216 lines
2.4 MiB
Vendored
216 lines
2.4 MiB
Vendored
/*!
|
||
* jQuery JavaScript Library v3.4.1
|
||
* https://jquery.com/
|
||
*
|
||
* Includes Sizzle.js
|
||
* https://sizzlejs.com/
|
||
*
|
||
* Copyright JS Foundation and other contributors
|
||
* Released under the MIT license
|
||
* https://jquery.org/license
|
||
*
|
||
* Date: 2019-05-01T21:04Z
|
||
*/
|
||
function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _possibleConstructorReturn(self,call){return!call||"object"!==_typeof(call)&&"function"!=typeof call?_assertThisInitialized(self):call}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}!function(global,factory){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,(function(window,noGlobal){"use strict";var arr=[],document=window.document,getProto=Object.getPrototypeOf,slice=arr.slice,concat=arr.concat,push=arr.push,indexOf=arr.indexOf,class2type={},toString=class2type.toString,hasOwn=class2type.hasOwnProperty,fnToString=hasOwn.toString,ObjectFunctionString=fnToString.call(Object),support={},isFunction=function isFunction(obj){return"function"==typeof obj&&"number"!=typeof obj.nodeType},isWindow=function isWindow(obj){return null!=obj&&obj===obj.window},preservedScriptAttributes={type:!0,src:!0,nonce:!0,noModule:!0};function DOMEval(code,node,doc){var i,val,script=(doc=doc||document).createElement("script");if(script.text=code,node)for(i in preservedScriptAttributes)(val=node[i]||node.getAttribute&&node.getAttribute(i))&&script.setAttribute(i,val);doc.head.appendChild(script).parentNode.removeChild(script)}function toType(obj){return null==obj?obj+"":"object"==typeof obj||"function"==typeof obj?class2type[toString.call(obj)]||"object":typeof obj}var version="3.4.1",jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=toType(obj);return!isFunction(obj)&&!isWindow(obj)&&("array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj)}jQuery.fn=jQuery.prototype={jquery:"3.4.1",constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){return null==num?slice.call(this):num<0?this[num+this.length]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret},each:function(callback){return jQuery.each(this,callback)},map:function(callback){return this.pushStack(jQuery.map(this,(function(elem,i){return callback.call(elem,i,elem)})))},slice:function(){return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[])},end:function(){return this.prevObject||this.constructor()},push:push,sort:arr.sort,splice:arr.splice},jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=!1;for("boolean"==typeof target&&(deep=target,target=arguments[i]||{},i++),"object"==typeof target||isFunction(target)||(target={}),i===length&&(target=this,i--);i<length;i++)if(null!=(options=arguments[i]))for(name in options)copy=options[name],"__proto__"!==name&&target!==copy&&(deep&©&&(jQuery.isPlainObject(copy)||(copyIsArray=Array.isArray(copy)))?(src=target[name],clone=copyIsArray&&!Array.isArray(src)?[]:copyIsArray||jQuery.isPlainObject(src)?src:{},copyIsArray=!1,target[name]=jQuery.extend(deep,clone,copy)):void 0!==copy&&(target[name]=copy));return target},jQuery.extend({expando:"jQuery"+("3.4.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(msg){throw new Error(msg)},noop:function(){},isPlainObject:function(obj){var proto,Ctor;return!(!obj||"[object Object]"!==toString.call(obj))&&(!(proto=getProto(obj))||"function"==typeof(Ctor=hasOwn.call(proto,"constructor")&&proto.constructor)&&fnToString.call(Ctor)===ObjectFunctionString)},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},globalEval:function(code,options){DOMEval(code,{nonce:options&&options.nonce})},each:function(obj,callback){var length,i=0;if(isArrayLike(obj))for(length=obj.length;i<length&&!1!==callback.call(obj[i],i,obj[i]);i++);else for(i in obj)if(!1===callback.call(obj[i],i,obj[i]))break;return obj},trim:function(text){return null==text?"":(text+"").replace(rtrim,"")},makeArray:function(arr,results){var ret=results||[];return null!=arr&&(isArrayLike(Object(arr))?jQuery.merge(ret,"string"==typeof arr?[arr]:arr):push.call(ret,arr)),ret},inArray:function(elem,arr,i){return null==arr?-1:indexOf.call(arr,elem,i)},merge:function(first,second){for(var len=+second.length,j=0,i=first.length;j<len;j++)first[i++]=second[j];return first.length=i,first},grep:function(elems,callback,invert){for(var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;i<length;i++)(callbackInverse=!callback(elems[i],i))!==callbackExpect&&matches.push(elems[i]);return matches},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems))for(length=elems.length;i<length;i++)null!=(value=callback(elems[i],i,arg))&&ret.push(value);else for(i in elems)null!=(value=callback(elems[i],i,arg))&&ret.push(value);return concat.apply([],ret)},guid:1,support:support}),"function"==typeof Symbol&&(jQuery.fn[Symbol.iterator]=arr[Symbol.iterator]),jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()}));var Sizzle=
|
||
/*!
|
||
* Sizzle CSS Selector Engine v2.3.4
|
||
* https://sizzlejs.com/
|
||
*
|
||
* Copyright JS Foundation and other contributors
|
||
* Released under the MIT license
|
||
* https://js.foundation/
|
||
*
|
||
* Date: 2019-04-08
|
||
*/
|
||
function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date,preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),nonnativeSelectorCache=createCache(),sortOrder=function(a,b){return a===b&&(hasDuplicate=!0),0},hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){for(var i=0,len=list.length;i<len;i++)if(list[i]===elem)return i;return-1},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",identifier="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]",pseudos=":("+identifier+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|.*)\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rdescend=new RegExp(whitespace+"|>"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp("^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rhtml=/HTML$/i,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-65536;return high!=high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){return asCodePoint?"\0"===ch?"<22>":ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ":"\\"+ch},unloadHandler=function(){setDocument()},inDisabledFieldset=addCombinator((function(elem){return!0===elem.disabled&&"fieldset"===elem.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes),arr[preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els))}:function(target,els){for(var j=target.length,i=0;target[j++]=els[i++];);target.length=j-1}}}function Sizzle(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;if(results=results||[],"string"!=typeof selector||!selector||1!==nodeType&&9!==nodeType&&11!==nodeType)return results;if(!seed&&((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,documentIsHTML)){if(11!==nodeType&&(match=rquickExpr.exec(selector)))if(m=match[1]){if(9===nodeType){if(!(elem=context.getElementById(m)))return results;if(elem.id===m)return results.push(elem),results}else if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,context.getElementsByTagName(selector)),results;if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName)return push.apply(results,context.getElementsByClassName(m)),results}if(support.qsa&&!nonnativeSelectorCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))&&(1!==nodeType||"object"!==context.nodeName.toLowerCase())){if(newSelector=selector,newContext=context,1===nodeType&&rdescend.test(selector)){for((nid=context.getAttribute("id"))?nid=nid.replace(rcssescape,fcssescape):context.setAttribute("id",nid=expando),i=(groups=tokenize(selector)).length;i--;)groups[i]="#"+nid+" "+toSelector(groups[i]);newSelector=groups.join(","),newContext=rsibling.test(selector)&&testContext(context.parentNode)||context}try{return push.apply(results,newContext.querySelectorAll(newSelector)),results}catch(qsaError){nonnativeSelectorCache(selector,!0)}finally{nid===expando&&context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){var keys=[];function cache(key,value){return keys.push(key+" ")>Expr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el)}catch(e){return!1}finally{el.parentNode&&el.parentNode.removeChild(el),el=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=arr.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name;return"input"===elem.nodeName.toLowerCase()&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createDisabledPseudo(disabled){return function(elem){return"form"in elem?elem.parentNode&&!1===elem.disabled?"label"in elem?"label"in elem.parentNode?elem.parentNode.disabled===disabled:elem.disabled===disabled:elem.isDisabled===disabled||elem.isDisabled!==!disabled&&inDisabledFieldset(elem)===disabled:elem.disabled===disabled:"label"in elem&&elem.disabled===disabled}}function createPositionalPseudo(fn){return markFunction((function(argument){return argument=+argument,markFunction((function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))}))}))}function testContext(context){return context&&void 0!==context.getElementsByTagName&&context}for(i in support=Sizzle.support={},isXML=Sizzle.isXML=function(elem){var namespace=elem.namespaceURI,docElem=(elem.ownerDocument||elem).documentElement;return!rhtml.test(namespace||docElem&&docElem.nodeName||"HTML")},setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(docElem=(document=doc).documentElement,documentIsHTML=!isXML(document),preferredDoc!==document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow&&(subWindow.addEventListener?subWindow.addEventListener("unload",unloadHandler,!1):subWindow.attachEvent&&subWindow.attachEvent("onunload",unloadHandler)),support.attributes=assert((function(el){return el.className="i",!el.getAttribute("className")})),support.getElementsByTagName=assert((function(el){return el.appendChild(document.createComment("")),!el.getElementsByTagName("*").length})),support.getElementsByClassName=rnative.test(document.getElementsByClassName),support.getById=assert((function(el){return docElem.appendChild(el).id=expando,!document.getElementsByName||!document.getElementsByName(expando).length})),support.getById?(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}},Expr.find.ID=function(id,context){if(void 0!==context.getElementById&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[]}}):(Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=void 0!==elem.getAttributeNode&&elem.getAttributeNode("id");return node&&node.value===attrId}},Expr.find.ID=function(id,context){if(void 0!==context.getElementById&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){if((node=elem.getAttributeNode("id"))&&node.value===id)return[elem];for(elems=context.getElementsByName(id),i=0;elem=elems[i++];)if((node=elem.getAttributeNode("id"))&&node.value===id)return[elem]}return[]}}),Expr.find.TAG=support.getElementsByTagName?function(tag,context){return void 0!==context.getElementsByTagName?context.getElementsByTagName(tag):support.qsa?context.querySelectorAll(tag):void 0}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.CLASS=support.getElementsByClassName&&function(className,context){if(void 0!==context.getElementsByClassName&&documentIsHTML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[],(support.qsa=rnative.test(document.querySelectorAll))&&(assert((function(el){docElem.appendChild(el).innerHTML="<a id='"+expando+"'></a><select id='"+expando+"-\r\\' msallowcapture=''><option selected=''></option></select>",el.querySelectorAll("[msallowcapture^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")"),el.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")"),el.querySelectorAll("[id~="+expando+"-]").length||rbuggyQSA.push("~="),el.querySelectorAll(":checked").length||rbuggyQSA.push(":checked"),el.querySelectorAll("a#"+expando+"+*").length||rbuggyQSA.push(".#.+[+~]")})),assert((function(el){el.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var input=document.createElement("input");input.setAttribute("type","hidden"),el.appendChild(input).setAttribute("name","D"),el.querySelectorAll("[name=d]").length&&rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?="),2!==el.querySelectorAll(":enabled").length&&rbuggyQSA.push(":enabled",":disabled"),docElem.appendChild(el).disabled=!0,2!==el.querySelectorAll(":disabled").length&&rbuggyQSA.push(":enabled",":disabled"),el.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")}))),(support.matchesSelector=rnative.test(matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert((function(el){support.disconnectedMatch=matches.call(el,"*"),matches.call(el,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)})),rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|")),rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|")),hasCompare=rnative.test(docElem.compareDocumentPosition),contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=hasCompare?function(a,b){if(a===b)return hasDuplicate=!0,0;var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;return compare||(1&(compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1)||!support.sortDetached&&b.compareDocumentPosition(a)===compare?a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)?-1:b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0:4&compare?-1:1)}:function(a,b){if(a===b)return hasDuplicate=!0,0;var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup)return a===document?-1:b===document?1:aup?-1:bup?1:sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),support.matchesSelector&&documentIsHTML&&!nonnativeSelectorCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr)))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){nonnativeSelectorCache(expr,!0)}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){(elem.ownerDocument||elem)!==document&&setDocument(elem);var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):void 0;return void 0!==val?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null},Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape)},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;if(hasDuplicate=!support.detectDuplicates,sortInput=!support.sortStable&&results.slice(0),results.sort(sortOrder),hasDuplicate){for(;elem=results[i++];)elem===results[i]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return sortInput=null,results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i++];)ret+=getText(node);return ret},(Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[6]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[3]?match[2]=match[4]||match[5]||"":unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return"*"===nodeNameSelector?function(){return!0}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,(function(elem){return pattern.test("string"==typeof elem.className&&elem.className||void 0!==elem.getAttribute&&elem.getAttribute("class")||"")}))},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=!1;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(diff=(nodeIndex=(cache=(uniqueCache=(outerCache=(node=parent)[expando]||(node[expando]={}))[node.uniqueID]||(outerCache[node.uniqueID]={}))[type]||[])[0]===dirruns&&cache[1])&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(diff=nodeIndex=(cache=(uniqueCache=(outerCache=(node=elem)[expando]||(node[expando]={}))[node.uniqueID]||(outerCache[node.uniqueID]={}))[type]||[])[0]===dirruns&&cache[1]),!1===diff)for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((uniqueCache=(outerCache=node[expando]||(node[expando]={}))[node.uniqueID]||(outerCache[node.uniqueID]={}))[type]=[dirruns,diff]),node!==elem)););return(diff-=last)===first||diff%first==0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction((function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)seed[idx=indexOf(seed,matched[i])]=!(matches[idx]=matched[i])})):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction((function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction((function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))})):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),input[0]=null,!results.pop()}})),has:markFunction((function(selector){return function(elem){return Sizzle(selector,elem).length>0}})),contains:markFunction((function(text){return text=text.replace(runescape,funescape),function(elem){return(elem.textContent||getText(elem)).indexOf(text)>-1}})),lang:markFunction((function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do{if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))return(elemLang=elemLang.toLowerCase())===lang||0===elemLang.indexOf(lang+"-")}while((elem=elem.parentNode)&&1===elem.nodeType);return!1}})),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:createDisabledPseudo(!1),disabled:createDisabledPseudo(!0),checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,!0===elem.selected},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeType<6)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||"text"===attr.toLowerCase())},first:createPositionalPseudo((function(){return[0]})),last:createPositionalPseudo((function(matchIndexes,length){return[length-1]})),eq:createPositionalPseudo((function(matchIndexes,length,argument){return[argument<0?argument+length:argument]})),even:createPositionalPseudo((function(matchIndexes,length){for(var i=0;i<length;i+=2)matchIndexes.push(i);return matchIndexes})),odd:createPositionalPseudo((function(matchIndexes,length){for(var i=1;i<length;i+=2)matchIndexes.push(i);return matchIndexes})),lt:createPositionalPseudo((function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument>length?length:argument;--i>=0;)matchIndexes.push(i);return matchIndexes})),gt:createPositionalPseudo((function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i<length;)matchIndexes.push(i);return matchIndexes}))}}).pseudos.nth=Expr.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Expr.pseudos[i]=createInputPseudo(i);for(i in{submit:!0,reset:!0})Expr.pseudos[i]=createButtonPseudo(i);function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i<len;i++)selector+=tokens[i].value;return selector}function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&"parentNode"===key,doneName=done++;return combinator.first?function(elem,context,xml){for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)return matcher(elem,context,xml);return!1}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){for(;elem=elem[dir];)if((1===elem.nodeType||checkNonElements)&&matcher(elem,context,xml))return!0}else for(;elem=elem[dir];)if(1===elem.nodeType||checkNonElements)if(uniqueCache=(outerCache=elem[expando]||(elem[expando]={}))[elem.uniqueID]||(outerCache[elem.uniqueID]={}),skip&&skip===elem.nodeName.toLowerCase())elem=elem[dir]||elem;else{if((oldCache=uniqueCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName)return newCache[2]=oldCache[2];if(uniqueCache[key]=newCache,newCache[2]=matcher(elem,context,xml))return!0}return!1}}function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i<len;i++)Sizzle(selector,contexts[i],results);return results}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i<len;i++)(elem=unmatched[i])&&(filter&&!filter(elem,context,xml)||(newUnmatched.push(elem),mapped&&map.push(i)));return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){return postFilter&&!postFilter[expando]&&(postFilter=setMatcher(postFilter)),postFinder&&!postFinder[expando]&&(postFinder=setMatcher(postFinder,postSelector)),markFunction((function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=!preFilter||!seed&&selector?elems:condense(elems,preMap,preFilter,context,xml),matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher&&matcher(matcherIn,matcherOut,context,xml),postFilter)for(temp=condense(matcherOut,postMap),postFilter(temp,[],context,xml),i=temp.length;i--;)(elem=temp[i])&&(matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem));if(seed){if(postFinder||preFilter){if(postFinder){for(temp=[],i=matcherOut.length;i--;)(elem=matcherOut[i])&&temp.push(matcherIn[i]=elem);postFinder(null,matcherOut=[],temp,xml)}for(i=matcherOut.length;i--;)(elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)}))}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator((function(elem){return elem===checkContext}),implicitRelative,!0),matchAnyContext=addCombinator((function(elem){return indexOf(checkContext,elem)>-1}),implicitRelative,!0),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));return checkContext=null,ret}];i<len;i++)if(matcher=Expr.relative[tokens[i].type])matchers=[addCombinator(elementMatcher(matchers),matcher)];else{if((matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches))[expando]){for(j=++i;j<len&&!Expr.relative[tokens[j].type];j++);return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:" "===tokens[i-2].type?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens(tokens=tokens.slice(j)),j<len&&toSelector(tokens))}matchers.push(matcher)}return elementMatcher(matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",outermost),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1,len=elems.length;for(outermost&&(outermostContext=context===document||context||outermost);i!==len&&null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0,context||elem.ownerDocument===document||(setDocument(elem),xml=!documentIsHTML);matcher=elementMatchers[j++];)if(matcher(elem,context||document,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}return setFilters.prototype=Expr.filters=Expr.pseudos,Expr.setFilters=new setFilters,tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){for(type in matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length)),Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)},compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){for(match||(match=tokenize(selector)),i=match.length;i--;)(cached=matcherFromTokens(match[i]))[expando]?setMatchers.push(cached):elementMatchers.push(cached);(cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers))).selector=selector}return cached},select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled="function"==typeof selector&&selector,match=!seed&&tokenize(selector=compiled.selector||selector);if(results=results||[],1===match.length){if((tokens=match[0]=match[0].slice(0)).length>2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&documentIsHTML&&Expr.relative[tokens[1].type]){if(!(context=(Expr.find.ID(token.matches[0].replace(runescape,funescape),context)||[])[0]))return results;compiled&&(context=context.parentNode),selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){if(tokens.splice(i,1),!(selector=seed.length&&toSelector(tokens)))return push.apply(results,seed),results;break}}return(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context),results},support.sortStable=expando.split("").sort(sortOrder).join("")===expando,support.detectDuplicates=!!hasDuplicate,setDocument(),support.sortDetached=assert((function(el){return 1&el.compareDocumentPosition(document.createElement("fieldset"))})),assert((function(el){return el.innerHTML="<a href='#'></a>","#"===el.firstChild.getAttribute("href")}))||addHandle("type|href|height|width",(function(elem,name,isXML){if(!isXML)return elem.getAttribute(name,"type"===name.toLowerCase()?1:2)})),support.attributes&&assert((function(el){return el.innerHTML="<input/>",el.firstChild.setAttribute("value",""),""===el.firstChild.getAttribute("value")}))||addHandle("value",(function(elem,name,isXML){if(!isXML&&"input"===elem.nodeName.toLowerCase())return elem.defaultValue})),assert((function(el){return null==el.getAttribute("disabled")}))||addHandle(booleans,(function(elem,name,isXML){var val;if(!isXML)return!0===elem[name]?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null})),Sizzle}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains,jQuery.escapeSelector=Sizzle.escape;var dir=function(elem,dir,until){for(var matched=[],truncate=void 0!==until;(elem=elem[dir])&&9!==elem.nodeType;)if(1===elem.nodeType){if(truncate&&jQuery(elem).is(until))break;matched.push(elem)}return matched},siblings=function(n,elem){for(var matched=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&matched.push(n);return matched},rneedsContext=jQuery.expr.match.needsContext;function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()}var rsingleTag=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function winnow(elements,qualifier,not){return isFunction(qualifier)?jQuery.grep(elements,(function(elem,i){return!!qualifier.call(elem,i,elem)!==not})):qualifier.nodeType?jQuery.grep(elements,(function(elem){return elem===qualifier!==not})):"string"!=typeof qualifier?jQuery.grep(elements,(function(elem){return indexOf.call(qualifier,elem)>-1!==not})):jQuery.filter(qualifier,elements,not)}jQuery.filter=function(expr,elems,not){var elem=elems[0];return not&&(expr=":not("+expr+")"),1===elems.length&&1===elem.nodeType?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,(function(elem){return 1===elem.nodeType})))},jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if("string"!=typeof selector)return this.pushStack(jQuery(selector).filter((function(){for(i=0;i<len;i++)if(jQuery.contains(self[i],this))return!0})));for(ret=this.pushStack([]),i=0;i<len;i++)jQuery.find(selector,self[i],ret);return len>1?jQuery.uniqueSort(ret):ret},filter:function(selector){return this.pushStack(winnow(this,selector||[],!1))},not:function(selector){return this.pushStack(winnow(this,selector||[],!0))},is:function(selector){return!!winnow(this,"string"==typeof selector&&rneedsContext.test(selector)?jQuery(selector):selector||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init;(jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector)return this;if(root=root||rootjQuery,"string"==typeof selector){if(!(match="<"===selector[0]&&">"===selector[selector.length-1]&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector))||!match[1]&&context)return!context||context.jquery?(context||root).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}return(elem=document.getElementById(match[2]))&&(this[0]=elem,this.length=1),this}return selector.nodeType?(this[0]=selector,this.length=1,this):isFunction(selector)?void 0!==root.ready?root.ready(selector):selector(jQuery):jQuery.makeArray(selector,this)}).prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};function sibling(cur,dir){for(;(cur=cur[dir])&&1!==cur.nodeType;);return cur}jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter((function(){for(var i=0;i<l;i++)if(jQuery.contains(this,targets[i]))return!0}))},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets="string"!=typeof selectors&&jQuery(selectors);if(!rneedsContext.test(selectors))for(;i<l;i++)for(cur=this[i];cur&&cur!==context;cur=cur.parentNode)if(cur.nodeType<11&&(targets?targets.index(cur)>-1:1===cur.nodeType&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break}return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched)},index:function(elem){return elem?"string"==typeof elem?indexOf.call(jQuery(elem),this[0]):indexOf.call(this,elem.jquery?elem[0]:elem):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return dir(elem,"nextSibling")},prevAll:function(elem){return dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return dir(elem,"previousSibling",until)},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem)},children:function(elem){return siblings(elem.firstChild)},contents:function(elem){return void 0!==elem.contentDocument?elem.contentDocument:(nodeName(elem,"template")&&(elem=elem.content||elem),jQuery.merge([],elem.childNodes))}},(function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);return"Until"!==name.slice(-5)&&(selector=until),selector&&"string"==typeof selector&&(matched=jQuery.filter(selector,matched)),this.length>1&&(guaranteedUnique[name]||jQuery.uniqueSort(matched),rparentsprev.test(name)&&matched.reverse()),this.pushStack(matched)}}));var rnothtmlwhite=/[^\x20\t\r\n\f]+/g;function createOptions(options){var object={};return jQuery.each(options.match(rnothtmlwhite)||[],(function(_,flag){object[flag]=!0})),object}function Identity(v){return v}function Thrower(ex){throw ex}function adoptValue(value,resolve,reject,noValue){var method;try{value&&isFunction(method=value.promise)?method.call(value).done(resolve).fail(reject):value&&isFunction(method=value.then)?method.call(value,resolve,reject):resolve.apply(void 0,[value].slice(noValue))}catch(value){reject.apply(void 0,[value])}}jQuery.Callbacks=function(options){options="string"==typeof options?createOptions(options):jQuery.extend({},options);var firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){for(locked=locked||options.once,fired=firing=!0;queue.length;firingIndex=-1)for(memory=queue.shift();++firingIndex<list.length;)!1===list[firingIndex].apply(memory[0],memory[1])&&options.stopOnFalse&&(firingIndex=list.length,memory=!1);options.memory||(memory=!1),firing=!1,locked&&(list=memory?[]:"")},self={add:function(){return list&&(memory&&!firing&&(firingIndex=list.length-1,queue.push(memory)),function add(args){jQuery.each(args,(function(_,arg){isFunction(arg)?options.unique&&self.has(arg)||list.push(arg):arg&&arg.length&&"string"!==toType(arg)&&add(arg)}))}(arguments),memory&&!firing&&fire()),this},remove:function(){return jQuery.each(arguments,(function(_,arg){for(var index;(index=jQuery.inArray(arg,list,index))>-1;)list.splice(index,1),index<=firingIndex&&firingIndex--})),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0},empty:function(){return list&&(list=[]),this},disable:function(){return locked=queue=[],list=memory="",this},disabled:function(){return!list},lock:function(){return locked=queue=[],memory||firing||(list=memory=""),this},locked:function(){return!!locked},fireWith:function(context,args){return locked||(args=[context,(args=args||[]).slice?args.slice():args],queue.push(args),firing||fire()),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},catch:function(fn){return promise.then(null,fn)},pipe:function(){var fns=arguments;return jQuery.Deferred((function(newDefer){jQuery.each(tuples,(function(i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]]((function(){var returned=fn&&fn.apply(this,arguments);returned&&isFunction(returned.promise)?returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject):newDefer[tuple[0]+"With"](this,fn?[returned]:arguments)}))})),fns=null})).promise()},then:function(onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(!(depth<maxDepth)){if((returned=handler.apply(that,args))===deferred.promise())throw new TypeError("Thenable self-resolution");then=returned&&("object"==typeof returned||"function"==typeof returned)&&returned.then,isFunction(then)?special?then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special)):(maxDepth++,then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith))):(handler!==Identity&&(that=void 0,args=[returned]),(special||deferred.resolveWith)(that,args))}},process=special?mightThrow:function(){try{mightThrow()}catch(e){jQuery.Deferred.exceptionHook&&jQuery.Deferred.exceptionHook(e,process.stackTrace),depth+1>=maxDepth&&(handler!==Thrower&&(that=void 0,args=[e]),deferred.rejectWith(that,args))}};depth?process():(jQuery.Deferred.getStackHook&&(process.stackTrace=jQuery.Deferred.getStackHook()),window.setTimeout(process))}}return jQuery.Deferred((function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith)),tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity)),tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower))})).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return jQuery.each(tuples,(function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add,stateString&&list.add((function(){state=stateString}),tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock),list.add(tuple[3].fire),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?void 0:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith})),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(singleValue){var remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this,resolveValues[i]=arguments.length>1?slice.call(arguments):value,--remaining||master.resolveWith(resolveContexts,resolveValues)}};if(remaining<=1&&(adoptValue(singleValue,master.done(updateFunc(i)).resolve,master.reject,!remaining),"pending"===master.state()||isFunction(resolveValues[i]&&resolveValues[i].then)))return master.then();for(;i--;)adoptValue(resolveValues[i],updateFunc(i),master.reject);return master.promise()}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){window.console&&window.console.warn&&error&&rerrorNames.test(error.name)&&window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack)},jQuery.readyException=function(error){window.setTimeout((function(){throw error}))};var readyList=jQuery.Deferred();function completed(){document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed),jQuery.ready()}jQuery.fn.ready=function(fn){return readyList.then(fn).catch((function(error){jQuery.readyException(error)})),this},jQuery.extend({isReady:!1,readyWait:1,ready:function(wait){(!0===wait?--jQuery.readyWait:jQuery.isReady)||(jQuery.isReady=!0,!0!==wait&&--jQuery.readyWait>0||readyList.resolveWith(document,[jQuery]))}}),jQuery.ready.then=readyList.then,"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed),window.addEventListener("load",completed));var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=null==key;if("object"===toType(key))for(i in chainable=!0,key)access(elems,fn,i,key[i],!0,emptyGet,raw);else if(void 0!==value&&(chainable=!0,isFunction(value)||(raw=!0),bulk&&(raw?(fn.call(elems,value),fn=null):(bulk=fn,fn=function(elem,key,value){return bulk.call(jQuery(elem),value)})),fn))for(;i<len;i++)fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));return chainable?elems:bulk?fn.call(elems):len?fn(elems[0],key):emptyGet},rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g;function fcamelCase(all,letter){return letter.toUpperCase()}function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)}var acceptData=function(owner){return 1===owner.nodeType||9===owner.nodeType||!+owner.nodeType};function Data(){this.expando=jQuery.expando+Data.uid++}Data.uid=1,Data.prototype={cache:function(owner){var value=owner[this.expando];return value||(value={},acceptData(owner)&&(owner.nodeType?owner[this.expando]=value:Object.defineProperty(owner,this.expando,{value:value,configurable:!0}))),value},set:function(owner,data,value){var prop,cache=this.cache(owner);if("string"==typeof data)cache[camelCase(data)]=value;else for(prop in data)cache[camelCase(prop)]=data[prop];return cache},get:function(owner,key){return void 0===key?this.cache(owner):owner[this.expando]&&owner[this.expando][camelCase(key)]},access:function(owner,key,value){return void 0===key||key&&"string"==typeof key&&void 0===value?this.get(owner,key):(this.set(owner,key,value),void 0!==value?value:key)},remove:function(owner,key){var i,cache=owner[this.expando];if(void 0!==cache){if(void 0!==key){i=(key=Array.isArray(key)?key.map(camelCase):(key=camelCase(key))in cache?[key]:key.match(rnothtmlwhite)||[]).length;for(;i--;)delete cache[key[i]]}(void 0===key||jQuery.isEmptyObject(cache))&&(owner.nodeType?owner[this.expando]=void 0:delete owner[this.expando])}},hasData:function(owner){var cache=owner[this.expando];return void 0!==cache&&!jQuery.isEmptyObject(cache)}};var dataPriv=new Data,dataUser=new Data,rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;function getData(data){return"true"===data||"false"!==data&&("null"===data?null:data===+data+""?+data:rbrace.test(data)?JSON.parse(data):data)}function dataAttr(elem,key,data){var name;if(void 0===data&&1===elem.nodeType)if(name="data-"+key.replace(rmultiDash,"-$&").toLowerCase(),"string"==typeof(data=elem.getAttribute(name))){try{data=getData(data)}catch(e){}dataUser.set(elem,key,data)}else data=void 0;return data}jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem)},data:function(elem,name,data){return dataUser.access(elem,name,data)},removeData:function(elem,name){dataUser.remove(elem,name)},_data:function(elem,name,data){return dataPriv.access(elem,name,data)},_removeData:function(elem,name){dataPriv.remove(elem,name)}}),jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(void 0===key){if(this.length&&(data=dataUser.get(elem),1===elem.nodeType&&!dataPriv.get(elem,"hasDataAttrs"))){for(i=attrs.length;i--;)attrs[i]&&0===(name=attrs[i].name).indexOf("data-")&&(name=camelCase(name.slice(5)),dataAttr(elem,name,data[name]));dataPriv.set(elem,"hasDataAttrs",!0)}return data}return"object"==typeof key?this.each((function(){dataUser.set(this,key)})):access(this,(function(value){var data;if(elem&&void 0===value)return void 0!==(data=dataUser.get(elem,key))?data:void 0!==(data=dataAttr(elem,key))?data:void 0;this.each((function(){dataUser.set(this,key,value)}))}),null,value,arguments.length>1,null,!0)},removeData:function(key){return this.each((function(){dataUser.remove(this,key)}))}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=dataPriv.get(elem,type),data&&(!queue||Array.isArray(data)?queue=dataPriv.access(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add((function(){dataPriv.remove(elem,[type+"queue",key])}))})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length<setter?jQuery.queue(this[0],type):void 0===data?this:this.each((function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type),"fx"===type&&"inprogress"!==queue[0]&&jQuery.dequeue(this,type)}))},dequeue:function(type){return this.each((function(){jQuery.dequeue(this,type)}))},clearQueue:function(type){return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){--count||defer.resolveWith(elements,[elements])};for("string"!=typeof type&&(obj=type,type=void 0),type=type||"fx";i--;)(tmp=dataPriv.get(elements[i],type+"queueHooks"))&&tmp.empty&&(count++,tmp.empty.add(resolve));return resolve(),defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i"),cssExpand=["Top","Right","Bottom","Left"],documentElement=document.documentElement,isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)},composed={composed:!0};documentElement.getRootNode&&(isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)||elem.getRootNode(composed)===elem.ownerDocument});var isHiddenWithinTree=function(elem,el){return"none"===(elem=el||elem).style.display||""===elem.style.display&&isAttached(elem)&&"none"===jQuery.css(elem,"display")},swap=function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];for(name in ret=callback.apply(elem,args||[]),options)elem.style[name]=old[name];return ret};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,maxIterations=20,currentValue=tween?function(){return tween.cur()}:function(){return jQuery.css(elem,prop,"")},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=elem.nodeType&&(jQuery.cssNumber[prop]||"px"!==unit&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){for(initial/=2,unit=unit||initialInUnit[3],initialInUnit=+initial||1;maxIterations--;)jQuery.style(elem,prop,initialInUnit+unit),(1-scale)*(1-(scale=currentValue()/initial||.5))<=0&&(maxIterations=0),initialInUnit/=scale;initialInUnit*=2,jQuery.style(elem,prop,initialInUnit+unit),valueParts=valueParts||[]}return valueParts&&(initialInUnit=+initialInUnit||+initial||0,adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2],tween&&(tween.unit=unit,tween.start=initialInUnit,tween.end=adjusted)),adjusted}var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];return display||(temp=doc.body.appendChild(doc.createElement(nodeName)),display=jQuery.css(temp,"display"),temp.parentNode.removeChild(temp),"none"===display&&(display="block"),defaultDisplayMap[nodeName]=display,display)}function showHide(elements,show){for(var display,elem,values=[],index=0,length=elements.length;index<length;index++)(elem=elements[index]).style&&(display=elem.style.display,show?("none"===display&&(values[index]=dataPriv.get(elem,"display")||null,values[index]||(elem.style.display="")),""===elem.style.display&&isHiddenWithinTree(elem)&&(values[index]=getDefaultDisplay(elem))):"none"!==display&&(values[index]="none",dataPriv.set(elem,"display",display)));for(index=0;index<length;index++)null!=values[index]&&(elements[index].style.display=values[index]);return elements}jQuery.fn.extend({show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){return"boolean"==typeof state?state?this.show():this.hide():this.each((function(){isHiddenWithinTree(this)?jQuery(this).show():jQuery(this).hide()}))}});var rcheckableType=/^(?:checkbox|radio)$/i,rtagName=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,rscriptType=/^$|^module$|\/(?:java|ecma)script/i,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function getAll(context,tag){var ret;return ret=void 0!==context.getElementsByTagName?context.getElementsByTagName(tag||"*"):void 0!==context.querySelectorAll?context.querySelectorAll(tag||"*"):[],void 0===tag||tag&&nodeName(context,tag)?jQuery.merge([context],ret):ret}function setGlobalEval(elems,refElements){for(var i=0,l=elems.length;i<l;i++)dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"))}wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td;var rhtml=/<|&#?\w+;/,fragment,div,input;function buildFragment(elems,context,scripts,selection,ignored){for(var elem,tmp,tag,wrap,attached,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;i<l;i++)if((elem=elems[i])||0===elem)if("object"===toType(elem))jQuery.merge(nodes,elem.nodeType?[elem]:elem);else if(rhtml.test(elem)){for(tmp=tmp||fragment.appendChild(context.createElement("div")),tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;jQuery.merge(nodes,tmp.childNodes),(tmp=fragment.firstChild).textContent=""}else nodes.push(context.createTextNode(elem));for(fragment.textContent="",i=0;elem=nodes[i++];)if(selection&&jQuery.inArray(elem,selection)>-1)ignored&&ignored.push(elem);else if(attached=isAttached(elem),tmp=getAll(fragment.appendChild(elem),"script"),attached&&setGlobalEval(tmp),scripts)for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return fragment}div=document.createDocumentFragment().appendChild(document.createElement("div")),(input=document.createElement("input")).setAttribute("type","radio"),input.setAttribute("checked","checked"),input.setAttribute("name","t"),div.appendChild(input),support.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked,div.innerHTML="<textarea>x</textarea>",support.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue;var rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return!0}function returnFalse(){return!1}function expectSync(elem,type){return elem===safeActiveElement()==("focus"===type)}function safeActiveElement(){try{return document.activeElement}catch(err){}}function on(elem,types,selector,data,fn,one){var origFn,type;if("object"==typeof types){for(type in"string"!=typeof selector&&(data=data||selector,selector=void 0),types)on(elem,type,selector,data,types[type],one);return elem}if(null==data&&null==fn?(fn=selector,data=selector=void 0):null==fn&&("string"==typeof selector?(fn=data,data=void 0):(fn=data,data=selector,selector=void 0)),!1===fn)fn=returnFalse;else if(!fn)return elem;return 1===one&&(origFn=fn,(fn=function(event){return jQuery().off(event),origFn.apply(this,arguments)}).guid=origFn.guid||(origFn.guid=jQuery.guid++)),elem.each((function(){jQuery.event.add(this,types,fn,data,selector)}))}function leverageNative(el,type,expectSync){expectSync?(dataPriv.set(el,type,!1),jQuery.event.add(el,type,{namespace:!1,handler:function(event){var notAsync,result,saved=dataPriv.get(this,type);if(1&event.isTrigger&&this[type]){if(saved.length)(jQuery.event.special[type]||{}).delegateType&&event.stopPropagation();else if(saved=slice.call(arguments),dataPriv.set(this,type,saved),notAsync=expectSync(this,type),this[type](),saved!==(result=dataPriv.get(this,type))||notAsync?dataPriv.set(this,type,!1):result={},saved!==result)return event.stopImmediatePropagation(),event.preventDefault(),result.value}else saved.length&&(dataPriv.set(this,type,{value:jQuery.event.trigger(jQuery.extend(saved[0],jQuery.Event.prototype),saved.slice(1),this)}),event.stopImmediatePropagation())}})):void 0===dataPriv.get(el,type)&&jQuery.event.add(el,type,returnTrue)}jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(elemData)for(handler.handler&&(handler=(handleObjIn=handler).handler,selector=handleObjIn.selector),selector&&jQuery.find.matchesSelector(documentElement,selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return void 0!==jQuery&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):void 0}),t=(types=(types||"").match(rnothtmlwhite)||[""]).length;t--;)type=origType=(tmp=rtypenamespace.exec(types[t])||[])[1],namespaces=(tmp[2]||"").split(".").sort(),type&&(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||((handlers=events[type]=[]).delegateCount=0,special.setup&&!1!==special.setup.call(elem,data,namespaces,eventHandle)||elem.addEventListener&&elem.addEventListener(type,eventHandle)),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0)},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(elemData&&(events=elemData.events)){for(t=(types=(types||"").match(rnothtmlwhite)||[""]).length;t--;)if(type=origType=(tmp=rtypenamespace.exec(types[t])||[])[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},handlers=events[type=(selector?special.delegateType:special.bindType)||type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&!1!==special.teardown.call(elem,namespaces,elemData.handle)||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&dataPriv.remove(elem,"handle events")}},dispatch:function(nativeEvent){var event=jQuery.event.fix(nativeEvent),i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};for(args[0]=event,i=1;i<arguments.length;i++)args[i]=arguments[i];if(event.delegateTarget=this,!special.preDispatch||!1!==special.preDispatch.call(this,event)){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)event.rnamespace&&!1!==handleObj.namespace&&!event.rnamespace.test(handleObj.namespace)||(event.handleObj=handleObj,event.data=handleObj.data,void 0!==(ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args))&&!1===(event.result=ret)&&(event.preventDefault(),event.stopPropagation()));return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var i,handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&!("click"===event.type&&event.button>=1))for(;cur!==this;cur=cur.parentNode||this)if(1===cur.nodeType&&("click"!==event.type||!0!==cur.disabled)){for(matchedHandlers=[],matchedSelectors={},i=0;i<delegateCount;i++)void 0===matchedSelectors[sel=(handleObj=handlers[i]).selector+" "]&&(matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length),matchedSelectors[sel]&&matchedHandlers.push(handleObj);matchedHandlers.length&&handlerQueue.push({elem:cur,handlers:matchedHandlers})}return cur=this,delegateCount<handlers.length&&handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)}),handlerQueue},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:!0,configurable:!0,get:isFunction(hook)?function(){if(this.originalEvent)return hook(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[name]},set:function(value){Object.defineProperty(this,name,{enumerable:!0,configurable:!0,writable:!0,value:value})}})},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent)},special:{load:{noBubble:!0},click:{setup:function(data){var el=this||data;return rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")&&leverageNative(el,"click",returnTrue),!1},trigger:function(data){var el=this||data;return rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")&&leverageNative(el,"click"),!0},_default:function(event){var target=event.target;return rcheckableType.test(target.type)&&target.click&&nodeName(target,"input")&&dataPriv.get(target,"click")||nodeName(target,"a")}},beforeunload:{postDispatch:function(event){void 0!==event.result&&event.originalEvent&&(event.originalEvent.returnValue=event.result)}}}},jQuery.removeEvent=function(elem,type,handle){elem.removeEventListener&&elem.removeEventListener(type,handle)},jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event))return new jQuery.Event(src,props);src&&src.type?(this.originalEvent=src,this.type=src.type,this.isDefaultPrevented=src.defaultPrevented||void 0===src.defaultPrevented&&!1===src.returnValue?returnTrue:returnFalse,this.target=src.target&&3===src.target.nodeType?src.target.parentNode:src.target,this.currentTarget=src.currentTarget,this.relatedTarget=src.relatedTarget):this.type=src,props&&jQuery.extend(this,props),this.timeStamp=src&&src.timeStamp||Date.now(),this[jQuery.expando]=!0},jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},jQuery.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(event){var button=event.button;return null==event.which&&rkeyEvent.test(event.type)?null!=event.charCode?event.charCode:event.keyCode:!event.which&&void 0!==button&&rmouseEvent.test(event.type)?1&button?1:2&button?3:4&button?2:0:event.which}},jQuery.event.addProp),jQuery.each({focus:"focusin",blur:"focusout"},(function(type,delegateType){jQuery.event.special[type]={setup:function(){return leverageNative(this,type,expectSync),!1},trigger:function(){return leverageNative(this,type),!0},delegateType:delegateType}})),jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;return related&&(related===target||jQuery.contains(target,related))||(event.type=handleObj.origType,ret=handleObj.handler.apply(this,arguments),event.type=fix),ret}}})),jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn)},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1)},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj)return handleObj=types.handleObj,jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler),this;if("object"==typeof types){for(type in types)this.off(type,selector,types[type]);return this}return!1!==selector&&"function"!=typeof selector||(fn=selector,selector=void 0),!1===fn&&(fn=returnFalse),this.each((function(){jQuery.event.remove(this,types,fn,selector)}))}});var rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function manipulationTarget(elem,content){return nodeName(elem,"table")&&nodeName(11!==content.nodeType?content:content.firstChild,"tr")&&jQuery(elem).children("tbody")[0]||elem}function disableScript(elem){return elem.type=(null!==elem.getAttribute("type"))+"/"+elem.type,elem}function restoreScript(elem){return"true/"===(elem.type||"").slice(0,5)?elem.type=elem.type.slice(5):elem.removeAttribute("type"),elem}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(1===dest.nodeType){if(dataPriv.hasData(src)&&(pdataOld=dataPriv.access(src),pdataCur=dataPriv.set(dest,pdataOld),events=pdataOld.events))for(type in delete pdataCur.handle,pdataCur.events={},events)for(i=0,l=events[type].length;i<l;i++)jQuery.event.add(dest,type,events[type][i]);dataUser.hasData(src)&&(udataOld=dataUser.access(src),udataCur=jQuery.extend({},udataOld),dataUser.set(dest,udataCur))}}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();"input"===nodeName&&rcheckableType.test(src.type)?dest.checked=src.checked:"input"!==nodeName&&"textarea"!==nodeName||(dest.defaultValue=src.defaultValue)}function domManip(collection,args,callback,ignored){args=concat.apply([],args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],valueIsFunction=isFunction(value);if(valueIsFunction||l>1&&"string"==typeof value&&!support.checkClone&&rchecked.test(value))return collection.each((function(index){var self=collection.eq(index);valueIsFunction&&(args[0]=value.call(this,index,self.html())),domManip(self,args,callback,ignored)}));if(l&&(first=(fragment=buildFragment(args,collection[0].ownerDocument,!1,collection,ignored)).firstChild,1===fragment.childNodes.length&&(fragment=first),first||ignored)){for(hasScripts=(scripts=jQuery.map(getAll(fragment,"script"),disableScript)).length;i<l;i++)node=fragment,i!==iNoClone&&(node=jQuery.clone(node,!0,!0),hasScripts&&jQuery.merge(scripts,getAll(node,"script"))),callback.call(collection[i],node,i);if(hasScripts)for(doc=scripts[scripts.length-1].ownerDocument,jQuery.map(scripts,restoreScript),i=0;i<hasScripts;i++)node=scripts[i],rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)&&(node.src&&"module"!==(node.type||"").toLowerCase()?jQuery._evalUrl&&!node.noModule&&jQuery._evalUrl(node.src,{nonce:node.nonce||node.getAttribute("nonce")}):DOMEval(node.textContent.replace(rcleanScript,""),node,doc))}return collection}function remove(elem,selector,keepData){for(var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;null!=(node=nodes[i]);i++)keepData||1!==node.nodeType||jQuery.cleanData(getAll(node)),node.parentNode&&(keepData&&isAttached(node)&&setGlobalEval(getAll(node,"script")),node.parentNode.removeChild(node));return elem}jQuery.extend({htmlPrefilter:function(html){return html.replace(rxhtmlTag,"<$1></$2>")},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(!0),inPage=isAttached(elem);if(!(support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),i=0,l=(srcElements=getAll(elem)).length;i<l;i++)fixInput(srcElements[i],destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0,l=srcElements.length;i<l;i++)cloneCopyEvent(srcElements[i],destElements[i]);else cloneCopyEvent(elem,clone);return(destElements=getAll(clone,"script")).length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),clone},cleanData:function(elems){for(var data,elem,type,special=jQuery.event.special,i=0;void 0!==(elem=elems[i]);i++)if(acceptData(elem)){if(data=elem[dataPriv.expando]){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);elem[dataPriv.expando]=void 0}elem[dataUser.expando]&&(elem[dataUser.expando]=void 0)}}}),jQuery.fn.extend({detach:function(selector){return remove(this,selector,!0)},remove:function(selector){return remove(this,selector)},text:function(value){return access(this,(function(value){return void 0===value?jQuery.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=value)}))}),null,value,arguments.length)},append:function(){return domManip(this,arguments,(function(elem){var target;1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||manipulationTarget(this,elem).appendChild(elem)}))},prepend:function(){return domManip(this,arguments,(function(elem){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild)}}))},before:function(){return domManip(this,arguments,(function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)}))},after:function(){return domManip(this,arguments,(function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)}))},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++)1===elem.nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.textContent="");return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map((function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)}))},html:function(value){return access(this,(function(value){var elem=this[0]||{},i=0,l=this.length;if(void 0===value&&1===elem.nodeType)return elem.innerHTML;if("string"==typeof value&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++)1===(elem=this[i]||{}).nodeType&&(jQuery.cleanData(getAll(elem,!1)),elem.innerHTML=value);elem=0}catch(e){}}elem&&this.empty().append(value)}),null,value,arguments.length)},replaceWith:function(){var ignored=[];return domManip(this,arguments,(function(elem){var parent=this.parentNode;jQuery.inArray(this,ignored)<0&&(jQuery.cleanData(getAll(this)),parent&&parent.replaceChild(elem,this))}),ignored)}}),jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(name,original){jQuery.fn[name]=function(selector){for(var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;i<=last;i++)elems=i===last?this:this.clone(!0),jQuery(insert[i])[original](elems),push.apply(ret,elems.get());return this.pushStack(ret)}}));var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i"),getStyles=function(elem){var view=elem.ownerDocument.defaultView;return view&&view.opener||(view=window),view.getComputedStyle(elem)},rboxStyle=new RegExp(cssExpand.join("|"),"i");function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;return(computed=computed||getStyles(elem))&&(""!==(ret=computed.getPropertyValue(name)||computed[name])||isAttached(elem)||(ret=jQuery.style(elem,name)),!support.pixelBoxStyles()&&rnumnonpx.test(ret)&&rboxStyle.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),void 0!==ret?ret+"":ret}function addGetHookIf(conditionFn,hookFn){return{get:function(){if(!conditionFn())return(this.get=hookFn).apply(this,arguments);delete this.get}}}!function(){function computeStyleTests(){if(div){container.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);pixelPositionVal="1%"!==divStyle.top,reliableMarginLeftVal=12===roundPixelMeasures(divStyle.marginLeft),div.style.right="60%",pixelBoxStylesVal=36===roundPixelMeasures(divStyle.right),boxSizingReliableVal=36===roundPixelMeasures(divStyle.width),div.style.position="absolute",scrollboxSizeVal=12===roundPixelMeasures(div.offsetWidth/3),documentElement.removeChild(container),div=null}}function roundPixelMeasures(measure){return Math.round(parseFloat(measure))}var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");div.style&&(div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,jQuery.extend(support,{boxSizingReliable:function(){return computeStyleTests(),boxSizingReliableVal},pixelBoxStyles:function(){return computeStyleTests(),pixelBoxStylesVal},pixelPosition:function(){return computeStyleTests(),pixelPositionVal},reliableMarginLeft:function(){return computeStyleTests(),reliableMarginLeftVal},scrollboxSize:function(){return computeStyleTests(),scrollboxSizeVal}}))}();var cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style,vendorProps={};function vendorPropName(name){for(var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;i--;)if((name=cssPrefixes[i]+capName)in emptyStyle)return name}function finalPropName(name){var final=jQuery.cssProps[name]||vendorProps[name];return final||(name in emptyStyle?name:vendorProps[name]=vendorPropName(name)||name)}var rdisplayswap=/^(none|table(?!-c[ea]).+)/,rcustomProp=/^--/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"};function setPositiveNumber(elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value}function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i="width"===dimension?1:0,extra=0,delta=0;if(box===(isBorderBox?"border":"content"))return 0;for(;i<4;i+=2)"margin"===box&&(delta+=jQuery.css(elem,box+cssExpand[i],!0,styles)),isBorderBox?("content"===box&&(delta-=jQuery.css(elem,"padding"+cssExpand[i],!0,styles)),"margin"!==box&&(delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles))):(delta+=jQuery.css(elem,"padding"+cssExpand[i],!0,styles),"padding"!==box?delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles):extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",!0,styles));return!isBorderBox&&computedVal>=0&&(delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-computedVal-delta-extra-.5))||0),delta}function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),boxSizingNeeded,isBorderBox=(!support.boxSizingReliable()||extra)&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),valueIsBorderBox=isBorderBox,val=curCSS(elem,dimension,styles),offsetProp="offset"+dimension[0].toUpperCase()+dimension.slice(1);if(rnumnonpx.test(val)){if(!extra)return val;val="auto"}return(!support.boxSizingReliable()&&isBorderBox||"auto"===val||!parseFloat(val)&&"inline"===jQuery.css(elem,"display",!1,styles))&&elem.getClientRects().length&&(isBorderBox="border-box"===jQuery.css(elem,"boxSizing",!1,styles),(valueIsBorderBox=offsetProp in elem)&&(val=elem[offsetProp])),(val=parseFloat(val)||0)+boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val)+"px"}function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing)}jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(isCustomProp||(name=finalPropName(origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],void 0===value)return hooks&&"get"in hooks&&void 0!==(ret=hooks.get(elem,!1,extra))?ret:style[name];"string"===(type=typeof value)&&(ret=rcssNum.exec(value))&&ret[1]&&(value=adjustCSS(elem,name,ret),type="number"),null!=value&&value==value&&("number"!==type||isCustomProp||(value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px")),support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&void 0===(value=hooks.set(elem,value,extra))||(isCustomProp?style.setProperty(name,value):style[name]=value))}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name),isCustomProp;return rcustomProp.test(name)||(name=finalPropName(origName)),(hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName])&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),void 0===val&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),!0===extra||isFinite(num)?num||0:val):val}}),jQuery.each(["height","width"],(function(i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,extra){if(computed)return!rdisplayswap.test(jQuery.css(elem,"display"))||elem.getClientRects().length&&elem.getBoundingClientRect().width?getWidthOrHeight(elem,dimension,extra):swap(elem,cssShow,(function(){return getWidthOrHeight(elem,dimension,extra)}))},set:function(elem,value,extra){var matches,styles=getStyles(elem),scrollboxSizeBuggy=!support.scrollboxSize()&&"absolute"===styles.position,boxSizingNeeded,isBorderBox=(scrollboxSizeBuggy||extra)&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),subtract=extra?boxModelAdjustment(elem,dimension,extra,isBorderBox,styles):0;return isBorderBox&&scrollboxSizeBuggy&&(subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-parseFloat(styles[dimension])-boxModelAdjustment(elem,dimension,"border",!1,styles)-.5)),subtract&&(matches=rcssNum.exec(value))&&"px"!==(matches[3]||"px")&&(elem.style[dimension]=value,value=jQuery.css(elem,dimension)),setPositiveNumber(elem,value,subtract)}}})),jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,(function(elem,computed){if(computed)return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-swap(elem,{marginLeft:0},(function(){return elem.getBoundingClientRect().left})))+"px"})),jQuery.each({margin:"",padding:"",border:"Width"},(function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},"margin"!==prefix&&(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)})),jQuery.fn.extend({css:function(name,value){return access(this,(function(elem,name,value){var styles,len,map={},i=0;if(Array.isArray(name)){for(styles=getStyles(elem),len=name.length;i<len;i++)map[name[i]]=jQuery.css(elem,name[i],!1,styles);return map}return void 0!==value?jQuery.style(elem,name,value):jQuery.css(elem,name)}),name,value,arguments.length>1)}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem,this.prop=prop,this.easing=easing||jQuery.easing._default,this.options=options,this.start=this.now=this.cur(),this.end=end,this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];return this.options.duration?this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration):this.pos=eased=percent,this.now=(this.end-this.start)*eased+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),hooks&&hooks.set?hooks.set(this):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(tween){var result;return 1!==tween.elem.nodeType||null!=tween.elem[tween.prop]&&null==tween.elem.style[tween.prop]?tween.elem[tween.prop]:(result=jQuery.css(tween.elem,tween.prop,""))&&"auto"!==result?result:0},set:function(tween){jQuery.fx.step[tween.prop]?jQuery.fx.step[tween.prop](tween):1!==tween.elem.nodeType||!jQuery.cssHooks[tween.prop]&&null==tween.elem.style[finalPropName(tween.prop)]?tween.elem[tween.prop]=tween.now:jQuery.style(tween.elem,tween.prop,tween.now+tween.unit)}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){tween.elem.nodeType&&tween.elem.parentNode&&(tween.elem[tween.prop]=tween.now)}},jQuery.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2},_default:"swing"},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){inProgress&&(!1===document.hidden&&window.requestAnimationFrame?window.requestAnimationFrame(schedule):window.setTimeout(schedule,jQuery.fx.interval),jQuery.fx.tick())}function createFxNow(){return window.setTimeout((function(){fxNow=void 0})),fxNow=Date.now()}function genFx(type,includeWidth){var which,i=0,attrs={height:type};for(includeWidth=includeWidth?1:0;i<4;i+=2-includeWidth)attrs["margin"+(which=cssExpand[i])]=attrs["padding"+which]=type;return includeWidth&&(attrs.opacity=attrs.width=type),attrs}function createTween(value,prop,animation){for(var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;index<length;index++)if(tween=collection[index].call(animation,prop,value))return tween}function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width"in props||"height"in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");for(prop in opts.queue||(null==(hooks=jQuery._queueHooks(elem,"fx")).unqueued&&(hooks.unqueued=0,oldfire=hooks.empty.fire,hooks.empty.fire=function(){hooks.unqueued||oldfire()}),hooks.unqueued++,anim.always((function(){anim.always((function(){hooks.unqueued--,jQuery.queue(elem,"fx").length||hooks.empty.fire()}))}))),props)if(value=props[prop],rfxtypes.test(value)){if(delete props[prop],toggle=toggle||"toggle"===value,value===(hidden?"hide":"show")){if("show"!==value||!dataShow||void 0===dataShow[prop])continue;hidden=!0}orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}if((propTween=!jQuery.isEmptyObject(props))||!jQuery.isEmptyObject(orig))for(prop in isBox&&1===elem.nodeType&&(opts.overflow=[style.overflow,style.overflowX,style.overflowY],null==(restoreDisplay=dataShow&&dataShow.display)&&(restoreDisplay=dataPriv.get(elem,"display")),"none"===(display=jQuery.css(elem,"display"))&&(restoreDisplay?display=restoreDisplay:(showHide([elem],!0),restoreDisplay=elem.style.display||restoreDisplay,display=jQuery.css(elem,"display"),showHide([elem]))),("inline"===display||"inline-block"===display&&null!=restoreDisplay)&&"none"===jQuery.css(elem,"float")&&(propTween||(anim.done((function(){style.display=restoreDisplay})),null==restoreDisplay&&(display=style.display,restoreDisplay="none"===display?"":display)),style.display="inline-block")),opts.overflow&&(style.overflow="hidden",anim.always((function(){style.overflow=opts.overflow[0],style.overflowX=opts.overflow[1],style.overflowY=opts.overflow[2]}))),propTween=!1,orig)propTween||(dataShow?"hidden"in dataShow&&(hidden=dataShow.hidden):dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay}),toggle&&(dataShow.hidden=!hidden),hidden&&showHide([elem],!0),anim.done((function(){for(prop in hidden||showHide([elem]),dataPriv.remove(elem,"fxshow"),orig)jQuery.style(elem,prop,orig[prop])}))),propTween=createTween(hidden?dataShow[prop]:0,prop,anim),prop in dataShow||(dataShow[prop]=propTween.start,hidden&&(propTween.end=propTween.start,propTween.start=0))}function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props)if(easing=specialEasing[name=camelCase(index)],value=props[index],Array.isArray(value)&&(easing=value[1],value=props[index]=value[0]),index!==name&&(props[name]=value,delete props[index]),(hooks=jQuery.cssHooks[name])&&"expand"in hooks)for(index in value=hooks.expand(value),delete props[name],value)index in props||(props[index]=value[index],specialEasing[index]=easing);else specialEasing[name]=easing}function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always((function(){delete tick.elem})),tick=function(){if(stopped)return!1;for(var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp,percent=1-(remaining/animation.duration||0),index=0,length=animation.tweens.length;index<length;index++)animation.tweens[index].run(percent);return deferred.notifyWith(elem,[animation,percent,remaining]),percent<1&&length?remaining:(length||deferred.notifyWith(elem,[animation,1,0]),deferred.resolveWith(elem,[animation]),!1)},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(!0,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);return animation.tweens.push(tween),tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped)return this;for(stopped=!0;index<length;index++)animation.tweens[index].run(1);return gotoEnd?(deferred.notifyWith(elem,[animation,1,0]),deferred.resolveWith(elem,[animation,gotoEnd])):deferred.rejectWith(elem,[animation,gotoEnd]),this}}),props=animation.props;for(propFilter(props,animation.opts.specialEasing);index<length;index++)if(result=Animation.prefilters[index].call(animation,elem,props,animation.opts))return isFunction(result.stop)&&(jQuery._queueHooks(animation.elem,animation.opts.queue).stop=result.stop.bind(result)),result;return jQuery.map(props,createTween,animation),isFunction(animation.opts.start)&&animation.opts.start.call(elem,animation),animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always),jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue})),animation}jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);return adjustCSS(tween.elem,prop,rcssNum.exec(value),tween),tween}]},tweener:function(props,callback){isFunction(props)?(callback=props,props=["*"]):props=props.match(rnothtmlwhite);for(var prop,index=0,length=props.length;index<length;index++)prop=props[index],Animation.tweeners[prop]=Animation.tweeners[prop]||[],Animation.tweeners[prop].unshift(callback)},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){prepend?Animation.prefilters.unshift(callback):Animation.prefilters.push(callback)}}),jQuery.speed=function(speed,easing,fn){var opt=speed&&"object"==typeof speed?jQuery.extend({},speed):{complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!isFunction(easing)&&easing};return jQuery.fx.off?opt.duration=0:"number"!=typeof opt.duration&&(opt.duration in jQuery.fx.speeds?opt.duration=jQuery.fx.speeds[opt.duration]:opt.duration=jQuery.fx.speeds._default),null!=opt.queue&&!0!==opt.queue||(opt.queue="fx"),opt.old=opt.complete,opt.complete=function(){isFunction(opt.old)&&opt.old.call(this),opt.queue&&jQuery.dequeue(this,opt.queue)},opt},jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);(empty||dataPriv.get(this,"finish"))&&anim.stop(!0)};return doAnimation.finish=doAnimation,empty||!1===optall.queue?this.each(doAnimation):this.queue(optall.queue,doAnimation)},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop,stop(gotoEnd)};return"string"!=typeof type&&(gotoEnd=clearQueue,clearQueue=type,type=void 0),clearQueue&&!1!==type&&this.queue(type||"fx",[]),this.each((function(){var dequeue=!0,index=null!=type&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index)data[index]&&data[index].stop&&stopQueue(data[index]);else for(index in data)data[index]&&data[index].stop&&rrun.test(index)&&stopQueue(data[index]);for(index=timers.length;index--;)timers[index].elem!==this||null!=type&&timers[index].queue!==type||(timers[index].anim.stop(gotoEnd),dequeue=!1,timers.splice(index,1));!dequeue&&gotoEnd||jQuery.dequeue(this,type)}))},finish:function(type){return!1!==type&&(type=type||"fx"),this.each((function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;for(data.finish=!0,jQuery.queue(this,type,[]),hooks&&hooks.stop&&hooks.stop.call(this,!0),index=timers.length;index--;)timers[index].elem===this&&timers[index].queue===type&&(timers[index].anim.stop(!0),timers.splice(index,1));for(index=0;index<length;index++)queue[index]&&queue[index].finish&&queue[index].finish.call(this);delete data.finish}))}}),jQuery.each(["toggle","show","hide"],(function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return null==speed||"boolean"==typeof speed?cssFn.apply(this,arguments):this.animate(genFx(name,!0),speed,easing,callback)}})),jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback)}})),jQuery.timers=[],jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;for(fxNow=Date.now();i<timers.length;i++)(timer=timers[i])()||timers[i]!==timer||timers.splice(i--,1);timers.length||jQuery.fx.stop(),fxNow=void 0},jQuery.fx.timer=function(timer){jQuery.timers.push(timer),jQuery.fx.start()},jQuery.fx.interval=13,jQuery.fx.start=function(){inProgress||(inProgress=!0,schedule())},jQuery.fx.stop=function(){inProgress=null},jQuery.fx.speeds={slow:600,fast:200,_default:400},jQuery.fn.delay=function(time,type){return time=jQuery.fx&&jQuery.fx.speeds[time]||time,type=type||"fx",this.queue(type,(function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout)}}))},function(){var input=document.createElement("input"),select,opt=document.createElement("select").appendChild(document.createElement("option"));input.type="checkbox",support.checkOn=""!==input.value,support.optSelected=opt.selected,(input=document.createElement("input")).value="t",input.type="radio",support.radioValue="t"===input.value}();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1)},removeAttr:function(name){return this.each((function(){jQuery.removeAttr(this,name)}))}}),jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return void 0===elem.getAttribute?jQuery.prop(elem,name,value):(1===nType&&jQuery.isXMLDoc(elem)||(hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:void 0)),void 0!==value?null===value?void jQuery.removeAttr(elem,name):hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:(elem.setAttribute(name,value+""),value):hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:null==(ret=jQuery.find.attr(elem,name))?void 0:ret)},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&"radio"===value&&nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)elem.removeAttribute(name)}}),boolHook={set:function(elem,value,name){return!1===value?jQuery.removeAttr(elem,name):elem.setAttribute(name,name),name}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),(function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();return isXML||(handle=attrHandle[lowercaseName],attrHandle[lowercaseName]=ret,ret=null!=getter(elem,name,isXML)?lowercaseName:null,attrHandle[lowercaseName]=handle),ret}}));var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;function stripAndCollapse(value){var tokens;return(value.match(rnothtmlwhite)||[]).join(" ")}function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||""}function classesToArray(value){return Array.isArray(value)?value:"string"==typeof value&&value.match(rnothtmlwhite)||[]}jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return this.each((function(){delete this[jQuery.propFix[name]||name]}))}}),jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(3!==nType&&8!==nType&&2!==nType)return 1===nType&&jQuery.isXMLDoc(elem)||(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),void 0!==value?hooks&&"set"in hooks&&void 0!==(ret=hooks.set(elem,value,name))?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),support.optSelected||(jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;return parent&&parent.parentNode&&parent.parentNode.selectedIndex,null},set:function(elem){var parent=elem.parentNode;parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex)}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){jQuery.propFix[this.toLowerCase()]=this})),jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each((function(j){jQuery(this).addClass(value.call(this,j,getClass(this)))}));if((classes=classesToArray(value)).length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)cur.indexOf(" "+clazz+" ")<0&&(cur+=clazz+" ");curValue!==(finalValue=stripAndCollapse(cur))&&elem.setAttribute("class",finalValue)}return this},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value))return this.each((function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)))}));if(!arguments.length)return this.attr("class","");if((classes=classesToArray(value)).length)for(;elem=this[i++];)if(curValue=getClass(elem),cur=1===elem.nodeType&&" "+stripAndCollapse(curValue)+" "){for(j=0;clazz=classes[j++];)for(;cur.indexOf(" "+clazz+" ")>-1;)cur=cur.replace(" "+clazz+" "," ");curValue!==(finalValue=stripAndCollapse(cur))&&elem.setAttribute("class",finalValue)}return this},toggleClass:function(value,stateVal){var type=typeof value,isValidValue="string"===type||Array.isArray(value);return"boolean"==typeof stateVal&&isValidValue?stateVal?this.addClass(value):this.removeClass(value):isFunction(value)?this.each((function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal)})):this.each((function(){var className,i,self,classNames;if(isValidValue)for(i=0,self=jQuery(this),classNames=classesToArray(value);className=classNames[i++];)self.hasClass(className)?self.removeClass(className):self.addClass(className);else void 0!==value&&"boolean"!==type||((className=getClass(this))&&dataPriv.set(this,"__className__",className),this.setAttribute&&this.setAttribute("class",className||!1===value?"":dataPriv.get(this,"__className__")||""))}))},hasClass:function(selector){var className,elem,i=0;for(className=" "+selector+" ";elem=this[i++];)if(1===elem.nodeType&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1)return!0;return!1}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];return arguments.length?(valueIsFunction=isFunction(value),this.each((function(i){var val;1===this.nodeType&&(null==(val=valueIsFunction?value.call(this,i,jQuery(this).val()):value)?val="":"number"==typeof val?val+="":Array.isArray(val)&&(val=jQuery.map(val,(function(value){return null==value?"":value+""}))),(hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()])&&"set"in hooks&&void 0!==hooks.set(this,val,"value")||(this.value=val))}))):elem?(hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()])&&"get"in hooks&&void 0!==(ret=hooks.get(elem,"value"))?ret:"string"==typeof(ret=elem.value)?ret.replace(rreturn,""):null==ret?"":ret:void 0}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return null!=val?val:stripAndCollapse(jQuery.text(elem))}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type,values=one?null:[],max=one?index+1:options.length;for(i=index<0?max:one?index:0;i<max;i++)if(((option=options[i]).selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){if(value=jQuery(option).val(),one)return value;values.push(value)}return values},set:function(elem,value){for(var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;i--;)((option=options[i]).selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1)&&(optionSet=!0);return optionSet||(elem.selectedIndex=-1),values}}}}),jQuery.each(["radio","checkbox"],(function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1}},support.checkOn||(jQuery.valHooks[this].get=function(elem){return null===elem.getAttribute("value")?"on":elem.value})})),support.focusin="onfocusin"in window;var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation()};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=lastElement=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>-1&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,(event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event)).isTrigger=onlyHandlers?2:3,event.namespace=namespaces.join("."),event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=void 0,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||!1!==special.trigger.apply(elem,data))){if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)lastElement=cur,event.type=i>1?bubbleType:special.bindType||type,(handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle"))&&handle.apply(cur,data),(handle=ontype&&cur[ontype])&&handle.apply&&acceptData(cur)&&(event.result=handle.apply(cur,data),!1===event.result&&event.preventDefault());return event.type=type,onlyHandlers||event.isDefaultPrevented()||special._default&&!1!==special._default.apply(eventPath.pop(),data)||!acceptData(elem)||ontype&&isFunction(elem[type])&&!isWindow(elem)&&((tmp=elem[ontype])&&(elem[ontype]=null),jQuery.event.triggered=type,event.isPropagationStopped()&&lastElement.addEventListener(type,stopPropagationCallback),elem[type](),event.isPropagationStopped()&&lastElement.removeEventListener(type,stopPropagationCallback),jQuery.event.triggered=void 0,tmp&&(elem[ontype]=tmp)),event.result}},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:!0});jQuery.event.trigger(e,null,elem)}}),jQuery.fn.extend({trigger:function(type,data){return this.each((function(){jQuery.event.trigger(type,data,this)}))},triggerHandler:function(type,data){var elem=this[0];if(elem)return jQuery.event.trigger(type,data,elem,!0)}}),support.focusin||jQuery.each({focus:"focusin",blur:"focusout"},(function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event))};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix);attaches||doc.addEventListener(orig,handler,!0),dataPriv.access(doc,fix,(attaches||0)+1)},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;attaches?dataPriv.access(doc,fix,attaches):(doc.removeEventListener(orig,handler,!0),dataPriv.remove(doc,fix))}}}));var location=window.location,nonce=Date.now(),rquery=/\?/;jQuery.parseXML=function(data){var xml;if(!data||"string"!=typeof data)return null;try{xml=(new window.DOMParser).parseFromString(data,"text/xml")}catch(e){xml=void 0}return xml&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml};var rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj))jQuery.each(obj,(function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v&&null!=v?i:"")+"]",v,traditional,add)}));else if(traditional||"object"!==toType(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(null==value?"":value)};if(null==a)return"";if(Array.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,(function(){add(this.name,this.value)}));else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this})).filter((function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))})).map((function(i,elem){var val=jQuery(this).val();return null==val?null:Array.isArray(val)?jQuery.map(val,(function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}})):{name:elem.name,value:val.replace(rCRLF,"\r\n")}})).get()}});var r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=structure===transports;function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],(function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)})),selected}return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)void 0!==src[key]&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){for(var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;"*"===dataTypes[0];)dataTypes.shift(),void 0===ct&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(current=dataTypes.shift();current;)if(s.responseFields[current]&&(jqXHR[s.responseFields[current]]=response),!prev&&isSuccess&&s.dataFilter&&(response=s.dataFilter(response,s.dataType)),prev=current,current=dataTypes.shift())if("*"===current)current=prev;else if("*"!==prev&&prev!==current){if(!(conv=converters[prev+" "+current]||converters["* "+current]))for(conv2 in converters)if((tmp=conv2.split(" "))[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){!0===conv?conv=converters[conv2]:!0!==converters[conv2]&&(current=tmp[0],dataTypes.unshift(tmp[1]));break}if(!0!==conv)if(conv&&s.throws)response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}return{state:"success",data:response}}originAnchor.href=location.href,jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){"object"==typeof url&&(options=url,url=void 0),options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()+" "]=(responseHeaders[match[1].toLowerCase()+" "]||[]).concat(match[2]);match=responseHeaders[key.toLowerCase()+" "]}return null==match?null:match.join(", ")},getAllResponseHeaders:function(){return completed?responseHeadersString:null},setRequestHeader:function(name,value){return null==completed&&(name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return null==completed&&(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(completed)jqXHR.always(map[jqXHR.status]);else for(code in map)statusCode[code]=[statusCode[code],map[code]];return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR),s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""],null==s.crossDomain){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url,urlAnchor.href=urlAnchor.href,s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!=urlAnchor.protocol+"//"+urlAnchor.host}catch(e){s.crossDomain=!0}}if(s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),completed)return jqXHR;for(i in(fireGlobals=jQuery.event&&s.global)&&0==jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url.replace(rhash,""),s.hasContent?s.data&&s.processData&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&(s.data=s.data.replace(r20,"+")):(uncached=s.url.slice(cacheURL.length),s.data&&(s.processData||"string"==typeof s.data)&&(cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),!1===s.cache&&(cacheURL=cacheURL.replace(rantiCache,"$1"),uncached=(rquery.test(cacheURL)?"&":"?")+"_="+nonce+++uncached),s.url=cacheURL+uncached),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&!1!==s.contentType||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]),s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(!1===s.beforeSend.call(callbackContext,jqXHR,s)||completed))return jqXHR.abort();if(strAbort="abort",completeDeferred.add(s.complete),jqXHR.done(s.success),jqXHR.fail(s.error),transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){if(jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),completed)return jqXHR;s.async&&s.timeout>0&&(timeoutTimer=window.setTimeout((function(){jqXHR.abort("timeout")}),s.timeout));try{completed=!1,transport.send(requestHeaders,done)}catch(e){if(completed)throw e;done(-1,e)}}else done(-1,"No Transport");function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;completed||(completed=!0,timeoutTimer&&window.clearTimeout(timeoutTimer),transport=void 0,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,isSuccess=status>=200&&status<300||304===status,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),response=ajaxConvert(s,response,jqXHR,isSuccess),isSuccess?(s.ifModified&&((modified=jqXHR.getResponseHeader("Last-Modified"))&&(jQuery.lastModified[cacheURL]=modified),(modified=jqXHR.getResponseHeader("etag"))&&(jQuery.etag[cacheURL]=modified)),204===status||"HEAD"===s.type?statusText="nocontent":304===status?statusText="notmodified":(statusText=response.state,success=response.data,isSuccess=!(error=response.error))):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=void 0,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}return jqXHR},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,void 0,callback,"script")}}),jQuery.each(["get","post"],(function(i,method){jQuery[method]=function(url,data,callback,type){return isFunction(data)&&(type=type||callback,callback=data,data=void 0),jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url))}})),jQuery._evalUrl=function(url,options){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(response){jQuery.globalEval(response,options)}})},jQuery.fn.extend({wrapAll:function(html){var wrap;return this[0]&&(isFunction(html)&&(html=html.call(this[0])),wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map((function(){for(var elem=this;elem.firstElementChild;)elem=elem.firstElementChild;return elem})).append(this)),this},wrapInner:function(html){return isFunction(html)?this.each((function(i){jQuery(this).wrapInner(html.call(this,i))})):this.each((function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)}))},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each((function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html)}))},unwrap:function(selector){return this.parent(selector).not("body").each((function(){jQuery(this).replaceWith(this.childNodes)})),this}}),jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem)},jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length)},jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,support.ajax=xhrSupported=!!xhrSupported,jQuery.ajaxTransport((function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain)return{send:function(headers,complete){var i,xhr=options.xhr();if(xhr.open(options.type,options.url,options.async,options.username,options.password),options.xhrFields)for(i in options.xhrFields)xhr[i]=options.xhrFields[i];for(i in options.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(options.mimeType),options.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest"),headers)xhr.setRequestHeader(i,headers[i]);callback=function(type){return function(){callback&&(callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null,"abort"===type?xhr.abort():"error"===type?"number"!=typeof xhr.status?complete(0,"error"):complete(xhr.status,xhr.statusText):complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,"text"!==(xhr.responseType||"text")||"string"!=typeof xhr.responseText?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders()))}},xhr.onload=callback(),errorCallback=xhr.onerror=xhr.ontimeout=callback("error"),void 0!==xhr.onabort?xhr.onabort=errorCallback:xhr.onreadystatechange=function(){4===xhr.readyState&&window.setTimeout((function(){callback&&errorCallback()}))},callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback)throw e}},abort:function(){callback&&callback()}}})),jQuery.ajaxPrefilter((function(s){s.crossDomain&&(s.contents.script=!1)})),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",(function(s){void 0===s.cache&&(s.cache=!1),s.crossDomain&&(s.type="GET")})),jQuery.ajaxTransport("script",(function(s){var script,callback;if(s.crossDomain||s.scriptAttrs)return{send:function(_,complete){script=jQuery("<script>").attr(s.scriptAttrs||{}).prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove(),callback=null,evt&&complete("error"===evt.type?404:200,evt.type)}),document.head.appendChild(script[0])},abort:function(){callback&&callback()}}}));var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/,body;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",(function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=!1!==s.jsonp&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):!1!==s.jsonp&&(s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always((function(){void 0===overwritten?jQuery(window).removeProp(callbackName):window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=void 0})),"script"})),support.createHTMLDocument=((body=document.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===body.childNodes.length),jQuery.parseHTML=function(data,context,keepScripts){return"string"!=typeof data?[]:("boolean"==typeof context&&(keepScripts=context,context=!1),context||(support.createHTMLDocument?((base=(context=document.implementation.createHTMLDocument("")).createElement("base")).href=document.location.href,context.head.appendChild(base)):context=document),scripts=!keepScripts&&[],(parsed=rsingleTag.exec(data))?[context.createElement(parsed[1])]:(parsed=buildFragment([data],context,scripts),scripts&&scripts.length&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes)));var base,parsed,scripts},jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");return off>-1&&(selector=stripAndCollapse(url.slice(off)),url=url.slice(0,off)),isFunction(params)?(callback=params,params=void 0):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done((function(responseText){response=arguments,self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText)})).always(callback&&function(jqXHR,status){self.each((function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR])}))}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}})),jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,(function(fn){return elem===fn.elem})).length},jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};"static"===position&&(elem.style.position="relative"),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),(calculatePosition=("absolute"===position||"fixed"===position)&&(curCSSTop+curCSSLeft).indexOf("auto")>-1)?(curTop=(curPosition=curElem.position()).top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),isFunction(options)&&(options=options.call(elem,i,jQuery.extend({},curOffset))),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({offset:function(options){if(arguments.length)return void 0===options?this:this.each((function(i){jQuery.offset.setOffset(this,options,i)}));var rect,win,elem=this[0];return elem?elem.getClientRects().length?(rect=elem.getBoundingClientRect(),win=elem.ownerDocument.defaultView,{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if("fixed"===jQuery.css(elem,"position"))offset=elem.getBoundingClientRect();else{for(offset=this.offset(),doc=elem.ownerDocument,offsetParent=elem.offsetParent||doc.documentElement;offsetParent&&(offsetParent===doc.body||offsetParent===doc.documentElement)&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.parentNode;offsetParent&&offsetParent!==elem&&1===offsetParent.nodeType&&((parentOffset=jQuery(offsetParent).offset()).top+=jQuery.css(offsetParent,"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",!0))}return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var offsetParent=this.offsetParent;offsetParent&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||documentElement}))}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,(function(elem,method,val){var win;if(isWindow(elem)?win=elem:9===elem.nodeType&&(win=elem.defaultView),void 0===val)return win?win[prop]:elem[method];win?win.scrollTo(top?win.pageXOffset:val,top?val:win.pageYOffset):elem[method]=val}),method,val,arguments.length)}})),jQuery.each(["top","left"],(function(i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,(function(elem,computed){if(computed)return computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}))})),jQuery.each({Height:"height",Width:"width"},(function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},(function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(!0===margin||!0===value?"margin":"border");return access(this,(function(elem,type,value){var doc;return isWindow(elem)?0===funcName.indexOf("outer")?elem["inner"+name]:elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):void 0===value?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)}),type,chainable?margin:void 0,chainable)}}))})),jQuery.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}})),jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)}}),jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},undelegate:function(selector,types,fn){return 1===arguments.length?this.off(selector,"**"):this.off(types,selector||"**",fn)}}),jQuery.proxy=function(fn,context){var tmp,args,proxy;if("string"==typeof context&&(tmp=fn[context],context=fn,fn=tmp),isFunction(fn))return args=slice.call(arguments,2),(proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)))}).guid=fn.guid=fn.guid||jQuery.guid++,proxy},jQuery.holdReady=function(hold){hold?jQuery.readyWait++:jQuery.ready(!0)},jQuery.isArray=Array.isArray,jQuery.parseJSON=JSON.parse,jQuery.nodeName=nodeName,jQuery.isFunction=isFunction,jQuery.isWindow=isWindow,jQuery.camelCase=camelCase,jQuery.type=toType,jQuery.now=Date.now,jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return("number"===type||"string"===type)&&!isNaN(obj-parseFloat(obj))},"function"==typeof define&&define.amd&&define("jquery",[],(function(){return jQuery}));var _jQuery=window.jQuery,_$=window.$;return jQuery.noConflict=function(deep){return window.$===jQuery&&(window.$=_$),deep&&window.jQuery===jQuery&&(window.jQuery=_jQuery),jQuery},noGlobal||(window.jQuery=window.$=jQuery),jQuery})),
|
||
/**!
|
||
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
||
* @version 1.16.1
|
||
* @license
|
||
* Copyright (c) 2016 Federico Zivolo and contributors
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/
|
||
function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.Popper=factory()}(this,(function(){"use strict";var isBrowser="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,timeoutDuration=function(){for(var longerTimeoutBrowsers=["Edge","Trident","Firefox"],i=0;i<longerTimeoutBrowsers.length;i+=1)if(isBrowser&&navigator.userAgent.indexOf(longerTimeoutBrowsers[i])>=0)return 1;return 0}();function microtaskDebounce(fn){var called=!1;return function(){called||(called=!0,window.Promise.resolve().then((function(){called=!1,fn()})))}}function taskDebounce(fn){var scheduled=!1;return function(){scheduled||(scheduled=!0,setTimeout((function(){scheduled=!1,fn()}),timeoutDuration))}}var supportsMicroTasks,debounce=isBrowser&&window.Promise?microtaskDebounce:taskDebounce;function isFunction(functionToCheck){var getType;return functionToCheck&&"[object Function]"==={}.toString.call(functionToCheck)}function getStyleComputedProperty(element,property){if(1!==element.nodeType)return[];var window,css=element.ownerDocument.defaultView.getComputedStyle(element,null);return property?css[property]:css}function getParentNode(element){return"HTML"===element.nodeName?element:element.parentNode||element.host}function getScrollParent(element){if(!element)return document.body;switch(element.nodeName){case"HTML":case"BODY":return element.ownerDocument.body;case"#document":return element.body}var _getStyleComputedProp=getStyleComputedProperty(element),overflow=_getStyleComputedProp.overflow,overflowX=_getStyleComputedProp.overflowX,overflowY=_getStyleComputedProp.overflowY;return/(auto|scroll|overlay)/.test(overflow+overflowY+overflowX)?element:getScrollParent(getParentNode(element))}function getReferenceNode(reference){return reference&&reference.referenceNode?reference.referenceNode:reference}var isIE11=isBrowser&&!(!window.MSInputMethodContext||!document.documentMode),isIE10=isBrowser&&/MSIE 10/.test(navigator.userAgent);function isIE(version){return 11===version?isIE11:10===version?isIE10:isIE11||isIE10}function getOffsetParent(element){if(!element)return document.documentElement;for(var noOffsetParent=isIE(10)?document.body:null,offsetParent=element.offsetParent||null;offsetParent===noOffsetParent&&element.nextElementSibling;)offsetParent=(element=element.nextElementSibling).offsetParent;var nodeName=offsetParent&&offsetParent.nodeName;return nodeName&&"BODY"!==nodeName&&"HTML"!==nodeName?-1!==["TH","TD","TABLE"].indexOf(offsetParent.nodeName)&&"static"===getStyleComputedProperty(offsetParent,"position")?getOffsetParent(offsetParent):offsetParent:element?element.ownerDocument.documentElement:document.documentElement}function isOffsetContainer(element){var nodeName=element.nodeName;return"BODY"!==nodeName&&("HTML"===nodeName||getOffsetParent(element.firstElementChild)===element)}function getRoot(node){return null!==node.parentNode?getRoot(node.parentNode):node}function findCommonOffsetParent(element1,element2){if(!(element1&&element1.nodeType&&element2&&element2.nodeType))return document.documentElement;var order=element1.compareDocumentPosition(element2)&Node.DOCUMENT_POSITION_FOLLOWING,start=order?element1:element2,end=order?element2:element1,range=document.createRange();range.setStart(start,0),range.setEnd(end,0);var commonAncestorContainer=range.commonAncestorContainer;if(element1!==commonAncestorContainer&&element2!==commonAncestorContainer||start.contains(end))return isOffsetContainer(commonAncestorContainer)?commonAncestorContainer:getOffsetParent(commonAncestorContainer);var element1root=getRoot(element1);return element1root.host?findCommonOffsetParent(element1root.host,element2):findCommonOffsetParent(element1,getRoot(element2).host)}function getScroll(element){var side=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",upperSide="top"===side?"scrollTop":"scrollLeft",nodeName=element.nodeName;if("BODY"===nodeName||"HTML"===nodeName){var html=element.ownerDocument.documentElement,scrollingElement=element.ownerDocument.scrollingElement||html;return scrollingElement[upperSide]}return element[upperSide]}function includeScroll(rect,element){var subtract=arguments.length>2&&void 0!==arguments[2]&&arguments[2],scrollTop=getScroll(element,"top"),scrollLeft=getScroll(element,"left"),modifier=subtract?-1:1;return rect.top+=scrollTop*modifier,rect.bottom+=scrollTop*modifier,rect.left+=scrollLeft*modifier,rect.right+=scrollLeft*modifier,rect}function getBordersSize(styles,axis){var sideA="x"===axis?"Left":"Top",sideB="Left"===sideA?"Right":"Bottom";return parseFloat(styles["border"+sideA+"Width"])+parseFloat(styles["border"+sideB+"Width"])}function getSize(axis,body,html,computedStyle){return Math.max(body["offset"+axis],body["scroll"+axis],html["client"+axis],html["offset"+axis],html["scroll"+axis],isIE(10)?parseInt(html["offset"+axis])+parseInt(computedStyle["margin"+("Height"===axis?"Top":"Left")])+parseInt(computedStyle["margin"+("Height"===axis?"Bottom":"Right")]):0)}function getWindowSizes(document){var body=document.body,html=document.documentElement,computedStyle=isIE(10)&&getComputedStyle(html);return{height:getSize("Height",body,html,computedStyle),width:getSize("Width",body,html,computedStyle)}}var classCallCheck=function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")},createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),defineProperty=function(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj},_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};function getClientRect(offsets){return _extends({},offsets,{right:offsets.left+offsets.width,bottom:offsets.top+offsets.height})}function getBoundingClientRect(element){var rect={};try{if(isIE(10)){rect=element.getBoundingClientRect();var scrollTop=getScroll(element,"top"),scrollLeft=getScroll(element,"left");rect.top+=scrollTop,rect.left+=scrollLeft,rect.bottom+=scrollTop,rect.right+=scrollLeft}else rect=element.getBoundingClientRect()}catch(e){}var result={left:rect.left,top:rect.top,width:rect.right-rect.left,height:rect.bottom-rect.top},sizes="HTML"===element.nodeName?getWindowSizes(element.ownerDocument):{},width=sizes.width||element.clientWidth||result.width,height=sizes.height||element.clientHeight||result.height,horizScrollbar=element.offsetWidth-width,vertScrollbar=element.offsetHeight-height;if(horizScrollbar||vertScrollbar){var styles=getStyleComputedProperty(element);horizScrollbar-=getBordersSize(styles,"x"),vertScrollbar-=getBordersSize(styles,"y"),result.width-=horizScrollbar,result.height-=vertScrollbar}return getClientRect(result)}function getOffsetRectRelativeToArbitraryNode(children,parent){var fixedPosition=arguments.length>2&&void 0!==arguments[2]&&arguments[2],isIE10=isIE(10),isHTML="HTML"===parent.nodeName,childrenRect=getBoundingClientRect(children),parentRect=getBoundingClientRect(parent),scrollParent=getScrollParent(children),styles=getStyleComputedProperty(parent),borderTopWidth=parseFloat(styles.borderTopWidth),borderLeftWidth=parseFloat(styles.borderLeftWidth);fixedPosition&&isHTML&&(parentRect.top=Math.max(parentRect.top,0),parentRect.left=Math.max(parentRect.left,0));var offsets=getClientRect({top:childrenRect.top-parentRect.top-borderTopWidth,left:childrenRect.left-parentRect.left-borderLeftWidth,width:childrenRect.width,height:childrenRect.height});if(offsets.marginTop=0,offsets.marginLeft=0,!isIE10&&isHTML){var marginTop=parseFloat(styles.marginTop),marginLeft=parseFloat(styles.marginLeft);offsets.top-=borderTopWidth-marginTop,offsets.bottom-=borderTopWidth-marginTop,offsets.left-=borderLeftWidth-marginLeft,offsets.right-=borderLeftWidth-marginLeft,offsets.marginTop=marginTop,offsets.marginLeft=marginLeft}return(isIE10&&!fixedPosition?parent.contains(scrollParent):parent===scrollParent&&"BODY"!==scrollParent.nodeName)&&(offsets=includeScroll(offsets,parent)),offsets}function getViewportOffsetRectRelativeToArtbitraryNode(element){var excludeScroll=arguments.length>1&&void 0!==arguments[1]&&arguments[1],html=element.ownerDocument.documentElement,relativeOffset=getOffsetRectRelativeToArbitraryNode(element,html),width=Math.max(html.clientWidth,window.innerWidth||0),height=Math.max(html.clientHeight,window.innerHeight||0),scrollTop=excludeScroll?0:getScroll(html),scrollLeft=excludeScroll?0:getScroll(html,"left"),offset={top:scrollTop-relativeOffset.top+relativeOffset.marginTop,left:scrollLeft-relativeOffset.left+relativeOffset.marginLeft,width:width,height:height};return getClientRect(offset)}function isFixed(element){var nodeName=element.nodeName;if("BODY"===nodeName||"HTML"===nodeName)return!1;if("fixed"===getStyleComputedProperty(element,"position"))return!0;var parentNode=getParentNode(element);return!!parentNode&&isFixed(parentNode)}function getFixedPositionOffsetParent(element){if(!element||!element.parentElement||isIE())return document.documentElement;for(var el=element.parentElement;el&&"none"===getStyleComputedProperty(el,"transform");)el=el.parentElement;return el||document.documentElement}function getBoundaries(popper,reference,padding,boundariesElement){var fixedPosition=arguments.length>4&&void 0!==arguments[4]&&arguments[4],boundaries={top:0,left:0},offsetParent=fixedPosition?getFixedPositionOffsetParent(popper):findCommonOffsetParent(popper,getReferenceNode(reference));if("viewport"===boundariesElement)boundaries=getViewportOffsetRectRelativeToArtbitraryNode(offsetParent,fixedPosition);else{var boundariesNode=void 0;"scrollParent"===boundariesElement?"BODY"===(boundariesNode=getScrollParent(getParentNode(reference))).nodeName&&(boundariesNode=popper.ownerDocument.documentElement):boundariesNode="window"===boundariesElement?popper.ownerDocument.documentElement:boundariesElement;var offsets=getOffsetRectRelativeToArbitraryNode(boundariesNode,offsetParent,fixedPosition);if("HTML"!==boundariesNode.nodeName||isFixed(offsetParent))boundaries=offsets;else{var _getWindowSizes=getWindowSizes(popper.ownerDocument),height=_getWindowSizes.height,width=_getWindowSizes.width;boundaries.top+=offsets.top-offsets.marginTop,boundaries.bottom=height+offsets.top,boundaries.left+=offsets.left-offsets.marginLeft,boundaries.right=width+offsets.left}}var isPaddingNumber="number"==typeof(padding=padding||0);return boundaries.left+=isPaddingNumber?padding:padding.left||0,boundaries.top+=isPaddingNumber?padding:padding.top||0,boundaries.right-=isPaddingNumber?padding:padding.right||0,boundaries.bottom-=isPaddingNumber?padding:padding.bottom||0,boundaries}function getArea(_ref){var width,height;return _ref.width*_ref.height}function computeAutoPlacement(placement,refRect,popper,reference,boundariesElement){var padding=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===placement.indexOf("auto"))return placement;var boundaries=getBoundaries(popper,reference,padding,boundariesElement),rects={top:{width:boundaries.width,height:refRect.top-boundaries.top},right:{width:boundaries.right-refRect.right,height:boundaries.height},bottom:{width:boundaries.width,height:boundaries.bottom-refRect.bottom},left:{width:refRect.left-boundaries.left,height:boundaries.height}},sortedAreas=Object.keys(rects).map((function(key){return _extends({key:key},rects[key],{area:getArea(rects[key])})})).sort((function(a,b){return b.area-a.area})),filteredAreas=sortedAreas.filter((function(_ref2){var width=_ref2.width,height=_ref2.height;return width>=popper.clientWidth&&height>=popper.clientHeight})),computedPlacement=filteredAreas.length>0?filteredAreas[0].key:sortedAreas[0].key,variation=placement.split("-")[1];return computedPlacement+(variation?"-"+variation:"")}function getReferenceOffsets(state,popper,reference){var fixedPosition=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,commonOffsetParent=fixedPosition?getFixedPositionOffsetParent(popper):findCommonOffsetParent(popper,getReferenceNode(reference));return getOffsetRectRelativeToArbitraryNode(reference,commonOffsetParent,fixedPosition)}function getOuterSizes(element){var window,styles=element.ownerDocument.defaultView.getComputedStyle(element),x=parseFloat(styles.marginTop||0)+parseFloat(styles.marginBottom||0),y=parseFloat(styles.marginLeft||0)+parseFloat(styles.marginRight||0),result;return{width:element.offsetWidth+y,height:element.offsetHeight+x}}function getOppositePlacement(placement){var hash={left:"right",right:"left",bottom:"top",top:"bottom"};return placement.replace(/left|right|bottom|top/g,(function(matched){return hash[matched]}))}function getPopperOffsets(popper,referenceOffsets,placement){placement=placement.split("-")[0];var popperRect=getOuterSizes(popper),popperOffsets={width:popperRect.width,height:popperRect.height},isHoriz=-1!==["right","left"].indexOf(placement),mainSide=isHoriz?"top":"left",secondarySide=isHoriz?"left":"top",measurement=isHoriz?"height":"width",secondaryMeasurement=isHoriz?"width":"height";return popperOffsets[mainSide]=referenceOffsets[mainSide]+referenceOffsets[measurement]/2-popperRect[measurement]/2,popperOffsets[secondarySide]=placement===secondarySide?referenceOffsets[secondarySide]-popperRect[secondaryMeasurement]:referenceOffsets[getOppositePlacement(secondarySide)],popperOffsets}function find(arr,check){return Array.prototype.find?arr.find(check):arr.filter(check)[0]}function findIndex(arr,prop,value){if(Array.prototype.findIndex)return arr.findIndex((function(cur){return cur[prop]===value}));var match=find(arr,(function(obj){return obj[prop]===value}));return arr.indexOf(match)}function runModifiers(modifiers,data,ends){var modifiersToRun;return(void 0===ends?modifiers:modifiers.slice(0,findIndex(modifiers,"name",ends))).forEach((function(modifier){modifier.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var fn=modifier.function||modifier.fn;modifier.enabled&&isFunction(fn)&&(data.offsets.popper=getClientRect(data.offsets.popper),data.offsets.reference=getClientRect(data.offsets.reference),data=fn(data,modifier))})),data}function update(){if(!this.state.isDestroyed){var data={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};data.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference,this.options.positionFixed),data.placement=computeAutoPlacement(this.options.placement,data.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),data.originalPlacement=data.placement,data.positionFixed=this.options.positionFixed,data.offsets.popper=getPopperOffsets(this.popper,data.offsets.reference,data.placement),data.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",data=runModifiers(this.modifiers,data),this.state.isCreated?this.options.onUpdate(data):(this.state.isCreated=!0,this.options.onCreate(data))}}function isModifierEnabled(modifiers,modifierName){return modifiers.some((function(_ref){var name=_ref.name,enabled;return _ref.enabled&&name===modifierName}))}function getSupportedPropertyName(property){for(var prefixes=[!1,"ms","Webkit","Moz","O"],upperProp=property.charAt(0).toUpperCase()+property.slice(1),i=0;i<prefixes.length;i++){var prefix=prefixes[i],toCheck=prefix?""+prefix+upperProp:property;if(void 0!==document.body.style[toCheck])return toCheck}return null}function destroy(){return this.state.isDestroyed=!0,isModifierEnabled(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[getSupportedPropertyName("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function getWindow(element){var ownerDocument=element.ownerDocument;return ownerDocument?ownerDocument.defaultView:window}function attachToScrollParents(scrollParent,event,callback,scrollParents){var isBody="BODY"===scrollParent.nodeName,target=isBody?scrollParent.ownerDocument.defaultView:scrollParent;target.addEventListener(event,callback,{passive:!0}),isBody||attachToScrollParents(getScrollParent(target.parentNode),event,callback,scrollParents),scrollParents.push(target)}function setupEventListeners(reference,options,state,updateBound){state.updateBound=updateBound,getWindow(reference).addEventListener("resize",state.updateBound,{passive:!0});var scrollElement=getScrollParent(reference);return attachToScrollParents(scrollElement,"scroll",state.updateBound,state.scrollParents),state.scrollElement=scrollElement,state.eventsEnabled=!0,state}function enableEventListeners(){this.state.eventsEnabled||(this.state=setupEventListeners(this.reference,this.options,this.state,this.scheduleUpdate))}function removeEventListeners(reference,state){return getWindow(reference).removeEventListener("resize",state.updateBound),state.scrollParents.forEach((function(target){target.removeEventListener("scroll",state.updateBound)})),state.updateBound=null,state.scrollParents=[],state.scrollElement=null,state.eventsEnabled=!1,state}function disableEventListeners(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=removeEventListeners(this.reference,this.state))}function isNumeric(n){return""!==n&&!isNaN(parseFloat(n))&&isFinite(n)}function setStyles(element,styles){Object.keys(styles).forEach((function(prop){var unit="";-1!==["width","height","top","right","bottom","left"].indexOf(prop)&&isNumeric(styles[prop])&&(unit="px"),element.style[prop]=styles[prop]+unit}))}function setAttributes(element,attributes){Object.keys(attributes).forEach((function(prop){var value;!1!==attributes[prop]?element.setAttribute(prop,attributes[prop]):element.removeAttribute(prop)}))}function applyStyle(data){return setStyles(data.instance.popper,data.styles),setAttributes(data.instance.popper,data.attributes),data.arrowElement&&Object.keys(data.arrowStyles).length&&setStyles(data.arrowElement,data.arrowStyles),data}function applyStyleOnLoad(reference,popper,options,modifierOptions,state){var referenceOffsets=getReferenceOffsets(state,popper,reference,options.positionFixed),placement=computeAutoPlacement(options.placement,referenceOffsets,popper,reference,options.modifiers.flip.boundariesElement,options.modifiers.flip.padding);return popper.setAttribute("x-placement",placement),setStyles(popper,{position:options.positionFixed?"fixed":"absolute"}),options}function getRoundedOffsets(data,shouldRound){var _data$offsets=data.offsets,popper=_data$offsets.popper,reference=_data$offsets.reference,round=Math.round,floor=Math.floor,noRound=function noRound(v){return v},referenceWidth=round(reference.width),popperWidth=round(popper.width),isVertical=-1!==["left","right"].indexOf(data.placement),isVariation=-1!==data.placement.indexOf("-"),sameWidthParity,bothOddWidth,horizontalToInteger=shouldRound?isVertical||isVariation||referenceWidth%2==popperWidth%2?round:floor:noRound,verticalToInteger=shouldRound?round:noRound;return{left:horizontalToInteger(referenceWidth%2==1&&popperWidth%2==1&&!isVariation&&shouldRound?popper.left-1:popper.left),top:verticalToInteger(popper.top),bottom:verticalToInteger(popper.bottom),right:horizontalToInteger(popper.right)}}var isFirefox=isBrowser&&/Firefox/i.test(navigator.userAgent);function computeStyle(data,options){var x=options.x,y=options.y,popper=data.offsets.popper,legacyGpuAccelerationOption=find(data.instance.modifiers,(function(modifier){return"applyStyle"===modifier.name})).gpuAcceleration;void 0!==legacyGpuAccelerationOption&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var gpuAcceleration=void 0!==legacyGpuAccelerationOption?legacyGpuAccelerationOption:options.gpuAcceleration,offsetParent=getOffsetParent(data.instance.popper),offsetParentRect=getBoundingClientRect(offsetParent),styles={position:popper.position},offsets=getRoundedOffsets(data,window.devicePixelRatio<2||!isFirefox),sideA="bottom"===x?"top":"bottom",sideB="right"===y?"left":"right",prefixedProperty=getSupportedPropertyName("transform"),left=void 0,top=void 0;if(top="bottom"===sideA?"HTML"===offsetParent.nodeName?-offsetParent.clientHeight+offsets.bottom:-offsetParentRect.height+offsets.bottom:offsets.top,left="right"===sideB?"HTML"===offsetParent.nodeName?-offsetParent.clientWidth+offsets.right:-offsetParentRect.width+offsets.right:offsets.left,gpuAcceleration&&prefixedProperty)styles[prefixedProperty]="translate3d("+left+"px, "+top+"px, 0)",styles[sideA]=0,styles[sideB]=0,styles.willChange="transform";else{var invertTop="bottom"===sideA?-1:1,invertLeft="right"===sideB?-1:1;styles[sideA]=top*invertTop,styles[sideB]=left*invertLeft,styles.willChange=sideA+", "+sideB}var attributes={"x-placement":data.placement};return data.attributes=_extends({},attributes,data.attributes),data.styles=_extends({},styles,data.styles),data.arrowStyles=_extends({},data.offsets.arrow,data.arrowStyles),data}function isModifierRequired(modifiers,requestingName,requestedName){var requesting=find(modifiers,(function(_ref){var name;return _ref.name===requestingName})),isRequired=!!requesting&&modifiers.some((function(modifier){return modifier.name===requestedName&&modifier.enabled&&modifier.order<requesting.order}));if(!isRequired){var _requesting="`"+requestingName+"`",requested="`"+requestedName+"`";console.warn(requested+" modifier is required by "+_requesting+" modifier in order to work, be sure to include it before "+_requesting+"!")}return isRequired}function arrow(data,options){var _data$offsets$arrow;if(!isModifierRequired(data.instance.modifiers,"arrow","keepTogether"))return data;var arrowElement=options.element;if("string"==typeof arrowElement){if(!(arrowElement=data.instance.popper.querySelector(arrowElement)))return data}else if(!data.instance.popper.contains(arrowElement))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),data;var placement=data.placement.split("-")[0],_data$offsets=data.offsets,popper=_data$offsets.popper,reference=_data$offsets.reference,isVertical=-1!==["left","right"].indexOf(placement),len=isVertical?"height":"width",sideCapitalized=isVertical?"Top":"Left",side=sideCapitalized.toLowerCase(),altSide=isVertical?"left":"top",opSide=isVertical?"bottom":"right",arrowElementSize=getOuterSizes(arrowElement)[len];reference[opSide]-arrowElementSize<popper[side]&&(data.offsets.popper[side]-=popper[side]-(reference[opSide]-arrowElementSize)),reference[side]+arrowElementSize>popper[opSide]&&(data.offsets.popper[side]+=reference[side]+arrowElementSize-popper[opSide]),data.offsets.popper=getClientRect(data.offsets.popper);var center=reference[side]+reference[len]/2-arrowElementSize/2,css=getStyleComputedProperty(data.instance.popper),popperMarginSide=parseFloat(css["margin"+sideCapitalized]),popperBorderSide=parseFloat(css["border"+sideCapitalized+"Width"]),sideValue=center-data.offsets.popper[side]-popperMarginSide-popperBorderSide;return sideValue=Math.max(Math.min(popper[len]-arrowElementSize,sideValue),0),data.arrowElement=arrowElement,data.offsets.arrow=(defineProperty(_data$offsets$arrow={},side,Math.round(sideValue)),defineProperty(_data$offsets$arrow,altSide,""),_data$offsets$arrow),data}function getOppositeVariation(variation){return"end"===variation?"start":"start"===variation?"end":variation}var placements=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],validPlacements=placements.slice(3);function clockwise(placement){var counter=arguments.length>1&&void 0!==arguments[1]&&arguments[1],index=validPlacements.indexOf(placement),arr=validPlacements.slice(index+1).concat(validPlacements.slice(0,index));return counter?arr.reverse():arr}var BEHAVIORS_FLIP="flip",BEHAVIORS_CLOCKWISE="clockwise",BEHAVIORS_COUNTERCLOCKWISE="counterclockwise";function flip(data,options){if(isModifierEnabled(data.instance.modifiers,"inner"))return data;if(data.flipped&&data.placement===data.originalPlacement)return data;var boundaries=getBoundaries(data.instance.popper,data.instance.reference,options.padding,options.boundariesElement,data.positionFixed),placement=data.placement.split("-")[0],placementOpposite=getOppositePlacement(placement),variation=data.placement.split("-")[1]||"",flipOrder=[];switch(options.behavior){case BEHAVIORS_FLIP:flipOrder=[placement,placementOpposite];break;case BEHAVIORS_CLOCKWISE:flipOrder=clockwise(placement);break;case BEHAVIORS_COUNTERCLOCKWISE:flipOrder=clockwise(placement,!0);break;default:flipOrder=options.behavior}return flipOrder.forEach((function(step,index){if(placement!==step||flipOrder.length===index+1)return data;placement=data.placement.split("-")[0],placementOpposite=getOppositePlacement(placement);var popperOffsets=data.offsets.popper,refOffsets=data.offsets.reference,floor=Math.floor,overlapsRef="left"===placement&&floor(popperOffsets.right)>floor(refOffsets.left)||"right"===placement&&floor(popperOffsets.left)<floor(refOffsets.right)||"top"===placement&&floor(popperOffsets.bottom)>floor(refOffsets.top)||"bottom"===placement&&floor(popperOffsets.top)<floor(refOffsets.bottom),overflowsLeft=floor(popperOffsets.left)<floor(boundaries.left),overflowsRight=floor(popperOffsets.right)>floor(boundaries.right),overflowsTop=floor(popperOffsets.top)<floor(boundaries.top),overflowsBottom=floor(popperOffsets.bottom)>floor(boundaries.bottom),overflowsBoundaries="left"===placement&&overflowsLeft||"right"===placement&&overflowsRight||"top"===placement&&overflowsTop||"bottom"===placement&&overflowsBottom,isVertical=-1!==["top","bottom"].indexOf(placement),flippedVariationByRef=!!options.flipVariations&&(isVertical&&"start"===variation&&overflowsLeft||isVertical&&"end"===variation&&overflowsRight||!isVertical&&"start"===variation&&overflowsTop||!isVertical&&"end"===variation&&overflowsBottom),flippedVariationByContent=!!options.flipVariationsByContent&&(isVertical&&"start"===variation&&overflowsRight||isVertical&&"end"===variation&&overflowsLeft||!isVertical&&"start"===variation&&overflowsBottom||!isVertical&&"end"===variation&&overflowsTop),flippedVariation=flippedVariationByRef||flippedVariationByContent;(overlapsRef||overflowsBoundaries||flippedVariation)&&(data.flipped=!0,(overlapsRef||overflowsBoundaries)&&(placement=flipOrder[index+1]),flippedVariation&&(variation=getOppositeVariation(variation)),data.placement=placement+(variation?"-"+variation:""),data.offsets.popper=_extends({},data.offsets.popper,getPopperOffsets(data.instance.popper,data.offsets.reference,data.placement)),data=runModifiers(data.instance.modifiers,data,"flip"))})),data}function keepTogether(data){var _data$offsets=data.offsets,popper=_data$offsets.popper,reference=_data$offsets.reference,placement=data.placement.split("-")[0],floor=Math.floor,isVertical=-1!==["top","bottom"].indexOf(placement),side=isVertical?"right":"bottom",opSide=isVertical?"left":"top",measurement=isVertical?"width":"height";return popper[side]<floor(reference[opSide])&&(data.offsets.popper[opSide]=floor(reference[opSide])-popper[measurement]),popper[opSide]>floor(reference[side])&&(data.offsets.popper[opSide]=floor(reference[side])),data}function toValue(str,measurement,popperOffsets,referenceOffsets){var split=str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),value=+split[1],unit=split[2];if(!value)return str;if(0===unit.indexOf("%")){var element=void 0,rect;switch(unit){case"%p":element=popperOffsets;break;case"%":case"%r":default:element=referenceOffsets}return getClientRect(element)[measurement]/100*value}if("vh"===unit||"vw"===unit){var size=void 0;return(size="vh"===unit?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*value}return value}function parseOffset(offset,popperOffsets,referenceOffsets,basePlacement){var offsets=[0,0],useHeight=-1!==["right","left"].indexOf(basePlacement),fragments=offset.split(/(\+|\-)/).map((function(frag){return frag.trim()})),divider=fragments.indexOf(find(fragments,(function(frag){return-1!==frag.search(/,|\s/)})));fragments[divider]&&-1===fragments[divider].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var splitRegex=/\s*,\s*|\s+/,ops=-1!==divider?[fragments.slice(0,divider).concat([fragments[divider].split(splitRegex)[0]]),[fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider+1))]:[fragments];return(ops=ops.map((function(op,index){var measurement=(1===index?!useHeight:useHeight)?"height":"width",mergeWithPrevious=!1;return op.reduce((function(a,b){return""===a[a.length-1]&&-1!==["+","-"].indexOf(b)?(a[a.length-1]=b,mergeWithPrevious=!0,a):mergeWithPrevious?(a[a.length-1]+=b,mergeWithPrevious=!1,a):a.concat(b)}),[]).map((function(str){return toValue(str,measurement,popperOffsets,referenceOffsets)}))}))).forEach((function(op,index){op.forEach((function(frag,index2){isNumeric(frag)&&(offsets[index]+=frag*("-"===op[index2-1]?-1:1))}))})),offsets}function offset(data,_ref){var offset=_ref.offset,placement=data.placement,_data$offsets=data.offsets,popper=_data$offsets.popper,reference=_data$offsets.reference,basePlacement=placement.split("-")[0],offsets=void 0;return offsets=isNumeric(+offset)?[+offset,0]:parseOffset(offset,popper,reference,basePlacement),"left"===basePlacement?(popper.top+=offsets[0],popper.left-=offsets[1]):"right"===basePlacement?(popper.top+=offsets[0],popper.left+=offsets[1]):"top"===basePlacement?(popper.left+=offsets[0],popper.top-=offsets[1]):"bottom"===basePlacement&&(popper.left+=offsets[0],popper.top+=offsets[1]),data.popper=popper,data}function preventOverflow(data,options){var boundariesElement=options.boundariesElement||getOffsetParent(data.instance.popper);data.instance.reference===boundariesElement&&(boundariesElement=getOffsetParent(boundariesElement));var transformProp=getSupportedPropertyName("transform"),popperStyles=data.instance.popper.style,top=popperStyles.top,left=popperStyles.left,transform=popperStyles[transformProp];popperStyles.top="",popperStyles.left="",popperStyles[transformProp]="";var boundaries=getBoundaries(data.instance.popper,data.instance.reference,options.padding,boundariesElement,data.positionFixed);popperStyles.top=top,popperStyles.left=left,popperStyles[transformProp]=transform,options.boundaries=boundaries;var order=options.priority,popper=data.offsets.popper,check={primary:function primary(placement){var value=popper[placement];return popper[placement]<boundaries[placement]&&!options.escapeWithReference&&(value=Math.max(popper[placement],boundaries[placement])),defineProperty({},placement,value)},secondary:function secondary(placement){var mainSide="right"===placement?"left":"top",value=popper[mainSide];return popper[placement]>boundaries[placement]&&!options.escapeWithReference&&(value=Math.min(popper[mainSide],boundaries[placement]-("right"===placement?popper.width:popper.height))),defineProperty({},mainSide,value)}};return order.forEach((function(placement){var side=-1!==["left","top"].indexOf(placement)?"primary":"secondary";popper=_extends({},popper,check[side](placement))})),data.offsets.popper=popper,data}function shift(data){var placement=data.placement,basePlacement=placement.split("-")[0],shiftvariation=placement.split("-")[1];if(shiftvariation){var _data$offsets=data.offsets,reference=_data$offsets.reference,popper=_data$offsets.popper,isVertical=-1!==["bottom","top"].indexOf(basePlacement),side=isVertical?"left":"top",measurement=isVertical?"width":"height",shiftOffsets={start:defineProperty({},side,reference[side]),end:defineProperty({},side,reference[side]+reference[measurement]-popper[measurement])};data.offsets.popper=_extends({},popper,shiftOffsets[shiftvariation])}return data}function hide(data){if(!isModifierRequired(data.instance.modifiers,"hide","preventOverflow"))return data;var refRect=data.offsets.reference,bound=find(data.instance.modifiers,(function(modifier){return"preventOverflow"===modifier.name})).boundaries;if(refRect.bottom<bound.top||refRect.left>bound.right||refRect.top>bound.bottom||refRect.right<bound.left){if(!0===data.hide)return data;data.hide=!0,data.attributes["x-out-of-boundaries"]=""}else{if(!1===data.hide)return data;data.hide=!1,data.attributes["x-out-of-boundaries"]=!1}return data}function inner(data){var placement=data.placement,basePlacement=placement.split("-")[0],_data$offsets=data.offsets,popper=_data$offsets.popper,reference=_data$offsets.reference,isHoriz=-1!==["left","right"].indexOf(basePlacement),subtractLength=-1===["top","left"].indexOf(basePlacement);return popper[isHoriz?"left":"top"]=reference[basePlacement]-(subtractLength?popper[isHoriz?"width":"height"]:0),data.placement=getOppositePlacement(placement),data.offsets.popper=getClientRect(popper),data}var modifiers,Defaults={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function onCreate(){},onUpdate:function onUpdate(){},modifiers:{shift:{order:100,enabled:!0,fn:shift},offset:{order:200,enabled:!0,fn:offset,offset:0},preventOverflow:{order:300,enabled:!0,fn:preventOverflow,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:keepTogether},arrow:{order:500,enabled:!0,fn:arrow,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:flip,behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:inner},hide:{order:800,enabled:!0,fn:hide},computeStyle:{order:850,enabled:!0,fn:computeStyle,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:applyStyle,onLoad:applyStyleOnLoad,gpuAcceleration:void 0}}},Popper=function(){function Popper(reference,popper){var _this=this,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};classCallCheck(this,Popper),this.scheduleUpdate=function(){return requestAnimationFrame(_this.update)},this.update=debounce(this.update.bind(this)),this.options=_extends({},Popper.Defaults,options),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=reference&&reference.jquery?reference[0]:reference,this.popper=popper&&popper.jquery?popper[0]:popper,this.options.modifiers={},Object.keys(_extends({},Popper.Defaults.modifiers,options.modifiers)).forEach((function(name){_this.options.modifiers[name]=_extends({},Popper.Defaults.modifiers[name]||{},options.modifiers?options.modifiers[name]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(name){return _extends({name:name},_this.options.modifiers[name])})).sort((function(a,b){return a.order-b.order})),this.modifiers.forEach((function(modifierOptions){modifierOptions.enabled&&isFunction(modifierOptions.onLoad)&&modifierOptions.onLoad(_this.reference,_this.popper,_this.options,modifierOptions,_this.state)})),this.update();var eventsEnabled=this.options.eventsEnabled;eventsEnabled&&this.enableEventListeners(),this.state.eventsEnabled=eventsEnabled}return createClass(Popper,[{key:"update",value:function update$$1(){return update.call(this)}},{key:"destroy",value:function destroy$$1(){return destroy.call(this)}},{key:"enableEventListeners",value:function enableEventListeners$$1(){return enableEventListeners.call(this)}},{key:"disableEventListeners",value:function disableEventListeners$$1(){return disableEventListeners.call(this)}}]),Popper}();return Popper.Utils=("undefined"!=typeof window?window:global).PopperUtils,Popper.placements=placements,Popper.Defaults=Defaults,Popper})),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,(function(t,e,n){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t){var n=this,i=!1;return e(this).one(c.TRANSITION_END,(function(){i=!0})),setTimeout((function(){i||c.triggerTransitionEnd(n)}),t),this}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var c={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var n=e(t).css("transition-duration"),i=e(t).css("transition-delay"),o=parseFloat(n),s=parseFloat(i);return o||s?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){e(t).trigger("transitionend")},supportsTransitionEnd:function(){return Boolean("transitionend")},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],s=e[i],r=s&&c.isElement(s)?"element":null===(a=s)||void 0===a?""+a:{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(r))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+r+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if(void 0===e)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};c.jQueryDetection(),e.fn.emulateTransitionEnd=l,e.event.special[c.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var h="alert",u=e.fn[h],d=function(){function t(t){this._element=t}var n=t.prototype;return n.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},n.dispose=function(){e.removeData(this._element,"bs.alert"),this._element=null},n._getRootElement=function(t){var n=c.getSelectorFromElement(t),i=!1;return n&&(i=document.querySelector(n)),i||(i=e(t).closest(".alert")[0]),i},n._triggerCloseEvent=function(t){var n=e.Event("close.bs.alert");return e(t).trigger(n),n},n._removeElement=function(t){var n=this;if(e(t).removeClass("show"),e(t).hasClass("fade")){var i=c.getTransitionDurationFromElement(t);e(t).one(c.TRANSITION_END,(function(e){return n._destroyElement(t,e)})).emulateTransitionEnd(i)}else this._destroyElement(t)},n._destroyElement=function(t){e(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||(o=new t(this),i.data("bs.alert",o)),"close"===n&&o[n](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',d._handleDismiss(new d)),e.fn[h]=d._jQueryInterface,e.fn[h].Constructor=d,e.fn[h].noConflict=function(){return e.fn[h]=u,d._jQueryInterface};var f=e.fn.button,g=function(){function t(t){this._element=t}var n=t.prototype;return n.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var o=this._element.querySelector('input:not([type="hidden"])');if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains("active"))t=!1;else{var s=i.querySelector(".active");s&&e(s).removeClass("active")}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains("active")),e(o).trigger("change")),o.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},n.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.button");i||(i=new t(this),e(this).data("bs.button",i)),"toggle"===n&&i[n]()}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"LABEL"===i.tagName&&o&&"checkbox"===o.type&&t.preventDefault(),g._jQueryInterface.call(e(n),"toggle")}})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))})),e(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e<n;e++){var i=t[e],o=i.querySelector('input:not([type="hidden"])');o.checked||o.hasAttribute("checked")?i.classList.add("active"):i.classList.remove("active")}for(var s=0,r=(t=[].slice.call(document.querySelectorAll('[data-toggle="button"]'))).length;s<r;s++){var a=t[s];"true"===a.getAttribute("aria-pressed")?a.classList.add("active"):a.classList.remove("active")}})),e.fn.button=g._jQueryInterface,e.fn.button.Constructor=g,e.fn.button.noConflict=function(){return e.fn.button=f,g._jQueryInterface};var m="carousel",p=".bs.carousel",_=e.fn[m],v={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},b={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},y={TOUCH:"touch",PEN:"pen"},E=function(){function t(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(".carousel-indicators"),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&e(this._element).is(":visible")&&"hidden"!==e(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(c.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var n=this;this._activeElement=this._element.querySelector(".active.carousel-item");var i=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)e(this._element).one("slid.bs.carousel",(function(){return n.to(t)}));else{if(i===t)return this.pause(),void this.cycle();var o=t>i?"next":"prev";this._slide(o,this._items[t])}},n.dispose=function(){e(this._element).off(p),e.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=a(a({},v),t),c.typeCheckConfig(m,t,b),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},n._addEventListeners=function(){var t=this;this._config.keyboard&&e(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&e(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var n=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},i=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};e(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(e(this._element).on("pointerdown.bs.carousel",(function(t){return n(t)})),e(this._element).on("pointerup.bs.carousel",(function(t){return i(t)})),this._element.classList.add("pointer-event")):(e(this._element).on("touchstart.bs.carousel",(function(t){return n(t)})),e(this._element).on("touchmove.bs.carousel",(function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),e(this._element).on("touchend.bs.carousel",(function(t){return i(t)})))}},n._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},n._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+("prev"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,n){var i=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(".active.carousel-item")),s=e.Event("slide.bs.carousel",{relatedTarget:t,direction:n,from:o,to:i});return e(this._element).trigger(s),s},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));e(n).removeClass("active");var i=this._indicatorsElement.children[this._getItemIndex(t)];i&&e(i).addClass("active")}},n._slide=function(t,n){var i,o,s,r=this,a=this._element.querySelector(".active.carousel-item"),l=this._getItemIndex(a),h=n||a&&this._getItemByDirection(t,a),u=this._getItemIndex(h),d=Boolean(this._interval);if("next"===t?(i="carousel-item-left",o="carousel-item-next",s="left"):(i="carousel-item-right",o="carousel-item-prev",s="right"),h&&e(h).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(h,s).isDefaultPrevented()&&a&&h){this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(h);var f=e.Event("slid.bs.carousel",{relatedTarget:h,direction:s,from:l,to:u});if(e(this._element).hasClass("slide")){e(h).addClass(o),c.reflow(h),e(a).addClass(i),e(h).addClass(i);var g=parseInt(h.getAttribute("data-interval"),10);g?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=g):this._config.interval=this._config.defaultInterval||this._config.interval;var m=c.getTransitionDurationFromElement(a);e(a).one(c.TRANSITION_END,(function(){e(h).removeClass(i+" "+o).addClass("active"),e(a).removeClass("active "+o+" "+i),r._isSliding=!1,setTimeout((function(){return e(r._element).trigger(f)}),0)})).emulateTransitionEnd(m)}else e(a).removeClass("active"),e(h).addClass("active"),this._isSliding=!1,e(this._element).trigger(f);d&&this.cycle()}},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.carousel"),o=a(a({},v),e(this).data());"object"==typeof n&&(o=a(a({},o),n));var s="string"==typeof n?n:o.slide;if(i||(i=new t(this,o),e(this).data("bs.carousel",i)),"number"==typeof n)i.to(n);else if("string"==typeof s){if(void 0===i[s])throw new TypeError('No method named "'+s+'"');i[s]()}else o.interval&&o.ride&&(i.pause(),i.cycle())}))},t._dataApiClickHandler=function(n){var i=c.getSelectorFromElement(this);if(i){var o=e(i)[0];if(o&&e(o).hasClass("carousel")){var s=a(a({},e(o).data()),e(this).data()),r=this.getAttribute("data-slide-to");r&&(s.interval=!1),t._jQueryInterface.call(e(o),s),r&&e(o).data("bs.carousel").to(r),n.preventDefault()}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return v}}]),t}();e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",E._dataApiClickHandler),e(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),n=0,i=t.length;n<i;n++){var o=e(t[n]);E._jQueryInterface.call(o,o.data())}})),e.fn[m]=E._jQueryInterface,e.fn[m].Constructor=E,e.fn[m].noConflict=function(){return e.fn[m]=_,E._jQueryInterface};var w="collapse",T=e.fn[w],C={toggle:!0,parent:""},S={toggle:"boolean",parent:"(string|element)"},D=function(){function t(t,e){this._isTransitioning=!1,this._element=t,this._config=this._getConfig(e),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'));for(var n=[].slice.call(document.querySelectorAll('[data-toggle="collapse"]')),i=0,o=n.length;i<o;i++){var s=n[i],r=c.getSelectorFromElement(s),a=[].slice.call(document.querySelectorAll(r)).filter((function(e){return e===t}));null!==r&&a.length>0&&(this._selector=r,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=t.prototype;return n.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},n.show=function(){var n,i,o=this;if(!(this._isTransitioning||e(this._element).hasClass("show")||(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains("collapse")}))).length&&(n=null),n&&(i=e(n).not(this._selector).data("bs.collapse"))&&i._isTransitioning))){var s=e.Event("show.bs.collapse");if(e(this._element).trigger(s),!s.isDefaultPrevented()){n&&(t._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data("bs.collapse",null));var r=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[r]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var a="scroll"+(r[0].toUpperCase()+r.slice(1)),l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[r]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(l),this._element.style[r]=this._element[a]+"px"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var n=e.Event("hide.bs.collapse");if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",c.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var s=0;s<o;s++){var r=this._triggerArray[s],a=c.getSelectorFromElement(r);null!==a&&(e([].slice.call(document.querySelectorAll(a))).hasClass("show")||e(r).addClass("collapsed").attr("aria-expanded",!1))}this.setTransitioning(!0),this._element.style[i]="";var l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){t.setTransitioning(!1),e(t._element).removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")})).emulateTransitionEnd(l)}}},n.setTransitioning=function(t){this._isTransitioning=t},n.dispose=function(){e.removeData(this._element,"bs.collapse"),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},n._getConfig=function(t){return(t=a(a({},C),t)).toggle=Boolean(t.toggle),c.typeCheckConfig(w,t,S),t},n._getDimension=function(){return e(this._element).hasClass("width")?"width":"height"},n._getParent=function(){var n,i=this;c.isElement(this._config.parent)?(n=this._config.parent,void 0!==this._config.parent.jquery&&(n=this._config.parent[0])):n=document.querySelector(this._config.parent);var o='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',s=[].slice.call(n.querySelectorAll(o));return e(s).each((function(e,n){i._addAriaAndCollapsedClass(t._getTargetFromElement(n),[n])})),n},n._addAriaAndCollapsedClass=function(t,n){var i=e(t).hasClass("show");n.length&&e(n).toggleClass("collapsed",!i).attr("aria-expanded",i)},t._getTargetFromElement=function(t){var e=c.getSelectorFromElement(t);return e?document.querySelector(e):null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.collapse"),s=a(a(a({},C),i.data()),"object"==typeof n&&n?n:{});if(!o&&s.toggle&&"string"==typeof n&&/show|hide/.test(n)&&(s.toggle=!1),o||(o=new t(this,s),i.data("bs.collapse",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return C}}]),t}();e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=e(this),i=c.getSelectorFromElement(this),o=[].slice.call(document.querySelectorAll(i));e(o).each((function(){var t=e(this),i=t.data("bs.collapse")?"toggle":n.data();D._jQueryInterface.call(t,i)}))})),e.fn[w]=D._jQueryInterface,e.fn[w].Constructor=D,e.fn[w].noConflict=function(){return e.fn[w]=T,D._jQueryInterface};var k="dropdown",N=e.fn[k],A=new RegExp("38|40|27"),I={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},O={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},j=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var i=t.prototype;return i.toggle=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")){var n=e(this._menu).hasClass("show");t._clearMenus(),n||this.show(!0)}},i.show=function(i){if(void 0===i&&(i=!1),!(this._element.disabled||e(this._element).hasClass("disabled")||e(this._menu).hasClass("show"))){var o={relatedTarget:this._element},s=e.Event("show.bs.dropdown",o),r=t._getParentFromElement(this._element);if(e(r).trigger(s),!s.isDefaultPrevented()){if(!this._inNavbar&&i){if(void 0===n)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var a=this._element;"parent"===this._config.reference?a=r:c.isElement(this._config.reference)&&(a=this._config.reference,void 0!==this._config.reference.jquery&&(a=this._config.reference[0])),"scrollParent"!==this._config.boundary&&e(r).addClass("position-static"),this._popper=new n(a,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===e(r).closest(".navbar-nav").length&&e(document.body).children().on("mouseover",null,e.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),e(this._menu).toggleClass("show"),e(r).toggleClass("show").trigger(e.Event("shown.bs.dropdown",o))}}},i.hide=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")&&e(this._menu).hasClass("show")){var n={relatedTarget:this._element},i=e.Event("hide.bs.dropdown",n),o=t._getParentFromElement(this._element);e(o).trigger(i),i.isDefaultPrevented()||(this._popper&&this._popper.destroy(),e(this._menu).toggleClass("show"),e(o).toggleClass("show").trigger(e.Event("hidden.bs.dropdown",n)))}},i.dispose=function(){e.removeData(this._element,"bs.dropdown"),e(this._element).off(".bs.dropdown"),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},i.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},i._addEventListeners=function(){var t=this;e(this._element).on("click.bs.dropdown",(function(e){e.preventDefault(),e.stopPropagation(),t.toggle()}))},i._getConfig=function(t){return t=a(a(a({},this.constructor.Default),e(this._element).data()),t),c.typeCheckConfig(k,t,this.constructor.DefaultType),t},i._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(".dropdown-menu"))}return this._menu},i._getPlacement=function(){var t=e(this._element.parentNode),n="bottom-start";return t.hasClass("dropup")?n=e(this._menu).hasClass("dropdown-menu-right")?"top-end":"top-start":t.hasClass("dropright")?n="right-start":t.hasClass("dropleft")?n="left-start":e(this._menu).hasClass("dropdown-menu-right")&&(n="bottom-end"),n},i._detectNavbar=function(){return e(this._element).closest(".navbar").length>0},i._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},i._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),a(a({},t),this._config.popperConfig)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.dropdown");if(i||(i=new t(this,"object"==typeof n?n:null),e(this).data("bs.dropdown",i)),"string"==typeof n){if(void 0===i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},t._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var i=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),o=0,s=i.length;o<s;o++){var r=t._getParentFromElement(i[o]),a=e(i[o]).data("bs.dropdown"),l={relatedTarget:i[o]};if(n&&"click"===n.type&&(l.clickEvent=n),a){var c=a._menu;if(e(r).hasClass("show")&&!(n&&("click"===n.type&&/input|textarea/i.test(n.target.tagName)||"keyup"===n.type&&9===n.which)&&e.contains(r,n.target))){var h=e.Event("hide.bs.dropdown",l);e(r).trigger(h),h.isDefaultPrevented()||("ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),i[o].setAttribute("aria-expanded","false"),a._popper&&a._popper.destroy(),e(c).removeClass("show"),e(r).removeClass("show").trigger(e.Event("hidden.bs.dropdown",l)))}}}},t._getParentFromElement=function(t){var e,n=c.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},t._dataApiKeydownHandler=function(n){if(!(/input|textarea/i.test(n.target.tagName)?32===n.which||27!==n.which&&(40!==n.which&&38!==n.which||e(n.target).closest(".dropdown-menu").length):!A.test(n.which))&&!this.disabled&&!e(this).hasClass("disabled")){var i=t._getParentFromElement(this),o=e(i).hasClass("show");if(o||27!==n.which){if(n.preventDefault(),n.stopPropagation(),!o||o&&(27===n.which||32===n.which))return 27===n.which&&e(i.querySelector('[data-toggle="dropdown"]')).trigger("focus"),void e(this).trigger("click");var s=[].slice.call(i.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter((function(t){return e(t).is(":visible")}));if(0!==s.length){var r=s.indexOf(n.target);38===n.which&&r>0&&r--,40===n.which&&r<s.length-1&&r++,r<0&&(r=0),s[r].focus()}}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return I}},{key:"DefaultType",get:function(){return O}}]),t}();e(document).on("keydown.bs.dropdown.data-api",'[data-toggle="dropdown"]',j._dataApiKeydownHandler).on("keydown.bs.dropdown.data-api",".dropdown-menu",j._dataApiKeydownHandler).on("click.bs.dropdown.data-api keyup.bs.dropdown.data-api",j._clearMenus).on("click.bs.dropdown.data-api",'[data-toggle="dropdown"]',(function(t){t.preventDefault(),t.stopPropagation(),j._jQueryInterface.call(e(this),"toggle")})).on("click.bs.dropdown.data-api",".dropdown form",(function(t){t.stopPropagation()})),e.fn[k]=j._jQueryInterface,e.fn[k].Constructor=j,e.fn[k].noConflict=function(){return e.fn[k]=N,j._jQueryInterface};var P=e.fn.modal,x={backdrop:!0,keyboard:!0,focus:!0,show:!0},L={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},R=function(){function t(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(".modal-dialog"),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var n=t.prototype;return n.toggle=function(t){return this._isShown?this.hide():this.show(t)},n.show=function(t){var n=this;if(!this._isShown&&!this._isTransitioning){e(this._element).hasClass("fade")&&(this._isTransitioning=!0);var i=e.Event("show.bs.modal",{relatedTarget:t});e(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),e(this._element).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',(function(t){return n.hide(t)})),e(this._dialog).on("mousedown.dismiss.bs.modal",(function(){e(n._element).one("mouseup.dismiss.bs.modal",(function(t){e(t.target).is(n._element)&&(n._ignoreBackdropClick=!0)}))})),this._showBackdrop((function(){return n._showElement(t)})))}},n.hide=function(t){var n=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var i=e.Event("hide.bs.modal");if(e(this._element).trigger(i),this._isShown&&!i.isDefaultPrevented()){this._isShown=!1;var o=e(this._element).hasClass("fade");if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),e(document).off("focusin.bs.modal"),e(this._element).removeClass("show"),e(this._element).off("click.dismiss.bs.modal"),e(this._dialog).off("mousedown.dismiss.bs.modal"),o){var s=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(t){return n._hideModal(t)})).emulateTransitionEnd(s)}else this._hideModal()}}},n.dispose=function(){[window,this._element,this._dialog].forEach((function(t){return e(t).off(".bs.modal")})),e(document).off("focusin.bs.modal"),e.removeData(this._element,"bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},n.handleUpdate=function(){this._adjustDialog()},n._getConfig=function(t){return t=a(a({},x),t),c.typeCheckConfig("modal",t,L),t},n._triggerBackdropTransition=function(){var t=this;if("static"===this._config.backdrop){var n=e.Event("hidePrevented.bs.modal");if(e(this._element).trigger(n),n.defaultPrevented)return;this._element.classList.add("modal-static");var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){t._element.classList.remove("modal-static")})).emulateTransitionEnd(i),this._element.focus()}else this.hide()},n._showElement=function(t){var n=this,i=e(this._element).hasClass("fade"),o=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),e(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,i&&c.reflow(this._element),e(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t}),r=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,e(n._element).trigger(s)};if(i){var a=c.getTransitionDurationFromElement(this._dialog);e(this._dialog).one(c.TRANSITION_END,r).emulateTransitionEnd(a)}else r()},n._enforceFocus=function(){var t=this;e(document).off("focusin.bs.modal").on("focusin.bs.modal",(function(n){document!==n.target&&t._element!==n.target&&0===e(t._element).has(n.target).length&&t._element.focus()}))},n._setEscapeEvent=function(){var t=this;this._isShown?e(this._element).on("keydown.dismiss.bs.modal",(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||e(this._element).off("keydown.dismiss.bs.modal")},n._setResizeEvent=function(){var t=this;this._isShown?e(window).on("resize.bs.modal",(function(e){return t.handleUpdate(e)})):e(window).off("resize.bs.modal")},n._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop((function(){e(document.body).removeClass("modal-open"),t._resetAdjustments(),t._resetScrollbar(),e(t._element).trigger("hidden.bs.modal")}))},n._removeBackdrop=function(){this._backdrop&&(e(this._backdrop).remove(),this._backdrop=null)},n._showBackdrop=function(t){var n=this,i=e(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",i&&this._backdrop.classList.add(i),e(this._backdrop).appendTo(document.body),e(this._element).on("click.dismiss.bs.modal",(function(t){n._ignoreBackdropClick?n._ignoreBackdropClick=!1:t.target===t.currentTarget&&n._triggerBackdropTransition()})),i&&c.reflow(this._backdrop),e(this._backdrop).addClass("show"),!t)return;if(!i)return void t();var o=c.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(c.TRANSITION_END,t).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){e(this._backdrop).removeClass("show");var s=function(){n._removeBackdrop(),t&&t()};if(e(this._element).hasClass("fade")){var r=c.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s()}else t&&t()},n._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},n._setScrollbar=function(){var t=this;if(this._isBodyOverflowing){var n=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top")),i=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(n,i){var o=i.style.paddingRight,s=e(i).css("padding-right");e(i).data("padding-right",o).css("padding-right",parseFloat(s)+t._scrollbarWidth+"px")})),e(i).each((function(n,i){var o=i.style.marginRight,s=e(i).css("margin-right");e(i).data("margin-right",o).css("margin-right",parseFloat(s)-t._scrollbarWidth+"px")}));var o=document.body.style.paddingRight,s=e(document.body).css("padding-right");e(document.body).data("padding-right",o).css("padding-right",parseFloat(s)+this._scrollbarWidth+"px")}e(document.body).addClass("modal-open")},n._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"));e(t).each((function(t,n){var i=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=i||""}));var n=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(t,n){var i=e(n).data("margin-right");void 0!==i&&e(n).css("margin-right",i).removeData("margin-right")}));var i=e(document.body).data("padding-right");e(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},n._getScrollbarWidth=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},t._jQueryInterface=function(n,i){return this.each((function(){var o=e(this).data("bs.modal"),s=a(a(a({},x),e(this).data()),"object"==typeof n&&n?n:{});if(o||(o=new t(this,s),e(this).data("bs.modal",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n](i)}else s.show&&o.show(i)}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return x}}]),t}();e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(t){var n,i=this,o=c.getSelectorFromElement(this);o&&(n=document.querySelector(o));var s=e(n).data("bs.modal")?"toggle":a(a({},e(n).data()),e(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=e(n).one("show.bs.modal",(function(t){t.isDefaultPrevented()||r.one("hidden.bs.modal",(function(){e(i).is(":visible")&&i.focus()}))}));R._jQueryInterface.call(e(n),s,this)})),e.fn.modal=R._jQueryInterface,e.fn.modal.Constructor=R,e.fn.modal.noConflict=function(){return e.fn.modal=P,R._jQueryInterface};var q=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],F={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Q=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi,B=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;function H(t,e,n){if(0===t.length)return t;if(n&&"function"==typeof n)return n(t);for(var i=(new window.DOMParser).parseFromString(t,"text/html"),o=Object.keys(e),s=[].slice.call(i.body.querySelectorAll("*")),r=function(t,n){var i=s[t],r=i.nodeName.toLowerCase();if(-1===o.indexOf(i.nodeName.toLowerCase()))return i.parentNode.removeChild(i),"continue";var a=[].slice.call(i.attributes),l=[].concat(e["*"]||[],e[r]||[]);a.forEach((function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===q.indexOf(n)||Boolean(t.nodeValue.match(Q)||t.nodeValue.match(B));for(var i=e.filter((function(t){return t instanceof RegExp})),o=0,s=i.length;o<s;o++)if(n.match(i[o]))return!0;return!1})(t,l)||i.removeAttribute(t.nodeName)}))},a=0,l=s.length;a<l;a++)r(a);return i.body.innerHTML}var U="tooltip",M=e.fn[U],W=new RegExp("(^|\\s)bs-tooltip\\S+","g"),V=["sanitize","whiteList","sanitizeFn"],z={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},K={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},X={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:F,popperConfig:null},Y={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},$=function(){function t(t,e){if(void 0===n)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var i=t.prototype;return i.enable=function(){this._isEnabled=!0},i.disable=function(){this._isEnabled=!1},i.toggleEnabled=function(){this._isEnabled=!this._isEnabled},i.toggle=function(t){if(this._isEnabled)if(t){var n=this.constructor.DATA_KEY,i=e(t.currentTarget).data(n);i||(i=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(e(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},i.dispose=function(){clearTimeout(this._timeout),e.removeData(this.element,this.constructor.DATA_KEY),e(this.element).off(this.constructor.EVENT_KEY),e(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&e(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},i.show=function(){var t=this;if("none"===e(this.element).css("display"))throw new Error("Please use show on visible elements");var i=e.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){e(this.element).trigger(i);var o=c.findShadowRoot(this.element),s=e.contains(null!==o?o:this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),a=c.getUID(this.constructor.NAME);r.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&e(r).addClass("fade");var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var u=this._getContainer();e(r).data(this.constructor.DATA_KEY,this),e.contains(this.element.ownerDocument.documentElement,this.tip)||e(r).appendTo(u),e(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,this._getPopperConfig(h)),e(r).addClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().on("mouseover",null,e.noop);var d=function(){t.config.animation&&t._fixTransition();var n=t._hoverState;t._hoverState=null,e(t.element).trigger(t.constructor.Event.SHOWN),"out"===n&&t._leave(null,t)};if(e(this.tip).hasClass("fade")){var f=c.getTransitionDurationFromElement(this.tip);e(this.tip).one(c.TRANSITION_END,d).emulateTransitionEnd(f)}else d()}},i.hide=function(t){var n=this,i=this.getTipElement(),o=e.Event(this.constructor.Event.HIDE),s=function(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),e(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),t&&t()};if(e(this.element).trigger(o),!o.isDefaultPrevented()){if(e(i).removeClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,e(this.tip).hasClass("fade")){var r=c.getTransitionDurationFromElement(i);e(i).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s();this._hoverState=""}},i.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},i.isWithContent=function(){return Boolean(this.getTitle())},i.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-tooltip-"+t)},i.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},i.setContent=function(){var t=this.getTipElement();this.setElementContent(e(t.querySelectorAll(".tooltip-inner")),this.getTitle()),e(t).removeClass("fade show")},i.setElementContent=function(t,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=H(n,this.config.whiteList,this.config.sanitizeFn)),t.html(n)):t.text(n):this.config.html?e(n).parent().is(t)||t.empty().append(n):t.text(e(n).text())},i.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},i._getPopperConfig=function(t){var e=this;return a(a({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),this.config.popperConfig)},i._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},i._getContainer=function(){return!1===this.config.container?document.body:c.isElement(this.config.container)?e(this.config.container):e(document).find(this.config.container)},i._getAttachment=function(t){return K[t.toUpperCase()]},i._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(n){if("click"===n)e(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==n){var i="hover"===n?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o="hover"===n?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;e(t.element).on(i,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},e(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=a(a({},this.config),{},{trigger:"manual",selector:""}):this._fixTitle()},i._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},i._enter=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e(n.getTipElement()).hasClass("show")||"show"===n._hoverState?n._hoverState="show":(clearTimeout(n._timeout),n._hoverState="show",n.config.delay&&n.config.delay.show?n._timeout=setTimeout((function(){"show"===n._hoverState&&n.show()}),n.config.delay.show):n.show())},i._leave=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState="out",n.config.delay&&n.config.delay.hide?n._timeout=setTimeout((function(){"out"===n._hoverState&&n.hide()}),n.config.delay.hide):n.hide())},i._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},i._getConfig=function(t){var n=e(this.element).data();return Object.keys(n).forEach((function(t){-1!==V.indexOf(t)&&delete n[t]})),"number"==typeof(t=a(a(a({},this.constructor.Default),n),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),c.typeCheckConfig(U,t,this.constructor.DefaultType),t.sanitize&&(t.template=H(t.template,t.whiteList,t.sanitizeFn)),t},i._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},i._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(W);null!==n&&n.length&&t.removeClass(n.join(""))},i._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},i._fixTransition=function(){var t=this.getTipElement(),n=this.config.animation;null===t.getAttribute("x-placement")&&(e(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.tooltip"),o="object"==typeof n&&n;if((i||!/dispose|hide/.test(n))&&(i||(i=new t(this,o),e(this).data("bs.tooltip",i)),"string"==typeof n)){if(void 0===i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return X}},{key:"NAME",get:function(){return U}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Y}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return z}}]),t}();e.fn[U]=$._jQueryInterface,e.fn[U].Constructor=$,e.fn[U].noConflict=function(){return e.fn[U]=M,$._jQueryInterface};var J="popover",G=e.fn[J],Z=new RegExp("(^|\\s)bs-popover\\S+","g"),tt=a(a({},$.Default),{},{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),et=a(a({},$.DefaultType),{},{content:"(string|element|function)"}),nt={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},it=function(t){var n,i;function s(){return t.apply(this,arguments)||this}i=t,(n=s).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var r=s.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},r.setContent=function(){var t=e(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(t.find(".popover-body"),n),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(Z);null!==n&&n.length>0&&t.removeClass(n.join(""))},s._jQueryInterface=function(t){return this.each((function(){var n=e(this).data("bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new s(this,i),e(this).data("bs.popover",n)),"string"==typeof t)){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},o(s,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return tt}},{key:"NAME",get:function(){return J}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return nt}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return et}}]),s}($);e.fn[J]=it._jQueryInterface,e.fn[J].Constructor=it,e.fn[J].noConflict=function(){return e.fn[J]=G,it._jQueryInterface};var ot="scrollspy",st=e.fn[ot],rt={offset:10,method:"auto",target:""},at={offset:"number",method:"string",target:"(string|element)"},lt=function(){function t(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return i._process(t)})),this.refresh(),this._process()}var n=t.prototype;return n.refresh=function(){var t=this,n=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?n:this._config.method,o="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var n,s=c.getSelectorFromElement(t);if(s&&(n=document.querySelector(s)),n){var r=n.getBoundingClientRect();if(r.width||r.height)return[e(n)[i]().top+o,s]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},n.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=a(a({},rt),"object"==typeof t&&t?t:{})).target&&c.isElement(t.target)){var n=e(t.target).attr("id");n||(n=c.getUID(ot),e(t.target).attr("id",n)),t.target="#"+n}return c.typeCheckConfig(ot,t,at),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}},n._activate=function(t){this._activeTarget=t,this._clear();var n=this._selector.split(",").map((function(e){return e+'[data-target="'+t+'"],'+e+'[href="'+t+'"]'})),i=e([].slice.call(document.querySelectorAll(n.join(","))));i.hasClass("dropdown-item")?(i.closest(".dropdown").find(".dropdown-toggle").addClass("active"),i.addClass("active")):(i.addClass("active"),i.parents(".nav, .list-group").prev(".nav-link, .list-group-item").addClass("active"),i.parents(".nav, .list-group").prev(".nav-item").children(".nav-link").addClass("active")),e(this._scrollElement).trigger("activate.bs.scrollspy",{relatedTarget:t})},n._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter((function(t){return t.classList.contains("active")})).forEach((function(t){return t.classList.remove("active")}))},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.scrollspy");if(i||(i=new t(this,"object"==typeof n&&n),e(this).data("bs.scrollspy",i)),"string"==typeof n){if(void 0===i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return rt}}]),t}();e(window).on("load.bs.scrollspy.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),n=t.length;n--;){var i=e(t[n]);lt._jQueryInterface.call(i,i.data())}})),e.fn[ot]=lt._jQueryInterface,e.fn[ot].Constructor=lt,e.fn[ot].noConflict=function(){return e.fn[ot]=st,lt._jQueryInterface};var ct=e.fn.tab,ht=function(){function t(t){this._element=t}var n=t.prototype;return n.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&e(this._element).hasClass("active")||e(this._element).hasClass("disabled"))){var n,i,o=e(this._element).closest(".nav, .list-group")[0],s=c.getSelectorFromElement(this._element);if(o){var r="UL"===o.nodeName||"OL"===o.nodeName?"> li > .active":".active";i=(i=e.makeArray(e(o).find(r)))[i.length-1]}var a=e.Event("hide.bs.tab",{relatedTarget:this._element}),l=e.Event("show.bs.tab",{relatedTarget:i});if(i&&e(i).trigger(a),e(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=document.querySelector(s)),this._activate(this._element,o);var h=function(){var n=e.Event("hidden.bs.tab",{relatedTarget:t._element}),o=e.Event("shown.bs.tab",{relatedTarget:i});e(i).trigger(n),e(t._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},n.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(t,n,i){var o=this,s=(!n||"UL"!==n.nodeName&&"OL"!==n.nodeName?e(n).children(".active"):e(n).find("> li > .active"))[0],r=i&&s&&e(s).hasClass("fade"),a=function(){return o._transitionComplete(t,s,i)};if(s&&r){var l=c.getTransitionDurationFromElement(s);e(s).removeClass("show").one(c.TRANSITION_END,a).emulateTransitionEnd(l)}else a()},n._transitionComplete=function(t,n,i){if(n){e(n).removeClass("active");var o=e(n.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(e(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),c.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&e(t.parentNode).hasClass("dropdown-menu")){var s=e(t).closest(".dropdown")[0];if(s){var r=[].slice.call(s.querySelectorAll(".dropdown-toggle"));e(r).addClass("active")}t.setAttribute("aria-expanded",!0)}i&&i()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.tab");if(o||(o=new t(this),i.data("bs.tab",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),ht._jQueryInterface.call(e(this),"show")})),e.fn.tab=ht._jQueryInterface,e.fn.tab.Constructor=ht,e.fn.tab.noConflict=function(){return e.fn.tab=ct,ht._jQueryInterface};var ut=e.fn.toast,dt={animation:"boolean",autohide:"boolean",delay:"number"},ft={animation:!0,autohide:!0,delay:500},gt=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var n=t.prototype;return n.show=function(){var t=this,n=e.Event("show.bs.toast");if(e(this._element).trigger(n),!n.isDefaultPrevented()){this._config.animation&&this._element.classList.add("fade");var i=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),e(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),c.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var o=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,i).emulateTransitionEnd(o)}else i()}},n.hide=function(){if(this._element.classList.contains("show")){var t=e.Event("hide.bs.toast");e(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},n.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains("show")&&this._element.classList.remove("show"),e(this._element).off("click.dismiss.bs.toast"),e.removeData(this._element,"bs.toast"),this._element=null,this._config=null},n._getConfig=function(t){return t=a(a(a({},ft),e(this._element).data()),"object"==typeof t&&t?t:{}),c.typeCheckConfig("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;e(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',(function(){return t.hide()}))},n._close=function(){var t=this,n=function(){t._element.classList.add("hide"),e(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,n).emulateTransitionEnd(i)}else n()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.toast");if(o||(o=new t(this,"object"==typeof n&&n),i.data("bs.toast",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n](this)}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"DefaultType",get:function(){return dt}},{key:"Default",get:function(){return ft}}]),t}();e.fn.toast=gt._jQueryInterface,e.fn.toast.Constructor=gt,e.fn.toast.noConflict=function(){return e.fn.toast=ut,gt._jQueryInterface},t.Alert=d,t.Button=g,t.Carousel=E,t.Collapse=D,t.Dropdown=j,t.Modal=R,t.Popover=it,t.Scrollspy=lt,t.Tab=ht,t.Toast=gt,t.Tooltip=$,t.Util=c,Object.defineProperty(t,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,(function(){"use strict";var e,i;function f(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(m(e,t))return;return 1}function r(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){for(var n=[],s=0;s<e.length;++s)n.push(t(e[s],s));return n}function c(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function _(e,t,n,s){return xt(e,t,n,s,!0).utc()}function y(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function g(e){if(null==e._isValid){var t=y(e),n=i.call(t.parsedDateParts,(function(e){return null!=e})),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function w(e){var t=_(NaN);return null!=e?c(y(t),e):y(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var p=f.momentProperties=[],t=!1;function v(e,t){var n,s,i;if(r(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),r(t._i)||(e._i=t._i),r(t._f)||(e._f=t._f),r(t._l)||(e._l=t._l),r(t._strict)||(e._strict=t._strict),r(t._tzm)||(e._tzm=t._tzm),r(t._isUTC)||(e._isUTC=t._isUTC),r(t._offset)||(e._offset=t._offset),r(t._pf)||(e._pf=y(t)),r(t._locale)||(e._locale=t._locale),0<p.length)for(n=0;n<p.length;n++)r(i=t[s=p[n]])||(e[s]=i);return e}function k(e){v(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,f.updateOffset(this),t=!1)}function M(e){return e instanceof k||null!=e&&null!=e._isAMomentObject}function D(e){!1===f.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return c((function(){if(null!=f.deprecationHandler&&f.deprecationHandler(null,i),a){for(var e,t,n=[],s=0;s<arguments.length;s++){if(e="","object"==typeof arguments[s]){for(t in e+="\n["+s+"] ",arguments[0])m(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[s];n.push(e)}D(i+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)}),r)}var s,S={};function Y(e,t){null!=f.deprecationHandler&&f.deprecationHandler(e,t),S[e]||(D(t),S[e]=!0)}function O(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=c({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},c(s[n],e[n]),c(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=c({},s[n]));return s}function x(e){null!=e&&this.set(e)}function T(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,P=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},W={};function C(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(W[e]=i),t&&(W[t[0]]=function(){return T(i.apply(this,arguments),t[1],t[2])}),n&&(W[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function U(e,t){return e.isValid()?(t=H(t,e.localeData()),R[t]=R[t]||function(s){for(var e,i=s.match(N),t=0,r=i.length;t<r;t++)W[i[t]]?i[t]=W[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=O(i[n])?i[n].call(e,s):i[n];return t}}(t),R[t](e)):e.localeData().invalidDate()}function H(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(P.lastIndex=0;0<=n&&P.test(e);)e=e.replace(P,s),P.lastIndex=0,--n;return e}var F={};function L(e,t){var n=e.toLowerCase();F[n]=F[n+"s"]=F[t]=e}function V(e){return"string"==typeof e?F[e]||F[e.toLowerCase()]:void 0}function G(e){var t,n,s={};for(n in e)m(e,n)&&(t=V(n))&&(s[t]=e[n]);return s}var E={};function A(e,t){E[e]=t}function j(e){return e%4==0&&e%100!=0||e%400==0}function I(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Z(e){var t=+e,n=0;return 0!=t&&isFinite(t)&&(n=I(t)),n}function z(t,n){return function(e){return null!=e?(q(this,t,e),f.updateOffset(this,n),this):$(this,t)}}function $(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function q(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&j(e.year())&&1===e.month()&&29===e.date()?(n=Z(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),xe(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var B,J=/\d/,Q=/\d\d/,X=/\d{3}/,K=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,ne=/\d\d\d\d?/,se=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,re=/\d{1,4}/,ae=/[+-]?\d{1,6}/,oe=/\d+/,ue=/[+-]?\d+/,le=/Z|[+-]\d\d:?\d\d/gi,he=/Z|[+-]\d\d(?::?\d\d)?/gi,de=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function ce(e,n,s){B[e]=O(n)?n:function(e,t){return e&&s?s:n}}function fe(e,t){return m(B,e)?B[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,s,i){return t||n||s||i}))))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}B={};var _e={};function ye(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),h(n)&&(s=function(e,t){t[n]=Z(e)}),t=0;t<e.length;t++)_e[e[t]]=s}function ge(e,i){ye(e,(function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)}))}var we,pe=0,ve=1,ke=2,Me=3,De=4,Se=5,Ye=6,Oe=7,be=8;function xe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1==s?j(e)?29:28:31-s%7%2}we=Array.prototype.indexOf?Array.prototype.indexOf:function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},C("M",["MM",2],"Mo",(function(){return this.month()+1})),C("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),C("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),L("month","M"),A("month",8),ce("M",te),ce("MM",te,Q),ce("MMM",(function(e,t){return t.monthsShortRegex(e)})),ce("MMMM",(function(e,t){return t.monthsRegex(e)})),ye(["M","MM"],(function(e,t){t[1]=Z(e)-1})),ye(["MMM","MMMM"],(function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[1]=i:y(n).invalidMonth=e}));var Te="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ne="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Re=de,We=de;function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Z(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),xe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ue(e){return null!=e?(Ce(this,e),f.updateOffset(this,!0),this):$(this,"Month")}function He(){function e(e,t){return t.length-e.length}for(var t,n=[],s=[],i=[],r=0;r<12;r++)t=_([2e3,r]),n.push(this.monthsShort(t,"")),s.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(n.sort(e),s.sort(e),i.sort(e),r=0;r<12;r++)n[r]=me(n[r]),s[r]=me(s[r]);for(r=0;r<24;r++)i[r]=me(i[r]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Fe(e){return j(e)?366:365}C("Y",0,0,(function(){var e=this.year();return e<=9999?T(e,4):"+"+e})),C(0,["YY",2],0,(function(){return this.year()%100})),C(0,["YYYY",4],0,"year"),C(0,["YYYYY",5],0,"year"),C(0,["YYYYYY",6,!0],0,"year"),L("year","y"),A("year",1),ce("Y",ue),ce("YY",te,Q),ce("YYYY",re,K),ce("YYYYY",ae,ee),ce("YYYYYY",ae,ee),ye(["YYYYY","YYYYYY"],0),ye("YYYY",(function(e,t){t[0]=2===e.length?f.parseTwoDigitYear(e):Z(e)})),ye("YY",(function(e,t){t[0]=f.parseTwoDigitYear(e)})),ye("Y",(function(e,t){t[0]=parseInt(e,10)})),f.parseTwoDigitYear=function(e){return Z(e)+(68<Z(e)?1900:2e3)};var Le=z("FullYear",!0);function Ve(e){var t,n;return e<100&&0<=e?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ge(e,t,n){var s=7+t-n;return s-(7+Ve(e,0,s).getUTCDay()-t)%7-1}function Ee(e,t,n,s,i){var r,a=1+7*(t-1)+(7+n-s)%7+Ge(e,s,i),o=a<=0?Fe(r=e-1)+a:a>Fe(e)?(r=e+1,a-Fe(e)):(r=e,a);return{year:r,dayOfYear:o}}function Ae(e,t,n){var s,i,r=Ge(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+je(i=e.year()-1,t,n):a>je(e.year(),t,n)?(s=a-je(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function je(e,t,n){var s=Ge(e,t,n),i=Ge(e+1,t,n);return(Fe(e)-s+i)/7}function Ie(e,t){return e.slice(t,7).concat(e.slice(0,t))}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),A("week",5),A("isoWeek",5),ce("w",te),ce("ww",te,Q),ce("W",te),ce("WW",te,Q),ge(["w","ww","W","WW"],(function(e,t,n,s){t[s.substr(0,1)]=Z(e)})),C("d",0,"do","day"),C("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),C("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),C("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),ce("d",te),ce("e",te),ce("E",te),ce("dd",(function(e,t){return t.weekdaysMinRegex(e)})),ce("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),ce("dddd",(function(e,t){return t.weekdaysRegex(e)})),ge(["dd","ddd","dddd"],(function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:y(n).invalidWeekday=e})),ge(["d","e","E"],(function(e,t,n,s){t[s]=Z(e)}));var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$e="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qe=de,Be=de,Je=de;function Qe(){function e(e,t){return t.length-e.length}for(var t,n,s,i,r=[],a=[],o=[],u=[],l=0;l<7;l++)t=_([2e3,1]).day(l),n=me(this.weekdaysMin(t,"")),s=me(this.weekdaysShort(t,"")),i=me(this.weekdays(t,"")),r.push(n),a.push(s),o.push(i),u.push(n),u.push(s),u.push(i);r.sort(e),a.sort(e),o.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){C(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function et(e,t){return t._meridiemParse}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,Xe),C("k",["kk",2],0,(function(){return this.hours()||24})),C("hmm",0,0,(function(){return""+Xe.apply(this)+T(this.minutes(),2)})),C("hmmss",0,0,(function(){return""+Xe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)})),C("Hmm",0,0,(function(){return""+this.hours()+T(this.minutes(),2)})),C("Hmmss",0,0,(function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)})),Ke("a",!0),Ke("A",!1),L("hour","h"),A("hour",13),ce("a",et),ce("A",et),ce("H",te),ce("h",te),ce("k",te),ce("HH",te,Q),ce("hh",te,Q),ce("kk",te,Q),ce("hmm",ne),ce("hmmss",se),ce("Hmm",ne),ce("Hmmss",se),ye(["H","HH"],3),ye(["k","kk"],(function(e,t,n){var s=Z(e);t[3]=24===s?0:s})),ye(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ye(["h","hh"],(function(e,t,n){t[3]=Z(e),y(n).bigHour=!0})),ye("hmm",(function(e,t,n){var s=e.length-2;t[3]=Z(e.substr(0,s)),t[4]=Z(e.substr(s)),y(n).bigHour=!0})),ye("hmmss",(function(e,t,n){var s=e.length-4,i=e.length-2;t[3]=Z(e.substr(0,s)),t[4]=Z(e.substr(s,2)),t[5]=Z(e.substr(i)),y(n).bigHour=!0})),ye("Hmm",(function(e,t,n){var s=e.length-2;t[3]=Z(e.substr(0,s)),t[4]=Z(e.substr(s))})),ye("Hmmss",(function(e,t,n){var s=e.length-4,i=e.length-2;t[3]=Z(e.substr(0,s)),t[4]=Z(e.substr(s,2)),t[5]=Z(e.substr(i))}));var tt=z("Hours",!0),nt,st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:Ne,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=at(e[r]).split("-")).length,n=(n=at(e[r+1]))?n.split("-"):null;0<t;){if(s=ut(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return nt}function ut(t){var e=null;if(void 0===it[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=nt._abbr,require("./locale/"+t),lt(e)}catch(e){it[t]=null}return it[t]}function lt(e,t){var n;return e&&((n=r(t)?dt(e):ht(e,t))?nt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nt._abbr}function ht(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ut(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new x(b(s,t)),rt[e]&&rt[e].forEach((function(e){ht(e.name,e.config)})),lt(e),it[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nt;if(!o(e)){if(t=ut(e))return t;e=[e]}return ot(e)}function ct(e){var t,n=e._a;return n&&-2===y(e).overflow&&(t=n[1]<0||11<n[1]?1:n[2]<1||n[2]>xe(n[0],n[1])?2:n[3]<0||24<n[3]||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||59<n[4]?4:n[5]<0||59<n[5]?5:n[6]<0||999<n[6]?6:-1,y(e)._overflowDayOfYear&&(t<0||2<t)&&(t=2),y(e)._overflowWeeks&&-1===t&&(t=7),y(e)._overflowWeekday&&-1===t&&(t=8),y(e).overflow=t),e}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],gt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wt=/^\/?Date\((-?\d+)/i,pt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,vt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function kt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(y(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||" ")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Ot(e)}else e._isValid=!1}function Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}(e),Ne.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}function Dt(e){var t,n,s,i,r=pt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(r){if(s=t=Mt(r[4],r[3],r[2],r[5],r[6],r[7]),i=e,(n=r[1])&&ze.indexOf(n)!==new Date(s[0],s[1],s[2]).getDay()&&(y(i).weekdayMismatch=!0,!void(i._isValid=!1)))return;e._a=t,e._tzm=function(e,t,n){if(e)return vt[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(r[8],r[9],r[10]),e._d=Ve.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),y(e).rfc2822=!0}else e._isValid=!1}function St(e,t,n){return null!=e?e:null!=t?t:n}function Yt(e){var t,n,s,i,r,a,o,u=[];if(!e._d){for(a=e,o=new Date(f.now()),s=a._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()],e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,s,i,r,a,o,u,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,n=St(t.GG,e._a[0],Ae(Tt(),1,4).year),s=St(t.W,1),((i=St(t.E,1))<1||7<i)&&(u=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,l=Ae(Tt(),r,a),n=St(t.gg,e._a[0],l.year),s=St(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r),s<1||s>je(n,r,a)?y(e)._overflowWeeks=!0:null!=u?y(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[0]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=St(e._a[0],s[0]),(e._dayOfYear>Fe(r)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),n=Ve(r,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=u[t]=s[t];for(;t<7;t++)e._a[t]=u[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Ve:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,u),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function Ot(e){if(e._f!==f.ISO_8601)if(e._f!==f.RFC_2822){e._a=[],y(e).empty=!0;for(var t,n,s,i,r,a,o,u=""+e._i,l=u.length,h=0,d=H(e._f,e._locale).match(N)||[],c=0;c<d.length;c++)n=d[c],(t=(u.match(fe(n,e))||[])[0])&&(0<(s=u.substr(0,u.indexOf(t))).length&&y(e).unusedInput.push(s),u=u.slice(u.indexOf(t)+t.length),h+=t.length),W[n]?(t?y(e).empty=!1:y(e).unusedTokens.push(n),r=n,o=e,null!=(a=t)&&m(_e,r)&&_e[r](a,o._a,o,r)):e._strict&&!t&&y(e).unusedTokens.push(n);y(e).charsLeftOver=l-h,0<u.length&&y(e).unusedInput.push(u),e._a[3]<=12&&!0===y(e).bigHour&&0<e._a[3]&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var s;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[3],e._meridiem),null!==(i=y(e).era)&&(e._a[0]=e._locale.erasConvertYear(i,e._a[0])),Yt(e),ct(e)}else Dt(e);else kt(e)}function bt(e){var t,n,s=e._i,i=e._f;return e._locale=e._locale||dt(e._l),null===s||void 0===i&&""===s?w({nullInput:!0}):("string"==typeof s&&(e._i=s=e._locale.preparse(s)),M(s)?new k(ct(s)):(a(s)?e._d=s:o(i)?function(e){var t,n,s,i,r,a,o=!1;if(0===e._f.length)return y(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,a=!1,t=v({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Ot(t),g(t)&&(a=!0),r+=y(t).charsLeftOver,r+=10*y(t).unusedTokens.length,y(t).score=r,o?r<s&&(s=r,n=t):(null==s||r<s||a)&&(s=r,n=t,a&&(o=!0));c(e,n||t)}(e):i?Ot(e):r(n=(t=e)._i)?t._d=new Date(f.now()):a(n)?t._d=new Date(n.valueOf()):"string"==typeof n?function(e){var t=wt.exec(e._i);null===t?(kt(e),!1===e._isValid&&(delete e._isValid,Dt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:f.createFromInputFallback(e)))):e._d=new Date(+t[1])}(t):o(n)?(t._a=d(n.slice(0),(function(e){return parseInt(e,10)})),Yt(t)):u(n)?function(e){var t,n;e._d||(n=void 0===(t=G(e._i)).day?t.date:t.day,e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),Yt(e))}(t):h(n)?t._d=new Date(n):f.createFromInputFallback(t),g(e)||(e._d=null),e))}function xt(e,t,n,s,i){var r,a={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&l(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new k(ct(bt(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Tt(e,t,n,s){return xt(e,t,n,s,!1)}f.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),f.ISO_8601=function(){},f.RFC_2822=function(){};var Nt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:w()})),Pt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:w()}));function Rt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var t=G(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,h=t.millisecond||0;this._isValid=function(e){var t,n,s=!1;for(t in e)if(m(e,t)&&(-1===we.call(Wt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<Wt.length;++n)if(e[Wt[n]]){if(s)return!1;parseFloat(e[Wt[n]])!==Z(e[Wt[n]])&&(s=!0)}return!0}(t),this._milliseconds=+h+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=dt(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){C(e,0,0,(function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+T(~~(e/60),2)+n+T(~~e%60,2)}))}Ft("Z",":"),Ft("ZZ",""),ce("Z",he),ce("ZZ",he),ye(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Vt(he,e)}));var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var n,s,i=(t||"").match(e);return null===i?null:0===(s=60*(n=((i[i.length-1]||[])+"").match(Lt)||["-",0,0])[1]+Z(n[2]))?0:"+"===n[0]?s:-s}function Gt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(M(e)||a(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),f.updateOffset(n,!1),n):Tt(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&this._isUTC&&0===this._offset}f.updateOffset=function(){};var jt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,It=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Zt(e,t){var n,s,i,r=e,a=null;return Ut(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:h(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(a=jt.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:Z(a[2])*n,h:Z(a[3])*n,m:Z(a[4])*n,s:Z(a[5])*n,ms:Z(Ht(1e3*a[6]))*n}):(a=It.exec(e))?(n="-"===a[1]?-1:1,r={y:zt(a[2],n),M:zt(a[3],n),w:zt(a[4],n),d:zt(a[5],n),h:zt(a[6],n),m:zt(a[7],n),s:zt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;return e.isValid()&&t.isValid()?(t=Gt(t,e),e.isBefore(t)?n=$t(e,t):((n=$t(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ct(r),Ut(e)&&m(e,"_locale")&&(s._locale=e._locale),Ut(e)&&m(e,"_isValid")&&(s._isValid=e._isValid),s}function zt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function $t(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=t-e.clone().add(n.months,"M"),n}function qt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Y(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),Bt(this,Zt(e,t),s),this}}function Bt(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),a=Ht(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,$(e,"Month")+a*n),r&&q(e,"Date",$(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&f.updateOffset(e,r||a))}Zt.fn=Ct.prototype,Zt.invalid=function(){return Zt(NaN)};var Jt=qt(1,"add"),Qt=qt(-1,"subtract");function Xt(e){return"string"==typeof e||e instanceof String}function Kt(e){return M(e)||a(e)||Xt(e)||h(e)||function(t){var e=o(t),n=!1;return e&&(n=0===t.filter((function(e){return!h(e)&&Xt(t)})).length),e&&n}(e)||function(e){var t,n,s=u(e)&&!l(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<r.length;t+=1)i=i||m(e,n=r[t]);return s&&i}(e)||null==e}function en(e,t){if(e.date()<t.date())return-en(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months"),i;return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s)))||0}function tn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=dt(e))&&(this._locale=t),this)}f.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",f.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var nn=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function sn(){return this._locale}var rn=126227808e5;function an(e,t){return(e%t+t)%t}function on(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-rn:new Date(e,t,n).valueOf()}function un(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-rn:Date.UTC(e,t,n)}function ln(e,t){return t.erasAbbrRegex(e)}function hn(){for(var e=[],t=[],n=[],s=[],i=this.eras(),r=0,a=i.length;r<a;++r)t.push(me(i[r].name)),e.push(me(i[r].abbr)),n.push(me(i[r].narrow)),s.push(me(i[r].name)),s.push(me(i[r].abbr)),s.push(me(i[r].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}function dn(e,t){C(0,[e,e.length],0,t)}function cn(e,t,n,s,i){var r;return null==e?Ae(this,s,i).year:((r=je(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ve(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),ce("N",ln),ce("NN",ln),ce("NNN",ln),ce("NNNN",(function(e,t){return t.erasNameRegex(e)})),ce("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ye(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,s){var i=n._locale.erasParse(e,s,n._strict);i?y(n).era=i:y(n).invalidEra=e})),ce("y",oe),ce("yy",oe),ce("yyy",oe),ce("yyyy",oe),ce("yo",(function(e,t){return t._eraYearOrdinalRegex||oe})),ye(["y","yy","yyy","yyyy"],0),ye(["yo"],(function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[0]=n._locale.eraYearOrdinalParse(e,i):t[0]=parseInt(e,10)})),C(0,["gg",2],0,(function(){return this.weekYear()%100})),C(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),dn("gggg","weekYear"),dn("ggggg","weekYear"),dn("GGGG","isoWeekYear"),dn("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),A("weekYear",1),A("isoWeekYear",1),ce("G",ue),ce("g",ue),ce("GG",te,Q),ce("gg",te,Q),ce("GGGG",re,K),ce("gggg",re,K),ce("GGGGG",ae,ee),ce("ggggg",ae,ee),ge(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,s){t[s.substr(0,2)]=Z(e)})),ge(["gg","GG"],(function(e,t,n,s){t[s]=f.parseTwoDigitYear(e)})),C("Q",0,"Qo","quarter"),L("quarter","Q"),A("quarter",7),ce("Q",J),ye("Q",(function(e,t){t[1]=3*(Z(e)-1)})),C("D",["DD",2],"Do","date"),L("date","D"),A("date",9),ce("D",te),ce("DD",te,Q),ce("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ye(["D","DD"],2),ye("Do",(function(e,t){t[2]=Z(e.match(te)[0])}));var fn=z("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),A("dayOfYear",4),ce("DDD",ie),ce("DDDD",X),ye(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=Z(e)})),C("m",["mm",2],0,"minute"),L("minute","m"),A("minute",14),ce("m",te),ce("mm",te,Q),ye(["m","mm"],4);var mn=z("Minutes",!1);C("s",["ss",2],0,"second"),L("second","s"),A("second",15),ce("s",te),ce("ss",te,Q),ye(["s","ss"],5);var _n,yn,gn=z("Seconds",!1);for(C("S",0,0,(function(){return~~(this.millisecond()/100)})),C(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),C(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),C(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),C(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),C(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),C(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),L("millisecond","ms"),A("millisecond",16),ce("S",ie,J),ce("SS",ie,Q),ce("SSS",ie,X),_n="SSSS";_n.length<=9;_n+="S")ce(_n,oe);function wn(e,t){t[6]=Z(1e3*("0."+e))}for(_n="S";_n.length<=9;_n+="S")ye(_n,wn);yn=z("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");var pn=k.prototype;function vn(e){return e}pn.add=Jt,pn.calendar=function(e,t){1===arguments.length&&(Kt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=u(e)&&!l(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||m(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0));var n=e||Tt(),s=Gt(n,this).startOf("day"),i=f.calendarFormat(this,s)||"sameElse",r=t&&(O(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},pn.clone=function(){return new k(this)},pn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=V(t)){case"year":r=en(this,s)/12;break;case"month":r=en(this,s);break;case"quarter":r=en(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:I(r)},pn.endOf=function(e){var t,n;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?un:on,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-an(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-an(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-an(t,1e3)-1}return this._d.setTime(t),f.updateOffset(this,!0),this},pn.format=function(e){var t=U(this,e=e||(this.isUtc()?f.defaultFormatUtc:f.defaultFormat));return this.localeData().postformat(t)},pn.from=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Tt(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.fromNow=function(e){return this.from(Tt(),e)},pn.to=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Tt(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.toNow=function(e){return this.to(Tt(),e)},pn.get=function(e){return O(this[e=V(e)])?this[e]():this},pn.invalidAt=function(){return y(this).overflow},pn.isAfter=function(e,t){var n=M(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},pn.isBefore=function(e,t){var n=M(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},pn.isBetween=function(e,t,n,s){var i=M(e)?e:Tt(e),r=M(t)?t:Tt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},pn.isSame=function(e,t){var n,s=M(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},pn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},pn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},pn.isValid=function(){return g(this)},pn.lang=nn,pn.locale=tn,pn.localeData=sn,pn.max=Pt,pn.min=Nt,pn.parsingFlags=function(){return c({},y(this))},pn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)m(e,t)&&n.push({unit:t,priority:E[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}(e=G(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(O(this[e=V(e)]))return this[e](t);return this},pn.startOf=function(e){var t,n;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?un:on,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=an(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=an(t,6e4);break;case"second":t=this._d.valueOf(),t-=an(t,1e3)}return this._d.setTime(t),f.updateOffset(this,!0),this},pn.subtract=Qt,pn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},pn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},pn.toDate=function(){return new Date(this.valueOf())},pn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?U(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(n,"Z")):U(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},pn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,s="moment",i="";return this.isLocal()||(s=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+s+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(pn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),pn.toJSON=function(){return this.isValid()?this.toISOString():null},pn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pn.unix=function(){return Math.floor(this.valueOf()/1e3)},pn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pn.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},pn.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},pn.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},pn.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-f(n[s].since).year())*e+n[s].offset;return this.year()},pn.year=Le,pn.isLeapYear=function(){return j(this.year())},pn.weekYear=function(e){return cn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},pn.isoWeekYear=function(e){return cn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},pn.quarter=pn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},pn.month=Ue,pn.daysInMonth=function(){return xe(this.year(),this.month())},pn.week=pn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},pn.isoWeek=pn.isoWeeks=function(e){var t=Ae(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},pn.weeksInYear=function(){var e=this.localeData()._week;return je(this.year(),e.dow,e.doy)},pn.weeksInWeekYear=function(){var e=this.localeData()._week;return je(this.weekYear(),e.dow,e.doy)},pn.isoWeeksInYear=function(){return je(this.year(),1,4)},pn.isoWeeksInISOWeekYear=function(){return je(this.isoWeekYear(),1,4)},pn.date=fn,pn.day=pn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},pn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},pn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,s=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?s:s-7)},pn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},pn.hour=pn.hours=tt,pn.minute=pn.minutes=mn,pn.second=pn.seconds=gn,pn.millisecond=pn.milliseconds=yn,pn.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(he,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?Bt(this,Zt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,f.updateOffset(this,!0),this._changeInProgress=null)),this},pn.utc=function(e){return this.utcOffset(0,e)},pn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Et(this),"m")),this},pn.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(le,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},pn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},pn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pn.isLocal=function(){return!!this.isValid()&&!this._isUTC},pn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pn.isUtc=At,pn.isUTC=At,pn.zoneAbbr=function(){return this._isUTC?"UTC":""},pn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pn.dates=n("dates accessor is deprecated. Use date instead.",fn),pn.months=n("months accessor is deprecated. Use month instead",Ue),pn.years=n("years accessor is deprecated. Use year instead",Le),pn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),pn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,t={};return v(t,this),(t=bt(t))._a?(e=(t._isUTC?_:Tt)(t._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)Z(e[a])!==Z(t[a])&&r++;return r+i}(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted}));var kn=x.prototype;function Mn(e,t,n,s){var i=dt(),r=_().set(s,t);return i[n](r,e)}function Dn(e,t,n){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return Mn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=Mn(e,i,n,"month");return s}function Sn(e,t,n,s){"boolean"==typeof e?h(t)&&(n=t,t=void 0):(t=e,e=!1,h(n=t)&&(n=t,t=void 0)),t=t||"";var i,r=dt(),a=e?r._week.dow:0,o=[];if(null!=n)return Mn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=Mn(t,(i+a)%7,s,"day");return o}kn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return O(s)?s.call(t,n):s},kn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(N).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},kn.invalidDate=function(){return this._invalidDate},kn.ordinal=function(e){return this._ordinal.replace("%d",e)},kn.preparse=vn,kn.postformat=vn,kn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return O(i)?i(e,t,n,s):i.replace(/%d/i,e)},kn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return O(n)?n(t):n.replace(/%s/i,t)},kn.set=function(e){var t,n;for(n in e)m(e,n)&&(O(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},kn.eras=function(e,t){for(var n,s=this._eras||dt("en")._eras,i=0,r=s.length;i<r;++i){switch(typeof s[i].since){case"string":n=f(s[i].since).startOf("day"),s[i].since=n.valueOf()}switch(typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=f(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf()}}return s},kn.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s]}else if(0<=[r,a,o].indexOf(e))return u[s]},kn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?f(e.since).year():f(e.since).year()+(t-e.offset)*n},kn.erasAbbrRegex=function(e){return m(this,"_erasAbbrRegex")||hn.call(this),e?this._erasAbbrRegex:this._erasRegex},kn.erasNameRegex=function(e){return m(this,"_erasNameRegex")||hn.call(this),e?this._erasNameRegex:this._erasRegex},kn.erasNarrowRegex=function(e){return m(this,"_erasNarrowRegex")||hn.call(this),e?this._erasNarrowRegex:this._erasRegex},kn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},kn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},kn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=_([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=we.call(this._shortMonthsParse,a))?i:null:-1!==(i=we.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=we.call(this._shortMonthsParse,a))||-1!==(i=we.call(this._longMonthsParse,a))?i:null:-1!==(i=we.call(this._longMonthsParse,a))||-1!==(i=we.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=_([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},kn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||He.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=We),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},kn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||He.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},kn.week=function(e){return Ae(e,this._week.dow,this._week.doy).week},kn.firstDayOfYear=function(){return this._week.doy},kn.firstDayOfWeek=function(){return this._week.dow},kn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ie(n,this._week.dow):e?n[e.day()]:n},kn.weekdaysMin=function(e){return!0===e?Ie(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},kn.weekdaysShort=function(e){return!0===e?Ie(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},kn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=_([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=we.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=we.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=we.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=we.call(this._weekdaysParse,a))||-1!==(i=we.call(this._shortWeekdaysParse,a))||-1!==(i=we.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=we.call(this._shortWeekdaysParse,a))||-1!==(i=we.call(this._weekdaysParse,a))||-1!==(i=we.call(this._minWeekdaysParse,a))?i:null:-1!==(i=we.call(this._minWeekdaysParse,a))||-1!==(i=we.call(this._weekdaysParse,a))||-1!==(i=we.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=_([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},kn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},kn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Be),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},kn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},kn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},kn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},lt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Z(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),f.lang=n("moment.lang is deprecated. Use moment.locale instead.",lt),f.langData=n("moment.langData is deprecated. Use moment.localeData instead.",dt);var Yn=Math.abs;function On(e,t,n,s){var i=Zt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function bn(e){return e<0?Math.floor(e):Math.ceil(e)}function xn(e){return 4800*e/146097}function Tn(e){return 146097*e/4800}function Nn(e){return function(){return this.as(e)}}var Pn=Nn("ms"),Rn=Nn("s"),Wn=Nn("m"),Cn=Nn("h"),Un=Nn("d"),Hn=Nn("w"),Fn=Nn("M"),Ln=Nn("Q"),Vn=Nn("y");function Gn(e){return function(){return this.isValid()?this._data[e]:NaN}}var En=Gn("milliseconds"),An=Gn("seconds"),jn=Gn("minutes"),In=Gn("hours"),Zn=Gn("days"),zn=Gn("months"),$n=Gn("years"),qn=Math.round,Bn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jn(e,t,n,s){var i=Zt(e).abs(),r=qn(i.as("s")),a=qn(i.as("m")),o=qn(i.as("h")),u=qn(i.as("d")),l=qn(i.as("M")),h=qn(i.as("w")),d=qn(i.as("y")),c=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||a<=1&&["m"]||a<n.m&&["mm",a]||o<=1&&["h"]||o<n.h&&["hh",o]||u<=1&&["d"]||u<n.d&&["dd",u];return null!=n.w&&(c=c||h<=1&&["w"]||h<n.w&&["ww",h]),(c=c||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,c[3]=0<+e,c[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,c)}var Qn=Math.abs;function Xn(e){return(0<e)-(e<0)||+e}function Kn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,s,i,r,a,o,u=Qn(this._milliseconds)/1e3,l=Qn(this._days),h=Qn(this._months),d=this.asSeconds();return d?(e=I(u/60),t=I(e/60),u%=60,e%=60,n=I(h/12),h%=12,s=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",r=Xn(this._months)!==Xn(d)?"-":"",a=Xn(this._days)!==Xn(d)?"-":"",o=Xn(this._milliseconds)!==Xn(d)?"-":"",i+"P"+(n?r+n+"Y":"")+(h?r+h+"M":"")+(l?a+l+"D":"")+(t||e||u?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(u?o+s+"S":"")):"P0D"}var es=Ct.prototype;return es.isValid=function(){return this._isValid},es.abs=function(){var e=this._data;return this._milliseconds=Yn(this._milliseconds),this._days=Yn(this._days),this._months=Yn(this._months),e.milliseconds=Yn(e.milliseconds),e.seconds=Yn(e.seconds),e.minutes=Yn(e.minutes),e.hours=Yn(e.hours),e.months=Yn(e.months),e.years=Yn(e.years),this},es.add=function(e,t){return On(this,e,t,1)},es.subtract=function(e,t){return On(this,e,t,-1)},es.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=V(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+xn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},es.asMilliseconds=Pn,es.asSeconds=Rn,es.asMinutes=Wn,es.asHours=Cn,es.asDays=Un,es.asWeeks=Hn,es.asMonths=Fn,es.asQuarters=Ln,es.asYears=Vn,es.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Z(this._months/12):NaN},es._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*bn(Tn(o)+a),o=a=0),u.milliseconds=r%1e3,e=I(r/1e3),u.seconds=e%60,t=I(e/60),u.minutes=t%60,n=I(t/60),u.hours=n%24,a+=I(n/24),o+=i=I(xn(a)),a-=bn(Tn(i)),s=I(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},es.clone=function(){return Zt(this)},es.get=function(e){return e=V(e),this.isValid()?this[e+"s"]():NaN},es.milliseconds=En,es.seconds=An,es.minutes=jn,es.hours=In,es.days=Zn,es.weeks=function(){return I(this.days()/7)},es.months=zn,es.years=$n,es.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,s,i=!1,r=Bn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(r=Object.assign({},Bn,t),null!=t.s&&null==t.ss&&(r.ss=t.s-1)),s=Jn(this,!i,r,n=this.localeData()),i&&(s=n.pastFuture(+this,s)),n.postformat(s)},es.toISOString=Kn,es.toString=Kn,es.toJSON=Kn,es.locale=tn,es.localeData=sn,es.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Kn),es.lang=nn,C("X",0,0,"unix"),C("x",0,0,"valueOf"),ce("x",ue),ce("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ye("x",(function(e,t,n){n._d=new Date(Z(e))})),f.version="2.26.0",e=Tt,f.fn=pn,f.min=function(){return Rt("isBefore",[].slice.call(arguments,0))},f.max=function(){return Rt("isAfter",[].slice.call(arguments,0))},f.now=function(){return Date.now?Date.now():+new Date},f.utc=_,f.unix=function(e){return Tt(1e3*e)},f.months=function(e,t){return Dn(e,t,"months")},f.isDate=a,f.locale=lt,f.invalid=w,f.duration=Zt,f.isMoment=M,f.weekdays=function(e,t,n){return Sn(e,t,n,"weekdays")},f.parseZone=function(){return Tt.apply(null,arguments).parseZone()},f.localeData=dt,f.isDuration=Ut,f.monthsShort=function(e,t){return Dn(e,t,"monthsShort")},f.weekdaysMin=function(e,t,n){return Sn(e,t,n,"weekdaysMin")},f.defineLocale=ht,f.updateLocale=function(e,t){var n,s,i;return null!=t?(i=st,null!=it[e]&&null!=it[e].parentLocale?it[e].set(b(it[e]._config,t)):(null!=(s=ut(e))&&(i=s._config),t=b(i,t),null==s&&(t.abbr=e),(n=new x(t)).parentLocale=it[e],it[e]=n),lt(e)):null!=it[e]&&(null!=it[e].parentLocale?(it[e]=it[e].parentLocale,e===lt()&<(e)):null!=it[e]&&delete it[e]),it[e]},f.locales=function(){return s(it)},f.weekdaysShort=function(e,t,n){return Sn(e,t,n,"weekdaysShort")},f.normalizeUnits=V,f.relativeTimeRounding=function(e){return void 0===e?qn:"function"==typeof e&&(qn=e,!0)},f.relativeTimeThreshold=function(e,t){return void 0!==Bn[e]&&(void 0===t?Bn[e]:(Bn[e]=t,"s"===e&&(Bn.ss=t-1),!0))},f.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},f.prototype=pn,f.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},f})),
|
||
/*!
|
||
* perfect-scrollbar v1.5.0
|
||
* Copyright 2020 Hyunje Jun, MDBootstrap and Contributors
|
||
* Licensed under MIT
|
||
*/
|
||
function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global=global||self).PerfectScrollbar=factory()}(this,(function(){"use strict";function get(element){return getComputedStyle(element)}function set(element,obj){for(var key in obj){var val=obj[key];"number"==typeof val&&(val+="px"),element.style[key]=val}return element}function div(className){var div=document.createElement("div");return div.className=className,div}var elMatches="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function matches(element,query){if(!elMatches)throw new Error("No element matching method supported");return elMatches.call(element,query)}function remove(element){element.remove?element.remove():element.parentNode&&element.parentNode.removeChild(element)}function queryChildren(element,selector){return Array.prototype.filter.call(element.children,(function(child){return matches(child,selector)}))}var cls_main="ps",cls_rtl="ps__rtl",cls_element={thumb:function(x){return"ps__thumb-"+x},rail:function(x){return"ps__rail-"+x},consuming:"ps__child--consume"},cls_state={focus:"ps--focus",clicking:"ps--clicking",active:function(x){return"ps--active-"+x},scrolling:function(x){return"ps--scrolling-"+x}},scrollingClassTimeout={x:null,y:null};function addScrollingClass(i,x){var classList=i.element.classList,className=cls_state.scrolling(x);classList.contains(className)?clearTimeout(scrollingClassTimeout[x]):classList.add(className)}function removeScrollingClass(i,x){scrollingClassTimeout[x]=setTimeout((function(){return i.isAlive&&i.element.classList.remove(cls_state.scrolling(x))}),i.settings.scrollingThreshold)}function setScrollingClassInstantly(i,x){addScrollingClass(i,x),removeScrollingClass(i,x)}var EventElement=function EventElement(element){this.element=element,this.handlers={}},prototypeAccessors={isEmpty:{configurable:!0}};EventElement.prototype.bind=function bind(eventName,handler){void 0===this.handlers[eventName]&&(this.handlers[eventName]=[]),this.handlers[eventName].push(handler),this.element.addEventListener(eventName,handler,!1)},EventElement.prototype.unbind=function unbind(eventName,target){var this$1=this;this.handlers[eventName]=this.handlers[eventName].filter((function(handler){return!(!target||handler===target)||(this$1.element.removeEventListener(eventName,handler,!1),!1)}))},EventElement.prototype.unbindAll=function unbindAll(){for(var name in this.handlers)this.unbind(name)},prototypeAccessors.isEmpty.get=function(){var this$1=this;return Object.keys(this.handlers).every((function(key){return 0===this$1.handlers[key].length}))},Object.defineProperties(EventElement.prototype,prototypeAccessors);var EventManager=function EventManager(){this.eventElements=[]};function createEvent(name){if("function"==typeof window.CustomEvent)return new CustomEvent(name);var evt=document.createEvent("CustomEvent");return evt.initCustomEvent(name,!1,!1,void 0),evt}function processScrollDiff(i,axis,diff,useScrollingClass,forceFireReachEvent){var fields;if(void 0===useScrollingClass&&(useScrollingClass=!0),void 0===forceFireReachEvent&&(forceFireReachEvent=!1),"top"===axis)fields=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==axis)throw new Error("A proper axis should be provided");fields=["contentWidth","containerWidth","scrollLeft","x","left","right"]}processScrollDiff$1(i,diff,fields,useScrollingClass,forceFireReachEvent)}function processScrollDiff$1(i,diff,ref,useScrollingClass,forceFireReachEvent){var contentHeight=ref[0],containerHeight=ref[1],scrollTop=ref[2],y=ref[3],up=ref[4],down=ref[5];void 0===useScrollingClass&&(useScrollingClass=!0),void 0===forceFireReachEvent&&(forceFireReachEvent=!1);var element=i.element;i.reach[y]=null,element[scrollTop]<1&&(i.reach[y]="start"),element[scrollTop]>i[contentHeight]-i[containerHeight]-1&&(i.reach[y]="end"),diff&&(element.dispatchEvent(createEvent("ps-scroll-"+y)),diff<0?element.dispatchEvent(createEvent("ps-scroll-"+up)):diff>0&&element.dispatchEvent(createEvent("ps-scroll-"+down)),useScrollingClass&&setScrollingClassInstantly(i,y)),i.reach[y]&&(diff||forceFireReachEvent)&&element.dispatchEvent(createEvent("ps-"+y+"-reach-"+i.reach[y]))}function toInt(x){return parseInt(x,10)||0}function isEditable(el){return matches(el,"input,[contenteditable]")||matches(el,"select,[contenteditable]")||matches(el,"textarea,[contenteditable]")||matches(el,"button,[contenteditable]")}function outerWidth(element){var styles=get(element);return toInt(styles.width)+toInt(styles.paddingLeft)+toInt(styles.paddingRight)+toInt(styles.borderLeftWidth)+toInt(styles.borderRightWidth)}EventManager.prototype.eventElement=function eventElement(element){var ee=this.eventElements.filter((function(ee){return ee.element===element}))[0];return ee||(ee=new EventElement(element),this.eventElements.push(ee)),ee},EventManager.prototype.bind=function bind(element,eventName,handler){this.eventElement(element).bind(eventName,handler)},EventManager.prototype.unbind=function unbind(element,eventName,handler){var ee=this.eventElement(element);ee.unbind(eventName,handler),ee.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(ee),1)},EventManager.prototype.unbindAll=function unbindAll(){this.eventElements.forEach((function(e){return e.unbindAll()})),this.eventElements=[]},EventManager.prototype.once=function once(element,eventName,handler){var ee=this.eventElement(element),onceHandler=function(evt){ee.unbind(eventName,onceHandler),handler(evt)};ee.bind(eventName,onceHandler)};var env={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function updateGeometry(i){var element=i.element,roundedScrollTop=Math.floor(element.scrollTop),rect=element.getBoundingClientRect();i.containerWidth=Math.ceil(rect.width),i.containerHeight=Math.ceil(rect.height),i.contentWidth=element.scrollWidth,i.contentHeight=element.scrollHeight,element.contains(i.scrollbarXRail)||(queryChildren(element,cls_element.rail("x")).forEach((function(el){return remove(el)})),element.appendChild(i.scrollbarXRail)),element.contains(i.scrollbarYRail)||(queryChildren(element,cls_element.rail("y")).forEach((function(el){return remove(el)})),element.appendChild(i.scrollbarYRail)),!i.settings.suppressScrollX&&i.containerWidth+i.settings.scrollXMarginOffset<i.contentWidth?(i.scrollbarXActive=!0,i.railXWidth=i.containerWidth-i.railXMarginWidth,i.railXRatio=i.containerWidth/i.railXWidth,i.scrollbarXWidth=getThumbSize(i,toInt(i.railXWidth*i.containerWidth/i.contentWidth)),i.scrollbarXLeft=toInt((i.negativeScrollAdjustment+element.scrollLeft)*(i.railXWidth-i.scrollbarXWidth)/(i.contentWidth-i.containerWidth))):i.scrollbarXActive=!1,!i.settings.suppressScrollY&&i.containerHeight+i.settings.scrollYMarginOffset<i.contentHeight?(i.scrollbarYActive=!0,i.railYHeight=i.containerHeight-i.railYMarginHeight,i.railYRatio=i.containerHeight/i.railYHeight,i.scrollbarYHeight=getThumbSize(i,toInt(i.railYHeight*i.containerHeight/i.contentHeight)),i.scrollbarYTop=toInt(roundedScrollTop*(i.railYHeight-i.scrollbarYHeight)/(i.contentHeight-i.containerHeight))):i.scrollbarYActive=!1,i.scrollbarXLeft>=i.railXWidth-i.scrollbarXWidth&&(i.scrollbarXLeft=i.railXWidth-i.scrollbarXWidth),i.scrollbarYTop>=i.railYHeight-i.scrollbarYHeight&&(i.scrollbarYTop=i.railYHeight-i.scrollbarYHeight),updateCss(element,i),i.scrollbarXActive?element.classList.add(cls_state.active("x")):(element.classList.remove(cls_state.active("x")),i.scrollbarXWidth=0,i.scrollbarXLeft=0,element.scrollLeft=!0===i.isRtl?i.contentWidth:0),i.scrollbarYActive?element.classList.add(cls_state.active("y")):(element.classList.remove(cls_state.active("y")),i.scrollbarYHeight=0,i.scrollbarYTop=0,element.scrollTop=0)}function getThumbSize(i,thumbSize){return i.settings.minScrollbarLength&&(thumbSize=Math.max(thumbSize,i.settings.minScrollbarLength)),i.settings.maxScrollbarLength&&(thumbSize=Math.min(thumbSize,i.settings.maxScrollbarLength)),thumbSize}function updateCss(element,i){var xRailOffset={width:i.railXWidth},roundedScrollTop=Math.floor(element.scrollTop);i.isRtl?xRailOffset.left=i.negativeScrollAdjustment+element.scrollLeft+i.containerWidth-i.contentWidth:xRailOffset.left=element.scrollLeft,i.isScrollbarXUsingBottom?xRailOffset.bottom=i.scrollbarXBottom-roundedScrollTop:xRailOffset.top=i.scrollbarXTop+roundedScrollTop,set(i.scrollbarXRail,xRailOffset);var yRailOffset={top:roundedScrollTop,height:i.railYHeight};i.isScrollbarYUsingRight?i.isRtl?yRailOffset.right=i.contentWidth-(i.negativeScrollAdjustment+element.scrollLeft)-i.scrollbarYRight-i.scrollbarYOuterWidth-9:yRailOffset.right=i.scrollbarYRight-element.scrollLeft:i.isRtl?yRailOffset.left=i.negativeScrollAdjustment+element.scrollLeft+2*i.containerWidth-i.contentWidth-i.scrollbarYLeft-i.scrollbarYOuterWidth:yRailOffset.left=i.scrollbarYLeft+element.scrollLeft,set(i.scrollbarYRail,yRailOffset),set(i.scrollbarX,{left:i.scrollbarXLeft,width:i.scrollbarXWidth-i.railBorderXWidth}),set(i.scrollbarY,{top:i.scrollbarYTop,height:i.scrollbarYHeight-i.railBorderYWidth})}function clickRail(i){var element=i.element;i.event.bind(i.scrollbarY,"mousedown",(function(e){return e.stopPropagation()})),i.event.bind(i.scrollbarYRail,"mousedown",(function(e){var positionTop,direction=e.pageY-window.pageYOffset-i.scrollbarYRail.getBoundingClientRect().top>i.scrollbarYTop?1:-1;i.element.scrollTop+=direction*i.containerHeight,updateGeometry(i),e.stopPropagation()})),i.event.bind(i.scrollbarX,"mousedown",(function(e){return e.stopPropagation()})),i.event.bind(i.scrollbarXRail,"mousedown",(function(e){var positionLeft,direction=e.pageX-window.pageXOffset-i.scrollbarXRail.getBoundingClientRect().left>i.scrollbarXLeft?1:-1;i.element.scrollLeft+=direction*i.containerWidth,updateGeometry(i),e.stopPropagation()}))}function dragThumb(i){bindMouseScrollHandler(i,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),bindMouseScrollHandler(i,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function bindMouseScrollHandler(i,ref){var containerHeight=ref[0],contentHeight=ref[1],pageY=ref[2],railYHeight=ref[3],scrollbarY=ref[4],scrollbarYHeight=ref[5],scrollTop=ref[6],y=ref[7],scrollbarYRail=ref[8],element=i.element,startingScrollTop=null,startingMousePageY=null,scrollBy=null;function mouseMoveHandler(e){e.touches&&e.touches[0]&&(e[pageY]=e.touches[0].pageY),element[scrollTop]=startingScrollTop+scrollBy*(e[pageY]-startingMousePageY),addScrollingClass(i,y),updateGeometry(i),e.stopPropagation(),e.preventDefault()}function mouseUpHandler(){removeScrollingClass(i,y),i[scrollbarYRail].classList.remove(cls_state.clicking),i.event.unbind(i.ownerDocument,"mousemove",mouseMoveHandler)}function bindMoves(e,touchMode){startingScrollTop=element[scrollTop],touchMode&&e.touches&&(e[pageY]=e.touches[0].pageY),startingMousePageY=e[pageY],scrollBy=(i[contentHeight]-i[containerHeight])/(i[railYHeight]-i[scrollbarYHeight]),touchMode?i.event.bind(i.ownerDocument,"touchmove",mouseMoveHandler):(i.event.bind(i.ownerDocument,"mousemove",mouseMoveHandler),i.event.once(i.ownerDocument,"mouseup",mouseUpHandler),e.preventDefault()),i[scrollbarYRail].classList.add(cls_state.clicking),e.stopPropagation()}i.event.bind(i[scrollbarY],"mousedown",(function(e){bindMoves(e)})),i.event.bind(i[scrollbarY],"touchstart",(function(e){bindMoves(e,!0)}))}function keyboard(i){var element=i.element,elementHovered=function(){return matches(element,":hover")},scrollbarFocused=function(){return matches(i.scrollbarX,":focus")||matches(i.scrollbarY,":focus")};function shouldPreventDefault(deltaX,deltaY){var scrollTop=Math.floor(element.scrollTop);if(0===deltaX){if(!i.scrollbarYActive)return!1;if(0===scrollTop&&deltaY>0||scrollTop>=i.contentHeight-i.containerHeight&&deltaY<0)return!i.settings.wheelPropagation}var scrollLeft=element.scrollLeft;if(0===deltaY){if(!i.scrollbarXActive)return!1;if(0===scrollLeft&&deltaX<0||scrollLeft>=i.contentWidth-i.containerWidth&&deltaX>0)return!i.settings.wheelPropagation}return!0}i.event.bind(i.ownerDocument,"keydown",(function(e){if(!(e.isDefaultPrevented&&e.isDefaultPrevented()||e.defaultPrevented)&&(elementHovered()||scrollbarFocused())){var activeElement=document.activeElement?document.activeElement:i.ownerDocument.activeElement;if(activeElement){if("IFRAME"===activeElement.tagName)activeElement=activeElement.contentDocument.activeElement;else for(;activeElement.shadowRoot;)activeElement=activeElement.shadowRoot.activeElement;if(isEditable(activeElement))return}var deltaX=0,deltaY=0;switch(e.which){case 37:deltaX=e.metaKey?-i.contentWidth:e.altKey?-i.containerWidth:-30;break;case 38:deltaY=e.metaKey?i.contentHeight:e.altKey?i.containerHeight:30;break;case 39:deltaX=e.metaKey?i.contentWidth:e.altKey?i.containerWidth:30;break;case 40:deltaY=e.metaKey?-i.contentHeight:e.altKey?-i.containerHeight:-30;break;case 32:deltaY=e.shiftKey?i.containerHeight:-i.containerHeight;break;case 33:deltaY=i.containerHeight;break;case 34:deltaY=-i.containerHeight;break;case 36:deltaY=i.contentHeight;break;case 35:deltaY=-i.contentHeight;break;default:return}i.settings.suppressScrollX&&0!==deltaX||i.settings.suppressScrollY&&0!==deltaY||(element.scrollTop-=deltaY,element.scrollLeft+=deltaX,updateGeometry(i),shouldPreventDefault(deltaX,deltaY)&&e.preventDefault())}}))}function wheel(i){var element=i.element;function shouldPreventDefault(deltaX,deltaY){var roundedScrollTop=Math.floor(element.scrollTop),isTop=0===element.scrollTop,isBottom=roundedScrollTop+element.offsetHeight===element.scrollHeight,isLeft=0===element.scrollLeft,isRight=element.scrollLeft+element.offsetWidth===element.scrollWidth,hitsBound;return!(hitsBound=Math.abs(deltaY)>Math.abs(deltaX)?isTop||isBottom:isLeft||isRight)||!i.settings.wheelPropagation}function getDeltaFromEvent(e){var deltaX=e.deltaX,deltaY=-1*e.deltaY;return void 0!==deltaX&&void 0!==deltaY||(deltaX=-1*e.wheelDeltaX/6,deltaY=e.wheelDeltaY/6),e.deltaMode&&1===e.deltaMode&&(deltaX*=10,deltaY*=10),deltaX!=deltaX&&deltaY!=deltaY&&(deltaX=0,deltaY=e.wheelDelta),e.shiftKey?[-deltaY,-deltaX]:[deltaX,deltaY]}function shouldBeConsumedByChild(target,deltaX,deltaY){if(!env.isWebKit&&element.querySelector("select:focus"))return!0;if(!element.contains(target))return!1;for(var cursor=target;cursor&&cursor!==element;){if(cursor.classList.contains(cls_element.consuming))return!0;var style=get(cursor);if(deltaY&&style.overflowY.match(/(scroll|auto)/)){var maxScrollTop=cursor.scrollHeight-cursor.clientHeight;if(maxScrollTop>0&&(cursor.scrollTop>0&&deltaY<0||cursor.scrollTop<maxScrollTop&&deltaY>0))return!0}if(deltaX&&style.overflowX.match(/(scroll|auto)/)){var maxScrollLeft=cursor.scrollWidth-cursor.clientWidth;if(maxScrollLeft>0&&(cursor.scrollLeft>0&&deltaX<0||cursor.scrollLeft<maxScrollLeft&&deltaX>0))return!0}cursor=cursor.parentNode}return!1}function mousewheelHandler(e){var ref=getDeltaFromEvent(e),deltaX=ref[0],deltaY=ref[1];if(!shouldBeConsumedByChild(e.target,deltaX,deltaY)){var shouldPrevent=!1;i.settings.useBothWheelAxes?i.scrollbarYActive&&!i.scrollbarXActive?(deltaY?element.scrollTop-=deltaY*i.settings.wheelSpeed:element.scrollTop+=deltaX*i.settings.wheelSpeed,shouldPrevent=!0):i.scrollbarXActive&&!i.scrollbarYActive&&(deltaX?element.scrollLeft+=deltaX*i.settings.wheelSpeed:element.scrollLeft-=deltaY*i.settings.wheelSpeed,shouldPrevent=!0):(element.scrollTop-=deltaY*i.settings.wheelSpeed,element.scrollLeft+=deltaX*i.settings.wheelSpeed),updateGeometry(i),(shouldPrevent=shouldPrevent||shouldPreventDefault(deltaX,deltaY))&&!e.ctrlKey&&(e.stopPropagation(),e.preventDefault())}}void 0!==window.onwheel?i.event.bind(element,"wheel",mousewheelHandler):void 0!==window.onmousewheel&&i.event.bind(element,"mousewheel",mousewheelHandler)}function touch(i){if(env.supportsTouch||env.supportsIePointer){var element=i.element,startOffset={},startTime=0,speed={},easingLoop=null;env.supportsTouch?(i.event.bind(element,"touchstart",touchStart),i.event.bind(element,"touchmove",touchMove),i.event.bind(element,"touchend",touchEnd)):env.supportsIePointer&&(window.PointerEvent?(i.event.bind(element,"pointerdown",touchStart),i.event.bind(element,"pointermove",touchMove),i.event.bind(element,"pointerup",touchEnd)):window.MSPointerEvent&&(i.event.bind(element,"MSPointerDown",touchStart),i.event.bind(element,"MSPointerMove",touchMove),i.event.bind(element,"MSPointerUp",touchEnd)))}function shouldPrevent(deltaX,deltaY){var scrollTop=Math.floor(element.scrollTop),scrollLeft=element.scrollLeft,magnitudeX=Math.abs(deltaX),magnitudeY=Math.abs(deltaY);if(magnitudeY>magnitudeX){if(deltaY<0&&scrollTop===i.contentHeight-i.containerHeight||deltaY>0&&0===scrollTop)return 0===window.scrollY&&deltaY>0&&env.isChrome}else if(magnitudeX>magnitudeY&&(deltaX<0&&scrollLeft===i.contentWidth-i.containerWidth||deltaX>0&&0===scrollLeft))return!0;return!0}function applyTouchMove(differenceX,differenceY){element.scrollTop-=differenceY,element.scrollLeft-=differenceX,updateGeometry(i)}function getTouch(e){return e.targetTouches?e.targetTouches[0]:e}function shouldHandle(e){return(!e.pointerType||"pen"!==e.pointerType||0!==e.buttons)&&(!(!e.targetTouches||1!==e.targetTouches.length)||!(!e.pointerType||"mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))}function touchStart(e){if(shouldHandle(e)){var touch=getTouch(e);startOffset.pageX=touch.pageX,startOffset.pageY=touch.pageY,startTime=(new Date).getTime(),null!==easingLoop&&clearInterval(easingLoop)}}function shouldBeConsumedByChild(target,deltaX,deltaY){if(!element.contains(target))return!1;for(var cursor=target;cursor&&cursor!==element;){if(cursor.classList.contains(cls_element.consuming))return!0;var style=get(cursor);if(deltaY&&style.overflowY.match(/(scroll|auto)/)){var maxScrollTop=cursor.scrollHeight-cursor.clientHeight;if(maxScrollTop>0&&(cursor.scrollTop>0&&deltaY<0||cursor.scrollTop<maxScrollTop&&deltaY>0))return!0}if(deltaX&&style.overflowX.match(/(scroll|auto)/)){var maxScrollLeft=cursor.scrollWidth-cursor.clientWidth;if(maxScrollLeft>0&&(cursor.scrollLeft>0&&deltaX<0||cursor.scrollLeft<maxScrollLeft&&deltaX>0))return!0}cursor=cursor.parentNode}return!1}function touchMove(e){if(shouldHandle(e)){var touch=getTouch(e),currentOffset={pageX:touch.pageX,pageY:touch.pageY},differenceX=currentOffset.pageX-startOffset.pageX,differenceY=currentOffset.pageY-startOffset.pageY;if(shouldBeConsumedByChild(e.target,differenceX,differenceY))return;applyTouchMove(differenceX,differenceY),startOffset=currentOffset;var currentTime=(new Date).getTime(),timeGap=currentTime-startTime;timeGap>0&&(speed.x=differenceX/timeGap,speed.y=differenceY/timeGap,startTime=currentTime),shouldPrevent(differenceX,differenceY)&&e.preventDefault()}}function touchEnd(){i.settings.swipeEasing&&(clearInterval(easingLoop),easingLoop=setInterval((function(){i.isInitialized?clearInterval(easingLoop):speed.x||speed.y?Math.abs(speed.x)<.01&&Math.abs(speed.y)<.01?clearInterval(easingLoop):(applyTouchMove(30*speed.x,30*speed.y),speed.x*=.8,speed.y*=.8):clearInterval(easingLoop)}),10))}}var defaultSettings=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},handlers={"click-rail":clickRail,"drag-thumb":dragThumb,keyboard:keyboard,wheel:wheel,touch:touch},PerfectScrollbar=function PerfectScrollbar(element,userSettings){var this$1=this;if(void 0===userSettings&&(userSettings={}),"string"==typeof element&&(element=document.querySelector(element)),!element||!element.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var key in this.element=element,element.classList.add(cls_main),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},userSettings)this.settings[key]=userSettings[key];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var focus=function(){return element.classList.add(cls_state.focus)},blur=function(){return element.classList.remove(cls_state.focus)},originalScrollLeft,result;this.isRtl="rtl"===get(element).direction,!0===this.isRtl&&element.classList.add(cls_rtl),this.isNegativeScroll=(originalScrollLeft=element.scrollLeft,result=null,element.scrollLeft=-1,result=element.scrollLeft<0,element.scrollLeft=originalScrollLeft,result),this.negativeScrollAdjustment=this.isNegativeScroll?element.scrollWidth-element.clientWidth:0,this.event=new EventManager,this.ownerDocument=element.ownerDocument||document,this.scrollbarXRail=div(cls_element.rail("x")),element.appendChild(this.scrollbarXRail),this.scrollbarX=div(cls_element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",focus),this.event.bind(this.scrollbarX,"blur",blur),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var railXStyle=get(this.scrollbarXRail);this.scrollbarXBottom=parseInt(railXStyle.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=toInt(railXStyle.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=toInt(railXStyle.borderLeftWidth)+toInt(railXStyle.borderRightWidth),set(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=toInt(railXStyle.marginLeft)+toInt(railXStyle.marginRight),set(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=div(cls_element.rail("y")),element.appendChild(this.scrollbarYRail),this.scrollbarY=div(cls_element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",focus),this.event.bind(this.scrollbarY,"blur",blur),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var railYStyle=get(this.scrollbarYRail);this.scrollbarYRight=parseInt(railYStyle.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=toInt(railYStyle.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?outerWidth(this.scrollbarY):null,this.railBorderYWidth=toInt(railYStyle.borderTopWidth)+toInt(railYStyle.borderBottomWidth),set(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=toInt(railYStyle.marginTop)+toInt(railYStyle.marginBottom),set(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:element.scrollLeft<=0?"start":element.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:element.scrollTop<=0?"start":element.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach((function(handlerName){return handlers[handlerName](this$1)})),this.lastScrollTop=Math.floor(element.scrollTop),this.lastScrollLeft=element.scrollLeft,this.event.bind(this.element,"scroll",(function(e){return this$1.onScroll(e)})),updateGeometry(this)};return PerfectScrollbar.prototype.update=function update(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,set(this.scrollbarXRail,{display:"block"}),set(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=toInt(get(this.scrollbarXRail).marginLeft)+toInt(get(this.scrollbarXRail).marginRight),this.railYMarginHeight=toInt(get(this.scrollbarYRail).marginTop)+toInt(get(this.scrollbarYRail).marginBottom),set(this.scrollbarXRail,{display:"none"}),set(this.scrollbarYRail,{display:"none"}),updateGeometry(this),processScrollDiff(this,"top",0,!1,!0),processScrollDiff(this,"left",0,!1,!0),set(this.scrollbarXRail,{display:""}),set(this.scrollbarYRail,{display:""}))},PerfectScrollbar.prototype.onScroll=function onScroll(e){this.isAlive&&(updateGeometry(this),processScrollDiff(this,"top",this.element.scrollTop-this.lastScrollTop),processScrollDiff(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},PerfectScrollbar.prototype.destroy=function destroy(){this.isAlive&&(this.event.unbindAll(),remove(this.scrollbarX),remove(this.scrollbarY),remove(this.scrollbarXRail),remove(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},PerfectScrollbar.prototype.removePsClasses=function removePsClasses(){this.element.className=this.element.className.split(" ").filter((function(name){return!name.match(/^ps([-_].+|)$/)})).join(" ")},PerfectScrollbar})),function(factory){"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?module.exports=factory():window.wNumb=factory()}((function(){"use strict";var FormatOptions=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function strReverse(a){return a.split("").reverse().join("")}function strStartsWith(input,match){return input.substring(0,match.length)===match}function strEndsWith(input,match){return input.slice(-1*match.length)===match}function throwEqualError(F,a,b){if((F[a]||F[b])&&F[a]===F[b])throw new Error(a)}function isValidNumber(input){return"number"==typeof input&&isFinite(input)}function toFixed(value,exp){return value=value.toString().split("e"),(+((value=(value=Math.round(+(value[0]+"e"+(value[1]?+value[1]+exp:exp)))).toString().split("e"))[0]+"e"+(value[1]?+value[1]-exp:-exp))).toFixed(exp)}function formatTo(decimals,thousand,mark,prefix,suffix,encoder,decoder,negativeBefore,negative,edit,undo,input){var originalInput=input,inputIsNegative,inputPieces,inputBase,inputDecimals="",output="";return encoder&&(input=encoder(input)),!!isValidNumber(input)&&(!1!==decimals&&0===parseFloat(input.toFixed(decimals))&&(input=0),input<0&&(inputIsNegative=!0,input=Math.abs(input)),!1!==decimals&&(input=toFixed(input,decimals)),-1!==(input=input.toString()).indexOf(".")?(inputBase=(inputPieces=input.split("."))[0],mark&&(inputDecimals=mark+inputPieces[1])):inputBase=input,thousand&&(inputBase=strReverse(inputBase).match(/.{1,3}/g),inputBase=strReverse(inputBase.join(strReverse(thousand)))),inputIsNegative&&negativeBefore&&(output+=negativeBefore),prefix&&(output+=prefix),inputIsNegative&&negative&&(output+=negative),output+=inputBase,output+=inputDecimals,suffix&&(output+=suffix),edit&&(output=edit(output,originalInput)),output)}function formatFrom(decimals,thousand,mark,prefix,suffix,encoder,decoder,negativeBefore,negative,edit,undo,input){var originalInput=input,inputIsNegative,output="";return undo&&(input=undo(input)),!(!input||"string"!=typeof input)&&(negativeBefore&&strStartsWith(input,negativeBefore)&&(input=input.replace(negativeBefore,""),inputIsNegative=!0),prefix&&strStartsWith(input,prefix)&&(input=input.replace(prefix,"")),negative&&strStartsWith(input,negative)&&(input=input.replace(negative,""),inputIsNegative=!0),suffix&&strEndsWith(input,suffix)&&(input=input.slice(0,-1*suffix.length)),thousand&&(input=input.split(thousand).join("")),mark&&(input=input.replace(mark,".")),inputIsNegative&&(output+="-"),""!==(output=(output+=input).replace(/[^0-9\.\-.]/g,""))&&(output=Number(output),decoder&&(output=decoder(output)),!!isValidNumber(output)&&output))}function validate(inputOptions){var i,optionName,optionValue,filteredOptions={};for(void 0===inputOptions.suffix&&(inputOptions.suffix=inputOptions.postfix),i=0;i<FormatOptions.length;i+=1)if(void 0===(optionValue=inputOptions[optionName=FormatOptions[i]]))"negative"!==optionName||filteredOptions.negativeBefore?"mark"===optionName&&"."!==filteredOptions.thousand?filteredOptions[optionName]=".":filteredOptions[optionName]=!1:filteredOptions[optionName]="-";else if("decimals"===optionName){if(!(optionValue>=0&&optionValue<8))throw new Error(optionName);filteredOptions[optionName]=optionValue}else if("encoder"===optionName||"decoder"===optionName||"edit"===optionName||"undo"===optionName){if("function"!=typeof optionValue)throw new Error(optionName);filteredOptions[optionName]=optionValue}else{if("string"!=typeof optionValue)throw new Error(optionName);filteredOptions[optionName]=optionValue}return throwEqualError(filteredOptions,"mark","thousand"),throwEqualError(filteredOptions,"prefix","negative"),throwEqualError(filteredOptions,"prefix","negativeBefore"),filteredOptions}function passAll(options,method,input){var i,args=[];for(i=0;i<FormatOptions.length;i+=1)args.push(options[FormatOptions[i]]);return args.push(input),method.apply("",args)}function wNumb(options){if(!(this instanceof wNumb))return new wNumb(options);"object"==typeof options&&(options=validate(options),this.to=function(input){return passAll(options,formatTo,input)},this.from=function(input){return passAll(options,formatFrom,input)})}return wNumb})),
|
||
/*!
|
||
* https://github.com/paulmillr/es6-shim
|
||
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
|
||
* and contributors, MIT License
|
||
* es6-shim: v0.35.4
|
||
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
|
||
* Details and documentation:
|
||
* https://github.com/paulmillr/es6-shim/
|
||
*/
|
||
function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.returnExports=t()}(this,(function(){"use strict";var e=Function.call.bind(Function.apply),t=Function.call.bind(Function.call),r=Array.isArray,n=Object.keys,o=function notThunker(t){return function notThunk(){return!e(t,this,arguments)}},i=function(e){try{return e(),!1}catch(t){return!0}},a=function valueOrFalseIfThrows(e){try{return e()}catch(t){return!1}},u=o(i),f=function(){return!i((function(){return Object.defineProperty({},"x",{get:function(){}})}))},s=!!Object.defineProperty&&f(),c="foo"===function foo(){}.name,l=Function.call.bind(Array.prototype.forEach),p=Function.call.bind(Array.prototype.reduce),v=Function.call.bind(Array.prototype.filter),y=Function.call.bind(Array.prototype.some),h=function(e,t,r,n){!n&&t in e||(s?Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:r}):e[t]=r)},b=function(e,t,r){l(n(t),(function(n){var o=t[n];h(e,n,o,!!r)}))},g=Function.call.bind(Object.prototype.toString),d="function"==typeof/abc/?function IsCallableSlow(e){return"function"==typeof e&&"[object Function]"===g(e)}:function IsCallableFast(e){return"function"==typeof e},m={getter:function(e,t,r){if(!s)throw new TypeError("getters require true ES5 support");Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:r})},proxy:function(e,t,r){if(!s)throw new TypeError("getters require true ES5 support");var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,{configurable:n.configurable,enumerable:n.enumerable,get:function getKey(){return e[t]},set:function setKey(r){e[t]=r}})},redefine:function(e,t,r){if(s){var n=Object.getOwnPropertyDescriptor(e,t);n.value=r,Object.defineProperty(e,t,n)}else e[t]=r},defineByDescriptor:function(e,t,r){s?Object.defineProperty(e,t,r):"value"in r&&(e[t]=r.value)},preserveToString:function(e,t){t&&d(t.toString)&&h(e,"toString",t.toString.bind(t),!0)}},O=Object.create||function(e,t){var r=function Prototype(){};r.prototype=e;var o=new r;return void 0!==t&&n(t).forEach((function(e){m.defineByDescriptor(o,e,t[e])})),o},w=function(e,t){return!!Object.setPrototypeOf&&a((function(){var r=function Subclass(t){var r=new e(t);return Object.setPrototypeOf(r,Subclass.prototype),r};return Object.setPrototypeOf(r,e),r.prototype=O(e.prototype,{constructor:{value:r}}),t(r)}))},j=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")},S=j(),T=S.isFinite,I=Function.call.bind(String.prototype.indexOf),E=Function.apply.bind(Array.prototype.indexOf),P=Function.call.bind(Array.prototype.concat),C=Function.call.bind(String.prototype.slice),M=Function.call.bind(Array.prototype.push),x=Function.apply.bind(Array.prototype.push),N=Function.call.bind(Array.prototype.shift),A=Math.max,R=Math.min,_=Math.floor,k=Math.abs,L=Math.exp,F=Math.log,D=Math.sqrt,z=Function.call.bind(Object.prototype.hasOwnProperty),q,W=function(){},G=S.Map,H=G&&G.prototype.delete,V=G&&G.prototype.get,B=G&&G.prototype.has,U=G&&G.prototype.set,$=S.Symbol||{},J=$.species||"@@species",X=Number.isNaN||function isNaN(e){return e!=e},K=Number.isFinite||function isFinite(e){return"number"==typeof e&&T(e)},Z=d(Math.sign)?Math.sign:function sign(e){var t=Number(e);return 0===t?t:X(t)?t:t<0?-1:1},Y=function log1p(e){var t=Number(e);return t<-1||X(t)?NaN:0===t||t===1/0?t:-1===t?-1/0:1+t-1==0?t:t*(F(1+t)/(1+t-1))},Q=function isArguments(e){return"[object Arguments]"===g(e)},ee=function isArguments(e){return null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==g(e)&&"[object Function]"===g(e.callee)},te=Q(arguments)?Q:ee,re={primitive:function(e){return null===e||"function"!=typeof e&&"object"!=typeof e},string:function(e){return"[object String]"===g(e)},regex:function(e){return"[object RegExp]"===g(e)},symbol:function(e){return"function"==typeof S.Symbol&&"symbol"==typeof e}},ne=function overrideNative(e,t,r){var n=e[t];h(e,t,r,!0),m.preserveToString(e[t],n)},oe="function"==typeof $&&"function"==typeof $.for&&re.symbol($()),ie=re.symbol($.iterator)?$.iterator:"_es6-shim iterator_";S.Set&&"function"==typeof(new S.Set)["@@iterator"]&&(ie="@@iterator"),S.Reflect||h(S,"Reflect",{},!0);var ae=S.Reflect,ue=String,fe="undefined"!=typeof document&&document?document.all:null,se=null==fe?function isNullOrUndefined(e){return null==e}:function isNullOrUndefinedAndNotDocumentAll(e){return null==e&&e!==fe},ce={Call:function Call(t,r){var n=arguments.length>2?arguments[2]:[];if(!ce.IsCallable(t))throw new TypeError(t+" is not a function");return e(t,r,n)},RequireObjectCoercible:function(e,t){if(se(e))throw new TypeError(t||"Cannot call method on "+e);return e},TypeIsObject:function(e){return null!=e&&!0!==e&&!1!==e&&("function"==typeof e||"object"==typeof e||e===fe)},ToObject:function(e,t){return Object(ce.RequireObjectCoercible(e,t))},IsCallable:d,IsConstructor:function(e){return ce.IsCallable(e)},ToInt32:function(e){return ce.ToNumber(e)>>0},ToUint32:function(e){return ce.ToNumber(e)>>>0},ToNumber:function(e){if("[object Symbol]"===g(e))throw new TypeError("Cannot convert a Symbol value to a number");return+e},ToInteger:function(e){var t=ce.ToNumber(e);return X(t)?0:0!==t&&K(t)?(t>0?1:-1)*_(k(t)):t},ToLength:function(e){var t=ce.ToInteger(e);return t<=0?0:t>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t},SameValue:function(e,t){return e===t?0!==e||1/e==1/t:X(e)&&X(t)},SameValueZero:function(e,t){return e===t||X(e)&&X(t)},IsIterable:function(e){return ce.TypeIsObject(e)&&(void 0!==e[ie]||te(e))},GetIterator:function(e){if(te(e))return new q(e,"value");var t=ce.GetMethod(e,ie);if(!ce.IsCallable(t))throw new TypeError("value is not an iterable");var r=ce.Call(t,e);if(!ce.TypeIsObject(r))throw new TypeError("bad iterator");return r},GetMethod:function(e,t){var r=ce.ToObject(e)[t];if(!se(r)){if(!ce.IsCallable(r))throw new TypeError("Method not callable: "+t);return r}},IteratorComplete:function(e){return!!e.done},IteratorClose:function(e,t){var r=ce.GetMethod(e,"return");if(void 0!==r){var n,o;try{n=ce.Call(r,e)}catch(i){o=i}if(!t){if(o)throw o;if(!ce.TypeIsObject(n))throw new TypeError("Iterator's return method returned a non-object.")}}},IteratorNext:function(e){var t=arguments.length>1?e.next(arguments[1]):e.next();if(!ce.TypeIsObject(t))throw new TypeError("bad iterator");return t},IteratorStep:function(e){var t=ce.IteratorNext(e),r;return!ce.IteratorComplete(t)&&t},Construct:function(e,t,r,n){var o=void 0===r?e:r;if(!n&&ae.construct)return ae.construct(e,t,o);var i=o.prototype;ce.TypeIsObject(i)||(i=Object.prototype);var a=O(i),u=ce.Call(e,a,t);return ce.TypeIsObject(u)?u:a},SpeciesConstructor:function(e,t){var r=e.constructor;if(void 0===r)return t;if(!ce.TypeIsObject(r))throw new TypeError("Bad constructor");var n=r[J];if(se(n))return t;if(!ce.IsConstructor(n))throw new TypeError("Bad @@species");return n},CreateHTML:function(e,t,r,n){var o=ce.ToString(e),i="<"+t,a,u,f,s;""!==r&&(i+=" "+r+'="'+ce.ToString(n).replace(/"/g,""")+'"');return i+">"+o+"</"+t+">"},IsRegExp:function IsRegExp(e){if(!ce.TypeIsObject(e))return!1;var t=e[$.match];return void 0!==t?!!t:re.regex(e)},ToString:function ToString(e){return ue(e)}};if(s&&oe){var le=function defineWellKnownSymbol(e){if(re.symbol($[e]))return $[e];var t=$.for("Symbol."+e);return Object.defineProperty($,e,{configurable:!1,enumerable:!1,writable:!1,value:t}),t};if(!re.symbol($.search)){var pe=le("search"),ve=String.prototype.search;h(RegExp.prototype,pe,(function search(e){return ce.Call(ve,e,[this])}));var ye=function search(e){var t=ce.RequireObjectCoercible(this);if(!se(e)){var r=ce.GetMethod(e,pe);if(void 0!==r)return ce.Call(r,e,[t])}return ce.Call(ve,t,[ce.ToString(e)])};ne(String.prototype,"search",ye)}if(!re.symbol($.replace)){var he=le("replace"),be=String.prototype.replace;h(RegExp.prototype,he,(function replace(e,t){return ce.Call(be,e,[this,t])}));var ge=function replace(e,t){var r=ce.RequireObjectCoercible(this);if(!se(e)){var n=ce.GetMethod(e,he);if(void 0!==n)return ce.Call(n,e,[r,t])}return ce.Call(be,r,[ce.ToString(e),t])};ne(String.prototype,"replace",ge)}if(!re.symbol($.split)){var de=le("split"),me=String.prototype.split;h(RegExp.prototype,de,(function split(e,t){return ce.Call(me,e,[this,t])}));var Oe=function split(e,t){var r=ce.RequireObjectCoercible(this);if(!se(e)){var n=ce.GetMethod(e,de);if(void 0!==n)return ce.Call(n,e,[r,t])}return ce.Call(me,r,[ce.ToString(e),t])};ne(String.prototype,"split",Oe)}var we=re.symbol($.match),je=we&&function(){var e={};return e[$.match]=function(){return 42},42!=="a".match(e)}();if(!we||je){var Se=le("match"),Te=String.prototype.match;h(RegExp.prototype,Se,(function match(e){return ce.Call(Te,e,[this])}));var Ie=function match(e){var t=ce.RequireObjectCoercible(this);if(!se(e)){var r=ce.GetMethod(e,Se);if(void 0!==r)return ce.Call(r,e,[t])}return ce.Call(Te,t,[ce.ToString(e)])};ne(String.prototype,"match",Ie)}}var Ee=function wrapConstructor(e,t,r){m.preserveToString(t,e),Object.setPrototypeOf&&Object.setPrototypeOf(e,t),s?l(Object.getOwnPropertyNames(e),(function(n){n in W||r[n]||m.proxy(e,n,t)})):l(Object.keys(e),(function(n){n in W||r[n]||(t[n]=e[n])})),t.prototype=e.prototype,m.redefine(e.prototype,"constructor",t)},Pe=function(){return this},Ce=function(e){s&&!z(e,J)&&m.getter(e,J,Pe)},Me=function(e,t){var r=t||function iterator(){return this};h(e,ie,r),!e[ie]&&re.symbol(ie)&&(e[ie]=r)},xe=function createDataProperty(e,t,r){s?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r},Ne=function createDataPropertyOrThrow(e,t,r){if(xe(e,t,r),!ce.SameValue(e[t],r))throw new TypeError("property is nonconfigurable")},Ae=function(e,t,r,n){if(!ce.TypeIsObject(e))throw new TypeError("Constructor requires `new`: "+t.name);var o=t.prototype;ce.TypeIsObject(o)||(o=r);var i=O(o);for(var a in n)if(z(n,a)){var u=n[a];h(i,a,u,!0)}return i};if(String.fromCodePoint&&1!==String.fromCodePoint.length){var Re=String.fromCodePoint;ne(String,"fromCodePoint",(function fromCodePoint(e){return ce.Call(Re,this,arguments)}))}var _e={fromCodePoint:function fromCodePoint(e){for(var t=[],r,n=0,o=arguments.length;n<o;n++){if(r=Number(arguments[n]),!ce.SameValue(r,ce.ToInteger(r))||r<0||r>1114111)throw new RangeError("Invalid code point "+r);r<65536?M(t,String.fromCharCode(r)):(r-=65536,M(t,String.fromCharCode(55296+(r>>10))),M(t,String.fromCharCode(r%1024+56320)))}return t.join("")},raw:function raw(e){var t=ce.ToObject(e,"bad callSite"),r=ce.ToObject(t.raw,"bad raw value"),n=r.length,o=ce.ToLength(n);if(o<=0)return"";for(var i=[],a=0,u,f,s,c;a<o&&(u=ce.ToString(a),s=ce.ToString(r[u]),M(i,s),!(a+1>=o));)f=a+1<arguments.length?arguments[a+1]:"",c=ce.ToString(f),M(i,c),a+=1;return i.join("")}};String.raw&&"xy"!==String.raw({raw:{0:"x",1:"y",length:2}})&&ne(String,"raw",_e.raw),b(String,_e);var ke=function repeat(e,t){if(t<1)return"";if(t%2)return repeat(e,t-1)+e;var r=repeat(e,t/2);return r+r},Le=1/0,Fe={repeat:function repeat(e){var t=ce.ToString(ce.RequireObjectCoercible(this)),r=ce.ToInteger(e);if(r<0||r>=Le)throw new RangeError("repeat count must be less than infinity and not overflow maximum string size");return ke(t,r)},startsWith:function startsWith(e){var t=ce.ToString(ce.RequireObjectCoercible(this));if(ce.IsRegExp(e))throw new TypeError('Cannot call method "startsWith" with a regex');var r=ce.ToString(e),n;arguments.length>1&&(n=arguments[1]);var o=A(ce.ToInteger(n),0);return C(t,o,o+r.length)===r},endsWith:function endsWith(e){var t=ce.ToString(ce.RequireObjectCoercible(this));if(ce.IsRegExp(e))throw new TypeError('Cannot call method "endsWith" with a regex');var r=ce.ToString(e),n=t.length,o;arguments.length>1&&(o=arguments[1]);var i=void 0===o?n:ce.ToInteger(o),a=R(A(i,0),n);return C(t,a-r.length,a)===r},includes:function includes(e){if(ce.IsRegExp(e))throw new TypeError('"includes" does not accept a RegExp');var t=ce.ToString(e),r;return arguments.length>1&&(r=arguments[1]),-1!==I(this,t,r)},codePointAt:function codePointAt(e){var t=ce.ToString(ce.RequireObjectCoercible(this)),r=ce.ToInteger(e),n=t.length;if(r>=0&&r<n){var o=t.charCodeAt(r),i;if(o<55296||o>56319||r+1===n)return o;var a=t.charCodeAt(r+1);return a<56320||a>57343?o:1024*(o-55296)+(a-56320)+65536}}};if(String.prototype.includes&&!1!=="a".includes("a",1/0)&&ne(String.prototype,"includes",Fe.includes),String.prototype.startsWith&&String.prototype.endsWith){var De=i((function(){return"/a/".startsWith(/a/)})),ze=a((function(){return!1==="abc".startsWith("a",1/0)}));De&&ze||(ne(String.prototype,"startsWith",Fe.startsWith),ne(String.prototype,"endsWith",Fe.endsWith))}if(oe){var qe=a((function(){var e=/a/;return e[$.match]=!1,"/a/".startsWith(e)}));qe||ne(String.prototype,"startsWith",Fe.startsWith);var We=a((function(){var e=/a/;return e[$.match]=!1,"/a/".endsWith(e)}));We||ne(String.prototype,"endsWith",Fe.endsWith);var Ge=a((function(){var e=/a/;return e[$.match]=!1,"/a/".includes(e)}));Ge||ne(String.prototype,"includes",Fe.includes)}b(String.prototype,Fe);var He=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),Ve=new RegExp("(^["+He+"]+)|(["+He+"]+$)","g"),Be=function trim(){return ce.ToString(ce.RequireObjectCoercible(this)).replace(Ve,"")},Ue=["
","",""].join(""),$e=new RegExp("["+Ue+"]","g"),Je=/^[-+]0x[0-9a-f]+$/i,Xe=Ue.trim().length!==Ue.length;h(String.prototype,"trim",Be,Xe);var Ke=function(e){return{value:e,done:0===arguments.length}},Ze=function(e){ce.RequireObjectCoercible(e),this._s=ce.ToString(e),this._i=0};Ze.prototype.next=function(){var e=this._s,t=this._i;if(void 0===e||t>=e.length)return this._s=void 0,Ke();var r=e.charCodeAt(t),n,o;return o=r<55296||r>56319||t+1===e.length?1:(n=e.charCodeAt(t+1))<56320||n>57343?1:2,this._i=t+o,Ke(e.substr(t,o))},Me(Ze.prototype),Me(String.prototype,(function(){return new Ze(this)}));var Ye={from:function from(e){var r=this,n,o,i;if(arguments.length>1&&(n=arguments[1]),void 0===n)o=!1;else{if(!ce.IsCallable(n))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(i=arguments[2]),o=!0}var a=void 0!==(te(e)||ce.GetMethod(e,ie)),u,f,s;if(a){f=ce.IsConstructor(r)?Object(new r):[];var c=ce.GetIterator(e),l,p;for(s=0;!1!==(l=ce.IteratorStep(c));){p=l.value;try{o&&(p=void 0===i?n(p,s):t(n,i,p,s)),f[s]=p}catch(v){throw ce.IteratorClose(c,!0),v}s+=1}u=s}else{var y=ce.ToObject(e),h;for(u=ce.ToLength(y.length),f=ce.IsConstructor(r)?Object(new r(u)):new Array(u),s=0;s<u;++s)h=y[s],o&&(h=void 0===i?n(h,s):t(n,i,h,s)),Ne(f,s,h)}return f.length=u,f},of:function of(){for(var e=arguments.length,t=this,n=r(t)||!ce.IsCallable(t)?new Array(e):ce.Construct(t,[e]),o=0;o<e;++o)Ne(n,o,arguments[o]);return n.length=e,n}};b(Array,Ye),Ce(Array),b((q=function(e,t){this.i=0,this.array=e,this.kind=t}).prototype,{next:function(){var e=this.i,t=this.array;if(!(this instanceof q))throw new TypeError("Not an ArrayIterator");if(void 0!==t)for(var r=ce.ToLength(t.length);e<r;e++){var n=this.kind,o;return"key"===n?o=e:"value"===n?o=t[e]:"entry"===n&&(o=[e,t[e]]),this.i=e+1,Ke(o)}return this.array=void 0,Ke()}}),Me(q.prototype);var Qe=Array.of===Ye.of||function(){var e=function Foo(e){this.length=e};e.prototype=[];var t=Array.of.apply(e,[1,2]);return t instanceof e&&2===t.length}();Qe||ne(Array,"of",Ye.of);var et={copyWithin:function copyWithin(e,t){var r=ce.ToObject(this),n=ce.ToLength(r.length),o=ce.ToInteger(e),i=ce.ToInteger(t),a=o<0?A(n+o,0):R(o,n),u=i<0?A(n+i,0):R(i,n),f;arguments.length>2&&(f=arguments[2]);var s=void 0===f?n:ce.ToInteger(f),c=s<0?A(n+s,0):R(s,n),l=R(c-u,n-a),p=1;for(u<a&&a<u+l&&(p=-1,u+=l-1,a+=l-1);l>0;)u in r?r[a]=r[u]:delete r[a],u+=p,a+=p,l-=1;return r},fill:function fill(e){var t,r;arguments.length>1&&(t=arguments[1]),arguments.length>2&&(r=arguments[2]);var n=ce.ToObject(this),o=ce.ToLength(n.length);t=ce.ToInteger(void 0===t?0:t),r=ce.ToInteger(void 0===r?o:r);for(var i=t<0?A(o+t,0):R(t,o),a=r<0?o+r:r,u=i;u<o&&u<a;++u)n[u]=e;return n},find:function find(e){var r=ce.ToObject(this),n=ce.ToLength(r.length);if(!ce.IsCallable(e))throw new TypeError("Array#find: predicate must be a function");for(var o=arguments.length>1?arguments[1]:null,i=0,a;i<n;i++)if(a=r[i],o){if(t(e,o,a,i,r))return a}else if(e(a,i,r))return a},findIndex:function findIndex(e){var r=ce.ToObject(this),n=ce.ToLength(r.length);if(!ce.IsCallable(e))throw new TypeError("Array#findIndex: predicate must be a function");for(var o=arguments.length>1?arguments[1]:null,i=0;i<n;i++)if(o){if(t(e,o,r[i],i,r))return i}else if(e(r[i],i,r))return i;return-1},keys:function keys(){return new q(this,"key")},values:function values(){return new q(this,"value")},entries:function entries(){return new q(this,"entry")}};if(Array.prototype.keys&&!ce.IsCallable([1].keys().next)&&delete Array.prototype.keys,Array.prototype.entries&&!ce.IsCallable([1].entries().next)&&delete Array.prototype.entries,Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[ie]&&(b(Array.prototype,{values:Array.prototype[ie]}),re.symbol($.unscopables)&&(Array.prototype[$.unscopables].values=!0)),c&&Array.prototype.values&&"values"!==Array.prototype.values.name){var tt=Array.prototype.values;ne(Array.prototype,"values",(function values(){return ce.Call(tt,this,arguments)})),h(Array.prototype,ie,Array.prototype.values,!0)}b(Array.prototype,et),1/[!0].indexOf(!0,-0)<0&&h(Array.prototype,"indexOf",(function indexOf(e){var t=E(this,arguments);return 0===t&&1/t<0?0:t}),!0),Me(Array.prototype,(function(){return this.values()})),Object.getPrototypeOf&&Me(Object.getPrototypeOf([].values()));var rt=a((function(){return 0===Array.from({length:-1}).length})),nt=function(){var e=Array.from([0].entries());return 1===e.length&&r(e[0])&&0===e[0][0]&&0===e[0][1]}();rt&&nt||ne(Array,"from",Ye.from);var ot=a((function(){return Array.from([0],void 0)}));if(!ot){var it=Array.from;ne(Array,"from",(function from(e){return arguments.length>1&&void 0!==arguments[1]?ce.Call(it,this,arguments):t(it,this,e)}))}var at=-(Math.pow(2,32)-1),ut=function(e,r){var n={length:at};return n[r?(n.length>>>0)-1:0]=!0,a((function(){return t(e,n,(function(){throw new RangeError("should not reach here")}),[]),!0}))};if(!ut(Array.prototype.forEach)){var ft=Array.prototype.forEach;ne(Array.prototype,"forEach",(function forEach(e){return ce.Call(ft,this.length>=0?this:[],arguments)}),!0)}if(!ut(Array.prototype.map)){var st=Array.prototype.map;ne(Array.prototype,"map",(function map(e){return ce.Call(st,this.length>=0?this:[],arguments)}),!0)}if(!ut(Array.prototype.filter)){var ct=Array.prototype.filter;ne(Array.prototype,"filter",(function filter(e){return ce.Call(ct,this.length>=0?this:[],arguments)}),!0)}if(!ut(Array.prototype.some)){var lt=Array.prototype.some;ne(Array.prototype,"some",(function some(e){return ce.Call(lt,this.length>=0?this:[],arguments)}),!0)}if(!ut(Array.prototype.every)){var pt=Array.prototype.every;ne(Array.prototype,"every",(function every(e){return ce.Call(pt,this.length>=0?this:[],arguments)}),!0)}if(!ut(Array.prototype.reduce)){var vt=Array.prototype.reduce;ne(Array.prototype,"reduce",(function reduce(e){return ce.Call(vt,this.length>=0?this:[],arguments)}),!0)}if(!ut(Array.prototype.reduceRight,!0)){var yt=Array.prototype.reduceRight;ne(Array.prototype,"reduceRight",(function reduceRight(e){return ce.Call(yt,this.length>=0?this:[],arguments)}),!0)}var ht=8!==Number("0o10"),bt=2!==Number("0b10"),gt=y(Ue,(function(e){return 0===Number(e+0+e)}));if(ht||bt||gt){var dt=Number,mt=/^0b[01]+$/i,Ot=/^0o[0-7]+$/i,wt=mt.test.bind(mt),jt=Ot.test.bind(Ot),St=function(e){var t;if("function"==typeof e.valueOf&&(t=e.valueOf(),re.primitive(t)))return t;if("function"==typeof e.toString&&(t=e.toString(),re.primitive(t)))return t;throw new TypeError("No default value")},Tt=$e.test.bind($e),It=Je.test.bind(Je),Et=function(){var e=function Number(t){var r;"string"==typeof(r=arguments.length>0?re.primitive(t)?t:St(t,"number"):0)&&(r=ce.Call(Be,r),wt(r)?r=parseInt(C(r,2),2):jt(r)?r=parseInt(C(r,2),8):(Tt(r)||It(r))&&(r=NaN));var n=this,o=a((function(){return dt.prototype.valueOf.call(n),!0}));return n instanceof e&&!o?new dt(r):dt(r)};return e}();Ee(dt,Et,{}),b(Et,{NaN:dt.NaN,MAX_VALUE:dt.MAX_VALUE,MIN_VALUE:dt.MIN_VALUE,NEGATIVE_INFINITY:dt.NEGATIVE_INFINITY,POSITIVE_INFINITY:dt.POSITIVE_INFINITY}),Number=Et,m.redefine(S,"Number",Et)}var Pt=Math.pow(2,53)-1;b(Number,{MAX_SAFE_INTEGER:Pt,MIN_SAFE_INTEGER:-Pt,EPSILON:2220446049250313e-31,parseInt:S.parseInt,parseFloat:S.parseFloat,isFinite:K,isInteger:function isInteger(e){return K(e)&&ce.ToInteger(e)===e},isSafeInteger:function isSafeInteger(e){return Number.isInteger(e)&&k(e)<=Number.MAX_SAFE_INTEGER},isNaN:X}),h(Number,"parseInt",S.parseInt,Number.parseInt!==S.parseInt),1===[,1].find((function(){return!0}))&&ne(Array.prototype,"find",et.find),0!==[,1].findIndex((function(){return!0}))&&ne(Array.prototype,"findIndex",et.findIndex);var Ct=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable),Mt=function ensureEnumerable(e,t){s&&Ct(e,t)&&Object.defineProperty(e,t,{enumerable:!1})},xt=function sliceArgs(){for(var e=Number(this),t=arguments.length,r=t-e,n=new Array(r<0?0:r),o=e;o<t;++o)n[o-e]=arguments[o];return n},Nt=function assignTo(e){return function assignToSource(t,r){return t[r]=e[r],t}},At=function(e,t){var r=n(Object(t)),o;return ce.IsCallable(Object.getOwnPropertySymbols)&&(o=v(Object.getOwnPropertySymbols(Object(t)),Ct(t))),p(P(r,o||[]),Nt(t),e)},Rt={assign:function(e,t){var r=ce.ToObject(e,"Cannot convert undefined or null to object");return p(ce.Call(xt,1,arguments),At,r)},is:function is(e,t){return ce.SameValue(e,t)}},_t=Object.assign&&Object.preventExtensions&&function(){var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}}();if(_t&&ne(Object,"assign",Rt.assign),b(Object,Rt),s){var kt={setPrototypeOf:function(e,r){var n,o=function(e,t){if(!ce.TypeIsObject(e))throw new TypeError("cannot set prototype on a non-object");if(null!==t&&!ce.TypeIsObject(t))throw new TypeError("can only set prototype to an object or null"+t)},i=function(e,r){return o(e,r),t(n,e,r),e};try{n=e.getOwnPropertyDescriptor(e.prototype,r).set,t(n,{},null)}catch(a){if(e.prototype!=={}[r])return;n=function(e){this[r]=e},i.polyfill=i(i({},null),e.prototype)instanceof e}return i}(Object,"__proto__")};b(Object,kt)}Object.setPrototypeOf&&Object.getPrototypeOf&&null!==Object.getPrototypeOf(Object.setPrototypeOf({},null))&&null===Object.getPrototypeOf(Object.create(null))&&function(){var e=Object.create(null),t=Object.getPrototypeOf,r=Object.setPrototypeOf;Object.getPrototypeOf=function(r){var n=t(r);return n===e?null:n},Object.setPrototypeOf=function(t,n){var o;return r(t,null===n?e:n)},Object.setPrototypeOf.polyfill=!1}();var Lt=!i((function(){return Object.keys("foo")}));if(!Lt){var Ft=Object.keys;ne(Object,"keys",(function keys(e){return Ft(ce.ToObject(e))})),n=Object.keys}var Dt=i((function(){return Object.keys(/a/g)}));if(Dt){var zt=Object.keys;ne(Object,"keys",(function keys(e){if(re.regex(e)){var t=[];for(var r in e)z(e,r)&&M(t,r);return t}return zt(e)})),n=Object.keys}if(Object.getOwnPropertyNames){var qt=!i((function(){return Object.getOwnPropertyNames("foo")}));if(!qt){var Wt="object"==typeof window?Object.getOwnPropertyNames(window):[],Gt=Object.getOwnPropertyNames;ne(Object,"getOwnPropertyNames",(function getOwnPropertyNames(e){var t=ce.ToObject(e);if("[object Window]"===g(t))try{return Gt(t)}catch(r){return P([],Wt)}return Gt(t)}))}}if(Object.getOwnPropertyDescriptor){var Ht=!i((function(){return Object.getOwnPropertyDescriptor("foo","bar")}));if(!Ht){var Vt=Object.getOwnPropertyDescriptor;ne(Object,"getOwnPropertyDescriptor",(function getOwnPropertyDescriptor(e,t){return Vt(ce.ToObject(e),t)}))}}if(Object.seal){var Bt=!i((function(){return Object.seal("foo")}));if(!Bt){var Ut=Object.seal;ne(Object,"seal",(function seal(e){return ce.TypeIsObject(e)?Ut(e):e}))}}if(Object.isSealed){var $t=!i((function(){return Object.isSealed("foo")}));if(!$t){var Jt=Object.isSealed;ne(Object,"isSealed",(function isSealed(e){return!ce.TypeIsObject(e)||Jt(e)}))}}if(Object.freeze){var Xt=!i((function(){return Object.freeze("foo")}));if(!Xt){var Kt=Object.freeze;ne(Object,"freeze",(function freeze(e){return ce.TypeIsObject(e)?Kt(e):e}))}}if(Object.isFrozen){var Zt=!i((function(){return Object.isFrozen("foo")}));if(!Zt){var Yt=Object.isFrozen;ne(Object,"isFrozen",(function isFrozen(e){return!ce.TypeIsObject(e)||Yt(e)}))}}if(Object.preventExtensions){var Qt=!i((function(){return Object.preventExtensions("foo")}));if(!Qt){var er=Object.preventExtensions;ne(Object,"preventExtensions",(function preventExtensions(e){return ce.TypeIsObject(e)?er(e):e}))}}if(Object.isExtensible){var tr=!i((function(){return Object.isExtensible("foo")}));if(!tr){var rr=Object.isExtensible;ne(Object,"isExtensible",(function isExtensible(e){return!!ce.TypeIsObject(e)&&rr(e)}))}}if(Object.getPrototypeOf){var nr=!i((function(){return Object.getPrototypeOf("foo")}));if(!nr){var or=Object.getPrototypeOf;ne(Object,"getPrototypeOf",(function getPrototypeOf(e){return or(ce.ToObject(e))}))}}var ir=s&&function(){var e=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags");return e&&ce.IsCallable(e.get)}();if(s&&!ir){var ar=function flags(){if(!ce.TypeIsObject(this))throw new TypeError("Method called on incompatible type: must be an object.");var e="";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e};m.getter(RegExp.prototype,"flags",ar)}var ur=s&&a((function(){return"/a/i"===String(new RegExp(/a/g,"i"))})),fr=oe&&s&&function(){var e=/./;return e[$.match]=!1,RegExp(e)===e}(),sr=a((function(){return"/abc/"===RegExp.prototype.toString.call({source:"abc"})})),cr=sr&&a((function(){return"/a/b"===RegExp.prototype.toString.call({source:"a",flags:"b"})}));if(!sr||!cr){var lr=RegExp.prototype.toString;h(RegExp.prototype,"toString",(function toString(){var e=ce.RequireObjectCoercible(this),r,n;return re.regex(e)?t(lr,e):"/"+ue(e.source)+"/"+ue(e.flags)}),!0),m.preserveToString(RegExp.prototype.toString,lr)}if(s&&(!ur||fr)){var pr=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get,vr=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")||{},yr=function(){return this.source},hr=ce.IsCallable(vr.get)?vr.get:yr,br=RegExp,gr=function RegExp(e,t){var r=ce.IsRegExp(e),n;if(!(this instanceof RegExp)&&r&&void 0===t&&e.constructor===RegExp)return e;var o=e,i=t;return re.regex(e)?new RegExp(o=ce.Call(hr,e),i=void 0===t?ce.Call(pr,e):t):(r&&(o=e.source,i=void 0===t?e.flags:t),new br(e,t))};Ee(br,gr,{$input:!0}),RegExp=gr,m.redefine(S,"RegExp",gr)}if(s){var dr={input:"$_",lastMatch:"$&",lastParen:"$+",leftContext:"$`",rightContext:"$'"};l(n(dr),(function(e){e in RegExp&&!(dr[e]in RegExp)&&m.getter(RegExp,dr[e],(function get(){return RegExp[e]}))}))}Ce(RegExp);var mr=1/Number.EPSILON,Or=function roundTiesToEven(e){return e+mr-mr},wr=Math.pow(2,-23),jr=Math.pow(2,127)*(2-wr),Sr=Math.pow(2,-126),Tr=Math.E,Ir=Math.LOG2E,Er=Math.LOG10E,Pr=Number.prototype.clz;delete Number.prototype.clz;var Cr={acosh:function acosh(e){var t=Number(e);if(X(t)||e<1)return NaN;if(1===t)return 0;if(t===1/0)return t;var r=1/(t*t);if(t<2)return Y(t-1+D(1-r)*t);var n=t/2;return Y(n+D(1-r)*n-1)+1/Ir},asinh:function asinh(e){var t=Number(e);if(0===t||!T(t))return t;var r=k(t),n=r*r,o=Z(t);return r<1?o*Y(r+n/(D(n+1)+1)):o*(Y(r/2+D(1+1/n)*r/2-1)+1/Ir)},atanh:function atanh(e){var t=Number(e);if(0===t)return t;if(-1===t)return-1/0;if(1===t)return 1/0;if(X(t)||t<-1||t>1)return NaN;var r=k(t);return Z(t)*Y(2*r/(1-r))/2},cbrt:function cbrt(e){var t=Number(e);if(0===t)return t;var r=t<0,n;return r&&(t=-t),n=t===1/0?1/0:(t/((n=L(F(t)/3))*n)+2*n)/3,r?-n:n},clz32:function clz32(e){var t=Number(e),r=ce.ToUint32(t);return 0===r?32:Pr?ce.Call(Pr,r):31-_(F(r+.5)*Ir)},cosh:function cosh(e){var t=Number(e);if(0===t)return 1;if(X(t))return NaN;if(!T(t))return 1/0;var r=L(k(t)-1);return(r+1/(r*Tr*Tr))*(Tr/2)},expm1:function expm1(e){var t=Number(e);if(t===-1/0)return-1;if(!T(t)||0===t)return t;if(k(t)>.5)return L(t)-1;for(var r=t,n=0,o=1;n+r!==n;)n+=r,r*=t/(o+=1);return n},hypot:function hypot(e,t){for(var r=0,n=0,o=0;o<arguments.length;++o){var i=k(Number(arguments[o]));n<i?(r*=n/i*(n/i),r+=1,n=i):r+=i>0?i/n*(i/n):i}return n===1/0?1/0:n*D(r)},log2:function log2(e){return F(e)*Ir},log10:function log10(e){return F(e)*Er},log1p:Y,sign:Z,sinh:function sinh(e){var t=Number(e);if(!T(t)||0===t)return t;var r=k(t);if(r<1){var n=Math.expm1(r);return Z(t)*n*(1+1/(n+1))/2}var o=L(r-1);return Z(t)*(o-1/(o*Tr*Tr))*(Tr/2)},tanh:function tanh(e){var t=Number(e);return X(t)||0===t?t:t>=20?1:t<=-20?-1:(Math.expm1(t)-Math.expm1(-t))/(L(t)+L(-t))},trunc:function trunc(e){var t=Number(e);return t<0?-_(-t):_(t)},imul:function imul(e,t){var r=ce.ToUint32(e),n=ce.ToUint32(t),o,i=65535&r,a,u=65535&n;return i*u+((r>>>16&65535)*u+i*(n>>>16&65535)<<16>>>0)|0},fround:function fround(e){var t=Number(e);if(0===t||t===1/0||t===-1/0||X(t))return t;var r=Z(t),n=k(t);if(n<Sr)return r*Or(n/Sr/wr)*Sr*wr;var o=(1+wr/Number.EPSILON)*n,i=o-(o-n);return i>jr||X(i)?r*(1/0):r*i}},Mr=function withinULPDistance(e,t,r){return k(1-e/t)/Number.EPSILON<(r||8)};b(Math,Cr),h(Math,"sinh",Cr.sinh,Math.sinh(710)===1/0),h(Math,"cosh",Cr.cosh,Math.cosh(710)===1/0),h(Math,"log1p",Cr.log1p,-1e-17!==Math.log1p(-1e-17)),h(Math,"asinh",Cr.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7)),h(Math,"asinh",Cr.asinh,Math.asinh(1e300)===1/0),h(Math,"atanh",Cr.atanh,0===Math.atanh(1e-300)),h(Math,"tanh",Cr.tanh,-2e-17!==Math.tanh(-2e-17)),h(Math,"acosh",Cr.acosh,Math.acosh(Number.MAX_VALUE)===1/0),h(Math,"acosh",Cr.acosh,!Mr(Math.acosh(1+Number.EPSILON),Math.sqrt(2*Number.EPSILON))),h(Math,"cbrt",Cr.cbrt,!Mr(Math.cbrt(1e-300),1e-100)),h(Math,"sinh",Cr.sinh,-2e-17!==Math.sinh(-2e-17));var xr=Math.expm1(10);h(Math,"expm1",Cr.expm1,xr>22025.465794806718||xr<22025.465794806718);var Nr=Math.round,Ar=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(Number.EPSILON/3.99-.5),Rr=mr+1,_r=2*mr-1,kr=[Rr,_r].every((function(e){return Math.round(e)===e}));h(Math,"round",(function round(e){var t=_(e),r;return e-t<.5?t:-1===t?-0:t+1}),!Ar||!kr),m.preserveToString(Math.round,Nr);var Lr=Math.imul;-5!==Math.imul(4294967295,5)&&(Math.imul=Cr.imul,m.preserveToString(Math.imul,Lr)),2!==Math.imul.length&&ne(Math,"imul",(function imul(e,t){return ce.Call(Lr,Math,arguments)}));var Fr=function(){var e=S.setTimeout;if("function"==typeof e||"object"==typeof e){ce.IsPromise=function(e){return!!ce.TypeIsObject(e)&&void 0!==e._promise};var r=function(e){if(!ce.IsConstructor(e))throw new TypeError("Bad promise constructor");var t=this,r=function(e,r){if(void 0!==t.resolve||void 0!==t.reject)throw new TypeError("Bad Promise implementation!");t.resolve=e,t.reject=r};if(t.resolve=void 0,t.reject=void 0,t.promise=new e(r),!ce.IsCallable(t.resolve)||!ce.IsCallable(t.reject))throw new TypeError("Bad promise constructor")},n;"undefined"!=typeof window&&ce.IsCallable(window.postMessage)&&(n=function(){var e=[],t="zero-timeout-message",r=function(r){M(e,r),window.postMessage(t,"*")},n=function(r){if(r.source===window&&r.data===t){if(r.stopPropagation(),0===e.length)return;var n;N(e)()}};return window.addEventListener("message",n,!0),r});var o=function(){var e=S.Promise,t=e&&e.resolve&&e.resolve();return t&&function(e){return t.then(e)}},i=ce.IsCallable(S.setImmediate)?S.setImmediate:"object"==typeof process&&process.nextTick?process.nextTick:o()||(ce.IsCallable(n)?n():function(t){e(t,0)}),a=function(e){return e},u=function(e){throw e},f=0,s=1,c=2,l=0,p=1,v=2,y={},h=function(e,t,r){i((function(){g(e,t,r)}))},g=function(e,t,r){var n,o;if(t===y)return e(r);try{n=e(r),o=t.resolve}catch(i){n=i,o=t.reject}o(n)},d=function(e,t){var r=e._promise,n=r.reactionLength;if(n>0&&(h(r.fulfillReactionHandler0,r.reactionCapability0,t),r.fulfillReactionHandler0=void 0,r.rejectReactions0=void 0,r.reactionCapability0=void 0,n>1))for(var o=1,i=0;o<n;o++,i+=3)h(r[i+0],r[i+2],t),e[i+0]=void 0,e[i+1]=void 0,e[i+2]=void 0;r.result=t,r.state=1,r.reactionLength=0},m=function(e,t){var r=e._promise,n=r.reactionLength;if(n>0&&(h(r.rejectReactionHandler0,r.reactionCapability0,t),r.fulfillReactionHandler0=void 0,r.rejectReactions0=void 0,r.reactionCapability0=void 0,n>1))for(var o=1,i=0;o<n;o++,i+=3)h(r[i+1],r[i+2],t),e[i+0]=void 0,e[i+1]=void 0,e[i+2]=void 0;r.result=t,r.state=2,r.reactionLength=0},O=function(e){var t=!1,r,n;return{resolve:function(r){var n;if(!t){if(t=!0,r===e)return m(e,new TypeError("Self resolution"));if(!ce.TypeIsObject(r))return d(e,r);try{n=r.then}catch(o){return m(e,o)}if(!ce.IsCallable(n))return d(e,r);i((function(){j(e,r,n)}))}},reject:function(r){if(!t)return t=!0,m(e,r)}}},w=function(e,r,n,o){e===I?t(e,r,n,o,y):t(e,r,n,o)},j=function(e,t,r){var n=O(e),o=n.resolve,i=n.reject;try{w(r,t,o,i)}catch(a){i(a)}},T,I,E=function(){var e=function Promise(t){if(!(this instanceof e))throw new TypeError('Constructor Promise requires "new"');if(this&&this._promise)throw new TypeError("Bad construction");if(!ce.IsCallable(t))throw new TypeError("not a valid resolver");var r=Ae(this,e,T,{_promise:{result:void 0,state:0,reactionLength:0,fulfillReactionHandler0:void 0,rejectReactionHandler0:void 0,reactionCapability0:void 0}}),n=O(r),o=n.reject;try{t(n.resolve,o)}catch(i){o(i)}return r};return e}();T=E.prototype;var P=function(e,t,r,n){var o=!1;return function(i){var a;o||(o=!0,t[e]=i,0==--n.count&&(0,r.resolve)(t))}},C=function(e,t,r){for(var n=e.iterator,o=[],i={count:1},a,u,f=0,p;;){try{if(!1===(a=ce.IteratorStep(n))){e.done=!0;break}u=a.value}catch(s){throw e.done=!0,s}o[f]=void 0;var c=t.resolve(u),l=P(f,o,r,i);i.count+=1,w(c.then,c,l,r.reject),f+=1}0==--i.count&&(0,r.resolve)(o);return r.promise},x=function(e,t,r){for(var n=e.iterator,o,i,a;;){try{if(!1===(o=ce.IteratorStep(n))){e.done=!0;break}i=o.value}catch(u){throw e.done=!0,u}a=t.resolve(i),w(a.then,a,r.resolve,r.reject)}return r.promise};return b(E,{all:function all(e){var t=this;if(!ce.TypeIsObject(t))throw new TypeError("Promise is not object");var n=new r(t),o,i;try{return o=ce.GetIterator(e),C(i={iterator:o,done:!1},t,n)}catch(a){var u=a,s;if(i&&!i.done)try{ce.IteratorClose(o,!0)}catch(f){u=f}return(0,n.reject)(u),n.promise}},race:function race(e){var t=this;if(!ce.TypeIsObject(t))throw new TypeError("Promise is not object");var n=new r(t),o,i;try{return o=ce.GetIterator(e),x(i={iterator:o,done:!1},t,n)}catch(a){var u=a,s;if(i&&!i.done)try{ce.IteratorClose(o,!0)}catch(f){u=f}return(0,n.reject)(u),n.promise}},reject:function reject(e){var t=this;if(!ce.TypeIsObject(t))throw new TypeError("Bad promise constructor");var n=new r(t),o;return(0,n.reject)(e),n.promise},resolve:function resolve(e){var t=this,n;if(!ce.TypeIsObject(t))throw new TypeError("Bad promise constructor");if(ce.IsPromise(e)&&e.constructor===t)return e;var o=new r(t),i;return(0,o.resolve)(e),o.promise}}),b(T,{catch:function(e){return this.then(null,e)},then:function then(e,t){var n=this;if(!ce.IsPromise(n))throw new TypeError("not a promise");var o=ce.SpeciesConstructor(n,E),i,b=arguments.length>2&&arguments[2]===y;i=b&&o===E?y:new r(o);var g=ce.IsCallable(e)?e:a,d=ce.IsCallable(t)?t:u,m=n._promise,O;if(0===m.state){if(0===m.reactionLength)m.fulfillReactionHandler0=g,m.rejectReactionHandler0=d,m.reactionCapability0=i;else{var w=3*(m.reactionLength-1);m[w+0]=g,m[w+1]=d,m[w+2]=i}m.reactionLength+=1}else if(1===m.state)O=m.result,h(g,i,O);else{if(2!==m.state)throw new TypeError("unexpected Promise state");O=m.result,h(d,i,O)}return i.promise}}),y=new r(E),I=T.then,E}}();if(S.Promise&&(delete S.Promise.accept,delete S.Promise.defer,delete S.Promise.prototype.chain),"function"==typeof Fr){b(S,{Promise:Fr});var Dr=w(S.Promise,(function(e){return e.resolve(42).then((function(){}))instanceof e})),zr=!i((function(){return S.Promise.reject(42).then(null,5).then(null,W)})),qr=i((function(){return S.Promise.call(3,W)})),Wr=function(e){var t=e.resolve(5);t.constructor={};var r=e.resolve(t);try{r.then(null,W).then(null,W)}catch(n){return!0}return t===r}(S.Promise),Gr=s&&function(){var e=0,t=Object.defineProperty({},"then",{get:function(){e+=1}});return Promise.resolve(t),1===e}(),Hr=function BadResolverPromise(e){var t=new Promise(e);e(3,(function(){})),this.then=t.then,this.constructor=BadResolverPromise};Hr.prototype=Promise.prototype,Hr.all=Promise.all;var Vr=a((function(){return!!Hr.all([1,2])}));if(Dr&&zr&&qr&&!Wr&&Gr&&!Vr||(Promise=Fr,ne(S,"Promise",Fr)),1!==Promise.all.length){var Br=Promise.all;ne(Promise,"all",(function all(e){return ce.Call(Br,this,arguments)}))}if(1!==Promise.race.length){var Ur=Promise.race;ne(Promise,"race",(function race(e){return ce.Call(Ur,this,arguments)}))}if(1!==Promise.resolve.length){var $r=Promise.resolve;ne(Promise,"resolve",(function resolve(e){return ce.Call($r,this,arguments)}))}if(1!==Promise.reject.length){var Jr=Promise.reject;ne(Promise,"reject",(function reject(e){return ce.Call(Jr,this,arguments)}))}Mt(Promise,"all"),Mt(Promise,"race"),Mt(Promise,"resolve"),Mt(Promise,"reject"),Ce(Promise)}var Xr=function(e){var t=n(p(e,(function(e,t){return e[t]=!0,e}),{}));return e.join(":")===t.join(":")},Kr=Xr(["z","a","bb"]),Zr=Xr(["z",1,"a","3",2]);if(s){var Yr=function fastkey(e,t){return t||Kr?se(e)?"^"+ce.ToString(e):"string"==typeof e?"$"+e:"number"==typeof e?Zr?e:"n"+e:"boolean"==typeof e?"b"+e:null:null},Qr=function emptyObject(){return Object.create?Object.create(null):{}},en=function addIterableToMap(e,n,o){if(r(o)||re.string(o))l(o,(function(e){if(!ce.TypeIsObject(e))throw new TypeError("Iterator value "+e+" is not an entry object");n.set(e[0],e[1])}));else if(o instanceof e)t(e.prototype.forEach,o,(function(e,t){n.set(t,e)}));else{var i,a;if(!se(o)){if(a=n.set,!ce.IsCallable(a))throw new TypeError("bad map");i=ce.GetIterator(o)}if(void 0!==i)for(;;){var u=ce.IteratorStep(i);if(!1===u)break;var f=u.value;try{if(!ce.TypeIsObject(f))throw new TypeError("Iterator value "+f+" is not an entry object");t(a,n,f[0],f[1])}catch(s){throw ce.IteratorClose(i,!0),s}}}},tn=function addIterableToSet(e,n,o){if(r(o)||re.string(o))l(o,(function(e){n.add(e)}));else if(o instanceof e)t(e.prototype.forEach,o,(function(e){n.add(e)}));else{var i,a;if(!se(o)){if(a=n.add,!ce.IsCallable(a))throw new TypeError("bad set");i=ce.GetIterator(o)}if(void 0!==i)for(;;){var u=ce.IteratorStep(i);if(!1===u)break;var f=u.value;try{t(a,n,f)}catch(s){throw ce.IteratorClose(i,!0),s}}}},rn={Map:function(){var e={},r=function MapEntry(e,t){this.key=e,this.value=t,this.next=null,this.prev=null};r.prototype.isRemoved=function isRemoved(){return this.key===e};var n=function isMap(e){return!!e._es6map},o=function requireMapSlot(e,t){if(!ce.TypeIsObject(e)||!n(e))throw new TypeError("Method Map.prototype."+t+" called on incompatible receiver "+ce.ToString(e))},i=function MapIterator(e,t){o(e,"[[MapIterator]]"),this.head=e._head,this.i=this.head,this.kind=t},a;Me(i.prototype={isMapIterator:!0,next:function next(){if(!this.isMapIterator)throw new TypeError("Not a MapIterator");var e=this.i,t=this.kind,r=this.head,n;if(void 0===this.i)return Ke();for(;e.isRemoved()&&e!==r;)e=e.prev;for(;e.next!==r;)if(!(e=e.next).isRemoved())return n="key"===t?e.key:"value"===t?e.value:[e.key,e.value],this.i=e,Ke(n);return this.i=void 0,Ke()}});var u=function Map(){if(!(this instanceof Map))throw new TypeError('Constructor Map requires "new"');if(this&&this._es6map)throw new TypeError("Bad construction");var e=Ae(this,Map,a,{_es6map:!0,_head:null,_map:G?new G:null,_size:0,_storage:Qr()}),t=new r(null,null);return t.next=t.prev=t,e._head=t,arguments.length>0&&en(Map,e,arguments[0]),e};return a=u.prototype,m.getter(a,"size",(function(){if(void 0===this._size)throw new TypeError("size method called on incompatible Map");return this._size})),b(a,{get:function get(e){var t;o(this,"get");var r=Yr(e,!0);if(null!==r)return(t=this._storage[r])?t.value:void 0;if(this._map)return(t=V.call(this._map,e))?t.value:void 0;for(var n=this._head,i=n;(i=i.next)!==n;)if(ce.SameValueZero(i.key,e))return i.value},has:function has(e){o(this,"has");var t=Yr(e,!0);if(null!==t)return void 0!==this._storage[t];if(this._map)return B.call(this._map,e);for(var r=this._head,n=r;(n=n.next)!==r;)if(ce.SameValueZero(n.key,e))return!0;return!1},set:function set(e,t){o(this,"set");var n=this._head,i=n,a,u=Yr(e,!0);if(null!==u){if(void 0!==this._storage[u])return this._storage[u].value=t,this;a=this._storage[u]=new r(e,t),i=n.prev}else this._map&&(B.call(this._map,e)?V.call(this._map,e).value=t:(a=new r(e,t),U.call(this._map,e,a),i=n.prev));for(;(i=i.next)!==n;)if(ce.SameValueZero(i.key,e))return i.value=t,this;return a=a||new r(e,t),ce.SameValue(-0,e)&&(a.key=0),a.next=this._head,a.prev=this._head.prev,a.prev.next=a,a.next.prev=a,this._size+=1,this},delete:function(t){o(this,"delete");var r=this._head,n=r,i=Yr(t,!0);if(null!==i){if(void 0===this._storage[i])return!1;n=this._storage[i].prev,delete this._storage[i]}else if(this._map){if(!B.call(this._map,t))return!1;n=V.call(this._map,t).prev,H.call(this._map,t)}for(;(n=n.next)!==r;)if(ce.SameValueZero(n.key,t))return n.key=e,n.value=e,n.prev.next=n.next,n.next.prev=n.prev,this._size-=1,!0;return!1},clear:function clear(){o(this,"clear"),this._map=G?new G:null,this._size=0,this._storage=Qr();for(var t=this._head,r=t,n=r.next;(r=n)!==t;)r.key=e,r.value=e,n=r.next,r.next=r.prev=t;t.next=t.prev=t},keys:function keys(){return o(this,"keys"),new i(this,"key")},values:function values(){return o(this,"values"),new i(this,"value")},entries:function entries(){return o(this,"entries"),new i(this,"key+value")},forEach:function forEach(e){o(this,"forEach");for(var r=arguments.length>1?arguments[1]:null,n=this.entries(),i=n.next();!i.done;i=n.next())r?t(e,r,i.value[1],i.value[0],this):e(i.value[1],i.value[0],this)}}),Me(a,a.entries),u}(),Set:function(){var e=function isSet(e){return e._es6set&&void 0!==e._storage},r=function requireSetSlot(t,r){if(!ce.TypeIsObject(t)||!e(t))throw new TypeError("Set.prototype."+r+" called on incompatible receiver "+ce.ToString(t))},o,i=function Set(){if(!(this instanceof Set))throw new TypeError('Constructor Set requires "new"');if(this&&this._es6set)throw new TypeError("Bad construction");var e=Ae(this,Set,o,{_es6set:!0,"[[SetData]]":null,_storage:Qr()});if(!e._es6set)throw new TypeError("bad set");return arguments.length>0&&tn(Set,e,arguments[0]),e};o=i.prototype;var a=function(e){var t=e;if("^null"===t)return null;if("^undefined"!==t){var r=t.charAt(0);return"$"===r?C(t,1):"n"===r?+C(t,1):"b"===r?"btrue"===t:+t}},u=function ensureMap(e){if(!e["[[SetData]]"]){var t=new rn.Map;e["[[SetData]]"]=t,l(n(e._storage),(function(e){var r=a(e);t.set(r,r)})),e["[[SetData]]"]=t}e._storage=null};m.getter(i.prototype,"size",(function(){return r(this,"size"),this._storage?n(this._storage).length:(u(this),this["[[SetData]]"].size)})),b(i.prototype,{has:function has(e){var t;return r(this,"has"),this._storage&&null!==(t=Yr(e))?!!this._storage[t]:(u(this),this["[[SetData]]"].has(e))},add:function add(e){var t;return r(this,"add"),this._storage&&null!==(t=Yr(e))?(this._storage[t]=!0,this):(u(this),this["[[SetData]]"].set(e,e),this)},delete:function(e){var t;if(r(this,"delete"),this._storage&&null!==(t=Yr(e))){var n=z(this._storage,t);return delete this._storage[t]&&n}return u(this),this["[[SetData]]"].delete(e)},clear:function clear(){r(this,"clear"),this._storage&&(this._storage=Qr()),this["[[SetData]]"]&&this["[[SetData]]"].clear()},values:function values(){return r(this,"values"),u(this),new f(this["[[SetData]]"].values())},entries:function entries(){return r(this,"entries"),u(this),new f(this["[[SetData]]"].entries())},forEach:function forEach(e){r(this,"forEach");var n=arguments.length>1?arguments[1]:null,o=this;u(o),this["[[SetData]]"].forEach((function(r,i){n?t(e,n,i,i,o):e(i,i,o)}))}}),h(i.prototype,"keys",i.prototype.values,!0),Me(i.prototype,i.prototype.values);var f=function SetIterator(e){this.it=e};return f.prototype={isSetIterator:!0,next:function next(){if(!this.isSetIterator)throw new TypeError("Not a SetIterator");return this.it.next()}},Me(f.prototype),i}()},nn=S.Set&&!Set.prototype.delete&&Set.prototype.remove&&Set.prototype.items&&Set.prototype.map&&Array.isArray((new Set).keys);if(nn&&(S.Set=rn.Set),S.Map||S.Set){var on=a((function(){return 2===new Map([[1,2]]).get(1)}));on||(S.Map=function Map(){if(!(this instanceof Map))throw new TypeError('Constructor Map requires "new"');var e=new G;return arguments.length>0&&en(Map,e,arguments[0]),delete e.constructor,Object.setPrototypeOf(e,S.Map.prototype),e},S.Map.prototype=O(G.prototype),h(S.Map.prototype,"constructor",S.Map,!0),m.preserveToString(S.Map,G));var an=new Map,un=function(){var e=new Map([[1,0],[2,0],[3,0],[4,0]]);return e.set(-0,e),e.get(0)===e&&e.get(-0)===e&&e.has(0)&&e.has(-0)}(),fn=an.set(1,2)===an;un&&fn||ne(Map.prototype,"set",(function set(e,r){return t(U,this,0===e?0:e,r),this})),un||(b(Map.prototype,{get:function get(e){return t(V,this,0===e?0:e)},has:function has(e){return t(B,this,0===e?0:e)}},!0),m.preserveToString(Map.prototype.get,V),m.preserveToString(Map.prototype.has,B));var sn=new Set,cn=Set.prototype.delete&&Set.prototype.add&&Set.prototype.has&&function(e){return e.delete(0),e.add(-0),!e.has(0)}(sn),ln=sn.add(1)===sn;if(!cn||!ln){var pn=Set.prototype.add;Set.prototype.add=function add(e){return t(pn,this,0===e?0:e),this},m.preserveToString(Set.prototype.add,pn)}if(!cn){var vn=Set.prototype.has;Set.prototype.has=function has(e){return t(vn,this,0===e?0:e)},m.preserveToString(Set.prototype.has,vn);var yn=Set.prototype.delete;Set.prototype.delete=function SetDelete(e){return t(yn,this,0===e?0:e)},m.preserveToString(Set.prototype.delete,yn)}var hn=w(S.Map,(function(e){var t=new e([]);return t.set(42,42),t instanceof e})),bn=Object.setPrototypeOf&&!hn,gn=function(){try{return!(S.Map()instanceof S.Map)}catch(e){return e instanceof TypeError}}();0===S.Map.length&&!bn&&gn||(S.Map=function Map(){if(!(this instanceof Map))throw new TypeError('Constructor Map requires "new"');var e=new G;return arguments.length>0&&en(Map,e,arguments[0]),delete e.constructor,Object.setPrototypeOf(e,Map.prototype),e},S.Map.prototype=G.prototype,h(S.Map.prototype,"constructor",S.Map,!0),m.preserveToString(S.Map,G));var dn=w(S.Set,(function(e){var t=new e([]);return t.add(42,42),t instanceof e})),mn=Object.setPrototypeOf&&!dn,On=function(){try{return!(S.Set()instanceof S.Set)}catch(e){return e instanceof TypeError}}();if(0!==S.Set.length||mn||!On){var wn=S.Set;S.Set=function Set(){if(!(this instanceof Set))throw new TypeError('Constructor Set requires "new"');var e=new wn;return arguments.length>0&&tn(Set,e,arguments[0]),delete e.constructor,Object.setPrototypeOf(e,Set.prototype),e},S.Set.prototype=wn.prototype,h(S.Set.prototype,"constructor",S.Set,!0),m.preserveToString(S.Set,wn)}var jn=new S.Map,Sn=!a((function(){return jn.keys().next().done}));if(("function"!=typeof S.Map.prototype.clear||0!==(new S.Set).size||0!==jn.size||"function"!=typeof S.Map.prototype.keys||"function"!=typeof S.Set.prototype.keys||"function"!=typeof S.Map.prototype.forEach||"function"!=typeof S.Set.prototype.forEach||u(S.Map)||u(S.Set)||"function"!=typeof jn.keys().next||Sn||!hn)&&b(S,{Map:rn.Map,Set:rn.Set},!0),S.Set.prototype.keys!==S.Set.prototype.values&&h(S.Set.prototype,"keys",S.Set.prototype.values,!0),Me(Object.getPrototypeOf((new S.Map).keys())),Me(Object.getPrototypeOf((new S.Set).keys())),c&&"has"!==S.Set.prototype.has.name){var Tn=S.Set.prototype.has;ne(S.Set.prototype,"has",(function has(e){return t(Tn,this,e)}))}}b(S,rn),Ce(S.Map),Ce(S.Set)}var In=function throwUnlessTargetIsObject(e){if(!ce.TypeIsObject(e))throw new TypeError("target must be an object")},En={apply:function apply(){return ce.Call(ce.Call,null,arguments)},construct:function construct(e,t){if(!ce.IsConstructor(e))throw new TypeError("First argument must be a constructor.");var r=arguments.length>2?arguments[2]:e;if(!ce.IsConstructor(r))throw new TypeError("new.target must be a constructor.");return ce.Construct(e,t,r,"internal")},deleteProperty:function deleteProperty(e,t){if(In(e),s){var r=Object.getOwnPropertyDescriptor(e,t);if(r&&!r.configurable)return!1}return delete e[t]},has:function has(e,t){return In(e),t in e}};Object.getOwnPropertyNames&&Object.assign(En,{ownKeys:function ownKeys(e){In(e);var t=Object.getOwnPropertyNames(e);return ce.IsCallable(Object.getOwnPropertySymbols)&&x(t,Object.getOwnPropertySymbols(e)),t}});var Pn=function ConvertExceptionToBoolean(e){return!i(e)};if(Object.preventExtensions&&Object.assign(En,{isExtensible:function isExtensible(e){return In(e),Object.isExtensible(e)},preventExtensions:function preventExtensions(e){return In(e),Pn((function(){return Object.preventExtensions(e)}))}}),s){var Cn=function get(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);if(!n){var o=Object.getPrototypeOf(e);if(null===o)return;return Cn(o,t,r)}return"value"in n?n.value:n.get?ce.Call(n.get,r):void 0},Mn=function set(e,r,n,o){var i=Object.getOwnPropertyDescriptor(e,r),u;if(!i){var a=Object.getPrototypeOf(e);if(null!==a)return Mn(a,r,n,o);i={value:void 0,writable:!0,enumerable:!0,configurable:!0}}return"value"in i?!!i.writable&&(!!ce.TypeIsObject(o)&&(Object.getOwnPropertyDescriptor(o,r)?ae.defineProperty(o,r,{value:n}):ae.defineProperty(o,r,{value:n,writable:!0,enumerable:!0,configurable:!0}))):!!i.set&&(t(i.set,o,n),!0)};Object.assign(En,{defineProperty:function defineProperty(e,t,r){return In(e),Pn((function(){return Object.defineProperty(e,t,r)}))},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(e,t){return In(e),Object.getOwnPropertyDescriptor(e,t)},get:function get(e,t){In(e);var r=arguments.length>2?arguments[2]:e;return Cn(e,t,r)},set:function set(e,t,r){In(e);var n=arguments.length>3?arguments[3]:e;return Mn(e,t,r,n)}})}if(Object.getPrototypeOf){var xn=Object.getPrototypeOf;En.getPrototypeOf=function getPrototypeOf(e){return In(e),xn(e)}}if(Object.setPrototypeOf&&En.getPrototypeOf){var Nn=function(e,t){for(var r=t;r;){if(e===r)return!0;r=En.getPrototypeOf(r)}return!1};Object.assign(En,{setPrototypeOf:function setPrototypeOf(e,t){if(In(e),null!==t&&!ce.TypeIsObject(t))throw new TypeError("proto must be an object or null");return t===ae.getPrototypeOf(e)||!(ae.isExtensible&&!ae.isExtensible(e))&&(!Nn(e,t)&&(Object.setPrototypeOf(e,t),!0))}})}var An=function(e,t){var r;ce.IsCallable(S.Reflect[e])?a((function(){return S.Reflect[e](1),S.Reflect[e](NaN),S.Reflect[e](!0),!0}))&&ne(S.Reflect,e,t):h(S.Reflect,e,t)};Object.keys(En).forEach((function(e){An(e,En[e])}));var Rn=S.Reflect.getPrototypeOf;if(c&&Rn&&"getPrototypeOf"!==Rn.name&&ne(S.Reflect,"getPrototypeOf",(function getPrototypeOf(e){return t(Rn,S.Reflect,e)})),S.Reflect.setPrototypeOf&&a((function(){return S.Reflect.setPrototypeOf(1,{}),!0}))&&ne(S.Reflect,"setPrototypeOf",En.setPrototypeOf),S.Reflect.defineProperty&&(a((function(){var e=!S.Reflect.defineProperty(1,"test",{value:1}),t="function"!=typeof Object.preventExtensions||!S.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return e&&t}))||ne(S.Reflect,"defineProperty",En.defineProperty)),S.Reflect.construct&&(a((function(){var e=function F(){};return S.Reflect.construct((function(){}),[],e)instanceof e}))||ne(S.Reflect,"construct",En.construct)),"Invalid Date"!==String(new Date(NaN))){var _n=Date.prototype.toString,kn=function toString(){var e=+this;return e!=e?"Invalid Date":ce.Call(_n,this)};ne(Date.prototype,"toString",kn)}var Ln={anchor:function anchor(e){return ce.CreateHTML(this,"a","name",e)},big:function big(){return ce.CreateHTML(this,"big","","")},blink:function blink(){return ce.CreateHTML(this,"blink","","")},bold:function bold(){return ce.CreateHTML(this,"b","","")},fixed:function fixed(){return ce.CreateHTML(this,"tt","","")},fontcolor:function fontcolor(e){return ce.CreateHTML(this,"font","color",e)},fontsize:function fontsize(e){return ce.CreateHTML(this,"font","size",e)},italics:function italics(){return ce.CreateHTML(this,"i","","")},link:function link(e){return ce.CreateHTML(this,"a","href",e)},small:function small(){return ce.CreateHTML(this,"small","","")},strike:function strike(){return ce.CreateHTML(this,"strike","","")},sub:function sub(){return ce.CreateHTML(this,"sub","","")},sup:function sub(){return ce.CreateHTML(this,"sup","","")}};l(Object.keys(Ln),(function(e){var r=String.prototype[e],n=!1;if(ce.IsCallable(r)){var o=t(r,"",' " '),i=P([],o.match(/"/g)).length;n=o!==o.toLowerCase()||i>2}else n=!0;n&&ne(String.prototype,e,Ln[e])}));var Fn=function(){if(!oe)return!1;var e="object"==typeof JSON&&"function"==typeof JSON.stringify?JSON.stringify:null;if(!e)return!1;if(void 0!==e($()))return!0;if("[null]"!==e([$()]))return!0;var t={a:$()};return t[$()]=!0,"{}"!==e(t)}(),Dn=a((function(){return!oe||"{}"===JSON.stringify(Object($()))&&"[{}]"===JSON.stringify([Object($())])}));if(Fn||!Dn){var zn=JSON.stringify;ne(JSON,"stringify",(function stringify(e){if("symbol"!=typeof e){var n;arguments.length>1&&(n=arguments[1]);var o=[e];if(r(n))o.push(n);else{var i=ce.IsCallable(n)?n:null,a=function(e,r){var n=i?t(i,this,e,r):r;if("symbol"!=typeof n)return re.symbol(n)?Nt({})(n):n};o.push(a)}return arguments.length>2&&o.push(arguments[2]),zn.apply(this,o)}}))}return S})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).FormValidation={})}(this,(function(e){"use strict";function t(e){for(var t=e.length,n=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],r=0,a=0;t--;)a+=n[r][parseInt(e.charAt(t),10)],r=1-r;return a%10==0&&a>0}function n(e){for(var t=e.length,n=5,r=0;r<t;r++)n=(2*(n||10)%11+parseInt(e.charAt(r),10))%10;return 1===n}function r(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=e.length,r=t.length,a=Math.floor(r/2),l=0;l<n;l++)a=(2*(a||r)%(r+1)+t.indexOf(e.charAt(l)))%r;return 1===a}function a(e){for(var t=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],n=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],r=e.reverse(),a=0,l=0;l<r.length;l++)a=t[a][n[l%8][r[l]]];return 0===a}var l={luhn:t,mod11And10:n,mod37And36:r,verhoeff:a};function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?m(e):t}function p(){return{fns:{},clear:function(){this.fns={}},emit:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(this.fns[e]||[]).map((function(e){return e.apply(e,n)}))},off:function(e,t){if(this.fns[e]){var n=this.fns[e].indexOf(t);n>=0&&this.fns[e].splice(n,1)}},on:function(e,t){(this.fns[e]=this.fns[e]||[]).push(t)}}}function h(){return{filters:{},add:function(e,t){(this.filters[e]=this.filters[e]||[]).push(t)},clear:function(){this.filters={}},execute:function(e,t,n){if(!this.filters[e]||!this.filters[e].length)return t;for(var r=t,a=this.filters[e],l=a.length,i=0;i<l;i++)r=a[i].apply(r,n);return r},remove:function(e,t){this.filters[e]&&(this.filters[e]=this.filters[e].filter((function(e){return e!==t})))}}}function v(e,t,n,r){var a=(n.getAttribute("type")||"").toLowerCase(),l;switch(n.tagName.toLowerCase()){case"textarea":return n.value;case"select":var s=n,o=s.selectedIndex;return o>=0?s.options.item(o).value:"";case"input":if("radio"===a||"checkbox"===a){var i=r.filter((function(e){return e.checked})).length;return 0===i?"":i+""}return n.value;default:return""}}function A(e,t){var n=Array.isArray(t)?t:[t],r=e;return n.forEach((function(e){r=r.replace("%s",e)})),r}function b(){var e=function(e){return parseFloat("".concat(e).replace(",","."))};return{validate:function(t){var n=t.value;if(""===n)return{valid:!0};var r=Object.assign({},{inclusive:!0,message:""},t.options),a=e(r.min),l=e(r.max);return r.inclusive?{message:A(t.l10n?r.message||t.l10n.between.default:r.message,["".concat(a),"".concat(l)]),valid:parseFloat(n)>=a&&parseFloat(n)<=l}:{message:A(t.l10n?r.message||t.l10n.between.notInclusive:r.message,["".concat(a),"".concat(l)]),valid:parseFloat(n)>a&&parseFloat(n)<l}}}}function E(){return{validate:function(e){return{valid:!0}}}}function C(e,t){if("function"==typeof e)return e.apply(this,t);if("string"==typeof e){var n=e;"()"===n.substring(n.length-2)&&(n=n.substring(0,n.length-2));var r=n.split("."),a=r.pop(),l=window,i=!0,o=!1,s=void 0;try{for(var c=r[Symbol.iterator](),u;!(i=(u=c.next()).done);i=!0){var d;l=l[u.value]}}catch(e){o=!0,s=e}finally{try{!i&&null!=c.return&&c.return()}finally{if(o)throw s}}return void 0===l[a]?null:l[a].apply(this,t)}}function V(){return{validate:function(e){var t=C(e.options.callback,[e]);return"boolean"==typeof t?{valid:t}:t}}}function S(){return{validate:function(e){var t="select"===e.element.tagName.toLowerCase()?e.element.querySelectorAll("option:checked").length:e.elements.filter((function(e){return e.checked})).length,n=e.options.min?"".concat(e.options.min):"",r=e.options.max?"".concat(e.options.max):"",a=e.l10n?e.options.message||e.l10n.choice.default:e.options.message,l=!(n&&t<parseInt(n,10)||r&&t>parseInt(r,10));switch(!0){case!!n&&!!r:a=A(e.l10n?e.l10n.choice.between:e.options.message,[n,r]);break;case!!n:a=A(e.l10n?e.l10n.choice.more:e.options.message,n);break;case!!r:a=A(e.l10n?e.l10n.choice.less:e.options.message,r)}return{message:a,valid:l}}}}var H={AMERICAN_EXPRESS:{length:[15],prefix:["34","37"]},DANKORT:{length:[16],prefix:["5019"]},DINERS_CLUB:{length:[14],prefix:["300","301","302","303","304","305","36"]},DINERS_CLUB_US:{length:[16],prefix:["54","55"]},DISCOVER:{length:[16],prefix:["6011","622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925","644","645","646","647","648","649","65"]},ELO:{length:[16],prefix:["4011","4312","4389","4514","4573","4576","5041","5066","5067","509","6277","6362","6363","650","6516","6550"]},FORBRUGSFORENINGEN:{length:[16],prefix:["600722"]},JCB:{length:[16],prefix:["3528","3529","353","354","355","356","357","358"]},LASER:{length:[16,17,18,19],prefix:["6304","6706","6771","6709"]},MAESTRO:{length:[12,13,14,15,16,17,18,19],prefix:["5018","5020","5038","5868","6304","6759","6761","6762","6763","6764","6765","6766"]},MASTERCARD:{length:[16],prefix:["51","52","53","54","55"]},SOLO:{length:[16,18,19],prefix:["6334","6767"]},UNIONPAY:{length:[16,17,18,19],prefix:["622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925"]},VISA:{length:[16],prefix:["4"]},VISA_ELECTRON:{length:[16],prefix:["4026","417500","4405","4508","4844","4913","4917"]}};function y(){return{validate:function(e){if(""===e.value)return{meta:{type:null},valid:!0};if(/[^0-9-\s]+/.test(e.value))return{meta:{type:null},valid:!1};var n=e.value.replace(/\D/g,"");if(!t(n))return{meta:{type:null},valid:!1};for(var r=0,a=Object.keys(H);r<a.length;r++){var l=a[r];for(var i in H[l].prefix)if(e.value.substr(0,H[l].prefix[i].length)===H[l].prefix[i]&&-1!==H[l].length.indexOf(n.length))return{meta:{type:l},valid:!0}}return{meta:{type:null},valid:!1}}}}function F(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n))return!1;if(e<1e3||e>9999||t<=0||t>12)return!1;var a;if(n<=0||n>[31,e%400==0||e%100!=0&&e%4==0?29:28,31,30,31,30,31,31,30,31,30,31][t-1])return!1;if(!0===r){var l=new Date,i=l.getFullYear(),o=l.getMonth(),s=l.getDate();return e<i||e===i&&t-1<o||e===i&&t-1===o&&n<s}return!0}function I(){var e=function(e,t,n){var r=t.indexOf("YYYY"),a=t.indexOf("MM"),l=t.indexOf("DD");if(-1===r||-1===a||-1===l)return null;var i=e.split(" "),o=i[0].split(n);if(o.length<3)return null;var s=new Date(parseInt(o[r],10),parseInt(o[a],10)-1,parseInt(o[l],10));if(i.length>1){var c=i[1].split(":");s.setHours(c.length>0?parseInt(c[0],10):0),s.setMinutes(c.length>1?parseInt(c[1],10):0),s.setSeconds(c.length>2?parseInt(c[2],10):0)}return s},t=function(e,t){var n=t.replace(/Y/g,"y").replace(/M/g,"m").replace(/D/g,"d").replace(/:m/g,":M").replace(/:mm/g,":MM").replace(/:S/,":s").replace(/:SS/,":ss"),r=e.getDate(),a=r<10?"0".concat(r):r,l=e.getMonth()+1,i=l<10?"0".concat(l):l,o="".concat(e.getFullYear()).substr(2),s=e.getFullYear(),c=e.getHours()%12||12,u=c<10?"0".concat(c):c,d=e.getHours(),f=d<10?"0".concat(d):d,m=e.getMinutes(),g=m<10?"0".concat(m):m,p=e.getSeconds(),h=p<10?"0".concat(p):p,v={H:"".concat(d),HH:"".concat(f),M:"".concat(m),MM:"".concat(g),d:"".concat(r),dd:"".concat(a),h:"".concat(c),hh:"".concat(u),m:"".concat(l),mm:"".concat(i),s:"".concat(p),ss:"".concat(h),yy:"".concat(o),yyyy:"".concat(s)};return n.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMs])\1?|"[^"]*"|'[^']*'/g,(function(e){return v[e]?v[e]:e.slice(1,e.length-1)}))};return{validate:function(n){if(""===n.value)return{meta:{date:null},valid:!0};var r=Object.assign({},{format:n.element&&"date"===n.element.getAttribute("type")?"YYYY-MM-DD":"MM/DD/YYYY",message:""},n.options),a=n.l10n?n.l10n.date.default:r.message,l={message:"".concat(a),meta:{date:null},valid:!1},i=r.format.split(" "),o=i.length>1?i[1]:null,s=i.length>2?i[2]:null,c=n.value.split(" "),u=c[0],d=c.length>1?c[1]:null;if(i.length!==c.length)return l;var f=r.separator||(-1!==u.indexOf("/")?"/":-1!==u.indexOf("-")?"-":-1!==u.indexOf(".")?".":"/");if(null===f||-1===u.indexOf(f))return l;var m=u.split(f),g=i[0].split(f);if(m.length!==g.length)return l;var p=m[g.indexOf("YYYY")],h=m[g.indexOf("MM")],v=m[g.indexOf("DD")];if(!/^\d+$/.test(p)||!/^\d+$/.test(h)||!/^\d+$/.test(v)||p.length>4||h.length>2||v.length>2)return l;var b=parseInt(p,10),E=parseInt(h,10),C=parseInt(v,10);if(!F(b,E,C))return l;var V=new Date(b,E-1,C);if(o){var S=d.split(":");if(o.split(":").length!==S.length)return l;var H=S.length>0?S[0].length<=2&&/^\d+$/.test(S[0])?parseInt(S[0],10):-1:0,y=S.length>1?S[1].length<=2&&/^\d+$/.test(S[1])?parseInt(S[1],10):-1:0,I=S.length>2?S[2].length<=2&&/^\d+$/.test(S[2])?parseInt(S[2],10):-1:0;if(-1===H||-1===y||-1===I)return l;if(I<0||I>60)return l;if(H<0||H>=24||s&&H>12)return l;if(y<0||y>59)return l;V.setHours(H),V.setMinutes(y),V.setSeconds(I)}var O="function"==typeof r.min?r.min():r.min,w=O instanceof Date?O:O?e(O,g,f):V,L="function"==typeof r.max?r.max():r.max,N=L instanceof Date?L:L?e(L,g,f):V,x=O instanceof Date?t(w,r.format):O,M=L instanceof Date?t(N,r.format):L;switch(!0){case!!x&&!M:return{message:A(n.l10n?n.l10n.date.min:a,x),meta:{date:V},valid:V.getTime()>=w.getTime()};case!!M&&!x:return{message:A(n.l10n?n.l10n.date.max:a,M),meta:{date:V},valid:V.getTime()<=N.getTime()};case!!M&&!!x:return{message:A(n.l10n?n.l10n.date.range:a,[x,M]),meta:{date:V},valid:V.getTime()<=N.getTime()&&V.getTime()>=w.getTime()};default:return{message:"".concat(a),meta:{date:V},valid:!0}}}}}function O(){return{validate:function(e){var t="function"==typeof e.options.compare?e.options.compare.call(this):e.options.compare;return{valid:""===t||e.value!==t}}}}function w(){return{validate:function(e){return{valid:""===e.value||/^\d+$/.test(e.value)}}}}function L(){var e=function(e,t){for(var n=e.split(/"/),r=n.length,a=[],l="",i=0;i<r;i++)if(i%2==0){var o=n[i].split(t),s=o.length;if(1===s)l+=o[0];else{a.push(l+o[0]);for(var c=1;c<s-1;c++)a.push(o[c]);l=o[s-1]}}else l+='"'+n[i],i<r-1&&(l+='"');return a.push(l),a};return{validate:function(t){if(""===t.value)return{valid:!0};var n=Object.assign({},{multiple:!1,separator:/[,;]/},t.options),r=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,a;if(!0===n.multiple||"true"==="".concat(n.multiple)){for(var l=n.separator||/[,;]/,i=e(t.value,l),o=i.length,s=0;s<o;s++)if(!r.test(i[s]))return{valid:!1};return{valid:!0}}return{valid:r.test(t.value)}}}}function N(){return{validate:function(e){if(""===e.value)return{valid:!0};var t,n=e.options.extension?e.options.extension.toLowerCase().split(","):null,r=e.options.type?e.options.type.toLowerCase().split(","):null,a;if(window.File&&window.FileList&&window.FileReader){var l=e.element.files,i=l.length,o=0;if(e.options.maxFiles&&i>parseInt("".concat(e.options.maxFiles),10))return{meta:{error:"INVALID_MAX_FILES"},valid:!1};if(e.options.minFiles&&i<parseInt("".concat(e.options.minFiles),10))return{meta:{error:"INVALID_MIN_FILES"},valid:!1};for(var s={},c=0;c<i;c++){if(o+=l[c].size,s={ext:t=l[c].name.substr(l[c].name.lastIndexOf(".")+1),file:l[c],size:l[c].size,type:l[c].type},e.options.minSize&&l[c].size<parseInt("".concat(e.options.minSize),10))return{meta:Object.assign({},{error:"INVALID_MIN_SIZE"},s),valid:!1};if(e.options.maxSize&&l[c].size>parseInt("".concat(e.options.maxSize),10))return{meta:Object.assign({},{error:"INVALID_MAX_SIZE"},s),valid:!1};if(n&&-1===n.indexOf(t.toLowerCase()))return{meta:Object.assign({},{error:"INVALID_EXTENSION"},s),valid:!1};if(l[c].type&&r&&-1===r.indexOf(l[c].type.toLowerCase()))return{meta:Object.assign({},{error:"INVALID_TYPE"},s),valid:!1}}if(e.options.maxTotalSize&&o>parseInt("".concat(e.options.maxTotalSize),10))return{meta:Object.assign({},{error:"INVALID_MAX_TOTAL_SIZE",totalSize:o},s),valid:!1};if(e.options.minTotalSize&&o<parseInt("".concat(e.options.minTotalSize),10))return{meta:Object.assign({},{error:"INVALID_MIN_TOTAL_SIZE",totalSize:o},s),valid:!1}}else if(t=e.value.substr(e.value.lastIndexOf(".")+1),n&&-1===n.indexOf(t.toLowerCase()))return{meta:{error:"INVALID_EXTENSION",ext:t},valid:!1};return{valid:!0}}}}function x(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=Object.assign({},{inclusive:!0,message:""},e.options),n=parseFloat("".concat(t.min).replace(",","."));return t.inclusive?{message:A(e.l10n?t.message||e.l10n.greaterThan.default:t.message,"".concat(n)),valid:parseFloat(e.value)>=n}:{message:A(e.l10n?t.message||e.l10n.greaterThan.notInclusive:t.message,"".concat(n)),valid:parseFloat(e.value)>n}}}}function M(){return{validate:function(e){var t="function"==typeof e.options.compare?e.options.compare.call(this):e.options.compare;return{valid:""===t||e.value===t}}}}function T(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=Object.assign({},{decimalSeparator:".",thousandsSeparator:""},e.options),n="."===t.decimalSeparator?"\\.":t.decimalSeparator,r="."===t.thousandsSeparator?"\\.":t.thousandsSeparator,a=new RegExp("^-?[0-9]{1,3}(".concat(r,"[0-9]{3})*(").concat(n,"[0-9]+)?$")),l=new RegExp(r,"g"),i="".concat(e.value);if(!a.test(i))return{valid:!1};r&&(i=i.replace(l,"")),n&&(i=i.replace(n,"."));var o=parseFloat(i);return{valid:!isNaN(o)&&isFinite(o)&&Math.floor(o)===o}}}}function k(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=Object.assign({},{ipv4:!0,ipv6:!0},e.options),n=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/([0-9]|[1-2][0-9]|3[0-2]))?$/,r=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*(\/(\d|\d\d|1[0-1]\d|12[0-8]))?$/;switch(!0){case t.ipv4&&!t.ipv6:return{message:e.l10n?t.message||e.l10n.ip.ipv4:t.message,valid:n.test(e.value)};case!t.ipv4&&t.ipv6:return{message:e.l10n?t.message||e.l10n.ip.ipv6:t.message,valid:r.test(e.value)};case t.ipv4&&t.ipv6:default:return{message:e.l10n?t.message||e.l10n.ip.default:t.message,valid:n.test(e.value)||r.test(e.value)}}}}}function R(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=Object.assign({},{inclusive:!0,message:""},e.options),n=parseFloat("".concat(t.max).replace(",","."));return t.inclusive?{message:A(e.l10n?t.message||e.l10n.lessThan.default:t.message,"".concat(n)),valid:parseFloat(e.value)<=n}:{message:A(e.l10n?t.message||e.l10n.lessThan.notInclusive:t.message,"".concat(n)),valid:parseFloat(e.value)<n}}}}function B(){return{validate:function(e){return{valid:""!==e.value}}}}function Z(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=Object.assign({},{decimalSeparator:".",thousandsSeparator:""},e.options),n="".concat(e.value);n.substr(0,1)===t.decimalSeparator?n="0".concat(t.decimalSeparator).concat(n.substr(1)):n.substr(0,2)==="-".concat(t.decimalSeparator)&&(n="-0".concat(t.decimalSeparator).concat(n.substr(2)));var r="."===t.decimalSeparator?"\\.":t.decimalSeparator,a="."===t.thousandsSeparator?"\\.":t.thousandsSeparator,l=new RegExp("^-?[0-9]{1,3}(".concat(a,"[0-9]{3})*(").concat(r,"[0-9]+)?$")),i=new RegExp(a,"g");if(!l.test(n))return{valid:!1};a&&(n=n.replace(i,"")),r&&(n=n.replace(r,"."));var o=parseFloat(n);return{valid:!isNaN(o)&&isFinite(o)}}}}function G(){return{validate:function(e){return C(e.options.promise,[e])}}}function P(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=e.options.regexp;if(t instanceof RegExp)return{valid:t.test(e.value)};var n=t.toString(),r;return{valid:(e.options.flags?new RegExp(n,e.options.flags):new RegExp(n)).test(e.value)}}}}function D(e,t){var n=function(e){return Object.keys(e).map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))})).join("&")};return new Promise((function(r,a){var l=Object.assign({},{crossDomain:!1,headers:{},method:"GET",params:{}},t),i=Object.keys(l.params).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(l.params[e]))})).join("&"),o=e.indexOf("?"),s="GET"===l.method?"".concat(e).concat(o?"?":"&").concat(i):e;if(l.crossDomain){var c=document.createElement("script"),u="___fetch".concat(Date.now(),"___");window[u]=function(e){delete window[u],r(e)},c.src="".concat(s).concat(o?"&":"?","callback=").concat(u),c.async=!0,c.addEventListener("load",(function(){c.parentNode.removeChild(c)})),c.addEventListener("error",(function(){return a})),document.head.appendChild(c)}else{var d=new XMLHttpRequest;d.open(l.method,s),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),"POST"===l.method&&d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),Object.keys(l.headers).forEach((function(e){return d.setRequestHeader(e,l.headers[e])})),d.addEventListener("load",(function(){r(JSON.parse(this.responseText))})),d.addEventListener("error",(function(){return a})),d.send(n(l.params))}}))}function K(){var e={crossDomain:!1,data:{},headers:{},method:"GET",validKey:"valid"};return{validate:function(t){if(""===t.value)return Promise.resolve({valid:!0});var n=Object.assign({},e,t.options),r=n.data,a;return"function"==typeof n.data&&(r=n.data.call(this,t)),"string"==typeof r&&(r=JSON.parse(r)),r[n.name||t.field]=t.value,D("function"==typeof n.url?n.url.call(this,t):n.url,{crossDomain:n.crossDomain,headers:n.headers,method:n.method,params:r}).then((function(e){return Promise.resolve({message:e.message,meta:e,valid:"true"==="".concat(e[n.validKey])})})).catch((function(e){return Promise.reject({valid:!1})}))}}}function U(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=Object.assign({},{case:"lower"},e.options),n=(t.case||"lower").toLowerCase();return{message:t.message||(e.l10n?"upper"===n?e.l10n.stringCase.upper:e.l10n.stringCase.default:t.message),valid:"upper"===n?e.value===e.value.toUpperCase():e.value===e.value.toLowerCase()}}}}function Y(){var e=function(e){for(var t=e.length,n=e.length-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return"".concat(t)};return{validate:function(t){var n=Object.assign({},{message:"",trim:!1,utf8Bytes:!1},t.options),r=!0===n.trim||"true"==="".concat(n.trim)?t.value.trim():t.value;if(""===r)return{valid:!0};var a=n.min?"".concat(n.min):"",l=n.max?"".concat(n.max):"",i=n.utf8Bytes?e(r):r.length,o=!0,s=t.l10n?n.message||t.l10n.stringLength.default:n.message;switch((a&&i<parseInt(a,10)||l&&i>parseInt(l,10))&&(o=!1),!0){case!!a&&!!l:s=A(t.l10n?n.message||t.l10n.stringLength.between:n.message,[a,l]);break;case!!a:s=A(t.l10n?n.message||t.l10n.stringLength.more:n.message,"".concat(parseInt(a,10)-1));break;case!!l:s=A(t.l10n?n.message||t.l10n.stringLength.less:n.message,"".concat(parseInt(l,10)+1))}return{message:s,valid:o}}}}function J(){var e={allowEmptyProtocol:!1,allowLocal:!1,protocol:"http, https, ftp"};return{validate:function(t){if(""===t.value)return{valid:!0};var n=Object.assign({},e,t.options),r=!0===n.allowLocal||"true"==="".concat(n.allowLocal),a=!0===n.allowEmptyProtocol||"true"==="".concat(n.allowEmptyProtocol),l=n.protocol.split(",").join("|").replace(/\s/g,""),i;return{valid:new RegExp("^(?:(?:"+l+")://)"+(a?"?":"")+"(?:\\S+(?::\\S*)?@)?(?:"+(r?"":"(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})")+"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-?)*[a-z\\u00a1-\\uffff0-9])*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))"+(r?"?":"")+")(?::\\d{2,5})?(?:/[^\\s]*)?$","i").test(t.value)}}}}function W(){return{validate:function(e){return{valid:""===e.value||/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$/.test(e.value)}}}}function z(){return{validate:function(e){return{valid:""===e.value||/^[a-zA-Z]{6}[a-zA-Z0-9]{2}([a-zA-Z0-9]{3})?$/.test(e.value)}}}}function _(){var e=["hex","rgb","rgba","hsl","hsla","keyword"],t=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],n=function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},r=function(e){return/^hsl\((\s*(-?\d+)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*)\)$/.test(e)},a=function(e){return/^hsla\((\s*(-?\d+)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*,){2}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/.test(e)},l=function(e){return t.indexOf(e)>=0},i=function(e){return/^rgb\((\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*,){2}(\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*)\)$/.test(e)||/^rgb\((\s*(\b(0?\d{1,2}|100)\b%)\s*,){2}(\s*(\b(0?\d{1,2}|100)\b%)\s*)\)$/.test(e)},o=function(e){return/^rgba\((\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*,){3}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/.test(e)||/^rgba\((\s*(\b(0?\d{1,2}|100)\b%)\s*,){3}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/.test(e)};return{validate:function(t){if(""===t.value)return{valid:!0};var s="string"==typeof t.options.type?t.options.type.toString().replace(/s/g,"").split(","):t.options.type||e,c=!0,u=!1,d=void 0;try{for(var f=s[Symbol.iterator](),m;!(c=(m=f.next()).done);c=!0){var g,p=m.value.toLowerCase();if(-1!==e.indexOf(p)){var h=!0;switch(p){case"hex":h=n(t.value);break;case"hsl":h=r(t.value);break;case"hsla":h=a(t.value);break;case"keyword":h=l(t.value);break;case"rgb":h=i(t.value);break;case"rgba":h=o(t.value)}if(h)return{valid:!0}}}}catch(e){u=!0,d=e}finally{try{!c&&null!=f.return&&f.return()}finally{if(u)throw d}}return{valid:!1}}}}function X(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=e.value.toUpperCase();if(!/^[0-9A-Z]{9}$/.test(t))return{valid:!1};for(var n=t.split("").map((function(e){var t=e.charCodeAt(0);return t>=65&&t<=90?t-65+10+"":e})),r=n.length,a=0,l=0;l<r-1;l++){var i=parseInt(n[l],10);l%2!=0&&(i*=2),i>9&&(i-=9),a+=i}return{valid:(a=(10-a%10)%10)===parseInt(n[r-1],10)}}}}function Q(){return{validate:function(e){if(""===e.value)return{valid:!0};if(!/^(\d{8}|\d{12}|\d{13}|\d{14})$/.test(e.value))return{valid:!1};for(var t=e.value.length,n=0,r=8===t?[3,1]:[1,3],a=0;a<t-1;a++)n+=parseInt(e.value.charAt(a),10)*r[a%2];return{valid:"".concat(n=(10-n%10)%10)===e.value.charAt(t-1)}}}}function q(){var e={ANDOVER:["10","12"],ATLANTA:["60","67"],AUSTIN:["50","53"],BROOKHAVEN:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],CINCINNATI:["30","32","35","36","37","38","61"],FRESNO:["15","24"],INTERNET:["20","26","27","45","46","47"],KANSAS_CITY:["40","44"],MEMPHIS:["94","95"],OGDEN:["80","90"],PHILADELPHIA:["33","39","41","42","43","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],SMALL_BUSINESS_ADMINISTRATION:["31"]};return{validate:function(t){if(""===t.value)return{meta:null,valid:!0};if(!/^[0-9]{2}-?[0-9]{7}$/.test(t.value))return{meta:null,valid:!1};var n="".concat(t.value.substr(0,2));for(var r in e)if(-1!==e[r].indexOf(n))return{meta:{campus:r},valid:!0};return{meta:null,valid:!1}}}}function $(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=e.value.toUpperCase();return/^[GRID:]*([0-9A-Z]{2})[-\s]*([0-9A-Z]{5})[-\s]*([0-9A-Z]{10})[-\s]*([0-9A-Z]{1})$/g.test(t)?("GRID:"===(t=t.replace(/\s/g,"").replace(/-/g,"")).substr(0,5)&&(t=t.substr(5)),{valid:r(t)}):{valid:!1}}}}function j(){return{validate:function(e){return{valid:""===e.value||/^[0-9a-fA-F]+$/.test(e.value)}}}}function ee(){var e={AD:"AD[0-9]{2}[0-9]{4}[0-9]{4}[A-Z0-9]{12}",AE:"AE[0-9]{2}[0-9]{3}[0-9]{16}",AL:"AL[0-9]{2}[0-9]{8}[A-Z0-9]{16}",AO:"AO[0-9]{2}[0-9]{21}",AT:"AT[0-9]{2}[0-9]{5}[0-9]{11}",AZ:"AZ[0-9]{2}[A-Z]{4}[A-Z0-9]{20}",BA:"BA[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{8}[0-9]{2}",BE:"BE[0-9]{2}[0-9]{3}[0-9]{7}[0-9]{2}",BF:"BF[0-9]{2}[0-9]{23}",BG:"BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}",BH:"BH[0-9]{2}[A-Z]{4}[A-Z0-9]{14}",BI:"BI[0-9]{2}[0-9]{12}",BJ:"BJ[0-9]{2}[A-Z]{1}[0-9]{23}",BR:"BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z][A-Z0-9]",CH:"CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}",CI:"CI[0-9]{2}[A-Z]{1}[0-9]{23}",CM:"CM[0-9]{2}[0-9]{23}",CR:"CR[0-9]{2}[0-9][0-9]{3}[0-9]{14}",CV:"CV[0-9]{2}[0-9]{21}",CY:"CY[0-9]{2}[0-9]{3}[0-9]{5}[A-Z0-9]{16}",CZ:"CZ[0-9]{2}[0-9]{20}",DE:"DE[0-9]{2}[0-9]{8}[0-9]{10}",DK:"DK[0-9]{2}[0-9]{14}",DO:"DO[0-9]{2}[A-Z0-9]{4}[0-9]{20}",DZ:"DZ[0-9]{2}[0-9]{20}",EE:"EE[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{11}[0-9]{1}",ES:"ES[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{1}[0-9]{1}[0-9]{10}",FI:"FI[0-9]{2}[0-9]{6}[0-9]{7}[0-9]{1}",FO:"FO[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}",FR:"FR[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}",GB:"GB[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}",GE:"GE[0-9]{2}[A-Z]{2}[0-9]{16}",GI:"GI[0-9]{2}[A-Z]{4}[A-Z0-9]{15}",GL:"GL[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}",GR:"GR[0-9]{2}[0-9]{3}[0-9]{4}[A-Z0-9]{16}",GT:"GT[0-9]{2}[A-Z0-9]{4}[A-Z0-9]{20}",HR:"HR[0-9]{2}[0-9]{7}[0-9]{10}",HU:"HU[0-9]{2}[0-9]{3}[0-9]{4}[0-9]{1}[0-9]{15}[0-9]{1}",IE:"IE[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}",IL:"IL[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{13}",IR:"IR[0-9]{2}[0-9]{22}",IS:"IS[0-9]{2}[0-9]{4}[0-9]{2}[0-9]{6}[0-9]{10}",IT:"IT[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}",JO:"JO[0-9]{2}[A-Z]{4}[0-9]{4}[0]{8}[A-Z0-9]{10}",KW:"KW[0-9]{2}[A-Z]{4}[0-9]{22}",KZ:"KZ[0-9]{2}[0-9]{3}[A-Z0-9]{13}",LB:"LB[0-9]{2}[0-9]{4}[A-Z0-9]{20}",LI:"LI[0-9]{2}[0-9]{5}[A-Z0-9]{12}",LT:"LT[0-9]{2}[0-9]{5}[0-9]{11}",LU:"LU[0-9]{2}[0-9]{3}[A-Z0-9]{13}",LV:"LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}",MC:"MC[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}",MD:"MD[0-9]{2}[A-Z0-9]{20}",ME:"ME[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",MG:"MG[0-9]{2}[0-9]{23}",MK:"MK[0-9]{2}[0-9]{3}[A-Z0-9]{10}[0-9]{2}",ML:"ML[0-9]{2}[A-Z]{1}[0-9]{23}",MR:"MR13[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}",MT:"MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}",MU:"MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{3}",MZ:"MZ[0-9]{2}[0-9]{21}",NL:"NL[0-9]{2}[A-Z]{4}[0-9]{10}",NO:"NO[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{1}",PK:"PK[0-9]{2}[A-Z]{4}[A-Z0-9]{16}",PL:"PL[0-9]{2}[0-9]{8}[0-9]{16}",PS:"PS[0-9]{2}[A-Z]{4}[A-Z0-9]{21}",PT:"PT[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{11}[0-9]{2}",QA:"QA[0-9]{2}[A-Z]{4}[A-Z0-9]{21}",RO:"RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}",RS:"RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",SA:"SA[0-9]{2}[0-9]{2}[A-Z0-9]{18}",SE:"SE[0-9]{2}[0-9]{3}[0-9]{16}[0-9]{1}",SI:"SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}",SK:"SK[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{10}",SM:"SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}",SN:"SN[0-9]{2}[A-Z]{1}[0-9]{23}",TL:"TL38[0-9]{3}[0-9]{14}[0-9]{2}",TN:"TN59[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",TR:"TR[0-9]{2}[0-9]{5}[A-Z0-9]{1}[A-Z0-9]{16}",VG:"VG[0-9]{2}[A-Z]{4}[0-9]{16}",XK:"XK[0-9]{2}[0-9]{4}[0-9]{10}[0-9]{2}"},t=["AT","BE","BG","CH","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GI","GR","HR","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","NL","NO","PL","PT","RO","SE","SI","SK","SM"];return{validate:function(n){if(""===n.value)return{valid:!0};var r=Object.assign({},{message:""},n.options),a=n.value.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),l=r.country||a.substr(0,2);if(!e[l])return{message:r.message,valid:!1};if(void 0!==r.sepa){var i=-1!==t.indexOf(l);if(("true"===r.sepa||!0===r.sepa)&&!i||("false"===r.sepa||!1===r.sepa)&&i)return{message:r.message,valid:!1}}var o=A(n.l10n?r.message||n.l10n.iban.country:r.message,n.l10n?n.l10n.iban.countries[l]:l);if(!new RegExp("^".concat(e[l],"$")).test(n.value))return{message:o,valid:!1};a=(a="".concat(a.substr(4)).concat(a.substr(0,4))).split("").map((function(e){var t=e.charCodeAt(0);return t>=65&&t<=90?t-65+10:e})).join("");for(var s=parseInt(a.substr(0,1),10),c=a.length,u=1;u<c;++u)s=(10*s+parseInt(a.substr(u,1),10))%97;return{message:o,valid:1===s}}}}function te(e){var t=e.replace(/\./g,"");return{meta:{},valid:/^\d{7,8}$/.test(t)}}function ne(e,t){if(!/^\d{13}$/.test(e))return!1;var n=parseInt(e.substr(0,2),10),r=parseInt(e.substr(2,2),10),a=parseInt(e.substr(7,2),10),l=parseInt(e.substr(12,1),10);if(n>31||r>12)return!1;for(var i=0,o=0;o<6;o++)i+=(7-o)*(parseInt(e.charAt(o),10)+parseInt(e.charAt(o+6),10));if((10===(i=11-i%11)||11===i)&&(i=0),i!==l)return!1;switch(t.toUpperCase()){case"BA":return 10<=a&&a<=19;case"MK":return 41<=a&&a<=49;case"ME":return 20<=a&&a<=29;case"RS":return 70<=a&&a<=99;case"SI":return 50<=a&&a<=59;default:return!0}}function re(e){return{meta:{},valid:ne(e,"BA")}}function ae(e){if(!/^\d{10}$/.test(e)&&!/^\d{6}\s\d{3}\s\d{1}$/.test(e))return{meta:{},valid:!1};var t=e.replace(/\s/g,""),n=parseInt(t.substr(0,2),10)+1900,r=parseInt(t.substr(2,2),10),a;if(r>40?(n+=100,r-=40):r>20&&(n-=100,r-=20),!F(n,r,parseInt(t.substr(4,2),10)))return{meta:{},valid:!1};for(var l=0,i=[2,4,8,5,10,9,7,3,6],o=0;o<9;o++)l+=parseInt(t.charAt(o),10)*i[o];return{meta:{},valid:"".concat(l=l%11%10)===t.substr(9,1)}}function le(e){var t=e.replace(/\D/g,"");if(!/^\d{11}$/.test(t)||/^1{11}|2{11}|3{11}|4{11}|5{11}|6{11}|7{11}|8{11}|9{11}|0{11}$/.test(t))return{meta:{},valid:!1};var n=0,r;for(r=0;r<9;r++)n+=(10-r)*parseInt(t.charAt(r),10);if((10===(n=11-n%11)||11===n)&&(n=0),"".concat(n)!==t.charAt(9))return{meta:{},valid:!1};var a=0;for(r=0;r<10;r++)a+=(11-r)*parseInt(t.charAt(r),10);return(10===(a=11-a%11)||11===a)&&(a=0),{meta:{},valid:"".concat(a)===t.charAt(10)}}function ie(e){if(!/^756[\.]{0,1}[0-9]{4}[\.]{0,1}[0-9]{4}[\.]{0,1}[0-9]{2}$/.test(e))return{meta:{},valid:!1};for(var t=e.replace(/\D/g,"").substr(3),n=t.length,r=8===n?[3,1]:[1,3],a=0,l=0;l<n-1;l++)a+=parseInt(t.charAt(l),10)*r[l%2];return{meta:{},valid:"".concat(a=10-a%10)===t.charAt(n-1)}}function oe(e){if(!/^\d{7,8}[-]{0,1}[0-9K]$/i.test(e))return{meta:{},valid:!1};for(var t=e.replace(/\-/g,"");t.length<9;)t="0".concat(t);for(var n=[3,2,7,6,5,4,3,2],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];var l="".concat(r=11-r%11);return 11===r?l="0":10===r&&(l="K"),{meta:{},valid:l===t.charAt(8).toUpperCase()}}function se(e){var t=e.trim();if(!/^\d{15}$/.test(t)&&!/^\d{17}[\dXx]{1}$/.test(t))return{meta:{},valid:!1};var n={11:{0:[0],1:[[0,9],[11,17]],2:[0,28,29]},12:{0:[0],1:[[0,16]],2:[0,21,23,25]},13:{0:[0],1:[[0,5],7,8,21,[23,33],[81,85]],2:[[0,5],[7,9],[23,25],27,29,30,81,83],3:[[0,4],[21,24]],4:[[0,4],6,21,[23,35],81],5:[[0,3],[21,35],81,82],6:[[0,4],[21,38],[81,84]],7:[[0,3],5,6,[21,33]],8:[[0,4],[21,28]],9:[[0,3],[21,30],[81,84]],10:[[0,3],[22,26],28,81,82],11:[[0,2],[21,28],81,82]},14:{0:[0],1:[0,1,[5,10],[21,23],81],2:[[0,3],11,12,[21,27]],3:[[0,3],11,21,22],4:[[0,2],11,21,[23,31],81],5:[[0,2],21,22,24,25,81],6:[[0,3],[21,24]],7:[[0,2],[21,29],81],8:[[0,2],[21,30],81,82],9:[[0,2],[21,32],81],10:[[0,2],[21,34],81,82],11:[[0,2],[21,30],81,82],23:[[0,3],22,23,[25,30],32,33]},15:{0:[0],1:[[0,5],[21,25]],2:[[0,7],[21,23]],3:[[0,4]],4:[[0,4],[21,26],[28,30]],5:[[0,2],[21,26],81],6:[[0,2],[21,27]],7:[[0,3],[21,27],[81,85]],8:[[0,2],[21,26]],9:[[0,2],[21,29],81],22:[[0,2],[21,24]],25:[[0,2],[22,31]],26:[[0,2],[24,27],[29,32],34],28:[0,1,[22,27]],29:[0,[21,23]]},21:{0:[0],1:[[0,6],[11,14],[22,24],81],2:[[0,4],[11,13],24,[81,83]],3:[[0,4],11,21,23,81],4:[[0,4],11,[21,23]],5:[[0,5],21,22],6:[[0,4],24,81,82],7:[[0,3],11,26,27,81,82],8:[[0,4],11,81,82],9:[[0,5],11,21,22],10:[[0,5],11,21,81],11:[[0,3],21,22],12:[[0,2],4,21,23,24,81,82],13:[[0,3],21,22,24,81,82],14:[[0,4],21,22,81]},22:{0:[0],1:[[0,6],12,22,[81,83]],2:[[0,4],11,21,[81,84]],3:[[0,3],22,23,81,82],4:[[0,3],21,22],5:[[0,3],21,23,24,81,82],6:[[0,2],4,5,[21,23],25,81],7:[[0,2],[21,24],81],8:[[0,2],21,22,81,82],24:[[0,6],24,26]},23:{0:[0],1:[[0,12],21,[23,29],[81,84]],2:[[0,8],21,[23,25],27,[29,31],81],3:[[0,7],21,81,82],4:[[0,7],21,22],5:[[0,3],5,6,[21,24]],6:[[0,6],[21,24]],7:[[0,16],22,81],8:[[0,5],11,22,26,28,33,81,82],9:[[0,4],21],10:[[0,5],24,25,81,[83,85]],11:[[0,2],21,23,24,81,82],12:[[0,2],[21,26],[81,83]],27:[[0,4],[21,23]]},31:{0:[0],1:[0,1,[3,10],[12,20]],2:[0,30]},32:{0:[0],1:[[0,7],11,[13,18],24,25],2:[[0,6],11,81,82],3:[[0,5],11,12,[21,24],81,82],4:[[0,2],4,5,11,12,81,82],5:[[0,9],[81,85]],6:[[0,2],11,12,21,23,[81,84]],7:[0,1,3,5,6,[21,24]],8:[[0,4],11,26,[29,31]],9:[[0,3],[21,25],28,81,82],10:[[0,3],11,12,23,81,84,88],11:[[0,2],11,12,[81,83]],12:[[0,4],[81,84]],13:[[0,2],11,[21,24]]},33:{0:[0],1:[[0,6],[8,10],22,27,82,83,85],2:[0,1,[3,6],11,12,25,26,[81,83]],3:[[0,4],22,24,[26,29],81,82],4:[[0,2],11,21,24,[81,83]],5:[[0,3],[21,23]],6:[[0,2],21,24,[81,83]],7:[[0,3],23,26,27,[81,84]],8:[[0,3],22,24,25,81],9:[[0,3],21,22],10:[[0,4],[21,24],81,82],11:[[0,2],[21,27],81]},34:{0:[0],1:[[0,4],11,[21,24],81],2:[[0,4],7,8,[21,23],25],3:[[0,4],11,[21,23]],4:[[0,6],21],5:[[0,4],6,[21,23]],6:[[0,4],21],7:[[0,3],11,21],8:[[0,3],11,[22,28],81],10:[[0,4],[21,24]],11:[[0,3],22,[24,26],81,82],12:[[0,4],21,22,25,26,82],13:[[0,2],[21,24]],14:[[0,2],[21,24]],15:[[0,3],[21,25]],16:[[0,2],[21,23]],17:[[0,2],[21,23]],18:[[0,2],[21,25],81]},35:{0:[0],1:[[0,5],11,[21,25],28,81,82],2:[[0,6],[11,13]],3:[[0,5],22],4:[[0,3],21,[23,30],81],5:[[0,5],21,[24,27],[81,83]],6:[[0,3],[22,29],81],7:[[0,2],[21,25],[81,84]],8:[[0,2],[21,25],81],9:[[0,2],[21,26],81,82]},36:{0:[0],1:[[0,5],11,[21,24]],2:[[0,3],22,81],3:[[0,2],13,[21,23]],4:[[0,3],21,[23,30],81,82],5:[[0,2],21],6:[[0,2],22,81],7:[[0,2],[21,35],81,82],8:[[0,3],[21,30],81],9:[[0,2],[21,26],[81,83]],10:[[0,2],[21,30]],11:[[0,2],[21,30],81]},37:{0:[0],1:[[0,5],12,13,[24,26],81],2:[[0,3],5,[11,14],[81,85]],3:[[0,6],[21,23]],4:[[0,6],81],5:[[0,3],[21,23]],6:[[0,2],[11,13],34,[81,87]],7:[[0,5],24,25,[81,86]],8:[[0,2],11,[26,32],[81,83]],9:[[0,3],11,21,23,82,83],10:[[0,2],[81,83]],11:[[0,3],21,22],12:[[0,3]],13:[[0,2],11,12,[21,29]],14:[[0,2],[21,28],81,82],15:[[0,2],[21,26],81],16:[[0,2],[21,26]],17:[[0,2],[21,28]]},41:{0:[0],1:[[0,6],8,22,[81,85]],2:[[0,5],11,[21,25]],3:[[0,7],11,[22,29],81],4:[[0,4],11,[21,23],25,81,82],5:[[0,3],5,6,22,23,26,27,81],6:[[0,3],11,21,22],7:[[0,4],11,21,[24,28],81,82],8:[[0,4],11,[21,23],25,[81,83]],9:[[0,2],22,23,[26,28]],10:[[0,2],[23,25],81,82],11:[[0,4],[21,23]],12:[[0,2],21,22,24,81,82],13:[[0,3],[21,30],81],14:[[0,3],[21,26],81],15:[[0,3],[21,28]],16:[[0,2],[21,28],81],17:[[0,2],[21,29]],90:[0,1]},42:{0:[0],1:[[0,7],[11,17]],2:[[0,5],22,81],3:[[0,3],[21,25],81],5:[[0,6],[25,29],[81,83]],6:[[0,2],6,7,[24,26],[82,84]],7:[[0,4]],8:[[0,2],4,21,22,81],9:[[0,2],[21,23],81,82,84],10:[[0,3],[22,24],81,83,87],11:[[0,2],[21,27],81,82],12:[[0,2],[21,24],81],13:[[0,3],21,81],28:[[0,2],22,23,[25,28]],90:[0,[4,6],21]},43:{0:[0],1:[[0,5],11,12,21,22,24,81],2:[[0,4],11,21,[23,25],81],3:[[0,2],4,21,81,82],4:[0,1,[5,8],12,[21,24],26,81,82],5:[[0,3],11,[21,25],[27,29],81],6:[[0,3],11,21,23,24,26,81,82],7:[[0,3],[21,26],81],8:[[0,2],11,21,22],9:[[0,3],[21,23],81],10:[[0,3],[21,28],81],11:[[0,3],[21,29]],12:[[0,2],[21,30],81],13:[[0,2],21,22,81,82],31:[0,1,[22,27],30]},44:{0:[0],1:[[0,7],[11,16],83,84],2:[[0,5],21,22,24,29,32,33,81,82],3:[0,1,[3,8]],4:[[0,4]],5:[0,1,[6,15],23,82,83],6:[0,1,[4,8]],7:[0,1,[3,5],81,[83,85]],8:[[0,4],11,23,25,[81,83]],9:[[0,3],23,[81,83]],12:[[0,3],[23,26],83,84],13:[[0,3],[22,24],81],14:[[0,2],[21,24],26,27,81],15:[[0,2],21,23,81],16:[[0,2],[21,25]],17:[[0,2],21,23,81],18:[[0,3],21,23,[25,27],81,82],19:[0],20:[0],51:[[0,3],21,22],52:[[0,3],21,22,24,81],53:[[0,2],[21,23],81]},45:{0:[0],1:[[0,9],[21,27]],2:[[0,5],[21,26]],3:[[0,5],11,12,[21,32]],4:[0,1,[3,6],11,[21,23],81],5:[[0,3],12,21],6:[[0,3],21,81],7:[[0,3],21,22],8:[[0,4],21,81],9:[[0,3],[21,24],81],10:[[0,2],[21,31]],11:[[0,2],[21,23]],12:[[0,2],[21,29],81],13:[[0,2],[21,24],81],14:[[0,2],[21,25],81]},46:{0:[0],1:[0,1,[5,8]],2:[0,1],3:[0,[21,23]],90:[[0,3],[5,7],[21,39]]},50:{0:[0],1:[[0,19]],2:[0,[22,38],[40,43]],3:[0,[81,84]]},51:{0:[0],1:[0,1,[4,8],[12,15],[21,24],29,31,32,[81,84]],3:[[0,4],11,21,22],4:[[0,3],11,21,22],5:[[0,4],21,22,24,25],6:[0,1,3,23,26,[81,83]],7:[0,1,3,4,[22,27],81],8:[[0,2],11,12,[21,24]],9:[[0,4],[21,23]],10:[[0,2],11,24,25,28],11:[[0,2],[11,13],23,24,26,29,32,33,81],13:[[0,4],[21,25],81],14:[[0,2],[21,25]],15:[[0,3],[21,29]],16:[[0,3],[21,23],81],17:[[0,3],[21,25],81],18:[[0,3],[21,27]],19:[[0,3],[21,23]],20:[[0,2],21,22,81],32:[0,[21,33]],33:[0,[21,38]],34:[0,1,[22,37]]},52:{0:[0],1:[[0,3],[11,15],[21,23],81],2:[0,1,3,21,22],3:[[0,3],[21,30],81,82],4:[[0,2],[21,25]],5:[[0,2],[21,27]],6:[[0,3],[21,28]],22:[0,1,[22,30]],23:[0,1,[22,28]],24:[0,1,[22,28]],26:[0,1,[22,36]],27:[[0,2],22,23,[25,32]]},53:{0:[0],1:[[0,3],[11,14],21,22,[24,29],81],3:[[0,2],[21,26],28,81],4:[[0,2],[21,28]],5:[[0,2],[21,24]],6:[[0,2],[21,30]],7:[[0,2],[21,24]],8:[[0,2],[21,29]],9:[[0,2],[21,27]],23:[0,1,[22,29],31],25:[[0,4],[22,32]],26:[0,1,[21,28]],27:[0,1,[22,30]],28:[0,1,22,23],29:[0,1,[22,32]],31:[0,2,3,[22,24]],34:[0,[21,23]],33:[0,21,[23,25]],35:[0,[21,28]]},54:{0:[0],1:[[0,2],[21,27]],21:[0,[21,29],32,33],22:[0,[21,29],[31,33]],23:[0,1,[22,38]],24:[0,[21,31]],25:[0,[21,27]],26:[0,[21,27]]},61:{0:[0],1:[[0,4],[11,16],22,[24,26]],2:[[0,4],22],3:[[0,4],[21,24],[26,31]],4:[[0,4],[22,31],81],5:[[0,2],[21,28],81,82],6:[[0,2],[21,32]],7:[[0,2],[21,30]],8:[[0,2],[21,31]],9:[[0,2],[21,29]],10:[[0,2],[21,26]]},62:{0:[0],1:[[0,5],11,[21,23]],2:[0,1],3:[[0,2],21],4:[[0,3],[21,23]],5:[[0,3],[21,25]],6:[[0,2],[21,23]],7:[[0,2],[21,25]],8:[[0,2],[21,26]],9:[[0,2],[21,24],81,82],10:[[0,2],[21,27]],11:[[0,2],[21,26]],12:[[0,2],[21,28]],24:[0,21,[24,29]],26:[0,21,[23,30]],29:[0,1,[21,27]],30:[0,1,[21,27]]},63:{0:[0],1:[[0,5],[21,23]],2:[0,2,[21,25]],21:[0,[21,23],[26,28]],22:[0,[21,24]],23:[0,[21,24]],25:[0,[21,25]],26:[0,[21,26]],27:[0,1,[21,26]],28:[[0,2],[21,23]]},64:{0:[0],1:[0,1,[4,6],21,22,81],2:[[0,3],5,[21,23]],3:[[0,3],[21,24],81],4:[[0,2],[21,25]],5:[[0,2],21,22]},65:{0:[0],1:[[0,9],21],2:[[0,5]],21:[0,1,22,23],22:[0,1,22,23],23:[[0,3],[23,25],27,28],28:[0,1,[22,29]],29:[0,1,[22,29]],30:[0,1,[22,24]],31:[0,1,[21,31]],32:[0,1,[21,27]],40:[0,2,3,[21,28]],42:[[0,2],21,[23,26]],43:[0,1,[21,26]],90:[[0,4]],27:[[0,2],22,23]},71:{0:[0]},81:{0:[0]},82:{0:[0]}},r=parseInt(t.substr(0,2),10),a=parseInt(t.substr(2,2),10),l=parseInt(t.substr(4,2),10);if(!n[r]||!n[r][a])return{meta:{},valid:!1};var i=!1,o=n[r][a],s,c,u,d,f;for(s=0;s<o.length;s++)if(Array.isArray(o[s])&&o[s][0]<=l&&l<=o[s][1]||!Array.isArray(o[s])&&l===o[s]){i=!0;break}if(!i)return{meta:{},valid:!1};if(c=18===t.length?t.substr(6,8):"19".concat(t.substr(6,6)),!F(parseInt(c.substr(0,4),10),parseInt(c.substr(4,2),10),parseInt(c.substr(6,2),10)))return{meta:{},valid:!1};if(18===t.length){var m=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],g=0,p;for(s=0;s<17;s++)g+=parseInt(t.charAt(s),10)*m[s];return g=(12-g%11)%11,{meta:{},valid:("X"!==t.charAt(17).toUpperCase()?parseInt(t.charAt(17),10):10)===g}}return{meta:{},valid:!0}}function ce(e){var t=e.replace(/\./g,"").replace("-","");if(!/^\d{8,16}$/.test(t))return{meta:{},valid:!1};for(var n=t.length,r=[3,7,13,17,19,23,29,37,41,43,47,53,59,67,71],a=0,l=n-2;l>=0;l--)a+=parseInt(t.charAt(l),10)*r[l];return(a%=11)>=2&&(a=11-a),{meta:{},valid:"".concat(a)===t.substr(n-1)}}function ue(e){if(!/^\d{9,10}$/.test(e))return{meta:{},valid:!1};var t=1900+parseInt(e.substr(0,2),10),n=parseInt(e.substr(2,2),10)%50%20,r=parseInt(e.substr(4,2),10);if(9===e.length){if(t>=1980&&(t-=100),t>1953)return{meta:{},valid:!1}}else t<1954&&(t+=100);if(!F(t,n,r))return{meta:{},valid:!1};if(10===e.length){var a=parseInt(e.substr(0,9),10)%11;return t<1985&&(a%=10),{meta:{},valid:"".concat(a)===e.substr(9,1)}}return{meta:{},valid:!0}}function de(e){if(!/^[0-9]{6}[-]{0,1}[0-9]{4}$/.test(e))return{meta:{},valid:!1};var t=e.replace(/-/g,""),n=parseInt(t.substr(0,2),10),r=parseInt(t.substr(2,2),10),a=parseInt(t.substr(4,2),10);switch(!0){case-1!=="5678".indexOf(t.charAt(6))&&a>=58:a+=1800;break;case-1!=="0123".indexOf(t.charAt(6)):case-1!=="49".indexOf(t.charAt(6))&&a>=37:a+=1900;break;default:a+=2e3}return{meta:{},valid:F(a,r,n)}}function fe(e){var t=/^[0-9]{8}[-]{0,1}[A-HJ-NP-TV-Z]$/.test(e),n=/^[XYZ][-]{0,1}[0-9]{7}[-]{0,1}[A-HJ-NP-TV-Z]$/.test(e),r=/^[A-HNPQS][-]{0,1}[0-9]{7}[-]{0,1}[0-9A-J]$/.test(e);if(!t&&!n&&!r)return{meta:{},valid:!1};var a=e.replace(/-/g,""),l,i,o=!0;if(t||n){i="DNI";var s="XYZ".indexOf(a.charAt(0));return-1!==s&&(a=s+a.substr(1)+"",i="NIE"),{meta:{type:i},valid:(l="TRWAGMYFPDXBNJZSQVHLCKE"[(l=parseInt(a.substr(0,8),10))%23])===a.substr(8,1)}}l=a.substr(1,7),i="CIF";for(var c=a[0],u=a.substr(-1),d=0,f=0;f<l.length;f++)if(f%2!=0)d+=parseInt(l[f],10);else{var m=""+2*parseInt(l[f],10);d+=parseInt(m[0],10),2===m.length&&(d+=parseInt(m[1],10))}var g=d-10*Math.floor(d/10);return 0!==g&&(g=10-g),{meta:{type:i},valid:o=-1!=="KQS".indexOf(c)?u==="JABCDEFGHI"[g]:-1!=="ABEH".indexOf(c)?u===""+g:u===""+g||u==="JABCDEFGHI"[g]}}function me(e){if(!/^[0-9]{6}[-+A][0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/.test(e))return{meta:{},valid:!1};var t=parseInt(e.substr(0,2),10),n=parseInt(e.substr(2,2),10),r=parseInt(e.substr(4,2),10),a,l;if(!F(r={"+":1800,"-":1900,A:2e3}[e.charAt(6)]+r,n,t))return{meta:{},valid:!1};if(parseInt(e.substr(7,3),10)<2)return{meta:{},valid:!1};var i=parseInt(e.substr(0,6)+e.substr(7,3)+"",10);return{meta:{},valid:"0123456789ABCDEFHJKLMNPRSTUVWXY".charAt(i%31)===e.charAt(10)}}function ge(e){var t=e.toUpperCase();if(!/^(1|2)\d{2}\d{2}(\d{2}|\d[A-Z]|\d{3})\d{2,3}\d{3}\d{2}$/.test(t))return{meta:{},valid:!1};var n=t.substr(5,2);switch(!0){case/^\d{2}$/.test(n):t=e;break;case"2A"===n:t="".concat(e.substr(0,5),"19").concat(e.substr(7));break;case"2B"===n:t="".concat(e.substr(0,5),"18").concat(e.substr(7));break;default:return{meta:{},valid:!1}}var r=97-parseInt(t.substr(0,13),10)%97,a;return{meta:{},valid:(r<10?"0".concat(r):"".concat(r))===t.substr(13)}}function pe(e){var t=e.toUpperCase();if(!/^[A-MP-Z]{1,2}[0-9]{6}[0-9A]$/.test(t))return{meta:{},valid:!1};var n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r=t.charAt(0),a=t.charAt(1),l=0,i=t;/^[A-Z]$/.test(a)?(l+=9*(10+n.indexOf(r)),l+=8*(10+n.indexOf(a)),i=t.substr(2)):(l+=324,l+=8*(10+n.indexOf(r)),i=t.substr(1));for(var o=i.length,s=0;s<o-1;s++)l+=(7-s)*parseInt(i.charAt(s),10);var c=l%11,u;return{meta:{},valid:(0===c?"0":11-c==10?"A":"".concat(11-c))===i.charAt(o-1)}}function he(e){return{meta:{},valid:/^[0-9]{11}$/.test(e)&&n(e)}}function ve(e){return/^[2-9]\d{11}$/.test(e)?{meta:{},valid:a(e.split("").map((function(e){return parseInt(e,10)})))}:{meta:{},valid:!1};var t}function Ae(e){if(!/^\d{7}[A-W][AHWTX]?$/.test(e))return{meta:{},valid:!1};var t=function(e){for(var t=e;t.length<7;)t="0".concat(t);for(var n="WABCDEFGHIJKLMNOPQRSTUV",r=0,a=0;a<7;a++)r+=parseInt(t.charAt(a),10)*(8-a);return r+=9*n.indexOf(t.substr(7)),n[r%23]},n;return{meta:{},valid:9!==e.length||"A"!==e.charAt(8)&&"H"!==e.charAt(8)?e.charAt(7)===t(e.substr(0,7)):e.charAt(7)===t(e.substr(0,7)+e.substr(8)+"")}}function be(e){return/^\d{1,9}$/.test(e)?{meta:{},valid:t(e)}:{meta:{},valid:!1}}function Ee(e){if(!/^[0-9]{6}[-]{0,1}[0-9]{4}$/.test(e))return{meta:{},valid:!1};var t=e.replace(/-/g,""),n=parseInt(t.substr(0,2),10),r=parseInt(t.substr(2,2),10),a=parseInt(t.substr(4,2),10),l=parseInt(t.charAt(9),10);if(!F(a=9===l?1900+a:100*(20+l)+a,r,n,!0))return{meta:{},valid:!1};for(var i=[3,2,7,6,5,4,3,2],o=0,s=0;s<8;s++)o+=parseInt(t.charAt(s),10)*i[s];return{meta:{},valid:"".concat(o=11-o%11)===t.charAt(8)}}function Ce(e){var t=e.replace("-","");if(!/^\d{13}$/.test(t))return{meta:{},valid:!1};var n=t.charAt(6),r=parseInt(t.substr(0,2),10),a=parseInt(t.substr(2,2),10),l=parseInt(t.substr(4,2),10),u;switch(n){case"1":case"2":case"5":case"6":r+=1900;break;case"3":case"4":case"7":case"8":r+=2e3;break;default:r+=1800}if(!F(r,a,l))return{meta:{},valid:!1};for(var i=[2,3,4,5,6,7,8,9,2,3,4,5],o=t.length,s=0,c=0;c<o-1;c++)s+=i[c]*parseInt(t.charAt(c),10);return{meta:{},valid:"".concat((11-s%11)%10)===t.charAt(o-1)}}function Ve(e){if(!/^[0-9]{11}$/.test(e))return{meta:{},valid:!1};var t=parseInt(e.charAt(0),10),n=parseInt(e.substr(1,2),10),r,a,l;if(!F(n=100*(t%2==0?17+t/2:17+(t+1)/2)+n,parseInt(e.substr(3,2),10),parseInt(e.substr(5,2),10),!0))return{meta:{},valid:!1};var i=[1,2,3,4,5,6,7,8,9,1],o=0,s;for(s=0;s<10;s++)o+=parseInt(e.charAt(s),10)*i[s];if(10!==(o%=11))return{meta:{},valid:"".concat(o)===e.charAt(10)};for(o=0,i=[3,4,5,6,7,8,9,1,2,3],s=0;s<10;s++)o+=parseInt(e.charAt(s),10)*i[s];return 10===(o%=11)&&(o=0),{meta:{},valid:"".concat(o)===e.charAt(10)}}function Se(e){if(!/^[0-9]{6}[-]{0,1}[0-9]{5}$/.test(e))return{meta:{},valid:!1};var t=e.replace(/\D/g,""),n=parseInt(t.substr(0,2),10),r=parseInt(t.substr(2,2),10),a=parseInt(t.substr(4,2),10);if(!F(a=a+1800+100*parseInt(t.charAt(6),10),r,n,!0))return{meta:{},valid:!1};for(var l=0,i=[10,5,8,4,2,1,6,3,7,9],o=0;o<10;o++)l+=parseInt(t.charAt(o),10)*i[o];return{meta:{},valid:"".concat(l=(l+1)%11%10)===t.charAt(10)}}function He(e){return{meta:{},valid:ne(e,"ME")}}function ye(e){return{meta:{},valid:ne(e,"MK")}}function Fe(e){var t=e.toUpperCase();if(!/^[A-Z]{4}\d{6}[A-Z]{6}[0-9A-Z]\d$/.test(t))return{meta:{},valid:!1};var n=["BACA","BAKA","BUEI","BUEY","CACA","CACO","CAGA","CAGO","CAKA","CAKO","COGE","COGI","COJA","COJE","COJI","COJO","COLA","CULO","FALO","FETO","GETA","GUEI","GUEY","JETA","JOTO","KACA","KACO","KAGA","KAGO","KAKA","KAKO","KOGE","KOGI","KOJA","KOJE","KOJI","KOJO","KOLA","KULO","LILO","LOCA","LOCO","LOKA","LOKO","MAME","MAMO","MEAR","MEAS","MEON","MIAR","MION","MOCO","MOKO","MULA","MULO","NACA","NACO","PEDA","PEDO","PENE","PIPI","PITO","POPO","PUTA","PUTO","QULO","RATA","ROBA","ROBE","ROBO","RUIN","SENO","TETA","VACA","VAGA","VAGO","VAKA","VUEI","VUEY","WUEI","WUEY"],r=t.substr(0,4);if(n.indexOf(r)>=0)return{meta:{},valid:!1};var a=parseInt(t.substr(4,2),10),l=parseInt(t.substr(6,2),10),i=parseInt(t.substr(6,2),10);if(/^[0-9]$/.test(t.charAt(16))?a+=1900:a+=2e3,!F(a,l,i))return{meta:{},valid:!1};var o=t.charAt(10);if("H"!==o&&"M"!==o)return{meta:{},valid:!1};var s=t.substr(11,2),c;if(-1===["AS","BC","BS","CC","CH","CL","CM","CS","DF","DG","GR","GT","HG","JC","MC","MN","MS","NE","NL","NT","OC","PL","QR","QT","SL","SP","SR","TC","TL","TS","VZ","YN","ZS"].indexOf(s))return{meta:{},valid:!1};for(var u="0123456789ABCDEFGHIJKLMN&OPQRSTUVWXYZ",d=0,f=t.length,m=0;m<f-1;m++)d+=(18-m)*u.indexOf(t.charAt(m));return{meta:{},valid:"".concat(d=(10-d%10)%10)===t.charAt(f-1)}}function Ie(e){if(!/^\d{12}$/.test(e))return{meta:{},valid:!1};var t=parseInt(e.substr(0,2),10),n=parseInt(e.substr(2,2),10),r=parseInt(e.substr(4,2),10);if(!F(t+1900,n,r)&&!F(t+2e3,n,r))return{meta:{},valid:!1};var a=e.substr(6,2),l;return{meta:{},valid:-1===["17","18","19","20","69","70","73","80","81","94","95","96","97"].indexOf(a)}}function Oe(e){if(e.length<8)return{meta:{},valid:!1};var t=e;if(8===t.length&&(t="0".concat(t)),!/^[0-9]{4}[.]{0,1}[0-9]{2}[.]{0,1}[0-9]{3}$/.test(t))return{meta:{},valid:!1};if(t=t.replace(/\./g,""),0===parseInt(t,10))return{meta:{},valid:!1};for(var n=0,r=t.length,a=0;a<r-1;a++)n+=(9-a)*parseInt(t.charAt(a),10);return 10===(n%=11)&&(n=0),{meta:{},valid:"".concat(n)===t.charAt(r-1)}}function we(e){if(!/^\d{11}$/.test(e))return{meta:{},valid:!1};var t=function(e){for(var t=[3,7,6,1,8,9,4,5,2],n=0,r=0;r<9;r++)n+=t[r]*parseInt(e.charAt(r),10);return 11-n%11},n=function(e){for(var t=[5,4,3,2,7,6,5,4,3,2],n=0,r=0;r<10;r++)n+=t[r]*parseInt(e.charAt(r),10);return 11-n%11};return{meta:{},valid:"".concat(t(e))===e.substr(-2,1)&&"".concat(n(e))===e.substr(-1)}}function Le(e){if(!/^\d{8}[0-9A-Z]*$/.test(e))return{meta:{},valid:!1};if(8===e.length)return{meta:{},valid:!0};for(var t=[3,2,7,6,5,4,3,2],n=0,r=0;r<8;r++)n+=t[r]*parseInt(e.charAt(r),10);var a=n%11,l=[6,5,4,3,2,1,1,0,9,8,7][a],i="KJIHGFEDCBA".charAt(a);return{meta:{},valid:e.charAt(8)==="".concat(l)||e.charAt(8)===i}}function Ne(e){if(!/^[0-9]{11}$/.test(e))return{meta:{},valid:!1};for(var t=0,n=e.length,r=[1,3,7,9,1,3,7,9,1,3,7],a=0;a<n-1;a++)t+=r[a]*parseInt(e.charAt(a),10);return 0===(t%=10)&&(t=10),{meta:{},valid:"".concat(t=10-t)===e.charAt(n-1)}}function xe(e){if(!/^[0-9]{13}$/.test(e))return{meta:{},valid:!1};var t=parseInt(e.charAt(0),10);if(0===t||7===t||8===t)return{meta:{},valid:!1};var n=parseInt(e.substr(1,2),10),r=parseInt(e.substr(3,2),10),a=parseInt(e.substr(5,2),10),l;if(a>31&&r>12)return{meta:{},valid:!1};if(9!==t&&!F(n={1:1900,2:1900,3:1800,4:1800,5:2e3,6:2e3}[t+""]+n,r,a))return{meta:{},valid:!1};for(var i=0,o=[2,7,9,1,4,6,3,5,8,2,7,9],s=e.length,c=0;c<s-1;c++)i+=parseInt(e.charAt(c),10)*o[c];return 10===(i%=11)&&(i=1),{meta:{},valid:"".concat(i)===e.charAt(s-1)}}function Me(e){return{meta:{},valid:ne(e,"RS")}}function Te(e){if(!/^[0-9]{10}$/.test(e)&&!/^[0-9]{6}[-|+][0-9]{4}$/.test(e))return{meta:{},valid:!1};var n=e.replace(/[^0-9]/g,""),r,a,l;return F(parseInt(n.substr(0,2),10)+1900,parseInt(n.substr(2,2),10),parseInt(n.substr(4,2),10))?{meta:{},valid:t(n)}:{meta:{},valid:!1}}function ke(e){return{meta:{},valid:ne(e,"SI")}}function Re(e){return{meta:{},valid:/^\d{5}$/.test(e)}}function Be(e){if(13!==e.length)return{meta:{},valid:!1};for(var t=0,n=0;n<12;n++)t+=parseInt(e.charAt(n),10)*(13-n);return{meta:{},valid:(11-t%11)%10===parseInt(e.charAt(12),10)}}function Ze(e){if(11!==e.length)return{meta:{},valid:!1};for(var t=0,n=0;n<10;n++)t+=parseInt(e.charAt(n),10);return{meta:{},valid:t%10===parseInt(e.charAt(10),10)}}function Ge(e){var t=e.toUpperCase();if(!/^[A-Z][12][0-9]{8}$/.test(t))return{meta:{},valid:!1};for(var n=t.length,r,a="ABCDEFGHJKLMNPQRSTUVXYWZIO".indexOf(t.charAt(0))+10,l=Math.floor(a/10)+a%10*(n-1),i=0,o=1;o<n-1;o++)i+=parseInt(t.charAt(o),10)*(n-1-o);return{meta:{},valid:(l+i+parseInt(t.charAt(n-1),10))%10==0}}function Pe(e){if(!/^\d{8}$/.test(e))return{meta:{},valid:!1};for(var t=[2,9,8,7,6,3,4],n=0,r=0;r<7;r++)n+=parseInt(e.charAt(r),10)*t[r];return(n%=10)>0&&(n=10-n),{meta:{},valid:"".concat(n)===e.charAt(7)}}function De(e){if(!/^[0-9]{10}[0|1][8|9][0-9]$/.test(e))return{meta:{},valid:!1};var n=parseInt(e.substr(0,2),10),r,a,l;return F(n=n>=new Date.getFullYear%100?n+1900:n+2e3,parseInt(e.substr(2,2),10),parseInt(e.substr(4,2),10))?{meta:{},valid:t(e)}:{meta:{},valid:!1}}function Ke(){var e=["AR","BA","BG","BR","CH","CL","CN","CO","CZ","DK","EE","ES","FI","FR","HK","HR","ID","IE","IL","IS","KR","LT","LV","ME","MK","MX","MY","NL","NO","PE","PL","RO","RS","SE","SI","SK","SM","TH","TR","TW","UY","ZA"];return{validate:function(t){if(""===t.value)return{valid:!0};var n=Object.assign({},{message:""},t.options),r=t.value.substr(0,2);if(r="function"==typeof n.country?n.country.call(this):n.country,-1===e.indexOf(r))return{valid:!0};var a={meta:{},valid:!0};switch(r.toLowerCase()){case"ar":a=te(t.value);break;case"ba":a=re(t.value);break;case"bg":a=ae(t.value);break;case"br":a=le(t.value);break;case"ch":a=ie(t.value);break;case"cl":a=oe(t.value);break;case"cn":a=se(t.value);break;case"co":a=ce(t.value);break;case"cz":a=ue(t.value);break;case"dk":a=de(t.value);break;case"ee":a=Ve(t.value);break;case"es":a=fe(t.value);break;case"fi":a=me(t.value);break;case"fr":a=ge(t.value);break;case"hk":a=pe(t.value);break;case"hr":a=he(t.value);break;case"id":a=ve(t.value);break;case"ie":a=Ae(t.value);break;case"il":a=be(t.value);break;case"is":a=Ee(t.value);break;case"kr":a=Ce(t.value);break;case"lt":a=Ve(t.value);break;case"lv":a=Se(t.value);break;case"me":a=He(t.value);break;case"mk":a=ye(t.value);break;case"mx":a=Fe(t.value);break;case"my":a=Ie(t.value);break;case"nl":a=Oe(t.value);break;case"no":a=we(t.value);break;case"pe":a=Le(t.value);break;case"pl":a=Ne(t.value);break;case"ro":a=xe(t.value);break;case"rs":a=Me(t.value);break;case"se":a=Te(t.value);break;case"si":a=ke(t.value);break;case"sk":a=ue(t.value);break;case"sm":a=Re(t.value);break;case"th":a=Be(t.value);break;case"tr":a=Ze(t.value);break;case"tw":a=Ge(t.value);break;case"uy":a=Pe(t.value);break;case"za":a=De(t.value)}var l=A(t.l10n?n.message||t.l10n.id.country:n.message,t.l10n?t.l10n.id.countries[r.toUpperCase()]:r.toUpperCase());return Object.assign({},{message:l},a)}}}function Ue(){return{validate:function(e){if(""===e.value)return{valid:!0};switch(!0){case/^\d{15}$/.test(e.value):case/^\d{2}-\d{6}-\d{6}-\d{1}$/.test(e.value):case/^\d{2}\s\d{6}\s\d{6}\s\d{1}$/.test(e.value):var n;return{valid:t(e.value.replace(/[^0-9]/g,""))};case/^\d{14}$/.test(e.value):case/^\d{16}$/.test(e.value):case/^\d{2}-\d{6}-\d{6}(|-\d{2})$/.test(e.value):case/^\d{2}\s\d{6}\s\d{6}(|\s\d{2})$/.test(e.value):return{valid:!0};default:return{valid:!1}}}}}function Ye(){return{validate:function(e){if(""===e.value)return{valid:!0};if(!/^IMO \d{7}$/i.test(e.value))return{valid:!1};for(var t=e.value.replace(/^.*(\d{7})$/,"$1"),n=0,r=6;r>=1;r--)n+=parseInt(t.slice(6-r,-r),10)*(r+1);return{valid:n%10===parseInt(t.charAt(6),10)}}}}function Je(){return{validate:function(e){if(""===e.value)return{meta:{type:null},valid:!0};var t;switch(!0){case/^\d{9}[\dX]$/.test(e.value):case 13===e.value.length&&/^(\d+)-(\d+)-(\d+)-([\dX])$/.test(e.value):case 13===e.value.length&&/^(\d+)\s(\d+)\s(\d+)\s([\dX])$/.test(e.value):t="ISBN10";break;case/^(978|979)\d{9}[\dX]$/.test(e.value):case 17===e.value.length&&/^(978|979)-(\d+)-(\d+)-(\d+)-([\dX])$/.test(e.value):case 17===e.value.length&&/^(978|979)\s(\d+)\s(\d+)\s(\d+)\s([\dX])$/.test(e.value):t="ISBN13";break;default:return{meta:{type:null},valid:!1}}var n=e.value.replace(/[^0-9X]/gi,"").split(""),r=n.length,a=0,l,i;switch(t){case"ISBN10":for(a=0,l=0;l<r-1;l++)a+=parseInt(n[l],10)*(10-l);return 11===(i=11-a%11)?i=0:10===i&&(i="X"),{meta:{type:t},valid:"".concat(i)===n[r-1]};case"ISBN13":for(a=0,l=0;l<r-1;l++)a+=l%2==0?parseInt(n[l],10):3*parseInt(n[l],10);return 10===(i=10-a%10)&&(i="0"),{meta:{type:t},valid:"".concat(i)===n[r-1]}}}}}function We(){var e="AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|CL|CN|CX|CC|CO|KM|CG|CD|CK|CR|CI|HR|CU|CW|CY|CZ|DK|DJ|DM|DO|EC|EG|SV|GQ|ER|EE|ET|FK|FO|FJ|FI|FR|GF|PF|TF|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GU|GT|GG|GN|GW|GY|HT|HM|VA|HN|HK|HU|IS|IN|ID|IR|IQ|IE|IM|IL|IT|JM|JP|JE|JO|KZ|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|SS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW";return{validate:function(t){if(""===t.value)return{valid:!0};var n=t.value.toUpperCase(),r;if(!new RegExp("^("+e+")[0-9A-Z]{10}$").test(t.value))return{valid:!1};var a=n.length,l="",i;for(i=0;i<a-1;i++){var o=n.charCodeAt(i);l+=o>57?(o-55).toString():n.charAt(i)}var s="",c=l.length,u=c%2!=0?0:1;for(i=0;i<c;i++)s+=parseInt(l[i],10)*(i%2===u?2:1)+"";var d=0;for(i=0;i<s.length;i++)d+=parseInt(s.charAt(i),10);return{valid:"".concat(d=(10-d%10)%10)===n.charAt(a-1)}}}}function ze(){return{validate:function(e){if(""===e.value)return{meta:null,valid:!0};var t;switch(!0){case/^M\d{9}$/.test(e.value):case/^M-\d{4}-\d{4}-\d{1}$/.test(e.value):case/^M\s\d{4}\s\d{4}\s\d{1}$/.test(e.value):t="ISMN10";break;case/^9790\d{9}$/.test(e.value):case/^979-0-\d{4}-\d{4}-\d{1}$/.test(e.value):case/^979\s0\s\d{4}\s\d{4}\s\d{1}$/.test(e.value):t="ISMN13";break;default:return{meta:null,valid:!1}}var n=e.value;"ISMN10"===t&&(n="9790".concat(n.substr(1)));for(var r=0,a=(n=n.replace(/[^0-9]/gi,"")).length,l=[1,3],i=0;i<a-1;i++)r+=parseInt(n.charAt(i),10)*l[i%2];return{meta:{type:t},valid:"".concat(r=(10-r%10)%10)===n.charAt(a-1)}}}}function _e(){return{validate:function(e){if(""===e.value)return{valid:!0};if(!/^\d{4}\-\d{3}[\dX]$/.test(e.value))return{valid:!1};var t=e.value.replace(/[^0-9X]/gi,"").split(""),n=t.length,r=0;"X"===t[7]&&(t[7]="10");for(var a=0;a<n;a++)r+=parseInt(t[a],10)*(8-a);return{valid:r%11==0}}}}function Xe(){return{validate:function(e){return{valid:""===e.value||/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/.test(e.value)||/^([0-9A-Fa-f]{4}\.){2}([0-9A-Fa-f]{4})$/.test(e.value)}}}}function Qe(){return{validate:function(e){if(""===e.value)return{valid:!0};var n=e.value;switch(!0){case/^[0-9A-F]{15}$/i.test(n):case/^[0-9A-F]{2}[- ][0-9A-F]{6}[- ][0-9A-F]{6}[- ][0-9A-F]$/i.test(n):case/^\d{19}$/.test(n):case/^\d{5}[- ]\d{5}[- ]\d{4}[- ]\d{4}[- ]\d$/.test(n):var i=n.charAt(n.length-1).toUpperCase();if((n=n.replace(/[- ]/g,"")).match(/^\d*$/i))return{valid:t(n)};n=n.slice(0,-1);var l="",a;for(a=1;a<=13;a+=2)l+=(2*parseInt(n.charAt(a),16)).toString(16);var r=0;for(a=0;a<l.length;a++)r+=parseInt(l.charAt(a),16);return{valid:r%10==0?"0"===i:i===(2*(10*Math.floor((r+10)/10)-r)).toString(16).toUpperCase()};case/^[0-9A-F]{14}$/i.test(n):case/^[0-9A-F]{2}[- ][0-9A-F]{6}[- ][0-9A-F]{6}$/i.test(n):case/^\d{18}$/.test(n):case/^\d{5}[- ]\d{5}[- ]\d{4}[- ]\d{4}$/.test(n):return{valid:!0};default:return{valid:!1}}}}}function qe(){var e=["AE","BG","BR","CN","CZ","DE","DK","ES","FR","GB","IN","MA","NL","PK","RO","RU","SK","TH","US","VE"];return{validate:function(t){if(""===t.value)return{valid:!0};var n=Object.assign({},{message:""},t.options),r=t.value.trim(),a=r.substr(0,2);if(!(a="function"==typeof n.country?n.country.call(this):n.country)||-1===e.indexOf(a.toUpperCase()))return{valid:!0};var l=!0;switch(a.toUpperCase()){case"AE":l=/^(((\+|00)?971[\s\.-]?(\(0\)[\s\.-]?)?|0)(\(5(0|2|5|6)\)|5(0|2|5|6)|2|3|4|6|7|9)|60)([\s\.-]?[0-9]){7}$/.test(r);break;case"BG":l=/^(0|359|00)(((700|900)[0-9]{5}|((800)[0-9]{5}|(800)[0-9]{4}))|(87|88|89)([0-9]{7})|((2[0-9]{7})|(([3-9][0-9])(([0-9]{6})|([0-9]{5})))))$/.test(r.replace(/\+|\s|-|\/|\(|\)/gi,""));break;case"BR":l=/^(([\d]{4}[-.\s]{1}[\d]{2,3}[-.\s]{1}[\d]{2}[-.\s]{1}[\d]{2})|([\d]{4}[-.\s]{1}[\d]{3}[-.\s]{1}[\d]{4})|((\(?\+?[0-9]{2}\)?\s?)?(\(?\d{2}\)?\s?)?\d{4,5}[-.\s]?\d{4}))$/.test(r);break;case"CN":l=/^((00|\+)?(86(?:-| )))?((\d{11})|(\d{3}[- ]{1}\d{4}[- ]{1}\d{4})|((\d{2,4}[- ]){1}(\d{7,8}|(\d{3,4}[- ]{1}\d{4}))([- ]{1}\d{1,4})?))$/.test(r);break;case"CZ":l=/^(((00)([- ]?)|\+)(420)([- ]?))?((\d{3})([- ]?)){2}(\d{3})$/.test(r);break;case"DE":l=/^(((((((00|\+)49[ \-/]?)|0)[1-9][0-9]{1,4})[ \-/]?)|((((00|\+)49\()|\(0)[1-9][0-9]{1,4}\)[ \-/]?))[0-9]{1,7}([ \-/]?[0-9]{1,5})?)$/.test(r);break;case"DK":l=/^(\+45|0045|\(45\))?\s?[2-9](\s?\d){7}$/.test(r);break;case"ES":l=/^(?:(?:(?:\+|00)34\D?))?(?:5|6|7|8|9)(?:\d\D?){8}$/.test(r);break;case"FR":l=/^(?:(?:(?:\+|00)33[ ]?(?:\(0\)[ ]?)?)|0){1}[1-9]{1}([ .-]?)(?:\d{2}\1?){3}\d{2}$/.test(r);break;case"GB":l=/^\(?(?:(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?\(?(?:0\)?[\s-]?\(?)?|0)(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}|\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4}|\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3})|\d{5}\)?[\s-]?\d{4,5}|8(?:00[\s-]?11[\s-]?11|45[\s-]?46[\s-]?4\d))(?:(?:[\s-]?(?:x|ext\.?\s?|\#)\d+)?)$/.test(r);break;case"IN":l=/((\+?)((0[ -]+)*|(91 )*)(\d{12}|\d{10}))|\d{5}([- ]*)\d{6}/.test(r);break;case"MA":l=/^(?:(?:(?:\+|00)212[\s]?(?:[\s]?\(0\)[\s]?)?)|0){1}(?:5[\s.-]?[2-3]|6[\s.-]?[13-9]){1}[0-9]{1}(?:[\s.-]?\d{2}){3}$/.test(r);break;case"NL":l=/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9])((\s|\s?-\s?)?[0-9])((\s|\s?-\s?)?[0-9])\s?[0-9]\s?[0-9]\s?[0-9]\s?[0-9]\s?[0-9]$/gm.test(r);break;case"PK":l=/^0?3[0-9]{2}[0-9]{7}$/.test(r);break;case"RO":l=/^(\+4|)?(07[0-8]{1}[0-9]{1}|02[0-9]{2}|03[0-9]{2}){1}?(\s|\.|\-)?([0-9]{3}(\s|\.|\-|)){2}$/g.test(r);break;case"RU":l=/^((8|\+7|007)[\-\.\/ ]?)?([\(\/\.]?\d{3}[\)\/\.]?[\-\.\/ ]?)?[\d\-\.\/ ]{7,10}$/g.test(r);break;case"SK":l=/^(((00)([- ]?)|\+)(421)([- ]?))?((\d{3})([- ]?)){2}(\d{3})$/.test(r);break;case"TH":l=/^0\(?([6|8-9]{2})*-([0-9]{3})*-([0-9]{4})$/.test(r);break;case"VE":l=/^0(?:2(?:12|4[0-9]|5[1-9]|6[0-9]|7[0-8]|8[1-35-8]|9[1-5]|3[45789])|4(?:1[246]|2[46]))\d{7}$/.test(r);break;case"US":default:l=/^(?:(1\-?)|(\+1 ?))?\(?\d{3}\)?[\-\.\s]?\d{3}[\-\.\s]?\d{4}$/.test(r)}return{message:A(t.l10n?n.message||t.l10n.phone.country:n.message,t.l10n?t.l10n.phone.countries[a]:a),valid:l}}}}function $e(){return{validate:function(e){if(""===e.value)return{valid:!0};if(!/^\d{9}$/.test(e.value))return{valid:!1};for(var t=0,n=0;n<e.value.length;n+=3)t+=3*parseInt(e.value.charAt(n),10)+7*parseInt(e.value.charAt(n+1),10)+parseInt(e.value.charAt(n+2),10);return{valid:0!==t&&t%10==0}}}}function je(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=e.value.toUpperCase();if(!/^[0-9A-Z]{7}$/.test(t))return{valid:!1};for(var n=[1,3,1,7,3,9,1],r=t.length,a=0,l=0;l<r-1;l++)a+=n[l]*parseInt(t.charAt(l),36);return{valid:"".concat(a=(10-a%10)%10)===t.charAt(r-1)}}}}function et(){return{validate:function(e){return{valid:""===e.value||/^\d{9}$/.test(e.value)&&t(e.value)}}}}function tt(){return{validate:function(e){if(""===e.value)return{valid:!0};for(var t=e.value.length,n=0,r,a=0;a<t;a++)r=parseInt(e.value.charAt(a),10),a%2==0&&((r*=2)>9&&(r-=9)),n+=r;return{valid:n%10==0}}}}function nt(){var e=function(e,t){var n=Math.pow(10,t),r=e*n,a,l;switch(!0){case 0===r:a=0;break;case r>0:a=1;break;case r<0:a=-1}return r%1==.5*a?(Math.floor(r)+(a>0?1:0))/n:Math.round(r)/n},t=function(t,n){if(0===n)return 1;var r="".concat(t).split("."),a="".concat(n).split("."),l=(1===r.length?0:r[1].length)+(1===a.length?0:a[1].length);return e(t-n*Math.floor(t/n),l)};return{validate:function(e){if(""===e.value)return{valid:!0};var n=parseFloat(e.value);if(isNaN(n)||!isFinite(n))return{valid:!1};var r=Object.assign({},{baseValue:0,message:"",step:1},e.options),a=t(n-r.baseValue,r.step);return{message:A(e.l10n?r.message||e.l10n.step.default:r.message,"".concat(r.step)),valid:0===a||a===r.step}}}}function rt(){return{validate:function(e){if(""===e.value)return{valid:!0};var t=Object.assign({},{message:""},e.options),n={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i},r=t.version?"".concat(t.version):"all";return{message:t.version?A(e.l10n?t.message||e.l10n.uuid.version:t.message,t.version):e.l10n?e.l10n.uuid.default:t.message,valid:null===n[r]||n[r].test(e.value)}}}}function at(e){var t=e.replace("-","");if(/^AR[0-9]{11}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{11}$/.test(t))return{meta:{},valid:!1};for(var n=[5,4,3,2,7,6,5,4,3,2],r=0,a=0;a<10;a++)r+=parseInt(t.charAt(a),10)*n[a];return 11===(r=11-r%11)&&(r=0),{meta:{},valid:"".concat(r)===t.substr(10)}}function lt(e){var t=e;if(/^ATU[0-9]{8}$/.test(t)&&(t=t.substr(2)),!/^U[0-9]{8}$/.test(t))return{meta:{},valid:!1};t=t.substr(1);for(var n=[1,2,1,2,1,2,1],r=0,a=0,l=0;l<7;l++)(a=parseInt(t.charAt(l),10)*n[l])>9&&(a=Math.floor(a/10)+a%10),r+=a;return 10===(r=10-(r+4)%10)&&(r=0),{meta:{},valid:"".concat(r)===t.substr(7,1)}}function it(e){var t=e,n;return/^BE[0]?[0-9]{9}$/.test(t)&&(t=t.substr(2)),/^[0]?[0-9]{9}$/.test(t)?(9===t.length&&(t="0".concat(t)),"0"===t.substr(1,1)?{meta:{},valid:!1}:{meta:{},valid:(parseInt(t.substr(0,8),10)+parseInt(t.substr(8,2),10))%97==0}):{meta:{},valid:!1}}function ot(e){var t=e;if(/^BG[0-9]{9,10}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9,10}$/.test(t))return{meta:{},valid:!1};var n=0,r=0;if(9===t.length){for(r=0;r<8;r++)n+=parseInt(t.charAt(r),10)*(r+1);if(10===(n%=11))for(n=0,r=0;r<8;r++)n+=parseInt(t.charAt(r),10)*(r+3);return{meta:{},valid:"".concat(n%=10)===t.substr(8)}}var a=function(e){var t=parseInt(e.substr(0,2),10)+1900,n=parseInt(e.substr(2,2),10),r;if(n>40?(t+=100,n-=40):n>20&&(t-=100,n-=20),!F(t,n,parseInt(e.substr(4,2),10)))return!1;for(var a=[2,4,8,5,10,9,7,3,6],l=0,i=0;i<9;i++)l+=parseInt(e.charAt(i),10)*a[i];return"".concat(l=l%11%10)===e.substr(9,1)},l=function(e){for(var t=[21,19,17,13,11,9,7,3,1],n=0,r=0;r<9;r++)n+=parseInt(e.charAt(r),10)*t[r];return"".concat(n%=10)===e.substr(9,1)},i=function(e){for(var t=[4,3,2,7,6,5,4,3,2],n=0,r=0;r<9;r++)n+=parseInt(e.charAt(r),10)*t[r];return 10!=(n=11-n%11)&&(11===n&&(n=0),"".concat(n)===e.substr(9,1))};return{meta:{},valid:a(t)||l(t)||i(t)}}function st(e){if(""===e)return{meta:{},valid:!0};var t=e.replace(/[^\d]+/g,"");if(""===t||14!==t.length)return{meta:{},valid:!1};if("00000000000000"===t||"11111111111111"===t||"22222222222222"===t||"33333333333333"===t||"44444444444444"===t||"55555555555555"===t||"66666666666666"===t||"77777777777777"===t||"88888888888888"===t||"99999999999999"===t)return{meta:{},valid:!1};var n=t.length-2,r=t.substring(0,n),a=t.substring(n),l=0,i=n-7,o;for(o=n;o>=1;o--)l+=parseInt(r.charAt(n-o),10)*i--,i<2&&(i=9);var s=l%11<2?0:11-l%11;if(s!==parseInt(a.charAt(0),10))return{meta:{},valid:!1};for(n+=1,r=t.substring(0,n),l=0,i=n-7,o=n;o>=1;o--)l+=parseInt(r.charAt(n-o),10)*i--,i<2&&(i=9);return{meta:{},valid:(s=l%11<2?0:11-l%11)===parseInt(a.charAt(1),10)}}function ct(e){var t=e;if(/^CHE[0-9]{9}(MWST|TVA|IVA|TPV)?$/.test(t)&&(t=t.substr(2)),!/^E[0-9]{9}(MWST|TVA|IVA|TPV)?$/.test(t))return{meta:{},valid:!1};t=t.substr(1);for(var n=[5,4,3,2,7,6,5,4],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return 10===(r=11-r%11)?{meta:{},valid:!1}:(11===r&&(r=0),{meta:{},valid:"".concat(r)===t.substr(8,1)})}function ut(e){var t=e;if(/^CY[0-5|9][0-9]{7}[A-Z]$/.test(t)&&(t=t.substr(2)),!/^[0-5|9][0-9]{7}[A-Z]$/.test(t))return{meta:{},valid:!1};if("12"===t.substr(0,2))return{meta:{},valid:!1};for(var n=0,r={0:1,1:0,2:5,3:7,4:9,5:13,6:15,7:17,8:19,9:21},a=0;a<8;a++){var l=parseInt(t.charAt(a),10);a%2==0&&(l=r["".concat(l)]),n+=l}return{meta:{},valid:"".concat("ABCDEFGHIJKLMNOPQRSTUVWXYZ"[n%26])===t.substr(8,1)}}function dt(e){var t=e;if(/^CZ[0-9]{8,10}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{8,10}$/.test(t))return{meta:{},valid:!1};var n=0,r=0;if(8===t.length){if("9"==="".concat(t.charAt(0)))return{meta:{},valid:!1};for(n=0,r=0;r<7;r++)n+=parseInt(t.charAt(r),10)*(8-r);return 10===(n=11-n%11)&&(n=0),11===n&&(n=1),{meta:{},valid:"".concat(n)===t.substr(7,1)}}if(9===t.length&&"6"==="".concat(t.charAt(0))){for(n=0,r=0;r<7;r++)n+=parseInt(t.charAt(r+1),10)*(8-r);return 10===(n=11-n%11)&&(n=0),11===n&&(n=1),{meta:{},valid:"".concat(n=[8,7,6,5,4,3,2,1,0,9,10][n-1])===t.substr(8,1)}}if(9===t.length||10===t.length){var a=1900+parseInt(t.substr(0,2),10),l=parseInt(t.substr(2,2),10)%50%20,i=parseInt(t.substr(4,2),10);if(9===t.length){if(a>=1980&&(a-=100),a>1953)return{meta:{},valid:!1}}else a<1954&&(a+=100);if(!F(a,l,i))return{meta:{},valid:!1};if(10===t.length){var o=parseInt(t.substr(0,9),10)%11;return a<1985&&(o%=10),{meta:{},valid:"".concat(o)===t.substr(9,1)}}return{meta:{},valid:!0}}return{meta:{},valid:!1}}function ft(e){var t=e;return/^DE[0-9]{9}$/.test(t)&&(t=t.substr(2)),/^[0-9]{9}$/.test(t)?{meta:{},valid:n(t)}:{meta:{},valid:!1}}function mt(e){var t=e;if(/^DK[0-9]{8}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{8}$/.test(t))return{meta:{},valid:!1};for(var n=0,r=[2,7,6,5,4,3,2,1],a=0;a<8;a++)n+=parseInt(t.charAt(a),10)*r[a];return{meta:{},valid:n%11==0}}function gt(e){var t=e;if(/^EE[0-9]{9}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9}$/.test(t))return{meta:{},valid:!1};for(var n=0,r=[3,7,1,3,7,1,3,7,1],a=0;a<9;a++)n+=parseInt(t.charAt(a),10)*r[a];return{meta:{},valid:n%10==0}}function pt(e){var t=e;if(/^ES[0-9A-Z][0-9]{7}[0-9A-Z]$/.test(t)&&(t=t.substr(2)),!/^[0-9A-Z][0-9]{7}[0-9A-Z]$/.test(t))return{meta:{},valid:!1};var n=function(e){var t=parseInt(e.substr(0,8),10);return"".concat("TRWAGMYFPDXBNJZSQVHLCKE"[t%23])===e.substr(8,1)},r=function(e){var t=["XYZ".indexOf(e.charAt(0)),e.substr(1)].join(""),n="TRWAGMYFPDXBNJZSQVHLCKE"[parseInt(t,10)%23];return"".concat(n)===e.substr(8,1)},a=function(e){var t=e.charAt(0),n;if(-1!=="KLM".indexOf(t))return n=parseInt(e.substr(1,8),10),"".concat(n="TRWAGMYFPDXBNJZSQVHLCKE"[n%23])===e.substr(8,1);if(-1!=="ABCDEFGHJNPQRSUVW".indexOf(t)){for(var r=[2,1,2,1,2,1,2],a=0,l=0,i=0;i<7;i++)(l=parseInt(e.charAt(i+1),10)*r[i])>9&&(l=Math.floor(l/10)+l%10),a+=l;return 10===(a=10-a%10)&&(a=0),"".concat(a)===e.substr(8,1)||"JABCDEFGHI"[a]===e.substr(8,1)}return!1},l=t.charAt(0);return/^[0-9]$/.test(l)?{meta:{type:"DNI"},valid:n(t)}:/^[XYZ]$/.test(l)?{meta:{type:"NIE"},valid:r(t)}:{meta:{type:"CIF"},valid:a(t)}}function ht(e){var t=e;if(/^FI[0-9]{8}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{8}$/.test(t))return{meta:{},valid:!1};for(var n=[7,9,10,5,8,4,2,1],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return{meta:{},valid:r%11==0}}function vt(e){var n=e;if(/^FR[0-9A-Z]{2}[0-9]{9}$/.test(n)&&(n=n.substr(2)),!/^[0-9A-Z]{2}[0-9]{9}$/.test(n))return{meta:{},valid:!1};if(!t(n.substr(2)))return{meta:{},valid:!1};if(/^[0-9]{2}$/.test(n.substr(0,2)))return{meta:{},valid:n.substr(0,2)==="".concat(parseInt(n.substr(2)+"12",10)%97)};var r="0123456789ABCDEFGHJKLMNPQRSTUVWXYZ",a;return a=/^[0-9]$/.test(n.charAt(0))?24*r.indexOf(n.charAt(0))+r.indexOf(n.charAt(1))-10:34*r.indexOf(n.charAt(0))+r.indexOf(n.charAt(1))-100,{meta:{},valid:(parseInt(n.substr(2),10)+1+Math.floor(a/11))%11==a%11}}function At(e){var t=e;if((/^GB[0-9]{9}$/.test(t)||/^GB[0-9]{12}$/.test(t)||/^GBGD[0-9]{3}$/.test(t)||/^GBHA[0-9]{3}$/.test(t)||/^GB(GD|HA)8888[0-9]{5}$/.test(t))&&(t=t.substr(2)),!(/^[0-9]{9}$/.test(t)||/^[0-9]{12}$/.test(t)||/^GD[0-9]{3}$/.test(t)||/^HA[0-9]{3}$/.test(t)||/^(GD|HA)8888[0-9]{5}$/.test(t)))return{meta:{},valid:!1};var n=t.length;if(5===n){var r=t.substr(0,2),a=parseInt(t.substr(2),10);return{meta:{},valid:"GD"===r&&a<500||"HA"===r&&a>=500}}if(11===n&&("GD8888"===t.substr(0,6)||"HA8888"===t.substr(0,6)))return"GD"===t.substr(0,2)&&parseInt(t.substr(6,3),10)>=500||"HA"===t.substr(0,2)&&parseInt(t.substr(6,3),10)<500?{meta:{},valid:!1}:{meta:{},valid:parseInt(t.substr(6,3),10)%97===parseInt(t.substr(9,2),10)};if(9===n||12===n){for(var l=[8,7,6,5,4,3,2,10,1],i=0,o=0;o<9;o++)i+=parseInt(t.charAt(o),10)*l[o];var s;return i%=97,{meta:{},valid:parseInt(t.substr(0,3),10)>=100?0===i||42===i||55===i:0===i}}return{meta:{},valid:!0}}function bt(e){var t=e;if(/^(GR|EL)[0-9]{9}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9}$/.test(t))return{meta:{},valid:!1};8===t.length&&(t="0".concat(t));for(var n=[256,128,64,32,16,8,4,2],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return{meta:{},valid:"".concat(r=r%11%10)===t.substr(8,1)}}function Et(e){var t=e;return/^HR[0-9]{11}$/.test(t)&&(t=t.substr(2)),/^[0-9]{11}$/.test(t)?{meta:{},valid:n(t)}:{meta:{},valid:!1}}function Ct(e){var t=e;if(/^HU[0-9]{8}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{8}$/.test(t))return{meta:{},valid:!1};for(var n=[9,7,3,1,9,7,3,1],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return{meta:{},valid:r%10==0}}function Vt(e){var t=e;if(/^IE[0-9][0-9A-Z\*\+][0-9]{5}[A-Z]{1,2}$/.test(t)&&(t=t.substr(2)),!/^[0-9][0-9A-Z\*\+][0-9]{5}[A-Z]{1,2}$/.test(t))return{meta:{},valid:!1};var n=function(e){for(var t=e;t.length<7;)t="0".concat(t);for(var n="WABCDEFGHIJKLMNOPQRSTUV",r=0,a=0;a<7;a++)r+=parseInt(t.charAt(a),10)*(8-a);return r+=9*n.indexOf(t.substr(7)),n[r%23]};return/^[0-9]+$/.test(t.substr(0,7))?{meta:{},valid:t.charAt(7)===n("".concat(t.substr(0,7)).concat(t.substr(8)))}:-1!=="ABCDEFGHIJKLMNOPQRSTUVWXYZ+*".indexOf(t.charAt(1))?{meta:{},valid:t.charAt(7)===n("".concat(t.substr(2,5)).concat(t.substr(0,1)))}:{meta:{},valid:!0}}function St(e){var t=e;return/^IS[0-9]{5,6}$/.test(t)&&(t=t.substr(2)),{meta:{},valid:/^[0-9]{5,6}$/.test(t)}}function Ht(e){var n=e;if(/^IT[0-9]{11}$/.test(n)&&(n=n.substr(2)),!/^[0-9]{11}$/.test(n))return{meta:{},valid:!1};if(0===parseInt(n.substr(0,7),10))return{meta:{},valid:!1};var r=parseInt(n.substr(7,3),10);return r<1||r>201&&999!==r&&888!==r?{meta:{},valid:!1}:{meta:{},valid:t(n)}}function yt(e){var t=e;if(/^LT([0-9]{7}1[0-9]|[0-9]{10}1[0-9])$/.test(t)&&(t=t.substr(2)),!/^([0-9]{7}1[0-9]|[0-9]{10}1[0-9])$/.test(t))return{meta:{},valid:!1};var n=t.length,r=0,a;for(a=0;a<n-1;a++)r+=parseInt(t.charAt(a),10)*(1+a%9);var l=r%11;if(10===l)for(r=0,a=0;a<n-1;a++)r+=parseInt(t.charAt(a),10)*(1+(a+2)%9);return{meta:{},valid:"".concat(l=l%11%10)===t.charAt(n-1)}}function Ft(e){var t=e;return/^LU[0-9]{8}$/.test(t)&&(t=t.substr(2)),/^[0-9]{8}$/.test(t)?{meta:{},valid:"".concat(parseInt(t.substr(0,6),10)%89)===t.substr(6,2)}:{meta:{},valid:!1}}function It(e){var t=e;if(/^LV[0-9]{11}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{11}$/.test(t))return{meta:{},valid:!1};var n=parseInt(t.charAt(0),10),r=t.length,a=0,l=[],i;if(n>3){for(a=0,l=[9,1,4,8,3,10,2,5,7,6,1],i=0;i<r;i++)a+=parseInt(t.charAt(i),10)*l[i];return{meta:{},valid:3===(a%=11)}}var o=parseInt(t.substr(0,2),10),s=parseInt(t.substr(2,2),10),c=parseInt(t.substr(4,2),10);if(!F(c=c+1800+100*parseInt(t.charAt(6),10),s,o))return{meta:{},valid:!1};for(a=0,l=[10,5,8,4,2,1,6,3,7,9],i=0;i<r-1;i++)a+=parseInt(t.charAt(i),10)*l[i];return{meta:{},valid:"".concat(a=(a+1)%11%10)===t.charAt(r-1)}}function Ot(e){var t=e;if(/^MT[0-9]{8}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{8}$/.test(t))return{meta:{},valid:!1};for(var n=[3,4,6,7,8,9,10,1],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return{meta:{},valid:r%37==0}}function wt(e){var t=e;if(/^NL[0-9]{9}B[0-9]{2}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9}B[0-9]{2}$/.test(t))return{meta:{},valid:!1};for(var n=[9,8,7,6,5,4,3,2],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return(r%=11)>9&&(r=0),{meta:{},valid:"".concat(r)===t.substr(8,1)}}function Lt(e){var t=e;if(/^NO[0-9]{9}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9}$/.test(t))return{meta:{},valid:!1};for(var n=[3,2,7,6,5,4,3,2],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return 11===(r=11-r%11)&&(r=0),{meta:{},valid:"".concat(r)===t.substr(8,1)}}function Nt(e){var t=e;if(/^PL[0-9]{10}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{10}$/.test(t))return{meta:{},valid:!1};for(var n=[6,5,7,2,3,4,5,6,7,-1],r=0,a=0;a<10;a++)r+=parseInt(t.charAt(a),10)*n[a];return{meta:{},valid:r%11==0}}function xt(e){var t=e;if(/^PT[0-9]{9}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9}$/.test(t))return{meta:{},valid:!1};for(var n=[9,8,7,6,5,4,3,2],r=0,a=0;a<8;a++)r+=parseInt(t.charAt(a),10)*n[a];return(r=11-r%11)>9&&(r=0),{meta:{},valid:"".concat(r)===t.substr(8,1)}}function Mt(e){var t=e;if(/^RO[1-9][0-9]{1,9}$/.test(t)&&(t=t.substr(2)),!/^[1-9][0-9]{1,9}$/.test(t))return{meta:{},valid:!1};for(var n=t.length,r=[7,5,3,2,1,7,5,3,2].slice(10-n),a=0,l=0;l<n-1;l++)a+=parseInt(t.charAt(l),10)*r[l];return{meta:{},valid:"".concat(a=10*a%11%10)===t.substr(n-1,1)}}function Tt(e){var t=e;if(/^RS[0-9]{9}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9}$/.test(t))return{meta:{},valid:!1};for(var n=10,r=0,a=0;a<8;a++)0===(r=(parseInt(t.charAt(a),10)+n)%10)&&(r=10),n=2*r%11;return{meta:{},valid:(n+parseInt(t.substr(8,1),10))%10==1}}function kt(e){var t=e;if(/^RU([0-9]{10}|[0-9]{12})$/.test(t)&&(t=t.substr(2)),!/^([0-9]{10}|[0-9]{12})$/.test(t))return{meta:{},valid:!1};var n=0;if(10===t.length){var r=[2,4,10,3,5,9,4,6,8,0],a=0;for(n=0;n<10;n++)a+=parseInt(t.charAt(n),10)*r[n];return(a%=11)>9&&(a%=10),{meta:{},valid:"".concat(a)===t.substr(9,1)}}if(12===t.length){var l=[7,2,4,10,3,5,9,4,6,8,0],i=[3,7,2,4,10,3,5,9,4,6,8,0],o=0,s=0;for(n=0;n<11;n++)o+=parseInt(t.charAt(n),10)*l[n],s+=parseInt(t.charAt(n),10)*i[n];return(o%=11)>9&&(o%=10),(s%=11)>9&&(s%=10),{meta:{},valid:"".concat(o)===t.substr(10,1)&&"".concat(s)===t.substr(11,1)}}return{meta:{},valid:!0}}function Rt(e){var n=e;return/^SE[0-9]{10}01$/.test(n)&&(n=n.substr(2)),/^[0-9]{10}01$/.test(n)?{meta:{},valid:t(n=n.substr(0,10))}:{meta:{},valid:!1}}function Bt(e){var t=e.match(/^(SI)?([1-9][0-9]{7})$/);if(!t)return{meta:{},valid:!1};for(var n=t[1]?e.substr(2):e,r=[8,7,6,5,4,3,2],a=0,l=0;l<7;l++)a+=parseInt(n.charAt(l),10)*r[l];return 10===(a=11-a%11)&&(a=0),{meta:{},valid:"".concat(a)===n.substr(7,1)}}function Zt(e){var t=e;return/^SK[1-9][0-9][(2-4)|(6-9)][0-9]{7}$/.test(t)&&(t=t.substr(2)),/^[1-9][0-9][(2-4)|(6-9)][0-9]{7}$/.test(t)?{meta:{},valid:parseInt(t,10)%11==0}:{meta:{},valid:!1}}function Gt(e){var t=e;if(/^VE[VEJPG][0-9]{9}$/.test(t)&&(t=t.substr(2)),!/^[VEJPG][0-9]{9}$/.test(t))return{meta:{},valid:!1};for(var n,r=[3,2,7,6,5,4,3,2],a={E:8,G:20,J:12,P:16,V:4}[t.charAt(0)],l=0;l<8;l++)a+=parseInt(t.charAt(l+1),10)*r[l];return(11===(a=11-a%11)||10===a)&&(a=0),{meta:{},valid:"".concat(a)===t.substr(9,1)}}function Pt(e){var t=e;return/^ZA4[0-9]{9}$/.test(t)&&(t=t.substr(2)),{meta:{},valid:/^4[0-9]{9}$/.test(t)}}function Dt(){var e=["AR","AT","BE","BG","BR","CH","CY","CZ","DE","DK","EE","EL","ES","FI","FR","GB","GR","HR","HU","IE","IS","IT","LT","LU","LV","MT","NL","NO","PL","PT","RO","RU","RS","SE","SK","SI","VE","ZA"];return{validate:function(t){var n=t.value;if(""===n)return{valid:!0};var r=Object.assign({},{message:""},t.options),a=n.substr(0,2);if(a="function"==typeof r.country?r.country.call(this):r.country,-1===e.indexOf(a))return{valid:!0};var l={meta:{},valid:!0};switch(a.toLowerCase()){case"ar":l=at(n);break;case"at":l=lt(n);break;case"be":l=it(n);break;case"bg":l=ot(n);break;case"br":l=st(n);break;case"ch":l=ct(n);break;case"cy":l=ut(n);break;case"cz":l=dt(n);break;case"de":l=ft(n);break;case"dk":l=mt(n);break;case"ee":l=gt(n);break;case"el":l=bt(n);break;case"es":l=pt(n);break;case"fi":l=ht(n);break;case"fr":l=vt(n);break;case"gb":l=At(n);break;case"gr":l=bt(n);break;case"hr":l=Et(n);break;case"hu":l=Ct(n);break;case"ie":l=Vt(n);break;case"is":l=St(n);break;case"it":l=Ht(n);break;case"lt":l=yt(n);break;case"lu":l=Ft(n);break;case"lv":l=It(n);break;case"mt":l=Ot(n);break;case"nl":l=wt(n);break;case"no":l=Lt(n);break;case"pl":l=Nt(n);break;case"pt":l=xt(n);break;case"ro":l=Mt(n);break;case"rs":l=Tt(n);break;case"ru":l=kt(n);break;case"se":l=Rt(n);break;case"si":l=Bt(n);break;case"sk":l=Zt(n);break;case"ve":l=Gt(n);break;case"za":l=Pt(n)}var i=A(t.l10n?r.message||t.l10n.vat.country:r.message,t.l10n?t.l10n.vat.countries[a.toUpperCase()]:a.toUpperCase());return Object.assign({},{message:i},l)}}}function Kt(){return{validate:function(e){if(""===e.value)return{valid:!0};if(!/^[a-hj-npr-z0-9]{8}[0-9xX][a-hj-npr-z0-9]{8}$/i.test(e.value))return{valid:!1};for(var t=e.value.toUpperCase(),n={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,J:1,K:2,L:3,M:4,N:5,P:7,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9,0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9},r=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],a=t.length,l=0,i=0;i<a;i++)l+=n["".concat(t.charAt(i))]*r[i];var o="".concat(l%11);return"10"===o&&(o="X"),{valid:o===t.charAt(8)}}}}function Ut(){var e=["AT","BG","BR","CA","CH","CZ","DE","DK","ES","FR","GB","IE","IN","IT","MA","NL","PL","PT","RO","RU","SE","SG","SK","US"],t=function(e){for(var t="[ABCDEFGHIJKLMNOPRSTUWYZ]",n="[ABCDEFGHKLMNOPQRSTUVWXY]",r="[ABCDEFGHJKPMNRSTUVWXY]",a="[ABEHMNPRVWXY]",l="[ABDEFGHJLNPQRSTUWXYZ]",i,o=0,s=[new RegExp("^(".concat(t,"{1}").concat(n,"?[0-9]{1,2})(\\s*)([0-9]{1}").concat(l,"{2})$"),"i"),new RegExp("^(".concat(t,"{1}[0-9]{1}").concat(r,"{1})(\\s*)([0-9]{1}").concat(l,"{2})$"),"i"),new RegExp("^(".concat(t,"{1}").concat(n,"{1}?[0-9]{1}").concat(a,"{1})(\\s*)([0-9]{1}").concat(l,"{2})$"),"i"),new RegExp("^(BF1)(\\s*)([0-6]{1}[ABDEFGHJLNPQRST]{1}[ABDEFGHJLNPQRSTUWZYZ]{1})$","i"),/^(GIR)(\s*)(0AA)$/i,/^(BFPO)(\s*)([0-9]{1,4})$/i,/^(BFPO)(\s*)(c\/o\s*[0-9]{1,3})$/i,/^([A-Z]{4})(\s*)(1ZZ)$/i,/^(AI-2640)$/i];o<s.length;o++){var c;if(s[o].test(e))return!0}return!1};return{validate:function(n){var r=Object.assign({},n.options);if(""===n.value||!r.country)return{valid:!0};var a=n.value.substr(0,2);if(!(a="function"==typeof r.country?r.country.call(this):r.country)||-1===e.indexOf(a.toUpperCase()))return{valid:!0};var l=!1;switch(a=a.toUpperCase()){case"AT":l=/^([1-9]{1})(\d{3})$/.test(n.value);break;case"BG":l=/^([1-9]{1}[0-9]{3})$/.test(n.value);break;case"BR":l=/^(\d{2})([\.]?)(\d{3})([\-]?)(\d{3})$/.test(n.value);break;case"CA":l=/^(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|W|X|Y|Z){1}\s?[0-9]{1}(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|W|X|Y|Z){1}[0-9]{1}$/i.test(n.value);break;case"CH":l=/^([1-9]{1})(\d{3})$/.test(n.value);break;case"CZ":l=/^(\d{3})([ ]?)(\d{2})$/.test(n.value);break;case"DE":l=/^(?!01000|99999)(0[1-9]\d{3}|[1-9]\d{4})$/.test(n.value);break;case"DK":l=/^(DK(-|\s)?)?\d{4}$/i.test(n.value);break;case"ES":l=/^(?:0[1-9]|[1-4][0-9]|5[0-2])\d{3}$/.test(n.value);break;case"FR":l=/^[0-9]{5}$/i.test(n.value);break;case"GB":l=t(n.value);break;case"IN":l=/^\d{3}\s?\d{3}$/.test(n.value);break;case"IE":l=/^(D6W|[ACDEFHKNPRTVWXY]\d{2})\s[0-9ACDEFHKNPRTVWXY]{4}$/.test(n.value);break;case"IT":l=/^(I-|IT-)?\d{5}$/i.test(n.value);break;case"MA":l=/^[1-9][0-9]{4}$/i.test(n.value);break;case"NL":l=/^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(n.value);break;case"PL":l=/^[0-9]{2}\-[0-9]{3}$/.test(n.value);break;case"PT":l=/^[1-9]\d{3}-\d{3}$/.test(n.value);break;case"RO":l=/^(0[1-8]{1}|[1-9]{1}[0-5]{1})?[0-9]{4}$/i.test(n.value);break;case"RU":l=/^[0-9]{6}$/i.test(n.value);break;case"SE":l=/^(S-)?\d{3}\s?\d{2}$/i.test(n.value);break;case"SG":l=/^([0][1-9]|[1-6][0-9]|[7]([0-3]|[5-9])|[8][0-2])(\d{4})$/i.test(n.value);break;case"SK":l=/^(\d{3})([ ]?)(\d{2})$/.test(n.value);break;case"US":default:l=/^\d{4,5}([\-]?\d{4})?$/.test(n.value)}return{message:A(n.l10n?r.message||n.l10n.zipCode.country:r.message,n.l10n?n.l10n.zipCode.countries[a]:a),valid:l}}}}var Yt={between:b,blank:E,callback:V,choice:S,creditCard:y,date:I,different:O,digits:w,emailAddress:L,file:N,greaterThan:x,identical:M,integer:T,ip:k,lessThan:R,notEmpty:B,numeric:Z,promise:G,regexp:P,remote:K,stringCase:U,stringLength:Y,uri:J,base64:W,bic:z,color:_,cusip:X,ean:Q,ein:q,grid:$,hex:j,iban:ee,id:Ke,imei:Ue,imo:Ye,isbn:Je,isin:We,ismn:ze,issn:_e,mac:Xe,meid:Qe,phone:qe,rtn:$e,sedol:je,siren:et,siret:tt,step:nt,uuid:rt,vat:Dt,vin:Kt,zipCode:Ut},Jt=function(){function e(t,n){i(this,e),this.elements={},this.ee=p(),this.filter={filters:{},add:function(e,t){(this.filters[e]=this.filters[e]||[]).push(t)},clear:function(){this.filters={}},execute:function(e,t,n){if(!this.filters[e]||!this.filters[e].length)return t;for(var r=t,a=this.filters[e],l=a.length,i=0;i<l;i++)r=a[i].apply(r,n);return r},remove:function(e,t){this.filters[e]&&(this.filters[e]=this.filters[e].filter((function(e){return e!==t})))}},this.plugins={},this.results=new Map,this.validators={},this.form=t,this.fields=n}return s(e,[{key:"on",value:function(e,t){return this.ee.on(e,t),this}},{key:"off",value:function(e,t){return this.ee.off(e,t),this}},{key:"emit",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(t=this.ee).emit.apply(t,[e].concat(r)),this}},{key:"registerPlugin",value:function(e,t){if(this.plugins[e])throw new Error("The plguin ".concat(e," is registered"));return t.setCore(this),t.install(),this.plugins[e]=t,this}},{key:"deregisterPlugin",value:function(e){var t=this.plugins[e];return t&&t.uninstall(),delete this.plugins[e],this}},{key:"registerValidator",value:function(e,t){if(this.validators[e])throw new Error("The validator ".concat(e," is registered"));return this.validators[e]=t,this}},{key:"registerFilter",value:function(e,t){return this.filter.add(e,t),this}},{key:"deregisterFilter",value:function(e,t){return this.filter.remove(e,t),this}},{key:"executeFilter",value:function(e,t,n){return this.filter.execute(e,t,n)}},{key:"addField",value:function(e,t){var n=Object.assign({},{selector:"",validators:{}},t);return this.fields[e]=this.fields[e]?{selector:n.selector||this.fields[e].selector,validators:Object.assign({},this.fields[e].validators,n.validators)}:n,this.elements[e]=this.queryElements(e),this.emit("core.field.added",{elements:this.elements[e],field:e,options:this.fields[e]}),this}},{key:"removeField",value:function(e){if(!this.fields[e])throw new Error("The field ".concat(e," validators are not defined. Please ensure the field is added first"));var t=this.elements[e],n=this.fields[e];return delete this.elements[e],delete this.fields[e],this.emit("core.field.removed",{elements:t,field:e,options:n}),this}},{key:"validate",value:function(){var e=this;return this.emit("core.form.validating"),this.filter.execute("validate-pre",Promise.resolve(),[]).then((function(){return Promise.all(Object.keys(e.fields).map((function(t){return e.validateField(t)}))).then((function(t){switch(!0){case-1!==t.indexOf("Invalid"):return e.emit("core.form.invalid"),Promise.resolve("Invalid");case-1!==t.indexOf("NotValidated"):return e.emit("core.form.notvalidated"),Promise.resolve("NotValidated");default:return e.emit("core.form.valid"),Promise.resolve("Valid")}}))}))}},{key:"validateField",value:function(e){var t=this,n=this.results.get(e);if("Valid"===n||"Invalid"===n)return Promise.resolve(n);this.emit("core.field.validating",e);var r=this.elements[e];if(0===r.length)return this.emit("core.field.valid",e),Promise.resolve("Valid");var a=r[0].getAttribute("type");return"radio"===a||"checkbox"===a||1===r.length?this.validateElement(e,r[0]):Promise.all(r.map((function(n){return t.validateElement(e,n)}))).then((function(n){switch(!0){case-1!==n.indexOf("Invalid"):return t.emit("core.field.invalid",e),t.results.set(e,"Invalid"),Promise.resolve("Invalid");case-1!==n.indexOf("NotValidated"):return t.emit("core.field.notvalidated",e),t.results.delete(e),Promise.resolve("NotValidated");default:return t.emit("core.field.valid",e),t.results.set(e,"Valid"),Promise.resolve("Valid")}}))}},{key:"validateElement",value:function(e,t){var n=this;this.results.delete(e);var r=this.elements[e],a;if(this.filter.execute("element-ignored",!1,[e,t,r]))return this.emit("core.element.ignored",{element:t,elements:r,field:e}),Promise.resolve("Ignored");var l=this.fields[e].validators;this.emit("core.element.validating",{element:t,elements:r,field:e});var i=Object.keys(l).map((function(r){return function(){return n.executeValidator(e,t,r,l[r])}}));return this.waterfall(i).then((function(a){var l=-1===a.indexOf("Invalid");n.emit("core.element.validated",{element:t,elements:r,field:e,valid:l});var i=t.getAttribute("type");return("radio"===i||"checkbox"===i||1===r.length)&&n.emit(l?"core.field.valid":"core.field.invalid",e),Promise.resolve(l?"Valid":"Invalid")})).catch((function(a){return n.emit("core.element.notvalidated",{element:t,elements:r,field:e}),Promise.resolve(a)}))}},{key:"executeValidator",value:function(e,t,n,r){var a=this,l=this.elements[e],i=this.filter.execute("validator-name",n,[n,e]);if(r.message=this.filter.execute("validator-message",r.message,[this.locale,e,i]),!this.validators[i]||!1===r.enabled)return this.emit("core.validator.validated",{element:t,elements:l,field:e,result:this.normalizeResult(e,i,{valid:!0}),validator:i}),Promise.resolve("Valid");var o=this.validators[i],s=this.getElementValue(e,t,i),c;if(!this.filter.execute("field-should-validate",!0,[e,t,s,n]))return this.emit("core.validator.notvalidated",{element:t,elements:l,field:e,validator:n}),Promise.resolve("NotValidated");this.emit("core.validator.validating",{element:t,elements:l,field:e,validator:n});var u=o().validate({element:t,elements:l,field:e,l10n:this.localization,options:r,value:s}),d;if("function"==typeof u.then)return u.then((function(r){var i=a.normalizeResult(e,n,r);return a.emit("core.validator.validated",{element:t,elements:l,field:e,result:i,validator:n}),i.valid?"Valid":"Invalid"}));var f=this.normalizeResult(e,n,u);return this.emit("core.validator.validated",{element:t,elements:l,field:e,result:f,validator:n}),Promise.resolve(f.valid?"Valid":"Invalid")}},{key:"getElementValue",value:function(e,t,n){var r=v(this.form,e,t,this.elements[e]);return this.filter.execute("field-value",r,[r,e,t,n])}},{key:"getElements",value:function(e){return this.elements[e]}},{key:"getFields",value:function(){return this.fields}},{key:"getFormElement",value:function(){return this.form}},{key:"getLocale",value:function(){return this.locale}},{key:"getPlugin",value:function(e){return this.plugins[e]}},{key:"updateFieldStatus",value:function(e,t,n){var r=this,a=this.elements[e],l=a[0].getAttribute("type"),i;if(("radio"===l||"checkbox"===l?[a[0]]:a).forEach((function(a){return r.updateElementStatus(e,a,t,n)})),!n)switch(t){case"NotValidated":this.emit("core.field.notvalidated",e),this.results.delete(e);break;case"Validating":this.emit("core.field.validating",e),this.results.delete(e);break;case"Valid":this.emit("core.field.valid",e),this.results.set(e,"Valid");break;case"Invalid":this.emit("core.field.invalid",e),this.results.set(e,"Invalid")}return this}},{key:"updateElementStatus",value:function(e,t,n,r){var a=this,l=this.elements[e],i=this.fields[e].validators,o=r?[r]:Object.keys(i);switch(n){case"NotValidated":o.forEach((function(n){return a.emit("core.validator.notvalidated",{element:t,elements:l,field:e,validator:n})})),this.emit("core.element.notvalidated",{element:t,elements:l,field:e});break;case"Validating":o.forEach((function(n){return a.emit("core.validator.validating",{element:t,elements:l,field:e,validator:n})})),this.emit("core.element.validating",{element:t,elements:l,field:e});break;case"Valid":o.forEach((function(n){return a.emit("core.validator.validated",{element:t,field:e,result:{message:i[n].message,valid:!0},validator:n})})),this.emit("core.element.validated",{element:t,elements:l,field:e,valid:!0});break;case"Invalid":o.forEach((function(n){return a.emit("core.validator.validated",{element:t,field:e,result:{message:i[n].message,valid:!1},validator:n})})),this.emit("core.element.validated",{element:t,elements:l,field:e,valid:!1})}return this}},{key:"resetForm",value:function(e){var t=this;return Object.keys(this.fields).forEach((function(n){return t.resetField(n,e)})),this.emit("core.form.reset",{reset:e}),this}},{key:"resetField",value:function(e,t){if(t){var n=this.elements[e],r=n[0].getAttribute("type");n.forEach((function(e){"radio"===r||"checkbox"===r?(e.removeAttribute("selected"),e.removeAttribute("checked"),e.checked=!1):(e.setAttribute("value",""),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=""))}))}return this.updateFieldStatus(e,"NotValidated"),this.emit("core.field.reset",{field:e,reset:t}),this}},{key:"revalidateField",value:function(e){return this.updateFieldStatus(e,"NotValidated"),this.validateField(e)}},{key:"disableValidator",value:function(e,t){return this.toggleValidator(!1,e,t)}},{key:"enableValidator",value:function(e,t){return this.toggleValidator(!0,e,t)}},{key:"updateValidatorOption",value:function(e,t,n,r){return this.fields[e]&&this.fields[e].validators&&this.fields[e].validators[t]&&(this.fields[e].validators[t][n]=r),this}},{key:"destroy",value:function(){var e=this;return Object.keys(this.plugins).forEach((function(t){return e.plugins[t].uninstall()})),this.ee.clear(),this.filter.clear(),this.results.clear(),this.plugins={},this}},{key:"setLocale",value:function(e,t){return this.locale=e,this.localization=t,this}},{key:"waterfall",value:function(e){return e.reduce((function(e,t,n,r){return e.then((function(e){return t().then((function(t){return e.push(t),e}))}))}),Promise.resolve([]))}},{key:"queryElements",value:function(e){var t=this.fields[e].selector?"#"===this.fields[e].selector.charAt(0)?'[id="'.concat(this.fields[e].selector.substring(1),'"]'):this.fields[e].selector:'[name="'.concat(e,'"]');return[].slice.call(this.form.querySelectorAll(t))}},{key:"normalizeResult",value:function(e,t,n){var r=this.fields[e].validators[t];return Object.assign({},n,{message:n.message||(r?r.message:"")||(this.localization&&this.localization[t]&&this.localization[t].default?this.localization[t].default:"")||"The field ".concat(e," is not valid")})}},{key:"toggleValidator",value:function(e,t,n){var r=this,a=this.fields[t].validators;return n&&a&&a[n]?this.fields[t].validators[n].enabled=e:n||Object.keys(a).forEach((function(n){return r.fields[t].validators[n].enabled=e})),this.updateFieldStatus(t,"NotValidated",n)}}]),e}();function Wt(e,t){var n=Object.assign({},{fields:{},locale:"en_US",plugins:{}},t),r=new Jt(e,n.fields);return r.setLocale(n.locale,n.localization),Object.keys(n.plugins).forEach((function(e){return r.registerPlugin(e,n.plugins[e])})),Object.keys(Yt).forEach((function(e){return r.registerValidator(e,Yt[e])})),Object.keys(n.fields).forEach((function(e){return r.addField(e,n.fields[e])})),r}var zt=function(){function e(t){i(this,e),this.opts=t}return s(e,[{key:"setCore",value:function(e){return this.core=e,this}},{key:"install",value:function(){}},{key:"uninstall",value:function(){}}]),e}(),_t={getFieldValue:v},Xt=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).opts=e||{},n.validatorNameFilter=n.getValidatorName.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.registerFilter("validator-name",this.validatorNameFilter)}},{key:"uninstall",value:function(){this.core.deregisterFilter("validator-name",this.validatorNameFilter)}},{key:"getValidatorName",value:function(e,t){return this.opts[e]||e}}]),t}(zt),Qt=function(e){function t(){var e;return i(this,t),(e=g(this,d(t).call(this,{}))).elementValidatedHandler=e.onElementValidated.bind(m(e)),e.fieldValidHandler=e.onFieldValid.bind(m(e)),e.fieldInvalidHandler=e.onFieldInvalid.bind(m(e)),e.messageDisplayedHandler=e.onMessageDisplayed.bind(m(e)),e}return u(t,e),s(t,[{key:"install",value:function(){this.core.on("core.field.valid",this.fieldValidHandler).on("core.field.invalid",this.fieldInvalidHandler).on("core.element.validated",this.elementValidatedHandler).on("plugins.message.displayed",this.messageDisplayedHandler)}},{key:"uninstall",value:function(){this.core.off("core.field.valid",this.fieldValidHandler).off("core.field.invalid",this.fieldInvalidHandler).off("core.element.validated",this.elementValidatedHandler).off("plugins.message.displayed",this.messageDisplayedHandler)}},{key:"onElementValidated",value:function(e){e.valid&&(e.element.setAttribute("aria-invalid","false"),e.element.removeAttribute("aria-describedby"))}},{key:"onFieldValid",value:function(e){var t=this.core.getElements(e);t&&t.forEach((function(e){e.setAttribute("aria-invalid","false"),e.removeAttribute("aria-describedby")}))}},{key:"onFieldInvalid",value:function(e){var t=this.core.getElements(e);t&&t.forEach((function(e){return e.setAttribute("aria-invalid","true")}))}},{key:"onMessageDisplayed",value:function(e){e.messageElement.setAttribute("role","alert"),e.messageElement.setAttribute("aria-hidden","false");var t=this.core.getElements(e.field),n=t.indexOf(e.element),r="js-fv-".concat(e.field,"-").concat(n,"-").concat(Date.now(),"-message");e.messageElement.setAttribute("id",r),e.element.setAttribute("aria-describedby",r);var a=e.element.getAttribute("type");("radio"===a||"checkbox"===a)&&t.forEach((function(e){return e.setAttribute("aria-describedby",r)}))}}]),t}(zt),qt=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).opts=Object.assign({},{html5Input:!1,pluginPrefix:"data-fvp-",prefix:"data-fv-"},e),n}return u(t,e),s(t,[{key:"install",value:function(){var e=this;this.parsePlugins();var t=this.parseOptions();Object.keys(t).forEach((function(n){return e.core.addField(n,t[n])}))}},{key:"parseOptions",value:function(){var e=this,t=this.opts.prefix,n={},r=this.core.getFields(),a=this.core.getFormElement(),l;return[].slice.call(a.querySelectorAll("[name], [".concat(t,"field]"))).forEach((function(r){var a=e.parseElement(r);if(!e.isEmptyOption(a)){var l=r.getAttribute("name")||r.getAttribute("".concat(t,"field"));n[l]=Object.assign({},n[l],a)}})),Object.keys(n).forEach((function(e){Object.keys(n[e].validators).forEach((function(t){n[e].validators[t].enabled=n[e].validators[t].enabled||!1,r[e]&&r[e].validators&&r[e].validators[t]&&Object.assign(n[e].validators[t],r[e].validators[t])}))})),Object.assign({},r,n)}},{key:"createPluginInstance",value:function(e,t){for(var n=e.split("."),r=window||this,a=0,l=n.length;a<l;a++)r=r[n[a]];if("function"!=typeof r)throw new Error("the plugin ".concat(e," doesn't exist"));return new r(t)}},{key:"parsePlugins",value:function(){for(var e=this,t=this.core.getFormElement(),n=new RegExp("^".concat(this.opts.pluginPrefix,"([a-z0-9-]+)(___)*([a-z0-9-]+)*$")),r=t.attributes.length,a={},l=0;l<r;l++){var i=t.attributes[l].name,o=t.attributes[l].value,s=n.exec(i);if(s&&4===s.length){var u=this.toCamelCase(s[1]);a[u]=Object.assign({},s[3]?c({},this.toCamelCase(s[3]),o):{enabled:""===o||"true"===o},a[u])}}Object.keys(a).forEach((function(t){var n=a[t],r=n.enabled,l=n.class;if(r&&l){delete n.enabled,delete n.clazz;var i=e.createPluginInstance(l,n);e.core.registerPlugin(t,i)}}))}},{key:"isEmptyOption",value:function(e){var t=e.validators;return 0===Object.keys(t).length&&t.constructor===Object}},{key:"parseElement",value:function(e){for(var t=new RegExp("^".concat(this.opts.prefix,"([a-z0-9-]+)(___)*([a-z0-9-]+)*$")),n=e.attributes.length,r={},a=e.getAttribute("type"),l=0;l<n;l++){var i=e.attributes[l].name,o=e.attributes[l].value;if(this.opts.html5Input)switch(!0){case"minlength"===i:r.stringLength=Object.assign({},{enabled:!0,min:parseInt(o,10)},r.stringLength);break;case"maxlength"===i:r.stringLength=Object.assign({},{enabled:!0,max:parseInt(o,10)},r.stringLength);break;case"pattern"===i:r.regexp=Object.assign({},{enabled:!0,regexp:o},r.regexp);break;case"required"===i:r.notEmpty=Object.assign({},{enabled:!0},r.notEmpty);break;case"type"===i&&"color"===o:r.color=Object.assign({},{enabled:!0,type:"hex"},r.color);break;case"type"===i&&"email"===o:r.emailAddress=Object.assign({},{enabled:!0},r.emailAddress);break;case"type"===i&&"url"===o:r.uri=Object.assign({},{enabled:!0},r.uri);break;case"type"===i&&"range"===o:r.between=Object.assign({},{enabled:!0,max:parseFloat(e.getAttribute("max")),min:parseFloat(e.getAttribute("min"))},r.between);break;case"min"===i&&"date"!==a&&"range"!==a:r.greaterThan=Object.assign({},{enabled:!0,min:parseFloat(o)},r.greaterThan);break;case"max"===i&&"date"!==a&&"range"!==a:r.lessThan=Object.assign({},{enabled:!0,max:parseFloat(o)},r.lessThan)}var s=t.exec(i);if(s&&4===s.length){var u=this.toCamelCase(s[1]);r[u]=Object.assign({},s[3]?c({},this.toCamelCase(s[3]),o):{enabled:""===o||"true"===o},r[u])}}return{validators:r}}},{key:"toUpperCase",value:function(e){return e.charAt(1).toUpperCase()}},{key:"toCamelCase",value:function(e){return e.replace(/-./g,this.toUpperCase)}}]),t}(zt),$t=function(e){function t(){var e;return i(this,t),(e=g(this,d(t).call(this,{}))).onValidHandler=e.onFormValid.bind(m(e)),e}return u(t,e),s(t,[{key:"install",value:function(){var e;if(this.core.getFormElement().querySelectorAll('[type="submit"][name="submit"]').length)throw new Error("Do not use `submit` for the name attribute of submit button");this.core.on("core.form.valid",this.onValidHandler)}},{key:"uninstall",value:function(){this.core.off("core.form.valid",this.onValidHandler)}},{key:"onFormValid",value:function(){var e=this.core.getFormElement();e instanceof HTMLFormElement&&e.submit()}}]),t}(zt),jt=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).opts=e||{},n.triggerExecutedHandler=n.onTriggerExecuted.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.on("plugins.trigger.executed",this.triggerExecutedHandler)}},{key:"uninstall",value:function(){this.core.off("plugins.trigger.executed",this.triggerExecutedHandler)}},{key:"onTriggerExecuted",value:function(e){if(this.opts[e.field]){var t=this.opts[e.field].split(" "),n=!0,r=!1,a=void 0;try{for(var l=t[Symbol.iterator](),i;!(n=(i=l.next()).done);n=!0){var o,s=i.value.trim();this.opts[s]&&this.core.revalidateField(s)}}catch(e){r=!0,a=e}finally{try{!n&&null!=l.return&&l.return()}finally{if(r)throw a}}}}}]),t}(zt),en=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).opts=Object.assign({},{excluded:t.defaultIgnore},e),n.ignoreValidationFilter=n.ignoreValidation.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.registerFilter("element-ignored",this.ignoreValidationFilter)}},{key:"uninstall",value:function(){this.core.deregisterFilter("element-ignored",this.ignoreValidationFilter)}},{key:"ignoreValidation",value:function(e,t,n){return this.opts.excluded.apply(this,[e,t,n])}}],[{key:"defaultIgnore",value:function(e,t,n){var r=!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),a=t.getAttribute("disabled");return""===a||"disabled"===a||"hidden"===t.getAttribute("type")||!r}}]),t}(zt),tn=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).statuses=new Map,n.opts=Object.assign({},{onStatusChanged:function(){}},e),n.elementValidatingHandler=n.onElementValidating.bind(m(n)),n.elementValidatedHandler=n.onElementValidated.bind(m(n)),n.elementNotValidatedHandler=n.onElementNotValidated.bind(m(n)),n.elementIgnoredHandler=n.onElementIgnored.bind(m(n)),n.fieldAddedHandler=n.onFieldAdded.bind(m(n)),n.fieldRemovedHandler=n.onFieldRemoved.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.on("core.element.validating",this.elementValidatingHandler).on("core.element.validated",this.elementValidatedHandler).on("core.element.notvalidated",this.elementNotValidatedHandler).on("core.element.ignored",this.elementIgnoredHandler).on("core.field.added",this.fieldAddedHandler).on("core.field.removed",this.fieldRemovedHandler)}},{key:"uninstall",value:function(){this.statuses.clear(),this.core.off("core.element.validating",this.elementValidatingHandler).off("core.element.validated",this.elementValidatedHandler).off("core.element.notvalidated",this.elementNotValidatedHandler).off("core.element.ignored",this.elementIgnoredHandler).off("core.field.added",this.fieldAddedHandler).off("core.field.removed",this.fieldRemovedHandler)}},{key:"areFieldsValid",value:function(){return Array.from(this.statuses.values()).every((function(e){return"Valid"===e||"NotValidated"===e||"Ignored"===e}))}},{key:"getStatuses",value:function(){return this.statuses}},{key:"onFieldAdded",value:function(e){this.statuses.set(e.field,"NotValidated")}},{key:"onFieldRemoved",value:function(e){this.statuses.has(e.field)&&this.statuses.delete(e.field),this.opts.onStatusChanged(this.areFieldsValid())}},{key:"onElementValidating",value:function(e){this.statuses.set(e.field,"Validating"),this.opts.onStatusChanged(!1)}},{key:"onElementValidated",value:function(e){this.statuses.set(e.field,e.valid?"Valid":"Invalid"),e.valid?this.opts.onStatusChanged(this.areFieldsValid()):this.opts.onStatusChanged(!1)}},{key:"onElementNotValidated",value:function(e){this.statuses.set(e.field,"NotValidated"),this.opts.onStatusChanged(!1)}},{key:"onElementIgnored",value:function(e){this.statuses.set(e.field,"Ignored"),this.opts.onStatusChanged(this.areFieldsValid())}}]),t}(zt);function nn(e,t){t.split(" ").forEach((function(t){e.classList?e.classList.add(t):" ".concat(e.className," ").indexOf(" ".concat(t," "))&&(e.className+=" ".concat(t))}))}function rn(e,t){t.split(" ").forEach((function(t){e.classList?e.classList.remove(t):e.className=e.className.replace(t,"")}))}function an(e,t){var n=[],r=[];Object.keys(t).forEach((function(e){e&&(t[e]?n.push(e):r.push(e))})),r.forEach((function(t){return rn(e,t)})),n.forEach((function(t){return nn(e,t)}))}function ln(e,t){var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector,r;return n?n.call(e,t):[].slice.call(e.parentElement.querySelectorAll(t)).indexOf(e)>=0}function on(e,t){for(var n=e;n&&!ln(n,t);)n=n.parentElement;return n}var sn=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).messages=new Map,n.defaultContainer=document.createElement("div"),n.opts=Object.assign({},{container:function(e,t){return n.defaultContainer}},e),n.elementIgnoredHandler=n.onElementIgnored.bind(m(n)),n.fieldAddedHandler=n.onFieldAdded.bind(m(n)),n.fieldRemovedHandler=n.onFieldRemoved.bind(m(n)),n.validatorValidatedHandler=n.onValidatorValidated.bind(m(n)),n.validatorNotValidatedHandler=n.onValidatorNotValidated.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.getFormElement().appendChild(this.defaultContainer),this.core.on("core.element.ignored",this.elementIgnoredHandler).on("core.field.added",this.fieldAddedHandler).on("core.field.removed",this.fieldRemovedHandler).on("core.validator.validated",this.validatorValidatedHandler).on("core.validator.notvalidated",this.validatorNotValidatedHandler)}},{key:"uninstall",value:function(){this.core.getFormElement().removeChild(this.defaultContainer),this.messages.forEach((function(e){return e.parentNode.removeChild(e)})),this.messages.clear(),this.core.off("core.element.ignored",this.elementIgnoredHandler).off("core.field.added",this.fieldAddedHandler).off("core.field.removed",this.fieldRemovedHandler).off("core.validator.validated",this.validatorValidatedHandler).off("core.validator.notvalidated",this.validatorNotValidatedHandler)}},{key:"onFieldAdded",value:function(e){var t=this,n=e.elements;n&&(n.forEach((function(e){var n=t.messages.get(e);n&&(n.parentNode.removeChild(n),t.messages.delete(e))})),this.prepareFieldContainer(e.field,n))}},{key:"onFieldRemoved",value:function(e){var t=this;if(e.elements.length&&e.field){var n=e.elements[0].getAttribute("type"),r;("radio"===n||"checkbox"===n?[e.elements[0]]:e.elements).forEach((function(e){if(t.messages.has(e)){var n=t.messages.get(e);n.parentNode.removeChild(n),t.messages.delete(e)}}))}}},{key:"prepareFieldContainer",value:function(e,t){var n=this;if(t.length){var r=t[0].getAttribute("type");"radio"===r||"checkbox"===r?this.prepareElementContainer(e,t[0],t):t.forEach((function(r){return n.prepareElementContainer(e,r,t)}))}}},{key:"prepareElementContainer",value:function(e,t,n){var r;switch(!0){case"string"==typeof this.opts.container:var a=this.opts.container;a="#"===a.charAt(0)?'[id="'.concat(a.substring(1),'"]'):a,r=this.core.getFormElement().querySelector(a);break;default:r=this.opts.container(e,t)}var l=document.createElement("div");r.appendChild(l),an(l,{"fv-plugins-message-container":!0}),this.core.emit("plugins.message.placed",{element:t,elements:n,field:e,messageElement:l}),this.messages.set(t,l)}},{key:"getMessage",value:function(e){return"string"==typeof e.message?e.message:e.message[this.core.getLocale()]}},{key:"onValidatorValidated",value:function(e){var t=e.elements,n=e.element.getAttribute("type"),r="radio"===n||"checkbox"===n?t[0]:e.element;if(this.messages.has(r)){var a=this.messages.get(r),l=a.querySelector('[data-field="'.concat(e.field,'"][data-validator="').concat(e.validator,'"]'));if(l||e.result.valid)l&&!e.result.valid?(l.innerHTML=this.getMessage(e.result),this.core.emit("plugins.message.displayed",{element:e.element,field:e.field,message:e.result.message,messageElement:l,meta:e.result.meta,validator:e.validator})):l&&e.result.valid&&a.removeChild(l);else{var i=document.createElement("div");i.innerHTML=this.getMessage(e.result),i.setAttribute("data-field",e.field),i.setAttribute("data-validator",e.validator),this.opts.clazz&&an(i,c({},this.opts.clazz,!0)),a.appendChild(i),this.core.emit("plugins.message.displayed",{element:e.element,field:e.field,message:e.result.message,messageElement:i,meta:e.result.meta,validator:e.validator})}}}},{key:"onValidatorNotValidated",value:function(e){var t=e.elements,n=e.element.getAttribute("type"),r="radio"===n||"checkbox"===n?t[0]:e.element;if(this.messages.has(r)){var a=this.messages.get(r),l=a.querySelector('[data-field="'.concat(e.field,'"][data-validator="').concat(e.validator,'"]'));l&&a.removeChild(l)}}},{key:"onElementIgnored",value:function(e){var t=e.elements,n=e.element.getAttribute("type"),r="radio"===n||"checkbox"===n?t[0]:e.element;if(this.messages.has(r)){var a=this.messages.get(r),l;[].slice.call(a.querySelectorAll('[data-field="'.concat(e.field,'"]'))).forEach((function(e){a.removeChild(e)}))}}}],[{key:"getClosestContainer",value:function(e,t,n){for(var r=e;r&&r!==t&&(r=r.parentElement,!n.test(r.className)););return r}}]),t}(zt),cn=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).results=new Map,n.containers=new Map,n.opts=Object.assign({},{defaultMessageContainer:!0,eleInvalidClass:"",eleValidClass:"",rowClasses:"",rowValidatingClass:""},e),n.elementIgnoredHandler=n.onElementIgnored.bind(m(n)),n.elementValidatingHandler=n.onElementValidating.bind(m(n)),n.elementValidatedHandler=n.onElementValidated.bind(m(n)),n.elementNotValidatedHandler=n.onElementNotValidated.bind(m(n)),n.iconPlacedHandler=n.onIconPlaced.bind(m(n)),n.fieldAddedHandler=n.onFieldAdded.bind(m(n)),n.fieldRemovedHandler=n.onFieldRemoved.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){var e,t=this;an(this.core.getFormElement(),(c(e={},this.opts.formClass,!0),c(e,"fv-plugins-framework",!0),e)),this.core.on("core.element.ignored",this.elementIgnoredHandler).on("core.element.validating",this.elementValidatingHandler).on("core.element.validated",this.elementValidatedHandler).on("core.element.notvalidated",this.elementNotValidatedHandler).on("plugins.icon.placed",this.iconPlacedHandler).on("core.field.added",this.fieldAddedHandler).on("core.field.removed",this.fieldRemovedHandler),this.opts.defaultMessageContainer&&this.core.registerPlugin("___frameworkMessage",new sn({clazz:this.opts.messageClass,container:function(e,n){var r,a=on(n,"string"==typeof t.opts.rowSelector?t.opts.rowSelector:t.opts.rowSelector(e,n));return sn.getClosestContainer(n,a,t.opts.rowPattern)}}))}},{key:"uninstall",value:function(){var e;this.results.clear(),this.containers.clear(),an(this.core.getFormElement(),(c(e={},this.opts.formClass,!1),c(e,"fv-plugins-framework",!1),e)),this.core.off("core.element.ignored",this.elementIgnoredHandler).off("core.element.validating",this.elementValidatingHandler).off("core.element.validated",this.elementValidatedHandler).off("core.element.notvalidated",this.elementNotValidatedHandler).off("plugins.icon.placed",this.iconPlacedHandler).off("core.field.added",this.fieldAddedHandler).off("core.field.removed",this.fieldRemovedHandler)}},{key:"onIconPlaced",value:function(e){}},{key:"onFieldAdded",value:function(e){var t=this,n=e.elements;n&&(n.forEach((function(e){var n=t.containers.get(e),r;n&&(an(n,(c(r={},t.opts.rowInvalidClass,!1),c(r,t.opts.rowValidatingClass,!1),c(r,t.opts.rowValidClass,!1),c(r,"fv-plugins-icon-container",!1),r)),t.containers.delete(e))})),this.prepareFieldContainer(e.field,n))}},{key:"onFieldRemoved",value:function(e){var t=this;e.elements.forEach((function(e){var n=t.containers.get(e),r;n&&an(n,(c(r={},t.opts.rowInvalidClass,!1),c(r,t.opts.rowValidatingClass,!1),c(r,t.opts.rowValidClass,!1),r))}))}},{key:"prepareFieldContainer",value:function(e,t){var n=this;if(t.length){var r=t[0].getAttribute("type");"radio"===r||"checkbox"===r?this.prepareElementContainer(e,t[0]):t.forEach((function(t){return n.prepareElementContainer(e,t)}))}}},{key:"prepareElementContainer",value:function(e,t){var n,r=on(t,"string"==typeof this.opts.rowSelector?this.opts.rowSelector:this.opts.rowSelector(e,t)),a;r!==t&&(an(r,(c(a={},this.opts.rowClasses,!0),c(a,"fv-plugins-icon-container",!0),a)),this.containers.set(t,r))}},{key:"onElementValidating",value:function(e){var t=e.elements,n=e.element.getAttribute("type"),r="radio"===n||"checkbox"===n?t[0]:e.element,a=this.containers.get(r),l;a&&an(a,(c(l={},this.opts.rowInvalidClass,!1),c(l,this.opts.rowValidatingClass,!0),c(l,this.opts.rowValidClass,!1),l))}},{key:"onElementNotValidated",value:function(e){this.removeClasses(e.element,e.elements)}},{key:"onElementIgnored",value:function(e){this.removeClasses(e.element,e.elements)}},{key:"removeClasses",value:function(e,t){var n,r=e.getAttribute("type"),a="radio"===r||"checkbox"===r?t[0]:e;an(a,(c(n={},this.opts.eleValidClass,!1),c(n,this.opts.eleInvalidClass,!1),n));var l=this.containers.get(a),i;l&&an(l,(c(i={},this.opts.rowInvalidClass,!1),c(i,this.opts.rowValidatingClass,!1),c(i,this.opts.rowValidClass,!1),i))}},{key:"onElementValidated",value:function(e){var t,n=this,r=e.elements,a=e.element.getAttribute("type"),l="radio"===a||"checkbox"===a?r[0]:e.element;an(l,(c(t={},this.opts.eleValidClass,e.valid),c(t,this.opts.eleInvalidClass,!e.valid),t));var i=this.containers.get(l);if(i)if(e.valid){this.results.delete(l);var s=!0,u;if(this.containers.forEach((function(e,t){e===i&&!1===n.results.get(t)&&(s=!1)})),s)an(i,(c(u={},this.opts.rowInvalidClass,!1),c(u,this.opts.rowValidatingClass,!1),c(u,this.opts.rowValidClass,!0),u))}else{var o;this.results.set(l,!1),an(i,(c(o={},this.opts.rowInvalidClass,!0),c(o,this.opts.rowValidatingClass,!1),c(o,this.opts.rowValidClass,!1),o))}}}]),t}(zt),un=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).icons=new Map,n.opts=Object.assign({},{invalid:"fv-plugins-icon--invalid",onPlaced:function(){},onSet:function(){},valid:"fv-plugins-icon--valid",validating:"fv-plugins-icon--validating"},e),n.elementValidatingHandler=n.onElementValidating.bind(m(n)),n.elementValidatedHandler=n.onElementValidated.bind(m(n)),n.elementNotValidatedHandler=n.onElementNotValidated.bind(m(n)),n.elementIgnoredHandler=n.onElementIgnored.bind(m(n)),n.fieldAddedHandler=n.onFieldAdded.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.on("core.element.validating",this.elementValidatingHandler).on("core.element.validated",this.elementValidatedHandler).on("core.element.notvalidated",this.elementNotValidatedHandler).on("core.element.ignored",this.elementIgnoredHandler).on("core.field.added",this.fieldAddedHandler)}},{key:"uninstall",value:function(){this.icons.forEach((function(e){return e.parentNode.removeChild(e)})),this.icons.clear(),this.core.off("core.element.validating",this.elementValidatingHandler).off("core.element.validated",this.elementValidatedHandler).off("core.element.notvalidated",this.elementNotValidatedHandler).off("core.element.ignored",this.elementIgnoredHandler).off("core.field.added",this.fieldAddedHandler)}},{key:"onFieldAdded",value:function(e){var t=this,n=e.elements;n&&(n.forEach((function(e){var n=t.icons.get(e);n&&(n.parentNode.removeChild(n),t.icons.delete(e))})),this.prepareFieldIcon(e.field,n))}},{key:"prepareFieldIcon",value:function(e,t){var n=this;if(t.length){var r=t[0].getAttribute("type");"radio"===r||"checkbox"===r?this.prepareElementIcon(e,t[0]):t.forEach((function(t){return n.prepareElementIcon(e,t)}))}}},{key:"prepareElementIcon",value:function(e,t){var n=document.createElement("i");n.setAttribute("data-field",e),t.parentNode.insertBefore(n,t.nextSibling),an(n,{"fv-plugins-icon":!0});var r={classes:{invalid:this.opts.invalid,valid:this.opts.valid,validating:this.opts.validating},element:t,field:e,iconElement:n};this.core.emit("plugins.icon.placed",r),this.opts.onPlaced(r),this.icons.set(t,n)}},{key:"onElementValidating",value:function(e){var t,n=this.setClasses(e.field,e.element,e.elements,(c(t={},this.opts.invalid,!1),c(t,this.opts.valid,!1),c(t,this.opts.validating,!0),t)),r={element:e.element,field:e.field,iconElement:n,status:"Validating"};this.core.emit("plugins.icon.set",r),this.opts.onSet(r)}},{key:"onElementValidated",value:function(e){var t,n=this.setClasses(e.field,e.element,e.elements,(c(t={},this.opts.invalid,!e.valid),c(t,this.opts.valid,e.valid),c(t,this.opts.validating,!1),t)),r={element:e.element,field:e.field,iconElement:n,status:e.valid?"Valid":"Invalid"};this.core.emit("plugins.icon.set",r),this.opts.onSet(r)}},{key:"onElementNotValidated",value:function(e){var t,n=this.setClasses(e.field,e.element,e.elements,(c(t={},this.opts.invalid,!1),c(t,this.opts.valid,!1),c(t,this.opts.validating,!1),t)),r={element:e.element,field:e.field,iconElement:n,status:"NotValidated"};this.core.emit("plugins.icon.set",r),this.opts.onSet(r)}},{key:"onElementIgnored",value:function(e){var t,n=this.setClasses(e.field,e.element,e.elements,(c(t={},this.opts.invalid,!1),c(t,this.opts.valid,!1),c(t,this.opts.validating,!1),t)),r={element:e.element,field:e.field,iconElement:n,status:"Ignored"};this.core.emit("plugins.icon.set",r),this.opts.onSet(r)}},{key:"setClasses",value:function(e,t,n,r){var a=t.getAttribute("type"),l="radio"===a||"checkbox"===a?n[0]:t;if(this.icons.has(l)){var i=this.icons.get(l);return an(i,r),i}return null}}]),t}(zt),dn=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).invalidFields=new Map,n.opts=Object.assign({},{enabled:!0},e),n.validatorHandler=n.onValidatorValidated.bind(m(n)),n.shouldValidateFilter=n.shouldValidate.bind(m(n)),n.fieldAddedHandler=n.onFieldAdded.bind(m(n)),n.elementNotValidatedHandler=n.onElementNotValidated.bind(m(n)),n.elementValidatingHandler=n.onElementValidating.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.on("core.validator.validated",this.validatorHandler).on("core.field.added",this.fieldAddedHandler).on("core.element.notvalidated",this.elementNotValidatedHandler).on("core.element.validating",this.elementValidatingHandler).registerFilter("field-should-validate",this.shouldValidateFilter)}},{key:"uninstall",value:function(){this.invalidFields.clear(),this.core.off("core.validator.validated",this.validatorHandler).off("core.field.added",this.fieldAddedHandler).off("core.element.notvalidated",this.elementNotValidatedHandler).off("core.element.validating",this.elementValidatingHandler).deregisterFilter("field-should-validate",this.shouldValidateFilter)}},{key:"shouldValidate",value:function(e,t,n,r){var a;return!((!0===this.opts.enabled||!0===this.opts.enabled[e])&&this.invalidFields.has(t)&&!!this.invalidFields.get(t).length&&-1===this.invalidFields.get(t).indexOf(r))}},{key:"onValidatorValidated",value:function(e){var t=this.invalidFields.has(e.element)?this.invalidFields.get(e.element):[],n=t.indexOf(e.validator);e.result.valid&&n>=0?t.splice(n,1):!e.result.valid&&-1===n&&t.push(e.validator),this.invalidFields.set(e.element,t)}},{key:"onFieldAdded",value:function(e){e.elements&&this.clearInvalidFields(e.elements)}},{key:"onElementNotValidated",value:function(e){this.clearInvalidFields(e.elements)}},{key:"onElementValidating",value:function(e){this.clearInvalidFields(e.elements)}},{key:"clearInvalidFields",value:function(e){var t=this;e.forEach((function(e){return t.invalidFields.delete(e)}))}}]),t}(zt),fn=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).isFormValid=!1,n.opts=Object.assign({},{aspNetButton:!1,selector:'[type="submit"]:not([formnovalidate])'},e),n.submitHandler=n.handleSubmitEvent.bind(m(n)),n.buttonClickHandler=n.handleClickEvent.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){var e=this;if(this.core.getFormElement()instanceof HTMLFormElement){var t=this.core.getFormElement();this.selectorButtons=[].slice.call(t.querySelectorAll(this.opts.selector)),this.submitButtons=[].slice.call(t.querySelectorAll('[type="submit"]')),t.setAttribute("novalidate","novalidate"),t.addEventListener("submit",this.submitHandler),this.hiddenClickedEle=document.createElement("input"),this.hiddenClickedEle.setAttribute("type","hidden"),t.appendChild(this.hiddenClickedEle),this.submitButtons.forEach((function(t){t.addEventListener("click",e.buttonClickHandler)}))}}},{key:"uninstall",value:function(){var e=this,t=this.core.getFormElement();t instanceof HTMLFormElement&&t.removeEventListener("submit",this.submitHandler),this.submitButtons.forEach((function(t){t.removeEventListener("click",e.buttonClickHandler)})),this.hiddenClickedEle.parentElement.removeChild(this.hiddenClickedEle)}},{key:"handleSubmitEvent",value:function(e){this.validateForm(e)}},{key:"handleClickEvent",value:function(e){var t=e.currentTarget;if(t instanceof HTMLElement&&-1!==this.selectorButtons.indexOf(t)&&(!this.opts.aspNetButton||!0!==this.isFormValid)){var n;this.core.getFormElement().removeEventListener("submit",this.submitHandler),this.clickedButton=e.target;var r=this.clickedButton.getAttribute("name"),a=this.clickedButton.getAttribute("value");r&&a&&(this.hiddenClickedEle.setAttribute("name",r),this.hiddenClickedEle.setAttribute("value",a)),this.validateForm(e)}}},{key:"validateForm",value:function(e){var t=this;e.preventDefault(),this.core.validate().then((function(e){"Valid"===e&&t.opts.aspNetButton&&!t.isFormValid&&t.clickedButton&&(t.isFormValid=!0,t.clickedButton.removeEventListener("click",t.buttonClickHandler),t.clickedButton.click())}))}}]),t}(zt),mn=function(e){function t(e){var n;return i(this,t),(n=g(this,d(t).call(this,e))).messages=new Map,n.opts=Object.assign({},{placement:"top",trigger:"click"},e),n.iconPlacedHandler=n.onIconPlaced.bind(m(n)),n.validatorValidatedHandler=n.onValidatorValidated.bind(m(n)),n.elementValidatedHandler=n.onElementValidated.bind(m(n)),n.documentClickHandler=n.onDocumentClicked.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.tip=document.createElement("div"),an(this.tip,c({"fv-plugins-tooltip":!0},"fv-plugins-tooltip--".concat(this.opts.placement),!0)),document.body.appendChild(this.tip),this.core.on("plugins.icon.placed",this.iconPlacedHandler).on("core.validator.validated",this.validatorValidatedHandler).on("core.element.validated",this.elementValidatedHandler),"click"===this.opts.trigger&&document.addEventListener("click",this.documentClickHandler)}},{key:"uninstall",value:function(){this.messages.clear(),document.body.removeChild(this.tip),this.core.off("plugins.icon.placed",this.iconPlacedHandler).off("core.validator.validated",this.validatorValidatedHandler).off("core.element.validated",this.elementValidatedHandler),"click"===this.opts.trigger&&document.removeEventListener("click",this.documentClickHandler)}},{key:"onIconPlaced",value:function(e){var t=this;switch(an(e.iconElement,{"fv-plugins-tooltip-icon":!0}),this.opts.trigger){case"hover":e.iconElement.addEventListener("mouseenter",(function(n){return t.show(e.element,n)})),e.iconElement.addEventListener("mouseleave",(function(e){return t.hide()}));break;case"click":default:e.iconElement.addEventListener("click",(function(n){return t.show(e.element,n)}))}}},{key:"onValidatorValidated",value:function(e){if(!e.result.valid){var t=e.elements,n=e.element.getAttribute("type"),r="radio"===n||"checkbox"===n?t[0]:e.element,a="string"==typeof e.result.message?e.result.message:e.result.message[this.core.getLocale()];this.messages.set(r,a)}}},{key:"onElementValidated",value:function(e){if(e.valid){var t=e.elements,n=e.element.getAttribute("type"),r="radio"===n||"checkbox"===n?t[0]:e.element;this.messages.delete(r)}}},{key:"onDocumentClicked",value:function(e){this.hide()}},{key:"show",value:function(e,t){if(t.preventDefault(),t.stopPropagation(),this.messages.has(e)){an(this.tip,{"fv-plugins-tooltip--hide":!1}),this.tip.innerHTML='<span class="fv-plugins-tooltip__content">'.concat(this.messages.get(e),"</span>");var n,r=t.target.getBoundingClientRect(),a=0,l=0,i,o;switch(this.opts.placement){case"top":default:a=r.top-r.height,l=r.left+r.width/2-this.tip.clientWidth/2;break;case"top-left":a=r.top-r.height,l=r.left;break;case"top-right":a=r.top-r.height,l=r.left+r.width-this.tip.clientWidth;break;case"bottom":a=r.top+r.height,l=r.left+r.width/2-this.tip.clientWidth/2;break;case"bottom-left":a=r.top+r.height,l=r.left;break;case"bottom-right":a=r.top+r.height,l=r.left+r.width-this.tip.clientWidth;break;case"left":a=r.top+r.height/2-this.tip.clientHeight/2,l=r.left-this.tip.clientWidth;break;case"right":a=r.top+r.height/2-this.tip.clientHeight/2,l=r.left+r.width}a+=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,l+=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,this.tip.setAttribute("style","top: ".concat(a,"px; left: ").concat(l,"px"))}}},{key:"hide",value:function(){an(this.tip,{"fv-plugins-tooltip--hide":!0})}}]),t}(zt),gn=function(e){function t(e){var n;i(this,t),(n=g(this,d(t).call(this,e))).handlers=[],n.timers=new Map,n.ieVersion=function(){for(var e=3,t=document.createElement("div"),n=t.all||[];t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><br><![endif]--\x3e",n[0];);return e>4?e:document.documentMode}();var r=document.createElement("div");return n.defaultEvent=9!==n.ieVersion&&"oninput"in r?"input":"keyup",n.opts=Object.assign({},{delay:0,event:n.defaultEvent,threshold:0},e),n.fieldAddedHandler=n.onFieldAdded.bind(m(n)),n.fieldRemovedHandler=n.onFieldRemoved.bind(m(n)),n}return u(t,e),s(t,[{key:"install",value:function(){this.core.on("core.field.added",this.fieldAddedHandler).on("core.field.removed",this.fieldRemovedHandler)}},{key:"uninstall",value:function(){this.handlers.forEach((function(e){return e.element.removeEventListener(e.event,e.handler)})),this.handlers=[],this.timers.forEach((function(e){return window.clearTimeout(e)})),this.timers.clear(),this.core.off("core.field.added",this.fieldAddedHandler).off("core.field.removed",this.fieldRemovedHandler)}},{key:"prepareHandler",value:function(e,t){var n=this;t.forEach((function(t){var r=[];switch(!0){case!!n.opts.event&&!1===n.opts.event[e]:r=[];break;case!!n.opts.event&&!!n.opts.event[e]:r=n.opts.event[e].split(" ");break;case"string"==typeof n.opts.event&&n.opts.event!==n.defaultEvent:r=n.opts.event.split(" ");break;default:var i=t.getAttribute("type"),l=t.tagName.toLowerCase(),a;r=["radio"===i||"checkbox"===i||"file"===i||"select"===l?"change":n.ieVersion>=10&&t.getAttribute("placeholder")?"keyup":n.defaultEvent]}r.forEach((function(r){var a=function(r){return n.handleEvent(r,e,t)};n.handlers.push({element:t,event:r,field:e,handler:a}),t.addEventListener(r,a)}))}))}},{key:"handleEvent",value:function(e,t,n){var r=this;if(this.exceedThreshold(t,n)&&this.core.executeFilter("plugins-trigger-should-validate",!0,[t,n])){var a=function(){return r.core.validateElement(t,n).then((function(a){r.core.emit("plugins.trigger.executed",{element:n,event:e,field:t})}))},l=this.opts.delay[t]||this.opts.delay;if(0===l)a();else{var i=this.timers.get(n);i&&window.clearTimeout(i),this.timers.set(n,window.setTimeout(a,1e3*l))}}}},{key:"onFieldAdded",value:function(e){this.handlers.filter((function(t){return t.field===e.field})).forEach((function(e){return e.element.removeEventListener(e.event,e.handler)})),this.prepareHandler(e.field,e.elements)}},{key:"onFieldRemoved",value:function(e){this.handlers.filter((function(t){return t.field===e.field&&e.elements.indexOf(t.element)>=0})).forEach((function(e){return e.element.removeEventListener(e.event,e.handler)}))}},{key:"exceedThreshold",value:function(e,t){var n=0!==this.opts.threshold[e]&&0!==this.opts.threshold&&(this.opts.threshold[e]||this.opts.threshold);if(!n)return!0;var r=t.getAttribute("type"),a;return-1!==["button","checkbox","file","hidden","image","radio","reset","submit"].indexOf(r)||this.core.getElementValue(e,t).length>=n}}]),t}(zt),pn={Alias:Xt,Aria:Qt,Declarative:qt,DefaultSubmit:$t,Dependency:jt,Excluded:en,FieldStatus:tn,Framework:cn,Icon:un,Message:sn,Sequence:dn,SubmitButton:fn,Tooltip:mn,Trigger:gn};function hn(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )".concat(t,"( |$)"),"gi").test(e.className)}var vn={call:C,classSet:an,closest:on,fetch:D,format:A,hasClass:hn,isValidDate:F},An={};e.Plugin=zt,e.algorithms=l,e.filters=_t,e.formValidation=Wt,e.locales=An,e.plugins=pn,e.utils=vn,e.validators=Yt,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):((e=e||self).FormValidation=e.FormValidation||{},e.FormValidation.plugins=e.FormValidation.plugins||{},e.FormValidation.plugins.Bootstrap=n())}(this,(function(){"use strict";function e(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function n(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}function i(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&r(e,n)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,n){return(r=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,n){return!n||"object"!=typeof n&&"function"!=typeof n?l(e):n}var u=FormValidation.utils.classSet,a=FormValidation.utils.hasClass,s,p;return function(n){function r(n){return e(this,r),c(this,o(r).call(this,Object.assign({},{eleInvalidClass:"is-invalid",eleValidClass:"is-valid",formClass:"fv-plugins-bootstrap",messageClass:"fv-help-block",rowInvalidClass:"has-danger",rowPattern:/^(.*)(col|offset)(-(sm|md|lg|xl))*-[0-9]+(.*)$/,rowSelector:".form-group",rowValidClass:"has-success"},n)))}return i(r,n),t(r,[{key:"onIconPlaced",value:function(e){var n=e.element.parentElement;a(n,"input-group")&&n.parentElement.insertBefore(e.iconElement,n.nextSibling);var t=e.element.getAttribute("type");if("checkbox"===t||"radio"===t){var i=n.parentElement;a(n,"form-check")?(u(e.iconElement,{"fv-plugins-icon-check":!0}),n.parentElement.insertBefore(e.iconElement,n.nextSibling)):a(n.parentElement,"form-check")&&(u(e.iconElement,{"fv-plugins-icon-check":!0}),i.parentElement.insertBefore(e.iconElement,i.nextSibling))}}}]),r}(FormValidation.plugins.Framework)}))
|
||
/*!
|
||
* jQuery blockUI plugin
|
||
* Version 2.70.0-2014.11.23
|
||
* Requires jQuery v1.7 or later
|
||
*
|
||
* Examples at: http://malsup.com/jquery/block/
|
||
* Copyright (c) 2007-2013 M. Alsup
|
||
* Dual licensed under the MIT and GPL licenses:
|
||
* http://www.opensource.org/licenses/mit-license.php
|
||
* http://www.gnu.org/licenses/gpl.html
|
||
*
|
||
* Thanks to Amir-Hossein Sobhi for some excellent contributions!
|
||
*/,function(){"use strict";function setup($){$.fn._fadeIn=$.fn.fadeIn;var noOp=$.noop||function(){},msie=/MSIE/.test(navigator.userAgent),ie6=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),mode=document.documentMode||0,setExpr=$.isFunction(document.createElement("div").style.setExpression);$.blockUI=function(opts){install(window,opts)},$.unblockUI=function(opts){remove(window,opts)},$.growlUI=function(title,message,timeout,onClose){var $m=$('<div class="growlUI"></div>');title&&$m.append("<h1>"+title+"</h1>"),message&&$m.append("<h2>"+message+"</h2>"),void 0===timeout&&(timeout=3e3);var callBlock=function(opts){opts=opts||{},$.blockUI({message:$m,fadeIn:void 0!==opts.fadeIn?opts.fadeIn:700,fadeOut:void 0!==opts.fadeOut?opts.fadeOut:1e3,timeout:void 0!==opts.timeout?opts.timeout:timeout,centerY:!1,showOverlay:!1,onUnblock:onClose,css:$.blockUI.defaults.growlCSS})};callBlock();var nonmousedOpacity=$m.css("opacity");$m.mouseover((function(){callBlock({fadeIn:0,timeout:3e4});var displayBlock=$(".blockMsg");displayBlock.stop(),displayBlock.fadeTo(300,1)})).mouseout((function(){$(".blockMsg").fadeOut(1e3)}))},$.fn.block=function(opts){if(this[0]===window)return $.blockUI(opts),this;var fullOpts=$.extend({},$.blockUI.defaults,opts||{});return this.each((function(){var $el=$(this);fullOpts.ignoreIfBlocked&&$el.data("blockUI.isBlocked")||$el.unblock({fadeOut:0})})),this.each((function(){"static"==$.css(this,"position")&&(this.style.position="relative",$(this).data("blockUI.static",!0)),this.style.zoom=1,install(this,opts)}))},$.fn.unblock=function(opts){return this[0]===window?($.unblockUI(opts),this):this.each((function(){remove(this,opts)}))},$.blockUI.version=2.7,$.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var pageBlock=null,pageBlockEls=[];function install(el,opts){var css,themedCSS,full=el==window,msg=opts&&void 0!==opts.message?opts.message:void 0;if(!(opts=$.extend({},$.blockUI.defaults,opts||{})).ignoreIfBlocked||!$(el).data("blockUI.isBlocked")){if(opts.overlayCSS=$.extend({},$.blockUI.defaults.overlayCSS,opts.overlayCSS||{}),css=$.extend({},$.blockUI.defaults.css,opts.css||{}),opts.onOverlayClick&&(opts.overlayCSS.cursor="pointer"),themedCSS=$.extend({},$.blockUI.defaults.themedCSS,opts.themedCSS||{}),msg=void 0===msg?opts.message:msg,full&&pageBlock&&remove(window,{fadeOut:0}),msg&&"string"!=typeof msg&&(msg.parentNode||msg.jquery)){var node=msg.jquery?msg[0]:msg,data={};$(el).data("blockUI.history",data),data.el=node,data.parent=node.parentNode,data.display=node.style.display,data.position=node.style.position,data.parent&&data.parent.removeChild(node)}$(el).data("blockUI.onUnblock",opts.onUnblock);var z=opts.baseZ,lyr1,lyr2,lyr3,s;lyr1=msie||opts.forceIframe?$('<iframe class="blockUI" style="z-index:'+z+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>'):$('<div class="blockUI" style="display:none"></div>'),lyr2=opts.theme?$('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+z+++';display:none"></div>'):$('<div class="blockUI blockOverlay" style="z-index:'+z+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),opts.theme&&full?(s='<div class="blockUI '+opts.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">',opts.title&&(s+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title||" ")+"</div>"),s+='<div class="ui-widget-content ui-dialog-content"></div>',s+="</div>"):opts.theme?(s='<div class="blockUI '+opts.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">',opts.title&&(s+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title||" ")+"</div>"),s+='<div class="ui-widget-content ui-dialog-content"></div>',s+="</div>"):s=full?'<div class="blockUI '+opts.blockMsgClass+' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+opts.blockMsgClass+' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>',lyr3=$(s),msg&&(opts.theme?(lyr3.css(themedCSS),lyr3.addClass("ui-widget-content")):lyr3.css(css)),opts.theme||lyr2.css(opts.overlayCSS),lyr2.css("position",full?"fixed":"absolute"),(msie||opts.forceIframe)&&lyr1.css("opacity",0);var layers=[lyr1,lyr2,lyr3],$par=$(full?"body":el);$.each(layers,(function(){this.appendTo($par)})),opts.theme&&opts.draggable&&$.fn.draggable&&lyr3.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var expr=setExpr&&(!$.support.boxModel||$("object,embed",full?null:el).length>0);if(ie6||expr){if(full&&opts.allowBodyStretch&&$.support.boxModel&&$("html,body").css("height","100%"),(ie6||!$.support.boxModel)&&!full)var t=sz(el,"borderTopWidth"),l=sz(el,"borderLeftWidth"),fixT=t?"(0 - "+t+")":0,fixL=l?"(0 - "+l+")":0;$.each(layers,(function(i,o){var s=o[0].style;if(s.position="absolute",i<2)full?s.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+opts.quirksmodeOffsetHack+') + "px"'):s.setExpression("height",'this.parentNode.offsetHeight + "px"'),full?s.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):s.setExpression("width",'this.parentNode.offsetWidth + "px"'),fixL&&s.setExpression("left",fixL),fixT&&s.setExpression("top",fixT);else if(opts.centerY)full&&s.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),s.marginTop=0;else if(!opts.centerY&&full){var top,expression="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(opts.css&&opts.css.top?parseInt(opts.css.top,10):0)+') + "px"';s.setExpression("top",expression)}}))}if(msg&&(opts.theme?lyr3.find(".ui-widget-content").append(msg):lyr3.append(msg),(msg.jquery||msg.nodeType)&&$(msg).show()),(msie||opts.forceIframe)&&opts.showOverlay&&lyr1.show(),opts.fadeIn){var cb=opts.onBlock?opts.onBlock:noOp,cb1=opts.showOverlay&&!msg?cb:noOp,cb2=msg?cb:noOp;opts.showOverlay&&lyr2._fadeIn(opts.fadeIn,cb1),msg&&lyr3._fadeIn(opts.fadeIn,cb2)}else opts.showOverlay&&lyr2.show(),msg&&lyr3.show(),opts.onBlock&&opts.onBlock.bind(lyr3)();if(bind(1,el,opts),full?(pageBlock=lyr3[0],pageBlockEls=$(opts.focusableElements,pageBlock),opts.focusInput&&setTimeout(focus,20)):center(lyr3[0],opts.centerX,opts.centerY),opts.timeout){var to=setTimeout((function(){full?$.unblockUI(opts):$(el).unblock(opts)}),opts.timeout);$(el).data("blockUI.timeout",to)}}}function remove(el,opts){var count,full=el==window,$el=$(el),data=$el.data("blockUI.history"),to=$el.data("blockUI.timeout"),els;to&&(clearTimeout(to),$el.removeData("blockUI.timeout")),opts=$.extend({},$.blockUI.defaults,opts||{}),bind(0,el,opts),null===opts.onUnblock&&(opts.onUnblock=$el.data("blockUI.onUnblock"),$el.removeData("blockUI.onUnblock")),els=full?$("body").children().filter(".blockUI").add("body > .blockUI"):$el.find(">.blockUI"),opts.cursorReset&&(els.length>1&&(els[1].style.cursor=opts.cursorReset),els.length>2&&(els[2].style.cursor=opts.cursorReset)),full&&(pageBlock=pageBlockEls=null),opts.fadeOut?(count=els.length,els.stop().fadeOut(opts.fadeOut,(function(){0==--count&&reset(els,data,opts,el)}))):reset(els,data,opts,el)}function reset(els,data,opts,el){var $el=$(el);if(!$el.data("blockUI.isBlocked")){els.each((function(i,o){this.parentNode&&this.parentNode.removeChild(this)})),data&&data.el&&(data.el.style.display=data.display,data.el.style.position=data.position,data.el.style.cursor="default",data.parent&&data.parent.appendChild(data.el),$el.removeData("blockUI.history")),$el.data("blockUI.static")&&$el.css("position","static"),"function"==typeof opts.onUnblock&&opts.onUnblock(el,opts);var body=$(document.body),w=body.width(),cssW=body[0].style.width;body.width(w-1).width(w),body[0].style.width=cssW}}function bind(b,el,opts){var full=el==window,$el=$(el);if((b||(!full||pageBlock)&&(full||$el.data("blockUI.isBlocked")))&&($el.data("blockUI.isBlocked",b),full&&opts.bindEvents&&(!b||opts.showOverlay))){var events="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";b?$(document).bind(events,opts,handler):$(document).unbind(events,handler)}}function handler(e){if("keydown"===e.type&&e.keyCode&&9==e.keyCode&&pageBlock&&e.data.constrainTabKey){var els=pageBlockEls,fwd=!e.shiftKey&&e.target===els[els.length-1],back=e.shiftKey&&e.target===els[0];if(fwd||back)return setTimeout((function(){focus(back)}),10),!1}var opts=e.data,target=$(e.target);return target.hasClass("blockOverlay")&&opts.onOverlayClick&&opts.onOverlayClick(e),target.parents("div."+opts.blockMsgClass).length>0||0===target.parents().children().filter("div.blockUI").length}function focus(back){if(pageBlockEls){var e=pageBlockEls[!0===back?pageBlockEls.length-1:0];e&&e.focus()}}function center(el,x,y){var p=el.parentNode,s=el.style,l=(p.offsetWidth-el.offsetWidth)/2-sz(p,"borderLeftWidth"),t=(p.offsetHeight-el.offsetHeight)/2-sz(p,"borderTopWidth");x&&(s.left=l>0?l+"px":"0"),y&&(s.top=t>0?t+"px":"0")}function sz(el,p){return parseInt($.css(el,p),10)||0}}"function"==typeof define&&define.amd?define(["jquery"],setup):"object"==typeof exports?setup(require("jquery")):setup(jQuery)}(),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}((function(a,b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function d(){var a=new Date;return c(a.getFullYear(),a.getMonth(),a.getDate())}function e(a,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function f(c,d){return function(){return d!==b&&a.fn.datepicker.deprecated(d),this[c].apply(this,arguments)}}function g(a){return a&&!isNaN(a.getTime())}function h(b,c){function d(a,b){return b.toLowerCase()}var e,f=a(b).data(),g={},h=new RegExp("^"+c.toLowerCase()+"([A-Z])");for(var i in c=new RegExp("^"+c.toLowerCase()),f)c.test(i)&&(g[e=i.replace(h,d)]=f[i]);return g}function i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,(function(a,b){b in d&&(c[b]=d[b])})),c}}var j=function(){var b={get:function(a){return this.slice(a)[0]},contains:function(a){for(var b=a&&a.valueOf(),c=0,d=this.length;c<d;c++)if(0<=this[c].valueOf()-b&&this[c].valueOf()-b<864e5)return c;return-1},remove:function(a){this.splice(a,1)},replace:function(b){b&&(a.isArray(b)||(b=[b]),this.clear(),this.push.apply(this,b))},clear:function(){this.length=0},copy:function(){var a=new j;return a.replace(this),a}};return function(){var c=[];return c.push.apply(c,arguments),a.extend(c,b),c}}(),k=function(b,c){a.data(b,"datepicker",this),this._events=[],this._secondaryEvents=[],this._process_options(c),this.dates=new j,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=a(b),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn"),this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=a(r.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",(function(a,b){return Number(b)+1})),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};k.prototype={constructor:k,_resolveViewName:function(b){return a.each(r.viewModes,(function(c,d){if(b===c||-1!==a.inArray(b,d.names))return b=c,!1})),b},_resolveDaysOfWeek:function(b){return a.isArray(b)||(b=b.split(/[,\s]*/)),a.map(b,Number)},_check_template:function(c){try{return c!==b&&""!==c&&((c.match(/[<>]/g)||[]).length<=0||a(c).length>0)}catch(a){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView),e.minViewMode=this._resolveViewName(e.minViewMode),e.maxViewMode=this._resolveViewName(e.maxViewMode),e.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,e.startView)),!0!==e.multidate&&(e.multidate=Number(e.multidate)||!1,!1!==e.multidate&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-1/0&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-1/0),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=this._resolveDaysOfWeek(e.daysOfWeekDisabled||[]),e.daysOfWeekHighlighted=this._resolveDaysOfWeek(e.daysOfWeekHighlighted||[]),e.datesDisabled=e.datesDisabled||[],a.isArray(e.datesDisabled)||(e.datesDisabled=e.datesDisabled.split(",")),e.datesDisabled=a.map(e.datesDisabled,(function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)}));var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,(function(a){return/^auto|left|right|top|bottom$/.test(a)})),e.orientation={x:"auto",y:"auto"},i&&"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,(function(a){return/^left|right$/.test(a)})),e.orientation.x=i[0]||"auto",i=a.grep(h,(function(a){return/^top|bottom$/.test(a)})),e.orientation.y=i[0]||"auto";if(e.defaultViewDate instanceof Date||"string"==typeof e.defaultViewDate)e.defaultViewDate=r.parseDate(e.defaultViewDate,g,e.language,e.assumeNearbyYear);else if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_applyEvents:function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(d=b,e=a[f][1]):3===a[f].length&&(d=a[f][1],e=a[f][2]),c.on(e,d)},_unapplyEvents:function(a){for(var c,d,e,f=0;f<a.length;f++)c=a[f][0],2===a[f].length?(e=b,d=a[f][1]):3===a[f].length&&(e=a[f][1],d=a[f][2]),c.off(d,e)},_buildEvents:function(){var b={keyup:a.proxy((function(b){-1===a.inArray(b.keyCode,[27,37,39,38,40,32,13,9])&&this.update()}),this),keydown:a.proxy(this.keydown,this),paste:a.proxy(this.paste,this)};!0===this.o.showOnFocus&&(b.focus=a.proxy(this.show,this)),this.isInput?this._events=[[this.element,b]]:this.component&&this.inputField.length?this._events=[[this.inputField,b],[this.component,{click:a.proxy(this.show,this)}]]:this._events=[[this.element,{click:a.proxy(this.show,this),keydown:a.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:a.proxy((function(a){this._focused_from=a.target}),this)}],[this.element,{blur:a.proxy((function(a){this._focused_from=a.target}),this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":a.proxy((function(a){this.update(a.date)}),this)}]),this._secondaryEvents=[[this.picker,{click:a.proxy(this.click,this)}],[this.picker,".prev, .next",{click:a.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:a.proxy(this.dayCellClick,this)}],[a(window),{resize:a.proxy(this.place,this)}],[a(document),{"mousedown touchstart":a.proxy((function(a){this.element.is(a.target)||this.element.find(a.target).length||this.picker.is(a.target)||this.picker.find(a.target).length||this.isInline||this.hide()}),this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(b,c){var d=c||this.dates.get(-1),e=this._utc_to_local(d);this.element.trigger({type:b,date:e,viewMode:this.viewMode,dates:a.map(this.dates,this._utc_to_local),format:a.proxy((function(a,b){0===arguments.length?(a=this.dates.length-1,b=this.o.format):"string"==typeof a&&(b=a,a=this.dates.length-1),b=b||this.o.format;var c=this.dates.get(a);return r.formatDate(c,b,this.o.language)}),this)})},show:function(){if(!(this.inputField.is(":disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&a(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(b){var c;if(b.originalEvent.clipboardData&&b.originalEvent.clipboardData.types&&-1!==a.inArray("text/plain",b.originalEvent.clipboardData.types))c=b.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;c=window.clipboardData.getData("Text")}this.setDate(c),this.update(),b.preventDefault()},_utc_to_local:function(a){if(!a)return a;var b=new Date(a.getTime()+6e4*a.getTimezoneOffset());return b.getTimezoneOffset()!==a.getTimezoneOffset()&&(b=new Date(a.getTime()+6e4*b.getTimezoneOffset())),b},_local_to_utc:function(a){return a&&new Date(a.getTime()-6e4*a.getTimezoneOffset())},_zero_time:function(a){return a&&new Date(a.getFullYear(),a.getMonth(),a.getDate())},_zero_utc_time:function(a){return a&&c(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())},getDates:function(){return a.map(this.dates,this._utc_to_local)},getUTCDates:function(){return a.map(this.dates,(function(a){return new Date(a)}))},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var a=this.dates.get(-1);return a!==b?new Date(a):null},clearDates:function(){this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,b),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var b=a.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,a.map(b,this._utc_to_local)),this},setDate:f("setDates"),setUTCDate:f("setUTCDates"),remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var a=this.getFormattedDate();return this.inputField.val(a),this},getFormattedDate:function(c){c===b&&(c=this.o.format);var d=this.o.language;return a.map(this.dates,(function(a){return r.formatDate(a,c,d)})).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(a){return this._process_options({startDate:a}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(a){return this._process_options({endDate:a}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(a){return this._process_options({daysOfWeekDisabled:a}),this.update(),this},setDaysOfWeekHighlighted:function(a){return this._process_options({daysOfWeekHighlighted:a}),this.update(),this},setDatesDisabled:function(a){return this._process_options({datesDisabled:a}),this.update(),this},place:function(){if(this.isInline)return this;var b=this.picker.outerWidth(),c=this.picker.outerHeight(),d=a(this.o.container),e=d.width(),f="body"===this.o.container?a(document).scrollTop():d.scrollTop(),g=d.offset(),h=[0];this.element.parents().each((function(){var b=a(this).css("z-index");"auto"!==b&&0!==Number(b)&&h.push(Number(b))}));var i=Math.max.apply(Math,h)+this.o.zIndexOffset,j=this.component?this.component.parent().offset():this.element.offset(),k=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),l=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),m=j.left-g.left,n=j.top-g.top;"body"!==this.o.container&&(n+=f),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(m-=b-l)):j.left<0?(this.picker.addClass("datepicker-orient-left"),m-=j.left-10):m+b>e?(this.picker.addClass("datepicker-orient-right"),m+=l-b):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var o,p=this.o.orientation.y;if("auto"===p&&(p=(o=-f+n-c)<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+p),"top"===p?n-=c+parseInt(this.picker.css("padding-top")):n+=k,this.o.rtl){var q=e-(m+l);this.picker.css({top:n,right:q,zIndex:i})}else this.picker.css({top:n,left:m,zIndex:i});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return arguments.length?(a.each(arguments,a.proxy((function(a,b){b instanceof Date&&(b=this._local_to_utc(b)),c.push(b)}),this)),d=!0):(c=(c=this.isInput?this.element.val():this.element.data("date")||this.inputField.val())&&this.o.multidate?c.split(this.o.multidateSeparator):[c],delete this.element.data().date),c=a.map(c,a.proxy((function(a){return r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)}),this)),c=a.grep(c,a.proxy((function(a){return!this.dateWithinRange(a)||!a}),this),!0),this.dates.replace(c),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),d?(this.setValue(),this.element.change()):this.dates.length&&String(b)!==String(this.dates)&&d&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&b.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var b=this.o.weekStart,c="<tr>";for(this.o.calendarWeeks&&(c+='<th class="cw"> </th>');b<this.o.weekStart+7;)c+='<th class="dow',-1!==a.inArray(b,this.o.daysOfWeekDisabled)&&(c+=" disabled"),c+='">'+q[this.o.language].daysMin[b++%7]+"</th>";c+="</tr>",this.picker.find(".datepicker-days thead").append(c)}},fillMonths:function(){for(var a,b=this._utc_to_local(this.viewDate),c="",d=0;d<12;d++)c+='<span class="month'+(a=b&&b.getMonth()===d?" focused":"")+'">'+q[this.o.language].monthsShort[d]+"</span>";this.picker.find(".datepicker-months td").html(c)},setRange:function(b){b&&b.length?this.range=a.map(b,(function(a){return a.valueOf()})):delete this.range,this.fill()},getClassNames:function(b){var c=[],f=this.viewDate.getUTCFullYear(),g=this.viewDate.getUTCMonth(),h=d();return b.getUTCFullYear()<f||b.getUTCFullYear()===f&&b.getUTCMonth()<g?c.push("old"):(b.getUTCFullYear()>f||b.getUTCFullYear()===f&&b.getUTCMonth()>g)&&c.push("new"),this.focusDate&&b.valueOf()===this.focusDate.valueOf()&&c.push("focused"),this.o.todayHighlight&&e(b,h)&&c.push("today"),-1!==this.dates.contains(b)&&c.push("active"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&&c.push("disabled","disabled-date"),-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)&&c.push("highlighted"),this.range&&(b>this.range[0]&&b<this.range[this.range.length-1]&&c.push("range"),-1!==a.inArray(b.valueOf(),this.range)&&c.push("selected"),b.valueOf()===this.range[0]&&c.push("range-start"),b.valueOf()===this.range[this.range.length-1]&&c.push("range-end")),c},_fill_yearsView:function(c,d,e,f,g,h,i){for(var j,k,l,m="",n=e/10,o=this.picker.find(c),p=Math.floor(f/e)*e,q=p+9*n,r=Math.floor(this.viewDate.getFullYear()/n)*n,s=a.map(this.dates,(function(a){return Math.floor(a.getUTCFullYear()/n)*n})),t=p-n;t<=q+n;t+=n)j=[d],k=null,t===p-n?j.push("old"):t===q+n&&j.push("new"),-1!==a.inArray(t,s)&&j.push("active"),(t<g||t>h)&&j.push("disabled"),t===r&&j.push("focused"),i!==a.noop&&((l=i(new Date(t,0,1)))===b?l={}:"boolean"==typeof l?l={enabled:l}:"string"==typeof l&&(l={classes:l}),!1===l.enabled&&j.push("disabled"),l.classes&&(j=j.concat(l.classes.split(/\s+/))),l.tooltip&&(k=l.tooltip)),m+='<span class="'+j.join(" ")+'"'+(k?' title="'+k+'"':"")+">"+t+"</span>";o.find(".datepicker-switch").text(p+"-"+q),o.find("td").html(m)},fill:function(){var e,f,g=new Date(this.viewDate),h=g.getUTCFullYear(),i=g.getUTCMonth(),j=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,k=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,m=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,n=q[this.o.language].today||q.en.today||"",o=q[this.o.language].clear||q.en.clear||"",p=q[this.o.language].titleFormat||q.en.titleFormat,s=d(),t=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&s>=this.o.startDate&&s<=this.o.endDate&&!this.weekOfDateIsDisabled(s);if(!isNaN(h)&&!isNaN(i)){this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(g,p,this.o.language)),this.picker.find("tfoot .today").text(n).css("display",t?"table-cell":"none"),this.picker.find("tfoot .clear").text(o).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var u=c(h,i,0),v=u.getUTCDate();u.setUTCDate(v-(u.getUTCDay()-this.o.weekStart+7)%7);var w=new Date(u);u.getUTCFullYear()<100&&w.setUTCFullYear(u.getUTCFullYear()),w.setUTCDate(w.getUTCDate()+42),w=w.valueOf();for(var x,y,z=[];u.valueOf()<w;){if((x=u.getUTCDay())===this.o.weekStart&&(z.push("<tr>"),this.o.calendarWeeks)){var A=new Date(+u+(this.o.weekStart-x-7)%7*864e5),B=new Date(Number(A)+(11-A.getUTCDay())%7*864e5),C=new Date(Number(C=c(B.getUTCFullYear(),0,1))+(11-C.getUTCDay())%7*864e5),D=(B-C)/864e5/7+1;z.push('<td class="cw">'+D+"</td>")}(y=this.getClassNames(u)).push("day");var E=u.getUTCDate();this.o.beforeShowDay!==a.noop&&((f=this.o.beforeShowDay(this._utc_to_local(u)))===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1===f.enabled&&y.push("disabled"),f.classes&&(y=y.concat(f.classes.split(/\s+/))),f.tooltip&&(e=f.tooltip),f.content&&(E=f.content)),y=a.isFunction(a.uniqueSort)?a.uniqueSort(y):a.unique(y),z.push('<td class="'+y.join(" ")+'"'+(e?' title="'+e+'"':"")+' data-date="'+u.getTime().toString()+'">'+E+"</td>"),e=null,x===this.o.weekEnd&&z.push("</tr>"),u.setUTCDate(u.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(z.join(""));var F=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",G=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?F:h).end().find("tbody span").removeClass("active");if(a.each(this.dates,(function(a,b){b.getUTCFullYear()===h&&G.eq(b.getUTCMonth()).addClass("active")})),(h<j||h>l)&&G.addClass("disabled"),h===j&&G.slice(0,k).addClass("disabled"),h===l&&G.slice(m+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var H=this;a.each(G,(function(c,d){var e=new Date(h,c,1),f=H.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1!==f.enabled||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&&a(d).addClass(f.classes),f.tooltip&&a(d).prop("title",f.tooltip)}))}this._fill_yearsView(".datepicker-years","year",10,h,j,l,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,h,j,l,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,h,j,l,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a,b,c=new Date(this.viewDate),d=c.getUTCFullYear(),e=c.getUTCMonth(),f=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,g=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,h=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,i=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,j=1;switch(this.viewMode){case 4:j*=10;case 3:j*=10;case 2:j*=10;case 1:a=Math.floor(d/j)*j<=f,b=Math.floor(d/j)*j+j>h;break;case 0:a=d<=f&&e<=g,b=d>=h&&e>=i}this.picker.find(".prev").toggleClass("disabled",a),this.picker.find(".next").toggleClass("disabled",b)}},click:function(b){var e,f,g,h;b.preventDefault(),b.stopPropagation(),(e=a(b.target)).hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),e.hasClass("today")&&!e.hasClass("day")&&(this.setViewMode(0),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("month")||e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),f=1,1===this.viewMode?(h=e.parent().find("span").index(e),g=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(h)):(h=0,g=Number(e.text()),this.viewDate.setUTCFullYear(g)),this._trigger(r.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(c(g,h,1)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(b){var c,d=a(b.currentTarget).data("date"),e=new Date(d);this.o.updateViewDate&&(e.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),e.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(e)},navArrowsClick:function(b){var c,d=a(b.currentTarget).hasClass("prev")?-1:1;0!==this.viewMode&&(d*=12*r.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,d),this._trigger(r.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(a){var b=this.dates.contains(a);if(a||this.dates.clear(),-1!==b?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(b):!1===this.o.multidate?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(a,b){b&&"date"!==b||this._toggle_multidate(a&&new Date(a)),(!b&&this.o.updateViewDate||"view"===b)&&(this.viewDate=a&&new Date(a)),this.fill(),this.setValue(),b&&"view"===b||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||b&&"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b>0?1:-1,1===i)d=-1===b?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),c=(c+12)%12;else{for(var j=0;j<i;j++)e=this.moveMonth(e,b);c=e.getUTCMonth(),e.setUTCDate(f),d=function(){return c!==e.getUTCMonth()}}for(;d();)e.setUTCDate(--f),e.setUTCMonth(c);return e},moveYear:function(a,b){return this.moveMonth(a,12*b)},moveAvailableDate:function(a,b,c){do{if(a=this[c](a,b),!this.dateWithinRange(a))return!1;c="moveDay"}while(this.dateIsDisabled(a));return a},weekOfDateIsDisabled:function(b){return-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(b){return this.weekOfDateIsDisabled(b)||a.grep(this.o.datesDisabled,(function(a){return e(b,a)})).length>0},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(this.picker.is(":visible")){var b,c,d=!1,e=this.focusDate||this.viewDate;switch(a.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),a.preventDefault(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"))&&this._trigger("changeYear",this.viewDate):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&&(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveYear")),c&&(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),a.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))}else 40!==a.keyCode&&27!==a.keyCode||(this.show(),a.stopPropagation())},setViewMode:function(a){this.viewMode=a,this.picker.children("div").hide().filter(".datepicker-"+r.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var l=function(b,c){a.data(b,"datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,(function(a){return a.jquery?a[0]:a})),delete c.inputs,this.keepEmptyValues=c.keepEmptyValues,delete c.keepEmptyValues,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,(function(b){return a.data(b,"datepicker")})),this.updateDates()};l.prototype={updateDates:function(){this.dates=a.map(this.pickers,(function(a){return a.getUTCDate()})),this.updateRanges()},updateRanges:function(){var b=a.map(this.dates,(function(a){return a.valueOf()}));a.each(this.pickers,(function(a,c){c.setRange(b)}))},clearDates:function(){a.each(this.pickers,(function(a,b){b.clearDates()}))},dateUpdated:function(c){if(!this.updating){this.updating=!0;var d=a.data(c.target,"datepicker");if(d!==b){var e=d.getUTCDate(),f=this.keepEmptyValues,g=a.inArray(c.target,this.inputs),h=g-1,i=g+1,j=this.inputs.length;if(-1!==g){if(a.each(this.pickers,(function(a,b){b.getUTCDate()||b!==d&&f||b.setUTCDate(e)})),e<this.dates[h])for(;h>=0&&e<this.dates[h];)this.pickers[h--].setUTCDate(e);else if(e>this.dates[i])for(;i<j&&e>this.dates[i];)this.pickers[i++].setUTCDate(e);this.updateDates(),delete this.updating}}}},destroy:function(){a.map(this.pickers,(function(a){a.destroy()})),a(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments),e;if(d.shift(),this.each((function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&&c;if(!f){var j=h(this,"date"),m,n=i(a.extend({},o,j,g).language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&&"function"==typeof f[c]&&(e=f[c].apply(f,d))})),e===b||e instanceof k||e instanceof l)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"«",rightArrow:"»"},showWeekDays:!0},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},r={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&&"function"==typeof a.toDisplay)return a;var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,e,f,g){function h(a,b){return!0===b&&(b=10),a<100&&(a+=2e3)>(new Date).getFullYear()+b&&(a-=100),a}function i(){var a=this.slice(0,j[n].length),b=j[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!c)return b;if(c instanceof Date)return c;if("string"==typeof e&&(e=r.parseFormat(e)),e.toValue)return e.toValue(c,e,f);var j,l,m,n,o,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},s={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(c in s&&(c=s[c]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(c)){for(j=c.match(/([\-+]\d+)([dmwy])/gi),c=new Date,n=0;n<j.length;n++)l=j[n].match(/([\-+]\d+)([dmwy])/i),m=Number(l[1]),o=p[l[2].toLowerCase()],c=k.prototype[o](c,m);return k.prototype._zero_utc_time(c)}j=c&&c.match(this.nonpunctuation)||[];var t,u,v={},w=["yyyy","yy","M","MM","m","mm","d","dd"],x={yyyy:function(a,b){return a.setUTCFullYear(g?h(b,g):b)},m:function(a,b){if(isNaN(a))return a;for(b-=1;b<0;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!==b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};x.yy=x.yyyy,x.M=x.MM=x.mm=x.m,x.dd=x.d,c=d();var y=e.parts.slice();if(j.length!==y.length&&(y=a(y).filter((function(b,c){return-1!==a.inArray(c,w)})).toArray()),j.length===y.length){var z,A,B;for(n=0,z=y.length;n<z;n++){if(t=parseInt(j[n],10),l=y[n],isNaN(t))switch(l){case"MM":u=a(q[f].months).filter(i),t=a.inArray(u[0],q[f].months)+1;break;case"M":u=a(q[f].monthsShort).filter(i),t=a.inArray(u[0],q[f].monthsShort)+1}v[l]=t}for(n=0;n<w.length;n++)(B=w[n])in v&&!isNaN(v[B])&&(A=new Date(c),x[B](A,v[B]),isNaN(A)||(c=A))}return c},formatDate:function(b,c,d){if(!b)return"";if("string"==typeof c&&(c=r.parseFormat(c)),c.toDisplay)return c.toDisplay(b,c,d);var e={d:b.getUTCDate(),D:q[d].daysShort[b.getUTCDay()],DD:q[d].days[b.getUTCDay()],m:b.getUTCMonth()+1,M:q[d].monthsShort[b.getUTCMonth()],MM:q[d].months[b.getUTCMonth()],yy:b.getUTCFullYear().toString().substring(2),yyyy:b.getUTCFullYear()};e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,b=[];for(var f=a.extend([],c.separators),g=0,h=c.parts.length;g<=h;g++)f.length&&b.push(f.shift()),b.push(e[c.parts[g]]);return b.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+o.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+o.templates.rightArrow+"</th></tr></thead>",contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};r.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+r.headTemplate+"<tbody></tbody>"+r.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+r.headTemplate+r.contTemplate+r.footTemplate+"</table></div></div>",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.9.0",a.fn.datepicker.deprecated=function(a){var b=window.console;b&&b.warn&&b.warn("DEPRECATED: "+a)},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',(function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),n.call(c,"show"))})),a((function(){n.call(a('[data-provide="datepicker-inline"]'))}))})),$.fn.datepicker.defaults.zIndexOffset=10,function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}((function(d,f){function a(){var q,k,p,l,j,n,m,o;if((p=(null!=(m=(k=(new Date).toString()).split("(")[1])?m.slice(0,-1):0)||k.split(" "))instanceof Array){n=[];for(var l=0,j=p.length;l<j;l++)(q=null!==(m=(o=p[l]).match(/\b[A-Z]+\b/)))&&m[0]&&n.push(q);p=n.pop()}return p}function h(){return new Date(Date.UTC.apply(Date,arguments))}"indexOf"in Array.prototype||(Array.prototype.indexOf=function(k,j){j===f&&(j=0),j<0&&(j+=this.length),j<0&&(j=0);for(var l=this.length;j<l;j++)if(j in this&&this[j]===k)return j;return-1});var g=function(k,j){var m=this;this.element=d(k),this.container=j.container||"body",this.language=j.language||this.element.data("date-language")||"en",this.language=this.language in e?this.language:this.language.split("-")[0],this.language=this.language in e?this.language:"en",this.isRTL=e[this.language].rtl||!1,this.formatType=j.formatType||this.element.data("format-type")||"standard",this.format=c.parseFormat(j.format||this.element.data("date-format")||e[this.language].format||c.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.fontAwesome=j.fontAwesome||this.element.data("font-awesome")||!1,this.bootcssVer=j.bootcssVer||(this.isInput?this.element.is(".form-control")?3:2:this.bootcssVer=this.element.is(".input-group")?3:2),this.component=!!this.element.is(".date")&&(3===this.bootcssVer?this.element.find(".input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o").parent():this.element.find(".add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o").parent()),this.componentReset=!!this.element.is(".date")&&(3===this.bootcssVer?this.element.find(".input-group-addon .glyphicon-remove, .input-group-addon .fa-times").parent():this.element.find(".add-on .icon-remove, .add-on .fa-times").parent()),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=j.linkField||this.element.data("link-field")||!1,this.linkFormat=c.parseFormat(j.linkFormat||this.element.data("link-format")||c.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=j.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=j.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=j.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=j.initialDate||new Date,this.zIndex=j.zIndex||this.element.data("z-index")||f,this.title=void 0!==j.title&&j.title,this.timezone=j.timezone||a(),this.icons={leftArrow:this.fontAwesome?"fa-arrow-left":3===this.bootcssVer?"glyphicon-arrow-left":"icon-arrow-left",rightArrow:this.fontAwesome?"fa-arrow-right":3===this.bootcssVer?"glyphicon-arrow-right":"icon-arrow-right"},this.icontype=this.fontAwesome?"fa":"glyphicon",this._attachEvents(),this.clickedOutside=function(n){0===d(n.target).closest(".datetimepicker").length&&m.hide()},this.formatViewType="datetime","formatViewType"in j?this.formatViewType=j.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in j?this.minView=j.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=c.convertViewMode(this.minView),this.maxView=c.modes.length-1,"maxView"in j?this.maxView=j.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=c.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in j?this.wheelViewModeNavigation=j.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in j?this.wheelViewModeNavigationInverseDirection=j.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in j?this.wheelViewModeNavigationDelay=j.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in j?this.startViewMode=j.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=c.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in j?this.viewSelect=j.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=c.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in j?this.forceParse=j.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse"));for(var l=3===this.bootcssVer?c.templateV3:c.template;-1!==l.indexOf("{iconType}");)l=l.replace("{iconType}",this.icontype);for(;-1!==l.indexOf("{leftArrow}");)l=l.replace("{leftArrow}",this.icons.leftArrow);for(;-1!==l.indexOf("{rightArrow}");)l=l.replace("{rightArrow}",this.icons.rightArrow);if(this.picker=d(l).appendTo(this.isInline?this.element:this.container).on({click:d.proxy(this.click,this),mousedown:d.proxy(this.mousedown,this)}),this.wheelViewModeNavigation&&(d.fn.mousewheel?this.picker.on({mousewheel:d.proxy(this.mousewheel,this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL){this.picker.addClass("datetimepicker-rtl");var i=3===this.bootcssVer?".prev span, .next span":".prev i, .next i";this.picker.find(i).toggleClass(this.icons.leftArrow+" "+this.icons.rightArrow)}d(document).on("mousedown touchend",this.clickedOutside),this.autoclose=!1,"autoclose"in j?this.autoclose=j.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in j?this.keyboardNavigation=j.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=j.todayBtn||this.element.data("date-today-btn")||!1,this.clearBtn=j.clearBtn||this.element.data("date-clear-btn")||!1,this.todayHighlight=j.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=0,void 0!==j.weekStart?this.weekStart=j.weekStart:void 0!==this.element.data("date-weekstart")?this.weekStart=this.element.data("date-weekstart"):void 0!==e[this.language].weekStart&&(this.weekStart=e[this.language].weekStart),this.weekStart=this.weekStart%7,this.weekEnd=(this.weekStart+6)%7,this.onRenderDay=function(n){var p=(j.onRenderDay||function(){return[]})(n),o;return"string"==typeof p&&(p=[p]),["day"].concat(p||[])},this.onRenderHour=function(n){var p=(j.onRenderHour||function(){return[]})(n),o;return"string"==typeof p&&(p=[p]),["hour"].concat(p||[])},this.onRenderMinute=function(n){var p=(j.onRenderMinute||function(){return[]})(n),o=["minute"];return"string"==typeof p&&(p=[p]),n<this.startDate||n>this.endDate?o.push("disabled"):Math.floor(this.date.getUTCMinutes()/this.minuteStep)===Math.floor(n.getUTCMinutes()/this.minuteStep)&&o.push("active"),o.concat(p||[])},this.onRenderYear=function(o){var q=(j.onRenderYear||function(){return[]})(o),p=["year"];"string"==typeof q&&(q=[q]),this.date.getUTCFullYear()===o.getUTCFullYear()&&p.push("active");var n=o.getUTCFullYear(),r=this.endDate.getUTCFullYear();return(o<this.startDate||n>r)&&p.push("disabled"),p.concat(q||[])},this.onRenderMonth=function(n){var p=(j.onRenderMonth||function(){return[]})(n),o;return"string"==typeof p&&(p=[p]),["month"].concat(p||[])},this.startDate=new Date(-8639968443048e3),this.endDate=new Date(8639968443048e3),this.datesDisabled=[],this.daysOfWeekDisabled=[],this.setStartDate(j.startDate||this.element.data("date-startdate")),this.setEndDate(j.endDate||this.element.data("date-enddate")),this.setDatesDisabled(j.datesDisabled||this.element.data("date-dates-disabled")),this.setDaysOfWeekDisabled(j.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.setMinutesDisabled(j.minutesDisabled||this.element.data("date-minute-disabled")),this.setHoursDisabled(j.hoursDisabled||this.element.data("date-hour-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};g.prototype={constructor:g,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:d.proxy(this.show,this),keyup:d.proxy(this.update,this),keydown:d.proxy(this.keydown,this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:d.proxy(this.show,this),keyup:d.proxy(this.update,this),keydown:d.proxy(this.keydown,this)}],[this.component,{click:d.proxy(this.show,this)}]],this.componentReset&&this._events.push([this.componentReset,{click:d.proxy(this.reset,this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:d.proxy(this.show,this)}]];for(var j=0,k,l;j<this._events.length;j++)k=this._events[j][0],l=this._events[j][1],k.on(l)},_detachEvents:function(){for(var j=0,k,l;j<this._events.length;j++)k=this._events[j][0],l=this._events[j][1],k.off(l);this._events=[]},show:function(i){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.forceParse&&this.update(),this.place(),d(window).on("resize",d.proxy(this.place,this)),i&&(i.stopPropagation(),i.preventDefault()),this.isVisible=!0,this.element.trigger({type:"show",date:this.date})},hide:function(){this.isVisible&&(this.isInline||(this.picker.hide(),d(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||d(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.isVisible=!1,this.element.trigger({type:"hide",date:this.date})))},remove:function(){this._detachEvents(),d(document).off("mousedown",this.clickedOutside),this.picker.remove(),delete this.picker,delete this.element.data().datetimepicker},getDate:function(){var i=this.getUTCDate();return null===i?null:new Date(i.getTime()+6e4*i.getTimezoneOffset())},getUTCDate:function(){return this.date},getInitialDate:function(){return this.initialDate},setInitialDate:function(i){this.initialDate=i},setDate:function(i){this.setUTCDate(new Date(i.getTime()-6e4*i.getTimezoneOffset()))},setUTCDate:function(i){i>=this.startDate&&i<=this.endDate?(this.date=i,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:i,startDate:this.startDate,endDate:this.endDate})},setFormat:function(j){var i;this.format=c.parseFormat(j,this.formatType),this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&i.val()&&this.setValue()},setValue:function(){var i=this.getFormattedDate();this.isInput?this.element.val(i):(this.component&&this.element.find("input").val(i),this.element.data("date",i)),this.linkField&&d("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(i){return i=i||this.format,c.formatDate(this.date,i,this.language,this.formatType,this.timezone)},setStartDate:function(i){this.startDate=i||this.startDate,8639968443048e3!==this.startDate.valueOf()&&(this.startDate=c.parseDate(this.startDate,this.format,this.language,this.formatType,this.timezone)),this.update(),this.updateNavArrows()},setEndDate:function(i){this.endDate=i||this.endDate,8639968443048e3!==this.endDate.valueOf()&&(this.endDate=c.parseDate(this.endDate,this.format,this.language,this.formatType,this.timezone)),this.update(),this.updateNavArrows()},setDatesDisabled:function(j){this.datesDisabled=j||[],d.isArray(this.datesDisabled)||(this.datesDisabled=this.datesDisabled.split(/,\s*/));var i=this;this.datesDisabled=d.map(this.datesDisabled,(function(k){return c.parseDate(k,i.format,i.language,i.formatType,i.timezone).toDateString()})),this.update(),this.updateNavArrows()},setTitle:function(i,j){return this.picker.find(i).find("th:eq(1)").text(!1===this.title?j:this.title)},setDaysOfWeekDisabled:function(i){this.daysOfWeekDisabled=i||[],d.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=d.map(this.daysOfWeekDisabled,(function(j){return parseInt(j,10)})),this.update(),this.updateNavArrows()},setMinutesDisabled:function(i){this.minutesDisabled=i||[],d.isArray(this.minutesDisabled)||(this.minutesDisabled=this.minutesDisabled.split(/,\s*/)),this.minutesDisabled=d.map(this.minutesDisabled,(function(j){return parseInt(j,10)})),this.update(),this.updateNavArrows()},setHoursDisabled:function(i){this.hoursDisabled=i||[],d.isArray(this.hoursDisabled)||(this.hoursDisabled=this.hoursDisabled.split(/,\s*/)),this.hoursDisabled=d.map(this.hoursDisabled,(function(j){return parseInt(j,10)})),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){if(!this.zIndex){var j=0;d("div").each((function(){var o=parseInt(d(this).css("zIndex"),10);o>j&&(j=o)})),this.zIndex=j+10}var n,m,l,k;k=this.container instanceof d?this.container.offset():d(this.container).offset(),this.component?(l=(n=this.component.offset()).left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition||(l+=this.component.outerWidth()-this.picker.outerWidth())):(l=(n=this.element.offset()).left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition||(l+=this.element.outerWidth()-this.picker.outerWidth()));var i=document.body.clientWidth||window.innerWidth;l+220>i&&(l=i-220),m="top-left"===this.pickerPosition||"top-right"===this.pickerPosition?n.top-this.picker.outerHeight():n.top+this.height,m-=k.top,l-=k.left,this.picker.css({top:m,left:l,zIndex:this.zIndex})}},hour_minute:"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]",update:function(){var i,j=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(i=arguments[0],j=!0):"string"==typeof(i=(this.isInput?this.element.val():this.element.find("input").val())||this.element.data("date")||this.initialDate)&&(i=i.replace(/^\s+|\s+$/g,"")),i||(i=new Date,j=!1),"string"==typeof i&&(new RegExp(this.hour_minute).test(i)||new RegExp(this.hour_minute+":[0-5][0-9]").test(i))&&(i=this.getDate()),this.date=c.parseDate(i,this.format,this.language,this.formatType,this.timezone),j&&this.setValue(),this.date<this.startDate?this.viewDate=new Date(this.startDate):this.date>this.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var i=this.weekStart,j="<tr>";i<this.weekStart+7;)j+='<th class="dow">'+e[this.language].daysMin[i++%7]+"</th>";j+="</tr>",this.picker.find(".datetimepicker-days thead").append(j)},fillMonths:function(){for(var l="",m=new Date(this.viewDate),k=0;k<12;k++){var j;m.setUTCMonth(k),l+='<span class="'+this.onRenderMonth(m).join(" ")+'">'+e[this.language].monthsShort[k]+"</span>"}this.picker.find(".datetimepicker-months td").html(l)},fill:function(){if(this.date&&this.viewDate){var E=new Date(this.viewDate),t=E.getUTCFullYear(),G=E.getUTCMonth(),n=E.getUTCDate(),A=E.getUTCHours(),w=this.startDate.getUTCFullYear(),B=this.startDate.getUTCMonth(),p=this.endDate.getUTCFullYear(),x=this.endDate.getUTCMonth()+1,q=new h(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),D=new Date;if(this.setTitle(".datetimepicker-days",e[this.language].months[G]+" "+t),"time"===this.formatViewType){var k=this.getFormattedDate();this.setTitle(".datetimepicker-hours",k),this.setTitle(".datetimepicker-minutes",k)}else this.setTitle(".datetimepicker-hours",n+" "+e[this.language].months[G]+" "+t),this.setTitle(".datetimepicker-minutes",n+" "+e[this.language].months[G]+" "+t);this.picker.find("tfoot th.today").text(e[this.language].today||e.en.today).toggle(!1!==this.todayBtn),this.picker.find("tfoot th.clear").text(e[this.language].clear||e.en.clear).toggle(!1!==this.clearBtn),this.updateNavArrows(),this.fillMonths();var I=h(t,G-1,28,0,0,0,0),z=c.getDaysInMonth(I.getUTCFullYear(),I.getUTCMonth());I.setUTCDate(z),I.setUTCDate(z-(I.getUTCDay()-this.weekStart+7)%7);var j=new Date(I);j.setUTCDate(j.getUTCDate()+42),j=j.valueOf();for(var r=[],F;I.valueOf()<j;)I.getUTCDay()===this.weekStart&&r.push("<tr>"),F=this.onRenderDay(I),I.getUTCFullYear()<t||I.getUTCFullYear()===t&&I.getUTCMonth()<G?F.push("old"):(I.getUTCFullYear()>t||I.getUTCFullYear()===t&&I.getUTCMonth()>G)&&F.push("new"),this.todayHighlight&&I.getUTCFullYear()===D.getFullYear()&&I.getUTCMonth()===D.getMonth()&&I.getUTCDate()===D.getDate()&&F.push("today"),I.valueOf()===q&&F.push("active"),(I.valueOf()+864e5<=this.startDate||I.valueOf()>this.endDate||-1!==d.inArray(I.getUTCDay(),this.daysOfWeekDisabled)||-1!==d.inArray(I.toDateString(),this.datesDisabled))&&F.push("disabled"),r.push('<td class="'+F.join(" ")+'">'+I.getUTCDate()+"</td>"),I.getUTCDay()===this.weekEnd&&r.push("</tr>"),I.setUTCDate(I.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(r.join("")),r=[];var u="",C="",s="",l=this.hoursDisabled||[];E=new Date(this.viewDate);for(var y=0;y<24;y++){E.setUTCHours(y),F=this.onRenderHour(E),-1!==l.indexOf(y)&&F.push("disabled");var v=h(t,G,n,y);v.valueOf()+36e5<=this.startDate||v.valueOf()>this.endDate?F.push("disabled"):A===y&&F.push("active"),this.showMeridian&&2===e[this.language].meridiem.length?((C=y<12?e[this.language].meridiem[0]:e[this.language].meridiem[1])!==s&&(""!==s&&r.push("</fieldset>"),r.push('<fieldset class="hour"><legend>'+C.toUpperCase()+"</legend>")),s=C,u=y%12?y%12:12,y<12?F.push("hour_am"):F.push("hour_pm"),r.push('<span class="'+F.join(" ")+'">'+u+"</span>"),23===y&&r.push("</fieldset>")):(u=y+":00",r.push('<span class="'+F.join(" ")+'">'+u+"</span>"))}this.picker.find(".datetimepicker-hours td").html(r.join("")),r=[],u="",C="",s="";var m=this.minutesDisabled||[];E=new Date(this.viewDate);for(var y=0;y<60;y+=this.minuteStep)-1===m.indexOf(y)&&(E.setUTCMinutes(y),E.setUTCSeconds(0),F=this.onRenderMinute(E),this.showMeridian&&2===e[this.language].meridiem.length?((C=A<12?e[this.language].meridiem[0]:e[this.language].meridiem[1])!==s&&(""!==s&&r.push("</fieldset>"),r.push('<fieldset class="minute"><legend>'+C.toUpperCase()+"</legend>")),s=C,u=A%12?A%12:12,r.push('<span class="'+F.join(" ")+'">'+u+":"+(y<10?"0"+y:y)+"</span>"),59===y&&r.push("</fieldset>")):(u=y+":00",r.push('<span class="'+F.join(" ")+'">'+A+":"+(y<10?"0"+y:y)+"</span>")));this.picker.find(".datetimepicker-minutes td").html(r.join(""));var J=this.date.getUTCFullYear(),o=this.setTitle(".datetimepicker-months",t).end().find(".month").removeClass("active");J===t&&o.eq(this.date.getUTCMonth()).addClass("active"),(t<w||t>p)&&o.addClass("disabled"),t===w&&o.slice(0,B).addClass("disabled"),t===p&&o.slice(x).addClass("disabled"),r="",t=10*parseInt(t/10,10);var H=this.setTitle(".datetimepicker-years",t+"-"+(t+9)).end().find("td");t-=1,E=new Date(this.viewDate);for(var y=-1;y<11;y++)E.setUTCFullYear(t),F=this.onRenderYear(E),-1!==y&&10!==y||F.push(b),r+='<span class="'+F.join(" ")+'">'+t+"</span>",t+=1;H.html(r),this.place()}},updateNavArrows:function(){var m=new Date(this.viewDate),k=m.getUTCFullYear(),l=m.getUTCMonth(),j=m.getUTCDate(),i=m.getUTCHours();switch(this.viewMode){case 0:k<=this.startDate.getUTCFullYear()&&l<=this.startDate.getUTCMonth()&&j<=this.startDate.getUTCDate()&&i<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),k>=this.endDate.getUTCFullYear()&&l>=this.endDate.getUTCMonth()&&j>=this.endDate.getUTCDate()&&i>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:k<=this.startDate.getUTCFullYear()&&l<=this.startDate.getUTCMonth()&&j<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),k>=this.endDate.getUTCFullYear()&&l>=this.endDate.getUTCMonth()&&j>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:k<=this.startDate.getUTCFullYear()&&l<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),k>=this.endDate.getUTCFullYear()&&l>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:k<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),k>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(j){if(j.preventDefault(),j.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var i,l=j.originalEvent.wheelDelta,k=l>0?1:0===l?0:-1;this.wheelViewModeNavigationInverseDirection&&(k=-k),this.showMode(k),setTimeout(d.proxy((function(){this.wheelPause=!1}),this),this.wheelViewModeNavigationDelay)}},click:function(m){m.stopPropagation(),m.preventDefault();var n=d(m.target).closest("span, td, th, legend");if(n.is("."+this.icontype)&&(n=d(n).parent().closest("span, td, th, legend")),1===n.length){if(n.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var i=c.modes[this.viewMode].navStep*("prev"===n[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,i);break;case 1:this.viewDate=this.moveDate(this.viewDate,i);break;case 2:this.viewDate=this.moveMonth(this.viewDate,i);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,i)}this.fill(),this.element.trigger({type:n[0].className+":"+this.convertViewModeText(this.viewMode),date:this.viewDate,startDate:this.startDate,endDate:this.endDate});break;case"clear":this.reset(),this.autoclose&&this.hide();break;case"today":var j=new Date;(j=h(j.getFullYear(),j.getMonth(),j.getDate(),j.getHours(),j.getMinutes(),j.getSeconds(),0))<this.startDate?j=this.startDate:j>this.endDate&&(j=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(j),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!n.is(".disabled")){var p=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),q=this.viewDate.getUTCDate(),r=this.viewDate.getUTCHours(),k=this.viewDate.getUTCMinutes(),s=this.viewDate.getUTCSeconds();if(n.is(".month")?(this.viewDate.setUTCDate(1),o=n.parent().find("span").index(n),q=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(o),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(h(p,o,q,r,k,s,0))):n.is(".year")?(this.viewDate.setUTCDate(1),p=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(p),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(h(p,o,q,r,k,s,0))):n.is(".hour")?(r=parseInt(n.text(),10)||0,(n.hasClass("hour_am")||n.hasClass("hour_pm"))&&(12===r&&n.hasClass("hour_am")?r=0:12!==r&&n.hasClass("hour_pm")&&(r+=12)),this.viewDate.setUTCHours(r),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(h(p,o,q,r,k,s,0))):n.is(".minute")&&(k=parseInt(n.text().substr(n.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(k),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(h(p,o,q,r,k,s,0))),0!==this.viewMode){var l=this.viewMode;this.showMode(-1),this.fill(),l===this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(n.is(".day")&&!n.is(".disabled")){var q=parseInt(n.text(),10)||1,p=this.viewDate.getUTCFullYear(),o=this.viewDate.getUTCMonth(),r=this.viewDate.getUTCHours(),k=this.viewDate.getUTCMinutes(),s=this.viewDate.getUTCSeconds();n.is(".old")?0===o?(o=11,p-=1):o-=1:n.is(".new")&&(11===o?(o=0,p+=1):o+=1),this.viewDate.setUTCFullYear(p),this.viewDate.setUTCMonth(o,q),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(h(p,o,q,r,k,s,0))}var l=this.viewMode;this.showMode(-1),this.fill(),l===this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(i,k){var j;k&&"date"!==k||(this.date=i),k&&"view"!==k||(this.viewDate=i),this.fill(),this.setValue(),this.isInput?j=this.element:this.component&&(j=this.element.find("input")),j&&j.change(),this.element.trigger({type:"changeDate",date:this.getDate()}),null===i&&(this.date=this.viewDate)},moveMinute:function(j,i){if(!i)return j;var k=new Date(j.valueOf());return k.setUTCMinutes(k.getUTCMinutes()+i*this.minuteStep),k},moveHour:function(j,i){if(!i)return j;var k=new Date(j.valueOf());return k.setUTCHours(k.getUTCHours()+i),k},moveDate:function(j,i){if(!i)return j;var k=new Date(j.valueOf());return k.setUTCDate(k.getUTCDate()+i),k},moveMonth:function(j,k){if(!k)return j;var n=new Date(j.valueOf()),r=n.getUTCDate(),o=n.getUTCMonth(),m=Math.abs(k),q,p;if(k=k>0?1:-1,1===m)p=-1===k?function(){return n.getUTCMonth()===o}:function(){return n.getUTCMonth()!==q},q=o+k,n.setUTCMonth(q),(q<0||q>11)&&(q=(q+12)%12);else{for(var l=0;l<m;l++)n=this.moveMonth(n,k);q=n.getUTCMonth(),n.setUTCDate(r),p=function(){return q!==n.getUTCMonth()}}for(;p();)n.setUTCDate(--r),n.setUTCMonth(q);return n},moveYear:function(j,i){return this.moveMonth(j,12*i)},dateWithinRange:function(i){return i>=this.startDate&&i<=this.endDate},keydown:function(o){if(this.picker.is(":not(:visible)"))27===o.keyCode&&this.show();else{var k=!1,j,i,n,l;switch(o.keyCode){case 27:this.hide(),o.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;j=37===o.keyCode?-1:1;var m=this.viewMode;o.ctrlKey?m+=2:o.shiftKey&&(m+=1),4===m?(i=this.moveYear(this.date,j),n=this.moveYear(this.viewDate,j)):3===m?(i=this.moveMonth(this.date,j),n=this.moveMonth(this.viewDate,j)):2===m?(i=this.moveDate(this.date,j),n=this.moveDate(this.viewDate,j)):1===m?(i=this.moveHour(this.date,j),n=this.moveHour(this.viewDate,j)):0===m&&(i=this.moveMinute(this.date,j),n=this.moveMinute(this.viewDate,j)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),o.preventDefault(),k=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;j=38===o.keyCode?-1:1,m=this.viewMode,o.ctrlKey?m+=2:o.shiftKey&&(m+=1),4===m?(i=this.moveYear(this.date,j),n=this.moveYear(this.viewDate,j)):3===m?(i=this.moveMonth(this.date,j),n=this.moveMonth(this.viewDate,j)):2===m?(i=this.moveDate(this.date,7*j),n=this.moveDate(this.viewDate,7*j)):1===m?this.showMeridian?(i=this.moveHour(this.date,6*j),n=this.moveHour(this.viewDate,6*j)):(i=this.moveHour(this.date,4*j),n=this.moveHour(this.viewDate,4*j)):0===m&&(i=this.moveMinute(this.date,4*j),n=this.moveMinute(this.viewDate,4*j)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),o.preventDefault(),k=!0);break;case 13:if(0!==this.viewMode){var p=this.viewMode;this.showMode(-1),this.fill(),p===this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();o.preventDefault();break;case 9:this.hide()}if(k)this.isInput?l=this.element:this.component&&(l=this.element.find("input")),l&&l.change(),this.element.trigger({type:"changeDate",date:this.getDate()})}},showMode:function(i){if(i){var j=Math.max(0,Math.min(c.modes.length-1,this.viewMode+i));j>=this.minView&&j<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:j}),this.viewMode=j)}this.picker.find(">div").hide().filter(".datetimepicker-"+c.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(){this._setDate(null,"date")},convertViewModeText:function(i){switch(i){case 4:return"decade";case 3:return"year";case 2:return"month";case 1:return"day";case 0:return"hour"}}};var b=d.fn.datetimepicker;d.fn.datetimepicker=function(k){var i=Array.apply(null,arguments),j;return i.shift(),this.each((function(){var n=d(this),m=n.data("datetimepicker"),l="object"==typeof k&&k;if(m||n.data("datetimepicker",m=new g(this,d.extend({},d.fn.datetimepicker.defaults,l))),"string"==typeof k&&"function"==typeof m[k]&&(j=m[k].apply(m,i))!==f)return!1})),j!==f?j:this},d.fn.datetimepicker.defaults={},d.fn.datetimepicker.Constructor=g;var e=d.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today",clear:"Clear"}},c={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(i){return i%4==0&&i%100!=0||i%400==0},getDaysInMonth:function(i,j){return[31,c.isLeapYear(i)?29:28,31,30,31,30,31,31,30,31,30,31][j]},getDefaultFormat:function(i,j){if("standard"===i)return"input"===j?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"===i)return"input"===j?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(i){if("standard"===i)return/t|hh?|HH?|p|P|z|Z|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"===i)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(l,j){var i=l.replace(this.validParts(j),"\0").split("\0"),k=l.match(this.validParts(j));if(!i||!i.length||!k||0===k.length)throw new Error("Invalid date format.");return{separators:i,parts:k}},parseDate:function(A,y,v,j,r){if(A instanceof Date){var u=new Date(A.valueOf()-6e4*A.getTimezoneOffset());return u.setMilliseconds(0),u}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(A)&&(y=this.parseFormat("yyyy-mm-dd",j)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(A)&&(y=this.parseFormat("yyyy-mm-dd hh:ii",j)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(A)&&(y=this.parseFormat("yyyy-mm-dd hh:ii:ss",j)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(A)){var l=/([-+]\d+)([dmwy])/,q=A.match(/([-+]\d+)([dmwy])/g),t,p;A=new Date;for(var x=0;x<q.length;x++)switch(t=l.exec(q[x]),p=parseInt(t[1]),t[2]){case"d":A.setUTCDate(A.getUTCDate()+p);break;case"m":A=g.prototype.moveMonth.call(g.prototype,A,p);break;case"w":A.setUTCDate(A.getUTCDate()+7*p);break;case"y":A=g.prototype.moveYear.call(g.prototype,A,p)}return h(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate(),A.getUTCHours(),A.getUTCMinutes(),A.getUTCSeconds(),0)}var q=A&&A.toString().match(this.nonpunctuation)||[],A=new Date(0,0,0,0,0,0,0),m={},z=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","D","DD","d","dd","H","HH","p","P","z","Z"],o={hh:function(s,i){return s.setUTCHours(i)},h:function(s,i){return s.setUTCHours(i)},HH:function(s,i){return s.setUTCHours(12===i?0:i)},H:function(s,i){return s.setUTCHours(12===i?0:i)},ii:function(s,i){return s.setUTCMinutes(i)},i:function(s,i){return s.setUTCMinutes(i)},ss:function(s,i){return s.setUTCSeconds(i)},s:function(s,i){return s.setUTCSeconds(i)},yyyy:function(s,i){return s.setUTCFullYear(i)},yy:function(s,i){return s.setUTCFullYear(2e3+i)},m:function(s,i){for(i-=1;i<0;)i+=12;for(i%=12,s.setUTCMonth(i);s.getUTCMonth()!==i;){if(isNaN(s.getUTCMonth()))return s;s.setUTCDate(s.getUTCDate()-1)}return s},d:function(s,i){return s.setUTCDate(i)},p:function(s,i){return s.setUTCHours(1===i?s.getUTCHours()+12:s.getUTCHours())},z:function(){return r}},B,k,t;if(o.M=o.MM=o.mm=o.m,o.dd=o.d,o.P=o.p,o.Z=o.z,A=h(A.getFullYear(),A.getMonth(),A.getDate(),A.getHours(),A.getMinutes(),A.getSeconds()),q.length===y.parts.length){for(var x=0,w=y.parts.length;x<w;x++){if(B=parseInt(q[x],10),t=y.parts[x],isNaN(B))switch(t){case"MM":k=d(e[v].months).filter((function(){var i=this.slice(0,q[x].length),s;return i===q[x].slice(0,i.length)})),B=d.inArray(k[0],e[v].months)+1;break;case"M":k=d(e[v].monthsShort).filter((function(){var i=this.slice(0,q[x].length),s=q[x].slice(0,i.length);return i.toLowerCase()===s.toLowerCase()})),B=d.inArray(k[0],e[v].monthsShort)+1;break;case"p":case"P":B=d.inArray(q[x].toLowerCase(),e[v].meridiem)}m[t]=B}for(var x=0,n;x<z.length;x++)(n=z[x])in m&&!isNaN(m[n])&&o[n](A,m[n])}return A},formatDate:function(l,q,m,p,o){if(null===l)return"";var k;if("standard"===p)k={t:l.getTime(),yy:l.getUTCFullYear().toString().substring(2),yyyy:l.getUTCFullYear(),m:l.getUTCMonth()+1,M:e[m].monthsShort[l.getUTCMonth()],MM:e[m].months[l.getUTCMonth()],d:l.getUTCDate(),D:e[m].daysShort[l.getUTCDay()],DD:e[m].days[l.getUTCDay()],p:2===e[m].meridiem.length?e[m].meridiem[l.getUTCHours()<12?0:1]:"",h:l.getUTCHours(),i:l.getUTCMinutes(),s:l.getUTCSeconds(),z:o},2===e[m].meridiem.length?k.H=k.h%12==0?12:k.h%12:k.H=k.h,k.HH=(k.H<10?"0":"")+k.H,k.P=k.p.toUpperCase(),k.Z=k.z,k.hh=(k.h<10?"0":"")+k.h,k.ii=(k.i<10?"0":"")+k.i,k.ss=(k.s<10?"0":"")+k.s,k.dd=(k.d<10?"0":"")+k.d,k.mm=(k.m<10?"0":"")+k.m;else{if("php"!==p)throw new Error("Invalid format type.");(k={y:l.getUTCFullYear().toString().substring(2),Y:l.getUTCFullYear(),F:e[m].months[l.getUTCMonth()],M:e[m].monthsShort[l.getUTCMonth()],n:l.getUTCMonth()+1,t:c.getDaysInMonth(l.getUTCFullYear(),l.getUTCMonth()),j:l.getUTCDate(),l:e[m].days[l.getUTCDay()],D:e[m].daysShort[l.getUTCDay()],w:l.getUTCDay(),N:0===l.getUTCDay()?7:l.getUTCDay(),S:l.getUTCDate()%10<=e[m].suffix.length?e[m].suffix[l.getUTCDate()%10-1]:"",a:2===e[m].meridiem.length?e[m].meridiem[l.getUTCHours()<12?0:1]:"",g:l.getUTCHours()%12==0?12:l.getUTCHours()%12,G:l.getUTCHours(),i:l.getUTCMinutes(),s:l.getUTCSeconds()}).m=(k.n<10?"0":"")+k.n,k.d=(k.j<10?"0":"")+k.j,k.A=k.a.toString().toUpperCase(),k.h=(k.g<10?"0":"")+k.g,k.H=(k.G<10?"0":"")+k.G,k.i=(k.i<10?"0":"")+k.i,k.s=(k.s<10?"0":"")+k.s}for(var l=[],r=d.extend([],q.separators),n=0,j=q.parts.length;n<j;n++)r.length&&l.push(r.shift()),l.push(k[q.parts[n]]);return r.length&&l.push(r.shift()),l.join("")},convertViewMode:function(i){switch(i){case 4:case"decade":i=4;break;case 3:case"year":i=3;break;case 2:case"month":i=2;break;case 1:case"day":i=1;break;case 0:case"hour":i=0}return i},headTemplate:'<thead><tr><th class="prev"><i class="{iconType} {leftArrow}"/></th><th colspan="5" class="switch"></th><th class="next"><i class="{iconType} {rightArrow}"/></th></tr></thead>',headTemplateV3:'<thead><tr><th class="prev"><span class="{iconType} {leftArrow}"></span> </th><th colspan="5" class="switch"></th><th class="next"><span class="{iconType} {rightArrow}"></span> </th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};c.template='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+c.headTemplate+"<tbody></tbody>"+c.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+c.headTemplate+c.contTemplate+c.footTemplate+"</table></div></div>",c.templateV3='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+c.headTemplateV3+"<tbody></tbody>"+c.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+c.headTemplateV3+c.contTemplate+c.footTemplate+"</table></div></div>",d.fn.datetimepicker.DPGlobal=c,d.fn.datetimepicker.noConflict=function(){return d.fn.datetimepicker=b,this},d(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',(function(j){var i=d(this);i.data("datetimepicker")||(j.preventDefault(),i.datetimepicker("show"))})),d((function(){d('[data-provide="datetimepicker-inline"]').datetimepicker()}))})),function(a,b,c){"use strict";var d=function(b,c){this.widget="",this.$element=a(b),this.defaultTime=c.defaultTime,this.disableFocus=c.disableFocus,this.disableMousewheel=c.disableMousewheel,this.isOpen=c.isOpen,this.minuteStep=c.minuteStep,this.modalBackdrop=c.modalBackdrop,this.orientation=c.orientation,this.secondStep=c.secondStep,this.snapToStep=c.snapToStep,this.showInputs=c.showInputs,this.showMeridian=c.showMeridian,this.showSeconds=c.showSeconds,this.template=c.template,this.appendWidgetTo=c.appendWidgetTo,this.showWidgetOnAddonClick=c.showWidgetOnAddonClick,this.icons=c.icons,this.maxHours=c.maxHours,this.explicitMode=c.explicitMode,this.handleDocumentClick=function(a){var b=a.data.scope;b.$element.parent().find(a.target).length||b.$widget.is(a.target)||b.$widget.find(a.target).length||b.hideWidget()},this._init()};d.prototype={constructor:d,_init:function(){var b=this;this.showWidgetOnAddonClick&&this.$element.parent().hasClass("input-group")&&this.$element.parent().hasClass("bootstrap-timepicker")?(this.$element.parent(".input-group.bootstrap-timepicker").find(".input-group-addon").on({"click.timepicker":a.proxy(this.showWidget,this)}),this.$element.on({"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)})):this.template?this.$element.on({"focus.timepicker":a.proxy(this.showWidget,this),"click.timepicker":a.proxy(this.showWidget,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)}):this.$element.on({"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)}),!1!==this.template?this.$widget=a(this.getTemplate()).on("click",a.proxy(this.widgetClick,this)):this.$widget=!1,this.showInputs&&!1!==this.$widget&&this.$widget.find("input").each((function(){a(this).on({"click.timepicker":function(){a(this).select()},"keydown.timepicker":a.proxy(b.widgetKeydown,b),"keyup.timepicker":a.proxy(b.widgetKeyup,b)})})),this.setDefaultTime(this.defaultTime)},blurElement:function(){this.highlightedUnit=null,this.updateFromElementVal()},clear:function(){this.hour="",this.minute="",this.second="",this.meridian="",this.$element.val("")},decrementHour:function(){if(this.showMeridian)if(1===this.hour)this.hour=12;else{if(12===this.hour)return this.hour--,this.toggleMeridian();if(0===this.hour)return this.hour=11,this.toggleMeridian();this.hour--}else this.hour<=0?this.hour=this.maxHours-1:this.hour--},decrementMinute:function(a){var b;0>(b=a?this.minute-a:this.minute-this.minuteStep)?(this.decrementHour(),this.minute=b+60):this.minute=b},decrementSecond:function(){var a=this.second-this.secondStep;0>a?(this.decrementMinute(!0),this.second=a+60):this.second=a},elementKeydown:function(a){switch(a.which){case 9:if(a.shiftKey){if("hour"===this.highlightedUnit){this.hideWidget();break}this.highlightPrevUnit()}else{if(this.showMeridian&&"meridian"===this.highlightedUnit||this.showSeconds&&"second"===this.highlightedUnit||!this.showMeridian&&!this.showSeconds&&"minute"===this.highlightedUnit){this.hideWidget();break}this.highlightNextUnit()}a.preventDefault(),this.updateFromElementVal();break;case 27:this.updateFromElementVal();break;case 37:a.preventDefault(),this.highlightPrevUnit(),this.updateFromElementVal();break;case 38:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.incrementHour(),this.highlightHour();break;case"minute":this.incrementMinute(),this.highlightMinute();break;case"second":this.incrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update();break;case 39:a.preventDefault(),this.highlightNextUnit(),this.updateFromElementVal();break;case 40:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.decrementHour(),this.highlightHour();break;case"minute":this.decrementMinute(),this.highlightMinute();break;case"second":this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update()}},getCursorPosition:function(){var a=this.$element.get(0);if("selectionStart"in a)return a.selectionStart;if(c.selection){a.focus();var b=c.selection.createRange(),d=c.selection.createRange().text.length;return b.moveStart("character",-a.value.length),b.text.length-d}},getTemplate:function(){var a,b,c,d,e,f;switch(this.showInputs?(b='<input type="text" class="bootstrap-timepicker-hour" maxlength="2"/>',c='<input type="text" class="bootstrap-timepicker-minute" maxlength="2"/>',d='<input type="text" class="bootstrap-timepicker-second" maxlength="2"/>',e='<input type="text" class="bootstrap-timepicker-meridian" maxlength="2"/>'):(b='<span class="bootstrap-timepicker-hour"></span>',c='<span class="bootstrap-timepicker-minute"></span>',d='<span class="bootstrap-timepicker-second"></span>',e='<span class="bootstrap-timepicker-meridian"></span>'),f='<table><tr><td><a href="#" data-action="incrementHour"><span class="'+this.icons.up+'"></span></a></td><td class="separator"> </td><td><a href="#" data-action="incrementMinute"><span class="'+this.icons.up+'"></span></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="incrementSecond"><span class="'+this.icons.up+'"></span></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><span class="'+this.icons.up+'"></span></a></td>':"")+"</tr><tr><td>"+b+'</td> <td class="separator">:</td><td>'+c+"</td> "+(this.showSeconds?'<td class="separator">:</td><td>'+d+"</td>":"")+(this.showMeridian?'<td class="separator"> </td><td>'+e+"</td>":"")+'</tr><tr><td><a href="#" data-action="decrementHour"><span class="'+this.icons.down+'"></span></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><span class="'+this.icons.down+'"></span></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="decrementSecond"><span class="'+this.icons.down+'"></span></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td><a href="#" data-action="toggleMeridian"><span class="'+this.icons.down+'"></span></a></td>':"")+"</tr></table>",this.template){case"modal":a='<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+(this.modalBackdrop?"true":"false")+'"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">×</a><h3>Pick a Time</h3></div><div class="modal-content">'+f+'</div><div class="modal-footer"><a href="#" class="btn btn-primary" data-dismiss="modal">OK</a></div></div>';break;case"dropdown":a='<div class="bootstrap-timepicker-widget dropdown-menu">'+f+"</div>"}return a},getTime:function(){return""===this.hour?"":this.hour+":"+(1===this.minute.toString().length?"0"+this.minute:this.minute)+(this.showSeconds?":"+(1===this.second.toString().length?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:"")},hideWidget:function(){!1!==this.isOpen&&(this.$element.trigger({type:"hide.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),"modal"===this.template&&this.$widget.modal?this.$widget.modal("hide"):this.$widget.removeClass("open"),a(c).off("mousedown.timepicker, touchend.timepicker",this.handleDocumentClick),this.isOpen=!1,this.$widget.detach())},highlightUnit:function(){this.position=this.getCursorPosition(),this.position>=0&&this.position<=2?this.highlightHour():this.position>=3&&this.position<=5?this.highlightMinute():this.position>=6&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():this.position>=9&&this.position<=11&&this.highlightMeridian()},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"second":this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"meridian":this.highlightHour()}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.showMeridian?this.highlightMeridian():this.showSeconds?this.highlightSecond():this.highlightMinute();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},highlightHour:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="hour",a.setSelectionRange&&setTimeout((function(){b.hour<10?a.setSelectionRange(0,1):a.setSelectionRange(0,2)}),0)},highlightMinute:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="minute",a.setSelectionRange&&setTimeout((function(){b.hour<10?a.setSelectionRange(2,4):a.setSelectionRange(3,5)}),0)},highlightSecond:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="second",a.setSelectionRange&&setTimeout((function(){b.hour<10?a.setSelectionRange(5,7):a.setSelectionRange(6,8)}),0)},highlightMeridian:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="meridian",a.setSelectionRange&&(this.showSeconds?setTimeout((function(){b.hour<10?a.setSelectionRange(8,10):a.setSelectionRange(9,11)}),0):setTimeout((function(){b.hour<10?a.setSelectionRange(5,7):a.setSelectionRange(6,8)}),0))},incrementHour:function(){if(this.showMeridian){if(11===this.hour)return this.hour++,this.toggleMeridian();12===this.hour&&(this.hour=0)}return this.hour===this.maxHours-1?void(this.hour=0):void this.hour++},incrementMinute:function(a){var b;(b=a?this.minute+a:this.minute+this.minuteStep-this.minute%this.minuteStep)>59?(this.incrementHour(),this.minute=b-60):this.minute=b},incrementSecond:function(){var a=this.second+this.secondStep-this.second%this.secondStep;a>59?(this.incrementMinute(!0),this.second=a-60):this.second=a},mousewheel:function(b){if(!this.disableMousewheel){b.preventDefault(),b.stopPropagation();var c=b.originalEvent.wheelDelta||-b.originalEvent.detail,d=null;switch("mousewheel"===b.type?d=-1*b.originalEvent.wheelDelta:"DOMMouseScroll"===b.type&&(d=40*b.originalEvent.detail),d&&(b.preventDefault(),a(this).scrollTop(d+a(this).scrollTop())),this.highlightedUnit){case"minute":c>0?this.incrementMinute():this.decrementMinute(),this.highlightMinute();break;case"second":c>0?this.incrementSecond():this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian();break;default:c>0?this.incrementHour():this.decrementHour(),this.highlightHour()}return!1}},changeToNearestStep:function(a,b){return a%b==0?a:Math.round(a%b/b)?(a+(b-a%b))%60:a-a%b},place:function(){if(!this.isInline){var c=this.$widget.outerWidth(),d=this.$widget.outerHeight(),e=10,f=a(b).width(),g=a(b).height(),h=a(b).scrollTop(),i=parseInt(this.$element.parents().filter((function(){return"auto"!==a(this).css("z-index")})).first().css("z-index"),10)+10,j=this.component?this.component.parent().offset():this.$element.offset(),k=this.component?this.component.outerHeight(!0):this.$element.outerHeight(!1),l=this.component?this.component.outerWidth(!0):this.$element.outerWidth(!1),m=j.left,n=j.top;this.$widget.removeClass("timepicker-orient-top timepicker-orient-bottom timepicker-orient-right timepicker-orient-left"),"auto"!==this.orientation.x?(this.$widget.addClass("timepicker-orient-"+this.orientation.x),"right"===this.orientation.x&&(m-=c-l)):(this.$widget.addClass("timepicker-orient-left"),j.left<0?m-=j.left-e:j.left+c>f&&(m=f-c-e));var o,p,q=this.orientation.y;"auto"===q&&(o=-h+j.top-d,p=h+g-(j.top+k+d),q=Math.max(o,p)===p?"top":"bottom"),this.$widget.addClass("timepicker-orient-"+q),"top"===q?n+=k:n-=d+parseInt(this.$widget.css("padding-top"),10),this.$widget.css({top:n,left:m,zIndex:i})}},remove:function(){a("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},setDefaultTime:function(a){if(this.$element.val())this.updateFromElementVal();else if("current"===a){var b=new Date,c=b.getHours(),d=b.getMinutes(),e=b.getSeconds(),f="AM";0!==e&&(60===(e=Math.ceil(b.getSeconds()/this.secondStep)*this.secondStep)&&(d+=1,e=0)),0!==d&&(60===(d=Math.ceil(b.getMinutes()/this.minuteStep)*this.minuteStep)&&(c+=1,d=0)),this.showMeridian&&(0===c?c=12:c>=12?(c>12&&(c-=12),f="PM"):f="AM"),this.hour=c,this.minute=d,this.second=e,this.meridian=f,this.update()}else!1===a?(this.hour=0,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(a)},setTime:function(a,b){if(a){var c,d,e,f,g,h;if("object"==typeof a&&a.getMonth)e=a.getHours(),f=a.getMinutes(),g=a.getSeconds(),this.showMeridian&&(h="AM",e>12&&(h="PM",e%=12),12===e&&(h="PM"));else{if((c=(/a/i.test(a)?1:0)+(/p/i.test(a)?2:0))>2)return void this.clear();if(e=(d=a.replace(/[^0-9\:]/g,"").split(":"))[0]?d[0].toString():d.toString(),this.explicitMode&&e.length>2&&e.length%2!=0)return void this.clear();f=d[1]?d[1].toString():"",g=d[2]?d[2].toString():"",e.length>4&&(g=e.slice(-2),e=e.slice(0,-2)),e.length>2&&(f=e.slice(-2),e=e.slice(0,-2)),f.length>2&&(g=f.slice(-2),f=f.slice(0,-2)),e=parseInt(e,10),f=parseInt(f,10),g=parseInt(g,10),isNaN(e)&&(e=0),isNaN(f)&&(f=0),isNaN(g)&&(g=0),g>59&&(g=59),f>59&&(f=59),e>=this.maxHours&&(e=this.maxHours-1),this.showMeridian?(e>12&&(c=2,e-=12),c||(c=1),0===e&&(e=12),h=1===c?"AM":"PM"):12>e&&2===c?e+=12:e>=this.maxHours?e=this.maxHours-1:(0>e||12===e&&1===c)&&(e=0)}this.hour=e,this.snapToStep?(this.minute=this.changeToNearestStep(f,this.minuteStep),this.second=this.changeToNearestStep(g,this.secondStep)):(this.minute=f,this.second=g),this.meridian=h,this.update(b)}else this.clear()},showWidget:function(){this.isOpen||this.$element.is(":disabled")||(this.$widget.appendTo(this.appendWidgetTo),a(c).on("mousedown.timepicker, touchend.timepicker",{scope:this},this.handleDocumentClick),this.$element.trigger({type:"show.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),this.place(),this.disableFocus&&this.$element.blur(),""===this.hour&&(this.defaultTime?this.setDefaultTime(this.defaultTime):this.setTime("0:0:0")),"modal"===this.template&&this.$widget.modal?this.$widget.modal("show").on("hidden",a.proxy(this.hideWidget,this)):!1===this.isOpen&&this.$widget.addClass("open"),this.isOpen=!0)},toggleMeridian:function(){this.meridian="AM"===this.meridian?"PM":"AM"},update:function(a){this.updateElement(),a||this.updateWidget(),this.$element.trigger({type:"changeTime.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}})},updateElement:function(){this.$element.val(this.getTime()).change()},updateFromElementVal:function(){this.setTime(this.$element.val())},updateWidget:function(){if(!1!==this.$widget){var a=this.hour,b=1===this.minute.toString().length?"0"+this.minute:this.minute,c=1===this.second.toString().length?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(a),this.$widget.find("input.bootstrap-timepicker-minute").val(b),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(c),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(a),this.$widget.find("span.bootstrap-timepicker-minute").text(b),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(c),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))}},updateFromWidgetInputs:function(){if(!1!==this.$widget){var a=this.$widget.find("input.bootstrap-timepicker-hour").val()+":"+this.$widget.find("input.bootstrap-timepicker-minute").val()+(this.showSeconds?":"+this.$widget.find("input.bootstrap-timepicker-second").val():"")+(this.showMeridian?this.$widget.find("input.bootstrap-timepicker-meridian").val():"");this.setTime(a,!0)}},widgetClick:function(b){b.stopPropagation(),b.preventDefault();var c=a(b.target),d=c.closest("a").data("action");d&&this[d](),this.update(),c.is("input")&&c.get(0).setSelectionRange(0,2)},widgetKeydown:function(b){var c=a(b.target),d=c.attr("class").replace("bootstrap-timepicker-","");switch(b.which){case 9:if(b.shiftKey){if("hour"===d)return this.hideWidget()}else if(this.showMeridian&&"meridian"===d||this.showSeconds&&"second"===d||!this.showMeridian&&!this.showSeconds&&"minute"===d)return this.hideWidget();break;case 27:this.hideWidget();break;case 38:switch(b.preventDefault(),d){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),c.get(0).setSelectionRange(0,2);break;case 40:switch(b.preventDefault(),d){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),c.get(0).setSelectionRange(0,2)}},widgetKeyup:function(a){(65===a.which||77===a.which||80===a.which||46===a.which||8===a.which||a.which>=48&&a.which<=57||a.which>=96&&a.which<=105)&&this.updateFromWidgetInputs()}},a.fn.timepicker=function(b){var c=Array.apply(null,arguments);return c.shift(),this.each((function(){var e=a(this),f=e.data("timepicker"),g="object"==typeof b&&b;f||e.data("timepicker",f=new d(this,a.extend({},a.fn.timepicker.defaults,g,a(this).data()))),"string"==typeof b&&f[b].apply(f,c)}))},a.fn.timepicker.defaults={defaultTime:"current",disableFocus:!1,disableMousewheel:!1,isOpen:!1,minuteStep:15,modalBackdrop:!1,orientation:{x:"auto",y:"auto"},secondStep:15,snapToStep:!1,showSeconds:!1,showInputs:!0,showMeridian:!0,template:"dropdown",appendWidgetTo:"body",showWidgetOnAddonClick:!0,icons:{up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},maxHours:24,explicitMode:!1},a.fn.timepicker.Constructor=d,a(c).on("focus.timepicker.data-api click.timepicker.data-api",'[data-provide="timepicker"]',(function(b){var c=a(this);c.data("timepicker")||(b.preventDefault(),c.timepicker())}))}(jQuery,window,document),$.fn.timepicker.defaults=$.extend(!0,{},$.fn.timepicker.defaults,{icons:{up:"ki ki-arrow-up",down:"ki ki-arrow-down"}}),
|
||
/**
|
||
* @version: 3.1
|
||
* @author: Dan Grossman http://www.dangrossman.info/
|
||
* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved.
|
||
* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
|
||
* @website: http://www.daterangepicker.com/
|
||
*/
|
||
function(root,factory){if("function"==typeof define&&define.amd)define(["moment","jquery"],(function(moment,jquery){return jquery.fn||(jquery.fn={}),"function"!=typeof moment&&moment.hasOwnProperty("default")&&(moment=moment.default),factory(moment,jquery)}));else if("object"==typeof module&&module.exports){var jQuery="undefined"!=typeof window?window.jQuery:void 0;jQuery||(jQuery=require("jquery")).fn||(jQuery.fn={});var moment="undefined"!=typeof window&&void 0!==window.moment?window.moment:require("moment");module.exports=factory(moment,jQuery)}else root.daterangepicker=factory(root.moment,root.jQuery)}(this,(function(moment,$){var DateRangePicker=function(element,options,cb){if(this.parentEl="body",this.element=$(element),this.startDate=moment().startOf("day"),this.endDate=moment().endOf("day"),this.minDate=!1,this.maxDate=!1,this.maxSpan=!1,this.autoApply=!1,this.singleDatePicker=!1,this.showDropdowns=!1,this.minYear=moment().subtract(100,"year").format("YYYY"),this.maxYear=moment().add(100,"year").format("YYYY"),this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.timePicker=!1,this.timePicker24Hour=!1,this.timePickerIncrement=1,this.timePickerSeconds=!1,this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.ranges={},this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses="btn btn-sm",this.applyButtonClasses="btn-primary",this.cancelButtonClasses="btn-default",this.locale={direction:"ltr",format:moment.localeData().longDateFormat("L"),separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:moment.weekdaysMin(),monthNames:moment.monthsShort(),firstDay:moment.localeData().firstDayOfWeek()},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},"object"==typeof options&&null!==options||(options={}),"string"==typeof(options=$.extend(this.element.data(),options)).template||options.template instanceof $||(options.template='<div class="daterangepicker"><div class="ranges"></div><div class="drp-calendar left"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-calendar right"><div class="calendar-table"></div><div class="calendar-time"></div></div><div class="drp-buttons"><span class="drp-selected"></span><button class="cancelBtn" type="button"></button><button class="applyBtn" disabled="disabled" type="button"></button> </div></div>'),this.parentEl=options.parentEl&&$(options.parentEl).length?$(options.parentEl):$(this.parentEl),this.container=$(options.template).appendTo(this.parentEl),"object"==typeof options.locale&&("string"==typeof options.locale.direction&&(this.locale.direction=options.locale.direction),"string"==typeof options.locale.format&&(this.locale.format=options.locale.format),"string"==typeof options.locale.separator&&(this.locale.separator=options.locale.separator),"object"==typeof options.locale.daysOfWeek&&(this.locale.daysOfWeek=options.locale.daysOfWeek.slice()),"object"==typeof options.locale.monthNames&&(this.locale.monthNames=options.locale.monthNames.slice()),"number"==typeof options.locale.firstDay&&(this.locale.firstDay=options.locale.firstDay),"string"==typeof options.locale.applyLabel&&(this.locale.applyLabel=options.locale.applyLabel),"string"==typeof options.locale.cancelLabel&&(this.locale.cancelLabel=options.locale.cancelLabel),"string"==typeof options.locale.weekLabel&&(this.locale.weekLabel=options.locale.weekLabel),"string"==typeof options.locale.customRangeLabel)){var elem;(elem=document.createElement("textarea")).innerHTML=options.locale.customRangeLabel;var rangeHtml=elem.value;this.locale.customRangeLabel=rangeHtml}if(this.container.addClass(this.locale.direction),"string"==typeof options.startDate&&(this.startDate=moment(options.startDate,this.locale.format)),"string"==typeof options.endDate&&(this.endDate=moment(options.endDate,this.locale.format)),"string"==typeof options.minDate&&(this.minDate=moment(options.minDate,this.locale.format)),"string"==typeof options.maxDate&&(this.maxDate=moment(options.maxDate,this.locale.format)),"object"==typeof options.startDate&&(this.startDate=moment(options.startDate)),"object"==typeof options.endDate&&(this.endDate=moment(options.endDate)),"object"==typeof options.minDate&&(this.minDate=moment(options.minDate)),"object"==typeof options.maxDate&&(this.maxDate=moment(options.maxDate)),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),"string"==typeof options.applyButtonClasses&&(this.applyButtonClasses=options.applyButtonClasses),"string"==typeof options.applyClass&&(this.applyButtonClasses=options.applyClass),"string"==typeof options.cancelButtonClasses&&(this.cancelButtonClasses=options.cancelButtonClasses),"string"==typeof options.cancelClass&&(this.cancelButtonClasses=options.cancelClass),"object"==typeof options.maxSpan&&(this.maxSpan=options.maxSpan),"object"==typeof options.dateLimit&&(this.maxSpan=options.dateLimit),"string"==typeof options.opens&&(this.opens=options.opens),"string"==typeof options.drops&&(this.drops=options.drops),"boolean"==typeof options.showWeekNumbers&&(this.showWeekNumbers=options.showWeekNumbers),"boolean"==typeof options.showISOWeekNumbers&&(this.showISOWeekNumbers=options.showISOWeekNumbers),"string"==typeof options.buttonClasses&&(this.buttonClasses=options.buttonClasses),"object"==typeof options.buttonClasses&&(this.buttonClasses=options.buttonClasses.join(" ")),"boolean"==typeof options.showDropdowns&&(this.showDropdowns=options.showDropdowns),"number"==typeof options.minYear&&(this.minYear=options.minYear),"number"==typeof options.maxYear&&(this.maxYear=options.maxYear),"boolean"==typeof options.showCustomRangeLabel&&(this.showCustomRangeLabel=options.showCustomRangeLabel),"boolean"==typeof options.singleDatePicker&&(this.singleDatePicker=options.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),"boolean"==typeof options.timePicker&&(this.timePicker=options.timePicker),"boolean"==typeof options.timePickerSeconds&&(this.timePickerSeconds=options.timePickerSeconds),"number"==typeof options.timePickerIncrement&&(this.timePickerIncrement=options.timePickerIncrement),"boolean"==typeof options.timePicker24Hour&&(this.timePicker24Hour=options.timePicker24Hour),"boolean"==typeof options.autoApply&&(this.autoApply=options.autoApply),"boolean"==typeof options.autoUpdateInput&&(this.autoUpdateInput=options.autoUpdateInput),"boolean"==typeof options.linkedCalendars&&(this.linkedCalendars=options.linkedCalendars),"function"==typeof options.isInvalidDate&&(this.isInvalidDate=options.isInvalidDate),"function"==typeof options.isCustomDate&&(this.isCustomDate=options.isCustomDate),"boolean"==typeof options.alwaysShowCalendars&&(this.alwaysShowCalendars=options.alwaysShowCalendars),0!=this.locale.firstDay)for(var iterator=this.locale.firstDay;iterator>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),iterator--;var start,end,range;if(void 0===options.startDate&&void 0===options.endDate&&$(this.element).is(":text")){var val=$(this.element).val(),split=val.split(this.locale.separator);start=end=null,2==split.length?(start=moment(split[0],this.locale.format),end=moment(split[1],this.locale.format)):this.singleDatePicker&&""!==val&&(start=moment(val,this.locale.format),end=moment(val,this.locale.format)),null!==start&&null!==end&&(this.setStartDate(start),this.setEndDate(end))}if("object"==typeof options.ranges){for(range in options.ranges){start="string"==typeof options.ranges[range][0]?moment(options.ranges[range][0],this.locale.format):moment(options.ranges[range][0]),end="string"==typeof options.ranges[range][1]?moment(options.ranges[range][1],this.locale.format):moment(options.ranges[range][1]),this.minDate&&start.isBefore(this.minDate)&&(start=this.minDate.clone());var maxDate=this.maxDate;if(this.maxSpan&&maxDate&&start.clone().add(this.maxSpan).isAfter(maxDate)&&(maxDate=start.clone().add(this.maxSpan)),maxDate&&end.isAfter(maxDate)&&(end=maxDate.clone()),!(this.minDate&&end.isBefore(this.minDate,this.timepicker?"minute":"day")||maxDate&&start.isAfter(maxDate,this.timepicker?"minute":"day"))){var elem;(elem=document.createElement("textarea")).innerHTML=range;var rangeHtml=elem.value;this.ranges[rangeHtml]=[start,end]}}var list="<ul>";for(range in this.ranges)list+='<li data-range-key="'+range+'">'+range+"</li>";this.showCustomRangeLabel&&(list+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+"</li>"),list+="</ul>",this.container.find(".ranges").prepend(list)}"function"==typeof cb&&(this.callback=cb),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide()),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&this.container.addClass("auto-apply"),"object"==typeof options.ranges&&this.container.addClass("show-ranges"),this.singleDatePicker&&(this.container.addClass("single"),this.container.find(".drp-calendar.left").addClass("single"),this.container.find(".drp-calendar.left").show(),this.container.find(".drp-calendar.right").hide(),!this.timePicker&&this.autoApply&&this.container.addClass("auto-apply")),(void 0===options.ranges&&!this.singleDatePicker||this.alwaysShowCalendars)&&this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyButtonClasses.length&&this.container.find(".applyBtn").addClass(this.applyButtonClasses),this.cancelButtonClasses.length&&this.container.find(".cancelBtn").addClass(this.cancelButtonClasses),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".drp-calendar").on("click.daterangepicker",".prev",$.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",$.proxy(this.clickNext,this)).on("mousedown.daterangepicker","td.available",$.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",$.proxy(this.hoverDate,this)).on("change.daterangepicker","select.yearselect",$.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",$.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",$.proxy(this.timeChanged,this)),this.container.find(".ranges").on("click.daterangepicker","li",$.proxy(this.clickRange,this)),this.container.find(".drp-buttons").on("click.daterangepicker","button.applyBtn",$.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",$.proxy(this.clickCancel,this)),this.element.is("input")||this.element.is("button")?this.element.on({"click.daterangepicker":$.proxy(this.show,this),"focus.daterangepicker":$.proxy(this.show,this),"keyup.daterangepicker":$.proxy(this.elementChanged,this),"keydown.daterangepicker":$.proxy(this.keydown,this)}):(this.element.on("click.daterangepicker",$.proxy(this.toggle,this)),this.element.on("keydown.daterangepicker",$.proxy(this.toggle,this))),this.updateElement()};return DateRangePicker.prototype={constructor:DateRangePicker,setStartDate:function(startDate){"string"==typeof startDate&&(this.startDate=moment(startDate,this.locale.format)),"object"==typeof startDate&&(this.startDate=moment(startDate)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.floor(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.isShowing||this.updateElement(),this.updateMonthsInView()},setEndDate:function(endDate){"string"==typeof endDate&&(this.endDate=moment(endDate,this.locale.format)),"object"==typeof endDate&&(this.endDate=moment(endDate)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),this.maxSpan&&this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.maxSpan)),this.previousRightTime=this.endDate.clone(),this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.isShowing||this.updateElement(),this.updateMonthsInView()},isInvalidDate:function(){return!1},isCustomDate:function(){return!1},updateView:function(){this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").prop("disabled",!1).removeClass("disabled"):this.container.find(".right .calendar-time select").prop("disabled",!0).addClass("disabled")),this.endDate&&this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.updateMonthsInView(),this.updateCalendars(),this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.startDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM"))&&(this.endDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.endDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM")))return;this.leftCalendar.month=this.startDate.clone().date(2),this.linkedCalendars||this.endDate.month()==this.startDate.month()&&this.endDate.year()==this.startDate.year()?this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"):this.rightCalendar.month=this.endDate.clone().date(2)}else this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"));this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&this.rightCalendar.month>this.maxDate&&(this.rightCalendar.month=this.maxDate.clone().date(2),this.leftCalendar.month=this.maxDate.clone().date(2).subtract(1,"month"))},updateCalendars:function(){if(this.timePicker){var hour,minute,second,ampm,ampm;if(this.endDate){if(hour=parseInt(this.container.find(".left .hourselect").val(),10),minute=parseInt(this.container.find(".left .minuteselect").val(),10),isNaN(minute)&&(minute=parseInt(this.container.find(".left .minuteselect option:last").val(),10)),second=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,!this.timePicker24Hour)"PM"===(ampm=this.container.find(".left .ampmselect").val())&&hour<12&&(hour+=12),"AM"===ampm&&12===hour&&(hour=0)}else if(hour=parseInt(this.container.find(".right .hourselect").val(),10),minute=parseInt(this.container.find(".right .minuteselect").val(),10),isNaN(minute)&&(minute=parseInt(this.container.find(".right .minuteselect option:last").val(),10)),second=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,!this.timePicker24Hour)"PM"===(ampm=this.container.find(".right .ampmselect").val())&&hour<12&&(hour+=12),"AM"===ampm&&12===hour&&(hour=0);this.leftCalendar.month.hour(hour).minute(minute).second(second),this.rightCalendar.month.hour(hour).minute(minute).second(second)}this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),null!=this.endDate&&this.calculateChosenLabel()},renderCalendar:function(side){var calendar,month=(calendar="left"==side?this.leftCalendar:this.rightCalendar).month.month(),year=calendar.month.year(),hour=calendar.month.hour(),minute=calendar.month.minute(),second=calendar.month.second(),daysInMonth=moment([year,month]).daysInMonth(),firstDay=moment([year,month,1]),lastDay=moment([year,month,daysInMonth]),lastMonth=moment(firstDay).subtract(1,"month").month(),lastYear=moment(firstDay).subtract(1,"month").year(),daysInLastMonth=moment([lastYear,lastMonth]).daysInMonth(),dayOfWeek=firstDay.day(),calendar;(calendar=[]).firstDay=firstDay,calendar.lastDay=lastDay;for(var i=0;i<6;i++)calendar[i]=[];var startDay=daysInLastMonth-dayOfWeek+this.locale.firstDay+1;startDay>daysInLastMonth&&(startDay-=7),dayOfWeek==this.locale.firstDay&&(startDay=daysInLastMonth-6);for(var curDate=moment([lastYear,lastMonth,startDay,12,minute,second]),col,row,i=0,col=0,row=0;i<42;i++,col++,curDate=moment(curDate).add(24,"hour"))i>0&&col%7==0&&(col=0,row++),calendar[row][col]=curDate.clone().hour(hour).minute(minute).second(second),curDate.hour(12),this.minDate&&calendar[row][col].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&calendar[row][col].isBefore(this.minDate)&&"left"==side&&(calendar[row][col]=this.minDate.clone()),this.maxDate&&calendar[row][col].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&calendar[row][col].isAfter(this.maxDate)&&"right"==side&&(calendar[row][col]=this.maxDate.clone());"left"==side?this.leftCalendar.calendar=calendar:this.rightCalendar.calendar=calendar;var minDate="left"==side?this.minDate:this.startDate,maxDate=this.maxDate,selected="left"==side?this.startDate:this.endDate,arrow="ltr"==this.locale.direction?{left:"chevron-left",right:"chevron-right"}:{left:"chevron-right",right:"chevron-left"},html='<table class="table-condensed">';html+="<thead>",html+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(html+="<th></th>"),minDate&&!minDate.isBefore(calendar.firstDay)||this.linkedCalendars&&"left"!=side?html+="<th></th>":html+='<th class="prev available"><span></span></th>';var dateHtml=this.locale.monthNames[calendar[1][1].month()]+calendar[1][1].format(" YYYY");if(this.showDropdowns){for(var currentMonth=calendar[1][1].month(),currentYear=calendar[1][1].year(),maxYear=maxDate&&maxDate.year()||this.maxYear,minYear=minDate&&minDate.year()||this.minYear,inMinYear=currentYear==minYear,inMaxYear=currentYear==maxYear,monthHtml='<select class="monthselect">',m=0;m<12;m++)(!inMinYear||minDate&&m>=minDate.month())&&(!inMaxYear||maxDate&&m<=maxDate.month())?monthHtml+="<option value='"+m+"'"+(m===currentMonth?" selected='selected'":"")+">"+this.locale.monthNames[m]+"</option>":monthHtml+="<option value='"+m+"'"+(m===currentMonth?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[m]+"</option>";monthHtml+="</select>";for(var yearHtml='<select class="yearselect">',y=minYear;y<=maxYear;y++)yearHtml+='<option value="'+y+'"'+(y===currentYear?' selected="selected"':"")+">"+y+"</option>";dateHtml=monthHtml+(yearHtml+="</select>")}if(html+='<th colspan="5" class="month">'+dateHtml+"</th>",maxDate&&!maxDate.isAfter(calendar.lastDay)||this.linkedCalendars&&"right"!=side&&!this.singleDatePicker?html+="<th></th>":html+='<th class="next available"><span></span></th>',html+="</tr>",html+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(html+='<th class="week">'+this.locale.weekLabel+"</th>"),$.each(this.locale.daysOfWeek,(function(index,dayOfWeek){html+="<th>"+dayOfWeek+"</th>"})),html+="</tr>",html+="</thead>",html+="<tbody>",null==this.endDate&&this.maxSpan){var maxLimit=this.startDate.clone().add(this.maxSpan).endOf("day");maxDate&&!maxLimit.isBefore(maxDate)||(maxDate=maxLimit)}for(var row=0;row<6;row++){html+="<tr>",this.showWeekNumbers?html+='<td class="week">'+calendar[row][0].week()+"</td>":this.showISOWeekNumbers&&(html+='<td class="week">'+calendar[row][0].isoWeek()+"</td>");for(var col=0;col<7;col++){var classes=[];calendar[row][col].isSame(new Date,"day")&&classes.push("today"),calendar[row][col].isoWeekday()>5&&classes.push("weekend"),calendar[row][col].month()!=calendar[1][1].month()&&classes.push("off","ends"),this.minDate&&calendar[row][col].isBefore(this.minDate,"day")&&classes.push("off","disabled"),maxDate&&calendar[row][col].isAfter(maxDate,"day")&&classes.push("off","disabled"),this.isInvalidDate(calendar[row][col])&&classes.push("off","disabled"),calendar[row][col].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&classes.push("active","start-date"),null!=this.endDate&&calendar[row][col].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&classes.push("active","end-date"),null!=this.endDate&&calendar[row][col]>this.startDate&&calendar[row][col]<this.endDate&&classes.push("in-range");var isCustom=this.isCustomDate(calendar[row][col]);!1!==isCustom&&("string"==typeof isCustom?classes.push(isCustom):Array.prototype.push.apply(classes,isCustom));for(var cname="",disabled=!1,i=0;i<classes.length;i++)cname+=classes[i]+" ","disabled"==classes[i]&&(disabled=!0);disabled||(cname+="available"),html+='<td class="'+cname.replace(/^\s+|\s+$/g,"")+'" data-title="r'+row+"c"+col+'">'+calendar[row][col].date()+"</td>"}html+="</tr>"}html+="</tbody>",html+="</table>",this.container.find(".drp-calendar."+side+" .calendar-table").html(html)},renderTimePicker:function(side){if("right"!=side||this.endDate){var html,selected,minDate,maxDate=this.maxDate;if(!this.maxSpan||this.maxDate&&!this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate)||(maxDate=this.startDate.clone().add(this.maxSpan)),"left"==side)selected=this.startDate.clone(),minDate=this.minDate;else if("right"==side){selected=this.endDate.clone(),minDate=this.startDate;var timeSelector=this.container.find(".drp-calendar.right .calendar-time");if(""!=timeSelector.html()&&(selected.hour(isNaN(selected.hour())?timeSelector.find(".hourselect option:selected").val():selected.hour()),selected.minute(isNaN(selected.minute())?timeSelector.find(".minuteselect option:selected").val():selected.minute()),selected.second(isNaN(selected.second())?timeSelector.find(".secondselect option:selected").val():selected.second()),!this.timePicker24Hour)){var ampm=timeSelector.find(".ampmselect option:selected").val();"PM"===ampm&&selected.hour()<12&&selected.hour(selected.hour()+12),"AM"===ampm&&12===selected.hour()&&selected.hour(0)}selected.isBefore(this.startDate)&&(selected=this.startDate.clone()),maxDate&&selected.isAfter(maxDate)&&(selected=maxDate.clone())}html='<select class="hourselect">';for(var start=this.timePicker24Hour?0:1,end=this.timePicker24Hour?23:12,i=start;i<=end;i++){var i_in_24=i;this.timePicker24Hour||(i_in_24=selected.hour()>=12?12==i?12:i+12:12==i?0:i);var time=selected.clone().hour(i_in_24),disabled=!1;minDate&&time.minute(59).isBefore(minDate)&&(disabled=!0),maxDate&&time.minute(0).isAfter(maxDate)&&(disabled=!0),i_in_24!=selected.hour()||disabled?html+=disabled?'<option value="'+i+'" disabled="disabled" class="disabled">'+i+"</option>":'<option value="'+i+'">'+i+"</option>":html+='<option value="'+i+'" selected="selected">'+i+"</option>"}html+="</select> ",html+=': <select class="minuteselect">';for(var i=0;i<60;i+=this.timePickerIncrement){var padded=i<10?"0"+i:i,time=selected.clone().minute(i),disabled=!1;minDate&&time.second(59).isBefore(minDate)&&(disabled=!0),maxDate&&time.second(0).isAfter(maxDate)&&(disabled=!0),selected.minute()!=i||disabled?html+=disabled?'<option value="'+i+'" disabled="disabled" class="disabled">'+padded+"</option>":'<option value="'+i+'">'+padded+"</option>":html+='<option value="'+i+'" selected="selected">'+padded+"</option>"}if(html+="</select> ",this.timePickerSeconds){html+=': <select class="secondselect">';for(var i=0;i<60;i++){var padded=i<10?"0"+i:i,time=selected.clone().second(i),disabled=!1;minDate&&time.isBefore(minDate)&&(disabled=!0),maxDate&&time.isAfter(maxDate)&&(disabled=!0),selected.second()!=i||disabled?html+=disabled?'<option value="'+i+'" disabled="disabled" class="disabled">'+padded+"</option>":'<option value="'+i+'">'+padded+"</option>":html+='<option value="'+i+'" selected="selected">'+padded+"</option>"}html+="</select> "}if(!this.timePicker24Hour){html+='<select class="ampmselect">';var am_html="",pm_html="";minDate&&selected.clone().hour(12).minute(0).second(0).isBefore(minDate)&&(am_html=' disabled="disabled" class="disabled"'),maxDate&&selected.clone().hour(0).minute(0).second(0).isAfter(maxDate)&&(pm_html=' disabled="disabled" class="disabled"'),selected.hour()>=12?html+='<option value="AM"'+am_html+'>AM</option><option value="PM" selected="selected"'+pm_html+">PM</option>":html+='<option value="AM" selected="selected"'+am_html+'>AM</option><option value="PM"'+pm_html+">PM</option>",html+="</select>"}this.container.find(".drp-calendar."+side+" .calendar-time").html(html)}},updateFormInputs:function(){this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").prop("disabled",!1):this.container.find("button.applyBtn").prop("disabled",!0)},move:function(){var parentOffset={top:0,left:0},containerTop,drops=this.drops,parentRightEdge=$(window).width();switch(this.parentEl.is("body")||(parentOffset={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},parentRightEdge=this.parentEl[0].clientWidth+this.parentEl.offset().left),drops){case"auto":(containerTop=this.element.offset().top+this.element.outerHeight()-parentOffset.top)+this.container.outerHeight()>=this.parentEl[0].scrollHeight&&(containerTop=this.element.offset().top-this.container.outerHeight()-parentOffset.top,drops="up");break;case"up":containerTop=this.element.offset().top-this.container.outerHeight()-parentOffset.top;break;default:containerTop=this.element.offset().top+this.element.outerHeight()-parentOffset.top}this.container.css({top:0,left:0,right:"auto"});var containerWidth=this.container.outerWidth();if(this.container.toggleClass("drop-up","up"==drops),"left"==this.opens){var containerRight=parentRightEdge-this.element.offset().left-this.element.outerWidth();containerWidth+containerRight>$(window).width()?this.container.css({top:containerTop,right:"auto",left:9}):this.container.css({top:containerTop,right:containerRight,left:"auto"})}else if("center"==this.opens){var containerLeft;(containerLeft=this.element.offset().left-parentOffset.left+this.element.outerWidth()/2-containerWidth/2)<0?this.container.css({top:containerTop,right:"auto",left:9}):containerLeft+containerWidth>$(window).width()?this.container.css({top:containerTop,left:"auto",right:0}):this.container.css({top:containerTop,left:containerLeft,right:"auto"})}else{var containerLeft;(containerLeft=this.element.offset().left-parentOffset.left)+containerWidth>$(window).width()?this.container.css({top:containerTop,left:"auto",right:0}):this.container.css({top:containerTop,left:containerLeft,right:"auto"})}},show:function(e){this.isShowing||(this._outsideClickProxy=$.proxy((function(e){this.outsideClick(e)}),this),$(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),$(window).on("resize.daterangepicker",$.proxy((function(e){this.move(e)}),this)),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.previousRightTime=this.endDate.clone(),this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)},hide:function(e){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate.clone(),this.endDate.clone(),this.chosenLabel),this.updateElement(),$(document).off(".daterangepicker"),$(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1)},toggle:function(e){this.isShowing?this.hide():this.show()},outsideClick:function(e){var target=$(e.target);"focusin"==e.type||target.closest(this.element).length||target.closest(this.container).length||target.closest(".calendar-table").length||(this.hide(),this.element.trigger("outsideClick.daterangepicker",this))},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)},clickRange:function(e){var label=e.target.getAttribute("data-range-key");if(this.chosenLabel=label,label==this.locale.customRangeLabel)this.showCalendars();else{var dates=this.ranges[label];this.startDate=dates[0],this.endDate=dates[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.alwaysShowCalendars||this.hideCalendars(),this.clickApply()}},clickPrev:function(e){var cal;$(e.target).parents(".drp-calendar").hasClass("left")?(this.leftCalendar.month.subtract(1,"month"),this.linkedCalendars&&this.rightCalendar.month.subtract(1,"month")):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(e){var cal;$(e.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.month.add(1,"month"):(this.rightCalendar.month.add(1,"month"),this.linkedCalendars&&this.leftCalendar.month.add(1,"month")),this.updateCalendars()},hoverDate:function(e){if($(e.target).hasClass("available")){var title=$(e.target).attr("data-title"),row=title.substr(1,1),col=title.substr(3,1),cal,date=$(e.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[row][col]:this.rightCalendar.calendar[row][col],leftCalendar=this.leftCalendar,rightCalendar=this.rightCalendar,startDate=this.startDate;this.endDate||this.container.find(".drp-calendar tbody td").each((function(index,el){if(!$(el).hasClass("week")){var title=$(el).attr("data-title"),row=title.substr(1,1),col=title.substr(3,1),cal,dt=$(el).parents(".drp-calendar").hasClass("left")?leftCalendar.calendar[row][col]:rightCalendar.calendar[row][col];dt.isAfter(startDate)&&dt.isBefore(date)||dt.isSame(date,"day")?$(el).addClass("in-range"):$(el).removeClass("in-range")}}))}},clickDate:function(e){if($(e.target).hasClass("available")){var title=$(e.target).attr("data-title"),row=title.substr(1,1),col=title.substr(3,1),cal,date=$(e.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[row][col]:this.rightCalendar.calendar[row][col];if(this.endDate||date.isBefore(this.startDate,"day")){if(this.timePicker){var hour=parseInt(this.container.find(".left .hourselect").val(),10),ampm;if(!this.timePicker24Hour)"PM"===(ampm=this.container.find(".left .ampmselect").val())&&hour<12&&(hour+=12),"AM"===ampm&&12===hour&&(hour=0);var minute=parseInt(this.container.find(".left .minuteselect").val(),10);isNaN(minute)&&(minute=parseInt(this.container.find(".left .minuteselect option:last").val(),10));var second=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0;date=date.clone().hour(hour).minute(minute).second(second)}this.endDate=null,this.setStartDate(date.clone())}else if(!this.endDate&&date.isBefore(this.startDate))this.setEndDate(this.startDate.clone());else{if(this.timePicker){var hour=parseInt(this.container.find(".right .hourselect").val(),10),ampm;if(!this.timePicker24Hour)"PM"===(ampm=this.container.find(".right .ampmselect").val())&&hour<12&&(hour+=12),"AM"===ampm&&12===hour&&(hour=0);var minute=parseInt(this.container.find(".right .minuteselect").val(),10);isNaN(minute)&&(minute=parseInt(this.container.find(".right .minuteselect option:last").val(),10));var second=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0;date=date.clone().hour(hour).minute(minute).second(second)}this.setEndDate(date.clone()),this.autoApply&&(this.calculateChosenLabel(),this.clickApply())}this.singleDatePicker&&(this.setEndDate(this.startDate),!this.timePicker&&this.autoApply&&this.clickApply()),this.updateView(),e.stopPropagation()}},calculateChosenLabel:function(){var customRange=!0,i=0;for(var range in this.ranges){if(this.timePicker){var format=this.timePickerSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm";if(this.startDate.format(format)==this.ranges[range][0].format(format)&&this.endDate.format(format)==this.ranges[range][1].format(format)){customRange=!1,this.chosenLabel=this.container.find(".ranges li:eq("+i+")").addClass("active").attr("data-range-key");break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[range][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[range][1].format("YYYY-MM-DD")){customRange=!1,this.chosenLabel=this.container.find(".ranges li:eq("+i+")").addClass("active").attr("data-range-key");break}i++}customRange&&(this.showCustomRangeLabel?this.chosenLabel=this.container.find(".ranges li:last").addClass("active").attr("data-range-key"):this.chosenLabel=null,this.showCalendars())},clickApply:function(e){this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(e){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(e){var isLeft=$(e.target).closest(".drp-calendar").hasClass("left"),leftOrRight=isLeft?"left":"right",cal=this.container.find(".drp-calendar."+leftOrRight),month=parseInt(cal.find(".monthselect").val(),10),year=cal.find(".yearselect").val();isLeft||(year<this.startDate.year()||year==this.startDate.year()&&month<this.startDate.month())&&(month=this.startDate.month(),year=this.startDate.year()),this.minDate&&(year<this.minDate.year()||year==this.minDate.year()&&month<this.minDate.month())&&(month=this.minDate.month(),year=this.minDate.year()),this.maxDate&&(year>this.maxDate.year()||year==this.maxDate.year()&&month>this.maxDate.month())&&(month=this.maxDate.month(),year=this.maxDate.year()),isLeft?(this.leftCalendar.month.month(month).year(year),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.clone().add(1,"month"))):(this.rightCalendar.month.month(month).year(year),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,"month"))),this.updateCalendars()},timeChanged:function(e){var cal=$(e.target).closest(".drp-calendar"),isLeft=cal.hasClass("left"),hour=parseInt(cal.find(".hourselect").val(),10),minute=parseInt(cal.find(".minuteselect").val(),10);isNaN(minute)&&(minute=parseInt(cal.find(".minuteselect option:last").val(),10));var second=this.timePickerSeconds?parseInt(cal.find(".secondselect").val(),10):0;if(!this.timePicker24Hour){var ampm=cal.find(".ampmselect").val();"PM"===ampm&&hour<12&&(hour+=12),"AM"===ampm&&12===hour&&(hour=0)}if(isLeft){var start=this.startDate.clone();start.hour(hour),start.minute(minute),start.second(second),this.setStartDate(start),this.singleDatePicker?this.endDate=this.startDate.clone():this.endDate&&this.endDate.format("YYYY-MM-DD")==start.format("YYYY-MM-DD")&&this.endDate.isBefore(start)&&this.setEndDate(start.clone())}else if(this.endDate){var end=this.endDate.clone();end.hour(hour),end.minute(minute),end.second(second),this.setEndDate(end)}this.updateCalendars(),this.updateFormInputs(),this.renderTimePicker("left"),this.renderTimePicker("right")},elementChanged:function(){if(this.element.is("input")&&this.element.val().length){var dateString=this.element.val().split(this.locale.separator),start=null,end=null;2===dateString.length&&(start=moment(dateString[0],this.locale.format),end=moment(dateString[1],this.locale.format)),(this.singleDatePicker||null===start||null===end)&&(end=start=moment(this.element.val(),this.locale.format)),start.isValid()&&end.isValid()&&(this.setStartDate(start),this.setEndDate(end),this.updateView())}},keydown:function(e){9!==e.keyCode&&13!==e.keyCode||this.hide(),27===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.hide())},updateElement:function(){if(this.element.is("input")&&this.autoUpdateInput){var newValue=this.startDate.format(this.locale.format);this.singleDatePicker||(newValue+=this.locale.separator+this.endDate.format(this.locale.format)),newValue!==this.element.val()&&this.element.val(newValue).trigger("change")}},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}},$.fn.daterangepicker=function(options,callback){var implementOptions=$.extend(!0,{},$.fn.daterangepicker.defaultOptions,options);return this.each((function(){var el=$(this);el.data("daterangepicker")&&el.data("daterangepicker").remove(),el.data("daterangepicker",new DateRangePicker(el,implementOptions,callback))})),this},DateRangePicker})),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=function(root,jQuery){return void 0===jQuery&&(jQuery="undefined"!=typeof window?require("jquery"):require("jquery")(root)),factory(jQuery),jQuery}:factory(jQuery)}((function($){"use strict";var _currentSpinnerId=0;$.fn.TouchSpin=function(options){var defaults={min:0,max:100,initval:"",replacementval:"",firstclickvalueifempty:null,step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalup:"+",verticaldown:"-",verticalupclass:"",verticaldownclass:"",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-primary",buttonup_class:"btn btn-primary",buttondown_txt:"-",buttonup_txt:"+",callback_before_calculation:function(value){return value},callback_after_calculation:function(value){return value}},attributeMap={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",firstclickvalueifempty:"first-click-value-if-empty",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each((function(){var settings,originalinput=$(this),originalinput_data=originalinput.data(),_detached_prefix,_detached_postfix,container,elements,value,downSpinTimer,upSpinTimer,downDelayTimeout,upDelayTimeout,spincount=0,spinning=!1;function init(){originalinput.data("alreadyinitialized")||(originalinput.data("alreadyinitialized",!0),_currentSpinnerId+=1,originalinput.data("spinnerid",_currentSpinnerId),originalinput.is("input")?(_initSettings(),_setInitval(),_checkValue(),_buildHtml(),_initElements(),_hideEmptyPrefixPostfix(),_bindEvents(),_bindEventsInterface()):console.log("Must be an input."))}function _setInitval(){""!==settings.initval&&""===originalinput.val()&&originalinput.val(settings.initval)}function changeSettings(newsettings){_updateSettings(newsettings),_checkValue();var value=elements.input.val();""!==value&&(value=Number(settings.callback_before_calculation(elements.input.val())),elements.input.val(settings.callback_after_calculation(Number(value).toFixed(settings.decimals))))}function _initSettings(){settings=$.extend({},defaults,originalinput_data,_parseAttributes(),options)}function _parseAttributes(){var data={};return $.each(attributeMap,(function(key,value){var attrName="bts-"+value;originalinput.is("[data-"+attrName+"]")&&(data[key]=originalinput.data(attrName))})),data}function _destroy(){var $parent=originalinput.parent();stopSpin(),originalinput.off(".touchspin"),$parent.hasClass("bootstrap-touchspin-injected")?(originalinput.siblings().remove(),originalinput.unwrap()):($(".bootstrap-touchspin-injected",$parent).remove(),$parent.removeClass("bootstrap-touchspin")),originalinput.data("alreadyinitialized",!1)}function _updateSettings(newsettings){var $postfix,$prefix;(settings=$.extend({},settings,newsettings),newsettings.postfix)&&(0===originalinput.parent().find(".bootstrap-touchspin-postfix").length&&_detached_postfix.insertAfter(originalinput),originalinput.parent().find(".bootstrap-touchspin-postfix .input-group-text").text(newsettings.postfix));newsettings.prefix&&(0===originalinput.parent().find(".bootstrap-touchspin-prefix").length&&_detached_prefix.insertBefore(originalinput),originalinput.parent().find(".bootstrap-touchspin-prefix .input-group-text").text(newsettings.prefix));_hideEmptyPrefixPostfix()}function _buildHtml(){var initval=originalinput.val(),parentelement=originalinput.parent();""!==initval&&(initval=settings.callback_after_calculation(Number(initval).toFixed(settings.decimals))),originalinput.data("initvalue",initval).val(initval),originalinput.addClass("form-control"),parentelement.hasClass("input-group")?_advanceInputGroup(parentelement):_buildInputGroup()}function _advanceInputGroup(parentelement){parentelement.addClass("bootstrap-touchspin");var prev=originalinput.prev(),next=originalinput.next(),downhtml,uphtml,prefixhtml='<span class="input-group-addon input-group-prepend bootstrap-touchspin-prefix input-group-prepend bootstrap-touchspin-injected"><span class="input-group-text">'+settings.prefix+"</span></span>",postfixhtml='<span class="input-group-addon input-group-append bootstrap-touchspin-postfix input-group-append bootstrap-touchspin-injected"><span class="input-group-text">'+settings.postfix+"</span></span>";prev.hasClass("input-group-btn")||prev.hasClass("input-group-prepend")?(downhtml='<button class="'+settings.buttondown_class+' bootstrap-touchspin-down bootstrap-touchspin-injected" type="button">'+settings.buttondown_txt+"</button>",prev.append(downhtml)):(downhtml='<span class="input-group-btn input-group-prepend bootstrap-touchspin-injected"><button class="'+settings.buttondown_class+' bootstrap-touchspin-down" type="button">'+settings.buttondown_txt+"</button></span>",$(downhtml).insertBefore(originalinput)),next.hasClass("input-group-btn")||next.hasClass("input-group-append")?(uphtml='<button class="'+settings.buttonup_class+' bootstrap-touchspin-up bootstrap-touchspin-injected" type="button">'+settings.buttonup_txt+"</button>",next.prepend(uphtml)):(uphtml='<span class="input-group-btn input-group-append bootstrap-touchspin-injected"><button class="'+settings.buttonup_class+' bootstrap-touchspin-up" type="button">'+settings.buttonup_txt+"</button></span>",$(uphtml).insertAfter(originalinput)),$(prefixhtml).insertBefore(originalinput),$(postfixhtml).insertAfter(originalinput),container=parentelement}function _buildInputGroup(){var html,inputGroupSize="";originalinput.hasClass("input-sm")&&(inputGroupSize="input-group-sm"),originalinput.hasClass("input-lg")&&(inputGroupSize="input-group-lg"),html=settings.verticalbuttons?'<div class="input-group '+inputGroupSize+' bootstrap-touchspin bootstrap-touchspin-injected"><span class="input-group-addon input-group-prepend bootstrap-touchspin-prefix"><span class="input-group-text">'+settings.prefix+'</span></span><span class="input-group-addon bootstrap-touchspin-postfix input-group-append"><span class="input-group-text">'+settings.postfix+'</span></span><span class="input-group-btn-vertical"><button class="'+settings.buttondown_class+" bootstrap-touchspin-up "+settings.verticalupclass+'" type="button">'+settings.verticalup+'</button><button class="'+settings.buttonup_class+" bootstrap-touchspin-down "+settings.verticaldownclass+'" type="button">'+settings.verticaldown+"</button></span></div>":'<div class="input-group bootstrap-touchspin bootstrap-touchspin-injected"><span class="input-group-btn input-group-prepend"><button class="'+settings.buttondown_class+' bootstrap-touchspin-down" type="button">'+settings.buttondown_txt+'</button></span><span class="input-group-addon bootstrap-touchspin-prefix input-group-prepend"><span class="input-group-text">'+settings.prefix+'</span></span><span class="input-group-addon bootstrap-touchspin-postfix input-group-append"><span class="input-group-text">'+settings.postfix+'</span></span><span class="input-group-btn input-group-append"><button class="'+settings.buttonup_class+' bootstrap-touchspin-up" type="button">'+settings.buttonup_txt+"</button></span></div>",container=$(html).insertBefore(originalinput),$(".bootstrap-touchspin-prefix",container).after(originalinput),originalinput.hasClass("input-sm")?container.addClass("input-group-sm"):originalinput.hasClass("input-lg")&&container.addClass("input-group-lg")}function _initElements(){elements={down:$(".bootstrap-touchspin-down",container),up:$(".bootstrap-touchspin-up",container),input:$("input",container),prefix:$(".bootstrap-touchspin-prefix",container).addClass(settings.prefix_extraclass),postfix:$(".bootstrap-touchspin-postfix",container).addClass(settings.postfix_extraclass)}}function _hideEmptyPrefixPostfix(){""===settings.prefix&&(_detached_prefix=elements.prefix.detach()),""===settings.postfix&&(_detached_postfix=elements.postfix.detach())}function _bindEvents(){originalinput.on("keydown.touchspin",(function(ev){var code=ev.keyCode||ev.which;38===code?("up"!==spinning&&(upOnce(),startUpSpin()),ev.preventDefault()):40===code&&("down"!==spinning&&(downOnce(),startDownSpin()),ev.preventDefault())})),originalinput.on("keyup.touchspin",(function(ev){var code=ev.keyCode||ev.which;38===code?stopSpin():40===code&&stopSpin()})),originalinput.on("blur.touchspin",(function(){_checkValue(),originalinput.val(settings.callback_after_calculation(originalinput.val()))})),elements.down.on("keydown",(function(ev){var code=ev.keyCode||ev.which;32!==code&&13!==code||("down"!==spinning&&(downOnce(),startDownSpin()),ev.preventDefault())})),elements.down.on("keyup.touchspin",(function(ev){var code=ev.keyCode||ev.which;32!==code&&13!==code||stopSpin()})),elements.up.on("keydown.touchspin",(function(ev){var code=ev.keyCode||ev.which;32!==code&&13!==code||("up"!==spinning&&(upOnce(),startUpSpin()),ev.preventDefault())})),elements.up.on("keyup.touchspin",(function(ev){var code=ev.keyCode||ev.which;32!==code&&13!==code||stopSpin()})),elements.down.on("mousedown.touchspin",(function(ev){elements.down.off("touchstart.touchspin"),originalinput.is(":disabled")||(downOnce(),startDownSpin(),ev.preventDefault(),ev.stopPropagation())})),elements.down.on("touchstart.touchspin",(function(ev){elements.down.off("mousedown.touchspin"),originalinput.is(":disabled")||(downOnce(),startDownSpin(),ev.preventDefault(),ev.stopPropagation())})),elements.up.on("mousedown.touchspin",(function(ev){elements.up.off("touchstart.touchspin"),originalinput.is(":disabled")||(upOnce(),startUpSpin(),ev.preventDefault(),ev.stopPropagation())})),elements.up.on("touchstart.touchspin",(function(ev){elements.up.off("mousedown.touchspin"),originalinput.is(":disabled")||(upOnce(),startUpSpin(),ev.preventDefault(),ev.stopPropagation())})),elements.up.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",(function(ev){spinning&&(ev.stopPropagation(),stopSpin())})),elements.down.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",(function(ev){spinning&&(ev.stopPropagation(),stopSpin())})),elements.down.on("mousemove.touchspin touchmove.touchspin",(function(ev){spinning&&(ev.stopPropagation(),ev.preventDefault())})),elements.up.on("mousemove.touchspin touchmove.touchspin",(function(ev){spinning&&(ev.stopPropagation(),ev.preventDefault())})),originalinput.on("mousewheel.touchspin DOMMouseScroll.touchspin",(function(ev){if(settings.mousewheel&&originalinput.is(":focus")){var delta=ev.originalEvent.wheelDelta||-ev.originalEvent.deltaY||-ev.originalEvent.detail;ev.stopPropagation(),ev.preventDefault(),delta<0?downOnce():upOnce()}}))}function _bindEventsInterface(){originalinput.on("touchspin.destroy",(function(){_destroy()})),originalinput.on("touchspin.uponce",(function(){stopSpin(),upOnce()})),originalinput.on("touchspin.downonce",(function(){stopSpin(),downOnce()})),originalinput.on("touchspin.startupspin",(function(){startUpSpin()})),originalinput.on("touchspin.startdownspin",(function(){startDownSpin()})),originalinput.on("touchspin.stopspin",(function(){stopSpin()})),originalinput.on("touchspin.updatesettings",(function(e,newsettings){changeSettings(newsettings)}))}function _forcestepdivisibility(value){switch(settings.forcestepdivisibility){case"round":return(Math.round(value/settings.step)*settings.step).toFixed(settings.decimals);case"floor":return(Math.floor(value/settings.step)*settings.step).toFixed(settings.decimals);case"ceil":return(Math.ceil(value/settings.step)*settings.step).toFixed(settings.decimals);default:return value.toFixed(settings.decimals)}}function _checkValue(){var val,parsedval,returnval;""!==(val=settings.callback_before_calculation(originalinput.val()))?settings.decimals>0&&"."===val||(parsedval=parseFloat(val),isNaN(parsedval)&&(parsedval=""!==settings.replacementval?settings.replacementval:0),returnval=parsedval,parsedval.toString()!==val&&(returnval=parsedval),null!==settings.min&&parsedval<settings.min&&(returnval=settings.min),null!==settings.max&&parsedval>settings.max&&(returnval=settings.max),returnval=_forcestepdivisibility(returnval),Number(val).toString()!==returnval.toString()&&(originalinput.val(returnval),originalinput.trigger("change"))):""!==settings.replacementval&&(originalinput.val(settings.replacementval),originalinput.trigger("change"))}function _getBoostedStep(){if(settings.booster){var boosted=Math.pow(2,Math.floor(spincount/settings.boostat))*settings.step;return settings.maxboostedstep&&boosted>settings.maxboostedstep&&(boosted=settings.maxboostedstep,value=Math.round(value/boosted)*boosted),Math.max(settings.step,boosted)}return settings.step}function valueIfIsNaN(){return"number"==typeof settings.firstclickvalueifempty?settings.firstclickvalueifempty:(settings.min+settings.max)/2}function upOnce(){_checkValue();var initvalue=value=parseFloat(settings.callback_before_calculation(elements.input.val())),boostedstep;isNaN(value)?value=valueIfIsNaN():(boostedstep=_getBoostedStep(),value+=boostedstep),null!==settings.max&&value>settings.max&&(value=settings.max,originalinput.trigger("touchspin.on.max"),stopSpin()),elements.input.val(settings.callback_after_calculation(Number(value).toFixed(settings.decimals))),initvalue!==value&&originalinput.trigger("change")}function downOnce(){_checkValue();var initvalue=value=parseFloat(settings.callback_before_calculation(elements.input.val())),boostedstep;isNaN(value)?value=valueIfIsNaN():(boostedstep=_getBoostedStep(),value-=boostedstep),null!==settings.min&&value<settings.min&&(value=settings.min,originalinput.trigger("touchspin.on.min"),stopSpin()),elements.input.val(settings.callback_after_calculation(Number(value).toFixed(settings.decimals))),initvalue!==value&&originalinput.trigger("change")}function startDownSpin(){stopSpin(),spincount=0,spinning="down",originalinput.trigger("touchspin.on.startspin"),originalinput.trigger("touchspin.on.startdownspin"),downDelayTimeout=setTimeout((function(){downSpinTimer=setInterval((function(){spincount++,downOnce()}),settings.stepinterval)}),settings.stepintervaldelay)}function startUpSpin(){stopSpin(),spincount=0,spinning="up",originalinput.trigger("touchspin.on.startspin"),originalinput.trigger("touchspin.on.startupspin"),upDelayTimeout=setTimeout((function(){upSpinTimer=setInterval((function(){spincount++,upOnce()}),settings.stepinterval)}),settings.stepintervaldelay)}function stopSpin(){switch(clearTimeout(downDelayTimeout),clearTimeout(upDelayTimeout),clearInterval(downSpinTimer),clearInterval(upSpinTimer),spinning){case"up":originalinput.trigger("touchspin.on.stopupspin"),originalinput.trigger("touchspin.on.stopspin");break;case"down":originalinput.trigger("touchspin.on.stopdownspin"),originalinput.trigger("touchspin.on.stopspin")}spincount=0,spinning=!1}init()}))}})),function($){"use strict";$.event.special.destroyed||($.event.special.destroyed={remove:function(o){o.handler&&o.handler()}}),$.fn.extend({maxlength:function(options,callback){var documentBody=$("body"),defaults={showOnReady:!1,alwaysShow:!0,threshold:0,warningClass:"small form-text text-muted",limitReachedClass:"small form-text text-danger",separator:" / ",preText:"",postText:"",showMaxLength:!0,placement:"bottom-right-inside",message:null,showCharsTyped:!0,validate:!1,utf8:!1,appendToParent:!1,twoCharLinebreak:!0,customMaxAttribute:null,allowOverMax:!1,zIndex:1099};function utf8CharByteCount(character){var c=character.charCodeAt();return c?c<128?1:c<2048?2:3:0}function utf8Length(string){return string.split("").map(utf8CharByteCount).concat(0).reduce((function(sum,val){return sum+val}))}function inputLength(input){var text=input.val();text=options.twoCharLinebreak?text.replace(/\r(?!\n)|\n(?!\r)/g,"\r\n"):text.replace(/(?:\r\n|\r|\n)/g,"\n");var currentLength=0;return currentLength=options.utf8?utf8Length(text):text.length,"file"===input.prop("type")&&""!==input.val()&&(currentLength-=12),currentLength}function truncateChars(input,maxlength){var text=input.val();if(options.twoCharLinebreak&&"\n"===(text=text.replace(/\r(?!\n)|\n(?!\r)/g,"\r\n"))[text.length-1]&&(maxlength-=text.length%2),options.utf8){for(var indexedSize=text.split("").map(utf8CharByteCount),removedBytes=0,bytesPastMax=utf8Length(text)-maxlength;removedBytes<bytesPastMax;removedBytes+=indexedSize.pop());maxlength-=maxlength-indexedSize.length}input.val(text.substr(0,maxlength))}function charsLeftThreshold(input,threshold,maxlength){var output=!0;return!options.alwaysShow&&maxlength-inputLength(input)>threshold&&(output=!1),output}function remainingChars(input,maxlength){var length;return maxlength-inputLength(input)}function showRemaining(currentInput,indicator){indicator.css({display:"block"}),currentInput.trigger("maxlength.shown")}function hideRemaining(currentInput,indicator){options.alwaysShow||(indicator.css({display:"none"}),currentInput.trigger("maxlength.hidden"))}function updateMaxLengthHTML(currentInputText,maxLengthThisInput,typedChars){var output="";return options.message?output="function"==typeof options.message?options.message(currentInputText,maxLengthThisInput):options.message.replace("%charsTyped%",typedChars).replace("%charsRemaining%",maxLengthThisInput-typedChars).replace("%charsTotal%",maxLengthThisInput):(options.preText&&(output+=options.preText),options.showCharsTyped?output+=typedChars:output+=maxLengthThisInput-typedChars,options.showMaxLength&&(output+=options.separator+maxLengthThisInput),options.postText&&(output+=options.postText)),output}function manageRemainingVisibility(remaining,currentInput,maxLengthCurrentInput,maxLengthIndicator){maxLengthIndicator&&(maxLengthIndicator.html(updateMaxLengthHTML(currentInput.val(),maxLengthCurrentInput,maxLengthCurrentInput-remaining)),remaining>0?charsLeftThreshold(currentInput,options.threshold,maxLengthCurrentInput)?showRemaining(currentInput,maxLengthIndicator.removeClass(options.limitReachedClass).addClass(options.warningClass)):hideRemaining(currentInput,maxLengthIndicator):showRemaining(currentInput,maxLengthIndicator.removeClass(options.warningClass).addClass(options.limitReachedClass))),options.customMaxAttribute&&(remaining<0?currentInput.addClass("overmax"):currentInput.removeClass("overmax"))}function getPosition(currentInput){var el=currentInput[0];return $.extend({},"function"==typeof el.getBoundingClientRect?el.getBoundingClientRect():{width:el.offsetWidth,height:el.offsetHeight},currentInput.offset())}function placeWithCSS(placement,maxLengthIndicator){if(placement&&maxLengthIndicator){var POSITION_KEYS=["top","bottom","left","right","position"],cssPos={};$.each(POSITION_KEYS,(function(i,key){var val=options.placement[key];void 0!==val&&(cssPos[key]=val)})),maxLengthIndicator.css(cssPos)}}function place(currentInput,maxLengthIndicator){var pos=getPosition(currentInput);if("function"!==$.type(options.placement))if($.isPlainObject(options.placement))placeWithCSS(options.placement,maxLengthIndicator);else{var inputOuter=currentInput.outerWidth(),outerWidth=maxLengthIndicator.outerWidth(),actualWidth=maxLengthIndicator.width(),actualHeight=maxLengthIndicator.height();switch(options.appendToParent&&(pos.top-=currentInput.parent().offset().top,pos.left-=currentInput.parent().offset().left),options.placement){case"bottom":maxLengthIndicator.css({top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2});break;case"top":maxLengthIndicator.css({top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2});break;case"left":maxLengthIndicator.css({top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth});break;case"right":maxLengthIndicator.css({top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width});break;case"bottom-right":maxLengthIndicator.css({top:pos.top+pos.height,left:pos.left+pos.width});break;case"top-right":maxLengthIndicator.css({top:pos.top-actualHeight,left:pos.left+inputOuter});break;case"top-left":maxLengthIndicator.css({top:pos.top-actualHeight,left:pos.left-outerWidth});break;case"bottom-left":maxLengthIndicator.css({top:pos.top+currentInput.outerHeight(),left:pos.left-outerWidth});break;case"centered-right":maxLengthIndicator.css({top:pos.top+actualHeight/2,left:pos.left+inputOuter-outerWidth-3});break;case"bottom-right-inside":maxLengthIndicator.css({top:pos.top+pos.height,left:pos.left+pos.width-outerWidth});break;case"top-right-inside":maxLengthIndicator.css({top:pos.top-actualHeight,left:pos.left+inputOuter-outerWidth});break;case"top-left-inside":maxLengthIndicator.css({top:pos.top-actualHeight,left:pos.left});break;case"bottom-left-inside":maxLengthIndicator.css({top:pos.top+currentInput.outerHeight(),left:pos.left})}}else options.placement(currentInput,maxLengthIndicator,pos)}function isPlacementMutable(){return"bottom-right-inside"===options.placement||"top-right-inside"===options.placement||"function"==typeof options.placement||options.message&&"function"==typeof options.message}function getMaxLength(currentInput){var max=currentInput.attr("maxlength")||options.customMaxAttribute;if(options.customMaxAttribute&&!options.allowOverMax){var custom=currentInput.attr(options.customMaxAttribute);(!max||custom<max)&&(max=custom)}return max||(max=currentInput.attr("size")),max}return $.isFunction(options)&&!callback&&(callback=options,options={}),options=$.extend(defaults,options),this.each((function(){var currentInput=$(this),maxLengthCurrentInput,maxLengthIndicator;function firstInit(){var maxlengthContent=updateMaxLengthHTML(currentInput.val(),maxLengthCurrentInput,"0"),remaining;maxLengthCurrentInput=getMaxLength(currentInput),maxLengthIndicator||(maxLengthIndicator=$('<span class="bootstrap-maxlength"></span>').css({display:"none",position:"absolute",whiteSpace:"nowrap",zIndex:options.zIndex}).html(maxlengthContent)),currentInput.is("textarea")&&(currentInput.data("maxlenghtsizex",currentInput.outerWidth()),currentInput.data("maxlenghtsizey",currentInput.outerHeight()),currentInput.mouseup((function(){currentInput.outerWidth()===currentInput.data("maxlenghtsizex")&¤tInput.outerHeight()===currentInput.data("maxlenghtsizey")||place(currentInput,maxLengthIndicator),currentInput.data("maxlenghtsizex",currentInput.outerWidth()),currentInput.data("maxlenghtsizey",currentInput.outerHeight())}))),options.appendToParent?(currentInput.parent().append(maxLengthIndicator),currentInput.parent().css("position","relative")):documentBody.append(maxLengthIndicator),manageRemainingVisibility(remainingChars(currentInput,getMaxLength(currentInput)),currentInput,maxLengthCurrentInput,maxLengthIndicator),place(currentInput,maxLengthIndicator)}$(window).resize((function(){maxLengthIndicator&&place(currentInput,maxLengthIndicator)})),options.showOnReady?currentInput.ready((function(){firstInit()})):currentInput.focus((function(){firstInit()})),currentInput.on("maxlength.reposition",(function(){place(currentInput,maxLengthIndicator)})),currentInput.on("destroyed",(function(){maxLengthIndicator&&maxLengthIndicator.remove()})),currentInput.on("blur",(function(){maxLengthIndicator&&!options.showOnReady&&maxLengthIndicator.remove()})),currentInput.on("input",(function(){var maxlength=getMaxLength(currentInput),remaining=remainingChars(currentInput,maxlength),output=!0;return options.validate&&remaining<0?(truncateChars(currentInput,maxlength),output=!1):manageRemainingVisibility(remaining,currentInput,maxLengthCurrentInput,maxLengthIndicator),isPlacementMutable()&&place(currentInput,maxLengthIndicator),output}))}))}})}(jQuery),function(a){"use strict";function c(c){return this.each((function(){var d=a(this),e=d.data("multiselectsplitter"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("multiselectsplitter",e=new b(this,f)),"string"==typeof c&&e[c]())}))}var b=function(a,b){this.init("multiselectsplitter",a,b)};b.DEFAULTS={selectSize:null,maxSelectSize:null,clearOnFirstChange:!1,onlySameGroup:!1,groupCounter:!1,maximumSelected:null,afterInitialize:null,maximumAlert:function(a){alert("Only "+a+" values can be selected")},createFirstSelect:function(a,b){return"<option>"+a+"</option>"},createSecondSelect:function(a,b){return"<option>"+a+"</option>"},template:'<div class="row" data-multiselectsplitter-wrapper-selector><div class="col-xs-6 col-sm-6"><select class="form-control" data-multiselectsplitter-firstselect-selector></select></div> \x3c!-- Add the extra clearfix for only the required viewport --\x3e<div class="col-xs-6 col-sm-6"><select class="form-control" data-multiselectsplitter-secondselect-selector></select></div></div>'},b.prototype.init=function(c,d,e){var f=this;f.type=c,f.last$ElementSelected=[],f.initialized=!1,f.$element=a(d),f.$element.hide(),f.options=a.extend({},b.DEFAULTS,e),f.$element.after(f.options.template),f.$wrapper=f.$element.next("div[data-multiselectsplitter-wrapper-selector]"),f.$firstSelect=a("select[data-multiselectsplitter-firstselect-selector]",f.$wrapper),f.$secondSelect=a("select[data-multiselectsplitter-secondselect-selector]",f.$wrapper);var g=0,h=0;if(0!=f.$element.find("optgroup").length){f.$element.find("optgroup").each((function(){var b=a(this).attr("label"),c=a(f.options.createFirstSelect(b,f.$element));c.val(b),c.attr("data-current-label",c.text()),f.$firstSelect.append(c);var d=a(this).find("option").length;d>h&&(h=d),g++}));var i=Math.max(g,h);i=Math.min(i,10),f.options.selectSize?i=f.options.selectSize:f.options.maxSelectSize&&(i=Math.min(i,f.options.maxSelectSize)),f.$firstSelect.attr("size",i),f.$secondSelect.attr("size",i),f.$element.attr("multiple")&&f.$secondSelect.attr("multiple","multiple"),f.$element.is(":disabled")&&f.disable(),f.$firstSelect.on("change",a.proxy(f.updateParentCategory,f)),f.$secondSelect.on("click change",a.proxy(f.updateChildCategory,f)),f.update=function(){if(!(f.$element.find("option").length<1)){var b,a=f.$element.find("option:selected:first");b=a.length?a.parent().attr("label"):f.$element.find("option:first").parent().attr("label"),f.$firstSelect.find('option[value="'+b+'"]').prop("selected",!0),f.$firstSelect.trigger("change")}},f.update(),f.initialized=!0,f.options.afterInitialize&&f.options.afterInitialize(f.$firstSelect,f.$secondSelect)}},b.prototype.disable=function(){this.$secondSelect.prop("disabled",!0),this.$firstSelect.prop("disabled",!0)},b.prototype.enable=function(){this.$secondSelect.prop("disabled",!1),this.$firstSelect.prop("disabled",!1)},b.prototype.createSecondSelect=function(){var b=this;b.$secondSelect.empty(),a.each(b.$element.find('optgroup[label="'+b.$firstSelect.val()+'"] option'),(function(c,d){var e=a(this).val(),f=a(this).text(),g=a(b.options.createSecondSelect(f,b.$firstSelect));g.val(e),a.each(b.$element.find("option:selected"),(function(b,c){a(c).val()==e&&g.prop("selected",!0)})),b.$secondSelect.append(g)}))},b.prototype.updateParentCategory=function(){var a=this;a.last$ElementSelected=a.$element.find("option:selected"),a.options.clearOnFirstChange&&a.initialized&&a.$element.find("option:selected").prop("selected",!1),a.createSecondSelect(),a.checkSelected(),a.updateCounter()},b.prototype.updateCounter=function(){var b=this;b.$element.attr("multiple")&&b.options.groupCounter&&a.each(b.$firstSelect.find("option"),(function(c,d){var e=a(d).val(),f=a(d).data("currentLabel"),g=b.$element.find('optgroup[label="'+e+'"] option:selected').length;g>0&&(f+=" ("+g+")"),a(d).html(f)}))},b.prototype.checkSelected=function(){var b=this;if(b.$element.attr("multiple")&&b.options.maximumSelected){var c=0,d;if(!((c="function"==typeof b.options.maximumSelected?b.options.maximumSelected(b.$firstSelect,b.$secondSelect):b.options.maximumSelected)<1))if(b.$element.find("option:selected").length>c){b.$firstSelect.find("option:selected").prop("selected",!1),b.$secondSelect.find("option:selected").prop("selected",!1),b.initialized?(b.$element.find("option:selected").prop("selected",!1),b.last$ElementSelected.prop("selected",!0)):a.each(b.$element.find("option:selected"),(function(b,d){b>c-1&&a(d).prop("selected",!1)}));var e=b.last$ElementSelected.first().parent().attr("label");b.$firstSelect.find('option[value="'+e+'"]').prop("selected",!0),b.createSecondSelect(),b.options.maximumAlert(c)}}},b.prototype.basicUpdateChildCategory=function(b,c){var d=this;d.last$ElementSelected=d.$element.find("option:selected");var e=d.$secondSelect.val();a.isArray(e)||(e=[e]);var f=d.$firstSelect.val(),g=!1;d.$element.attr("multiple")?d.options.onlySameGroup?a.each(d.$element.find("option:selected"),(function(b,c){if(a(c).parent().attr("label")!=f)return g=!0,!1})):c||(g=!0):g=!0,g?d.$element.find("option:selected").prop("selected",!1):a.each(d.$element.find("option:selected"),(function(b,c){f==a(c).parent().attr("label")&&-1==a.inArray(a(c).val(),e)&&a(c).prop("selected",!1)})),a.each(e,(function(a,b){d.$element.find('option[value="'+b+'"]').prop("selected",!0)})),d.checkSelected(),d.updateCounter(),d.$element.trigger("change")},b.prototype.updateChildCategory=function(b){"change"==b.type?this.timeOut=setTimeout(a.proxy((function(){this.basicUpdateChildCategory(b,b.ctrlKey)}),this),10):"click"==b.type&&(clearTimeout(this.timeOut),this.basicUpdateChildCategory(b,b.ctrlKey))},b.prototype.destroy=function(){this.$wrapper.remove(),this.$element.removeData(this.type),this.$element.show()},a.fn.multiselectsplitter=c,a.fn.multiselectsplitter.Constructor=b,a.fn.multiselectsplitter.VERSION="1.0.1"}(jQuery),
|
||
/*!
|
||
* Bootstrap-select v1.13.17 (https://developer.snapappointments.com/bootstrap-select)
|
||
*
|
||
* Copyright 2012-2020 SnapAppointments, LLC
|
||
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
|
||
*/
|
||
function(root,factory){void 0===root&&void 0!==window&&(root=window),"function"==typeof define&&define.amd?define(["jquery"],(function(a0){return factory(a0)})):"object"==typeof module&&module.exports?module.exports=factory(require("jquery")):factory(root.jQuery)}(this,(function(jQuery){!function($){"use strict";var DISALLOWED_ATTRIBUTES=["sanitize","whiteList","sanitizeFn"],uriAttrs=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],ARIA_ATTRIBUTE_PATTERN,DefaultWhitelist={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},SAFE_URL_PATTERN=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,DATA_URL_PATTERN=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function allowedAttribute(attr,allowedAttributeList){var attrName=attr.nodeName.toLowerCase();if(-1!==$.inArray(attrName,allowedAttributeList))return-1===$.inArray(attrName,uriAttrs)||Boolean(attr.nodeValue.match(SAFE_URL_PATTERN)||attr.nodeValue.match(DATA_URL_PATTERN));for(var regExp=$(allowedAttributeList).filter((function(index,value){return value instanceof RegExp})),i=0,l=regExp.length;i<l;i++)if(attrName.match(regExp[i]))return!0;return!1}function sanitizeHtml(unsafeElements,whiteList,sanitizeFn){if(sanitizeFn&&"function"==typeof sanitizeFn)return sanitizeFn(unsafeElements);for(var whitelistKeys=Object.keys(whiteList),i=0,len=unsafeElements.length;i<len;i++)for(var elements=unsafeElements[i].querySelectorAll("*"),j=0,len2=elements.length;j<len2;j++){var el=elements[j],elName=el.nodeName.toLowerCase();if(-1!==whitelistKeys.indexOf(elName))for(var attributeList=[].slice.call(el.attributes),whitelistedAttributes=[].concat(whiteList["*"]||[],whiteList[elName]||[]),k=0,len3=attributeList.length;k<len3;k++){var attr=attributeList[k];allowedAttribute(attr,whitelistedAttributes)||el.removeAttribute(attr.nodeName)}else el.parentNode.removeChild(el)}}"classList"in document.createElement("_")||function(view){if("Element"in view){var classListProp="classList",protoProp="prototype",elemCtrProto=view.Element.prototype,objCtr=Object,classListGetter=function(){var $elem=$(this);return{add:function(classes){return classes=Array.prototype.slice.call(arguments).join(" "),$elem.addClass(classes)},remove:function(classes){return classes=Array.prototype.slice.call(arguments).join(" "),$elem.removeClass(classes)},toggle:function(classes,force){return $elem.toggleClass(classes,force)},contains:function(classes){return $elem.hasClass(classes)}}};if(objCtr.defineProperty){var classListPropDesc={get:classListGetter,enumerable:!0,configurable:!0};try{objCtr.defineProperty(elemCtrProto,"classList",classListPropDesc)}catch(ex){void 0!==ex.number&&-2146823252!==ex.number||(classListPropDesc.enumerable=!1,objCtr.defineProperty(elemCtrProto,"classList",classListPropDesc))}}else objCtr.prototype.__defineGetter__&&elemCtrProto.__defineGetter__("classList",classListGetter)}}(window);var testElement=document.createElement("_"),defineProperty,toString,startsWith;if(testElement.classList.add("c1","c2"),!testElement.classList.contains("c2")){var _add=DOMTokenList.prototype.add,_remove=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){Array.prototype.forEach.call(arguments,_add.bind(this))},DOMTokenList.prototype.remove=function(){Array.prototype.forEach.call(arguments,_remove.bind(this))}}if(testElement.classList.toggle("c3",!1),testElement.classList.contains("c3")){var _toggle=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(token,force){return 1 in arguments&&!this.contains(token)==!force?force:_toggle.call(this,token)}}function isEqual(array1,array2){return array1.length===array2.length&&array1.every((function(element,index){return element===array2[index]}))}function getSelectedOptions(select,ignoreDisabled){var selectedOptions=select.selectedOptions,options=[],opt;if(ignoreDisabled){for(var i=0,len=selectedOptions.length;i<len;i++)(opt=selectedOptions[i]).disabled||"OPTGROUP"===opt.parentNode.tagName&&opt.parentNode.disabled||options.push(opt);return options}return selectedOptions}function getSelectValues(select,selectedOptions){for(var value=[],options=selectedOptions||select.selectedOptions,opt,i=0,len=options.length;i<len;i++)(opt=options[i]).disabled||"OPTGROUP"===opt.parentNode.tagName&&opt.parentNode.disabled||value.push(opt.value);return select.multiple?value:value.length?value[0]:null}testElement=null,String.prototype.startsWith||(defineProperty=function(){try{var object={},$defineProperty=Object.defineProperty,result=$defineProperty(object,object,object)&&$defineProperty}catch(error){}return result}(),toString={}.toString,startsWith=function(search){if(null==this)throw new TypeError;var string=String(this);if(search&&"[object RegExp]"==toString.call(search))throw new TypeError;var stringLength=string.length,searchString=String(search),searchLength=searchString.length,position=arguments.length>1?arguments[1]:void 0,pos=position?Number(position):0;pos!=pos&&(pos=0);var start=Math.min(Math.max(pos,0),stringLength);if(searchLength+start>stringLength)return!1;for(var index=-1;++index<searchLength;)if(string.charCodeAt(start+index)!=searchString.charCodeAt(index))return!1;return!0},defineProperty?defineProperty(String.prototype,"startsWith",{value:startsWith,configurable:!0,writable:!0}):String.prototype.startsWith=startsWith),Object.keys||(Object.keys=function(o,k,r){for(k in r=[],o)r.hasOwnProperty.call(o,k)&&r.push(k);return r}),HTMLSelectElement&&!HTMLSelectElement.prototype.hasOwnProperty("selectedOptions")&&Object.defineProperty(HTMLSelectElement.prototype,"selectedOptions",{get:function(){return this.querySelectorAll(":checked")}});var valHooks={useDefault:!1,_set:$.valHooks.select.set};$.valHooks.select.set=function(elem,value){return value&&!valHooks.useDefault&&$(elem).data("selected",!0),valHooks._set.apply(this,arguments)};var changedArguments=null,EventIsSupported=function(){try{return new Event("change"),!0}catch(e){return!1}}();function stringSearch(li,searchString,method,normalize){for(var stringTypes=["display","subtext","tokens"],searchSuccess=!1,i=0;i<stringTypes.length;i++){var stringType=stringTypes[i],string=li[stringType];if(string&&(string=string.toString(),"display"===stringType&&(string=string.replace(/<[^>]+>/g,"")),normalize&&(string=normalizeToBase(string)),string=string.toUpperCase(),searchSuccess="contains"===method?string.indexOf(searchString)>=0:string.startsWith(searchString)))break}return searchSuccess}function toInteger(value){return parseInt(value,10)||0}$.fn.triggerNative=function(eventName){var el=this[0],event;el.dispatchEvent?(EventIsSupported?event=new Event(eventName,{bubbles:!0}):(event=document.createEvent("Event")).initEvent(eventName,!0,!1),el.dispatchEvent(event)):el.fireEvent?((event=document.createEventObject()).eventType=eventName,el.fireEvent("on"+eventName,event)):this.trigger(eventName)};var deburredLetters={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboMarksExtendedRange="\\u1ab0-\\u1aff",rsComboMarksSupplementRange="\\u1dc0-\\u1dff",rsComboRange,rsCombo,reComboMark=RegExp("["+"\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff"+"]","g");function deburrLetter(key){return deburredLetters[key]}function normalizeToBase(string){return(string=string.toString())&&string.replace(reLatin,deburrLetter).replace(reComboMark,"")}var escapeMap,createEscaper,htmlEscape=function(map){var escaper=function(match){return map[match]},source="(?:"+Object.keys(map).join("|")+")",testRegexp=RegExp(source),replaceRegexp=RegExp(source,"g");return function(string){return string=null==string?"":""+string,testRegexp.test(string)?string.replace(replaceRegexp,escaper):string}}({"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"}),keyCodeMap={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},keyCodes_ESCAPE=27,keyCodes_ENTER=13,keyCodes_SPACE=32,keyCodes_TAB=9,keyCodes_ARROW_UP=38,keyCodes_ARROW_DOWN=40,version={success:!1,major:"3"};try{version.full=($.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),version.major=version.full[0],version.success=!0}catch(err){}var selectId=0,EVENT_KEY=".bs.select",classNames={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},Selector={MENU:"."+classNames.MENU},elementTemplates={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};elementTemplates.noResults=elementTemplates.li.cloneNode(!1),elementTemplates.noResults.className="no-results",elementTemplates.a.setAttribute("role","option"),elementTemplates.a.className="dropdown-item",elementTemplates.subtext.className="text-muted",elementTemplates.text=elementTemplates.span.cloneNode(!1),elementTemplates.text.className="text",elementTemplates.checkMark=elementTemplates.span.cloneNode(!1);var REGEXP_ARROW=new RegExp(keyCodes_ARROW_UP+"|"+keyCodes_ARROW_DOWN),REGEXP_TAB_OR_ESCAPE=new RegExp("^"+keyCodes_TAB+"$|"+keyCodes_ESCAPE),generateOption={li:function(content,classes,optgroup){var li=elementTemplates.li.cloneNode(!1);return content&&(1===content.nodeType||11===content.nodeType?li.appendChild(content):li.innerHTML=content),void 0!==classes&&""!==classes&&(li.className=classes),null!=optgroup&&li.classList.add("optgroup-"+optgroup),li},a:function(text,classes,inline){var a=elementTemplates.a.cloneNode(!0);return text&&(11===text.nodeType?a.appendChild(text):a.insertAdjacentHTML("beforeend",text)),void 0!==classes&&""!==classes&&a.classList.add.apply(a.classList,classes.split(/\s+/)),inline&&a.setAttribute("style",inline),a},text:function(options,useFragment){var textElement=elementTemplates.text.cloneNode(!1),subtextElement,iconElement;if(options.content)textElement.innerHTML=options.content;else{if(textElement.textContent=options.text,options.icon){var whitespace=elementTemplates.whitespace.cloneNode(!1);(iconElement=(!0===useFragment?elementTemplates.i:elementTemplates.span).cloneNode(!1)).className=this.options.iconBase+" "+options.icon,elementTemplates.fragment.appendChild(iconElement),elementTemplates.fragment.appendChild(whitespace)}options.subtext&&((subtextElement=elementTemplates.subtext.cloneNode(!1)).textContent=options.subtext,textElement.appendChild(subtextElement))}if(!0===useFragment)for(;textElement.childNodes.length>0;)elementTemplates.fragment.appendChild(textElement.childNodes[0]);else elementTemplates.fragment.appendChild(textElement);return elementTemplates.fragment},label:function(options){var textElement=elementTemplates.text.cloneNode(!1),subtextElement,iconElement;if(textElement.innerHTML=options.display,options.icon){var whitespace=elementTemplates.whitespace.cloneNode(!1);(iconElement=elementTemplates.span.cloneNode(!1)).className=this.options.iconBase+" "+options.icon,elementTemplates.fragment.appendChild(iconElement),elementTemplates.fragment.appendChild(whitespace)}return options.subtext&&((subtextElement=elementTemplates.subtext.cloneNode(!1)).textContent=options.subtext,textElement.appendChild(subtextElement)),elementTemplates.fragment.appendChild(textElement),elementTemplates.fragment}};function showNoResults(searchMatch,searchValue){searchMatch.length||(elementTemplates.noResults.innerHTML=this.options.noneResultsText.replace("{0}",'"'+htmlEscape(searchValue)+'"'),this.$menuInner[0].firstChild.appendChild(elementTemplates.noResults))}var Selectpicker=function(element,options){var that=this;valHooks.useDefault||($.valHooks.select.set=valHooks._set,valHooks.useDefault=!0),this.$element=$(element),this.$newElement=null,this.$button=null,this.$menu=null,this.options=options,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){that.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var winPad=this.options.windowPadding;"number"==typeof winPad&&(this.options.windowPadding=[winPad,winPad,winPad,winPad]),this.val=Selectpicker.prototype.val,this.render=Selectpicker.prototype.render,this.refresh=Selectpicker.prototype.refresh,this.setStyle=Selectpicker.prototype.setStyle,this.selectAll=Selectpicker.prototype.selectAll,this.deselectAll=Selectpicker.prototype.deselectAll,this.destroy=Selectpicker.prototype.destroy,this.remove=Selectpicker.prototype.remove,this.show=Selectpicker.prototype.show,this.hide=Selectpicker.prototype.hide,this.init()};function Plugin(option){var args=arguments,_option=option,value;if([].shift.apply(args),!version.success){try{version.full=($.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(err){Selectpicker.BootstrapVersion?version.full=Selectpicker.BootstrapVersion.split(" ")[0].split("."):(version.full=[version.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",err))}version.major=version.full[0],version.success=!0}if("4"===version.major){var toUpdate=[];Selectpicker.DEFAULTS.style===classNames.BUTTONCLASS&&toUpdate.push({name:"style",className:"BUTTONCLASS"}),Selectpicker.DEFAULTS.iconBase===classNames.ICONBASE&&toUpdate.push({name:"iconBase",className:"ICONBASE"}),Selectpicker.DEFAULTS.tickIcon===classNames.TICKICON&&toUpdate.push({name:"tickIcon",className:"TICKICON"}),classNames.DIVIDER="dropdown-divider",classNames.SHOW="show",classNames.BUTTONCLASS="btn-light",classNames.POPOVERHEADER="popover-header",classNames.ICONBASE="",classNames.TICKICON="bs-ok-default";for(var i=0;i<toUpdate.length;i++){var option=toUpdate[i];Selectpicker.DEFAULTS[option.name]=classNames[option.className]}}var chain=this.each((function(){var $this=$(this);if($this.is("select")){var data=$this.data("selectpicker"),options="object"==typeof _option&&_option;if(data){if(options)for(var i in options)Object.prototype.hasOwnProperty.call(options,i)&&(data.options[i]=options[i])}else{var dataAttributes=$this.data();for(var dataAttr in dataAttributes)Object.prototype.hasOwnProperty.call(dataAttributes,dataAttr)&&-1!==$.inArray(dataAttr,DISALLOWED_ATTRIBUTES)&&delete dataAttributes[dataAttr];var config=$.extend({},Selectpicker.DEFAULTS,$.fn.selectpicker.defaults||{},dataAttributes,options);config.template=$.extend({},Selectpicker.DEFAULTS.template,$.fn.selectpicker.defaults?$.fn.selectpicker.defaults.template:{},dataAttributes.template,options.template),$this.data("selectpicker",data=new Selectpicker(this,config))}"string"==typeof _option&&(value=data[_option]instanceof Function?data[_option].apply(data,args):data.options[_option])}}));return void 0!==value?value:chain}Selectpicker.VERSION="1.13.17",Selectpicker.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(numSelected,numTotal){return 1==numSelected?"{0} item selected":"{0} items selected"},maxOptionsText:function(numAll,numGroup){return[1==numAll?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==numGroup?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:classNames.BUTTONCLASS,size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:classNames.ICONBASE,tickIcon:classNames.TICKICON,showTick:!1,template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:DefaultWhitelist},Selectpicker.prototype={constructor:Selectpicker,init:function(){var that=this,id=this.$element.attr("id");selectId++,this.selectId="bs-select-"+selectId,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$element[0].classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(Selector.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(classNames.MENURIGHT),void 0!==id&&this.$button.attr("data-id",id),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide.bs.select",(function(){if(that.isVirtual()){var menuInner=that.$menuInner[0],emptyMenu=menuInner.firstChild.cloneNode(!1);menuInner.replaceChild(emptyMenu,menuInner.firstChild),menuInner.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){that.$element.trigger("hide.bs.select",e)},"hidden.bs.dropdown":function(e){that.$element.trigger("hidden.bs.select",e)},"show.bs.dropdown":function(e){that.$element.trigger("show.bs.select",e)},"shown.bs.dropdown":function(e){that.$element.trigger("shown.bs.select",e)}}),that.$element[0].hasAttribute("required")&&this.$element.on("invalid.bs.select",(function(){that.$button[0].classList.add("bs-invalid"),that.$element.on("shown.bs.select.invalid",(function(){that.$element.val(that.$element.val()).off("shown.bs.select.invalid")})).on("rendered.bs.select",(function(){this.validity.valid&&that.$button[0].classList.remove("bs-invalid"),that.$element.off("rendered.bs.select")})),that.$button.on("blur.bs.select",(function(){that.$element.trigger("focus").trigger("blur"),that.$button.off("blur.bs.select")}))})),setTimeout((function(){that.buildList(),that.$element.trigger("loaded.bs.select")}))},createDropdown:function(){var showTick=this.multiple||this.options.showTick?" show-tick":"",multiselectable=this.multiple?' aria-multiselectable="true"':"",inputGroup="",autofocus=this.autofocus?" autofocus":"";version.major<4&&this.$element.parent().hasClass("input-group")&&(inputGroup=" input-group-btn");var drop,header="",searchbox="",actionsbox="",donebutton="";return this.options.header&&(header='<div class="'+classNames.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">×</button>'+this.options.header+"</div>"),this.options.liveSearch&&(searchbox='<div class="bs-searchbox"><input type="search" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+htmlEscape(this.options.liveSearchPlaceholder)+'"')+' role="combobox" aria-label="Search" aria-controls="'+this.selectId+'" aria-autocomplete="list"></div>'),this.multiple&&this.options.actionsBox&&(actionsbox='<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+classNames.BUTTONCLASS+'">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn '+classNames.BUTTONCLASS+'">'+this.options.deselectAllText+"</button></div></div>"),this.multiple&&this.options.doneButton&&(donebutton='<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+classNames.BUTTONCLASS+'">'+this.options.doneButtonText+"</button></div></div>"),drop='<div class="dropdown bootstrap-select'+showTick+inputGroup+'"><button type="button" tabindex="-1" class="'+this.options.styleBase+' dropdown-toggle" '+("static"===this.options.display?'data-display="static"':"")+'data-toggle="dropdown"'+autofocus+' role="combobox" aria-owns="'+this.selectId+'" aria-haspopup="listbox" aria-expanded="false"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"></div></div> </div>'+("4"===version.major?"":'<span class="bs-caret">'+this.options.template.caret+"</span>")+'</button><div class="'+classNames.MENU+" "+("4"===version.major?"":classNames.SHOW)+'">'+header+searchbox+actionsbox+'<div class="inner '+classNames.SHOW+'" role="listbox" id="'+this.selectId+'" tabindex="-1" '+multiselectable+'><ul class="'+classNames.MENU+" inner "+("4"===version.major?classNames.SHOW:"")+'" role="presentation"></ul></div>'+donebutton+"</div></div>",$(drop)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0;for(var i=0;i<this.selectpicker.current.data.length;i++){var li=this.selectpicker.current.data[i],canHighlight=!0;"divider"===li.type?(canHighlight=!1,li.height=this.sizeInfo.dividerHeight):"optgroup-label"===li.type?(canHighlight=!1,li.height=this.sizeInfo.dropdownHeaderHeight):li.height=this.sizeInfo.liHeight,li.disabled&&(canHighlight=!1),this.selectpicker.view.canHighlight.push(canHighlight),canHighlight&&(this.selectpicker.view.size++,li.posinset=this.selectpicker.view.size),li.position=(0===i?0:this.selectpicker.current.data[i-1].position)+li.height}},isVirtual:function(){return!1!==this.options.virtualScroll&&this.selectpicker.main.elements.length>=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(isSearching,setSize,refresh){var that=this,scrollTop=0,active=[],selected,prevActive;if(this.selectpicker.isSearching=isSearching,this.selectpicker.current=isSearching?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),setSize)if(refresh)scrollTop=this.$menuInner[0].scrollTop;else if(!that.multiple){var element=that.$element[0],selectedIndex=(element.options[element.selectedIndex]||{}).liIndex;if("number"==typeof selectedIndex&&!1!==that.options.size){var selectedData=that.selectpicker.main.data[selectedIndex],position=selectedData&&selectedData.position;position&&(scrollTop=position-(that.sizeInfo.menuInnerHeight+that.sizeInfo.liHeight)/2)}}function scroll(scrollTop,init){var size=that.selectpicker.current.elements.length,chunks=[],chunkSize,chunkCount,firstChunk,lastChunk,currentChunk,prevPositions,positionIsDifferent,previousElements,menuIsDifferent=!0,isVirtual=that.isVirtual();that.selectpicker.view.scrollTop=scrollTop,chunkSize=Math.ceil(that.sizeInfo.menuInnerHeight/that.sizeInfo.liHeight*1.5),chunkCount=Math.round(size/chunkSize)||1;for(var i=0;i<chunkCount;i++){var endOfChunk=(i+1)*chunkSize;if(i===chunkCount-1&&(endOfChunk=size),chunks[i]=[i*chunkSize+(i?1:0),endOfChunk],!size)break;void 0===currentChunk&&scrollTop-1<=that.selectpicker.current.data[endOfChunk-1].position-that.sizeInfo.menuInnerHeight&&(currentChunk=i)}if(void 0===currentChunk&&(currentChunk=0),prevPositions=[that.selectpicker.view.position0,that.selectpicker.view.position1],firstChunk=Math.max(0,currentChunk-1),lastChunk=Math.min(chunkCount-1,currentChunk+1),that.selectpicker.view.position0=!1===isVirtual?0:Math.max(0,chunks[firstChunk][0])||0,that.selectpicker.view.position1=!1===isVirtual?size:Math.min(size,chunks[lastChunk][1])||0,positionIsDifferent=prevPositions[0]!==that.selectpicker.view.position0||prevPositions[1]!==that.selectpicker.view.position1,void 0!==that.activeIndex&&(prevActive=that.selectpicker.main.elements[that.prevActiveIndex],active=that.selectpicker.main.elements[that.activeIndex],selected=that.selectpicker.main.elements[that.selectedIndex],init&&(that.activeIndex!==that.selectedIndex&&that.defocusItem(active),that.activeIndex=void 0),that.activeIndex&&that.activeIndex!==that.selectedIndex&&that.defocusItem(selected)),void 0!==that.prevActiveIndex&&that.prevActiveIndex!==that.activeIndex&&that.prevActiveIndex!==that.selectedIndex&&that.defocusItem(prevActive),(init||positionIsDifferent)&&(previousElements=that.selectpicker.view.visibleElements?that.selectpicker.view.visibleElements.slice():[],that.selectpicker.view.visibleElements=!1===isVirtual?that.selectpicker.current.elements:that.selectpicker.current.elements.slice(that.selectpicker.view.position0,that.selectpicker.view.position1),that.setOptionStatus(),(isSearching||!1===isVirtual&&init)&&(menuIsDifferent=!isEqual(previousElements,that.selectpicker.view.visibleElements)),(init||!0===isVirtual)&&menuIsDifferent)){var menuInner=that.$menuInner[0],menuFragment=document.createDocumentFragment(),emptyMenu=menuInner.firstChild.cloneNode(!1),marginTop,marginBottom,elements=that.selectpicker.view.visibleElements,toSanitize=[];menuInner.replaceChild(emptyMenu,menuInner.firstChild);for(var i=0,visibleElementsLen=elements.length;i<visibleElementsLen;i++){var element=elements[i],elText,elementData;that.options.sanitize&&(elText=element.lastChild)&&(elementData=that.selectpicker.current.data[i+that.selectpicker.view.position0])&&elementData.content&&!elementData.sanitized&&(toSanitize.push(elText),elementData.sanitized=!0),menuFragment.appendChild(element)}if(that.options.sanitize&&toSanitize.length&&sanitizeHtml(toSanitize,that.options.whiteList,that.options.sanitizeFn),!0===isVirtual?(marginTop=0===that.selectpicker.view.position0?0:that.selectpicker.current.data[that.selectpicker.view.position0-1].position,marginBottom=that.selectpicker.view.position1>size-1?0:that.selectpicker.current.data[size-1].position-that.selectpicker.current.data[that.selectpicker.view.position1-1].position,menuInner.firstChild.style.marginTop=marginTop+"px",menuInner.firstChild.style.marginBottom=marginBottom+"px"):(menuInner.firstChild.style.marginTop=0,menuInner.firstChild.style.marginBottom=0),menuInner.firstChild.appendChild(menuFragment),!0===isVirtual&&that.sizeInfo.hasScrollBar){var menuInnerInnerWidth=menuInner.firstChild.offsetWidth;if(init&&menuInnerInnerWidth<that.sizeInfo.menuInnerInnerWidth&&that.sizeInfo.totalMenuWidth>that.sizeInfo.selectWidth)menuInner.firstChild.style.minWidth=that.sizeInfo.menuInnerInnerWidth+"px";else if(menuInnerInnerWidth>that.sizeInfo.menuInnerInnerWidth){that.$menu[0].style.minWidth=0;var actualMenuWidth=menuInner.firstChild.offsetWidth;actualMenuWidth>that.sizeInfo.menuInnerInnerWidth&&(that.sizeInfo.menuInnerInnerWidth=actualMenuWidth,menuInner.firstChild.style.minWidth=that.sizeInfo.menuInnerInnerWidth+"px"),that.$menu[0].style.minWidth=""}}}if(that.prevActiveIndex=that.activeIndex,that.options.liveSearch){if(isSearching&&init){var index=0,newActive;that.selectpicker.view.canHighlight[index]||(index=1+that.selectpicker.view.canHighlight.slice(1).indexOf(!0)),newActive=that.selectpicker.view.visibleElements[index],that.defocusItem(that.selectpicker.view.currentActive),that.activeIndex=(that.selectpicker.current.data[index]||{}).index,that.focusItem(newActive)}}else that.$menuInner.trigger("focus")}scroll(scrollTop,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(e,updateValue){that.noScroll||scroll(this.scrollTop,updateValue),that.noScroll=!1})),$(window).off("resize.bs.select."+this.selectId+".createView").on("resize.bs.select."+this.selectId+".createView",(function(){var isActive;that.$newElement.hasClass(classNames.SHOW)&&scroll(that.$menuInner[0].scrollTop)}))},focusItem:function(li,liData,noStyle){if(li){liData=liData||this.selectpicker.main.data[this.activeIndex];var a=li.firstChild;a&&(a.setAttribute("aria-setsize",this.selectpicker.view.size),a.setAttribute("aria-posinset",liData.posinset),!0!==noStyle&&(this.focusedParent.setAttribute("aria-activedescendant",a.id),li.classList.add("active"),a.classList.add("active")))}},defocusItem:function(li){li&&(li.classList.remove("active"),li.firstChild&&li.firstChild.classList.remove("active"))},setPlaceholder:function(){var that=this,updateIndex=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),updateIndex=!0;var element=this.$element[0],selectTitleOption=!1,titleNotAppended=!this.selectpicker.view.titleOption.parentNode,selectedIndex=element.selectedIndex,selectedOption=element.options[selectedIndex],navigation=window.performance&&window.performance.getEntriesByType("navigation");titleNotAppended&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",selectTitleOption=!selectedOption||0===selectedIndex&&!1===selectedOption.defaultSelected&&void 0===this.$element.data("selected")),(titleNotAppended||0!==this.selectpicker.view.titleOption.index)&&element.insertBefore(this.selectpicker.view.titleOption,element.firstChild),selectTitleOption&&navigation.length&&"back_forward"!==navigation[0].type?element.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){that.selectpicker.view.displayedValue!==element.value&&that.render()}))}return updateIndex},buildData:function(){var optionSelector=':not([hidden]):not([data-hidden="true"])',mainData=[],optID=0,startIndex=this.setPlaceholder()?1:0;this.options.hideDisabled&&(optionSelector+=":not(:disabled)");var selectOptions=this.$element[0].querySelectorAll("select > *"+optionSelector);function addDivider(config){var previousData=mainData[mainData.length-1];previousData&&"divider"===previousData.type&&(previousData.optID||config.optID)||((config=config||{}).type="divider",mainData.push(config))}function addOption(option,config){if((config=config||{}).divider="true"===option.getAttribute("data-divider"),config.divider)addDivider({optID:config.optID});else{var liIndex=mainData.length,cssText=option.style.cssText,inlineStyle=cssText?htmlEscape(cssText):"",optionClass=(option.className||"")+(config.optgroupClass||"");config.optID&&(optionClass="opt "+optionClass),config.optionClass=optionClass.trim(),config.inlineStyle=inlineStyle,config.text=option.textContent,config.content=option.getAttribute("data-content"),config.tokens=option.getAttribute("data-tokens"),config.subtext=option.getAttribute("data-subtext"),config.icon=option.getAttribute("data-icon"),option.liIndex=liIndex,config.display=config.content||config.text,config.type="option",config.index=liIndex,config.option=option,config.selected=!!option.selected,config.disabled=config.disabled||!!option.disabled,mainData.push(config)}}function addOptgroup(index,selectOptions){var optgroup=selectOptions[index],previous=!(index-1<startIndex)&&selectOptions[index-1],next=selectOptions[index+1],options=optgroup.querySelectorAll("option"+optionSelector);if(options.length){var config={display:htmlEscape(optgroup.label),subtext:optgroup.getAttribute("data-subtext"),icon:optgroup.getAttribute("data-icon"),type:"optgroup-label",optgroupClass:" "+(optgroup.className||"")},headerIndex,lastIndex;optID++,previous&&addDivider({optID:optID}),config.optID=optID,mainData.push(config);for(var j=0,len=options.length;j<len;j++){var option=options[j];0===j&&(lastIndex=(headerIndex=mainData.length-1)+len),addOption(option,{headerIndex:headerIndex,lastIndex:lastIndex,optID:config.optID,optgroupClass:config.optgroupClass,disabled:optgroup.disabled})}next&&addDivider({optID:optID})}}for(var len=selectOptions.length,i=startIndex;i<len;i++){var item=selectOptions[i];"OPTGROUP"!==item.tagName?addOption(item,{}):addOptgroup(i,selectOptions)}this.selectpicker.main.data=this.selectpicker.current.data=mainData},buildList:function(){var that=this,selectData=this.selectpicker.main.data,mainElements=[],widestOptionLength=0;function buildElement(item){var liElement,combinedLength=0;switch(item.type){case"divider":liElement=generateOption.li(!1,classNames.DIVIDER,item.optID?item.optID+"div":void 0);break;case"option":(liElement=generateOption.li(generateOption.a(generateOption.text.call(that,item),item.optionClass,item.inlineStyle),"",item.optID)).firstChild&&(liElement.firstChild.id=that.selectId+"-"+item.index);break;case"optgroup-label":liElement=generateOption.li(generateOption.label.call(that,item),"dropdown-header"+item.optgroupClass,item.optID)}item.element=liElement,mainElements.push(liElement),item.display&&(combinedLength+=item.display.length),item.subtext&&(combinedLength+=item.subtext.length),item.icon&&(combinedLength+=1),combinedLength>widestOptionLength&&(widestOptionLength=combinedLength,that.selectpicker.view.widestOption=mainElements[mainElements.length-1])}!that.options.showTick&&!that.multiple||elementTemplates.checkMark.parentNode||(elementTemplates.checkMark.className=this.options.iconBase+" "+that.options.tickIcon+" check-mark",elementTemplates.a.appendChild(elementTemplates.checkMark));for(var len=selectData.length,i=0;i<len;i++){var item;buildElement(selectData[i])}this.selectpicker.main.elements=this.selectpicker.current.elements=mainElements},findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){var that=this,element=this.$element[0],placeholderSelected=this.setPlaceholder()&&0===element.selectedIndex,selectedOptions=getSelectedOptions(element,this.options.hideDisabled),selectedCount=selectedOptions.length,button=this.$button[0],buttonInner=button.querySelector(".filter-option-inner-inner"),multipleSeparator=document.createTextNode(this.options.multipleSeparator),titleFragment=elementTemplates.fragment.cloneNode(!1),showCount,countMax,hasContent=!1;if(button.classList.toggle("bs-placeholder",this.multiple?!selectedCount:!getSelectValues(element,selectedOptions)),this.multiple||1!==selectedOptions.length||(this.selectpicker.view.displayedValue=getSelectValues(element,selectedOptions)),"static"===this.options.selectedTextFormat)titleFragment=generateOption.text.call(this,{text:this.options.title},!0);else if((showCount=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&selectedCount>1)&&(showCount=(countMax=this.options.selectedTextFormat.split(">")).length>1&&selectedCount>countMax[1]||1===countMax.length&&selectedCount>=2),!1===showCount){if(!placeholderSelected){for(var selectedIndex=0;selectedIndex<selectedCount&&selectedIndex<50;selectedIndex++){var option=selectedOptions[selectedIndex],thisData=this.selectpicker.main.data[option.liIndex],titleOptions={};this.multiple&&selectedIndex>0&&titleFragment.appendChild(multipleSeparator.cloneNode(!1)),option.title?titleOptions.text=option.title:thisData&&(thisData.content&&this.options.showContent?(titleOptions.content=thisData.content.toString(),hasContent=!0):(this.options.showIcon&&(titleOptions.icon=thisData.icon),this.options.showSubtext&&!this.multiple&&thisData.subtext&&(titleOptions.subtext=" "+thisData.subtext),titleOptions.text=option.textContent.trim())),titleFragment.appendChild(generateOption.text.call(this,titleOptions,!0))}selectedCount>49&&titleFragment.appendChild(document.createTextNode("..."))}}else{var optionSelector=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(optionSelector+=":not(:disabled)");var totalCount=this.$element[0].querySelectorAll("select > option"+optionSelector+", optgroup"+optionSelector+" option"+optionSelector).length,tr8nText="function"==typeof this.options.countSelectedText?this.options.countSelectedText(selectedCount,totalCount):this.options.countSelectedText;titleFragment=generateOption.text.call(this,{text:tr8nText.replace("{0}",selectedCount.toString()).replace("{1}",totalCount.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),titleFragment.childNodes.length||(titleFragment=generateOption.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),button.title=titleFragment.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&hasContent&&sanitizeHtml([titleFragment],this.options.whiteList,this.options.sanitizeFn),buttonInner.innerHTML="",buttonInner.appendChild(titleFragment),version.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var filterExpand=button.querySelector(".filter-expand"),clone=buttonInner.cloneNode(!0);clone.className="filter-expand",filterExpand?button.replaceChild(clone,filterExpand):button.appendChild(clone)}this.$element.trigger("rendered.bs.select")},setStyle:function(newStyle,status){var button=this.$button[0],newElement=this.$newElement[0],style=this.options.style.trim(),buttonClass;this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),version.major<4&&(newElement.classList.add("bs3"),newElement.parentNode.classList&&newElement.parentNode.classList.contains("input-group")&&(newElement.previousElementSibling||newElement.nextElementSibling)&&(newElement.previousElementSibling||newElement.nextElementSibling).classList.contains("input-group-addon")&&newElement.classList.add("bs3-has-addon")),buttonClass=newStyle?newStyle.trim():style,"add"==status?buttonClass&&button.classList.add.apply(button.classList,buttonClass.split(" ")):"remove"==status?buttonClass&&button.classList.remove.apply(button.classList,buttonClass.split(" ")):(style&&button.classList.remove.apply(button.classList,style.split(" ")),buttonClass&&button.classList.add.apply(button.classList,buttonClass.split(" ")))},liHeight:function(refresh){if(refresh||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var newElement=elementTemplates.div.cloneNode(!1),menu=elementTemplates.div.cloneNode(!1),menuInner=elementTemplates.div.cloneNode(!1),menuInnerInner=document.createElement("ul"),divider=elementTemplates.li.cloneNode(!1),dropdownHeader=elementTemplates.li.cloneNode(!1),li,a=elementTemplates.a.cloneNode(!1),text=elementTemplates.span.cloneNode(!1),header=this.options.header&&this.$menu.find("."+classNames.POPOVERHEADER).length>0?this.$menu.find("."+classNames.POPOVERHEADER)[0].cloneNode(!0):null,search=this.options.liveSearch?elementTemplates.div.cloneNode(!1):null,actions=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,doneButton=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,firstOption=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,text.className="text",a.className="dropdown-item "+(firstOption?firstOption.className:""),newElement.className=this.$menu[0].parentNode.className+" "+classNames.SHOW,newElement.style.width=0,"auto"===this.options.width&&(menu.style.minWidth=0),menu.className=classNames.MENU+" "+classNames.SHOW,menuInner.className="inner "+classNames.SHOW,menuInnerInner.className=classNames.MENU+" inner "+("4"===version.major?classNames.SHOW:""),divider.className=classNames.DIVIDER,dropdownHeader.className="dropdown-header",text.appendChild(document.createTextNode("")),this.selectpicker.current.data.length)for(var i=0;i<this.selectpicker.current.data.length;i++){var data=this.selectpicker.current.data[i];if("option"===data.type){li=data.element;break}}else li=elementTemplates.li.cloneNode(!1),a.appendChild(text),li.appendChild(a);if(dropdownHeader.appendChild(text.cloneNode(!0)),this.selectpicker.view.widestOption&&menuInnerInner.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),menuInnerInner.appendChild(li),menuInnerInner.appendChild(divider),menuInnerInner.appendChild(dropdownHeader),header&&menu.appendChild(header),search){var input=document.createElement("input");search.className="bs-searchbox",input.className="form-control",search.appendChild(input),menu.appendChild(search)}actions&&menu.appendChild(actions),menuInner.appendChild(menuInnerInner),menu.appendChild(menuInner),doneButton&&menu.appendChild(doneButton),newElement.appendChild(menu),document.body.appendChild(newElement);var liHeight=li.offsetHeight,dropdownHeaderHeight=dropdownHeader?dropdownHeader.offsetHeight:0,headerHeight=header?header.offsetHeight:0,searchHeight=search?search.offsetHeight:0,actionsHeight=actions?actions.offsetHeight:0,doneButtonHeight=doneButton?doneButton.offsetHeight:0,dividerHeight=$(divider).outerHeight(!0),menuStyle=!!window.getComputedStyle&&window.getComputedStyle(menu),menuWidth=menu.offsetWidth,$menu=menuStyle?null:$(menu),menuPadding={vert:toInteger(menuStyle?menuStyle.paddingTop:$menu.css("paddingTop"))+toInteger(menuStyle?menuStyle.paddingBottom:$menu.css("paddingBottom"))+toInteger(menuStyle?menuStyle.borderTopWidth:$menu.css("borderTopWidth"))+toInteger(menuStyle?menuStyle.borderBottomWidth:$menu.css("borderBottomWidth")),horiz:toInteger(menuStyle?menuStyle.paddingLeft:$menu.css("paddingLeft"))+toInteger(menuStyle?menuStyle.paddingRight:$menu.css("paddingRight"))+toInteger(menuStyle?menuStyle.borderLeftWidth:$menu.css("borderLeftWidth"))+toInteger(menuStyle?menuStyle.borderRightWidth:$menu.css("borderRightWidth"))},menuExtras={vert:menuPadding.vert+toInteger(menuStyle?menuStyle.marginTop:$menu.css("marginTop"))+toInteger(menuStyle?menuStyle.marginBottom:$menu.css("marginBottom"))+2,horiz:menuPadding.horiz+toInteger(menuStyle?menuStyle.marginLeft:$menu.css("marginLeft"))+toInteger(menuStyle?menuStyle.marginRight:$menu.css("marginRight"))+2},scrollBarWidth;menuInner.style.overflowY="scroll",scrollBarWidth=menu.offsetWidth-menuWidth,document.body.removeChild(newElement),this.sizeInfo.liHeight=liHeight,this.sizeInfo.dropdownHeaderHeight=dropdownHeaderHeight,this.sizeInfo.headerHeight=headerHeight,this.sizeInfo.searchHeight=searchHeight,this.sizeInfo.actionsHeight=actionsHeight,this.sizeInfo.doneButtonHeight=doneButtonHeight,this.sizeInfo.dividerHeight=dividerHeight,this.sizeInfo.menuPadding=menuPadding,this.sizeInfo.menuExtras=menuExtras,this.sizeInfo.menuWidth=menuWidth,this.sizeInfo.menuInnerInnerWidth=menuWidth-menuPadding.horiz,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth,this.sizeInfo.scrollBarWidth=scrollBarWidth,this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight,this.setPositionData()}},getSelectPosition:function(){var that=this,$window=$(window),pos=this.$newElement.offset(),$container=$(this.options.container),containerPos;this.options.container&&$container.length&&!$container.is("body")?((containerPos=$container.offset()).top+=parseInt($container.css("borderTopWidth")),containerPos.left+=parseInt($container.css("borderLeftWidth"))):containerPos={top:0,left:0};var winPad=this.options.windowPadding;this.sizeInfo.selectOffsetTop=pos.top-containerPos.top-$window.scrollTop(),this.sizeInfo.selectOffsetBot=$window.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-containerPos.top-winPad[2],this.sizeInfo.selectOffsetLeft=pos.left-containerPos.left-$window.scrollLeft(),this.sizeInfo.selectOffsetRight=$window.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-containerPos.left-winPad[1],this.sizeInfo.selectOffsetTop-=winPad[0],this.sizeInfo.selectOffsetLeft-=winPad[3]},setMenuSize:function(isAuto){this.getSelectPosition();var selectWidth=this.sizeInfo.selectWidth,liHeight=this.sizeInfo.liHeight,headerHeight=this.sizeInfo.headerHeight,searchHeight=this.sizeInfo.searchHeight,actionsHeight=this.sizeInfo.actionsHeight,doneButtonHeight=this.sizeInfo.doneButtonHeight,divHeight=this.sizeInfo.dividerHeight,menuPadding=this.sizeInfo.menuPadding,menuInnerHeight,menuHeight,divLength=0,minHeight,_minHeight,maxHeight,menuInnerMinHeight,estimate,isDropup;if(this.options.dropupAuto&&(estimate=liHeight*this.selectpicker.current.elements.length+menuPadding.vert,isDropup=this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&estimate+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(isDropup=this.selectpicker.dropup),this.$newElement.toggleClass(classNames.DROPUP,isDropup),this.selectpicker.dropup=isDropup),"auto"===this.options.size)_minHeight=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,menuHeight=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,minHeight=_minHeight+headerHeight+searchHeight+actionsHeight+doneButtonHeight,menuInnerMinHeight=Math.max(_minHeight-menuPadding.vert,0),this.$newElement.hasClass(classNames.DROPUP)&&(menuHeight=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),maxHeight=menuHeight,menuInnerHeight=menuHeight-headerHeight-searchHeight-actionsHeight-doneButtonHeight-menuPadding.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var i=0;i<this.options.size;i++)"divider"===this.selectpicker.current.data[i].type&&divLength++;menuInnerHeight=(menuHeight=liHeight*this.options.size+divLength*divHeight+menuPadding.vert)-menuPadding.vert,maxHeight=menuHeight+headerHeight+searchHeight+actionsHeight+doneButtonHeight,minHeight=menuInnerMinHeight=""}this.$menu.css({"max-height":maxHeight+"px",overflow:"hidden","min-height":minHeight+"px"}),this.$menuInner.css({"max-height":menuInnerHeight+"px","overflow-y":"auto","min-height":menuInnerMinHeight+"px"}),this.sizeInfo.menuInnerHeight=Math.max(menuInnerHeight,1),this.selectpicker.current.data.length&&this.selectpicker.current.data[this.selectpicker.current.data.length-1].position>this.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(classNames.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.sizeInfo.totalMenuWidth-selectWidth),this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(refresh){if(this.liHeight(refresh),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var that=this,$window=$(window);this.setMenuSize(),this.options.liveSearch&&this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",(function(){return that.setMenuSize()})),"auto"===this.options.size?$window.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+EVENT_KEY+"."+this.selectId+".setMenuSize").on("resize.bs.select."+this.selectId+".setMenuSize scroll"+EVENT_KEY+"."+this.selectId+".setMenuSize",(function(){return that.setMenuSize()})):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&$window.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+EVENT_KEY+"."+this.selectId+".setMenuSize")}this.createView(!1,!0,refresh)},setWidth:function(){var that=this;"auto"===this.options.width?requestAnimationFrame((function(){that.$menu.css("min-width","0"),that.$element.on("loaded.bs.select",(function(){that.liHeight(),that.setMenuSize();var $selectClone=that.$newElement.clone().appendTo("body"),btnWidth=$selectClone.css("width","auto").children("button").outerWidth();$selectClone.remove(),that.sizeInfo.selectWidth=Math.max(that.sizeInfo.totalMenuWidth,btnWidth),that.$newElement.css("width",that.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=$('<div class="bs-container" />');var that=this,$container=$(this.options.container),pos,containerPos,actualHeight,getPlacement=function($element){var containerPosition={},display=that.options.display||!!$.fn.dropdown.Constructor.Default&&$.fn.dropdown.Constructor.Default.display;that.$bsContainer.addClass($element.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(classNames.DROPUP,$element.hasClass(classNames.DROPUP)),pos=$element.offset(),$container.is("body")?containerPos={top:0,left:0}:((containerPos=$container.offset()).top+=parseInt($container.css("borderTopWidth"))-$container.scrollTop(),containerPos.left+=parseInt($container.css("borderLeftWidth"))-$container.scrollLeft()),actualHeight=$element.hasClass(classNames.DROPUP)?0:$element[0].offsetHeight,(version.major<4||"static"===display)&&(containerPosition.top=pos.top-containerPos.top+actualHeight,containerPosition.left=pos.left-containerPos.left),containerPosition.width=$element[0].offsetWidth,that.$bsContainer.css(containerPosition)};this.$button.on("click.bs.dropdown.data-api",(function(){that.isDisabled()||(getPlacement(that.$newElement),that.$bsContainer.appendTo(that.options.container).toggleClass(classNames.SHOW,!that.$button.hasClass(classNames.SHOW)).append(that.$menu))})),$(window).off("resize.bs.select."+this.selectId+" scroll"+EVENT_KEY+"."+this.selectId).on("resize.bs.select."+this.selectId+" scroll"+EVENT_KEY+"."+this.selectId,(function(){var isActive;that.$newElement.hasClass(classNames.SHOW)&&getPlacement(that.$newElement)})),this.$element.on("hide.bs.select",(function(){that.$menu.data("height",that.$menu.height()),that.$bsContainer.detach()}))},setOptionStatus:function(selectedOnly){var that=this;if(this.noScroll=!1,this.selectpicker.view.visibleElements&&this.selectpicker.view.visibleElements.length)for(var i=0;i<this.selectpicker.view.visibleElements.length;i++){var liData=this.selectpicker.current.data[i+this.selectpicker.view.position0],option=liData.option;option&&(!0!==selectedOnly&&this.setDisabled(liData.index,liData.disabled),this.setSelected(liData.index,option.selected))}},setSelected:function(index,selected){var li=this.selectpicker.main.elements[index],liData=this.selectpicker.main.data[index],activeIndexIsSet=void 0!==this.activeIndex,thisIsActive,prevActive,a,keepActive=this.activeIndex===index||selected&&!this.multiple&&!activeIndexIsSet;liData.selected=selected,a=li.firstChild,selected&&(this.selectedIndex=index),li.classList.toggle("selected",selected),keepActive?(this.focusItem(li,liData),this.selectpicker.view.currentActive=li,this.activeIndex=index):this.defocusItem(li),a&&(a.classList.toggle("selected",selected),selected?a.setAttribute("aria-selected",!0):this.multiple?a.setAttribute("aria-selected",!1):a.removeAttribute("aria-selected")),keepActive||activeIndexIsSet||!selected||void 0===this.prevActiveIndex||(prevActive=this.selectpicker.main.elements[this.prevActiveIndex],this.defocusItem(prevActive))},setDisabled:function(index,disabled){var li=this.selectpicker.main.elements[index],a;this.selectpicker.main.data[index].disabled=disabled,a=li.firstChild,li.classList.toggle(classNames.DISABLED,disabled),a&&("4"===version.major&&a.classList.toggle(classNames.DISABLED,disabled),disabled?(a.setAttribute("aria-disabled",disabled),a.setAttribute("tabindex",-1)):(a.removeAttribute("aria-disabled"),a.setAttribute("tabindex",0)))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){this.isDisabled()?(this.$newElement[0].classList.add(classNames.DISABLED),this.$button.addClass(classNames.DISABLED).attr("aria-disabled",!0)):this.$button[0].classList.contains(classNames.DISABLED)&&(this.$newElement[0].classList.remove(classNames.DISABLED),this.$button.removeClass(classNames.DISABLED).attr("aria-disabled",!1))},clickListener:function(){var that=this,$document=$(document);function setFocus(){that.options.liveSearch?that.$searchbox.trigger("focus"):that.$menuInner.trigger("focus")}function checkPopperExists(){that.dropdown&&that.dropdown._popper&&that.dropdown._popper.state.isCreated?setFocus():requestAnimationFrame(checkPopperExists)}$document.data("spaceSelect",!1),this.$button.on("keyup",(function(e){/(32)/.test(e.keyCode.toString(10))&&$document.data("spaceSelect")&&(e.preventDefault(),$document.data("spaceSelect",!1))})),this.$newElement.on("show.bs.dropdown",(function(){version.major>3&&!that.dropdown&&(that.dropdown=that.$button.data("bs.dropdown"),that.dropdown._menu=that.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){that.$newElement.hasClass(classNames.SHOW)||that.setSize()})),this.$element.on("shown.bs.select",(function(){that.$menuInner[0].scrollTop!==that.selectpicker.view.scrollTop&&(that.$menuInner[0].scrollTop=that.selectpicker.view.scrollTop),version.major>3?requestAnimationFrame(checkPopperExists):setFocus()})),this.$menuInner.on("mouseenter","li a",(function(e){var hoverLi=this.parentElement,position0=that.isVirtual()?that.selectpicker.view.position0:0,index=Array.prototype.indexOf.call(hoverLi.parentElement.children,hoverLi),hoverData=that.selectpicker.current.data[index+position0];that.focusItem(hoverLi,hoverData,!0)})),this.$menuInner.on("click","li a",(function(e,retainActive){var $this=$(this),element=that.$element[0],position0=that.isVirtual()?that.selectpicker.view.position0:0,clickedData=that.selectpicker.current.data[$this.parent().index()+position0],clickedIndex=clickedData.index,prevValue=getSelectValues(element),prevIndex=element.selectedIndex,prevOption=element.options[prevIndex],triggerChange=!0;if(that.multiple&&1!==that.options.maxOptions&&e.stopPropagation(),e.preventDefault(),!that.isDisabled()&&!$this.parent().hasClass(classNames.DISABLED)){var option=clickedData.option,$option=$(option),state=option.selected,$optgroup=$option.parent("optgroup"),$optgroupOptions=$optgroup.find("option"),maxOptions=that.options.maxOptions,maxOptionsGrp=$optgroup.data("maxOptions")||!1;if(clickedIndex===that.activeIndex&&(retainActive=!0),retainActive||(that.prevActiveIndex=that.activeIndex,that.activeIndex=void 0),that.multiple){if(option.selected=!state,that.setSelected(clickedIndex,!state),$this.trigger("blur"),!1!==maxOptions||!1!==maxOptionsGrp){var maxReached=maxOptions<getSelectedOptions(element).length,maxReachedGrp=maxOptionsGrp<$optgroup.find("option:selected").length;if(maxOptions&&maxReached||maxOptionsGrp&&maxReachedGrp)if(maxOptions&&1==maxOptions)element.selectedIndex=-1,option.selected=!0,that.setOptionStatus(!0);else if(maxOptionsGrp&&1==maxOptionsGrp){for(var i=0;i<$optgroupOptions.length;i++){var _option=$optgroupOptions[i];_option.selected=!1,that.setSelected(_option.liIndex,!1)}option.selected=!0,that.setSelected(clickedIndex,!0)}else{var maxOptionsText="string"==typeof that.options.maxOptionsText?[that.options.maxOptionsText,that.options.maxOptionsText]:that.options.maxOptionsText,maxOptionsArr="function"==typeof maxOptionsText?maxOptionsText(maxOptions,maxOptionsGrp):maxOptionsText,maxTxt=maxOptionsArr[0].replace("{n}",maxOptions),maxTxtGrp=maxOptionsArr[1].replace("{n}",maxOptionsGrp),$notify=$('<div class="notify"></div>');maxOptionsArr[2]&&(maxTxt=maxTxt.replace("{var}",maxOptionsArr[2][maxOptions>1?0:1]),maxTxtGrp=maxTxtGrp.replace("{var}",maxOptionsArr[2][maxOptionsGrp>1?0:1])),option.selected=!1,that.$menu.append($notify),maxOptions&&maxReached&&($notify.append($("<div>"+maxTxt+"</div>")),triggerChange=!1,that.$element.trigger("maxReached.bs.select")),maxOptionsGrp&&maxReachedGrp&&($notify.append($("<div>"+maxTxtGrp+"</div>")),triggerChange=!1,that.$element.trigger("maxReachedGrp.bs.select")),setTimeout((function(){that.setSelected(clickedIndex,!1)}),10),$notify[0].classList.add("fadeOut"),setTimeout((function(){$notify.remove()}),1050)}}}else prevOption&&(prevOption.selected=!1),option.selected=!0,that.setSelected(clickedIndex,!0);!that.multiple||that.multiple&&1===that.options.maxOptions?that.$button.trigger("focus"):that.options.liveSearch&&that.$searchbox.trigger("focus"),triggerChange&&(that.multiple||prevIndex!==element.selectedIndex)&&(changedArguments=[option.index,$option.prop("selected"),prevValue],that.$element.triggerNative("change"))}})),this.$menu.on("click","li."+classNames.DISABLED+" a, ."+classNames.POPOVERHEADER+", ."+classNames.POPOVERHEADER+" :not(.close)",(function(e){e.currentTarget==this&&(e.preventDefault(),e.stopPropagation(),that.options.liveSearch&&!$(e.target).hasClass("close")?that.$searchbox.trigger("focus"):that.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault(),e.stopPropagation(),that.options.liveSearch?that.$searchbox.trigger("focus"):that.$button.trigger("focus")})),this.$menu.on("click","."+classNames.POPOVERHEADER+" .close",(function(){that.$button.trigger("click")})),this.$searchbox.on("click",(function(e){e.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(e){that.options.liveSearch?that.$searchbox.trigger("focus"):that.$button.trigger("focus"),e.preventDefault(),e.stopPropagation(),$(this).hasClass("bs-select-all")?that.selectAll():that.deselectAll()})),this.$button.on("focus.bs.select",(function(e){var tabindex=that.$element[0].getAttribute("tabindex");void 0!==tabindex&&e.originalEvent&&e.originalEvent.isTrusted&&(this.setAttribute("tabindex",tabindex),that.$element[0].setAttribute("tabindex",-1),that.selectpicker.view.tabindex=tabindex)})).on("blur.bs.select",(function(e){void 0!==that.selectpicker.view.tabindex&&e.originalEvent&&e.originalEvent.isTrusted&&(that.$element[0].setAttribute("tabindex",that.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),that.selectpicker.view.tabindex=void 0)})),this.$element.on("change.bs.select",(function(){that.render(),that.$element.trigger("changed.bs.select",changedArguments),changedArguments=null})).on("focus.bs.select",(function(){that.options.mobile||that.$button.trigger("focus")}))},liveSearchListener:function(){var that=this;this.$button.on("click.bs.dropdown.data-api",(function(){that.$searchbox.val()&&that.$searchbox.val("")})),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(e){e.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var searchValue=that.$searchbox.val();if(that.selectpicker.search.elements=[],that.selectpicker.search.data=[],searchValue){var i,searchMatch=[],q=searchValue.toUpperCase(),cache={},cacheArr=[],searchStyle=that._searchStyle(),normalizeSearch=that.options.liveSearchNormalize;normalizeSearch&&(q=normalizeToBase(q));for(var i=0;i<that.selectpicker.main.data.length;i++){var li=that.selectpicker.main.data[i];cache[i]||(cache[i]=stringSearch(li,q,searchStyle,normalizeSearch)),cache[i]&&void 0!==li.headerIndex&&-1===cacheArr.indexOf(li.headerIndex)&&(li.headerIndex>0&&(cache[li.headerIndex-1]=!0,cacheArr.push(li.headerIndex-1)),cache[li.headerIndex]=!0,cacheArr.push(li.headerIndex),cache[li.lastIndex+1]=!0),cache[i]&&"optgroup-label"!==li.type&&cacheArr.push(i)}for(var i=0,cacheLen=cacheArr.length;i<cacheLen;i++){var index=cacheArr[i],prevIndex=cacheArr[i-1],li=that.selectpicker.main.data[index],liPrev=that.selectpicker.main.data[prevIndex];("divider"!==li.type||"divider"===li.type&&liPrev&&"divider"!==liPrev.type&&cacheLen-1!==i)&&(that.selectpicker.search.data.push(li),searchMatch.push(that.selectpicker.main.elements[index]))}that.activeIndex=void 0,that.noScroll=!0,that.$menuInner.scrollTop(0),that.selectpicker.search.elements=searchMatch,that.createView(!0),showNoResults.call(that,searchMatch,searchValue)}else that.$menuInner.scrollTop(0),that.createView(!1)}))},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(value){var element=this.$element[0];if(void 0!==value){var prevValue=getSelectValues(element);if(changedArguments=[null,null,prevValue],this.$element.val(value).trigger("changed.bs.select",changedArguments),this.$newElement.hasClass(classNames.SHOW))if(this.multiple)this.setOptionStatus(!0);else{var liSelectedIndex=(element.options[element.selectedIndex]||{}).liIndex;"number"==typeof liSelectedIndex&&(this.setSelected(this.selectedIndex,!1),this.setSelected(liSelectedIndex,!0))}return this.render(),changedArguments=null,this.$element}return this.$element.val()},changeAll:function(status){if(this.multiple){void 0===status&&(status=!0);var element=this.$element[0],previousSelected=0,currentSelected=0,prevValue=getSelectValues(element);element.classList.add("bs-select-hidden");for(var i=0,data=this.selectpicker.current.data,len=data.length;i<len;i++){var liData=data[i],option=liData.option;option&&!liData.disabled&&"divider"!==liData.type&&(liData.selected&&previousSelected++,option.selected=status,!0===status&¤tSelected++)}element.classList.remove("bs-select-hidden"),previousSelected!==currentSelected&&(this.setOptionStatus(),changedArguments=[null,null,prevValue],this.$element.triggerNative("change"))}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(e){(e=e||window.event)&&e.stopPropagation(),this.$button.trigger("click.bs.dropdown.data-api")},keydown:function(e){var $this=$(this),isToggle=$this.hasClass("dropdown-toggle"),$parent,that=(isToggle?$this.closest(".dropdown"):$this.closest(Selector.MENU)).data("this"),$items=that.findLis(),index,isActive,liActive,activeLi,offset,updateScroll=!1,downOnTab=e.which===keyCodes_TAB&&!isToggle&&!that.options.selectOnTab,isArrowKey=REGEXP_ARROW.test(e.which)||downOnTab,scrollTop=that.$menuInner[0].scrollTop,isVirtual,position0=!0===that.isVirtual()?that.selectpicker.view.position0:0;if(!(e.which>=112&&e.which<=123))if(!(isActive=that.$newElement.hasClass(classNames.SHOW))&&(isArrowKey||e.which>=48&&e.which<=57||e.which>=96&&e.which<=105||e.which>=65&&e.which<=90)&&(that.$button.trigger("click.bs.dropdown.data-api"),that.options.liveSearch))that.$searchbox.trigger("focus");else{if(e.which===keyCodes_ESCAPE&&isActive&&(e.preventDefault(),that.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),isArrowKey){if(!$items.length)return;-1!==(index=(liActive=that.selectpicker.main.elements[that.activeIndex])?Array.prototype.indexOf.call(liActive.parentElement.children,liActive):-1)&&that.defocusItem(liActive),e.which===keyCodes_ARROW_UP?(-1!==index&&index--,index+position0<0&&(index+=$items.length),that.selectpicker.view.canHighlight[index+position0]||-1===(index=that.selectpicker.view.canHighlight.slice(0,index+position0).lastIndexOf(!0)-position0)&&(index=$items.length-1)):(e.which===keyCodes_ARROW_DOWN||downOnTab)&&(++index+position0>=that.selectpicker.view.canHighlight.length&&(index=0),that.selectpicker.view.canHighlight[index+position0]||(index=index+1+that.selectpicker.view.canHighlight.slice(index+position0+1).indexOf(!0))),e.preventDefault();var liActiveIndex=position0+index;e.which===keyCodes_ARROW_UP?0===position0&&index===$items.length-1?(that.$menuInner[0].scrollTop=that.$menuInner[0].scrollHeight,liActiveIndex=that.selectpicker.current.elements.length-1):updateScroll=(offset=(activeLi=that.selectpicker.current.data[liActiveIndex]).position-activeLi.height)<scrollTop:(e.which===keyCodes_ARROW_DOWN||downOnTab)&&(0===index?(that.$menuInner[0].scrollTop=0,liActiveIndex=0):updateScroll=(offset=(activeLi=that.selectpicker.current.data[liActiveIndex]).position-that.sizeInfo.menuInnerHeight)>scrollTop),liActive=that.selectpicker.current.elements[liActiveIndex],that.activeIndex=that.selectpicker.current.data[liActiveIndex].index,that.focusItem(liActive),that.selectpicker.view.currentActive=liActive,updateScroll&&(that.$menuInner[0].scrollTop=offset),that.options.liveSearch?that.$searchbox.trigger("focus"):$this.trigger("focus")}else if(!$this.is("input")&&!REGEXP_TAB_OR_ESCAPE.test(e.which)||e.which===keyCodes_SPACE&&that.selectpicker.keydown.keyHistory){var searchMatch,matches=[],keyHistory;e.preventDefault(),that.selectpicker.keydown.keyHistory+=keyCodeMap[e.which],that.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(that.selectpicker.keydown.resetKeyHistory.cancel),that.selectpicker.keydown.resetKeyHistory.cancel=that.selectpicker.keydown.resetKeyHistory.start(),keyHistory=that.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(keyHistory)&&(keyHistory=keyHistory.charAt(0));for(var i=0;i<that.selectpicker.current.data.length;i++){var li=that.selectpicker.current.data[i],hasMatch;(hasMatch=stringSearch(li,keyHistory,"startsWith",!0))&&that.selectpicker.view.canHighlight[i]&&matches.push(li.index)}if(matches.length){var matchIndex=0;$items.removeClass("active").find("a").removeClass("active"),1===keyHistory.length&&(-1===(matchIndex=matches.indexOf(that.activeIndex))||matchIndex===matches.length-1?matchIndex=0:matchIndex++),searchMatch=matches[matchIndex],scrollTop-(activeLi=that.selectpicker.main.data[searchMatch]).position>0?(offset=activeLi.position-activeLi.height,updateScroll=!0):(offset=activeLi.position-that.sizeInfo.menuInnerHeight,updateScroll=activeLi.position>scrollTop+that.sizeInfo.menuInnerHeight),liActive=that.selectpicker.main.elements[searchMatch],that.activeIndex=matches[matchIndex],that.focusItem(liActive),liActive&&liActive.firstChild.focus(),updateScroll&&(that.$menuInner[0].scrollTop=offset),$this.trigger("focus")}}isActive&&(e.which===keyCodes_SPACE&&!that.selectpicker.keydown.keyHistory||e.which===keyCodes_ENTER||e.which===keyCodes_TAB&&that.options.selectOnTab)&&(e.which!==keyCodes_SPACE&&e.preventDefault(),that.options.liveSearch&&e.which===keyCodes_SPACE||(that.$menuInner.find(".active a").trigger("click",!0),$this.trigger("focus"),that.options.liveSearch||(e.preventDefault(),$(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var config=$.extend({},this.options,this.$element.data());this.options=config,this.checkDisabled(),this.buildData(),this.setStyle(),this.render(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(EVENT_KEY).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),$(window).off(".bs.select."+this.selectId)}};var old=$.fn.selectpicker;function keydownHandler(){if($.fn.dropdown){var bootstrapKeydown=$.fn.dropdown.Constructor._dataApiKeydownHandler||$.fn.dropdown.Constructor.prototype.keydown;return bootstrapKeydown.apply(this,arguments)}}$.fn.selectpicker=Plugin,$.fn.selectpicker.Constructor=Selectpicker,$.fn.selectpicker.noConflict=function(){return $.fn.selectpicker=old,this},$(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',keydownHandler).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",keydownHandler).on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',Selectpicker.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(e){e.stopPropagation()})),$(window).on("load.bs.select.data-api",(function(){$(".selectpicker").each((function(){var $selectpicker=$(this);Plugin.call($selectpicker,$selectpicker.data())}))}))}(jQuery)})),
|
||
/**
|
||
* bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
|
||
*
|
||
* @version v3.3.4
|
||
* @homepage https://bttstrp.github.io/bootstrap-switch
|
||
* @author Mattia Larentis <mattia@larentis.eu> (http://larentis.eu)
|
||
* @license Apache-2.0
|
||
*/
|
||
function(global,factory){if("function"==typeof define&&define.amd)define(["jquery"],factory);else if("undefined"!=typeof exports)factory(require("jquery"));else{var mod={exports:{}};factory(global.jquery),global.bootstrapSwitch=mod.exports}}(this,(function(_jquery){"use strict";var _jquery2=_interopRequireDefault(_jquery);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),$=_jquery2.default||window.jQuery||window.$,BootstrapSwitch=function(){function BootstrapSwitch(element){var _this=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,BootstrapSwitch),this.$element=$(element),this.options=$.extend({},$.fn.bootstrapSwitch.defaults,this._getElementOptions(),options),this.prevOptions={},this.$wrapper=$("<div>",{class:function _class(){var classes=[];return classes.push(_this.options.state?"on":"off"),_this.options.size&&classes.push(_this.options.size),_this.options.disabled&&classes.push("disabled"),_this.options.readonly&&classes.push("readonly"),_this.options.indeterminate&&classes.push("indeterminate"),_this.options.inverse&&classes.push("inverse"),_this.$element.attr("id")&&classes.push("id-"+_this.$element.attr("id")),classes.map(_this._getClass.bind(_this)).concat([_this.options.baseClass],_this._getClasses(_this.options.wrapperClass)).join(" ")}}),this.$container=$("<div>",{class:this._getClass("container")}),this.$on=$("<span>",{html:this.options.onText,class:this._getClass("handle-on")+" "+this._getClass(this.options.onColor)}),this.$off=$("<span>",{html:this.options.offText,class:this._getClass("handle-off")+" "+this._getClass(this.options.offColor)}),this.$label=$("<span>",{html:this.options.labelText,class:this._getClass("label")}),this.$element.on("init.bootstrapSwitch",this.options.onInit.bind(this,element)),this.$element.on("switchChange.bootstrapSwitch",(function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];!1===_this.options.onSwitchChange.apply(element,args)&&(_this.$element.is(":radio")?$('[name="'+_this.$element.attr("name")+'"]').trigger("previousState.bootstrapSwitch",!0):_this.$element.trigger("previousState.bootstrapSwitch",!0))})),this.$container=this.$element.wrap(this.$container).parent(),this.$wrapper=this.$container.wrap(this.$wrapper).parent(),this.$element.before(this.options.inverse?this.$off:this.$on).before(this.$label).before(this.options.inverse?this.$on:this.$off),this.options.indeterminate&&this.$element.prop("indeterminate",!0),this._init(),this._elementHandlers(),this._handleHandlers(),this._labelHandlers(),this._formHandler(),this._externalLabelHandler(),this.$element.trigger("init.bootstrapSwitch",this.options.state)}return _createClass(BootstrapSwitch,[{key:"setPrevOptions",value:function setPrevOptions(){this.prevOptions=_extends({},this.options)}},{key:"state",value:function state(value,skip){return void 0===value?this.options.state:this.options.disabled||this.options.readonly||this.options.state&&!this.options.radioAllOff&&this.$element.is(":radio")?this.$element:(this.$element.is(":radio")?$('[name="'+this.$element.attr("name")+'"]').trigger("setPreviousOptions.bootstrapSwitch"):this.$element.trigger("setPreviousOptions.bootstrapSwitch"),this.options.indeterminate&&this.indeterminate(!1),this.$element.prop("checked",Boolean(value)).trigger("change.bootstrapSwitch",skip),this.$element)}},{key:"toggleState",value:function toggleState(skip){return this.options.disabled||this.options.readonly?this.$element:this.options.indeterminate?(this.indeterminate(!1),this.state(!0)):this.$element.prop("checked",!this.options.state).trigger("change.bootstrapSwitch",skip)}},{key:"size",value:function size(value){return void 0===value?this.options.size:(null!=this.options.size&&this.$wrapper.removeClass(this._getClass(this.options.size)),value&&this.$wrapper.addClass(this._getClass(value)),this._width(),this._containerPosition(),this.options.size=value,this.$element)}},{key:"animate",value:function animate(value){return void 0===value?this.options.animate:this.options.animate===Boolean(value)?this.$element:this.toggleAnimate()}},{key:"toggleAnimate",value:function toggleAnimate(){return this.options.animate=!this.options.animate,this.$wrapper.toggleClass(this._getClass("animate")),this.$element}},{key:"disabled",value:function disabled(value){return void 0===value?this.options.disabled:this.options.disabled===Boolean(value)?this.$element:this.toggleDisabled()}},{key:"toggleDisabled",value:function toggleDisabled(){return this.options.disabled=!this.options.disabled,this.$element.prop("disabled",this.options.disabled),this.$wrapper.toggleClass(this._getClass("disabled")),this.$element}},{key:"readonly",value:function readonly(value){return void 0===value?this.options.readonly:this.options.readonly===Boolean(value)?this.$element:this.toggleReadonly()}},{key:"toggleReadonly",value:function toggleReadonly(){return this.options.readonly=!this.options.readonly,this.$element.prop("readonly",this.options.readonly),this.$wrapper.toggleClass(this._getClass("readonly")),this.$element}},{key:"indeterminate",value:function indeterminate(value){return void 0===value?this.options.indeterminate:this.options.indeterminate===Boolean(value)?this.$element:this.toggleIndeterminate()}},{key:"toggleIndeterminate",value:function toggleIndeterminate(){return this.options.indeterminate=!this.options.indeterminate,this.$element.prop("indeterminate",this.options.indeterminate),this.$wrapper.toggleClass(this._getClass("indeterminate")),this._containerPosition(),this.$element}},{key:"inverse",value:function inverse(value){return void 0===value?this.options.inverse:this.options.inverse===Boolean(value)?this.$element:this.toggleInverse()}},{key:"toggleInverse",value:function toggleInverse(){this.$wrapper.toggleClass(this._getClass("inverse"));var $on=this.$on.clone(!0),$off=this.$off.clone(!0);return this.$on.replaceWith($off),this.$off.replaceWith($on),this.$on=$off,this.$off=$on,this.options.inverse=!this.options.inverse,this.$element}},{key:"onColor",value:function onColor(value){return void 0===value?this.options.onColor:(this.options.onColor&&this.$on.removeClass(this._getClass(this.options.onColor)),this.$on.addClass(this._getClass(value)),this.options.onColor=value,this.$element)}},{key:"offColor",value:function offColor(value){return void 0===value?this.options.offColor:(this.options.offColor&&this.$off.removeClass(this._getClass(this.options.offColor)),this.$off.addClass(this._getClass(value)),this.options.offColor=value,this.$element)}},{key:"onText",value:function onText(value){return void 0===value?this.options.onText:(this.$on.html(value),this._width(),this._containerPosition(),this.options.onText=value,this.$element)}},{key:"offText",value:function offText(value){return void 0===value?this.options.offText:(this.$off.html(value),this._width(),this._containerPosition(),this.options.offText=value,this.$element)}},{key:"labelText",value:function labelText(value){return void 0===value?this.options.labelText:(this.$label.html(value),this._width(),this.options.labelText=value,this.$element)}},{key:"handleWidth",value:function handleWidth(value){return void 0===value?this.options.handleWidth:(this.options.handleWidth=value,this._width(),this._containerPosition(),this.$element)}},{key:"labelWidth",value:function labelWidth(value){return void 0===value?this.options.labelWidth:(this.options.labelWidth=value,this._width(),this._containerPosition(),this.$element)}},{key:"baseClass",value:function baseClass(value){return this.options.baseClass}},{key:"wrapperClass",value:function wrapperClass(value){return void 0===value?this.options.wrapperClass:(value||(value=$.fn.bootstrapSwitch.defaults.wrapperClass),this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" ")),this.$wrapper.addClass(this._getClasses(value).join(" ")),this.options.wrapperClass=value,this.$element)}},{key:"radioAllOff",value:function radioAllOff(value){if(void 0===value)return this.options.radioAllOff;var val=Boolean(value);return this.options.radioAllOff===val?this.$element:(this.options.radioAllOff=val,this.$element)}},{key:"onInit",value:function onInit(value){return void 0===value?this.options.onInit:(value||(value=$.fn.bootstrapSwitch.defaults.onInit),this.options.onInit=value,this.$element)}},{key:"onSwitchChange",value:function onSwitchChange(value){return void 0===value?this.options.onSwitchChange:(value||(value=$.fn.bootstrapSwitch.defaults.onSwitchChange),this.options.onSwitchChange=value,this.$element)}},{key:"destroy",value:function destroy(){var $form=this.$element.closest("form");return $form.length&&$form.off("reset.bootstrapSwitch").removeData("bootstrap-switch"),this.$container.children().not(this.$element).remove(),this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch"),this.$element}},{key:"_getElementOptions",value:function _getElementOptions(){return{state:this.$element.is(":checked"),size:this.$element.data("size"),animate:this.$element.data("animate"),disabled:this.$element.is(":disabled"),readonly:this.$element.is("[readonly]"),indeterminate:this.$element.data("indeterminate"),inverse:this.$element.data("inverse"),radioAllOff:this.$element.data("radio-all-off"),onColor:this.$element.data("on-color"),offColor:this.$element.data("off-color"),onText:this.$element.data("on-text"),offText:this.$element.data("off-text"),labelText:this.$element.data("label-text"),handleWidth:this.$element.data("handle-width"),labelWidth:this.$element.data("label-width"),baseClass:this.$element.data("base-class"),wrapperClass:this.$element.data("wrapper-class")}}},{key:"_width",value:function _width(){var _this2=this,$handles=this.$on.add(this.$off).add(this.$label).css("width",""),handleWidth="auto"===this.options.handleWidth?Math.round(Math.max(this.$on.width(),this.$off.width())):this.options.handleWidth;return $handles.width(handleWidth),this.$label.width((function(index,width){return"auto"!==_this2.options.labelWidth?_this2.options.labelWidth:width<handleWidth?handleWidth:width})),this._handleWidth=this.$on.outerWidth(),this._labelWidth=this.$label.outerWidth(),this.$container.width(2*this._handleWidth+this._labelWidth),this.$wrapper.width(this._handleWidth+this._labelWidth)}},{key:"_containerPosition",value:function _containerPosition(){var _this3=this,state=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.state,callback=arguments[1];this.$container.css("margin-left",(function(){var values=[0,"-"+_this3._handleWidth+"px"];return _this3.options.indeterminate?"-"+_this3._handleWidth/2+"px":state?_this3.options.inverse?values[1]:values[0]:_this3.options.inverse?values[0]:values[1]}))}},{key:"_init",value:function _init(){var _this4=this,init=function init(){_this4.setPrevOptions(),_this4._width(),_this4._containerPosition(),setTimeout((function(){if(_this4.options.animate)return _this4.$wrapper.addClass(_this4._getClass("animate"))}),50)};if(this.$wrapper.is(":visible"))init();else var initInterval=window.setInterval((function(){if(_this4.$wrapper.is(":visible"))return init(),window.clearInterval(initInterval)}),50)}},{key:"_elementHandlers",value:function _elementHandlers(){var _this5=this;return this.$element.on({"setPreviousOptions.bootstrapSwitch":this.setPrevOptions.bind(this),"previousState.bootstrapSwitch":function previousStateBootstrapSwitch(){_this5.options=_this5.prevOptions,_this5.options.indeterminate&&_this5.$wrapper.addClass(_this5._getClass("indeterminate")),_this5.$element.prop("checked",_this5.options.state).trigger("change.bootstrapSwitch",!0)},"change.bootstrapSwitch":function changeBootstrapSwitch(event,skip){event.preventDefault(),event.stopImmediatePropagation();var state=_this5.$element.is(":checked");_this5._containerPosition(state),state!==_this5.options.state&&(_this5.options.state=state,_this5.$wrapper.toggleClass(_this5._getClass("off")).toggleClass(_this5._getClass("on")),skip||(_this5.$element.is(":radio")&&$('[name="'+_this5.$element.attr("name")+'"]').not(_this5.$element).prop("checked",!1).trigger("change.bootstrapSwitch",!0),_this5.$element.trigger("switchChange.bootstrapSwitch",[state])))},"focus.bootstrapSwitch":function focusBootstrapSwitch(event){event.preventDefault(),_this5.$wrapper.addClass(_this5._getClass("focused"))},"blur.bootstrapSwitch":function blurBootstrapSwitch(event){event.preventDefault(),_this5.$wrapper.removeClass(_this5._getClass("focused"))},"keydown.bootstrapSwitch":function keydownBootstrapSwitch(event){!event.which||_this5.options.disabled||_this5.options.readonly||37!==event.which&&39!==event.which||(event.preventDefault(),event.stopImmediatePropagation(),_this5.state(39===event.which))}})}},{key:"_handleHandlers",value:function _handleHandlers(){var _this6=this;return this.$on.on("click.bootstrapSwitch",(function(event){return event.preventDefault(),event.stopPropagation(),_this6.state(!1),_this6.$element.trigger("focus.bootstrapSwitch")})),this.$off.on("click.bootstrapSwitch",(function(event){return event.preventDefault(),event.stopPropagation(),_this6.state(!0),_this6.$element.trigger("focus.bootstrapSwitch")}))}},{key:"_labelHandlers",value:function _labelHandlers(){var _this7=this,handlers={click:function click(event){event.stopPropagation()},"mousedown.bootstrapSwitch touchstart.bootstrapSwitch":function mousedownBootstrapSwitchTouchstartBootstrapSwitch(event){_this7._dragStart||_this7.options.disabled||_this7.options.readonly||(event.preventDefault(),event.stopPropagation(),_this7._dragStart=(event.pageX||event.originalEvent.touches[0].pageX)-parseInt(_this7.$container.css("margin-left"),10),_this7.options.animate&&_this7.$wrapper.removeClass(_this7._getClass("animate")),_this7.$element.trigger("focus.bootstrapSwitch"))},"mousemove.bootstrapSwitch touchmove.bootstrapSwitch":function mousemoveBootstrapSwitchTouchmoveBootstrapSwitch(event){if(null!=_this7._dragStart){var difference=(event.pageX||event.originalEvent.touches[0].pageX)-_this7._dragStart;event.preventDefault(),difference<-_this7._handleWidth||difference>0||(_this7._dragEnd=difference,_this7.$container.css("margin-left",_this7._dragEnd+"px"))}},"mouseup.bootstrapSwitch touchend.bootstrapSwitch":function mouseupBootstrapSwitchTouchendBootstrapSwitch(event){if(_this7._dragStart){if(event.preventDefault(),_this7.options.animate&&_this7.$wrapper.addClass(_this7._getClass("animate")),_this7._dragEnd){var state=_this7._dragEnd>-_this7._handleWidth/2;_this7._dragEnd=!1,_this7.state(_this7.options.inverse?!state:state)}else _this7.state(!_this7.options.state);_this7._dragStart=!1}},"mouseleave.bootstrapSwitch":function mouseleaveBootstrapSwitch(){_this7.$label.trigger("mouseup.bootstrapSwitch")}};this.$label.on(handlers)}},{key:"_externalLabelHandler",value:function _externalLabelHandler(){var _this8=this,$externalLabel=this.$element.closest("label");$externalLabel.on("click",(function(event){event.preventDefault(),event.stopImmediatePropagation(),event.target===$externalLabel[0]&&_this8.toggleState()}))}},{key:"_formHandler",value:function _formHandler(){var $form=this.$element.closest("form");$form.data("bootstrap-switch")||$form.on("reset.bootstrapSwitch",(function(){window.setTimeout((function(){$form.find("input").filter((function(){return $(this).data("bootstrap-switch")})).each((function(){return $(this).bootstrapSwitch("state",this.checked)}))}),1)})).data("bootstrap-switch",!0)}},{key:"_getClass",value:function _getClass(name){return this.options.baseClass+"-"+name}},{key:"_getClasses",value:function _getClasses(classes){return $.isArray(classes)?classes.map(this._getClass.bind(this)):[this._getClass(classes)]}}]),BootstrapSwitch}();$.fn.bootstrapSwitch=function(option){for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];function reducer(ret,next){var $this=$(next),existingData=$this.data("bootstrap-switch"),data=existingData||new BootstrapSwitch(next,option);return existingData||$this.data("bootstrap-switch",data),"string"==typeof option?data[option].apply(data,args):ret}return Array.prototype.reduce.call(this,reducer,this)},$.fn.bootstrapSwitch.Constructor=BootstrapSwitch,$.fn.bootstrapSwitch.defaults={state:!0,size:null,animate:!0,disabled:!1,readonly:!1,indeterminate:!1,inverse:!1,radioAllOff:!1,onColor:"primary",offColor:"default",onText:"ON",offText:"OFF",labelText:" ",handleWidth:"auto",labelWidth:"auto",baseClass:"bootstrap-switch",wrapperClass:"wrapper",onInit:function onInit(){},onSwitchChange:function onSwitchChange(){}}})),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=function(root,jQuery){return void 0===jQuery&&(jQuery="undefined"!=typeof window?require("jquery"):require("jquery")(root)),factory(jQuery),jQuery}:factory(jQuery)}((function(jQuery){var S2=function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var S2=jQuery.fn.select2.amd;var S2,factory;return function(){
|
||
/**
|
||
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
|
||
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
|
||
*/
|
||
var requirejs,require,define;S2&&S2.requirejs||(S2?require=S2:S2={},function(undef){var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;function hasProp(obj,prop){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,normalizedBaseParts,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name){for(lastIndex=(name=name.split("/")).length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(name=(normalizedBaseParts=baseParts.slice(0,baseParts.length-1)).concat(name)),i=0;i<name.length;i++)if("."===(part=name[i]))name.splice(i,1),i-=1;else if(".."===part){if(0===i||1===i&&".."===name[2]||".."===name[i-1])continue;i>0&&(name.splice(i-1,2),i-=2)}name=name.join("/")}if((baseParts||starMap)&&map){for(i=(nameParts=name.split("/")).length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=map[baseParts.slice(0,j).join("/")])&&(mapValue=mapValue[nameSegment])){foundMap=mapValue,foundI=i;break}if(foundMap)break;!foundStarMap&&starMap&&starMap[nameSegment]&&(foundStarMap=starMap[nameSegment],starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return name}function makeRequire(relName,forceSync){return function(){var args=aps.call(arguments,0);return"string"!=typeof args[0]&&1===args.length&&args.push(null),req.apply(undef,args.concat([relName,forceSync]))}}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(depName){return function(value){defined[depName]=value}}function callDep(name){if(hasProp(waiting,name)){var args=waiting[name];delete waiting[name],defining[name]=!0,main.apply(undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name))throw new Error("No "+name);return defined[name]}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeRelParts(relName){return relName?splitPrefix(relName):[]}function makeConfig(name){return function(){return config&&config.config&&config.config[name]||{}}}makeMap=function(name,relParts){var plugin,parts=splitPrefix(name),prefix=parts[0],relResourceName=relParts[1];return name=parts[1],prefix&&(plugin=callDep(prefix=normalize(prefix,relResourceName))),prefix?name=plugin&&plugin.normalize?plugin.normalize(name,makeNormalize(relResourceName)):normalize(name,relResourceName):(prefix=(parts=splitPrefix(name=normalize(name,relResourceName)))[0],name=parts[1],prefix&&(plugin=callDep(prefix))),{f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}},handlers={require:function(name){return makeRequire(name)},exports:function(name){var e=defined[name];return void 0!==e?e:defined[name]={}},module:function(name){return{id:name,uri:"",exports:defined[name],config:makeConfig(name)}}},main=function(name,deps,callback,relName){var cjsModule,depName,ret,map,i,relParts,args=[],callbackType=typeof callback,usingExports;if(relParts=makeRelParts(relName=relName||name),"undefined"===callbackType||"function"===callbackType){for(deps=!deps.length&&callback.length?["require","exports","module"]:deps,i=0;i<deps.length;i+=1)if("require"===(depName=(map=makeMap(deps[i],relParts)).f))args[i]=handlers.require(name);else if("exports"===depName)args[i]=handlers.exports(name),usingExports=!0;else if("module"===depName)cjsModule=args[i]=handlers.module(name);else if(hasProp(defined,depName)||hasProp(waiting,depName)||hasProp(defining,depName))args[i]=callDep(depName);else{if(!map.p)throw new Error(name+" missing "+depName);map.p.load(map.n,makeRequire(relName,!0),makeLoad(depName),{}),args[i]=defined[depName]}ret=callback?callback.apply(defined[name],args):void 0,name&&(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]?defined[name]=cjsModule.exports:ret===undef&&usingExports||(defined[name]=ret))}else name&&(defined[name]=callback)},requirejs=require=req=function(deps,callback,relName,forceSync,alt){if("string"==typeof deps)return handlers[deps]?handlers[deps](callback):callDep(makeMap(deps,makeRelParts(callback)).f);if(!deps.splice){if((config=deps).deps&&req(config.deps,config.callback),!callback)return;callback.splice?(deps=callback,callback=relName,relName=null):deps=undef}return callback=callback||function(){},"function"==typeof relName&&(relName=forceSync,forceSync=alt),forceSync?main(undef,deps,callback,relName):setTimeout((function(){main(undef,deps,callback,relName)}),4),req},req.config=function(cfg){return req(cfg)},requirejs._defined=defined,(define=function(name,deps,callback){if("string"!=typeof name)throw new Error("See almond README: incorrect module build, no module name");deps.splice||(callback=deps,deps=[]),hasProp(defined,name)||hasProp(waiting,name)||(waiting[name]=[name,deps,callback])}).amd={jQuery:!0}}(),S2.requirejs=requirejs,S2.require=require,S2.define=define)}(),S2.define("almond",(function(){})),S2.define("jquery",[],(function(){var _$=jQuery||$;return null==_$&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),_$})),S2.define("select2/utils",["jquery"],(function($){var Utils={};function getMethods(theClass){var proto=theClass.prototype,methods=[];for(var methodName in proto){var m;"function"==typeof proto[methodName]&&("constructor"!==methodName&&methods.push(methodName))}return methods}Utils.Extend=function(ChildClass,SuperClass){var __hasProp={}.hasOwnProperty;function BaseConstructor(){this.constructor=ChildClass}for(var key in SuperClass)__hasProp.call(SuperClass,key)&&(ChildClass[key]=SuperClass[key]);return BaseConstructor.prototype=SuperClass.prototype,ChildClass.prototype=new BaseConstructor,ChildClass.__super__=SuperClass.prototype,ChildClass},Utils.Decorate=function(SuperClass,DecoratorClass){var decoratedMethods=getMethods(DecoratorClass),superMethods=getMethods(SuperClass);function DecoratedClass(){var unshift=Array.prototype.unshift,argCount=DecoratorClass.prototype.constructor.length,calledConstructor=SuperClass.prototype.constructor;argCount>0&&(unshift.call(arguments,SuperClass.prototype.constructor),calledConstructor=DecoratorClass.prototype.constructor),calledConstructor.apply(this,arguments)}function ctr(){this.constructor=DecoratedClass}DecoratorClass.displayName=SuperClass.displayName,DecoratedClass.prototype=new ctr;for(var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[superMethod]=SuperClass.prototype[superMethod]}for(var calledMethod=function(methodName){var originalMethod=function(){};methodName in DecoratedClass.prototype&&(originalMethod=DecoratedClass.prototype[methodName]);var decoratedMethod=DecoratorClass.prototype[methodName];return function(){var unshift=Array.prototype.unshift;return unshift.call(arguments,originalMethod),decoratedMethod.apply(this,arguments)}},d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];DecoratedClass.prototype[decoratedMethod]=calledMethod(decoratedMethod)}return DecoratedClass};var Observable=function(){this.listeners={}};Observable.prototype.on=function(event,callback){this.listeners=this.listeners||{},event in this.listeners?this.listeners[event].push(callback):this.listeners[event]=[callback]},Observable.prototype.trigger=function(event){var slice=Array.prototype.slice,params=slice.call(arguments,1);this.listeners=this.listeners||{},null==params&&(params=[]),0===params.length&¶ms.push({}),params[0]._type=event,event in this.listeners&&this.invoke(this.listeners[event],slice.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},Observable.prototype.invoke=function(listeners,params){for(var i=0,len=listeners.length;i<len;i++)listeners[i].apply(this,params)},Utils.Observable=Observable,Utils.generateChars=function(length){for(var chars="",i=0;i<length;i++){var randomChar;chars+=Math.floor(36*Math.random()).toString(36)}return chars},Utils.bind=function(func,context){return function(){func.apply(context,arguments)}},Utils._convertData=function(data){for(var originalKey in data){var keys=originalKey.split("-"),dataLevel=data;if(1!==keys.length){for(var k=0;k<keys.length;k++){var key=keys[k];(key=key.substring(0,1).toLowerCase()+key.substring(1))in dataLevel||(dataLevel[key]={}),k==keys.length-1&&(dataLevel[key]=data[originalKey]),dataLevel=dataLevel[key]}delete data[originalKey]}}return data},Utils.hasScroll=function(index,el){var $el=$(el),overflowX=el.style.overflowX,overflowY=el.style.overflowY;return(overflowX!==overflowY||"hidden"!==overflowY&&"visible"!==overflowY)&&("scroll"===overflowX||"scroll"===overflowY||($el.innerHeight()<el.scrollHeight||$el.innerWidth()<el.scrollWidth))},Utils.escapeMarkup=function(markup){var replaceMap={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof markup?markup:String(markup).replace(/[&<>"'\/\\]/g,(function(match){return replaceMap[match]}))},Utils.appendMany=function($element,$nodes){if("1.7"===$.fn.jquery.substr(0,3)){var $jqNodes=$();$.map($nodes,(function(node){$jqNodes=$jqNodes.add(node)})),$nodes=$jqNodes}$element.append($nodes)},Utils.__cache={};var id=0;return Utils.GetUniqueElementId=function(element){var select2Id=element.getAttribute("data-select2-id");return null==select2Id&&(element.id?(select2Id=element.id,element.setAttribute("data-select2-id",select2Id)):(element.setAttribute("data-select2-id",++id),select2Id=id.toString())),select2Id},Utils.StoreData=function(element,name,value){var id=Utils.GetUniqueElementId(element);Utils.__cache[id]||(Utils.__cache[id]={}),Utils.__cache[id][name]=value},Utils.GetData=function(element,name){var id=Utils.GetUniqueElementId(element);return name?Utils.__cache[id]&&null!=Utils.__cache[id][name]?Utils.__cache[id][name]:$(element).data(name):Utils.__cache[id]},Utils.RemoveData=function(element){var id=Utils.GetUniqueElementId(element);null!=Utils.__cache[id]&&delete Utils.__cache[id],element.removeAttribute("data-select2-id")},Utils})),S2.define("select2/results",["jquery","./utils"],(function($,Utils){function Results($element,options,dataAdapter){this.$element=$element,this.data=dataAdapter,this.options=options,Results.__super__.constructor.call(this)}return Utils.Extend(Results,Utils.Observable),Results.prototype.render=function(){var $results=$('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&$results.attr("aria-multiselectable","true"),this.$results=$results,$results},Results.prototype.clear=function(){this.$results.empty()},Results.prototype.displayMessage=function(params){var escapeMarkup=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var $message=$('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),message=this.options.get("translations").get(params.message);$message.append(escapeMarkup(message(params.args))),$message[0].className+=" select2-results__message",this.$results.append($message)},Results.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},Results.prototype.append=function(data){this.hideLoading();var $options=[];if(null!=data.results&&0!==data.results.length){data.results=this.sort(data.results);for(var d=0;d<data.results.length;d++){var item=data.results[d],$option=this.option(item);$options.push($option)}this.$results.append($options)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},Results.prototype.position=function($results,$dropdown){var $resultsContainer;$dropdown.find(".select2-results").append($results)},Results.prototype.sort=function(data){var sorter;return this.options.get("sorter")(data)},Results.prototype.highlightFirstItem=function(){var $options=this.$results.find(".select2-results__option[aria-selected]"),$selected=$options.filter("[aria-selected=true]");$selected.length>0?$selected.first().trigger("mouseenter"):$options.first().trigger("mouseenter"),this.ensureHighlightVisible()},Results.prototype.setClasses=function(){var self=this;this.data.current((function(selected){var selectedIds=$.map(selected,(function(s){return s.id.toString()})),$options;self.$results.find(".select2-results__option[aria-selected]").each((function(){var $option=$(this),item=Utils.GetData(this,"data"),id=""+item.id;null!=item.element&&item.element.selected||null==item.element&&$.inArray(id,selectedIds)>-1?$option.attr("aria-selected","true"):$option.attr("aria-selected","false")}))}))},Results.prototype.showLoading=function(params){this.hideLoading();var loadingMore,loading={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(params)},$loading=this.option(loading);$loading.className+=" loading-results",this.$results.prepend($loading)},Results.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},Results.prototype.option=function(data){var option=document.createElement("li");option.className="select2-results__option";var attrs={role:"option","aria-selected":"false"},matches=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var attr in(null!=data.element&&matches.call(data.element,":disabled")||null==data.element&&data.disabled)&&(delete attrs["aria-selected"],attrs["aria-disabled"]="true"),null==data.id&&delete attrs["aria-selected"],null!=data._resultId&&(option.id=data._resultId),data.title&&(option.title=data.title),data.children&&(attrs.role="group",attrs["aria-label"]=data.text,delete attrs["aria-selected"]),attrs){var val=attrs[attr];option.setAttribute(attr,val)}if(data.children){var $option=$(option),label=document.createElement("strong");label.className="select2-results__group";var $label=$(label);this.template(data,label);for(var $children=[],c=0;c<data.children.length;c++){var child=data.children[c],$child=this.option(child);$children.push($child)}var $childrenContainer=$("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});$childrenContainer.append($children),$option.append(label),$option.append($childrenContainer)}else this.template(data,option);return Utils.StoreData(option,"data",data),option},Results.prototype.bind=function(container,$container){var self=this,id=container.id+"-results";this.$results.attr("id",id),container.on("results:all",(function(params){self.clear(),self.append(params.data),container.isOpen()&&(self.setClasses(),self.highlightFirstItem())})),container.on("results:append",(function(params){self.append(params.data),container.isOpen()&&self.setClasses()})),container.on("query",(function(params){self.hideMessages(),self.showLoading(params)})),container.on("select",(function(){container.isOpen()&&(self.setClasses(),self.options.get("scrollAfterSelect")&&self.highlightFirstItem())})),container.on("unselect",(function(){container.isOpen()&&(self.setClasses(),self.options.get("scrollAfterSelect")&&self.highlightFirstItem())})),container.on("open",(function(){self.$results.attr("aria-expanded","true"),self.$results.attr("aria-hidden","false"),self.setClasses(),self.ensureHighlightVisible()})),container.on("close",(function(){self.$results.attr("aria-expanded","false"),self.$results.attr("aria-hidden","true"),self.$results.removeAttr("aria-activedescendant")})),container.on("results:toggle",(function(){var $highlighted=self.getHighlightedResults();0!==$highlighted.length&&$highlighted.trigger("mouseup")})),container.on("results:select",(function(){var $highlighted=self.getHighlightedResults();if(0!==$highlighted.length){var data=Utils.GetData($highlighted[0],"data");"true"==$highlighted.attr("aria-selected")?self.trigger("close",{}):self.trigger("select",{data:data})}})),container.on("results:previous",(function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex=$options.index($highlighted);if(!(currentIndex<=0)){var nextIndex=currentIndex-1;0===$highlighted.length&&(nextIndex=0);var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top,nextTop=$next.offset().top,nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);0===nextIndex?self.$results.scrollTop(0):nextTop-currentOffset<0&&self.$results.scrollTop(nextOffset)}})),container.on("results:next",(function(){var $highlighted=self.getHighlightedResults(),$options=self.$results.find("[aria-selected]"),currentIndex,nextIndex=$options.index($highlighted)+1;if(!(nextIndex>=$options.length)){var $next=$options.eq(nextIndex);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(!1),nextBottom=$next.offset().top+$next.outerHeight(!1),nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;0===nextIndex?self.$results.scrollTop(0):nextBottom>currentOffset&&self.$results.scrollTop(nextOffset)}})),container.on("results:focus",(function(params){params.element.addClass("select2-results__option--highlighted")})),container.on("results:message",(function(params){self.displayMessage(params)})),$.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var top=self.$results.scrollTop(),bottom=self.$results.get(0).scrollHeight-top+e.deltaY,isAtTop=e.deltaY>0&&top-e.deltaY<=0,isAtBottom=e.deltaY<0&&bottom<=self.$results.height();isAtTop?(self.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):isAtBottom&&(self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results__option[aria-selected]",(function(evt){var $this=$(this),data=Utils.GetData(this,"data");"true"!==$this.attr("aria-selected")?self.trigger("select",{originalEvent:evt,data:data}):self.options.get("multiple")?self.trigger("unselect",{originalEvent:evt,data:data}):self.trigger("close",{})})),this.$results.on("mouseenter",".select2-results__option[aria-selected]",(function(evt){var data=Utils.GetData(this,"data");self.getHighlightedResults().removeClass("select2-results__option--highlighted"),self.trigger("results:focus",{data:data,element:$(this)})}))},Results.prototype.getHighlightedResults=function(){var $highlighted;return this.$results.find(".select2-results__option--highlighted")},Results.prototype.destroy=function(){this.$results.remove()},Results.prototype.ensureHighlightVisible=function(){var $highlighted=this.getHighlightedResults();if(0!==$highlighted.length){var $options,currentIndex=this.$results.find("[aria-selected]").index($highlighted),currentOffset=this.$results.offset().top,nextTop=$highlighted.offset().top,nextOffset=this.$results.scrollTop()+(nextTop-currentOffset),offsetDelta=nextTop-currentOffset;nextOffset-=2*$highlighted.outerHeight(!1),currentIndex<=2?this.$results.scrollTop(0):(offsetDelta>this.$results.outerHeight()||offsetDelta<0)&&this.$results.scrollTop(nextOffset)}},Results.prototype.template=function(result,container){var template=this.options.get("templateResult"),escapeMarkup=this.options.get("escapeMarkup"),content=template(result,container);null==content?container.style.display="none":"string"==typeof content?container.innerHTML=escapeMarkup(content):$(container).append(content)},Results})),S2.define("select2/keys",[],(function(){var KEYS;return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),S2.define("select2/selection/base",["jquery","../utils","../keys"],(function($,Utils,KEYS){function BaseSelection($element,options){this.$element=$element,this.options=options,BaseSelection.__super__.constructor.call(this)}return Utils.Extend(BaseSelection,Utils.Observable),BaseSelection.prototype.render=function(){var $selection=$('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=Utils.GetData(this.$element[0],"old-tabindex")?this._tabindex=Utils.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),$selection.attr("title",this.$element.attr("title")),$selection.attr("tabindex",this._tabindex),$selection.attr("aria-disabled","false"),this.$selection=$selection,$selection},BaseSelection.prototype.bind=function(container,$container){var self=this,resultsId=container.id+"-results";this.container=container,this.$selection.on("focus",(function(evt){self.trigger("focus",evt)})),this.$selection.on("blur",(function(evt){self._handleBlur(evt)})),this.$selection.on("keydown",(function(evt){self.trigger("keypress",evt),evt.which===KEYS.SPACE&&evt.preventDefault()})),container.on("results:focus",(function(params){self.$selection.attr("aria-activedescendant",params.data._resultId)})),container.on("selection:update",(function(params){self.update(params.data)})),container.on("open",(function(){self.$selection.attr("aria-expanded","true"),self.$selection.attr("aria-owns",resultsId),self._attachCloseHandler(container)})),container.on("close",(function(){self.$selection.attr("aria-expanded","false"),self.$selection.removeAttr("aria-activedescendant"),self.$selection.removeAttr("aria-owns"),self.$selection.trigger("focus"),self._detachCloseHandler(container)})),container.on("enable",(function(){self.$selection.attr("tabindex",self._tabindex),self.$selection.attr("aria-disabled","false")})),container.on("disable",(function(){self.$selection.attr("tabindex","-1"),self.$selection.attr("aria-disabled","true")}))},BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout((function(){document.activeElement==self.$selection[0]||$.contains(self.$selection[0],document.activeElement)||self.trigger("blur",evt)}),1)},BaseSelection.prototype._attachCloseHandler=function(container){$(document.body).on("mousedown.select2."+container.id,(function(e){var $target,$select=$(e.target).closest(".select2"),$all;$(".select2.select2-container--open").each((function(){var $element;this!=$select[0]&&Utils.GetData(this,"element").select2("close")}))}))},BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off("mousedown.select2."+container.id)},BaseSelection.prototype.position=function($selection,$container){var $selectionContainer;$container.find(".selection").append($selection)},BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)},BaseSelection.prototype.update=function(data){throw new Error("The `update` method must be defined in child classes.")},BaseSelection.prototype.isEnabled=function(){return!this.isDisabled()},BaseSelection.prototype.isDisabled=function(){return this.options.get("disabled")},BaseSelection})),S2.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function($,BaseSelection,Utils,KEYS){function SingleSelection(){SingleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(SingleSelection,BaseSelection),SingleSelection.prototype.render=function(){var $selection=SingleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--single"),$selection.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),$selection},SingleSelection.prototype.bind=function(container,$container){var self=this;SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",id).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",id),this.$selection.on("mousedown",(function(evt){1===evt.which&&self.trigger("toggle",{originalEvent:evt})})),this.$selection.on("focus",(function(evt){})),this.$selection.on("blur",(function(evt){})),container.on("focus",(function(evt){container.isOpen()||self.$selection.trigger("focus")}))},SingleSelection.prototype.clear=function(){var $rendered=this.$selection.find(".select2-selection__rendered");$rendered.empty(),$rendered.removeAttr("title")},SingleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection"),escapeMarkup;return this.options.get("escapeMarkup")(template(data,container))},SingleSelection.prototype.selectionContainer=function(){return $("<span></span>")},SingleSelection.prototype.update=function(data){if(0!==data.length){var selection=data[0],$rendered=this.$selection.find(".select2-selection__rendered"),formatted=this.display(selection,$rendered);$rendered.empty().append(formatted);var title=selection.title||selection.text;title?$rendered.attr("title",title):$rendered.removeAttr("title")}else this.clear()},SingleSelection})),S2.define("select2/selection/multiple",["jquery","./base","../utils"],(function($,BaseSelection,Utils){function MultipleSelection($element,options){MultipleSelection.__super__.constructor.apply(this,arguments)}return Utils.Extend(MultipleSelection,BaseSelection),MultipleSelection.prototype.render=function(){var $selection=MultipleSelection.__super__.render.call(this);return $selection.addClass("select2-selection--multiple"),$selection.html('<ul class="select2-selection__rendered"></ul>'),$selection},MultipleSelection.prototype.bind=function(container,$container){var self=this;MultipleSelection.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(evt){self.trigger("toggle",{originalEvent:evt})})),this.$selection.on("click",".select2-selection__choice__remove",(function(evt){if(!self.isDisabled()){var $remove,$selection=$(this).parent(),data=Utils.GetData($selection[0],"data");self.trigger("unselect",{originalEvent:evt,data:data})}}))},MultipleSelection.prototype.clear=function(){var $rendered=this.$selection.find(".select2-selection__rendered");$rendered.empty(),$rendered.removeAttr("title")},MultipleSelection.prototype.display=function(data,container){var template=this.options.get("templateSelection"),escapeMarkup;return this.options.get("escapeMarkup")(template(data,container))},MultipleSelection.prototype.selectionContainer=function(){var $container;return $('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},MultipleSelection.prototype.update=function(data){if(this.clear(),0!==data.length){for(var $selections=[],d=0;d<data.length;d++){var selection=data[d],$selection=this.selectionContainer(),formatted=this.display(selection,$selection);$selection.append(formatted);var title=selection.title||selection.text;title&&$selection.attr("title",title),Utils.StoreData($selection[0],"data",selection),$selections.push($selection)}var $rendered=this.$selection.find(".select2-selection__rendered");Utils.appendMany($rendered,$selections)}},MultipleSelection})),S2.define("select2/selection/placeholder",["../utils"],(function(Utils){function Placeholder(decorated,$element,options){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options)}return Placeholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},Placeholder.prototype.createPlaceholder=function(decorated,placeholder){var $placeholder=this.selectionContainer();return $placeholder.html(this.display(placeholder)),$placeholder.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),$placeholder},Placeholder.prototype.update=function(decorated,data){var singlePlaceholder=1==data.length&&data[0].id!=this.placeholder.id,multipleSelections;if(data.length>1||singlePlaceholder)return decorated.call(this,data);this.clear();var $placeholder=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append($placeholder)},Placeholder})),S2.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function($,KEYS,Utils){function AllowClear(){}return AllowClear.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(evt){self._handleClear(evt)})),container.on("keypress",(function(evt){self._handleKeyboardClear(evt,container)}))},AllowClear.prototype._handleClear=function(_,evt){if(!this.isDisabled()){var $clear=this.$selection.find(".select2-selection__clear");if(0!==$clear.length){evt.stopPropagation();var data=Utils.GetData($clear[0],"data"),previousVal=this.$element.val();this.$element.val(this.placeholder.id);var unselectData={data:data};if(this.trigger("clear",unselectData),unselectData.prevented)this.$element.val(previousVal);else{for(var d=0;d<data.length;d++)if(unselectData={data:data[d]},this.trigger("unselect",unselectData),unselectData.prevented)return void this.$element.val(previousVal);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},AllowClear.prototype._handleKeyboardClear=function(_,evt,container){container.isOpen()||evt.which!=KEYS.DELETE&&evt.which!=KEYS.BACKSPACE||this._handleClear(evt)},AllowClear.prototype.update=function(decorated,data){if(decorated.call(this,data),!(this.$selection.find(".select2-selection__placeholder").length>0||0===data.length)){var removeAll=this.options.get("translations").get("removeAllItems"),$remove=$('<span class="select2-selection__clear" title="'+removeAll()+'">×</span>');Utils.StoreData($remove[0],"data",data),this.$selection.find(".select2-selection__rendered").prepend($remove)}},AllowClear})),S2.define("select2/selection/search",["jquery","../utils","../keys"],(function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,$element,options)}return Search.prototype.render=function(decorated){var $search=$('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=$search,this.$search=$search.find("input");var $rendered=decorated.call(this);return this._transferTabIndex(),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this,resultsId=container.id+"-results";decorated.call(this,container,$container),container.on("open",(function(){self.$search.attr("aria-controls",resultsId),self.$search.trigger("focus")})),container.on("close",(function(){self.$search.val(""),self.$search.removeAttr("aria-controls"),self.$search.removeAttr("aria-activedescendant"),self.$search.trigger("focus")})),container.on("enable",(function(){self.$search.prop("disabled",!1),self._transferTabIndex()})),container.on("disable",(function(){self.$search.prop("disabled",!0)})),container.on("focus",(function(evt){self.$search.trigger("focus")})),container.on("results:focus",(function(params){params.data._resultId?self.$search.attr("aria-activedescendant",params.data._resultId):self.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(evt){self.trigger("focus",evt)})),this.$selection.on("focusout",".select2-search--inline",(function(evt){self._handleBlur(evt)})),this.$selection.on("keydown",".select2-search--inline",(function(evt){var key;if(evt.stopPropagation(),self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented(),evt.which===KEYS.BACKSPACE&&""===self.$search.val()){var $previousChoice=self.$searchContainer.prev(".select2-selection__choice");if($previousChoice.length>0){var item=Utils.GetData($previousChoice[0],"data");self.searchRemoveChoice(item),evt.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(evt){self.$search.val()&&evt.stopPropagation()}));var msie=document.documentMode,disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(evt){disableInputEvents?self.$selection.off("input.search input.searchcheck"):self.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(evt){if(disableInputEvents&&"input"===evt.type)self.$selection.off("input.search input.searchcheck");else{var key=evt.which;key!=KEYS.SHIFT&&key!=KEYS.CTRL&&key!=KEYS.ALT&&key!=KEYS.TAB&&self.handleSearch(evt)}}))},Search.prototype._transferTabIndex=function(decorated){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder",placeholder.text)},Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),decorated.call(this,data),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),searchHadFocus&&this.$search.trigger("focus")},Search.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item}),this.$search.val(item.text),this.handleSearch()},Search.prototype.resizeSearch=function(){this.$search.css("width","25px");var width="",minimumWidth;""!==this.$search.attr("placeholder")?width=this.$selection.find(".select2-selection__rendered").width():width=.75*(this.$search.val().length+1)+"em";this.$search.css("width",width)},Search})),S2.define("select2/selection/eventRelay",["jquery"],(function($){function EventRelay(){}return EventRelay.prototype.bind=function(decorated,container,$container){var self=this,relayEvents=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],preventableEvents=["opening","closing","selecting","unselecting","clearing"];decorated.call(this,container,$container),container.on("*",(function(name,params){if(-1!==$.inArray(name,relayEvents)){params=params||{};var evt=$.Event("select2:"+name,{params:params});self.$element.trigger(evt),-1!==$.inArray(name,preventableEvents)&&(params.prevented=evt.isDefaultPrevented())}}))},EventRelay})),S2.define("select2/translation",["jquery","require"],(function($,require){function Translation(dict){this.dict=dict||{}}return Translation.prototype.all=function(){return this.dict},Translation.prototype.get=function(key){return this.dict[key]},Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)},Translation._cache={},Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}return new Translation(Translation._cache[path])},Translation})),S2.define("select2/diacritics",[],(function(){var diacritics;return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),S2.define("select2/data/base",["../utils"],(function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}return Utils.Extend(BaseAdapter,Utils.Observable),BaseAdapter.prototype.current=function(callback){throw new Error("The `current` method must be defined in child classes.")},BaseAdapter.prototype.query=function(params,callback){throw new Error("The `query` method must be defined in child classes.")},BaseAdapter.prototype.bind=function(container,$container){},BaseAdapter.prototype.destroy=function(){},BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";return id+=Utils.generateChars(4),null!=data.id?id+="-"+data.id.toString():id+="-"+Utils.generateChars(4),id},BaseAdapter})),S2.define("select2/data/select",["./base","../utils","jquery"],(function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element,this.options=options,SelectAdapter.__super__.constructor.call(this)}return Utils.Extend(SelectAdapter,BaseAdapter),SelectAdapter.prototype.current=function(callback){var data=[],self=this;this.$element.find(":selected").each((function(){var $option=$(this),option=self.item($option);data.push(option)})),callback(data)},SelectAdapter.prototype.select=function(data){var self=this;if(data.selected=!0,$(data.element).is("option"))return data.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(currentData){var val=[];(data=[data]).push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=data[d].id;-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("input").trigger("change")}));else{var val=data.id;this.$element.val(val),this.$element.trigger("input").trigger("change")}},SelectAdapter.prototype.unselect=function(data){var self=this;if(this.$element.prop("multiple")){if(data.selected=!1,$(data.element).is("option"))return data.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(currentData){for(var val=[],d=0;d<currentData.length;d++){var id=currentData[d].id;id!==data.id&&-1===$.inArray(id,val)&&val.push(id)}self.$element.val(val),self.$element.trigger("input").trigger("change")}))}},SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container,container.on("select",(function(params){self.select(params.data)})),container.on("unselect",(function(params){self.unselect(params.data)}))},SelectAdapter.prototype.destroy=function(){this.$element.find("*").each((function(){Utils.RemoveData(this)}))},SelectAdapter.prototype.query=function(params,callback){var data=[],self=this,$options;this.$element.children().each((function(){var $option=$(this);if($option.is("option")||$option.is("optgroup")){var option=self.item($option),matches=self.matches(params,option);null!==matches&&data.push(matches)}})),callback({results:data})},SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element,$options)},SelectAdapter.prototype.option=function(data){var option;data.children?(option=document.createElement("optgroup")).label=data.text:void 0!==(option=document.createElement("option")).textContent?option.textContent=data.text:option.innerText=data.text,void 0!==data.id&&(option.value=data.id),data.disabled&&(option.disabled=!0),data.selected&&(option.selected=!0),data.title&&(option.title=data.title);var $option=$(option),normalizedData=this._normalizeItem(data);return normalizedData.element=option,Utils.StoreData(option,"data",normalizedData),$option},SelectAdapter.prototype.item=function($option){var data={};if(null!=(data=Utils.GetData($option[0],"data")))return data;if($option.is("option"))data={id:$option.val(),text:$option.text(),disabled:$option.prop("disabled"),selected:$option.prop("selected"),title:$option.prop("title")};else if($option.is("optgroup")){data={text:$option.prop("label"),children:[],title:$option.prop("title")};for(var $children=$option.children("option"),children=[],c=0;c<$children.length;c++){var $child=$($children[c]),child=this.item($child);children.push(child)}data.children=children}return(data=this._normalizeItem(data)).element=$option[0],Utils.StoreData($option[0],"data",data),data},SelectAdapter.prototype._normalizeItem=function(item){item!==Object(item)&&(item={id:item,text:item});var defaults={selected:!1,disabled:!1};return null!=(item=$.extend({},{text:""},item)).id&&(item.id=item.id.toString()),null!=item.text&&(item.text=item.text.toString()),null==item._resultId&&item.id&&null!=this.container&&(item._resultId=this.generateResultId(this.container,item)),$.extend({},defaults,item)},SelectAdapter.prototype.matches=function(params,data){var matcher;return this.options.get("matcher")(params,data)},SelectAdapter})),S2.define("select2/data/array",["./select","../utils","jquery"],(function(SelectAdapter,Utils,$){function ArrayAdapter($element,options){this._dataToConvert=options.get("data")||[],ArrayAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(ArrayAdapter,SelectAdapter),ArrayAdapter.prototype.bind=function(container,$container){ArrayAdapter.__super__.bind.call(this,container,$container),this.addOptions(this.convertToOptions(this._dataToConvert))},ArrayAdapter.prototype.select=function(data){var $option=this.$element.find("option").filter((function(i,elm){return elm.value==data.id.toString()}));0===$option.length&&($option=this.option(data),this.addOptions($option)),ArrayAdapter.__super__.select.call(this,data)},ArrayAdapter.prototype.convertToOptions=function(data){var self=this,$existing=this.$element.find("option"),existingIds=$existing.map((function(){return self.item($(this)).id})).get(),$options=[];function onlyItem(item){return function(){return $(this).val()==item.id}}for(var d=0;d<data.length;d++){var item=this._normalizeItem(data[d]);if($.inArray(item.id,existingIds)>=0){var $existingOption=$existing.filter(onlyItem(item)),existingData=this.item($existingOption),newData=$.extend(!0,{},item,existingData),$newOption=this.option(newData);$existingOption.replaceWith($newOption)}else{var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);Utils.appendMany($option,$children)}$options.push($option)}}return $options},ArrayAdapter})),S2.define("select2/data/ajax",["./array","../utils","jquery"],(function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),AjaxAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(AjaxAdapter,ArrayAdapter),AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);return $request.then(success),$request.fail(failure),$request}};return $.extend({},defaults,options,!0)},AjaxAdapter.prototype.processResults=function(results){return results},AjaxAdapter.prototype.query=function(params,callback){var matches=[],self=this;null!=this._request&&($.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var options=$.extend({type:"GET"},this.ajaxOptions);function request(){var $request=options.transport(options,(function(data){var results=self.processResults(data,params);self.options.get("debug")&&window.console&&console.error&&(results&&results.results&&$.isArray(results.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),callback(results)}),(function(){"status"in $request&&(0===$request.status||"0"===$request.status)||self.trigger("results:message",{message:"errorLoading"})}));self._request=$request}"function"==typeof options.url&&(options.url=options.url.call(this.$element,params)),"function"==typeof options.data&&(options.data=options.data.call(this.$element,params)),this.ajaxOptions.delay&&null!=params.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)):request()},AjaxAdapter})),S2.define("select2/data/tags",["jquery"],(function($){function Tags(decorated,$element,options){var tags=options.get("tags"),createTag=options.get("createTag");void 0!==createTag&&(this.createTag=createTag);var insertTag=options.get("insertTag");if(void 0!==insertTag&&(this.insertTag=insertTag),decorated.call(this,$element,options),$.isArray(tags))for(var t=0;t<tags.length;t++){var tag=tags[t],item=this._normalizeItem(tag),$option=this.option(item);this.$element.append($option)}}return Tags.prototype.query=function(decorated,params,callback){var self=this;function wrapper(obj,child){for(var data=obj.results,i=0;i<data.length;i++){var option=data[i],checkChildren=null!=option.children&&!wrapper({results:option.children},!0),optionText,paramsTerm,checkText;if((option.text||"").toUpperCase()===(params.term||"").toUpperCase()||checkChildren)return!child&&(obj.data=data,void callback(obj))}if(child)return!0;var tag=self.createTag(params);if(null!=tag){var $option=self.option(tag);$option.attr("data-select2-tag",!0),self.addOptions([$option]),self.insertTag(data,tag)}obj.results=data,callback(obj)}this._removeOldTags(),null!=params.term&&null==params.page?decorated.call(this,params,wrapper):decorated.call(this,params,callback)},Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);return""===term?null:{id:term,text:term}},Tags.prototype.insertTag=function(_,data,tag){data.unshift(tag)},Tags.prototype._removeOldTags=function(_){var $options;this.$element.find("option[data-select2-tag]").each((function(){this.selected||$(this).remove()}))},Tags})),S2.define("select2/data/tokenizer",["jquery"],(function($){function Tokenizer(decorated,$element,options){var tokenizer=options.get("tokenizer");void 0!==tokenizer&&(this.tokenizer=tokenizer),decorated.call(this,$element,options)}return Tokenizer.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container),this.$search=container.dropdown.$search||container.selection.$search||$container.find(".select2-search__field")},Tokenizer.prototype.query=function(decorated,params,callback){var self=this;function createAndSelect(data){var item=self._normalizeItem(data),$existingOptions;if(!self.$element.find("option").filter((function(){return $(this).val()===item.id})).length){var $option=self.option(item);$option.attr("data-select2-tag",!0),self._removeOldTags(),self.addOptions([$option])}select(item)}function select(data){self.trigger("select",{data:data})}params.term=params.term||"";var tokenData=this.tokenizer(params,this.options,createAndSelect);tokenData.term!==params.term&&(this.$search.length&&(this.$search.val(tokenData.term),this.$search.trigger("focus")),params.term=tokenData.term),decorated.call(this,params,callback)},Tokenizer.prototype.tokenizer=function(_,params,options,callback){for(var separators=options.get("tokenSeparators")||[],term=params.term,i=0,createTag=this.createTag||function(params){return{id:params.term,text:params.term}};i<term.length;){var termChar=term[i];if(-1!==$.inArray(termChar,separators)){var part=term.substr(0,i),partParams,data=createTag($.extend({},params,{term:part}));null!=data?(callback(data),term=term.substr(i+1)||"",i=0):i++}else i++}return{term:term}},Tokenizer})),S2.define("select2/data/minimumInputLength",[],(function(){function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get("minimumInputLength"),decorated.call(this,$e,options)}return MinimumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"",params.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:params.term,params:params}}):decorated.call(this,params,callback)},MinimumInputLength})),S2.define("select2/data/maximumInputLength",[],(function(){function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get("maximumInputLength"),decorated.call(this,$e,options)}return MaximumInputLength.prototype.query=function(decorated,params,callback){params.term=params.term||"",this.maximumInputLength>0&¶ms.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,params:params}}):decorated.call(this,params,callback)},MaximumInputLength})),S2.define("select2/data/maximumSelectionLength",[],(function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get("maximumSelectionLength"),decorated.call(this,$e,options)}return MaximumSelectionLength.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",(function(){self._checkIfMaximumSelected()}))},MaximumSelectionLength.prototype.query=function(decorated,params,callback){var self=this;this._checkIfMaximumSelected((function(){decorated.call(self,params,callback)}))},MaximumSelectionLength.prototype._checkIfMaximumSelected=function(_,successCallback){var self=this;this.current((function(currentData){var count=null!=currentData?currentData.length:0;self.maximumSelectionLength>0&&count>=self.maximumSelectionLength?self.trigger("results:message",{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}}):successCallback&&successCallback()}))},MaximumSelectionLength})),S2.define("select2/dropdown",["jquery","./utils"],(function($,Utils){function Dropdown($element,options){this.$element=$element,this.options=options,Dropdown.__super__.constructor.call(this)}return Utils.Extend(Dropdown,Utils.Observable),Dropdown.prototype.render=function(){var $dropdown=$('<span class="select2-dropdown"><span class="select2-results"></span></span>');return $dropdown.attr("dir",this.options.get("dir")),this.$dropdown=$dropdown,$dropdown},Dropdown.prototype.bind=function(){},Dropdown.prototype.position=function($dropdown,$container){},Dropdown.prototype.destroy=function(){this.$dropdown.remove()},Dropdown})),S2.define("select2/dropdown/search",["jquery","../utils"],(function($,Utils){function Search(){}return Search.prototype.render=function(decorated){var $rendered=decorated.call(this),$search=$('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=$search,this.$search=$search.find("input"),$rendered.prepend($search),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this,resultsId=container.id+"-results";decorated.call(this,container,$container),this.$search.on("keydown",(function(evt){self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented()})),this.$search.on("input",(function(evt){$(this).off("keyup")})),this.$search.on("keyup input",(function(evt){self.handleSearch(evt)})),container.on("open",(function(){self.$search.attr("tabindex",0),self.$search.attr("aria-controls",resultsId),self.$search.trigger("focus"),window.setTimeout((function(){self.$search.trigger("focus")}),0)})),container.on("close",(function(){self.$search.attr("tabindex",-1),self.$search.removeAttr("aria-controls"),self.$search.removeAttr("aria-activedescendant"),self.$search.val(""),self.$search.trigger("blur")})),container.on("focus",(function(){container.isOpen()||self.$search.trigger("focus")})),container.on("results:all",(function(params){var showSearch;null!=params.query.term&&""!==params.query.term||(self.showSearch(params)?self.$searchContainer.removeClass("select2-search--hide"):self.$searchContainer.addClass("select2-search--hide"))})),container.on("results:focus",(function(params){params.data._resultId?self.$search.attr("aria-activedescendant",params.data._resultId):self.$search.removeAttr("aria-activedescendant")}))},Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.showSearch=function(_,params){return!0},Search})),S2.define("select2/dropdown/hidePlaceholder",[],(function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options,dataAdapter)}return HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results),decorated.call(this,data)},HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},HidePlaceholder.prototype.removePlaceholder=function(_,data){for(var modifiedData=data.slice(0),d=data.length-1;d>=0;d--){var item=data[d];this.placeholder.id===item.id&&modifiedData.splice(d,1)}return modifiedData},HidePlaceholder})),S2.define("select2/dropdown/infiniteScroll",["jquery"],(function($){function InfiniteScroll(decorated,$element,options,dataAdapter){this.lastParams={},decorated.call(this,$element,options,dataAdapter),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove(),this.loading=!1,decorated.call(this,data),this.showLoadingMore(data)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("query",(function(params){self.lastParams=params,self.loading=!0})),container.on("query:append",(function(params){self.lastParams=params,self.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},InfiniteScroll.prototype.loadMoreIfNeeded=function(){var isLoadMoreVisible=$.contains(document.documentElement,this.$loadingMore[0]),currentOffset,loadingMoreOffset;!this.loading&&isLoadMoreVisible&&(this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore())},InfiniteScroll.prototype.loadMore=function(){this.loading=!0;var params=$.extend({},{page:1},this.lastParams);params.page++,this.trigger("query:append",params)},InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more},InfiniteScroll.prototype.createLoadingMore=function(){var $option=$('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),message=this.options.get("translations").get("loadingMore");return $option.html(message(this.lastParams)),$option},InfiniteScroll})),S2.define("select2/dropdown/attachBody",["jquery","../utils"],(function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=$(options.get("dropdownParent")||document.body),decorated.call(this,$element,options)}return AttachBody.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("open",(function(){self._showDropdown(),self._attachPositioningHandler(container),self._bindContainerResultHandlers(container)})),container.on("close",(function(){self._hideDropdown(),self._detachPositioningHandler(container)})),this.$dropdownContainer.on("mousedown",(function(evt){evt.stopPropagation()}))},AttachBody.prototype.destroy=function(decorated){decorated.call(this),this.$dropdownContainer.remove()},AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr("class",$container.attr("class")),$dropdown.removeClass("select2"),$dropdown.addClass("select2-container--open"),$dropdown.css({position:"absolute",top:-999999}),this.$container=$container},AttachBody.prototype.render=function(decorated){var $container=$("<span></span>"),$dropdown=decorated.call(this);return $container.append($dropdown),this.$dropdownContainer=$container,$container},AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()},AttachBody.prototype._bindContainerResultHandlers=function(decorated,container){if(!this._containerResultsHandlersBound){var self=this;container.on("results:all",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("results:append",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("results:message",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("select",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("unselect",(function(){self._positionDropdown(),self._resizeDropdown()})),this._containerResultsHandlersBound=!0}},AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this,scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each((function(){Utils.StoreData(this,"select2-scroll-position",{x:$(this).scrollLeft(),y:$(this).scrollTop()})})),$watchers.on(scrollEvent,(function(ev){var position=Utils.GetData(this,"select2-scroll-position");$(this).scrollTop(position.y)})),$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,(function(e){self._positionDropdown(),self._resizeDropdown()}))},AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers;this.$container.parents().filter(Utils.hasScroll).off(scrollEvent),$(window).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)},AttachBody.prototype._positionDropdown=function(){var $window=$(window),isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown--above"),isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown--below"),newDirection=null,offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(!1);var container={height:this.$container.outerHeight(!1)};container.top=offset.top,container.bottom=offset.top+container.height;var dropdown_height=this.$dropdown.outerHeight(!1),viewport_top=$window.scrollTop(),viewport_bottom=$window.scrollTop()+$window.height(),enoughRoomAbove=viewport_top<offset.top-dropdown_height,enoughRoomBelow=viewport_bottom>offset.bottom+dropdown_height,css={left:offset.left,top:container.bottom},$offsetParent=this.$dropdownParent;"static"===$offsetParent.css("position")&&($offsetParent=$offsetParent.offsetParent());var parentOffset={top:0,left:0};($.contains(document.body,$offsetParent[0])||$offsetParent[0].isConnected)&&(parentOffset=$offsetParent.offset()),css.top-=parentOffset.top,css.left-=parentOffset.left,isCurrentlyAbove||isCurrentlyBelow||(newDirection="below"),enoughRoomBelow||!enoughRoomAbove||isCurrentlyAbove?!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove&&(newDirection="below"):newDirection="above",("above"==newDirection||isCurrentlyAbove&&"below"!==newDirection)&&(css.top=container.top-parentOffset.top-dropdown_height),null!=newDirection&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+newDirection),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+newDirection)),this.$dropdownContainer.css(css)},AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(css.minWidth=css.width,css.position="relative",css.width="auto"),this.$dropdown.css(css)},AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},AttachBody})),S2.define("select2/dropdown/minimumResultsForSearch",[],(function(){function countResults(data){for(var count=0,d=0;d<data.length;d++){var item=data[d];item.children?count+=countResults(item.children):count++}return count}function MinimumResultsForSearch(decorated,$element,options,dataAdapter){this.minimumResultsForSearch=options.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),decorated.call(this,$element,options,dataAdapter)}return MinimumResultsForSearch.prototype.showSearch=function(decorated,params){return!(countResults(params.data.results)<this.minimumResultsForSearch)&&decorated.call(this,params)},MinimumResultsForSearch})),S2.define("select2/dropdown/selectOnClose",["../utils"],(function(Utils){function SelectOnClose(){}return SelectOnClose.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("close",(function(params){self._handleSelectOnClose(params)}))},SelectOnClose.prototype._handleSelectOnClose=function(_,params){if(params&&null!=params.originalSelect2Event){var event=params.originalSelect2Event;if("select"===event._type||"unselect"===event._type)return}var $highlightedResults=this.getHighlightedResults();if(!($highlightedResults.length<1)){var data=Utils.GetData($highlightedResults[0],"data");null!=data.element&&data.element.selected||null==data.element&&data.selected||this.trigger("select",{data:data})}},SelectOnClose})),S2.define("select2/dropdown/closeOnSelect",[],(function(){function CloseOnSelect(){}return CloseOnSelect.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",(function(evt){self._selectTriggered(evt)})),container.on("unselect",(function(evt){self._selectTriggered(evt)}))},CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;originalEvent&&(originalEvent.ctrlKey||originalEvent.metaKey)||this.trigger("close",{originalEvent:originalEvent,originalSelect2Event:evt})},CloseOnSelect})),S2.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(args){var overChars=args.input.length-args.maximum,message="Please delete "+overChars+" character";return 1!=overChars&&(message+="s"),message},inputTooShort:function(args){var remainingChars,message;return"Please enter "+(args.minimum-args.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(args){var message="You can only select "+args.maximum+" item";return 1!=args.maximum&&(message+="s"),message},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}})),S2.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],(function($,require,ResultsList,SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,AttachBody,MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){function Defaults(){this.reset()}var defaults;return Defaults.prototype.apply=function(options){if(null==(options=$.extend(!0,{},this.defaults,options)).dataAdapter){if(null!=options.ajax?options.dataAdapter=AjaxData:null!=options.data?options.dataAdapter=ArrayData:options.dataAdapter=SelectData,options.minimumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength)),options.maximumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)),options.maximumSelectionLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength)),options.tags&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags)),null==options.tokenSeparators&&null==options.tokenizer||(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer)),null!=options.query){var Query=require(options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}if(null!=options.initSelection){var InitSelection=require(options.amdBase+"compat/initSelection");options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(null==options.resultsAdapter&&(options.resultsAdapter=ResultsList,null!=options.ajax&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)),null!=options.placeholder&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder)),options.selectOnClose&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,SelectOnClose))),null==options.dropdownAdapter){if(options.multiple)options.dropdownAdapter=Dropdown;else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}if(0!==options.minimumResultsForSearch&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)),options.closeOnSelect&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)),null!=options.dropdownCssClass||null!=options.dropdownCss||null!=options.adaptDropdownCssClass){var DropdownCSS=require(options.amdBase+"compat/dropdownCss");options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(null==options.selectionAdapter){if(options.multiple?options.selectionAdapter=MultipleSelection:options.selectionAdapter=SingleSelection,null!=options.placeholder&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)),options.allowClear&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)),options.multiple&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)),null!=options.containerCssClass||null!=options.containerCss||null!=options.adaptContainerCssClass){var ContainerCSS=require(options.amdBase+"compat/containerCss");options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}options.language=this._resolveLanguage(options.language),options.language.push("en");for(var uniqueLanguages=[],l=0;l<options.language.length;l++){var language=options.language[l];-1===uniqueLanguages.indexOf(language)&&uniqueLanguages.push(language)}return options.language=uniqueLanguages,options.translations=this._processTranslations(options.language,options.debug),options},Defaults.prototype.reset=function(){function stripDiacritics(text){function match(a){return DIACRITICS[a]||a}return text.replace(/[^\u0000-\u007E]/g,match)}function matcher(params,data){if(""===$.trim(params.term))return data;if(data.children&&data.children.length>0){for(var match=$.extend(!0,{},data),c=data.children.length-1;c>=0;c--){var child,matches;null==matcher(params,data.children[c])&&match.children.splice(c,1)}return match.children.length>0?match:matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase(),term=stripDiacritics(params.term).toUpperCase();return original.indexOf(term)>-1?data:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:Utils.escapeMarkup,language:{},matcher:matcher,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:"default",width:"resolve"}},Defaults.prototype.applyFromElement=function(options,$element){var optionLanguage=options.language,defaultLanguage=this.defaults.language,elementLanguage=$element.prop("lang"),parentLanguage=$element.closest("[lang]").prop("lang"),languages=Array.prototype.concat.call(this._resolveLanguage(elementLanguage),this._resolveLanguage(optionLanguage),this._resolveLanguage(defaultLanguage),this._resolveLanguage(parentLanguage));return options.language=languages,options},Defaults.prototype._resolveLanguage=function(language){if(!language)return[];if($.isEmptyObject(language))return[];if($.isPlainObject(language))return[language];var languages;languages=$.isArray(language)?language:[language];for(var resolvedLanguages=[],l=0;l<languages.length;l++)if(resolvedLanguages.push(languages[l]),"string"==typeof languages[l]&&languages[l].indexOf("-")>0){var languageParts,baseLanguage=languages[l].split("-")[0];resolvedLanguages.push(baseLanguage)}return resolvedLanguages},Defaults.prototype._processTranslations=function(languages,debug){for(var translations=new Translation,l=0;l<languages.length;l++){var languageData=new Translation,language=languages[l];if("string"==typeof language)try{languageData=Translation.loadPath(language)}catch(e){try{language=this.defaults.amdLanguageBase+language,languageData=Translation.loadPath(language)}catch(ex){debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+language+'" could not be automatically loaded. A fallback will be used instead.')}}else languageData=$.isPlainObject(language)?new Translation(language):language;translations.extend(languageData)}return translations},Defaults.prototype.set=function(key,value){var camelKey,data={};data[$.camelCase(key)]=value;var convertedData=Utils._convertData(data);$.extend(!0,this.defaults,convertedData)},new Defaults})),S2.define("select2/options",["require","jquery","./defaults","./utils"],(function(require,$,Defaults,Utils){function Options(options,$element){if(this.options=options,null!=$element&&this.fromElement($element),null!=$element&&(this.options=Defaults.applyFromElement(this.options,$element)),this.options=Defaults.apply(this.options),$element&&$element.is("input")){var InputCompat=require(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}}return Options.prototype.fromElement=function($e){var excludedData=["select2"];null==this.options.multiple&&(this.options.multiple=$e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=$e.prop("disabled")),null==this.options.dir&&($e.prop("dir")?this.options.dir=$e.prop("dir"):$e.closest("[dir]").prop("dir")?this.options.dir=$e.closest("[dir]").prop("dir"):this.options.dir="ltr"),$e.prop("disabled",this.options.disabled),$e.prop("multiple",this.options.multiple),Utils.GetData($e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),Utils.StoreData($e[0],"data",Utils.GetData($e[0],"select2Tags")),Utils.StoreData($e[0],"tags",!0)),Utils.GetData($e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),$e.attr("ajax--url",Utils.GetData($e[0],"ajaxUrl")),Utils.StoreData($e[0],"ajax-Url",Utils.GetData($e[0],"ajaxUrl")));var dataset={};function upperCaseLetter(_,letter){return letter.toUpperCase()}for(var attr=0;attr<$e[0].attributes.length;attr++){var attributeName=$e[0].attributes[attr].name,prefix="data-";if(attributeName.substr(0,prefix.length)==prefix){var dataName=attributeName.substring(prefix.length),dataValue=Utils.GetData($e[0],dataName),camelDataName;dataset[dataName.replace(/-([a-z])/g,upperCaseLetter)]=dataValue}}$.fn.jquery&&"1."==$.fn.jquery.substr(0,2)&&$e[0].dataset&&(dataset=$.extend(!0,{},$e[0].dataset,dataset));var data=$.extend(!0,{},Utils.GetData($e[0]),dataset);for(var key in data=Utils._convertData(data))$.inArray(key,excludedData)>-1||($.isPlainObject(this.options[key])?$.extend(this.options[key],data[key]):this.options[key]=data[key]);return this},Options.prototype.get=function(key){return this.options[key]},Options.prototype.set=function(key,val){this.options[key]=val},Options})),S2.define("select2/core",["jquery","./options","./utils","./keys"],(function($,Options,Utils,KEYS){var Select2=function($element,options){null!=Utils.GetData($element[0],"select2")&&Utils.GetData($element[0],"select2").destroy(),this.$element=$element,this.id=this._generateId($element),options=options||{},this.options=new Options(options,$element),Select2.__super__.constructor.call(this);var tabindex=$element.attr("tabindex")||0;Utils.StoreData($element[0],"old-tabindex",tabindex),$element.attr("tabindex","-1");var DataAdapter=this.options.get("dataAdapter");this.dataAdapter=new DataAdapter($element,this.options);var $container=this.render();this._placeContainer($container);var SelectionAdapter=this.options.get("selectionAdapter");this.selection=new SelectionAdapter($element,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,$container);var DropdownAdapter=this.options.get("dropdownAdapter");this.dropdown=new DropdownAdapter($element,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get("resultsAdapter");this.results=new ResultsAdapter($element,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var self=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(initialData){self.trigger("selection:update",{data:initialData})})),$element.addClass("select2-hidden-accessible"),$element.attr("aria-hidden","true"),this._syncAttributes(),Utils.StoreData($element[0],"select2",this),$element.data("select2",this)};return Utils.Extend(Select2,Utils.Observable),Select2.prototype._generateId=function($element){var id="";return id="select2-"+(id=(id=null!=$element.attr("id")?$element.attr("id"):null!=$element.attr("name")?$element.attr("name")+"-"+Utils.generateChars(2):Utils.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,""))},Select2.prototype._placeContainer=function($container){$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get("width"));null!=width&&$container.css("width",width)},Select2.prototype._resolveWidth=function($element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i,computedStyle;if("resolve"==method){var styleWidth=this._resolveWidth($element,"style");return null!=styleWidth?styleWidth:this._resolveWidth($element,"element")}if("element"==method){var elementWidth=$element.outerWidth(!1);return elementWidth<=0?"auto":elementWidth+"px"}if("style"==method){var style=$element.attr("style");if("string"!=typeof style)return null;for(var attrs=style.split(";"),i=0,l=attrs.length;i<l;i+=1){var attr,matches=attrs[i].replace(/\s/g,"").match(WIDTH);if(null!==matches&&matches.length>=1)return matches[1]}return null}return"computedstyle"==method?window.getComputedStyle($element[0]).width:method},Select2.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},Select2.prototype._registerDomEvents=function(){var self=this;this.$element.on("change.select2",(function(){self.dataAdapter.current((function(data){self.trigger("selection:update",{data:data})}))})),this.$element.on("focus.select2",(function(evt){self.trigger("focus",evt)})),this._syncA=Utils.bind(this._syncAttributes,this),this._syncS=Utils.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=observer?(this._observer=new observer((function(mutations){self._syncA(),self._syncS(null,mutations)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",self._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",self._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",self._syncS,!1))},Select2.prototype._registerDataEvents=function(){var self=this;this.dataAdapter.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerSelectionEvents=function(){var self=this,nonRelayEvents=["toggle","focus"];this.selection.on("toggle",(function(){self.toggleDropdown()})),this.selection.on("focus",(function(params){self.focus(params)})),this.selection.on("*",(function(name,params){-1===$.inArray(name,nonRelayEvents)&&self.trigger(name,params)}))},Select2.prototype._registerDropdownEvents=function(){var self=this;this.dropdown.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerEvents=function(){var self=this;this.on("open",(function(){self.$container.addClass("select2-container--open")})),this.on("close",(function(){self.$container.removeClass("select2-container--open")})),this.on("enable",(function(){self.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){self.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){self.$container.removeClass("select2-container--focus")})),this.on("query",(function(params){self.isOpen()||self.trigger("open",{}),this.dataAdapter.query(params,(function(data){self.trigger("results:all",{data:data,query:params})}))})),this.on("query:append",(function(params){this.dataAdapter.query(params,(function(data){self.trigger("results:append",{data:data,query:params})}))})),this.on("keypress",(function(evt){var key=evt.which;self.isOpen()?key===KEYS.ESC||key===KEYS.TAB||key===KEYS.UP&&evt.altKey?(self.close(evt),evt.preventDefault()):key===KEYS.ENTER?(self.trigger("results:select",{}),evt.preventDefault()):key===KEYS.SPACE&&evt.ctrlKey?(self.trigger("results:toggle",{}),evt.preventDefault()):key===KEYS.UP?(self.trigger("results:previous",{}),evt.preventDefault()):key===KEYS.DOWN&&(self.trigger("results:next",{}),evt.preventDefault()):(key===KEYS.ENTER||key===KEYS.SPACE||key===KEYS.DOWN&&evt.altKey)&&(self.open(),evt.preventDefault())}))},Select2.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},Select2.prototype._isChangeMutation=function(evt,mutations){var changed=!1,self=this;if(!evt||!evt.target||"OPTION"===evt.target.nodeName||"OPTGROUP"===evt.target.nodeName){if(mutations)if(mutations.addedNodes&&mutations.addedNodes.length>0)for(var n=0;n<mutations.addedNodes.length;n++){var node;mutations.addedNodes[n].selected&&(changed=!0)}else mutations.removedNodes&&mutations.removedNodes.length>0?changed=!0:$.isArray(mutations)&&$.each(mutations,(function(evt,mutation){if(self._isChangeMutation(evt,mutation))return changed=!0,!1}));else changed=!0;return changed}},Select2.prototype._syncSubtree=function(evt,mutations){var changed=this._isChangeMutation(evt,mutations),self=this;changed&&this.dataAdapter.current((function(currentData){self.trigger("selection:update",{data:currentData})}))},Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger,preTriggerMap={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===args&&(args={}),name in preTriggerMap){var preTriggerName=preTriggerMap[name],preTriggerArgs={prevented:!1,name:name,args:args};if(actualTrigger.call(this,preTriggerName,preTriggerArgs),preTriggerArgs.prevented)return void(args.prevented=!0)}actualTrigger.call(this,name,args)},Select2.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},Select2.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},Select2.prototype.close=function(evt){this.isOpen()&&this.trigger("close",{originalEvent:evt})},Select2.prototype.isEnabled=function(){return!this.isDisabled()},Select2.prototype.isDisabled=function(){return this.options.get("disabled")},Select2.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},Select2.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},Select2.prototype.focus=function(data){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},Select2.prototype.enable=function(args){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=args&&0!==args.length||(args=[!0]);var disabled=!args[0];this.$element.prop("disabled",disabled)},Select2.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var data=[];return this.dataAdapter.current((function(currentData){data=currentData})),data},Select2.prototype.val=function(args){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==args||0===args.length)return this.$element.val();var newVal=args[0];$.isArray(newVal)&&(newVal=$.map(newVal,(function(obj){return obj.toString()}))),this.$element.val(newVal).trigger("input").trigger("change")},Select2.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",Utils.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),Utils.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},Select2.prototype.render=function(){var $container=$('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return $container.attr("dir",this.options.get("dir")),this.$container=$container,this.$container.addClass("select2-container--"+this.options.get("theme")),Utils.StoreData($container[0],"element",this.$element),$container},Select2})),S2.define("select2/compat/utils",["jquery"],(function($){function syncCssClasses($dest,$src,adapter){var classes,replacements=[],adapted;(classes=$.trim($dest.attr("class")))&&$((classes=""+classes).split(/\s+/)).each((function(){0===this.indexOf("select2-")&&replacements.push(this)})),(classes=$.trim($src.attr("class")))&&$((classes=""+classes).split(/\s+/)).each((function(){0!==this.indexOf("select2-")&&null!=(adapted=adapter(this))&&replacements.push(adapted)})),$dest.attr("class",replacements.join(" "))}return{syncCssClasses:syncCssClasses}})),S2.define("select2/compat/containerCss",["jquery","./utils"],(function($,CompatUtils){function _containerAdapter(clazz){return null}function ContainerCSS(){}return ContainerCSS.prototype.render=function(decorated){var $container=decorated.call(this),containerCssClass=this.options.get("containerCssClass")||"";$.isFunction(containerCssClass)&&(containerCssClass=containerCssClass(this.$element));var containerCssAdapter=this.options.get("adaptContainerCssClass");if(containerCssAdapter=containerCssAdapter||_containerAdapter,-1!==containerCssClass.indexOf(":all:")){containerCssClass=containerCssClass.replace(":all:","");var _cssAdapter=containerCssAdapter;containerCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);return null!=adapted?adapted+" "+clazz:clazz}}var containerCss=this.options.get("containerCss")||{};return $.isFunction(containerCss)&&(containerCss=containerCss(this.$element)),CompatUtils.syncCssClasses($container,this.$element,containerCssAdapter),$container.css(containerCss),$container.addClass(containerCssClass),$container},ContainerCSS})),S2.define("select2/compat/dropdownCss",["jquery","./utils"],(function($,CompatUtils){function _dropdownAdapter(clazz){return null}function DropdownCSS(){}return DropdownCSS.prototype.render=function(decorated){var $dropdown=decorated.call(this),dropdownCssClass=this.options.get("dropdownCssClass")||"";$.isFunction(dropdownCssClass)&&(dropdownCssClass=dropdownCssClass(this.$element));var dropdownCssAdapter=this.options.get("adaptDropdownCssClass");if(dropdownCssAdapter=dropdownCssAdapter||_dropdownAdapter,-1!==dropdownCssClass.indexOf(":all:")){dropdownCssClass=dropdownCssClass.replace(":all:","");var _cssAdapter=dropdownCssAdapter;dropdownCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);return null!=adapted?adapted+" "+clazz:clazz}}var dropdownCss=this.options.get("dropdownCss")||{};return $.isFunction(dropdownCss)&&(dropdownCss=dropdownCss(this.$element)),CompatUtils.syncCssClasses($dropdown,this.$element,dropdownCssAdapter),$dropdown.css(dropdownCss),$dropdown.addClass(dropdownCssClass),$dropdown},DropdownCSS})),S2.define("select2/compat/initSelection",["jquery"],(function($){function InitSelection(decorated,$element,options){options.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=options.get("initSelection"),this._isInitialized=!1,decorated.call(this,$element,options)}return InitSelection.prototype.current=function(decorated,callback){var self=this;this._isInitialized?decorated.call(this,callback):this.initSelection.call(null,this.$element,(function(data){self._isInitialized=!0,$.isArray(data)||(data=[data]),callback(data)}))},InitSelection})),S2.define("select2/compat/inputData",["jquery","../utils"],(function($,Utils){function InputData(decorated,$element,options){this._currentData=[],this._valueSeparator=options.get("valueSeparator")||",","hidden"===$element.prop("type")&&options.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),decorated.call(this,$element,options)}return InputData.prototype.current=function(_,callback){function getSelected(data,selectedIds){var selected=[];return data.selected||-1!==$.inArray(data.id,selectedIds)?(data.selected=!0,selected.push(data)):data.selected=!1,data.children&&selected.push.apply(selected,getSelected(data.children,selectedIds)),selected}for(var selected=[],d=0;d<this._currentData.length;d++){var data=this._currentData[d];selected.push.apply(selected,getSelected(data,this.$element.val().split(this._valueSeparator)))}callback(selected)},InputData.prototype.select=function(_,data){if(this.options.get("multiple")){var value=this.$element.val();value+=this._valueSeparator+data.id,this.$element.val(value),this.$element.trigger("input").trigger("change")}else this.current((function(allData){$.map(allData,(function(data){data.selected=!1}))})),this.$element.val(data.id),this.$element.trigger("input").trigger("change")},InputData.prototype.unselect=function(_,data){var self=this;data.selected=!1,this.current((function(allData){for(var values=[],d=0;d<allData.length;d++){var item=allData[d];data.id!=item.id&&values.push(item.id)}self.$element.val(values.join(self._valueSeparator)),self.$element.trigger("input").trigger("change")}))},InputData.prototype.query=function(_,params,callback){for(var results=[],d=0;d<this._currentData.length;d++){var data=this._currentData[d],matches=this.matches(params,data);null!==matches&&results.push(matches)}callback({results:results})},InputData.prototype.addOptions=function(_,$options){var options=$.map($options,(function($option){return Utils.GetData($option[0],"data")}));this._currentData.push.apply(this._currentData,options)},InputData})),S2.define("select2/compat/matcher",["jquery"],(function($){function oldMatcher(matcher){function wrappedMatcher(params,data){var match=$.extend(!0,{},data);if(null==params.term||""===$.trim(params.term))return match;if(data.children){for(var c=data.children.length-1;c>=0;c--){var child=data.children[c],doesMatch;matcher(params.term,child.text,child)||match.children.splice(c,1)}if(match.children.length>0)return match}return matcher(params.term,data.text,data)?match:null}return wrappedMatcher}return oldMatcher})),S2.define("select2/compat/query",[],(function(){function Query(decorated,$element,options){options.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),decorated.call(this,$element,options)}return Query.prototype.query=function(_,params,callback){var query;params.callback=callback,this.options.get("query").call(null,params)},Query})),S2.define("select2/dropdown/attachContainer",[],(function(){function AttachContainer(decorated,$element,options){decorated.call(this,$element,options)}return AttachContainer.prototype.position=function(decorated,$dropdown,$container){var $dropdownContainer;$container.find(".dropdown-wrapper").append($dropdown),$dropdown.addClass("select2-dropdown--below"),$container.addClass("select2-container--below")},AttachContainer})),S2.define("select2/dropdown/stopPropagation",[],(function(){function StopPropagation(){}return StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);var stoppedEvents=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(stoppedEvents.join(" "),(function(evt){evt.stopPropagation()}))},StopPropagation})),S2.define("select2/selection/stopPropagation",[],(function(){function StopPropagation(){}return StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,container,$container);var stoppedEvents=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(stoppedEvents.join(" "),(function(evt){evt.stopPropagation()}))},StopPropagation})),
|
||
/*!
|
||
* jQuery Mousewheel 3.1.13
|
||
*
|
||
* Copyright jQuery Foundation and other contributors
|
||
* Released under the MIT license
|
||
* http://jquery.org/license
|
||
*/
|
||
factory=function($){var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler;$.data(this,"mousewheel-line-height",special.getLineHeight(this)),$.data(this,"mousewheel-page-height",special.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null;$.removeData(this,"mousewheel-line-height"),$.removeData(this,"mousewheel-page-height")},getLineHeight:function(elem){var $elem=$(elem),$parent=$elem["offsetParent"in $.fn?"offsetParent":"parent"]();return $parent.length||($parent=$("body")),parseInt($parent.css("fontSize"),10)||parseInt($elem.css("fontSize"),10)||16},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,deltaX=0,deltaY=0,absDelta=0,offsetX=0,offsetY=0;if((event=$.event.fix(orgEvent)).type="mousewheel","detail"in orgEvent&&(deltaY=-1*orgEvent.detail),"wheelDelta"in orgEvent&&(deltaY=orgEvent.wheelDelta),"wheelDeltaY"in orgEvent&&(deltaY=orgEvent.wheelDeltaY),"wheelDeltaX"in orgEvent&&(deltaX=-1*orgEvent.wheelDeltaX),"axis"in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS&&(deltaX=-1*deltaY,deltaY=0),delta=0===deltaY?deltaX:deltaY,"deltaY"in orgEvent&&(delta=deltaY=-1*orgEvent.deltaY),"deltaX"in orgEvent&&(deltaX=orgEvent.deltaX,0===deltaY&&(delta=-1*deltaX)),0!==deltaY||0!==deltaX){if(1===orgEvent.deltaMode){var lineHeight=$.data(this,"mousewheel-line-height");delta*=lineHeight,deltaY*=lineHeight,deltaX*=lineHeight}else if(2===orgEvent.deltaMode){var pageHeight=$.data(this,"mousewheel-page-height");delta*=pageHeight,deltaY*=pageHeight,deltaX*=pageHeight}if(absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX)),(!lowestDelta||absDelta<lowestDelta)&&(lowestDelta=absDelta,shouldAdjustOldDeltas(orgEvent,absDelta)&&(lowestDelta/=40)),shouldAdjustOldDeltas(orgEvent,absDelta)&&(delta/=40,deltaX/=40,deltaY/=40),delta=Math[delta>=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120==0}$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})},"function"==typeof S2.define&&S2.define.amd?S2.define("jquery-mousewheel",["jquery"],factory):"object"==typeof exports?module.exports=factory:factory(jQuery),S2.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function($,_,Select2,Defaults,Utils){if(null==$.fn.select2){var thisMethods=["open","close","destroy"];$.fn.select2=function(options){if("object"==typeof(options=options||{}))return this.each((function(){var instanceOptions=$.extend(!0,{},options),instance=new Select2($(this),instanceOptions)})),this;if("string"==typeof options){var ret,args=Array.prototype.slice.call(arguments,1);return this.each((function(){var instance=Utils.GetData(this,"select2");null==instance&&window.console&&console.error&&console.error("The select2('"+options+"') method was called on an element that is not using Select2."),ret=instance[options].apply(instance,args)})),$.inArray(options,thisMethods)>-1?this:ret}throw new Error("Invalid arguments for Select2: "+options)}}return null==$.fn.select2.defaults&&($.fn.select2.defaults=Defaults),Select2})),{define:S2.define,require:S2.require}}(),select2=S2.require("jquery.select2");return jQuery.fn.select2.amd=S2,select2})),function(factory){"undefined"!=typeof jQuery&&jQuery||"function"!=typeof define||!define.amd?"undefined"!=typeof jQuery&&jQuery||"object"!=typeof exports?factory(jQuery,document,window,navigator):factory(require("jquery"),document,window,navigator):define(["jquery"],(function(jQuery){return factory(jQuery,document,window,navigator)}))}((function($,document,window,navigator,undefined){"use strict";var plugin_count=0,is_old_ie=(n=navigator.userAgent,r=/msie\s\d+/i,n.search(r)>0&&(v=(v=r.exec(n).toString()).split(" ")[1])<9&&($("html").addClass("lt-ie9"),!0)),n,r,v;Function.prototype.bind||(Function.prototype.bind=function bind(that){var target=this,slice=[].slice;if("function"!=typeof target)throw new TypeError;var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var F=function(){};F.prototype=target.prototype;var self=new F,result=target.apply(self,args.concat(slice.call(arguments)));return Object(result)===result?result:self}return target.apply(that,args.concat(slice.call(arguments)))};return bound}),Array.prototype.indexOf||(Array.prototype.indexOf=function(searchElement,fromIndex){var k;if(null==this)throw new TypeError('"this" is null or not defined');var O=Object(this),len=O.length>>>0;if(0===len)return-1;var n=+fromIndex||0;if(Math.abs(n)===1/0&&(n=0),n>=len)return-1;for(k=Math.max(n>=0?n:len-Math.abs(n),0);k<len;){if(k in O&&O[k]===searchElement)return k;k++}return-1});var base_html='<span class="irs"><span class="irs-line" tabindex="0"></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span>',single_html='<span class="irs-bar irs-bar--single"></span><span class="irs-shadow shadow-single"></span><span class="irs-handle single"><i></i><i></i><i></i></span>',double_html='<span class="irs-bar"></span><span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-handle from"><i></i><i></i><i></i></span><span class="irs-handle to"><i></i><i></i><i></i></span>',disable_html='<span class="irs-disable-mask"></span>',IonRangeSlider=function(input,options,plugin_count){this.VERSION="2.3.1",this.input=input,this.plugin_count=plugin_count,this.current_plugin=0,this.calc_count=0,this.update_tm=0,this.old_from=0,this.old_to=0,this.old_min_interval=null,this.raf_id=null,this.dragging=!1,this.force_redraw=!1,this.no_diapason=!1,this.has_tab_index=!0,this.is_key=!1,this.is_update=!1,this.is_start=!0,this.is_finish=!1,this.is_active=!1,this.is_resize=!1,this.is_click=!1,options=options||{},this.$cache={win:$(window),body:$(document.body),input:$(input),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,s_to:null,shad_single:null,shad_from:null,shad_to:null,edge:null,grid:null,grid_labels:[]},this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0,p_step:0,p_pointer:0,p_handle:0,p_single_fake:0,p_single_real:0,p_from_fake:0,p_from_real:0,p_to_fake:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],big_x:[]},this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from_fake:0,p_from_left:0,p_to_fake:0,p_to_left:0,p_single_fake:0,p_single_left:0};var $inp=this.$cache.input,val=$inp.prop("value"),config,config_from_data,prop;for(prop in config={skin:"flat",type:"single",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:" ",prettify:null,force_edges:!1,keyboard:!0,grid:!1,grid_margin:!0,grid_num:4,grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:"",postfix:"",max_postfix:"",decorate_both:!0,values_separator:" — ",input_values_separator:";",disable:!1,block:!1,extra_classes:"",scope:null,onStart:null,onChange:null,onFinish:null,onUpdate:null},"INPUT"!==$inp[0].nodeName&&console&&console.warn&&console.warn("Base element should be <input>!",$inp[0]),(config_from_data={skin:$inp.data("skin"),type:$inp.data("type"),min:$inp.data("min"),max:$inp.data("max"),from:$inp.data("from"),to:$inp.data("to"),step:$inp.data("step"),min_interval:$inp.data("minInterval"),max_interval:$inp.data("maxInterval"),drag_interval:$inp.data("dragInterval"),values:$inp.data("values"),from_fixed:$inp.data("fromFixed"),from_min:$inp.data("fromMin"),from_max:$inp.data("fromMax"),from_shadow:$inp.data("fromShadow"),to_fixed:$inp.data("toFixed"),to_min:$inp.data("toMin"),to_max:$inp.data("toMax"),to_shadow:$inp.data("toShadow"),prettify_enabled:$inp.data("prettifyEnabled"),prettify_separator:$inp.data("prettifySeparator"),force_edges:$inp.data("forceEdges"),keyboard:$inp.data("keyboard"),grid:$inp.data("grid"),grid_margin:$inp.data("gridMargin"),grid_num:$inp.data("gridNum"),grid_snap:$inp.data("gridSnap"),hide_min_max:$inp.data("hideMinMax"),hide_from_to:$inp.data("hideFromTo"),prefix:$inp.data("prefix"),postfix:$inp.data("postfix"),max_postfix:$inp.data("maxPostfix"),decorate_both:$inp.data("decorateBoth"),values_separator:$inp.data("valuesSeparator"),input_values_separator:$inp.data("inputValuesSeparator"),disable:$inp.data("disable"),block:$inp.data("block"),extra_classes:$inp.data("extraClasses")}).values=config_from_data.values&&config_from_data.values.split(","),config_from_data)config_from_data.hasOwnProperty(prop)&&(config_from_data[prop]!==undefined&&""!==config_from_data[prop]||delete config_from_data[prop]);val!==undefined&&""!==val&&((val=val.split(config_from_data.input_values_separator||options.input_values_separator||";"))[0]&&val[0]==+val[0]&&(val[0]=+val[0]),val[1]&&val[1]==+val[1]&&(val[1]=+val[1]),options&&options.values&&options.values.length?(config.from=val[0]&&options.values.indexOf(val[0]),config.to=val[1]&&options.values.indexOf(val[1])):(config.from=val[0]&&+val[0],config.to=val[1]&&+val[1])),$.extend(config,options),$.extend(config,config_from_data),this.options=config,this.update_check={},this.validate(),this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null},this.init()};IonRangeSlider.prototype={init:function(is_update){this.no_diapason=!1,this.coords.p_step=this.convertToPercent(this.options.step,!0),this.target="base",this.toggleInput(),this.append(),this.setMinMax(),is_update?(this.force_redraw=!0,this.calc(!0),this.callOnUpdate()):(this.force_redraw=!0,this.calc(!0),this.callOnStart()),this.updateScene()},append:function(){var container_html='<span class="irs irs--'+this.options.skin+" js-irs-"+this.plugin_count+" "+this.options.extra_classes+'"></span>';this.$cache.input.before(container_html),this.$cache.input.prop("readonly",!0),this.$cache.cont=this.$cache.input.prev(),this.result.slider=this.$cache.cont,this.$cache.cont.html(base_html),this.$cache.rs=this.$cache.cont.find(".irs"),this.$cache.min=this.$cache.cont.find(".irs-min"),this.$cache.max=this.$cache.cont.find(".irs-max"),this.$cache.from=this.$cache.cont.find(".irs-from"),this.$cache.to=this.$cache.cont.find(".irs-to"),this.$cache.single=this.$cache.cont.find(".irs-single"),this.$cache.line=this.$cache.cont.find(".irs-line"),this.$cache.grid=this.$cache.cont.find(".irs-grid"),"single"===this.options.type?(this.$cache.cont.append(single_html),this.$cache.bar=this.$cache.cont.find(".irs-bar"),this.$cache.edge=this.$cache.cont.find(".irs-bar-edge"),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append(double_html),this.$cache.bar=this.$cache.cont.find(".irs-bar"),this.$cache.s_from=this.$cache.cont.find(".from"),this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"),this.setTopHandler()),this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none"),this.appendGrid(),this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.input[0].disabled=!1,this.removeDisableMask(),this.bindEvents()),this.options.disable||(this.options.block?this.appendDisableMask():this.removeDisableMask()),this.options.drag_interval&&(this.$cache.bar[0].style.cursor="ew-resize")},setTopHandler:function(){var min=this.options.min,max=this.options.max,from=this.options.from,to=this.options.to;from>min&&to===max?this.$cache.s_from.addClass("type_last"):to<max&&this.$cache.s_to.addClass("type_last")},changeLevel:function(target){switch(target){case"single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single_fake),this.$cache.s_single.addClass("state_hover");break;case"from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.$cache.s_from.addClass("state_hover"),this.$cache.s_from.addClass("type_last"),this.$cache.s_to.removeClass("type_last");break;case"to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to_fake),this.$cache.s_to.addClass("state_hover"),this.$cache.s_to.addClass("type_last"),this.$cache.s_from.removeClass("type_last");break;case"both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.coords.p_gap_right=this.toFixed(this.coords.p_to_fake-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},appendDisableMask:function(){this.$cache.cont.append(disable_html),this.$cache.cont.addClass("irs-disabled")},removeDisableMask:function(){this.$cache.cont.remove(".irs-disable-mask"),this.$cache.cont.removeClass("irs-disabled")},remove:function(){this.$cache.cont.remove(),this.$cache.cont=null,this.$cache.line.off("keydown.irs_"+this.plugin_count),this.$cache.body.off("touchmove.irs_"+this.plugin_count),this.$cache.body.off("mousemove.irs_"+this.plugin_count),this.$cache.win.off("touchend.irs_"+this.plugin_count),this.$cache.win.off("mouseup.irs_"+this.plugin_count),is_old_ie&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)),this.$cache.grid_labels=[],this.coords.big=[],this.coords.big_w=[],this.coords.big_p=[],this.coords.big_x=[],cancelAnimationFrame(this.raf_id)},bindEvents:function(){this.no_diapason||(this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("focus.irs_"+this.plugin_count,this.pointerFocus.bind(this)),this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),"single"===this.options.type?(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.edge.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),this.options.keyboard&&this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard")),is_old_ie&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this))))},pointerFocus:function(e){var x,$handle;this.target||(x=($handle="single"===this.options.type?this.$cache.single:this.$cache.from).offset().left,x+=$handle.width()/2-1,this.pointerClick("single",{preventDefault:function(){},pageX:x}))},pointerMove:function(e){if(this.dragging){var x=e.pageX||e.originalEvent.touches&&e.originalEvent.touches[0].pageX;this.coords.x_pointer=x-this.coords.x_gap,this.calc()}},pointerUp:function(e){this.current_plugin===this.plugin_count&&this.is_active&&(this.is_active=!1,this.$cache.cont.find(".state_hover").removeClass("state_hover"),this.force_redraw=!0,is_old_ie&&$("*").prop("unselectable",!1),this.updateScene(),this.restoreOriginalMinInterval(),($.contains(this.$cache.cont[0],e.target)||this.dragging)&&this.callOnFinish(),this.dragging=!1)},pointerDown:function(target,e){e.preventDefault();var x=e.pageX||e.originalEvent.touches&&e.originalEvent.touches[0].pageX;2!==e.button&&("both"===target&&this.setTempMinInterval(),target||(target=this.target||"from"),this.current_plugin=this.plugin_count,this.target=target,this.is_active=!0,this.dragging=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=x-this.coords.x_gap,this.calcPointerPercent(),this.changeLevel(target),is_old_ie&&$("*").prop("unselectable",!0),this.$cache.line.trigger("focus"),this.updateScene())},pointerClick:function(target,e){e.preventDefault();var x=e.pageX||e.originalEvent.touches&&e.originalEvent.touches[0].pageX;2!==e.button&&(this.current_plugin=this.plugin_count,this.target=target,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(x-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(target,e){if(!(this.current_plugin!==this.plugin_count||e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)){switch(e.which){case 83:case 65:case 40:case 37:e.preventDefault(),this.moveByKey(!1);break;case 87:case 68:case 38:case 39:e.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(right){var p=this.coords.p_pointer,p_step=(this.options.max-this.options.min)/100;p_step=this.options.step/p_step,right?p+=p_step:p-=p_step,this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*p),this.is_key=!0,this.calc()},setMinMax:function(){if(this.options){if(this.options.hide_min_max)return this.$cache.min[0].style.display="none",void(this.$cache.max[0].style.display="none");if(this.options.values.length)this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]));else{var min_pretty=this._prettify(this.options.min),max_pretty=this._prettify(this.options.max);this.result.min_pretty=min_pretty,this.result.max_pretty=max_pretty,this.$cache.min.html(this.decorate(min_pretty,this.options.min)),this.$cache.max.html(this.decorate(max_pretty,this.options.max))}this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)}},setTempMinInterval:function(){var interval=this.result.to-this.result.from;null===this.old_min_interval&&(this.old_min_interval=this.options.min_interval),this.options.min_interval=interval},restoreOriginalMinInterval:function(){null!==this.old_min_interval&&(this.options.min_interval=this.old_min_interval,this.old_min_interval=null)},calc:function(update){if(this.options&&(this.calc_count++,(10===this.calc_count||update)&&(this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.calcHandlePercent()),this.coords.w_rs)){this.calcPointerPercent();var handle_x=this.getHandleX();switch("both"===this.target&&(this.coords.p_gap=0,handle_x=this.getHandleX()),"click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,handle_x=this.getHandleX(),this.options.drag_interval?this.target="both_one":this.target=this.chooseHandle(handle_x)),this.target){case"base":var w=(this.options.max-this.options.min)/100,f=(this.result.from-this.options.min)/w,t=(this.result.to-this.options.min)/w;this.coords.p_single_real=this.toFixed(f),this.coords.p_from_real=this.toFixed(f),this.coords.p_to_real=this.toFixed(t),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real),this.target=null;break;case"single":if(this.options.from_fixed)break;this.coords.p_single_real=this.convertToRealPercent(handle_x),this.coords.p_single_real=this.calcWithStep(this.coords.p_single_real),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);break;case"from":if(this.options.from_fixed)break;this.coords.p_from_real=this.convertToRealPercent(handle_x),this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real),this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);break;case"to":if(this.options.to_fixed)break;this.coords.p_to_real=this.convertToRealPercent(handle_x),this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real),this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);break;case"both":if(this.options.from_fixed||this.options.to_fixed)break;handle_x=this.toFixed(handle_x+.001*this.coords.p_handle),this.coords.p_from_real=this.convertToRealPercent(handle_x)-this.coords.p_gap_left,this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.convertToRealPercent(handle_x)+this.coords.p_gap_right,this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);break;case"both_one":if(this.options.from_fixed||this.options.to_fixed)break;var real_x=this.convertToRealPercent(handle_x),from=this.result.from_percent,to,full=this.result.to_percent-from,half=full/2,new_from=real_x-half,new_to=real_x+half;new_from<0&&(new_to=(new_from=0)+full),new_to>100&&(new_from=(new_to=100)-full),this.coords.p_from_real=this.calcWithStep(new_from),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.calcWithStep(new_to),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real)}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single_fake,this.result.from_percent=this.coords.p_single_real,this.result.from=this.convertToValue(this.coords.p_single_real),this.result.from_pretty=this._prettify(this.result.from),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=this.toFixed(this.coords.p_from_fake+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to_fake-this.coords.p_from_fake),this.result.from_percent=this.coords.p_from_real,this.result.from=this.convertToValue(this.coords.p_from_real),this.result.from_pretty=this._prettify(this.result.from),this.result.to_percent=this.coords.p_to_real,this.result.to=this.convertToValue(this.coords.p_to_real),this.result.to_pretty=this._prettify(this.result.to),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to])),this.calcMinMax(),this.calcLabels()}},calcPointerPercent:function(){this.coords.w_rs?(this.coords.x_pointer<0||isNaN(this.coords.x_pointer)?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},convertToRealPercent:function(fake){var full;return fake/(100-this.coords.p_handle)*100},convertToFakePercent:function(real){var full;return real/100*(100-this.coords.p_handle)},getHandleX:function(){var max=100-this.coords.p_handle,x=this.toFixed(this.coords.p_pointer-this.coords.p_gap);return x<0?x=0:x>max&&(x=max),x},calcHandlePercent:function(){"single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100)},chooseHandle:function(real_x){return"single"===this.options.type?"single":real_x>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?this.options.to_fixed?"from":"to":this.options.from_fixed?"to":"from";var m_point},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single_fake+this.coords.p_handle/2-this.labels.p_single_fake/2,this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake)):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from_fake=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from_fake+this.coords.p_handle/2-this.labels.p_from_fake/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from_fake),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to_fake=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to_fake+this.coords.p_handle/2-this.labels.p_to_fake/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to_fake),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to_fake)/2-this.labels.p_single_fake/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake)))},updateScene:function(){this.raf_id&&(cancelAnimationFrame(this.raf_id),this.raf_id=null),clearTimeout(this.update_tm),this.update_tm=null,this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0),(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)&&(this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow()),this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)&&((this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key)&&(this.drawLabels(),this.$cache.bar[0].style.left=this.coords.p_bar_x+"%",this.$cache.bar[0].style.width=this.coords.p_bar_w+"%","single"===this.options.type?(this.$cache.bar[0].style.left=0,this.$cache.bar[0].style.width=this.coords.p_bar_w+this.coords.p_bar_x+"%",this.$cache.s_single[0].style.left=this.coords.p_single_fake+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%"):(this.$cache.s_from[0].style.left=this.coords.p_from_fake+"%",this.$cache.s_to[0].style.left=this.coords.p_to_fake+"%",(this.old_from!==this.result.from||this.force_redraw)&&(this.$cache.from[0].style.left=this.labels.p_from_left+"%"),(this.old_to!==this.result.to||this.force_redraw)&&(this.$cache.to[0].style.left=this.labels.p_to_left+"%"),this.$cache.single[0].style.left=this.labels.p_single_left+"%"),this.writeToInput(),this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||(this.$cache.input.trigger("change"),this.$cache.input.trigger("input")),this.old_from=this.result.from,this.old_to=this.result.to,this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange(),(this.is_key||this.is_click)&&(this.is_key=!1,this.is_click=!1,this.callOnFinish()),this.is_update=!1,this.is_resize=!1,this.is_finish=!1),this.is_start=!1,this.is_key=!1,this.is_click=!1,this.force_redraw=!1))},drawLabels:function(){if(this.options){var values_num=this.options.values.length,p_values=this.options.p_values,text_single,text_from,text_to,from_pretty,to_pretty;if(!this.options.hide_from_to)if("single"===this.options.type)values_num?(text_single=this.decorate(p_values[this.result.from]),this.$cache.single.html(text_single)):(from_pretty=this._prettify(this.result.from),text_single=this.decorate(from_pretty,this.result.from),this.$cache.single.html(text_single)),this.calcLabels(),this.labels.p_single_left<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",this.labels.p_single_left+this.labels.p_single_fake>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible";else{values_num?(this.options.decorate_both?(text_single=this.decorate(p_values[this.result.from]),text_single+=this.options.values_separator,text_single+=this.decorate(p_values[this.result.to])):text_single=this.decorate(p_values[this.result.from]+this.options.values_separator+p_values[this.result.to]),text_from=this.decorate(p_values[this.result.from]),text_to=this.decorate(p_values[this.result.to]),this.$cache.single.html(text_single),this.$cache.from.html(text_from),this.$cache.to.html(text_to)):(from_pretty=this._prettify(this.result.from),to_pretty=this._prettify(this.result.to),this.options.decorate_both?(text_single=this.decorate(from_pretty,this.result.from),text_single+=this.options.values_separator,text_single+=this.decorate(to_pretty,this.result.to)):text_single=this.decorate(from_pretty+this.options.values_separator+to_pretty,this.result.to),text_from=this.decorate(from_pretty,this.result.from),text_to=this.decorate(to_pretty,this.result.to),this.$cache.single.html(text_single),this.$cache.from.html(text_from),this.$cache.to.html(text_to)),this.calcLabels();var min=Math.min(this.labels.p_single_left,this.labels.p_from_left),single_left=this.labels.p_single_left+this.labels.p_single_fake,to_left=this.labels.p_to_left+this.labels.p_to_fake,max=Math.max(single_left,to_left);this.labels.p_from_left+this.labels.p_from_fake>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?("from"===this.target?this.$cache.from[0].style.visibility="visible":"to"===this.target?this.$cache.to[0].style.visibility="visible":this.target||(this.$cache.from[0].style.visibility="visible"),this.$cache.single[0].style.visibility="hidden",max=to_left):(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",max=Math.max(single_left,to_left))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden"),min<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",max>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible"}}},drawShadow:function(){var o=this.options,c=this.$cache,is_from_min="number"==typeof o.from_min&&!isNaN(o.from_min),is_from_max="number"==typeof o.from_max&&!isNaN(o.from_max),is_to_min="number"==typeof o.to_min&&!isNaN(o.to_min),is_to_max="number"==typeof o.to_max&&!isNaN(o.to_max),from_min,from_max,to_min,to_max;"single"===o.type?o.from_shadow&&(is_from_min||is_from_max)?(from_min=this.convertToPercent(is_from_min?o.from_min:o.min),from_max=this.convertToPercent(is_from_max?o.from_max:o.max)-from_min,from_min=this.toFixed(from_min-this.coords.p_handle/100*from_min),from_max=this.toFixed(from_max-this.coords.p_handle/100*from_max),from_min+=this.coords.p_handle/2,c.shad_single[0].style.display="block",c.shad_single[0].style.left=from_min+"%",c.shad_single[0].style.width=from_max+"%"):c.shad_single[0].style.display="none":(o.from_shadow&&(is_from_min||is_from_max)?(from_min=this.convertToPercent(is_from_min?o.from_min:o.min),from_max=this.convertToPercent(is_from_max?o.from_max:o.max)-from_min,from_min=this.toFixed(from_min-this.coords.p_handle/100*from_min),from_max=this.toFixed(from_max-this.coords.p_handle/100*from_max),from_min+=this.coords.p_handle/2,c.shad_from[0].style.display="block",c.shad_from[0].style.left=from_min+"%",c.shad_from[0].style.width=from_max+"%"):c.shad_from[0].style.display="none",o.to_shadow&&(is_to_min||is_to_max)?(to_min=this.convertToPercent(is_to_min?o.to_min:o.min),to_max=this.convertToPercent(is_to_max?o.to_max:o.max)-to_min,to_min=this.toFixed(to_min-this.coords.p_handle/100*to_min),to_max=this.toFixed(to_max-this.coords.p_handle/100*to_max),to_min+=this.coords.p_handle/2,c.shad_to[0].style.display="block",c.shad_to[0].style.left=to_min+"%",c.shad_to[0].style.width=to_max+"%"):c.shad_to[0].style.display="none")},writeToInput:function(){"single"===this.options.type?(this.options.values.length?this.$cache.input.prop("value",this.result.from_value):this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from)):(this.options.values.length?this.$cache.input.prop("value",this.result.from_value+this.options.input_values_separator+this.result.to_value):this.$cache.input.prop("value",this.result.from+this.options.input_values_separator+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))},callOnStart:function(){this.writeToInput(),this.options.onStart&&"function"==typeof this.options.onStart&&(this.options.scope?this.options.onStart.call(this.options.scope,this.result):this.options.onStart(this.result))},callOnChange:function(){this.writeToInput(),this.options.onChange&&"function"==typeof this.options.onChange&&(this.options.scope?this.options.onChange.call(this.options.scope,this.result):this.options.onChange(this.result))},callOnFinish:function(){this.writeToInput(),this.options.onFinish&&"function"==typeof this.options.onFinish&&(this.options.scope?this.options.onFinish.call(this.options.scope,this.result):this.options.onFinish(this.result))},callOnUpdate:function(){this.writeToInput(),this.options.onUpdate&&"function"==typeof this.options.onUpdate&&(this.options.scope?this.options.onUpdate.call(this.options.scope,this.result):this.options.onUpdate(this.result))},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input"),this.has_tab_index?this.$cache.input.prop("tabindex",-1):this.$cache.input.removeProp("tabindex"),this.has_tab_index=!this.has_tab_index},convertToPercent:function(value,no_min){var diapason=this.options.max-this.options.min,one_percent=diapason/100,val,percent;return diapason?(percent=(val=no_min?value:value-this.options.min)/one_percent,this.toFixed(percent)):(this.no_diapason=!0,0)},convertToValue:function(percent){var min=this.options.min,max=this.options.max,min_decimals=min.toString().split(".")[1],max_decimals=max.toString().split(".")[1],min_length,max_length,avg_decimals=0,abs=0;if(0===percent)return this.options.min;if(100===percent)return this.options.max;min_decimals&&(avg_decimals=min_length=min_decimals.length),max_decimals&&(avg_decimals=max_length=max_decimals.length),min_length&&max_length&&(avg_decimals=min_length>=max_length?min_length:max_length),min<0&&(min=+(min+(abs=Math.abs(min))).toFixed(avg_decimals),max=+(max+abs).toFixed(avg_decimals));var number=(max-min)/100*percent+min,string=this.options.step.toString().split(".")[1],result;return string?number=+number.toFixed(string.length):(number/=this.options.step,number=+(number*=this.options.step).toFixed(0)),abs&&(number-=abs),(result=string?+number.toFixed(string.length):this.toFixed(number))<this.options.min?result=this.options.min:result>this.options.max&&(result=this.options.max),result},calcWithStep:function(percent){var rounded=Math.round(percent/this.coords.p_step)*this.coords.p_step;return rounded>100&&(rounded=100),100===percent&&(rounded=100),this.toFixed(rounded)},checkMinInterval:function(p_current,p_next,type){var o=this.options,current,next;return o.min_interval?(current=this.convertToValue(p_current),next=this.convertToValue(p_next),"from"===type?next-current<o.min_interval&&(current=next-o.min_interval):current-next<o.min_interval&&(current=next+o.min_interval),this.convertToPercent(current)):p_current},checkMaxInterval:function(p_current,p_next,type){var o=this.options,current,next;return o.max_interval?(current=this.convertToValue(p_current),next=this.convertToValue(p_next),"from"===type?next-current>o.max_interval&&(current=next-o.max_interval):current-next>o.max_interval&&(current=next+o.max_interval),this.convertToPercent(current)):p_current},checkDiapason:function(p_num,min,max){var num=this.convertToValue(p_num),o=this.options;return"number"!=typeof min&&(min=o.min),"number"!=typeof max&&(max=o.max),num<min&&(num=min),num>max&&(num=max),this.convertToPercent(num)},toFixed:function(num){return+(num=num.toFixed(20))},_prettify:function(num){return this.options.prettify_enabled?this.options.prettify&&"function"==typeof this.options.prettify?this.options.prettify(num):this.prettify(num):num},prettify:function(num){var n;return num.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(left,width){return this.options.force_edges?(left<0?left=0:left>100-width&&(left=100-width),this.toFixed(left)):this.toFixed(left)},validate:function(){var o=this.options,r=this.result,v=o.values,vl=v.length,value,i;if("string"==typeof o.min&&(o.min=+o.min),"string"==typeof o.max&&(o.max=+o.max),"string"==typeof o.from&&(o.from=+o.from),"string"==typeof o.to&&(o.to=+o.to),"string"==typeof o.step&&(o.step=+o.step),"string"==typeof o.from_min&&(o.from_min=+o.from_min),"string"==typeof o.from_max&&(o.from_max=+o.from_max),"string"==typeof o.to_min&&(o.to_min=+o.to_min),"string"==typeof o.to_max&&(o.to_max=+o.to_max),"string"==typeof o.grid_num&&(o.grid_num=+o.grid_num),o.max<o.min&&(o.max=o.min),vl)for(o.p_values=[],o.min=0,o.max=vl-1,o.step=1,o.grid_num=o.max,o.grid_snap=!0,i=0;i<vl;i++)value=+v[i],isNaN(value)?value=v[i]:(v[i]=value,value=this._prettify(value)),o.p_values.push(value);("number"!=typeof o.from||isNaN(o.from))&&(o.from=o.min),("number"!=typeof o.to||isNaN(o.to))&&(o.to=o.max),"single"===o.type?(o.from<o.min&&(o.from=o.min),o.from>o.max&&(o.from=o.max)):(o.from<o.min&&(o.from=o.min),o.from>o.max&&(o.from=o.max),o.to<o.min&&(o.to=o.min),o.to>o.max&&(o.to=o.max),this.update_check.from&&(this.update_check.from!==o.from&&o.from>o.to&&(o.from=o.to),this.update_check.to!==o.to&&o.to<o.from&&(o.to=o.from)),o.from>o.to&&(o.from=o.to),o.to<o.from&&(o.to=o.from)),("number"!=typeof o.step||isNaN(o.step)||!o.step||o.step<0)&&(o.step=1),"number"==typeof o.from_min&&o.from<o.from_min&&(o.from=o.from_min),"number"==typeof o.from_max&&o.from>o.from_max&&(o.from=o.from_max),"number"==typeof o.to_min&&o.to<o.to_min&&(o.to=o.to_min),"number"==typeof o.to_max&&o.from>o.to_max&&(o.to=o.to_max),r&&(r.min!==o.min&&(r.min=o.min),r.max!==o.max&&(r.max=o.max),(r.from<r.min||r.from>r.max)&&(r.from=o.from),(r.to<r.min||r.to>r.max)&&(r.to=o.to)),("number"!=typeof o.min_interval||isNaN(o.min_interval)||!o.min_interval||o.min_interval<0)&&(o.min_interval=0),("number"!=typeof o.max_interval||isNaN(o.max_interval)||!o.max_interval||o.max_interval<0)&&(o.max_interval=0),o.min_interval&&o.min_interval>o.max-o.min&&(o.min_interval=o.max-o.min),o.max_interval&&o.max_interval>o.max-o.min&&(o.max_interval=o.max-o.min)},decorate:function(num,original){var decorated="",o=this.options;return o.prefix&&(decorated+=o.prefix),decorated+=num,o.max_postfix&&(o.values.length&&num===o.p_values[o.max]?(decorated+=o.max_postfix,o.postfix&&(decorated+=" ")):original===o.max&&(decorated+=o.max_postfix,o.postfix&&(decorated+=" "))),o.postfix&&(decorated+=o.postfix),decorated},updateFrom:function(){this.result.from=this.options.from,this.result.from_percent=this.convertToPercent(this.result.from),this.result.from_pretty=this._prettify(this.result.from),this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to,this.result.to_percent=this.convertToPercent(this.result.to),this.result.to_pretty=this._prettify(this.result.to),this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(){this.result.min=this.options.min,this.result.max=this.options.max,this.updateFrom(),this.updateTo()},appendGrid:function(){if(this.options.grid){var o=this.options,i,z,total=o.max-o.min,big_num=o.grid_num,big_p=0,big_w=0,small_max=4,local_small_max,small_p,small_w=0,result,html="";for(this.calcGridMargin(),o.grid_snap&&(big_num=total/o.step),big_num>50&&(big_num=50),big_p=this.toFixed(100/big_num),big_num>4&&(small_max=3),big_num>7&&(small_max=2),big_num>14&&(small_max=1),big_num>28&&(small_max=0),i=0;i<big_num+1;i++){for(local_small_max=small_max,(big_w=this.toFixed(big_p*i))>100&&(big_w=100),this.coords.big[i]=big_w,small_p=(big_w-big_p*(i-1))/(local_small_max+1),z=1;z<=local_small_max&&0!==big_w;z++)html+='<span class="irs-grid-pol small" style="left: '+(small_w=this.toFixed(big_w-small_p*z))+'%"></span>';html+='<span class="irs-grid-pol" style="left: '+big_w+'%"></span>',result=this.convertToValue(big_w),html+='<span class="irs-grid-text js-grid-text-'+i+'" style="left: '+big_w+'%">'+(result=o.values.length?o.p_values[result]:this._prettify(result))+"</span>"}this.coords.big_num=Math.ceil(big_num+1),this.$cache.cont.addClass("irs-with-grid"),this.$cache.grid.html(html),this.cacheGridLabels()}},cacheGridLabels:function(){var $label,i,num=this.coords.big_num;for(i=0;i<num;i++)$label=this.$cache.grid.find(".js-grid-text-"+i),this.$cache.grid_labels.push($label);this.calcGridLabels()},calcGridLabels:function(){var i,label,start=[],finish=[],num=this.coords.big_num;for(i=0;i<num;i++)this.coords.big_w[i]=this.$cache.grid_labels[i].outerWidth(!1),this.coords.big_p[i]=this.toFixed(this.coords.big_w[i]/this.coords.w_rs*100),this.coords.big_x[i]=this.toFixed(this.coords.big_p[i]/2),start[i]=this.toFixed(this.coords.big[i]-this.coords.big_x[i]),finish[i]=this.toFixed(start[i]+this.coords.big_p[i]);for(this.options.force_edges&&(start[0]<-this.coords.grid_gap&&(start[0]=-this.coords.grid_gap,finish[0]=this.toFixed(start[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),finish[num-1]>100+this.coords.grid_gap&&(finish[num-1]=100+this.coords.grid_gap,start[num-1]=this.toFixed(finish[num-1]-this.coords.big_p[num-1]),this.coords.big_x[num-1]=this.toFixed(this.coords.big_p[num-1]-this.coords.grid_gap))),this.calcGridCollision(2,start,finish),this.calcGridCollision(4,start,finish),i=0;i<num;i++)label=this.$cache.grid_labels[i][0],this.coords.big_x[i]!==Number.POSITIVE_INFINITY&&(label.style.marginLeft=-this.coords.big_x[i]+"%")},calcGridCollision:function(step,start,finish){var i,next_i,label,num=this.coords.big_num;for(i=0;i<num&&!((next_i=i+step/2)>=num);i+=step)label=this.$cache.grid_labels[next_i][0],finish[i]<=start[next_i]?label.style.visibility="visible":label.style.visibility="hidden"},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&("single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(options){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.update_check.from=this.result.from,this.update_check.to=this.result.to,this.options=$.extend(this.options,options),this.validate(),this.updateResult(options),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),$.data(this.input,"ionRangeSlider",null),this.remove(),this.input=null,this.options=null)}},$.fn.ionRangeSlider=function(options){return this.each((function(){$.data(this,"ionRangeSlider")||$.data(this,"ionRangeSlider",new IonRangeSlider(this,options,plugin_count++))}))},function(){for(var lastTime=0,vendors=["ms","moz","webkit","o"],x=0;x<vendors.length&&!window.requestAnimationFrame;++x)window.requestAnimationFrame=window[vendors[x]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[vendors[x]+"CancelAnimationFrame"]||window[vendors[x]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(callback,element){var currTime=(new Date).getTime(),timeToCall=Math.max(0,16-(currTime-lastTime)),id=window.setTimeout((function(){callback(currTime+timeToCall)}),timeToCall);return lastTime=currTime+timeToCall,id}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(id){clearTimeout(id)})}()})),
|
||
/*!
|
||
* typeahead.js 0.11.1
|
||
* https://github.com/twitter/typeahead.js
|
||
* Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
|
||
*/
|
||
function(root,factory){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],(function(a0){return root.Bloodhound=factory(a0)})):"object"==typeof exports?module.exports=factory(require("jquery")):root.Bloodhound=factory(jQuery)}(this,(function($){var _=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(obj){return"string"==typeof obj},isNumber:function(obj){return"number"==typeof obj},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return void 0===obj},isElement:function(obj){return!(!obj||1!==obj.nodeType)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||null===s?"":s+""},bind:$.proxy,each:function(collection,cb){function reverseArgs(index,value){return cb(value,index)}$.each(collection,reverseArgs)},map:$.map,filter:$.grep,every:function(obj,test){var result=!0;return obj?($.each(obj,(function(key,val){if(!(result=test.call(null,val,key,obj)))return!1})),!!result):result},some:function(obj,test){var result=!1;return obj?($.each(obj,(function(key,val){if(result=test.call(null,val,key,obj))return!1})),!!result):result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(!0,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;return later=function(){timeout=null,immediate||(result=func.apply(context,args))},callNow=immediate&&!timeout,clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&(result=func.apply(context,args)),result}},throttle:function(func,wait){var context,args,timeout,result,previous,later;return previous=0,later=function(){previous=new Date,timeout=null,result=func.apply(context,args)},function(){var now=new Date,remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0?(clearTimeout(timeout),timeout=null,previous=now,result=func.apply(context,args)):timeout||(timeout=setTimeout(later,remaining)),result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}(),VERSION="0.11.1",tokenizers=function(){"use strict";return{nonword:nonword,whitespace:whitespace,obj:{nonword:getObjTokenizer(nonword),whitespace:getObjTokenizer(whitespace)}};function whitespace(str){return(str=_.toStr(str))?str.split(/\s+/):[]}function nonword(str){return(str=_.toStr(str))?str.split(/\W+/):[]}function getObjTokenizer(tokenizer){return function setKey(keys){return keys=_.isArray(keys)?keys:[].slice.call(arguments,0),function tokenize(o){var tokens=[];return _.each(keys,(function(k){tokens=tokens.concat(tokenizer(_.toStr(o[k])))})),tokens}}}}(),LruCache=function(){"use strict";function LruCache(maxSize){this.maxSize=_.isNumber(maxSize)?maxSize:100,this.reset(),this.maxSize<=0&&(this.set=this.get=$.noop)}function List(){this.head=this.tail=null}function Node(key,val){this.key=key,this.val=val,this.prev=this.next=null}return _.mixin(LruCache.prototype,{set:function set(key,val){var tailItem=this.list.tail,node;this.size>=this.maxSize&&(this.list.remove(tailItem),delete this.hash[tailItem.key],this.size--),(node=this.hash[key])?(node.val=val,this.list.moveToFront(node)):(node=new Node(key,val),this.list.add(node),this.hash[key]=node,this.size++)},get:function get(key){var node=this.hash[key];if(node)return this.list.moveToFront(node),node.val},reset:function reset(){this.size=0,this.hash={},this.list=new List}}),_.mixin(List.prototype,{add:function add(node){this.head&&(node.next=this.head,this.head.prev=node),this.head=node,this.tail=this.tail||node},remove:function remove(node){node.prev?node.prev.next=node.next:this.head=node.next,node.next?node.next.prev=node.prev:this.tail=node.prev},moveToFront:function(node){this.remove(node),this.add(node)}}),LruCache}(),PersistentStorage=function(){"use strict";var LOCAL_STORAGE;try{(LOCAL_STORAGE=window.localStorage).setItem("~~~","!"),LOCAL_STORAGE.removeItem("~~~")}catch(err){LOCAL_STORAGE=null}function PersistentStorage(namespace,override){this.prefix=["__",namespace,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+_.escapeRegExChars(this.prefix)),this.ls=override||LOCAL_STORAGE,!this.ls&&this._noop()}return _.mixin(PersistentStorage.prototype,{_prefix:function(key){return this.prefix+key},_ttlKey:function(key){return this._prefix(key)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=_.noop},_safeSet:function(key,val){try{this.ls.setItem(key,val)}catch(err){"QuotaExceededError"===err.name&&(this.clear(),this._noop())}},get:function(key){return this.isExpired(key)&&this.remove(key),decode(this.ls.getItem(this._prefix(key)))},set:function(key,val,ttl){return _.isNumber(ttl)?this._safeSet(this._ttlKey(key),encode(now()+ttl)):this.ls.removeItem(this._ttlKey(key)),this._safeSet(this._prefix(key),encode(val))},remove:function(key){return this.ls.removeItem(this._ttlKey(key)),this.ls.removeItem(this._prefix(key)),this},clear:function(){var i,keys=gatherMatchingKeys(this.keyMatcher);for(i=keys.length;i--;)this.remove(keys[i]);return this},isExpired:function(key){var ttl=decode(this.ls.getItem(this._ttlKey(key)));return!!(_.isNumber(ttl)&&now()>ttl)}}),PersistentStorage;function now(){return(new Date).getTime()}function encode(val){return JSON.stringify(_.isUndefined(val)?null:val)}function decode(val){return $.parseJSON(val)}function gatherMatchingKeys(keyMatcher){var i,key,keys=[],len=LOCAL_STORAGE.length;for(i=0;i<len;i++)(key=LOCAL_STORAGE.key(i)).match(keyMatcher)&&keys.push(key.replace(keyMatcher,""));return keys}}(),Transport=function(){"use strict";var pendingRequestsCount=0,pendingRequests={},maxPendingRequests=6,sharedCache=new LruCache(10);function Transport(o){o=o||{},this.cancelled=!1,this.lastReq=null,this._send=o.transport,this._get=o.limiter?o.limiter(this._get):this._get,this._cache=!1===o.cache?new LruCache(0):sharedCache}return Transport.setMaxPendingRequests=function setMaxPendingRequests(num){maxPendingRequests=num},Transport.resetCache=function resetCache(){sharedCache.reset()},_.mixin(Transport.prototype,{_fingerprint:function fingerprint(o){return(o=o||{}).url+o.type+$.param(o.data||{})},_get:function(o,cb){var that=this,fingerprint,jqXhr;function done(resp){cb(null,resp),that._cache.set(fingerprint,resp)}function fail(){cb(!0)}function always(){pendingRequestsCount--,delete pendingRequests[fingerprint],that.onDeckRequestArgs&&(that._get.apply(that,that.onDeckRequestArgs),that.onDeckRequestArgs=null)}fingerprint=this._fingerprint(o),this.cancelled||fingerprint!==this.lastReq||((jqXhr=pendingRequests[fingerprint])?jqXhr.done(done).fail(fail):pendingRequestsCount<maxPendingRequests?(pendingRequestsCount++,pendingRequests[fingerprint]=this._send(o).done(done).fail(fail).always(always)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(o,cb){var resp,fingerprint;cb=cb||$.noop,o=_.isString(o)?{url:o}:o||{},fingerprint=this._fingerprint(o),this.cancelled=!1,this.lastReq=fingerprint,(resp=this._cache.get(fingerprint))?cb(null,resp):this._get(o,cb)},cancel:function(){this.cancelled=!0}}),Transport}(),SearchIndex=window.SearchIndex=function(){"use strict";var CHILDREN="c",IDS="i";function SearchIndex(o){(o=o||{}).datumTokenizer&&o.queryTokenizer||$.error("datumTokenizer and queryTokenizer are both required"),this.identify=o.identify||_.stringify,this.datumTokenizer=o.datumTokenizer,this.queryTokenizer=o.queryTokenizer,this.reset()}return _.mixin(SearchIndex.prototype,{bootstrap:function bootstrap(o){this.datums=o.datums,this.trie=o.trie},add:function(data){var that=this;data=_.isArray(data)?data:[data],_.each(data,(function(datum){var id,tokens;that.datums[id=that.identify(datum)]=datum,tokens=normalizeTokens(that.datumTokenizer(datum)),_.each(tokens,(function(token){var node,chars,ch;for(node=that.trie,chars=token.split("");ch=chars.shift();)(node=node.c[ch]||(node.c[ch]=newNode())).i.push(id)}))}))},get:function get(ids){var that=this;return _.map(ids,(function(id){return that.datums[id]}))},search:function search(query){var that=this,tokens,matches;return tokens=normalizeTokens(this.queryTokenizer(query)),_.each(tokens,(function(token){var node,chars,ch,ids;if(matches&&0===matches.length)return!1;for(node=that.trie,chars=token.split("");node&&(ch=chars.shift());)node=node.c[ch];if(!node||0!==chars.length)return matches=[],!1;ids=node.i.slice(0),matches=matches?getIntersection(matches,ids):ids})),matches?_.map(unique(matches),(function(id){return that.datums[id]})):[]},all:function all(){var values=[];for(var key in this.datums)values.push(this.datums[key]);return values},reset:function reset(){this.datums={},this.trie=newNode()},serialize:function serialize(){return{datums:this.datums,trie:this.trie}}}),SearchIndex;function normalizeTokens(tokens){return tokens=_.filter(tokens,(function(token){return!!token})),tokens=_.map(tokens,(function(token){return token.toLowerCase()}))}function newNode(){var node={i:[],c:{}};return node}function unique(array){for(var seen={},uniques=[],i=0,len=array.length;i<len;i++)seen[array[i]]||(seen[array[i]]=!0,uniques.push(array[i]));return uniques}function getIntersection(arrayA,arrayB){var ai=0,bi=0,intersection=[];arrayA=arrayA.sort(),arrayB=arrayB.sort();for(var lenArrayA=arrayA.length,lenArrayB=arrayB.length;ai<lenArrayA&&bi<lenArrayB;)arrayA[ai]<arrayB[bi]?ai++:arrayA[ai]>arrayB[bi]?bi++:(intersection.push(arrayA[ai]),ai++,bi++);return intersection}}(),Prefetch=function(){"use strict";var keys;function Prefetch(o){this.url=o.url,this.ttl=o.ttl,this.cache=o.cache,this.prepare=o.prepare,this.transform=o.transform,this.transport=o.transport,this.thumbprint=o.thumbprint,this.storage=new PersistentStorage(o.cacheKey)}return keys={data:"data",protocol:"protocol",thumbprint:"thumbprint"},_.mixin(Prefetch.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},store:function store(data){this.cache&&(this.storage.set(keys.data,data,this.ttl),this.storage.set(keys.protocol,location.protocol,this.ttl),this.storage.set(keys.thumbprint,this.thumbprint,this.ttl))},fromCache:function fromCache(){var stored={},isExpired;return this.cache?(stored.data=this.storage.get(keys.data),stored.protocol=this.storage.get(keys.protocol),stored.thumbprint=this.storage.get(keys.thumbprint),isExpired=stored.thumbprint!==this.thumbprint||stored.protocol!==location.protocol,stored.data&&!isExpired?stored.data:null):null},fromNetwork:function(cb){var that=this,settings;function onError(){cb(!0)}function onResponse(resp){cb(null,that.transform(resp))}cb&&(settings=this.prepare(this._settings()),this.transport(settings).fail(onError).done(onResponse))},clear:function clear(){return this.storage.clear(),this}}),Prefetch}(),Remote=function(){"use strict";function Remote(o){this.url=o.url,this.prepare=o.prepare,this.transform=o.transform,this.transport=new Transport({cache:o.cache,limiter:o.limiter,transport:o.transport})}return _.mixin(Remote.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"}},get:function get(query,cb){var that=this,settings;if(cb)return query=query||"",settings=this.prepare(query,this._settings()),this.transport.get(settings,onResponse);function onResponse(err,resp){cb(err?[]:that.transform(resp))}},cancelLastRequest:function cancelLastRequest(){this.transport.cancel()}}),Remote}(),oParser=function(){"use strict";return function parse(o){var defaults,sorter;return defaults={initialize:!0,identify:_.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},!(o=_.mixin(defaults,o||{})).datumTokenizer&&$.error("datumTokenizer is required"),!o.queryTokenizer&&$.error("queryTokenizer is required"),sorter=o.sorter,o.sorter=sorter?function(x){return x.sort(sorter)}:_.identity,o.local=_.isFunction(o.local)?o.local():o.local,o.prefetch=parsePrefetch(o.prefetch),o.remote=parseRemote(o.remote),o};function parsePrefetch(o){var defaults;return o?(defaults={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:_.identity,transform:_.identity,transport:null},o=_.isString(o)?{url:o}:o,!(o=_.mixin(defaults,o)).url&&$.error("prefetch requires url to be set"),o.transform=o.filter||o.transform,o.cacheKey=o.cacheKey||o.url,o.thumbprint=VERSION+o.thumbprint,o.transport=o.transport?callbackToDeferred(o.transport):$.ajax,o):null}function parseRemote(o){var defaults;if(o)return defaults={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:_.identity,transport:null},o=_.isString(o)?{url:o}:o,!(o=_.mixin(defaults,o)).url&&$.error("remote requires url to be set"),o.transform=o.filter||o.transform,o.prepare=toRemotePrepare(o),o.limiter=toLimiter(o),o.transport=o.transport?callbackToDeferred(o.transport):$.ajax,delete o.replace,delete o.wildcard,delete o.rateLimitBy,delete o.rateLimitWait,o}function toRemotePrepare(o){var prepare,replace,wildcard;return prepare=o.prepare,replace=o.replace,wildcard=o.wildcard,prepare||(prepare=replace?prepareByReplace:o.wildcard?prepareByWildcard:idenityPrepare);function prepareByReplace(query,settings){return settings.url=replace(settings.url,query),settings}function prepareByWildcard(query,settings){return settings.url=settings.url.replace(wildcard,encodeURIComponent(query)),settings}function idenityPrepare(query,settings){return settings}}function toLimiter(o){var limiter,method,wait;return limiter=o.limiter,method=o.rateLimitBy,wait=o.rateLimitWait,limiter||(limiter=/^throttle$/i.test(method)?throttle(wait):debounce(wait)),limiter;function debounce(wait){return function debounce(fn){return _.debounce(fn,wait)}}function throttle(wait){return function throttle(fn){return _.throttle(fn,wait)}}}function callbackToDeferred(fn){return function wrapper(o){var deferred=$.Deferred();return fn(o,onSuccess,onError),deferred;function onSuccess(resp){_.defer((function(){deferred.resolve(resp)}))}function onError(err){_.defer((function(){deferred.reject(err)}))}}}}(),Bloodhound;return function(){"use strict";var old;function Bloodhound(o){o=oParser(o),this.sorter=o.sorter,this.identify=o.identify,this.sufficient=o.sufficient,this.local=o.local,this.remote=o.remote?new Remote(o.remote):null,this.prefetch=o.prefetch?new Prefetch(o.prefetch):null,this.index=new SearchIndex({identify:this.identify,datumTokenizer:o.datumTokenizer,queryTokenizer:o.queryTokenizer}),!1!==o.initialize&&this.initialize()}return old=window&&window.Bloodhound,Bloodhound.noConflict=function noConflict(){return window&&(window.Bloodhound=old),Bloodhound},Bloodhound.tokenizers=tokenizers,_.mixin(Bloodhound.prototype,{__ttAdapter:function ttAdapter(){var that=this;return this.remote?withAsync:withoutAsync;function withAsync(query,sync,async){return that.search(query,sync,async)}function withoutAsync(query,sync){return that.search(query,sync)}},_loadPrefetch:function loadPrefetch(){var that=this,deferred,serialized;return deferred=$.Deferred(),this.prefetch?(serialized=this.prefetch.fromCache())?(this.index.bootstrap(serialized),deferred.resolve()):this.prefetch.fromNetwork(done):deferred.resolve(),deferred.promise();function done(err,data){if(err)return deferred.reject();that.add(data),that.prefetch.store(that.index.serialize()),deferred.resolve()}},_initialize:function initialize(){var that=this,deferred;return this.clear(),(this.initPromise=this._loadPrefetch()).done(addLocalToIndex),this.initPromise;function addLocalToIndex(){that.add(that.local)}},initialize:function initialize(force){return!this.initPromise||force?this._initialize():this.initPromise},add:function add(data){return this.index.add(data),this},get:function get(ids){return ids=_.isArray(ids)?ids:[].slice.call(arguments),this.index.get(ids)},search:function search(query,sync,async){var that=this,local;return local=this.sorter(this.index.search(query)),sync(this.remote?local.slice():local),this.remote&&local.length<this.sufficient?this.remote.get(query,processRemote):this.remote&&this.remote.cancelLastRequest(),this;function processRemote(remote){var nonDuplicates=[];_.each(remote,(function(r){!_.some(local,(function(l){return that.identify(r)===that.identify(l)}))&&nonDuplicates.push(r)})),async&&async(nonDuplicates)}},all:function all(){return this.index.all()},clear:function clear(){return this.index.reset(),this},clearPrefetchCache:function clearPrefetchCache(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function clearRemoteCache(){return Transport.resetCache(),this},ttAdapter:function ttAdapter(){return this.__ttAdapter()}}),Bloodhound}()})),function(root,factory){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],(function(a0){return factory(a0)})):"object"==typeof exports?module.exports=factory(require("jquery")):factory(jQuery)}(this,(function($){var _=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(str){return!str||/^\s*$/.test(str)},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(obj){return"string"==typeof obj},isNumber:function(obj){return"number"==typeof obj},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return void 0===obj},isElement:function(obj){return!(!obj||1!==obj.nodeType)},isJQuery:function(obj){return obj instanceof $},toStr:function toStr(s){return _.isUndefined(s)||null===s?"":s+""},bind:$.proxy,each:function(collection,cb){function reverseArgs(index,value){return cb(value,index)}$.each(collection,reverseArgs)},map:$.map,filter:$.grep,every:function(obj,test){var result=!0;return obj?($.each(obj,(function(key,val){if(!(result=test.call(null,val,key,obj)))return!1})),!!result):result},some:function(obj,test){var result=!1;return obj?($.each(obj,(function(key,val){if(result=test.call(null,val,key,obj))return!1})),!!result):result},mixin:$.extend,identity:function(x){return x},clone:function(obj){return $.extend(!0,{},obj)},getIdGenerator:function(){var counter=0;return function(){return counter++}},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj)}},defer:function(fn){setTimeout(fn,0)},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;return later=function(){timeout=null,immediate||(result=func.apply(context,args))},callNow=immediate&&!timeout,clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&(result=func.apply(context,args)),result}},throttle:function(func,wait){var context,args,timeout,result,previous,later;return previous=0,later=function(){previous=new Date,timeout=null,result=func.apply(context,args)},function(){var now=new Date,remaining=wait-(now-previous);return context=this,args=arguments,remaining<=0?(clearTimeout(timeout),timeout=null,previous=now,result=func.apply(context,args)):timeout||(timeout=setTimeout(later,remaining)),result}},stringify:function(val){return _.isString(val)?val:JSON.stringify(val)},noop:function(){}}}(),WWW=function(){"use strict";var defaultClassNames={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return build;function build(o){var www,classes;return classes=_.mixin({},defaultClassNames,o),{css:(www={css:buildCss(),classes:classes,html:buildHtml(classes),selectors:buildSelectors(classes)}).css,html:www.html,classes:www.classes,selectors:www.selectors,mixin:function(o){_.mixin(o,www)}}}function buildHtml(c){return{wrapper:'<span class="'+c.wrapper+'"></span>',menu:'<div class="'+c.menu+'"></div>'}}function buildSelectors(classes){var selectors={};return _.each(classes,(function(v,k){selectors[k]="."+v})),selectors}function buildCss(){var css={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return _.isMsie()&&_.mixin(css.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),css}}(),EventBus=function(){"use strict";var namespace,deprecationMap;function EventBus(o){o&&o.el||$.error("EventBus initialized without el"),this.$el=$(o.el)}return namespace="typeahead:",deprecationMap={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},_.mixin(EventBus.prototype,{_trigger:function(type,args){var $e;return $e=$.Event(namespace+type),(args=args||[]).unshift($e),this.$el.trigger.apply(this.$el,args),$e},before:function(type){var args,$e;return args=[].slice.call(arguments,1),($e=this._trigger("before"+type,args)).isDefaultPrevented()},trigger:function(type){var deprecatedType;this._trigger(type,[].slice.call(arguments,1)),(deprecatedType=deprecationMap[type])&&this._trigger(deprecatedType,[].slice.call(arguments,1))}}),EventBus}(),EventEmitter=function(){"use strict";var splitter=/\s+/,nextTick=getNextTick();return{onSync:onSync,onAsync:onAsync,off:off,trigger:trigger};function on(method,types,cb,context){var type;if(!cb)return this;for(types=types.split(splitter),cb=context?bindContext(cb,context):cb,this._callbacks=this._callbacks||{};type=types.shift();)this._callbacks[type]=this._callbacks[type]||{sync:[],async:[]},this._callbacks[type][method].push(cb);return this}function onAsync(types,cb,context){return on.call(this,"async",types,cb,context)}function onSync(types,cb,context){return on.call(this,"sync",types,cb,context)}function off(types){var type;if(!this._callbacks)return this;for(types=types.split(splitter);type=types.shift();)delete this._callbacks[type];return this}function trigger(types){var type,callbacks,args,syncFlush,asyncFlush;if(!this._callbacks)return this;for(types=types.split(splitter),args=[].slice.call(arguments,1);(type=types.shift())&&(callbacks=this._callbacks[type]);)syncFlush=getFlush(callbacks.sync,this,[type].concat(args)),asyncFlush=getFlush(callbacks.async,this,[type].concat(args)),syncFlush()&&nextTick(asyncFlush);return this}function getFlush(callbacks,context,args){return flush;function flush(){for(var cancelled,i=0,len=callbacks.length;!cancelled&&i<len;i+=1)cancelled=!1===callbacks[i].apply(context,args);return!cancelled}}function getNextTick(){var nextTickFn;return nextTickFn=window.setImmediate?function nextTickSetImmediate(fn){setImmediate((function(){fn()}))}:function nextTickSetTimeout(fn){setTimeout((function(){fn()}),0)}}function bindContext(fn,context){return fn.bind?fn.bind(context):function(){fn.apply(context,[].slice.call(arguments,0))}}}(),highlight=function(doc){"use strict";var defaults={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function hightlight(o){var regex;function hightlightTextNode(textNode){var match,patternNode,wrapperNode;return(match=regex.exec(textNode.data))&&(wrapperNode=doc.createElement(o.tagName),o.className&&(wrapperNode.className=o.className),(patternNode=textNode.splitText(match.index)).splitText(match[0].length),wrapperNode.appendChild(patternNode.cloneNode(!0)),textNode.parentNode.replaceChild(wrapperNode,patternNode)),!!match}function traverse(el,hightlightTextNode){for(var childNode,TEXT_NODE_TYPE=3,i=0;i<el.childNodes.length;i++)3===(childNode=el.childNodes[i]).nodeType?i+=hightlightTextNode(childNode)?1:0:traverse(childNode,hightlightTextNode)}(o=_.mixin({},defaults,o)).node&&o.pattern&&(o.pattern=_.isArray(o.pattern)?o.pattern:[o.pattern],regex=getRegex(o.pattern,o.caseSensitive,o.wordsOnly),traverse(o.node,hightlightTextNode))};function getRegex(patterns,caseSensitive,wordsOnly){for(var escapedPatterns=[],regexStr,i=0,len=patterns.length;i<len;i++)escapedPatterns.push(_.escapeRegExChars(patterns[i]));return regexStr=wordsOnly?"\\b("+escapedPatterns.join("|")+")\\b":"("+escapedPatterns.join("|")+")",caseSensitive?new RegExp(regexStr):new RegExp(regexStr,"i")}}(window.document),Input=function(){"use strict";var specialKeyCodeMap;function Input(o,www){(o=o||{}).input||$.error("input is missing"),www.mixin(this),this.$hint=$(o.hint),this.$input=$(o.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=buildOverflowHelper(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=_.noop)}return specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},Input.normalizeQuery=function(str){return _.toStr(str).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},_.mixin(Input.prototype,EventEmitter,{_onBlur:function onBlur(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function onFocus(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function onKeydown($e){var keyName=specialKeyCodeMap[$e.which||$e.keyCode];this._managePreventDefault(keyName,$e),keyName&&this._shouldTrigger(keyName,$e)&&this.trigger(keyName+"Keyed",$e)},_onInput:function onInput(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function managePreventDefault(keyName,$e){var preventDefault;switch(keyName){case"up":case"down":preventDefault=!withModifier($e);break;default:preventDefault=!1}preventDefault&&$e.preventDefault()},_shouldTrigger:function shouldTrigger(keyName,$e){var trigger;switch(keyName){case"tab":trigger=!withModifier($e);break;default:trigger=!0}return trigger},_checkLanguageDirection:function checkLanguageDirection(){var dir=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==dir&&(this.dir=dir,this.$hint.attr("dir",dir),this.trigger("langDirChanged",dir))},_setQuery:function setQuery(val,silent){var areEquivalent,hasDifferentWhitespace;hasDifferentWhitespace=!!(areEquivalent=areQueriesEquivalent(val,this.query))&&this.query.length!==val.length,this.query=val,silent||areEquivalent?!silent&&hasDifferentWhitespace&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var that=this,onBlur,onFocus,onKeydown,onInput;return onBlur=_.bind(this._onBlur,this),onFocus=_.bind(this._onFocus,this),onKeydown=_.bind(this._onKeydown,this),onInput=_.bind(this._onInput,this),this.$input.on("blur.tt",onBlur).on("focus.tt",onFocus).on("keydown.tt",onKeydown),!_.isMsie()||_.isMsie()>9?this.$input.on("input.tt",onInput):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",(function($e){specialKeyCodeMap[$e.which||$e.keyCode]||_.defer(_.bind(that._onInput,that,$e))})),this},focus:function focus(){this.$input.focus()},blur:function blur(){this.$input.blur()},getLangDir:function getLangDir(){return this.dir},getQuery:function getQuery(){return this.query||""},setQuery:function setQuery(val,silent){this.setInputValue(val),this._setQuery(val,silent)},hasQueryChangedSinceLastFocus:function hasQueryChangedSinceLastFocus(){return this.query!==this.queryWhenFocused},getInputValue:function getInputValue(){return this.$input.val()},setInputValue:function setInputValue(value){this.$input.val(value),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function resetInputValue(){this.setInputValue(this.query)},getHint:function getHint(){return this.$hint.val()},setHint:function setHint(value){this.$hint.val(value)},clearHint:function clearHint(){this.setHint("")},clearHintIfInvalid:function clearHintIfInvalid(){var val,hint,valIsPrefixOfHint,isValid;valIsPrefixOfHint=(val=this.getInputValue())!==(hint=this.getHint())&&0===hint.indexOf(val),!(isValid=""!==val&&valIsPrefixOfHint&&!this.hasOverflow())&&this.clearHint()},hasFocus:function hasFocus(){return this.$input.is(":focus")},hasOverflow:function hasOverflow(){var constraint=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=constraint},isCursorAtEnd:function(){var valueLength,selectionStart,range;return valueLength=this.$input.val().length,selectionStart=this.$input[0].selectionStart,_.isNumber(selectionStart)?selectionStart===valueLength:!document.selection||((range=document.selection.createRange()).moveStart("character",-valueLength),valueLength===range.text.length)},destroy:function destroy(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=$("<div>")}}),Input;function buildOverflowHelper($input){return $('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:$input.css("font-family"),fontSize:$input.css("font-size"),fontStyle:$input.css("font-style"),fontVariant:$input.css("font-variant"),fontWeight:$input.css("font-weight"),wordSpacing:$input.css("word-spacing"),letterSpacing:$input.css("letter-spacing"),textIndent:$input.css("text-indent"),textRendering:$input.css("text-rendering"),textTransform:$input.css("text-transform")}).insertAfter($input)}function areQueriesEquivalent(a,b){return Input.normalizeQuery(a)===Input.normalizeQuery(b)}function withModifier($e){return $e.altKey||$e.ctrlKey||$e.metaKey||$e.shiftKey}}(),Dataset=function(){"use strict";var keys,nameGenerator;function Dataset(o,www){(o=o||{}).templates=o.templates||{},o.templates.notFound=o.templates.notFound||o.templates.empty,o.source||$.error("missing source"),o.node||$.error("missing node"),o.name&&!isValidName(o.name)&&$.error("invalid dataset name: "+o.name),www.mixin(this),this.highlight=!!o.highlight,this.name=o.name||nameGenerator(),this.limit=o.limit||5,this.displayFn=getDisplayFn(o.display||o.displayKey),this.templates=getTemplates(o.templates,this.displayFn),this.source=o.source.__ttAdapter?o.source.__ttAdapter():o.source,this.async=_.isUndefined(o.async)?this.source.length>2:!!o.async,this._resetLastSuggestion(),this.$el=$(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return keys={val:"tt-selectable-display",obj:"tt-selectable-object"},nameGenerator=_.getIdGenerator(),Dataset.extractData=function extractData(el){var $el=$(el);return $el.data(keys.obj)?{val:$el.data(keys.val)||"",obj:$el.data(keys.obj)||null}:null},_.mixin(Dataset.prototype,EventEmitter,{_overwrite:function overwrite(query,suggestions){(suggestions=suggestions||[]).length?this._renderSuggestions(query,suggestions):this.async&&this.templates.pending?this._renderPending(query):!this.async&&this.templates.notFound?this._renderNotFound(query):this._empty(),this.trigger("rendered",this.name,suggestions,!1)},_append:function append(query,suggestions){(suggestions=suggestions||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(query,suggestions):suggestions.length?this._renderSuggestions(query,suggestions):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(query),this.trigger("rendered",this.name,suggestions,!0)},_renderSuggestions:function renderSuggestions(query,suggestions){var $fragment;$fragment=this._getSuggestionsFragment(query,suggestions),this.$lastSuggestion=$fragment.children().last(),this.$el.html($fragment).prepend(this._getHeader(query,suggestions)).append(this._getFooter(query,suggestions))},_appendSuggestions:function appendSuggestions(query,suggestions){var $fragment,$lastSuggestion;$lastSuggestion=($fragment=this._getSuggestionsFragment(query,suggestions)).children().last(),this.$lastSuggestion.after($fragment),this.$lastSuggestion=$lastSuggestion},_renderPending:function renderPending(query){var template=this.templates.pending;this._resetLastSuggestion(),template&&this.$el.html(template({query:query,dataset:this.name}))},_renderNotFound:function renderNotFound(query){var template=this.templates.notFound;this._resetLastSuggestion(),template&&this.$el.html(template({query:query,dataset:this.name}))},_empty:function empty(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function getSuggestionsFragment(query,suggestions){var that=this,fragment;return fragment=document.createDocumentFragment(),_.each(suggestions,(function getSuggestionNode(suggestion){var $el,context;context=that._injectQuery(query,suggestion),$el=$(that.templates.suggestion(context)).data(keys.obj,suggestion).data(keys.val,that.displayFn(suggestion)).addClass(that.classes.suggestion+" "+that.classes.selectable),fragment.appendChild($el[0])})),this.highlight&&highlight({className:this.classes.highlight,node:fragment,pattern:query}),$(fragment)},_getFooter:function getFooter(query,suggestions){return this.templates.footer?this.templates.footer({query:query,suggestions:suggestions,dataset:this.name}):null},_getHeader:function getHeader(query,suggestions){return this.templates.header?this.templates.header({query:query,suggestions:suggestions,dataset:this.name}):null},_resetLastSuggestion:function resetLastSuggestion(){this.$lastSuggestion=$()},_injectQuery:function injectQuery(query,obj){return _.isObject(obj)?_.mixin({_query:query},obj):obj},update:function update(query){var that=this,canceled=!1,syncCalled=!1,rendered=0;function sync(suggestions){syncCalled||(syncCalled=!0,suggestions=(suggestions||[]).slice(0,that.limit),rendered=suggestions.length,that._overwrite(query,suggestions),rendered<that.limit&&that.async&&that.trigger("asyncRequested",query))}function async(suggestions){suggestions=suggestions||[],!canceled&&rendered<that.limit&&(that.cancel=$.noop,rendered+=suggestions.length,that._append(query,suggestions.slice(0,that.limit-rendered)),that.async&&that.trigger("asyncReceived",query))}this.cancel(),this.cancel=function cancel(){canceled=!0,that.cancel=$.noop,that.async&&that.trigger("asyncCanceled",query)},this.source(query,sync,async),!syncCalled&&sync([])},cancel:$.noop,clear:function clear(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function isEmpty(){return this.$el.is(":empty")},destroy:function destroy(){this.$el=$("<div>")}}),Dataset;function getDisplayFn(display){return display=display||_.stringify,_.isFunction(display)?display:displayFn;function displayFn(obj){return obj[display]}}function getTemplates(templates,displayFn){return{notFound:templates.notFound&&_.templatify(templates.notFound),pending:templates.pending&&_.templatify(templates.pending),header:templates.header&&_.templatify(templates.header),footer:templates.footer&&_.templatify(templates.footer),suggestion:templates.suggestion||suggestionTemplate};function suggestionTemplate(context){return $("<div>").text(displayFn(context))}}function isValidName(str){return/^[_a-zA-Z0-9-]+$/.test(str)}}(),Menu=function(){"use strict";function Menu(o,www){var that=this;function initializeDataset(oDataset){var node=that.$node.find(oDataset.node).first();return oDataset.node=node.length?node:$("<div>").appendTo(that.$node),new Dataset(oDataset,www)}(o=o||{}).node||$.error("node is required"),www.mixin(this),this.$node=$(o.node),this.query=null,this.datasets=_.map(o.datasets,initializeDataset)}return _.mixin(Menu.prototype,EventEmitter,{_onSelectableClick:function onSelectableClick($e){this.trigger("selectableClicked",$($e.currentTarget))},_onRendered:function onRendered(type,dataset,suggestions,async){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",dataset,suggestions,async)},_onCleared:function onCleared(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function propagate(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function allDatasetsEmpty(){return _.every(this.datasets,isDatasetEmpty);function isDatasetEmpty(dataset){return dataset.isEmpty()}},_getSelectables:function getSelectables(){return this.$node.find(this.selectors.selectable)},_removeCursor:function _removeCursor(){var $selectable=this.getActiveSelectable();$selectable&&$selectable.removeClass(this.classes.cursor)},_ensureVisible:function ensureVisible($el){var elTop,elBottom,nodeScrollTop,nodeHeight;elBottom=(elTop=$el.position().top)+$el.outerHeight(!0),nodeScrollTop=this.$node.scrollTop(),nodeHeight=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),elTop<0?this.$node.scrollTop(nodeScrollTop+elTop):nodeHeight<elBottom&&this.$node.scrollTop(nodeScrollTop+(elBottom-nodeHeight))},bind:function(){var that=this,onSelectableClick;return onSelectableClick=_.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,onSelectableClick),_.each(this.datasets,(function(dataset){dataset.onSync("asyncRequested",that._propagate,that).onSync("asyncCanceled",that._propagate,that).onSync("asyncReceived",that._propagate,that).onSync("rendered",that._onRendered,that).onSync("cleared",that._onCleared,that)})),this},isOpen:function isOpen(){return this.$node.hasClass(this.classes.open)},open:function open(){this.$node.addClass(this.classes.open)},close:function close(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function setLanguageDirection(dir){this.$node.attr("dir",dir)},selectableRelativeToCursor:function selectableRelativeToCursor(delta){var $selectables,$oldCursor,oldIndex,newIndex;return $oldCursor=this.getActiveSelectable(),$selectables=this._getSelectables(),-1===(newIndex=(newIndex=((newIndex=(oldIndex=$oldCursor?$selectables.index($oldCursor):-1)+delta)+1)%($selectables.length+1)-1)<-1?$selectables.length-1:newIndex)?null:$selectables.eq(newIndex)},setCursor:function setCursor($selectable){this._removeCursor(),($selectable=$selectable&&$selectable.first())&&($selectable.addClass(this.classes.cursor),this._ensureVisible($selectable))},getSelectableData:function getSelectableData($el){return $el&&$el.length?Dataset.extractData($el):null},getActiveSelectable:function getActiveSelectable(){var $selectable=this._getSelectables().filter(this.selectors.cursor).first();return $selectable.length?$selectable:null},getTopSelectable:function getTopSelectable(){var $selectable=this._getSelectables().first();return $selectable.length?$selectable:null},update:function update(query){var isValidUpdate=query!==this.query;return isValidUpdate&&(this.query=query,_.each(this.datasets,updateDataset)),isValidUpdate;function updateDataset(dataset){dataset.update(query)}},empty:function empty(){function clearDataset(dataset){dataset.clear()}_.each(this.datasets,clearDataset),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function destroy(){function destroyDataset(dataset){dataset.destroy()}this.$node.off(".tt"),this.$node=$("<div>"),_.each(this.datasets,destroyDataset)}}),Menu}(),DefaultMenu=function(){"use strict";var s=Menu.prototype;function DefaultMenu(){Menu.apply(this,[].slice.call(arguments,0))}return _.mixin(DefaultMenu.prototype,Menu.prototype,{open:function open(){return!this._allDatasetsEmpty()&&this._show(),s.open.apply(this,[].slice.call(arguments,0))},close:function close(){return this._hide(),s.close.apply(this,[].slice.call(arguments,0))},_onRendered:function onRendered(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),s._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function onCleared(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),s._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function setLanguageDirection(dir){return this.$node.css("ltr"===dir?this.css.ltr:this.css.rtl),s.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function hide(){this.$node.hide()},_show:function show(){this.$node.css("display","block")}}),DefaultMenu}(),Typeahead=function(){"use strict";function Typeahead(o,www){var onFocused,onBlurred,onEnterKeyed,onTabKeyed,onEscKeyed,onUpKeyed,onDownKeyed,onLeftKeyed,onRightKeyed,onQueryChanged,onWhitespaceChanged;(o=o||{}).input||$.error("missing input"),o.menu||$.error("missing menu"),o.eventBus||$.error("missing event bus"),www.mixin(this),this.eventBus=o.eventBus,this.minLength=_.isNumber(o.minLength)?o.minLength:1,this.input=o.input,this.menu=o.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),onFocused=c(this,"activate","open","_onFocused"),onBlurred=c(this,"deactivate","_onBlurred"),onEnterKeyed=c(this,"isActive","isOpen","_onEnterKeyed"),onTabKeyed=c(this,"isActive","isOpen","_onTabKeyed"),onEscKeyed=c(this,"isActive","_onEscKeyed"),onUpKeyed=c(this,"isActive","open","_onUpKeyed"),onDownKeyed=c(this,"isActive","open","_onDownKeyed"),onLeftKeyed=c(this,"isActive","isOpen","_onLeftKeyed"),onRightKeyed=c(this,"isActive","isOpen","_onRightKeyed"),onQueryChanged=c(this,"_openIfActive","_onQueryChanged"),onWhitespaceChanged=c(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",onFocused,this).onSync("blurred",onBlurred,this).onSync("enterKeyed",onEnterKeyed,this).onSync("tabKeyed",onTabKeyed,this).onSync("escKeyed",onEscKeyed,this).onSync("upKeyed",onUpKeyed,this).onSync("downKeyed",onDownKeyed,this).onSync("leftKeyed",onLeftKeyed,this).onSync("rightKeyed",onRightKeyed,this).onSync("queryChanged",onQueryChanged,this).onSync("whitespaceChanged",onWhitespaceChanged,this).onSync("langDirChanged",this._onLangDirChanged,this)}return _.mixin(Typeahead.prototype,{_hacks:function hacks(){var $input,$menu;$input=this.input.$input||$("<div>"),$menu=this.menu.$node||$("<div>"),$input.on("blur.tt",(function($e){var active,isActive,hasActive;active=document.activeElement,isActive=$menu.is(active),hasActive=$menu.has(active).length>0,_.isMsie()&&(isActive||hasActive)&&($e.preventDefault(),$e.stopImmediatePropagation(),_.defer((function(){$input.focus()})))})),$menu.on("mousedown.tt",(function($e){$e.preventDefault()}))},_onSelectableClicked:function onSelectableClicked(type,$el){this.select($el)},_onDatasetCleared:function onDatasetCleared(){this._updateHint()},_onDatasetRendered:function onDatasetRendered(type,dataset,suggestions,async){this._updateHint(),this.eventBus.trigger("render",suggestions,async,dataset)},_onAsyncRequested:function onAsyncRequested(type,dataset,query){this.eventBus.trigger("asyncrequest",query,dataset)},_onAsyncCanceled:function onAsyncCanceled(type,dataset,query){this.eventBus.trigger("asynccancel",query,dataset)},_onAsyncReceived:function onAsyncReceived(type,dataset,query){this.eventBus.trigger("asyncreceive",query,dataset)},_onFocused:function onFocused(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function onBlurred(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function onEnterKeyed(type,$e){var $selectable;($selectable=this.menu.getActiveSelectable())&&this.select($selectable)&&$e.preventDefault()},_onTabKeyed:function onTabKeyed(type,$e){var $selectable;($selectable=this.menu.getActiveSelectable())?this.select($selectable)&&$e.preventDefault():($selectable=this.menu.getTopSelectable())&&this.autocomplete($selectable)&&$e.preventDefault()},_onEscKeyed:function onEscKeyed(){this.close()},_onUpKeyed:function onUpKeyed(){this.moveCursor(-1)},_onDownKeyed:function onDownKeyed(){this.moveCursor(1)},_onLeftKeyed:function onLeftKeyed(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function onRightKeyed(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function onQueryChanged(e,query){this._minLengthMet(query)?this.menu.update(query):this.menu.empty()},_onWhitespaceChanged:function onWhitespaceChanged(){this._updateHint()},_onLangDirChanged:function onLangDirChanged(e,dir){this.dir!==dir&&(this.dir=dir,this.menu.setLanguageDirection(dir))},_openIfActive:function openIfActive(){this.isActive()&&this.open()},_minLengthMet:function minLengthMet(query){return(query=_.isString(query)?query:this.input.getQuery()||"").length>=this.minLength},_updateHint:function updateHint(){var $selectable,data,val,query,escapedQuery,frontMatchRegEx,match;$selectable=this.menu.getTopSelectable(),data=this.menu.getSelectableData($selectable),val=this.input.getInputValue(),!data||_.isBlankString(val)||this.input.hasOverflow()?this.input.clearHint():(query=Input.normalizeQuery(val),escapedQuery=_.escapeRegExChars(query),(match=(frontMatchRegEx=new RegExp("^(?:"+escapedQuery+")(.+$)","i")).exec(data.val))&&this.input.setHint(val+match[1]))},isEnabled:function isEnabled(){return this.enabled},enable:function enable(){this.enabled=!0},disable:function disable(){this.enabled=!1},isActive:function isActive(){return this.active},activate:function activate(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function deactivate(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function isOpen(){return this.menu.isOpen()},open:function open(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function close(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function setVal(val){this.input.setQuery(_.toStr(val))},getVal:function getVal(){return this.input.getQuery()},select:function select($selectable){var data=this.menu.getSelectableData($selectable);return!(!data||this.eventBus.before("select",data.obj))&&(this.input.setQuery(data.val,!0),this.eventBus.trigger("select",data.obj),this.close(),!0)},autocomplete:function autocomplete($selectable){var query,data,isValid;return query=this.input.getQuery(),!(!(isValid=(data=this.menu.getSelectableData($selectable))&&query!==data.val)||this.eventBus.before("autocomplete",data.obj))&&(this.input.setQuery(data.val),this.eventBus.trigger("autocomplete",data.obj),!0)},moveCursor:function moveCursor(delta){var query,$candidate,data,payload,cancelMove;return query=this.input.getQuery(),$candidate=this.menu.selectableRelativeToCursor(delta),payload=(data=this.menu.getSelectableData($candidate))?data.obj:null,!(cancelMove=this._minLengthMet()&&this.menu.update(query))&&!this.eventBus.before("cursorchange",payload)&&(this.menu.setCursor($candidate),data?this.input.setInputValue(data.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",payload),!0)},destroy:function destroy(){this.input.destroy(),this.menu.destroy()}}),Typeahead;function c(ctx){var methods=[].slice.call(arguments,1);return function(){var args=[].slice.call(arguments);_.each(methods,(function(method){return ctx[method].apply(ctx,args)}))}}}();!function(){"use strict";var old,keys,methods;function ttEach($els,fn){$els.each((function(){var $input=$(this),typeahead;(typeahead=$input.data(keys.typeahead))&&fn(typeahead,$input)}))}function buildHintFromInput($input,www){return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function prepInput($input,www){$input.data(keys.attrs,{dir:$input.attr("dir"),autocomplete:$input.attr("autocomplete"),spellcheck:$input.attr("spellcheck"),style:$input.attr("style")}),$input.addClass(www.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!$input.attr("dir")&&$input.attr("dir","auto")}catch(e){}return $input}function getBackgroundStyles($el){return{backgroundAttachment:$el.css("background-attachment"),backgroundClip:$el.css("background-clip"),backgroundColor:$el.css("background-color"),backgroundImage:$el.css("background-image"),backgroundOrigin:$el.css("background-origin"),backgroundPosition:$el.css("background-position"),backgroundRepeat:$el.css("background-repeat"),backgroundSize:$el.css("background-size")}}function revert($input){var www,$wrapper;www=$input.data(keys.www),$wrapper=$input.parent().filter(www.selectors.wrapper),_.each($input.data(keys.attrs),(function(val,key){_.isUndefined(val)?$input.removeAttr(key):$input.attr(key,val)})),$input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input),$wrapper.length&&($input.detach().insertAfter($wrapper),$wrapper.remove())}function $elOrNull(obj){var isValid,$el;return($el=(isValid=_.isJQuery(obj)||_.isElement(obj))?$(obj).first():[]).length?$el:null}old=$.fn.typeahead,keys={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},methods={initialize:function initialize(o,datasets){var www;return datasets=_.isArray(datasets)?datasets:[].slice.call(arguments,1),www=WWW((o=o||{}).classNames),this.each(attach);function attach(){var $input,$wrapper,$hint,$menu,defaultHint,defaultMenu,eventBus,input,menu,typeahead,MenuConstructor;_.each(datasets,(function(d){d.highlight=!!o.highlight})),$input=$(this),$wrapper=$(www.html.wrapper),$hint=$elOrNull(o.hint),$menu=$elOrNull(o.menu),defaultHint=!1!==o.hint&&!$hint,defaultMenu=!1!==o.menu&&!$menu,defaultHint&&($hint=buildHintFromInput($input,www)),defaultMenu&&($menu=$(www.html.menu).css(www.css.menu)),$hint&&$hint.val(""),$input=prepInput($input,www),(defaultHint||defaultMenu)&&($wrapper.css(www.css.wrapper),$input.css(defaultHint?www.css.input:www.css.inputWithNoHint),$input.wrap($wrapper).parent().prepend(defaultHint?$hint:null).append(defaultMenu?$menu:null)),MenuConstructor=defaultMenu?DefaultMenu:Menu,eventBus=new EventBus({el:$input}),input=new Input({hint:$hint,input:$input},www),menu=new MenuConstructor({node:$menu,datasets:datasets},www),typeahead=new Typeahead({input:input,menu:menu,eventBus:eventBus,minLength:o.minLength},www),$input.data(keys.www,www),$input.data(keys.typeahead,typeahead)}},isEnabled:function isEnabled(){var enabled;return ttEach(this.first(),(function(t){enabled=t.isEnabled()})),enabled},enable:function enable(){return ttEach(this,(function(t){t.enable()})),this},disable:function disable(){return ttEach(this,(function(t){t.disable()})),this},isActive:function isActive(){var active;return ttEach(this.first(),(function(t){active=t.isActive()})),active},activate:function activate(){return ttEach(this,(function(t){t.activate()})),this},deactivate:function deactivate(){return ttEach(this,(function(t){t.deactivate()})),this},isOpen:function isOpen(){var open;return ttEach(this.first(),(function(t){open=t.isOpen()})),open},open:function open(){return ttEach(this,(function(t){t.open()})),this},close:function close(){return ttEach(this,(function(t){t.close()})),this},select:function select(el){var success=!1,$el=$(el);return ttEach(this.first(),(function(t){success=t.select($el)})),success},autocomplete:function autocomplete(el){var success=!1,$el=$(el);return ttEach(this.first(),(function(t){success=t.autocomplete($el)})),success},moveCursor:function moveCursoe(delta){var success=!1;return ttEach(this.first(),(function(t){success=t.moveCursor(delta)})),success},val:function val(newVal){var query;return arguments.length?(ttEach(this,(function(t){t.setVal(newVal)})),this):(ttEach(this.first(),(function(t){query=t.getVal()})),query)},destroy:function destroy(){return ttEach(this,(function(typeahead,$input){revert($input),typeahead.destroy()})),this}},$.fn.typeahead=function(method){return methods[method]?methods[method].apply(this,[].slice.call(arguments,1)):methods.initialize.apply(this,arguments)},$.fn.typeahead.noConflict=function noConflict(){return $.fn.typeahead=old,this}}()})),
|
||
/**!
|
||
|
||
@license
|
||
handlebars v4.1.0
|
||
|
||
Copyright (C) 2011-2017 by Yehuda Katz
|
||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
of this software and associated documentation files (the "Software"), to deal
|
||
in the Software without restriction, including without limitation the rights
|
||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
copies of the Software, and to permit persons to whom the Software is
|
||
furnished to do so, subject to the following conditions:
|
||
|
||
The above copyright notice and this permission notice shall be included in
|
||
all copies or substantial portions of the Software.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||
THE SOFTWARE.
|
||
|
||
*/
|
||
function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.Handlebars=factory():root.Handlebars=factory()}(this,(function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0;var _handlebarsRuntime,_handlebarsRuntime2=_interopRequireDefault(__webpack_require__(2)),_handlebarsCompilerAst,_handlebarsCompilerAst2=_interopRequireDefault(__webpack_require__(35)),_handlebarsCompilerBase=__webpack_require__(36),_handlebarsCompilerCompiler=__webpack_require__(41),_handlebarsCompilerJavascriptCompiler,_handlebarsCompilerJavascriptCompiler2=_interopRequireDefault(__webpack_require__(42)),_handlebarsCompilerVisitor,_handlebarsCompilerVisitor2=_interopRequireDefault(__webpack_require__(39)),_handlebarsNoConflict,_handlebarsNoConflict2=_interopRequireDefault(__webpack_require__(34)),_create=_handlebarsRuntime2.default.create;function create(){var hb=_create();return hb.compile=function(input,options){return _handlebarsCompilerCompiler.compile(input,options,hb)},hb.precompile=function(input,options){return _handlebarsCompilerCompiler.precompile(input,options,hb)},hb.AST=_handlebarsCompilerAst2.default,hb.Compiler=_handlebarsCompilerCompiler.Compiler,hb.JavaScriptCompiler=_handlebarsCompilerJavascriptCompiler2.default,hb.Parser=_handlebarsCompilerBase.parser,hb.parse=_handlebarsCompilerBase.parse,hb}var inst=create();inst.create=create,_handlebarsNoConflict2.default(inst),inst.Visitor=_handlebarsCompilerVisitor2.default,inst.default=inst,exports.default=inst,module.exports=exports.default},function(module,exports){"use strict";exports.default=function(obj){return obj&&obj.__esModule?obj:{default:obj}},exports.__esModule=!0},function(module,exports,__webpack_require__){"use strict";var _interopRequireWildcard=__webpack_require__(3).default,_interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0;var _handlebarsBase,base=_interopRequireWildcard(__webpack_require__(4)),_handlebarsSafeString,_handlebarsSafeString2=_interopRequireDefault(__webpack_require__(21)),_handlebarsException,_handlebarsException2=_interopRequireDefault(__webpack_require__(6)),_handlebarsUtils,Utils=_interopRequireWildcard(__webpack_require__(5)),_handlebarsRuntime,runtime=_interopRequireWildcard(__webpack_require__(22)),_handlebarsNoConflict,_handlebarsNoConflict2=_interopRequireDefault(__webpack_require__(34));function create(){var hb=new base.HandlebarsEnvironment;return Utils.extend(hb,base),hb.SafeString=_handlebarsSafeString2.default,hb.Exception=_handlebarsException2.default,hb.Utils=Utils,hb.escapeExpression=Utils.escapeExpression,hb.VM=runtime,hb.template=function(spec){return runtime.template(spec,hb)},hb}var inst=create();inst.create=create,_handlebarsNoConflict2.default(inst),inst.default=inst,exports.default=inst,module.exports=exports.default},function(module,exports){"use strict";exports.default=function(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj},exports.__esModule=!0},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0,exports.HandlebarsEnvironment=HandlebarsEnvironment;var _utils=__webpack_require__(5),_exception,_exception2=_interopRequireDefault(__webpack_require__(6)),_helpers=__webpack_require__(10),_decorators=__webpack_require__(18),_logger,_logger2=_interopRequireDefault(__webpack_require__(20)),VERSION="4.1.0";exports.VERSION="4.1.0";var COMPILER_REVISION=7;exports.COMPILER_REVISION=7;var REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};exports.REVISION_CHANGES=REVISION_CHANGES;var objectType="[object Object]";function HandlebarsEnvironment(helpers,partials,decorators){this.helpers=helpers||{},this.partials=partials||{},this.decorators=decorators||{},_helpers.registerDefaultHelpers(this),_decorators.registerDefaultDecorators(this)}HandlebarsEnvironment.prototype={constructor:HandlebarsEnvironment,logger:_logger2.default,log:_logger2.default.log,registerHelper:function registerHelper(name,fn){if(_utils.toString.call(name)===objectType){if(fn)throw new _exception2.default("Arg not supported with multiple helpers");_utils.extend(this.helpers,name)}else this.helpers[name]=fn},unregisterHelper:function unregisterHelper(name){delete this.helpers[name]},registerPartial:function registerPartial(name,partial){if(_utils.toString.call(name)===objectType)_utils.extend(this.partials,name);else{if(void 0===partial)throw new _exception2.default('Attempting to register a partial called "'+name+'" as undefined');this.partials[name]=partial}},unregisterPartial:function unregisterPartial(name){delete this.partials[name]},registerDecorator:function registerDecorator(name,fn){if(_utils.toString.call(name)===objectType){if(fn)throw new _exception2.default("Arg not supported with multiple decorators");_utils.extend(this.decorators,name)}else this.decorators[name]=fn},unregisterDecorator:function unregisterDecorator(name){delete this.decorators[name]}};var log=_logger2.default.log;exports.log=log,exports.createFrame=_utils.createFrame,exports.logger=_logger2.default},function(module,exports){"use strict";exports.__esModule=!0,exports.extend=extend,exports.indexOf=indexOf,exports.escapeExpression=escapeExpression,exports.isEmpty=isEmpty,exports.createFrame=createFrame,exports.blockParams=blockParams,exports.appendContextPath=appendContextPath;var escape={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},badChars=/[&<>"'`=]/g,possible=/[&<>"'`=]/;function escapeChar(chr){return escape[chr]}function extend(obj){for(var i=1;i<arguments.length;i++)for(var key in arguments[i])Object.prototype.hasOwnProperty.call(arguments[i],key)&&(obj[key]=arguments[i][key]);return obj}var toString=Object.prototype.toString;exports.toString=toString;var isFunction=function isFunction(value){return"function"==typeof value};isFunction(/x/)&&(exports.isFunction=isFunction=function(value){return"function"==typeof value&&"[object Function]"===toString.call(value)}),exports.isFunction=isFunction;var isArray=Array.isArray||function(value){return!(!value||"object"!=typeof value)&&"[object Array]"===toString.call(value)};function indexOf(array,value){for(var i=0,len=array.length;i<len;i++)if(array[i]===value)return i;return-1}function escapeExpression(string){if("string"!=typeof string){if(string&&string.toHTML)return string.toHTML();if(null==string)return"";if(!string)return string+"";string=""+string}return possible.test(string)?string.replace(badChars,escapeChar):string}function isEmpty(value){return!value&&0!==value||!(!isArray(value)||0!==value.length)}function createFrame(object){var frame=extend({},object);return frame._parent=object,frame}function blockParams(params,ids){return params.path=ids,params}function appendContextPath(contextPath,id){return(contextPath?contextPath+".":"")+id}exports.isArray=isArray},function(module,exports,__webpack_require__){"use strict";var _Object$defineProperty=__webpack_require__(7).default;exports.__esModule=!0;var errorProps=["description","fileName","lineNumber","message","name","number","stack"];function Exception(message,node){var loc=node&&node.loc,line=void 0,column=void 0;loc&&(message+=" - "+(line=loc.start.line)+":"+(column=loc.start.column));for(var tmp=Error.prototype.constructor.call(this,message),idx=0;idx<errorProps.length;idx++)this[errorProps[idx]]=tmp[errorProps[idx]];Error.captureStackTrace&&Error.captureStackTrace(this,Exception);try{loc&&(this.lineNumber=line,_Object$defineProperty?Object.defineProperty(this,"column",{value:column,enumerable:!0}):this.column=column)}catch(nop){}}Exception.prototype=new Error,exports.default=Exception,module.exports=exports.default},function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(8),__esModule:!0}},function(module,exports,__webpack_require__){var $=__webpack_require__(9);module.exports=function defineProperty(it,key,desc){return $.setDesc(it,key,desc)}},function(module,exports){var $Object=Object;module.exports={create:$Object.create,getProto:$Object.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:$Object.getOwnPropertyDescriptor,setDesc:$Object.defineProperty,setDescs:$Object.defineProperties,getKeys:$Object.keys,getNames:$Object.getOwnPropertyNames,getSymbols:$Object.getOwnPropertySymbols,each:[].forEach}},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0,exports.registerDefaultHelpers=registerDefaultHelpers;var _helpersBlockHelperMissing,_helpersBlockHelperMissing2=_interopRequireDefault(__webpack_require__(11)),_helpersEach,_helpersEach2=_interopRequireDefault(__webpack_require__(12)),_helpersHelperMissing,_helpersHelperMissing2=_interopRequireDefault(__webpack_require__(13)),_helpersIf,_helpersIf2=_interopRequireDefault(__webpack_require__(14)),_helpersLog,_helpersLog2=_interopRequireDefault(__webpack_require__(15)),_helpersLookup,_helpersLookup2=_interopRequireDefault(__webpack_require__(16)),_helpersWith,_helpersWith2=_interopRequireDefault(__webpack_require__(17));function registerDefaultHelpers(instance){_helpersBlockHelperMissing2.default(instance),_helpersEach2.default(instance),_helpersHelperMissing2.default(instance),_helpersIf2.default(instance),_helpersLog2.default(instance),_helpersLookup2.default(instance),_helpersWith2.default(instance)}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _utils=__webpack_require__(5);exports.default=function(instance){instance.registerHelper("blockHelperMissing",(function(context,options){var inverse=options.inverse,fn=options.fn;if(!0===context)return fn(this);if(!1===context||null==context)return inverse(this);if(_utils.isArray(context))return context.length>0?(options.ids&&(options.ids=[options.name]),instance.helpers.each(context,options)):inverse(this);if(options.data&&options.ids){var data=_utils.createFrame(options.data);data.contextPath=_utils.appendContextPath(options.data.contextPath,options.name),options={data:data}}return fn(context,options)}))},module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0;var _utils=__webpack_require__(5),_exception,_exception2=_interopRequireDefault(__webpack_require__(6));exports.default=function(instance){instance.registerHelper("each",(function(context,options){if(!options)throw new _exception2.default("Must pass iterator to #each");var fn=options.fn,inverse=options.inverse,i=0,ret="",data=void 0,contextPath=void 0;function execIteration(field,index,last){data&&(data.key=field,data.index=index,data.first=0===index,data.last=!!last,contextPath&&(data.contextPath=contextPath+field)),ret+=fn(context[field],{data:data,blockParams:_utils.blockParams([context[field],field],[contextPath+field,null])})}if(options.data&&options.ids&&(contextPath=_utils.appendContextPath(options.data.contextPath,options.ids[0])+"."),_utils.isFunction(context)&&(context=context.call(this)),options.data&&(data=_utils.createFrame(options.data)),context&&"object"==typeof context)if(_utils.isArray(context))for(var j=context.length;i<j;i++)i in context&&execIteration(i,i,i===context.length-1);else{var priorKey=void 0;for(var key in context)context.hasOwnProperty(key)&&(void 0!==priorKey&&execIteration(priorKey,i-1),priorKey=key,i++);void 0!==priorKey&&execIteration(priorKey,i-1,!0)}return 0===i&&(ret=inverse(this)),ret}))},module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0;var _exception,_exception2=_interopRequireDefault(__webpack_require__(6));exports.default=function(instance){instance.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new _exception2.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _utils=__webpack_require__(5);exports.default=function(instance){instance.registerHelper("if",(function(conditional,options){return _utils.isFunction(conditional)&&(conditional=conditional.call(this)),!options.hash.includeZero&&!conditional||_utils.isEmpty(conditional)?options.inverse(this):options.fn(this)})),instance.registerHelper("unless",(function(conditional,options){return instance.helpers.if.call(this,conditional,{fn:options.inverse,inverse:options.fn,hash:options.hash})}))},module.exports=exports.default},function(module,exports){"use strict";exports.__esModule=!0,exports.default=function(instance){instance.registerHelper("log",(function(){for(var args=[void 0],options=arguments[arguments.length-1],i=0;i<arguments.length-1;i++)args.push(arguments[i]);var level=1;null!=options.hash.level?level=options.hash.level:options.data&&null!=options.data.level&&(level=options.data.level),args[0]=level,instance.log.apply(instance,args)}))},module.exports=exports.default},function(module,exports){"use strict";exports.__esModule=!0,exports.default=function(instance){instance.registerHelper("lookup",(function(obj,field){return obj&&obj[field]}))},module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _utils=__webpack_require__(5);exports.default=function(instance){instance.registerHelper("with",(function(context,options){_utils.isFunction(context)&&(context=context.call(this));var fn=options.fn;if(_utils.isEmpty(context))return options.inverse(this);var data=options.data;return options.data&&options.ids&&((data=_utils.createFrame(options.data)).contextPath=_utils.appendContextPath(options.data.contextPath,options.ids[0])),fn(context,{data:data,blockParams:_utils.blockParams([context],[data&&data.contextPath])})}))},module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0,exports.registerDefaultDecorators=registerDefaultDecorators;var _decoratorsInline,_decoratorsInline2=_interopRequireDefault(__webpack_require__(19));function registerDefaultDecorators(instance){_decoratorsInline2.default(instance)}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _utils=__webpack_require__(5);exports.default=function(instance){instance.registerDecorator("inline",(function(fn,props,container,options){var ret=fn;return props.partials||(props.partials={},ret=function(context,options){var original=container.partials;container.partials=_utils.extend({},original,props.partials);var ret=fn(context,options);return container.partials=original,ret}),props.partials[options.args[0]]=options.fn,ret}))},module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _utils=__webpack_require__(5),logger={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function lookupLevel(level){if("string"==typeof level){var levelMap=_utils.indexOf(logger.methodMap,level.toLowerCase());level=levelMap>=0?levelMap:parseInt(level,10)}return level},log:function log(level){if(level=logger.lookupLevel(level),"undefined"!=typeof console&&logger.lookupLevel(logger.level)<=level){var method=logger.methodMap[level];console[method]||(method="log");for(var _len=arguments.length,message=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)message[_key-1]=arguments[_key];console[method].apply(console,message)}}};exports.default=logger,module.exports=exports.default},function(module,exports){"use strict";function SafeString(string){this.string=string}exports.__esModule=!0,SafeString.prototype.toString=SafeString.prototype.toHTML=function(){return""+this.string},exports.default=SafeString,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _Object$seal=__webpack_require__(23).default,_interopRequireWildcard=__webpack_require__(3).default,_interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0,exports.checkRevision=checkRevision,exports.template=template,exports.wrapProgram=wrapProgram,exports.resolvePartial=resolvePartial,exports.invokePartial=invokePartial,exports.noop=noop;var _utils,Utils=_interopRequireWildcard(__webpack_require__(5)),_exception,_exception2=_interopRequireDefault(__webpack_require__(6)),_base=__webpack_require__(4);function checkRevision(compilerInfo){var compilerRevision=compilerInfo&&compilerInfo[0]||1,currentRevision=_base.COMPILER_REVISION;if(compilerRevision!==currentRevision){if(compilerRevision<currentRevision){var runtimeVersions=_base.REVISION_CHANGES[currentRevision],compilerVersions=_base.REVISION_CHANGES[compilerRevision];throw new _exception2.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").")}throw new _exception2.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+compilerInfo[1]+").")}}function template(templateSpec,env){if(!env)throw new _exception2.default("No environment passed to template");if(!templateSpec||!templateSpec.main)throw new _exception2.default("Unknown template object: "+typeof templateSpec);function invokePartialWrapper(partial,context,options){options.hash&&(context=Utils.extend({},context,options.hash),options.ids&&(options.ids[0]=!0)),partial=env.VM.resolvePartial.call(this,partial,context,options);var result=env.VM.invokePartial.call(this,partial,context,options);if(null==result&&env.compile&&(options.partials[options.name]=env.compile(partial,templateSpec.compilerOptions,env),result=options.partials[options.name](context,options)),null!=result){if(options.indent){for(var lines=result.split("\n"),i=0,l=lines.length;i<l&&(lines[i]||i+1!==l);i++)lines[i]=options.indent+lines[i];result=lines.join("\n")}return result}throw new _exception2.default("The partial "+options.name+" could not be compiled when running in runtime-only mode")}templateSpec.main.decorator=templateSpec.main_d,env.VM.checkRevision(templateSpec.compiler);var container={strict:function strict(obj,name){if(!(name in obj))throw new _exception2.default('"'+name+'" not defined in '+obj);return obj[name]},lookup:function lookup(depths,name){for(var len=depths.length,i=0;i<len;i++)if(depths[i]&&null!=depths[i][name])return depths[i][name]},lambda:function lambda(current,context){return"function"==typeof current?current.call(context):current},escapeExpression:Utils.escapeExpression,invokePartial:invokePartialWrapper,fn:function fn(i){var ret=templateSpec[i];return ret.decorator=templateSpec[i+"_d"],ret},programs:[],program:function program(i,data,declaredBlockParams,blockParams,depths){var programWrapper=this.programs[i],fn=this.fn(i);return data||depths||blockParams||declaredBlockParams?programWrapper=wrapProgram(this,i,fn,data,declaredBlockParams,blockParams,depths):programWrapper||(programWrapper=this.programs[i]=wrapProgram(this,i,fn)),programWrapper},data:function data(value,depth){for(;value&&depth--;)value=value._parent;return value},merge:function merge(param,common){var obj=param||common;return param&&common&¶m!==common&&(obj=Utils.extend({},common,param)),obj},nullContext:_Object$seal({}),noop:env.VM.noop,compilerInfo:templateSpec.compiler};function ret(context){var options=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],data=options.data;ret._setup(options),!options.partial&&templateSpec.useData&&(data=initData(context,data));var depths=void 0,blockParams=templateSpec.useBlockParams?[]:void 0;function main(context){return""+templateSpec.main(container,context,container.helpers,container.partials,data,blockParams,depths)}return templateSpec.useDepths&&(depths=options.depths?context!=options.depths[0]?[context].concat(options.depths):options.depths:[context]),(main=executeDecorators(templateSpec.main,main,container,options.depths||[],data,blockParams))(context,options)}return ret.isTop=!0,ret._setup=function(options){options.partial?(container.helpers=options.helpers,container.partials=options.partials,container.decorators=options.decorators):(container.helpers=container.merge(options.helpers,env.helpers),templateSpec.usePartial&&(container.partials=container.merge(options.partials,env.partials)),(templateSpec.usePartial||templateSpec.useDecorators)&&(container.decorators=container.merge(options.decorators,env.decorators)))},ret._child=function(i,data,blockParams,depths){if(templateSpec.useBlockParams&&!blockParams)throw new _exception2.default("must pass block params");if(templateSpec.useDepths&&!depths)throw new _exception2.default("must pass parent depths");return wrapProgram(container,i,templateSpec[i],data,0,blockParams,depths)},ret}function wrapProgram(container,i,fn,data,declaredBlockParams,blockParams,depths){function prog(context){var options=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],currentDepths=depths;return!depths||context==depths[0]||context===container.nullContext&&null===depths[0]||(currentDepths=[context].concat(depths)),fn(container,context,container.helpers,container.partials,options.data||data,blockParams&&[options.blockParams].concat(blockParams),currentDepths)}return(prog=executeDecorators(fn,prog,container,depths,data,blockParams)).program=i,prog.depth=depths?depths.length:0,prog.blockParams=declaredBlockParams||0,prog}function resolvePartial(partial,context,options){return partial?partial.call||options.name||(options.name=partial,partial=options.partials[partial]):partial="@partial-block"===options.name?options.data["partial-block"]:options.partials[options.name],partial}function invokePartial(partial,context,options){var currentPartialBlock=options.data&&options.data["partial-block"];options.partial=!0,options.ids&&(options.data.contextPath=options.ids[0]||options.data.contextPath);var partialBlock=void 0;if(options.fn&&options.fn!==noop&&function(){options.data=_base.createFrame(options.data);var fn=options.fn;partialBlock=options.data["partial-block"]=function partialBlockWrapper(context){var options=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return options.data=_base.createFrame(options.data),options.data["partial-block"]=currentPartialBlock,fn(context,options)},fn.partials&&(options.partials=Utils.extend({},options.partials,fn.partials))}(),void 0===partial&&partialBlock&&(partial=partialBlock),void 0===partial)throw new _exception2.default("The partial "+options.name+" could not be found");if(partial instanceof Function)return partial(context,options)}function noop(){return""}function initData(context,data){return data&&"root"in data||((data=data?_base.createFrame(data):{}).root=context),data}function executeDecorators(fn,prog,container,depths,data,blockParams){if(fn.decorator){var props={};prog=fn.decorator(prog,props,container,depths&&depths[0],data,blockParams,depths),Utils.extend(prog,props)}return prog}},function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(24),__esModule:!0}},function(module,exports,__webpack_require__){__webpack_require__(25),module.exports=__webpack_require__(30).Object.seal},function(module,exports,__webpack_require__){var isObject=__webpack_require__(26);__webpack_require__(27)("seal",(function($seal){return function seal(it){return $seal&&isObject(it)?$seal(it):it}}))},function(module,exports){module.exports=function(it){return"object"==typeof it?null!==it:"function"==typeof it}},function(module,exports,__webpack_require__){var $export=__webpack_require__(28),core=__webpack_require__(30),fails=__webpack_require__(33);module.exports=function(KEY,exec){var fn=(core.Object||{})[KEY]||Object[KEY],exp={};exp[KEY]=exec(fn),$export($export.S+$export.F*fails((function(){fn(1)})),"Object",exp)}},function(module,exports,__webpack_require__){var global=__webpack_require__(29),core=__webpack_require__(30),ctx=__webpack_require__(31),PROTOTYPE="prototype",$export=function(type,name,source){var IS_FORCED=type&$export.F,IS_GLOBAL=type&$export.G,IS_STATIC=type&$export.S,IS_PROTO=type&$export.P,IS_BIND=type&$export.B,IS_WRAP=type&$export.W,exports=IS_GLOBAL?core:core[name]||(core[name]={}),target=IS_GLOBAL?global:IS_STATIC?global[name]:(global[name]||{}).prototype,key,own,out;for(key in IS_GLOBAL&&(source=name),source)(own=!IS_FORCED&&target&&key in target)&&key in exports||(out=own?target[key]:source[key],exports[key]=IS_GLOBAL&&"function"!=typeof target[key]?source[key]:IS_BIND&&own?ctx(out,global):IS_WRAP&&target[key]==out?function(C){var F=function(param){return this instanceof C?new C(param):C(param)};return F.prototype=C.prototype,F}(out):IS_PROTO&&"function"==typeof out?ctx(Function.call,out):out,IS_PROTO&&((exports.prototype||(exports.prototype={}))[key]=out))};$export.F=1,$export.G=2,$export.S=4,$export.P=8,$export.B=16,$export.W=32,module.exports=$export},function(module,exports){var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},function(module,exports){var core=module.exports={version:"1.2.6"};"number"==typeof __e&&(__e=core)},function(module,exports,__webpack_require__){var aFunction=__webpack_require__(32);module.exports=function(fn,that,length){if(aFunction(fn),void 0===that)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},function(module,exports){module.exports=function(it){if("function"!=typeof it)throw TypeError(it+" is not a function!");return it}},function(module,exports){module.exports=function(exec){try{return!!exec()}catch(e){return!0}}},function(module,exports){(function(global){"use strict";exports.__esModule=!0,exports.default=function(Handlebars){var root=void 0!==global?global:window,$Handlebars=root.Handlebars;Handlebars.noConflict=function(){return root.Handlebars===Handlebars&&(root.Handlebars=$Handlebars),Handlebars}},module.exports=exports.default}).call(exports,function(){return this}())},function(module,exports){"use strict";exports.__esModule=!0;var AST={helpers:{helperExpression:function helperExpression(node){return"SubExpression"===node.type||("MustacheStatement"===node.type||"BlockStatement"===node.type)&&!!(node.params&&node.params.length||node.hash)},scopedId:function scopedId(path){return/^\.|this\b/.test(path.original)},simpleId:function simpleId(path){return 1===path.parts.length&&!AST.helpers.scopedId(path)&&!path.depth}}};exports.default=AST,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default,_interopRequireWildcard=__webpack_require__(3).default;exports.__esModule=!0,exports.parse=parse;var _parser,_parser2=_interopRequireDefault(__webpack_require__(37)),_whitespaceControl,_whitespaceControl2=_interopRequireDefault(__webpack_require__(38)),_helpers,Helpers=_interopRequireWildcard(__webpack_require__(40)),_utils=__webpack_require__(5);exports.parser=_parser2.default;var yy={};function parse(input,options){return"Program"===input.type?input:(_parser2.default.yy=yy,yy.locInfo=function(locInfo){return new yy.SourceLocation(options&&options.srcName,locInfo)},new _whitespaceControl2.default(options).accept(_parser2.default.parse(input)));var strip}_utils.extend(yy,Helpers)},function(module,exports){"use strict";exports.__esModule=!0;var handlebars=function(){var parser={trace:function trace(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-1];case 2:this.$=yy.prepareProgram($$[$0]);break;case 3:case 4:case 5:case 6:case 7:case 8:this.$=$$[$0];break;case 9:this.$={type:"CommentStatement",value:yy.stripComment($$[$0]),strip:yy.stripFlags($$[$0],$$[$0]),loc:yy.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:$$[$0],value:$$[$0],loc:yy.locInfo(this._$)};break;case 11:this.$=yy.prepareRawBlock($$[$0-2],$$[$0-1],$$[$0],this._$);break;case 12:this.$={path:$$[$0-3],params:$$[$0-2],hash:$$[$0-1]};break;case 13:this.$=yy.prepareBlock($$[$0-3],$$[$0-2],$$[$0-1],$$[$0],!1,this._$);break;case 14:this.$=yy.prepareBlock($$[$0-3],$$[$0-2],$$[$0-1],$$[$0],!0,this._$);break;case 15:this.$={open:$$[$0-5],path:$$[$0-4],params:$$[$0-3],hash:$$[$0-2],blockParams:$$[$0-1],strip:yy.stripFlags($$[$0-5],$$[$0])};break;case 16:case 17:this.$={path:$$[$0-4],params:$$[$0-3],hash:$$[$0-2],blockParams:$$[$0-1],strip:yy.stripFlags($$[$0-5],$$[$0])};break;case 18:this.$={strip:yy.stripFlags($$[$0-1],$$[$0-1]),program:$$[$0]};break;case 19:var inverse=yy.prepareBlock($$[$0-2],$$[$0-1],$$[$0],$$[$0],!1,this._$),program=yy.prepareProgram([inverse],$$[$0-1].loc);program.chained=!0,this.$={strip:$$[$0-2].strip,program:program,chain:!0};break;case 20:this.$=$$[$0];break;case 21:this.$={path:$$[$0-1],strip:yy.stripFlags($$[$0-2],$$[$0])};break;case 22:case 23:this.$=yy.prepareMustache($$[$0-3],$$[$0-2],$$[$0-1],$$[$0-4],yy.stripFlags($$[$0-4],$$[$0]),this._$);break;case 24:this.$={type:"PartialStatement",name:$$[$0-3],params:$$[$0-2],hash:$$[$0-1],indent:"",strip:yy.stripFlags($$[$0-4],$$[$0]),loc:yy.locInfo(this._$)};break;case 25:this.$=yy.preparePartialBlock($$[$0-2],$$[$0-1],$$[$0],this._$);break;case 26:this.$={path:$$[$0-3],params:$$[$0-2],hash:$$[$0-1],strip:yy.stripFlags($$[$0-4],$$[$0])};break;case 27:case 28:this.$=$$[$0];break;case 29:this.$={type:"SubExpression",path:$$[$0-3],params:$$[$0-2],hash:$$[$0-1],loc:yy.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:$$[$0],loc:yy.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:yy.id($$[$0-2]),value:$$[$0],loc:yy.locInfo(this._$)};break;case 32:this.$=yy.id($$[$0-1]);break;case 33:case 34:this.$=$$[$0];break;case 35:this.$={type:"StringLiteral",value:$$[$0],original:$$[$0],loc:yy.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number($$[$0]),original:Number($$[$0]),loc:yy.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===$$[$0],original:"true"===$$[$0],loc:yy.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:yy.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:yy.locInfo(this._$)};break;case 40:case 41:this.$=$$[$0];break;case 42:this.$=yy.preparePath(!0,$$[$0],this._$);break;case 43:this.$=yy.preparePath(!1,$$[$0],this._$);break;case 44:$$[$0-2].push({part:yy.id($$[$0]),original:$$[$0],separator:$$[$0-1]}),this.$=$$[$0-2];break;case 45:this.$=[{part:yy.id($$[$0]),original:$$[$0]}];break;case 46:this.$=[];break;case 47:$$[$0-1].push($$[$0]);break;case 48:this.$=[$$[$0]];break;case 49:$$[$0-1].push($$[$0]);break;case 50:this.$=[];break;case 51:$$[$0-1].push($$[$0]);break;case 58:this.$=[];break;case 59:$$[$0-1].push($$[$0]);break;case 64:this.$=[];break;case 65:$$[$0-1].push($$[$0]);break;case 70:this.$=[];break;case 71:$$[$0-1].push($$[$0]);break;case 78:this.$=[];break;case 79:$$[$0-1].push($$[$0]);break;case 82:this.$=[];break;case 83:$$[$0-1].push($$[$0]);break;case 86:this.$=[];break;case 87:$$[$0-1].push($$[$0]);break;case 90:this.$=[];break;case 91:$$[$0-1].push($$[$0]);break;case 94:this.$=[];break;case 95:$$[$0-1].push($$[$0]);break;case 98:this.$=[$$[$0]];break;case 99:$$[$0-1].push($$[$0]);break;case 100:this.$=[$$[$0]];break;case 101:$$[$0-1].push($$[$0])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:45,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:48,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:42,56:49,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:50,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,51]},{72:[1,35],86:52},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:53,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:65,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:66,47:[1,67]},{30:68,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:69,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:70,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:71,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,80]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:84,47:[1,67]},{47:[2,55]},{4:85,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:86,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:87,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:88,47:[1,67]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:92,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:93,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,106]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:107,72:[1,108],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,109],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,110]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,114]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:[1,121]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:122,74:123,75:[1,121]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,124]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,125]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,109]},{20:75,63:126,64:76,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,130]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:135,74:136,75:[1,121]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,138],77:[1,137]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function parseError(str,hash){throw new Error(str)},parse:function parse(input){var self=this,stack=[0],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;this.lexer.setInput(input),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var yyloc=this.lexer.yylloc;lstack.push(yyloc);var ranges=this.lexer.options&&this.lexer.options.ranges;function popStack(n){stack.length=stack.length-2*n,vstack.length=vstack.length-n,lstack.length=lstack.length-n}function lex(){var token;return"number"!=typeof(token=self.lexer.lex()||1)&&(token=self.symbols_[token]||token),token}"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var symbol,preErrorSymbol,state,action,a,r,yyval={},p,len,newState,expected;;){if(state=stack[stack.length-1],this.defaultActions[state]?action=this.defaultActions[state]:(null==symbol&&(symbol=lex()),action=table[state]&&table[state][symbol]),void 0===action||!action.length||!action[0]){var errStr="";if(!recovering){for(p in expected=[],table[state])this.terminals_[p]&&p>2&&expected.push("'"+this.terminals_[p]+"'");errStr=this.lexer.showPosition?"Parse error on line "+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'":"Parse error on line "+(yylineno+1)+": Unexpected "+(1==symbol?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'"),this.parseError(errStr,{text:this.lexer.match,token:this.terminals_[symbol]||symbol,line:this.lexer.yylineno,loc:yyloc,expected:expected})}}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol),vstack.push(this.lexer.yytext),lstack.push(this.lexer.yylloc),stack.push(action[1]),symbol=null,preErrorSymbol?(symbol=preErrorSymbol,preErrorSymbol=null):(yyleng=this.lexer.yyleng,yytext=this.lexer.yytext,yylineno=this.lexer.yylineno,yyloc=this.lexer.yylloc,recovering>0&&recovering--);break;case 2:if(len=this.productions_[action[1]][1],yyval.$=vstack[vstack.length-len],yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column},ranges&&(yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]),void 0!==(r=this.performAction.call(yyval,yytext,yyleng,yylineno,this.yy,action[1],vstack,lstack)))return r;len&&(stack=stack.slice(0,-1*len*2),vstack=vstack.slice(0,-1*len),lstack=lstack.slice(0,-1*len)),stack.push(this.productions_[action[1]][0]),vstack.push(yyval.$),lstack.push(yyval._$),newState=table[stack[stack.length-2]][stack[stack.length-1]],stack.push(newState);break;case 3:return!0}}return!0}},lexer=function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(!this.yy.parser)throw new Error(str);this.yy.parser.parseError(str,hash)},setInput:function setInput(input){return this._input=input,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function input(){var ch=this._input[0],lines;return this.yytext+=ch,this.yyleng++,this.offset++,this.match+=ch,this.matched+=ch,ch.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ch},unput:function unput(ch){var len=ch.length,lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-len-1),this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),lines.length-1&&(this.yylineno-=lines.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-len]),this},more:function more(){return this._more=!0,this},less:function less(n){this.unput(this.match.slice(n))},pastInput:function pastInput(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function upcomingInput(){var next=this.match;return next.length<20&&(next+=this._input.substr(0,20-next.length)),(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function showPosition(){var pre=this.pastInput(),c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},next:function next(){if(this.done)return this.EOF;var token,match,tempMatch,index,col,lines;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var rules=this._currentRules(),i=0;i<rules.length&&(!(tempMatch=this._input.match(this.rules[rules[i]]))||match&&!(tempMatch[0].length>match[0].length)||(match=tempMatch,index=i,this.options.flex));i++);return match?((lines=match[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=lines.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length},this.yytext+=match[0],this.match+=match[0],this.matches=match,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(match[0].length),this.matched+=match[0],token=this.performAction.call(this,this.yy,this,rules[index],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),token||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function lex(){var r=this.next();return void 0!==r?r:this.lex()},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){return this.conditionStack.pop()},_currentRules:function _currentRules(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function topState(){return this.conditionStack[this.conditionStack.length-2]},pushState:function begin(condition){this.begin(condition)},options:{},performAction:function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){function strip(start,end){return yy_.yytext=yy_.yytext.substr(start,yy_.yyleng-end)}var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:if("\\\\"===yy_.yytext.slice(-2)?(strip(0,1),this.begin("mu")):"\\"===yy_.yytext.slice(-1)?(strip(0,1),this.begin("emu")):this.begin("mu"),yy_.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(yy_.yytext=yy_.yytext.substr(5,yy_.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(yy_.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return yy_.yytext=strip(1,2).replace(/\\"/g,'"'),80;case 32:return yy_.yytext=strip(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return yy_.yytext=yy_.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return lexer}();function Parser(){this.yy={}}return parser.lexer=lexer,Parser.prototype=parser,parser.Parser=Parser,new Parser}();exports.default=handlebars,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0;var _visitor,_visitor2=_interopRequireDefault(__webpack_require__(39));function WhitespaceControl(){var options=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=options}function isPrevWhitespace(body,i,isRoot){void 0===i&&(i=body.length);var prev=body[i-1],sibling=body[i-2];return prev?"ContentStatement"===prev.type?(sibling||!isRoot?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(prev.original):void 0:isRoot}function isNextWhitespace(body,i,isRoot){void 0===i&&(i=-1);var next=body[i+1],sibling=body[i+2];return next?"ContentStatement"===next.type?(sibling||!isRoot?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(next.original):void 0:isRoot}function omitRight(body,i,multiple){var current=body[null==i?0:i+1];if(current&&"ContentStatement"===current.type&&(multiple||!current.rightStripped)){var original=current.value;current.value=current.value.replace(multiple?/^\s+/:/^[ \t]*\r?\n?/,""),current.rightStripped=current.value!==original}}function omitLeft(body,i,multiple){var current=body[null==i?body.length-1:i-1];if(current&&"ContentStatement"===current.type&&(multiple||!current.leftStripped)){var original=current.value;return current.value=current.value.replace(multiple?/\s+$/:/[ \t]+$/,""),current.leftStripped=current.value!==original,current.leftStripped}}WhitespaceControl.prototype=new _visitor2.default,WhitespaceControl.prototype.Program=function(program){var doStandalone=!this.options.ignoreStandalone,isRoot=!this.isRootSeen;this.isRootSeen=!0;for(var body=program.body,i=0,l=body.length;i<l;i++){var current=body[i],strip=this.accept(current);if(strip){var _isPrevWhitespace=isPrevWhitespace(body,i,isRoot),_isNextWhitespace=isNextWhitespace(body,i,isRoot),openStandalone=strip.openStandalone&&_isPrevWhitespace,closeStandalone=strip.closeStandalone&&_isNextWhitespace,inlineStandalone=strip.inlineStandalone&&_isPrevWhitespace&&_isNextWhitespace;strip.close&&omitRight(body,i,!0),strip.open&&omitLeft(body,i,!0),doStandalone&&inlineStandalone&&(omitRight(body,i),omitLeft(body,i)&&"PartialStatement"===current.type&&(current.indent=/([ \t]+$)/.exec(body[i-1].original)[1])),doStandalone&&openStandalone&&(omitRight((current.program||current.inverse).body),omitLeft(body,i)),doStandalone&&closeStandalone&&(omitRight(body,i),omitLeft((current.inverse||current.program).body))}}return program},WhitespaceControl.prototype.BlockStatement=WhitespaceControl.prototype.DecoratorBlock=WhitespaceControl.prototype.PartialBlockStatement=function(block){this.accept(block.program),this.accept(block.inverse);var program=block.program||block.inverse,inverse=block.program&&block.inverse,firstInverse=inverse,lastInverse=inverse;if(inverse&&inverse.chained)for(firstInverse=inverse.body[0].program;lastInverse.chained;)lastInverse=lastInverse.body[lastInverse.body.length-1].program;var strip={open:block.openStrip.open,close:block.closeStrip.close,openStandalone:isNextWhitespace(program.body),closeStandalone:isPrevWhitespace((firstInverse||program).body)};if(block.openStrip.close&&omitRight(program.body,null,!0),inverse){var inverseStrip=block.inverseStrip;inverseStrip.open&&omitLeft(program.body,null,!0),inverseStrip.close&&omitRight(firstInverse.body,null,!0),block.closeStrip.open&&omitLeft(lastInverse.body,null,!0),!this.options.ignoreStandalone&&isPrevWhitespace(program.body)&&isNextWhitespace(firstInverse.body)&&(omitLeft(program.body),omitRight(firstInverse.body))}else block.closeStrip.open&&omitLeft(program.body,null,!0);return strip},WhitespaceControl.prototype.Decorator=WhitespaceControl.prototype.MustacheStatement=function(mustache){return mustache.strip},WhitespaceControl.prototype.PartialStatement=WhitespaceControl.prototype.CommentStatement=function(node){var strip=node.strip||{};return{inlineStandalone:!0,open:strip.open,close:strip.close}},exports.default=WhitespaceControl,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0;var _exception,_exception2=_interopRequireDefault(__webpack_require__(6));function Visitor(){this.parents=[]}function visitSubExpression(mustache){this.acceptRequired(mustache,"path"),this.acceptArray(mustache.params),this.acceptKey(mustache,"hash")}function visitBlock(block){visitSubExpression.call(this,block),this.acceptKey(block,"program"),this.acceptKey(block,"inverse")}function visitPartial(partial){this.acceptRequired(partial,"name"),this.acceptArray(partial.params),this.acceptKey(partial,"hash")}Visitor.prototype={constructor:Visitor,mutating:!1,acceptKey:function acceptKey(node,name){var value=this.accept(node[name]);if(this.mutating){if(value&&!Visitor.prototype[value.type])throw new _exception2.default('Unexpected node type "'+value.type+'" found when accepting '+name+" on "+node.type);node[name]=value}},acceptRequired:function acceptRequired(node,name){if(this.acceptKey(node,name),!node[name])throw new _exception2.default(node.type+" requires "+name)},acceptArray:function acceptArray(array){for(var i=0,l=array.length;i<l;i++)this.acceptKey(array,i),array[i]||(array.splice(i,1),i--,l--)},accept:function accept(object){if(object){if(!this[object.type])throw new _exception2.default("Unknown type: "+object.type,object);this.current&&this.parents.unshift(this.current),this.current=object;var ret=this[object.type](object);return this.current=this.parents.shift(),!this.mutating||ret?ret:!1!==ret?object:void 0}},Program:function Program(program){this.acceptArray(program.body)},MustacheStatement:visitSubExpression,Decorator:visitSubExpression,BlockStatement:visitBlock,DecoratorBlock:visitBlock,PartialStatement:visitPartial,PartialBlockStatement:function PartialBlockStatement(partial){visitPartial.call(this,partial),this.acceptKey(partial,"program")},ContentStatement:function ContentStatement(){},CommentStatement:function CommentStatement(){},SubExpression:visitSubExpression,PathExpression:function PathExpression(){},StringLiteral:function StringLiteral(){},NumberLiteral:function NumberLiteral(){},BooleanLiteral:function BooleanLiteral(){},UndefinedLiteral:function UndefinedLiteral(){},NullLiteral:function NullLiteral(){},Hash:function Hash(hash){this.acceptArray(hash.pairs)},HashPair:function HashPair(pair){this.acceptRequired(pair,"value")}},exports.default=Visitor,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0,exports.SourceLocation=SourceLocation,exports.id=id,exports.stripFlags=stripFlags,exports.stripComment=stripComment,exports.preparePath=preparePath,exports.prepareMustache=prepareMustache,exports.prepareRawBlock=prepareRawBlock,exports.prepareBlock=prepareBlock,exports.prepareProgram=prepareProgram,exports.preparePartialBlock=preparePartialBlock;var _exception,_exception2=_interopRequireDefault(__webpack_require__(6));function validateClose(open,close){if(close=close.path?close.path.original:close,open.path.original!==close){var errorNode={loc:open.path.loc};throw new _exception2.default(open.path.original+" doesn't match "+close,errorNode)}}function SourceLocation(source,locInfo){this.source=source,this.start={line:locInfo.first_line,column:locInfo.first_column},this.end={line:locInfo.last_line,column:locInfo.last_column}}function id(token){return/^\[.*\]$/.test(token)?token.substr(1,token.length-2):token}function stripFlags(open,close){return{open:"~"===open.charAt(2),close:"~"===close.charAt(close.length-3)}}function stripComment(comment){return comment.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function preparePath(data,parts,loc){loc=this.locInfo(loc);for(var original=data?"@":"",dig=[],depth=0,i=0,l=parts.length;i<l;i++){var part=parts[i].part,isLiteral=parts[i].original!==part;if(original+=(parts[i].separator||"")+part,isLiteral||".."!==part&&"."!==part&&"this"!==part)dig.push(part);else{if(dig.length>0)throw new _exception2.default("Invalid path: "+original,{loc:loc});".."===part&&depth++}}return{type:"PathExpression",data:data,depth:depth,parts:dig,original:original,loc:loc}}function prepareMustache(path,params,hash,open,strip,locInfo){var escapeFlag=open.charAt(3)||open.charAt(2),escaped="{"!==escapeFlag&&"&"!==escapeFlag,decorator;return{type:/\*/.test(open)?"Decorator":"MustacheStatement",path:path,params:params,hash:hash,escaped:escaped,strip:strip,loc:this.locInfo(locInfo)}}function prepareRawBlock(openRawBlock,contents,close,locInfo){validateClose(openRawBlock,close);var program={type:"Program",body:contents,strip:{},loc:locInfo=this.locInfo(locInfo)};return{type:"BlockStatement",path:openRawBlock.path,params:openRawBlock.params,hash:openRawBlock.hash,program:program,openStrip:{},inverseStrip:{},closeStrip:{},loc:locInfo}}function prepareBlock(openBlock,program,inverseAndProgram,close,inverted,locInfo){close&&close.path&&validateClose(openBlock,close);var decorator=/\*/.test(openBlock.open);program.blockParams=openBlock.blockParams;var inverse=void 0,inverseStrip=void 0;if(inverseAndProgram){if(decorator)throw new _exception2.default("Unexpected inverse block on decorator",inverseAndProgram);inverseAndProgram.chain&&(inverseAndProgram.program.body[0].closeStrip=close.strip),inverseStrip=inverseAndProgram.strip,inverse=inverseAndProgram.program}return inverted&&(inverted=inverse,inverse=program,program=inverted),{type:decorator?"DecoratorBlock":"BlockStatement",path:openBlock.path,params:openBlock.params,hash:openBlock.hash,program:program,inverse:inverse,openStrip:openBlock.strip,inverseStrip:inverseStrip,closeStrip:close&&close.strip,loc:this.locInfo(locInfo)}}function prepareProgram(statements,loc){if(!loc&&statements.length){var firstLoc=statements[0].loc,lastLoc=statements[statements.length-1].loc;firstLoc&&lastLoc&&(loc={source:firstLoc.source,start:{line:firstLoc.start.line,column:firstLoc.start.column},end:{line:lastLoc.end.line,column:lastLoc.end.column}})}return{type:"Program",body:statements,strip:{},loc:loc}}function preparePartialBlock(open,program,close,locInfo){return validateClose(open,close),{type:"PartialBlockStatement",name:open.path,params:open.params,hash:open.hash,program:program,openStrip:open.strip,closeStrip:close&&close.strip,loc:this.locInfo(locInfo)}}},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0,exports.Compiler=Compiler,exports.precompile=precompile,exports.compile=compile;var _exception,_exception2=_interopRequireDefault(__webpack_require__(6)),_utils=__webpack_require__(5),_ast,_ast2=_interopRequireDefault(__webpack_require__(35)),slice=[].slice;function Compiler(){}function precompile(input,options,env){if(null==input||"string"!=typeof input&&"Program"!==input.type)throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+input);"data"in(options=options||{})||(options.data=!0),options.compat&&(options.useDepths=!0);var ast=env.parse(input,options),environment=(new env.Compiler).compile(ast,options);return(new env.JavaScriptCompiler).compile(environment,options)}function compile(input,options,env){if(void 0===options&&(options={}),null==input||"string"!=typeof input&&"Program"!==input.type)throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+input);"data"in(options=_utils.extend({},options))||(options.data=!0),options.compat&&(options.useDepths=!0);var compiled=void 0;function compileInput(){var ast=env.parse(input,options),environment=(new env.Compiler).compile(ast,options),templateSpec=(new env.JavaScriptCompiler).compile(environment,options,void 0,!0);return env.template(templateSpec)}function ret(context,execOptions){return compiled||(compiled=compileInput()),compiled.call(this,context,execOptions)}return ret._setup=function(setupOptions){return compiled||(compiled=compileInput()),compiled._setup(setupOptions)},ret._child=function(i,data,blockParams,depths){return compiled||(compiled=compileInput()),compiled._child(i,data,blockParams,depths)},ret}function argEquals(a,b){if(a===b)return!0;if(_utils.isArray(a)&&_utils.isArray(b)&&a.length===b.length){for(var i=0;i<a.length;i++)if(!argEquals(a[i],b[i]))return!1;return!0}}function transformLiteralToPath(sexpr){if(!sexpr.path.parts){var literal=sexpr.path;sexpr.path={type:"PathExpression",data:!1,depth:0,parts:[literal.original+""],original:literal.original+"",loc:literal.loc}}}Compiler.prototype={compiler:Compiler,equals:function equals(other){var len=this.opcodes.length;if(other.opcodes.length!==len)return!1;for(var i=0;i<len;i++){var opcode=this.opcodes[i],otherOpcode=other.opcodes[i];if(opcode.opcode!==otherOpcode.opcode||!argEquals(opcode.args,otherOpcode.args))return!1}len=this.children.length;for(var i=0;i<len;i++)if(!this.children[i].equals(other.children[i]))return!1;return!0},guid:0,compile:function compile(program,options){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=options,this.stringParams=options.stringParams,this.trackIds=options.trackIds,options.blockParams=options.blockParams||[];var knownHelpers=options.knownHelpers;if(options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},knownHelpers)for(var _name in knownHelpers)this.options.knownHelpers[_name]=knownHelpers[_name];return this.accept(program)},compileProgram:function compileProgram(program){var childCompiler,result=(new this.compiler).compile(program,this.options),guid=this.guid++;return this.usePartial=this.usePartial||result.usePartial,this.children[guid]=result,this.useDepths=this.useDepths||result.useDepths,guid},accept:function accept(node){if(!this[node.type])throw new _exception2.default("Unknown type: "+node.type,node);this.sourceNode.unshift(node);var ret=this[node.type](node);return this.sourceNode.shift(),ret},Program:function Program(program){this.options.blockParams.unshift(program.blockParams);for(var body=program.body,bodyLength=body.length,i=0;i<bodyLength;i++)this.accept(body[i]);return this.options.blockParams.shift(),this.isSimple=1===bodyLength,this.blockParams=program.blockParams?program.blockParams.length:0,this},BlockStatement:function BlockStatement(block){transformLiteralToPath(block);var program=block.program,inverse=block.inverse;program=program&&this.compileProgram(program),inverse=inverse&&this.compileProgram(inverse);var type=this.classifySexpr(block);"helper"===type?this.helperSexpr(block,program,inverse):"simple"===type?(this.simpleSexpr(block),this.opcode("pushProgram",program),this.opcode("pushProgram",inverse),this.opcode("emptyHash"),this.opcode("blockValue",block.path.original)):(this.ambiguousSexpr(block,program,inverse),this.opcode("pushProgram",program),this.opcode("pushProgram",inverse),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function DecoratorBlock(decorator){var program=decorator.program&&this.compileProgram(decorator.program),params=this.setupFullMustacheParams(decorator,program,void 0),path=decorator.path;this.useDecorators=!0,this.opcode("registerDecorator",params.length,path.original)},PartialStatement:function PartialStatement(partial){this.usePartial=!0;var program=partial.program;program&&(program=this.compileProgram(partial.program));var params=partial.params;if(params.length>1)throw new _exception2.default("Unsupported number of partial arguments: "+params.length,partial);params.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):params.push({type:"PathExpression",parts:[],depth:0}));var partialName=partial.name.original,isDynamic="SubExpression"===partial.name.type;isDynamic&&this.accept(partial.name),this.setupFullMustacheParams(partial,program,void 0,!0);var indent=partial.indent||"";this.options.preventIndent&&indent&&(this.opcode("appendContent",indent),indent=""),this.opcode("invokePartial",isDynamic,partialName,indent),this.opcode("append")},PartialBlockStatement:function PartialBlockStatement(partialBlock){this.PartialStatement(partialBlock)},MustacheStatement:function MustacheStatement(mustache){this.SubExpression(mustache),mustache.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function Decorator(decorator){this.DecoratorBlock(decorator)},ContentStatement:function ContentStatement(content){content.value&&this.opcode("appendContent",content.value)},CommentStatement:function CommentStatement(){},SubExpression:function SubExpression(sexpr){transformLiteralToPath(sexpr);var type=this.classifySexpr(sexpr);"simple"===type?this.simpleSexpr(sexpr):"helper"===type?this.helperSexpr(sexpr):this.ambiguousSexpr(sexpr)},ambiguousSexpr:function ambiguousSexpr(sexpr,program,inverse){var path=sexpr.path,name=path.parts[0],isBlock=null!=program||null!=inverse;this.opcode("getContext",path.depth),this.opcode("pushProgram",program),this.opcode("pushProgram",inverse),path.strict=!0,this.accept(path),this.opcode("invokeAmbiguous",name,isBlock)},simpleSexpr:function simpleSexpr(sexpr){var path=sexpr.path;path.strict=!0,this.accept(path),this.opcode("resolvePossibleLambda")},helperSexpr:function helperSexpr(sexpr,program,inverse){var params=this.setupFullMustacheParams(sexpr,program,inverse),path=sexpr.path,name=path.parts[0];if(this.options.knownHelpers[name])this.opcode("invokeKnownHelper",params.length,name);else{if(this.options.knownHelpersOnly)throw new _exception2.default("You specified knownHelpersOnly, but used the unknown helper "+name,sexpr);path.strict=!0,path.falsy=!0,this.accept(path),this.opcode("invokeHelper",params.length,path.original,_ast2.default.helpers.simpleId(path))}},PathExpression:function PathExpression(path){this.addDepth(path.depth),this.opcode("getContext",path.depth);var name=path.parts[0],scoped=_ast2.default.helpers.scopedId(path),blockParamId=!path.depth&&!scoped&&this.blockParamIndex(name);blockParamId?this.opcode("lookupBlockParam",blockParamId,path.parts):name?path.data?(this.options.data=!0,this.opcode("lookupData",path.depth,path.parts,path.strict)):this.opcode("lookupOnContext",path.parts,path.falsy,path.strict,scoped):this.opcode("pushContext")},StringLiteral:function StringLiteral(string){this.opcode("pushString",string.value)},NumberLiteral:function NumberLiteral(number){this.opcode("pushLiteral",number.value)},BooleanLiteral:function BooleanLiteral(bool){this.opcode("pushLiteral",bool.value)},UndefinedLiteral:function UndefinedLiteral(){this.opcode("pushLiteral","undefined")},NullLiteral:function NullLiteral(){this.opcode("pushLiteral","null")},Hash:function Hash(hash){var pairs=hash.pairs,i=0,l=pairs.length;for(this.opcode("pushHash");i<l;i++)this.pushParam(pairs[i].value);for(;i--;)this.opcode("assignToHash",pairs[i].key);this.opcode("popHash")},opcode:function opcode(name){this.opcodes.push({opcode:name,args:slice.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function addDepth(depth){depth&&(this.useDepths=!0)},classifySexpr:function classifySexpr(sexpr){var isSimple=_ast2.default.helpers.simpleId(sexpr.path),isBlockParam=isSimple&&!!this.blockParamIndex(sexpr.path.parts[0]),isHelper=!isBlockParam&&_ast2.default.helpers.helperExpression(sexpr),isEligible=!isBlockParam&&(isHelper||isSimple);if(isEligible&&!isHelper){var _name2=sexpr.path.parts[0],options=this.options;options.knownHelpers[_name2]?isHelper=!0:options.knownHelpersOnly&&(isEligible=!1)}return isHelper?"helper":isEligible?"ambiguous":"simple"},pushParams:function pushParams(params){for(var i=0,l=params.length;i<l;i++)this.pushParam(params[i])},pushParam:function pushParam(val){var value=null!=val.value?val.value:val.original||"";if(this.stringParams)value.replace&&(value=value.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),val.depth&&this.addDepth(val.depth),this.opcode("getContext",val.depth||0),this.opcode("pushStringParam",value,val.type),"SubExpression"===val.type&&this.accept(val);else{if(this.trackIds){var blockParamIndex=void 0;if(!val.parts||_ast2.default.helpers.scopedId(val)||val.depth||(blockParamIndex=this.blockParamIndex(val.parts[0])),blockParamIndex){var blockParamChild=val.parts.slice(1).join(".");this.opcode("pushId","BlockParam",blockParamIndex,blockParamChild)}else(value=val.original||value).replace&&(value=value.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",val.type,value)}this.accept(val)}},setupFullMustacheParams:function setupFullMustacheParams(sexpr,program,inverse,omitEmpty){var params=sexpr.params;return this.pushParams(params),this.opcode("pushProgram",program),this.opcode("pushProgram",inverse),sexpr.hash?this.accept(sexpr.hash):this.opcode("emptyHash",omitEmpty),params},blockParamIndex:function blockParamIndex(name){for(var depth=0,len=this.options.blockParams.length;depth<len;depth++){var blockParams=this.options.blockParams[depth],param=blockParams&&_utils.indexOf(blockParams,name);if(blockParams&¶m>=0)return[depth,param]}}}},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=__webpack_require__(1).default;exports.__esModule=!0;var _base=__webpack_require__(4),_exception,_exception2=_interopRequireDefault(__webpack_require__(6)),_utils=__webpack_require__(5),_codeGen,_codeGen2=_interopRequireDefault(__webpack_require__(43));function Literal(value){this.value=value}function JavaScriptCompiler(){}function strictLookup(requireTerminal,compiler,parts,type){var stack=compiler.popStack(),i=0,len=parts.length;for(requireTerminal&&len--;i<len;i++)stack=compiler.nameLookup(stack,parts[i],type);return requireTerminal?[compiler.aliasable("container.strict"),"(",stack,", ",compiler.quotedString(parts[i]),")"]:stack}JavaScriptCompiler.prototype={nameLookup:function nameLookup(parent,name){return"constructor"===name?["(",parent,".propertyIsEnumerable('constructor') ? ",parent,".constructor : undefined",")"]:JavaScriptCompiler.isValidJavaScriptVariableName(name)?[parent,".",name]:[parent,"[",JSON.stringify(name),"]"]},depthedLookup:function depthedLookup(name){return[this.aliasable("container.lookup"),'(depths, "',name,'")']},compilerInfo:function compilerInfo(){var revision=_base.COMPILER_REVISION,versions;return[revision,_base.REVISION_CHANGES[revision]]},appendToBuffer:function appendToBuffer(source,location,explicit){return _utils.isArray(source)||(source=[source]),source=this.source.wrap(source,location),this.environment.isSimple?["return ",source,";"]:explicit?["buffer += ",source,";"]:(source.appendToBuffer=!0,source)},initializeBuffer:function initializeBuffer(){return this.quotedString("")},compile:function compile(environment,options,context,asObject){this.environment=environment,this.options=options,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!asObject,this.name=this.environment.name,this.isChild=!!context,this.context=context||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(environment,options),this.useDepths=this.useDepths||environment.useDepths||environment.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||environment.useBlockParams;var opcodes=environment.opcodes,opcode=void 0,firstLoc=void 0,i=void 0,l=void 0;for(i=0,l=opcodes.length;i<l;i++)opcode=opcodes[i],this.source.currentLocation=opcode.loc,firstLoc=firstLoc||opcode.loc,this[opcode.opcode].apply(this,opcode.args);if(this.source.currentLocation=firstLoc,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new _exception2.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),asObject?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var fn=this.createFunctionContext(asObject);if(this.isChild)return fn;var ret={compiler:this.compilerInfo(),main:fn};this.decorators&&(ret.main_d=this.decorators,ret.useDecorators=!0);var _context=this.context,programs=_context.programs,decorators=_context.decorators;for(i=0,l=programs.length;i<l;i++)programs[i]&&(ret[i]=programs[i],decorators[i]&&(ret[i+"_d"]=decorators[i],ret.useDecorators=!0));return this.environment.usePartial&&(ret.usePartial=!0),this.options.data&&(ret.useData=!0),this.useDepths&&(ret.useDepths=!0),this.useBlockParams&&(ret.useBlockParams=!0),this.options.compat&&(ret.compat=!0),asObject?ret.compilerOptions=this.options:(ret.compiler=JSON.stringify(ret.compiler),this.source.currentLocation={start:{line:1,column:0}},ret=this.objectLiteral(ret),options.srcName?(ret=ret.toStringWithSourceMap({file:options.destName})).map=ret.map&&ret.map.toString():ret=ret.toString()),ret},preamble:function preamble(){this.lastContext=0,this.source=new _codeGen2.default(this.options.srcName),this.decorators=new _codeGen2.default(this.options.srcName)},createFunctionContext:function createFunctionContext(asObject){var varDeclarations="",locals=this.stackVars.concat(this.registers.list);locals.length>0&&(varDeclarations+=", "+locals.join(", "));var aliasCount=0;for(var alias in this.aliases){var node=this.aliases[alias];this.aliases.hasOwnProperty(alias)&&node.children&&node.referenceCount>1&&(varDeclarations+=", alias"+ ++aliasCount+"="+alias,node.children[0]="alias"+aliasCount)}var params=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&¶ms.push("blockParams"),this.useDepths&¶ms.push("depths");var source=this.mergeSource(varDeclarations);return asObject?(params.push(source),Function.apply(this,params)):this.source.wrap(["function(",params.join(","),") {\n ",source,"}"])},mergeSource:function mergeSource(varDeclarations){var isSimple=this.environment.isSimple,appendOnly=!this.forceBuffer,appendFirst=void 0,sourceSeen=void 0,bufferStart=void 0,bufferEnd=void 0;return this.source.each((function(line){line.appendToBuffer?(bufferStart?line.prepend(" + "):bufferStart=line,bufferEnd=line):(bufferStart&&(sourceSeen?bufferStart.prepend("buffer += "):appendFirst=!0,bufferEnd.add(";"),bufferStart=bufferEnd=void 0),sourceSeen=!0,isSimple||(appendOnly=!1))})),appendOnly?bufferStart?(bufferStart.prepend("return "),bufferEnd.add(";")):sourceSeen||this.source.push('return "";'):(varDeclarations+=", buffer = "+(appendFirst?"":this.initializeBuffer()),bufferStart?(bufferStart.prepend("return buffer + "),bufferEnd.add(";")):this.source.push("return buffer;")),varDeclarations&&this.source.prepend("var "+varDeclarations.substring(2)+(appendFirst?"":";\n")),this.source.merge()},blockValue:function blockValue(name){var blockHelperMissing=this.aliasable("helpers.blockHelperMissing"),params=[this.contextName(0)];this.setupHelperArgs(name,0,params);var blockName=this.popStack();params.splice(1,0,blockName),this.push(this.source.functionCall(blockHelperMissing,"call",params))},ambiguousBlockValue:function ambiguousBlockValue(){var blockHelperMissing=this.aliasable("helpers.blockHelperMissing"),params=[this.contextName(0)];this.setupHelperArgs("",0,params,!0),this.flushInline();var current=this.topStack();params.splice(1,0,current),this.pushSource(["if (!",this.lastHelper,") { ",current," = ",this.source.functionCall(blockHelperMissing,"call",params),"}"])},appendContent:function appendContent(content){this.pendingContent?content=this.pendingContent+content:this.pendingLocation=this.source.currentLocation,this.pendingContent=content},append:function append(){if(this.isInline())this.replaceStack((function(current){return[" != null ? ",current,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var local=this.popStack();this.pushSource(["if (",local," != null) { ",this.appendToBuffer(local,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function appendEscaped(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function getContext(depth){this.lastContext=depth},pushContext:function pushContext(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function lookupOnContext(parts,falsy,strict,scoped){var i=0;scoped||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(parts[i++])),this.resolvePath("context",parts,i,falsy,strict)},lookupBlockParam:function lookupBlockParam(blockParamId,parts){this.useBlockParams=!0,this.push(["blockParams[",blockParamId[0],"][",blockParamId[1],"]"]),this.resolvePath("context",parts,1)},lookupData:function lookupData(depth,parts,strict){depth?this.pushStackLiteral("container.data(data, "+depth+")"):this.pushStackLiteral("data"),this.resolvePath("data",parts,0,!0,strict)},resolvePath:function resolvePath(type,parts,i,falsy,strict){var _this=this;if(this.options.strict||this.options.assumeObjects)this.push(strictLookup(this.options.strict&&strict,this,parts,type));else for(var len=parts.length;i<len;i++)this.replaceStack((function(current){var lookup=_this.nameLookup(current,parts[i],type);return falsy?[" && ",lookup]:[" != null ? ",lookup," : ",current]}))},resolvePossibleLambda:function resolvePossibleLambda(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function pushStringParam(string,type){this.pushContext(),this.pushString(type),"SubExpression"!==type&&("string"==typeof string?this.pushString(string):this.pushStackLiteral(string))},emptyHash:function emptyHash(omitEmpty){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(omitEmpty?"undefined":"{}")},pushHash:function pushHash(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function popHash(){var hash=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(hash.ids)),this.stringParams&&(this.push(this.objectLiteral(hash.contexts)),this.push(this.objectLiteral(hash.types))),this.push(this.objectLiteral(hash.values))},pushString:function pushString(string){this.pushStackLiteral(this.quotedString(string))},pushLiteral:function pushLiteral(value){this.pushStackLiteral(value)},pushProgram:function pushProgram(guid){null!=guid?this.pushStackLiteral(this.programExpression(guid)):this.pushStackLiteral(null)},registerDecorator:function registerDecorator(paramSize,name){var foundDecorator=this.nameLookup("decorators",name,"decorator"),options=this.setupHelperArgs(name,paramSize);this.decorators.push(["fn = ",this.decorators.functionCall(foundDecorator,"",["fn","props","container",options])," || fn;"])},invokeHelper:function invokeHelper(paramSize,name,isSimple){var nonHelper=this.popStack(),helper=this.setupHelper(paramSize,name),simple=isSimple?[helper.name," || "]:"",lookup=["("].concat(simple,nonHelper);this.options.strict||lookup.push(" || ",this.aliasable("helpers.helperMissing")),lookup.push(")"),this.push(this.source.functionCall(lookup,"call",helper.callParams))},invokeKnownHelper:function invokeKnownHelper(paramSize,name){var helper=this.setupHelper(paramSize,name);this.push(this.source.functionCall(helper.name,"call",helper.callParams))},invokeAmbiguous:function invokeAmbiguous(name,helperCall){this.useRegister("helper");var nonHelper=this.popStack();this.emptyHash();var helper=this.setupHelper(0,name,helperCall),helperName,lookup=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",name,"helper")," || ",nonHelper,")"];this.options.strict||(lookup[0]="(helper = ",lookup.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",lookup,helper.paramsInit?["),(",helper.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",helper.callParams)," : helper))"])},invokePartial:function invokePartial(isDynamic,name,indent){var params=[],options=this.setupParams(name,1,params);isDynamic&&(name=this.popStack(),delete options.name),indent&&(options.indent=JSON.stringify(indent)),options.helpers="helpers",options.partials="partials",options.decorators="container.decorators",isDynamic?params.unshift(name):params.unshift(this.nameLookup("partials",name,"partial")),this.options.compat&&(options.depths="depths"),options=this.objectLiteral(options),params.push(options),this.push(this.source.functionCall("container.invokePartial","",params))},assignToHash:function assignToHash(key){var value=this.popStack(),context=void 0,type=void 0,id=void 0;this.trackIds&&(id=this.popStack()),this.stringParams&&(type=this.popStack(),context=this.popStack());var hash=this.hash;context&&(hash.contexts[key]=context),type&&(hash.types[key]=type),id&&(hash.ids[key]=id),hash.values[key]=value},pushId:function pushId(type,name,child){"BlockParam"===type?this.pushStackLiteral("blockParams["+name[0]+"].path["+name[1]+"]"+(child?" + "+JSON.stringify("."+child):"")):"PathExpression"===type?this.pushString(name):"SubExpression"===type?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:JavaScriptCompiler,compileChildren:function compileChildren(environment,options){for(var children=environment.children,child=void 0,compiler=void 0,i=0,l=children.length;i<l;i++){child=children[i],compiler=new this.compiler;var existing=this.matchExistingProgram(child);if(null==existing){this.context.programs.push("");var index=this.context.programs.length;child.index=index,child.name="program"+index,this.context.programs[index]=compiler.compile(child,options,this.context,!this.precompile),this.context.decorators[index]=compiler.decorators,this.context.environments[index]=child,this.useDepths=this.useDepths||compiler.useDepths,this.useBlockParams=this.useBlockParams||compiler.useBlockParams,child.useDepths=this.useDepths,child.useBlockParams=this.useBlockParams}else child.index=existing.index,child.name="program"+existing.index,this.useDepths=this.useDepths||existing.useDepths,this.useBlockParams=this.useBlockParams||existing.useBlockParams}},matchExistingProgram:function matchExistingProgram(child){for(var i=0,len=this.context.environments.length;i<len;i++){var environment=this.context.environments[i];if(environment&&environment.equals(child))return environment}},programExpression:function programExpression(guid){var child=this.environment.children[guid],programParams=[child.index,"data",child.blockParams];return(this.useBlockParams||this.useDepths)&&programParams.push("blockParams"),this.useDepths&&programParams.push("depths"),"container.program("+programParams.join(", ")+")"},useRegister:function useRegister(name){this.registers[name]||(this.registers[name]=!0,this.registers.list.push(name))},push:function push(expr){return expr instanceof Literal||(expr=this.source.wrap(expr)),this.inlineStack.push(expr),expr},pushStackLiteral:function pushStackLiteral(item){this.push(new Literal(item))},pushSource:function pushSource(source){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),source&&this.source.push(source)},replaceStack:function replaceStack(callback){var prefix=["("],stack=void 0,createdStack=void 0,usedLiteral=void 0;if(!this.isInline())throw new _exception2.default("replaceStack on non-inline");var top=this.popStack(!0);if(top instanceof Literal)prefix=["(",stack=[top.value]],usedLiteral=!0;else{createdStack=!0;var _name=this.incrStack();prefix=["((",this.push(_name)," = ",top,")"],stack=this.topStack()}var item=callback.call(this,stack);usedLiteral||this.popStack(),createdStack&&this.stackSlot--,this.push(prefix.concat(item,")"))},incrStack:function incrStack(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function topStackName(){return"stack"+this.stackSlot},flushInline:function flushInline(){var inlineStack=this.inlineStack;this.inlineStack=[];for(var i=0,len=inlineStack.length;i<len;i++){var entry=inlineStack[i];if(entry instanceof Literal)this.compileStack.push(entry);else{var stack=this.incrStack();this.pushSource([stack," = ",entry,";"]),this.compileStack.push(stack)}}},isInline:function isInline(){return this.inlineStack.length},popStack:function popStack(wrapped){var inline=this.isInline(),item=(inline?this.inlineStack:this.compileStack).pop();if(!wrapped&&item instanceof Literal)return item.value;if(!inline){if(!this.stackSlot)throw new _exception2.default("Invalid stack pop");this.stackSlot--}return item},topStack:function topStack(){var stack=this.isInline()?this.inlineStack:this.compileStack,item=stack[stack.length-1];return item instanceof Literal?item.value:item},contextName:function contextName(context){return this.useDepths&&context?"depths["+context+"]":"depth"+context},quotedString:function quotedString(str){return this.source.quotedString(str)},objectLiteral:function objectLiteral(obj){return this.source.objectLiteral(obj)},aliasable:function aliasable(name){var ret=this.aliases[name];return ret?(ret.referenceCount++,ret):((ret=this.aliases[name]=this.source.wrap(name)).aliasable=!0,ret.referenceCount=1,ret)},setupHelper:function setupHelper(paramSize,name,blockHelper){var params=[],paramsInit,foundHelper,callContext;return{params:params,paramsInit:this.setupHelperArgs(name,paramSize,params,blockHelper),name:this.nameLookup("helpers",name,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(params)}},setupParams:function setupParams(helper,paramSize,params){var options={},contexts=[],types=[],ids=[],objectArgs=!params,param=void 0;objectArgs&&(params=[]),options.name=this.quotedString(helper),options.hash=this.popStack(),this.trackIds&&(options.hashIds=this.popStack()),this.stringParams&&(options.hashTypes=this.popStack(),options.hashContexts=this.popStack());var inverse=this.popStack(),program=this.popStack();(program||inverse)&&(options.fn=program||"container.noop",options.inverse=inverse||"container.noop");for(var i=paramSize;i--;)param=this.popStack(),params[i]=param,this.trackIds&&(ids[i]=this.popStack()),this.stringParams&&(types[i]=this.popStack(),contexts[i]=this.popStack());return objectArgs&&(options.args=this.source.generateArray(params)),this.trackIds&&(options.ids=this.source.generateArray(ids)),this.stringParams&&(options.types=this.source.generateArray(types),options.contexts=this.source.generateArray(contexts)),this.options.data&&(options.data="data"),this.useBlockParams&&(options.blockParams="blockParams"),options},setupHelperArgs:function setupHelperArgs(helper,paramSize,params,useRegister){var options=this.setupParams(helper,paramSize,params);return options=this.objectLiteral(options),useRegister?(this.useRegister("options"),params.push("options"),["options=",options]):params?(params.push(options),""):options}},function(){for(var reservedWords="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),compilerWords=JavaScriptCompiler.RESERVED_WORDS={},i=0,l=reservedWords.length;i<l;i++)compilerWords[reservedWords[i]]=!0}(),JavaScriptCompiler.isValidJavaScriptVariableName=function(name){return!JavaScriptCompiler.RESERVED_WORDS[name]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)},exports.default=JavaScriptCompiler,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";exports.__esModule=!0;var _utils=__webpack_require__(5),SourceNode=void 0;try{var SourceMap}catch(err){}function castChunk(chunk,codeGen,loc){if(_utils.isArray(chunk)){for(var ret=[],i=0,len=chunk.length;i<len;i++)ret.push(codeGen.wrap(chunk[i],loc));return ret}return"boolean"==typeof chunk||"number"==typeof chunk?chunk+"":chunk}function CodeGen(srcFile){this.srcFile=srcFile,this.source=[]}SourceNode||((SourceNode=function(line,column,srcFile,chunks){this.src="",chunks&&this.add(chunks)}).prototype={add:function add(chunks){_utils.isArray(chunks)&&(chunks=chunks.join("")),this.src+=chunks},prepend:function prepend(chunks){_utils.isArray(chunks)&&(chunks=chunks.join("")),this.src=chunks+this.src},toStringWithSourceMap:function toStringWithSourceMap(){return{code:this.toString()}},toString:function toString(){return this.src}}),CodeGen.prototype={isEmpty:function isEmpty(){return!this.source.length},prepend:function prepend(source,loc){this.source.unshift(this.wrap(source,loc))},push:function push(source,loc){this.source.push(this.wrap(source,loc))},merge:function merge(){var source=this.empty();return this.each((function(line){source.add([" ",line,"\n"])})),source},each:function each(iter){for(var i=0,len=this.source.length;i<len;i++)iter(this.source[i])},empty:function empty(){var loc=this.currentLocation||{start:{}};return new SourceNode(loc.start.line,loc.start.column,this.srcFile)},wrap:function wrap(chunk){var loc=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return chunk instanceof SourceNode?chunk:(chunk=castChunk(chunk,this,loc),new SourceNode(loc.start.line,loc.start.column,this.srcFile,chunk))},functionCall:function functionCall(fn,type,params){return params=this.generateList(params),this.wrap([fn,type?"."+type+"(":"(",params,")"])},quotedString:function quotedString(str){return'"'+(str+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function objectLiteral(obj){var pairs=[];for(var key in obj)if(obj.hasOwnProperty(key)){var value=castChunk(obj[key],this);"undefined"!==value&&pairs.push([this.quotedString(key),":",value])}var ret=this.generateList(pairs);return ret.prepend("{"),ret.add("}"),ret},generateList:function generateList(entries){for(var ret=this.empty(),i=0,len=entries.length;i<len;i++)i&&ret.add(","),ret.add(castChunk(entries[i],this));return ret},generateArray:function generateArray(entries){var ret=this.generateList(entries);return ret.prepend("["),ret.add("]"),ret}},exports.default=CodeGen,module.exports=exports.default}])})),
|
||
/*!
|
||
* jquery.inputmask.bundle.js
|
||
* https://github.com/RobinHerbots/Inputmask
|
||
* Copyright (c) 2010 - 2019 Robin Herbots
|
||
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
||
* Version: 4.0.9
|
||
*/
|
||
function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=0)}([function(module,exports,__webpack_require__){"use strict";__webpack_require__(1),__webpack_require__(6),__webpack_require__(7);var _inputmask,_inputmask2=_interopRequireDefault(__webpack_require__(2)),_inputmask3,_inputmask4=_interopRequireDefault(__webpack_require__(3)),_jquery,_jquery2=_interopRequireDefault(__webpack_require__(4));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_inputmask4.default===_jquery2.default&&__webpack_require__(8),window.Inputmask=_inputmask2.default},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},factory;factory=function(Inputmask){return Inputmask.extendDefinitions({A:{validator:"[A-Za-zА-яЁёÀ-ÿµ]",casing:"upper"},"&":{validator:"[0-9A-Za-zА-яЁёÀ-ÿµ]",casing:"upper"},"#":{validator:"[0-9A-Fa-f]",casing:"upper"}}),Inputmask.extendAliases({cssunit:{regex:"[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)"},url:{regex:"(https?|ftp)//.*",autoUnmask:!1},ip:{mask:"i[i[i]].i[i[i]].i[i[i]].i[i[i]]",definitions:{i:{validator:function validator(chrs,maskset,pos,strict,opts){return pos-1>-1&&"."!==maskset.buffer[pos-1]?(chrs=maskset.buffer[pos-1]+chrs,chrs=pos-2>-1&&"."!==maskset.buffer[pos-2]?maskset.buffer[pos-2]+chrs:"0"+chrs):chrs="00"+chrs,new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs)}}},onUnMask:function onUnMask(maskedValue,unmaskedValue,opts){return maskedValue},inputmode:"numeric"},email:{mask:"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",greedy:!1,casing:"lower",onBeforePaste:function onBeforePaste(pastedValue,opts){return(pastedValue=pastedValue.toLowerCase()).replace("mailto:","")},definitions:{"*":{validator:"[0-91-9A-Za-zА-яЁёÀ-ÿµ!#$%&'*+/=?^_`{|}~-]"},"-":{validator:"[0-9A-Za-z-]"}},onUnMask:function onUnMask(maskedValue,unmaskedValue,opts){return maskedValue},inputmode:"email"},mac:{mask:"##:##:##:##:##:##"},vin:{mask:"V{13}9{4}",definitions:{V:{validator:"[A-HJ-NPR-Za-hj-npr-z\\d]",casing:"upper"}},clearIncomplete:!0,autoUnmask:!0}}),Inputmask},__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2)],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=factory)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},factory;factory=function($,window,undefined){var document=window.document,ua=navigator.userAgent,ie=ua.indexOf("MSIE ")>0||ua.indexOf("Trident/")>0,mobile=isInputEventSupported("touchstart"),iemobile=/iemobile/i.test(ua),iphone=/iphone/i.test(ua)&&!iemobile;function Inputmask(alias,options,internal){if(!(this instanceof Inputmask))return new Inputmask(alias,options,internal);this.el=undefined,this.events={},this.maskset=undefined,this.refreshValue=!1,!0!==internal&&($.isPlainObject(alias)?options=alias:(options=options||{},alias&&(options.alias=alias)),this.opts=$.extend(!0,{},this.defaults,options),this.noMasksCache=options&&options.definitions!==undefined,this.userOptions=options||{},this.isRTL=this.opts.numericInput,resolveAlias(this.opts.alias,options,this.opts))}function resolveAlias(aliasStr,options,opts){var aliasDefinition=Inputmask.prototype.aliases[aliasStr];return aliasDefinition?(aliasDefinition.alias&&resolveAlias(aliasDefinition.alias,undefined,opts),$.extend(!0,opts,aliasDefinition),$.extend(!0,opts,options),!0):(null===opts.mask&&(opts.mask=aliasStr),!1)}function generateMaskSet(opts,nocache){function generateMask(mask,metadata,opts){var regexMask=!1;if(null!==mask&&""!==mask||((regexMask=null!==opts.regex)?mask=(mask=opts.regex).replace(/^(\^)(.*)(\$)$/,"$2"):(regexMask=!0,mask=".*")),1===mask.length&&!1===opts.greedy&&0!==opts.repeat&&(opts.placeholder=""),opts.repeat>0||"*"===opts.repeat||"+"===opts.repeat){var repeatStart="*"===opts.repeat?0:"+"===opts.repeat?1:opts.repeat;mask=opts.groupmarker[0]+mask+opts.groupmarker[1]+opts.quantifiermarker[0]+repeatStart+","+opts.repeat+opts.quantifiermarker[1]}var masksetDefinition,maskdefKey=regexMask?"regex_"+opts.regex:opts.numericInput?mask.split("").reverse().join(""):mask;return Inputmask.prototype.masksCache[maskdefKey]===undefined||!0===nocache?(masksetDefinition={mask:mask,maskToken:Inputmask.prototype.analyseMask(mask,regexMask,opts),validPositions:{},_buffer:undefined,buffer:undefined,tests:{},excludes:{},metadata:metadata,maskLength:undefined,jitOffset:{}},!0!==nocache&&(Inputmask.prototype.masksCache[maskdefKey]=masksetDefinition,masksetDefinition=$.extend(!0,{},Inputmask.prototype.masksCache[maskdefKey]))):masksetDefinition=$.extend(!0,{},Inputmask.prototype.masksCache[maskdefKey]),masksetDefinition}var ms;if($.isFunction(opts.mask)&&(opts.mask=opts.mask(opts)),$.isArray(opts.mask)){if(opts.mask.length>1){if(null===opts.keepStatic){opts.keepStatic="auto";for(var i=0;i<opts.mask.length;i++)if(opts.mask[i].charAt(0)!==opts.mask[0].charAt(0)){opts.keepStatic=!0;break}}var altMask=opts.groupmarker[0];return $.each(opts.isRTL?opts.mask.reverse():opts.mask,(function(ndx,msk){altMask.length>1&&(altMask+=opts.groupmarker[1]+opts.alternatormarker+opts.groupmarker[0]),msk.mask===undefined||$.isFunction(msk.mask)?altMask+=msk:altMask+=msk.mask})),generateMask(altMask+=opts.groupmarker[1],opts.mask,opts)}opts.mask=opts.mask.pop()}return ms=opts.mask&&opts.mask.mask!==undefined&&!$.isFunction(opts.mask.mask)?generateMask(opts.mask.mask,opts.mask,opts):generateMask(opts.mask,opts.mask,opts)}function isInputEventSupported(eventName){var el=document.createElement("input"),evName="on"+eventName,isSupported=evName in el;return isSupported||(el.setAttribute(evName,"return;"),isSupported="function"==typeof el[evName]),el=null,isSupported}function maskScope(actionObj,maskset,opts){maskset=maskset||this.maskset,opts=opts||this.opts;var inputmask=this,el=this.el,isRTL=this.isRTL,undoValue,$el,skipKeyPressEvent=!1,skipInputEvent=!1,ignorable=!1,maxLength,mouseEnter=!1,colorMask,originalPlaceholder,getMaskTemplate=function getMaskTemplate(baseOnInput,minimalPos,includeMode,noJit,clearOptionalTail){var greedy=opts.greedy;clearOptionalTail&&(opts.greedy=!1),minimalPos=minimalPos||0;var maskTemplate=[],ndxIntlzr,pos=0,test,testPos,lvp=getLastValidPosition();do{if(!0===baseOnInput&&getMaskSet().validPositions[pos])test=(testPos=clearOptionalTail&&!0===getMaskSet().validPositions[pos].match.optionality&&getMaskSet().validPositions[pos+1]===undefined&&(!0===getMaskSet().validPositions[pos].generatedInput||getMaskSet().validPositions[pos].input==opts.skipOptionalPartCharacter&&pos>0)?determineTestTemplate(pos,getTests(pos,ndxIntlzr,pos-1)):getMaskSet().validPositions[pos]).match,ndxIntlzr=testPos.locator.slice(),maskTemplate.push(!0===includeMode?testPos.input:!1===includeMode?test.nativeDef:getPlaceholder(pos,test));else{test=(testPos=getTestTemplate(pos,ndxIntlzr,pos-1)).match,ndxIntlzr=testPos.locator.slice();var jitMasking=!0!==noJit&&(!1!==opts.jitMasking?opts.jitMasking:test.jit);(!1===jitMasking||jitMasking===undefined||"number"==typeof jitMasking&&isFinite(jitMasking)&&jitMasking>pos)&&maskTemplate.push(!1===includeMode?test.nativeDef:getPlaceholder(pos,test))}"auto"===opts.keepStatic&&test.newBlockMarker&&null!==test.fn&&(opts.keepStatic=pos-1),pos++}while((maxLength===undefined||pos<maxLength)&&(null!==test.fn||""!==test.def)||minimalPos>pos);return""===maskTemplate[maskTemplate.length-1]&&maskTemplate.pop(),!1===includeMode&&getMaskSet().maskLength!==undefined||(getMaskSet().maskLength=pos-1),opts.greedy=greedy,maskTemplate};function getMaskSet(){return maskset}function resetMaskSet(soft){var maskset=getMaskSet();maskset.buffer=undefined,!0!==soft&&(maskset.validPositions={},maskset.p=0)}function getLastValidPosition(closestTo,strict,validPositions){var before=-1,after=-1,valids=validPositions||getMaskSet().validPositions;for(var posNdx in closestTo===undefined&&(closestTo=-1),valids){var psNdx=parseInt(posNdx);valids[psNdx]&&(strict||!0!==valids[psNdx].generatedInput)&&(psNdx<=closestTo&&(before=psNdx),psNdx>=closestTo&&(after=psNdx))}return-1===before||before==closestTo?after:-1==after?before:closestTo-before<after-closestTo?before:after}function getDecisionTaker(tst){var decisionTaker=tst.locator[tst.alternation];return"string"==typeof decisionTaker&&decisionTaker.length>0&&(decisionTaker=decisionTaker.split(",")[0]),decisionTaker!==undefined?decisionTaker.toString():""}function getLocator(tst,align){var locator=(tst.alternation!=undefined?tst.mloc[getDecisionTaker(tst)]:tst.locator).join("");if(""!==locator)for(;locator.length<align;)locator+="0";return locator}function determineTestTemplate(pos,tests){for(var altTest,targetLocator=getLocator(getTest(pos=pos>0?pos-1:0)),tstLocator,closest,bestMatch,ndx=0;ndx<tests.length;ndx++){var tst=tests[ndx];tstLocator=getLocator(tst,targetLocator.length);var distance=Math.abs(tstLocator-targetLocator);(closest===undefined||""!==tstLocator&&distance<closest||bestMatch&&!opts.greedy&&bestMatch.match.optionality&&"master"===bestMatch.match.newBlockMarker&&(!tst.match.optionality||!tst.match.newBlockMarker)||bestMatch&&bestMatch.match.optionalQuantifier&&!tst.match.optionalQuantifier)&&(closest=distance,bestMatch=tst)}return bestMatch}function getTestTemplate(pos,ndxIntlzr,tstPs){return getMaskSet().validPositions[pos]||determineTestTemplate(pos,getTests(pos,ndxIntlzr?ndxIntlzr.slice():ndxIntlzr,tstPs))}function getTest(pos,tests){return getMaskSet().validPositions[pos]?getMaskSet().validPositions[pos]:(tests||getTests(pos))[0]}function positionCanMatchDefinition(pos,def){for(var valid=!1,tests=getTests(pos),tndx=0;tndx<tests.length;tndx++)if(tests[tndx].match&&tests[tndx].match.def===def){valid=!0;break}return valid}function getTests(pos,ndxIntlzr,tstPs){var maskTokens=getMaskSet().maskToken,testPos=ndxIntlzr?tstPs:0,ndxInitializer=ndxIntlzr?ndxIntlzr.slice():[0],matches=[],insertStop=!1,latestMatch,cacheDependency=ndxIntlzr?ndxIntlzr.join(""):"";function resolveTestFromToken(maskToken,ndxInitializer,loopNdx,quantifierRecurse){function handleMatch(match,loopNdx,quantifierRecurse){function isFirstMatch(latestMatch,tokenGroup){var firstMatch=0===$.inArray(latestMatch,tokenGroup.matches);return firstMatch||$.each(tokenGroup.matches,(function(ndx,match){if(!0===match.isQuantifier?firstMatch=isFirstMatch(latestMatch,tokenGroup.matches[ndx-1]):match.hasOwnProperty("matches")&&(firstMatch=isFirstMatch(latestMatch,match)),firstMatch)return!1})),firstMatch}function resolveNdxInitializer(pos,alternateNdx,targetAlternation){var bestMatch,indexPos;if((getMaskSet().tests[pos]||getMaskSet().validPositions[pos])&&$.each(getMaskSet().tests[pos]||[getMaskSet().validPositions[pos]],(function(ndx,lmnt){if(lmnt.mloc[alternateNdx])return bestMatch=lmnt,!1;var alternation=targetAlternation!==undefined?targetAlternation:lmnt.alternation,ndxPos=lmnt.locator[alternation]!==undefined?lmnt.locator[alternation].toString().indexOf(alternateNdx):-1;(indexPos===undefined||ndxPos<indexPos)&&-1!==ndxPos&&(bestMatch=lmnt,indexPos=ndxPos)})),bestMatch){var bestMatchAltIndex=bestMatch.locator[bestMatch.alternation],locator;return(bestMatch.mloc[alternateNdx]||bestMatch.mloc[bestMatchAltIndex]||bestMatch.locator).slice((targetAlternation!==undefined?targetAlternation:bestMatch.alternation)+1)}return targetAlternation!==undefined?resolveNdxInitializer(pos,alternateNdx):undefined}function isSubsetOf(source,target){function expand(pattern){for(var expanded=[],start,end,i=0,l=pattern.length;i<l;i++)if("-"===pattern.charAt(i))for(end=pattern.charCodeAt(i+1);++start<end;)expanded.push(String.fromCharCode(start));else start=pattern.charCodeAt(i),expanded.push(pattern.charAt(i));return expanded.join("")}return opts.regex&&null!==source.match.fn&&null!==target.match.fn?-1!==expand(target.match.def.replace(/[\[\]]/g,"")).indexOf(expand(source.match.def.replace(/[\[\]]/g,""))):source.match.def===target.match.nativeDef}function staticCanMatchDefinition(source,target){var sloc,tloc,canMatch=source.locator.slice(source.alternation).join("")==target.locator.slice(target.alternation).join("");return canMatch=!(!canMatch||null!==source.match.fn||null===target.match.fn)&&target.match.fn.test(source.match.def,getMaskSet(),pos,!1,opts,!1)}function setMergeLocators(targetMatch,altMatch){if(altMatch===undefined||targetMatch.alternation===altMatch.alternation&&-1===targetMatch.locator[targetMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation])){targetMatch.mloc=targetMatch.mloc||{};var locNdx=targetMatch.locator[targetMatch.alternation];if(locNdx!==undefined){if("string"==typeof locNdx&&(locNdx=locNdx.split(",")[0]),targetMatch.mloc[locNdx]===undefined&&(targetMatch.mloc[locNdx]=targetMatch.locator.slice()),altMatch!==undefined){for(var ndx in altMatch.mloc)"string"==typeof ndx&&(ndx=ndx.split(",")[0]),targetMatch.mloc[ndx]===undefined&&(targetMatch.mloc[ndx]=altMatch.mloc[ndx]);targetMatch.locator[targetMatch.alternation]=Object.keys(targetMatch.mloc).join(",")}return!0}targetMatch.alternation=undefined}return!1}if(testPos>500&&quantifierRecurse!==undefined)throw"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. "+getMaskSet().mask;if(testPos===pos&&match.matches===undefined)return matches.push({match:match,locator:loopNdx.reverse(),cd:cacheDependency,mloc:{}}),!0;if(match.matches!==undefined){if(match.isGroup&&quantifierRecurse!==match){if(match=handleMatch(maskToken.matches[$.inArray(match,maskToken.matches)+1],loopNdx,quantifierRecurse))return!0}else if(match.isOptional){var optionalToken=match;if(match=resolveTestFromToken(match,ndxInitializer,loopNdx,quantifierRecurse)){if($.each(matches,(function(ndx,mtch){mtch.match.optionality=!0})),latestMatch=matches[matches.length-1].match,quantifierRecurse!==undefined||!isFirstMatch(latestMatch,optionalToken))return!0;insertStop=!0,testPos=pos}}else if(match.isAlternator){var alternateToken=match,malternateMatches=[],maltMatches,currentMatches=matches.slice(),loopNdxCnt=loopNdx.length,altIndex=ndxInitializer.length>0?ndxInitializer.shift():-1;if(-1===altIndex||"string"==typeof altIndex){var currentPos=testPos,ndxInitializerClone=ndxInitializer.slice(),altIndexArr=[],amndx;if("string"==typeof altIndex)altIndexArr=altIndex.split(",");else for(amndx=0;amndx<alternateToken.matches.length;amndx++)altIndexArr.push(amndx.toString());if(getMaskSet().excludes[pos]){for(var altIndexArrClone=altIndexArr.slice(),i=0,el=getMaskSet().excludes[pos].length;i<el;i++)altIndexArr.splice(altIndexArr.indexOf(getMaskSet().excludes[pos][i].toString()),1);0===altIndexArr.length&&(getMaskSet().excludes[pos]=undefined,altIndexArr=altIndexArrClone)}(!0===opts.keepStatic||isFinite(parseInt(opts.keepStatic))&¤tPos>=opts.keepStatic)&&(altIndexArr=altIndexArr.slice(0,1));for(var unMatchedAlternation=!1,ndx=0;ndx<altIndexArr.length;ndx++){amndx=parseInt(altIndexArr[ndx]),matches=[],ndxInitializer="string"==typeof altIndex&&resolveNdxInitializer(testPos,amndx,loopNdxCnt)||ndxInitializerClone.slice(),alternateToken.matches[amndx]&&handleMatch(alternateToken.matches[amndx],[amndx].concat(loopNdx),quantifierRecurse)?match=!0:0===ndx&&(unMatchedAlternation=!0),maltMatches=matches.slice(),testPos=currentPos,matches=[];for(var ndx1=0;ndx1<maltMatches.length;ndx1++){var altMatch=maltMatches[ndx1],dropMatch=!1;altMatch.match.jit=altMatch.match.jit||unMatchedAlternation,altMatch.alternation=altMatch.alternation||loopNdxCnt,setMergeLocators(altMatch);for(var ndx2=0;ndx2<malternateMatches.length;ndx2++){var altMatch2=malternateMatches[ndx2];if("string"!=typeof altIndex||altMatch.alternation!==undefined&&-1!==$.inArray(altMatch.locator[altMatch.alternation].toString(),altIndexArr)){if(altMatch.match.nativeDef===altMatch2.match.nativeDef){dropMatch=!0,setMergeLocators(altMatch2,altMatch);break}if(isSubsetOf(altMatch,altMatch2)){setMergeLocators(altMatch,altMatch2)&&(dropMatch=!0,malternateMatches.splice(malternateMatches.indexOf(altMatch2),0,altMatch));break}if(isSubsetOf(altMatch2,altMatch)){setMergeLocators(altMatch2,altMatch);break}if(staticCanMatchDefinition(altMatch,altMatch2)){setMergeLocators(altMatch,altMatch2)&&(dropMatch=!0,malternateMatches.splice(malternateMatches.indexOf(altMatch2),0,altMatch));break}}}dropMatch||malternateMatches.push(altMatch)}}matches=currentMatches.concat(malternateMatches),testPos=pos,insertStop=matches.length>0,match=malternateMatches.length>0,ndxInitializer=ndxInitializerClone.slice()}else match=handleMatch(alternateToken.matches[altIndex]||maskToken.matches[altIndex],[altIndex].concat(loopNdx),quantifierRecurse);if(match)return!0}else if(match.isQuantifier&&quantifierRecurse!==maskToken.matches[$.inArray(match,maskToken.matches)-1])for(var qt=match,qndx=ndxInitializer.length>0?ndxInitializer.shift():0;qndx<(isNaN(qt.quantifier.max)?qndx+1:qt.quantifier.max)&&testPos<=pos;qndx++){var tokenGroup=maskToken.matches[$.inArray(qt,maskToken.matches)-1];if(match=handleMatch(tokenGroup,[qndx].concat(loopNdx),tokenGroup)){if((latestMatch=matches[matches.length-1].match).optionalQuantifier=qndx>=qt.quantifier.min,latestMatch.jit=(qndx||1)*tokenGroup.matches.indexOf(latestMatch)>=qt.quantifier.jit,latestMatch.optionalQuantifier&&isFirstMatch(latestMatch,tokenGroup)){insertStop=!0,testPos=pos;break}return latestMatch.jit&&(getMaskSet().jitOffset[pos]=tokenGroup.matches.indexOf(latestMatch)),!0}}else if(match=resolveTestFromToken(match,ndxInitializer,loopNdx,quantifierRecurse))return!0}else testPos++}for(var tndx=ndxInitializer.length>0?ndxInitializer.shift():0;tndx<maskToken.matches.length;tndx++)if(!0!==maskToken.matches[tndx].isQuantifier){var match=handleMatch(maskToken.matches[tndx],[tndx].concat(loopNdx),quantifierRecurse);if(match&&testPos===pos)return match;if(testPos>pos)break}}function mergeLocators(pos,tests){var locator=[];return $.isArray(tests)||(tests=[tests]),tests.length>0&&(tests[0].alternation===undefined?0===(locator=determineTestTemplate(pos,tests.slice()).locator.slice()).length&&(locator=tests[0].locator.slice()):$.each(tests,(function(ndx,tst){if(""!==tst.def)if(0===locator.length)locator=tst.locator.slice();else for(var i=0;i<locator.length;i++)tst.locator[i]&&-1===locator[i].toString().indexOf(tst.locator[i])&&(locator[i]+=","+tst.locator[i])}))),locator}if(pos>-1){if(ndxIntlzr===undefined){for(var previousPos=pos-1,test;(test=getMaskSet().validPositions[previousPos]||getMaskSet().tests[previousPos])===undefined&&previousPos>-1;)previousPos--;test!==undefined&&previousPos>-1&&(ndxInitializer=mergeLocators(previousPos,test),cacheDependency=ndxInitializer.join(""),testPos=previousPos)}if(getMaskSet().tests[pos]&&getMaskSet().tests[pos][0].cd===cacheDependency)return getMaskSet().tests[pos];for(var mtndx=ndxInitializer.shift();mtndx<maskTokens.length;mtndx++){var match;if(resolveTestFromToken(maskTokens[mtndx],ndxInitializer,[mtndx])&&testPos===pos||testPos>pos)break}}return(0===matches.length||insertStop)&&matches.push({match:{fn:null,optionality:!1,casing:null,def:"",placeholder:""},locator:[],mloc:{},cd:cacheDependency}),ndxIntlzr!==undefined&&getMaskSet().tests[pos]?$.extend(!0,[],matches):(getMaskSet().tests[pos]=$.extend(!0,[],matches),getMaskSet().tests[pos])}function getBufferTemplate(){return getMaskSet()._buffer===undefined&&(getMaskSet()._buffer=getMaskTemplate(!1,1),getMaskSet().buffer===undefined&&(getMaskSet().buffer=getMaskSet()._buffer.slice())),getMaskSet()._buffer}function getBuffer(noCache){return getMaskSet().buffer!==undefined&&!0!==noCache||(getMaskSet().buffer=getMaskTemplate(!0,getLastValidPosition(),!0),getMaskSet()._buffer===undefined&&(getMaskSet()._buffer=getMaskSet().buffer.slice())),getMaskSet().buffer}function refreshFromBuffer(start,end,buffer){var i,p;if(!0===start)resetMaskSet(),start=0,end=buffer.length;else for(i=start;i<end;i++)delete getMaskSet().validPositions[i];for(p=start,i=start;i<end;i++)if(resetMaskSet(!0),buffer[i]!==opts.skipOptionalPartCharacter){var valResult=isValid(p,buffer[i],!0,!0);!1!==valResult&&(resetMaskSet(!0),p=valResult.caret!==undefined?valResult.caret:valResult.pos+1)}}function casing(elem,test,pos){switch(opts.casing||test.casing){case"upper":elem=elem.toUpperCase();break;case"lower":elem=elem.toLowerCase();break;case"title":var posBefore=getMaskSet().validPositions[pos-1];elem=0===pos||posBefore&&posBefore.input===String.fromCharCode(Inputmask.keyCode.SPACE)?elem.toUpperCase():elem.toLowerCase();break;default:if($.isFunction(opts.casing)){var args=Array.prototype.slice.call(arguments);args.push(getMaskSet().validPositions),elem=opts.casing.apply(this,args)}}return elem}function checkAlternationMatch(altArr1,altArr2,na){for(var altArrC=opts.greedy?altArr2:altArr2.slice(0,1),isMatch=!1,naArr=na!==undefined?na.split(","):[],naNdx,i=0;i<naArr.length;i++)-1!==(naNdx=altArr1.indexOf(naArr[i]))&&altArr1.splice(naNdx,1);for(var alndx=0;alndx<altArr1.length;alndx++)if(-1!==$.inArray(altArr1[alndx],altArrC)){isMatch=!0;break}return isMatch}function alternate(pos,c,strict,fromSetValid,rAltPos){var validPsClone=$.extend(!0,{},getMaskSet().validPositions),lastAlt,alternation,isValidRslt=!1,altPos,prevAltPos,i,validPos,decisionPos,lAltPos=rAltPos!==undefined?rAltPos:getLastValidPosition();if(-1===lAltPos&&rAltPos===undefined)alternation=(prevAltPos=getTest(lastAlt=0)).alternation;else for(;lAltPos>=0;lAltPos--)if((altPos=getMaskSet().validPositions[lAltPos])&&altPos.alternation!==undefined){if(prevAltPos&&prevAltPos.locator[altPos.alternation]!==altPos.locator[altPos.alternation])break;lastAlt=lAltPos,alternation=getMaskSet().validPositions[lastAlt].alternation,prevAltPos=altPos}if(alternation!==undefined){decisionPos=parseInt(lastAlt),getMaskSet().excludes[decisionPos]=getMaskSet().excludes[decisionPos]||[],!0!==pos&&getMaskSet().excludes[decisionPos].push(getDecisionTaker(prevAltPos));var validInputsClone=[],staticInputsBeforePos=0;for(i=decisionPos;i<getLastValidPosition(undefined,!0)+1;i++)(validPos=getMaskSet().validPositions[i])&&!0!==validPos.generatedInput?validInputsClone.push(validPos.input):i<pos&&staticInputsBeforePos++,delete getMaskSet().validPositions[i];for(;getMaskSet().excludes[decisionPos]&&getMaskSet().excludes[decisionPos].length<10;){var posOffset=-1*staticInputsBeforePos,validInputs=validInputsClone.slice();for(getMaskSet().tests[decisionPos]=undefined,resetMaskSet(!0),isValidRslt=!0;validInputs.length>0;){var input=validInputs.shift();if(!(isValidRslt=isValid(getLastValidPosition(undefined,!0)+1,input,!1,fromSetValid,!0)))break}if(isValidRslt&&c!==undefined){var targetLvp=getLastValidPosition(pos)+1;for(i=decisionPos;i<getLastValidPosition()+1;i++)((validPos=getMaskSet().validPositions[i])===undefined||null==validPos.match.fn)&&i<pos+posOffset&&posOffset++;isValidRslt=isValid((pos+=posOffset)>targetLvp?targetLvp:pos,c,strict,fromSetValid,!0)}if(isValidRslt)break;if(resetMaskSet(),prevAltPos=getTest(decisionPos),getMaskSet().validPositions=$.extend(!0,{},validPsClone),!getMaskSet().excludes[decisionPos]){isValidRslt=alternate(pos,c,strict,fromSetValid,decisionPos-1);break}var decisionTaker=getDecisionTaker(prevAltPos);if(-1!==getMaskSet().excludes[decisionPos].indexOf(decisionTaker)){isValidRslt=alternate(pos,c,strict,fromSetValid,decisionPos-1);break}for(getMaskSet().excludes[decisionPos].push(decisionTaker),i=decisionPos;i<getLastValidPosition(undefined,!0)+1;i++)delete getMaskSet().validPositions[i]}}return getMaskSet().excludes[decisionPos]=undefined,isValidRslt}function isValid(pos,c,strict,fromSetValid,fromAlternate,validateOnly){function isSelection(posObj){return isRTL?posObj.begin-posObj.end>1||posObj.begin-posObj.end==1:posObj.end-posObj.begin>1||posObj.end-posObj.begin==1}strict=!0===strict;var maskPos=pos;function _isValid(position,c,strict){var rslt=!1;return $.each(getTests(position),(function(ndx,tst){var test=tst.match;if(getBuffer(!0),!1!==(rslt=null!=test.fn?test.fn.test(c,getMaskSet(),position,strict,opts,isSelection(pos)):(c===test.def||c===opts.skipOptionalPartCharacter)&&""!==test.def&&{c:getPlaceholder(position,test,!0)||test.def,pos:position})){var elem=rslt.c!==undefined?rslt.c:c,validatedPos=position;return elem=elem===opts.skipOptionalPartCharacter&&null===test.fn?getPlaceholder(position,test,!0)||test.def:elem,rslt.remove!==undefined&&($.isArray(rslt.remove)||(rslt.remove=[rslt.remove]),$.each(rslt.remove.sort((function(a,b){return b-a})),(function(ndx,lmnt){revalidateMask({begin:lmnt,end:lmnt+1})}))),rslt.insert!==undefined&&($.isArray(rslt.insert)||(rslt.insert=[rslt.insert]),$.each(rslt.insert.sort((function(a,b){return a-b})),(function(ndx,lmnt){isValid(lmnt.pos,lmnt.c,!0,fromSetValid)}))),!0!==rslt&&rslt.pos!==undefined&&rslt.pos!==position&&(validatedPos=rslt.pos),(!0===rslt||rslt.pos!==undefined||rslt.c!==undefined)&&(revalidateMask(pos,$.extend({},tst,{input:casing(elem,test,validatedPos)}),fromSetValid,validatedPos)||(rslt=!1),!1)}})),rslt}pos.begin!==undefined&&(maskPos=isRTL?pos.end:pos.begin);var result=!0,positionsClone=$.extend(!0,{},getMaskSet().validPositions);if($.isFunction(opts.preValidation)&&!strict&&!0!==fromSetValid&&!0!==validateOnly&&(result=opts.preValidation(getBuffer(),maskPos,c,isSelection(pos),opts,getMaskSet())),!0===result){if(trackbackPositions(undefined,maskPos,!0),(maxLength===undefined||maskPos<maxLength)&&(result=_isValid(maskPos,c,strict),(!strict||!0===fromSetValid)&&!1===result&&!0!==validateOnly)){var currentPosValid=getMaskSet().validPositions[maskPos];if(!currentPosValid||null!==currentPosValid.match.fn||currentPosValid.match.def!==c&&c!==opts.skipOptionalPartCharacter){if((opts.insertMode||getMaskSet().validPositions[seekNext(maskPos)]===undefined)&&(!isMask(maskPos,!0)||getMaskSet().jitOffset[maskPos]))if(getMaskSet().jitOffset[maskPos]&&getMaskSet().validPositions[seekNext(maskPos)]===undefined)!1!==(result=isValid(maskPos+getMaskSet().jitOffset[maskPos],c,strict))&&(result.caret=maskPos);else for(var nPos=maskPos+1,snPos=seekNext(maskPos);nPos<=snPos;nPos++)if(!1!==(result=_isValid(nPos,c,strict))){result=trackbackPositions(maskPos,result.pos!==undefined?result.pos:nPos)||result,maskPos=nPos;break}}else result={caret:seekNext(maskPos)}}!1!==result||!1===opts.keepStatic||null!=opts.regex&&!isComplete(getBuffer())||strict||!0===fromAlternate||(result=alternate(maskPos,c,strict,fromSetValid)),!0===result&&(result={pos:maskPos})}if($.isFunction(opts.postValidation)&&!1!==result&&!strict&&!0!==fromSetValid&&!0!==validateOnly){var postResult=opts.postValidation(getBuffer(!0),pos.begin!==undefined?isRTL?pos.end:pos.begin:pos,result,opts);if(postResult!==undefined){if(postResult.refreshFromBuffer&&postResult.buffer){var refresh=postResult.refreshFromBuffer;refreshFromBuffer(!0===refresh?refresh:refresh.start,refresh.end,postResult.buffer)}result=!0===postResult?result:postResult}}return result&&result.pos===undefined&&(result.pos=maskPos),!1!==result&&!0!==validateOnly||(resetMaskSet(!0),getMaskSet().validPositions=$.extend(!0,{},positionsClone)),result}function trackbackPositions(originalPos,newPos,fillOnly){var result;if(originalPos===undefined)for(originalPos=newPos-1;originalPos>0&&!getMaskSet().validPositions[originalPos];originalPos--);for(var ps=originalPos;ps<newPos;ps++){var vp;if(getMaskSet().validPositions[ps]===undefined&&!isMask(ps,!0)&&(0==ps?getTest(ps):getMaskSet().validPositions[ps-1])){var tests=getTests(ps).slice();""===tests[tests.length-1].match.def&&tests.pop();var bestMatch=determineTestTemplate(ps,tests);if((bestMatch=$.extend({},bestMatch,{input:getPlaceholder(ps,bestMatch.match,!0)||bestMatch.match.def})).generatedInput=!0,revalidateMask(ps,bestMatch,!0),!0!==fillOnly){var cvpInput=getMaskSet().validPositions[newPos].input;getMaskSet().validPositions[newPos]=undefined,result=isValid(newPos,cvpInput,!0,!0)}}}return result}function revalidateMask(pos,validTest,fromSetValid,validatedPos){function IsEnclosedStatic(pos,valids,selection){var posMatch=valids[pos];if(posMatch!==undefined&&(null===posMatch.match.fn&&!0!==posMatch.match.optionality||posMatch.input===opts.radixPoint)){var prevMatch=selection.begin<=pos-1?valids[pos-1]&&null===valids[pos-1].match.fn&&valids[pos-1]:valids[pos-1],nextMatch=selection.end>pos+1?valids[pos+1]&&null===valids[pos+1].match.fn&&valids[pos+1]:valids[pos+1];return prevMatch&&nextMatch}return!1}var begin=pos.begin!==undefined?pos.begin:pos,end=pos.end!==undefined?pos.end:pos;if(pos.begin>pos.end&&(begin=pos.end,end=pos.begin),validatedPos=validatedPos!==undefined?validatedPos:begin,begin!==end||opts.insertMode&&getMaskSet().validPositions[validatedPos]!==undefined&&fromSetValid===undefined){var positionsClone=$.extend(!0,{},getMaskSet().validPositions),lvp=getLastValidPosition(undefined,!0),i;for(getMaskSet().p=begin,i=lvp;i>=begin;i--)getMaskSet().validPositions[i]&&"+"===getMaskSet().validPositions[i].match.nativeDef&&(opts.isNegative=!1),delete getMaskSet().validPositions[i];var valid=!0,j=validatedPos,vps=getMaskSet().validPositions,needsValidation=!1,posMatch=j,i=j;for(validTest&&(getMaskSet().validPositions[validatedPos]=$.extend(!0,{},validTest),posMatch++,j++,begin<end&&i++);i<=lvp;i++){var t=positionsClone[i];if(t!==undefined&&(i>=end||i>=begin&&!0!==t.generatedInput&&IsEnclosedStatic(i,positionsClone,{begin:begin,end:end}))){for(;""!==getTest(posMatch).match.def;){if(!1===needsValidation&&positionsClone[posMatch]&&positionsClone[posMatch].match.nativeDef===t.match.nativeDef)getMaskSet().validPositions[posMatch]=$.extend(!0,{},positionsClone[posMatch]),getMaskSet().validPositions[posMatch].input=t.input,trackbackPositions(undefined,posMatch,!0),j=posMatch+1,valid=!0;else if(opts.shiftPositions&&positionCanMatchDefinition(posMatch,t.match.def)){var result=isValid(posMatch,t.input,!0,!0);valid=!1!==result,j=result.caret||result.insert?getLastValidPosition():posMatch+1,needsValidation=!0}else valid=!0===t.generatedInput||t.input===opts.radixPoint&&!0===opts.numericInput;if(valid)break;if(!valid&&posMatch>end&&isMask(posMatch,!0)&&(null!==t.match.fn||posMatch>getMaskSet().maskLength))break;posMatch++}""==getTest(posMatch).match.def&&(valid=!1),posMatch=j}if(!valid)break}if(!valid)return getMaskSet().validPositions=$.extend(!0,{},positionsClone),resetMaskSet(!0),!1}else validTest&&(getMaskSet().validPositions[validatedPos]=$.extend(!0,{},validTest));return resetMaskSet(!0),!0}function isMask(pos,strict){var test=getTestTemplate(pos).match;if(""===test.def&&(test=getTest(pos).match),null!=test.fn)return test.fn;if(!0!==strict&&pos>-1){var tests=getTests(pos);return tests.length>1+(""===tests[tests.length-1].match.def?1:0)}return!1}function seekNext(pos,newBlock){for(var position=pos+1;""!==getTest(position).match.def&&(!0===newBlock&&(!0!==getTest(position).match.newBlockMarker||!isMask(position))||!0!==newBlock&&!isMask(position));)position++;return position}function seekPrevious(pos,newBlock){var position=pos,tests;if(position<=0)return 0;for(;--position>0&&(!0===newBlock&&!0!==getTest(position).match.newBlockMarker||!0!==newBlock&&!isMask(position)&&((tests=getTests(position)).length<2||2===tests.length&&""===tests[1].match.def)););return position}function writeBuffer(input,buffer,caretPos,event,triggerEvents){if(event&&$.isFunction(opts.onBeforeWrite)){var result=opts.onBeforeWrite.call(inputmask,event,buffer,caretPos,opts);if(result){if(result.refreshFromBuffer){var refresh=result.refreshFromBuffer;refreshFromBuffer(!0===refresh?refresh:refresh.start,refresh.end,result.buffer||buffer),buffer=getBuffer(!0)}caretPos!==undefined&&(caretPos=result.caret!==undefined?result.caret:caretPos)}}if(input!==undefined&&(input.inputmask._valueSet(buffer.join("")),caretPos===undefined||event!==undefined&&"blur"===event.type?renderColorMask(input,caretPos,0===buffer.length):caret(input,caretPos),!0===triggerEvents)){var $input=$(input),nptVal=input.inputmask._valueGet();skipInputEvent=!0,$input.trigger("input"),setTimeout((function(){nptVal===getBufferTemplate().join("")?$input.trigger("cleared"):!0===isComplete(buffer)&&$input.trigger("complete")}),0)}}function getPlaceholder(pos,test,returnPL){if((test=test||getTest(pos).match).placeholder!==undefined||!0===returnPL)return $.isFunction(test.placeholder)?test.placeholder(opts):test.placeholder;if(null===test.fn){if(pos>-1&&getMaskSet().validPositions[pos]===undefined){var tests=getTests(pos),staticAlternations=[],prevTest;if(tests.length>1+(""===tests[tests.length-1].match.def?1:0))for(var i=0;i<tests.length;i++)if(!0!==tests[i].match.optionality&&!0!==tests[i].match.optionalQuantifier&&(null===tests[i].match.fn||prevTest===undefined||!1!==tests[i].match.fn.test(prevTest.match.def,getMaskSet(),pos,!0,opts))&&(staticAlternations.push(tests[i]),null===tests[i].match.fn&&(prevTest=tests[i]),staticAlternations.length>1&&/[0-9a-bA-Z]/.test(staticAlternations[0].match.def)))return opts.placeholder.charAt(pos%opts.placeholder.length)}return test.def}return opts.placeholder.charAt(pos%opts.placeholder.length)}function HandleNativePlaceholder(npt,value){if(ie){if(npt.inputmask._valueGet()!==value&&(npt.placeholder!==value||""===npt.placeholder)){var buffer=getBuffer().slice(),nptValue=npt.inputmask._valueGet();if(nptValue!==value){var lvp=getLastValidPosition();-1===lvp&&nptValue===getBufferTemplate().join("")?buffer=[]:-1!==lvp&&clearOptionalTail(buffer),writeBuffer(npt,buffer)}}}else npt.placeholder!==value&&(npt.placeholder=value,""===npt.placeholder&&npt.removeAttribute("placeholder"))}var EventRuler={on:function on(input,eventName,eventHandler){var ev=function ev(e){var that=this;if(that.inputmask===undefined&&"FORM"!==this.nodeName){var imOpts=$.data(that,"_inputmask_opts");imOpts?new Inputmask(imOpts).mask(that):EventRuler.off(that)}else{if("setvalue"===e.type||"FORM"===this.nodeName||!(that.disabled||that.readOnly&&!("keydown"===e.type&&e.ctrlKey&&67===e.keyCode||!1===opts.tabThrough&&e.keyCode===Inputmask.keyCode.TAB))){switch(e.type){case"input":if(!0===skipInputEvent)return skipInputEvent=!1,e.preventDefault();if(mobile){var args=arguments;return setTimeout((function(){eventHandler.apply(that,args),caret(that,that.inputmask.caretPos,undefined,!0)}),0),!1}break;case"keydown":skipKeyPressEvent=!1,skipInputEvent=!1;break;case"keypress":if(!0===skipKeyPressEvent)return e.preventDefault();skipKeyPressEvent=!0;break;case"click":if(iemobile||iphone){var args=arguments;return setTimeout((function(){eventHandler.apply(that,args)}),0),!1}}var returnVal=eventHandler.apply(that,arguments);return!1===returnVal&&(e.preventDefault(),e.stopPropagation()),returnVal}e.preventDefault()}};input.inputmask.events[eventName]=input.inputmask.events[eventName]||[],input.inputmask.events[eventName].push(ev),-1!==$.inArray(eventName,["submit","reset"])?null!==input.form&&$(input.form).on(eventName,ev):$(input).on(eventName,ev)},off:function off(input,event){var events;input.inputmask&&input.inputmask.events&&(event?(events=[])[event]=input.inputmask.events[event]:events=input.inputmask.events,$.each(events,(function(eventName,evArr){for(;evArr.length>0;){var ev=evArr.pop();-1!==$.inArray(eventName,["submit","reset"])?null!==input.form&&$(input.form).off(eventName,ev):$(input).off(eventName,ev)}delete input.inputmask.events[eventName]})))}},EventHandlers={keydownEvent:function keydownEvent(e){var input=this,$input=$(this),k=e.keyCode,pos=caret(this);if(k===Inputmask.keyCode.BACKSPACE||k===Inputmask.keyCode.DELETE||iphone&&k===Inputmask.keyCode.BACKSPACE_SAFARI||e.ctrlKey&&k===Inputmask.keyCode.X&&!isInputEventSupported("cut"))e.preventDefault(),handleRemove(this,k,pos),writeBuffer(this,getBuffer(!0),getMaskSet().p,e,this.inputmask._valueGet()!==getBuffer().join(""));else if(k===Inputmask.keyCode.END||k===Inputmask.keyCode.PAGE_DOWN){e.preventDefault();var caretPos=seekNext(getLastValidPosition());caret(this,e.shiftKey?pos.begin:caretPos,caretPos,!0)}else k===Inputmask.keyCode.HOME&&!e.shiftKey||k===Inputmask.keyCode.PAGE_UP?(e.preventDefault(),caret(this,0,e.shiftKey?pos.begin:0,!0)):(opts.undoOnEscape&&k===Inputmask.keyCode.ESCAPE||90===k&&e.ctrlKey)&&!0!==e.altKey?(checkVal(this,!0,!1,undoValue.split("")),$input.trigger("click")):k!==Inputmask.keyCode.INSERT||e.shiftKey||e.ctrlKey?!0===opts.tabThrough&&k===Inputmask.keyCode.TAB&&(!0===e.shiftKey?(null===getTest(pos.begin).match.fn&&(pos.begin=seekNext(pos.begin)),pos.end=seekPrevious(pos.begin,!0),pos.begin=seekPrevious(pos.end,!0)):(pos.begin=seekNext(pos.begin,!0),pos.end=seekNext(pos.begin,!0),pos.end<getMaskSet().maskLength&&pos.end--),pos.begin<getMaskSet().maskLength&&(e.preventDefault(),caret(this,pos.begin,pos.end))):(opts.insertMode=!opts.insertMode,this.setAttribute("im-insert",opts.insertMode));opts.onKeyDown.call(this,e,getBuffer(),caret(this).begin,opts),ignorable=-1!==$.inArray(k,opts.ignorables)},keypressEvent:function keypressEvent(e,checkval,writeOut,strict,ndx){var input=this,$input=$(input),k=e.which||e.charCode||e.keyCode;if(!(!0===checkval||e.ctrlKey&&e.altKey)&&(e.ctrlKey||e.metaKey||ignorable))return k===Inputmask.keyCode.ENTER&&undoValue!==getBuffer().join("")&&(undoValue=getBuffer().join(""),setTimeout((function(){$input.trigger("change")}),0)),!0;if(k){46===k&&!1===e.shiftKey&&""!==opts.radixPoint&&(k=opts.radixPoint.charCodeAt(0));var pos=checkval?{begin:ndx,end:ndx}:caret(input),forwardPosition,c=String.fromCharCode(k),offset=0;if(opts._radixDance&&opts.numericInput){var caretPos=getBuffer().indexOf(opts.radixPoint.charAt(0))+1;pos.begin<=caretPos&&(k===opts.radixPoint.charCodeAt(0)&&(offset=1),pos.begin-=1,pos.end-=1)}getMaskSet().writeOutBuffer=!0;var valResult=isValid(pos,c,strict);if(!1!==valResult&&(resetMaskSet(!0),forwardPosition=valResult.caret!==undefined?valResult.caret:seekNext(valResult.pos.begin?valResult.pos.begin:valResult.pos),getMaskSet().p=forwardPosition),forwardPosition=(opts.numericInput&&valResult.caret===undefined?seekPrevious(forwardPosition):forwardPosition)+offset,!1!==writeOut&&(setTimeout((function(){opts.onKeyValidation.call(input,k,valResult,opts)}),0),getMaskSet().writeOutBuffer&&!1!==valResult)){var buffer=getBuffer();writeBuffer(input,buffer,forwardPosition,e,!0!==checkval)}if(e.preventDefault(),checkval)return!1!==valResult&&(valResult.forwardPosition=forwardPosition),valResult}},pasteEvent:function pasteEvent(e){var input=this,ev=e.originalEvent||e,$input=$(this),inputValue=this.inputmask._valueGet(!0),caretPos=caret(this),tempValue;isRTL&&(tempValue=caretPos.end,caretPos.end=caretPos.begin,caretPos.begin=tempValue);var valueBeforeCaret=inputValue.substr(0,caretPos.begin),valueAfterCaret=inputValue.substr(caretPos.end,inputValue.length);if(valueBeforeCaret===(isRTL?getBufferTemplate().reverse():getBufferTemplate()).slice(0,caretPos.begin).join("")&&(valueBeforeCaret=""),valueAfterCaret===(isRTL?getBufferTemplate().reverse():getBufferTemplate()).slice(caretPos.end).join("")&&(valueAfterCaret=""),window.clipboardData&&window.clipboardData.getData)inputValue=valueBeforeCaret+window.clipboardData.getData("Text")+valueAfterCaret;else{if(!ev.clipboardData||!ev.clipboardData.getData)return!0;inputValue=valueBeforeCaret+ev.clipboardData.getData("text/plain")+valueAfterCaret}var pasteValue=inputValue;if($.isFunction(opts.onBeforePaste)){if(!1===(pasteValue=opts.onBeforePaste.call(inputmask,inputValue,opts)))return e.preventDefault();pasteValue||(pasteValue=inputValue)}return checkVal(this,!1,!1,pasteValue.toString().split("")),writeBuffer(this,getBuffer(),seekNext(getLastValidPosition()),e,undoValue!==getBuffer().join("")),e.preventDefault()},inputFallBackEvent:function inputFallBackEvent(e){function radixPointHandler(input,inputValue,caretPos){return"."===inputValue.charAt(caretPos.begin-1)&&""!==opts.radixPoint&&((inputValue=inputValue.split(""))[caretPos.begin-1]=opts.radixPoint.charAt(0),inputValue=inputValue.join("")),inputValue}function ieMobileHandler(input,inputValue,caretPos){if(iemobile){var inputChar=inputValue.replace(getBuffer().join(""),"");if(1===inputChar.length){var iv=inputValue.split("");iv.splice(caretPos.begin,0,inputChar),inputValue=iv.join("")}}return inputValue}var input=this,inputValue=input.inputmask._valueGet();if(getBuffer().join("")!==inputValue){var caretPos=caret(input);if(inputValue=radixPointHandler(input,inputValue,caretPos),inputValue=ieMobileHandler(input,inputValue,caretPos),getBuffer().join("")!==inputValue){var buffer=getBuffer().join(""),offset=!opts.numericInput&&inputValue.length>buffer.length?-1:0,frontPart=inputValue.substr(0,caretPos.begin),backPart=inputValue.substr(caretPos.begin),frontBufferPart=buffer.substr(0,caretPos.begin+offset),backBufferPart=buffer.substr(caretPos.begin+offset),selection=caretPos,entries="",isEntry=!1;if(frontPart!==frontBufferPart){var fpl=(isEntry=frontPart.length>=frontBufferPart.length)?frontPart.length:frontBufferPart.length,i;for(i=0;frontPart.charAt(i)===frontBufferPart.charAt(i)&&i<fpl;i++);isEntry&&(selection.begin=i-offset,entries+=frontPart.slice(i,selection.end))}if(backPart!==backBufferPart&&(backPart.length>backBufferPart.length?entries+=backPart.slice(0,1):backPart.length<backBufferPart.length&&(selection.end+=backBufferPart.length-backPart.length,isEntry||""===opts.radixPoint||""!==backPart||frontPart.charAt(selection.begin+offset-1)!==opts.radixPoint||(selection.begin--,entries=opts.radixPoint))),writeBuffer(input,getBuffer(),{begin:selection.begin+offset,end:selection.end+offset}),entries.length>0)$.each(entries.split(""),(function(ndx,entry){var keypress=new $.Event("keypress");keypress.which=entry.charCodeAt(0),ignorable=!1,EventHandlers.keypressEvent.call(input,keypress)}));else{selection.begin===selection.end-1&&(selection.begin=seekPrevious(selection.begin+1),selection.begin===selection.end-1?caret(input,selection.begin):caret(input,selection.begin,selection.end));var keydown=new $.Event("keydown");keydown.keyCode=opts.numericInput?Inputmask.keyCode.BACKSPACE:Inputmask.keyCode.DELETE,EventHandlers.keydownEvent.call(input,keydown)}e.preventDefault()}}},beforeInputEvent:function beforeInputEvent(e){if(e.cancelable){var input=this;switch(e.inputType){case"insertText":return $.each(e.data.split(""),(function(ndx,entry){var keypress=new $.Event("keypress");keypress.which=entry.charCodeAt(0),ignorable=!1,EventHandlers.keypressEvent.call(input,keypress)})),e.preventDefault();case"deleteContentBackward":var keydown;return(keydown=new $.Event("keydown")).keyCode=Inputmask.keyCode.BACKSPACE,EventHandlers.keydownEvent.call(input,keydown),e.preventDefault();case"deleteContentForward":var keydown;return(keydown=new $.Event("keydown")).keyCode=Inputmask.keyCode.DELETE,EventHandlers.keydownEvent.call(input,keydown),e.preventDefault()}}},setValueEvent:function setValueEvent(e){this.inputmask.refreshValue=!1;var input=this,value,value=(value=e&&e.detail?e.detail[0]:arguments[1])||input.inputmask._valueGet(!0);$.isFunction(opts.onBeforeMask)&&(value=opts.onBeforeMask.call(inputmask,value,opts)||value),checkVal(input,!0,!1,value=value.toString().split("")),undoValue=getBuffer().join(""),(opts.clearMaskOnLostFocus||opts.clearIncomplete)&&input.inputmask._valueGet()===getBufferTemplate().join("")&&input.inputmask._valueSet("")},focusEvent:function focusEvent(e){var input=this,nptValue=this.inputmask._valueGet();opts.showMaskOnFocus&&(nptValue!==getBuffer().join("")?writeBuffer(this,getBuffer(),seekNext(getLastValidPosition())):!1===mouseEnter&&caret(this,seekNext(getLastValidPosition()))),!0===opts.positionCaretOnTab&&!1===mouseEnter&&EventHandlers.clickEvent.apply(this,[e,!0]),undoValue=getBuffer().join("")},mouseleaveEvent:function mouseleaveEvent(e){var input=this;mouseEnter=!1,opts.clearMaskOnLostFocus&&document.activeElement!==this&&HandleNativePlaceholder(this,originalPlaceholder)},clickEvent:function clickEvent(e,tabbed){function doRadixFocus(clickPos){if(""!==opts.radixPoint){var vps=getMaskSet().validPositions;if(vps[clickPos]===undefined||vps[clickPos].input===getPlaceholder(clickPos)){if(clickPos<seekNext(-1))return!0;var radixPos=$.inArray(opts.radixPoint,getBuffer());if(-1!==radixPos){for(var vp in vps)if(radixPos<vp&&vps[vp].input!==getPlaceholder(vp))return!1;return!0}}}return!1}var input=this;setTimeout((function(){if(document.activeElement===input){var selectedCaret=caret(input);if(tabbed&&(isRTL?selectedCaret.end=selectedCaret.begin:selectedCaret.begin=selectedCaret.end),selectedCaret.begin===selectedCaret.end)switch(opts.positionCaretOnClick){case"none":break;case"select":caret(input,0,getBuffer().length);break;case"ignore":caret(input,seekNext(getLastValidPosition()));break;case"radixFocus":if(doRadixFocus(selectedCaret.begin)){var radixPos=getBuffer().join("").indexOf(opts.radixPoint);caret(input,opts.numericInput?seekNext(radixPos):radixPos);break}default:var clickPosition=selectedCaret.begin,lvclickPosition=getLastValidPosition(clickPosition,!0),lastPosition=seekNext(lvclickPosition);if(clickPosition<lastPosition)caret(input,isMask(clickPosition,!0)||isMask(clickPosition-1,!0)?clickPosition:seekNext(clickPosition));else{var lvp=getMaskSet().validPositions[lvclickPosition],tt=getTestTemplate(lastPosition,lvp?lvp.match.locator:undefined,lvp),placeholder=getPlaceholder(lastPosition,tt.match);if(""!==placeholder&&getBuffer()[lastPosition]!==placeholder&&!0!==tt.match.optionalQuantifier&&!0!==tt.match.newBlockMarker||!isMask(lastPosition,opts.keepStatic)&&tt.match.def===placeholder){var newPos=seekNext(lastPosition);(clickPosition>=newPos||clickPosition===lastPosition)&&(lastPosition=newPos)}caret(input,lastPosition)}}}}),0)},cutEvent:function cutEvent(e){var input=this,$input=$(this),pos=caret(this),ev=e.originalEvent||e,clipboardData=window.clipboardData||ev.clipboardData,clipData=isRTL?getBuffer().slice(pos.end,pos.begin):getBuffer().slice(pos.begin,pos.end);clipboardData.setData("text",isRTL?clipData.reverse().join(""):clipData.join("")),document.execCommand&&document.execCommand("copy"),handleRemove(this,Inputmask.keyCode.DELETE,pos),writeBuffer(this,getBuffer(),getMaskSet().p,e,undoValue!==getBuffer().join(""))},blurEvent:function blurEvent(e){var $input=$(this),input=this;if(this.inputmask){HandleNativePlaceholder(this,originalPlaceholder);var nptValue=this.inputmask._valueGet(),buffer=getBuffer().slice();""===nptValue&&colorMask===undefined||(opts.clearMaskOnLostFocus&&(-1===getLastValidPosition()&&nptValue===getBufferTemplate().join("")?buffer=[]:clearOptionalTail(buffer)),!1===isComplete(buffer)&&(setTimeout((function(){$input.trigger("incomplete")}),0),opts.clearIncomplete&&(resetMaskSet(),buffer=opts.clearMaskOnLostFocus?[]:getBufferTemplate().slice())),writeBuffer(this,buffer,undefined,e)),undoValue!==getBuffer().join("")&&(undoValue=buffer.join(""),$input.trigger("change"))}},mouseenterEvent:function mouseenterEvent(e){var input=this;mouseEnter=!0,document.activeElement!==this&&opts.showMaskOnHover&&HandleNativePlaceholder(this,(isRTL?getBuffer().slice().reverse():getBuffer()).join(""))},submitEvent:function submitEvent(e){undoValue!==getBuffer().join("")&&$el.trigger("change"),opts.clearMaskOnLostFocus&&-1===getLastValidPosition()&&el.inputmask._valueGet&&el.inputmask._valueGet()===getBufferTemplate().join("")&&el.inputmask._valueSet(""),opts.clearIncomplete&&!1===isComplete(getBuffer())&&el.inputmask._valueSet(""),opts.removeMaskOnSubmit&&(el.inputmask._valueSet(el.inputmask.unmaskedvalue(),!0),setTimeout((function(){writeBuffer(el,getBuffer())}),0))},resetEvent:function resetEvent(e){el.inputmask.refreshValue=!0,setTimeout((function(){$el.trigger("setvalue")}),0)}},valueBuffer;function checkVal(input,writeOut,strict,nptvl,initiatingEvent){var inputmask=this||input.inputmask,inputValue=nptvl.slice(),charCodes="",initialNdx=-1,result=undefined;function isTemplateMatch(ndx,charCodes){var charCodeNdx;return-1!==getMaskTemplate(!0,0,!1).slice(ndx,seekNext(ndx)).join("").replace(/'/g,"").indexOf(charCodes)&&!isMask(ndx)&&(getTest(ndx).match.nativeDef===charCodes.charAt(0)||null===getTest(ndx).match.fn&&getTest(ndx).match.nativeDef==="'"+charCodes.charAt(0)||" "===getTest(ndx).match.nativeDef&&(getTest(ndx+1).match.nativeDef===charCodes.charAt(0)||null===getTest(ndx+1).match.fn&&getTest(ndx+1).match.nativeDef==="'"+charCodes.charAt(0)))}if(resetMaskSet(),strict||!0===opts.autoUnmask)initialNdx=seekNext(initialNdx);else{var staticInput=getBufferTemplate().slice(0,seekNext(-1)).join(""),matches=inputValue.join("").match(new RegExp("^"+Inputmask.escapeRegex(staticInput),"g"));matches&&matches.length>0&&(inputValue.splice(0,matches.length*staticInput.length),initialNdx=seekNext(initialNdx))}-1===initialNdx?(getMaskSet().p=seekNext(initialNdx),initialNdx=0):getMaskSet().p=initialNdx,inputmask.caretPos={begin:initialNdx},$.each(inputValue,(function(ndx,charCode){if(charCode!==undefined)if(getMaskSet().validPositions[ndx]===undefined&&inputValue[ndx]===getPlaceholder(ndx)&&isMask(ndx,!0)&&!1===isValid(ndx,inputValue[ndx],!0,undefined,undefined,!0))getMaskSet().p++;else{var keypress=new $.Event("_checkval");keypress.which=charCode.charCodeAt(0),charCodes+=charCode;var lvp=getLastValidPosition(undefined,!0);isTemplateMatch(initialNdx,charCodes)?result=EventHandlers.keypressEvent.call(input,keypress,!0,!1,strict,lvp+1):(result=EventHandlers.keypressEvent.call(input,keypress,!0,!1,strict,inputmask.caretPos.begin))&&(initialNdx=inputmask.caretPos.begin+1,charCodes=""),result&&(writeBuffer(undefined,getBuffer(),result.forwardPosition,keypress,!1),inputmask.caretPos={begin:result.forwardPosition,end:result.forwardPosition})}})),writeOut&&writeBuffer(input,getBuffer(),result?result.forwardPosition:undefined,initiatingEvent||new $.Event("checkval"),initiatingEvent&&"input"===initiatingEvent.type)}function unmaskedvalue(input){if(input){if(input.inputmask===undefined)return input.value;input.inputmask&&input.inputmask.refreshValue&&EventHandlers.setValueEvent.call(input)}var umValue=[],vps=getMaskSet().validPositions;for(var pndx in vps)vps[pndx].match&&null!=vps[pndx].match.fn&&umValue.push(vps[pndx].input);var unmaskedValue=0===umValue.length?"":(isRTL?umValue.reverse():umValue).join("");if($.isFunction(opts.onUnMask)){var bufferValue=(isRTL?getBuffer().slice().reverse():getBuffer()).join("");unmaskedValue=opts.onUnMask.call(inputmask,bufferValue,unmaskedValue,opts)}return unmaskedValue}function caret(input,begin,end,notranslate){function translatePosition(pos){return!isRTL||"number"!=typeof pos||opts.greedy&&""===opts.placeholder||!el||(pos=el.inputmask._valueGet().length-pos),pos}var range;if(begin===undefined)return"selectionStart"in input?(begin=input.selectionStart,end=input.selectionEnd):window.getSelection?(range=window.getSelection().getRangeAt(0)).commonAncestorContainer.parentNode!==input&&range.commonAncestorContainer!==input||(begin=range.startOffset,end=range.endOffset):document.selection&&document.selection.createRange&&(end=(begin=0-(range=document.selection.createRange()).duplicate().moveStart("character",-input.inputmask._valueGet().length))+range.text.length),{begin:notranslate?begin:translatePosition(begin),end:notranslate?end:translatePosition(end)};if($.isArray(begin)&&(end=isRTL?begin[0]:begin[1],begin=isRTL?begin[1]:begin[0]),begin.begin!==undefined&&(end=isRTL?begin.begin:begin.end,begin=isRTL?begin.end:begin.begin),"number"==typeof begin){begin=notranslate?begin:translatePosition(begin),end="number"==typeof(end=notranslate?end:translatePosition(end))?end:begin;var scrollCalc=parseInt(((input.ownerDocument.defaultView||window).getComputedStyle?(input.ownerDocument.defaultView||window).getComputedStyle(input,null):input.currentStyle).fontSize)*end;if(input.scrollLeft=scrollCalc>input.scrollWidth?scrollCalc:0,input.inputmask.caretPos={begin:begin,end:end},input===document.activeElement){if("selectionStart"in input)input.selectionStart=begin,input.selectionEnd=end;else if(window.getSelection){if(range=document.createRange(),input.firstChild===undefined||null===input.firstChild){var textNode=document.createTextNode("");input.appendChild(textNode)}range.setStart(input.firstChild,begin<input.inputmask._valueGet().length?begin:input.inputmask._valueGet().length),range.setEnd(input.firstChild,end<input.inputmask._valueGet().length?end:input.inputmask._valueGet().length),range.collapse(!0);var sel=window.getSelection();sel.removeAllRanges(),sel.addRange(range)}else input.createTextRange&&((range=input.createTextRange()).collapse(!0),range.moveEnd("character",end),range.moveStart("character",begin),range.select());renderColorMask(input,{begin:begin,end:end})}}}function determineLastRequiredPosition(returnDefinition){var buffer=getMaskTemplate(!0,getLastValidPosition(),!0,!0),bl=buffer.length,pos,lvp=getLastValidPosition(),positions={},lvTest=getMaskSet().validPositions[lvp],ndxIntlzr=lvTest!==undefined?lvTest.locator.slice():undefined,testPos;for(pos=lvp+1;pos<buffer.length;pos++)ndxIntlzr=(testPos=getTestTemplate(pos,ndxIntlzr,pos-1)).locator.slice(),positions[pos]=$.extend(!0,{},testPos);var lvTestAlt=lvTest&&lvTest.alternation!==undefined?lvTest.locator[lvTest.alternation]:undefined;for(pos=bl-1;pos>lvp&&((testPos=positions[pos]).match.optionality||testPos.match.optionalQuantifier&&testPos.match.newBlockMarker||lvTestAlt&&(lvTestAlt!==positions[pos].locator[lvTest.alternation]&&null!=testPos.match.fn||null===testPos.match.fn&&testPos.locator[lvTest.alternation]&&checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","),lvTestAlt.toString().split(","))&&""!==getTests(pos)[0].def))&&buffer[pos]===getPlaceholder(pos,testPos.match);pos--)bl--;return returnDefinition?{l:bl,def:positions[bl]?positions[bl].match:undefined}:bl}function clearOptionalTail(buffer){buffer.length=0;for(var template=getMaskTemplate(!0,0,!0,undefined,!0),lmnt,validPos;(lmnt=template.shift())!==undefined;)buffer.push(lmnt);return buffer}function isComplete(buffer){if($.isFunction(opts.isComplete))return opts.isComplete(buffer,opts);if("*"===opts.repeat)return undefined;var complete=!1,lrp=determineLastRequiredPosition(!0),aml=seekPrevious(lrp.l);if(lrp.def===undefined||lrp.def.newBlockMarker||lrp.def.optionality||lrp.def.optionalQuantifier){complete=!0;for(var i=0;i<=aml;i++){var test=getTestTemplate(i).match;if(null!==test.fn&&getMaskSet().validPositions[i]===undefined&&!0!==test.optionality&&!0!==test.optionalQuantifier||null===test.fn&&buffer[i]!==getPlaceholder(i,test)){complete=!1;break}}}return complete}function handleRemove(input,k,pos,strict,fromIsValid){if((opts.numericInput||isRTL)&&(k===Inputmask.keyCode.BACKSPACE?k=Inputmask.keyCode.DELETE:k===Inputmask.keyCode.DELETE&&(k=Inputmask.keyCode.BACKSPACE),isRTL)){var pend=pos.end;pos.end=pos.begin,pos.begin=pend}if(k===Inputmask.keyCode.BACKSPACE&&pos.end-pos.begin<1?(pos.begin=seekPrevious(pos.begin),getMaskSet().validPositions[pos.begin]!==undefined&&getMaskSet().validPositions[pos.begin].input===opts.groupSeparator&&pos.begin--):k===Inputmask.keyCode.DELETE&&pos.begin===pos.end&&(pos.end=isMask(pos.end,!0)&&getMaskSet().validPositions[pos.end]&&getMaskSet().validPositions[pos.end].input!==opts.radixPoint?pos.end+1:seekNext(pos.end)+1,getMaskSet().validPositions[pos.begin]!==undefined&&getMaskSet().validPositions[pos.begin].input===opts.groupSeparator&&pos.end++),revalidateMask(pos),!0!==strict&&!1!==opts.keepStatic||null!==opts.regex){var result=alternate(!0);if(result){var newPos=result.caret!==undefined?result.caret:result.pos?seekNext(result.pos.begin?result.pos.begin:result.pos):getLastValidPosition(-1,!0);(k!==Inputmask.keyCode.DELETE||pos.begin>newPos)&&pos.begin}}var lvp=getLastValidPosition(pos.begin,!0);if(lvp<pos.begin||-1===pos.begin)getMaskSet().p=seekNext(lvp);else if(!0!==strict&&(getMaskSet().p=pos.begin,!0!==fromIsValid))for(;getMaskSet().p<lvp&&getMaskSet().validPositions[getMaskSet().p]===undefined;)getMaskSet().p++}function initializeColorMask(input){var computedStyle=(input.ownerDocument.defaultView||window).getComputedStyle(input,null);function findCaretPos(clientx){var e=document.createElement("span"),caretPos;for(var style in computedStyle)isNaN(style)&&-1!==style.indexOf("font")&&(e.style[style]=computedStyle[style]);e.style.textTransform=computedStyle.textTransform,e.style.letterSpacing=computedStyle.letterSpacing,e.style.position="absolute",e.style.height="auto",e.style.width="auto",e.style.visibility="hidden",e.style.whiteSpace="nowrap",document.body.appendChild(e);var inputText=input.inputmask._valueGet(),previousWidth=0,itl;for(caretPos=0,itl=inputText.length;caretPos<=itl;caretPos++){if(e.innerHTML+=inputText.charAt(caretPos)||"_",e.offsetWidth>=clientx){var offset1=clientx-previousWidth,offset2=e.offsetWidth-clientx;e.innerHTML=inputText.charAt(caretPos),caretPos=(offset1-=e.offsetWidth/3)<offset2?caretPos-1:caretPos;break}previousWidth=e.offsetWidth}return document.body.removeChild(e),caretPos}var template=document.createElement("div");template.style.width=computedStyle.width,template.style.textAlign=computedStyle.textAlign,colorMask=document.createElement("div"),input.inputmask.colorMask=colorMask,colorMask.className="im-colormask",input.parentNode.insertBefore(colorMask,input),input.parentNode.removeChild(input),colorMask.appendChild(input),colorMask.appendChild(template),input.style.left=template.offsetLeft+"px",$(colorMask).on("mouseleave",(function(e){return EventHandlers.mouseleaveEvent.call(input,[e])})),$(colorMask).on("mouseenter",(function(e){return EventHandlers.mouseenterEvent.call(input,[e])})),$(colorMask).on("click",(function(e){return caret(input,findCaretPos(e.clientX)),EventHandlers.clickEvent.call(input,[e])}))}function renderColorMask(input,caretPos,clear){var maskTemplate=[],isStatic=!1,test,testPos,ndxIntlzr,pos=0;function setEntry(entry){if(entry===undefined&&(entry=""),isStatic||null!==test.fn&&testPos.input!==undefined)if(isStatic&&(null!==test.fn&&testPos.input!==undefined||""===test.def)){isStatic=!1;var mtl=maskTemplate.length;maskTemplate[mtl-1]=maskTemplate[mtl-1]+"</span>",maskTemplate.push(entry)}else maskTemplate.push(entry);else isStatic=!0,maskTemplate.push("<span class='im-static'>"+entry)}function setCaret(){document.activeElement===input&&(maskTemplate.splice(caretPos.begin,0,caretPos.begin===caretPos.end||caretPos.end>getMaskSet().maskLength?'<mark class="im-caret" style="border-right-width: 1px;border-right-style: solid;">':'<mark class="im-caret-select">'),maskTemplate.splice(caretPos.end+1,0,"</mark>"))}if(colorMask!==undefined){var buffer=getBuffer();if(caretPos===undefined?caretPos=caret(input):caretPos.begin===undefined&&(caretPos={begin:caretPos,end:caretPos}),!0!==clear){var lvp=getLastValidPosition();do{getMaskSet().validPositions[pos]?(testPos=getMaskSet().validPositions[pos],test=testPos.match,ndxIntlzr=testPos.locator.slice(),setEntry(buffer[pos])):(testPos=getTestTemplate(pos,ndxIntlzr,pos-1),test=testPos.match,ndxIntlzr=testPos.locator.slice(),!1===opts.jitMasking||pos<lvp||"number"==typeof opts.jitMasking&&isFinite(opts.jitMasking)&&opts.jitMasking>pos?setEntry(getPlaceholder(pos,test)):isStatic=!1),pos++}while((maxLength===undefined||pos<maxLength)&&(null!==test.fn||""!==test.def)||lvp>pos||isStatic);isStatic&&setEntry(),setCaret()}var template=colorMask.getElementsByTagName("div")[0];template.innerHTML=maskTemplate.join(""),input.inputmask.positionColorMask(input,template)}}function mask(elem){function isElementTypeSupported(input,opts){function patchValueProperty(npt){var valueGet,valueSet;function patchValhook(type){if($.valHooks&&($.valHooks[type]===undefined||!0!==$.valHooks[type].inputmaskpatch)){var valhookGet=$.valHooks[type]&&$.valHooks[type].get?$.valHooks[type].get:function(elem){return elem.value},valhookSet=$.valHooks[type]&&$.valHooks[type].set?$.valHooks[type].set:function(elem,value){return elem.value=value,elem};$.valHooks[type]={get:function get(elem){if(elem.inputmask){if(elem.inputmask.opts.autoUnmask)return elem.inputmask.unmaskedvalue();var result=valhookGet(elem);return-1!==getLastValidPosition(undefined,undefined,elem.inputmask.maskset.validPositions)||!0!==opts.nullable?result:""}return valhookGet(elem)},set:function set(elem,value){var $elem=$(elem),result;return result=valhookSet(elem,value),elem.inputmask&&$elem.trigger("setvalue",[value]),result},inputmaskpatch:!0}}}function getter(){return this.inputmask?this.inputmask.opts.autoUnmask?this.inputmask.unmaskedvalue():-1!==getLastValidPosition()||!0!==opts.nullable?document.activeElement===this&&opts.clearMaskOnLostFocus?(isRTL?clearOptionalTail(getBuffer().slice()).reverse():clearOptionalTail(getBuffer().slice())).join(""):valueGet.call(this):"":valueGet.call(this)}function setter(value){valueSet.call(this,value),this.inputmask&&$(this).trigger("setvalue",[value])}function installNativeValueSetFallback(npt){EventRuler.on(npt,"mouseenter",(function(event){var $input=$(this),input=this,value;this.inputmask._valueGet()!==getBuffer().join("")&&$input.trigger("setvalue")}))}if(!npt.inputmask.__valueGet){if(!0!==opts.noValuePatching){if(Object.getOwnPropertyDescriptor){"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="object"===_typeof("test".__proto__)?function(object){return object.__proto__}:function(object){return object.constructor.prototype});var valueProperty=Object.getPrototypeOf?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt),"value"):undefined;valueProperty&&valueProperty.get&&valueProperty.set?(valueGet=valueProperty.get,valueSet=valueProperty.set,Object.defineProperty(npt,"value",{get:getter,set:setter,configurable:!0})):"INPUT"!==npt.tagName&&(valueGet=function valueGet(){return this.textContent},valueSet=function valueSet(value){this.textContent=value},Object.defineProperty(npt,"value",{get:getter,set:setter,configurable:!0}))}else document.__lookupGetter__&&npt.__lookupGetter__("value")&&(valueGet=npt.__lookupGetter__("value"),valueSet=npt.__lookupSetter__("value"),npt.__defineGetter__("value",getter),npt.__defineSetter__("value",setter));npt.inputmask.__valueGet=valueGet,npt.inputmask.__valueSet=valueSet}npt.inputmask._valueGet=function(overruleRTL){return isRTL&&!0!==overruleRTL?valueGet.call(this.el).split("").reverse().join(""):valueGet.call(this.el)},npt.inputmask._valueSet=function(value,overruleRTL){valueSet.call(this.el,null===value||value===undefined?"":!0!==overruleRTL&&isRTL?value.split("").reverse().join(""):value)},valueGet===undefined&&(valueGet=function valueGet(){return this.value},valueSet=function valueSet(value){this.value=value},patchValhook(npt.type),installNativeValueSetFallback(npt))}}var elementType=input.getAttribute("type"),isSupported="INPUT"===input.tagName&&-1!==$.inArray(elementType,opts.supportsInputType)||input.isContentEditable||"TEXTAREA"===input.tagName;if(!isSupported)if("INPUT"===input.tagName){var el=document.createElement("input");el.setAttribute("type",elementType),isSupported="text"===el.type,el=null}else isSupported="partial";return!1!==isSupported?patchValueProperty(input):input.inputmask=undefined,isSupported}EventRuler.off(elem);var isSupported=isElementTypeSupported(elem,opts);if(!1!==isSupported&&($el=$(el=elem),originalPlaceholder=el.placeholder,-1===(maxLength=el!==undefined?el.maxLength:undefined)&&(maxLength=undefined),!0===opts.colorMask&&initializeColorMask(el),mobile&&("inputMode"in el&&(el.inputmode=opts.inputmode,el.setAttribute("inputmode",opts.inputmode)),!0===opts.disablePredictiveText&&("autocorrect"in el?el.autocorrect=!1:(!0!==opts.colorMask&&initializeColorMask(el),el.type="password"))),!0===isSupported&&(el.setAttribute("im-insert",opts.insertMode),EventRuler.on(el,"submit",EventHandlers.submitEvent),EventRuler.on(el,"reset",EventHandlers.resetEvent),EventRuler.on(el,"blur",EventHandlers.blurEvent),EventRuler.on(el,"focus",EventHandlers.focusEvent),!0!==opts.colorMask&&(EventRuler.on(el,"click",EventHandlers.clickEvent),EventRuler.on(el,"mouseleave",EventHandlers.mouseleaveEvent),EventRuler.on(el,"mouseenter",EventHandlers.mouseenterEvent)),EventRuler.on(el,"paste",EventHandlers.pasteEvent),EventRuler.on(el,"cut",EventHandlers.cutEvent),EventRuler.on(el,"complete",opts.oncomplete),EventRuler.on(el,"incomplete",opts.onincomplete),EventRuler.on(el,"cleared",opts.oncleared),mobile||!0===opts.inputEventOnly?el.removeAttribute("maxLength"):(EventRuler.on(el,"keydown",EventHandlers.keydownEvent),EventRuler.on(el,"keypress",EventHandlers.keypressEvent)),EventRuler.on(el,"input",EventHandlers.inputFallBackEvent),EventRuler.on(el,"beforeinput",EventHandlers.beforeInputEvent)),EventRuler.on(el,"setvalue",EventHandlers.setValueEvent),undoValue=getBufferTemplate().join(""),""!==el.inputmask._valueGet(!0)||!1===opts.clearMaskOnLostFocus||document.activeElement===el)){var initialValue=$.isFunction(opts.onBeforeMask)&&opts.onBeforeMask.call(inputmask,el.inputmask._valueGet(!0),opts)||el.inputmask._valueGet(!0);""!==initialValue&&checkVal(el,!0,!1,initialValue.split(""));var buffer=getBuffer().slice();undoValue=buffer.join(""),!1===isComplete(buffer)&&opts.clearIncomplete&&resetMaskSet(),opts.clearMaskOnLostFocus&&document.activeElement!==el&&(-1===getLastValidPosition()?buffer=[]:clearOptionalTail(buffer)),(!1===opts.clearMaskOnLostFocus||opts.showMaskOnFocus&&document.activeElement===el||""!==el.inputmask._valueGet(!0))&&writeBuffer(el,buffer),document.activeElement===el&&caret(el,seekNext(getLastValidPosition()))}}if(actionObj!==undefined)switch(actionObj.action){case"isComplete":return el=actionObj.el,isComplete(getBuffer());case"unmaskedvalue":return el!==undefined&&actionObj.value===undefined||(valueBuffer=actionObj.value,valueBuffer=($.isFunction(opts.onBeforeMask)&&opts.onBeforeMask.call(inputmask,valueBuffer,opts)||valueBuffer).split(""),checkVal.call(this,undefined,!1,!1,valueBuffer),$.isFunction(opts.onBeforeWrite)&&opts.onBeforeWrite.call(inputmask,undefined,getBuffer(),0,opts)),unmaskedvalue(el);case"mask":mask(el);break;case"format":return valueBuffer=($.isFunction(opts.onBeforeMask)&&opts.onBeforeMask.call(inputmask,actionObj.value,opts)||actionObj.value).split(""),checkVal.call(this,undefined,!0,!1,valueBuffer),actionObj.metadata?{value:isRTL?getBuffer().slice().reverse().join(""):getBuffer().join(""),metadata:maskScope.call(this,{action:"getmetadata"},maskset,opts)}:isRTL?getBuffer().slice().reverse().join(""):getBuffer().join("");case"isValid":actionObj.value?(valueBuffer=actionObj.value.split(""),checkVal.call(this,undefined,!0,!0,valueBuffer)):actionObj.value=getBuffer().join("");for(var buffer=getBuffer(),rl=determineLastRequiredPosition(),lmib=buffer.length-1;lmib>rl&&!isMask(lmib);lmib--);return buffer.splice(rl,lmib+1-rl),isComplete(buffer)&&actionObj.value===getBuffer().join("");case"getemptymask":return getBufferTemplate().join("");case"remove":var valueProperty;return el&&el.inputmask&&($.data(el,"_inputmask_opts",null),$el=$(el),el.inputmask._valueSet(opts.autoUnmask?unmaskedvalue(el):el.inputmask._valueGet(!0)),EventRuler.off(el),el.inputmask.colorMask&&((colorMask=el.inputmask.colorMask).removeChild(el),colorMask.parentNode.insertBefore(el,colorMask),colorMask.parentNode.removeChild(colorMask)),Object.getOwnPropertyDescriptor&&Object.getPrototypeOf?(valueProperty=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el),"value"))&&el.inputmask.__valueGet&&Object.defineProperty(el,"value",{get:el.inputmask.__valueGet,set:el.inputmask.__valueSet,configurable:!0}):document.__lookupGetter__&&el.__lookupGetter__("value")&&el.inputmask.__valueGet&&(el.__defineGetter__("value",el.inputmask.__valueGet),el.__defineSetter__("value",el.inputmask.__valueSet)),el.inputmask=undefined),el;case"getmetadata":if($.isArray(maskset.metadata)){var maskTarget=getMaskTemplate(!0,0,!1).join("");return $.each(maskset.metadata,(function(ndx,mtdt){if(mtdt.mask===maskTarget)return maskTarget=mtdt,!1})),maskTarget}return maskset.metadata}}return Inputmask.prototype={dataAttribute:"data-inputmask",defaults:{placeholder:"_",optionalmarker:["[","]"],quantifiermarker:["{","}"],groupmarker:["(",")"],alternatormarker:"|",escapeChar:"\\",mask:null,regex:null,oncomplete:$.noop,onincomplete:$.noop,oncleared:$.noop,repeat:0,greedy:!1,autoUnmask:!1,removeMaskOnSubmit:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,alias:null,onKeyDown:$.noop,onBeforeMask:null,onBeforePaste:function onBeforePaste(pastedValue,opts){return $.isFunction(opts.onBeforeMask)?opts.onBeforeMask.call(this,pastedValue,opts):pastedValue},onBeforeWrite:null,onUnMask:null,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:$.noop,skipOptionalPartCharacter:" ",numericInput:!1,rightAlign:!1,undoOnEscape:!0,radixPoint:"",_radixDance:!1,groupSeparator:"",keepStatic:null,positionCaretOnTab:!0,tabThrough:!1,supportsInputType:["text","tel","url","password","search"],ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123,0,229],isComplete:null,preValidation:null,postValidation:null,staticDefinitionSymbol:undefined,jitMasking:!1,nullable:!0,inputEventOnly:!1,noValuePatching:!1,positionCaretOnClick:"lvp",casing:null,inputmode:"verbatim",colorMask:!1,disablePredictiveText:!1,importDataAttributes:!0,shiftPositions:!0},definitions:{9:{validator:"[0-91-9]",definitionSymbol:"*"},a:{validator:"[A-Za-zА-яЁёÀ-ÿµ]",definitionSymbol:"*"},"*":{validator:"[0-91-9A-Za-zА-яЁёÀ-ÿµ]"}},aliases:{},masksCache:{},mask:function mask(elems){var that=this;function importAttributeOptions(npt,opts,userOptions,dataAttribute){if(!0===opts.importDataAttributes){var attrOptions=npt.getAttribute(dataAttribute),option,dataoptions,optionData,p,importOption=function importOption(option,optionData){null!==(optionData=optionData!==undefined?optionData:npt.getAttribute(dataAttribute+"-"+option))&&("string"==typeof optionData&&(0===option.indexOf("on")?optionData=window[optionData]:"false"===optionData?optionData=!1:"true"===optionData&&(optionData=!0)),userOptions[option]=optionData)};if(attrOptions&&""!==attrOptions&&(attrOptions=attrOptions.replace(/'/g,'"'),dataoptions=JSON.parse("{"+attrOptions+"}")),dataoptions)for(p in optionData=undefined,dataoptions)if("alias"===p.toLowerCase()){optionData=dataoptions[p];break}for(option in importOption("alias",optionData),userOptions.alias&&resolveAlias(userOptions.alias,userOptions,opts),opts){if(dataoptions)for(p in optionData=undefined,dataoptions)if(p.toLowerCase()===option.toLowerCase()){optionData=dataoptions[p];break}importOption(option,optionData)}}return $.extend(!0,opts,userOptions),("rtl"===npt.dir||opts.rightAlign)&&(npt.style.textAlign="right"),("rtl"===npt.dir||opts.numericInput)&&(npt.dir="ltr",npt.removeAttribute("dir"),opts.isRTL=!0),Object.keys(userOptions).length}return"string"==typeof elems&&(elems=document.getElementById(elems)||document.querySelectorAll(elems)),elems=elems.nodeName?[elems]:elems,$.each(elems,(function(ndx,el){var scopedOpts=$.extend(!0,{},that.opts);if(importAttributeOptions(el,scopedOpts,$.extend(!0,{},that.userOptions),that.dataAttribute)){var maskset=generateMaskSet(scopedOpts,that.noMasksCache);maskset!==undefined&&(el.inputmask!==undefined&&(el.inputmask.opts.autoUnmask=!0,el.inputmask.remove()),el.inputmask=new Inputmask(undefined,undefined,!0),el.inputmask.opts=scopedOpts,el.inputmask.noMasksCache=that.noMasksCache,el.inputmask.userOptions=$.extend(!0,{},that.userOptions),el.inputmask.isRTL=scopedOpts.isRTL||scopedOpts.numericInput,el.inputmask.el=el,el.inputmask.maskset=maskset,$.data(el,"_inputmask_opts",scopedOpts),maskScope.call(el.inputmask,{action:"mask"}))}})),elems&&elems[0]&&elems[0].inputmask||this},option:function option(options,noremask){return"string"==typeof options?this.opts[options]:"object"===(void 0===options?"undefined":_typeof(options))?($.extend(this.userOptions,options),this.el&&!0!==noremask&&this.mask(this.el),this):void 0},unmaskedvalue:function unmaskedvalue(value){return this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache),maskScope.call(this,{action:"unmaskedvalue",value:value})},remove:function remove(){return maskScope.call(this,{action:"remove"})},getemptymask:function getemptymask(){return this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache),maskScope.call(this,{action:"getemptymask"})},hasMaskedValue:function hasMaskedValue(){return!this.opts.autoUnmask},isComplete:function isComplete(){return this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache),maskScope.call(this,{action:"isComplete"})},getmetadata:function getmetadata(){return this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache),maskScope.call(this,{action:"getmetadata"})},isValid:function isValid(value){return this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache),maskScope.call(this,{action:"isValid",value:value})},format:function format(value,metadata){return this.maskset=this.maskset||generateMaskSet(this.opts,this.noMasksCache),maskScope.call(this,{action:"format",value:value,metadata:metadata})},setValue:function setValue(value){this.el&&$(this.el).trigger("setvalue",[value])},analyseMask:function analyseMask(mask,regexMask,opts){var tokenizer=/(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?(?:\|[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g,regexTokenizer=/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,escaped=!1,currentToken=new MaskToken,match,m,openenings=[],maskTokens=[],openingToken,currentOpeningToken,alternator,lastMatch,groupToken;function MaskToken(isGroup,isOptional,isQuantifier,isAlternator){this.matches=[],this.openGroup=isGroup||!1,this.alternatorGroup=!1,this.isGroup=isGroup||!1,this.isOptional=isOptional||!1,this.isQuantifier=isQuantifier||!1,this.isAlternator=isAlternator||!1,this.quantifier={min:1,max:1}}function insertTestDefinition(mtoken,element,position){position=position!==undefined?position:mtoken.matches.length;var prevMatch=mtoken.matches[position-1];if(regexMask)0===element.indexOf("[")||escaped&&/\\d|\\s|\\w]/i.test(element)||"."===element?mtoken.matches.splice(position++,0,{fn:new RegExp(element,opts.casing?"i":""),optionality:!1,newBlockMarker:prevMatch===undefined?"master":prevMatch.def!==element,casing:null,def:element,placeholder:undefined,nativeDef:element}):(escaped&&(element=element[element.length-1]),$.each(element.split(""),(function(ndx,lmnt){prevMatch=mtoken.matches[position-1],mtoken.matches.splice(position++,0,{fn:null,optionality:!1,newBlockMarker:prevMatch===undefined?"master":prevMatch.def!==lmnt&&null!==prevMatch.fn,casing:null,def:opts.staticDefinitionSymbol||lmnt,placeholder:opts.staticDefinitionSymbol!==undefined?lmnt:undefined,nativeDef:(escaped?"'":"")+lmnt})}))),escaped=!1;else{var maskdef=(opts.definitions?opts.definitions[element]:undefined)||Inputmask.prototype.definitions[element];maskdef&&!escaped?mtoken.matches.splice(position++,0,{fn:maskdef.validator?"string"==typeof maskdef.validator?new RegExp(maskdef.validator,opts.casing?"i":""):new function(){this.test=maskdef.validator}:new RegExp("."),optionality:!1,newBlockMarker:prevMatch===undefined?"master":prevMatch.def!==(maskdef.definitionSymbol||element),casing:maskdef.casing,def:maskdef.definitionSymbol||element,placeholder:maskdef.placeholder,nativeDef:element}):(mtoken.matches.splice(position++,0,{fn:null,optionality:!1,newBlockMarker:prevMatch===undefined?"master":prevMatch.def!==element&&null!==prevMatch.fn,casing:null,def:opts.staticDefinitionSymbol||element,placeholder:opts.staticDefinitionSymbol!==undefined?element:undefined,nativeDef:(escaped?"'":"")+element}),escaped=!1)}}function verifyGroupMarker(maskToken){maskToken&&maskToken.matches&&$.each(maskToken.matches,(function(ndx,token){var nextToken=maskToken.matches[ndx+1];(nextToken===undefined||nextToken.matches===undefined||!1===nextToken.isQuantifier)&&token&&token.isGroup&&(token.isGroup=!1,regexMask||(insertTestDefinition(token,opts.groupmarker[0],0),!0!==token.openGroup&&insertTestDefinition(token,opts.groupmarker[1]))),verifyGroupMarker(token)}))}function defaultCase(){if(openenings.length>0){if(insertTestDefinition(currentOpeningToken=openenings[openenings.length-1],m),currentOpeningToken.isAlternator){alternator=openenings.pop();for(var mndx=0;mndx<alternator.matches.length;mndx++)alternator.matches[mndx].isGroup&&(alternator.matches[mndx].isGroup=!1);openenings.length>0?(currentOpeningToken=openenings[openenings.length-1]).matches.push(alternator):currentToken.matches.push(alternator)}}else insertTestDefinition(currentToken,m)}function reverseTokens(maskToken){function reverseStatic(st){return st===opts.optionalmarker[0]?st=opts.optionalmarker[1]:st===opts.optionalmarker[1]?st=opts.optionalmarker[0]:st===opts.groupmarker[0]?st=opts.groupmarker[1]:st===opts.groupmarker[1]&&(st=opts.groupmarker[0]),st}for(var match in maskToken.matches=maskToken.matches.reverse(),maskToken.matches)if(maskToken.matches.hasOwnProperty(match)){var intMatch=parseInt(match);if(maskToken.matches[match].isQuantifier&&maskToken.matches[intMatch+1]&&maskToken.matches[intMatch+1].isGroup){var qt=maskToken.matches[match];maskToken.matches.splice(match,1),maskToken.matches.splice(intMatch+1,0,qt)}maskToken.matches[match].matches!==undefined?maskToken.matches[match]=reverseTokens(maskToken.matches[match]):maskToken.matches[match]=reverseStatic(maskToken.matches[match])}return maskToken}function groupify(matches){var groupToken=new MaskToken(!0);return groupToken.openGroup=!1,groupToken.matches=matches,groupToken}for(regexMask&&(opts.optionalmarker[0]=undefined,opts.optionalmarker[1]=undefined);match=regexMask?regexTokenizer.exec(mask):tokenizer.exec(mask);){if(m=match[0],regexMask)switch(m.charAt(0)){case"?":m="{0,1}";break;case"+":case"*":m="{"+m+"}"}if(escaped)defaultCase();else switch(m.charAt(0)){case"(?=":case"(?!":case"(?<=":case"(?<!":break;case opts.escapeChar:escaped=!0,regexMask&&defaultCase();break;case opts.optionalmarker[1]:case opts.groupmarker[1]:if((openingToken=openenings.pop()).openGroup=!1,openingToken!==undefined)if(openenings.length>0){if((currentOpeningToken=openenings[openenings.length-1]).matches.push(openingToken),currentOpeningToken.isAlternator){alternator=openenings.pop();for(var mndx=0;mndx<alternator.matches.length;mndx++)alternator.matches[mndx].isGroup=!1,alternator.matches[mndx].alternatorGroup=!1;openenings.length>0?(currentOpeningToken=openenings[openenings.length-1]).matches.push(alternator):currentToken.matches.push(alternator)}}else currentToken.matches.push(openingToken);else defaultCase();break;case opts.optionalmarker[0]:openenings.push(new MaskToken(!1,!0));break;case opts.groupmarker[0]:openenings.push(new MaskToken(!0));break;case opts.quantifiermarker[0]:var quantifier=new MaskToken(!1,!1,!0),mqj=(m=m.replace(/[{}]/g,"")).split("|"),mq=mqj[0].split(","),mq0=isNaN(mq[0])?mq[0]:parseInt(mq[0]),mq1=1===mq.length?mq0:isNaN(mq[1])?mq[1]:parseInt(mq[1]);"*"!==mq0&&"+"!==mq0||(mq0="*"===mq1?0:1),quantifier.quantifier={min:mq0,max:mq1,jit:mqj[1]};var matches=openenings.length>0?openenings[openenings.length-1].matches:currentToken.matches;if((match=matches.pop()).isAlternator){matches.push(match),matches=match.matches;var groupToken=new MaskToken(!0),tmpMatch=matches.pop();matches.push(groupToken),matches=groupToken.matches,match=tmpMatch}match.isGroup||(match=groupify([match])),matches.push(match),matches.push(quantifier);break;case opts.alternatormarker:var groupQuantifier=function groupQuantifier(matches){var lastMatch=matches.pop();return lastMatch.isQuantifier&&(lastMatch=groupify([matches.pop(),lastMatch])),lastMatch};if(openenings.length>0){var subToken=(currentOpeningToken=openenings[openenings.length-1]).matches[currentOpeningToken.matches.length-1];lastMatch=currentOpeningToken.openGroup&&(subToken.matches===undefined||!1===subToken.isGroup&&!1===subToken.isAlternator)?openenings.pop():groupQuantifier(currentOpeningToken.matches)}else lastMatch=groupQuantifier(currentToken.matches);if(lastMatch.isAlternator)openenings.push(lastMatch);else if(lastMatch.alternatorGroup?(alternator=openenings.pop(),lastMatch.alternatorGroup=!1):alternator=new MaskToken(!1,!1,!1,!0),alternator.matches.push(lastMatch),openenings.push(alternator),lastMatch.openGroup){lastMatch.openGroup=!1;var alternatorGroup=new MaskToken(!0);alternatorGroup.alternatorGroup=!0,openenings.push(alternatorGroup)}break;default:defaultCase()}}for(;openenings.length>0;)openingToken=openenings.pop(),currentToken.matches.push(openingToken);return currentToken.matches.length>0&&(verifyGroupMarker(currentToken),maskTokens.push(currentToken)),(opts.numericInput||opts.isRTL)&&reverseTokens(maskTokens[0]),maskTokens},positionColorMask:function positionColorMask(input,template){input.style.left=template.offsetLeft+"px"}},Inputmask.extendDefaults=function(options){$.extend(!0,Inputmask.prototype.defaults,options)},Inputmask.extendDefinitions=function(definition){$.extend(!0,Inputmask.prototype.definitions,definition)},Inputmask.extendAliases=function(alias){$.extend(!0,Inputmask.prototype.aliases,alias)},Inputmask.format=function(value,options,metadata){return Inputmask(options).format(value,metadata)},Inputmask.unmask=function(value,options){return Inputmask(options).unmaskedvalue(value)},Inputmask.isValid=function(value,options){return Inputmask(options).isValid(value)},Inputmask.remove=function(elems){"string"==typeof elems&&(elems=document.getElementById(elems)||document.querySelectorAll(elems)),elems=elems.nodeName?[elems]:elems,$.each(elems,(function(ndx,el){el.inputmask&&el.inputmask.remove()}))},Inputmask.setValue=function(elems,value){"string"==typeof elems&&(elems=document.getElementById(elems)||document.querySelectorAll(elems)),elems=elems.nodeName?[elems]:elems,$.each(elems,(function(ndx,el){el.inputmask?el.inputmask.setValue(value):$(el).trigger("setvalue",[value])}))},Inputmask.escapeRegex=function(str){var specials=["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^"];return str.replace(new RegExp("(\\"+specials.join("|\\")+")","gim"),"\\$1")},Inputmask.keyCode={BACKSPACE:8,BACKSPACE_SAFARI:127,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,SPACE:32,TAB:9,UP:38,X:88,CONTROL:17},Inputmask.dependencyLib=$,Inputmask},__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(3),__webpack_require__(5)],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=factory)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},factory;factory=function($){return $},__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(4)],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=factory)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports){module.exports=jQuery},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};__WEBPACK_AMD_DEFINE_RESULT__=function(){return"undefined"!=typeof window?window:new(eval("require('jsdom').JSDOM"))("").window}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},factory;factory=function(Inputmask){var $=Inputmask.dependencyLib,formatCode={d:["[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",Date.prototype.getDate],dd:["0[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",function(){return pad(Date.prototype.getDate.call(this),2)}],ddd:[""],dddd:[""],m:["[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return Date.prototype.getMonth.call(this)+1}],mm:["0[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return pad(Date.prototype.getMonth.call(this)+1,2)}],mmm:[""],mmmm:[""],yy:["[0-9]{2}",Date.prototype.setFullYear,"year",function(){return pad(Date.prototype.getFullYear.call(this),2)}],yyyy:["[0-9]{4}",Date.prototype.setFullYear,"year",function(){return pad(Date.prototype.getFullYear.call(this),4)}],h:["[1-9]|1[0-2]",Date.prototype.setHours,"hours",Date.prototype.getHours],hh:["0[1-9]|1[0-2]",Date.prototype.setHours,"hours",function(){return pad(Date.prototype.getHours.call(this),2)}],hhh:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],H:["1?[0-9]|2[0-3]",Date.prototype.setHours,"hours",Date.prototype.getHours],HH:["0[0-9]|1[0-9]|2[0-3]",Date.prototype.setHours,"hours",function(){return pad(Date.prototype.getHours.call(this),2)}],HHH:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],M:["[1-5]?[0-9]",Date.prototype.setMinutes,"minutes",Date.prototype.getMinutes],MM:["0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]",Date.prototype.setMinutes,"minutes",function(){return pad(Date.prototype.getMinutes.call(this),2)}],ss:["[0-5][0-9]",Date.prototype.setSeconds,"seconds",function(){return pad(Date.prototype.getSeconds.call(this),2)}],l:["[0-9]{3}",Date.prototype.setMilliseconds,"milliseconds",function(){return pad(Date.prototype.getMilliseconds.call(this),3)}],L:["[0-9]{2}",Date.prototype.setMilliseconds,"milliseconds",function(){return pad(Date.prototype.getMilliseconds.call(this),2)}],t:["[ap]"],tt:["[ap]m"],T:["[AP]"],TT:["[AP]M"],Z:[""],o:[""],S:[""]},formatAlias={isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};function getTokenizer(opts){if(!opts.tokenizer){var tokens=[];for(var ndx in formatCode)-1===tokens.indexOf(ndx[0])&&tokens.push(ndx[0]);opts.tokenizer="("+tokens.join("+|")+")+?|.",opts.tokenizer=new RegExp(opts.tokenizer,"g")}return opts.tokenizer}function isValidDate(dateParts,currentResult){return(!isFinite(dateParts.rawday)||"29"==dateParts.day&&!isFinite(dateParts.rawyear)||new Date(dateParts.date.getFullYear(),isFinite(dateParts.rawmonth)?dateParts.month:dateParts.date.getMonth()+1,0).getDate()>=dateParts.day)&¤tResult}function isDateInRange(dateParts,opts){var result=!0;if(opts.min){if(dateParts.rawyear){var rawYear=dateParts.rawyear.replace(/[^0-9]/g,""),minYear;result=opts.min.year.substr(0,rawYear.length)<=rawYear}dateParts.year===dateParts.rawyear&&opts.min.date.getTime()==opts.min.date.getTime()&&(result=opts.min.date.getTime()<=dateParts.date.getTime())}return result&&opts.max&&opts.max.date.getTime()==opts.max.date.getTime()&&(result=opts.max.date.getTime()>=dateParts.date.getTime()),result}function parse(format,dateObjValue,opts,raw){for(var mask="",match;match=getTokenizer(opts).exec(format);){var getFn;if(void 0===dateObjValue)if(formatCode[match[0]])mask+="("+formatCode[match[0]][0]+")";else switch(match[0]){case"[":mask+="(";break;case"]":mask+=")?";break;default:mask+=Inputmask.escapeRegex(match[0])}else formatCode[match[0]]?!0!==raw&&formatCode[match[0]][3]?mask+=formatCode[match[0]][3].call(dateObjValue.date):formatCode[match[0]][2]?mask+=dateObjValue["raw"+formatCode[match[0]][2]]:mask+=match[0]:mask+=match[0]}return mask}function pad(val,len){for(val=String(val),len=len||2;val.length<len;)val="0"+val;return val}function analyseMask(maskString,format,opts){var dateObj={date:new Date(1,0,1)},targetProp,mask=maskString,match,dateOperation,targetValidator;function extendProperty(value){var correctedValue=value.replace(/[^0-9]/g,"0");if(correctedValue!=value){var enteredPart=value.replace(/[^0-9]/g,""),min=(opts.min&&opts.min[targetProp]||value).toString(),max=(opts.max&&opts.max[targetProp]||value).toString();correctedValue=enteredPart+(enteredPart<min.slice(0,enteredPart.length)?min.slice(enteredPart.length):enteredPart>max.slice(0,enteredPart.length)?max.slice(enteredPart.length):correctedValue.toString().slice(enteredPart.length))}return correctedValue}function setValue(dateObj,value,opts){dateObj[targetProp]=extendProperty(value),dateObj["raw"+targetProp]=value,void 0!==dateOperation&&dateOperation.call(dateObj.date,"month"==targetProp?parseInt(dateObj[targetProp])-1:dateObj[targetProp])}if("string"==typeof mask){for(;match=getTokenizer(opts).exec(format);){var value=mask.slice(0,match[0].length);formatCode.hasOwnProperty(match[0])&&(targetValidator=formatCode[match[0]][0],targetProp=formatCode[match[0]][2],dateOperation=formatCode[match[0]][1],setValue(dateObj,value,opts)),mask=mask.slice(value.length)}return dateObj}if(mask&&"object"===(void 0===mask?"undefined":_typeof(mask))&&mask.hasOwnProperty("date"))return mask}return Inputmask.extendAliases({datetime:{mask:function mask(opts){return formatCode.S=opts.i18n.ordinalSuffix.join("|"),opts.inputFormat=formatAlias[opts.inputFormat]||opts.inputFormat,opts.displayFormat=formatAlias[opts.displayFormat]||opts.displayFormat||opts.inputFormat,opts.outputFormat=formatAlias[opts.outputFormat]||opts.outputFormat||opts.inputFormat,opts.placeholder=""!==opts.placeholder?opts.placeholder:opts.inputFormat.replace(/[\[\]]/,""),opts.regex=parse(opts.inputFormat,void 0,opts),null},placeholder:"",inputFormat:"isoDateTime",displayFormat:void 0,outputFormat:void 0,min:null,max:null,i18n:{dayNames:["Mon","Tue","Wed","Thu","Fri","Sat","Sun","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],ordinalSuffix:["st","nd","rd","th"]},postValidation:function postValidation(buffer,pos,currentResult,opts){opts.min=analyseMask(opts.min,opts.inputFormat,opts),opts.max=analyseMask(opts.max,opts.inputFormat,opts);var result=currentResult,dateParts=analyseMask(buffer.join(""),opts.inputFormat,opts);return result&&dateParts.date.getTime()==dateParts.date.getTime()&&(result=(result=isValidDate(dateParts,result))&&isDateInRange(dateParts,opts)),pos&&result&¤tResult.pos!==pos?{buffer:parse(opts.inputFormat,dateParts,opts),refreshFromBuffer:{start:pos,end:currentResult.pos}}:result},onKeyDown:function onKeyDown(e,buffer,caretPos,opts){var input=this;if(e.ctrlKey&&e.keyCode===Inputmask.keyCode.RIGHT){for(var today=new Date,match,date="";match=getTokenizer(opts).exec(opts.inputFormat);)"d"===match[0].charAt(0)?date+=pad(today.getDate(),match[0].length):"m"===match[0].charAt(0)?date+=pad(today.getMonth()+1,match[0].length):"yyyy"===match[0]?date+=today.getFullYear().toString():"y"===match[0].charAt(0)&&(date+=pad(today.getYear(),match[0].length));this.inputmask._valueSet(date),$(this).trigger("setvalue")}},onUnMask:function onUnMask(maskedValue,unmaskedValue,opts){return parse(opts.outputFormat,analyseMask(maskedValue,opts.inputFormat,opts),opts,!0)},casing:function casing(elem,test,pos,validPositions){return 0==test.nativeDef.indexOf("[ap]")?elem.toLowerCase():0==test.nativeDef.indexOf("[AP]")?elem.toUpperCase():elem},insertMode:!1,shiftPositions:!1}}),Inputmask},__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2)],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=factory)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},factory;factory=function(Inputmask){var $=Inputmask.dependencyLib;function autoEscape(txt,opts){for(var escapedTxt="",i=0;i<txt.length;i++)Inputmask.prototype.definitions[txt.charAt(i)]||opts.definitions[txt.charAt(i)]||opts.optionalmarker.start===txt.charAt(i)||opts.optionalmarker.end===txt.charAt(i)||opts.quantifiermarker.start===txt.charAt(i)||opts.quantifiermarker.end===txt.charAt(i)||opts.groupmarker.start===txt.charAt(i)||opts.groupmarker.end===txt.charAt(i)||opts.alternatormarker===txt.charAt(i)?escapedTxt+="\\"+txt.charAt(i):escapedTxt+=txt.charAt(i);return escapedTxt}function alignDigits(buffer,digits,opts){if(digits>0){var radixPosition=$.inArray(opts.radixPoint,buffer);-1===radixPosition&&(buffer.push(opts.radixPoint),radixPosition=buffer.length-1);for(var i=1;i<=digits;i++)buffer[radixPosition+i]=buffer[radixPosition+i]||"0"}return buffer}return Inputmask.extendAliases({numeric:{mask:function mask(opts){if(0!==opts.repeat&&isNaN(opts.integerDigits)&&(opts.integerDigits=opts.repeat),opts.repeat=0,opts.groupSeparator===opts.radixPoint&&opts.digits&&"0"!==opts.digits&&("."===opts.radixPoint?opts.groupSeparator=",":","===opts.radixPoint?opts.groupSeparator=".":opts.groupSeparator="")," "===opts.groupSeparator&&(opts.skipOptionalPartCharacter=void 0),opts.autoGroup=opts.autoGroup&&""!==opts.groupSeparator,opts.autoGroup&&("string"==typeof opts.groupSize&&isFinite(opts.groupSize)&&(opts.groupSize=parseInt(opts.groupSize)),isFinite(opts.integerDigits))){var seps=Math.floor(opts.integerDigits/opts.groupSize),mod=opts.integerDigits%opts.groupSize;opts.integerDigits=parseInt(opts.integerDigits)+(0===mod?seps-1:seps),opts.integerDigits<1&&(opts.integerDigits="*")}opts.placeholder.length>1&&(opts.placeholder=opts.placeholder.charAt(0)),"radixFocus"===opts.positionCaretOnClick&&""===opts.placeholder&&!1===opts.integerOptional&&(opts.positionCaretOnClick="lvp"),opts.definitions[";"]=opts.definitions["~"],opts.definitions[";"].definitionSymbol="~",!0===opts.numericInput&&(opts.positionCaretOnClick="radixFocus"===opts.positionCaretOnClick?"lvp":opts.positionCaretOnClick,opts.digitsOptional=!1,isNaN(opts.digits)&&(opts.digits=2),opts.decimalProtect=!1);var mask="[+]";if(mask+=autoEscape(opts.prefix,opts),!0===opts.integerOptional?mask+="~{1,"+opts.integerDigits+"}":mask+="~{"+opts.integerDigits+"}",void 0!==opts.digits){var radixDef=opts.decimalProtect?":":opts.radixPoint,dq=opts.digits.toString().split(",");isFinite(dq[0])&&dq[1]&&isFinite(dq[1])?mask+=radixDef+";{"+opts.digits+"}":(isNaN(opts.digits)||parseInt(opts.digits)>0)&&(opts.digitsOptional?mask+="["+radixDef+";{1,"+opts.digits+"}]":mask+=radixDef+";{"+opts.digits+"}")}return mask+=autoEscape(opts.suffix,opts),mask+="[-]",opts.greedy=!1,mask},placeholder:"",greedy:!1,digits:"*",digitsOptional:!0,enforceDigitsOnBlur:!1,radixPoint:".",positionCaretOnClick:"radixFocus",groupSize:3,groupSeparator:"",autoGroup:!1,allowMinus:!0,negationSymbol:{front:"-",back:""},integerDigits:"+",integerOptional:!0,prefix:"",suffix:"",rightAlign:!0,decimalProtect:!0,min:null,max:null,step:1,insertMode:!0,autoUnmask:!1,unmaskAsNumber:!1,inputType:"text",inputmode:"numeric",preValidation:function preValidation(buffer,pos,c,isSelection,opts,maskset){if("-"===c||c===opts.negationSymbol.front)return!0===opts.allowMinus&&(opts.isNegative=void 0===opts.isNegative||!opts.isNegative,""===buffer.join("")||{caret:maskset.validPositions[pos]?pos:void 0,dopost:!0});if(!1===isSelection&&c===opts.radixPoint&&void 0!==opts.digits&&(isNaN(opts.digits)||parseInt(opts.digits)>0)){var radixPos=$.inArray(opts.radixPoint,buffer);if(-1!==radixPos&&void 0!==maskset.validPositions[radixPos])return!0===opts.numericInput?pos===radixPos:{caret:radixPos+1}}return!0},postValidation:function postValidation(buffer,pos,currentResult,opts){function buildPostMask(buffer,opts){var postMask="";if(postMask+="("+opts.groupSeparator+"*{"+opts.groupSize+"}){*}",""!==opts.radixPoint){var radixSplit=buffer.join("").split(opts.radixPoint);radixSplit[1]&&(postMask+=opts.radixPoint+"*{"+radixSplit[1].match(/^\d*\??\d*/)[0].length+"}")}return postMask}var suffix=opts.suffix.split(""),prefix=opts.prefix.split("");if(void 0===currentResult.pos&&void 0!==currentResult.caret&&!0!==currentResult.dopost)return currentResult;var caretPos=void 0!==currentResult.caret?currentResult.caret:currentResult.pos,maskedValue=buffer.slice();opts.numericInput&&(caretPos=maskedValue.length-caretPos-1,maskedValue=maskedValue.reverse());var charAtPos=maskedValue[caretPos];if(charAtPos===opts.groupSeparator&&(charAtPos=maskedValue[caretPos+=1]),caretPos===maskedValue.length-opts.suffix.length-1&&charAtPos===opts.radixPoint)return currentResult;void 0!==charAtPos&&charAtPos!==opts.radixPoint&&charAtPos!==opts.negationSymbol.front&&charAtPos!==opts.negationSymbol.back&&(maskedValue[caretPos]="?",opts.prefix.length>0&&caretPos>=(!1===opts.isNegative?1:0)&&caretPos<opts.prefix.length-1+(!1===opts.isNegative?1:0)?prefix[caretPos-(!1===opts.isNegative?1:0)]="?":opts.suffix.length>0&&caretPos>=maskedValue.length-opts.suffix.length-(!1===opts.isNegative?1:0)&&(suffix[caretPos-(maskedValue.length-opts.suffix.length-(!1===opts.isNegative?1:0))]="?")),prefix=prefix.join(""),suffix=suffix.join("");var processValue=maskedValue.join("").replace(prefix,"");if(processValue=(processValue=(processValue=(processValue=processValue.replace(suffix,"")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),"")).replace(new RegExp("[-"+Inputmask.escapeRegex(opts.negationSymbol.front)+"]","g"),"")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),""),isNaN(opts.placeholder)&&(processValue=processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder),"g"),"")),processValue.length>1&&1!==processValue.indexOf(opts.radixPoint)&&("0"===charAtPos&&(processValue=processValue.replace(/^\?/g,"")),processValue=processValue.replace(/^0/g,"")),processValue.charAt(0)===opts.radixPoint&&""!==opts.radixPoint&&!0!==opts.numericInput&&(processValue="0"+processValue),""!==processValue){if(processValue=processValue.split(""),(!opts.digitsOptional||opts.enforceDigitsOnBlur&&"blur"===currentResult.event)&&isFinite(opts.digits)){var radixPosition=$.inArray(opts.radixPoint,processValue),rpb=$.inArray(opts.radixPoint,maskedValue);-1===radixPosition&&(processValue.push(opts.radixPoint),radixPosition=processValue.length-1);for(var i=1;i<=opts.digits;i++)opts.digitsOptional&&(!opts.enforceDigitsOnBlur||"blur"!==currentResult.event)||void 0!==processValue[radixPosition+i]&&processValue[radixPosition+i]!==opts.placeholder.charAt(0)?-1!==rpb&&void 0!==maskedValue[rpb+i]&&(processValue[radixPosition+i]=processValue[radixPosition+i]||maskedValue[rpb+i]):processValue[radixPosition+i]=currentResult.placeholder||opts.placeholder.charAt(0)}if(!0!==opts.autoGroup||""===opts.groupSeparator||charAtPos===opts.radixPoint&&void 0===currentResult.pos&&!currentResult.dopost)processValue=processValue.join("");else{var addRadix=processValue[processValue.length-1]===opts.radixPoint&¤tResult.c===opts.radixPoint;processValue=Inputmask(buildPostMask(processValue,opts),{numericInput:!0,jitMasking:!0,definitions:{"*":{validator:"[0-9?]",cardinality:1}}}).format(processValue.join("")),addRadix&&(processValue+=opts.radixPoint),processValue.charAt(0)===opts.groupSeparator&&processValue.substr(1)}}if(opts.isNegative&&"blur"===currentResult.event&&(opts.isNegative="0"!==processValue),processValue=prefix+processValue,processValue+=suffix,opts.isNegative&&(processValue=opts.negationSymbol.front+processValue,processValue+=opts.negationSymbol.back),processValue=processValue.split(""),void 0!==charAtPos)if(charAtPos!==opts.radixPoint&&charAtPos!==opts.negationSymbol.front&&charAtPos!==opts.negationSymbol.back)(caretPos=$.inArray("?",processValue))>-1?processValue[caretPos]=charAtPos:caretPos=currentResult.caret||0;else if(charAtPos===opts.radixPoint||charAtPos===opts.negationSymbol.front||charAtPos===opts.negationSymbol.back){var newCaretPos=$.inArray(charAtPos,processValue);-1!==newCaretPos&&(caretPos=newCaretPos)}opts.numericInput&&(caretPos=processValue.length-caretPos-1,processValue=processValue.reverse());var rslt={caret:void 0!==charAtPos&&void 0===currentResult.pos||void 0===caretPos?caretPos:caretPos+(opts.numericInput?-1:1),buffer:processValue,refreshFromBuffer:currentResult.dopost||buffer.join("")!==processValue.join("")};return rslt.refreshFromBuffer?rslt:currentResult},onBeforeWrite:function onBeforeWrite(e,buffer,caretPos,opts){function parseMinMaxOptions(opts){void 0===opts.parseMinMaxOptions&&(null!==opts.min&&(opts.min=opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),""),","===opts.radixPoint&&(opts.min=opts.min.replace(opts.radixPoint,".")),opts.min=isFinite(opts.min)?parseFloat(opts.min):NaN,isNaN(opts.min)&&(opts.min=Number.MIN_VALUE)),null!==opts.max&&(opts.max=opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),""),","===opts.radixPoint&&(opts.max=opts.max.replace(opts.radixPoint,".")),opts.max=isFinite(opts.max)?parseFloat(opts.max):NaN,isNaN(opts.max)&&(opts.max=Number.MAX_VALUE)),opts.parseMinMaxOptions="done")}if(e)switch(e.type){case"keydown":return opts.postValidation(buffer,caretPos,{caret:caretPos,dopost:!0},opts);case"blur":case"checkval":var unmasked;if(parseMinMaxOptions(opts),null!==opts.min||null!==opts.max){if(unmasked=opts.onUnMask(buffer.join(""),void 0,$.extend({},opts,{unmaskAsNumber:!0})),null!==opts.min&&unmasked<opts.min)return opts.isNegative=opts.min<0,opts.postValidation(opts.min.toString().replace(".",opts.radixPoint).split(""),caretPos,{caret:caretPos,dopost:!0,placeholder:"0"},opts);if(null!==opts.max&&unmasked>opts.max)return opts.isNegative=opts.max<0,opts.postValidation(opts.max.toString().replace(".",opts.radixPoint).split(""),caretPos,{caret:caretPos,dopost:!0,placeholder:"0"},opts)}return opts.postValidation(buffer,caretPos,{caret:caretPos,placeholder:"0",event:"blur"},opts);case"_checkval":return{caret:caretPos}}},regex:{integerPart:function integerPart(opts,emptyCheck){return emptyCheck?new RegExp("["+Inputmask.escapeRegex(opts.negationSymbol.front)+"+]?"):new RegExp("["+Inputmask.escapeRegex(opts.negationSymbol.front)+"+]?\\d+")},integerNPart:function integerNPart(opts){return new RegExp("[\\d"+Inputmask.escapeRegex(opts.groupSeparator)+Inputmask.escapeRegex(opts.placeholder.charAt(0))+"]+")}},definitions:{"~":{validator:function validator(chrs,maskset,pos,strict,opts,isSelection){var isValid,l;if("k"===chrs||"m"===chrs){isValid={insert:[],c:0};for(var i=0,l="k"===chrs?2:5;i<l;i++)isValid.insert.push({pos:pos+i,c:0});return isValid.pos=pos+l,isValid}if(!0===(isValid=strict?new RegExp("[0-9"+Inputmask.escapeRegex(opts.groupSeparator)+"]").test(chrs):new RegExp("[0-9]").test(chrs))){if(!0!==opts.numericInput&&void 0!==maskset.validPositions[pos]&&"~"===maskset.validPositions[pos].match.def&&!isSelection){var processValue=maskset.buffer.join(""),pvRadixSplit=(processValue=(processValue=processValue.replace(new RegExp("[-"+Inputmask.escapeRegex(opts.negationSymbol.front)+"]","g"),"")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),"")).split(opts.radixPoint);pvRadixSplit.length>1&&(pvRadixSplit[1]=pvRadixSplit[1].replace(/0/g,opts.placeholder.charAt(0))),"0"===pvRadixSplit[0]&&(pvRadixSplit[0]=pvRadixSplit[0].replace(/0/g,opts.placeholder.charAt(0))),processValue=pvRadixSplit[0]+opts.radixPoint+pvRadixSplit[1]||"";var bufferTemplate=maskset._buffer.join("");for(processValue===opts.radixPoint&&(processValue=bufferTemplate);null===processValue.match(Inputmask.escapeRegex(bufferTemplate)+"$");)bufferTemplate=bufferTemplate.slice(1);isValid=void 0===(processValue=(processValue=processValue.replace(bufferTemplate,"")).split(""))[pos]?{pos:pos,remove:pos}:{pos:pos}}}else strict||chrs!==opts.radixPoint||void 0!==maskset.validPositions[pos-1]||(isValid={insert:{pos:pos,c:0},pos:pos+1});return isValid},cardinality:1},"+":{validator:function validator(chrs,maskset,pos,strict,opts){return opts.allowMinus&&("-"===chrs||chrs===opts.negationSymbol.front)},cardinality:1,placeholder:""},"-":{validator:function validator(chrs,maskset,pos,strict,opts){return opts.allowMinus&&chrs===opts.negationSymbol.back},cardinality:1,placeholder:""},":":{validator:function validator(chrs,maskset,pos,strict,opts){var radix="["+Inputmask.escapeRegex(opts.radixPoint)+"]",isValid=new RegExp(radix).test(chrs);return isValid&&maskset.validPositions[pos]&&maskset.validPositions[pos].match.placeholder===opts.radixPoint&&(isValid={caret:pos+1}),isValid},cardinality:1,placeholder:function placeholder(opts){return opts.radixPoint}}},onUnMask:function onUnMask(maskedValue,unmaskedValue,opts){if(""===unmaskedValue&&!0===opts.nullable)return unmaskedValue;var processValue=maskedValue.replace(opts.prefix,"");return processValue=(processValue=processValue.replace(opts.suffix,"")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),""),""!==opts.placeholder.charAt(0)&&(processValue=processValue.replace(new RegExp(opts.placeholder.charAt(0),"g"),"0")),opts.unmaskAsNumber?(""!==opts.radixPoint&&-1!==processValue.indexOf(opts.radixPoint)&&(processValue=processValue.replace(Inputmask.escapeRegex.call(this,opts.radixPoint),".")),processValue=(processValue=processValue.replace(new RegExp("^"+Inputmask.escapeRegex(opts.negationSymbol.front)),"-")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),""),Number(processValue)):processValue},isComplete:function isComplete(buffer,opts){var maskedValue=(opts.numericInput?buffer.slice().reverse():buffer).join("");return maskedValue=(maskedValue=(maskedValue=(maskedValue=(maskedValue=maskedValue.replace(new RegExp("^"+Inputmask.escapeRegex(opts.negationSymbol.front)),"-")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),"")).replace(opts.prefix,"")).replace(opts.suffix,"")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator)+"([0-9]{3})","g"),"$1"),","===opts.radixPoint&&(maskedValue=maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint),".")),isFinite(maskedValue)},onBeforeMask:function onBeforeMask(initialValue,opts){opts.isNegative=void 0;var radixPoint=opts.radixPoint||",";"number"!=typeof initialValue&&"number"!==opts.inputType||""===radixPoint||(initialValue=initialValue.toString().replace(".",radixPoint));var valueParts=initialValue.split(radixPoint),integerPart=valueParts[0].replace(/[^\-0-9]/g,""),decimalPart=valueParts.length>1?valueParts[1].replace(/[^0-9]/g,""):"";initialValue=integerPart+(""!==decimalPart?radixPoint+decimalPart:decimalPart);var digits=0;if(""!==radixPoint&&(digits=decimalPart.length,""!==decimalPart)){var digitsFactor=Math.pow(10,digits||1);isFinite(opts.digits)&&(digits=parseInt(opts.digits),digitsFactor=Math.pow(10,digits)),initialValue=initialValue.replace(Inputmask.escapeRegex(radixPoint),"."),isFinite(initialValue)&&(initialValue=Math.round(parseFloat(initialValue)*digitsFactor)/digitsFactor),initialValue=initialValue.toString().replace(".",radixPoint)}return 0===opts.digits&&-1!==initialValue.indexOf(Inputmask.escapeRegex(radixPoint))&&(initialValue=initialValue.substring(0,initialValue.indexOf(Inputmask.escapeRegex(radixPoint)))),alignDigits(initialValue.toString().split(""),digits,opts).join("")},onKeyDown:function onKeyDown(e,buffer,caretPos,opts){var $input=$(this);if(e.ctrlKey)switch(e.keyCode){case Inputmask.keyCode.UP:$input.val(parseFloat(this.inputmask.unmaskedvalue())+parseInt(opts.step)),$input.trigger("setvalue");break;case Inputmask.keyCode.DOWN:$input.val(parseFloat(this.inputmask.unmaskedvalue())-parseInt(opts.step)),$input.trigger("setvalue")}}},currency:{prefix:"$ ",groupSeparator:",",alias:"numeric",placeholder:"0",autoGroup:!0,digits:2,digitsOptional:!1,clearMaskOnLostFocus:!1},decimal:{alias:"numeric"},integer:{alias:"numeric",digits:0,radixPoint:""},percentage:{alias:"numeric",digits:2,digitsOptional:!0,radixPoint:".",placeholder:"0",autoGroup:!1,min:0,max:100,suffix:" %",allowMinus:!1}}),Inputmask},__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2)],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=factory)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){"use strict";var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},factory;factory=function($,Inputmask){return void 0===$.fn.inputmask&&($.fn.inputmask=function(fn,options){var nptmask,input=this[0];if(void 0===options&&(options={}),"string"==typeof fn)switch(fn){case"unmaskedvalue":return input&&input.inputmask?input.inputmask.unmaskedvalue():$(input).val();case"remove":return this.each((function(){this.inputmask&&this.inputmask.remove()}));case"getemptymask":return input&&input.inputmask?input.inputmask.getemptymask():"";case"hasMaskedValue":return!(!input||!input.inputmask)&&input.inputmask.hasMaskedValue();case"isComplete":return!input||!input.inputmask||input.inputmask.isComplete();case"getmetadata":return input&&input.inputmask?input.inputmask.getmetadata():void 0;case"setvalue":Inputmask.setValue(input,options);break;case"option":if("string"!=typeof options)return this.each((function(){if(void 0!==this.inputmask)return this.inputmask.option(options)}));if(input&&void 0!==input.inputmask)return input.inputmask.option(options);break;default:return options.alias=fn,nptmask=new Inputmask(options),this.each((function(){nptmask.mask(this)}))}else{if(Array.isArray(fn))return options.alias=fn,nptmask=new Inputmask(options),this.each((function(){nptmask.mask(this)}));if("object"==(void 0===fn?"undefined":_typeof(fn)))return nptmask=new Inputmask(fn),void 0===fn.mask&&void 0===fn.alias?this.each((function(){if(void 0!==this.inputmask)return this.inputmask.option(fn);nptmask.mask(this)})):this.each((function(){nptmask.mask(this)}));if(void 0===fn)return this.each((function(){(nptmask=new Inputmask(options)).mask(this)}))}}),$.fn.inputmask},__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(4),__webpack_require__(2)],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=factory)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}]),
|
||
/*!
|
||
* inputmask.date.extensions.js
|
||
* https://github.com/RobinHerbots/Inputmask
|
||
* Copyright (c) 2010 - 2019 Robin Herbots
|
||
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
||
* Version: 4.0.9
|
||
*/
|
||
function(factory){"function"==typeof define&&define.amd?define(["./inputmask"],factory):"object"==typeof exports?module.exports=factory(require("./inputmask")):factory(window.Inputmask)}((function(Inputmask){var $=Inputmask.dependencyLib,formatCode={d:["[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",Date.prototype.getDate],dd:["0[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",function(){return pad(Date.prototype.getDate.call(this),2)}],ddd:[""],dddd:[""],m:["[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return Date.prototype.getMonth.call(this)+1}],mm:["0[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return pad(Date.prototype.getMonth.call(this)+1,2)}],mmm:[""],mmmm:[""],yy:["[0-9]{2}",Date.prototype.setFullYear,"year",function(){return pad(Date.prototype.getFullYear.call(this),2)}],yyyy:["[0-9]{4}",Date.prototype.setFullYear,"year",function(){return pad(Date.prototype.getFullYear.call(this),4)}],h:["[1-9]|1[0-2]",Date.prototype.setHours,"hours",Date.prototype.getHours],hh:["0[1-9]|1[0-2]",Date.prototype.setHours,"hours",function(){return pad(Date.prototype.getHours.call(this),2)}],hhh:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],H:["1?[0-9]|2[0-3]",Date.prototype.setHours,"hours",Date.prototype.getHours],HH:["0[0-9]|1[0-9]|2[0-3]",Date.prototype.setHours,"hours",function(){return pad(Date.prototype.getHours.call(this),2)}],HHH:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],M:["[1-5]?[0-9]",Date.prototype.setMinutes,"minutes",Date.prototype.getMinutes],MM:["0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]",Date.prototype.setMinutes,"minutes",function(){return pad(Date.prototype.getMinutes.call(this),2)}],ss:["[0-5][0-9]",Date.prototype.setSeconds,"seconds",function(){return pad(Date.prototype.getSeconds.call(this),2)}],l:["[0-9]{3}",Date.prototype.setMilliseconds,"milliseconds",function(){return pad(Date.prototype.getMilliseconds.call(this),3)}],L:["[0-9]{2}",Date.prototype.setMilliseconds,"milliseconds",function(){return pad(Date.prototype.getMilliseconds.call(this),2)}],t:["[ap]"],tt:["[ap]m"],T:["[AP]"],TT:["[AP]M"],Z:[""],o:[""],S:[""]},formatAlias={isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};function getTokenizer(opts){if(!opts.tokenizer){var tokens=[];for(var ndx in formatCode)-1===tokens.indexOf(ndx[0])&&tokens.push(ndx[0]);opts.tokenizer="("+tokens.join("+|")+")+?|.",opts.tokenizer=new RegExp(opts.tokenizer,"g")}return opts.tokenizer}function isValidDate(dateParts,currentResult){return(!isFinite(dateParts.rawday)||"29"==dateParts.day&&!isFinite(dateParts.rawyear)||new Date(dateParts.date.getFullYear(),isFinite(dateParts.rawmonth)?dateParts.month:dateParts.date.getMonth()+1,0).getDate()>=dateParts.day)&¤tResult}function isDateInRange(dateParts,opts){var result=!0;if(opts.min){if(dateParts.rawyear){var rawYear=dateParts.rawyear.replace(/[^0-9]/g,""),minYear;result=opts.min.year.substr(0,rawYear.length)<=rawYear}dateParts.year===dateParts.rawyear&&opts.min.date.getTime()==opts.min.date.getTime()&&(result=opts.min.date.getTime()<=dateParts.date.getTime())}return result&&opts.max&&opts.max.date.getTime()==opts.max.date.getTime()&&(result=opts.max.date.getTime()>=dateParts.date.getTime()),result}function parse(format,dateObjValue,opts,raw){for(var mask="",match;match=getTokenizer(opts).exec(format);){var getFn;if(void 0===dateObjValue)if(formatCode[match[0]])mask+="("+formatCode[match[0]][0]+")";else switch(match[0]){case"[":mask+="(";break;case"]":mask+=")?";break;default:mask+=Inputmask.escapeRegex(match[0])}else if(formatCode[match[0]])if(!0!==raw&&formatCode[match[0]][3])mask+=formatCode[match[0]][3].call(dateObjValue.date);else formatCode[match[0]][2]?mask+=dateObjValue["raw"+formatCode[match[0]][2]]:mask+=match[0];else mask+=match[0]}return mask}function pad(val,len){for(val=String(val),len=len||2;val.length<len;)val="0"+val;return val}function analyseMask(maskString,format,opts){var dateObj={date:new Date(1,0,1)},targetProp,mask=maskString,match,dateOperation,targetValidator;function extendProperty(value){var correctedValue=value.replace(/[^0-9]/g,"0");if(correctedValue!=value){var enteredPart=value.replace(/[^0-9]/g,""),min=(opts.min&&opts.min[targetProp]||value).toString(),max=(opts.max&&opts.max[targetProp]||value).toString();correctedValue=enteredPart+(enteredPart<min.slice(0,enteredPart.length)?min.slice(enteredPart.length):enteredPart>max.slice(0,enteredPart.length)?max.slice(enteredPart.length):correctedValue.toString().slice(enteredPart.length))}return correctedValue}function setValue(dateObj,value,opts){dateObj[targetProp]=extendProperty(value),dateObj["raw"+targetProp]=value,void 0!==dateOperation&&dateOperation.call(dateObj.date,"month"==targetProp?parseInt(dateObj[targetProp])-1:dateObj[targetProp])}if("string"==typeof mask){for(;match=getTokenizer(opts).exec(format);){var value=mask.slice(0,match[0].length);formatCode.hasOwnProperty(match[0])&&(targetValidator=formatCode[match[0]][0],targetProp=formatCode[match[0]][2],dateOperation=formatCode[match[0]][1],setValue(dateObj,value,opts)),mask=mask.slice(value.length)}return dateObj}if(mask&&"object"==typeof mask&&mask.hasOwnProperty("date"))return mask}return Inputmask.extendAliases({datetime:{mask:function(opts){return formatCode.S=opts.i18n.ordinalSuffix.join("|"),opts.inputFormat=formatAlias[opts.inputFormat]||opts.inputFormat,opts.displayFormat=formatAlias[opts.displayFormat]||opts.displayFormat||opts.inputFormat,opts.outputFormat=formatAlias[opts.outputFormat]||opts.outputFormat||opts.inputFormat,opts.placeholder=""!==opts.placeholder?opts.placeholder:opts.inputFormat.replace(/[\[\]]/,""),opts.regex=parse(opts.inputFormat,void 0,opts),null},placeholder:"",inputFormat:"isoDateTime",displayFormat:void 0,outputFormat:void 0,min:null,max:null,i18n:{dayNames:["Mon","Tue","Wed","Thu","Fri","Sat","Sun","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],ordinalSuffix:["st","nd","rd","th"]},postValidation:function(buffer,pos,currentResult,opts){opts.min=analyseMask(opts.min,opts.inputFormat,opts),opts.max=analyseMask(opts.max,opts.inputFormat,opts);var result=currentResult,dateParts=analyseMask(buffer.join(""),opts.inputFormat,opts);return result&&dateParts.date.getTime()==dateParts.date.getTime()&&(result=(result=isValidDate(dateParts,result))&&isDateInRange(dateParts,opts)),pos&&result&¤tResult.pos!==pos?{buffer:parse(opts.inputFormat,dateParts,opts),refreshFromBuffer:{start:pos,end:currentResult.pos}}:result},onKeyDown:function(e,buffer,caretPos,opts){var input=this;if(e.ctrlKey&&e.keyCode===Inputmask.keyCode.RIGHT){for(var today=new Date,match,date="";match=getTokenizer(opts).exec(opts.inputFormat);)"d"===match[0].charAt(0)?date+=pad(today.getDate(),match[0].length):"m"===match[0].charAt(0)?date+=pad(today.getMonth()+1,match[0].length):"yyyy"===match[0]?date+=today.getFullYear().toString():"y"===match[0].charAt(0)&&(date+=pad(today.getYear(),match[0].length));this.inputmask._valueSet(date),$(this).trigger("setvalue")}},onUnMask:function(maskedValue,unmaskedValue,opts){return parse(opts.outputFormat,analyseMask(maskedValue,opts.inputFormat,opts),opts,!0)},casing:function(elem,test,pos,validPositions){return 0==test.nativeDef.indexOf("[ap]")?elem.toLowerCase():0==test.nativeDef.indexOf("[AP]")?elem.toUpperCase():elem},insertMode:!1,shiftPositions:!1}}),Inputmask})),
|
||
/*!
|
||
* inputmask.numeric.extensions.js
|
||
* https://github.com/RobinHerbots/Inputmask
|
||
* Copyright (c) 2010 - 2019 Robin Herbots
|
||
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
||
* Version: 4.0.9
|
||
*/
|
||
function(factory){"function"==typeof define&&define.amd?define(["./inputmask"],factory):"object"==typeof exports?module.exports=factory(require("./inputmask")):factory(window.Inputmask)}((function(Inputmask){var $=Inputmask.dependencyLib;function autoEscape(txt,opts){for(var escapedTxt="",i=0;i<txt.length;i++)Inputmask.prototype.definitions[txt.charAt(i)]||opts.definitions[txt.charAt(i)]||opts.optionalmarker.start===txt.charAt(i)||opts.optionalmarker.end===txt.charAt(i)||opts.quantifiermarker.start===txt.charAt(i)||opts.quantifiermarker.end===txt.charAt(i)||opts.groupmarker.start===txt.charAt(i)||opts.groupmarker.end===txt.charAt(i)||opts.alternatormarker===txt.charAt(i)?escapedTxt+="\\"+txt.charAt(i):escapedTxt+=txt.charAt(i);return escapedTxt}function alignDigits(buffer,digits,opts){if(digits>0){var radixPosition=$.inArray(opts.radixPoint,buffer);-1===radixPosition&&(buffer.push(opts.radixPoint),radixPosition=buffer.length-1);for(var i=1;i<=digits;i++)buffer[radixPosition+i]=buffer[radixPosition+i]||"0"}return buffer}return Inputmask.extendAliases({numeric:{mask:function(opts){if(0!==opts.repeat&&isNaN(opts.integerDigits)&&(opts.integerDigits=opts.repeat),opts.repeat=0,opts.groupSeparator===opts.radixPoint&&opts.digits&&"0"!==opts.digits&&("."===opts.radixPoint?opts.groupSeparator=",":","===opts.radixPoint?opts.groupSeparator=".":opts.groupSeparator="")," "===opts.groupSeparator&&(opts.skipOptionalPartCharacter=void 0),opts.autoGroup=opts.autoGroup&&""!==opts.groupSeparator,opts.autoGroup&&("string"==typeof opts.groupSize&&isFinite(opts.groupSize)&&(opts.groupSize=parseInt(opts.groupSize)),isFinite(opts.integerDigits))){var seps=Math.floor(opts.integerDigits/opts.groupSize),mod=opts.integerDigits%opts.groupSize;opts.integerDigits=parseInt(opts.integerDigits)+(0===mod?seps-1:seps),opts.integerDigits<1&&(opts.integerDigits="*")}opts.placeholder.length>1&&(opts.placeholder=opts.placeholder.charAt(0)),"radixFocus"===opts.positionCaretOnClick&&""===opts.placeholder&&!1===opts.integerOptional&&(opts.positionCaretOnClick="lvp"),opts.definitions[";"]=opts.definitions["~"],opts.definitions[";"].definitionSymbol="~",!0===opts.numericInput&&(opts.positionCaretOnClick="radixFocus"===opts.positionCaretOnClick?"lvp":opts.positionCaretOnClick,opts.digitsOptional=!1,isNaN(opts.digits)&&(opts.digits=2),opts.decimalProtect=!1);var mask="[+]";if(mask+=autoEscape(opts.prefix,opts),!0===opts.integerOptional?mask+="~{1,"+opts.integerDigits+"}":mask+="~{"+opts.integerDigits+"}",void 0!==opts.digits){var radixDef=opts.decimalProtect?":":opts.radixPoint,dq=opts.digits.toString().split(",");isFinite(dq[0])&&dq[1]&&isFinite(dq[1])?mask+=radixDef+";{"+opts.digits+"}":(isNaN(opts.digits)||parseInt(opts.digits)>0)&&(opts.digitsOptional?mask+="["+radixDef+";{1,"+opts.digits+"}]":mask+=radixDef+";{"+opts.digits+"}")}return mask+=autoEscape(opts.suffix,opts),mask+="[-]",opts.greedy=!1,mask},placeholder:"",greedy:!1,digits:"*",digitsOptional:!0,enforceDigitsOnBlur:!1,radixPoint:".",positionCaretOnClick:"radixFocus",groupSize:3,groupSeparator:"",autoGroup:!1,allowMinus:!0,negationSymbol:{front:"-",back:""},integerDigits:"+",integerOptional:!0,prefix:"",suffix:"",rightAlign:!0,decimalProtect:!0,min:null,max:null,step:1,insertMode:!0,autoUnmask:!1,unmaskAsNumber:!1,inputType:"text",inputmode:"numeric",preValidation:function(buffer,pos,c,isSelection,opts,maskset){if("-"===c||c===opts.negationSymbol.front)return!0===opts.allowMinus&&(opts.isNegative=void 0===opts.isNegative||!opts.isNegative,""===buffer.join("")||{caret:maskset.validPositions[pos]?pos:void 0,dopost:!0});if(!1===isSelection&&c===opts.radixPoint&&void 0!==opts.digits&&(isNaN(opts.digits)||parseInt(opts.digits)>0)){var radixPos=$.inArray(opts.radixPoint,buffer);if(-1!==radixPos&&void 0!==maskset.validPositions[radixPos])return!0===opts.numericInput?pos===radixPos:{caret:radixPos+1}}return!0},postValidation:function(buffer,pos,currentResult,opts){function buildPostMask(buffer,opts){var postMask="";if(postMask+="("+opts.groupSeparator+"*{"+opts.groupSize+"}){*}",""!==opts.radixPoint){var radixSplit=buffer.join("").split(opts.radixPoint);radixSplit[1]&&(postMask+=opts.radixPoint+"*{"+radixSplit[1].match(/^\d*\??\d*/)[0].length+"}")}return postMask}var suffix=opts.suffix.split(""),prefix=opts.prefix.split("");if(void 0===currentResult.pos&&void 0!==currentResult.caret&&!0!==currentResult.dopost)return currentResult;var caretPos=void 0!==currentResult.caret?currentResult.caret:currentResult.pos,maskedValue=buffer.slice();opts.numericInput&&(caretPos=maskedValue.length-caretPos-1,maskedValue=maskedValue.reverse());var charAtPos=maskedValue[caretPos];if(charAtPos===opts.groupSeparator&&(charAtPos=maskedValue[caretPos+=1]),caretPos===maskedValue.length-opts.suffix.length-1&&charAtPos===opts.radixPoint)return currentResult;void 0!==charAtPos&&charAtPos!==opts.radixPoint&&charAtPos!==opts.negationSymbol.front&&charAtPos!==opts.negationSymbol.back&&(maskedValue[caretPos]="?",opts.prefix.length>0&&caretPos>=(!1===opts.isNegative?1:0)&&caretPos<opts.prefix.length-1+(!1===opts.isNegative?1:0)?prefix[caretPos-(!1===opts.isNegative?1:0)]="?":opts.suffix.length>0&&caretPos>=maskedValue.length-opts.suffix.length-(!1===opts.isNegative?1:0)&&(suffix[caretPos-(maskedValue.length-opts.suffix.length-(!1===opts.isNegative?1:0))]="?")),prefix=prefix.join(""),suffix=suffix.join("");var processValue=maskedValue.join("").replace(prefix,"");if(processValue=(processValue=(processValue=(processValue=processValue.replace(suffix,"")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),"")).replace(new RegExp("[-"+Inputmask.escapeRegex(opts.negationSymbol.front)+"]","g"),"")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),""),isNaN(opts.placeholder)&&(processValue=processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder),"g"),"")),processValue.length>1&&1!==processValue.indexOf(opts.radixPoint)&&("0"===charAtPos&&(processValue=processValue.replace(/^\?/g,"")),processValue=processValue.replace(/^0/g,"")),processValue.charAt(0)===opts.radixPoint&&""!==opts.radixPoint&&!0!==opts.numericInput&&(processValue="0"+processValue),""!==processValue){if(processValue=processValue.split(""),(!opts.digitsOptional||opts.enforceDigitsOnBlur&&"blur"===currentResult.event)&&isFinite(opts.digits)){var radixPosition=$.inArray(opts.radixPoint,processValue),rpb=$.inArray(opts.radixPoint,maskedValue);-1===radixPosition&&(processValue.push(opts.radixPoint),radixPosition=processValue.length-1);for(var i=1;i<=opts.digits;i++)opts.digitsOptional&&(!opts.enforceDigitsOnBlur||"blur"!==currentResult.event)||void 0!==processValue[radixPosition+i]&&processValue[radixPosition+i]!==opts.placeholder.charAt(0)?-1!==rpb&&void 0!==maskedValue[rpb+i]&&(processValue[radixPosition+i]=processValue[radixPosition+i]||maskedValue[rpb+i]):processValue[radixPosition+i]=currentResult.placeholder||opts.placeholder.charAt(0)}if(!0!==opts.autoGroup||""===opts.groupSeparator||charAtPos===opts.radixPoint&&void 0===currentResult.pos&&!currentResult.dopost)processValue=processValue.join("");else{var addRadix=processValue[processValue.length-1]===opts.radixPoint&¤tResult.c===opts.radixPoint;processValue=Inputmask(buildPostMask(processValue,opts),{numericInput:!0,jitMasking:!0,definitions:{"*":{validator:"[0-9?]",cardinality:1}}}).format(processValue.join("")),addRadix&&(processValue+=opts.radixPoint),processValue.charAt(0)===opts.groupSeparator&&processValue.substr(1)}}if(opts.isNegative&&"blur"===currentResult.event&&(opts.isNegative="0"!==processValue),processValue=prefix+processValue,processValue+=suffix,opts.isNegative&&(processValue=opts.negationSymbol.front+processValue,processValue+=opts.negationSymbol.back),processValue=processValue.split(""),void 0!==charAtPos)if(charAtPos!==opts.radixPoint&&charAtPos!==opts.negationSymbol.front&&charAtPos!==opts.negationSymbol.back)(caretPos=$.inArray("?",processValue))>-1?processValue[caretPos]=charAtPos:caretPos=currentResult.caret||0;else if(charAtPos===opts.radixPoint||charAtPos===opts.negationSymbol.front||charAtPos===opts.negationSymbol.back){var newCaretPos=$.inArray(charAtPos,processValue);-1!==newCaretPos&&(caretPos=newCaretPos)}opts.numericInput&&(caretPos=processValue.length-caretPos-1,processValue=processValue.reverse());var rslt={caret:void 0!==charAtPos&&void 0===currentResult.pos||void 0===caretPos?caretPos:caretPos+(opts.numericInput?-1:1),buffer:processValue,refreshFromBuffer:currentResult.dopost||buffer.join("")!==processValue.join("")};return rslt.refreshFromBuffer?rslt:currentResult},onBeforeWrite:function(e,buffer,caretPos,opts){function parseMinMaxOptions(opts){void 0===opts.parseMinMaxOptions&&(null!==opts.min&&(opts.min=opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),""),","===opts.radixPoint&&(opts.min=opts.min.replace(opts.radixPoint,".")),opts.min=isFinite(opts.min)?parseFloat(opts.min):NaN,isNaN(opts.min)&&(opts.min=Number.MIN_VALUE)),null!==opts.max&&(opts.max=opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),""),","===opts.radixPoint&&(opts.max=opts.max.replace(opts.radixPoint,".")),opts.max=isFinite(opts.max)?parseFloat(opts.max):NaN,isNaN(opts.max)&&(opts.max=Number.MAX_VALUE)),opts.parseMinMaxOptions="done")}if(e)switch(e.type){case"keydown":return opts.postValidation(buffer,caretPos,{caret:caretPos,dopost:!0},opts);case"blur":case"checkval":var unmasked;if(parseMinMaxOptions(opts),null!==opts.min||null!==opts.max){if(unmasked=opts.onUnMask(buffer.join(""),void 0,$.extend({},opts,{unmaskAsNumber:!0})),null!==opts.min&&unmasked<opts.min)return opts.isNegative=opts.min<0,opts.postValidation(opts.min.toString().replace(".",opts.radixPoint).split(""),caretPos,{caret:caretPos,dopost:!0,placeholder:"0"},opts);if(null!==opts.max&&unmasked>opts.max)return opts.isNegative=opts.max<0,opts.postValidation(opts.max.toString().replace(".",opts.radixPoint).split(""),caretPos,{caret:caretPos,dopost:!0,placeholder:"0"},opts)}return opts.postValidation(buffer,caretPos,{caret:caretPos,placeholder:"0",event:"blur"},opts);case"_checkval":return{caret:caretPos}}},regex:{integerPart:function(opts,emptyCheck){return emptyCheck?new RegExp("["+Inputmask.escapeRegex(opts.negationSymbol.front)+"+]?"):new RegExp("["+Inputmask.escapeRegex(opts.negationSymbol.front)+"+]?\\d+")},integerNPart:function(opts){return new RegExp("[\\d"+Inputmask.escapeRegex(opts.groupSeparator)+Inputmask.escapeRegex(opts.placeholder.charAt(0))+"]+")}},definitions:{"~":{validator:function(chrs,maskset,pos,strict,opts,isSelection){var isValid,l;if("k"===chrs||"m"===chrs){isValid={insert:[],c:0};for(var i=0,l="k"===chrs?2:5;i<l;i++)isValid.insert.push({pos:pos+i,c:0});return isValid.pos=pos+l,isValid}if(!0===(isValid=strict?new RegExp("[0-9"+Inputmask.escapeRegex(opts.groupSeparator)+"]").test(chrs):new RegExp("[0-9]").test(chrs))){if(!0!==opts.numericInput&&void 0!==maskset.validPositions[pos]&&"~"===maskset.validPositions[pos].match.def&&!isSelection){var processValue=maskset.buffer.join(""),pvRadixSplit=(processValue=(processValue=processValue.replace(new RegExp("[-"+Inputmask.escapeRegex(opts.negationSymbol.front)+"]","g"),"")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),"")).split(opts.radixPoint);pvRadixSplit.length>1&&(pvRadixSplit[1]=pvRadixSplit[1].replace(/0/g,opts.placeholder.charAt(0))),"0"===pvRadixSplit[0]&&(pvRadixSplit[0]=pvRadixSplit[0].replace(/0/g,opts.placeholder.charAt(0))),processValue=pvRadixSplit[0]+opts.radixPoint+pvRadixSplit[1]||"";var bufferTemplate=maskset._buffer.join("");for(processValue===opts.radixPoint&&(processValue=bufferTemplate);null===processValue.match(Inputmask.escapeRegex(bufferTemplate)+"$");)bufferTemplate=bufferTemplate.slice(1);isValid=void 0===(processValue=(processValue=processValue.replace(bufferTemplate,"")).split(""))[pos]?{pos:pos,remove:pos}:{pos:pos}}}else strict||chrs!==opts.radixPoint||void 0!==maskset.validPositions[pos-1]||(isValid={insert:{pos:pos,c:0},pos:pos+1});return isValid},cardinality:1},"+":{validator:function(chrs,maskset,pos,strict,opts){return opts.allowMinus&&("-"===chrs||chrs===opts.negationSymbol.front)},cardinality:1,placeholder:""},"-":{validator:function(chrs,maskset,pos,strict,opts){return opts.allowMinus&&chrs===opts.negationSymbol.back},cardinality:1,placeholder:""},":":{validator:function(chrs,maskset,pos,strict,opts){var radix="["+Inputmask.escapeRegex(opts.radixPoint)+"]",isValid=new RegExp(radix).test(chrs);return isValid&&maskset.validPositions[pos]&&maskset.validPositions[pos].match.placeholder===opts.radixPoint&&(isValid={caret:pos+1}),isValid},cardinality:1,placeholder:function(opts){return opts.radixPoint}}},onUnMask:function(maskedValue,unmaskedValue,opts){if(""===unmaskedValue&&!0===opts.nullable)return unmaskedValue;var processValue=maskedValue.replace(opts.prefix,"");return processValue=(processValue=processValue.replace(opts.suffix,"")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator),"g"),""),""!==opts.placeholder.charAt(0)&&(processValue=processValue.replace(new RegExp(opts.placeholder.charAt(0),"g"),"0")),opts.unmaskAsNumber?(""!==opts.radixPoint&&-1!==processValue.indexOf(opts.radixPoint)&&(processValue=processValue.replace(Inputmask.escapeRegex.call(this,opts.radixPoint),".")),processValue=(processValue=processValue.replace(new RegExp("^"+Inputmask.escapeRegex(opts.negationSymbol.front)),"-")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),""),Number(processValue)):processValue},isComplete:function(buffer,opts){var maskedValue=(opts.numericInput?buffer.slice().reverse():buffer).join("");return maskedValue=(maskedValue=(maskedValue=(maskedValue=(maskedValue=maskedValue.replace(new RegExp("^"+Inputmask.escapeRegex(opts.negationSymbol.front)),"-")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back)+"$"),"")).replace(opts.prefix,"")).replace(opts.suffix,"")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator)+"([0-9]{3})","g"),"$1"),","===opts.radixPoint&&(maskedValue=maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint),".")),isFinite(maskedValue)},onBeforeMask:function(initialValue,opts){opts.isNegative=void 0;var radixPoint=opts.radixPoint||",";"number"!=typeof initialValue&&"number"!==opts.inputType||""===radixPoint||(initialValue=initialValue.toString().replace(".",radixPoint));var valueParts=initialValue.split(radixPoint),integerPart=valueParts[0].replace(/[^\-0-9]/g,""),decimalPart=valueParts.length>1?valueParts[1].replace(/[^0-9]/g,""):"";initialValue=integerPart+(""!==decimalPart?radixPoint+decimalPart:decimalPart);var digits=0;if(""!==radixPoint&&(digits=decimalPart.length,""!==decimalPart)){var digitsFactor=Math.pow(10,digits||1);isFinite(opts.digits)&&(digits=parseInt(opts.digits),digitsFactor=Math.pow(10,digits)),initialValue=initialValue.replace(Inputmask.escapeRegex(radixPoint),"."),isFinite(initialValue)&&(initialValue=Math.round(parseFloat(initialValue)*digitsFactor)/digitsFactor),initialValue=initialValue.toString().replace(".",radixPoint)}return 0===opts.digits&&-1!==initialValue.indexOf(Inputmask.escapeRegex(radixPoint))&&(initialValue=initialValue.substring(0,initialValue.indexOf(Inputmask.escapeRegex(radixPoint)))),alignDigits(initialValue.toString().split(""),digits,opts).join("")},onKeyDown:function(e,buffer,caretPos,opts){var $input=$(this);if(e.ctrlKey)switch(e.keyCode){case Inputmask.keyCode.UP:$input.val(parseFloat(this.inputmask.unmaskedvalue())+parseInt(opts.step)),$input.trigger("setvalue");break;case Inputmask.keyCode.DOWN:$input.val(parseFloat(this.inputmask.unmaskedvalue())-parseInt(opts.step)),$input.trigger("setvalue")}}},currency:{prefix:"$ ",groupSeparator:",",alias:"numeric",placeholder:"0",autoGroup:!0,digits:2,digitsOptional:!1,clearMaskOnLostFocus:!1},decimal:{alias:"numeric"},integer:{alias:"numeric",digits:0,radixPoint:""},percentage:{alias:"numeric",digits:2,digitsOptional:!0,radixPoint:".",placeholder:"0",autoGroup:!1,min:0,max:100,suffix:" %",allowMinus:!1}}),Inputmask})),
|
||
/*! nouislider - 14.5.0 - 5/11/2020 */
|
||
function(factory){"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?module.exports=factory():window.noUiSlider=factory()}((function(){"use strict";var VERSION="14.5.0";function isValidFormatter(entry){return"object"==typeof entry&&"function"==typeof entry.to&&"function"==typeof entry.from}function removeElement(el){el.parentElement.removeChild(el)}function isSet(value){return null!=value}function preventDefault(e){e.preventDefault()}function unique(array){return array.filter((function(a){return!this[a]&&(this[a]=!0)}),{})}function closest(value,to){return Math.round(value/to)*to}function offset(elem,orientation){var rect=elem.getBoundingClientRect(),doc=elem.ownerDocument,docElem=doc.documentElement,pageOffset=getPageOffset(doc);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(pageOffset.x=0),orientation?rect.top+pageOffset.y-docElem.clientTop:rect.left+pageOffset.x-docElem.clientLeft}function isNumeric(a){return"number"==typeof a&&!isNaN(a)&&isFinite(a)}function addClassFor(element,className,duration){duration>0&&(addClass(element,className),setTimeout((function(){removeClass(element,className)}),duration))}function limit(a){return Math.max(Math.min(a,100),0)}function asArray(a){return Array.isArray(a)?a:[a]}function countDecimals(numStr){var pieces=(numStr=String(numStr)).split(".");return pieces.length>1?pieces[1].length:0}function addClass(el,className){el.classList&&!/\s/.test(className)?el.classList.add(className):el.className+=" "+className}function removeClass(el,className){el.classList&&!/\s/.test(className)?el.classList.remove(className):el.className=el.className.replace(new RegExp("(^|\\b)"+className.split(" ").join("|")+"(\\b|$)","gi")," ")}function hasClass(el,className){return el.classList?el.classList.contains(className):new RegExp("\\b"+className+"\\b").test(el.className)}function getPageOffset(doc){var supportPageOffset=void 0!==window.pageXOffset,isCSS1Compat="CSS1Compat"===(doc.compatMode||""),x,y;return{x:supportPageOffset?window.pageXOffset:isCSS1Compat?doc.documentElement.scrollLeft:doc.body.scrollLeft,y:supportPageOffset?window.pageYOffset:isCSS1Compat?doc.documentElement.scrollTop:doc.body.scrollTop}}function getActions(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function getSupportsPassive(){var supportsPassive=!1;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassive=!0}});window.addEventListener("test",null,opts)}catch(e){}return supportsPassive}function getSupportsTouchActionNone(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function subRangeRatio(pa,pb){return 100/(pb-pa)}function fromPercentage(range,value,startRange){return 100*value/(range[startRange+1]-range[startRange])}function toPercentage(range,value){return fromPercentage(range,range[0]<0?value+Math.abs(range[0]):value-range[0],0)}function isPercentage(range,value){return value*(range[1]-range[0])/100+range[0]}function getJ(value,arr){for(var j=1;value>=arr[j];)j+=1;return j}function toStepping(xVal,xPct,value){if(value>=xVal.slice(-1)[0])return 100;var j=getJ(value,xVal),va=xVal[j-1],vb=xVal[j],pa=xPct[j-1],pb=xPct[j];return pa+toPercentage([va,vb],value)/subRangeRatio(pa,pb)}function fromStepping(xVal,xPct,value){if(value>=100)return xVal.slice(-1)[0];var j=getJ(value,xPct),va=xVal[j-1],vb=xVal[j],pa=xPct[j-1],pb;return isPercentage([va,vb],(value-pa)*subRangeRatio(pa,xPct[j]))}function getStep(xPct,xSteps,snap,value){if(100===value)return value;var j=getJ(value,xPct),a=xPct[j-1],b=xPct[j];return snap?value-a>(b-a)/2?b:a:xSteps[j-1]?xPct[j-1]+closest(value-xPct[j-1],xSteps[j-1]):value}function handleEntryPoint(index,value,that){var percentage;if("number"==typeof value&&(value=[value]),!Array.isArray(value))throw new Error("noUiSlider (14.5.0): 'range' contains invalid value.");if(!isNumeric(percentage="min"===index?0:"max"===index?100:parseFloat(index))||!isNumeric(value[0]))throw new Error("noUiSlider (14.5.0): 'range' value isn't numeric.");that.xPct.push(percentage),that.xVal.push(value[0]),percentage?that.xSteps.push(!isNaN(value[1])&&value[1]):isNaN(value[1])||(that.xSteps[0]=value[1]),that.xHighestCompleteStep.push(0)}function handleStepPoint(i,n,that){if(n)if(that.xVal[i]!==that.xVal[i+1]){that.xSteps[i]=fromPercentage([that.xVal[i],that.xVal[i+1]],n,0)/subRangeRatio(that.xPct[i],that.xPct[i+1]);var totalSteps=(that.xVal[i+1]-that.xVal[i])/that.xNumSteps[i],highestStep=Math.ceil(Number(totalSteps.toFixed(3))-1),step=that.xVal[i]+that.xNumSteps[i]*highestStep;that.xHighestCompleteStep[i]=step}else that.xSteps[i]=that.xHighestCompleteStep[i]=that.xVal[i]}function Spectrum(entry,snap,singleStep){var index;this.xPct=[],this.xVal=[],this.xSteps=[singleStep||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=snap;var ordered=[];for(index in entry)entry.hasOwnProperty(index)&&ordered.push([entry[index],index]);for(ordered.length&&"object"==typeof ordered[0][0]?ordered.sort((function(a,b){return a[0][0]-b[0][0]})):ordered.sort((function(a,b){return a[0]-b[0]})),index=0;index<ordered.length;index++)handleEntryPoint(ordered[index][1],ordered[index][0],this);for(this.xNumSteps=this.xSteps.slice(0),index=0;index<this.xNumSteps.length;index++)handleStepPoint(index,this.xNumSteps[index],this)}Spectrum.prototype.getDistance=function(value){var index,distances=[];for(index=0;index<this.xNumSteps.length-1;index++){var step=this.xNumSteps[index];if(step&&value/step%1!=0)throw new Error("noUiSlider (14.5.0): 'limit', 'margin' and 'padding' of "+this.xPct[index]+"% range must be divisible by step.");distances[index]=fromPercentage(this.xVal,value,index)}return distances},Spectrum.prototype.getAbsoluteDistance=function(value,distances,direction){var xPct_index=0,start_factor;if(value<this.xPct[this.xPct.length-1])for(;value>this.xPct[xPct_index+1];)xPct_index++;else value===this.xPct[this.xPct.length-1]&&(xPct_index=this.xPct.length-2);direction||value!==this.xPct[xPct_index+1]||xPct_index++;var rest_factor=1,rest_rel_distance=distances[xPct_index],range_pct=0,rel_range_distance=0,abs_distance_counter=0,range_counter=0;for(start_factor=direction?(value-this.xPct[xPct_index])/(this.xPct[xPct_index+1]-this.xPct[xPct_index]):(this.xPct[xPct_index+1]-value)/(this.xPct[xPct_index+1]-this.xPct[xPct_index]);rest_rel_distance>0;)range_pct=this.xPct[xPct_index+1+range_counter]-this.xPct[xPct_index+range_counter],distances[xPct_index+range_counter]*rest_factor+100-100*start_factor>100?(rel_range_distance=range_pct*start_factor,rest_factor=(rest_rel_distance-100*start_factor)/distances[xPct_index+range_counter],start_factor=1):(rel_range_distance=distances[xPct_index+range_counter]*range_pct/100*rest_factor,rest_factor=0),direction?(abs_distance_counter-=rel_range_distance,this.xPct.length+range_counter>=1&&range_counter--):(abs_distance_counter+=rel_range_distance,this.xPct.length-range_counter>=1&&range_counter++),rest_rel_distance=distances[xPct_index+range_counter]*rest_factor;return value+abs_distance_counter},Spectrum.prototype.toStepping=function(value){return value=toStepping(this.xVal,this.xPct,value)},Spectrum.prototype.fromStepping=function(value){return fromStepping(this.xVal,this.xPct,value)},Spectrum.prototype.getStep=function(value){return value=getStep(this.xPct,this.xSteps,this.snap,value)},Spectrum.prototype.getDefaultStep=function(value,isDown,size){var j=getJ(value,this.xPct);return(100===value||isDown&&value===this.xPct[j-1])&&(j=Math.max(j-1,1)),(this.xVal[j]-this.xVal[j-1])/size},Spectrum.prototype.getNearbySteps=function(value){var j=getJ(value,this.xPct);return{stepBefore:{startValue:this.xVal[j-2],step:this.xNumSteps[j-2],highestStep:this.xHighestCompleteStep[j-2]},thisStep:{startValue:this.xVal[j-1],step:this.xNumSteps[j-1],highestStep:this.xHighestCompleteStep[j-1]},stepAfter:{startValue:this.xVal[j],step:this.xNumSteps[j],highestStep:this.xHighestCompleteStep[j]}}},Spectrum.prototype.countStepDecimals=function(){var stepDecimals=this.xNumSteps.map(countDecimals);return Math.max.apply(null,stepDecimals)},Spectrum.prototype.convert=function(value){return this.getStep(this.toStepping(value))};var defaultFormatter={to:function(value){return void 0!==value&&value.toFixed(2)},from:Number},cssClasses={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"};function validateFormat(entry){if(isValidFormatter(entry))return!0;throw new Error("noUiSlider (14.5.0): 'format' requires 'to' and 'from' methods.")}function testStep(parsed,entry){if(!isNumeric(entry))throw new Error("noUiSlider (14.5.0): 'step' is not numeric.");parsed.singleStep=entry}function testRange(parsed,entry){if("object"!=typeof entry||Array.isArray(entry))throw new Error("noUiSlider (14.5.0): 'range' is not an object.");if(void 0===entry.min||void 0===entry.max)throw new Error("noUiSlider (14.5.0): Missing 'min' or 'max' in 'range'.");if(entry.min===entry.max)throw new Error("noUiSlider (14.5.0): 'range' 'min' and 'max' cannot be equal.");parsed.spectrum=new Spectrum(entry,parsed.snap,parsed.singleStep)}function testStart(parsed,entry){if(entry=asArray(entry),!Array.isArray(entry)||!entry.length)throw new Error("noUiSlider (14.5.0): 'start' option is incorrect.");parsed.handles=entry.length,parsed.start=entry}function testSnap(parsed,entry){if(parsed.snap=entry,"boolean"!=typeof entry)throw new Error("noUiSlider (14.5.0): 'snap' option must be a boolean.")}function testAnimate(parsed,entry){if(parsed.animate=entry,"boolean"!=typeof entry)throw new Error("noUiSlider (14.5.0): 'animate' option must be a boolean.")}function testAnimationDuration(parsed,entry){if(parsed.animationDuration=entry,"number"!=typeof entry)throw new Error("noUiSlider (14.5.0): 'animationDuration' option must be a number.")}function testConnect(parsed,entry){var connect=[!1],i;if("lower"===entry?entry=[!0,!1]:"upper"===entry&&(entry=[!1,!0]),!0===entry||!1===entry){for(i=1;i<parsed.handles;i++)connect.push(entry);connect.push(!1)}else{if(!Array.isArray(entry)||!entry.length||entry.length!==parsed.handles+1)throw new Error("noUiSlider (14.5.0): 'connect' option doesn't match handle count.");connect=entry}parsed.connect=connect}function testOrientation(parsed,entry){switch(entry){case"horizontal":parsed.ort=0;break;case"vertical":parsed.ort=1;break;default:throw new Error("noUiSlider (14.5.0): 'orientation' option is invalid.")}}function testMargin(parsed,entry){if(!isNumeric(entry))throw new Error("noUiSlider (14.5.0): 'margin' option must be numeric.");0!==entry&&(parsed.margin=parsed.spectrum.getDistance(entry))}function testLimit(parsed,entry){if(!isNumeric(entry))throw new Error("noUiSlider (14.5.0): 'limit' option must be numeric.");if(parsed.limit=parsed.spectrum.getDistance(entry),!parsed.limit||parsed.handles<2)throw new Error("noUiSlider (14.5.0): 'limit' option is only supported on linear sliders with 2 or more handles.")}function testPadding(parsed,entry){var index;if(!isNumeric(entry)&&!Array.isArray(entry))throw new Error("noUiSlider (14.5.0): 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(entry)&&2!==entry.length&&!isNumeric(entry[0])&&!isNumeric(entry[1]))throw new Error("noUiSlider (14.5.0): 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==entry){for(Array.isArray(entry)||(entry=[entry,entry]),parsed.padding=[parsed.spectrum.getDistance(entry[0]),parsed.spectrum.getDistance(entry[1])],index=0;index<parsed.spectrum.xNumSteps.length-1;index++)if(parsed.padding[0][index]<0||parsed.padding[1][index]<0)throw new Error("noUiSlider (14.5.0): 'padding' option must be a positive number(s).");var totalPadding=entry[0]+entry[1],firstValue=parsed.spectrum.xVal[0],lastValue;if(totalPadding/(parsed.spectrum.xVal[parsed.spectrum.xVal.length-1]-firstValue)>1)throw new Error("noUiSlider (14.5.0): 'padding' option must not exceed 100% of the range.")}}function testDirection(parsed,entry){switch(entry){case"ltr":parsed.dir=0;break;case"rtl":parsed.dir=1;break;default:throw new Error("noUiSlider (14.5.0): 'direction' option was not recognized.")}}function testBehaviour(parsed,entry){if("string"!=typeof entry)throw new Error("noUiSlider (14.5.0): 'behaviour' must be a string containing options.");var tap=entry.indexOf("tap")>=0,drag=entry.indexOf("drag")>=0,fixed=entry.indexOf("fixed")>=0,snap=entry.indexOf("snap")>=0,hover=entry.indexOf("hover")>=0,unconstrained=entry.indexOf("unconstrained")>=0;if(fixed){if(2!==parsed.handles)throw new Error("noUiSlider (14.5.0): 'fixed' behaviour must be used with 2 handles");testMargin(parsed,parsed.start[1]-parsed.start[0])}if(unconstrained&&(parsed.margin||parsed.limit))throw new Error("noUiSlider (14.5.0): 'unconstrained' behaviour cannot be used with margin or limit");parsed.events={tap:tap||snap,drag:drag,fixed:fixed,snap:snap,hover:hover,unconstrained:unconstrained}}function testTooltips(parsed,entry){if(!1!==entry)if(!0===entry){parsed.tooltips=[];for(var i=0;i<parsed.handles;i++)parsed.tooltips.push(!0)}else{if(parsed.tooltips=asArray(entry),parsed.tooltips.length!==parsed.handles)throw new Error("noUiSlider (14.5.0): must pass a formatter for all handles.");parsed.tooltips.forEach((function(formatter){if("boolean"!=typeof formatter&&("object"!=typeof formatter||"function"!=typeof formatter.to))throw new Error("noUiSlider (14.5.0): 'tooltips' must be passed a formatter or 'false'.")}))}}function testAriaFormat(parsed,entry){parsed.ariaFormat=entry,validateFormat(entry)}function testFormat(parsed,entry){parsed.format=entry,validateFormat(entry)}function testKeyboardSupport(parsed,entry){if(parsed.keyboardSupport=entry,"boolean"!=typeof entry)throw new Error("noUiSlider (14.5.0): 'keyboardSupport' option must be a boolean.")}function testDocumentElement(parsed,entry){parsed.documentElement=entry}function testCssPrefix(parsed,entry){if("string"!=typeof entry&&!1!==entry)throw new Error("noUiSlider (14.5.0): 'cssPrefix' must be a string or `false`.");parsed.cssPrefix=entry}function testCssClasses(parsed,entry){if("object"!=typeof entry)throw new Error("noUiSlider (14.5.0): 'cssClasses' must be an object.");if("string"==typeof parsed.cssPrefix)for(var key in parsed.cssClasses={},entry)entry.hasOwnProperty(key)&&(parsed.cssClasses[key]=parsed.cssPrefix+entry[key]);else parsed.cssClasses=entry}function testOptions(options){var parsed={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:defaultFormatter,format:defaultFormatter},tests={step:{r:!1,t:testStep},start:{r:!0,t:testStart},connect:{r:!0,t:testConnect},direction:{r:!0,t:testDirection},snap:{r:!1,t:testSnap},animate:{r:!1,t:testAnimate},animationDuration:{r:!1,t:testAnimationDuration},range:{r:!0,t:testRange},orientation:{r:!1,t:testOrientation},margin:{r:!1,t:testMargin},limit:{r:!1,t:testLimit},padding:{r:!1,t:testPadding},behaviour:{r:!0,t:testBehaviour},ariaFormat:{r:!1,t:testAriaFormat},format:{r:!1,t:testFormat},tooltips:{r:!1,t:testTooltips},keyboardSupport:{r:!0,t:testKeyboardSupport},documentElement:{r:!1,t:testDocumentElement},cssPrefix:{r:!0,t:testCssPrefix},cssClasses:{r:!0,t:testCssClasses}},defaults={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:cssClasses};options.format&&!options.ariaFormat&&(options.ariaFormat=options.format),Object.keys(tests).forEach((function(name){if(!isSet(options[name])&&void 0===defaults[name]){if(tests[name].r)throw new Error("noUiSlider (14.5.0): '"+name+"' is required.");return!0}tests[name].t(parsed,isSet(options[name])?options[name]:defaults[name])})),parsed.pips=options.pips;var d=document.createElement("div"),msPrefix=void 0!==d.style.msTransform,noPrefix=void 0!==d.style.transform;parsed.transformRule=noPrefix?"transform":msPrefix?"msTransform":"webkitTransform";var styles=[["left","top"],["right","bottom"]];return parsed.style=styles[parsed.dir][parsed.ort],parsed}function scope(target,options,originalOptions){var actions=getActions(),supportsTouchActionNone,supportsPassive=getSupportsTouchActionNone()&&getSupportsPassive(),scope_Target=target,scope_Base,scope_Handles,scope_Connects,scope_Pips,scope_Tooltips,scope_Spectrum=options.spectrum,scope_Values=[],scope_Locations=[],scope_HandleNumbers=[],scope_ActiveHandlesCount=0,scope_Events={},scope_Self,scope_Document=target.ownerDocument,scope_DocumentElement=options.documentElement||scope_Document.documentElement,scope_Body=scope_Document.body,PIPS_NONE=-1,PIPS_NO_VALUE=0,PIPS_LARGE_VALUE=1,PIPS_SMALL_VALUE=2,scope_DirOffset="rtl"===scope_Document.dir||1===options.ort?0:100;function addNodeTo(addTarget,className){var div=scope_Document.createElement("div");return className&&addClass(div,className),addTarget.appendChild(div),div}function addOrigin(base,handleNumber){var origin=addNodeTo(base,options.cssClasses.origin),handle=addNodeTo(origin,options.cssClasses.handle);return addNodeTo(handle,options.cssClasses.touchArea),handle.setAttribute("data-handle",handleNumber),options.keyboardSupport&&(handle.setAttribute("tabindex","0"),handle.addEventListener("keydown",(function(event){return eventKeydown(event,handleNumber)}))),handle.setAttribute("role","slider"),handle.setAttribute("aria-orientation",options.ort?"vertical":"horizontal"),0===handleNumber?addClass(handle,options.cssClasses.handleLower):handleNumber===options.handles-1&&addClass(handle,options.cssClasses.handleUpper),origin}function addConnect(base,add){return!!add&&addNodeTo(base,options.cssClasses.connect)}function addElements(connectOptions,base){var connectBase=addNodeTo(base,options.cssClasses.connects);scope_Handles=[],(scope_Connects=[]).push(addConnect(connectBase,connectOptions[0]));for(var i=0;i<options.handles;i++)scope_Handles.push(addOrigin(base,i)),scope_HandleNumbers[i]=i,scope_Connects.push(addConnect(connectBase,connectOptions[i+1]))}function addSlider(addTarget){var textDirection;return addClass(addTarget,options.cssClasses.target),0===options.dir?addClass(addTarget,options.cssClasses.ltr):addClass(addTarget,options.cssClasses.rtl),0===options.ort?addClass(addTarget,options.cssClasses.horizontal):addClass(addTarget,options.cssClasses.vertical),addClass(addTarget,"rtl"===getComputedStyle(addTarget).direction?options.cssClasses.textDirectionRtl:options.cssClasses.textDirectionLtr),addNodeTo(addTarget,options.cssClasses.base)}function addTooltip(handle,handleNumber){return!!options.tooltips[handleNumber]&&addNodeTo(handle.firstChild,options.cssClasses.tooltip)}function isSliderDisabled(){return scope_Target.hasAttribute("disabled")}function isHandleDisabled(handleNumber){var handleOrigin;return scope_Handles[handleNumber].hasAttribute("disabled")}function removeTooltips(){scope_Tooltips&&(removeEvent("update.tooltips"),scope_Tooltips.forEach((function(tooltip){tooltip&&removeElement(tooltip)})),scope_Tooltips=null)}function tooltips(){removeTooltips(),scope_Tooltips=scope_Handles.map(addTooltip),bindEvent("update.tooltips",(function(values,handleNumber,unencoded){if(scope_Tooltips[handleNumber]){var formattedValue=values[handleNumber];!0!==options.tooltips[handleNumber]&&(formattedValue=options.tooltips[handleNumber].to(unencoded[handleNumber])),scope_Tooltips[handleNumber].innerHTML=formattedValue}}))}function aria(){bindEvent("update",(function(values,handleNumber,unencoded,tap,positions){scope_HandleNumbers.forEach((function(index){var handle=scope_Handles[index],min=checkHandlePosition(scope_Locations,index,0,!0,!0,!0),max=checkHandlePosition(scope_Locations,index,100,!0,!0,!0),now=positions[index],text=options.ariaFormat.to(unencoded[index]);min=scope_Spectrum.fromStepping(min).toFixed(1),max=scope_Spectrum.fromStepping(max).toFixed(1),now=scope_Spectrum.fromStepping(now).toFixed(1),handle.children[0].setAttribute("aria-valuemin",min),handle.children[0].setAttribute("aria-valuemax",max),handle.children[0].setAttribute("aria-valuenow",now),handle.children[0].setAttribute("aria-valuetext",text)}))}))}function getGroup(mode,values,stepped){if("range"===mode||"steps"===mode)return scope_Spectrum.xVal;if("count"===mode){if(values<2)throw new Error("noUiSlider (14.5.0): 'values' (>= 2) required for mode 'count'.");var interval=values-1,spread=100/interval;for(values=[];interval--;)values[interval]=interval*spread;values.push(100),mode="positions"}return"positions"===mode?values.map((function(value){return scope_Spectrum.fromStepping(stepped?scope_Spectrum.getStep(value):value)})):"values"===mode?stepped?values.map((function(value){return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value)))})):values:void 0}function generateSpread(density,mode,group){function safeIncrement(value,increment){return(value+increment).toFixed(7)/1}var indexes={},firstInRange=scope_Spectrum.xVal[0],lastInRange=scope_Spectrum.xVal[scope_Spectrum.xVal.length-1],ignoreFirst=!1,ignoreLast=!1,prevPct=0;return(group=unique(group.slice().sort((function(a,b){return a-b}))))[0]!==firstInRange&&(group.unshift(firstInRange),ignoreFirst=!0),group[group.length-1]!==lastInRange&&(group.push(lastInRange),ignoreLast=!0),group.forEach((function(current,index){var step,i,q,low=current,high=group[index+1],newPct,pctDifference,pctPos,type,steps,realSteps,stepSize,isSteps="steps"===mode;if(isSteps&&(step=scope_Spectrum.xNumSteps[index]),step||(step=high-low),!1!==low&&void 0!==high)for(step=Math.max(step,1e-7),i=low;i<=high;i=safeIncrement(i,step)){for(steps=(pctDifference=(newPct=scope_Spectrum.toStepping(i))-prevPct)/density,stepSize=pctDifference/(realSteps=Math.round(steps)),q=1;q<=realSteps;q+=1)indexes[(pctPos=prevPct+q*stepSize).toFixed(5)]=[scope_Spectrum.fromStepping(pctPos),0];type=group.indexOf(i)>-1?1:isSteps?2:0,!index&&ignoreFirst&&i!==high&&(type=0),i===high&&ignoreLast||(indexes[newPct.toFixed(5)]=[i,type]),prevPct=newPct}})),indexes}function addMarking(spread,filterFunc,formatter){var element=scope_Document.createElement("div"),valueSizeClasses=[];valueSizeClasses[0]=options.cssClasses.valueNormal,valueSizeClasses[1]=options.cssClasses.valueLarge,valueSizeClasses[2]=options.cssClasses.valueSub;var markerSizeClasses=[];markerSizeClasses[0]=options.cssClasses.markerNormal,markerSizeClasses[1]=options.cssClasses.markerLarge,markerSizeClasses[2]=options.cssClasses.markerSub;var valueOrientationClasses=[options.cssClasses.valueHorizontal,options.cssClasses.valueVertical],markerOrientationClasses=[options.cssClasses.markerHorizontal,options.cssClasses.markerVertical];function getClasses(type,source){var a=source===options.cssClasses.value,orientationClasses,sizeClasses=a?valueSizeClasses:markerSizeClasses;return source+" "+(a?valueOrientationClasses:markerOrientationClasses)[options.ort]+" "+sizeClasses[type]}function addSpread(offset,value,type){if(-1!==(type=filterFunc?filterFunc(value,type):type)){var node=addNodeTo(element,!1);node.className=getClasses(type,options.cssClasses.marker),node.style[options.style]=offset+"%",type>0&&((node=addNodeTo(element,!1)).className=getClasses(type,options.cssClasses.value),node.setAttribute("data-value",value),node.style[options.style]=offset+"%",node.innerHTML=formatter.to(value))}}return addClass(element,options.cssClasses.pips),addClass(element,0===options.ort?options.cssClasses.pipsHorizontal:options.cssClasses.pipsVertical),Object.keys(spread).forEach((function(offset){addSpread(offset,spread[offset][0],spread[offset][1])})),element}function removePips(){scope_Pips&&(removeElement(scope_Pips),scope_Pips=null)}function pips(grid){removePips();var mode=grid.mode,density=grid.density||1,filter=grid.filter||!1,values,stepped,group,spread=generateSpread(density,mode,getGroup(mode,grid.values||!1,grid.stepped||!1)),format=grid.format||{to:Math.round};return scope_Pips=scope_Target.appendChild(addMarking(spread,filter,format))}function baseSize(){var rect=scope_Base.getBoundingClientRect(),alt="offset"+["Width","Height"][options.ort];return 0===options.ort?rect.width||scope_Base[alt]:rect.height||scope_Base[alt]}function attachEvent(events,element,callback,data){var method=function(e){return!!(e=fixEvent(e,data.pageOffset,data.target||element))&&(!(isSliderDisabled()&&!data.doNotReject)&&(!(hasClass(scope_Target,options.cssClasses.tap)&&!data.doNotReject)&&(!(events===actions.start&&void 0!==e.buttons&&e.buttons>1)&&((!data.hover||!e.buttons)&&(supportsPassive||e.preventDefault(),e.calcPoint=e.points[options.ort],void callback(e,data))))))},methods=[];return events.split(" ").forEach((function(eventName){element.addEventListener(eventName,method,!!supportsPassive&&{passive:!0}),methods.push([eventName,method])})),methods}function fixEvent(e,pageOffset,eventTarget){var touch=0===e.type.indexOf("touch"),mouse=0===e.type.indexOf("mouse"),pointer=0===e.type.indexOf("pointer"),x,y;if(0===e.type.indexOf("MSPointer")&&(pointer=!0),touch){var isTouchOnTarget=function(checkTouch){return checkTouch.target===eventTarget||eventTarget.contains(checkTouch.target)||checkTouch.target.shadowRoot&&checkTouch.target.shadowRoot.contains(eventTarget)};if("touchstart"===e.type){var targetTouches=Array.prototype.filter.call(e.touches,isTouchOnTarget);if(targetTouches.length>1)return!1;x=targetTouches[0].pageX,y=targetTouches[0].pageY}else{var targetTouch=Array.prototype.find.call(e.changedTouches,isTouchOnTarget);if(!targetTouch)return!1;x=targetTouch.pageX,y=targetTouch.pageY}}return pageOffset=pageOffset||getPageOffset(scope_Document),(mouse||pointer)&&(x=e.clientX+pageOffset.x,y=e.clientY+pageOffset.y),e.pageOffset=pageOffset,e.points=[x,y],e.cursor=mouse||pointer,e}function calcPointToPercentage(calcPoint){var location,proposal=100*(calcPoint-offset(scope_Base,options.ort))/baseSize();return proposal=limit(proposal),options.dir?100-proposal:proposal}function getClosestHandle(clickedPosition){var smallestDifference=100,handleNumber=!1;return scope_Handles.forEach((function(handle,index){if(!isHandleDisabled(index)){var handlePosition=scope_Locations[index],differenceWithThisHandle=Math.abs(handlePosition-clickedPosition),clickAtEdge,isCloser,isCloserAfter;(differenceWithThisHandle<smallestDifference||differenceWithThisHandle<=smallestDifference&&clickedPosition>handlePosition||100===differenceWithThisHandle&&100===smallestDifference)&&(handleNumber=index,smallestDifference=differenceWithThisHandle)}})),handleNumber}function documentLeave(event,data){"mouseout"===event.type&&"HTML"===event.target.nodeName&&null===event.relatedTarget&&eventEnd(event,data)}function eventMove(event,data){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===event.buttons&&0!==data.buttonsProperty)return eventEnd(event,data);var movement=(options.dir?-1:1)*(event.calcPoint-data.startCalcPoint),proposal;moveHandles(movement>0,100*movement/data.baseSize,data.locations,data.handleNumbers)}function eventEnd(event,data){data.handle&&(removeClass(data.handle,options.cssClasses.active),scope_ActiveHandlesCount-=1),data.listeners.forEach((function(c){scope_DocumentElement.removeEventListener(c[0],c[1])})),0===scope_ActiveHandlesCount&&(removeClass(scope_Target,options.cssClasses.drag),setZindex(),event.cursor&&(scope_Body.style.cursor="",scope_Body.removeEventListener("selectstart",preventDefault))),data.handleNumbers.forEach((function(handleNumber){fireEvent("change",handleNumber),fireEvent("set",handleNumber),fireEvent("end",handleNumber)}))}function eventStart(event,data){if(data.handleNumbers.some(isHandleDisabled))return!1;var handle,handleOrigin;1===data.handleNumbers.length&&(handle=scope_Handles[data.handleNumbers[0]].children[0],scope_ActiveHandlesCount+=1,addClass(handle,options.cssClasses.active));event.stopPropagation();var listeners=[],moveEvent=attachEvent(actions.move,scope_DocumentElement,eventMove,{target:event.target,handle:handle,listeners:listeners,startCalcPoint:event.calcPoint,baseSize:baseSize(),pageOffset:event.pageOffset,handleNumbers:data.handleNumbers,buttonsProperty:event.buttons,locations:scope_Locations.slice()}),endEvent=attachEvent(actions.end,scope_DocumentElement,eventEnd,{target:event.target,handle:handle,listeners:listeners,doNotReject:!0,handleNumbers:data.handleNumbers}),outEvent=attachEvent("mouseout",scope_DocumentElement,documentLeave,{target:event.target,handle:handle,listeners:listeners,doNotReject:!0,handleNumbers:data.handleNumbers});listeners.push.apply(listeners,moveEvent.concat(endEvent,outEvent)),event.cursor&&(scope_Body.style.cursor=getComputedStyle(event.target).cursor,scope_Handles.length>1&&addClass(scope_Target,options.cssClasses.drag),scope_Body.addEventListener("selectstart",preventDefault,!1)),data.handleNumbers.forEach((function(handleNumber){fireEvent("start",handleNumber)}))}function eventTap(event){event.stopPropagation();var proposal=calcPointToPercentage(event.calcPoint),handleNumber=getClosestHandle(proposal);if(!1===handleNumber)return!1;options.events.snap||addClassFor(scope_Target,options.cssClasses.tap,options.animationDuration),setHandle(handleNumber,proposal,!0,!0),setZindex(),fireEvent("slide",handleNumber,!0),fireEvent("update",handleNumber,!0),fireEvent("change",handleNumber,!0),fireEvent("set",handleNumber,!0),options.events.snap&&eventStart(event,{handleNumbers:[handleNumber]})}function eventHover(event){var proposal=calcPointToPercentage(event.calcPoint),to=scope_Spectrum.getStep(proposal),value=scope_Spectrum.fromStepping(to);Object.keys(scope_Events).forEach((function(targetEvent){"hover"===targetEvent.split(".")[0]&&scope_Events[targetEvent].forEach((function(callback){callback.call(scope_Self,value)}))}))}function eventKeydown(event,handleNumber){if(isSliderDisabled()||isHandleDisabled(handleNumber))return!1;var horizontalKeys=["Left","Right"],verticalKeys=["Down","Up"],largeStepKeys=["PageDown","PageUp"],edgeKeys=["Home","End"];options.dir&&!options.ort?horizontalKeys.reverse():options.ort&&!options.dir&&(verticalKeys.reverse(),largeStepKeys.reverse());var key=event.key.replace("Arrow",""),isLargeDown=key===largeStepKeys[0],isLargeUp=key===largeStepKeys[1],isDown=key===verticalKeys[0]||key===horizontalKeys[0]||isLargeDown,isUp=key===verticalKeys[1]||key===horizontalKeys[1]||isLargeUp,isMin,isMax=key===edgeKeys[1],to;if(!(isDown||isUp||key===edgeKeys[0]||isMax))return!0;if(event.preventDefault(),isUp||isDown){var multiplier=5,direction=isDown?0:1,steps,step=getNextStepsForHandle(handleNumber)[direction];if(null===step)return!1;!1===step&&(step=scope_Spectrum.getDefaultStep(scope_Locations[handleNumber],isDown,10)),(isLargeUp||isLargeDown)&&(step*=5),step=Math.max(step,1e-7),step*=isDown?-1:1,to=scope_Values[handleNumber]+step}else to=isMax?options.spectrum.xVal[options.spectrum.xVal.length-1]:options.spectrum.xVal[0];return setHandle(handleNumber,scope_Spectrum.toStepping(to),!0,!0),fireEvent("slide",handleNumber),fireEvent("update",handleNumber),fireEvent("change",handleNumber),fireEvent("set",handleNumber),!1}function bindSliderEvents(behaviour){behaviour.fixed||scope_Handles.forEach((function(handle,index){attachEvent(actions.start,handle.children[0],eventStart,{handleNumbers:[index]})})),behaviour.tap&&attachEvent(actions.start,scope_Base,eventTap,{}),behaviour.hover&&attachEvent(actions.move,scope_Base,eventHover,{hover:!0}),behaviour.drag&&scope_Connects.forEach((function(connect,index){if(!1!==connect&&0!==index&&index!==scope_Connects.length-1){var handleBefore=scope_Handles[index-1],handleAfter=scope_Handles[index],eventHolders=[connect];addClass(connect,options.cssClasses.draggable),behaviour.fixed&&(eventHolders.push(handleBefore.children[0]),eventHolders.push(handleAfter.children[0])),eventHolders.forEach((function(eventHolder){attachEvent(actions.start,eventHolder,eventStart,{handles:[handleBefore,handleAfter],handleNumbers:[index-1,index]})}))}}))}function bindEvent(namespacedEvent,callback){scope_Events[namespacedEvent]=scope_Events[namespacedEvent]||[],scope_Events[namespacedEvent].push(callback),"update"===namespacedEvent.split(".")[0]&&scope_Handles.forEach((function(a,index){fireEvent("update",index)}))}function removeEvent(namespacedEvent){var event=namespacedEvent&&namespacedEvent.split(".")[0],namespace=event&&namespacedEvent.substring(event.length);Object.keys(scope_Events).forEach((function(bind){var tEvent=bind.split(".")[0],tNamespace=bind.substring(tEvent.length);event&&event!==tEvent||namespace&&namespace!==tNamespace||delete scope_Events[bind]}))}function fireEvent(eventName,handleNumber,tap){Object.keys(scope_Events).forEach((function(targetEvent){var eventType=targetEvent.split(".")[0];eventName===eventType&&scope_Events[targetEvent].forEach((function(callback){callback.call(scope_Self,scope_Values.map(options.format.to),handleNumber,scope_Values.slice(),tap||!1,scope_Locations.slice(),scope_Self)}))}))}function checkHandlePosition(reference,handleNumber,to,lookBackward,lookForward,getValue){var distance;return scope_Handles.length>1&&!options.events.unconstrained&&(lookBackward&&handleNumber>0&&(distance=scope_Spectrum.getAbsoluteDistance(reference[handleNumber-1],options.margin,0),to=Math.max(to,distance)),lookForward&&handleNumber<scope_Handles.length-1&&(distance=scope_Spectrum.getAbsoluteDistance(reference[handleNumber+1],options.margin,1),to=Math.min(to,distance))),scope_Handles.length>1&&options.limit&&(lookBackward&&handleNumber>0&&(distance=scope_Spectrum.getAbsoluteDistance(reference[handleNumber-1],options.limit,0),to=Math.min(to,distance)),lookForward&&handleNumber<scope_Handles.length-1&&(distance=scope_Spectrum.getAbsoluteDistance(reference[handleNumber+1],options.limit,1),to=Math.max(to,distance))),options.padding&&(0===handleNumber&&(distance=scope_Spectrum.getAbsoluteDistance(0,options.padding[0],0),to=Math.max(to,distance)),handleNumber===scope_Handles.length-1&&(distance=scope_Spectrum.getAbsoluteDistance(100,options.padding[1],1),to=Math.min(to,distance))),!((to=limit(to=scope_Spectrum.getStep(to)))===reference[handleNumber]&&!getValue)&&to}function inRuleOrder(v,a){var o=options.ort;return(o?a:v)+", "+(o?v:a)}function moveHandles(upward,proposal,locations,handleNumbers){var proposals=locations.slice(),b=[!upward,upward],f=[upward,!upward];handleNumbers=handleNumbers.slice(),upward&&handleNumbers.reverse(),handleNumbers.length>1?handleNumbers.forEach((function(handleNumber,o){var to=checkHandlePosition(proposals,handleNumber,proposals[handleNumber]+proposal,b[o],f[o],!1);!1===to?proposal=0:(proposal=to-proposals[handleNumber],proposals[handleNumber]=to)})):b=f=[!0];var state=!1;handleNumbers.forEach((function(handleNumber,o){state=setHandle(handleNumber,locations[handleNumber]+proposal,b[o],f[o])||state})),state&&handleNumbers.forEach((function(handleNumber){fireEvent("update",handleNumber),fireEvent("slide",handleNumber)}))}function transformDirection(a,b){return options.dir?100-a-b:a}function updateHandlePosition(handleNumber,to){scope_Locations[handleNumber]=to,scope_Values[handleNumber]=scope_Spectrum.fromStepping(to);var translation,translateRule="translate("+inRuleOrder(10*(transformDirection(to,0)-scope_DirOffset)+"%","0")+")";scope_Handles[handleNumber].style[options.transformRule]=translateRule,updateConnect(handleNumber),updateConnect(handleNumber+1)}function setZindex(){scope_HandleNumbers.forEach((function(handleNumber){var dir=scope_Locations[handleNumber]>50?-1:1,zIndex=3+(scope_Handles.length+dir*handleNumber);scope_Handles[handleNumber].style.zIndex=zIndex}))}function setHandle(handleNumber,to,lookBackward,lookForward){return!1!==(to=checkHandlePosition(scope_Locations,handleNumber,to,lookBackward,lookForward,!1))&&(updateHandlePosition(handleNumber,to),!0)}function updateConnect(index){if(scope_Connects[index]){var l=0,h=100;0!==index&&(l=scope_Locations[index-1]),index!==scope_Connects.length-1&&(h=scope_Locations[index]);var connectWidth=h-l,translateRule="translate("+inRuleOrder(transformDirection(l,connectWidth)+"%","0")+")",scaleRule="scale("+inRuleOrder(connectWidth/100,"1")+")";scope_Connects[index].style[options.transformRule]=translateRule+" "+scaleRule}}function resolveToValue(to,handleNumber){return null===to||!1===to||void 0===to?scope_Locations[handleNumber]:("number"==typeof to&&(to=String(to)),to=options.format.from(to),!1===(to=scope_Spectrum.toStepping(to))||isNaN(to)?scope_Locations[handleNumber]:to)}function valueSet(input,fireSetEvent){var values=asArray(input),isInit=void 0===scope_Locations[0];fireSetEvent=void 0===fireSetEvent||!!fireSetEvent,options.animate&&!isInit&&addClassFor(scope_Target,options.cssClasses.tap,options.animationDuration),scope_HandleNumbers.forEach((function(handleNumber){setHandle(handleNumber,resolveToValue(values[handleNumber],handleNumber),!0,!1)}));for(var i=1===scope_HandleNumbers.length?0:1;i<scope_HandleNumbers.length;++i)scope_HandleNumbers.forEach((function(handleNumber){setHandle(handleNumber,scope_Locations[handleNumber],!0,!0)}));setZindex(),scope_HandleNumbers.forEach((function(handleNumber){fireEvent("update",handleNumber),null!==values[handleNumber]&&fireSetEvent&&fireEvent("set",handleNumber)}))}function valueReset(fireSetEvent){valueSet(options.start,fireSetEvent)}function valueSetHandle(handleNumber,value,fireSetEvent){if(!((handleNumber=Number(handleNumber))>=0&&handleNumber<scope_HandleNumbers.length))throw new Error("noUiSlider (14.5.0): invalid handle number, got: "+handleNumber);setHandle(handleNumber,resolveToValue(value,handleNumber),!0,!0),fireEvent("update",handleNumber),fireSetEvent&&fireEvent("set",handleNumber)}function valueGet(){var values=scope_Values.map(options.format.to);return 1===values.length?values[0]:values}function destroy(){for(var key in options.cssClasses)options.cssClasses.hasOwnProperty(key)&&removeClass(scope_Target,options.cssClasses[key]);for(;scope_Target.firstChild;)scope_Target.removeChild(scope_Target.firstChild);delete scope_Target.noUiSlider}function getNextStepsForHandle(handleNumber){var location=scope_Locations[handleNumber],nearbySteps=scope_Spectrum.getNearbySteps(location),value=scope_Values[handleNumber],increment=nearbySteps.thisStep.step,decrement=null;if(options.snap)return[value-nearbySteps.stepBefore.startValue||null,nearbySteps.stepAfter.startValue-value||null];!1!==increment&&value+increment>nearbySteps.stepAfter.startValue&&(increment=nearbySteps.stepAfter.startValue-value),decrement=value>nearbySteps.thisStep.startValue?nearbySteps.thisStep.step:!1!==nearbySteps.stepBefore.step&&value-nearbySteps.stepBefore.highestStep,100===location?increment=null:0===location&&(decrement=null);var stepDecimals=scope_Spectrum.countStepDecimals();return null!==increment&&!1!==increment&&(increment=Number(increment.toFixed(stepDecimals))),null!==decrement&&!1!==decrement&&(decrement=Number(decrement.toFixed(stepDecimals))),[decrement,increment]}function getNextSteps(){return scope_HandleNumbers.map(getNextStepsForHandle)}function updateOptions(optionsToUpdate,fireSetEvent){var v=valueGet(),updateAble=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];updateAble.forEach((function(name){void 0!==optionsToUpdate[name]&&(originalOptions[name]=optionsToUpdate[name])}));var newOptions=testOptions(originalOptions);updateAble.forEach((function(name){void 0!==optionsToUpdate[name]&&(options[name]=newOptions[name])})),scope_Spectrum=newOptions.spectrum,options.margin=newOptions.margin,options.limit=newOptions.limit,options.padding=newOptions.padding,options.pips?pips(options.pips):removePips(),options.tooltips?tooltips():removeTooltips(),scope_Locations=[],valueSet(optionsToUpdate.start||v,fireSetEvent)}function setupSlider(){scope_Base=addSlider(scope_Target),addElements(options.connect,scope_Base),bindSliderEvents(options.events),valueSet(options.start),options.pips&&pips(options.pips),options.tooltips&&tooltips(),aria()}return setupSlider(),scope_Self={destroy:destroy,steps:getNextSteps,on:bindEvent,off:removeEvent,get:valueGet,set:valueSet,setHandle:valueSetHandle,reset:valueReset,__moveHandles:function(a,b,c){moveHandles(a,b,scope_Locations,c)},options:originalOptions,updateOptions:updateOptions,target:scope_Target,removePips:removePips,removeTooltips:removeTooltips,getTooltips:function(){return scope_Tooltips},getOrigins:function(){return scope_Handles},pips:pips}}function initialize(target,originalOptions){if(!target||!target.nodeName)throw new Error("noUiSlider (14.5.0): create requires a single element, got: "+target);if(target.noUiSlider)throw new Error("noUiSlider (14.5.0): Slider was already initialized.");var options,api=scope(target,testOptions(originalOptions,target),originalOptions);return target.noUiSlider=api,api}return{__spectrum:Spectrum,version:VERSION,cssClasses:cssClasses,create:initialize}})),
|
||
/*!
|
||
autosize 4.0.2
|
||
license: MIT
|
||
http://www.jacklmoore.com/autosize
|
||
*/
|
||
function(global,factory){if("function"==typeof define&&define.amd)define(["module","exports"],factory);else if("undefined"!=typeof exports)factory(module,exports);else{var mod={exports:{}};factory(mod,mod.exports),global.autosize=mod.exports}}(this,(function(module,exports){"use strict";var map="function"==typeof Map?new Map:(keys=[],values=[],{has:function has(key){return keys.indexOf(key)>-1},get:function get(key){return values[keys.indexOf(key)]},set:function set(key,value){-1===keys.indexOf(key)&&(keys.push(key),values.push(value))},delete:function _delete(key){var index=keys.indexOf(key);index>-1&&(keys.splice(index,1),values.splice(index,1))}}),keys,values,createEvent=function createEvent(name){return new Event(name,{bubbles:!0})};try{new Event("test")}catch(e){createEvent=function createEvent(name){var evt=document.createEvent("Event");return evt.initEvent(name,!0,!1),evt}}function assign(ta){if(ta&&ta.nodeName&&"TEXTAREA"===ta.nodeName&&!map.has(ta)){var heightOffset=null,clientWidth=null,cachedHeight=null,pageResize=function pageResize(){ta.clientWidth!==clientWidth&&update()},destroy=function(style){window.removeEventListener("resize",pageResize,!1),ta.removeEventListener("input",update,!1),ta.removeEventListener("keyup",update,!1),ta.removeEventListener("autosize:destroy",destroy,!1),ta.removeEventListener("autosize:update",update,!1),Object.keys(style).forEach((function(key){ta.style[key]=style[key]})),map.delete(ta)}.bind(ta,{height:ta.style.height,resize:ta.style.resize,overflowY:ta.style.overflowY,overflowX:ta.style.overflowX,wordWrap:ta.style.wordWrap});ta.addEventListener("autosize:destroy",destroy,!1),"onpropertychange"in ta&&"oninput"in ta&&ta.addEventListener("keyup",update,!1),window.addEventListener("resize",pageResize,!1),ta.addEventListener("input",update,!1),ta.addEventListener("autosize:update",update,!1),ta.style.overflowX="hidden",ta.style.wordWrap="break-word",map.set(ta,{destroy:destroy,update:update}),init()}function init(){var style=window.getComputedStyle(ta,null);"vertical"===style.resize?ta.style.resize="none":"both"===style.resize&&(ta.style.resize="horizontal"),heightOffset="content-box"===style.boxSizing?-(parseFloat(style.paddingTop)+parseFloat(style.paddingBottom)):parseFloat(style.borderTopWidth)+parseFloat(style.borderBottomWidth),isNaN(heightOffset)&&(heightOffset=0),update()}function changeOverflow(value){var width=ta.style.width;ta.style.width="0px",ta.offsetWidth,ta.style.width=width,ta.style.overflowY=value}function getParentOverflows(el){for(var arr=[];el&&el.parentNode&&el.parentNode instanceof Element;)el.parentNode.scrollTop&&arr.push({node:el.parentNode,scrollTop:el.parentNode.scrollTop}),el=el.parentNode;return arr}function resize(){if(0!==ta.scrollHeight){var overflows=getParentOverflows(ta),docTop=document.documentElement&&document.documentElement.scrollTop;ta.style.height="",ta.style.height=ta.scrollHeight+heightOffset+"px",clientWidth=ta.clientWidth,overflows.forEach((function(el){el.node.scrollTop=el.scrollTop})),docTop&&(document.documentElement.scrollTop=docTop)}}function update(){resize();var styleHeight=Math.round(parseFloat(ta.style.height)),computed=window.getComputedStyle(ta,null),actualHeight="content-box"===computed.boxSizing?Math.round(parseFloat(computed.height)):ta.offsetHeight;if(actualHeight<styleHeight?"hidden"===computed.overflowY&&(changeOverflow("scroll"),resize(),actualHeight="content-box"===computed.boxSizing?Math.round(parseFloat(window.getComputedStyle(ta,null).height)):ta.offsetHeight):"hidden"!==computed.overflowY&&(changeOverflow("hidden"),resize(),actualHeight="content-box"===computed.boxSizing?Math.round(parseFloat(window.getComputedStyle(ta,null).height)):ta.offsetHeight),cachedHeight!==actualHeight){cachedHeight=actualHeight;var evt=createEvent("autosize:resized");try{ta.dispatchEvent(evt)}catch(err){}}}}function destroy(ta){var methods=map.get(ta);methods&&methods.destroy()}function update(ta){var methods=map.get(ta);methods&&methods.update()}var autosize=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((autosize=function autosize(el){return el}).destroy=function(el){return el},autosize.update=function(el){return el}):((autosize=function autosize(el,options){return el&&Array.prototype.forEach.call(el.length?el:[el],(function(x){return assign(x,options)})),el}).destroy=function(el){return el&&Array.prototype.forEach.call(el.length?el:[el],destroy),el},autosize.update=function(el){return el&&Array.prototype.forEach.call(el.length?el:[el],update),el}),exports.default=autosize,module.exports=exports.default})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,(function(){return o={},r.m=n=[function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n,t.exports.TinyEmitter=n},function(t,e,n){var d=n(3),h=n(4);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(u=t).addEventListener(s,f),{destroy:function(){u.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,l=n,Array.prototype.forEach.call(a,(function(t){t.addEventListener(c,l)})),{destroy:function(){Array.prototype.forEach.call(a,(function(t){t.removeEventListener(c,l)}))}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,l,u,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(5);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return i(t,e,n,o,r)})))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},function(t,e,n){"use strict";n.r(e);var o=n(0),r=n.n(o),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function c(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),this.resolveOptions(t),this.initSelection()}var l=(function(t,e,n){e&&a(t.prototype,e)}(c,[{key:"resolveOptions",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=r()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=r()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(t){var e=0<arguments.length&&void 0!==t?t:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),c),u=n(1),s=n.n(u),f=n(2),d=n.n(f),h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=function(t,e,n){return e&&y(t.prototype,e),n&&y(t,n),t};function y(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var m=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(v,s.a),p(v,[{key:"resolveOptions",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===h(e.container)?e.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=d()(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return b("action",t)}},{key:"defaultTarget",value:function(t){var e=b("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return b("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(t){var e=0<arguments.length&&void 0!==t?t:["copy","cut"],n="string"==typeof e?[e]:e,o=!!document.queryCommandSupported;return n.forEach((function(t){o=o&&!!document.queryCommandSupported(t)})),o}}]),v);function v(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,v);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return n.resolveOptions(e),n.listenClick(t),n}function b(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}e.default=m}],r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6).default;function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}var n,o}));var Emitter=function(){function Emitter(){_classCallCheck(this,Emitter)}return _createClass(Emitter,[{key:"on",value:function on(event,fn){return this._callbacks=this._callbacks||{},this._callbacks[event]||(this._callbacks[event]=[]),this._callbacks[event].push(fn),this}},{key:"emit",value:function emit(event){this._callbacks=this._callbacks||{};var callbacks=this._callbacks[event];if(callbacks){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _iterator=callbacks[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var callback=_step.value;callback.apply(this,args)}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}}return this}},{key:"off",value:function off(event,fn){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var callbacks=this._callbacks[event];if(!callbacks)return this;if(1===arguments.length)return delete this._callbacks[event],this;for(var i=0;i<callbacks.length;i++){var callback=callbacks[i];if(callback===fn){callbacks.splice(i,1);break}}return this}}]),Emitter}(),Dropzone=function(_Emitter){function Dropzone(el,options){var _this,fallback,left;if(_classCallCheck(this,Dropzone),(_this=_possibleConstructorReturn(this,_getPrototypeOf(Dropzone).call(this))).element=el,_this.version=Dropzone.version,_this.defaultOptions.previewTemplate=_this.defaultOptions.previewTemplate.replace(/\n*/g,""),_this.clickableElements=[],_this.listeners=[],_this.files=[],"string"==typeof _this.element&&(_this.element=document.querySelector(_this.element)),!_this.element||null==_this.element.nodeType)throw new Error("Invalid dropzone element.");if(_this.element.dropzone)throw new Error("Dropzone already attached.");Dropzone.instances.push(_assertThisInitialized(_this)),_this.element.dropzone=_assertThisInitialized(_this);var elementOptions=null!=(left=Dropzone.optionsForElement(_this.element))?left:{};if(_this.options=Dropzone.extend({},_this.defaultOptions,elementOptions,null!=options?options:{}),_this.options.forceFallback||!Dropzone.isBrowserSupported())return _possibleConstructorReturn(_this,_this.options.fallback.call(_assertThisInitialized(_this)));if(null==_this.options.url&&(_this.options.url=_this.element.getAttribute("action")),!_this.options.url)throw new Error("No URL provided.");if(_this.options.acceptedFiles&&_this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(_this.options.uploadMultiple&&_this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return _this.options.acceptedMimeTypes&&(_this.options.acceptedFiles=_this.options.acceptedMimeTypes,delete _this.options.acceptedMimeTypes),null!=_this.options.renameFilename&&(_this.options.renameFile=function(file){return _this.options.renameFilename.call(_assertThisInitialized(_this),file.name,file)}),_this.options.method=_this.options.method.toUpperCase(),(fallback=_this.getExistingFallback())&&fallback.parentNode&&fallback.parentNode.removeChild(fallback),!1!==_this.options.previewsContainer&&(_this.options.previewsContainer?_this.previewsContainer=Dropzone.getElement(_this.options.previewsContainer,"previewsContainer"):_this.previewsContainer=_this.element),_this.options.clickable&&(!0===_this.options.clickable?_this.clickableElements=[_this.element]:_this.clickableElements=Dropzone.getElements(_this.options.clickable,"clickable")),_this.init(),_this}return _inherits(Dropzone,_Emitter),_createClass(Dropzone,null,[{key:"initClass",value:function initClass(){this.prototype.Emitter=Emitter,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function init(){},params:function params(files,xhr,chunk){if(chunk)return{dzuuid:chunk.file.upload.uuid,dzchunkindex:chunk.index,dztotalfilesize:chunk.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:chunk.file.upload.totalChunkCount,dzchunkbyteoffset:chunk.index*this.options.chunkSize}},accept:function accept(file,done){return done()},chunksUploaded:function chunksUploaded(file,done){done()},fallback:function fallback(){var messageElement;this.element.className="".concat(this.element.className," dz-browser-not-supported");var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _iterator2=this.element.getElementsByTagName("div")[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0){var child=_step2.value;if(/(^| )dz-message($| )/.test(child.className)){messageElement=child,child.className="dz-message";break}}}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}messageElement||(messageElement=Dropzone.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(messageElement));var span=messageElement.getElementsByTagName("span")[0];return span&&(null!=span.textContent?span.textContent=this.options.dictFallbackMessage:null!=span.innerText&&(span.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function resize(file,width,height,resizeMethod){var info={srcX:0,srcY:0,srcWidth:file.width,srcHeight:file.height},srcRatio=file.width/file.height;null==width&&null==height?(width=info.srcWidth,height=info.srcHeight):null==width?width=height*srcRatio:null==height&&(height=width/srcRatio);var trgRatio=(width=Math.min(width,info.srcWidth))/(height=Math.min(height,info.srcHeight));if(info.srcWidth>width||info.srcHeight>height)if("crop"===resizeMethod)srcRatio>trgRatio?(info.srcHeight=file.height,info.srcWidth=info.srcHeight*trgRatio):(info.srcWidth=file.width,info.srcHeight=info.srcWidth/trgRatio);else{if("contain"!==resizeMethod)throw new Error("Unknown resizeMethod '".concat(resizeMethod,"'"));srcRatio>trgRatio?height=width/srcRatio:width=height*srcRatio}return info.srcX=(file.width-info.srcWidth)/2,info.srcY=(file.height-info.srcHeight)/2,info.trgWidth=width,info.trgHeight=height,info},transformFile:function transformFile(file,done){return(this.options.resizeWidth||this.options.resizeHeight)&&file.type.match(/image.*/)?this.resizeImage(file,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,done):done(file)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Check</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Error</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function dragstart(e){},dragend:function dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover:function dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave:function dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste:function paste(e){},reset:function reset(){return this.element.classList.remove("dz-started")},addedfile:function addedfile(file){var _this2=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){file.previewElement=Dropzone.createElement(this.options.previewTemplate.trim()),file.previewTemplate=file.previewElement,this.previewsContainer.appendChild(file.previewElement);var _iteratorNormalCompletion3=!0,_didIteratorError3=!1,_iteratorError3=void 0;try{for(var _iterator3=file.previewElement.querySelectorAll("[data-dz-name]")[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=!0){var node=_step3.value;node.textContent=file.name}}catch(err){_didIteratorError3=!0,_iteratorError3=err}finally{try{_iteratorNormalCompletion3||null==_iterator3.return||_iterator3.return()}finally{if(_didIteratorError3)throw _iteratorError3}}var _iteratorNormalCompletion4=!0,_didIteratorError4=!1,_iteratorError4=void 0;try{for(var _iterator4=file.previewElement.querySelectorAll("[data-dz-size]")[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=!0)(node=_step4.value).innerHTML=this.filesize(file.size)}catch(err){_didIteratorError4=!0,_iteratorError4=err}finally{try{_iteratorNormalCompletion4||null==_iterator4.return||_iterator4.return()}finally{if(_didIteratorError4)throw _iteratorError4}}this.options.addRemoveLinks&&(file._removeLink=Dropzone.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),file.previewElement.appendChild(file._removeLink));var removeFileEvent=function removeFileEvent(e){return e.preventDefault(),e.stopPropagation(),file.status===Dropzone.UPLOADING?Dropzone.confirm(_this2.options.dictCancelUploadConfirmation,(function(){return _this2.removeFile(file)})):_this2.options.dictRemoveFileConfirmation?Dropzone.confirm(_this2.options.dictRemoveFileConfirmation,(function(){return _this2.removeFile(file)})):_this2.removeFile(file)},_iteratorNormalCompletion5=!0,_didIteratorError5=!1,_iteratorError5=void 0;try{for(var _iterator5=file.previewElement.querySelectorAll("[data-dz-remove]")[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=!0){var removeLink;_step5.value.addEventListener("click",removeFileEvent)}}catch(err){_didIteratorError5=!0,_iteratorError5=err}finally{try{_iteratorNormalCompletion5||null==_iterator5.return||_iterator5.return()}finally{if(_didIteratorError5)throw _iteratorError5}}}},removedfile:function removedfile(file){return null!=file.previewElement&&null!=file.previewElement.parentNode&&file.previewElement.parentNode.removeChild(file.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function thumbnail(file,dataUrl){if(file.previewElement){file.previewElement.classList.remove("dz-file-preview");var _iteratorNormalCompletion6=!0,_didIteratorError6=!1,_iteratorError6=void 0;try{for(var _iterator6=file.previewElement.querySelectorAll("[data-dz-thumbnail]")[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=!0){var thumbnailElement=_step6.value;thumbnailElement.alt=file.name,thumbnailElement.src=dataUrl}}catch(err){_didIteratorError6=!0,_iteratorError6=err}finally{try{_iteratorNormalCompletion6||null==_iterator6.return||_iterator6.return()}finally{if(_didIteratorError6)throw _iteratorError6}}return setTimeout((function(){return file.previewElement.classList.add("dz-image-preview")}),1)}},error:function error(file,message){if(file.previewElement){file.previewElement.classList.add("dz-error"),"String"!=typeof message&&message.error&&(message=message.error);var _iteratorNormalCompletion7=!0,_didIteratorError7=!1,_iteratorError7=void 0;try{for(var _iterator7=file.previewElement.querySelectorAll("[data-dz-errormessage]")[Symbol.iterator](),_step7;!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=!0){var node;_step7.value.textContent=message}}catch(err){_didIteratorError7=!0,_iteratorError7=err}finally{try{_iteratorNormalCompletion7||null==_iterator7.return||_iterator7.return()}finally{if(_didIteratorError7)throw _iteratorError7}}}},errormultiple:function errormultiple(){},processing:function processing(file){if(file.previewElement&&(file.previewElement.classList.add("dz-processing"),file._removeLink))return file._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function processingmultiple(){},uploadprogress:function uploadprogress(file,progress,bytesSent){if(file.previewElement){var _iteratorNormalCompletion8=!0,_didIteratorError8=!1,_iteratorError8=void 0;try{for(var _iterator8=file.previewElement.querySelectorAll("[data-dz-uploadprogress]")[Symbol.iterator](),_step8;!(_iteratorNormalCompletion8=(_step8=_iterator8.next()).done);_iteratorNormalCompletion8=!0){var node=_step8.value;"PROGRESS"===node.nodeName?node.value=progress:node.style.width="".concat(progress,"%")}}catch(err){_didIteratorError8=!0,_iteratorError8=err}finally{try{_iteratorNormalCompletion8||null==_iterator8.return||_iterator8.return()}finally{if(_didIteratorError8)throw _iteratorError8}}}},totaluploadprogress:function totaluploadprogress(){},sending:function sending(){},sendingmultiple:function sendingmultiple(){},success:function success(file){if(file.previewElement)return file.previewElement.classList.add("dz-success")},successmultiple:function successmultiple(){},canceled:function canceled(file){return this.emit("error",file,this.options.dictUploadCanceled)},canceledmultiple:function canceledmultiple(){},complete:function complete(file){if(file._removeLink&&(file._removeLink.innerHTML=this.options.dictRemoveFile),file.previewElement)return file.previewElement.classList.add("dz-complete")},completemultiple:function completemultiple(){},maxfilesexceeded:function maxfilesexceeded(){},maxfilesreached:function maxfilesreached(){},queuecomplete:function queuecomplete(){},addedfiles:function addedfiles(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function extend(target){for(var _len2=arguments.length,objects=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)objects[_key2-1]=arguments[_key2];for(var _i=0,_objects=objects;_i<_objects.length;_i++){var object=_objects[_i];for(var key in object){var val=object[key];target[key]=val}}return target}}]),_createClass(Dropzone,[{key:"getAcceptedFiles",value:function getAcceptedFiles(){return this.files.filter((function(file){return file.accepted})).map((function(file){return file}))}},{key:"getRejectedFiles",value:function getRejectedFiles(){return this.files.filter((function(file){return!file.accepted})).map((function(file){return file}))}},{key:"getFilesWithStatus",value:function getFilesWithStatus(status){return this.files.filter((function(file){return file.status===status})).map((function(file){return file}))}},{key:"getQueuedFiles",value:function getQueuedFiles(){return this.getFilesWithStatus(Dropzone.QUEUED)}},{key:"getUploadingFiles",value:function getUploadingFiles(){return this.getFilesWithStatus(Dropzone.UPLOADING)}},{key:"getAddedFiles",value:function getAddedFiles(){return this.getFilesWithStatus(Dropzone.ADDED)}},{key:"getActiveFiles",value:function getActiveFiles(){return this.files.filter((function(file){return file.status===Dropzone.UPLOADING||file.status===Dropzone.QUEUED})).map((function(file){return file}))}},{key:"init",value:function init(){var _this3=this,setupHiddenFileInput;("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(Dropzone.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length)&&function setupHiddenFileInput(){return _this3.hiddenFileInput&&_this3.hiddenFileInput.parentNode.removeChild(_this3.hiddenFileInput),_this3.hiddenFileInput=document.createElement("input"),_this3.hiddenFileInput.setAttribute("type","file"),(null===_this3.options.maxFiles||_this3.options.maxFiles>1)&&_this3.hiddenFileInput.setAttribute("multiple","multiple"),_this3.hiddenFileInput.className="dz-hidden-input",null!==_this3.options.acceptedFiles&&_this3.hiddenFileInput.setAttribute("accept",_this3.options.acceptedFiles),null!==_this3.options.capture&&_this3.hiddenFileInput.setAttribute("capture",_this3.options.capture),_this3.hiddenFileInput.style.visibility="hidden",_this3.hiddenFileInput.style.position="absolute",_this3.hiddenFileInput.style.top="0",_this3.hiddenFileInput.style.left="0",_this3.hiddenFileInput.style.height="0",_this3.hiddenFileInput.style.width="0",Dropzone.getElement(_this3.options.hiddenInputContainer,"hiddenInputContainer").appendChild(_this3.hiddenFileInput),_this3.hiddenFileInput.addEventListener("change",(function(){var files=_this3.hiddenFileInput.files;if(files.length){var _iteratorNormalCompletion9=!0,_didIteratorError9=!1,_iteratorError9=void 0;try{for(var _iterator9=files[Symbol.iterator](),_step9;!(_iteratorNormalCompletion9=(_step9=_iterator9.next()).done);_iteratorNormalCompletion9=!0){var file=_step9.value;_this3.addFile(file)}}catch(err){_didIteratorError9=!0,_iteratorError9=err}finally{try{_iteratorNormalCompletion9||null==_iterator9.return||_iterator9.return()}finally{if(_didIteratorError9)throw _iteratorError9}}}return _this3.emit("addedfiles",files),setupHiddenFileInput()}))}();this.URL=null!==window.URL?window.URL:window.webkitURL;var _iteratorNormalCompletion10=!0,_didIteratorError10=!1,_iteratorError10=void 0;try{for(var _iterator10=this.events[Symbol.iterator](),_step10;!(_iteratorNormalCompletion10=(_step10=_iterator10.next()).done);_iteratorNormalCompletion10=!0){var eventName=_step10.value;this.on(eventName,this.options[eventName])}}catch(err){_didIteratorError10=!0,_iteratorError10=err}finally{try{_iteratorNormalCompletion10||null==_iterator10.return||_iterator10.return()}finally{if(_didIteratorError10)throw _iteratorError10}}this.on("uploadprogress",(function(){return _this3.updateTotalUploadProgress()})),this.on("removedfile",(function(){return _this3.updateTotalUploadProgress()})),this.on("canceled",(function(file){return _this3.emit("complete",file)})),this.on("complete",(function(file){if(0===_this3.getAddedFiles().length&&0===_this3.getUploadingFiles().length&&0===_this3.getQueuedFiles().length)return setTimeout((function(){return _this3.emit("queuecomplete")}),0)}));var containsFiles=function containsFiles(e){return e.dataTransfer.types&&e.dataTransfer.types.some((function(type){return"Files"==type}))},noPropagation=function noPropagation(e){if(containsFiles(e))return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function dragstart(e){return _this3.emit("dragstart",e)},dragenter:function dragenter(e){return noPropagation(e),_this3.emit("dragenter",e)},dragover:function dragover(e){var efct;try{efct=e.dataTransfer.effectAllowed}catch(error){}return e.dataTransfer.dropEffect="move"===efct||"linkMove"===efct?"move":"copy",noPropagation(e),_this3.emit("dragover",e)},dragleave:function dragleave(e){return _this3.emit("dragleave",e)},drop:function drop(e){return noPropagation(e),_this3.drop(e)},dragend:function dragend(e){return _this3.emit("dragend",e)}}}],this.clickableElements.forEach((function(clickableElement){return _this3.listeners.push({element:clickableElement,events:{click:function click(evt){return(clickableElement!==_this3.element||evt.target===_this3.element||Dropzone.elementInside(evt.target,_this3.element.querySelector(".dz-message")))&&_this3.hiddenFileInput.click(),!0}}})})),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,Dropzone.instances.splice(Dropzone.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function updateTotalUploadProgress(){var totalUploadProgress,totalBytesSent=0,totalBytes=0,activeFiles;if(this.getActiveFiles().length){var _iteratorNormalCompletion11=!0,_didIteratorError11=!1,_iteratorError11=void 0;try{for(var _iterator11=this.getActiveFiles()[Symbol.iterator](),_step11;!(_iteratorNormalCompletion11=(_step11=_iterator11.next()).done);_iteratorNormalCompletion11=!0){var file=_step11.value;totalBytesSent+=file.upload.bytesSent,totalBytes+=file.upload.total}}catch(err){_didIteratorError11=!0,_iteratorError11=err}finally{try{_iteratorNormalCompletion11||null==_iterator11.return||_iterator11.return()}finally{if(_didIteratorError11)throw _iteratorError11}}totalUploadProgress=100*totalBytesSent/totalBytes}else totalUploadProgress=100;return this.emit("totaluploadprogress",totalUploadProgress,totalBytes,totalBytesSent)}},{key:"_getParamName",value:function _getParamName(n){return"function"==typeof this.options.paramName?this.options.paramName(n):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(n,"]"):"")}},{key:"_renameFile",value:function _renameFile(file){return"function"!=typeof this.options.renameFile?file.name:this.options.renameFile(file)}},{key:"getFallbackForm",value:function getFallbackForm(){var existingFallback,form;if(existingFallback=this.getExistingFallback())return existingFallback;var fieldsString='<div class="dz-fallback">';this.options.dictFallbackText&&(fieldsString+="<p>".concat(this.options.dictFallbackText,"</p>")),fieldsString+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var fields=Dropzone.createElement(fieldsString);return"FORM"!==this.element.tagName?(form=Dropzone.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(fields):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=form?form:fields}},{key:"getExistingFallback",value:function getExistingFallback(){for(var getFallback=function getFallback(elements){var _iteratorNormalCompletion12=!0,_didIteratorError12=!1,_iteratorError12=void 0;try{for(var _iterator12=elements[Symbol.iterator](),_step12;!(_iteratorNormalCompletion12=(_step12=_iterator12.next()).done);_iteratorNormalCompletion12=!0){var el=_step12.value;if(/(^| )fallback($| )/.test(el.className))return el}}catch(err){_didIteratorError12=!0,_iteratorError12=err}finally{try{_iteratorNormalCompletion12||null==_iterator12.return||_iterator12.return()}finally{if(_didIteratorError12)throw _iteratorError12}}},_i2=0,_arr=["div","form"];_i2<_arr.length;_i2++){var tagName=_arr[_i2],fallback;if(fallback=getFallback(this.element.getElementsByTagName(tagName)))return fallback}}},{key:"setupEventListeners",value:function setupEventListeners(){return this.listeners.map((function(elementListeners){return function(){var result=[];for(var event in elementListeners.events){var listener=elementListeners.events[event];result.push(elementListeners.element.addEventListener(event,listener,!1))}return result}()}))}},{key:"removeEventListeners",value:function removeEventListeners(){return this.listeners.map((function(elementListeners){return function(){var result=[];for(var event in elementListeners.events){var listener=elementListeners.events[event];result.push(elementListeners.element.removeEventListener(event,listener,!1))}return result}()}))}},{key:"disable",value:function disable(){var _this4=this;return this.clickableElements.forEach((function(element){return element.classList.remove("dz-clickable")})),this.removeEventListeners(),this.disabled=!0,this.files.map((function(file){return _this4.cancelUpload(file)}))}},{key:"enable",value:function enable(){return delete this.disabled,this.clickableElements.forEach((function(element){return element.classList.add("dz-clickable")})),this.setupEventListeners()}},{key:"filesize",value:function filesize(size){var selectedSize=0,selectedUnit="b";if(size>0){for(var units=["tb","gb","mb","kb","b"],i=0;i<units.length;i++){var unit=units[i],cutoff;if(size>=Math.pow(this.options.filesizeBase,4-i)/10){selectedSize=size/Math.pow(this.options.filesizeBase,4-i),selectedUnit=unit;break}}selectedSize=Math.round(10*selectedSize)/10}return"<strong>".concat(selectedSize,"</strong> ").concat(this.options.dictFileSizeUnits[selectedUnit])}},{key:"_updateMaxFilesReachedClass",value:function _updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function drop(e){if(e.dataTransfer){this.emit("drop",e);for(var files=[],i=0;i<e.dataTransfer.files.length;i++)files[i]=e.dataTransfer.files[i];if(files.length){var items=e.dataTransfer.items;items&&items.length&&null!=items[0].webkitGetAsEntry?this._addFilesFromItems(items):this.handleFiles(files)}this.emit("addedfiles",files)}}},{key:"paste",value:function paste(e){if(null!=__guard__(null!=e?e.clipboardData:void 0,(function(x){return x.items}))){this.emit("paste",e);var items=e.clipboardData.items;return items.length?this._addFilesFromItems(items):void 0}}},{key:"handleFiles",value:function handleFiles(files){var _iteratorNormalCompletion13=!0,_didIteratorError13=!1,_iteratorError13=void 0;try{for(var _iterator13=files[Symbol.iterator](),_step13;!(_iteratorNormalCompletion13=(_step13=_iterator13.next()).done);_iteratorNormalCompletion13=!0){var file=_step13.value;this.addFile(file)}}catch(err){_didIteratorError13=!0,_iteratorError13=err}finally{try{_iteratorNormalCompletion13||null==_iterator13.return||_iterator13.return()}finally{if(_didIteratorError13)throw _iteratorError13}}}},{key:"_addFilesFromItems",value:function _addFilesFromItems(items){var _this5=this;return function(){var result=[],_iteratorNormalCompletion14=!0,_didIteratorError14=!1,_iteratorError14=void 0;try{for(var _iterator14=items[Symbol.iterator](),_step14;!(_iteratorNormalCompletion14=(_step14=_iterator14.next()).done);_iteratorNormalCompletion14=!0){var item=_step14.value,entry;null!=item.webkitGetAsEntry&&(entry=item.webkitGetAsEntry())?entry.isFile?result.push(_this5.addFile(item.getAsFile())):entry.isDirectory?result.push(_this5._addFilesFromDirectory(entry,entry.name)):result.push(void 0):null!=item.getAsFile&&(null==item.kind||"file"===item.kind)?result.push(_this5.addFile(item.getAsFile())):result.push(void 0)}}catch(err){_didIteratorError14=!0,_iteratorError14=err}finally{try{_iteratorNormalCompletion14||null==_iterator14.return||_iterator14.return()}finally{if(_didIteratorError14)throw _iteratorError14}}return result}()}},{key:"_addFilesFromDirectory",value:function _addFilesFromDirectory(directory,path){var _this6=this,dirReader=directory.createReader(),errorHandler=function errorHandler(error){return __guardMethod__(console,"log",(function(o){return o.log(error)}))},readEntries;return function readEntries(){return dirReader.readEntries((function(entries){if(entries.length>0){var _iteratorNormalCompletion15=!0,_didIteratorError15=!1,_iteratorError15=void 0;try{for(var _iterator15=entries[Symbol.iterator](),_step15;!(_iteratorNormalCompletion15=(_step15=_iterator15.next()).done);_iteratorNormalCompletion15=!0){var entry=_step15.value;entry.isFile?entry.file((function(file){if(!_this6.options.ignoreHiddenFiles||"."!==file.name.substring(0,1))return file.fullPath="".concat(path,"/").concat(file.name),_this6.addFile(file)})):entry.isDirectory&&_this6._addFilesFromDirectory(entry,"".concat(path,"/").concat(entry.name))}}catch(err){_didIteratorError15=!0,_iteratorError15=err}finally{try{_iteratorNormalCompletion15||null==_iterator15.return||_iterator15.return()}finally{if(_didIteratorError15)throw _iteratorError15}}readEntries()}return null}),errorHandler)}()}},{key:"accept",value:function accept(file,done){this.options.maxFilesize&&file.size>1024*this.options.maxFilesize*1024?done(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(file.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):Dropzone.isValidFile(file,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",file)):this.options.accept.call(this,file,done):done(this.options.dictInvalidFileType)}},{key:"addFile",value:function addFile(file){var _this7=this;file.upload={uuid:Dropzone.uuidv4(),progress:0,total:file.size,bytesSent:0,filename:this._renameFile(file)},this.files.push(file),file.status=Dropzone.ADDED,this.emit("addedfile",file),this._enqueueThumbnail(file),this.accept(file,(function(error){error?(file.accepted=!1,_this7._errorProcessing([file],error)):(file.accepted=!0,_this7.options.autoQueue&&_this7.enqueueFile(file)),_this7._updateMaxFilesReachedClass()}))}},{key:"enqueueFiles",value:function enqueueFiles(files){var _iteratorNormalCompletion16=!0,_didIteratorError16=!1,_iteratorError16=void 0;try{for(var _iterator16=files[Symbol.iterator](),_step16;!(_iteratorNormalCompletion16=(_step16=_iterator16.next()).done);_iteratorNormalCompletion16=!0){var file=_step16.value;this.enqueueFile(file)}}catch(err){_didIteratorError16=!0,_iteratorError16=err}finally{try{_iteratorNormalCompletion16||null==_iterator16.return||_iterator16.return()}finally{if(_didIteratorError16)throw _iteratorError16}}return null}},{key:"enqueueFile",value:function enqueueFile(file){var _this8=this;if(file.status!==Dropzone.ADDED||!0!==file.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(file.status=Dropzone.QUEUED,this.options.autoProcessQueue)return setTimeout((function(){return _this8.processQueue()}),0)}},{key:"_enqueueThumbnail",value:function _enqueueThumbnail(file){var _this9=this;if(this.options.createImageThumbnails&&file.type.match(/image.*/)&&file.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(file),setTimeout((function(){return _this9._processThumbnailQueue()}),0)}},{key:"_processThumbnailQueue",value:function _processThumbnailQueue(){var _this10=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var file=this._thumbnailQueue.shift();return this.createThumbnail(file,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(function(dataUrl){return _this10.emit("thumbnail",file,dataUrl),_this10._processingThumbnail=!1,_this10._processThumbnailQueue()}))}}},{key:"removeFile",value:function removeFile(file){if(file.status===Dropzone.UPLOADING&&this.cancelUpload(file),this.files=without(this.files,file),this.emit("removedfile",file),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function removeAllFiles(cancelIfNecessary){null==cancelIfNecessary&&(cancelIfNecessary=!1);var _iteratorNormalCompletion17=!0,_didIteratorError17=!1,_iteratorError17=void 0;try{for(var _iterator17=this.files.slice()[Symbol.iterator](),_step17;!(_iteratorNormalCompletion17=(_step17=_iterator17.next()).done);_iteratorNormalCompletion17=!0){var file=_step17.value;(file.status!==Dropzone.UPLOADING||cancelIfNecessary)&&this.removeFile(file)}}catch(err){_didIteratorError17=!0,_iteratorError17=err}finally{try{_iteratorNormalCompletion17||null==_iterator17.return||_iterator17.return()}finally{if(_didIteratorError17)throw _iteratorError17}}return null}},{key:"resizeImage",value:function resizeImage(file,width,height,resizeMethod,callback){var _this11=this;return this.createThumbnail(file,width,height,resizeMethod,!0,(function(dataUrl,canvas){if(null==canvas)return callback(file);var resizeMimeType=_this11.options.resizeMimeType;null==resizeMimeType&&(resizeMimeType=file.type);var resizedDataURL=canvas.toDataURL(resizeMimeType,_this11.options.resizeQuality);return"image/jpeg"!==resizeMimeType&&"image/jpg"!==resizeMimeType||(resizedDataURL=ExifRestore.restore(file.dataURL,resizedDataURL)),callback(Dropzone.dataURItoBlob(resizedDataURL))}))}},{key:"createThumbnail",value:function createThumbnail(file,width,height,resizeMethod,fixOrientation,callback){var _this12=this,fileReader=new FileReader;fileReader.onload=function(){file.dataURL=fileReader.result,"image/svg+xml"!==file.type?_this12.createThumbnailFromUrl(file,width,height,resizeMethod,fixOrientation,callback):null!=callback&&callback(fileReader.result)},fileReader.readAsDataURL(file)}},{key:"displayExistingFile",value:function displayExistingFile(mockFile,imageUrl,callback,crossOrigin){var _this13=this,resizeThumbnail=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this.emit("addedfile",mockFile),this.emit("complete",mockFile),resizeThumbnail){var onDone=function onDone(thumbnail){_this13.emit("thumbnail",mockFile,thumbnail),callback&&callback()};mockFile.dataURL=imageUrl,this.createThumbnailFromUrl(mockFile,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.resizeMethod,this.options.fixOrientation,onDone,crossOrigin)}else this.emit("thumbnail",mockFile,imageUrl),callback&&callback()}},{key:"createThumbnailFromUrl",value:function createThumbnailFromUrl(file,width,height,resizeMethod,fixOrientation,callback,crossOrigin){var _this14=this,img=document.createElement("img");return crossOrigin&&(img.crossOrigin=crossOrigin),img.onload=function(){var loadExif=function loadExif(callback){return callback(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&fixOrientation&&(loadExif=function loadExif(callback){return EXIF.getData(img,(function(){return callback(EXIF.getTag(this,"Orientation"))}))}),loadExif((function(orientation){file.width=img.width,file.height=img.height;var resizeInfo=_this14.options.resize.call(_this14,file,width,height,resizeMethod),canvas=document.createElement("canvas"),ctx=canvas.getContext("2d");switch(canvas.width=resizeInfo.trgWidth,canvas.height=resizeInfo.trgHeight,orientation>4&&(canvas.width=resizeInfo.trgHeight,canvas.height=resizeInfo.trgWidth),orientation){case 2:ctx.translate(canvas.width,0),ctx.scale(-1,1);break;case 3:ctx.translate(canvas.width,canvas.height),ctx.rotate(Math.PI);break;case 4:ctx.translate(0,canvas.height),ctx.scale(1,-1);break;case 5:ctx.rotate(.5*Math.PI),ctx.scale(1,-1);break;case 6:ctx.rotate(.5*Math.PI),ctx.translate(0,-canvas.width);break;case 7:ctx.rotate(.5*Math.PI),ctx.translate(canvas.height,-canvas.width),ctx.scale(-1,1);break;case 8:ctx.rotate(-.5*Math.PI),ctx.translate(-canvas.height,0)}drawImageIOSFix(ctx,img,null!=resizeInfo.srcX?resizeInfo.srcX:0,null!=resizeInfo.srcY?resizeInfo.srcY:0,resizeInfo.srcWidth,resizeInfo.srcHeight,null!=resizeInfo.trgX?resizeInfo.trgX:0,null!=resizeInfo.trgY?resizeInfo.trgY:0,resizeInfo.trgWidth,resizeInfo.trgHeight);var thumbnail=canvas.toDataURL("image/png");if(null!=callback)return callback(thumbnail,canvas)}))},null!=callback&&(img.onerror=callback),img.src=file.dataURL}},{key:"processQueue",value:function processQueue(){var parallelUploads=this.options.parallelUploads,processingLength=this.getUploadingFiles().length,i=processingLength;if(!(processingLength>=parallelUploads)){var queuedFiles=this.getQueuedFiles();if(queuedFiles.length>0){if(this.options.uploadMultiple)return this.processFiles(queuedFiles.slice(0,parallelUploads-processingLength));for(;i<parallelUploads;){if(!queuedFiles.length)return;this.processFile(queuedFiles.shift()),i++}}}}},{key:"processFile",value:function processFile(file){return this.processFiles([file])}},{key:"processFiles",value:function processFiles(files){var _iteratorNormalCompletion18=!0,_didIteratorError18=!1,_iteratorError18=void 0;try{for(var _iterator18=files[Symbol.iterator](),_step18;!(_iteratorNormalCompletion18=(_step18=_iterator18.next()).done);_iteratorNormalCompletion18=!0){var file=_step18.value;file.processing=!0,file.status=Dropzone.UPLOADING,this.emit("processing",file)}}catch(err){_didIteratorError18=!0,_iteratorError18=err}finally{try{_iteratorNormalCompletion18||null==_iterator18.return||_iterator18.return()}finally{if(_didIteratorError18)throw _iteratorError18}}return this.options.uploadMultiple&&this.emit("processingmultiple",files),this.uploadFiles(files)}},{key:"_getFilesWithXhr",value:function _getFilesWithXhr(xhr){var files;return this.files.filter((function(file){return file.xhr===xhr})).map((function(file){return file}))}},{key:"cancelUpload",value:function cancelUpload(file){if(file.status===Dropzone.UPLOADING){var groupedFiles=this._getFilesWithXhr(file.xhr),_iteratorNormalCompletion19=!0,_didIteratorError19=!1,_iteratorError19=void 0;try{for(var _iterator19=groupedFiles[Symbol.iterator](),_step19;!(_iteratorNormalCompletion19=(_step19=_iterator19.next()).done);_iteratorNormalCompletion19=!0){var groupedFile;_step19.value.status=Dropzone.CANCELED}}catch(err){_didIteratorError19=!0,_iteratorError19=err}finally{try{_iteratorNormalCompletion19||null==_iterator19.return||_iterator19.return()}finally{if(_didIteratorError19)throw _iteratorError19}}void 0!==file.xhr&&file.xhr.abort();var _iteratorNormalCompletion20=!0,_didIteratorError20=!1,_iteratorError20=void 0;try{for(var _iterator20=groupedFiles[Symbol.iterator](),_step20;!(_iteratorNormalCompletion20=(_step20=_iterator20.next()).done);_iteratorNormalCompletion20=!0){var _groupedFile=_step20.value;this.emit("canceled",_groupedFile)}}catch(err){_didIteratorError20=!0,_iteratorError20=err}finally{try{_iteratorNormalCompletion20||null==_iterator20.return||_iterator20.return()}finally{if(_didIteratorError20)throw _iteratorError20}}this.options.uploadMultiple&&this.emit("canceledmultiple",groupedFiles)}else file.status!==Dropzone.ADDED&&file.status!==Dropzone.QUEUED||(file.status=Dropzone.CANCELED,this.emit("canceled",file),this.options.uploadMultiple&&this.emit("canceledmultiple",[file]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function resolveOption(option){if("function"==typeof option){for(var _len3=arguments.length,args=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++)args[_key3-1]=arguments[_key3];return option.apply(this,args)}return option}},{key:"uploadFile",value:function uploadFile(file){return this.uploadFiles([file])}},{key:"uploadFiles",value:function uploadFiles(files){var _this15=this;this._transformFiles(files,(function(transformedFiles){if(_this15.options.chunking){var transformedFile=transformedFiles[0];files[0].upload.chunked=_this15.options.chunking&&(_this15.options.forceChunking||transformedFile.size>_this15.options.chunkSize),files[0].upload.totalChunkCount=Math.ceil(transformedFile.size/_this15.options.chunkSize)}if(files[0].upload.chunked){var file=files[0],_transformedFile=transformedFiles[0],startedChunkCount=0;file.upload.chunks=[];var handleNextChunk=function handleNextChunk(){for(var chunkIndex=0;void 0!==file.upload.chunks[chunkIndex];)chunkIndex++;if(!(chunkIndex>=file.upload.totalChunkCount)){startedChunkCount++;var start=chunkIndex*_this15.options.chunkSize,end=Math.min(start+_this15.options.chunkSize,file.size),dataBlock={name:_this15._getParamName(0),data:_transformedFile.webkitSlice?_transformedFile.webkitSlice(start,end):_transformedFile.slice(start,end),filename:file.upload.filename,chunkIndex:chunkIndex};file.upload.chunks[chunkIndex]={file:file,index:chunkIndex,dataBlock:dataBlock,status:Dropzone.UPLOADING,progress:0,retries:0},_this15._uploadData(files,[dataBlock])}};if(file.upload.finishedChunkUpload=function(chunk){var allFinished=!0;chunk.status=Dropzone.SUCCESS,chunk.dataBlock=null,chunk.xhr=null;for(var i=0;i<file.upload.totalChunkCount;i++){if(void 0===file.upload.chunks[i])return handleNextChunk();file.upload.chunks[i].status!==Dropzone.SUCCESS&&(allFinished=!1)}allFinished&&_this15.options.chunksUploaded(file,(function(){_this15._finished(files,"",null)}))},_this15.options.parallelChunkUploads)for(var i=0;i<file.upload.totalChunkCount;i++)handleNextChunk();else handleNextChunk()}else{for(var dataBlocks=[],_i3=0;_i3<files.length;_i3++)dataBlocks[_i3]={name:_this15._getParamName(_i3),data:transformedFiles[_i3],filename:files[_i3].upload.filename};_this15._uploadData(files,dataBlocks)}}))}},{key:"_getChunk",value:function _getChunk(file,xhr){for(var i=0;i<file.upload.totalChunkCount;i++)if(void 0!==file.upload.chunks[i]&&file.upload.chunks[i].xhr===xhr)return file.upload.chunks[i]}},{key:"_uploadData",value:function _uploadData(files,dataBlocks){var _this16=this,xhr=new XMLHttpRequest,_iteratorNormalCompletion21=!0,_didIteratorError21=!1,_iteratorError21=void 0;try{for(var _iterator21=files[Symbol.iterator](),_step21;!(_iteratorNormalCompletion21=(_step21=_iterator21.next()).done);_iteratorNormalCompletion21=!0){var file;_step21.value.xhr=xhr}}catch(err){_didIteratorError21=!0,_iteratorError21=err}finally{try{_iteratorNormalCompletion21||null==_iterator21.return||_iterator21.return()}finally{if(_didIteratorError21)throw _iteratorError21}}files[0].upload.chunked&&(files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr=xhr);var method=this.resolveOption(this.options.method,files),url=this.resolveOption(this.options.url,files),progressObj;xhr.open(method,url,!0),xhr.timeout=this.resolveOption(this.options.timeout,files),xhr.withCredentials=!!this.options.withCredentials,xhr.onload=function(e){_this16._finishedUploading(files,xhr,e)},xhr.ontimeout=function(){_this16._handleUploadError(files,xhr,"Request timedout after ".concat(_this16.options.timeout," seconds"))},xhr.onerror=function(){_this16._handleUploadError(files,xhr)},(null!=xhr.upload?xhr.upload:xhr).onprogress=function(e){return _this16._updateFilesUploadProgress(files,xhr,e)};var headers={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var headerName in this.options.headers&&Dropzone.extend(headers,this.options.headers),headers){var headerValue=headers[headerName];headerValue&&xhr.setRequestHeader(headerName,headerValue)}var formData=new FormData;if(this.options.params){var additionalParams=this.options.params;for(var key in"function"==typeof additionalParams&&(additionalParams=additionalParams.call(this,files,xhr,files[0].upload.chunked?this._getChunk(files[0],xhr):null)),additionalParams){var value=additionalParams[key];formData.append(key,value)}}var _iteratorNormalCompletion22=!0,_didIteratorError22=!1,_iteratorError22=void 0;try{for(var _iterator22=files[Symbol.iterator](),_step22;!(_iteratorNormalCompletion22=(_step22=_iterator22.next()).done);_iteratorNormalCompletion22=!0){var _file=_step22.value;this.emit("sending",_file,xhr,formData)}}catch(err){_didIteratorError22=!0,_iteratorError22=err}finally{try{_iteratorNormalCompletion22||null==_iterator22.return||_iterator22.return()}finally{if(_didIteratorError22)throw _iteratorError22}}this.options.uploadMultiple&&this.emit("sendingmultiple",files,xhr,formData),this._addFormElementData(formData);for(var i=0;i<dataBlocks.length;i++){var dataBlock=dataBlocks[i];formData.append(dataBlock.name,dataBlock.data,dataBlock.filename)}this.submitRequest(xhr,formData,files)}},{key:"_transformFiles",value:function _transformFiles(files,done){for(var _this17=this,transformedFiles=[],doneCounter=0,_loop=function _loop(i){_this17.options.transformFile.call(_this17,files[i],(function(transformedFile){transformedFiles[i]=transformedFile,++doneCounter===files.length&&done(transformedFiles)}))},i=0;i<files.length;i++)_loop(i)}},{key:"_addFormElementData",value:function _addFormElementData(formData){if("FORM"===this.element.tagName){var _iteratorNormalCompletion23=!0,_didIteratorError23=!1,_iteratorError23=void 0;try{for(var _iterator23=this.element.querySelectorAll("input, textarea, select, button")[Symbol.iterator](),_step23;!(_iteratorNormalCompletion23=(_step23=_iterator23.next()).done);_iteratorNormalCompletion23=!0){var input=_step23.value,inputName=input.getAttribute("name"),inputType=input.getAttribute("type");if(inputType&&(inputType=inputType.toLowerCase()),null!=inputName)if("SELECT"===input.tagName&&input.hasAttribute("multiple")){var _iteratorNormalCompletion24=!0,_didIteratorError24=!1,_iteratorError24=void 0;try{for(var _iterator24=input.options[Symbol.iterator](),_step24;!(_iteratorNormalCompletion24=(_step24=_iterator24.next()).done);_iteratorNormalCompletion24=!0){var option=_step24.value;option.selected&&formData.append(inputName,option.value)}}catch(err){_didIteratorError24=!0,_iteratorError24=err}finally{try{_iteratorNormalCompletion24||null==_iterator24.return||_iterator24.return()}finally{if(_didIteratorError24)throw _iteratorError24}}}else(!inputType||"checkbox"!==inputType&&"radio"!==inputType||input.checked)&&formData.append(inputName,input.value)}}catch(err){_didIteratorError23=!0,_iteratorError23=err}finally{try{_iteratorNormalCompletion23||null==_iterator23.return||_iterator23.return()}finally{if(_didIteratorError23)throw _iteratorError23}}}}},{key:"_updateFilesUploadProgress",value:function _updateFilesUploadProgress(files,xhr,e){var progress;if(void 0!==e){if(progress=100*e.loaded/e.total,files[0].upload.chunked){var file=files[0],chunk=this._getChunk(file,xhr);chunk.progress=progress,chunk.total=e.total,chunk.bytesSent=e.loaded;var fileProgress=0,fileTotal,fileBytesSent;file.upload.progress=0,file.upload.total=0,file.upload.bytesSent=0;for(var i=0;i<file.upload.totalChunkCount;i++)void 0!==file.upload.chunks[i]&&void 0!==file.upload.chunks[i].progress&&(file.upload.progress+=file.upload.chunks[i].progress,file.upload.total+=file.upload.chunks[i].total,file.upload.bytesSent+=file.upload.chunks[i].bytesSent);file.upload.progress=file.upload.progress/file.upload.totalChunkCount}else{var _iteratorNormalCompletion25=!0,_didIteratorError25=!1,_iteratorError25=void 0;try{for(var _iterator25=files[Symbol.iterator](),_step25;!(_iteratorNormalCompletion25=(_step25=_iterator25.next()).done);_iteratorNormalCompletion25=!0){var _file2=_step25.value;_file2.upload.progress=progress,_file2.upload.total=e.total,_file2.upload.bytesSent=e.loaded}}catch(err){_didIteratorError25=!0,_iteratorError25=err}finally{try{_iteratorNormalCompletion25||null==_iterator25.return||_iterator25.return()}finally{if(_didIteratorError25)throw _iteratorError25}}}var _iteratorNormalCompletion26=!0,_didIteratorError26=!1,_iteratorError26=void 0;try{for(var _iterator26=files[Symbol.iterator](),_step26;!(_iteratorNormalCompletion26=(_step26=_iterator26.next()).done);_iteratorNormalCompletion26=!0){var _file3=_step26.value;this.emit("uploadprogress",_file3,_file3.upload.progress,_file3.upload.bytesSent)}}catch(err){_didIteratorError26=!0,_iteratorError26=err}finally{try{_iteratorNormalCompletion26||null==_iterator26.return||_iterator26.return()}finally{if(_didIteratorError26)throw _iteratorError26}}}else{var allFilesFinished=!0;progress=100;var _iteratorNormalCompletion27=!0,_didIteratorError27=!1,_iteratorError27=void 0;try{for(var _iterator27=files[Symbol.iterator](),_step27;!(_iteratorNormalCompletion27=(_step27=_iterator27.next()).done);_iteratorNormalCompletion27=!0){var _file4=_step27.value;100===_file4.upload.progress&&_file4.upload.bytesSent===_file4.upload.total||(allFilesFinished=!1),_file4.upload.progress=progress,_file4.upload.bytesSent=_file4.upload.total}}catch(err){_didIteratorError27=!0,_iteratorError27=err}finally{try{_iteratorNormalCompletion27||null==_iterator27.return||_iterator27.return()}finally{if(_didIteratorError27)throw _iteratorError27}}if(allFilesFinished)return;var _iteratorNormalCompletion28=!0,_didIteratorError28=!1,_iteratorError28=void 0;try{for(var _iterator28=files[Symbol.iterator](),_step28;!(_iteratorNormalCompletion28=(_step28=_iterator28.next()).done);_iteratorNormalCompletion28=!0){var _file5=_step28.value;this.emit("uploadprogress",_file5,progress,_file5.upload.bytesSent)}}catch(err){_didIteratorError28=!0,_iteratorError28=err}finally{try{_iteratorNormalCompletion28||null==_iterator28.return||_iterator28.return()}finally{if(_didIteratorError28)throw _iteratorError28}}}}},{key:"_finishedUploading",value:function _finishedUploading(files,xhr,e){var response;if(files[0].status!==Dropzone.CANCELED&&4===xhr.readyState){if("arraybuffer"!==xhr.responseType&&"blob"!==xhr.responseType&&(response=xhr.responseText,xhr.getResponseHeader("content-type")&&~xhr.getResponseHeader("content-type").indexOf("application/json")))try{response=JSON.parse(response)}catch(error){e=error,response="Invalid JSON response from server."}this._updateFilesUploadProgress(files),200<=xhr.status&&xhr.status<300?files[0].upload.chunked?files[0].upload.finishedChunkUpload(this._getChunk(files[0],xhr)):this._finished(files,response,e):this._handleUploadError(files,xhr,response)}}},{key:"_handleUploadError",value:function _handleUploadError(files,xhr,response){if(files[0].status!==Dropzone.CANCELED){if(files[0].upload.chunked&&this.options.retryChunks){var chunk=this._getChunk(files[0],xhr);if(chunk.retries++<this.options.retryChunksLimit)return void this._uploadData(files,[chunk.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(files,response||this.options.dictResponseError.replace("{{statusCode}}",xhr.status),xhr)}}},{key:"submitRequest",value:function submitRequest(xhr,formData,files){xhr.send(formData)}},{key:"_finished",value:function _finished(files,responseText,e){var _iteratorNormalCompletion29=!0,_didIteratorError29=!1,_iteratorError29=void 0;try{for(var _iterator29=files[Symbol.iterator](),_step29;!(_iteratorNormalCompletion29=(_step29=_iterator29.next()).done);_iteratorNormalCompletion29=!0){var file=_step29.value;file.status=Dropzone.SUCCESS,this.emit("success",file,responseText,e),this.emit("complete",file)}}catch(err){_didIteratorError29=!0,_iteratorError29=err}finally{try{_iteratorNormalCompletion29||null==_iterator29.return||_iterator29.return()}finally{if(_didIteratorError29)throw _iteratorError29}}if(this.options.uploadMultiple&&(this.emit("successmultiple",files,responseText,e),this.emit("completemultiple",files)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function _errorProcessing(files,message,xhr){var _iteratorNormalCompletion30=!0,_didIteratorError30=!1,_iteratorError30=void 0;try{for(var _iterator30=files[Symbol.iterator](),_step30;!(_iteratorNormalCompletion30=(_step30=_iterator30.next()).done);_iteratorNormalCompletion30=!0){var file=_step30.value;file.status=Dropzone.ERROR,this.emit("error",file,message,xhr),this.emit("complete",file)}}catch(err){_didIteratorError30=!0,_iteratorError30=err}finally{try{_iteratorNormalCompletion30||null==_iterator30.return||_iterator30.return()}finally{if(_didIteratorError30)throw _iteratorError30}}if(this.options.uploadMultiple&&(this.emit("errormultiple",files,message,xhr),this.emit("completemultiple",files)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=16*Math.random()|0,v;return("x"===c?r:3&r|8).toString(16)}))}}]),Dropzone}(Emitter);Dropzone.initClass(),Dropzone.version="5.7.0",Dropzone.options={},Dropzone.optionsForElement=function(element){return element.getAttribute("id")?Dropzone.options[camelize(element.getAttribute("id"))]:void 0},Dropzone.instances=[],Dropzone.forElement=function(element){if("string"==typeof element&&(element=document.querySelector(element)),null==(null!=element?element.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return element.dropzone},Dropzone.autoDiscover=!0,Dropzone.discover=function(){var dropzones;if(document.querySelectorAll)dropzones=document.querySelectorAll(".dropzone");else{dropzones=[];var checkElements=function checkElements(elements){return function(){var result=[],_iteratorNormalCompletion31=!0,_didIteratorError31=!1,_iteratorError31=void 0;try{for(var _iterator31=elements[Symbol.iterator](),_step31;!(_iteratorNormalCompletion31=(_step31=_iterator31.next()).done);_iteratorNormalCompletion31=!0){var el=_step31.value;/(^| )dropzone($| )/.test(el.className)?result.push(dropzones.push(el)):result.push(void 0)}}catch(err){_didIteratorError31=!0,_iteratorError31=err}finally{try{_iteratorNormalCompletion31||null==_iterator31.return||_iterator31.return()}finally{if(_didIteratorError31)throw _iteratorError31}}return result}()};checkElements(document.getElementsByTagName("div")),checkElements(document.getElementsByTagName("form"))}return function(){var result=[],_iteratorNormalCompletion32=!0,_didIteratorError32=!1,_iteratorError32=void 0;try{for(var _iterator32=dropzones[Symbol.iterator](),_step32;!(_iteratorNormalCompletion32=(_step32=_iterator32.next()).done);_iteratorNormalCompletion32=!0){var dropzone=_step32.value;!1!==Dropzone.optionsForElement(dropzone)?result.push(new Dropzone(dropzone)):result.push(void 0)}}catch(err){_didIteratorError32=!0,_iteratorError32=err}finally{try{_iteratorNormalCompletion32||null==_iterator32.return||_iterator32.return()}finally{if(_didIteratorError32)throw _iteratorError32}}return result}()},Dropzone.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],Dropzone.isBrowserSupported=function(){var capableBrowser=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){var _iteratorNormalCompletion33=!0,_didIteratorError33=!1,_iteratorError33=void 0;try{for(var _iterator33=Dropzone.blacklistedBrowsers[Symbol.iterator](),_step33;!(_iteratorNormalCompletion33=(_step33=_iterator33.next()).done);_iteratorNormalCompletion33=!0){var regex;_step33.value.test(navigator.userAgent)&&(capableBrowser=!1)}}catch(err){_didIteratorError33=!0,_iteratorError33=err}finally{try{_iteratorNormalCompletion33||null==_iterator33.return||_iterator33.return()}finally{if(_didIteratorError33)throw _iteratorError33}}}else capableBrowser=!1;else capableBrowser=!1;return capableBrowser},Dropzone.dataURItoBlob=function(dataURI){for(var byteString=atob(dataURI.split(",")[1]),mimeString=dataURI.split(",")[0].split(":")[1].split(";")[0],ab=new ArrayBuffer(byteString.length),ia=new Uint8Array(ab),i=0,end=byteString.length,asc=0<=end;asc?i<=end:i>=end;asc?i++:i--)ia[i]=byteString.charCodeAt(i);return new Blob([ab],{type:mimeString})};var without=function without(list,rejectedItem){return list.filter((function(item){return item!==rejectedItem})).map((function(item){return item}))},camelize=function camelize(str){return str.replace(/[\-_](\w)/g,(function(match){return match.charAt(1).toUpperCase()}))};Dropzone.createElement=function(string){var div=document.createElement("div");return div.innerHTML=string,div.childNodes[0]},Dropzone.elementInside=function(element,container){if(element===container)return!0;for(;element=element.parentNode;)if(element===container)return!0;return!1},Dropzone.getElement=function(el,name){var element;if("string"==typeof el?element=document.querySelector(el):null!=el.nodeType&&(element=el),null==element)throw new Error("Invalid `".concat(name,"` option provided. Please provide a CSS selector or a plain HTML element."));return element},Dropzone.getElements=function(els,name){var el,elements;if(els instanceof Array){elements=[];try{var _iteratorNormalCompletion34=!0,_didIteratorError34=!1,_iteratorError34=void 0;try{for(var _iterator34=els[Symbol.iterator](),_step34;!(_iteratorNormalCompletion34=(_step34=_iterator34.next()).done);_iteratorNormalCompletion34=!0)el=_step34.value,elements.push(this.getElement(el,name))}catch(err){_didIteratorError34=!0,_iteratorError34=err}finally{try{_iteratorNormalCompletion34||null==_iterator34.return||_iterator34.return()}finally{if(_didIteratorError34)throw _iteratorError34}}}catch(e){elements=null}}else if("string"==typeof els){elements=[];var _iteratorNormalCompletion35=!0,_didIteratorError35=!1,_iteratorError35=void 0;try{for(var _iterator35=document.querySelectorAll(els)[Symbol.iterator](),_step35;!(_iteratorNormalCompletion35=(_step35=_iterator35.next()).done);_iteratorNormalCompletion35=!0)el=_step35.value,elements.push(el)}catch(err){_didIteratorError35=!0,_iteratorError35=err}finally{try{_iteratorNormalCompletion35||null==_iterator35.return||_iterator35.return()}finally{if(_didIteratorError35)throw _iteratorError35}}}else null!=els.nodeType&&(elements=[els]);if(null==elements||!elements.length)throw new Error("Invalid `".concat(name,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return elements},Dropzone.confirm=function(question,accepted,rejected){return window.confirm(question)?accepted():null!=rejected?rejected():void 0},Dropzone.isValidFile=function(file,acceptedFiles){if(!acceptedFiles)return!0;acceptedFiles=acceptedFiles.split(",");var mimeType=file.type,baseMimeType=mimeType.replace(/\/.*$/,""),_iteratorNormalCompletion36=!0,_didIteratorError36=!1,_iteratorError36=void 0;try{for(var _iterator36=acceptedFiles[Symbol.iterator](),_step36;!(_iteratorNormalCompletion36=(_step36=_iterator36.next()).done);_iteratorNormalCompletion36=!0){var validType=_step36.value;if("."===(validType=validType.trim()).charAt(0)){if(-1!==file.name.toLowerCase().indexOf(validType.toLowerCase(),file.name.length-validType.length))return!0}else if(/\/\*$/.test(validType)){if(baseMimeType===validType.replace(/\/.*$/,""))return!0}else if(mimeType===validType)return!0}}catch(err){_didIteratorError36=!0,_iteratorError36=err}finally{try{_iteratorNormalCompletion36||null==_iterator36.return||_iterator36.return()}finally{if(_didIteratorError36)throw _iteratorError36}}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(options){return this.each((function(){return new Dropzone(this,options)}))}),"undefined"!=typeof module&&null!==module?module.exports=Dropzone:window.Dropzone=Dropzone,Dropzone.ADDED="added",Dropzone.QUEUED="queued",Dropzone.ACCEPTED=Dropzone.QUEUED,Dropzone.UPLOADING="uploading",Dropzone.PROCESSING=Dropzone.UPLOADING,Dropzone.CANCELED="canceled",Dropzone.ERROR="error",Dropzone.SUCCESS="success";var detectVerticalSquash=function detectVerticalSquash(img){var iw=img.naturalWidth,ih=img.naturalHeight,canvas=document.createElement("canvas");canvas.width=1,canvas.height=ih;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);for(var _ctx$getImageData,data=ctx.getImageData(1,0,1,ih).data,sy=0,ey=ih,py=ih;py>sy;){var alpha;0===data[4*(py-1)+3]?ey=py:sy=py,py=ey+sy>>1}var ratio=py/ih;return 0===ratio?1:ratio},drawImageIOSFix=function drawImageIOSFix(ctx,img,sx,sy,sw,sh,dx,dy,dw,dh){var vertSquashRatio=detectVerticalSquash(img);return ctx.drawImage(img,sx,sy,sw,sh,dx,dy,dw,dh/vertSquashRatio)},ExifRestore=function(){function ExifRestore(){_classCallCheck(this,ExifRestore)}return _createClass(ExifRestore,null,[{key:"initClass",value:function initClass(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function encode64(input){for(var output="",chr1=void 0,chr2=void 0,chr3="",enc1=void 0,enc2=void 0,enc3=void 0,enc4="",i=0;enc1=(chr1=input[i++])>>2,enc2=(3&chr1)<<4|(chr2=input[i++])>>4,enc3=(15&chr2)<<2|(chr3=input[i++])>>6,enc4=63&chr3,isNaN(chr2)?enc3=enc4=64:isNaN(chr3)&&(enc4=64),output=output+this.KEY_STR.charAt(enc1)+this.KEY_STR.charAt(enc2)+this.KEY_STR.charAt(enc3)+this.KEY_STR.charAt(enc4),chr1=chr2=chr3="",enc1=enc2=enc3=enc4="",i<input.length;);return output}},{key:"restore",value:function restore(origFileBase64,resizedFileBase64){if(!origFileBase64.match("data:image/jpeg;base64,"))return resizedFileBase64;var rawImage=this.decode64(origFileBase64.replace("data:image/jpeg;base64,","")),segments=this.slice2Segments(rawImage),image=this.exifManipulation(resizedFileBase64,segments);return"data:image/jpeg;base64,".concat(this.encode64(image))}},{key:"exifManipulation",value:function exifManipulation(resizedFileBase64,segments){var exifArray=this.getExifArray(segments),newImageArray=this.insertExif(resizedFileBase64,exifArray),aBuffer;return new Uint8Array(newImageArray)}},{key:"getExifArray",value:function getExifArray(segments){for(var seg=void 0,x=0;x<segments.length;){if(255===(seg=segments[x])[0]&225===seg[1])return seg;x++}return[]}},{key:"insertExif",value:function insertExif(resizedFileBase64,exifArray){var imageData=resizedFileBase64.replace("data:image/jpeg;base64,",""),buf=this.decode64(imageData),separatePoint=buf.indexOf(255,3),mae=buf.slice(0,separatePoint),ato=buf.slice(separatePoint),array=mae;return array=(array=array.concat(exifArray)).concat(ato)}},{key:"slice2Segments",value:function slice2Segments(rawImageArray){for(var head=0,segments=[];;){var length;if(255===rawImageArray[head]&218===rawImageArray[head+1])break;if(255===rawImageArray[head]&216===rawImageArray[head+1])head+=2;else{var endPoint=head+(length=256*rawImageArray[head+2]+rawImageArray[head+3])+2,seg=rawImageArray.slice(head,endPoint);segments.push(seg),head=endPoint}if(head>rawImageArray.length)break}return segments}},{key:"decode64",value:function decode64(input){var output="",chr1=void 0,chr2=void 0,chr3="",enc1=void 0,enc2=void 0,enc3=void 0,enc4="",i=0,buf=[],base64test;for(/[^A-Za-z0-9\+\/\=]/g.exec(input)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");chr1=(enc1=this.KEY_STR.indexOf(input.charAt(i++)))<<2|(enc2=this.KEY_STR.indexOf(input.charAt(i++)))>>4,chr2=(15&enc2)<<4|(enc3=this.KEY_STR.indexOf(input.charAt(i++)))>>2,chr3=(3&enc3)<<6|(enc4=this.KEY_STR.indexOf(input.charAt(i++))),buf.push(chr1),64!==enc3&&buf.push(chr2),64!==enc4&&buf.push(chr3),chr1=chr2=chr3="",enc1=enc2=enc3=enc4="",i<input.length;);return buf}}]),ExifRestore}();ExifRestore.initClass();var contentLoaded=function contentLoaded(win,fn){var done=!1,top=!0,doc=win.document,root=doc.documentElement,add=doc.addEventListener?"addEventListener":"attachEvent",rem=doc.addEventListener?"removeEventListener":"detachEvent",pre=doc.addEventListener?"":"on",init=function init(e){if("readystatechange"!==e.type||"complete"===doc.readyState)return("load"===e.type?win:doc)[rem](pre+e.type,init,!1),!done&&(done=!0)?fn.call(win,e.type||e):void 0},poll=function poll(){try{root.doScroll("left")}catch(e){return void setTimeout(poll,50)}return init("poll")};if("complete"!==doc.readyState){if(doc.createEventObject&&root.doScroll){try{top=!win.frameElement}catch(error){}top&&poll()}return doc[add](pre+"DOMContentLoaded",init,!1),doc[add](pre+"readystatechange",init,!1),win[add](pre+"load",init,!1)}};function __guard__(value,transform){return null!=value?transform(value):void 0}function __guardMethod__(obj,methodName,transform){return null!=obj&&"function"==typeof obj[methodName]?transform(obj,methodName):void 0}function _classCallCheck(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,i){for(var e=0;e<i.length;e++){var s=i[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function _createClass(t,i,e){return i&&_defineProperties(t.prototype,i),e&&_defineProperties(t,e),t}Dropzone._autoDiscoverFunction=function(){if(Dropzone.autoDiscover)return Dropzone.discover()},contentLoaded(window,Dropzone._autoDiscoverFunction),Dropzone.autoDiscover=!1,
|
||
/*!
|
||
* Quill Editor v1.3.7
|
||
* https://quilljs.com/
|
||
* Copyright (c) 2014, Jason Chen
|
||
* Copyright (c) 2013, salesforce.com
|
||
*/
|
||
function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.Quill=factory():root.Quill=factory()}("undefined"!=typeof self?self:this,(function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=109)}([function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var container_1=__webpack_require__(17),format_1=__webpack_require__(18),leaf_1=__webpack_require__(19),scroll_1=__webpack_require__(45),inline_1=__webpack_require__(46),block_1=__webpack_require__(47),embed_1=__webpack_require__(48),text_1=__webpack_require__(49),attributor_1=__webpack_require__(12),class_1=__webpack_require__(32),style_1=__webpack_require__(33),store_1=__webpack_require__(31),Registry=__webpack_require__(1),Parchment={Scope:Registry.Scope,create:Registry.create,find:Registry.find,query:Registry.query,register:Registry.register,Container:container_1.default,Format:format_1.default,Leaf:leaf_1.default,Embed:embed_1.default,Scroll:scroll_1.default,Block:block_1.default,Inline:inline_1.default,Text:text_1.default,Attributor:{Attribute:attributor_1.default,Class:class_1.default,Style:style_1.default,Store:store_1.default}};exports.default=Parchment},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var ParchmentError=function(_super){function ParchmentError(message){var _this=this;return message="[Parchment] "+message,(_this=_super.call(this,message)||this).message=message,_this.name=_this.constructor.name,_this}return __extends(ParchmentError,_super),ParchmentError}(Error);exports.ParchmentError=ParchmentError;var attributes={},classes={},tags={},types={},Scope;function create(input,value){var match=query(input);if(null==match)throw new ParchmentError("Unable to create "+input+" blot");var BlotClass=match,node=input instanceof Node||input.nodeType===Node.TEXT_NODE?input:BlotClass.create(value);return new BlotClass(node,value)}function find(node,bubble){return void 0===bubble&&(bubble=!1),null==node?null:null!=node[exports.DATA_KEY]?node[exports.DATA_KEY].blot:bubble?find(node.parentNode,bubble):null}function query(query,scope){var match;if(void 0===scope&&(scope=Scope.ANY),"string"==typeof query)match=types[query]||attributes[query];else if(query instanceof Text||query.nodeType===Node.TEXT_NODE)match=types.text;else if("number"==typeof query)query&Scope.LEVEL&Scope.BLOCK?match=types.block:query&Scope.LEVEL&Scope.INLINE&&(match=types.inline);else if(query instanceof HTMLElement){var names=(query.getAttribute("class")||"").split(/\s+/);for(var i in names)if(match=classes[names[i]])break;match=match||tags[query.tagName]}return null==match?null:scope&Scope.LEVEL&match.scope&&scope&Scope.TYPE&match.scope?match:null}function register(){for(var Definitions=[],_i=0;_i<arguments.length;_i++)Definitions[_i]=arguments[_i];if(Definitions.length>1)return Definitions.map((function(d){return register(d)}));var Definition=Definitions[0];if("string"!=typeof Definition.blotName&&"string"!=typeof Definition.attrName)throw new ParchmentError("Invalid definition");if("abstract"===Definition.blotName)throw new ParchmentError("Cannot register abstract class");if(types[Definition.blotName||Definition.attrName]=Definition,"string"==typeof Definition.keyName)attributes[Definition.keyName]=Definition;else if(null!=Definition.className&&(classes[Definition.className]=Definition),null!=Definition.tagName){Array.isArray(Definition.tagName)?Definition.tagName=Definition.tagName.map((function(tagName){return tagName.toUpperCase()})):Definition.tagName=Definition.tagName.toUpperCase();var tagNames=Array.isArray(Definition.tagName)?Definition.tagName:[Definition.tagName];tagNames.forEach((function(tag){null!=tags[tag]&&null!=Definition.className||(tags[tag]=Definition)}))}return Definition}exports.DATA_KEY="__blot",function(Scope){Scope[Scope.TYPE=3]="TYPE",Scope[Scope.LEVEL=12]="LEVEL",Scope[Scope.ATTRIBUTE=13]="ATTRIBUTE",Scope[Scope.BLOT=14]="BLOT",Scope[Scope.INLINE=7]="INLINE",Scope[Scope.BLOCK=11]="BLOCK",Scope[Scope.BLOCK_BLOT=10]="BLOCK_BLOT",Scope[Scope.INLINE_BLOT=6]="INLINE_BLOT",Scope[Scope.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",Scope[Scope.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",Scope[Scope.ANY=15]="ANY"}(Scope=exports.Scope||(exports.Scope={})),exports.create=create,exports.find=find,exports.query=query,exports.register=register},function(module,exports,__webpack_require__){var diff=__webpack_require__(51),equal=__webpack_require__(11),extend=__webpack_require__(3),op=__webpack_require__(20),NULL_CHARACTER=String.fromCharCode(0),Delta=function(ops){Array.isArray(ops)?this.ops=ops:null!=ops&&Array.isArray(ops.ops)?this.ops=ops.ops:this.ops=[]};Delta.prototype.insert=function(text,attributes){var newOp={};return 0===text.length?this:(newOp.insert=text,null!=attributes&&"object"==typeof attributes&&Object.keys(attributes).length>0&&(newOp.attributes=attributes),this.push(newOp))},Delta.prototype.delete=function(length){return length<=0?this:this.push({delete:length})},Delta.prototype.retain=function(length,attributes){if(length<=0)return this;var newOp={retain:length};return null!=attributes&&"object"==typeof attributes&&Object.keys(attributes).length>0&&(newOp.attributes=attributes),this.push(newOp)},Delta.prototype.push=function(newOp){var index=this.ops.length,lastOp=this.ops[index-1];if(newOp=extend(!0,{},newOp),"object"==typeof lastOp){if("number"==typeof newOp.delete&&"number"==typeof lastOp.delete)return this.ops[index-1]={delete:lastOp.delete+newOp.delete},this;if("number"==typeof lastOp.delete&&null!=newOp.insert&&(index-=1,"object"!=typeof(lastOp=this.ops[index-1])))return this.ops.unshift(newOp),this;if(equal(newOp.attributes,lastOp.attributes)){if("string"==typeof newOp.insert&&"string"==typeof lastOp.insert)return this.ops[index-1]={insert:lastOp.insert+newOp.insert},"object"==typeof newOp.attributes&&(this.ops[index-1].attributes=newOp.attributes),this;if("number"==typeof newOp.retain&&"number"==typeof lastOp.retain)return this.ops[index-1]={retain:lastOp.retain+newOp.retain},"object"==typeof newOp.attributes&&(this.ops[index-1].attributes=newOp.attributes),this}}return index===this.ops.length?this.ops.push(newOp):this.ops.splice(index,0,newOp),this},Delta.prototype.chop=function(){var lastOp=this.ops[this.ops.length-1];return lastOp&&lastOp.retain&&!lastOp.attributes&&this.ops.pop(),this},Delta.prototype.filter=function(predicate){return this.ops.filter(predicate)},Delta.prototype.forEach=function(predicate){this.ops.forEach(predicate)},Delta.prototype.map=function(predicate){return this.ops.map(predicate)},Delta.prototype.partition=function(predicate){var passed=[],failed=[];return this.forEach((function(op){var target;(predicate(op)?passed:failed).push(op)})),[passed,failed]},Delta.prototype.reduce=function(predicate,initial){return this.ops.reduce(predicate,initial)},Delta.prototype.changeLength=function(){return this.reduce((function(length,elem){return elem.insert?length+op.length(elem):elem.delete?length-elem.delete:length}),0)},Delta.prototype.length=function(){return this.reduce((function(length,elem){return length+op.length(elem)}),0)},Delta.prototype.slice=function(start,end){start=start||0,"number"!=typeof end&&(end=1/0);for(var ops=[],iter=op.iterator(this.ops),index=0;index<end&&iter.hasNext();){var nextOp;index<start?nextOp=iter.next(start-index):(nextOp=iter.next(end-index),ops.push(nextOp)),index+=op.length(nextOp)}return new Delta(ops)},Delta.prototype.compose=function(other){var thisIter=op.iterator(this.ops),otherIter=op.iterator(other.ops),ops=[],firstOther=otherIter.peek();if(null!=firstOther&&"number"==typeof firstOther.retain&&null==firstOther.attributes){for(var firstLeft=firstOther.retain;"insert"===thisIter.peekType()&&thisIter.peekLength()<=firstLeft;)firstLeft-=thisIter.peekLength(),ops.push(thisIter.next());firstOther.retain-firstLeft>0&&otherIter.next(firstOther.retain-firstLeft)}for(var delta=new Delta(ops);thisIter.hasNext()||otherIter.hasNext();)if("insert"===otherIter.peekType())delta.push(otherIter.next());else if("delete"===thisIter.peekType())delta.push(thisIter.next());else{var length=Math.min(thisIter.peekLength(),otherIter.peekLength()),thisOp=thisIter.next(length),otherOp=otherIter.next(length);if("number"==typeof otherOp.retain){var newOp={};"number"==typeof thisOp.retain?newOp.retain=length:newOp.insert=thisOp.insert;var attributes=op.attributes.compose(thisOp.attributes,otherOp.attributes,"number"==typeof thisOp.retain);if(attributes&&(newOp.attributes=attributes),delta.push(newOp),!otherIter.hasNext()&&equal(delta.ops[delta.ops.length-1],newOp)){var rest=new Delta(thisIter.rest());return delta.concat(rest).chop()}}else"number"==typeof otherOp.delete&&"number"==typeof thisOp.retain&&delta.push(otherOp)}return delta.chop()},Delta.prototype.concat=function(other){var delta=new Delta(this.ops.slice());return other.ops.length>0&&(delta.push(other.ops[0]),delta.ops=delta.ops.concat(other.ops.slice(1))),delta},Delta.prototype.diff=function(other,index){if(this.ops===other.ops)return new Delta;var strings=[this,other].map((function(delta){return delta.map((function(op){if(null!=op.insert)return"string"==typeof op.insert?op.insert:NULL_CHARACTER;var prep;throw new Error("diff() called "+(delta===other?"on":"with")+" non-document")})).join("")})),delta=new Delta,diffResult=diff(strings[0],strings[1],index),thisIter=op.iterator(this.ops),otherIter=op.iterator(other.ops);return diffResult.forEach((function(component){for(var length=component[1].length;length>0;){var opLength=0;switch(component[0]){case diff.INSERT:opLength=Math.min(otherIter.peekLength(),length),delta.push(otherIter.next(opLength));break;case diff.DELETE:opLength=Math.min(length,thisIter.peekLength()),thisIter.next(opLength),delta.delete(opLength);break;case diff.EQUAL:opLength=Math.min(thisIter.peekLength(),otherIter.peekLength(),length);var thisOp=thisIter.next(opLength),otherOp=otherIter.next(opLength);equal(thisOp.insert,otherOp.insert)?delta.retain(opLength,op.attributes.diff(thisOp.attributes,otherOp.attributes)):delta.push(otherOp).delete(opLength)}length-=opLength}})),delta.chop()},Delta.prototype.eachLine=function(predicate,newline){newline=newline||"\n";for(var iter=op.iterator(this.ops),line=new Delta,i=0;iter.hasNext();){if("insert"!==iter.peekType())return;var thisOp=iter.peek(),start=op.length(thisOp)-iter.peekLength(),index="string"==typeof thisOp.insert?thisOp.insert.indexOf(newline,start)-start:-1;if(index<0)line.push(iter.next());else if(index>0)line.push(iter.next(index));else{if(!1===predicate(line,iter.next(1).attributes||{},i))return;i+=1,line=new Delta}}line.length()>0&&predicate(line,{},i)},Delta.prototype.transform=function(other,priority){if(priority=!!priority,"number"==typeof other)return this.transformPosition(other,priority);for(var thisIter=op.iterator(this.ops),otherIter=op.iterator(other.ops),delta=new Delta;thisIter.hasNext()||otherIter.hasNext();)if("insert"!==thisIter.peekType()||!priority&&"insert"===otherIter.peekType())if("insert"===otherIter.peekType())delta.push(otherIter.next());else{var length=Math.min(thisIter.peekLength(),otherIter.peekLength()),thisOp=thisIter.next(length),otherOp=otherIter.next(length);if(thisOp.delete)continue;otherOp.delete?delta.push(otherOp):delta.retain(length,op.attributes.transform(thisOp.attributes,otherOp.attributes,priority))}else delta.retain(op.length(thisIter.next()));return delta.chop()},Delta.prototype.transformPosition=function(index,priority){priority=!!priority;for(var thisIter=op.iterator(this.ops),offset=0;thisIter.hasNext()&&offset<=index;){var length=thisIter.peekLength(),nextType=thisIter.peekType();thisIter.next(),"delete"!==nextType?("insert"===nextType&&(offset<index||!priority)&&(index+=length),offset+=length):index-=Math.min(length,index-offset)}return index},module.exports=Delta},function(module,exports){"use strict";var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function isArray(arr){return"function"==typeof Array.isArray?Array.isArray(arr):"[object Array]"===toStr.call(arr)},isPlainObject=function isPlainObject(obj){if(!obj||"[object Object]"!==toStr.call(obj))return!1;var hasOwnConstructor=hasOwn.call(obj,"constructor"),hasIsPrototypeOf=obj.constructor&&obj.constructor.prototype&&hasOwn.call(obj.constructor.prototype,"isPrototypeOf"),key;if(obj.constructor&&!hasOwnConstructor&&!hasIsPrototypeOf)return!1;for(key in obj);return void 0===key||hasOwn.call(obj,key)},setProperty=function setProperty(target,options){defineProperty&&"__proto__"===options.name?defineProperty(target,options.name,{enumerable:!0,configurable:!0,value:options.newValue,writable:!0}):target[options.name]=options.newValue},getProperty=function getProperty(obj,name){if("__proto__"===name){if(!hasOwn.call(obj,name))return;if(gOPD)return gOPD(obj,name).value}return obj[name]};module.exports=function extend(){var options,name,src,copy,copyIsArray,clone,target=arguments[0],i=1,length=arguments.length,deep=!1;for("boolean"==typeof target&&(deep=target,target=arguments[1]||{},i=2),(null==target||"object"!=typeof target&&"function"!=typeof target)&&(target={});i<length;++i)if(null!=(options=arguments[i]))for(name in options)src=getProperty(target,name),target!==(copy=getProperty(options,name))&&(deep&©&&(isPlainObject(copy)||(copyIsArray=isArray(copy)))?(copyIsArray?(copyIsArray=!1,clone=src&&isArray(src)?src:[]):clone=src&&isPlainObject(src)?src:{},setProperty(target,{name:name,newValue:extend(deep,clone,copy)})):void 0!==copy&&setProperty(target,{name:name,newValue:copy}));return target}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.BlockEmbed=exports.bubbleFormats=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_extend,_extend2=_interopRequireDefault(__webpack_require__(3)),_quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_break,_break2=_interopRequireDefault(__webpack_require__(16)),_inline,_inline2=_interopRequireDefault(__webpack_require__(6)),_text,_text2=_interopRequireDefault(__webpack_require__(7));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var NEWLINE_LENGTH=1,BlockEmbed=function(_Parchment$Embed){function BlockEmbed(){return _classCallCheck(this,BlockEmbed),_possibleConstructorReturn(this,(BlockEmbed.__proto__||Object.getPrototypeOf(BlockEmbed)).apply(this,arguments))}return _inherits(BlockEmbed,_Parchment$Embed),_createClass(BlockEmbed,[{key:"attach",value:function attach(){_get(BlockEmbed.prototype.__proto__||Object.getPrototypeOf(BlockEmbed.prototype),"attach",this).call(this),this.attributes=new _parchment2.default.Attributor.Store(this.domNode)}},{key:"delta",value:function delta(){return(new _quillDelta2.default).insert(this.value(),(0,_extend2.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function format(name,value){var attribute=_parchment2.default.query(name,_parchment2.default.Scope.BLOCK_ATTRIBUTE);null!=attribute&&this.attributes.attribute(attribute,value)}},{key:"formatAt",value:function formatAt(index,length,name,value){this.format(name,value)}},{key:"insertAt",value:function insertAt(index,value,def){if("string"==typeof value&&value.endsWith("\n")){var block=_parchment2.default.create(Block.blotName);this.parent.insertBefore(block,0===index?this:this.next),block.insertAt(0,value.slice(0,-1))}else _get(BlockEmbed.prototype.__proto__||Object.getPrototypeOf(BlockEmbed.prototype),"insertAt",this).call(this,index,value,def)}}]),BlockEmbed}(_parchment2.default.Embed);BlockEmbed.scope=_parchment2.default.Scope.BLOCK_BLOT;var Block=function(_Parchment$Block){function Block(domNode){_classCallCheck(this,Block);var _this2=_possibleConstructorReturn(this,(Block.__proto__||Object.getPrototypeOf(Block)).call(this,domNode));return _this2.cache={},_this2}return _inherits(Block,_Parchment$Block),_createClass(Block,[{key:"delta",value:function delta(){return null==this.cache.delta&&(this.cache.delta=this.descendants(_parchment2.default.Leaf).reduce((function(delta,leaf){return 0===leaf.length()?delta:delta.insert(leaf.value(),bubbleFormats(leaf))}),new _quillDelta2.default).insert("\n",bubbleFormats(this))),this.cache.delta}},{key:"deleteAt",value:function deleteAt(index,length){_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"deleteAt",this).call(this,index,length),this.cache={}}},{key:"formatAt",value:function formatAt(index,length,name,value){length<=0||(_parchment2.default.query(name,_parchment2.default.Scope.BLOCK)?index+length===this.length()&&this.format(name,value):_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"formatAt",this).call(this,index,Math.min(length,this.length()-index-1),name,value),this.cache={})}},{key:"insertAt",value:function insertAt(index,value,def){if(null!=def)return _get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"insertAt",this).call(this,index,value,def);if(0!==value.length){var lines=value.split("\n"),text=lines.shift();text.length>0&&(index<this.length()-1||null==this.children.tail?_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"insertAt",this).call(this,Math.min(index,this.length()-1),text):this.children.tail.insertAt(this.children.tail.length(),text),this.cache={});var block=this;lines.reduce((function(index,line){return(block=block.split(index,!0)).insertAt(0,line),line.length}),index+text.length)}}},{key:"insertBefore",value:function insertBefore(blot,ref){var head=this.children.head;_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"insertBefore",this).call(this,blot,ref),head instanceof _break2.default&&head.remove(),this.cache={}}},{key:"length",value:function length(){return null==this.cache.length&&(this.cache.length=_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function moveChildren(target,ref){_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"moveChildren",this).call(this,target,ref),this.cache={}}},{key:"optimize",value:function optimize(context){_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"optimize",this).call(this,context),this.cache={}}},{key:"path",value:function path(index){return _get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"path",this).call(this,index,!0)}},{key:"removeChild",value:function removeChild(child){_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"removeChild",this).call(this,child),this.cache={}}},{key:"split",value:function split(index){var force=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(force&&(0===index||index>=this.length()-1)){var clone=this.clone();return 0===index?(this.parent.insertBefore(clone,this),this):(this.parent.insertBefore(clone,this.next),clone)}var next=_get(Block.prototype.__proto__||Object.getPrototypeOf(Block.prototype),"split",this).call(this,index,force);return this.cache={},next}}]),Block}(_parchment2.default.Block);function bubbleFormats(blot){var formats=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==blot?formats:("function"==typeof blot.formats&&(formats=(0,_extend2.default)(formats,blot.formats())),null==blot.parent||"scroll"==blot.parent.blotName||blot.parent.statics.scope!==blot.statics.scope?formats:bubbleFormats(blot.parent,formats))}Block.blotName="block",Block.tagName="P",Block.defaultChild="break",Block.allowedChildren=[_inline2.default,_parchment2.default.Embed,_text2.default],exports.bubbleFormats=bubbleFormats,exports.BlockEmbed=BlockEmbed,exports.default=Block},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.overload=exports.expandConfig=void 0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();__webpack_require__(50);var _quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_editor,_editor2=_interopRequireDefault(__webpack_require__(14)),_emitter3,_emitter4=_interopRequireDefault(__webpack_require__(8)),_module,_module2=_interopRequireDefault(__webpack_require__(9)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_selection=__webpack_require__(15),_selection2=_interopRequireDefault(_selection),_extend,_extend2=_interopRequireDefault(__webpack_require__(3)),_logger,_logger2=_interopRequireDefault(__webpack_require__(10)),_theme,_theme2=_interopRequireDefault(__webpack_require__(34));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var debug=(0,_logger2.default)("quill"),Quill=function(){function Quill(container){var _this2=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(_classCallCheck(this,Quill),this.options=expandConfig(container,options),this.container=this.options.container,null==this.container)return debug.error("Invalid Quill container",container);this.options.debug&&Quill.debug(this.options.debug);var html=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new _emitter4.default,this.scroll=_parchment2.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new _editor2.default(this.scroll),this.selection=new _selection2.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(_emitter4.default.events.EDITOR_CHANGE,(function(type){type===_emitter4.default.events.TEXT_CHANGE&&_this2.root.classList.toggle("ql-blank",_this2.editor.isBlank())})),this.emitter.on(_emitter4.default.events.SCROLL_UPDATE,(function(source,mutations){var range=_this2.selection.lastRange,index=range&&0===range.length?range.index:void 0;modify.call(_this2,(function(){return _this2.editor.update(null,mutations,index)}),source)}));var contents=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+html+"<p><br></p></div>");this.setContents(contents),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return _createClass(Quill,null,[{key:"debug",value:function debug(limit){!0===limit&&(limit="log"),_logger2.default.level(limit)}},{key:"find",value:function find(node){return node.__quill||_parchment2.default.find(node)}},{key:"import",value:function _import(name){return null==this.imports[name]&&debug.error("Cannot import "+name+". Are you sure it was registered?"),this.imports[name]}},{key:"register",value:function register(path,target){var _this=this,overwrite=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof path){var name=path.attrName||path.blotName;"string"==typeof name?this.register("formats/"+name,path,target):Object.keys(path).forEach((function(key){_this.register(key,path[key],target)}))}else null==this.imports[path]||overwrite||debug.warn("Overwriting "+path+" with",target),this.imports[path]=target,(path.startsWith("blots/")||path.startsWith("formats/"))&&"abstract"!==target.blotName?_parchment2.default.register(target):path.startsWith("modules")&&"function"==typeof target.register&&target.register()}}]),_createClass(Quill,[{key:"addContainer",value:function addContainer(container){var refNode=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof container){var className=container;(container=document.createElement("div")).classList.add(className)}return this.container.insertBefore(container,refNode),container}},{key:"blur",value:function blur(){this.selection.setRange(null)}},{key:"deleteText",value:function deleteText(index,length,source){var _this3=this,_overload=overload(index,length,source),_overload2=_slicedToArray(_overload,4);return index=_overload2[0],length=_overload2[1],source=_overload2[3],modify.call(this,(function(){return _this3.editor.deleteText(index,length)}),source,index,-1*length)}},{key:"disable",value:function disable(){this.enable(!1)}},{key:"enable",value:function enable(){var enabled=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(enabled),this.container.classList.toggle("ql-disabled",!enabled)}},{key:"focus",value:function focus(){var scrollTop=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=scrollTop,this.scrollIntoView()}},{key:"format",value:function format(name,value){var _this4=this,source=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_emitter4.default.sources.API;return modify.call(this,(function(){var range=_this4.getSelection(!0),change=new _quillDelta2.default;if(null==range)return change;if(_parchment2.default.query(name,_parchment2.default.Scope.BLOCK))change=_this4.editor.formatLine(range.index,range.length,_defineProperty({},name,value));else{if(0===range.length)return _this4.selection.format(name,value),change;change=_this4.editor.formatText(range.index,range.length,_defineProperty({},name,value))}return _this4.setSelection(range,_emitter4.default.sources.SILENT),change}),source)}},{key:"formatLine",value:function formatLine(index,length,name,value,source){var _this5=this,formats=void 0,_overload3=overload(index,length,name,value,source),_overload4=_slicedToArray(_overload3,4);return index=_overload4[0],length=_overload4[1],formats=_overload4[2],source=_overload4[3],modify.call(this,(function(){return _this5.editor.formatLine(index,length,formats)}),source,index,0)}},{key:"formatText",value:function formatText(index,length,name,value,source){var _this6=this,formats=void 0,_overload5=overload(index,length,name,value,source),_overload6=_slicedToArray(_overload5,4);return index=_overload6[0],length=_overload6[1],formats=_overload6[2],source=_overload6[3],modify.call(this,(function(){return _this6.editor.formatText(index,length,formats)}),source,index,0)}},{key:"getBounds",value:function getBounds(index){var length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,bounds=void 0;bounds="number"==typeof index?this.selection.getBounds(index,length):this.selection.getBounds(index.index,index.length);var containerBounds=this.container.getBoundingClientRect();return{bottom:bounds.bottom-containerBounds.top,height:bounds.height,left:bounds.left-containerBounds.left,right:bounds.right-containerBounds.left,top:bounds.top-containerBounds.top,width:bounds.width}}},{key:"getContents",value:function getContents(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-index,_overload7=overload(index,length),_overload8=_slicedToArray(_overload7,2);return index=_overload8[0],length=_overload8[1],this.editor.getContents(index,length)}},{key:"getFormat",value:function getFormat(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof index?this.editor.getFormat(index,length):this.editor.getFormat(index.index,index.length)}},{key:"getIndex",value:function getIndex(blot){return blot.offset(this.scroll)}},{key:"getLength",value:function getLength(){return this.scroll.length()}},{key:"getLeaf",value:function getLeaf(index){return this.scroll.leaf(index)}},{key:"getLine",value:function getLine(index){return this.scroll.line(index)}},{key:"getLines",value:function getLines(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof index?this.scroll.lines(index.index,index.length):this.scroll.lines(index,length)}},{key:"getModule",value:function getModule(name){return this.theme.modules[name]}},{key:"getSelection",value:function getSelection(){var focus=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return focus&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function getText(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-index,_overload9=overload(index,length),_overload10=_slicedToArray(_overload9,2);return index=_overload10[0],length=_overload10[1],this.editor.getText(index,length)}},{key:"hasFocus",value:function hasFocus(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function insertEmbed(index,embed,value){var _this7=this,source=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Quill.sources.API;return modify.call(this,(function(){return _this7.editor.insertEmbed(index,embed,value)}),source,index)}},{key:"insertText",value:function insertText(index,text,name,value,source){var _this8=this,formats=void 0,_overload11=overload(index,0,name,value,source),_overload12=_slicedToArray(_overload11,4);return index=_overload12[0],formats=_overload12[2],source=_overload12[3],modify.call(this,(function(){return _this8.editor.insertText(index,text,formats)}),source,index,text.length)}},{key:"isEnabled",value:function isEnabled(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function off(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function on(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function once(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function pasteHTML(index,html,source){this.clipboard.dangerouslyPasteHTML(index,html,source)}},{key:"removeFormat",value:function removeFormat(index,length,source){var _this9=this,_overload13=overload(index,length,source),_overload14=_slicedToArray(_overload13,4);return index=_overload14[0],length=_overload14[1],source=_overload14[3],modify.call(this,(function(){return _this9.editor.removeFormat(index,length)}),source,index)}},{key:"scrollIntoView",value:function scrollIntoView(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function setContents(delta){var _this10=this,source=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_emitter4.default.sources.API;return modify.call(this,(function(){delta=new _quillDelta2.default(delta);var length=_this10.getLength(),deleted=_this10.editor.deleteText(0,length),applied=_this10.editor.applyDelta(delta),lastOp=applied.ops[applied.ops.length-1],ret;return null!=lastOp&&"string"==typeof lastOp.insert&&"\n"===lastOp.insert[lastOp.insert.length-1]&&(_this10.editor.deleteText(_this10.getLength()-1,1),applied.delete(1)),deleted.compose(applied)}),source)}},{key:"setSelection",value:function setSelection(index,length,source){if(null==index)this.selection.setRange(null,length||Quill.sources.API);else{var _overload15=overload(index,length,source),_overload16=_slicedToArray(_overload15,4);index=_overload16[0],length=_overload16[1],source=_overload16[3],this.selection.setRange(new _selection.Range(index,length),source),source!==_emitter4.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function setText(text){var source=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_emitter4.default.sources.API,delta=(new _quillDelta2.default).insert(text);return this.setContents(delta,source)}},{key:"update",value:function update(){var source=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_emitter4.default.sources.USER,change=this.scroll.update(source);return this.selection.update(source),change}},{key:"updateContents",value:function updateContents(delta){var _this11=this,source=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_emitter4.default.sources.API;return modify.call(this,(function(){return delta=new _quillDelta2.default(delta),_this11.editor.applyDelta(delta,source)}),source,!0)}}]),Quill}();function expandConfig(container,userConfig){if((userConfig=(0,_extend2.default)(!0,{container:container,modules:{clipboard:!0,keyboard:!0,history:!0}},userConfig)).theme&&userConfig.theme!==Quill.DEFAULTS.theme){if(userConfig.theme=Quill.import("themes/"+userConfig.theme),null==userConfig.theme)throw new Error("Invalid theme "+userConfig.theme+". Did you register it?")}else userConfig.theme=_theme2.default;var themeConfig=(0,_extend2.default)(!0,{},userConfig.theme.DEFAULTS);[themeConfig,userConfig].forEach((function(config){config.modules=config.modules||{},Object.keys(config.modules).forEach((function(module){!0===config.modules[module]&&(config.modules[module]={})}))}));var moduleNames,moduleConfig=Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)).reduce((function(config,name){var moduleClass=Quill.import("modules/"+name);return null==moduleClass?debug.error("Cannot load "+name+" module. Are you sure you registered it?"):config[name]=moduleClass.DEFAULTS||{},config}),{});return null!=userConfig.modules&&userConfig.modules.toolbar&&userConfig.modules.toolbar.constructor!==Object&&(userConfig.modules.toolbar={container:userConfig.modules.toolbar}),userConfig=(0,_extend2.default)(!0,{},Quill.DEFAULTS,{modules:moduleConfig},themeConfig,userConfig),["bounds","container","scrollingContainer"].forEach((function(key){"string"==typeof userConfig[key]&&(userConfig[key]=document.querySelector(userConfig[key]))})),userConfig.modules=Object.keys(userConfig.modules).reduce((function(config,name){return userConfig.modules[name]&&(config[name]=userConfig.modules[name]),config}),{}),userConfig}function modify(modifier,source,index,shift){if(this.options.strict&&!this.isEnabled()&&source===_emitter4.default.sources.USER)return new _quillDelta2.default;var range=null==index?null:this.getSelection(),oldDelta=this.editor.delta,change=modifier();if(null!=range&&(!0===index&&(index=range.index),null==shift?range=shiftRange(range,change,source):0!==shift&&(range=shiftRange(range,index,shift,source)),this.setSelection(range,_emitter4.default.sources.SILENT)),change.length()>0){var _emitter,args=[_emitter4.default.events.TEXT_CHANGE,change,oldDelta,source],_emitter2;if((_emitter=this.emitter).emit.apply(_emitter,[_emitter4.default.events.EDITOR_CHANGE].concat(args)),source!==_emitter4.default.sources.SILENT)(_emitter2=this.emitter).emit.apply(_emitter2,args)}return change}function overload(index,length,name,value,source){var formats={};return"number"==typeof index.index&&"number"==typeof index.length?"number"!=typeof length?(source=value,value=name,name=length,length=index.length,index=index.index):(length=index.length,index=index.index):"number"!=typeof length&&(source=value,value=name,name=length,length=0),"object"===(void 0===name?"undefined":_typeof(name))?(formats=name,source=value):"string"==typeof name&&(null!=value?formats[name]=value:source=name),[index,length,formats,source=source||_emitter4.default.sources.API]}function shiftRange(range,index,length,source){if(null==range)return null;var start=void 0,end=void 0;if(index instanceof _quillDelta2.default){var _map=[range.index,range.index+range.length].map((function(pos){return index.transformPosition(pos,source!==_emitter4.default.sources.USER)})),_map2=_slicedToArray(_map,2);start=_map2[0],end=_map2[1]}else{var _map3=[range.index,range.index+range.length].map((function(pos){return pos<index||pos===index&&source===_emitter4.default.sources.USER?pos:length>=0?pos+length:Math.max(index,pos+length)})),_map4=_slicedToArray(_map3,2);start=_map4[0],end=_map4[1]}return new _selection.Range(start,end-start)}Quill.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},Quill.events=_emitter4.default.events,Quill.sources=_emitter4.default.sources,Quill.version="1.3.7",Quill.imports={delta:_quillDelta2.default,parchment:_parchment2.default,"core/module":_module2.default,"core/theme":_theme2.default},exports.expandConfig=expandConfig,exports.overload=overload,exports.default=Quill},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_text,_text2=_interopRequireDefault(__webpack_require__(7)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Inline=function(_Parchment$Inline){function Inline(){return _classCallCheck(this,Inline),_possibleConstructorReturn(this,(Inline.__proto__||Object.getPrototypeOf(Inline)).apply(this,arguments))}return _inherits(Inline,_Parchment$Inline),_createClass(Inline,[{key:"formatAt",value:function formatAt(index,length,name,value){if(Inline.compare(this.statics.blotName,name)<0&&_parchment2.default.query(name,_parchment2.default.Scope.BLOT)){var blot=this.isolate(index,length);value&&blot.wrap(name,value)}else _get(Inline.prototype.__proto__||Object.getPrototypeOf(Inline.prototype),"formatAt",this).call(this,index,length,name,value)}},{key:"optimize",value:function optimize(context){if(_get(Inline.prototype.__proto__||Object.getPrototypeOf(Inline.prototype),"optimize",this).call(this,context),this.parent instanceof Inline&&Inline.compare(this.statics.blotName,this.parent.statics.blotName)>0){var parent=this.parent.isolate(this.offset(),this.length());this.moveChildren(parent),parent.wrap(this)}}}],[{key:"compare",value:function compare(self,other){var selfIndex=Inline.order.indexOf(self),otherIndex=Inline.order.indexOf(other);return selfIndex>=0||otherIndex>=0?selfIndex-otherIndex:self===other?0:self<other?-1:1}}]),Inline}(_parchment2.default.Inline);Inline.allowedChildren=[Inline,_parchment2.default.Embed,_text2.default],Inline.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],exports.default=Inline},function(module,exports,__webpack_require__){"use strict";var _parchment,_parchment2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var TextBlot=function(_Parchment$Text){function TextBlot(){return _classCallCheck(this,TextBlot),_possibleConstructorReturn(this,(TextBlot.__proto__||Object.getPrototypeOf(TextBlot)).apply(this,arguments))}return _inherits(TextBlot,_Parchment$Text),TextBlot}(_interopRequireDefault(__webpack_require__(0)).default.Text);exports.default=TextBlot},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_eventemitter,_eventemitter2=_interopRequireDefault(__webpack_require__(54)),_logger,_logger2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var debug=(0,_interopRequireDefault(__webpack_require__(10)).default)("quill:events"),EVENTS;["selectionchange","mousedown","mouseup","click"].forEach((function(eventName){document.addEventListener(eventName,(function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];[].slice.call(document.querySelectorAll(".ql-container")).forEach((function(node){var _node$__quill$emitter;node.__quill&&node.__quill.emitter&&(_node$__quill$emitter=node.__quill.emitter).handleDOM.apply(_node$__quill$emitter,args)}))}))}));var Emitter=function(_EventEmitter){function Emitter(){_classCallCheck(this,Emitter);var _this=_possibleConstructorReturn(this,(Emitter.__proto__||Object.getPrototypeOf(Emitter)).call(this));return _this.listeners={},_this.on("error",debug.error),_this}return _inherits(Emitter,_EventEmitter),_createClass(Emitter,[{key:"emit",value:function emit(){debug.log.apply(debug,arguments),_get(Emitter.prototype.__proto__||Object.getPrototypeOf(Emitter.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function handleDOM(event){for(var _len2=arguments.length,args=Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];(this.listeners[event.type]||[]).forEach((function(_ref){var node=_ref.node,handler=_ref.handler;(event.target===node||node.contains(event.target))&&handler.apply(void 0,[event].concat(args))}))}},{key:"listenDOM",value:function listenDOM(eventName,node,handler){this.listeners[eventName]||(this.listeners[eventName]=[]),this.listeners[eventName].push({node:node,handler:handler})}}]),Emitter}(_eventemitter2.default);Emitter.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},Emitter.sources={API:"api",SILENT:"silent",USER:"user"},exports.default=Emitter},function(module,exports,__webpack_require__){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var Module=function Module(quill){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,Module),this.quill=quill,this.options=options};Module.DEFAULTS={},exports.default=Module},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var levels=["error","warn","log","info"],level="warn";function debug(method){if(levels.indexOf(method)<=levels.indexOf(level)){for(var _console,_len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];(_console=console)[method].apply(_console,args)}}function namespace(ns){return levels.reduce((function(logger,method){return logger[method]=debug.bind(console,method,ns),logger}),{})}debug.level=namespace.level=function(newLevel){level=newLevel},exports.default=namespace},function(module,exports,__webpack_require__){var pSlice=Array.prototype.slice,objectKeys=__webpack_require__(52),isArguments=__webpack_require__(53),deepEqual=module.exports=function(actual,expected,opts){return opts||(opts={}),actual===expected||(actual instanceof Date&&expected instanceof Date?actual.getTime()===expected.getTime():!actual||!expected||"object"!=typeof actual&&"object"!=typeof expected?opts.strict?actual===expected:actual==expected:objEquiv(actual,expected,opts))};function isUndefinedOrNull(value){return null==value}function isBuffer(x){return!(!x||"object"!=typeof x||"number"!=typeof x.length)&&("function"==typeof x.copy&&"function"==typeof x.slice&&!(x.length>0&&"number"!=typeof x[0]))}function objEquiv(a,b,opts){var i,key;if(isUndefinedOrNull(a)||isUndefinedOrNull(b))return!1;if(a.prototype!==b.prototype)return!1;if(isArguments(a))return!!isArguments(b)&&(a=pSlice.call(a),b=pSlice.call(b),deepEqual(a,b,opts));if(isBuffer(a)){if(!isBuffer(b))return!1;if(a.length!==b.length)return!1;for(i=0;i<a.length;i++)if(a[i]!==b[i])return!1;return!0}try{var ka=objectKeys(a),kb=objectKeys(b)}catch(e){return!1}if(ka.length!=kb.length)return!1;for(ka.sort(),kb.sort(),i=ka.length-1;i>=0;i--)if(ka[i]!=kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!deepEqual(a[key],b[key],opts))return!1;return typeof a==typeof b}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Registry=__webpack_require__(1),Attributor=function(){function Attributor(attrName,keyName,options){void 0===options&&(options={}),this.attrName=attrName,this.keyName=keyName;var attributeBit=Registry.Scope.TYPE&Registry.Scope.ATTRIBUTE;null!=options.scope?this.scope=options.scope&Registry.Scope.LEVEL|attributeBit:this.scope=Registry.Scope.ATTRIBUTE,null!=options.whitelist&&(this.whitelist=options.whitelist)}return Attributor.keys=function(node){return[].map.call(node.attributes,(function(item){return item.name}))},Attributor.prototype.add=function(node,value){return!!this.canAdd(node,value)&&(node.setAttribute(this.keyName,value),!0)},Attributor.prototype.canAdd=function(node,value){var match;return null!=Registry.query(node,Registry.Scope.BLOT&(this.scope|Registry.Scope.TYPE))&&(null==this.whitelist||("string"==typeof value?this.whitelist.indexOf(value.replace(/["']/g,""))>-1:this.whitelist.indexOf(value)>-1))},Attributor.prototype.remove=function(node){node.removeAttribute(this.keyName)},Attributor.prototype.value=function(node){var value=node.getAttribute(this.keyName);return this.canAdd(node,value)&&value?value:""},Attributor}();exports.default=Attributor},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Code=void 0;var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_block,_block2=_interopRequireDefault(__webpack_require__(4)),_inline,_inline2=_interopRequireDefault(__webpack_require__(6)),_text,_text2=_interopRequireDefault(__webpack_require__(7));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Code=function(_Inline){function Code(){return _classCallCheck(this,Code),_possibleConstructorReturn(this,(Code.__proto__||Object.getPrototypeOf(Code)).apply(this,arguments))}return _inherits(Code,_Inline),Code}(_inline2.default);Code.blotName="code",Code.tagName="CODE";var CodeBlock=function(_Block){function CodeBlock(){return _classCallCheck(this,CodeBlock),_possibleConstructorReturn(this,(CodeBlock.__proto__||Object.getPrototypeOf(CodeBlock)).apply(this,arguments))}return _inherits(CodeBlock,_Block),_createClass(CodeBlock,[{key:"delta",value:function delta(){var _this3=this,text=this.domNode.textContent;return text.endsWith("\n")&&(text=text.slice(0,-1)),text.split("\n").reduce((function(delta,frag){return delta.insert(frag).insert("\n",_this3.formats())}),new _quillDelta2.default)}},{key:"format",value:function format(name,value){if(name!==this.statics.blotName||!value){var _descendant=this.descendant(_text2.default,this.length()-1),_descendant2,text=_slicedToArray(_descendant,1)[0];null!=text&&text.deleteAt(text.length()-1,1),_get(CodeBlock.prototype.__proto__||Object.getPrototypeOf(CodeBlock.prototype),"format",this).call(this,name,value)}}},{key:"formatAt",value:function formatAt(index,length,name,value){if(0!==length&&null!=_parchment2.default.query(name,_parchment2.default.Scope.BLOCK)&&(name!==this.statics.blotName||value!==this.statics.formats(this.domNode))){var nextNewline=this.newlineIndex(index);if(!(nextNewline<0||nextNewline>=index+length)){var prevNewline=this.newlineIndex(index,!0)+1,isolateLength=nextNewline-prevNewline+1,blot=this.isolate(prevNewline,isolateLength),next=blot.next;blot.format(name,value),next instanceof CodeBlock&&next.formatAt(0,index-prevNewline+length-isolateLength,name,value)}}}},{key:"insertAt",value:function insertAt(index,value,def){if(null==def){var _descendant3=this.descendant(_text2.default,index),_descendant4=_slicedToArray(_descendant3,2),text=_descendant4[0],offset=_descendant4[1];text.insertAt(offset,value)}}},{key:"length",value:function length(){var length=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?length:length+1}},{key:"newlineIndex",value:function newlineIndex(searchIndex){var reverse=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(reverse)return this.domNode.textContent.slice(0,searchIndex).lastIndexOf("\n");var offset=this.domNode.textContent.slice(searchIndex).indexOf("\n");return offset>-1?searchIndex+offset:-1}},{key:"optimize",value:function optimize(context){this.domNode.textContent.endsWith("\n")||this.appendChild(_parchment2.default.create("text","\n")),_get(CodeBlock.prototype.__proto__||Object.getPrototypeOf(CodeBlock.prototype),"optimize",this).call(this,context);var next=this.next;null!=next&&next.prev===this&&next.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===next.statics.formats(next.domNode)&&(next.optimize(context),next.moveChildren(this),next.remove())}},{key:"replace",value:function replace(target){_get(CodeBlock.prototype.__proto__||Object.getPrototypeOf(CodeBlock.prototype),"replace",this).call(this,target),[].slice.call(this.domNode.querySelectorAll("*")).forEach((function(node){var blot=_parchment2.default.find(node);null==blot?node.parentNode.removeChild(node):blot instanceof _parchment2.default.Embed?blot.remove():blot.unwrap()}))}}],[{key:"create",value:function create(value){var domNode=_get(CodeBlock.__proto__||Object.getPrototypeOf(CodeBlock),"create",this).call(this,value);return domNode.setAttribute("spellcheck",!1),domNode}},{key:"formats",value:function formats(){return!0}}]),CodeBlock}(_block2.default);CodeBlock.blotName="code-block",CodeBlock.tagName="PRE",CodeBlock.TAB=" ",exports.Code=Code,exports.default=CodeBlock},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_op,_op2=_interopRequireDefault(__webpack_require__(20)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_code,_code2=_interopRequireDefault(__webpack_require__(13)),_cursor,_cursor2=_interopRequireDefault(__webpack_require__(24)),_block=__webpack_require__(4),_block2=_interopRequireDefault(_block),_break,_break2=_interopRequireDefault(__webpack_require__(16)),_clone,_clone2=_interopRequireDefault(__webpack_require__(21)),_deepEqual,_deepEqual2=_interopRequireDefault(__webpack_require__(11)),_extend,_extend2=_interopRequireDefault(__webpack_require__(3));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var ASCII=/^[ -~]*$/,Editor=function(){function Editor(scroll){_classCallCheck(this,Editor),this.scroll=scroll,this.delta=this.getDelta()}return _createClass(Editor,[{key:"applyDelta",value:function applyDelta(delta){var _this=this,consumeNextNewline=!1;this.scroll.update();var scrollLength=this.scroll.length();return this.scroll.batchStart(),(delta=normalizeDelta(delta)).reduce((function(index,op){var length=op.retain||op.delete||op.insert.length||1,attributes=op.attributes||{};if(null!=op.insert){if("string"==typeof op.insert){var text=op.insert;text.endsWith("\n")&&consumeNextNewline&&(consumeNextNewline=!1,text=text.slice(0,-1)),index>=scrollLength&&!text.endsWith("\n")&&(consumeNextNewline=!0),_this.scroll.insertAt(index,text);var _scroll$line=_this.scroll.line(index),_scroll$line2=_slicedToArray(_scroll$line,2),line=_scroll$line2[0],offset=_scroll$line2[1],formats=(0,_extend2.default)({},(0,_block.bubbleFormats)(line));if(line instanceof _block2.default){var _line$descendant=line.descendant(_parchment2.default.Leaf,offset),_line$descendant2,leaf=_slicedToArray(_line$descendant,1)[0];formats=(0,_extend2.default)(formats,(0,_block.bubbleFormats)(leaf))}attributes=_op2.default.attributes.diff(formats,attributes)||{}}else if("object"===_typeof(op.insert)){var key=Object.keys(op.insert)[0];if(null==key)return index;_this.scroll.insertAt(index,key,op.insert[key])}scrollLength+=length}return Object.keys(attributes).forEach((function(name){_this.scroll.formatAt(index,length,name,attributes[name])})),index+length}),0),delta.reduce((function(index,op){return"number"==typeof op.delete?(_this.scroll.deleteAt(index,op.delete),index):index+(op.retain||op.insert.length||1)}),0),this.scroll.batchEnd(),this.update(delta)}},{key:"deleteText",value:function deleteText(index,length){return this.scroll.deleteAt(index,length),this.update((new _quillDelta2.default).retain(index).delete(length))}},{key:"formatLine",value:function formatLine(index,length){var _this2=this,formats=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(formats).forEach((function(format){if(null==_this2.scroll.whitelist||_this2.scroll.whitelist[format]){var lines=_this2.scroll.lines(index,Math.max(length,1)),lengthRemaining=length;lines.forEach((function(line){var lineLength=line.length();if(line instanceof _code2.default){var codeIndex=index-line.offset(_this2.scroll),codeLength=line.newlineIndex(codeIndex+lengthRemaining)-codeIndex+1;line.formatAt(codeIndex,codeLength,format,formats[format])}else line.format(format,formats[format]);lengthRemaining-=lineLength}))}})),this.scroll.optimize(),this.update((new _quillDelta2.default).retain(index).retain(length,(0,_clone2.default)(formats)))}},{key:"formatText",value:function formatText(index,length){var _this3=this,formats=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(formats).forEach((function(format){_this3.scroll.formatAt(index,length,format,formats[format])})),this.update((new _quillDelta2.default).retain(index).retain(length,(0,_clone2.default)(formats)))}},{key:"getContents",value:function getContents(index,length){return this.delta.slice(index,index+length)}},{key:"getDelta",value:function getDelta(){return this.scroll.lines().reduce((function(delta,line){return delta.concat(line.delta())}),new _quillDelta2.default)}},{key:"getFormat",value:function getFormat(index){var length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,lines=[],leaves=[];0===length?this.scroll.path(index).forEach((function(path){var _path,blot=_slicedToArray(path,1)[0];blot instanceof _block2.default?lines.push(blot):blot instanceof _parchment2.default.Leaf&&leaves.push(blot)})):(lines=this.scroll.lines(index,length),leaves=this.scroll.descendants(_parchment2.default.Leaf,index,length));var formatsArr=[lines,leaves].map((function(blots){if(0===blots.length)return{};for(var formats=(0,_block.bubbleFormats)(blots.shift());Object.keys(formats).length>0;){var blot=blots.shift();if(null==blot)return formats;formats=combineFormats((0,_block.bubbleFormats)(blot),formats)}return formats}));return _extend2.default.apply(_extend2.default,formatsArr)}},{key:"getText",value:function getText(index,length){return this.getContents(index,length).filter((function(op){return"string"==typeof op.insert})).map((function(op){return op.insert})).join("")}},{key:"insertEmbed",value:function insertEmbed(index,embed,value){return this.scroll.insertAt(index,embed,value),this.update((new _quillDelta2.default).retain(index).insert(_defineProperty({},embed,value)))}},{key:"insertText",value:function insertText(index,text){var _this4=this,formats=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return text=text.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(index,text),Object.keys(formats).forEach((function(format){_this4.scroll.formatAt(index,text.length,format,formats[format])})),this.update((new _quillDelta2.default).retain(index).insert(text,(0,_clone2.default)(formats)))}},{key:"isBlank",value:function isBlank(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var block=this.scroll.children.head;return block.statics.blotName===_block2.default.blotName&&(!(block.children.length>1)&&block.children.head instanceof _break2.default)}},{key:"removeFormat",value:function removeFormat(index,length){var text=this.getText(index,length),_scroll$line3=this.scroll.line(index+length),_scroll$line4=_slicedToArray(_scroll$line3,2),line=_scroll$line4[0],offset=_scroll$line4[1],suffixLength=0,suffix=new _quillDelta2.default;null!=line&&(suffixLength=line instanceof _code2.default?line.newlineIndex(offset)-offset+1:line.length()-offset,suffix=line.delta().slice(offset,offset+suffixLength-1).insert("\n"));var contents,diff=this.getContents(index,length+suffixLength).diff((new _quillDelta2.default).insert(text).concat(suffix)),delta=(new _quillDelta2.default).retain(index).concat(diff);return this.applyDelta(delta)}},{key:"update",value:function update(change){var mutations=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],cursorIndex=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,oldDelta=this.delta;if(1===mutations.length&&"characterData"===mutations[0].type&&mutations[0].target.data.match(ASCII)&&_parchment2.default.find(mutations[0].target)){var textBlot=_parchment2.default.find(mutations[0].target),formats=(0,_block.bubbleFormats)(textBlot),index=textBlot.offset(this.scroll),oldValue=mutations[0].oldValue.replace(_cursor2.default.CONTENTS,""),oldText=(new _quillDelta2.default).insert(oldValue),newText=(new _quillDelta2.default).insert(textBlot.value()),diffDelta=(new _quillDelta2.default).retain(index).concat(oldText.diff(newText,cursorIndex));change=diffDelta.reduce((function(delta,op){return op.insert?delta.insert(op.insert,formats):delta.push(op)}),new _quillDelta2.default),this.delta=oldDelta.compose(change)}else this.delta=this.getDelta(),change&&(0,_deepEqual2.default)(oldDelta.compose(change),this.delta)||(change=oldDelta.diff(this.delta,cursorIndex));return change}}]),Editor}();function combineFormats(formats,combined){return Object.keys(combined).reduce((function(merged,name){return null==formats[name]?merged:(combined[name]===formats[name]?merged[name]=combined[name]:Array.isArray(combined[name])?combined[name].indexOf(formats[name])<0&&(merged[name]=combined[name].concat([formats[name]])):merged[name]=[combined[name],formats[name]],merged)}),{})}function normalizeDelta(delta){return delta.reduce((function(delta,op){if(1===op.insert){var attributes=(0,_clone2.default)(op.attributes);return delete attributes.image,delta.insert({image:op.attributes.image},attributes)}if(null==op.attributes||!0!==op.attributes.list&&!0!==op.attributes.bullet||((op=(0,_clone2.default)(op)).attributes.list?op.attributes.list="ordered":(op.attributes.list="bullet",delete op.attributes.bullet)),"string"==typeof op.insert){var text=op.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return delta.insert(text,op.attributes)}return delta.push(op)}),new _quillDelta2.default)}exports.default=Editor},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Range=void 0;var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_clone,_clone2=_interopRequireDefault(__webpack_require__(21)),_deepEqual,_deepEqual2=_interopRequireDefault(__webpack_require__(11)),_emitter3,_emitter4=_interopRequireDefault(__webpack_require__(8)),_logger,_logger2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}return Array.from(arr)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var debug=(0,_interopRequireDefault(__webpack_require__(10)).default)("quill:selection"),Range=function Range(index){var length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;_classCallCheck(this,Range),this.index=index,this.length=length},Selection=function(){function Selection(scroll,emitter){var _this=this;_classCallCheck(this,Selection),this.emitter=emitter,this.scroll=scroll,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=_parchment2.default.create("cursor",this),this.lastRange=this.savedRange=new Range(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(function(){_this.mouseDown||setTimeout(_this.update.bind(_this,_emitter4.default.sources.USER),1)})),this.emitter.on(_emitter4.default.events.EDITOR_CHANGE,(function(type,delta){type===_emitter4.default.events.TEXT_CHANGE&&delta.length()>0&&_this.update(_emitter4.default.sources.SILENT)})),this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE,(function(){if(_this.hasFocus()){var native=_this.getNativeRange();null!=native&&native.start.node!==_this.cursor.textNode&&_this.emitter.once(_emitter4.default.events.SCROLL_UPDATE,(function(){try{_this.setNativeRange(native.start.node,native.start.offset,native.end.node,native.end.offset)}catch(ignored){}}))}})),this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE,(function(mutations,context){if(context.range){var _context$range=context.range,startNode=_context$range.startNode,startOffset=_context$range.startOffset,endNode=_context$range.endNode,endOffset=_context$range.endOffset;_this.setNativeRange(startNode,startOffset,endNode,endOffset)}})),this.update(_emitter4.default.sources.SILENT)}return _createClass(Selection,[{key:"handleComposition",value:function handleComposition(){var _this2=this;this.root.addEventListener("compositionstart",(function(){_this2.composing=!0})),this.root.addEventListener("compositionend",(function(){if(_this2.composing=!1,_this2.cursor.parent){var range=_this2.cursor.restore();if(!range)return;setTimeout((function(){_this2.setNativeRange(range.startNode,range.startOffset,range.endNode,range.endOffset)}),1)}}))}},{key:"handleDragging",value:function handleDragging(){var _this3=this;this.emitter.listenDOM("mousedown",document.body,(function(){_this3.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(function(){_this3.mouseDown=!1,_this3.update(_emitter4.default.sources.USER)}))}},{key:"focus",value:function focus(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function format(_format,value){if(null==this.scroll.whitelist||this.scroll.whitelist[_format]){this.scroll.update();var nativeRange=this.getNativeRange();if(null!=nativeRange&&nativeRange.native.collapsed&&!_parchment2.default.query(_format,_parchment2.default.Scope.BLOCK)){if(nativeRange.start.node!==this.cursor.textNode){var blot=_parchment2.default.find(nativeRange.start.node,!1);if(null==blot)return;if(blot instanceof _parchment2.default.Leaf){var after=blot.split(nativeRange.start.offset);blot.parent.insertBefore(this.cursor,after)}else blot.insertBefore(this.cursor,nativeRange.start.node);this.cursor.attach()}this.cursor.format(_format,value),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function getBounds(index){var length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,scrollLength=this.scroll.length();index=Math.min(index,scrollLength-1),length=Math.min(index+length,scrollLength-1)-index;var node=void 0,_scroll$leaf=this.scroll.leaf(index),_scroll$leaf2=_slicedToArray(_scroll$leaf,2),leaf=_scroll$leaf2[0],offset=_scroll$leaf2[1];if(null==leaf)return null;var _leaf$position=leaf.position(offset,!0),_leaf$position2=_slicedToArray(_leaf$position,2);node=_leaf$position2[0],offset=_leaf$position2[1];var range=document.createRange();if(length>0){range.setStart(node,offset);var _scroll$leaf3=this.scroll.leaf(index+length),_scroll$leaf4=_slicedToArray(_scroll$leaf3,2);if(leaf=_scroll$leaf4[0],offset=_scroll$leaf4[1],null==leaf)return null;var _leaf$position3=leaf.position(offset,!0),_leaf$position4=_slicedToArray(_leaf$position3,2);return node=_leaf$position4[0],offset=_leaf$position4[1],range.setEnd(node,offset),range.getBoundingClientRect()}var side="left",rect=void 0;return node instanceof Text?(offset<node.data.length?(range.setStart(node,offset),range.setEnd(node,offset+1)):(range.setStart(node,offset-1),range.setEnd(node,offset),side="right"),rect=range.getBoundingClientRect()):(rect=leaf.domNode.getBoundingClientRect(),offset>0&&(side="right")),{bottom:rect.top+rect.height,height:rect.height,left:rect[side],right:rect[side],top:rect.top,width:0}}},{key:"getNativeRange",value:function getNativeRange(){var selection=document.getSelection();if(null==selection||selection.rangeCount<=0)return null;var nativeRange=selection.getRangeAt(0);if(null==nativeRange)return null;var range=this.normalizeNative(nativeRange);return debug.info("getNativeRange",range),range}},{key:"getRange",value:function getRange(){var normalized=this.getNativeRange(),range;return null==normalized?[null,null]:[this.normalizedToRange(normalized),normalized]}},{key:"hasFocus",value:function hasFocus(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function normalizedToRange(range){var _this4=this,positions=[[range.start.node,range.start.offset]];range.native.collapsed||positions.push([range.end.node,range.end.offset]);var indexes=positions.map((function(position){var _position=_slicedToArray(position,2),node=_position[0],offset=_position[1],blot=_parchment2.default.find(node,!0),index=blot.offset(_this4.scroll);return 0===offset?index:blot instanceof _parchment2.default.Container?index+blot.length():index+blot.index(node,offset)})),end=Math.min(Math.max.apply(Math,_toConsumableArray(indexes)),this.scroll.length()-1),start=Math.min.apply(Math,[end].concat(_toConsumableArray(indexes)));return new Range(start,end-start)}},{key:"normalizeNative",value:function normalizeNative(nativeRange){if(!contains(this.root,nativeRange.startContainer)||!nativeRange.collapsed&&!contains(this.root,nativeRange.endContainer))return null;var range={start:{node:nativeRange.startContainer,offset:nativeRange.startOffset},end:{node:nativeRange.endContainer,offset:nativeRange.endOffset},native:nativeRange};return[range.start,range.end].forEach((function(position){for(var node=position.node,offset=position.offset;!(node instanceof Text)&&node.childNodes.length>0;)if(node.childNodes.length>offset)node=node.childNodes[offset],offset=0;else{if(node.childNodes.length!==offset)break;offset=(node=node.lastChild)instanceof Text?node.data.length:node.childNodes.length+1}position.node=node,position.offset=offset})),range}},{key:"rangeToNative",value:function rangeToNative(range){var _this5=this,indexes=range.collapsed?[range.index]:[range.index,range.index+range.length],args=[],scrollLength=this.scroll.length();return indexes.forEach((function(index,i){index=Math.min(scrollLength-1,index);var node=void 0,_scroll$leaf5=_this5.scroll.leaf(index),_scroll$leaf6=_slicedToArray(_scroll$leaf5,2),leaf=_scroll$leaf6[0],offset=_scroll$leaf6[1],_leaf$position5=leaf.position(offset,0!==i),_leaf$position6=_slicedToArray(_leaf$position5,2);node=_leaf$position6[0],offset=_leaf$position6[1],args.push(node,offset)})),args.length<2&&(args=args.concat(args)),args}},{key:"scrollIntoView",value:function scrollIntoView(scrollingContainer){var range=this.lastRange;if(null!=range){var bounds=this.getBounds(range.index,range.length);if(null!=bounds){var limit=this.scroll.length()-1,_scroll$line=this.scroll.line(Math.min(range.index,limit)),_scroll$line2,first=_slicedToArray(_scroll$line,1)[0],last=first;if(range.length>0){var _scroll$line3=this.scroll.line(Math.min(range.index+range.length,limit)),_scroll$line4;last=_slicedToArray(_scroll$line3,1)[0]}if(null!=first&&null!=last){var scrollBounds=scrollingContainer.getBoundingClientRect();bounds.top<scrollBounds.top?scrollingContainer.scrollTop-=scrollBounds.top-bounds.top:bounds.bottom>scrollBounds.bottom&&(scrollingContainer.scrollTop+=bounds.bottom-scrollBounds.bottom)}}}}},{key:"setNativeRange",value:function setNativeRange(startNode,startOffset){var endNode=arguments.length>2&&void 0!==arguments[2]?arguments[2]:startNode,endOffset=arguments.length>3&&void 0!==arguments[3]?arguments[3]:startOffset,force=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(debug.info("setNativeRange",startNode,startOffset,endNode,endOffset),null==startNode||null!=this.root.parentNode&&null!=startNode.parentNode&&null!=endNode.parentNode){var selection=document.getSelection();if(null!=selection)if(null!=startNode){this.hasFocus()||this.root.focus();var native=(this.getNativeRange()||{}).native;if(null==native||force||startNode!==native.startContainer||startOffset!==native.startOffset||endNode!==native.endContainer||endOffset!==native.endOffset){"BR"==startNode.tagName&&(startOffset=[].indexOf.call(startNode.parentNode.childNodes,startNode),startNode=startNode.parentNode),"BR"==endNode.tagName&&(endOffset=[].indexOf.call(endNode.parentNode.childNodes,endNode),endNode=endNode.parentNode);var range=document.createRange();range.setStart(startNode,startOffset),range.setEnd(endNode,endOffset),selection.removeAllRanges(),selection.addRange(range)}}else selection.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function setRange(range){var force=arguments.length>1&&void 0!==arguments[1]&&arguments[1],source=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_emitter4.default.sources.API;if("string"==typeof force&&(source=force,force=!1),debug.info("setRange",range),null!=range){var args=this.rangeToNative(range);this.setNativeRange.apply(this,_toConsumableArray(args).concat([force]))}else this.setNativeRange(null);this.update(source)}},{key:"update",value:function update(){var source=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_emitter4.default.sources.USER,oldRange=this.lastRange,_getRange=this.getRange(),_getRange2=_slicedToArray(_getRange,2),lastRange=_getRange2[0],nativeRange=_getRange2[1];if(this.lastRange=lastRange,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,_deepEqual2.default)(oldRange,this.lastRange)){var _emitter;!this.composing&&null!=nativeRange&&nativeRange.native.collapsed&&nativeRange.start.node!==this.cursor.textNode&&this.cursor.restore();var args=[_emitter4.default.events.SELECTION_CHANGE,(0,_clone2.default)(this.lastRange),(0,_clone2.default)(oldRange),source],_emitter2;if((_emitter=this.emitter).emit.apply(_emitter,[_emitter4.default.events.EDITOR_CHANGE].concat(args)),source!==_emitter4.default.sources.SILENT)(_emitter2=this.emitter).emit.apply(_emitter2,args)}}}]),Selection}();function contains(parent,descendant){try{descendant.parentNode}catch(e){return!1}return descendant instanceof Text&&(descendant=descendant.parentNode),parent.contains(descendant)}exports.Range=Range,exports.default=Selection},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Break=function(_Parchment$Embed){function Break(){return _classCallCheck(this,Break),_possibleConstructorReturn(this,(Break.__proto__||Object.getPrototypeOf(Break)).apply(this,arguments))}return _inherits(Break,_Parchment$Embed),_createClass(Break,[{key:"insertInto",value:function insertInto(parent,ref){0===parent.children.length?_get(Break.prototype.__proto__||Object.getPrototypeOf(Break.prototype),"insertInto",this).call(this,parent,ref):this.remove()}},{key:"length",value:function length(){return 0}},{key:"value",value:function value(){return""}}],[{key:"value",value:function value(){}}]),Break}(_interopRequireDefault(__webpack_require__(0)).default.Embed);Break.blotName="break",Break.tagName="BR",exports.default=Break},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var linked_list_1=__webpack_require__(44),shadow_1=__webpack_require__(30),Registry=__webpack_require__(1),ContainerBlot=function(_super){function ContainerBlot(domNode){var _this=_super.call(this,domNode)||this;return _this.build(),_this}return __extends(ContainerBlot,_super),ContainerBlot.prototype.appendChild=function(other){this.insertBefore(other)},ContainerBlot.prototype.attach=function(){_super.prototype.attach.call(this),this.children.forEach((function(child){child.attach()}))},ContainerBlot.prototype.build=function(){var _this=this;this.children=new linked_list_1.default,[].slice.call(this.domNode.childNodes).reverse().forEach((function(node){try{var child=makeBlot(node);_this.insertBefore(child,_this.children.head||void 0)}catch(err){if(err instanceof Registry.ParchmentError)return;throw err}}))},ContainerBlot.prototype.deleteAt=function(index,length){if(0===index&&length===this.length())return this.remove();this.children.forEachAt(index,length,(function(child,offset,length){child.deleteAt(offset,length)}))},ContainerBlot.prototype.descendant=function(criteria,index){var _a=this.children.find(index),child=_a[0],offset=_a[1];return null==criteria.blotName&&criteria(child)||null!=criteria.blotName&&child instanceof criteria?[child,offset]:child instanceof ContainerBlot?child.descendant(criteria,offset):[null,-1]},ContainerBlot.prototype.descendants=function(criteria,index,length){void 0===index&&(index=0),void 0===length&&(length=Number.MAX_VALUE);var descendants=[],lengthLeft=length;return this.children.forEachAt(index,length,(function(child,index,length){(null==criteria.blotName&&criteria(child)||null!=criteria.blotName&&child instanceof criteria)&&descendants.push(child),child instanceof ContainerBlot&&(descendants=descendants.concat(child.descendants(criteria,index,lengthLeft))),lengthLeft-=length})),descendants},ContainerBlot.prototype.detach=function(){this.children.forEach((function(child){child.detach()})),_super.prototype.detach.call(this)},ContainerBlot.prototype.formatAt=function(index,length,name,value){this.children.forEachAt(index,length,(function(child,offset,length){child.formatAt(offset,length,name,value)}))},ContainerBlot.prototype.insertAt=function(index,value,def){var _a=this.children.find(index),child=_a[0],offset=_a[1];if(child)child.insertAt(offset,value,def);else{var blot=null==def?Registry.create("text",value):Registry.create(value,def);this.appendChild(blot)}},ContainerBlot.prototype.insertBefore=function(childBlot,refBlot){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some((function(child){return childBlot instanceof child})))throw new Registry.ParchmentError("Cannot insert "+childBlot.statics.blotName+" into "+this.statics.blotName);childBlot.insertInto(this,refBlot)},ContainerBlot.prototype.length=function(){return this.children.reduce((function(memo,child){return memo+child.length()}),0)},ContainerBlot.prototype.moveChildren=function(targetParent,refNode){this.children.forEach((function(child){targetParent.insertBefore(child,refNode)}))},ContainerBlot.prototype.optimize=function(context){if(_super.prototype.optimize.call(this,context),0===this.children.length)if(null!=this.statics.defaultChild){var child=Registry.create(this.statics.defaultChild);this.appendChild(child),child.optimize(context)}else this.remove()},ContainerBlot.prototype.path=function(index,inclusive){void 0===inclusive&&(inclusive=!1);var _a=this.children.find(index,inclusive),child=_a[0],offset=_a[1],position=[[this,index]];return child instanceof ContainerBlot?position.concat(child.path(offset,inclusive)):(null!=child&&position.push([child,offset]),position)},ContainerBlot.prototype.removeChild=function(child){this.children.remove(child)},ContainerBlot.prototype.replace=function(target){target instanceof ContainerBlot&&target.moveChildren(this),_super.prototype.replace.call(this,target)},ContainerBlot.prototype.split=function(index,force){if(void 0===force&&(force=!1),!force){if(0===index)return this;if(index===this.length())return this.next}var after=this.clone();return this.parent.insertBefore(after,this.next),this.children.forEachAt(index,this.length(),(function(child,offset,length){child=child.split(offset,force),after.appendChild(child)})),after},ContainerBlot.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},ContainerBlot.prototype.update=function(mutations,context){var _this=this,addedNodes=[],removedNodes=[];mutations.forEach((function(mutation){mutation.target===_this.domNode&&"childList"===mutation.type&&(addedNodes.push.apply(addedNodes,mutation.addedNodes),removedNodes.push.apply(removedNodes,mutation.removedNodes))})),removedNodes.forEach((function(node){if(!(null!=node.parentNode&&"IFRAME"!==node.tagName&&document.body.compareDocumentPosition(node)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var blot=Registry.find(node);null!=blot&&(null!=blot.domNode.parentNode&&blot.domNode.parentNode!==_this.domNode||blot.detach())}})),addedNodes.filter((function(node){return node.parentNode==_this.domNode})).sort((function(a,b){return a===b?0:a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1})).forEach((function(node){var refBlot=null;null!=node.nextSibling&&(refBlot=Registry.find(node.nextSibling));var blot=makeBlot(node);blot.next==refBlot&&null!=blot.next||(null!=blot.parent&&blot.parent.removeChild(_this),_this.insertBefore(blot,refBlot||void 0))}))},ContainerBlot}(shadow_1.default);function makeBlot(node){var blot=Registry.find(node);if(null==blot)try{blot=Registry.create(node)}catch(e){blot=Registry.create(Registry.Scope.INLINE),[].slice.call(node.childNodes).forEach((function(child){blot.domNode.appendChild(child)})),node.parentNode&&node.parentNode.replaceChild(blot.domNode,node),blot.attach()}return blot}exports.default=ContainerBlot},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var attributor_1=__webpack_require__(12),store_1=__webpack_require__(31),container_1=__webpack_require__(17),Registry=__webpack_require__(1),FormatBlot=function(_super){function FormatBlot(domNode){var _this=_super.call(this,domNode)||this;return _this.attributes=new store_1.default(_this.domNode),_this}return __extends(FormatBlot,_super),FormatBlot.formats=function(domNode){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?domNode.tagName.toLowerCase():void 0)},FormatBlot.prototype.format=function(name,value){var format=Registry.query(name);format instanceof attributor_1.default?this.attributes.attribute(format,value):value&&(null==format||name===this.statics.blotName&&this.formats()[name]===value||this.replaceWith(name,value))},FormatBlot.prototype.formats=function(){var formats=this.attributes.values(),format=this.statics.formats(this.domNode);return null!=format&&(formats[this.statics.blotName]=format),formats},FormatBlot.prototype.replaceWith=function(name,value){var replacement=_super.prototype.replaceWith.call(this,name,value);return this.attributes.copy(replacement),replacement},FormatBlot.prototype.update=function(mutations,context){var _this=this;_super.prototype.update.call(this,mutations,context),mutations.some((function(mutation){return mutation.target===_this.domNode&&"attributes"===mutation.type}))&&this.attributes.build()},FormatBlot.prototype.wrap=function(name,value){var wrapper=_super.prototype.wrap.call(this,name,value);return wrapper instanceof FormatBlot&&wrapper.statics.scope===this.statics.scope&&this.attributes.move(wrapper),wrapper},FormatBlot}(container_1.default);exports.default=FormatBlot},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var shadow_1=__webpack_require__(30),Registry=__webpack_require__(1),LeafBlot=function(_super){function LeafBlot(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(LeafBlot,_super),LeafBlot.value=function(domNode){return!0},LeafBlot.prototype.index=function(node,offset){return this.domNode===node||this.domNode.compareDocumentPosition(node)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(offset,1):-1},LeafBlot.prototype.position=function(index,inclusive){var offset=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return index>0&&(offset+=1),[this.parent.domNode,offset]},LeafBlot.prototype.value=function(){var _a;return(_a={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,_a},LeafBlot.scope=Registry.Scope.INLINE_BLOT,LeafBlot}(shadow_1.default);exports.default=LeafBlot},function(module,exports,__webpack_require__){var equal=__webpack_require__(11),extend=__webpack_require__(3),lib={attributes:{compose:function(a,b,keepNull){"object"!=typeof a&&(a={}),"object"!=typeof b&&(b={});var attributes=extend(!0,{},b);for(var key in keepNull||(attributes=Object.keys(attributes).reduce((function(copy,key){return null!=attributes[key]&&(copy[key]=attributes[key]),copy}),{})),a)void 0!==a[key]&&void 0===b[key]&&(attributes[key]=a[key]);return Object.keys(attributes).length>0?attributes:void 0},diff:function(a,b){"object"!=typeof a&&(a={}),"object"!=typeof b&&(b={});var attributes=Object.keys(a).concat(Object.keys(b)).reduce((function(attributes,key){return equal(a[key],b[key])||(attributes[key]=void 0===b[key]?null:b[key]),attributes}),{});return Object.keys(attributes).length>0?attributes:void 0},transform:function(a,b,priority){if("object"!=typeof a)return b;if("object"==typeof b){if(!priority)return b;var attributes=Object.keys(b).reduce((function(attributes,key){return void 0===a[key]&&(attributes[key]=b[key]),attributes}),{});return Object.keys(attributes).length>0?attributes:void 0}}},iterator:function(ops){return new Iterator(ops)},length:function(op){return"number"==typeof op.delete?op.delete:"number"==typeof op.retain?op.retain:"string"==typeof op.insert?op.insert.length:1}};function Iterator(ops){this.ops=ops,this.index=0,this.offset=0}Iterator.prototype.hasNext=function(){return this.peekLength()<1/0},Iterator.prototype.next=function(length){length||(length=1/0);var nextOp=this.ops[this.index];if(nextOp){var offset=this.offset,opLength=lib.length(nextOp);if(length>=opLength-offset?(length=opLength-offset,this.index+=1,this.offset=0):this.offset+=length,"number"==typeof nextOp.delete)return{delete:length};var retOp={};return nextOp.attributes&&(retOp.attributes=nextOp.attributes),"number"==typeof nextOp.retain?retOp.retain=length:"string"==typeof nextOp.insert?retOp.insert=nextOp.insert.substr(offset,length):retOp.insert=nextOp.insert,retOp}return{retain:1/0}},Iterator.prototype.peek=function(){return this.ops[this.index]},Iterator.prototype.peekLength=function(){return this.ops[this.index]?lib.length(this.ops[this.index])-this.offset:1/0},Iterator.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},Iterator.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var offset=this.offset,index=this.index,next=this.next(),rest=this.ops.slice(this.index);return this.offset=offset,this.index=index,[next].concat(rest)}return[]},module.exports=lib},function(module,exports){var clone=function(){"use strict";function _instanceof(obj,type){return null!=type&&obj instanceof type}var nativeMap,nativeSet,nativePromise;try{nativeMap=Map}catch(_){nativeMap=function(){}}try{nativeSet=Set}catch(_){nativeSet=function(){}}try{nativePromise=Promise}catch(_){nativePromise=function(){}}function clone(parent,circular,depth,prototype,includeNonEnumerable){"object"==typeof circular&&(depth=circular.depth,prototype=circular.prototype,includeNonEnumerable=circular.includeNonEnumerable,circular=circular.circular);var allParents=[],allChildren=[],useBuffer="undefined"!=typeof Buffer;function _clone(parent,depth){if(null===parent)return null;if(0===depth)return parent;var child,proto;if("object"!=typeof parent)return parent;if(_instanceof(parent,nativeMap))child=new nativeMap;else if(_instanceof(parent,nativeSet))child=new nativeSet;else if(_instanceof(parent,nativePromise))child=new nativePromise((function(resolve,reject){parent.then((function(value){resolve(_clone(value,depth-1))}),(function(err){reject(_clone(err,depth-1))}))}));else if(clone.__isArray(parent))child=[];else if(clone.__isRegExp(parent))child=new RegExp(parent.source,__getRegExpFlags(parent)),parent.lastIndex&&(child.lastIndex=parent.lastIndex);else if(clone.__isDate(parent))child=new Date(parent.getTime());else{if(useBuffer&&Buffer.isBuffer(parent))return child=Buffer.allocUnsafe?Buffer.allocUnsafe(parent.length):new Buffer(parent.length),parent.copy(child),child;_instanceof(parent,Error)?child=Object.create(parent):void 0===prototype?(proto=Object.getPrototypeOf(parent),child=Object.create(proto)):(child=Object.create(prototype),proto=prototype)}if(circular){var index=allParents.indexOf(parent);if(-1!=index)return allChildren[index];allParents.push(parent),allChildren.push(child)}for(var i in _instanceof(parent,nativeMap)&&parent.forEach((function(value,key){var keyChild=_clone(key,depth-1),valueChild=_clone(value,depth-1);child.set(keyChild,valueChild)})),_instanceof(parent,nativeSet)&&parent.forEach((function(value){var entryChild=_clone(value,depth-1);child.add(entryChild)})),parent){var attrs;proto&&(attrs=Object.getOwnPropertyDescriptor(proto,i)),attrs&&null==attrs.set||(child[i]=_clone(parent[i],depth-1))}if(Object.getOwnPropertySymbols)for(var symbols=Object.getOwnPropertySymbols(parent),i=0;i<symbols.length;i++){var symbol=symbols[i],descriptor;(!(descriptor=Object.getOwnPropertyDescriptor(parent,symbol))||descriptor.enumerable||includeNonEnumerable)&&(child[symbol]=_clone(parent[symbol],depth-1),descriptor.enumerable||Object.defineProperty(child,symbol,{enumerable:!1}))}if(includeNonEnumerable)for(var allPropertyNames=Object.getOwnPropertyNames(parent),i=0;i<allPropertyNames.length;i++){var propertyName=allPropertyNames[i],descriptor;(descriptor=Object.getOwnPropertyDescriptor(parent,propertyName))&&descriptor.enumerable||(child[propertyName]=_clone(parent[propertyName],depth-1),Object.defineProperty(child,propertyName,{enumerable:!1}))}return child}return void 0===circular&&(circular=!0),void 0===depth&&(depth=1/0),_clone(parent,depth)}function __objToStr(o){return Object.prototype.toString.call(o)}function __isDate(o){return"object"==typeof o&&"[object Date]"===__objToStr(o)}function __isArray(o){return"object"==typeof o&&"[object Array]"===__objToStr(o)}function __isRegExp(o){return"object"==typeof o&&"[object RegExp]"===__objToStr(o)}function __getRegExpFlags(re){var flags="";return re.global&&(flags+="g"),re.ignoreCase&&(flags+="i"),re.multiline&&(flags+="m"),flags}return clone.clonePrototype=function clonePrototype(parent){if(null===parent)return null;var c=function(){};return c.prototype=parent,new c},clone.__objToStr=__objToStr,clone.__isDate=__isDate,clone.__isArray=__isArray,clone.__isRegExp=__isRegExp,clone.__getRegExpFlags=__getRegExpFlags,clone}();"object"==typeof module&&module.exports&&(module.exports=clone)},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_emitter,_emitter2=_interopRequireDefault(__webpack_require__(8)),_block=__webpack_require__(4),_block2=_interopRequireDefault(_block),_break,_break2=_interopRequireDefault(__webpack_require__(16)),_code,_code2=_interopRequireDefault(__webpack_require__(13)),_container,_container2=_interopRequireDefault(__webpack_require__(25));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}function isLine(blot){return blot instanceof _block2.default||blot instanceof _block.BlockEmbed}var Scroll=function(_Parchment$Scroll){function Scroll(domNode,config){_classCallCheck(this,Scroll);var _this=_possibleConstructorReturn(this,(Scroll.__proto__||Object.getPrototypeOf(Scroll)).call(this,domNode));return _this.emitter=config.emitter,Array.isArray(config.whitelist)&&(_this.whitelist=config.whitelist.reduce((function(whitelist,format){return whitelist[format]=!0,whitelist}),{})),_this.domNode.addEventListener("DOMNodeInserted",(function(){})),_this.optimize(),_this.enable(),_this}return _inherits(Scroll,_Parchment$Scroll),_createClass(Scroll,[{key:"batchStart",value:function batchStart(){this.batch=!0}},{key:"batchEnd",value:function batchEnd(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function deleteAt(index,length){var _line=this.line(index),_line2=_slicedToArray(_line,2),first=_line2[0],offset=_line2[1],_line3=this.line(index+length),_line4,last=_slicedToArray(_line3,1)[0];if(_get(Scroll.prototype.__proto__||Object.getPrototypeOf(Scroll.prototype),"deleteAt",this).call(this,index,length),null!=last&&first!==last&&offset>0){if(first instanceof _block.BlockEmbed||last instanceof _block.BlockEmbed)return void this.optimize();if(first instanceof _code2.default){var newlineIndex=first.newlineIndex(first.length(),!0);if(newlineIndex>-1&&(first=first.split(newlineIndex+1))===last)return void this.optimize()}else if(last instanceof _code2.default){var _newlineIndex=last.newlineIndex(0);_newlineIndex>-1&&last.split(_newlineIndex+1)}var ref=last.children.head instanceof _break2.default?null:last.children.head;first.moveChildren(last,ref),first.remove()}this.optimize()}},{key:"enable",value:function enable(){var enabled=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",enabled)}},{key:"formatAt",value:function formatAt(index,length,format,value){(null==this.whitelist||this.whitelist[format])&&(_get(Scroll.prototype.__proto__||Object.getPrototypeOf(Scroll.prototype),"formatAt",this).call(this,index,length,format,value),this.optimize())}},{key:"insertAt",value:function insertAt(index,value,def){if(null==def||null==this.whitelist||this.whitelist[value]){if(index>=this.length())if(null==def||null==_parchment2.default.query(value,_parchment2.default.Scope.BLOCK)){var blot=_parchment2.default.create(this.statics.defaultChild);this.appendChild(blot),null==def&&value.endsWith("\n")&&(value=value.slice(0,-1)),blot.insertAt(0,value,def)}else{var embed=_parchment2.default.create(value,def);this.appendChild(embed)}else _get(Scroll.prototype.__proto__||Object.getPrototypeOf(Scroll.prototype),"insertAt",this).call(this,index,value,def);this.optimize()}}},{key:"insertBefore",value:function insertBefore(blot,ref){if(blot.statics.scope===_parchment2.default.Scope.INLINE_BLOT){var wrapper=_parchment2.default.create(this.statics.defaultChild);wrapper.appendChild(blot),blot=wrapper}_get(Scroll.prototype.__proto__||Object.getPrototypeOf(Scroll.prototype),"insertBefore",this).call(this,blot,ref)}},{key:"leaf",value:function leaf(index){return this.path(index).pop()||[null,-1]}},{key:"line",value:function line(index){return index===this.length()?this.line(index-1):this.descendant(isLine,index)}},{key:"lines",value:function lines(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,getLines=function getLines(blot,index,length){var lines=[],lengthLeft=length;return blot.children.forEachAt(index,length,(function(child,index,length){isLine(child)?lines.push(child):child instanceof _parchment2.default.Container&&(lines=lines.concat(getLines(child,index,lengthLeft))),lengthLeft-=length})),lines};return getLines(this,index,length)}},{key:"optimize",value:function optimize(){var mutations=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],context=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(_get(Scroll.prototype.__proto__||Object.getPrototypeOf(Scroll.prototype),"optimize",this).call(this,mutations,context),mutations.length>0&&this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE,mutations,context))}},{key:"path",value:function path(index){return _get(Scroll.prototype.__proto__||Object.getPrototypeOf(Scroll.prototype),"path",this).call(this,index).slice(1)}},{key:"update",value:function update(mutations){if(!0!==this.batch){var source=_emitter2.default.sources.USER;"string"==typeof mutations&&(source=mutations),Array.isArray(mutations)||(mutations=this.observer.takeRecords()),mutations.length>0&&this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE,source,mutations),_get(Scroll.prototype.__proto__||Object.getPrototypeOf(Scroll.prototype),"update",this).call(this,mutations.concat([])),mutations.length>0&&this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE,source,mutations)}}}]),Scroll}(_parchment2.default.Scroll);Scroll.blotName="scroll",Scroll.className="ql-editor",Scroll.tagName="DIV",Scroll.defaultChild="block",Scroll.allowedChildren=[_block2.default,_block.BlockEmbed,_container2.default],exports.default=Scroll},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SHORTKEY=exports.default=void 0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_clone,_clone2=_interopRequireDefault(__webpack_require__(21)),_deepEqual,_deepEqual2=_interopRequireDefault(__webpack_require__(11)),_extend,_extend2=_interopRequireDefault(__webpack_require__(3)),_quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_op,_op2=_interopRequireDefault(__webpack_require__(20)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_quill,_quill2=_interopRequireDefault(__webpack_require__(5)),_logger,_logger2=_interopRequireDefault(__webpack_require__(10)),_module,_module2=_interopRequireDefault(__webpack_require__(9));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var debug=(0,_logger2.default)("quill:keyboard"),SHORTKEY=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",Keyboard=function(_Module){function Keyboard(quill,options){_classCallCheck(this,Keyboard);var _this=_possibleConstructorReturn(this,(Keyboard.__proto__||Object.getPrototypeOf(Keyboard)).call(this,quill,options));return _this.bindings={},Object.keys(_this.options.bindings).forEach((function(name){("list autofill"!==name||null==quill.scroll.whitelist||quill.scroll.whitelist.list)&&_this.options.bindings[name]&&_this.addBinding(_this.options.bindings[name])})),_this.addBinding({key:Keyboard.keys.ENTER,shiftKey:null},handleEnter),_this.addBinding({key:Keyboard.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},(function(){})),/Firefox/i.test(navigator.userAgent)?(_this.addBinding({key:Keyboard.keys.BACKSPACE},{collapsed:!0},handleBackspace),_this.addBinding({key:Keyboard.keys.DELETE},{collapsed:!0},handleDelete)):(_this.addBinding({key:Keyboard.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},handleBackspace),_this.addBinding({key:Keyboard.keys.DELETE},{collapsed:!0,suffix:/^.?$/},handleDelete)),_this.addBinding({key:Keyboard.keys.BACKSPACE},{collapsed:!1},handleDeleteRange),_this.addBinding({key:Keyboard.keys.DELETE},{collapsed:!1},handleDeleteRange),_this.addBinding({key:Keyboard.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},handleBackspace),_this.listen(),_this}return _inherits(Keyboard,_Module),_createClass(Keyboard,null,[{key:"match",value:function match(evt,binding){return binding=normalize(binding),!["altKey","ctrlKey","metaKey","shiftKey"].some((function(key){return!!binding[key]!==evt[key]&&null!==binding[key]}))&&binding.key===(evt.which||evt.keyCode)}}]),_createClass(Keyboard,[{key:"addBinding",value:function addBinding(key){var context=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},handler=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},binding=normalize(key);if(null==binding||null==binding.key)return debug.warn("Attempted to add invalid keyboard binding",binding);"function"==typeof context&&(context={handler:context}),"function"==typeof handler&&(handler={handler:handler}),binding=(0,_extend2.default)(binding,context,handler),this.bindings[binding.key]=this.bindings[binding.key]||[],this.bindings[binding.key].push(binding)}},{key:"listen",value:function listen(){var _this2=this;this.quill.root.addEventListener("keydown",(function(evt){if(!evt.defaultPrevented){var which=evt.which||evt.keyCode,bindings=(_this2.bindings[which]||[]).filter((function(binding){return Keyboard.match(evt,binding)}));if(0!==bindings.length){var range=_this2.quill.getSelection();if(null!=range&&_this2.quill.hasFocus()){var _quill$getLine=_this2.quill.getLine(range.index),_quill$getLine2=_slicedToArray(_quill$getLine,2),line=_quill$getLine2[0],offset=_quill$getLine2[1],_quill$getLeaf=_this2.quill.getLeaf(range.index),_quill$getLeaf2=_slicedToArray(_quill$getLeaf,2),leafStart=_quill$getLeaf2[0],offsetStart=_quill$getLeaf2[1],_ref=0===range.length?[leafStart,offsetStart]:_this2.quill.getLeaf(range.index+range.length),_ref2=_slicedToArray(_ref,2),leafEnd=_ref2[0],offsetEnd=_ref2[1],prefixText=leafStart instanceof _parchment2.default.Text?leafStart.value().slice(0,offsetStart):"",suffixText=leafEnd instanceof _parchment2.default.Text?leafEnd.value().slice(offsetEnd):"",curContext={collapsed:0===range.length,empty:0===range.length&&line.length()<=1,format:_this2.quill.getFormat(range),offset:offset,prefix:prefixText,suffix:suffixText},prevented;bindings.some((function(binding){if(null!=binding.collapsed&&binding.collapsed!==curContext.collapsed)return!1;if(null!=binding.empty&&binding.empty!==curContext.empty)return!1;if(null!=binding.offset&&binding.offset!==curContext.offset)return!1;if(Array.isArray(binding.format)){if(binding.format.every((function(name){return null==curContext.format[name]})))return!1}else if("object"===_typeof(binding.format)&&!Object.keys(binding.format).every((function(name){return!0===binding.format[name]?null!=curContext.format[name]:!1===binding.format[name]?null==curContext.format[name]:(0,_deepEqual2.default)(binding.format[name],curContext.format[name])})))return!1;return!(null!=binding.prefix&&!binding.prefix.test(curContext.prefix))&&(!(null!=binding.suffix&&!binding.suffix.test(curContext.suffix))&&!0!==binding.handler.call(_this2,range,curContext))}))&&evt.preventDefault()}}}}))}}]),Keyboard}(_module2.default);function makeEmbedArrowHandler(key,shiftKey){var _ref3,where=key===Keyboard.keys.LEFT?"prefix":"suffix";return _defineProperty(_ref3={key:key,shiftKey:shiftKey,altKey:null},where,/^$/),_defineProperty(_ref3,"handler",(function handler(range){var index=range.index;key===Keyboard.keys.RIGHT&&(index+=range.length+1);var _quill$getLeaf3=this.quill.getLeaf(index),_quill$getLeaf4,leaf;return!(_slicedToArray(_quill$getLeaf3,1)[0]instanceof _parchment2.default.Embed)||(key===Keyboard.keys.LEFT?shiftKey?this.quill.setSelection(range.index-1,range.length+1,_quill2.default.sources.USER):this.quill.setSelection(range.index-1,_quill2.default.sources.USER):shiftKey?this.quill.setSelection(range.index,range.length+1,_quill2.default.sources.USER):this.quill.setSelection(range.index+range.length+1,_quill2.default.sources.USER),!1)})),_ref3}function handleBackspace(range,context){if(!(0===range.index||this.quill.getLength()<=1)){var _quill$getLine11=this.quill.getLine(range.index),_quill$getLine12,line=_slicedToArray(_quill$getLine11,1)[0],formats={};if(0===context.offset){var _quill$getLine13=this.quill.getLine(range.index-1),_quill$getLine14,prev=_slicedToArray(_quill$getLine13,1)[0];if(null!=prev&&prev.length()>1){var curFormats=line.formats(),prevFormats=this.quill.getFormat(range.index-1,1);formats=_op2.default.attributes.diff(curFormats,prevFormats)||{}}}var length=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix)?2:1;this.quill.deleteText(range.index-length,length,_quill2.default.sources.USER),Object.keys(formats).length>0&&this.quill.formatLine(range.index-length,length,formats,_quill2.default.sources.USER),this.quill.focus()}}function handleDelete(range,context){var length=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix)?2:1;if(!(range.index>=this.quill.getLength()-length)){var formats={},nextLength=0,_quill$getLine15=this.quill.getLine(range.index),_quill$getLine16,line=_slicedToArray(_quill$getLine15,1)[0];if(context.offset>=line.length()-1){var _quill$getLine17=this.quill.getLine(range.index+1),_quill$getLine18,next=_slicedToArray(_quill$getLine17,1)[0];if(next){var curFormats=line.formats(),nextFormats=this.quill.getFormat(range.index,1);formats=_op2.default.attributes.diff(curFormats,nextFormats)||{},nextLength=next.length()}}this.quill.deleteText(range.index,length,_quill2.default.sources.USER),Object.keys(formats).length>0&&this.quill.formatLine(range.index+nextLength-1,length,formats,_quill2.default.sources.USER)}}function handleDeleteRange(range){var lines=this.quill.getLines(range),formats={};if(lines.length>1){var firstFormats=lines[0].formats(),lastFormats=lines[lines.length-1].formats();formats=_op2.default.attributes.diff(lastFormats,firstFormats)||{}}this.quill.deleteText(range,_quill2.default.sources.USER),Object.keys(formats).length>0&&this.quill.formatLine(range.index,1,formats,_quill2.default.sources.USER),this.quill.setSelection(range.index,_quill2.default.sources.SILENT),this.quill.focus()}function handleEnter(range,context){var _this3=this;range.length>0&&this.quill.scroll.deleteAt(range.index,range.length);var lineFormats=Object.keys(context.format).reduce((function(lineFormats,format){return _parchment2.default.query(format,_parchment2.default.Scope.BLOCK)&&!Array.isArray(context.format[format])&&(lineFormats[format]=context.format[format]),lineFormats}),{});this.quill.insertText(range.index,"\n",lineFormats,_quill2.default.sources.USER),this.quill.setSelection(range.index+1,_quill2.default.sources.SILENT),this.quill.focus(),Object.keys(context.format).forEach((function(name){null==lineFormats[name]&&(Array.isArray(context.format[name])||"link"!==name&&_this3.quill.format(name,context.format[name],_quill2.default.sources.USER))}))}function makeCodeBlockHandler(indent){return{key:Keyboard.keys.TAB,shiftKey:!indent,format:{"code-block":!0},handler:function handler(range){var CodeBlock=_parchment2.default.query("code-block"),index=range.index,length=range.length,_quill$scroll$descend=this.quill.scroll.descendant(CodeBlock,index),_quill$scroll$descend2=_slicedToArray(_quill$scroll$descend,2),block=_quill$scroll$descend2[0],offset=_quill$scroll$descend2[1];if(null!=block){var scrollIndex=this.quill.getIndex(block),start=block.newlineIndex(offset,!0)+1,end=block.newlineIndex(scrollIndex+offset+length),lines=block.domNode.textContent.slice(start,end).split("\n");offset=0,lines.forEach((function(line,i){indent?(block.insertAt(start+offset,CodeBlock.TAB),offset+=CodeBlock.TAB.length,0===i?index+=CodeBlock.TAB.length:length+=CodeBlock.TAB.length):line.startsWith(CodeBlock.TAB)&&(block.deleteAt(start+offset,CodeBlock.TAB.length),offset-=CodeBlock.TAB.length,0===i?index-=CodeBlock.TAB.length:length-=CodeBlock.TAB.length),offset+=line.length+1})),this.quill.update(_quill2.default.sources.USER),this.quill.setSelection(index,length,_quill2.default.sources.SILENT)}}}}function makeFormatHandler(format){return{key:format[0].toUpperCase(),shortKey:!0,handler:function handler(range,context){this.quill.format(format,!context.format[format],_quill2.default.sources.USER)}}}function normalize(binding){if("string"==typeof binding||"number"==typeof binding)return normalize({key:binding});if("object"===(void 0===binding?"undefined":_typeof(binding))&&(binding=(0,_clone2.default)(binding,!1)),"string"==typeof binding.key)if(null!=Keyboard.keys[binding.key.toUpperCase()])binding.key=Keyboard.keys[binding.key.toUpperCase()];else{if(1!==binding.key.length)return null;binding.key=binding.key.toUpperCase().charCodeAt(0)}return binding.shortKey&&(binding[SHORTKEY]=binding.shortKey,delete binding.shortKey),binding}Keyboard.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},Keyboard.DEFAULTS={bindings:{bold:makeFormatHandler("bold"),italic:makeFormatHandler("italic"),underline:makeFormatHandler("underline"),indent:{key:Keyboard.keys.TAB,format:["blockquote","indent","list"],handler:function handler(range,context){if(context.collapsed&&0!==context.offset)return!0;this.quill.format("indent","+1",_quill2.default.sources.USER)}},outdent:{key:Keyboard.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function handler(range,context){if(context.collapsed&&0!==context.offset)return!0;this.quill.format("indent","-1",_quill2.default.sources.USER)}},"outdent backspace":{key:Keyboard.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function handler(range,context){null!=context.format.indent?this.quill.format("indent","-1",_quill2.default.sources.USER):null!=context.format.list&&this.quill.format("list",!1,_quill2.default.sources.USER)}},"indent code-block":makeCodeBlockHandler(!0),"outdent code-block":makeCodeBlockHandler(!1),"remove tab":{key:Keyboard.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function handler(range){this.quill.deleteText(range.index-1,1,_quill2.default.sources.USER)}},tab:{key:Keyboard.keys.TAB,handler:function handler(range){this.quill.history.cutoff();var delta=(new _quillDelta2.default).retain(range.index).delete(range.length).insert("\t");this.quill.updateContents(delta,_quill2.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(range.index+1,_quill2.default.sources.SILENT)}},"list empty enter":{key:Keyboard.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function handler(range,context){this.quill.format("list",!1,_quill2.default.sources.USER),context.format.indent&&this.quill.format("indent",!1,_quill2.default.sources.USER)}},"checklist enter":{key:Keyboard.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function handler(range){var _quill$getLine3=this.quill.getLine(range.index),_quill$getLine4=_slicedToArray(_quill$getLine3,2),line=_quill$getLine4[0],offset=_quill$getLine4[1],formats=(0,_extend2.default)({},line.formats(),{list:"checked"}),delta=(new _quillDelta2.default).retain(range.index).insert("\n",formats).retain(line.length()-offset-1).retain(1,{list:"unchecked"});this.quill.updateContents(delta,_quill2.default.sources.USER),this.quill.setSelection(range.index+1,_quill2.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:Keyboard.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function handler(range,context){var _quill$getLine5=this.quill.getLine(range.index),_quill$getLine6=_slicedToArray(_quill$getLine5,2),line=_quill$getLine6[0],offset=_quill$getLine6[1],delta=(new _quillDelta2.default).retain(range.index).insert("\n",context.format).retain(line.length()-offset-1).retain(1,{header:null});this.quill.updateContents(delta,_quill2.default.sources.USER),this.quill.setSelection(range.index+1,_quill2.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function handler(range,context){var length=context.prefix.length,_quill$getLine7=this.quill.getLine(range.index),_quill$getLine8=_slicedToArray(_quill$getLine7,2),line=_quill$getLine8[0],offset=_quill$getLine8[1];if(offset>length)return!0;var value=void 0;switch(context.prefix.trim()){case"[]":case"[ ]":value="unchecked";break;case"[x]":value="checked";break;case"-":case"*":value="bullet";break;default:value="ordered"}this.quill.insertText(range.index," ",_quill2.default.sources.USER),this.quill.history.cutoff();var delta=(new _quillDelta2.default).retain(range.index-offset).delete(length+1).retain(line.length()-2-offset).retain(1,{list:value});this.quill.updateContents(delta,_quill2.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(range.index-length,_quill2.default.sources.SILENT)}},"code exit":{key:Keyboard.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function handler(range){var _quill$getLine9=this.quill.getLine(range.index),_quill$getLine10=_slicedToArray(_quill$getLine9,2),line=_quill$getLine10[0],offset=_quill$getLine10[1],delta=(new _quillDelta2.default).retain(range.index+line.length()-offset-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(delta,_quill2.default.sources.USER)}},"embed left":makeEmbedArrowHandler(Keyboard.keys.LEFT,!1),"embed left shift":makeEmbedArrowHandler(Keyboard.keys.LEFT,!0),"embed right":makeEmbedArrowHandler(Keyboard.keys.RIGHT,!1),"embed right shift":makeEmbedArrowHandler(Keyboard.keys.RIGHT,!0)}},exports.default=Keyboard,exports.SHORTKEY=SHORTKEY},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_text,_text2=_interopRequireDefault(__webpack_require__(7));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Cursor=function(_Parchment$Embed){function Cursor(domNode,selection){_classCallCheck(this,Cursor);var _this=_possibleConstructorReturn(this,(Cursor.__proto__||Object.getPrototypeOf(Cursor)).call(this,domNode));return _this.selection=selection,_this.textNode=document.createTextNode(Cursor.CONTENTS),_this.domNode.appendChild(_this.textNode),_this._length=0,_this}return _inherits(Cursor,_Parchment$Embed),_createClass(Cursor,null,[{key:"value",value:function value(){}}]),_createClass(Cursor,[{key:"detach",value:function detach(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function format(name,value){if(0!==this._length)return _get(Cursor.prototype.__proto__||Object.getPrototypeOf(Cursor.prototype),"format",this).call(this,name,value);for(var target=this,index=0;null!=target&&target.statics.scope!==_parchment2.default.Scope.BLOCK_BLOT;)index+=target.offset(target.parent),target=target.parent;null!=target&&(this._length=Cursor.CONTENTS.length,target.optimize(),target.formatAt(index,Cursor.CONTENTS.length,name,value),this._length=0)}},{key:"index",value:function index(node,offset){return node===this.textNode?0:_get(Cursor.prototype.__proto__||Object.getPrototypeOf(Cursor.prototype),"index",this).call(this,node,offset)}},{key:"length",value:function length(){return this._length}},{key:"position",value:function position(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function remove(){_get(Cursor.prototype.__proto__||Object.getPrototypeOf(Cursor.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function restore(){if(!this.selection.composing&&null!=this.parent){var textNode=this.textNode,range=this.selection.getNativeRange(),restoreText=void 0,start=void 0,end=void 0;if(null!=range&&range.start.node===textNode&&range.end.node===textNode){var _ref=[textNode,range.start.offset,range.end.offset];restoreText=_ref[0],start=_ref[1],end=_ref[2]}for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==Cursor.CONTENTS){var text=this.textNode.data.split(Cursor.CONTENTS).join("");this.next instanceof _text2.default?(restoreText=this.next.domNode,this.next.insertAt(0,text),this.textNode.data=Cursor.CONTENTS):(this.textNode.data=text,this.parent.insertBefore(_parchment2.default.create(this.textNode),this),this.textNode=document.createTextNode(Cursor.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),null!=start){var _map=[start,end].map((function(offset){return Math.max(0,Math.min(restoreText.data.length,offset-1))})),_map2=_slicedToArray(_map,2);return start=_map2[0],end=_map2[1],{startNode:restoreText,startOffset:start,endNode:restoreText,endOffset:end}}}}},{key:"update",value:function update(mutations,context){var _this2=this;if(mutations.some((function(mutation){return"characterData"===mutation.type&&mutation.target===_this2.textNode}))){var range=this.restore();range&&(context.range=range)}}},{key:"value",value:function value(){return""}}]),Cursor}(_parchment2.default.Embed);Cursor.blotName="cursor",Cursor.className="ql-cursor",Cursor.tagName="span",Cursor.CONTENTS="\ufeff",exports.default=Cursor},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_block=__webpack_require__(4),_block2=_interopRequireDefault(_block);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Container=function(_Parchment$Container){function Container(){return _classCallCheck(this,Container),_possibleConstructorReturn(this,(Container.__proto__||Object.getPrototypeOf(Container)).apply(this,arguments))}return _inherits(Container,_Parchment$Container),Container}(_parchment2.default.Container);Container.allowedChildren=[_block2.default,_block.BlockEmbed,Container],exports.default=Container},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ColorStyle=exports.ColorClass=exports.ColorAttributor=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var ColorAttributor=function(_Parchment$Attributor){function ColorAttributor(){return _classCallCheck(this,ColorAttributor),_possibleConstructorReturn(this,(ColorAttributor.__proto__||Object.getPrototypeOf(ColorAttributor)).apply(this,arguments))}return _inherits(ColorAttributor,_Parchment$Attributor),_createClass(ColorAttributor,[{key:"value",value:function value(domNode){var value=_get(ColorAttributor.prototype.__proto__||Object.getPrototypeOf(ColorAttributor.prototype),"value",this).call(this,domNode);return value.startsWith("rgb(")?(value=value.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+value.split(",").map((function(component){return("00"+parseInt(component).toString(16)).slice(-2)})).join("")):value}}]),ColorAttributor}(_parchment2.default.Attributor.Style),ColorClass=new _parchment2.default.Attributor.Class("color","ql-color",{scope:_parchment2.default.Scope.INLINE}),ColorStyle=new ColorAttributor("color","color",{scope:_parchment2.default.Scope.INLINE});exports.ColorAttributor=ColorAttributor,exports.ColorClass=ColorClass,exports.ColorStyle=ColorStyle},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sanitize=exports.default=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_inline,_inline2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Link=function(_Inline){function Link(){return _classCallCheck(this,Link),_possibleConstructorReturn(this,(Link.__proto__||Object.getPrototypeOf(Link)).apply(this,arguments))}return _inherits(Link,_Inline),_createClass(Link,[{key:"format",value:function format(name,value){if(name!==this.statics.blotName||!value)return _get(Link.prototype.__proto__||Object.getPrototypeOf(Link.prototype),"format",this).call(this,name,value);value=this.constructor.sanitize(value),this.domNode.setAttribute("href",value)}}],[{key:"create",value:function create(value){var node=_get(Link.__proto__||Object.getPrototypeOf(Link),"create",this).call(this,value);return value=this.sanitize(value),node.setAttribute("href",value),node.setAttribute("rel","noopener noreferrer"),node.setAttribute("target","_blank"),node}},{key:"formats",value:function formats(domNode){return domNode.getAttribute("href")}},{key:"sanitize",value:function sanitize(url){return _sanitize(url,this.PROTOCOL_WHITELIST)?url:this.SANITIZED_URL}}]),Link}(_interopRequireDefault(__webpack_require__(6)).default);function _sanitize(url,protocols){var anchor=document.createElement("a");anchor.href=url;var protocol=anchor.href.slice(0,anchor.href.indexOf(":"));return protocols.indexOf(protocol)>-1}Link.blotName="link",Link.tagName="A",Link.SANITIZED_URL="about:blank",Link.PROTOCOL_WHITELIST=["http","https","mailto","tel"],exports.default=Link,exports.sanitize=_sanitize},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_keyboard,_keyboard2=_interopRequireDefault(__webpack_require__(23)),_dropdown,_dropdown2=_interopRequireDefault(__webpack_require__(107));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var optionsCounter=0;function toggleAriaAttribute(element,attribute){element.setAttribute(attribute,!("true"===element.getAttribute(attribute)))}var Picker=function(){function Picker(select){var _this=this;_classCallCheck(this,Picker),this.select=select,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(function(){_this.togglePicker()})),this.label.addEventListener("keydown",(function(event){switch(event.keyCode){case _keyboard2.default.keys.ENTER:_this.togglePicker();break;case _keyboard2.default.keys.ESCAPE:_this.escape(),event.preventDefault()}})),this.select.addEventListener("change",this.update.bind(this))}return _createClass(Picker,[{key:"togglePicker",value:function togglePicker(){this.container.classList.toggle("ql-expanded"),toggleAriaAttribute(this.label,"aria-expanded"),toggleAriaAttribute(this.options,"aria-hidden")}},{key:"buildItem",value:function buildItem(option){var _this2=this,item=document.createElement("span");return item.tabIndex="0",item.setAttribute("role","button"),item.classList.add("ql-picker-item"),option.hasAttribute("value")&&item.setAttribute("data-value",option.getAttribute("value")),option.textContent&&item.setAttribute("data-label",option.textContent),item.addEventListener("click",(function(){_this2.selectItem(item,!0)})),item.addEventListener("keydown",(function(event){switch(event.keyCode){case _keyboard2.default.keys.ENTER:_this2.selectItem(item,!0),event.preventDefault();break;case _keyboard2.default.keys.ESCAPE:_this2.escape(),event.preventDefault()}})),item}},{key:"buildLabel",value:function buildLabel(){var label=document.createElement("span");return label.classList.add("ql-picker-label"),label.innerHTML=_dropdown2.default,label.tabIndex="0",label.setAttribute("role","button"),label.setAttribute("aria-expanded","false"),this.container.appendChild(label),label}},{key:"buildOptions",value:function buildOptions(){var _this3=this,options=document.createElement("span");options.classList.add("ql-picker-options"),options.setAttribute("aria-hidden","true"),options.tabIndex="-1",options.id="ql-picker-options-"+optionsCounter,optionsCounter+=1,this.label.setAttribute("aria-controls",options.id),this.options=options,[].slice.call(this.select.options).forEach((function(option){var item=_this3.buildItem(option);options.appendChild(item),!0===option.selected&&_this3.selectItem(item)})),this.container.appendChild(options)}},{key:"buildPicker",value:function buildPicker(){var _this4=this;[].slice.call(this.select.attributes).forEach((function(item){_this4.container.setAttribute(item.name,item.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function escape(){var _this5=this;this.close(),setTimeout((function(){return _this5.label.focus()}),1)}},{key:"close",value:function close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function selectItem(item){var trigger=arguments.length>1&&void 0!==arguments[1]&&arguments[1],selected=this.container.querySelector(".ql-selected");if(item!==selected&&(null!=selected&&selected.classList.remove("ql-selected"),null!=item&&(item.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(item.parentNode.children,item),item.hasAttribute("data-value")?this.label.setAttribute("data-value",item.getAttribute("data-value")):this.label.removeAttribute("data-value"),item.hasAttribute("data-label")?this.label.setAttribute("data-label",item.getAttribute("data-label")):this.label.removeAttribute("data-label"),trigger))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":_typeof(Event))){var event=document.createEvent("Event");event.initEvent("change",!0,!0),this.select.dispatchEvent(event)}this.close()}}},{key:"update",value:function update(){var option=void 0;if(this.select.selectedIndex>-1){var item=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];option=this.select.options[this.select.selectedIndex],this.selectItem(item)}else this.selectItem(null);var isActive=null!=option&&option!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",isActive)}}]),Picker}();exports.default=Picker},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_quill,_quill2=_interopRequireDefault(__webpack_require__(5)),_block=__webpack_require__(4),_block2=_interopRequireDefault(_block),_break,_break2=_interopRequireDefault(__webpack_require__(16)),_container,_container2=_interopRequireDefault(__webpack_require__(25)),_cursor,_cursor2=_interopRequireDefault(__webpack_require__(24)),_embed,_embed2=_interopRequireDefault(__webpack_require__(35)),_inline,_inline2=_interopRequireDefault(__webpack_require__(6)),_scroll,_scroll2=_interopRequireDefault(__webpack_require__(22)),_text,_text2=_interopRequireDefault(__webpack_require__(7)),_clipboard,_clipboard2=_interopRequireDefault(__webpack_require__(55)),_history,_history2=_interopRequireDefault(__webpack_require__(42)),_keyboard,_keyboard2=_interopRequireDefault(__webpack_require__(23));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_quill2.default.register({"blots/block":_block2.default,"blots/block/embed":_block.BlockEmbed,"blots/break":_break2.default,"blots/container":_container2.default,"blots/cursor":_cursor2.default,"blots/embed":_embed2.default,"blots/inline":_inline2.default,"blots/scroll":_scroll2.default,"blots/text":_text2.default,"modules/clipboard":_clipboard2.default,"modules/history":_history2.default,"modules/keyboard":_keyboard2.default}),_parchment2.default.register(_block2.default,_break2.default,_cursor2.default,_inline2.default,_scroll2.default,_text2.default),exports.default=_quill2.default},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Registry=__webpack_require__(1),ShadowBlot=function(){function ShadowBlot(domNode){this.domNode=domNode,this.domNode[Registry.DATA_KEY]={blot:this}}return Object.defineProperty(ShadowBlot.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),ShadowBlot.create=function(value){if(null==this.tagName)throw new Registry.ParchmentError("Blot definition missing tagName");var node;return Array.isArray(this.tagName)?("string"==typeof value&&(value=value.toUpperCase(),parseInt(value).toString()===value&&(value=parseInt(value))),node="number"==typeof value?document.createElement(this.tagName[value-1]):this.tagName.indexOf(value)>-1?document.createElement(value):document.createElement(this.tagName[0])):node=document.createElement(this.tagName),this.className&&node.classList.add(this.className),node},ShadowBlot.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},ShadowBlot.prototype.clone=function(){var domNode=this.domNode.cloneNode(!1);return Registry.create(domNode)},ShadowBlot.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[Registry.DATA_KEY]},ShadowBlot.prototype.deleteAt=function(index,length){var blot;this.isolate(index,length).remove()},ShadowBlot.prototype.formatAt=function(index,length,name,value){var blot=this.isolate(index,length);if(null!=Registry.query(name,Registry.Scope.BLOT)&&value)blot.wrap(name,value);else if(null!=Registry.query(name,Registry.Scope.ATTRIBUTE)){var parent=Registry.create(this.statics.scope);blot.wrap(parent),parent.format(name,value)}},ShadowBlot.prototype.insertAt=function(index,value,def){var blot=null==def?Registry.create("text",value):Registry.create(value,def),ref=this.split(index);this.parent.insertBefore(blot,ref)},ShadowBlot.prototype.insertInto=function(parentBlot,refBlot){void 0===refBlot&&(refBlot=null),null!=this.parent&&this.parent.children.remove(this);var refDomNode=null;parentBlot.children.insertBefore(this,refBlot),null!=refBlot&&(refDomNode=refBlot.domNode),this.domNode.parentNode==parentBlot.domNode&&this.domNode.nextSibling==refDomNode||parentBlot.domNode.insertBefore(this.domNode,refDomNode),this.parent=parentBlot,this.attach()},ShadowBlot.prototype.isolate=function(index,length){var target=this.split(index);return target.split(length),target},ShadowBlot.prototype.length=function(){return 1},ShadowBlot.prototype.offset=function(root){return void 0===root&&(root=this.parent),null==this.parent||this==root?0:this.parent.children.offset(this)+this.parent.offset(root)},ShadowBlot.prototype.optimize=function(context){null!=this.domNode[Registry.DATA_KEY]&&delete this.domNode[Registry.DATA_KEY].mutations},ShadowBlot.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},ShadowBlot.prototype.replace=function(target){null!=target.parent&&(target.parent.insertBefore(this,target.next),target.remove())},ShadowBlot.prototype.replaceWith=function(name,value){var replacement="string"==typeof name?Registry.create(name,value):name;return replacement.replace(this),replacement},ShadowBlot.prototype.split=function(index,force){return 0===index?this:this.next},ShadowBlot.prototype.update=function(mutations,context){},ShadowBlot.prototype.wrap=function(name,value){var wrapper="string"==typeof name?Registry.create(name,value):name;return null!=this.parent&&this.parent.insertBefore(wrapper,this.next),wrapper.appendChild(this),wrapper},ShadowBlot.blotName="abstract",ShadowBlot}();exports.default=ShadowBlot},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var attributor_1=__webpack_require__(12),class_1=__webpack_require__(32),style_1=__webpack_require__(33),Registry=__webpack_require__(1),AttributorStore=function(){function AttributorStore(domNode){this.attributes={},this.domNode=domNode,this.build()}return AttributorStore.prototype.attribute=function(attribute,value){value?attribute.add(this.domNode,value)&&(null!=attribute.value(this.domNode)?this.attributes[attribute.attrName]=attribute:delete this.attributes[attribute.attrName]):(attribute.remove(this.domNode),delete this.attributes[attribute.attrName])},AttributorStore.prototype.build=function(){var _this=this;this.attributes={};var attributes=attributor_1.default.keys(this.domNode),classes=class_1.default.keys(this.domNode),styles=style_1.default.keys(this.domNode);attributes.concat(classes).concat(styles).forEach((function(name){var attr=Registry.query(name,Registry.Scope.ATTRIBUTE);attr instanceof attributor_1.default&&(_this.attributes[attr.attrName]=attr)}))},AttributorStore.prototype.copy=function(target){var _this=this;Object.keys(this.attributes).forEach((function(key){var value=_this.attributes[key].value(_this.domNode);target.format(key,value)}))},AttributorStore.prototype.move=function(target){var _this=this;this.copy(target),Object.keys(this.attributes).forEach((function(key){_this.attributes[key].remove(_this.domNode)})),this.attributes={}},AttributorStore.prototype.values=function(){var _this=this;return Object.keys(this.attributes).reduce((function(attributes,name){return attributes[name]=_this.attributes[name].value(_this.domNode),attributes}),{})},AttributorStore}();exports.default=AttributorStore},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics,attributor_1;function match(node,prefix){var className;return(node.getAttribute("class")||"").split(/\s+/).filter((function(name){return 0===name.indexOf(prefix+"-")}))}Object.defineProperty(exports,"__esModule",{value:!0});var ClassAttributor=function(_super){function ClassAttributor(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ClassAttributor,_super),ClassAttributor.keys=function(node){return(node.getAttribute("class")||"").split(/\s+/).map((function(name){return name.split("-").slice(0,-1).join("-")}))},ClassAttributor.prototype.add=function(node,value){return!!this.canAdd(node,value)&&(this.remove(node),node.classList.add(this.keyName+"-"+value),!0)},ClassAttributor.prototype.remove=function(node){var matches;match(node,this.keyName).forEach((function(name){node.classList.remove(name)})),0===node.classList.length&&node.removeAttribute("class")},ClassAttributor.prototype.value=function(node){var result,value=(match(node,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(node,value)?value:""},ClassAttributor}(__webpack_require__(12).default);exports.default=ClassAttributor},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics,attributor_1;function camelize(name){var parts=name.split("-"),rest=parts.slice(1).map((function(part){return part[0].toUpperCase()+part.slice(1)})).join("");return parts[0]+rest}Object.defineProperty(exports,"__esModule",{value:!0});var StyleAttributor=function(_super){function StyleAttributor(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(StyleAttributor,_super),StyleAttributor.keys=function(node){return(node.getAttribute("style")||"").split(";").map((function(value){var arr;return value.split(":")[0].trim()}))},StyleAttributor.prototype.add=function(node,value){return!!this.canAdd(node,value)&&(node.style[camelize(this.keyName)]=value,!0)},StyleAttributor.prototype.remove=function(node){node.style[camelize(this.keyName)]="",node.getAttribute("style")||node.removeAttribute("style")},StyleAttributor.prototype.value=function(node){var value=node.style[camelize(this.keyName)];return this.canAdd(node,value)?value:""},StyleAttributor}(__webpack_require__(12).default);exports.default=StyleAttributor},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Theme=function(){function Theme(quill,options){_classCallCheck(this,Theme),this.quill=quill,this.options=options,this.modules={}}return _createClass(Theme,[{key:"init",value:function init(){var _this=this;Object.keys(this.options.modules).forEach((function(name){null==_this.modules[name]&&_this.addModule(name)}))}},{key:"addModule",value:function addModule(name){var moduleClass=this.quill.constructor.import("modules/"+name);return this.modules[name]=new moduleClass(this.quill,this.options.modules[name]||{}),this.modules[name]}}]),Theme}();Theme.DEFAULTS={modules:{}},Theme.themes={default:Theme},exports.default=Theme},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_text,_text2=_interopRequireDefault(__webpack_require__(7));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var GUARD_TEXT="\ufeff",Embed=function(_Parchment$Embed){function Embed(node){_classCallCheck(this,Embed);var _this=_possibleConstructorReturn(this,(Embed.__proto__||Object.getPrototypeOf(Embed)).call(this,node));return _this.contentNode=document.createElement("span"),_this.contentNode.setAttribute("contenteditable",!1),[].slice.call(_this.domNode.childNodes).forEach((function(childNode){_this.contentNode.appendChild(childNode)})),_this.leftGuard=document.createTextNode("\ufeff"),_this.rightGuard=document.createTextNode("\ufeff"),_this.domNode.appendChild(_this.leftGuard),_this.domNode.appendChild(_this.contentNode),_this.domNode.appendChild(_this.rightGuard),_this}return _inherits(Embed,_Parchment$Embed),_createClass(Embed,[{key:"index",value:function index(node,offset){return node===this.leftGuard?0:node===this.rightGuard?1:_get(Embed.prototype.__proto__||Object.getPrototypeOf(Embed.prototype),"index",this).call(this,node,offset)}},{key:"restore",value:function restore(node){var range=void 0,textNode=void 0,text=node.data.split("\ufeff").join("");if(node===this.leftGuard)if(this.prev instanceof _text2.default){var prevLength=this.prev.length();this.prev.insertAt(prevLength,text),range={startNode:this.prev.domNode,startOffset:prevLength+text.length}}else textNode=document.createTextNode(text),this.parent.insertBefore(_parchment2.default.create(textNode),this),range={startNode:textNode,startOffset:text.length};else node===this.rightGuard&&(this.next instanceof _text2.default?(this.next.insertAt(0,text),range={startNode:this.next.domNode,startOffset:text.length}):(textNode=document.createTextNode(text),this.parent.insertBefore(_parchment2.default.create(textNode),this.next),range={startNode:textNode,startOffset:text.length}));return node.data="\ufeff",range}},{key:"update",value:function update(mutations,context){var _this2=this;mutations.forEach((function(mutation){if("characterData"===mutation.type&&(mutation.target===_this2.leftGuard||mutation.target===_this2.rightGuard)){var range=_this2.restore(mutation.target);range&&(context.range=range)}}))}}]),Embed}(_parchment2.default.Embed);exports.default=Embed},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlignStyle=exports.AlignClass=exports.AlignAttribute=void 0;var _parchment,_parchment2=_interopRequireDefault(__webpack_require__(0));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var config={scope:_parchment2.default.Scope.BLOCK,whitelist:["right","center","justify"]},AlignAttribute=new _parchment2.default.Attributor.Attribute("align","align",config),AlignClass=new _parchment2.default.Attributor.Class("align","ql-align",config),AlignStyle=new _parchment2.default.Attributor.Style("align","text-align",config);exports.AlignAttribute=AlignAttribute,exports.AlignClass=AlignClass,exports.AlignStyle=AlignStyle},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BackgroundStyle=exports.BackgroundClass=void 0;var _parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_color=__webpack_require__(26);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var BackgroundClass=new _parchment2.default.Attributor.Class("background","ql-bg",{scope:_parchment2.default.Scope.INLINE}),BackgroundStyle=new _color.ColorAttributor("background","background-color",{scope:_parchment2.default.Scope.INLINE});exports.BackgroundClass=BackgroundClass,exports.BackgroundStyle=BackgroundStyle},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DirectionStyle=exports.DirectionClass=exports.DirectionAttribute=void 0;var _parchment,_parchment2=_interopRequireDefault(__webpack_require__(0));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var config={scope:_parchment2.default.Scope.BLOCK,whitelist:["rtl"]},DirectionAttribute=new _parchment2.default.Attributor.Attribute("direction","dir",config),DirectionClass=new _parchment2.default.Attributor.Class("direction","ql-direction",config),DirectionStyle=new _parchment2.default.Attributor.Style("direction","direction",config);exports.DirectionAttribute=DirectionAttribute,exports.DirectionClass=DirectionClass,exports.DirectionStyle=DirectionStyle},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FontClass=exports.FontStyle=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var config={scope:_parchment2.default.Scope.INLINE,whitelist:["serif","monospace"]},FontClass=new _parchment2.default.Attributor.Class("font","ql-font",config),FontStyleAttributor,FontStyle=new(function(_Parchment$Attributor){function FontStyleAttributor(){return _classCallCheck(this,FontStyleAttributor),_possibleConstructorReturn(this,(FontStyleAttributor.__proto__||Object.getPrototypeOf(FontStyleAttributor)).apply(this,arguments))}return _inherits(FontStyleAttributor,_Parchment$Attributor),_createClass(FontStyleAttributor,[{key:"value",value:function value(node){return _get(FontStyleAttributor.prototype.__proto__||Object.getPrototypeOf(FontStyleAttributor.prototype),"value",this).call(this,node).replace(/["']/g,"")}}]),FontStyleAttributor}(_parchment2.default.Attributor.Style))("font","font-family",config);exports.FontStyle=FontStyle,exports.FontClass=FontClass},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SizeStyle=exports.SizeClass=void 0;var _parchment,_parchment2=_interopRequireDefault(__webpack_require__(0));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var SizeClass=new _parchment2.default.Attributor.Class("size","ql-size",{scope:_parchment2.default.Scope.INLINE,whitelist:["small","large","huge"]}),SizeStyle=new _parchment2.default.Attributor.Style("size","font-size",{scope:_parchment2.default.Scope.INLINE,whitelist:["10px","18px","32px"]});exports.SizeClass=SizeClass,exports.SizeStyle=SizeStyle},function(module,exports,__webpack_require__){"use strict";module.exports={align:{"":__webpack_require__(76),center:__webpack_require__(77),right:__webpack_require__(78),justify:__webpack_require__(79)},background:__webpack_require__(80),blockquote:__webpack_require__(81),bold:__webpack_require__(82),clean:__webpack_require__(83),code:__webpack_require__(58),"code-block":__webpack_require__(58),color:__webpack_require__(84),direction:{"":__webpack_require__(85),rtl:__webpack_require__(86)},float:{center:__webpack_require__(87),full:__webpack_require__(88),left:__webpack_require__(89),right:__webpack_require__(90)},formula:__webpack_require__(91),header:{1:__webpack_require__(92),2:__webpack_require__(93)},italic:__webpack_require__(94),image:__webpack_require__(95),indent:{"+1":__webpack_require__(96),"-1":__webpack_require__(97)},link:__webpack_require__(98),list:{ordered:__webpack_require__(99),bullet:__webpack_require__(100),check:__webpack_require__(101)},script:{sub:__webpack_require__(102),super:__webpack_require__(103)},strike:__webpack_require__(104),underline:__webpack_require__(105),video:__webpack_require__(106)}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLastChangeIndex=exports.default=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_quill,_quill2=_interopRequireDefault(__webpack_require__(5)),_module,_module2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var History=function(_Module){function History(quill,options){_classCallCheck(this,History);var _this=_possibleConstructorReturn(this,(History.__proto__||Object.getPrototypeOf(History)).call(this,quill,options));return _this.lastRecorded=0,_this.ignoreChange=!1,_this.clear(),_this.quill.on(_quill2.default.events.EDITOR_CHANGE,(function(eventName,delta,oldDelta,source){eventName!==_quill2.default.events.TEXT_CHANGE||_this.ignoreChange||(_this.options.userOnly&&source!==_quill2.default.sources.USER?_this.transform(delta):_this.record(delta,oldDelta))})),_this.quill.keyboard.addBinding({key:"Z",shortKey:!0},_this.undo.bind(_this)),_this.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},_this.redo.bind(_this)),/Win/i.test(navigator.platform)&&_this.quill.keyboard.addBinding({key:"Y",shortKey:!0},_this.redo.bind(_this)),_this}return _inherits(History,_Module),_createClass(History,[{key:"change",value:function change(source,dest){if(0!==this.stack[source].length){var delta=this.stack[source].pop();this.stack[dest].push(delta),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(delta[source],_quill2.default.sources.USER),this.ignoreChange=!1;var index=getLastChangeIndex(delta[source]);this.quill.setSelection(index)}}},{key:"clear",value:function clear(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function cutoff(){this.lastRecorded=0}},{key:"record",value:function record(changeDelta,oldDelta){if(0!==changeDelta.ops.length){this.stack.redo=[];var undoDelta=this.quill.getContents().diff(oldDelta),timestamp=Date.now();if(this.lastRecorded+this.options.delay>timestamp&&this.stack.undo.length>0){var delta=this.stack.undo.pop();undoDelta=undoDelta.compose(delta.undo),changeDelta=delta.redo.compose(changeDelta)}else this.lastRecorded=timestamp;this.stack.undo.push({redo:changeDelta,undo:undoDelta}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function redo(){this.change("redo","undo")}},{key:"transform",value:function transform(delta){this.stack.undo.forEach((function(change){change.undo=delta.transform(change.undo,!0),change.redo=delta.transform(change.redo,!0)})),this.stack.redo.forEach((function(change){change.undo=delta.transform(change.undo,!0),change.redo=delta.transform(change.redo,!0)}))}},{key:"undo",value:function undo(){this.change("undo","redo")}}]),History}(_interopRequireDefault(__webpack_require__(9)).default);function endsWithNewlineChange(delta){var lastOp=delta.ops[delta.ops.length-1];return null!=lastOp&&(null!=lastOp.insert?"string"==typeof lastOp.insert&&lastOp.insert.endsWith("\n"):null!=lastOp.attributes&&Object.keys(lastOp.attributes).some((function(attr){return null!=_parchment2.default.query(attr,_parchment2.default.Scope.BLOCK)})))}function getLastChangeIndex(delta){var deleteLength=delta.reduce((function(length,op){return length+=op.delete||0}),0),changeIndex=delta.length()-deleteLength;return endsWithNewlineChange(delta)&&(changeIndex-=1),changeIndex}History.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},exports.default=History,exports.getLastChangeIndex=getLastChangeIndex},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.BaseTooltip=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_extend,_extend2=_interopRequireDefault(__webpack_require__(3)),_quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_emitter,_emitter2=_interopRequireDefault(__webpack_require__(8)),_keyboard,_keyboard2=_interopRequireDefault(__webpack_require__(23)),_theme,_theme2=_interopRequireDefault(__webpack_require__(34)),_colorPicker,_colorPicker2=_interopRequireDefault(__webpack_require__(59)),_iconPicker,_iconPicker2=_interopRequireDefault(__webpack_require__(60)),_picker,_picker2=_interopRequireDefault(__webpack_require__(28)),_tooltip,_tooltip2=_interopRequireDefault(__webpack_require__(61));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var ALIGNS=[!1,"center","right","justify"],COLORS=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],FONTS=[!1,"serif","monospace"],HEADERS=["1","2","3",!1],SIZES=["small",!1,"large","huge"],BaseTheme=function(_Theme){function BaseTheme(quill,options){_classCallCheck(this,BaseTheme);var _this=_possibleConstructorReturn(this,(BaseTheme.__proto__||Object.getPrototypeOf(BaseTheme)).call(this,quill,options)),listener=function listener(e){if(!document.body.contains(quill.root))return document.body.removeEventListener("click",listener);null==_this.tooltip||_this.tooltip.root.contains(e.target)||document.activeElement===_this.tooltip.textbox||_this.quill.hasFocus()||_this.tooltip.hide(),null!=_this.pickers&&_this.pickers.forEach((function(picker){picker.container.contains(e.target)||picker.close()}))};return quill.emitter.listenDOM("click",document.body,listener),_this}return _inherits(BaseTheme,_Theme),_createClass(BaseTheme,[{key:"addModule",value:function addModule(name){var module=_get(BaseTheme.prototype.__proto__||Object.getPrototypeOf(BaseTheme.prototype),"addModule",this).call(this,name);return"toolbar"===name&&this.extendToolbar(module),module}},{key:"buildButtons",value:function buildButtons(buttons,icons){buttons.forEach((function(button){var className;(button.getAttribute("class")||"").split(/\s+/).forEach((function(name){if(name.startsWith("ql-")&&(name=name.slice("ql-".length),null!=icons[name]))if("direction"===name)button.innerHTML=icons[name][""]+icons[name].rtl;else if("string"==typeof icons[name])button.innerHTML=icons[name];else{var value=button.value||"";null!=value&&icons[name][value]&&(button.innerHTML=icons[name][value])}}))}))}},{key:"buildPickers",value:function buildPickers(selects,icons){var _this2=this;this.pickers=selects.map((function(select){if(select.classList.contains("ql-align"))return null==select.querySelector("option")&&fillSelect(select,ALIGNS),new _iconPicker2.default(select,icons.align);if(select.classList.contains("ql-background")||select.classList.contains("ql-color")){var format=select.classList.contains("ql-background")?"background":"color";return null==select.querySelector("option")&&fillSelect(select,COLORS,"background"===format?"#ffffff":"#000000"),new _colorPicker2.default(select,icons[format])}return null==select.querySelector("option")&&(select.classList.contains("ql-font")?fillSelect(select,FONTS):select.classList.contains("ql-header")?fillSelect(select,HEADERS):select.classList.contains("ql-size")&&fillSelect(select,SIZES)),new _picker2.default(select)}));var update=function update(){_this2.pickers.forEach((function(picker){picker.update()}))};this.quill.on(_emitter2.default.events.EDITOR_CHANGE,update)}}]),BaseTheme}(_theme2.default);BaseTheme.DEFAULTS=(0,_extend2.default)(!0,{},_theme2.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function formula(){this.quill.theme.tooltip.edit("formula")},image:function image(){var _this3=this,fileInput=this.container.querySelector("input.ql-image[type=file]");null==fileInput&&((fileInput=document.createElement("input")).setAttribute("type","file"),fileInput.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),fileInput.classList.add("ql-image"),fileInput.addEventListener("change",(function(){if(null!=fileInput.files&&null!=fileInput.files[0]){var reader=new FileReader;reader.onload=function(e){var range=_this3.quill.getSelection(!0);_this3.quill.updateContents((new _quillDelta2.default).retain(range.index).delete(range.length).insert({image:e.target.result}),_emitter2.default.sources.USER),_this3.quill.setSelection(range.index+1,_emitter2.default.sources.SILENT),fileInput.value=""},reader.readAsDataURL(fileInput.files[0])}})),this.container.appendChild(fileInput)),fileInput.click()},video:function video(){this.quill.theme.tooltip.edit("video")}}}}});var BaseTooltip=function(_Tooltip){function BaseTooltip(quill,boundsContainer){_classCallCheck(this,BaseTooltip);var _this4=_possibleConstructorReturn(this,(BaseTooltip.__proto__||Object.getPrototypeOf(BaseTooltip)).call(this,quill,boundsContainer));return _this4.textbox=_this4.root.querySelector('input[type="text"]'),_this4.listen(),_this4}return _inherits(BaseTooltip,_Tooltip),_createClass(BaseTooltip,[{key:"listen",value:function listen(){var _this5=this;this.textbox.addEventListener("keydown",(function(event){_keyboard2.default.match(event,"enter")?(_this5.save(),event.preventDefault()):_keyboard2.default.match(event,"escape")&&(_this5.cancel(),event.preventDefault())}))}},{key:"cancel",value:function cancel(){this.hide()}},{key:"edit",value:function edit(){var mode=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",preview=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=preview?this.textbox.value=preview:mode!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+mode)||""),this.root.setAttribute("data-mode",mode)}},{key:"restoreFocus",value:function restoreFocus(){var scrollTop=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=scrollTop}},{key:"save",value:function save(){var value=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var scrollTop=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",value,_emitter2.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",value,_emitter2.default.sources.USER)),this.quill.root.scrollTop=scrollTop;break;case"video":value=extractVideoUrl(value);case"formula":if(!value)break;var range=this.quill.getSelection(!0);if(null!=range){var index=range.index+range.length;this.quill.insertEmbed(index,this.root.getAttribute("data-mode"),value,_emitter2.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(index+1," ",_emitter2.default.sources.USER),this.quill.setSelection(index+2,_emitter2.default.sources.USER)}}this.textbox.value="",this.hide()}}]),BaseTooltip}(_tooltip2.default);function extractVideoUrl(url){var match=url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return match?(match[1]||"https")+"://www.youtube.com/embed/"+match[2]+"?showinfo=0":(match=url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(match[1]||"https")+"://player.vimeo.com/video/"+match[2]+"/":url}function fillSelect(select,values){var defaultValue=arguments.length>2&&void 0!==arguments[2]&&arguments[2];values.forEach((function(value){var option=document.createElement("option");value===defaultValue?option.setAttribute("selected","selected"):option.setAttribute("value",value),select.appendChild(option)}))}exports.BaseTooltip=BaseTooltip,exports.default=BaseTheme},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var LinkedList=function(){function LinkedList(){this.head=this.tail=null,this.length=0}return LinkedList.prototype.append=function(){for(var nodes=[],_i=0;_i<arguments.length;_i++)nodes[_i]=arguments[_i];this.insertBefore(nodes[0],null),nodes.length>1&&this.append.apply(this,nodes.slice(1))},LinkedList.prototype.contains=function(node){for(var cur,next=this.iterator();cur=next();)if(cur===node)return!0;return!1},LinkedList.prototype.insertBefore=function(node,refNode){node&&(node.next=refNode,null!=refNode?(node.prev=refNode.prev,null!=refNode.prev&&(refNode.prev.next=node),refNode.prev=node,refNode===this.head&&(this.head=node)):null!=this.tail?(this.tail.next=node,node.prev=this.tail,this.tail=node):(node.prev=null,this.head=this.tail=node),this.length+=1)},LinkedList.prototype.offset=function(target){for(var index=0,cur=this.head;null!=cur;){if(cur===target)return index;index+=cur.length(),cur=cur.next}return-1},LinkedList.prototype.remove=function(node){this.contains(node)&&(null!=node.prev&&(node.prev.next=node.next),null!=node.next&&(node.next.prev=node.prev),node===this.head&&(this.head=node.next),node===this.tail&&(this.tail=node.prev),this.length-=1)},LinkedList.prototype.iterator=function(curNode){return void 0===curNode&&(curNode=this.head),function(){var ret=curNode;return null!=curNode&&(curNode=curNode.next),ret}},LinkedList.prototype.find=function(index,inclusive){void 0===inclusive&&(inclusive=!1);for(var cur,next=this.iterator();cur=next();){var length=cur.length();if(index<length||inclusive&&index===length&&(null==cur.next||0!==cur.next.length()))return[cur,index];index-=length}return[null,0]},LinkedList.prototype.forEach=function(callback){for(var cur,next=this.iterator();cur=next();)callback(cur)},LinkedList.prototype.forEachAt=function(index,length,callback){if(!(length<=0))for(var _a=this.find(index),startNode=_a[0],offset,cur,curIndex=index-_a[1],next=this.iterator(startNode);(cur=next())&&curIndex<index+length;){var curLength=cur.length();index>curIndex?callback(cur,index-curIndex,Math.min(length,curIndex+curLength-index)):callback(cur,0,Math.min(curLength,index+length-curIndex)),curIndex+=curLength}},LinkedList.prototype.map=function(callback){return this.reduce((function(memo,cur){return memo.push(callback(cur)),memo}),[])},LinkedList.prototype.reduce=function(callback,memo){for(var cur,next=this.iterator();cur=next();)memo=callback(memo,cur);return memo},LinkedList}();exports.default=LinkedList},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var container_1=__webpack_require__(17),Registry=__webpack_require__(1),OBSERVER_CONFIG={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},MAX_OPTIMIZE_ITERATIONS=100,ScrollBlot=function(_super){function ScrollBlot(node){var _this=_super.call(this,node)||this;return _this.scroll=_this,_this.observer=new MutationObserver((function(mutations){_this.update(mutations)})),_this.observer.observe(_this.domNode,OBSERVER_CONFIG),_this.attach(),_this}return __extends(ScrollBlot,_super),ScrollBlot.prototype.detach=function(){_super.prototype.detach.call(this),this.observer.disconnect()},ScrollBlot.prototype.deleteAt=function(index,length){this.update(),0===index&&length===this.length()?this.children.forEach((function(child){child.remove()})):_super.prototype.deleteAt.call(this,index,length)},ScrollBlot.prototype.formatAt=function(index,length,name,value){this.update(),_super.prototype.formatAt.call(this,index,length,name,value)},ScrollBlot.prototype.insertAt=function(index,value,def){this.update(),_super.prototype.insertAt.call(this,index,value,def)},ScrollBlot.prototype.optimize=function(mutations,context){var _this=this;void 0===mutations&&(mutations=[]),void 0===context&&(context={}),_super.prototype.optimize.call(this,context);for(var records=[].slice.call(this.observer.takeRecords());records.length>0;)mutations.push(records.pop());for(var mark=function(blot,markParent){void 0===markParent&&(markParent=!0),null!=blot&&blot!==_this&&null!=blot.domNode.parentNode&&(null==blot.domNode[Registry.DATA_KEY].mutations&&(blot.domNode[Registry.DATA_KEY].mutations=[]),markParent&&mark(blot.parent))},optimize=function(blot){null!=blot.domNode[Registry.DATA_KEY]&&null!=blot.domNode[Registry.DATA_KEY].mutations&&(blot instanceof container_1.default&&blot.children.forEach(optimize),blot.optimize(context))},remaining=mutations,i=0;remaining.length>0;i+=1){if(i>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(remaining.forEach((function(mutation){var blot=Registry.find(mutation.target,!0);null!=blot&&(blot.domNode===mutation.target&&("childList"===mutation.type?(mark(Registry.find(mutation.previousSibling,!1)),[].forEach.call(mutation.addedNodes,(function(node){var child=Registry.find(node,!1);mark(child,!1),child instanceof container_1.default&&child.children.forEach((function(grandChild){mark(grandChild,!1)}))}))):"attributes"===mutation.type&&mark(blot.prev)),mark(blot))})),this.children.forEach(optimize),records=(remaining=[].slice.call(this.observer.takeRecords())).slice();records.length>0;)mutations.push(records.pop())}},ScrollBlot.prototype.update=function(mutations,context){var _this=this;void 0===context&&(context={}),(mutations=mutations||this.observer.takeRecords()).map((function(mutation){var blot=Registry.find(mutation.target,!0);return null==blot?null:null==blot.domNode[Registry.DATA_KEY].mutations?(blot.domNode[Registry.DATA_KEY].mutations=[mutation],blot):(blot.domNode[Registry.DATA_KEY].mutations.push(mutation),null)})).forEach((function(blot){null!=blot&&blot!==_this&&null!=blot.domNode[Registry.DATA_KEY]&&blot.update(blot.domNode[Registry.DATA_KEY].mutations||[],context)})),null!=this.domNode[Registry.DATA_KEY].mutations&&_super.prototype.update.call(this,this.domNode[Registry.DATA_KEY].mutations,context),this.optimize(mutations,context)},ScrollBlot.blotName="scroll",ScrollBlot.defaultChild="block",ScrollBlot.scope=Registry.Scope.BLOCK_BLOT,ScrollBlot.tagName="DIV",ScrollBlot}(container_1.default);exports.default=ScrollBlot},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var format_1=__webpack_require__(18),Registry=__webpack_require__(1);function isEqual(obj1,obj2){if(Object.keys(obj1).length!==Object.keys(obj2).length)return!1;for(var prop in obj1)if(obj1[prop]!==obj2[prop])return!1;return!0}var InlineBlot=function(_super){function InlineBlot(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(InlineBlot,_super),InlineBlot.formats=function(domNode){if(domNode.tagName!==InlineBlot.tagName)return _super.formats.call(this,domNode)},InlineBlot.prototype.format=function(name,value){var _this=this;name!==this.statics.blotName||value?_super.prototype.format.call(this,name,value):(this.children.forEach((function(child){child instanceof format_1.default||(child=child.wrap(InlineBlot.blotName,!0)),_this.attributes.copy(child)})),this.unwrap())},InlineBlot.prototype.formatAt=function(index,length,name,value){var blot;null!=this.formats()[name]||Registry.query(name,Registry.Scope.ATTRIBUTE)?this.isolate(index,length).format(name,value):_super.prototype.formatAt.call(this,index,length,name,value)},InlineBlot.prototype.optimize=function(context){_super.prototype.optimize.call(this,context);var formats=this.formats();if(0===Object.keys(formats).length)return this.unwrap();var next=this.next;next instanceof InlineBlot&&next.prev===this&&isEqual(formats,next.formats())&&(next.moveChildren(this),next.remove())},InlineBlot.blotName="inline",InlineBlot.scope=Registry.Scope.INLINE_BLOT,InlineBlot.tagName="SPAN",InlineBlot}(format_1.default);exports.default=InlineBlot},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var format_1=__webpack_require__(18),Registry=__webpack_require__(1),BlockBlot=function(_super){function BlockBlot(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(BlockBlot,_super),BlockBlot.formats=function(domNode){var tagName=Registry.query(BlockBlot.blotName).tagName;if(domNode.tagName!==tagName)return _super.formats.call(this,domNode)},BlockBlot.prototype.format=function(name,value){null!=Registry.query(name,Registry.Scope.BLOCK)&&(name!==this.statics.blotName||value?_super.prototype.format.call(this,name,value):this.replaceWith(BlockBlot.blotName))},BlockBlot.prototype.formatAt=function(index,length,name,value){null!=Registry.query(name,Registry.Scope.BLOCK)?this.format(name,value):_super.prototype.formatAt.call(this,index,length,name,value)},BlockBlot.prototype.insertAt=function(index,value,def){if(null==def||null!=Registry.query(value,Registry.Scope.INLINE))_super.prototype.insertAt.call(this,index,value,def);else{var after=this.split(index),blot=Registry.create(value,def);after.parent.insertBefore(blot,after)}},BlockBlot.prototype.update=function(mutations,context){navigator.userAgent.match(/Trident/)?this.build():_super.prototype.update.call(this,mutations,context)},BlockBlot.blotName="block",BlockBlot.scope=Registry.Scope.BLOCK_BLOT,BlockBlot.tagName="P",BlockBlot}(format_1.default);exports.default=BlockBlot},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var leaf_1,EmbedBlot=function(_super){function EmbedBlot(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(EmbedBlot,_super),EmbedBlot.formats=function(domNode){},EmbedBlot.prototype.format=function(name,value){_super.prototype.formatAt.call(this,0,this.length(),name,value)},EmbedBlot.prototype.formatAt=function(index,length,name,value){0===index&&length===this.length()?this.format(name,value):_super.prototype.formatAt.call(this,index,length,name,value)},EmbedBlot.prototype.formats=function(){return this.statics.formats(this.domNode)},EmbedBlot}(__webpack_require__(19).default);exports.default=EmbedBlot},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}),extendStatics;Object.defineProperty(exports,"__esModule",{value:!0});var leaf_1=__webpack_require__(19),Registry=__webpack_require__(1),TextBlot=function(_super){function TextBlot(node){var _this=_super.call(this,node)||this;return _this.text=_this.statics.value(_this.domNode),_this}return __extends(TextBlot,_super),TextBlot.create=function(value){return document.createTextNode(value)},TextBlot.value=function(domNode){var text=domNode.data;return text.normalize&&(text=text.normalize()),text},TextBlot.prototype.deleteAt=function(index,length){this.domNode.data=this.text=this.text.slice(0,index)+this.text.slice(index+length)},TextBlot.prototype.index=function(node,offset){return this.domNode===node?offset:-1},TextBlot.prototype.insertAt=function(index,value,def){null==def?(this.text=this.text.slice(0,index)+value+this.text.slice(index),this.domNode.data=this.text):_super.prototype.insertAt.call(this,index,value,def)},TextBlot.prototype.length=function(){return this.text.length},TextBlot.prototype.optimize=function(context){_super.prototype.optimize.call(this,context),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof TextBlot&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},TextBlot.prototype.position=function(index,inclusive){return void 0===inclusive&&(inclusive=!1),[this.domNode,index]},TextBlot.prototype.split=function(index,force){if(void 0===force&&(force=!1),!force){if(0===index)return this;if(index===this.length())return this.next}var after=Registry.create(this.domNode.splitText(index));return this.parent.insertBefore(after,this.next),this.text=this.statics.value(this.domNode),after},TextBlot.prototype.update=function(mutations,context){var _this=this;mutations.some((function(mutation){return"characterData"===mutation.type&&mutation.target===_this.domNode}))&&(this.text=this.statics.value(this.domNode))},TextBlot.prototype.value=function(){return this.text},TextBlot.blotName="text",TextBlot.scope=Registry.Scope.INLINE_BLOT,TextBlot}(leaf_1.default);exports.default=TextBlot},function(module,exports,__webpack_require__){"use strict";var elem=document.createElement("div");if(elem.classList.toggle("test-class",!1),elem.classList.contains("test-class")){var _toggle=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(token,force){return arguments.length>1&&!this.contains(token)==!force?force:_toggle.call(this,token)}}String.prototype.startsWith||(String.prototype.startsWith=function(searchString,position){return position=position||0,this.substr(position,searchString.length)===searchString}),String.prototype.endsWith||(String.prototype.endsWith=function(searchString,position){var subjectString=this.toString();("number"!=typeof position||!isFinite(position)||Math.floor(position)!==position||position>subjectString.length)&&(position=subjectString.length),position-=searchString.length;var lastIndex=subjectString.indexOf(searchString,position);return-1!==lastIndex&&lastIndex===position}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function value(predicate){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof predicate)throw new TypeError("predicate must be a function");for(var list=Object(this),length=list.length>>>0,thisArg=arguments[1],value,i=0;i<length;i++)if(value=list[i],predicate.call(thisArg,value,i,list))return value}}),document.addEventListener("DOMContentLoaded",(function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)}))},function(module,exports){var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;function diff_main(text1,text2,cursor_pos){if(text1==text2)return text1?[[0,text1]]:[];(cursor_pos<0||text1.length<cursor_pos)&&(cursor_pos=null);var commonlength=diff_commonPrefix(text1,text2),commonprefix=text1.substring(0,commonlength);commonlength=diff_commonSuffix(text1=text1.substring(commonlength),text2=text2.substring(commonlength));var commonsuffix=text1.substring(text1.length-commonlength),diffs=diff_compute_(text1=text1.substring(0,text1.length-commonlength),text2=text2.substring(0,text2.length-commonlength));return commonprefix&&diffs.unshift([0,commonprefix]),commonsuffix&&diffs.push([0,commonsuffix]),diff_cleanupMerge(diffs),null!=cursor_pos&&(diffs=fix_cursor(diffs,cursor_pos)),diffs=fix_emoji(diffs)}function diff_compute_(text1,text2){var diffs;if(!text1)return[[1,text2]];if(!text2)return[[-1,text1]];var longtext=text1.length>text2.length?text1:text2,shorttext=text1.length>text2.length?text2:text1,i=longtext.indexOf(shorttext);if(-1!=i)return diffs=[[1,longtext.substring(0,i)],[0,shorttext],[1,longtext.substring(i+shorttext.length)]],text1.length>text2.length&&(diffs[0][0]=diffs[2][0]=-1),diffs;if(1==shorttext.length)return[[-1,text1],[1,text2]];var hm=diff_halfMatch_(text1,text2);if(hm){var text1_a=hm[0],text1_b=hm[1],text2_a=hm[2],text2_b=hm[3],mid_common=hm[4],diffs_a=diff_main(text1_a,text2_a),diffs_b=diff_main(text1_b,text2_b);return diffs_a.concat([[0,mid_common]],diffs_b)}return diff_bisect_(text1,text2)}function diff_bisect_(text1,text2){for(var text1_length=text1.length,text2_length=text2.length,max_d=Math.ceil((text1_length+text2_length)/2),v_offset=max_d,v_length=2*max_d,v1=new Array(v_length),v2=new Array(v_length),x=0;x<v_length;x++)v1[x]=-1,v2[x]=-1;v1[v_offset+1]=0,v2[v_offset+1]=0;for(var delta=text1_length-text2_length,front=delta%2!=0,k1start=0,k1end=0,k2start=0,k2end=0,d=0;d<max_d;d++){for(var k1=-d+k1start;k1<=d-k1end;k1+=2){for(var k1_offset=v_offset+k1,x1,y1=(x1=k1==-d||k1!=d&&v1[k1_offset-1]<v1[k1_offset+1]?v1[k1_offset+1]:v1[k1_offset-1]+1)-k1;x1<text1_length&&y1<text2_length&&text1.charAt(x1)==text2.charAt(y1);)x1++,y1++;if(v1[k1_offset]=x1,x1>text1_length)k1end+=2;else if(y1>text2_length)k1start+=2;else if(front){var k2_offset,x2;if((k2_offset=v_offset+delta-k1)>=0&&k2_offset<v_length&&-1!=v2[k2_offset])if(x1>=(x2=text1_length-v2[k2_offset]))return diff_bisectSplit_(text1,text2,x1,y1)}}for(var k2=-d+k2start;k2<=d-k2end;k2+=2){for(var k2_offset=v_offset+k2,x2,y2=(x2=k2==-d||k2!=d&&v2[k2_offset-1]<v2[k2_offset+1]?v2[k2_offset+1]:v2[k2_offset-1]+1)-k2;x2<text1_length&&y2<text2_length&&text1.charAt(text1_length-x2-1)==text2.charAt(text2_length-y2-1);)x2++,y2++;if(v2[k2_offset]=x2,x2>text1_length)k2end+=2;else if(y2>text2_length)k2start+=2;else if(!front){var k1_offset;if((k1_offset=v_offset+delta-k2)>=0&&k1_offset<v_length&&-1!=v1[k1_offset]){var x1,y1=v_offset+(x1=v1[k1_offset])-k1_offset;if(x1>=(x2=text1_length-x2))return diff_bisectSplit_(text1,text2,x1,y1)}}}}return[[-1,text1],[1,text2]]}function diff_bisectSplit_(text1,text2,x,y){var text1a=text1.substring(0,x),text2a=text2.substring(0,y),text1b=text1.substring(x),text2b=text2.substring(y),diffs=diff_main(text1a,text2a),diffsb=diff_main(text1b,text2b);return diffs.concat(diffsb)}function diff_commonPrefix(text1,text2){if(!text1||!text2||text1.charAt(0)!=text2.charAt(0))return 0;for(var pointermin=0,pointermax=Math.min(text1.length,text2.length),pointermid=pointermax,pointerstart=0;pointermin<pointermid;)text1.substring(pointerstart,pointermid)==text2.substring(pointerstart,pointermid)?pointerstart=pointermin=pointermid:pointermax=pointermid,pointermid=Math.floor((pointermax-pointermin)/2+pointermin);return pointermid}function diff_commonSuffix(text1,text2){if(!text1||!text2||text1.charAt(text1.length-1)!=text2.charAt(text2.length-1))return 0;for(var pointermin=0,pointermax=Math.min(text1.length,text2.length),pointermid=pointermax,pointerend=0;pointermin<pointermid;)text1.substring(text1.length-pointermid,text1.length-pointerend)==text2.substring(text2.length-pointermid,text2.length-pointerend)?pointerend=pointermin=pointermid:pointermax=pointermid,pointermid=Math.floor((pointermax-pointermin)/2+pointermin);return pointermid}function diff_halfMatch_(text1,text2){var longtext=text1.length>text2.length?text1:text2,shorttext=text1.length>text2.length?text2:text1;if(longtext.length<4||2*shorttext.length<longtext.length)return null;function diff_halfMatchI_(longtext,shorttext,i){for(var seed=longtext.substring(i,i+Math.floor(longtext.length/4)),j=-1,best_common="",best_longtext_a,best_longtext_b,best_shorttext_a,best_shorttext_b;-1!=(j=shorttext.indexOf(seed,j+1));){var prefixLength=diff_commonPrefix(longtext.substring(i),shorttext.substring(j)),suffixLength=diff_commonSuffix(longtext.substring(0,i),shorttext.substring(0,j));best_common.length<suffixLength+prefixLength&&(best_common=shorttext.substring(j-suffixLength,j)+shorttext.substring(j,j+prefixLength),best_longtext_a=longtext.substring(0,i-suffixLength),best_longtext_b=longtext.substring(i+prefixLength),best_shorttext_a=shorttext.substring(0,j-suffixLength),best_shorttext_b=shorttext.substring(j+prefixLength))}return 2*best_common.length>=longtext.length?[best_longtext_a,best_longtext_b,best_shorttext_a,best_shorttext_b,best_common]:null}var hm1=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/4)),hm2=diff_halfMatchI_(longtext,shorttext,Math.ceil(longtext.length/2)),hm,text1_a,text1_b,text2_a,text2_b,mid_common;return hm1||hm2?(hm=hm2?hm1&&hm1[4].length>hm2[4].length?hm1:hm2:hm1,text1.length>text2.length?(text1_a=hm[0],text1_b=hm[1],text2_a=hm[2],text2_b=hm[3]):(text2_a=hm[0],text2_b=hm[1],text1_a=hm[2],text1_b=hm[3]),[text1_a,text1_b,text2_a,text2_b,hm[4]]):null}function diff_cleanupMerge(diffs){diffs.push([0,""]);for(var pointer=0,count_delete=0,count_insert=0,text_delete="",text_insert="",commonlength;pointer<diffs.length;)switch(diffs[pointer][0]){case 1:count_insert++,text_insert+=diffs[pointer][1],pointer++;break;case-1:count_delete++,text_delete+=diffs[pointer][1],pointer++;break;case 0:count_delete+count_insert>1?(0!==count_delete&&0!==count_insert&&(0!==(commonlength=diff_commonPrefix(text_insert,text_delete))&&(pointer-count_delete-count_insert>0&&0==diffs[pointer-count_delete-count_insert-1][0]?diffs[pointer-count_delete-count_insert-1][1]+=text_insert.substring(0,commonlength):(diffs.splice(0,0,[0,text_insert.substring(0,commonlength)]),pointer++),text_insert=text_insert.substring(commonlength),text_delete=text_delete.substring(commonlength)),0!==(commonlength=diff_commonSuffix(text_insert,text_delete))&&(diffs[pointer][1]=text_insert.substring(text_insert.length-commonlength)+diffs[pointer][1],text_insert=text_insert.substring(0,text_insert.length-commonlength),text_delete=text_delete.substring(0,text_delete.length-commonlength))),0===count_delete?diffs.splice(pointer-count_insert,count_delete+count_insert,[1,text_insert]):0===count_insert?diffs.splice(pointer-count_delete,count_delete+count_insert,[-1,text_delete]):diffs.splice(pointer-count_delete-count_insert,count_delete+count_insert,[-1,text_delete],[1,text_insert]),pointer=pointer-count_delete-count_insert+(count_delete?1:0)+(count_insert?1:0)+1):0!==pointer&&0==diffs[pointer-1][0]?(diffs[pointer-1][1]+=diffs[pointer][1],diffs.splice(pointer,1)):pointer++,count_insert=0,count_delete=0,text_delete="",text_insert=""}""===diffs[diffs.length-1][1]&&diffs.pop();var changes=!1;for(pointer=1;pointer<diffs.length-1;)0==diffs[pointer-1][0]&&0==diffs[pointer+1][0]&&(diffs[pointer][1].substring(diffs[pointer][1].length-diffs[pointer-1][1].length)==diffs[pointer-1][1]?(diffs[pointer][1]=diffs[pointer-1][1]+diffs[pointer][1].substring(0,diffs[pointer][1].length-diffs[pointer-1][1].length),diffs[pointer+1][1]=diffs[pointer-1][1]+diffs[pointer+1][1],diffs.splice(pointer-1,1),changes=!0):diffs[pointer][1].substring(0,diffs[pointer+1][1].length)==diffs[pointer+1][1]&&(diffs[pointer-1][1]+=diffs[pointer+1][1],diffs[pointer][1]=diffs[pointer][1].substring(diffs[pointer+1][1].length)+diffs[pointer+1][1],diffs.splice(pointer+1,1),changes=!0)),pointer++;changes&&diff_cleanupMerge(diffs)}var diff=diff_main;function cursor_normalize_diff(diffs,cursor_pos){if(0===cursor_pos)return[0,diffs];for(var current_pos=0,i=0;i<diffs.length;i++){var d=diffs[i];if(-1===d[0]||0===d[0]){var next_pos=current_pos+d[1].length;if(cursor_pos===next_pos)return[i+1,diffs];if(cursor_pos<next_pos){diffs=diffs.slice();var split_pos=cursor_pos-current_pos,d_left=[d[0],d[1].slice(0,split_pos)],d_right=[d[0],d[1].slice(split_pos)];return diffs.splice(i,1,d_left,d_right),[i+1,diffs]}current_pos=next_pos}}throw new Error("cursor_pos is out of bounds!")}function fix_cursor(diffs,cursor_pos){var norm=cursor_normalize_diff(diffs,cursor_pos),ndiffs=norm[1],cursor_pointer=norm[0],d=ndiffs[cursor_pointer],d_next=ndiffs[cursor_pointer+1];if(null==d)return diffs;if(0!==d[0])return diffs;if(null!=d_next&&d[1]+d_next[1]===d_next[1]+d[1])return ndiffs.splice(cursor_pointer,2,d_next,d),merge_tuples(ndiffs,cursor_pointer,2);if(null!=d_next&&0===d_next[1].indexOf(d[1])){ndiffs.splice(cursor_pointer,2,[d_next[0],d[1]],[0,d[1]]);var suffix=d_next[1].slice(d[1].length);return suffix.length>0&&ndiffs.splice(cursor_pointer+2,0,[d_next[0],suffix]),merge_tuples(ndiffs,cursor_pointer,3)}return diffs}function fix_emoji(diffs){for(var compact=!1,starts_with_pair_end=function(str){return str.charCodeAt(0)>=56320&&str.charCodeAt(0)<=57343},ends_with_pair_start=function(str){return str.charCodeAt(str.length-1)>=55296&&str.charCodeAt(str.length-1)<=56319},i=2;i<diffs.length;i+=1)0===diffs[i-2][0]&&ends_with_pair_start(diffs[i-2][1])&&-1===diffs[i-1][0]&&starts_with_pair_end(diffs[i-1][1])&&1===diffs[i][0]&&starts_with_pair_end(diffs[i][1])&&(compact=!0,diffs[i-1][1]=diffs[i-2][1].slice(-1)+diffs[i-1][1],diffs[i][1]=diffs[i-2][1].slice(-1)+diffs[i][1],diffs[i-2][1]=diffs[i-2][1].slice(0,-1));if(!compact)return diffs;for(var fixed_diffs=[],i=0;i<diffs.length;i+=1)diffs[i][1].length>0&&fixed_diffs.push(diffs[i]);return fixed_diffs}function merge_tuples(diffs,start,length){for(var i=start+length-1;i>=0&&i>=start-1;i--)if(i+1<diffs.length){var left_d=diffs[i],right_d=diffs[i+1];left_d[0]===right_d[1]&&diffs.splice(i,2,[left_d[0],left_d[1]+right_d[1]])}return diffs}diff.INSERT=1,diff.DELETE=-1,diff.EQUAL=0,module.exports=diff},function(module,exports){function shim(obj){var keys=[];for(var key in obj)keys.push(key);return keys}(exports=module.exports="function"==typeof Object.keys?Object.keys:shim).shim=shim},function(module,exports){var supportsArgumentsClass="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function supported(object){return"[object Arguments]"==Object.prototype.toString.call(object)}function unsupported(object){return object&&"object"==typeof object&&"number"==typeof object.length&&Object.prototype.hasOwnProperty.call(object,"callee")&&!Object.prototype.propertyIsEnumerable.call(object,"callee")||!1}(exports=module.exports=supportsArgumentsClass?supported:unsupported).supported=supported,exports.unsupported=unsupported},function(module,exports){"use strict";var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}function EE(fn,context,once){this.fn=fn,this.context=context,this.once=once||!1}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(prefix=!1)),EventEmitter.prototype.eventNames=function eventNames(){var names=[],events,name;if(0===this._eventsCount)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names},EventEmitter.prototype.listeners=function listeners(event,exists){var evt=prefix?prefix+event:event,available=this._events[evt];if(exists)return!!available;if(!available)return[];if(available.fn)return[available.fn];for(var i=0,l=available.length,ee=new Array(l);i<l;i++)ee[i]=available[i].fn;return ee},EventEmitter.prototype.emit=function emit(event,a1,a2,a3,a4,a5){var evt=prefix?prefix+event:event;if(!this._events[evt])return!1;var listeners=this._events[evt],len=arguments.length,args,i;if(listeners.fn){switch(listeners.once&&this.removeListener(event,listeners.fn,void 0,!0),len){case 1:return listeners.fn.call(listeners.context),!0;case 2:return listeners.fn.call(listeners.context,a1),!0;case 3:return listeners.fn.call(listeners.context,a1,a2),!0;case 4:return listeners.fn.call(listeners.context,a1,a2,a3),!0;case 5:return listeners.fn.call(listeners.context,a1,a2,a3,a4),!0;case 6:return listeners.fn.call(listeners.context,a1,a2,a3,a4,a5),!0}for(i=1,args=new Array(len-1);i<len;i++)args[i-1]=arguments[i];listeners.fn.apply(listeners.context,args)}else{var length=listeners.length,j;for(i=0;i<length;i++)switch(listeners[i].once&&this.removeListener(event,listeners[i].fn,void 0,!0),len){case 1:listeners[i].fn.call(listeners[i].context);break;case 2:listeners[i].fn.call(listeners[i].context,a1);break;case 3:listeners[i].fn.call(listeners[i].context,a1,a2);break;case 4:listeners[i].fn.call(listeners[i].context,a1,a2,a3);break;default:if(!args)for(j=1,args=new Array(len-1);j<len;j++)args[j-1]=arguments[j];listeners[i].fn.apply(listeners[i].context,args)}}return!0},EventEmitter.prototype.on=function on(event,fn,context){var listener=new EE(fn,context||this),evt=prefix?prefix+event:event;return this._events[evt]?this._events[evt].fn?this._events[evt]=[this._events[evt],listener]:this._events[evt].push(listener):(this._events[evt]=listener,this._eventsCount++),this},EventEmitter.prototype.once=function once(event,fn,context){var listener=new EE(fn,context||this,!0),evt=prefix?prefix+event:event;return this._events[evt]?this._events[evt].fn?this._events[evt]=[this._events[evt],listener]:this._events[evt].push(listener):(this._events[evt]=listener,this._eventsCount++),this},EventEmitter.prototype.removeListener=function removeListener(event,fn,context,once){var evt=prefix?prefix+event:event;if(!this._events[evt])return this;if(!fn)return 0==--this._eventsCount?this._events=new Events:delete this._events[evt],this;var listeners=this._events[evt];if(listeners.fn)listeners.fn!==fn||once&&!listeners.once||context&&listeners.context!==context||(0==--this._eventsCount?this._events=new Events:delete this._events[evt]);else{for(var i=0,events=[],length=listeners.length;i<length;i++)(listeners[i].fn!==fn||once&&!listeners[i].once||context&&listeners[i].context!==context)&&events.push(listeners[i]);events.length?this._events[evt]=1===events.length?events[0]:events:0==--this._eventsCount?this._events=new Events:delete this._events[evt]}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(event){var evt;return event?(evt=prefix?prefix+event:event,this._events[evt]&&(0==--this._eventsCount?this._events=new Events:delete this._events[evt])):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype.setMaxListeners=function setMaxListeners(){return this},EventEmitter.prefixed=prefix,EventEmitter.EventEmitter=EventEmitter,void 0!==module&&(module.exports=EventEmitter)},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.matchText=exports.matchSpacing=exports.matchNewline=exports.matchBlot=exports.matchAttributor=exports.default=void 0;var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_extend2,_extend3=_interopRequireDefault(__webpack_require__(3)),_quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_quill,_quill2=_interopRequireDefault(__webpack_require__(5)),_logger,_logger2=_interopRequireDefault(__webpack_require__(10)),_module,_module2=_interopRequireDefault(__webpack_require__(9)),_align=__webpack_require__(36),_background=__webpack_require__(37),_code,_code2=_interopRequireDefault(__webpack_require__(13)),_color=__webpack_require__(26),_direction=__webpack_require__(38),_font=__webpack_require__(39),_size=__webpack_require__(40);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var debug=(0,_logger2.default)("quill:clipboard"),DOM_KEY="__ql-matcher",CLIPBOARD_CONFIG=[[Node.TEXT_NODE,matchText],[Node.TEXT_NODE,matchNewline],["br",matchBreak],[Node.ELEMENT_NODE,matchNewline],[Node.ELEMENT_NODE,matchBlot],[Node.ELEMENT_NODE,matchSpacing],[Node.ELEMENT_NODE,matchAttributor],[Node.ELEMENT_NODE,matchStyles],["li",matchIndent],["b",matchAlias.bind(matchAlias,"bold")],["i",matchAlias.bind(matchAlias,"italic")],["style",matchIgnore]],ATTRIBUTE_ATTRIBUTORS=[_align.AlignAttribute,_direction.DirectionAttribute].reduce((function(memo,attr){return memo[attr.keyName]=attr,memo}),{}),STYLE_ATTRIBUTORS=[_align.AlignStyle,_background.BackgroundStyle,_color.ColorStyle,_direction.DirectionStyle,_font.FontStyle,_size.SizeStyle].reduce((function(memo,attr){return memo[attr.keyName]=attr,memo}),{}),Clipboard=function(_Module){function Clipboard(quill,options){_classCallCheck(this,Clipboard);var _this=_possibleConstructorReturn(this,(Clipboard.__proto__||Object.getPrototypeOf(Clipboard)).call(this,quill,options));return _this.quill.root.addEventListener("paste",_this.onPaste.bind(_this)),_this.container=_this.quill.addContainer("ql-clipboard"),_this.container.setAttribute("contenteditable",!0),_this.container.setAttribute("tabindex",-1),_this.matchers=[],CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach((function(_ref){var _ref2=_slicedToArray(_ref,2),selector=_ref2[0],matcher=_ref2[1];(options.matchVisual||matcher!==matchSpacing)&&_this.addMatcher(selector,matcher)})),_this}return _inherits(Clipboard,_Module),_createClass(Clipboard,[{key:"addMatcher",value:function addMatcher(selector,matcher){this.matchers.push([selector,matcher])}},{key:"convert",value:function convert(html){if("string"==typeof html)return this.container.innerHTML=html.replace(/\>\r?\n +\</g,"><"),this.convert();var formats=this.quill.getFormat(this.quill.selection.savedRange.index);if(formats[_code2.default.blotName]){var text=this.container.innerText;return this.container.innerHTML="",(new _quillDelta2.default).insert(text,_defineProperty({},_code2.default.blotName,formats[_code2.default.blotName]))}var _prepareMatching=this.prepareMatching(),_prepareMatching2=_slicedToArray(_prepareMatching,2),elementMatchers=_prepareMatching2[0],textMatchers=_prepareMatching2[1],delta=traverse(this.container,elementMatchers,textMatchers);return deltaEndsWith(delta,"\n")&&null==delta.ops[delta.ops.length-1].attributes&&(delta=delta.compose((new _quillDelta2.default).retain(delta.length()-1).delete(1))),debug.log("convert",this.container.innerHTML,delta),this.container.innerHTML="",delta}},{key:"dangerouslyPasteHTML",value:function dangerouslyPasteHTML(index,html){var source=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_quill2.default.sources.API;if("string"==typeof index)this.quill.setContents(this.convert(index),html),this.quill.setSelection(0,_quill2.default.sources.SILENT);else{var paste=this.convert(html);this.quill.updateContents((new _quillDelta2.default).retain(index).concat(paste),source),this.quill.setSelection(index+paste.length(),_quill2.default.sources.SILENT)}}},{key:"onPaste",value:function onPaste(e){var _this2=this;if(!e.defaultPrevented&&this.quill.isEnabled()){var range=this.quill.getSelection(),delta=(new _quillDelta2.default).retain(range.index),scrollTop=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(_quill2.default.sources.SILENT),setTimeout((function(){delta=delta.concat(_this2.convert()).delete(range.length),_this2.quill.updateContents(delta,_quill2.default.sources.USER),_this2.quill.setSelection(delta.length()-range.length,_quill2.default.sources.SILENT),_this2.quill.scrollingContainer.scrollTop=scrollTop,_this2.quill.focus()}),1)}}},{key:"prepareMatching",value:function prepareMatching(){var _this3=this,elementMatchers=[],textMatchers=[];return this.matchers.forEach((function(pair){var _pair=_slicedToArray(pair,2),selector=_pair[0],matcher=_pair[1];switch(selector){case Node.TEXT_NODE:textMatchers.push(matcher);break;case Node.ELEMENT_NODE:elementMatchers.push(matcher);break;default:[].forEach.call(_this3.container.querySelectorAll(selector),(function(node){node[DOM_KEY]=node[DOM_KEY]||[],node[DOM_KEY].push(matcher)}))}})),[elementMatchers,textMatchers]}}]),Clipboard}(_module2.default);function applyFormat(delta,format,value){return"object"===(void 0===format?"undefined":_typeof(format))?Object.keys(format).reduce((function(delta,key){return applyFormat(delta,key,format[key])}),delta):delta.reduce((function(delta,op){return op.attributes&&op.attributes[format]?delta.push(op):delta.insert(op.insert,(0,_extend3.default)({},_defineProperty({},format,value),op.attributes))}),new _quillDelta2.default)}function computeStyle(node){if(node.nodeType!==Node.ELEMENT_NODE)return{};var DOM_KEY="__ql-computed-style";return node[DOM_KEY]||(node[DOM_KEY]=window.getComputedStyle(node))}function deltaEndsWith(delta,text){for(var endText="",i=delta.ops.length-1;i>=0&&endText.length<text.length;--i){var op=delta.ops[i];if("string"!=typeof op.insert)break;endText=op.insert+endText}return endText.slice(-1*text.length)===text}function isLine(node){if(0===node.childNodes.length)return!1;var style=computeStyle(node);return["block","list-item"].indexOf(style.display)>-1}function traverse(node,elementMatchers,textMatchers){return node.nodeType===node.TEXT_NODE?textMatchers.reduce((function(delta,matcher){return matcher(node,delta)}),new _quillDelta2.default):node.nodeType===node.ELEMENT_NODE?[].reduce.call(node.childNodes||[],(function(delta,childNode){var childrenDelta=traverse(childNode,elementMatchers,textMatchers);return childNode.nodeType===node.ELEMENT_NODE&&(childrenDelta=elementMatchers.reduce((function(childrenDelta,matcher){return matcher(childNode,childrenDelta)}),childrenDelta),childrenDelta=(childNode[DOM_KEY]||[]).reduce((function(childrenDelta,matcher){return matcher(childNode,childrenDelta)}),childrenDelta)),delta.concat(childrenDelta)}),new _quillDelta2.default):new _quillDelta2.default}function matchAlias(format,node,delta){return applyFormat(delta,format,!0)}function matchAttributor(node,delta){var attributes=_parchment2.default.Attributor.Attribute.keys(node),classes=_parchment2.default.Attributor.Class.keys(node),styles=_parchment2.default.Attributor.Style.keys(node),formats={};return attributes.concat(classes).concat(styles).forEach((function(name){var attr=_parchment2.default.query(name,_parchment2.default.Scope.ATTRIBUTE);null!=attr&&(formats[attr.attrName]=attr.value(node),formats[attr.attrName])||(null==(attr=ATTRIBUTE_ATTRIBUTORS[name])||attr.attrName!==name&&attr.keyName!==name||(formats[attr.attrName]=attr.value(node)||void 0),null==(attr=STYLE_ATTRIBUTORS[name])||attr.attrName!==name&&attr.keyName!==name||(attr=STYLE_ATTRIBUTORS[name],formats[attr.attrName]=attr.value(node)||void 0))})),Object.keys(formats).length>0&&(delta=applyFormat(delta,formats)),delta}function matchBlot(node,delta){var match=_parchment2.default.query(node);if(null==match)return delta;if(match.prototype instanceof _parchment2.default.Embed){var embed={},value=match.value(node);null!=value&&(embed[match.blotName]=value,delta=(new _quillDelta2.default).insert(embed,match.formats(node)))}else"function"==typeof match.formats&&(delta=applyFormat(delta,match.blotName,match.formats(node)));return delta}function matchBreak(node,delta){return deltaEndsWith(delta,"\n")||delta.insert("\n"),delta}function matchIgnore(){return new _quillDelta2.default}function matchIndent(node,delta){var match=_parchment2.default.query(node);if(null==match||"list-item"!==match.blotName||!deltaEndsWith(delta,"\n"))return delta;for(var indent=-1,parent=node.parentNode;!parent.classList.contains("ql-clipboard");)"list"===(_parchment2.default.query(parent)||{}).blotName&&(indent+=1),parent=parent.parentNode;return indent<=0?delta:delta.compose((new _quillDelta2.default).retain(delta.length()-1).retain(1,{indent:indent}))}function matchNewline(node,delta){return deltaEndsWith(delta,"\n")||(isLine(node)||delta.length()>0&&node.nextSibling&&isLine(node.nextSibling))&&delta.insert("\n"),delta}function matchSpacing(node,delta){if(isLine(node)&&null!=node.nextElementSibling&&!deltaEndsWith(delta,"\n\n")){var nodeHeight=node.offsetHeight+parseFloat(computeStyle(node).marginTop)+parseFloat(computeStyle(node).marginBottom);node.nextElementSibling.offsetTop>node.offsetTop+1.5*nodeHeight&&delta.insert("\n")}return delta}function matchStyles(node,delta){var formats={},style=node.style||{};return style.fontStyle&&"italic"===computeStyle(node).fontStyle&&(formats.italic=!0),style.fontWeight&&(computeStyle(node).fontWeight.startsWith("bold")||parseInt(computeStyle(node).fontWeight)>=700)&&(formats.bold=!0),Object.keys(formats).length>0&&(delta=applyFormat(delta,formats)),parseFloat(style.textIndent||0)>0&&(delta=(new _quillDelta2.default).insert("\t").concat(delta)),delta}function matchText(node,delta){var text=node.data;if("O:P"===node.parentNode.tagName)return delta.insert(text.trim());if(0===text.trim().length&&node.parentNode.classList.contains("ql-clipboard"))return delta;if(!computeStyle(node.parentNode).whiteSpace.startsWith("pre")){var replacer=function replacer(collapse,match){return(match=match.replace(/[^\u00a0]/g,"")).length<1&&collapse?" ":match};text=(text=text.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,replacer.bind(replacer,!0)),(null==node.previousSibling&&isLine(node.parentNode)||null!=node.previousSibling&&isLine(node.previousSibling))&&(text=text.replace(/^\s+/,replacer.bind(replacer,!1))),(null==node.nextSibling&&isLine(node.parentNode)||null!=node.nextSibling&&isLine(node.nextSibling))&&(text=text.replace(/\s+$/,replacer.bind(replacer,!1)))}return delta.insert(text)}Clipboard.DEFAULTS={matchers:[],matchVisual:!0},exports.default=Clipboard,exports.matchAttributor=matchAttributor,exports.matchBlot=matchBlot,exports.matchNewline=matchNewline,exports.matchSpacing=matchSpacing,exports.matchText=matchText},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_inline,_inline2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Bold=function(_Inline){function Bold(){return _classCallCheck(this,Bold),_possibleConstructorReturn(this,(Bold.__proto__||Object.getPrototypeOf(Bold)).apply(this,arguments))}return _inherits(Bold,_Inline),_createClass(Bold,[{key:"optimize",value:function optimize(context){_get(Bold.prototype.__proto__||Object.getPrototypeOf(Bold.prototype),"optimize",this).call(this,context),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function create(){return _get(Bold.__proto__||Object.getPrototypeOf(Bold),"create",this).call(this)}},{key:"formats",value:function formats(){return!0}}]),Bold}(_interopRequireDefault(__webpack_require__(6)).default);Bold.blotName="bold",Bold.tagName=["STRONG","B"],exports.default=Bold},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addControls=exports.default=void 0;var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_quillDelta,_quillDelta2=_interopRequireDefault(__webpack_require__(2)),_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_quill,_quill2=_interopRequireDefault(__webpack_require__(5)),_logger,_logger2=_interopRequireDefault(__webpack_require__(10)),_module,_module2=_interopRequireDefault(__webpack_require__(9));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var debug=(0,_logger2.default)("quill:toolbar"),Toolbar=function(_Module){function Toolbar(quill,options){_classCallCheck(this,Toolbar);var _this=_possibleConstructorReturn(this,(Toolbar.__proto__||Object.getPrototypeOf(Toolbar)).call(this,quill,options)),_ret;if(Array.isArray(_this.options.container)){var container=document.createElement("div");addControls(container,_this.options.container),quill.container.parentNode.insertBefore(container,quill.container),_this.container=container}else"string"==typeof _this.options.container?_this.container=document.querySelector(_this.options.container):_this.container=_this.options.container;return _this.container instanceof HTMLElement?(_this.container.classList.add("ql-toolbar"),_this.controls=[],_this.handlers={},Object.keys(_this.options.handlers).forEach((function(format){_this.addHandler(format,_this.options.handlers[format])})),[].forEach.call(_this.container.querySelectorAll("button, select"),(function(input){_this.attach(input)})),_this.quill.on(_quill2.default.events.EDITOR_CHANGE,(function(type,range){type===_quill2.default.events.SELECTION_CHANGE&&_this.update(range)})),_this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE,(function(){var _this$quill$selection=_this.quill.selection.getRange(),_this$quill$selection2,range=_slicedToArray(_this$quill$selection,1)[0];_this.update(range)})),_this):(_ret=debug.error("Container required for toolbar",_this.options),_possibleConstructorReturn(_this,_ret))}return _inherits(Toolbar,_Module),_createClass(Toolbar,[{key:"addHandler",value:function addHandler(format,handler){this.handlers[format]=handler}},{key:"attach",value:function attach(input){var _this2=this,format=[].find.call(input.classList,(function(className){return 0===className.indexOf("ql-")}));if(format){if(format=format.slice("ql-".length),"BUTTON"===input.tagName&&input.setAttribute("type","button"),null==this.handlers[format]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[format])return void debug.warn("ignoring attaching to disabled format",format,input);if(null==_parchment2.default.query(format))return void debug.warn("ignoring attaching to nonexistent format",format,input)}var eventName="SELECT"===input.tagName?"change":"click";input.addEventListener(eventName,(function(e){var value=void 0;if("SELECT"===input.tagName){if(input.selectedIndex<0)return;var selected=input.options[input.selectedIndex];value=!selected.hasAttribute("selected")&&(selected.value||!1)}else value=!input.classList.contains("ql-active")&&(input.value||!input.hasAttribute("value")),e.preventDefault();_this2.quill.focus();var _quill$selection$getR=_this2.quill.selection.getRange(),_quill$selection$getR2,range=_slicedToArray(_quill$selection$getR,1)[0];if(null!=_this2.handlers[format])_this2.handlers[format].call(_this2,value);else if(_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed){if(!(value=prompt("Enter "+format)))return;_this2.quill.updateContents((new _quillDelta2.default).retain(range.index).delete(range.length).insert(_defineProperty({},format,value)),_quill2.default.sources.USER)}else _this2.quill.format(format,value,_quill2.default.sources.USER);_this2.update(range)})),this.controls.push([format,input])}}},{key:"update",value:function update(range){var formats=null==range?{}:this.quill.getFormat(range);this.controls.forEach((function(pair){var _pair=_slicedToArray(pair,2),format=_pair[0],input=_pair[1];if("SELECT"===input.tagName){var option=void 0;if(null==range)option=null;else if(null==formats[format])option=input.querySelector("option[selected]");else if(!Array.isArray(formats[format])){var value=formats[format];"string"==typeof value&&(value=value.replace(/\"/g,'\\"')),option=input.querySelector('option[value="'+value+'"]')}null==option?(input.value="",input.selectedIndex=-1):option.selected=!0}else if(null==range)input.classList.remove("ql-active");else if(input.hasAttribute("value")){var isActive=formats[format]===input.getAttribute("value")||null!=formats[format]&&formats[format].toString()===input.getAttribute("value")||null==formats[format]&&!input.getAttribute("value");input.classList.toggle("ql-active",isActive)}else input.classList.toggle("ql-active",null!=formats[format])}))}}]),Toolbar}(_module2.default);function addButton(container,format,value){var input=document.createElement("button");input.setAttribute("type","button"),input.classList.add("ql-"+format),null!=value&&(input.value=value),container.appendChild(input)}function addControls(container,groups){Array.isArray(groups[0])||(groups=[groups]),groups.forEach((function(controls){var group=document.createElement("span");group.classList.add("ql-formats"),controls.forEach((function(control){if("string"==typeof control)addButton(group,control);else{var format=Object.keys(control)[0],value=control[format];Array.isArray(value)?addSelect(group,format,value):addButton(group,format,value)}})),container.appendChild(group)}))}function addSelect(container,format,values){var input=document.createElement("select");input.classList.add("ql-"+format),values.forEach((function(value){var option=document.createElement("option");!1!==value?option.setAttribute("value",value):option.setAttribute("selected","selected"),input.appendChild(option)})),container.appendChild(input)}Toolbar.DEFAULTS={},Toolbar.DEFAULTS={container:null,handlers:{clean:function clean(){var _this3=this,range=this.quill.getSelection();if(null!=range)if(0==range.length){var formats=this.quill.getFormat();Object.keys(formats).forEach((function(name){null!=_parchment2.default.query(name,_parchment2.default.Scope.INLINE)&&_this3.quill.format(name,!1)}))}else this.quill.removeFormat(range,_quill2.default.sources.USER)},direction:function direction(value){var align=this.quill.getFormat().align;"rtl"===value&&null==align?this.quill.format("align","right",_quill2.default.sources.USER):value||"right"!==align||this.quill.format("align",!1,_quill2.default.sources.USER),this.quill.format("direction",value,_quill2.default.sources.USER)},indent:function indent(value){var range=this.quill.getSelection(),formats=this.quill.getFormat(range),indent=parseInt(formats.indent||0);if("+1"===value||"-1"===value){var modifier="+1"===value?1:-1;"rtl"===formats.direction&&(modifier*=-1),this.quill.format("indent",indent+modifier,_quill2.default.sources.USER)}},link:function link(value){!0===value&&(value=prompt("Enter link URL:")),this.quill.format("link",value,_quill2.default.sources.USER)},list:function list(value){var range=this.quill.getSelection(),formats=this.quill.getFormat(range);"check"===value?"checked"===formats.list||"unchecked"===formats.list?this.quill.format("list",!1,_quill2.default.sources.USER):this.quill.format("list","unchecked",_quill2.default.sources.USER):this.quill.format("list",value,_quill2.default.sources.USER)}}},exports.default=Toolbar,exports.addControls=addControls},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_picker,_picker2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var ColorPicker=function(_Picker){function ColorPicker(select,label){_classCallCheck(this,ColorPicker);var _this=_possibleConstructorReturn(this,(ColorPicker.__proto__||Object.getPrototypeOf(ColorPicker)).call(this,select));return _this.label.innerHTML=label,_this.container.classList.add("ql-color-picker"),[].slice.call(_this.container.querySelectorAll(".ql-picker-item"),0,7).forEach((function(item){item.classList.add("ql-primary")})),_this}return _inherits(ColorPicker,_Picker),_createClass(ColorPicker,[{key:"buildItem",value:function buildItem(option){var item=_get(ColorPicker.prototype.__proto__||Object.getPrototypeOf(ColorPicker.prototype),"buildItem",this).call(this,option);return item.style.backgroundColor=option.getAttribute("value")||"",item}},{key:"selectItem",value:function selectItem(item,trigger){_get(ColorPicker.prototype.__proto__||Object.getPrototypeOf(ColorPicker.prototype),"selectItem",this).call(this,item,trigger);var colorLabel=this.label.querySelector(".ql-color-label"),value=item&&item.getAttribute("data-value")||"";colorLabel&&("line"===colorLabel.tagName?colorLabel.style.stroke=value:colorLabel.style.fill=value)}}]),ColorPicker}(_interopRequireDefault(__webpack_require__(28)).default);exports.default=ColorPicker},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_picker,_picker2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var IconPicker=function(_Picker){function IconPicker(select,icons){_classCallCheck(this,IconPicker);var _this=_possibleConstructorReturn(this,(IconPicker.__proto__||Object.getPrototypeOf(IconPicker)).call(this,select));return _this.container.classList.add("ql-icon-picker"),[].forEach.call(_this.container.querySelectorAll(".ql-picker-item"),(function(item){item.innerHTML=icons[item.getAttribute("data-value")||""]})),_this.defaultItem=_this.container.querySelector(".ql-selected"),_this.selectItem(_this.defaultItem),_this}return _inherits(IconPicker,_Picker),_createClass(IconPicker,[{key:"selectItem",value:function selectItem(item,trigger){_get(IconPicker.prototype.__proto__||Object.getPrototypeOf(IconPicker.prototype),"selectItem",this).call(this,item,trigger),item=item||this.defaultItem,this.label.innerHTML=item.innerHTML}}]),IconPicker}(_interopRequireDefault(__webpack_require__(28)).default);exports.default=IconPicker},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var Tooltip=function(){function Tooltip(quill,boundsContainer){var _this=this;_classCallCheck(this,Tooltip),this.quill=quill,this.boundsContainer=boundsContainer||document.body,this.root=quill.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",(function(){_this.root.style.marginTop=-1*_this.quill.root.scrollTop+"px"})),this.hide()}return _createClass(Tooltip,[{key:"hide",value:function hide(){this.root.classList.add("ql-hidden")}},{key:"position",value:function position(reference){var left=reference.left+reference.width/2-this.root.offsetWidth/2,top=reference.bottom+this.quill.root.scrollTop;this.root.style.left=left+"px",this.root.style.top=top+"px",this.root.classList.remove("ql-flip");var containerBounds=this.boundsContainer.getBoundingClientRect(),rootBounds=this.root.getBoundingClientRect(),shift=0;if(rootBounds.right>containerBounds.right&&(shift=containerBounds.right-rootBounds.right,this.root.style.left=left+shift+"px"),rootBounds.left<containerBounds.left&&(shift=containerBounds.left-rootBounds.left,this.root.style.left=left+shift+"px"),rootBounds.bottom>containerBounds.bottom){var height=rootBounds.bottom-rootBounds.top,verticalShift=reference.bottom-reference.top+height;this.root.style.top=top-verticalShift+"px",this.root.classList.add("ql-flip")}return shift}},{key:"show",value:function show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),Tooltip}();exports.default=Tooltip},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(){function sliceIterator(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return sliceIterator(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_extend,_extend2=_interopRequireDefault(__webpack_require__(3)),_emitter,_emitter2=_interopRequireDefault(__webpack_require__(8)),_base=__webpack_require__(43),_base2=_interopRequireDefault(_base),_link,_link2=_interopRequireDefault(__webpack_require__(27)),_selection=__webpack_require__(15),_icons,_icons2=_interopRequireDefault(__webpack_require__(41));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var TOOLBAR_CONFIG=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],SnowTheme=function(_BaseTheme){function SnowTheme(quill,options){_classCallCheck(this,SnowTheme),null!=options.modules.toolbar&&null==options.modules.toolbar.container&&(options.modules.toolbar.container=TOOLBAR_CONFIG);var _this=_possibleConstructorReturn(this,(SnowTheme.__proto__||Object.getPrototypeOf(SnowTheme)).call(this,quill,options));return _this.quill.container.classList.add("ql-snow"),_this}return _inherits(SnowTheme,_BaseTheme),_createClass(SnowTheme,[{key:"extendToolbar",value:function extendToolbar(toolbar){toolbar.container.classList.add("ql-snow"),this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")),_icons2.default),this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")),_icons2.default),this.tooltip=new SnowTooltip(this.quill,this.options.bounds),toolbar.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},(function(range,context){toolbar.handlers.link.call(toolbar,!context.format.link)}))}}]),SnowTheme}(_base2.default);SnowTheme.DEFAULTS=(0,_extend2.default)(!0,{},_base2.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function link(value){if(value){var range=this.quill.getSelection();if(null==range||0==range.length)return;var preview=this.quill.getText(range),tooltip;/^\S+@\S+\.\S+$/.test(preview)&&0!==preview.indexOf("mailto:")&&(preview="mailto:"+preview),this.quill.theme.tooltip.edit("link",preview)}else this.quill.format("link",!1)}}}}});var SnowTooltip=function(_BaseTooltip){function SnowTooltip(quill,bounds){_classCallCheck(this,SnowTooltip);var _this2=_possibleConstructorReturn(this,(SnowTooltip.__proto__||Object.getPrototypeOf(SnowTooltip)).call(this,quill,bounds));return _this2.preview=_this2.root.querySelector("a.ql-preview"),_this2}return _inherits(SnowTooltip,_BaseTooltip),_createClass(SnowTooltip,[{key:"listen",value:function listen(){var _this3=this;_get(SnowTooltip.prototype.__proto__||Object.getPrototypeOf(SnowTooltip.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",(function(event){_this3.root.classList.contains("ql-editing")?_this3.save():_this3.edit("link",_this3.preview.textContent),event.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(function(event){if(null!=_this3.linkRange){var range=_this3.linkRange;_this3.restoreFocus(),_this3.quill.formatText(range,"link",!1,_emitter2.default.sources.USER),delete _this3.linkRange}event.preventDefault(),_this3.hide()})),this.quill.on(_emitter2.default.events.SELECTION_CHANGE,(function(range,oldRange,source){if(null!=range){if(0===range.length&&source===_emitter2.default.sources.USER){var _quill$scroll$descend=_this3.quill.scroll.descendant(_link2.default,range.index),_quill$scroll$descend2=_slicedToArray(_quill$scroll$descend,2),link=_quill$scroll$descend2[0],offset=_quill$scroll$descend2[1];if(null!=link){_this3.linkRange=new _selection.Range(range.index-offset,link.length());var preview=_link2.default.formats(link.domNode);return _this3.preview.textContent=preview,_this3.preview.setAttribute("href",preview),_this3.show(),void _this3.position(_this3.quill.getBounds(_this3.linkRange))}}else delete _this3.linkRange;_this3.hide()}}))}},{key:"show",value:function show(){_get(SnowTooltip.prototype.__proto__||Object.getPrototypeOf(SnowTooltip.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),SnowTooltip}(_base.BaseTooltip);SnowTooltip.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),exports.default=SnowTheme},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _core,_core2=_interopRequireDefault(__webpack_require__(29)),_align=__webpack_require__(36),_direction=__webpack_require__(38),_indent=__webpack_require__(64),_blockquote,_blockquote2=_interopRequireDefault(__webpack_require__(65)),_header,_header2=_interopRequireDefault(__webpack_require__(66)),_list=__webpack_require__(67),_list2=_interopRequireDefault(_list),_background=__webpack_require__(37),_color=__webpack_require__(26),_font=__webpack_require__(39),_size=__webpack_require__(40),_bold,_bold2=_interopRequireDefault(__webpack_require__(56)),_italic,_italic2=_interopRequireDefault(__webpack_require__(68)),_link,_link2=_interopRequireDefault(__webpack_require__(27)),_script,_script2=_interopRequireDefault(__webpack_require__(69)),_strike,_strike2=_interopRequireDefault(__webpack_require__(70)),_underline,_underline2=_interopRequireDefault(__webpack_require__(71)),_image,_image2=_interopRequireDefault(__webpack_require__(72)),_video,_video2=_interopRequireDefault(__webpack_require__(73)),_code=__webpack_require__(13),_code2=_interopRequireDefault(_code),_formula,_formula2=_interopRequireDefault(__webpack_require__(74)),_syntax,_syntax2=_interopRequireDefault(__webpack_require__(75)),_toolbar,_toolbar2=_interopRequireDefault(__webpack_require__(57)),_icons,_icons2=_interopRequireDefault(__webpack_require__(41)),_picker,_picker2=_interopRequireDefault(__webpack_require__(28)),_colorPicker,_colorPicker2=_interopRequireDefault(__webpack_require__(59)),_iconPicker,_iconPicker2=_interopRequireDefault(__webpack_require__(60)),_tooltip,_tooltip2=_interopRequireDefault(__webpack_require__(61)),_bubble,_bubble2=_interopRequireDefault(__webpack_require__(108)),_snow,_snow2=_interopRequireDefault(__webpack_require__(62));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_core2.default.register({"attributors/attribute/direction":_direction.DirectionAttribute,"attributors/class/align":_align.AlignClass,"attributors/class/background":_background.BackgroundClass,"attributors/class/color":_color.ColorClass,"attributors/class/direction":_direction.DirectionClass,"attributors/class/font":_font.FontClass,"attributors/class/size":_size.SizeClass,"attributors/style/align":_align.AlignStyle,"attributors/style/background":_background.BackgroundStyle,"attributors/style/color":_color.ColorStyle,"attributors/style/direction":_direction.DirectionStyle,"attributors/style/font":_font.FontStyle,"attributors/style/size":_size.SizeStyle},!0),_core2.default.register({"formats/align":_align.AlignClass,"formats/direction":_direction.DirectionClass,"formats/indent":_indent.IndentClass,"formats/background":_background.BackgroundStyle,"formats/color":_color.ColorStyle,"formats/font":_font.FontClass,"formats/size":_size.SizeClass,"formats/blockquote":_blockquote2.default,"formats/code-block":_code2.default,"formats/header":_header2.default,"formats/list":_list2.default,"formats/bold":_bold2.default,"formats/code":_code.Code,"formats/italic":_italic2.default,"formats/link":_link2.default,"formats/script":_script2.default,"formats/strike":_strike2.default,"formats/underline":_underline2.default,"formats/image":_image2.default,"formats/video":_video2.default,"formats/list/item":_list.ListItem,"modules/formula":_formula2.default,"modules/syntax":_syntax2.default,"modules/toolbar":_toolbar2.default,"themes/bubble":_bubble2.default,"themes/snow":_snow2.default,"ui/icons":_icons2.default,"ui/picker":_picker2.default,"ui/icon-picker":_iconPicker2.default,"ui/color-picker":_colorPicker2.default,"ui/tooltip":_tooltip2.default},!0),exports.default=_core2.default},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IndentClass=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var IdentAttributor,IndentClass=new(function(_Parchment$Attributor){function IdentAttributor(){return _classCallCheck(this,IdentAttributor),_possibleConstructorReturn(this,(IdentAttributor.__proto__||Object.getPrototypeOf(IdentAttributor)).apply(this,arguments))}return _inherits(IdentAttributor,_Parchment$Attributor),_createClass(IdentAttributor,[{key:"add",value:function add(node,value){if("+1"===value||"-1"===value){var indent=this.value(node)||0;value="+1"===value?indent+1:indent-1}return 0===value?(this.remove(node),!0):_get(IdentAttributor.prototype.__proto__||Object.getPrototypeOf(IdentAttributor.prototype),"add",this).call(this,node,value)}},{key:"canAdd",value:function canAdd(node,value){return _get(IdentAttributor.prototype.__proto__||Object.getPrototypeOf(IdentAttributor.prototype),"canAdd",this).call(this,node,value)||_get(IdentAttributor.prototype.__proto__||Object.getPrototypeOf(IdentAttributor.prototype),"canAdd",this).call(this,node,parseInt(value))}},{key:"value",value:function value(node){return parseInt(_get(IdentAttributor.prototype.__proto__||Object.getPrototypeOf(IdentAttributor.prototype),"value",this).call(this,node))||void 0}}]),IdentAttributor}(_parchment2.default.Attributor.Class))("indent","ql-indent",{scope:_parchment2.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});exports.IndentClass=IndentClass},function(module,exports,__webpack_require__){"use strict";var _block,_block2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var Blockquote=function(_Block){function Blockquote(){return _classCallCheck(this,Blockquote),_possibleConstructorReturn(this,(Blockquote.__proto__||Object.getPrototypeOf(Blockquote)).apply(this,arguments))}return _inherits(Blockquote,_Block),Blockquote}(_interopRequireDefault(__webpack_require__(4)).default);Blockquote.blotName="blockquote",Blockquote.tagName="blockquote",exports.default=Blockquote},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_block,_block2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Header=function(_Block){function Header(){return _classCallCheck(this,Header),_possibleConstructorReturn(this,(Header.__proto__||Object.getPrototypeOf(Header)).apply(this,arguments))}return _inherits(Header,_Block),_createClass(Header,null,[{key:"formats",value:function formats(domNode){return this.tagName.indexOf(domNode.tagName)+1}}]),Header}(_interopRequireDefault(__webpack_require__(4)).default);Header.blotName="header",Header.tagName=["H1","H2","H3","H4","H5","H6"],exports.default=Header},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ListItem=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_block,_block2=_interopRequireDefault(__webpack_require__(4)),_container,_container2=_interopRequireDefault(__webpack_require__(25));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var ListItem=function(_Block){function ListItem(){return _classCallCheck(this,ListItem),_possibleConstructorReturn(this,(ListItem.__proto__||Object.getPrototypeOf(ListItem)).apply(this,arguments))}return _inherits(ListItem,_Block),_createClass(ListItem,[{key:"format",value:function format(name,value){name!==List.blotName||value?_get(ListItem.prototype.__proto__||Object.getPrototypeOf(ListItem.prototype),"format",this).call(this,name,value):this.replaceWith(_parchment2.default.create(this.statics.scope))}},{key:"remove",value:function remove(){null==this.prev&&null==this.next?this.parent.remove():_get(ListItem.prototype.__proto__||Object.getPrototypeOf(ListItem.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function replaceWith(name,value){return this.parent.isolate(this.offset(this.parent),this.length()),name===this.parent.statics.blotName?(this.parent.replaceWith(name,value),this):(this.parent.unwrap(),_get(ListItem.prototype.__proto__||Object.getPrototypeOf(ListItem.prototype),"replaceWith",this).call(this,name,value))}}],[{key:"formats",value:function formats(domNode){return domNode.tagName===this.tagName?void 0:_get(ListItem.__proto__||Object.getPrototypeOf(ListItem),"formats",this).call(this,domNode)}}]),ListItem}(_block2.default);ListItem.blotName="list-item",ListItem.tagName="LI";var List=function(_Container){function List(domNode){_classCallCheck(this,List);var _this2=_possibleConstructorReturn(this,(List.__proto__||Object.getPrototypeOf(List)).call(this,domNode)),listEventHandler=function listEventHandler(e){if(e.target.parentNode===domNode){var format=_this2.statics.formats(domNode),blot=_parchment2.default.find(e.target);"checked"===format?blot.format("list","unchecked"):"unchecked"===format&&blot.format("list","checked")}};return domNode.addEventListener("touchstart",listEventHandler),domNode.addEventListener("mousedown",listEventHandler),_this2}return _inherits(List,_Container),_createClass(List,null,[{key:"create",value:function create(value){var tagName="ordered"===value?"OL":"UL",node=_get(List.__proto__||Object.getPrototypeOf(List),"create",this).call(this,tagName);return"checked"!==value&&"unchecked"!==value||node.setAttribute("data-checked","checked"===value),node}},{key:"formats",value:function formats(domNode){return"OL"===domNode.tagName?"ordered":"UL"===domNode.tagName?domNode.hasAttribute("data-checked")?"true"===domNode.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}}]),_createClass(List,[{key:"format",value:function format(name,value){this.children.length>0&&this.children.tail.format(name,value)}},{key:"formats",value:function formats(){return _defineProperty({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function insertBefore(blot,ref){if(blot instanceof ListItem)_get(List.prototype.__proto__||Object.getPrototypeOf(List.prototype),"insertBefore",this).call(this,blot,ref);else{var index=null==ref?this.length():ref.offset(this),after=this.split(index);after.parent.insertBefore(blot,after)}}},{key:"optimize",value:function optimize(context){_get(List.prototype.__proto__||Object.getPrototypeOf(List.prototype),"optimize",this).call(this,context);var next=this.next;null!=next&&next.prev===this&&next.statics.blotName===this.statics.blotName&&next.domNode.tagName===this.domNode.tagName&&next.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(next.moveChildren(this),next.remove())}},{key:"replace",value:function replace(target){if(target.statics.blotName!==this.statics.blotName){var item=_parchment2.default.create(this.statics.defaultChild);target.moveChildren(item),this.appendChild(item)}_get(List.prototype.__proto__||Object.getPrototypeOf(List.prototype),"replace",this).call(this,target)}}]),List}(_container2.default);List.blotName="list",List.scope=_parchment2.default.Scope.BLOCK_BLOT,List.tagName=["OL","UL"],List.defaultChild="list-item",List.allowedChildren=[ListItem],exports.ListItem=ListItem,exports.default=List},function(module,exports,__webpack_require__){"use strict";var _bold,_bold2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var Italic=function(_Bold){function Italic(){return _classCallCheck(this,Italic),_possibleConstructorReturn(this,(Italic.__proto__||Object.getPrototypeOf(Italic)).apply(this,arguments))}return _inherits(Italic,_Bold),Italic}(_interopRequireDefault(__webpack_require__(56)).default);Italic.blotName="italic",Italic.tagName=["EM","I"],exports.default=Italic},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_inline,_inline2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var Script=function(_Inline){function Script(){return _classCallCheck(this,Script),_possibleConstructorReturn(this,(Script.__proto__||Object.getPrototypeOf(Script)).apply(this,arguments))}return _inherits(Script,_Inline),_createClass(Script,null,[{key:"create",value:function create(value){return"super"===value?document.createElement("sup"):"sub"===value?document.createElement("sub"):_get(Script.__proto__||Object.getPrototypeOf(Script),"create",this).call(this,value)}},{key:"formats",value:function formats(domNode){return"SUB"===domNode.tagName?"sub":"SUP"===domNode.tagName?"super":void 0}}]),Script}(_interopRequireDefault(__webpack_require__(6)).default);Script.blotName="script",Script.tagName=["SUB","SUP"],exports.default=Script},function(module,exports,__webpack_require__){"use strict";var _inline,_inline2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var Strike=function(_Inline){function Strike(){return _classCallCheck(this,Strike),_possibleConstructorReturn(this,(Strike.__proto__||Object.getPrototypeOf(Strike)).apply(this,arguments))}return _inherits(Strike,_Inline),Strike}(_interopRequireDefault(__webpack_require__(6)).default);Strike.blotName="strike",Strike.tagName="S",exports.default=Strike},function(module,exports,__webpack_require__){"use strict";var _inline,_inline2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}Object.defineProperty(exports,"__esModule",{value:!0});var Underline=function(_Inline){function Underline(){return _classCallCheck(this,Underline),_possibleConstructorReturn(this,(Underline.__proto__||Object.getPrototypeOf(Underline)).apply(this,arguments))}return _inherits(Underline,_Inline),Underline}(_interopRequireDefault(__webpack_require__(6)).default);Underline.blotName="underline",Underline.tagName="U",exports.default=Underline},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_link=__webpack_require__(27);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var ATTRIBUTES=["alt","height","width"],Image=function(_Parchment$Embed){function Image(){return _classCallCheck(this,Image),_possibleConstructorReturn(this,(Image.__proto__||Object.getPrototypeOf(Image)).apply(this,arguments))}return _inherits(Image,_Parchment$Embed),_createClass(Image,[{key:"format",value:function format(name,value){ATTRIBUTES.indexOf(name)>-1?value?this.domNode.setAttribute(name,value):this.domNode.removeAttribute(name):_get(Image.prototype.__proto__||Object.getPrototypeOf(Image.prototype),"format",this).call(this,name,value)}}],[{key:"create",value:function create(value){var node=_get(Image.__proto__||Object.getPrototypeOf(Image),"create",this).call(this,value);return"string"==typeof value&&node.setAttribute("src",this.sanitize(value)),node}},{key:"formats",value:function formats(domNode){return ATTRIBUTES.reduce((function(formats,attribute){return domNode.hasAttribute(attribute)&&(formats[attribute]=domNode.getAttribute(attribute)),formats}),{})}},{key:"match",value:function match(url){return/\.(jpe?g|gif|png)$/.test(url)||/^data:image\/.+;base64/.test(url)}},{key:"sanitize",value:function sanitize(url){return(0,_link.sanitize)(url,["http","https","data"])?url:"//:0"}},{key:"value",value:function value(domNode){return domNode.getAttribute("src")}}]),Image}(_parchment2.default.Embed);Image.blotName="image",Image.tagName="IMG",exports.default=Image},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_block=__webpack_require__(4),_link,_link2=_interopRequireDefault(__webpack_require__(27));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var ATTRIBUTES=["height","width"],Video=function(_BlockEmbed){function Video(){return _classCallCheck(this,Video),_possibleConstructorReturn(this,(Video.__proto__||Object.getPrototypeOf(Video)).apply(this,arguments))}return _inherits(Video,_BlockEmbed),_createClass(Video,[{key:"format",value:function format(name,value){ATTRIBUTES.indexOf(name)>-1?value?this.domNode.setAttribute(name,value):this.domNode.removeAttribute(name):_get(Video.prototype.__proto__||Object.getPrototypeOf(Video.prototype),"format",this).call(this,name,value)}}],[{key:"create",value:function create(value){var node=_get(Video.__proto__||Object.getPrototypeOf(Video),"create",this).call(this,value);return node.setAttribute("frameborder","0"),node.setAttribute("allowfullscreen",!0),node.setAttribute("src",this.sanitize(value)),node}},{key:"formats",value:function formats(domNode){return ATTRIBUTES.reduce((function(formats,attribute){return domNode.hasAttribute(attribute)&&(formats[attribute]=domNode.getAttribute(attribute)),formats}),{})}},{key:"sanitize",value:function sanitize(url){return _link2.default.sanitize(url)}},{key:"value",value:function value(domNode){return domNode.getAttribute("src")}}]),Video}(_block.BlockEmbed);Video.blotName="video",Video.className="ql-video",Video.tagName="IFRAME",exports.default=Video},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.FormulaBlot=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_embed,_embed2=_interopRequireDefault(__webpack_require__(35)),_quill,_quill2=_interopRequireDefault(__webpack_require__(5)),_module,_module2=_interopRequireDefault(__webpack_require__(9));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var FormulaBlot=function(_Embed){function FormulaBlot(){return _classCallCheck(this,FormulaBlot),_possibleConstructorReturn(this,(FormulaBlot.__proto__||Object.getPrototypeOf(FormulaBlot)).apply(this,arguments))}return _inherits(FormulaBlot,_Embed),_createClass(FormulaBlot,null,[{key:"create",value:function create(value){var node=_get(FormulaBlot.__proto__||Object.getPrototypeOf(FormulaBlot),"create",this).call(this,value);return"string"==typeof value&&(window.katex.render(value,node,{throwOnError:!1,errorColor:"#f00"}),node.setAttribute("data-value",value)),node}},{key:"value",value:function value(domNode){return domNode.getAttribute("data-value")}}]),FormulaBlot}(_embed2.default);FormulaBlot.blotName="formula",FormulaBlot.className="ql-formula",FormulaBlot.tagName="SPAN";var Formula=function(_Module){function Formula(){_classCallCheck(this,Formula);var _this2=_possibleConstructorReturn(this,(Formula.__proto__||Object.getPrototypeOf(Formula)).call(this));if(null==window.katex)throw new Error("Formula module requires KaTeX.");return _this2}return _inherits(Formula,_Module),_createClass(Formula,null,[{key:"register",value:function register(){_quill2.default.register(FormulaBlot,!0)}}]),Formula}(_module2.default);exports.FormulaBlot=FormulaBlot,exports.default=Formula},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.CodeToken=exports.CodeBlock=void 0;var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_parchment,_parchment2=_interopRequireDefault(__webpack_require__(0)),_quill,_quill2=_interopRequireDefault(__webpack_require__(5)),_module,_module2=_interopRequireDefault(__webpack_require__(9)),_code,_code2;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var SyntaxCodeBlock=function(_CodeBlock){function SyntaxCodeBlock(){return _classCallCheck(this,SyntaxCodeBlock),_possibleConstructorReturn(this,(SyntaxCodeBlock.__proto__||Object.getPrototypeOf(SyntaxCodeBlock)).apply(this,arguments))}return _inherits(SyntaxCodeBlock,_CodeBlock),_createClass(SyntaxCodeBlock,[{key:"replaceWith",value:function replaceWith(block){this.domNode.textContent=this.domNode.textContent,this.attach(),_get(SyntaxCodeBlock.prototype.__proto__||Object.getPrototypeOf(SyntaxCodeBlock.prototype),"replaceWith",this).call(this,block)}},{key:"highlight",value:function highlight(_highlight){var text=this.domNode.textContent;this.cachedText!==text&&((text.trim().length>0||null==this.cachedText)&&(this.domNode.innerHTML=_highlight(text),this.domNode.normalize(),this.attach()),this.cachedText=text)}}]),SyntaxCodeBlock}(_interopRequireDefault(__webpack_require__(13)).default);SyntaxCodeBlock.className="ql-syntax";var CodeToken=new _parchment2.default.Attributor.Class("token","hljs",{scope:_parchment2.default.Scope.INLINE}),Syntax=function(_Module){function Syntax(quill,options){_classCallCheck(this,Syntax);var _this2=_possibleConstructorReturn(this,(Syntax.__proto__||Object.getPrototypeOf(Syntax)).call(this,quill,options));if("function"!=typeof _this2.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var timer=null;return _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE,(function(){clearTimeout(timer),timer=setTimeout((function(){_this2.highlight(),timer=null}),_this2.options.interval)})),_this2.highlight(),_this2}return _inherits(Syntax,_Module),_createClass(Syntax,null,[{key:"register",value:function register(){_quill2.default.register(CodeToken,!0),_quill2.default.register(SyntaxCodeBlock,!0)}}]),_createClass(Syntax,[{key:"highlight",value:function highlight(){var _this3=this;if(!this.quill.selection.composing){this.quill.update(_quill2.default.sources.USER);var range=this.quill.getSelection();this.quill.scroll.descendants(SyntaxCodeBlock).forEach((function(code){code.highlight(_this3.options.highlight)})),this.quill.update(_quill2.default.sources.SILENT),null!=range&&this.quill.setSelection(range,_quill2.default.sources.SILENT)}}}]),Syntax}(_module2.default);Syntax.DEFAULTS={highlight:null==window.hljs?null:function(text){var result;return window.hljs.highlightAuto(text).value},interval:1e3},exports.CodeBlock=SyntaxCodeBlock,exports.CodeToken=CodeToken,exports.default=Syntax},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(module,exports){module.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(module,exports){module.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(module,exports){module.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(module,exports){module.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(module,exports){module.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.BubbleTooltip=void 0;var _get=function get(object,property,receiver){null===object&&(object=Function.prototype);var desc=Object.getOwnPropertyDescriptor(object,property);if(void 0===desc){var parent=Object.getPrototypeOf(object);return null===parent?void 0:get(parent,property,receiver)}if("value"in desc)return desc.value;var getter=desc.get;return void 0!==getter?getter.call(receiver):void 0},_createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_extend,_extend2=_interopRequireDefault(__webpack_require__(3)),_emitter,_emitter2=_interopRequireDefault(__webpack_require__(8)),_base=__webpack_require__(43),_base2=_interopRequireDefault(_base),_selection=__webpack_require__(15),_icons,_icons2=_interopRequireDefault(__webpack_require__(41));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)}var TOOLBAR_CONFIG=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],BubbleTheme=function(_BaseTheme){function BubbleTheme(quill,options){_classCallCheck(this,BubbleTheme),null!=options.modules.toolbar&&null==options.modules.toolbar.container&&(options.modules.toolbar.container=TOOLBAR_CONFIG);var _this=_possibleConstructorReturn(this,(BubbleTheme.__proto__||Object.getPrototypeOf(BubbleTheme)).call(this,quill,options));return _this.quill.container.classList.add("ql-bubble"),_this}return _inherits(BubbleTheme,_BaseTheme),_createClass(BubbleTheme,[{key:"extendToolbar",value:function extendToolbar(toolbar){this.tooltip=new BubbleTooltip(this.quill,this.options.bounds),this.tooltip.root.appendChild(toolbar.container),this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")),_icons2.default),this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")),_icons2.default)}}]),BubbleTheme}(_base2.default);BubbleTheme.DEFAULTS=(0,_extend2.default)(!0,{},_base2.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function link(value){value?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var BubbleTooltip=function(_BaseTooltip){function BubbleTooltip(quill,bounds){_classCallCheck(this,BubbleTooltip);var _this2=_possibleConstructorReturn(this,(BubbleTooltip.__proto__||Object.getPrototypeOf(BubbleTooltip)).call(this,quill,bounds));return _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE,(function(type,range,oldRange,source){if(type===_emitter2.default.events.SELECTION_CHANGE)if(null!=range&&range.length>0&&source===_emitter2.default.sources.USER){_this2.show(),_this2.root.style.left="0px",_this2.root.style.width="",_this2.root.style.width=_this2.root.offsetWidth+"px";var lines=_this2.quill.getLines(range.index,range.length);if(1===lines.length)_this2.position(_this2.quill.getBounds(range));else{var lastLine=lines[lines.length-1],index=_this2.quill.getIndex(lastLine),length=Math.min(lastLine.length()-1,range.index+range.length-index),_bounds=_this2.quill.getBounds(new _selection.Range(index,length));_this2.position(_bounds)}}else document.activeElement!==_this2.textbox&&_this2.quill.hasFocus()&&_this2.hide()})),_this2}return _inherits(BubbleTooltip,_BaseTooltip),_createClass(BubbleTooltip,[{key:"listen",value:function listen(){var _this3=this;_get(BubbleTooltip.prototype.__proto__||Object.getPrototypeOf(BubbleTooltip.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",(function(){_this3.root.classList.remove("ql-editing")})),this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE,(function(){setTimeout((function(){if(!_this3.root.classList.contains("ql-hidden")){var range=_this3.quill.getSelection();null!=range&&_this3.position(_this3.quill.getBounds(range))}}),1)}))}},{key:"cancel",value:function cancel(){this.show()}},{key:"position",value:function position(reference){var shift=_get(BubbleTooltip.prototype.__proto__||Object.getPrototypeOf(BubbleTooltip.prototype),"position",this).call(this,reference),arrow=this.root.querySelector(".ql-tooltip-arrow");if(arrow.style.marginLeft="",0===shift)return shift;arrow.style.marginLeft=-1*shift-arrow.offsetWidth/2+"px"}}]),BubbleTooltip}(_base.BaseTooltip);BubbleTooltip.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),exports.BubbleTooltip=BubbleTooltip,exports.default=BubbleTheme},function(module,exports,__webpack_require__){module.exports=__webpack_require__(63)}]).default})),function(){"use strict";function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}"".trim||(String.prototype.trim=function(){return this.replace(/^[\s]+|[\s]+$/g,"")}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=e[i];if(t.call(r,o,i,e))return i;i++}return-1},configurable:!0,writable:!0}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},writable:!0,configurable:!0}),t.prototype=window.Event.prototype,"function"!=typeof window.CustomEvent&&(window.CustomEvent=t),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),document.execCommand("AutoUrlDetect",!1,!1),"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(t){if("Element"in t){var e="classList",n="prototype",r=t.Element[n],i=Object,o=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[n].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},u=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new u("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(e))throw new u("INVALID_CHARACTER_ERR","The token must not contain space characters.");return s.call(t,e)},a=function(t){for(var e=o.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],r=0,i=n.length;r<i;r++)this.push(n[r]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},f=a[n]=[],l=function(){return new a(this)};if(u[n]=Error[n],f.item=function(t){return this[t]||null},f.contains=function(t){return~c(this,t+"")},f.add=function(){for(var t,e=arguments,n=0,r=e.length,i=!1;~c(this,t=e[n]+"")||(this.push(t),i=!0),++n<r;);i&&this._updateClassName()},f.remove=function(){var t,e,n=arguments,r=0,i=n.length,o=!1;do{for(e=c(this,t=n[r]+"");~e;)this.splice(e,1),o=!0,e=c(this,t)}while(++r<i);o&&this._updateClassName()},f.toggle=function(t,e){var n=this.contains(t),r=n?!0!==e&&"remove":!1!==e&&"add";return r&&this[r](t),!0===e||!1===e?e:!n},f.replace=function(t,e){var n=c(t+"");~n&&(this.splice(n,1,e),this._updateClassName())},f.toString=function(){return this.join(" ")},i.defineProperty){var h={get:l,enumerable:!0,configurable:!0};try{i.defineProperty(r,e,h)}catch(t){void 0!==t.number&&-2146823252!==t.number||(h.enumerable=!1,i.defineProperty(r,e,h))}}else i[n].__defineGetter__&&r.__defineGetter__(e,l)}}(self),function(){var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var r=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var e,n=arguments.length;for(e=0;e<n;e++)t=arguments[e],r.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(t,e){var n=this.toString().split(" "),r=n.indexOf(t+"");~r&&(n=n.slice(r),this.remove.apply(this,n),this.add(e),this.add.apply(this,n.slice(1)))}),t=null}()),window.Promise=function(){function r(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function c(t){return"function"==typeof t}var t=void 0,n=t=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,e=void 0,o=void 0,s=function t(e,n){g[i]=e,g[i+1]=n,2===(i+=2)&&(o?o(w):A())};function u(t){o=t}function a(t){s=t}var f="undefined"!=typeof window?window:void 0,l=f||{},h=l.MutationObserver||l.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function v(){return function(){return process.nextTick(w)}}function y(){return void 0!==e?function(){e(w)}:b()}function m(){var t=0,e=new h(w),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function _(){var t=new MessageChannel;return t.port1.onmessage=w,function(){return t.port2.postMessage(0)}}function b(){var t=setTimeout;return function(){return t(w,1)}}var g=new Array(1e3);function w(){for(var t=0;t<i;t+=2){var e,n;(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}function E(){try{var t=Function("return this")().require("vertx");return e=t.runOnLoop||t.runOnContext,y()}catch(t){return b()}}var A=void 0;function O(t,e){var n=this,r=new this.constructor(T);void 0===r[j]&&W(r);var i=n._state;if(i){var o=arguments[i-1];s((function(){return $(i,r,o,n._result)}))}else G(n,r,t,e);return r}function S(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(T);return Y(n,t),n}A=p?v():h?m():d?_():void 0===f&&"function"==typeof require?E():b();var j=Math.random().toString(36).substring(2);function T(){}var C=void 0,L=1,P=2;function M(){return new TypeError("You cannot resolve a promise with itself")}function N(){return new TypeError("A promises callback cannot return that same promise.")}function k(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}function x(t,r,i){s((function(e){var n=!1,t=k(i,r,(function(t){n||(n=!0,r!==t?Y(e,t):I(e,t))}),(function(t){n||(n=!0,q(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&t&&(n=!0,q(e,t))}),t)}function D(e,t){1===t._state?I(e,t._result):2===t._state?q(e,t._result):G(t,void 0,(function(t){return Y(e,t)}),(function(t){return q(e,t)}))}function R(t,e,n){e.constructor===t.constructor&&n===O&&e.constructor.resolve===S?D(t,e):void 0===n?I(t,e):c(n)?x(t,e,n):I(t,e)}function Y(e,t){if(e===t)q(e,M());else if(r(t)){var n=void 0;try{n=t.then}catch(t){return void q(e,t)}R(e,t,n)}else I(e,t)}function F(t){t._onerror&&t._onerror(t._result),U(t)}function I(t,e){t._state===C&&(t._result=e,t._state=1,0!==t._subscribers.length&&s(U,t))}function q(t,e){t._state===C&&(t._state=2,t._result=e,s(F,t))}function G(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+1]=n,i[o+2]=r,0===o&&t._state&&s(U,t)}function U(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?$(n,r,i,o):i(o);t._subscribers.length=0}}function $(t,e,n,r){var i=c(n),o=void 0,s=void 0,u=!0;if(i){try{o=n(r)}catch(t){u=!1,s=t}if(e===o)return void q(e,N())}else o=r;e._state!==C||(i&&u?Y(e,o):!1===u?q(e,s):1===t?I(e,o):2===t&&q(e,o))}function H(n,t){try{t((function t(e){Y(n,e)}),(function t(e){q(n,e)}))}catch(t){q(n,t)}}var K=0;function V(){return K++}function W(t){t[j]=K++,t._state=void 0,t._result=void 0,t._subscribers=[]}function X(){return new Error("Array Methods must be provided an Array")}var z=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(T),this.promise[j]||W(this.promise),n(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&I(this.promise,this._result))):q(this.promise,X())}return t.prototype._enumerate=function t(e){for(var n=0;this._state===C&&n<e.length;n++)this._eachEntry(e[n],n)},t.prototype._eachEntry=function t(e,n){var r=this._instanceConstructor,i=r.resolve;if(i===S){var o=void 0,s=void 0,u=!1;try{o=e.then}catch(t){u=!0,s=t}if(o===O&&e._state!==C)this._settledAt(e._state,n,e._result);else if("function"!=typeof o)this._remaining--,this._result[n]=e;else if(r===et){var c=new r(T);u?q(c,s):R(c,e,o),this._willSettleAt(c,n)}else this._willSettleAt(new r((function(t){return t(e)})),n)}else this._willSettleAt(i(e),n)},t.prototype._settledAt=function t(e,n,r){var i=this.promise;i._state===C&&(this._remaining--,2===e?q(i,r):this._result[n]=r),0===this._remaining&&I(i,this._result)},t.prototype._willSettleAt=function t(e,n){var r=this;G(e,void 0,(function(t){return r._settledAt(1,n,t)}),(function(t){return r._settledAt(2,n,t)}))},t}();function B(t){return new z(this,t).promise}function J(i){var o=this;return n(i)?new o((function(t,e){for(var n=i.length,r=0;r<n;r++)o.resolve(i[r]).then(t,e)})):new o((function(t,e){return e(new TypeError("You must pass an array to race."))}))}function Q(t){var e=new this(T);return q(e,t),e}function Z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function tt(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var et=function(){function e(t){this[j]=V(),this._result=this._state=void 0,this._subscribers=[],T!==t&&("function"!=typeof t&&Z(),this instanceof e?H(this,t):tt())}return e.prototype.catch=function t(e){return this.then(null,e)},e.prototype.finally=function t(e){var n=this,r=n.constructor;return c(e)?n.then((function(t){return r.resolve(e()).then((function(){return t}))}),(function(t){return r.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();function nt(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=et}return et.prototype.then=O,et.all=function(t){return new z(this,t).promise},et.race=function(i){var o=this;return n(i)?new o((function(t,e){for(var n=i.length,r=0;r<n;r++)o.resolve(i[r]).then(t,e)})):new o((function(t,e){return e(new TypeError("You must pass an array to race."))}))},et.resolve=S,et.reject=function(t){var e=new this(T);return q(e,t),e},et._setScheduler=function(t){o=t},et._setAsap=function(t){s=t},et._asap=s,et.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=et},et.Promise=et}()}(),function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Tagify=e()}(this,(function(){"use strict";function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(i,!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(i).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var e="undefined"!=typeof InstallTrigger;function p(t){var e=Object.prototype.toString.call(t).split(" ")[1].slice(0,-1);return t===Object(t)&&"Array"!=e&&"Function"!=e&&"RegExp"!=e&&"HTMLUnknownElement"!=e}function d(t){var e=document.createElement("div");return t.replace(/\&#?[0-9a-z]+;/gi,(function(t){return e.innerHTML=t,e.innerText}))}function a(t){return(new DOMParser).parseFromString(t.trim(),"text/html").body.firstElementChild}function h(t){return t?t.replace(/\>[\r\n ]+\</g,"><").replace(/(<.*?>)|\s+/g,(function(t,e){return e||" "})):""}function o(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/`|'/g,"'")}function c(t,e,i){function s(t,e){for(var i in e)e.hasOwnProperty(i)&&(p(e[i])?p(t[i])?s(t[i],e[i]):t[i]=Object.assign({},e[i]):t[i]=e[i])}return t instanceof Object||(t={}),s(t,e),i&&s(t,i),t}function f(t){return String.prototype.normalize?"string"==typeof t?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:t}function t(t,e){if(!t)return console.warn("Tagify: ","invalid input element ",t),this;this.applySettings(t,e||{}),this.state={editing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},c(this,new this.EventDispatcher(this)),this.build(t),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),t.autofocus&&this.DOM.input.focus()}return(t.prototype={isIE:window.document.documentMode,TEXTS:{empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},DEFAULTS:{delimiters:",",pattern:null,maxTags:1/0,callbacks:{},addTagOnBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,keepInvalidTags:!1,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,editTags:2,transformTag:function(){},autoComplete:{enabled:!0,rightKey:!1},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:[],fuzzySearch:!0,accentedSearch:!0,highlightFirst:!1,closeOnSelect:!0,position:"all"},hooks:{beforeRemoveTag:function(){return Promise.resolve()}}},templates:{wrapper:function(t,e){return'<tags class="tagify '.concat(e.mode?"tagify--"+e.mode:""," ").concat(t.className,'"\n ').concat(e.readonly?"readonly":"",'\n tabIndex="-1">\n <span contenteditable data-placeholder="').concat(e.placeholder||"​",'" aria-placeholder="').concat(e.placeholder||"",'"\n class="tagify__input"\n role="textbox"\n aria-autocomplete="both"\n aria-multiline="').concat("mix"==e.mode,'"></span>\n </tags>')},tag:function(t,e){return'<tag title="'.concat(e.title||t,"\"\n contenteditable='false'\n spellcheck='false'\n tabIndex=\"-1\"\n class=\"tagify__tag ").concat(e.class?e.class:"",'"\n ').concat(this.getAttributes(e),">\n <x title='' class='tagify__tag__removeBtn' role='button' aria-label='remove tag'></x>\n <div>\n <span class='tagify__tag-text'>").concat(t,"</span>\n </div>\n </tag>")},dropdown:function(t){var e=t.dropdown,i="".concat("manual"==e.position?"":"tagify__dropdown tagify__dropdown--".concat(e.position)," ").concat(e.classname).trim();return'<div class="'.concat(i,'" role="listbox" aria-labelledby="dropdown">\n <div class="tagify__dropdown__wrapper"></div>\n </div>')},dropdownItem:function(t){return"<div ".concat(this.getAttributes(t),"\n class='tagify__dropdown__item ").concat(t.class?t.class:"",'\'\n tabindex="0"\n role="option">').concat(t.value,"</div>")}},customEventsList:["add","remove","invalid","input","click","keydown","focus","blur","edit:input","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select"],applySettings:function(i,t){var s=this;if(this.DEFAULTS.templates=this.templates,this.settings=c({},this.DEFAULTS,t),this.settings.readonly=i.hasAttribute("readonly"),this.settings.placeholder=i.getAttribute("placeholder")||this.settings.placeholder||"",this.isIE&&(this.settings.autoComplete=!1),["whitelist","blacklist"].forEach((function(t){var e=i.getAttribute("data-"+t);e&&(e=e.split(s.settings.delimiters))instanceof Array&&(s.settings[t]=e)})),"autoComplete"in t&&!p(t.autoComplete)&&(this.settings.autoComplete=this.DEFAULTS.autoComplete,this.settings.autoComplete.enabled=t.autoComplete),i.pattern)try{this.settings.pattern=new RegExp(i.pattern)}catch(t){}if(this.settings.delimiters)try{this.settings.delimiters=new RegExp(this.settings.delimiters,"g")}catch(t){}"select"==this.settings.mode&&(this.settings.dropdown.enabled=0),"mix"==this.settings.mode&&(this.settings.autoComplete.rightKey=!0)},getAttributes:function(t){if("[object Object]"!=Object.prototype.toString.call(t))return"";var e,i,s=Object.keys(t),n="";for(i=s.length;i--;)"class"!=(e=s[i])&&t.hasOwnProperty(e)&&t[e]&&(n+=" "+e+(t[e]?'="'.concat(t[e],'"'):""));return n},getCaretGlobalPosition:function(){var t=document.getSelection();if(t.rangeCount){var e,i,s=t.getRangeAt(0),n=s.startContainer,a=s.startOffset;return 0<a?((i=document.createRange()).setStart(n,a-1),i.setEnd(n,a),{left:(e=i.getBoundingClientRect()).right,top:e.top,bottom:e.bottom}):n.getBoundingClientRect()}return{left:-9999,top:-9999}},getCSSVars:function(){var t,e,i,s=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(t=function(t){if(!t)return{};var e=(t=t.trim().split(" ")[0]).split(/\d+/g).filter((function(t){return t})).pop().trim();return{value:+t.split(e).filter((function(t){return t}))[0].trim(),unit:e}}((i="tag-hide-transition",s.getPropertyValue("--"+i))),e=t.value,"s"==t.unit?1e3*e:e)}},build:function(t){var e=this.DOM,i=this.settings.templates.wrapper(t,this.settings);e.originalInput=t,e.scope=a(i),e.input=e.scope.querySelector("[contenteditable]"),t.parentNode.insertBefore(e.scope,t),0<=this.settings.dropdown.enabled&&this.dropdown.init.call(this)},destroy:function(){this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.dropdown.hide.call(this,!0),clearTimeout(this.dropdownHide__bindEventsTimeout)},loadOriginalValues:function(t){if(t=t||this.DOM.originalInput.value)if(this.removeAllTags(),"mix"==this.settings.mode)this.parseMixTags(t.trim());else{try{"string"!=typeof JSON.parse(t)&&(t=JSON.parse(t))}catch(t){}this.addTags(t).forEach((function(t){return t&&t.classList.add("tagify--noAnim")}))}},cloneEvent:function(t){var e={};for(var i in t)e[i]=t[i];return e},EventDispatcher:function(n){var a=document.createTextNode("");function i(e,t,i){i&&t.split(/\s+/g).forEach((function(t){return a[e+"EventListener"].call(a,t,i)}))}this.off=function(t,e){return i("remove",t,e),this},this.on=function(t,e){return e&&"function"==typeof e&&i("add",t,e),this},this.trigger=function(t,e){var i;if(t)if(n.settings.isJQueryPlugin)"remove"==t&&(t="removeTag"),jQuery(n.DOM.originalInput).triggerHandler(t,[e]);else{try{var s=c({},e);s.tagify=this,i=new CustomEvent(t,{detail:s})}catch(t){console.warn(t)}a.dispatchEvent(i)}}},loading:function(t){return this.state.isLoading=t,this.DOM.scope.classList[t?"add":"remove"]("tagify--loading"),this},toggleFocusClass:function(t){this.DOM.scope.classList.toggle("tagify--focus",!!t)},events:{customBinding:function(){var e=this;this.customEventsList.forEach((function(t){e.on(t,e.settings.callbacks[t])}))},binding:function(t){var e,i=!(0<arguments.length&&void 0!==t)||t,s=this.events.callbacks,n=i?"addEventListener":"removeEventListener";if(!this.state.mainEvents||!i)for(var a in(this.state.mainEvents=i)&&!this.listeners.main&&(this.DOM.input.addEventListener(this.isIE?"keydown":"input",s[this.isIE?"onInputIE":"onInput"].bind(this)),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),e=this.listeners.main=this.listeners.main||{focus:["input",s.onFocusBlur.bind(this)],blur:["input",s.onFocusBlur.bind(this)],keydown:["input",s.onKeydown.bind(this)],click:["scope",s.onClickScope.bind(this)],dblclick:["scope",s.onDoubleClickScope.bind(this)],paste:["input",s.onPaste.bind(this)]})"blur"==a&&!i||this.DOM[e[a][0]][n](a,e[a][1])},callbacks:{onFocusBlur:function(t){var e=t.target?t.target.textContent.trim():"",i=this.settings,s=t.type,n=0<=i.dropdown.enabled,a={relatedTarget:t.relatedTarget},o=t.relatedTarget&&t.relatedTarget.classList.contains("tagify__tag")&&this.DOM.scope.contains(t.relatedTarget),r=this.state.actions.selectOption&&(n||!i.dropdown.closeOnSelect),l=this.state.actions.addNew&&n;if(!o){if("blur"==s&&t.relatedTarget===this.DOM.scope)return this.dropdown.hide.call(this),void this.DOM.input.focus();if(!r&&!l)if(this.state.hasFocus="focus"==s&&+new Date,this.toggleFocusClass(this.state.hasFocus),this.setRangeAtStartEnd(!1),"mix"!=i.mode){if("focus"==s)return this.trigger("focus",a),void(0===i.dropdown.enabled&&this.dropdown.show.call(this));"blur"==s&&(this.trigger("blur",a),this.loading(!1),("select"==this.settings.mode?!this.value.length||this.value[0].value!=e:e&&!this.state.actions.selectOption&&i.addTagOnBlur)&&this.addTags(e,!0)),this.DOM.input.removeAttribute("style"),this.dropdown.hide.call(this)}else if("focus"==s){if(this.fixFirefoxLastTagNoCaret())return;this.trigger("focus",a)}else"blur"==t.type&&(this.trigger("blur",a),this.loading(!1),this.dropdown.hide.call(this),this.state.dropdown.visible=void 0)}},onKeydown:function(t){var s=this,e=t.target.textContent.trim();if(this.trigger("keydown",{originalEvent:this.cloneEvent(t)}),"mix"==this.settings.mode){switch(t.key){case"Left":case"ArrowLeft":this.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(this.state.editing)return;var i=document.getSelection(),n="Delete"==t.key&&i.anchorOffset==i.anchorNode.length,a=1==i.anchorNode.nodeType||!i.anchorOffset&&i.anchorNode.previousElementSibling,o=d(this.DOM.input.innerHTML),r=this.getTagElms();if(3==i.anchorNode.nodeType&&!i.anchorNode.nodeValue&&i.anchorNode.previousElementSibling&&t.preventDefault(),(a||n)&&!this.settings.backspace)return void t.preventDefault();setTimeout((function(){var t=d(s.DOM.input.innerHTML);if((i.anchorNode==s.DOM.input&&t.length==o.length||!i.anchorOffset&&t.length>=o.length)&&(s.removeTags(i.anchorNode.previousElementSibling),s.fixFirefoxLastTagNoCaret(),2==s.DOM.input.children.length&&"BR"==s.DOM.input.children[1].tagName))return s.DOM.input.innerHTML="",!(s.value.length=0);s.value=[].map.call(r,(function(t,e){var i=t.__tagifyTagData;if(t.parentNode)return i;s.trigger("remove",{tag:t,index:e,data:i})})).filter((function(t){return t}))}),50)}return!0}switch(t.key){case"Backspace":this.state.dropdown.visible||""!=e&&8203!=e.charCodeAt(0)||(!0===this.settings.backspace?this.removeTags():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0));break;case"Esc":case"Escape":if(this.state.dropdown.visible)return;t.target.blur();break;case"Down":case"ArrowDown":this.state.dropdown.visible||this.dropdown.show.call(this);break;case"ArrowRight":var l=this.state.inputSuggestion||this.state.ddItemData;if(l&&this.settings.autoComplete.rightKey)return void this.addTags([l],!0);break;case"Tab":if(!e||"select"==this.settings.mode)return!0;case"Enter":t.preventDefault(),setTimeout((function(){s.state.actions.selectOption||s.addTags(e,!0)}))}},onInput:function(t){var e=this.input.normalize.call(this),i=e.length>=this.settings.dropdown.enabled,s={value:e,inputElm:this.DOM.input};if("mix"==this.settings.mode)return this.events.callbacks.onMixTagsInput.call(this,t);s.isValid=this.validateTag({value:e}),this.trigger("input",s),e?this.input.value!=e&&(this.input.set.call(this,e,!1),-1!=e.search(this.settings.delimiters)?this.addTags(e)&&this.input.set.call(this):0<=this.settings.dropdown.enabled&&this.dropdown[i?"show":"hide"].call(this,e)):this.input.set.call(this,"")},onMixTagsInput:function(){var t,e,i,s,n,a,o,r,l=this,d=this.settings;if(this.value.length<this.getTagElms().length)return this.value=[].map.call(this.getTagElms(),(function(t){return t.__tagifyTagData})),void this.update();if(this.hasMaxTags())return!0;if(window.getSelection&&0<(o=window.getSelection()).rangeCount&&3==o.anchorNode.nodeType){if((t=o.getRangeAt(0).cloneRange()).collapse(!0),t.setStart(o.focusNode,0),s=(e=t.toString().slice(0,t.endOffset)).split(d.pattern).length-1,(i=e.match(d.pattern))&&(n=e.slice(e.lastIndexOf(i[i.length-1]))),n){this.state.actions.ArrowLeft=!1,this.state.tag={prefix:n.match(d.pattern)[0],value:n.replace(d.pattern,"")},this.state.tag.baseOffset=o.baseOffset-this.state.tag.value.length,a=this.state.tag.value.length>=d.dropdown.enabled;try{r=(r=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&r.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch(t){}(r||s<this.state.mixMode.matchedPatternCount)&&(a=!1)}else this.state.flaggedTags={};this.state.mixMode.matchedPatternCount=s}setTimeout((function(){l.update(),l.trigger("input",c({},l.state.tag,{textContent:l.DOM.input.textContent})),l.state.tag&&l.dropdown[a?"show":"hide"].call(l,l.state.tag.value)}),10)},onInputIE:function(t){var e=this;setTimeout((function(){e.events.callbacks.onInput.call(e,t)}))},onClickScope:function(t){var e=t.target.closest(".tagify__tag"),i=this.settings,s=new Date-this.state.hasFocus;if(t.target!=this.DOM.scope){if(!t.target.classList.contains("tagify__tag__removeBtn"))return e?(this.trigger("click",{tag:e,index:this.getNodeIndex(e),data:this.tagData(e),originalEvent:this.cloneEvent(t)}),void(1==this.settings.editTags&&this.events.callbacks.onDoubleClickScope.call(this,t))):void(t.target==this.DOM.input&&500<s?this.state.dropdown.visible?this.dropdown.hide.call(this):0===i.dropdown.enabled&&"mix"!=i.mode&&this.dropdown.show.call(this):"select"==i.mode&&(this.state.dropdown.visible||this.dropdown.show.call(this)));this.removeTags(t.target.parentNode)}else this.DOM.input.focus()},onPaste:function(t){var e;"mix"!=this.settings.mode&&(t.preventDefault(),e=(t.clipboardData||window.clipboardData).getData("Text"),this.input.set.call(this,e))},onEditTagInput:function(t,e){var i=t.closest(".tagify__tag"),s=this.getNodeIndex(i),n=this.input.normalize.call(this,t),a=n!=t.originalValue,o=this.validateTag({value:n});a||!0!==t.originalIsValid||(o=!0),i.classList.toggle("tagify--invalid",!0!==o),i.__tagifyTagData.__isValid=o,n.length>=this.settings.dropdown.enabled&&(this.state.editing.value=n,this.dropdown.show.call(this,n)),this.trigger("edit:input",{tag:i,index:s,data:c({},this.value[s],{newValue:n}),originalEvent:this.cloneEvent(e)})},onEditTagFocus:function(t){this.state.editing={scope:t,input:t.querySelector("[contenteditable]")}},onEditTagBlur:function(t){if(this.state.editing=!1,this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(t)){var e=t.closest(".tagify__tag"),i=this.input.normalize.call(this,t),s=i,n=s!=t.originalValue,a=c({},e.__tagifyTagData,{value:s}),o=this.validateTag(a);if(!i)return this.removeTags(e),void this.onEditTagDone(null,a);n?(this.settings.transformTag.call(this,a),!0===(o=this.validateTag(a))?this.onEditTagDone(e,a):this.trigger("invalid",{data:a,tag:e,message:o})):this.onEditTagDone(e,a)}},onEditTagkeydown:function(t,e){switch(this.trigger("edit:keydown",{originalEvent:this.cloneEvent(t)}),t.key){case"Esc":case"Escape":t.target.textContent=t.target.originalValue,e.__tagifyTagData=e.__tagifyTagData.__originalData;case"Enter":case"Tab":t.preventDefault(),t.target.blur()}},onDoubleClickScope:function(t){var e,i,s=t.target.closest("tag"),n=this.settings;s&&(e=s.classList.contains("tagify__tag--editable"),i=s.hasAttribute("readonly"),"select"==n.mode||n.readonly||e||i||!this.settings.editTags||this.editTag(s),this.toggleFocusClass(!0),this.trigger("dblclick",{tag:s,index:this.getNodeIndex(s),data:this.tagData(s)}))}}},fixFirefoxLastTagNoCaret:function(){var t=this.DOM.input;if(e&&t.childNodes.length&&1==t.lastChild.nodeType)return t.appendChild(document.createTextNode("")),this.setRangeAtStartEnd(!0),!0},editTag:function(e,t){var i=this;t=t||{};var s=(e=e||this.getLastTag()).querySelector(".tagify__tag-text"),n=this.getNodeIndex(e),a=e.__tagifyTagData,o=this.events.callbacks,r=this,l=!0;if(s){if(!(a instanceof Object&&"editable"in a)||a.editable)return e.__tagifyTagData.__originalData=c({},a),e.classList.add("tagify__tag--editable"),s.originalValue=s.textContent,s.setAttribute("contenteditable",!0),s.addEventListener("focus",o.onEditTagFocus.bind(this,e)),s.addEventListener("blur",(function(){setTimeout(o.onEditTagBlur.bind(r),0,s)})),s.addEventListener("input",o.onEditTagInput.bind(this,s)),s.addEventListener("keydown",(function(t){return o.onEditTagkeydown.call(i,t,e)})),s.focus(),this.setRangeAtStartEnd(!1,s),t.skipValidation||(l=this.editTagToggleValidity(e,a.value)),s.originalIsValid=l,this.trigger("edit:start",{tag:e,index:n,data:a,isValid:l}),this}else console.warn("Cannot find element in Tag template: ",".tagify__tag-text")},editTagToggleValidity:function(t){var e,i=t.__tagifyTagData;if(i)return e=!(!i.__isValid||1==i.__isValid),t.classList.toggle("tagify--invalid",e),i.__isValid;console.warn("tag has no data: ",t,i)},onEditTagDone:function(t,e){var i=this;e=e||{};var s={tag:t,index:this.getNodeIndex(t),data:e};this.trigger("edit:beforeUpdate",s),delete e.__originalData,t&&(this.editTagToggleValidity(t),this.replaceTag(t,e)),this.trigger("edit:updated",s),this.dropdown.hide.call(this),!0===e.__isValid&&this.getTagElms("tagify--notAllowed").forEach((function(t){var e=i.validateTag(t.__tagifyTagData);!0===e&&(t.__tagifyTagData.__isValid=e,i.replaceTag(t))}))},replaceTag:function(t,e){e&&e.value||(e=t.__tagifyTagData),e.__isValid&&1!=e.__isValid&&c(e,this.getInvaildTagParams(e,e.__isValid));var i=this.createTagElem(e);t.parentNode.replaceChild(i,t),this.updateValueByDOMTags()},updateValueByDOMTags:function(){var e=this;this.value.length=0,[].forEach.call(this.getTagElms(),(function(t){t.classList.contains("tagify--notAllowed")||e.value.push(t.__tagifyTagData)})),this.update()},setRangeAtStartEnd:function(e,i){i=(i=i||this.DOM.input).lastChild||i;var s=document.getSelection();s.rangeCount&&["Start","End"].forEach((function(t){return s.getRangeAt(0)["set"+t](i,e?0:i.length)}))},input:{value:"",set:function(t,e){var i=0<arguments.length&&void 0!==t?t:"",s=!(1<arguments.length&&void 0!==e)||e,n=this.settings.dropdown.closeOnSelect;this.input.value=i,s&&(this.DOM.input.innerHTML=i),!i&&n&&setTimeout(this.dropdown.hide.bind(this),20),this.input.autocomplete.suggest.call(this),this.input.validate.call(this),this.setRangeAtStartEnd()},validate:function(){var t=!this.input.value||this.validateTag({value:this.input.value});"select"==this.settings.mode?this.DOM.scope.classList.toggle("tagify--invalid",!0!==t):this.DOM.input.classList.toggle("tagify__input--invalid",!0!==t)},normalize:function(t){var e=t||this.DOM.input,i=[];e.childNodes.forEach((function(t){return 3==t.nodeType&&i.push(t.nodeValue)})),i=i.join("\n");try{i=i.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch(t){}return i=i.replace(/\s/g," ").replace(/^\s+/,"")},autocomplete:{suggest:function(t){if(this.settings.autoComplete.enabled){"string"==typeof(t=t||{})&&(t={value:t});var e=t.value||"",i=e.substr(0,this.input.value.length).toLowerCase(),s=e.substring(this.input.value.length);e&&this.input.value&&i==this.input.value.toLowerCase()?(this.DOM.input.setAttribute("data-suggest",s),this.state.inputSuggestion=t):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}},set:function(t){var e=this.DOM.input.getAttribute("data-suggest"),i=t||(e?this.input.value+e:null);return!!i&&("mix"==this.settings.mode?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+i)):(this.input.set.call(this,i),this.setRangeAtStartEnd()),this.input.autocomplete.suggest.call(this),this.dropdown.hide.call(this),!0)}}},getTagIdx:function(e){return this.value.findIndex((function(t){return JSON.stringify(t)==JSON.stringify(e)}))},getNodeIndex:function(t){var e=0;if(t)for(;t=t.previousElementSibling;)e++;return e},getTagElms:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var s=[".tagify__tag"].concat(e).join(".");return this.DOM.scope.querySelectorAll(s)},getLastTag:function(){var t=this.DOM.scope.querySelectorAll("tag:not(.tagify--hide):not([readonly])");return t[t.length-1]},tagData:function(t,e){return e&&(t.__tagifyTagData=c({},t.__tagifyTagData||{},e)),t.__tagifyTagData},isTagDuplicate:function(i){return"select"!=this.settings.mode&&this.value.reduce((function(t,e){return i.trim().toLowerCase()===e.value.toLowerCase()?t+1:t}),0)},getTagIndexByValue:function(i){var s=[];return this.getTagElms().forEach((function(t,e){t.textContent.trim().toLowerCase()==i.toLowerCase()&&s.push(e)})),s},getTagElmByValue:function(t){var e=this.getTagIndexByValue(t)[0];return this.getTagElms()[e]},markTagByValue:function(t,e){return!!(e=e||this.getTagElmByValue(t))&&(e.classList.add("tagify--mark"),setTimeout((function(){e.classList.remove("tagify--mark")}),100),e)},isTagBlacklisted:function(e){return e=e.toLowerCase().trim(),this.settings.blacklist.filter((function(t){return e==t.toLowerCase()})).length},isTagWhitelisted:function(e){return this.settings.whitelist.some((function(t){return"string"==typeof e?e.trim().toLowerCase()===(t.value||t).toLowerCase():JSON.stringify(t).toLowerCase()===JSON.stringify(e).toLowerCase()}))},validateTag:function(t){var e=t.value.trim(),i=this.settings,s=!0;return e?i.pattern&&i.pattern instanceof RegExp&&!i.pattern.test(e)?s=this.TEXTS.pattern:!i.duplicates&&this.isTagDuplicate(e)?s=this.TEXTS.duplicate:(this.isTagBlacklisted(e)||i.enforceWhitelist&&!this.isTagWhitelisted(e))&&(s=this.TEXTS.notAllowed):s=this.TEXTS.empty,s},getInvaildTagParams:function(t,e){return{"aria-invalid":!0,class:(t.class||"")+" tagify--notAllowed",title:e}},hasMaxTags:function(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},normalizeTags:function(t){function i(t){return(t+"").split(a).filter((function(t){return t})).map((function(t){return{value:t.trim()}}))}var e,s=this.settings,n=s.whitelist,a=s.delimiters,o=s.mode,r=!!n&&n[0]instanceof Object,l=t instanceof Array,d=l&&t[0]instanceof Object&&"value"in t[0],c=[];if(d)return(e=[]).concat.apply(e,u(t.map((function(e){return i(e.value).map((function(t){return g(g({},e),t)}))}))));if("number"==typeof t&&(t=t.toString()),"string"==typeof t){if(!t.trim())return[];t=i(t)}else if(l){var h;t=(h=[]).concat.apply(h,u(t.map((function(t){return i(t)}))))}return r&&(t.forEach((function(e){var t=n.filter((function(t){return t.value.toLowerCase()==e.value.toLowerCase()}));t[0]?c.push(t[0]):"mix"!=o&&c.push(e)})),c.length&&(t=c)),t},parseMixTags:function(t){var o=this,e=this.settings,r=e.mixTagsInterpolator,l=e.duplicates,d=e.transformTag,c=e.enforceWhitelist,h=[];return t=t.split(r[0]).map((function(t,e){var i,s,n=t.split(r[1]),a=n[0];try{i=JSON.parse(a)}catch(t){i=o.normalizeTags(a)[0]}if(!(1<n.length)||c&&!o.isTagWhitelisted(i.value)||!l&&o.isTagDuplicate(i.value)){if(t)return e?r[0]+t:t}else d.call(o,i),s=o.createTagElem(i),h.push(i),s.classList.add("tagify--noAnim"),n[0]=s.outerHTML,o.value.push(i);return n.join("")})).join(""),this.DOM.input.innerHTML=t,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize(),this.getTagElms().forEach((function(t,e){return t.__tagifyTagData=h[e]})),this.update(),t},replaceTextWithNode:function(t,e){if(this.state.tag||e){e=e||this.state.tag.prefix+this.state.tag.value;var i,s,n=this.state.selection||window.getSelection(),a=n.anchorNode;return a.splitText(n.anchorOffset),i=a.nodeValue.lastIndexOf(e),(s=a.splitText(i)).nodeValue=s.nodeValue.replace(e,""),a.parentNode.insertBefore(t,s),this.DOM.input.normalize(),s}},selectTag:function(t,e){if(!this.settings.enforceWhitelist||this.isTagWhitelisted(e.value))return this.input.set.call(this,e.value,!0),this.state.actions.selectOption&&setTimeout(this.setRangeAtStartEnd.bind(this)),this.getLastTag()?this.replaceTag(this.getLastTag(),e):this.appendTag(t),this.value[0]=e,this.trigger("add",{tag:t,data:e}),this.update(),[t]},addEmptyTag:function(){var t={value:""},e=this.createTagElem(t);e.__tagifyTagData=t,this.appendTag(e),this.editTag(e,{skipValidation:!0})},addTags:function(t,e,i){var s,n=this,a=2<arguments.length&&void 0!==i?i:this.settings.skipInvalid,o=[],r=this.settings;return t&&0!=t.length?(t=this.normalizeTags(t),"mix"==r.mode?(r.transformTag.call(this,t[0]),s=this.createTagElem(t[0]),this.replaceTextWithNode(s)||this.DOM.input.appendChild(s),setTimeout((function(){return s.classList.add("tagify--noAnim")}),300),t[0].prefix=t[0].prefix||this.state.tag?this.state.tag.prefix:(r.pattern.source||r.pattern)[0],this.value.push(t[0]),this.update(),this.state.tag=null,this.trigger("add",c({},{tag:s},{data:t[0]})),this.fixFirefoxLastTagNoCaret(),s):("select"==r.mode&&(e=!1),this.DOM.input.removeAttribute("style"),t.forEach((function(t){var e,i={};if(t=Object.assign({},t),r.transformTag.call(n,t),t.__isValid=n.hasMaxTags()||n.validateTag(t),!0!==t.__isValid){if(a)return;c(i,n.getInvaildTagParams(t,t.__isValid)),t.__isValid==n.TEXTS.duplicate&&n.markTagByValue(t.value)}if(i.role="tag",t.readonly&&(i["aria-readonly"]=!0),(e=n.createTagElem(c({},t,i))).__tagifyTagData=t,o.push(e),"select"==r.mode)return n.selectTag(e,t);n.appendTag(e),t.__isValid&&!0===t.__isValid?(n.value.push(t),n.update(),n.trigger("add",{tag:e,index:n.value.length-1,data:t})):(n.trigger("invalid",{data:t,index:n.value.length,tag:e,message:t.__isValid}),r.keepInvalidTags||setTimeout((function(){return n.removeTags(e,!0)}),1e3)),n.dropdown.position.call(n)})),t.length&&e&&this.input.set.call(this),this.dropdown.refilter.call(this),o)):("select"==r.mode&&this.removeAllTags(),o)},appendTag:function(t){var e=this.DOM.scope.lastElementChild;e===this.DOM.input?this.DOM.scope.insertBefore(t,e):this.DOM.scope.appendChild(t)},createTagElem:function(t){var e,i=o(t.value),s=this.settings.templates.tag.call(this,i,t);return this.settings.readonly&&(t.readonly=!0),(e=a(s=h(s))).__tagifyTagData=t,e},reCheckInvalidTags:function(){var n=this,t=this.DOM.scope.querySelectorAll(".tagify__tag.tagify--notAllowed");[].forEach.call(t,(function(t){var e=t.__tagifyTagData,i=t.getAttribute("title")==n.TEXTS.duplicate,s=!0===n.validateTag(e);i&&s&&(e.__isValid=!0,n.replaceTag(t,e))}))},removeTags:function(t,i,s){var n,a=this;t=t&&t instanceof HTMLElement?[t]:t instanceof Array?t:t?[t]:[this.getLastTag()],n=t.reduce((function(t,e){return e&&("string"==typeof e&&(e=a.getTagElmByValue(e)),e&&t.push({node:e,data:e.__tagifyTagData})),t}),[]),s="number"==typeof s?s:this.CSSVars.tagHideTransition,"select"==this.settings.mode&&(s=0,this.input.set.call(this)),1==n.length&&n[0].node.classList.contains("tagify--notAllowed")&&(i=!0),this.settings.hooks.beforeRemoveTag(n).then((function(){function e(t){if(t.node.parentNode){var e=this.getTagIdx(t.data);t.node.parentNode.removeChild(t.node),i?this.settings.keepInvalidTags&&this.trigger("remove",{tag:t.node,index:e}):(this.trigger("remove",{tag:t.node,index:e,data:t.data}),this.dropdown.refilter.call(this),this.dropdown.position.call(this),this.DOM.input.normalize(),this.settings.keepInvalidTags&&this.reCheckInvalidTags())}}s&&10<s&&1==n.length?function(t){t.node.style.width=parseFloat(window.getComputedStyle(t.node).width)+"px",document.body.clientTop,t.node.classList.add("tagify--hide"),setTimeout(e.bind(this),s,t)}.call(a,n[0]):n.forEach(e.bind(a)),i||(n.forEach((function(t){var e=a.getTagIdx(t.data);-1<e&&a.value.splice(e,1)})),a.update())})).catch((function(t){}))},removeAllTags:function(){this.value=[],"mix"==this.settings.mode?this.DOM.input.innerHTML="":Array.prototype.slice.call(this.getTagElms()).forEach((function(t){return t.parentNode.removeChild(t)})),this.dropdown.position.call(this),"select"==this.settings.mode&&this.input.set.call(this),this.update()},removeValueById:function(){},preUpdate:function(){this.DOM.scope.classList.toggle("tagify--hasMaxTags",this.value.length>=this.settings.maxTags),this.DOM.scope.classList.toggle("tagify--noTags",!this.value.length)},update:function(){this.preUpdate();var t=this.DOM.originalInput,e=t.value,i=function(t,s){return t.map((function(t){var e={};for(var i in t)i!=s&&(e[i]=t[i]);return e}))}(this.value,"__isValid"),s=new CustomEvent("change",{bubbles:!0});t.value="mix"==this.settings.mode?this.getMixedTagsAsString(i):i.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(i):JSON.stringify(i):"",s.simulated=!0,t._valueTracker&&t._valueTracker.setValue(e),t.dispatchEvent(s)},getMixedTagsAsString:function(){var i="",s=this,n=this.settings.mixTagsInterpolator;return function e(t){t.childNodes.forEach((function(t){if(1==t.nodeType){if(t.classList.contains("tagify__tag")&&t.__tagifyTagData)return void(i+=n[0]+JSON.stringify(t.__tagifyTagData)+n[1]);"BR"!=t.tagName||t.parentNode!=s.DOM.input&&1!=t.parentNode.childNodes.length?"DIV"!=t.tagName&&"P"!=t.tagName||(i+="\r\n",e(t)):i+="\r\n"}else i+=t.textContent}))}(this.DOM.input),i},getNodeHeight:function(t){var e,i=t.cloneNode(!0);return i.style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(i),e=i.clientHeight,i.parentNode.removeChild(i),e},dropdown:{init:function(){this.DOM.dropdown=a(this.settings.templates.dropdown(this.settings)),this.DOM.dropdown.content=this.DOM.dropdown.querySelector(".tagify__dropdown__wrapper")},show:function(t){var e,i,s,n,a=this,o=this.settings,r=window.getSelection(),l="mix"==o.mode&&!o.enforceWhitelist,d=!o.whitelist||!o.whitelist.length,c="manual"==o.dropdown.position;if(!(d&&!l||!1===o.dropdown.enable||this.state.isLoading)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems.call(this,t),this.suggestedListItems.length)t&&l&&!this.state.editing.scope&&!function(t,e){return t.toLowerCase()==e.toLowerCase()}(this.suggestedListItems[0].value,t)&&this.suggestedListItems.unshift({value:t});else{if(!t||!l||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),this.dropdown.hide.call(this),void this.events.binding.call(this);this.suggestedListItems=[{value:t}]}s=p(i=this.suggestedListItems[0])?i.value:i,o.autoComplete&&s&&0==s.indexOf(t)&&this.input.autocomplete.suggest.call(this,i),e=this.dropdown.createListHTML.call(this,this.suggestedListItems),this.DOM.dropdown.content.innerHTML=h(e),(o.enforceWhitelist&&!c||o.dropdown.highlightFirst)&&this.dropdown.highlightOption.call(this,this.DOM.dropdown.content.children[0]),this.DOM.scope.setAttribute("aria-expanded",!0),this.trigger("dropdown:show",this.DOM.dropdown),this.state.dropdown.visible=t||!0,this.state.selection={anchorOffset:r.anchorOffset,anchorNode:r.anchorNode},this.dropdown.position.call(this),document.body.contains(this.DOM.dropdown)||(c||(this.events.binding.call(this,!1),n=this.getNodeHeight(this.DOM.dropdown),this.DOM.dropdown.classList.add("tagify__dropdown--initial"),this.dropdown.position.call(this,n),document.body.appendChild(this.DOM.dropdown),setTimeout((function(){return a.DOM.dropdown.classList.remove("tagify__dropdown--initial")}))),setTimeout(this.dropdown.events.binding.bind(this)))}},hide:function(t){var e=this.DOM,i=e.scope,s=e.dropdown,n="manual"==this.settings.dropdown.position&&!t;s&&document.body.contains(s)&&!n&&(window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),clearTimeout(this.dropdownHide__bindEventsTimeout),this.dropdownHide__bindEventsTimeout=setTimeout(this.events.binding.bind(this),250),i.setAttribute("aria-expanded",!1),s.parentNode.removeChild(s),this.state.dropdown.visible=!1,this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",s))},refilter:function(){this.suggestedListItems=this.dropdown.filterListItems.call(this,"");var t=this.dropdown.createListHTML.call(this,this.suggestedListItems);this.DOM.dropdown.content.innerHTML=h(t),this.trigger("dropdown:updated",this.DOM.dropdown)},position:function(t){var e,i,s,n,a,o,r=this.DOM.dropdown,l=this.DOM["input"==this.settings.dropdown.position?"input":"scope"];this.state.dropdown.visible&&(o="text"==this.settings.dropdown.position?(n=(i=this.getCaretGlobalPosition()).bottom,s=i.top,a=i.left,"auto"):(s=(i=l.getBoundingClientRect()).top,n=i.bottom-1,a=i.left,i.width+"px"),s=Math.floor(s),n=Math.ceil(n),e=document.documentElement.clientHeight-n<(t||r.clientHeight),r.style.cssText="left:"+(a+window.pageXOffset)+"px; width:"+o+";"+(e?"bottom:"+(document.documentElement.clientHeight-s-window.pageYOffset-2)+"px;":"top: "+(n+window.pageYOffset)+"px"),r.setAttribute("placement",e?"top":"bottom"))},events:{binding:function(t){var e=!(0<arguments.length&&void 0!==t)||t,i=this.dropdown.events.callbacks,s=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this),onKeyDown:i.onKeyDown.bind(this),onMouseOver:i.onMouseOver.bind(this),onMouseLeave:i.onMouseLeave.bind(this),onClick:i.onClick.bind(this),onScroll:i.onScroll.bind(this)},n=e?"addEventListener":"removeEventListener";"manual"!=this.settings.dropdown.position&&(window[n]("resize",s.position),window[n]("keydown",s.onKeyDown)),this.DOM.dropdown[n]("mouseover",s.onMouseOver),this.DOM.dropdown[n]("mouseleave",s.onMouseLeave),this.DOM.dropdown[n]("mousedown",s.onClick),this.DOM.dropdown.content[n]("scroll",s.onScroll),this.DOM[this.listeners.main.click[0]][n]("click",this.listeners.main.click[1])},callbacks:{onKeyDown:function(t){var e=this.DOM.dropdown.querySelector("[class$='--active']"),i=e;switch(t.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":var s;t.preventDefault(),i=(i=i&&i[("ArrowUp"==t.key||"Up"==t.key?"previous":"next")+"ElementSibling"])||(s=this.DOM.dropdown.content.children)["ArrowUp"==t.key||"Up"==t.key?s.length-1:0],this.dropdown.highlightOption.call(this,i,!0);break;case"Escape":case"Esc":this.dropdown.hide.call(this);break;case"ArrowRight":if(this.state.actions.ArrowLeft)return;case"Tab":if("mix"!=this.settings.mode&&!this.settings.autoComplete.rightKey){try{var n=i?i.textContent:this.suggestedListItems[0].value;this.input.autocomplete.set.call(this,n)}catch(t){}return!1}case"Enter":t.preventDefault(),this.dropdown.selectOption.call(this,e);break;case"Backspace":if("mix"==this.settings.mode||this.state.editing.scope)return;var a=this.input.value.trim();""!=a&&8203!=a.charCodeAt(0)||(!0===this.settings.backspace?this.removeTags():"edit"==this.settings.backspace&&setTimeout(this.editTag.bind(this),0))}},onMouseOver:function(t){var e=t.target.closest(".tagify__dropdown__item");e&&this.dropdown.highlightOption.call(this,e)},onMouseLeave:function(){this.dropdown.highlightOption.call(this)},onClick:function(t){if(0==t.button&&t.target!=this.DOM.dropdown){var e=t.target.closest(".tagify__dropdown__item");t.target.closest(".tagify__dropdown__addNewBtn"),e&&this.dropdown.selectOption.call(this,e)}},onScroll:function(t){var e=t.target,i=e.scrollTop/(e.scrollHeight-e.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(i)})}}},highlightOption:function(t,e){var i,s="tagify__dropdown__item--active";if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(s),this.state.ddItemElm.removeAttribute("aria-selected")),!t)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);i=this.suggestedListItems[this.getNodeIndex(t)],this.state.ddItemData=i,(this.state.ddItemElm=t).classList.add(s),t.setAttribute("aria-selected",!0),e&&(t.parentNode.scrollTop=t.clientHeight+t.offsetTop-t.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,i),"manual"!=this.settings.dropdown.position&&this.dropdown.position.call(this))},selectOption:function(t){var e=this;if(t){this.state.actions.selectOption=!0,setTimeout((function(){return e.state.actions.selectOption=!1}),50);var i=this.settings.dropdown.closeOnSelect,s=this.suggestedListItems[this.getNodeIndex(t)].value||this.input.value;this.trigger("dropdown:select",s),this.state.editing?this.onEditTagDone(this.state.editing.scope,g(g({},this.state.editing.scope.__tagifyTagData),{},{value:s,__isValid:!0})):this.addTags([s],!0),setTimeout((function(){e.DOM.input.focus(),e.toggleFocusClass(!0)})),i&&this.dropdown.hide.call(this)}},filterListItems:function(t){var i,e,s,n,a,o=this,r=this.settings,l=[],d=r.whitelist,c=r.dropdown.maxItems||1/0,h=r.dropdown.searchKeys.concat(["searchBy","value"]),g=0;if(!t)return(r.duplicates?d:d.filter((function(t){return!o.isTagDuplicate(p(t)?t.value:t)}))).slice(0,c);for(;g<d.length&&(i=d[g]instanceof Object?d[g]:{value:d[g]},n=h.reduce((function(t,e){return t+" "+(i[e]||"")}),"").toLowerCase(),s=r.dropdown.accentedSearch?f(n).indexOf(f(t.toLowerCase())):n.indexOf(t.toLowerCase()),e=r.dropdown.fuzzySearch?0<=s:0==s,a=!r.duplicates&&this.isTagDuplicate(p(i)?i.value:i),e&&!a&&c--&&l.push(i),0!=c);g++);return l},createListHTML:function(t){var s=this;return t.map((function(t){"string"==typeof t&&(t={value:t});var e=s.settings.dropdown.mapValueTo,i=c({},t,{value:o((e?"function"==typeof e?e(t):t[e]:t.value)||"")});return s.settings.templates.dropdownItem.call(s,i)})).join("")}}}).removeTag=t.prototype.removeTags,t})),
|
||
/*!
|
||
*
|
||
* Super simple wysiwyg editor v0.8.18
|
||
* https://summernote.org
|
||
*
|
||
*
|
||
* Copyright 2013- Alan Hong. and other contributors
|
||
* summernote may be freely distributed under the MIT license.
|
||
*
|
||
* Date: 2020-05-20T16:47Z
|
||
*
|
||
*/
|
||
function webpackUniversalModuleDefinition(root,factory){if("object"==typeof exports&&"object"==typeof module)module.exports=factory(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],factory);else{var a="object"==typeof exports?factory(require("jquery")):factory(root.jQuery);for(var i in a)("object"==typeof exports?exports:root)[i]=a[i]}}(window,(function(__WEBPACK_EXTERNAL_MODULE__0__){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{enumerable:!0,get:getter})},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.t=function(value,mode){if(1&mode&&(value=__webpack_require__(value)),8&mode)return value;if(4&mode&&"object"==typeof value&&value&&value.__esModule)return value;var ns=Object.create(null);if(__webpack_require__.r(ns),Object.defineProperty(ns,"default",{enumerable:!0,value:value}),2&mode&&"string"!=typeof value)for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module.default}:function getModuleExports(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=53)}({0:function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE__0__},1:function(module,__webpack_exports__,__webpack_require__){"use strict";var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}var Renderer=function(){function Renderer(markup,children,options,callback){_classCallCheck(this,Renderer),this.markup=markup,this.children=children,this.options=options,this.callback=callback}return _createClass(Renderer,[{key:"render",value:function render($parent){var $node=jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.markup);if(this.options&&this.options.contents&&$node.html(this.options.contents),this.options&&this.options.className&&$node.addClass(this.options.className),this.options&&this.options.data&&jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(this.options.data,(function(k,v){$node.attr("data-"+k,v)})),this.options&&this.options.click&&$node.on("click",this.options.click),this.children){var $container=$node.find(".note-children-container");this.children.forEach((function(child){child.render($container.length?$container:$node)}))}return this.callback&&this.callback($node,this.options),this.options&&this.options.callback&&this.options.callback($node),$parent&&$parent.append($node),$node}}]),Renderer}();__webpack_exports__.a={create:function create(markup,callback){return function(){var options="object"===_typeof(arguments[1])?arguments[1]:arguments[0],children=Array.isArray(arguments[0])?arguments[0]:[];return options&&options.children&&(children=options.children),new Renderer(markup,children,options,callback)}}}},2:function(module,exports){(function(__webpack_amd_options__){module.exports=__webpack_amd_options__}).call(this,{})},3:function(module,__webpack_exports__,__webpack_require__){"use strict";var external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_=__webpack_require__(0),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default=__webpack_require__.n(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_);external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote||{lang:{}},external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size",sizeunit:"Font Size Unit"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize full",resizeHalf:"Resize half",resizeQuarter:"Resize quarter",resizeNone:"Original size",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Remove float",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image",original:"Original"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window",useProtocol:"Use default protocol"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Text Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default",cpSelect:"Select"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{escape:"Escape",insertParagraph:"Insert Paragraph",undo:"Undo the last command",redo:"Redo the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"},output:{noSelection:"No Selection Made!"}}});var isSupportAmd="function"==typeof define&&__webpack_require__(2),genericFontFamilies=["sans-serif","serif","monospace","cursive","fantasy"];function validFontName(fontName){return-1===external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.inArray(fontName.toLowerCase(),genericFontFamilies)?"'".concat(fontName,"'"):fontName}function env_isFontInstalled(fontName){var testFontName="Comic Sans MS"===fontName?"Courier New":"Comic Sans MS",testText="mmmmmmmmmmwwwww",testSize="200px",canvas,context=document.createElement("canvas").getContext("2d");context.font="200px '"+testFontName+"'";var originalWidth=context.measureText(testText).width,width;return context.font="200px "+validFontName(fontName)+', "'+testFontName+'"',originalWidth!==context.measureText(testText).width}var userAgent=navigator.userAgent,isMSIE=/MSIE|Trident/i.test(userAgent),browserVersion;if(isMSIE){var matches=/MSIE (\d+[.]\d+)/.exec(userAgent);matches&&(browserVersion=parseFloat(matches[1])),(matches=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent))&&(browserVersion=parseFloat(matches[1]))}var isEdge=/Edge\/\d+/.test(userAgent),isSupportTouch="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,inputEventName=isMSIE?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",env={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:isMSIE,isEdge:isEdge,isFF:!isEdge&&/firefox/i.test(userAgent),isPhantom:/PhantomJS/i.test(userAgent),isWebkit:!isEdge&&/webkit/i.test(userAgent),isChrome:!isEdge&&/chrome/i.test(userAgent),isSafari:!isEdge&&/safari/i.test(userAgent)&&!/chrome/i.test(userAgent),browserVersion:browserVersion,jqueryVersion:parseFloat(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.fn.jquery),isSupportAmd:isSupportAmd,isSupportTouch:isSupportTouch,isFontInstalled:env_isFontInstalled,isW3CRangeSupport:!!document.createRange,inputEventName:inputEventName,genericFontFamilies:genericFontFamilies,validFontName:validFontName};function eq(itemA){return function(itemB){return itemA===itemB}}function eq2(itemA,itemB){return itemA===itemB}function peq2(propName){return function(itemA,itemB){return itemA[propName]===itemB[propName]}}function ok(){return!0}function fail(){return!1}function not(f){return function(){return!f.apply(f,arguments)}}function and(fA,fB){return function(item){return fA(item)&&fB(item)}}function func_self(a){return a}function func_invoke(obj,method){return function(){return obj[method].apply(obj,arguments)}}var idCounter=0;function resetUniqueId(){idCounter=0}function uniqueId(prefix){var id=++idCounter+"";return prefix?prefix+id:id}function rect2bnd(rect){var $document=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document);return{top:rect.top+$document.scrollTop(),left:rect.left+$document.scrollLeft(),width:rect.right-rect.left,height:rect.bottom-rect.top}}function invertObject(obj){var inverted={};for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(inverted[obj[key]]=key);return inverted}function namespaceToCamel(namespace,prefix){return(prefix=prefix||"")+namespace.split(".").map((function(name){return name.substring(0,1).toUpperCase()+name.substring(1)})).join("")}function debounce(func,wait,immediate){var timeout;return function(){var context=this,args=arguments,later=function later(){timeout=null,immediate||func.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&func.apply(context,args)}}function isValidUrl(url){var expression;return/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(url)}var func={eq:eq,eq2:eq2,peq2:peq2,ok:ok,fail:fail,self:func_self,not:not,and:and,invoke:func_invoke,resetUniqueId:resetUniqueId,uniqueId:uniqueId,rect2bnd:rect2bnd,invertObject:invertObject,namespaceToCamel:namespaceToCamel,debounce:debounce,isValidUrl:isValidUrl};function lists_head(array){return array[0]}function lists_last(array){return array[array.length-1]}function initial(array){return array.slice(0,array.length-1)}function tail(array){return array.slice(1)}function find(array,pred){for(var idx=0,len=array.length;idx<len;idx++){var item=array[idx];if(pred(item))return item}}function lists_all(array,pred){for(var idx=0,len=array.length;idx<len;idx++)if(!pred(array[idx]))return!1;return!0}function contains(array,item){if(array&&array.length&&item){if(array.indexOf)return-1!==array.indexOf(item);if(array.contains)return array.contains(item)}return!1}function sum(array,fn){return fn=fn||func.self,array.reduce((function(memo,v){return memo+fn(v)}),0)}function from(collection){for(var result=[],length=collection.length,idx=-1;++idx<length;)result[idx]=collection[idx];return result}function lists_isEmpty(array){return!array||!array.length}function clusterBy(array,fn){return array.length?tail(array).reduce((function(memo,v){var aLast=lists_last(memo);return fn(lists_last(aLast),v)?aLast[aLast.length]=v:memo[memo.length]=[v],memo}),[[lists_head(array)]]):[];var aTail}function compact(array){for(var aResult=[],idx=0,len=array.length;idx<len;idx++)array[idx]&&aResult.push(array[idx]);return aResult}function unique(array){for(var results=[],idx=0,len=array.length;idx<len;idx++)contains(results,array[idx])||results.push(array[idx]);return results}function lists_next(array,item){if(array&&array.length&&item){var idx=array.indexOf(item);return-1===idx?null:array[idx+1]}return null}function prev(array,item){if(array&&array.length&&item){var idx=array.indexOf(item);return-1===idx?null:array[idx-1]}return null}var lists={head:lists_head,last:lists_last,initial:initial,tail:tail,prev:prev,next:lists_next,find:find,contains:contains,all:lists_all,sum:sum,from:from,isEmpty:lists_isEmpty,clusterBy:clusterBy,compact:compact,unique:unique},NBSP_CHAR=String.fromCharCode(160),ZERO_WIDTH_NBSP_CHAR="\ufeff";function isEditable(node){return node&&external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(node).hasClass("note-editable")}function isControlSizing(node){return node&&external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(node).hasClass("note-control-sizing")}function makePredByNodeName(nodeName){return nodeName=nodeName.toUpperCase(),function(node){return node&&node.nodeName.toUpperCase()===nodeName}}function isText(node){return node&&3===node.nodeType}function isElement(node){return node&&1===node.nodeType}function isVoid(node){return node&&/^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase())}function isPara(node){return!isEditable(node)&&(node&&/^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase()))}function isHeading(node){return node&&/^H[1-7]/.test(node.nodeName.toUpperCase())}var isPre=makePredByNodeName("PRE"),isLi=makePredByNodeName("LI");function isPurePara(node){return isPara(node)&&!isLi(node)}var isTable=makePredByNodeName("TABLE"),isData=makePredByNodeName("DATA");function dom_isInline(node){return!(isBodyContainer(node)||isList(node)||isHr(node)||isPara(node)||isTable(node)||isBlockquote(node)||isData(node))}function isList(node){return node&&/^UL|^OL/.test(node.nodeName.toUpperCase())}var isHr=makePredByNodeName("HR");function dom_isCell(node){return node&&/^TD|^TH/.test(node.nodeName.toUpperCase())}var isBlockquote=makePredByNodeName("BLOCKQUOTE");function isBodyContainer(node){return dom_isCell(node)||isBlockquote(node)||isEditable(node)}var isAnchor=makePredByNodeName("A");function isParaInline(node){return dom_isInline(node)&&!!dom_ancestor(node,isPara)}function isBodyInline(node){return dom_isInline(node)&&!dom_ancestor(node,isPara)}var isBody=makePredByNodeName("BODY");function isClosestSibling(nodeA,nodeB){return nodeA.nextSibling===nodeB||nodeA.previousSibling===nodeB}function withClosestSiblings(node,pred){pred=pred||func.ok;var siblings=[];return node.previousSibling&&pred(node.previousSibling)&&siblings.push(node.previousSibling),siblings.push(node),node.nextSibling&&pred(node.nextSibling)&&siblings.push(node.nextSibling),siblings}var blankHTML=env.isMSIE&&env.browserVersion<11?" ":"<br>";function nodeLength(node){return isText(node)?node.nodeValue.length:node?node.childNodes.length:0}function deepestChildIsEmpty(node){do{if(null===node.firstElementChild||""===node.firstElementChild.innerHTML)break}while(node=node.firstElementChild);return dom_isEmpty(node)}function dom_isEmpty(node){var len=nodeLength(node);return 0===len||(!isText(node)&&1===len&&node.innerHTML===blankHTML||!(!lists.all(node.childNodes,isText)||""!==node.innerHTML))}function paddingBlankHTML(node){isVoid(node)||nodeLength(node)||(node.innerHTML=blankHTML)}function dom_ancestor(node,pred){for(;node;){if(pred(node))return node;if(isEditable(node))break;node=node.parentNode}return null}function singleChildAncestor(node,pred){for(node=node.parentNode;node&&1===nodeLength(node);){if(pred(node))return node;if(isEditable(node))break;node=node.parentNode}return null}function listAncestor(node,pred){pred=pred||func.fail;var ancestors=[];return dom_ancestor(node,(function(el){return isEditable(el)||ancestors.push(el),pred(el)})),ancestors}function lastAncestor(node,pred){var ancestors=listAncestor(node);return lists.last(ancestors.filter(pred))}function dom_commonAncestor(nodeA,nodeB){for(var ancestors=listAncestor(nodeA),n=nodeB;n;n=n.parentNode)if(ancestors.indexOf(n)>-1)return n;return null}function listPrev(node,pred){pred=pred||func.fail;for(var nodes=[];node&&!pred(node);)nodes.push(node),node=node.previousSibling;return nodes}function listNext(node,pred){pred=pred||func.fail;for(var nodes=[];node&&!pred(node);)nodes.push(node),node=node.nextSibling;return nodes}function listDescendant(node,pred){var descendants=[];return pred=pred||func.ok,function fnWalk(current){node!==current&&pred(current)&&descendants.push(current);for(var idx=0,len=current.childNodes.length;idx<len;idx++)fnWalk(current.childNodes[idx])}(node),descendants}function wrap(node,wrapperName){var parent=node.parentNode,wrapper=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<"+wrapperName+">")[0];return parent.insertBefore(wrapper,node),wrapper.appendChild(node),wrapper}function insertAfter(node,preceding){var next=preceding.nextSibling,parent=preceding.parentNode;return next?parent.insertBefore(node,next):parent.appendChild(node),node}function appendChildNodes(node,aChild){return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(aChild,(function(idx,child){node.appendChild(child)})),node}function isLeftEdgePoint(point){return 0===point.offset}function isRightEdgePoint(point){return point.offset===nodeLength(point.node)}function isEdgePoint(point){return isLeftEdgePoint(point)||isRightEdgePoint(point)}function dom_isLeftEdgeOf(node,ancestor){for(;node&&node!==ancestor;){if(0!==dom_position(node))return!1;node=node.parentNode}return!0}function isRightEdgeOf(node,ancestor){if(!ancestor)return!1;for(;node&&node!==ancestor;){if(dom_position(node)!==nodeLength(node.parentNode)-1)return!1;node=node.parentNode}return!0}function isLeftEdgePointOf(point,ancestor){return isLeftEdgePoint(point)&&dom_isLeftEdgeOf(point.node,ancestor)}function isRightEdgePointOf(point,ancestor){return isRightEdgePoint(point)&&isRightEdgeOf(point.node,ancestor)}function dom_position(node){for(var offset=0;node=node.previousSibling;)offset+=1;return offset}function hasChildren(node){return!!(node&&node.childNodes&&node.childNodes.length)}function dom_prevPoint(point,isSkipInnerOffset){var node,offset;if(0===point.offset){if(isEditable(point.node))return null;node=point.node.parentNode,offset=dom_position(point.node)}else hasChildren(point.node)?offset=nodeLength(node=point.node.childNodes[point.offset-1]):(node=point.node,offset=isSkipInnerOffset?0:point.offset-1);return{node:node,offset:offset}}function dom_nextPoint(point,isSkipInnerOffset){var node,offset;if(nodeLength(point.node)===point.offset){if(isEditable(point.node))return null;var nextTextNode=getNextTextNode(point.node);nextTextNode?(node=nextTextNode,offset=0):(node=point.node.parentNode,offset=dom_position(point.node)+1)}else hasChildren(point.node)?(node=point.node.childNodes[point.offset],offset=0):(node=point.node,offset=isSkipInnerOffset?nodeLength(point.node):point.offset+1);return{node:node,offset:offset}}function nextPointWithEmptyNode(point,isSkipInnerOffset){var node,offset;if(dom_isEmpty(point.node))return{node:node=point.node.nextSibling,offset:offset=0};if(nodeLength(point.node)===point.offset){if(isEditable(point.node))return null;var nextTextNode=getNextTextNode(point.node);nextTextNode?(node=nextTextNode,offset=0):(node=point.node.parentNode,offset=dom_position(point.node)+1),isEditable(node)&&(node=point.node.nextSibling,offset=0)}else if(hasChildren(point.node)){if(offset=0,dom_isEmpty(node=point.node.childNodes[point.offset]))return null}else if(node=point.node,offset=isSkipInnerOffset?nodeLength(point.node):point.offset+1,dom_isEmpty(node))return null;return{node:node,offset:offset}}function getNextTextNode(actual){if(actual.nextSibling&&actual.parent===actual.nextSibling.parent)return isText(actual.nextSibling)?actual.nextSibling:getNextTextNode(actual.nextSibling)}function isSamePoint(pointA,pointB){return pointA.node===pointB.node&&pointA.offset===pointB.offset}function isVisiblePoint(point){if(isText(point.node)||!hasChildren(point.node)||dom_isEmpty(point.node))return!0;var leftNode=point.node.childNodes[point.offset-1],rightNode=point.node.childNodes[point.offset];return!(leftNode&&!isVoid(leftNode)||rightNode&&!isVoid(rightNode))}function prevPointUntil(point,pred){for(;point;){if(pred(point))return point;point=dom_prevPoint(point)}return null}function nextPointUntil(point,pred){for(;point;){if(pred(point))return point;point=dom_nextPoint(point)}return null}function isCharPoint(point){if(!isText(point.node))return!1;var ch=point.node.nodeValue.charAt(point.offset-1);return ch&&" "!==ch&&ch!==NBSP_CHAR}function isSpacePoint(point){if(!isText(point.node))return!1;var ch=point.node.nodeValue.charAt(point.offset-1);return" "===ch||ch===NBSP_CHAR}function walkPoint(startPoint,endPoint,handler,isSkipInnerOffset){for(var point=startPoint;point&&(handler(point),!isSamePoint(point,endPoint));){var isSkipOffset;point=nextPointWithEmptyNode(point,isSkipInnerOffset&&startPoint.node!==point.node&&endPoint.node!==point.node)}}function makeOffsetPath(ancestor,node){var ancestors;return listAncestor(node,func.eq(ancestor)).map(dom_position).reverse()}function fromOffsetPath(ancestor,offsets){for(var current=ancestor,i=0,len=offsets.length;i<len;i++)current=current.childNodes.length<=offsets[i]?current.childNodes[current.childNodes.length-1]:current.childNodes[offsets[i]];return current}function splitNode(point,options){var isSkipPaddingBlankHTML=options&&options.isSkipPaddingBlankHTML,isNotSplitEdgePoint=options&&options.isNotSplitEdgePoint,isDiscardEmptySplits=options&&options.isDiscardEmptySplits;if(isDiscardEmptySplits&&(isSkipPaddingBlankHTML=!0),isEdgePoint(point)&&(isText(point.node)||isNotSplitEdgePoint)){if(isLeftEdgePoint(point))return point.node;if(isRightEdgePoint(point))return point.node.nextSibling}if(isText(point.node))return point.node.splitText(point.offset);var childNode=point.node.childNodes[point.offset],clone=insertAfter(point.node.cloneNode(!1),point.node);return appendChildNodes(clone,listNext(childNode)),isSkipPaddingBlankHTML||(paddingBlankHTML(point.node),paddingBlankHTML(clone)),isDiscardEmptySplits&&(dom_isEmpty(point.node)&&remove(point.node),dom_isEmpty(clone))?(remove(clone),point.node.nextSibling):clone}function splitTree(root,point,options){var ancestors=listAncestor(point.node,func.eq(root));return ancestors.length?1===ancestors.length?splitNode(point,options):ancestors.reduce((function(node,parent){return node===point.node&&(node=splitNode(point,options)),splitNode({node:parent,offset:node?dom_position(node):nodeLength(parent)},options)})):null}function splitPoint(point,isInline){var pred=isInline?isPara:isBodyContainer,ancestors=listAncestor(point.node,pred),topAncestor=lists.last(ancestors)||point.node,splitRoot,container;pred(topAncestor)?(splitRoot=ancestors[ancestors.length-2],container=topAncestor):container=(splitRoot=topAncestor).parentNode;var pivot=splitRoot&&splitTree(splitRoot,point,{isSkipPaddingBlankHTML:isInline,isNotSplitEdgePoint:isInline});return pivot||container!==point.node||(pivot=point.node.childNodes[point.offset]),{rightNode:pivot,container:container}}function dom_create(nodeName){return document.createElement(nodeName)}function createText(text){return document.createTextNode(text)}function remove(node,isRemoveChild){if(node&&node.parentNode){if(node.removeNode)return node.removeNode(isRemoveChild);var parent=node.parentNode;if(!isRemoveChild){for(var nodes=[],i=0,len=node.childNodes.length;i<len;i++)nodes.push(node.childNodes[i]);for(var _i=0,_len=nodes.length;_i<_len;_i++)parent.insertBefore(nodes[_i],node)}parent.removeChild(node)}}function removeWhile(node,pred){for(;node&&!isEditable(node)&&pred(node);){var parent=node.parentNode;remove(node),node=parent}}function dom_replace(node,nodeName){if(node.nodeName.toUpperCase()===nodeName.toUpperCase())return node;var newNode=dom_create(nodeName);return node.style.cssText&&(newNode.style.cssText=node.style.cssText),appendChildNodes(newNode,lists.from(node.childNodes)),insertAfter(newNode,node),remove(node),newNode}var isTextarea=makePredByNodeName("TEXTAREA");function dom_value($node,stripLinebreaks){var val=isTextarea($node[0])?$node.val():$node.html();return stripLinebreaks?val.replace(/[\n\r]/g,""):val}function dom_html($node,isNewlineOnBlock){var markup=dom_value($node);if(isNewlineOnBlock){var regexTag=/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;markup=(markup=markup.replace(regexTag,(function(match,endSlash,name){name=name.toUpperCase();var isEndOfInlineContainer=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name)&&!!endSlash,isBlockNode=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);return match+(isEndOfInlineContainer||isBlockNode?"\n":"")}))).trim()}return markup}function posFromPlaceholder(placeholder){var $placeholder=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(placeholder),pos=$placeholder.offset(),height=$placeholder.outerHeight(!0);return{left:pos.left,top:pos.top+height}}function attachEvents($node,events){Object.keys(events).forEach((function(key){$node.on(key,events[key])}))}function detachEvents($node,events){Object.keys(events).forEach((function(key){$node.off(key,events[key])}))}function isCustomStyleTag(node){return node&&!isText(node)&&lists.contains(node.classList,"note-styletag")}var dom={NBSP_CHAR:NBSP_CHAR,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:blankHTML,emptyPara:"<p>".concat(blankHTML,"</p>"),makePredByNodeName:makePredByNodeName,isEditable:isEditable,isControlSizing:isControlSizing,isText:isText,isElement:isElement,isVoid:isVoid,isPara:isPara,isPurePara:isPurePara,isHeading:isHeading,isInline:dom_isInline,isBlock:func.not(dom_isInline),isBodyInline:isBodyInline,isBody:isBody,isParaInline:isParaInline,isPre:isPre,isList:isList,isTable:isTable,isData:isData,isCell:dom_isCell,isBlockquote:isBlockquote,isBodyContainer:isBodyContainer,isAnchor:isAnchor,isDiv:makePredByNodeName("DIV"),isLi:isLi,isBR:makePredByNodeName("BR"),isSpan:makePredByNodeName("SPAN"),isB:makePredByNodeName("B"),isU:makePredByNodeName("U"),isS:makePredByNodeName("S"),isI:makePredByNodeName("I"),isImg:makePredByNodeName("IMG"),isTextarea:isTextarea,deepestChildIsEmpty:deepestChildIsEmpty,isEmpty:dom_isEmpty,isEmptyAnchor:func.and(isAnchor,dom_isEmpty),isClosestSibling:isClosestSibling,withClosestSiblings:withClosestSiblings,nodeLength:nodeLength,isLeftEdgePoint:isLeftEdgePoint,isRightEdgePoint:isRightEdgePoint,isEdgePoint:isEdgePoint,isLeftEdgeOf:dom_isLeftEdgeOf,isRightEdgeOf:isRightEdgeOf,isLeftEdgePointOf:isLeftEdgePointOf,isRightEdgePointOf:isRightEdgePointOf,prevPoint:dom_prevPoint,nextPoint:dom_nextPoint,nextPointWithEmptyNode:nextPointWithEmptyNode,isSamePoint:isSamePoint,isVisiblePoint:isVisiblePoint,prevPointUntil:prevPointUntil,nextPointUntil:nextPointUntil,isCharPoint:isCharPoint,isSpacePoint:isSpacePoint,walkPoint:walkPoint,ancestor:dom_ancestor,singleChildAncestor:singleChildAncestor,listAncestor:listAncestor,lastAncestor:lastAncestor,listNext:listNext,listPrev:listPrev,listDescendant:listDescendant,commonAncestor:dom_commonAncestor,wrap:wrap,insertAfter:insertAfter,appendChildNodes:appendChildNodes,position:dom_position,hasChildren:hasChildren,makeOffsetPath:makeOffsetPath,fromOffsetPath:fromOffsetPath,splitTree:splitTree,splitPoint:splitPoint,create:dom_create,createText:createText,remove:remove,removeWhile:removeWhile,replace:dom_replace,html:dom_html,value:dom_value,posFromPlaceholder:posFromPlaceholder,attachEvents:attachEvents,detachEvents:detachEvents,isCustomStyleTag:isCustomStyleTag};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}var Context_Context=function(){function Context($note,options){_classCallCheck(this,Context),this.$note=$note,this.memos={},this.modules={},this.layoutInfo={},this.options=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(!0,{},options),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui_template(this.options),this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.initialize()}return _createClass(Context,[{key:"initialize",value:function initialize(){return this.layoutInfo=this.ui.createLayout(this.$note),this._initialize(),this.$note.hide(),this}},{key:"destroy",value:function destroy(){this._destroy(),this.$note.removeData("summernote"),this.ui.removeLayout(this.$note,this.layoutInfo)}},{key:"reset",value:function reset(){var disabled=this.isDisabled();this.code(dom.emptyPara),this._destroy(),this._initialize(),disabled&&this.disable()}},{key:"_initialize",value:function _initialize(){var _this=this;this.options.id=func.uniqueId(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.now()),this.options.container=this.options.container||this.layoutInfo.editor;var buttons=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend({},this.options.buttons);Object.keys(buttons).forEach((function(key){_this.memo("button."+key,buttons[key])}));var modules=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend({},this.options.modules,external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.plugins||{});Object.keys(modules).forEach((function(key){_this.module(key,modules[key],!0)})),Object.keys(this.modules).forEach((function(key){_this.initializeModule(key)}))}},{key:"_destroy",value:function _destroy(){var _this2=this;Object.keys(this.modules).reverse().forEach((function(key){_this2.removeModule(key)})),Object.keys(this.memos).forEach((function(key){_this2.removeMemo(key)})),this.triggerEvent("destroy",this)}},{key:"code",value:function code(html){var isActivated=this.invoke("codeview.isActivated");if(void 0===html)return this.invoke("codeview.sync"),isActivated?this.layoutInfo.codable.val():this.layoutInfo.editable.html();isActivated?this.invoke("codeview.sync",html):this.layoutInfo.editable.html(html),this.$note.val(html),this.triggerEvent("change",html,this.layoutInfo.editable)}},{key:"isDisabled",value:function isDisabled(){return"false"===this.layoutInfo.editable.attr("contenteditable")}},{key:"enable",value:function enable(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1),this.options.editing=!0}},{key:"disable",value:function disable(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.options.editing=!1,this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)}},{key:"triggerEvent",value:function triggerEvent(){var namespace=lists.head(arguments),args=lists.tail(lists.from(arguments)),callback=this.options.callbacks[func.namespaceToCamel(namespace,"on")];callback&&callback.apply(this.$note[0],args),this.$note.trigger("summernote."+namespace,args)}},{key:"initializeModule",value:function initializeModule(key){var module=this.modules[key];module.shouldInitialize=module.shouldInitialize||func.ok,module.shouldInitialize()&&(module.initialize&&module.initialize(),module.events&&dom.attachEvents(this.$note,module.events))}},{key:"module",value:function module(key,ModuleClass,withoutIntialize){if(1===arguments.length)return this.modules[key];this.modules[key]=new ModuleClass(this),withoutIntialize||this.initializeModule(key)}},{key:"removeModule",value:function removeModule(key){var module=this.modules[key];module.shouldInitialize()&&(module.events&&dom.detachEvents(this.$note,module.events),module.destroy&&module.destroy()),delete this.modules[key]}},{key:"memo",value:function memo(key,obj){if(1===arguments.length)return this.memos[key];this.memos[key]=obj}},{key:"removeMemo",value:function removeMemo(key){this.memos[key]&&this.memos[key].destroy&&this.memos[key].destroy(),delete this.memos[key]}},{key:"createInvokeHandlerAndUpdateState",value:function createInvokeHandlerAndUpdateState(namespace,value){var _this3=this;return function(event){_this3.createInvokeHandler(namespace,value)(event),_this3.invoke("buttons.updateCurrentStyle")}}},{key:"createInvokeHandler",value:function createInvokeHandler(namespace,value){var _this4=this;return function(event){event.preventDefault();var $target=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(event.target);_this4.invoke(namespace,value||$target.closest("[data-value]").data("value"),$target)}}},{key:"invoke",value:function invoke(){var namespace=lists.head(arguments),args=lists.tail(lists.from(arguments)),splits=namespace.split("."),hasSeparator=splits.length>1,moduleName=hasSeparator&&lists.head(splits),methodName=hasSeparator?lists.last(splits):lists.head(splits),module=this.modules[moduleName||"editor"];return!moduleName&&this[methodName]?this[methodName].apply(this,args):module&&module[methodName]&&module.shouldInitialize()?module[methodName].apply(module,args):void 0}}]),Context}();function range_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function range_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function range_createClass(Constructor,protoProps,staticProps){return protoProps&&range_defineProperties(Constructor.prototype,protoProps),staticProps&&range_defineProperties(Constructor,staticProps),Constructor}function textRangeToPoint(textRange,isStart){var container=textRange.parentElement(),offset,tester=document.body.createTextRange(),prevContainer,childNodes=lists.from(container.childNodes);for(offset=0;offset<childNodes.length;offset++)if(!dom.isText(childNodes[offset])){if(tester.moveToElementText(childNodes[offset]),tester.compareEndPoints("StartToStart",textRange)>=0)break;prevContainer=childNodes[offset]}if(0!==offset&&dom.isText(childNodes[offset-1])){var textRangeStart=document.body.createTextRange(),curTextNode=null;textRangeStart.moveToElementText(prevContainer||container),textRangeStart.collapse(!prevContainer),curTextNode=prevContainer?prevContainer.nextSibling:container.firstChild;var pointTester=textRange.duplicate();pointTester.setEndPoint("StartToStart",textRangeStart);for(var textCount=pointTester.text.replace(/[\r\n]/g,"").length;textCount>curTextNode.nodeValue.length&&curTextNode.nextSibling;)textCount-=curTextNode.nodeValue.length,curTextNode=curTextNode.nextSibling;var dummy=curTextNode.nodeValue;isStart&&curTextNode.nextSibling&&dom.isText(curTextNode.nextSibling)&&textCount===curTextNode.nodeValue.length&&(textCount-=curTextNode.nodeValue.length,curTextNode=curTextNode.nextSibling),container=curTextNode,offset=textCount}return{cont:container,offset:offset}}function pointToTextRange(point){var textRangeInfo=function textRangeInfo(container,offset){var node,isCollapseToStart;if(dom.isText(container)){var prevTextNodes=dom.listPrev(container,func.not(dom.isText)),prevContainer=lists.last(prevTextNodes).previousSibling;node=prevContainer||container.parentNode,offset+=lists.sum(lists.tail(prevTextNodes),dom.nodeLength),isCollapseToStart=!prevContainer}else{if(node=container.childNodes[offset]||container,dom.isText(node))return textRangeInfo(node,0);offset=0,isCollapseToStart=!1}return{node:node,collapseToStart:isCollapseToStart,offset:offset}},textRange=document.body.createTextRange(),info=textRangeInfo(point.node,point.offset);return textRange.moveToElementText(info.node),textRange.collapse(info.collapseToStart),textRange.moveStart("character",info.offset),textRange}external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.fn.extend({summernote:function summernote(){var type=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.type(lists.head(arguments)),isExternalAPICalled="string"===type,hasInitOptions="object"===type,options=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend({},external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.options,hasInitOptions?lists.head(arguments):{});options.langInfo=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(!0,{},external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.lang["en-US"],external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.lang[options.lang]),options.icons=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(!0,{},external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.options.icons,options.icons),options.tooltip="auto"===options.tooltip?!env.isSupportTouch:options.tooltip,this.each((function(idx,note){var $note=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(note);if(!$note.data("summernote")){var context=new Context_Context($note,options);$note.data("summernote",context),$note.data("summernote").triggerEvent("init",context.layoutInfo)}}));var $note=this.first();if($note.length){var context=$note.data("summernote");if(isExternalAPICalled)return context.invoke.apply(context,lists.from(arguments));options.focus&&context.invoke("editor.focus")}return this}});var range_WrappedRange=function(){function WrappedRange(sc,so,ec,eo){range_classCallCheck(this,WrappedRange),this.sc=sc,this.so=so,this.ec=ec,this.eo=eo,this.isOnEditable=this.makeIsOn(dom.isEditable),this.isOnList=this.makeIsOn(dom.isList),this.isOnAnchor=this.makeIsOn(dom.isAnchor),this.isOnCell=this.makeIsOn(dom.isCell),this.isOnData=this.makeIsOn(dom.isData)}return range_createClass(WrappedRange,[{key:"nativeRange",value:function nativeRange(){if(env.isW3CRangeSupport){var w3cRange=document.createRange();return w3cRange.setStart(this.sc,this.so),w3cRange.setEnd(this.ec,this.eo),w3cRange}var textRange=pointToTextRange({node:this.sc,offset:this.so});return textRange.setEndPoint("EndToEnd",pointToTextRange({node:this.ec,offset:this.eo})),textRange}},{key:"getPoints",value:function getPoints(){return{sc:this.sc,so:this.so,ec:this.ec,eo:this.eo}}},{key:"getStartPoint",value:function getStartPoint(){return{node:this.sc,offset:this.so}}},{key:"getEndPoint",value:function getEndPoint(){return{node:this.ec,offset:this.eo}}},{key:"select",value:function select(){var nativeRng=this.nativeRange();if(env.isW3CRangeSupport){var selection=document.getSelection();selection.rangeCount>0&&selection.removeAllRanges(),selection.addRange(nativeRng)}else nativeRng.select();return this}},{key:"scrollIntoView",value:function scrollIntoView(container){var height=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(container).height();return container.scrollTop+height<this.sc.offsetTop&&(container.scrollTop+=Math.abs(container.scrollTop+height-this.sc.offsetTop)),this}},{key:"normalize",value:function normalize(){var getVisiblePoint=function getVisiblePoint(point,isLeftToRight){if(!point)return point;if(dom.isVisiblePoint(point)&&(!dom.isEdgePoint(point)||dom.isRightEdgePoint(point)&&!isLeftToRight||dom.isLeftEdgePoint(point)&&isLeftToRight||dom.isRightEdgePoint(point)&&isLeftToRight&&dom.isVoid(point.node.nextSibling)||dom.isLeftEdgePoint(point)&&!isLeftToRight&&dom.isVoid(point.node.previousSibling)||dom.isBlock(point.node)&&dom.isEmpty(point.node)))return point;var block=dom.ancestor(point.node,dom.isBlock),hasRightNode=!1;if(!hasRightNode){var prevPoint=dom.prevPoint(point)||{node:null};hasRightNode=(dom.isLeftEdgePointOf(point,block)||dom.isVoid(prevPoint.node))&&!isLeftToRight}var hasLeftNode=!1,nextPoint;if(!hasLeftNode){var _nextPoint=dom.nextPoint(point)||{node:null};hasLeftNode=(dom.isRightEdgePointOf(point,block)||dom.isVoid(_nextPoint.node))&&isLeftToRight}if(hasRightNode||hasLeftNode){if(dom.isVisiblePoint(point))return point;isLeftToRight=!isLeftToRight}return(isLeftToRight?dom.nextPointUntil(dom.nextPoint(point),dom.isVisiblePoint):dom.prevPointUntil(dom.prevPoint(point),dom.isVisiblePoint))||point},endPoint=getVisiblePoint(this.getEndPoint(),!1),startPoint=this.isCollapsed()?endPoint:getVisiblePoint(this.getStartPoint(),!0);return new WrappedRange(startPoint.node,startPoint.offset,endPoint.node,endPoint.offset)}},{key:"nodes",value:function nodes(pred,options){pred=pred||func.ok;var includeAncestor=options&&options.includeAncestor,fullyContains=options&&options.fullyContains,startPoint=this.getStartPoint(),endPoint=this.getEndPoint(),nodes=[],leftEdgeNodes=[];return dom.walkPoint(startPoint,endPoint,(function(point){var node;dom.isEditable(point.node)||(fullyContains?(dom.isLeftEdgePoint(point)&&leftEdgeNodes.push(point.node),dom.isRightEdgePoint(point)&&lists.contains(leftEdgeNodes,point.node)&&(node=point.node)):node=includeAncestor?dom.ancestor(point.node,pred):point.node,node&&pred(node)&&nodes.push(node))}),!0),lists.unique(nodes)}},{key:"commonAncestor",value:function commonAncestor(){return dom.commonAncestor(this.sc,this.ec)}},{key:"expand",value:function expand(pred){var startAncestor=dom.ancestor(this.sc,pred),endAncestor=dom.ancestor(this.ec,pred);if(!startAncestor&&!endAncestor)return new WrappedRange(this.sc,this.so,this.ec,this.eo);var boundaryPoints=this.getPoints();return startAncestor&&(boundaryPoints.sc=startAncestor,boundaryPoints.so=0),endAncestor&&(boundaryPoints.ec=endAncestor,boundaryPoints.eo=dom.nodeLength(endAncestor)),new WrappedRange(boundaryPoints.sc,boundaryPoints.so,boundaryPoints.ec,boundaryPoints.eo)}},{key:"collapse",value:function collapse(isCollapseToStart){return isCollapseToStart?new WrappedRange(this.sc,this.so,this.sc,this.so):new WrappedRange(this.ec,this.eo,this.ec,this.eo)}},{key:"splitText",value:function splitText(){var isSameContainer=this.sc===this.ec,boundaryPoints=this.getPoints();return dom.isText(this.ec)&&!dom.isEdgePoint(this.getEndPoint())&&this.ec.splitText(this.eo),dom.isText(this.sc)&&!dom.isEdgePoint(this.getStartPoint())&&(boundaryPoints.sc=this.sc.splitText(this.so),boundaryPoints.so=0,isSameContainer&&(boundaryPoints.ec=boundaryPoints.sc,boundaryPoints.eo=this.eo-this.so)),new WrappedRange(boundaryPoints.sc,boundaryPoints.so,boundaryPoints.ec,boundaryPoints.eo)}},{key:"deleteContents",value:function deleteContents(){if(this.isCollapsed())return this;var rng=this.splitText(),nodes=rng.nodes(null,{fullyContains:!0}),point=dom.prevPointUntil(rng.getStartPoint(),(function(point){return!lists.contains(nodes,point.node)})),emptyParents=[];return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(nodes,(function(idx,node){var parent=node.parentNode;point.node!==parent&&1===dom.nodeLength(parent)&&emptyParents.push(parent),dom.remove(node,!1)})),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(emptyParents,(function(idx,node){dom.remove(node,!1)})),new WrappedRange(point.node,point.offset,point.node,point.offset).normalize()}},{key:"makeIsOn",value:function makeIsOn(pred){return function(){var ancestor=dom.ancestor(this.sc,pred);return!!ancestor&&ancestor===dom.ancestor(this.ec,pred)}}},{key:"isLeftEdgeOf",value:function isLeftEdgeOf(pred){if(!dom.isLeftEdgePoint(this.getStartPoint()))return!1;var node=dom.ancestor(this.sc,pred);return node&&dom.isLeftEdgeOf(this.sc,node)}},{key:"isCollapsed",value:function isCollapsed(){return this.sc===this.ec&&this.so===this.eo}},{key:"wrapBodyInlineWithPara",value:function wrapBodyInlineWithPara(){if(dom.isBodyContainer(this.sc)&&dom.isEmpty(this.sc))return this.sc.innerHTML=dom.emptyPara,new WrappedRange(this.sc.firstChild,0,this.sc.firstChild,0);var rng=this.normalize(),topAncestor;if(dom.isParaInline(this.sc)||dom.isPara(this.sc))return rng;if(dom.isInline(rng.sc)){var ancestors=dom.listAncestor(rng.sc,func.not(dom.isInline));topAncestor=lists.last(ancestors),dom.isInline(topAncestor)||(topAncestor=ancestors[ancestors.length-2]||rng.sc.childNodes[rng.so])}else topAncestor=rng.sc.childNodes[rng.so>0?rng.so-1:0];if(topAncestor){var inlineSiblings=dom.listPrev(topAncestor,dom.isParaInline).reverse();if((inlineSiblings=inlineSiblings.concat(dom.listNext(topAncestor.nextSibling,dom.isParaInline))).length){var para=dom.wrap(lists.head(inlineSiblings),"p");dom.appendChildNodes(para,lists.tail(inlineSiblings))}}return this.normalize()}},{key:"insertNode",value:function insertNode(node){var rng=this;(dom.isText(node)||dom.isInline(node))&&(rng=this.wrapBodyInlineWithPara().deleteContents());var info=dom.splitPoint(rng.getStartPoint(),dom.isInline(node));return info.rightNode?(info.rightNode.parentNode.insertBefore(node,info.rightNode),dom.isEmpty(info.rightNode)&&dom.isPara(node)&&info.rightNode.parentNode.removeChild(info.rightNode)):info.container.appendChild(node),node}},{key:"pasteHTML",value:function pasteHTML(markup){markup=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.trim(markup);var contentsContainer=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<div></div>").html(markup)[0],childNodes=lists.from(contentsContainer.childNodes),rng=this,reversed=!1;return rng.so>=0&&(childNodes=childNodes.reverse(),reversed=!0),childNodes=childNodes.map((function(childNode){return rng.insertNode(childNode)})),reversed&&(childNodes=childNodes.reverse()),childNodes}},{key:"toString",value:function toString(){var nativeRng=this.nativeRange();return env.isW3CRangeSupport?nativeRng.toString():nativeRng.text}},{key:"getWordRange",value:function getWordRange(findAfter){var endPoint=this.getEndPoint();if(!dom.isCharPoint(endPoint))return this;var startPoint=dom.prevPointUntil(endPoint,(function(point){return!dom.isCharPoint(point)}));return findAfter&&(endPoint=dom.nextPointUntil(endPoint,(function(point){return!dom.isCharPoint(point)}))),new WrappedRange(startPoint.node,startPoint.offset,endPoint.node,endPoint.offset)}},{key:"getWordsRange",value:function getWordsRange(findAfter){var endPoint=this.getEndPoint(),isNotTextPoint=function isNotTextPoint(point){return!dom.isCharPoint(point)&&!dom.isSpacePoint(point)};if(isNotTextPoint(endPoint))return this;var startPoint=dom.prevPointUntil(endPoint,isNotTextPoint);return findAfter&&(endPoint=dom.nextPointUntil(endPoint,isNotTextPoint)),new WrappedRange(startPoint.node,startPoint.offset,endPoint.node,endPoint.offset)}},{key:"getWordsMatchRange",value:function getWordsMatchRange(regex){var endPoint=this.getEndPoint(),startPoint=dom.prevPointUntil(endPoint,(function(point){if(!dom.isCharPoint(point)&&!dom.isSpacePoint(point))return!0;var rng=new WrappedRange(point.node,point.offset,endPoint.node,endPoint.offset),result=regex.exec(rng.toString());return result&&0===result.index})),rng=new WrappedRange(startPoint.node,startPoint.offset,endPoint.node,endPoint.offset),text=rng.toString(),result=regex.exec(text);return result&&result[0].length===text.length?rng:null}},{key:"bookmark",value:function bookmark(editable){return{s:{path:dom.makeOffsetPath(editable,this.sc),offset:this.so},e:{path:dom.makeOffsetPath(editable,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function paraBookmark(paras){return{s:{path:lists.tail(dom.makeOffsetPath(lists.head(paras),this.sc)),offset:this.so},e:{path:lists.tail(dom.makeOffsetPath(lists.last(paras),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function getClientRects(){var nativeRng;return this.nativeRange().getClientRects()}}]),WrappedRange}(),range={create:function create(sc,so,ec,eo){if(4===arguments.length)return new range_WrappedRange(sc,so,ec,eo);if(2===arguments.length)return new range_WrappedRange(sc,so,ec=sc,eo=so);var wrappedRange=this.createFromSelection();if(!wrappedRange&&1===arguments.length){var bodyElement=arguments[0];return dom.isEditable(bodyElement)&&(bodyElement=bodyElement.lastChild),this.createFromBodyElement(bodyElement,dom.emptyPara===arguments[0].innerHTML)}return wrappedRange},createFromBodyElement:function createFromBodyElement(bodyElement){var isCollapseToStart=arguments.length>1&&void 0!==arguments[1]&&arguments[1],wrappedRange=this.createFromNode(bodyElement);return wrappedRange.collapse(isCollapseToStart)},createFromSelection:function createFromSelection(){var sc,so,ec,eo;if(env.isW3CRangeSupport){var selection=document.getSelection();if(!selection||0===selection.rangeCount)return null;if(dom.isBody(selection.anchorNode))return null;var nativeRng=selection.getRangeAt(0);sc=nativeRng.startContainer,so=nativeRng.startOffset,ec=nativeRng.endContainer,eo=nativeRng.endOffset}else{var textRange=document.selection.createRange(),textRangeEnd=textRange.duplicate();textRangeEnd.collapse(!1);var textRangeStart=textRange;textRangeStart.collapse(!0);var startPoint=textRangeToPoint(textRangeStart,!0),endPoint=textRangeToPoint(textRangeEnd,!1);dom.isText(startPoint.node)&&dom.isLeftEdgePoint(startPoint)&&dom.isTextNode(endPoint.node)&&dom.isRightEdgePoint(endPoint)&&endPoint.node.nextSibling===startPoint.node&&(startPoint=endPoint),sc=startPoint.cont,so=startPoint.offset,ec=endPoint.cont,eo=endPoint.offset}return new range_WrappedRange(sc,so,ec,eo)},createFromNode:function createFromNode(node){var sc=node,so=0,ec=node,eo=dom.nodeLength(ec);return dom.isVoid(sc)&&(so=dom.listPrev(sc).length-1,sc=sc.parentNode),dom.isBR(ec)?(eo=dom.listPrev(ec).length-1,ec=ec.parentNode):dom.isVoid(ec)&&(eo=dom.listPrev(ec).length,ec=ec.parentNode),this.create(sc,so,ec,eo)},createFromNodeBefore:function createFromNodeBefore(node){return this.createFromNode(node).collapse(!0)},createFromNodeAfter:function createFromNodeAfter(node){return this.createFromNode(node).collapse()},createFromBookmark:function createFromBookmark(editable,bookmark){var sc=dom.fromOffsetPath(editable,bookmark.s.path),so=bookmark.s.offset,ec=dom.fromOffsetPath(editable,bookmark.e.path),eo=bookmark.e.offset;return new range_WrappedRange(sc,so,ec,eo)},createFromParaBookmark:function createFromParaBookmark(bookmark,paras){var so=bookmark.s.offset,eo=bookmark.e.offset,sc=dom.fromOffsetPath(lists.head(paras),bookmark.s.path),ec=dom.fromOffsetPath(lists.last(paras),bookmark.e.path);return new range_WrappedRange(sc,so,ec,eo)}},KEY_MAP={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34},core_key={isEdit:function isEdit(keyCode){return lists.contains([KEY_MAP.BACKSPACE,KEY_MAP.TAB,KEY_MAP.ENTER,KEY_MAP.SPACE,KEY_MAP.DELETE],keyCode)},isMove:function isMove(keyCode){return lists.contains([KEY_MAP.LEFT,KEY_MAP.UP,KEY_MAP.RIGHT,KEY_MAP.DOWN],keyCode)},isNavigation:function isNavigation(keyCode){return lists.contains([KEY_MAP.HOME,KEY_MAP.END,KEY_MAP.PAGEUP,KEY_MAP.PAGEDOWN],keyCode)},nameFromCode:func.invertObject(KEY_MAP),code:KEY_MAP};function readFileAsDataURL(file){return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.Deferred((function(deferred){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(new FileReader,{onload:function onload(e){var dataURL=e.target.result;deferred.resolve(dataURL)},onerror:function onerror(err){deferred.reject(err)}}).readAsDataURL(file)})).promise()}function createImage(url){return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.Deferred((function(deferred){var $img=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<img>");$img.one("load",(function(){$img.off("error abort"),deferred.resolve($img)})).one("error abort",(function(){$img.off("load").detach(),deferred.reject($img)})).css({display:"none"}).appendTo(document.body).attr("src",url)})).promise()}function History_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function History_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function History_createClass(Constructor,protoProps,staticProps){return protoProps&&History_defineProperties(Constructor.prototype,protoProps),staticProps&&History_defineProperties(Constructor,staticProps),Constructor}var History_History=function(){function History(context){History_classCallCheck(this,History),this.stack=[],this.stackOffset=-1,this.context=context,this.$editable=context.layoutInfo.editable,this.editable=this.$editable[0]}return History_createClass(History,[{key:"makeSnapshot",value:function makeSnapshot(){var rng=range.create(this.editable),emptyBookmark={s:{path:[],offset:0},e:{path:[],offset:0}};return{contents:this.$editable.html(),bookmark:rng&&rng.isOnEditable()?rng.bookmark(this.editable):emptyBookmark}}},{key:"applySnapshot",value:function applySnapshot(snapshot){null!==snapshot.contents&&this.$editable.html(snapshot.contents),null!==snapshot.bookmark&&range.createFromBookmark(this.editable,snapshot.bookmark).select()}},{key:"rewind",value:function rewind(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset=0,this.applySnapshot(this.stack[this.stackOffset])}},{key:"commit",value:function commit(){this.stack=[],this.stackOffset=-1,this.recordUndo()}},{key:"reset",value:function reset(){this.stack=[],this.stackOffset=-1,this.$editable.html(""),this.recordUndo()}},{key:"undo",value:function undo(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset>0&&(this.stackOffset--,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"redo",value:function redo(){this.stack.length-1>this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"recordUndo",value:function recordUndo(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),this.stackOffset-=1)}}]),History}();function Style_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Style_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Style_createClass(Constructor,protoProps,staticProps){return protoProps&&Style_defineProperties(Constructor.prototype,protoProps),staticProps&&Style_defineProperties(Constructor,staticProps),Constructor}var Style_Style=function(){function Style(){Style_classCallCheck(this,Style)}return Style_createClass(Style,[{key:"jQueryCSS",value:function jQueryCSS($obj,propertyNames){if(env.jqueryVersion<1.9){var result={};return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(propertyNames,(function(idx,propertyName){result[propertyName]=$obj.css(propertyName)})),result}return $obj.css(propertyNames)}},{key:"fromNode",value:function fromNode($node){var properties=["font-family","font-size","text-align","list-style-type","line-height"],styleInfo=this.jQueryCSS($node,properties)||{},fontSize=$node[0].style.fontSize||styleInfo["font-size"];return styleInfo["font-size"]=parseInt(fontSize,10),styleInfo["font-size-unit"]=fontSize.match(/[a-z%]+$/),styleInfo}},{key:"stylePara",value:function stylePara(rng,styleInfo){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(rng.nodes(dom.isPara,{includeAncestor:!0}),(function(idx,para){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(para).css(styleInfo)}))}},{key:"styleNodes",value:function styleNodes(rng,options){rng=rng.splitText();var nodeName=options&&options.nodeName||"SPAN",expandClosestSibling=!(!options||!options.expandClosestSibling),onlyPartialContains=!(!options||!options.onlyPartialContains);if(rng.isCollapsed())return[rng.insertNode(dom.create(nodeName))];var pred=dom.makePredByNodeName(nodeName),nodes=rng.nodes(dom.isText,{fullyContains:!0}).map((function(text){return dom.singleChildAncestor(text,pred)||dom.wrap(text,nodeName)}));if(expandClosestSibling){if(onlyPartialContains){var nodesInRange=rng.nodes();pred=func.and(pred,(function(node){return lists.contains(nodesInRange,node)}))}return nodes.map((function(node){var siblings=dom.withClosestSiblings(node,pred),head=lists.head(siblings),tails=lists.tail(siblings);return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(tails,(function(idx,elem){dom.appendChildNodes(head,elem.childNodes),dom.remove(elem)})),lists.head(siblings)}))}return nodes}},{key:"current",value:function current(rng){var $cont=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(dom.isElement(rng.sc)?rng.sc:rng.sc.parentNode),styleInfo=this.fromNode($cont);try{styleInfo=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(styleInfo,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal","font-family":document.queryCommandValue("fontname")||styleInfo["font-family"]})}catch(e){}if(rng.isOnList()){var orderedTypes,isUnordered=["circle","disc","disc-leading-zero","square"].indexOf(styleInfo["list-style-type"])>-1;styleInfo["list-style"]=isUnordered?"unordered":"ordered"}else styleInfo["list-style"]="none";var para=dom.ancestor(rng.sc,dom.isPara);if(para&¶.style["line-height"])styleInfo["line-height"]=para.style.lineHeight;else{var lineHeight=parseInt(styleInfo["line-height"],10)/parseInt(styleInfo["font-size"],10);styleInfo["line-height"]=lineHeight.toFixed(1)}return styleInfo.anchor=rng.isOnAnchor()&&dom.ancestor(rng.sc,dom.isAnchor),styleInfo.ancestors=dom.listAncestor(rng.sc,dom.isEditable),styleInfo.range=rng,styleInfo}}]),Style}();function Bullet_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Bullet_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Bullet_createClass(Constructor,protoProps,staticProps){return protoProps&&Bullet_defineProperties(Constructor.prototype,protoProps),staticProps&&Bullet_defineProperties(Constructor,staticProps),Constructor}var Bullet_Bullet=function(){function Bullet(){Bullet_classCallCheck(this,Bullet)}return Bullet_createClass(Bullet,[{key:"insertOrderedList",value:function insertOrderedList(editable){this.toggleList("OL",editable)}},{key:"insertUnorderedList",value:function insertUnorderedList(editable){this.toggleList("UL",editable)}},{key:"indent",value:function indent(editable){var _this=this,rng=range.create(editable).wrapBodyInlineWithPara(),paras=rng.nodes(dom.isPara,{includeAncestor:!0}),clustereds=lists.clusterBy(paras,func.peq2("parentNode"));external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(clustereds,(function(idx,paras){var head=lists.head(paras);if(dom.isLi(head)){var previousList=_this.findList(head.previousSibling);previousList?paras.map((function(para){return previousList.appendChild(para)})):(_this.wrapList(paras,head.parentNode.nodeName),paras.map((function(para){return para.parentNode})).map((function(para){return _this.appendToPrevious(para)})))}else external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(paras,(function(idx,para){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(para).css("marginLeft",(function(idx,val){return(parseInt(val,10)||0)+25}))}))})),rng.select()}},{key:"outdent",value:function outdent(editable){var _this2=this,rng=range.create(editable).wrapBodyInlineWithPara(),paras=rng.nodes(dom.isPara,{includeAncestor:!0}),clustereds=lists.clusterBy(paras,func.peq2("parentNode"));external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(clustereds,(function(idx,paras){var head=lists.head(paras);dom.isLi(head)?_this2.releaseList([paras]):external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(paras,(function(idx,para){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(para).css("marginLeft",(function(idx,val){return(val=parseInt(val,10)||0)>25?val-25:""}))}))})),rng.select()}},{key:"toggleList",value:function toggleList(listName,editable){var _this3=this,rng=range.create(editable).wrapBodyInlineWithPara(),paras=rng.nodes(dom.isPara,{includeAncestor:!0}),bookmark=rng.paraBookmark(paras),clustereds=lists.clusterBy(paras,func.peq2("parentNode"));if(lists.find(paras,dom.isPurePara)){var wrappedParas=[];external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(clustereds,(function(idx,paras){wrappedParas=wrappedParas.concat(_this3.wrapList(paras,listName))})),paras=wrappedParas}else{var diffLists=rng.nodes(dom.isList,{includeAncestor:!0}).filter((function(listNode){return!external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.nodeName(listNode,listName)}));diffLists.length?external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(diffLists,(function(idx,listNode){dom.replace(listNode,listName)})):paras=this.releaseList(clustereds,!0)}range.createFromParaBookmark(bookmark,paras).select()}},{key:"wrapList",value:function wrapList(paras,listName){var head=lists.head(paras),last=lists.last(paras),prevList=dom.isList(head.previousSibling)&&head.previousSibling,nextList=dom.isList(last.nextSibling)&&last.nextSibling,listNode=prevList||dom.insertAfter(dom.create(listName||"UL"),last);return paras=paras.map((function(para){return dom.isPurePara(para)?dom.replace(para,"LI"):para})),dom.appendChildNodes(listNode,paras),nextList&&(dom.appendChildNodes(listNode,lists.from(nextList.childNodes)),dom.remove(nextList)),paras}},{key:"releaseList",value:function releaseList(clustereds,isEscapseToBody){var _this4=this,releasedParas=[];return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(clustereds,(function(idx,paras){var head=lists.head(paras),last=lists.last(paras),headList=isEscapseToBody?dom.lastAncestor(head,dom.isList):head.parentNode,parentItem=headList.parentNode;if("LI"===headList.parentNode.nodeName)paras.map((function(para){var newList=_this4.findNextSiblings(para);parentItem.nextSibling?parentItem.parentNode.insertBefore(para,parentItem.nextSibling):parentItem.parentNode.appendChild(para),newList.length&&(_this4.wrapList(newList,headList.nodeName),para.appendChild(newList[0].parentNode))})),0===headList.children.length&&parentItem.removeChild(headList),0===parentItem.childNodes.length&&parentItem.parentNode.removeChild(parentItem);else{var lastList=headList.childNodes.length>1?dom.splitTree(headList,{node:last.parentNode,offset:dom.position(last)+1},{isSkipPaddingBlankHTML:!0}):null,middleList=dom.splitTree(headList,{node:head.parentNode,offset:dom.position(head)},{isSkipPaddingBlankHTML:!0});paras=isEscapseToBody?dom.listDescendant(middleList,dom.isLi):lists.from(middleList.childNodes).filter(dom.isLi),!isEscapseToBody&&dom.isList(headList.parentNode)||(paras=paras.map((function(para){return dom.replace(para,"P")}))),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(lists.from(paras).reverse(),(function(idx,para){dom.insertAfter(para,headList)}));var rootLists=lists.compact([headList,middleList,lastList]);external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(rootLists,(function(idx,rootList){var listNodes=[rootList].concat(dom.listDescendant(rootList,dom.isList));external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(listNodes.reverse(),(function(idx,listNode){dom.nodeLength(listNode)||dom.remove(listNode,!0)}))}))}releasedParas=releasedParas.concat(paras)})),releasedParas}},{key:"appendToPrevious",value:function appendToPrevious(node){return node.previousSibling?dom.appendChildNodes(node.previousSibling,[node]):this.wrapList([node],"LI")}},{key:"findList",value:function findList(node){return node?lists.find(node.children,(function(child){return["OL","UL"].indexOf(child.nodeName)>-1})):null}},{key:"findNextSiblings",value:function findNextSiblings(node){for(var siblings=[];node.nextSibling;)siblings.push(node.nextSibling),node=node.nextSibling;return siblings}}]),Bullet}();function Typing_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Typing_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Typing_createClass(Constructor,protoProps,staticProps){return protoProps&&Typing_defineProperties(Constructor.prototype,protoProps),staticProps&&Typing_defineProperties(Constructor,staticProps),Constructor}var Typing_Typing=function(){function Typing(context){Typing_classCallCheck(this,Typing),this.bullet=new Bullet_Bullet,this.options=context.options}return Typing_createClass(Typing,[{key:"insertTab",value:function insertTab(rng,tabsize){var tab=dom.createText(new Array(tabsize+1).join(dom.NBSP_CHAR));(rng=rng.deleteContents()).insertNode(tab,!0),(rng=range.create(tab,tabsize)).select()}},{key:"insertParagraph",value:function insertParagraph(editable,rng){rng=(rng=(rng=rng||range.create(editable)).deleteContents()).wrapBodyInlineWithPara();var splitRoot=dom.ancestor(rng.sc,dom.isPara),nextPara;if(splitRoot){if(dom.isLi(splitRoot)&&(dom.isEmpty(splitRoot)||dom.deepestChildIsEmpty(splitRoot)))return void this.bullet.toggleList(splitRoot.parentNode.nodeName);var blockquote=null;if(1===this.options.blockquoteBreakingLevel?blockquote=dom.ancestor(splitRoot,dom.isBlockquote):2===this.options.blockquoteBreakingLevel&&(blockquote=dom.lastAncestor(splitRoot,dom.isBlockquote)),blockquote){nextPara=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(dom.emptyPara)[0],dom.isRightEdgePoint(rng.getStartPoint())&&dom.isBR(rng.sc.nextSibling)&&external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(rng.sc.nextSibling).remove();var split=dom.splitTree(blockquote,rng.getStartPoint(),{isDiscardEmptySplits:!0});split?split.parentNode.insertBefore(nextPara,split):dom.insertAfter(nextPara,blockquote)}else{nextPara=dom.splitTree(splitRoot,rng.getStartPoint());var emptyAnchors=dom.listDescendant(splitRoot,dom.isEmptyAnchor);emptyAnchors=emptyAnchors.concat(dom.listDescendant(nextPara,dom.isEmptyAnchor)),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(emptyAnchors,(function(idx,anchor){dom.remove(anchor)})),(dom.isHeading(nextPara)||dom.isPre(nextPara)||dom.isCustomStyleTag(nextPara))&&dom.isEmpty(nextPara)&&(nextPara=dom.replace(nextPara,"p"))}}else{var next=rng.sc.childNodes[rng.so];nextPara=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(dom.emptyPara)[0],next?rng.sc.insertBefore(nextPara,next):rng.sc.appendChild(nextPara)}range.create(nextPara,0).normalize().select().scrollIntoView(editable)}}]),Typing}();function Table_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Table_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Table_createClass(Constructor,protoProps,staticProps){return protoProps&&Table_defineProperties(Constructor.prototype,protoProps),staticProps&&Table_defineProperties(Constructor,staticProps),Constructor}var TableResultAction=function TableResultAction(startPoint,where,action,domTable){var _startPoint={colPos:0,rowPos:0},_virtualTable=[],_actionCellList=[];function setStartPoint(){startPoint&&startPoint.tagName&&("td"===startPoint.tagName.toLowerCase()||"th"===startPoint.tagName.toLowerCase())&&(_startPoint.colPos=startPoint.cellIndex,startPoint.parentElement&&startPoint.parentElement.tagName&&"tr"===startPoint.parentElement.tagName.toLowerCase()&&(_startPoint.rowPos=startPoint.parentElement.rowIndex))}function setVirtualTablePosition(rowIndex,cellIndex,baseRow,baseCell,isRowSpan,isColSpan,isVirtualCell){var objPosition={baseRow:baseRow,baseCell:baseCell,isRowSpan:isRowSpan,isColSpan:isColSpan,isVirtual:isVirtualCell};_virtualTable[rowIndex]||(_virtualTable[rowIndex]=[]),_virtualTable[rowIndex][cellIndex]=objPosition}function getActionCell(virtualTableCellObj,resultAction,virtualRowPosition,virtualColPosition){return{baseCell:virtualTableCellObj.baseCell,action:resultAction,virtualTable:{rowIndex:virtualRowPosition,cellIndex:virtualColPosition}}}function recoverCellIndex(rowIndex,cellIndex){if(!_virtualTable[rowIndex])return cellIndex;if(!_virtualTable[rowIndex][cellIndex])return cellIndex;for(var newCellIndex=cellIndex;_virtualTable[rowIndex][newCellIndex];)if(newCellIndex++,!_virtualTable[rowIndex][newCellIndex])return newCellIndex}function addCellInfoToVirtual(row,cell){var cellIndex=recoverCellIndex(row.rowIndex,cell.cellIndex),cellHasColspan=cell.colSpan>1,cellHasRowspan=cell.rowSpan>1,isThisSelectedCell=row.rowIndex===_startPoint.rowPos&&cell.cellIndex===_startPoint.colPos;setVirtualTablePosition(row.rowIndex,cellIndex,row,cell,cellHasRowspan,cellHasColspan,!1);var rowspanNumber=cell.attributes.rowSpan?parseInt(cell.attributes.rowSpan.value,10):0;if(rowspanNumber>1)for(var rp=1;rp<rowspanNumber;rp++){var rowspanIndex=row.rowIndex+rp;adjustStartPoint(rowspanIndex,cellIndex,cell,isThisSelectedCell),setVirtualTablePosition(rowspanIndex,cellIndex,row,cell,!0,cellHasColspan,!0)}var colspanNumber=cell.attributes.colSpan?parseInt(cell.attributes.colSpan.value,10):0;if(colspanNumber>1)for(var cp=1;cp<colspanNumber;cp++){var cellspanIndex=recoverCellIndex(row.rowIndex,cellIndex+cp);adjustStartPoint(row.rowIndex,cellspanIndex,cell,isThisSelectedCell),setVirtualTablePosition(row.rowIndex,cellspanIndex,row,cell,cellHasRowspan,!0,!0)}}function adjustStartPoint(rowIndex,cellIndex,cell,isSelectedCell){rowIndex===_startPoint.rowPos&&_startPoint.colPos>=cell.cellIndex&&cell.cellIndex<=cellIndex&&!isSelectedCell&&_startPoint.colPos++}function createVirtualTable(){for(var rows=domTable.rows,rowIndex=0;rowIndex<rows.length;rowIndex++)for(var cells=rows[rowIndex].cells,cellIndex=0;cellIndex<cells.length;cellIndex++)addCellInfoToVirtual(rows[rowIndex],cells[cellIndex])}function getDeleteResultActionToCell(cell){switch(where){case TableResultAction.where.Column:if(cell.isColSpan)return TableResultAction.resultAction.SubtractSpanCount;break;case TableResultAction.where.Row:if(!cell.isVirtual&&cell.isRowSpan)return TableResultAction.resultAction.AddCell;if(cell.isRowSpan)return TableResultAction.resultAction.SubtractSpanCount}return TableResultAction.resultAction.RemoveCell}function getAddResultActionToCell(cell){switch(where){case TableResultAction.where.Column:if(cell.isColSpan)return TableResultAction.resultAction.SumSpanCount;if(cell.isRowSpan&&cell.isVirtual)return TableResultAction.resultAction.Ignore;break;case TableResultAction.where.Row:if(cell.isRowSpan)return TableResultAction.resultAction.SumSpanCount;if(cell.isColSpan&&cell.isVirtual)return TableResultAction.resultAction.Ignore}return TableResultAction.resultAction.AddCell}function init(){setStartPoint(),createVirtualTable()}this.getActionList=function(){for(var fixedRow=where===TableResultAction.where.Row?_startPoint.rowPos:-1,fixedCol=where===TableResultAction.where.Column?_startPoint.colPos:-1,actualPosition=0,canContinue=!0;canContinue;){var rowPosition=fixedRow>=0?fixedRow:actualPosition,colPosition=fixedCol>=0?fixedCol:actualPosition,row=_virtualTable[rowPosition];if(!row)return canContinue=!1,_actionCellList;var cell=row[colPosition];if(!cell)return canContinue=!1,_actionCellList;var resultAction=TableResultAction.resultAction.Ignore;switch(action){case TableResultAction.requestAction.Add:resultAction=getAddResultActionToCell(cell);break;case TableResultAction.requestAction.Delete:resultAction=getDeleteResultActionToCell(cell)}_actionCellList.push(getActionCell(cell,resultAction,rowPosition,colPosition)),actualPosition++}return _actionCellList},init()};TableResultAction.where={Row:0,Column:1},TableResultAction.requestAction={Add:0,Delete:1},TableResultAction.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};var Table_Table=function(){function Table(){Table_classCallCheck(this,Table)}return Table_createClass(Table,[{key:"tab",value:function tab(rng,isShift){var cell=dom.ancestor(rng.commonAncestor(),dom.isCell),table=dom.ancestor(cell,dom.isTable),cells=dom.listDescendant(table,dom.isCell),nextCell=lists[isShift?"prev":"next"](cells,cell);nextCell&&range.create(nextCell,0).select()}},{key:"addRow",value:function addRow(rng,position){for(var cell=dom.ancestor(rng.commonAncestor(),dom.isCell),currentTr=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(cell).closest("tr"),trAttributes=this.recoverAttributes(currentTr),html=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<tr"+trAttributes+"></tr>"),vTable,actions=new TableResultAction(cell,TableResultAction.where.Row,TableResultAction.requestAction.Add,external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(currentTr).closest("table")[0]).getActionList(),idCell=0;idCell<actions.length;idCell++){var currentCell=actions[idCell],tdAttributes=this.recoverAttributes(currentCell.baseCell);switch(currentCell.action){case TableResultAction.resultAction.AddCell:html.append("<td"+tdAttributes+">"+dom.blank+"</td>");break;case TableResultAction.resultAction.SumSpanCount:var baseCellTr,isTopFromRowSpan;if("top"===position)if((currentCell.baseCell.parent?currentCell.baseCell.closest("tr").rowIndex:0)<=currentTr[0].rowIndex){var newTd=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<div></div>").append(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<td"+tdAttributes+">"+dom.blank+"</td>").removeAttr("rowspan")).html();html.append(newTd);break}var rowspanNumber=parseInt(currentCell.baseCell.rowSpan,10);rowspanNumber++,currentCell.baseCell.setAttribute("rowSpan",rowspanNumber)}}if("top"===position)currentTr.before(html);else{var cellHasRowspan;if(cell.rowSpan>1){var lastTrIndex=currentTr[0].rowIndex+(cell.rowSpan-2);return void external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(currentTr).parent().find("tr")[lastTrIndex]).after(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(html))}currentTr.after(html)}}},{key:"addCol",value:function addCol(rng,position){var cell=dom.ancestor(rng.commonAncestor(),dom.isCell),row=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(cell).closest("tr"),rowsGroup;external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(row).siblings().push(row);for(var vTable,actions=new TableResultAction(cell,TableResultAction.where.Column,TableResultAction.requestAction.Add,external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(row).closest("table")[0]).getActionList(),actionIndex=0;actionIndex<actions.length;actionIndex++){var currentCell=actions[actionIndex],tdAttributes=this.recoverAttributes(currentCell.baseCell);switch(currentCell.action){case TableResultAction.resultAction.AddCell:"right"===position?external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(currentCell.baseCell).after("<td"+tdAttributes+">"+dom.blank+"</td>"):external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(currentCell.baseCell).before("<td"+tdAttributes+">"+dom.blank+"</td>");break;case TableResultAction.resultAction.SumSpanCount:if("right"===position){var colspanNumber=parseInt(currentCell.baseCell.colSpan,10);colspanNumber++,currentCell.baseCell.setAttribute("colSpan",colspanNumber)}else external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(currentCell.baseCell).before("<td"+tdAttributes+">"+dom.blank+"</td>")}}}},{key:"recoverAttributes",value:function recoverAttributes(el){var resultStr="";if(!el)return resultStr;for(var attrList=el.attributes||[],i=0;i<attrList.length;i++)"id"!==attrList[i].name.toLowerCase()&&attrList[i].specified&&(resultStr+=" "+attrList[i].name+"='"+attrList[i].value+"'");return resultStr}},{key:"deleteRow",value:function deleteRow(rng){for(var cell=dom.ancestor(rng.commonAncestor(),dom.isCell),row=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(cell).closest("tr"),cellPos=row.children("td, th").index(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(cell)),rowPos=row[0].rowIndex,vTable,actions=new TableResultAction(cell,TableResultAction.where.Row,TableResultAction.requestAction.Delete,external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(row).closest("table")[0]).getActionList(),actionIndex=0;actionIndex<actions.length;actionIndex++)if(actions[actionIndex]){var baseCell=actions[actionIndex].baseCell,virtualPosition=actions[actionIndex].virtualTable,hasRowspan=baseCell.rowSpan&&baseCell.rowSpan>1,rowspanNumber=hasRowspan?parseInt(baseCell.rowSpan,10):0;switch(actions[actionIndex].action){case TableResultAction.resultAction.Ignore:continue;case TableResultAction.resultAction.AddCell:var nextRow=row.next("tr")[0];if(!nextRow)continue;var cloneRow=row[0].cells[cellPos];hasRowspan&&(rowspanNumber>2?(rowspanNumber--,nextRow.insertBefore(cloneRow,nextRow.cells[cellPos]),nextRow.cells[cellPos].setAttribute("rowSpan",rowspanNumber),nextRow.cells[cellPos].innerHTML=""):2===rowspanNumber&&(nextRow.insertBefore(cloneRow,nextRow.cells[cellPos]),nextRow.cells[cellPos].removeAttribute("rowSpan"),nextRow.cells[cellPos].innerHTML=""));continue;case TableResultAction.resultAction.SubtractSpanCount:hasRowspan&&(rowspanNumber>2?(rowspanNumber--,baseCell.setAttribute("rowSpan",rowspanNumber),virtualPosition.rowIndex!==rowPos&&baseCell.cellIndex===cellPos&&(baseCell.innerHTML="")):2===rowspanNumber&&(baseCell.removeAttribute("rowSpan"),virtualPosition.rowIndex!==rowPos&&baseCell.cellIndex===cellPos&&(baseCell.innerHTML="")));continue;case TableResultAction.resultAction.RemoveCell:continue}}row.remove()}},{key:"deleteCol",value:function deleteCol(rng){for(var cell=dom.ancestor(rng.commonAncestor(),dom.isCell),row=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(cell).closest("tr"),cellPos=row.children("td, th").index(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(cell)),vTable,actions=new TableResultAction(cell,TableResultAction.where.Column,TableResultAction.requestAction.Delete,external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(row).closest("table")[0]).getActionList(),actionIndex=0;actionIndex<actions.length;actionIndex++)if(actions[actionIndex])switch(actions[actionIndex].action){case TableResultAction.resultAction.Ignore:continue;case TableResultAction.resultAction.SubtractSpanCount:var baseCell=actions[actionIndex].baseCell,hasColspan;if(baseCell.colSpan&&baseCell.colSpan>1){var colspanNumber=baseCell.colSpan?parseInt(baseCell.colSpan,10):0;colspanNumber>2?(colspanNumber--,baseCell.setAttribute("colSpan",colspanNumber),baseCell.cellIndex===cellPos&&(baseCell.innerHTML="")):2===colspanNumber&&(baseCell.removeAttribute("colSpan"),baseCell.cellIndex===cellPos&&(baseCell.innerHTML=""))}continue;case TableResultAction.resultAction.RemoveCell:dom.remove(actions[actionIndex].baseCell,!0);continue}}},{key:"createTable",value:function createTable(colCount,rowCount,options){for(var tds=[],tdHTML,idxCol=0;idxCol<colCount;idxCol++)tds.push("<td>"+dom.blank+"</td>");tdHTML=tds.join("");for(var trs=[],trHTML,idxRow=0;idxRow<rowCount;idxRow++)trs.push("<tr>"+tdHTML+"</tr>");trHTML=trs.join("");var $table=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<table>"+trHTML+"</table>");return options&&options.tableClassName&&$table.addClass(options.tableClassName),$table[0]}},{key:"deleteTable",value:function deleteTable(rng){var cell=dom.ancestor(rng.commonAncestor(),dom.isCell);external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(cell).closest("table").remove()}}]),Table}();function Editor_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Editor_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Editor_createClass(Constructor,protoProps,staticProps){return protoProps&&Editor_defineProperties(Constructor.prototype,protoProps),staticProps&&Editor_defineProperties(Constructor,staticProps),Constructor}var KEY_BOGUS="bogus",Editor_Editor=function(){function Editor(context){var _this=this;Editor_classCallCheck(this,Editor),this.context=context,this.$note=context.layoutInfo.note,this.$editor=context.layoutInfo.editor,this.$editable=context.layoutInfo.editable,this.options=context.options,this.lang=this.options.langInfo,this.editable=this.$editable[0],this.lastRange=null,this.snapshot=null,this.style=new Style_Style,this.table=new Table_Table,this.typing=new Typing_Typing(context),this.bullet=new Bullet_Bullet,this.history=new History_History(context),this.context.memo("help.escape",this.lang.help.escape),this.context.memo("help.undo",this.lang.help.undo),this.context.memo("help.redo",this.lang.help.redo),this.context.memo("help.tab",this.lang.help.tab),this.context.memo("help.untab",this.lang.help.untab),this.context.memo("help.insertParagraph",this.lang.help.insertParagraph),this.context.memo("help.insertOrderedList",this.lang.help.insertOrderedList),this.context.memo("help.insertUnorderedList",this.lang.help.insertUnorderedList),this.context.memo("help.indent",this.lang.help.indent),this.context.memo("help.outdent",this.lang.help.outdent),this.context.memo("help.formatPara",this.lang.help.formatPara),this.context.memo("help.insertHorizontalRule",this.lang.help.insertHorizontalRule),this.context.memo("help.fontName",this.lang.help.fontName);for(var commands=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor"],idx=0,len=commands.length;idx<len;idx++)this[commands[idx]]=function(sCmd){return function(value){_this.beforeCommand(),document.execCommand(sCmd,!1,value),_this.afterCommand(!0)}}(commands[idx]),this.context.memo("help."+commands[idx],this.lang.help[commands[idx]]);this.fontName=this.wrapCommand((function(value){return _this.fontStyling("font-family",env.validFontName(value))})),this.fontSize=this.wrapCommand((function(value){var unit=_this.currentStyle()["font-size-unit"];return _this.fontStyling("font-size",value+unit)})),this.fontSizeUnit=this.wrapCommand((function(value){var size=_this.currentStyle()["font-size"];return _this.fontStyling("font-size",size+value)}));for(var _idx=1;_idx<=6;_idx++)this["formatH"+_idx]=function(idx){return function(){_this.formatBlock("H"+idx)}}(_idx),this.context.memo("help.formatH"+_idx,this.lang.help["formatH"+_idx]);this.insertParagraph=this.wrapCommand((function(){_this.typing.insertParagraph(_this.editable)})),this.insertOrderedList=this.wrapCommand((function(){_this.bullet.insertOrderedList(_this.editable)})),this.insertUnorderedList=this.wrapCommand((function(){_this.bullet.insertUnorderedList(_this.editable)})),this.indent=this.wrapCommand((function(){_this.bullet.indent(_this.editable)})),this.outdent=this.wrapCommand((function(){_this.bullet.outdent(_this.editable)})),this.insertNode=this.wrapCommand((function(node){var rng;_this.isLimited(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(node).text().length)||(_this.getLastRange().insertNode(node),_this.setLastRange(range.createFromNodeAfter(node).select()))})),this.insertText=this.wrapCommand((function(text){if(!_this.isLimited(text.length)){var rng,textNode=_this.getLastRange().insertNode(dom.createText(text));_this.setLastRange(range.create(textNode,dom.nodeLength(textNode)).select())}})),this.pasteHTML=this.wrapCommand((function(markup){if(!_this.isLimited(markup.length)){markup=_this.context.invoke("codeview.purify",markup);var contents=_this.getLastRange().pasteHTML(markup);_this.setLastRange(range.createFromNodeAfter(lists.last(contents)).select())}})),this.formatBlock=this.wrapCommand((function(tagName,$target){var onApplyCustomStyle=_this.options.callbacks.onApplyCustomStyle;onApplyCustomStyle?onApplyCustomStyle.call(_this,$target,_this.context,_this.onFormatBlock):_this.onFormatBlock(tagName,$target)})),this.insertHorizontalRule=this.wrapCommand((function(){var hrNode=_this.getLastRange().insertNode(dom.create("HR"));hrNode.nextSibling&&_this.setLastRange(range.create(hrNode.nextSibling,0).normalize().select())})),this.lineHeight=this.wrapCommand((function(value){_this.style.stylePara(_this.getLastRange(),{lineHeight:value})})),this.createLink=this.wrapCommand((function(linkInfo){var linkUrl=linkInfo.url,linkText=linkInfo.text,isNewWindow=linkInfo.isNewWindow,checkProtocol=linkInfo.checkProtocol,rng=linkInfo.range||_this.getLastRange(),additionalTextLength=linkText.length-rng.toString().length;if(!(additionalTextLength>0&&_this.isLimited(additionalTextLength))){var isTextChanged=rng.toString()!==linkText;"string"==typeof linkUrl&&(linkUrl=linkUrl.trim()),_this.options.onCreateLink?linkUrl=_this.options.onCreateLink(linkUrl):checkProtocol&&(linkUrl=/^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(linkUrl)?linkUrl:_this.options.defaultProtocol+linkUrl);var anchors=[];if(isTextChanged){var anchor=(rng=rng.deleteContents()).insertNode(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<A>"+linkText+"</A>")[0]);anchors.push(anchor)}else anchors=_this.style.styleNodes(rng,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(anchors,(function(idx,anchor){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(anchor).attr("href",linkUrl),isNewWindow?external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(anchor).attr("target","_blank"):external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(anchor).removeAttr("target")})),_this.setLastRange(_this.createRangeFromList(anchors).select())}})),this.color=this.wrapCommand((function(colorInfo){var foreColor=colorInfo.foreColor,backColor=colorInfo.backColor;foreColor&&document.execCommand("foreColor",!1,foreColor),backColor&&document.execCommand("backColor",!1,backColor)})),this.foreColor=this.wrapCommand((function(colorInfo){document.execCommand("foreColor",!1,colorInfo)})),this.insertTable=this.wrapCommand((function(dim){var dimension=dim.split("x"),rng;_this.getLastRange().deleteContents().insertNode(_this.table.createTable(dimension[0],dimension[1],_this.options))})),this.removeMedia=this.wrapCommand((function(){var $target=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(_this.restoreTarget()).parent();$target.closest("figure").length?$target.closest("figure").remove():$target=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(_this.restoreTarget()).detach(),_this.context.triggerEvent("media.delete",$target,_this.$editable)})),this.floatMe=this.wrapCommand((function(value){var $target=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(_this.restoreTarget());$target.toggleClass("note-float-left","left"===value),$target.toggleClass("note-float-right","right"===value),$target.css("float","none"===value?"":value)})),this.resize=this.wrapCommand((function(value){var $target=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(_this.restoreTarget());0===(value=parseFloat(value))?$target.css("width",""):$target.css({width:100*value+"%",height:""})}))}return Editor_createClass(Editor,[{key:"initialize",value:function initialize(){var _this2=this;this.$editable.on("keydown",(function(event){if(event.keyCode===core_key.code.ENTER&&_this2.context.triggerEvent("enter",event),_this2.context.triggerEvent("keydown",event),_this2.snapshot=_this2.history.makeSnapshot(),_this2.hasKeyShortCut=!1,event.isDefaultPrevented()||(_this2.options.shortcuts?_this2.hasKeyShortCut=_this2.handleKeyMap(event):_this2.preventDefaultEditableShortCuts(event)),_this2.isLimited(1,event)){var lastRange=_this2.getLastRange();if(lastRange.eo-lastRange.so==0)return!1}_this2.setLastRange(),_this2.options.recordEveryKeystroke&&!1===_this2.hasKeyShortCut&&_this2.history.recordUndo()})).on("keyup",(function(event){_this2.setLastRange(),_this2.context.triggerEvent("keyup",event)})).on("focus",(function(event){_this2.setLastRange(),_this2.context.triggerEvent("focus",event)})).on("blur",(function(event){_this2.context.triggerEvent("blur",event)})).on("mousedown",(function(event){_this2.context.triggerEvent("mousedown",event)})).on("mouseup",(function(event){_this2.setLastRange(),_this2.history.recordUndo(),_this2.context.triggerEvent("mouseup",event)})).on("scroll",(function(event){_this2.context.triggerEvent("scroll",event)})).on("paste",(function(event){_this2.setLastRange(),_this2.context.triggerEvent("paste",event)})).on("input",(function(){_this2.isLimited(0)&&_this2.snapshot&&_this2.history.applySnapshot(_this2.snapshot)})),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(dom.html(this.$note)||dom.emptyPara),this.$editable.on(env.inputEventName,func.debounce((function(){_this2.context.triggerEvent("change",_this2.$editable.html(),_this2.$editable)}),10)),this.$editable.on("focusin",(function(event){_this2.context.triggerEvent("focusin",event)})).on("focusout",(function(event){_this2.context.triggerEvent("focusout",event)})),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",(function(event){return _this2.context.triggerEvent("contextmenu",event),!1})):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo(),this.setLastRange()}},{key:"destroy",value:function destroy(){this.$editable.off()}},{key:"handleKeyMap",value:function handleKeyMap(event){var keyMap=this.options.keyMap[env.isMac?"mac":"pc"],keys=[];event.metaKey&&keys.push("CMD"),event.ctrlKey&&!event.altKey&&keys.push("CTRL"),event.shiftKey&&keys.push("SHIFT");var keyName=core_key.nameFromCode[event.keyCode];keyName&&keys.push(keyName);var eventName=keyMap[keys.join("+")];if("TAB"!==keyName||this.options.tabDisable)if(eventName){if(!1!==this.context.invoke(eventName))return event.preventDefault(),!0}else core_key.isEdit(event.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function preventDefaultEditableShortCuts(event){(event.ctrlKey||event.metaKey)&&lists.contains([66,73,85],event.keyCode)&&event.preventDefault()}},{key:"isLimited",value:function isLimited(pad,event){return pad=pad||0,(void 0===event||!(core_key.isMove(event.keyCode)||core_key.isNavigation(event.keyCode)||event.ctrlKey||event.metaKey||lists.contains([core_key.code.BACKSPACE,core_key.code.DELETE],event.keyCode)))&&(this.options.maxTextLength>0&&this.$editable.text().length+pad>this.options.maxTextLength)}},{key:"createRange",value:function createRange(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"createRangeFromList",value:function createRangeFromList(lst){var startRange,startPoint=range.createFromNodeBefore(lists.head(lst)).getStartPoint(),endRange,endPoint=range.createFromNodeAfter(lists.last(lst)).getEndPoint();return range.create(startPoint.node,startPoint.offset,endPoint.node,endPoint.offset)}},{key:"setLastRange",value:function setLastRange(rng){rng?this.lastRange=rng:(this.lastRange=range.create(this.editable),0===external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=range.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function getLastRange(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function saveRange(thenCollapse){thenCollapse&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function restoreRange(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function saveTarget(node){this.$editable.data("target",node)}},{key:"clearTarget",value:function clearTarget(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function restoreTarget(){return this.$editable.data("target")}},{key:"currentStyle",value:function currentStyle(){var rng=range.create();return rng&&(rng=rng.normalize()),rng?this.style.current(rng):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function styleFromNode($node){return this.style.fromNode($node)}},{key:"undo",value:function undo(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.undo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"commit",value:function commit(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.commit(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"redo",value:function redo(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.redo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"beforeCommand",value:function beforeCommand(){this.context.triggerEvent("before.command",this.$editable.html()),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}},{key:"afterCommand",value:function afterCommand(isPreventTrigger){this.normalizeContent(),this.history.recordUndo(),isPreventTrigger||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function tab(){var rng=this.getLastRange();if(rng.isCollapsed()&&rng.isOnCell())this.table.tab(rng);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(rng,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function untab(){var rng=this.getLastRange();if(rng.isCollapsed()&&rng.isOnCell())this.table.tab(rng,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function wrapCommand(fn){return function(){this.beforeCommand(),fn.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function insertImage(src,param){var _this3=this;return createImage(src,param).then((function($image){_this3.beforeCommand(),"function"==typeof param?param($image):("string"==typeof param&&$image.attr("data-filename",param),$image.css("width",Math.min(_this3.$editable.width(),$image.width()))),$image.show(),_this3.getLastRange().insertNode($image[0]),_this3.setLastRange(range.createFromNodeAfter($image[0]).select()),_this3.afterCommand()})).fail((function(e){_this3.context.triggerEvent("image.upload.error",e)}))}},{key:"insertImagesAsDataURL",value:function insertImagesAsDataURL(files){var _this4=this;external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(files,(function(idx,file){var filename=file.name;_this4.options.maximumImageFileSize&&_this4.options.maximumImageFileSize<file.size?_this4.context.triggerEvent("image.upload.error",_this4.lang.image.maximumFileSizeError):readFileAsDataURL(file).then((function(dataURL){return _this4.insertImage(dataURL,filename)})).fail((function(){_this4.context.triggerEvent("image.upload.error")}))}))}},{key:"insertImagesOrCallback",value:function insertImagesOrCallback(files){var callbacks;this.options.callbacks.onImageUpload?this.context.triggerEvent("image.upload",files):this.insertImagesAsDataURL(files)}},{key:"getSelectedText",value:function getSelectedText(){var rng=this.getLastRange();return rng.isOnAnchor()&&(rng=range.createFromNode(dom.ancestor(rng.sc,dom.isAnchor))),rng.toString()}},{key:"onFormatBlock",value:function onFormatBlock(tagName,$target){if(document.execCommand("FormatBlock",!1,env.isMSIE?"<"+tagName+">":tagName),$target&&$target.length&&($target[0].tagName.toUpperCase()!==tagName.toUpperCase()&&($target=$target.find(tagName)),$target&&$target.length)){var className=$target[0].className||"";if(className){var currentRange=this.createRange(),$parent;external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()([currentRange.sc,currentRange.ec]).closest(tagName).addClass(className)}}}},{key:"formatPara",value:function formatPara(){this.formatBlock("P")}},{key:"fontStyling",value:function fontStyling(target,value){var rng=this.getLastRange();if(""!==rng){var spans=this.style.styleNodes(rng);if(this.$editor.find(".note-status-output").html(""),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(spans).css(target,value),rng.isCollapsed()){var firstSpan=lists.head(spans);firstSpan&&!dom.nodeLength(firstSpan)&&(firstSpan.innerHTML=dom.ZERO_WIDTH_NBSP_CHAR,range.createFromNode(firstSpan.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",firstSpan))}else this.setLastRange(this.createRangeFromList(spans).select())}else{var noteStatusOutput=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.now();this.$editor.find(".note-status-output").html('<div id="note-status-output-'+noteStatusOutput+'" class="alert alert-info">'+this.lang.output.noSelection+"</div>"),setTimeout((function(){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("#note-status-output-"+noteStatusOutput).remove()}),5e3)}}},{key:"unlink",value:function unlink(){var rng=this.getLastRange();if(rng.isOnAnchor()){var anchor=dom.ancestor(rng.sc,dom.isAnchor);(rng=range.createFromNode(anchor)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand()}}},{key:"getLinkInfo",value:function getLinkInfo(){var rng=this.getLastRange().expand(dom.isAnchor),$anchor=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(lists.head(rng.nodes(dom.isAnchor))),linkInfo={range:rng,text:rng.toString(),url:$anchor.length?$anchor.attr("href"):""};return $anchor.length&&(linkInfo.isNewWindow="_blank"===$anchor.attr("target")),linkInfo}},{key:"addRow",value:function addRow(position){var rng=this.getLastRange(this.$editable);rng.isCollapsed()&&rng.isOnCell()&&(this.beforeCommand(),this.table.addRow(rng,position),this.afterCommand())}},{key:"addCol",value:function addCol(position){var rng=this.getLastRange(this.$editable);rng.isCollapsed()&&rng.isOnCell()&&(this.beforeCommand(),this.table.addCol(rng,position),this.afterCommand())}},{key:"deleteRow",value:function deleteRow(){var rng=this.getLastRange(this.$editable);rng.isCollapsed()&&rng.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(rng),this.afterCommand())}},{key:"deleteCol",value:function deleteCol(){var rng=this.getLastRange(this.$editable);rng.isCollapsed()&&rng.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(rng),this.afterCommand())}},{key:"deleteTable",value:function deleteTable(){var rng=this.getLastRange(this.$editable);rng.isCollapsed()&&rng.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(rng),this.afterCommand())}},{key:"resizeTo",value:function resizeTo(pos,$target,bKeepRatio){var imageSize;if(bKeepRatio){var newRatio=pos.y/pos.x,ratio=$target.data("ratio");imageSize={width:ratio>newRatio?pos.x:pos.y/ratio,height:ratio>newRatio?pos.x*ratio:pos.y}}else imageSize={width:pos.x,height:pos.y};$target.css(imageSize)}},{key:"hasFocus",value:function hasFocus(){return this.$editable.is(":focus")}},{key:"focus",value:function focus(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function isEmpty(){return dom.isEmpty(this.$editable[0])||dom.emptyPara===this.$editable.html()}},{key:"empty",value:function empty(){this.context.invoke("code",dom.emptyPara)}},{key:"normalizeContent",value:function normalizeContent(){this.$editable[0].normalize()}}]),Editor}();function Clipboard_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Clipboard_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Clipboard_createClass(Constructor,protoProps,staticProps){return protoProps&&Clipboard_defineProperties(Constructor.prototype,protoProps),staticProps&&Clipboard_defineProperties(Constructor,staticProps),Constructor}var Clipboard_Clipboard=function(){function Clipboard(context){Clipboard_classCallCheck(this,Clipboard),this.context=context,this.$editable=context.layoutInfo.editable}return Clipboard_createClass(Clipboard,[{key:"initialize",value:function initialize(){this.$editable.on("paste",this.pasteByEvent.bind(this))}},{key:"pasteByEvent",value:function pasteByEvent(event){var _this=this,clipboardData=event.originalEvent.clipboardData;if(clipboardData&&clipboardData.items&&clipboardData.items.length){var item=clipboardData.items.length>1?clipboardData.items[1]:lists.head(clipboardData.items);"file"===item.kind&&-1!==item.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[item.getAsFile()]),event.preventDefault()):"string"===item.kind&&this.context.invoke("editor.isLimited",clipboardData.getData("Text").length)&&event.preventDefault()}else if(window.clipboardData){var text=window.clipboardData.getData("text");this.context.invoke("editor.isLimited",text.length)&&event.preventDefault()}setTimeout((function(){_this.context.invoke("editor.afterCommand")}),10)}}]),Clipboard}();function Dropzone_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Dropzone_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Dropzone_createClass(Constructor,protoProps,staticProps){return protoProps&&Dropzone_defineProperties(Constructor.prototype,protoProps),staticProps&&Dropzone_defineProperties(Constructor,staticProps),Constructor}var Dropzone_Dropzone=function(){function Dropzone(context){Dropzone_classCallCheck(this,Dropzone),this.context=context,this.$eventListener=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document),this.$editor=context.layoutInfo.editor,this.$editable=context.layoutInfo.editable,this.options=context.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(['<div class="note-dropzone">','<div class="note-dropzone-message"></div>',"</div>"].join("")).prependTo(this.$editor)}return Dropzone_createClass(Dropzone,[{key:"initialize",value:function initialize(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(e){e.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function attachDragAndDropEvent(){var _this=this,collection=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(),$dropzoneMessage=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(e){var isCodeview=_this.context.invoke("codeview.isActivated"),hasEditorSize=_this.$editor.width()>0&&_this.$editor.height()>0;isCodeview||collection.length||!hasEditorSize||(_this.$editor.addClass("dragover"),_this.$dropzone.width(_this.$editor.width()),_this.$dropzone.height(_this.$editor.height()),$dropzoneMessage.text(_this.lang.image.dragImageHere)),collection=collection.add(e.target)},this.documentEventHandlers.onDragleave=function(e){(collection=collection.not(e.target)).length&&"BODY"!==e.target.nodeName||(collection=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(),_this.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){collection=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(),_this.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",(function(){_this.$dropzone.addClass("hover"),$dropzoneMessage.text(_this.lang.image.dropImage)})).on("dragleave",(function(){_this.$dropzone.removeClass("hover"),$dropzoneMessage.text(_this.lang.image.dragImageHere)})),this.$dropzone.on("drop",(function(event){var dataTransfer=event.originalEvent.dataTransfer;event.preventDefault(),dataTransfer&&dataTransfer.files&&dataTransfer.files.length?(_this.$editable.focus(),_this.context.invoke("editor.insertImagesOrCallback",dataTransfer.files)):external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(dataTransfer.types,(function(idx,type){if(!(type.toLowerCase().indexOf("_moz_")>-1)){var content=dataTransfer.getData(type);type.toLowerCase().indexOf("text")>-1?_this.context.invoke("editor.pasteHTML",content):external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(content).each((function(idx,item){_this.context.invoke("editor.insertNode",item)}))}}))})).on("dragover",!1)}},{key:"destroy",value:function destroy(){var _this2=this;Object.keys(this.documentEventHandlers).forEach((function(key){_this2.$eventListener.off(key.substr(2).toLowerCase(),_this2.documentEventHandlers[key])})),this.documentEventHandlers={}}}]),Dropzone}();function _createForOfIteratorHelper(o){if("undefined"==typeof Symbol||null==o[Symbol.iterator]){if(Array.isArray(o)||(o=_unsupportedIterableToArray(o))){var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var it,normalCompletion=!0,didErr=!1,err;return{s:function s(){it=o[Symbol.iterator]()},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function Codeview_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Codeview_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Codeview_createClass(Constructor,protoProps,staticProps){return protoProps&&Codeview_defineProperties(Constructor.prototype,protoProps),staticProps&&Codeview_defineProperties(Constructor,staticProps),Constructor}var Codeview_CodeView=function(){function CodeView(context){Codeview_classCallCheck(this,CodeView),this.context=context,this.$editor=context.layoutInfo.editor,this.$editable=context.layoutInfo.editable,this.$codable=context.layoutInfo.codable,this.options=context.options,this.CodeMirrorConstructor=window.CodeMirror,this.options.codemirror.CodeMirrorConstructor&&(this.CodeMirrorConstructor=this.options.codemirror.CodeMirrorConstructor)}return Codeview_createClass(CodeView,[{key:"sync",value:function sync(html){var isCodeview=this.isActivated(),CodeMirror=this.CodeMirrorConstructor;isCodeview&&(html?CodeMirror?this.$codable.data("cmEditor").getDoc().setValue(html):this.$codable.val(html):CodeMirror&&this.$codable.data("cmEditor").save())}},{key:"initialize",value:function initialize(){var _this=this;this.$codable.on("keyup",(function(event){event.keyCode===core_key.code.ESCAPE&&_this.deactivate()}))}},{key:"isActivated",value:function isActivated(){return this.$editor.hasClass("codeview")}},{key:"toggle",value:function toggle(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}},{key:"purify",value:function purify(value){if(this.options.codeviewFilter&&(value=value.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter)){var whitelist=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);value=value.replace(/(<iframe.*?>.*?(?:<\/iframe>)?)/gi,(function(tag){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(tag))return"";var _iterator=_createForOfIteratorHelper(whitelist),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var src=_step.value;if(new RegExp('src="(https?:)?//'+src.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(tag))return tag}}catch(err){_iterator.e(err)}finally{_iterator.f()}return""}))}return value}},{key:"activate",value:function activate(){var _this2=this,CodeMirror=this.CodeMirrorConstructor;if(this.$codable.val(dom.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.context.invoke("airPopover.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),CodeMirror){var cmEditor=CodeMirror.fromTextArea(this.$codable[0],this.options.codemirror);if(this.options.codemirror.tern){var server=new CodeMirror.TernServer(this.options.codemirror.tern);cmEditor.ternServer=server,cmEditor.on("cursorActivity",(function(cm){server.updateArgHints(cm)}))}cmEditor.on("blur",(function(event){_this2.context.triggerEvent("blur.codeview",cmEditor.getValue(),event)})),cmEditor.on("change",(function(){_this2.context.triggerEvent("change.codeview",cmEditor.getValue(),cmEditor)})),cmEditor.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",cmEditor)}else this.$codable.on("blur",(function(event){_this2.context.triggerEvent("blur.codeview",_this2.$codable.val(),event)})),this.$codable.on("input",(function(){_this2.context.triggerEvent("change.codeview",_this2.$codable.val(),_this2.$codable)}))}},{key:"deactivate",value:function deactivate(){var CodeMirror;if(this.CodeMirrorConstructor){var cmEditor=this.$codable.data("cmEditor");this.$codable.val(cmEditor.getValue()),cmEditor.toTextArea()}var value=this.purify(dom.value(this.$codable,this.options.prettifyHtml)||dom.emptyPara),isChange=this.$editable.html()!==value;this.$editable.html(value),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),isChange&&this.context.triggerEvent("change",this.$editable.html(),this.$editable),this.$editable.focus(),this.context.invoke("toolbar.updateCodeview",!1),this.context.invoke("airPopover.updateCodeview",!1)}},{key:"destroy",value:function destroy(){this.isActivated()&&this.deactivate()}}]),CodeView}();function Statusbar_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Statusbar_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Statusbar_createClass(Constructor,protoProps,staticProps){return protoProps&&Statusbar_defineProperties(Constructor.prototype,protoProps),staticProps&&Statusbar_defineProperties(Constructor,staticProps),Constructor}var EDITABLE_PADDING=24,Statusbar_Statusbar=function(){function Statusbar(context){Statusbar_classCallCheck(this,Statusbar),this.$document=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document),this.$statusbar=context.layoutInfo.statusbar,this.$editable=context.layoutInfo.editable,this.options=context.options}return Statusbar_createClass(Statusbar,[{key:"initialize",value:function initialize(){var _this=this;this.options.airMode||this.options.disableResizeEditor?this.destroy():this.$statusbar.on("mousedown",(function(event){event.preventDefault(),event.stopPropagation();var editableTop=_this.$editable.offset().top-_this.$document.scrollTop(),onMouseMove=function onMouseMove(event){var height=event.clientY-(editableTop+24);height=_this.options.minheight>0?Math.max(height,_this.options.minheight):height,height=_this.options.maxHeight>0?Math.min(height,_this.options.maxHeight):height,_this.$editable.height(height)};_this.$document.on("mousemove",onMouseMove).one("mouseup",(function(){_this.$document.off("mousemove",onMouseMove)}))}))}},{key:"destroy",value:function destroy(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}]),Statusbar}();function Fullscreen_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Fullscreen_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Fullscreen_createClass(Constructor,protoProps,staticProps){return protoProps&&Fullscreen_defineProperties(Constructor.prototype,protoProps),staticProps&&Fullscreen_defineProperties(Constructor,staticProps),Constructor}var Fullscreen_Fullscreen=function(){function Fullscreen(context){var _this=this;Fullscreen_classCallCheck(this,Fullscreen),this.context=context,this.$editor=context.layoutInfo.editor,this.$toolbar=context.layoutInfo.toolbar,this.$editable=context.layoutInfo.editable,this.$codable=context.layoutInfo.codable,this.$window=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(window),this.$scrollbar=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("html, body"),this.onResize=function(){_this.resizeTo({h:_this.$window.height()-_this.$toolbar.outerHeight()})}}return Fullscreen_createClass(Fullscreen,[{key:"resizeTo",value:function resizeTo(size){this.$editable.css("height",size.h),this.$codable.css("height",size.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,size.h)}},{key:"toggle",value:function toggle(){this.$editor.toggleClass("fullscreen"),this.isFullscreen()?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize"),this.$scrollbar.css("overflow","hidden")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight")),this.$scrollbar.css("overflow","visible")),this.context.invoke("toolbar.updateFullscreen",this.isFullscreen())}},{key:"isFullscreen",value:function isFullscreen(){return this.$editor.hasClass("fullscreen")}}]),Fullscreen}();function Handle_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Handle_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Handle_createClass(Constructor,protoProps,staticProps){return protoProps&&Handle_defineProperties(Constructor.prototype,protoProps),staticProps&&Handle_defineProperties(Constructor,staticProps),Constructor}var Handle_Handle=function(){function Handle(context){var _this=this;Handle_classCallCheck(this,Handle),this.context=context,this.$document=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document),this.$editingArea=context.layoutInfo.editingArea,this.options=context.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":function summernoteMousedown(we,e){_this.update(e.target,e)&&e.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function summernoteKeyupSummernoteScrollSummernoteChangeSummernoteDialogShown(){_this.update()},"summernote.disable summernote.blur":function summernoteDisableSummernoteBlur(){_this.hide()},"summernote.codeview.toggled":function summernoteCodeviewToggled(){_this.update()}}}return Handle_createClass(Handle,[{key:"initialize",value:function initialize(){var _this2=this;this.$handle=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',this.options.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',this.options.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",(function(event){if(dom.isControlSizing(event.target)){event.preventDefault(),event.stopPropagation();var $target=_this2.$handle.find(".note-control-selection").data("target"),posStart=$target.offset(),scrollTop=_this2.$document.scrollTop(),onMouseMove=function onMouseMove(event){_this2.context.invoke("editor.resizeTo",{x:event.clientX-posStart.left,y:event.clientY-(posStart.top-scrollTop)},$target,!event.shiftKey),_this2.update($target[0],event)};_this2.$document.on("mousemove",onMouseMove).one("mouseup",(function(e){e.preventDefault(),_this2.$document.off("mousemove",onMouseMove),_this2.context.invoke("editor.afterCommand")})),$target.data("ratio")||$target.data("ratio",$target.height()/$target.width())}})),this.$handle.on("wheel",(function(e){e.preventDefault(),_this2.update()}))}},{key:"destroy",value:function destroy(){this.$handle.remove()}},{key:"update",value:function update(target,event){if(this.context.isDisabled())return!1;var isImage=dom.isImg(target),$selection=this.$handle.find(".note-control-selection");if(this.context.invoke("imagePopover.update",target,event),isImage){var $image=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(target),position=$image.position(),pos={left:position.left+parseInt($image.css("marginLeft"),10),top:position.top+parseInt($image.css("marginTop"),10)},imageSize={w:$image.outerWidth(!1),h:$image.outerHeight(!1)};$selection.css({display:"block",left:pos.left,top:pos.top,width:imageSize.w,height:imageSize.h}).data("target",$image);var origImageObj=new Image;origImageObj.src=$image.attr("src");var sizingText=imageSize.w+"x"+imageSize.h+" ("+this.lang.image.original+": "+origImageObj.width+"x"+origImageObj.height+")";$selection.find(".note-control-selection-info").text(sizingText),this.context.invoke("editor.saveTarget",target)}else this.hide();return isImage}},{key:"hide",value:function hide(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}]),Handle}();function AutoLink_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function AutoLink_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function AutoLink_createClass(Constructor,protoProps,staticProps){return protoProps&&AutoLink_defineProperties(Constructor.prototype,protoProps),staticProps&&AutoLink_defineProperties(Constructor,staticProps),Constructor}var defaultScheme="http://",linkPattern=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i,AutoLink_AutoLink=function(){function AutoLink(context){var _this=this;AutoLink_classCallCheck(this,AutoLink),this.context=context,this.options=context.options,this.events={"summernote.keyup":function summernoteKeyup(we,e){e.isDefaultPrevented()||_this.handleKeyup(e)},"summernote.keydown":function summernoteKeydown(we,e){_this.handleKeydown(e)}}}return AutoLink_createClass(AutoLink,[{key:"initialize",value:function initialize(){this.lastWordRange=null}},{key:"destroy",value:function destroy(){this.lastWordRange=null}},{key:"replace",value:function replace(){if(this.lastWordRange){var keyword=this.lastWordRange.toString(),match=keyword.match(linkPattern);if(match&&(match[1]||match[2])){var link=match[1]?keyword:"http://"+keyword,urlText=this.options.showDomainOnlyForAutolink?keyword.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\.)?/i,"").split("/")[0]:keyword,node=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<a />").html(urlText).attr("href",link)[0];this.context.options.linkTargetBlank&&external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(node).attr("target","_blank"),this.lastWordRange.insertNode(node),this.lastWordRange=null,this.context.invoke("editor.focus")}}}},{key:"handleKeydown",value:function handleKeydown(e){if(lists.contains([core_key.code.ENTER,core_key.code.SPACE],e.keyCode)){var wordRange=this.context.invoke("editor.createRange").getWordRange();this.lastWordRange=wordRange}}},{key:"handleKeyup",value:function handleKeyup(e){lists.contains([core_key.code.ENTER,core_key.code.SPACE],e.keyCode)&&this.replace()}}]),AutoLink}();function AutoSync_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function AutoSync_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function AutoSync_createClass(Constructor,protoProps,staticProps){return protoProps&&AutoSync_defineProperties(Constructor.prototype,protoProps),staticProps&&AutoSync_defineProperties(Constructor,staticProps),Constructor}var AutoSync_AutoSync=function(){function AutoSync(context){var _this=this;AutoSync_classCallCheck(this,AutoSync),this.$note=context.layoutInfo.note,this.events={"summernote.change":function summernoteChange(){_this.$note.val(context.invoke("code"))}}}return AutoSync_createClass(AutoSync,[{key:"shouldInitialize",value:function shouldInitialize(){return dom.isTextarea(this.$note[0])}}]),AutoSync}();function AutoReplace_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function AutoReplace_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function AutoReplace_createClass(Constructor,protoProps,staticProps){return protoProps&&AutoReplace_defineProperties(Constructor.prototype,protoProps),staticProps&&AutoReplace_defineProperties(Constructor,staticProps),Constructor}var AutoReplace_AutoReplace=function(){function AutoReplace(context){var _this=this;AutoReplace_classCallCheck(this,AutoReplace),this.context=context,this.options=context.options.replace||{},this.keys=[core_key.code.ENTER,core_key.code.SPACE,core_key.code.PERIOD,core_key.code.COMMA,core_key.code.SEMICOLON,core_key.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":function summernoteKeyup(we,e){e.isDefaultPrevented()||_this.handleKeyup(e)},"summernote.keydown":function summernoteKeydown(we,e){_this.handleKeydown(e)}}}return AutoReplace_createClass(AutoReplace,[{key:"shouldInitialize",value:function shouldInitialize(){return!!this.options.match}},{key:"initialize",value:function initialize(){this.lastWord=null}},{key:"destroy",value:function destroy(){this.lastWord=null}},{key:"replace",value:function replace(){if(this.lastWord){var self=this,keyword=this.lastWord.toString();this.options.match(keyword,(function(match){if(match){var node="";if("string"==typeof match?node=dom.createText(match):match instanceof jQuery?node=match[0]:match instanceof Node&&(node=match),!node)return;self.lastWord.insertNode(node),self.lastWord=null,self.context.invoke("editor.focus")}}))}}},{key:"handleKeydown",value:function handleKeydown(e){if(this.previousKeydownCode&&lists.contains(this.keys,this.previousKeydownCode))this.previousKeydownCode=e.keyCode;else{if(lists.contains(this.keys,e.keyCode)){var wordRange=this.context.invoke("editor.createRange").getWordRange();this.lastWord=wordRange}this.previousKeydownCode=e.keyCode}}},{key:"handleKeyup",value:function handleKeyup(e){lists.contains(this.keys,e.keyCode)&&this.replace()}}]),AutoReplace}();function Placeholder_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Placeholder_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Placeholder_createClass(Constructor,protoProps,staticProps){return protoProps&&Placeholder_defineProperties(Constructor.prototype,protoProps),staticProps&&Placeholder_defineProperties(Constructor,staticProps),Constructor}var Placeholder_Placeholder=function(){function Placeholder(context){var _this=this;Placeholder_classCallCheck(this,Placeholder),this.context=context,this.$editingArea=context.layoutInfo.editingArea,this.options=context.options,!0===this.options.inheritPlaceholder&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":function summernoteInitSummernoteChange(){_this.update()},"summernote.codeview.toggled":function summernoteCodeviewToggled(){_this.update()}}}return Placeholder_createClass(Placeholder,[{key:"shouldInitialize",value:function shouldInitialize(){return!!this.options.placeholder}},{key:"initialize",value:function initialize(){var _this2=this;this.$placeholder=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()('<div class="note-placeholder">'),this.$placeholder.on("click",(function(){_this2.context.invoke("focus")})).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function destroy(){this.$placeholder.remove()}},{key:"update",value:function update(){var isShow=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(isShow)}}]),Placeholder}();function Buttons_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Buttons_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Buttons_createClass(Constructor,protoProps,staticProps){return protoProps&&Buttons_defineProperties(Constructor.prototype,protoProps),staticProps&&Buttons_defineProperties(Constructor,staticProps),Constructor}var Buttons_Buttons=function(){function Buttons(context){Buttons_classCallCheck(this,Buttons),this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.context=context,this.$toolbar=context.layoutInfo.toolbar,this.options=context.options,this.lang=this.options.langInfo,this.invertedKeyMap=func.invertObject(this.options.keyMap[env.isMac?"mac":"pc"])}return Buttons_createClass(Buttons,[{key:"representShortcut",value:function representShortcut(editorMethod){var shortcut=this.invertedKeyMap[editorMethod];return this.options.shortcuts&&shortcut?(env.isMac&&(shortcut=shortcut.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(shortcut=shortcut.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""}},{key:"button",value:function button(o){return!this.options.tooltip&&o.tooltip&&delete o.tooltip,o.container=this.options.container,this.ui.button(o)}},{key:"initialize",value:function initialize(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}},{key:"destroy",value:function destroy(){delete this.fontInstalledMap}},{key:"isFontInstalled",value:function isFontInstalled(name){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,name)||(this.fontInstalledMap[name]=env.isFontInstalled(name)||lists.contains(this.options.fontNamesIgnoreCheck,name)),this.fontInstalledMap[name]}},{key:"isFontDeservedToAdd",value:function isFontDeservedToAdd(name){return""!==(name=name.toLowerCase())&&this.isFontInstalled(name)&&-1===env.genericFontFamilies.indexOf(name)}},{key:"colorPalette",value:function colorPalette(className,tooltip,backColor,foreColor){var _this=this;return this.ui.buttonGroup({className:"note-color "+className,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:tooltip,click:function click(e){var $button=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(e.currentTarget);backColor&&foreColor?_this.context.invoke("editor.color",{backColor:$button.attr("data-backColor"),foreColor:$button.attr("data-foreColor")}):backColor?_this.context.invoke("editor.color",{backColor:$button.attr("data-backColor")}):foreColor&&_this.context.invoke("editor.color",{foreColor:$button.attr("data-foreColor")})},callback:function callback($button){var $recentColor=$button.find(".note-recent-color");backColor&&($recentColor.css("background-color",_this.options.colorButton.backColor),$button.attr("data-backColor",_this.options.colorButton.backColor)),foreColor?($recentColor.css("color",_this.options.colorButton.foreColor),$button.attr("data-foreColor",_this.options.colorButton.foreColor)):$recentColor.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(backColor?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.background+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light btn-default" data-event="backColor" data-value="transparent">',this.lang.color.transparent,"</button>","</div>",'<div class="note-holder" data-event="backColor">\x3c!-- back colors --\x3e</div>',"<div>",'<button type="button" class="note-color-select btn btn-light btn-default" data-event="openPalette" data-value="backColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="backColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.backColor+'" data-event="backColorPalette">',"</div>",'<div class="note-holder-custom" id="backColorPalette" data-event="backColor"></div>',"</div>"].join(""):"")+(foreColor?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.foreground+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light btn-default" data-event="removeFormat" data-value="foreColor">',this.lang.color.resetToDefault,"</button>","</div>",'<div class="note-holder" data-event="foreColor">\x3c!-- fore colors --\x3e</div>',"<div>",'<button type="button" class="note-color-select btn btn-light btn-default" data-event="openPalette" data-value="foreColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="foreColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.foreColor+'" data-event="foreColorPalette">',"</div>",'<div class="note-holder-custom" id="foreColorPalette" data-event="foreColor"></div>',"</div>"].join(""):""),callback:function callback($dropdown){$dropdown.find(".note-holder").each((function(idx,item){var $holder=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(item);$holder.append(_this.ui.palette({colors:_this.options.colors,colorsName:_this.options.colorsName,eventName:$holder.data("event"),container:_this.options.container,tooltip:_this.options.tooltip}).render())}));var customColors=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];$dropdown.find(".note-holder-custom").each((function(idx,item){var $holder=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(item);$holder.append(_this.ui.palette({colors:customColors,colorsName:customColors,eventName:$holder.data("event"),container:_this.options.container,tooltip:_this.options.tooltip}).render())})),$dropdown.find("input[type=color]").each((function(idx,item){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(item).change((function(){var $chip=$dropdown.find("#"+external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this).data("event")).find(".note-color-btn").first(),color=this.value.toUpperCase();$chip.css("background-color",color).attr("aria-label",color).attr("data-value",color).attr("data-original-title",color),$chip.click()}))}))},click:function click(event){event.stopPropagation();var $parent=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("."+className).find(".note-dropdown-menu"),$button=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(event.target),eventName=$button.data("event"),value=$button.attr("data-value");if("openPalette"===eventName){var $picker=$parent.find("#"+value),$palette=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()($parent.find("#"+$picker.data("event")).find(".note-color-row")[0]),$chip=$palette.find(".note-color-btn").last().detach(),color=$picker.val();$chip.css("background-color",color).attr("aria-label",color).attr("data-value",color).attr("data-original-title",color),$palette.prepend($chip),$picker.click()}else{if(lists.contains(["backColor","foreColor"],eventName)){var key="backColor"===eventName?"background-color":"color",$color=$button.closest(".note-color").find(".note-recent-color"),$currentButton=$button.closest(".note-color").find(".note-current-color-button");$color.css(key,value),$currentButton.attr("data-"+eventName,value)}_this.context.invoke("editor."+eventName,value)}}})]}).render()}},{key:"addToolbarButtons",value:function addToolbarButtons(){var _this2=this;this.context.memo("button.style",(function(){return _this2.ui.buttonGroup([_this2.button({className:"dropdown-toggle",contents:_this2.ui.dropdownButtonContents(_this2.ui.icon(_this2.options.icons.magic),_this2.options),tooltip:_this2.lang.style.style,data:{toggle:"dropdown"}}),_this2.ui.dropdown({className:"dropdown-style",items:_this2.options.styleTags,title:_this2.lang.style.style,template:function template(item){"string"==typeof item&&(item={tag:item,title:Object.prototype.hasOwnProperty.call(_this2.lang.style,item)?_this2.lang.style[item]:item});var tag=item.tag,title=item.title,style,className;return"<"+tag+(item.style?' style="'+item.style+'" ':"")+(item.className?' class="'+item.className+'"':"")+">"+title+"</"+tag+">"},click:_this2.context.createInvokeHandler("editor.formatBlock")})]).render()}));for(var _loop=function _loop(styleIdx,styleLen){var item=_this2.options.styleTags[styleIdx];_this2.context.memo("button.style."+item,(function(){return _this2.button({className:"note-btn-style-"+item,contents:'<div data-value="'+item+'">'+item.toUpperCase()+"</div>",tooltip:_this2.lang.style[item],click:_this2.context.createInvokeHandler("editor.formatBlock")}).render()}))},styleIdx=0,styleLen=this.options.styleTags.length;styleIdx<styleLen;styleIdx++)_loop(styleIdx,styleLen);this.context.memo("button.bold",(function(){return _this2.button({className:"note-btn-bold",contents:_this2.ui.icon(_this2.options.icons.bold),tooltip:_this2.lang.font.bold+_this2.representShortcut("bold"),click:_this2.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()})),this.context.memo("button.italic",(function(){return _this2.button({className:"note-btn-italic",contents:_this2.ui.icon(_this2.options.icons.italic),tooltip:_this2.lang.font.italic+_this2.representShortcut("italic"),click:_this2.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()})),this.context.memo("button.underline",(function(){return _this2.button({className:"note-btn-underline",contents:_this2.ui.icon(_this2.options.icons.underline),tooltip:_this2.lang.font.underline+_this2.representShortcut("underline"),click:_this2.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()})),this.context.memo("button.clear",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.eraser),tooltip:_this2.lang.font.clear+_this2.representShortcut("removeFormat"),click:_this2.context.createInvokeHandler("editor.removeFormat")}).render()})),this.context.memo("button.strikethrough",(function(){return _this2.button({className:"note-btn-strikethrough",contents:_this2.ui.icon(_this2.options.icons.strikethrough),tooltip:_this2.lang.font.strikethrough+_this2.representShortcut("strikethrough"),click:_this2.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()})),this.context.memo("button.superscript",(function(){return _this2.button({className:"note-btn-superscript",contents:_this2.ui.icon(_this2.options.icons.superscript),tooltip:_this2.lang.font.superscript,click:_this2.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()})),this.context.memo("button.subscript",(function(){return _this2.button({className:"note-btn-subscript",contents:_this2.ui.icon(_this2.options.icons.subscript),tooltip:_this2.lang.font.subscript,click:_this2.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()})),this.context.memo("button.fontname",(function(){var styleInfo=_this2.context.invoke("editor.currentStyle");return _this2.options.addDefaultFonts&&external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(styleInfo["font-family"].split(","),(function(idx,fontname){fontname=fontname.trim().replace(/['"]+/g,""),_this2.isFontDeservedToAdd(fontname)&&-1===_this2.options.fontNames.indexOf(fontname)&&_this2.options.fontNames.push(fontname)})),_this2.ui.buttonGroup([_this2.button({className:"dropdown-toggle",contents:_this2.ui.dropdownButtonContents('<span class="note-current-fontname"></span>',_this2.options),tooltip:_this2.lang.font.name,data:{toggle:"dropdown"}}),_this2.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:_this2.options.icons.menuCheck,items:_this2.options.fontNames.filter(_this2.isFontInstalled.bind(_this2)),title:_this2.lang.font.name,template:function template(item){return'<span style="font-family: '+env.validFontName(item)+'">'+item+"</span>"},click:_this2.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()})),this.context.memo("button.fontsize",(function(){return _this2.ui.buttonGroup([_this2.button({className:"dropdown-toggle",contents:_this2.ui.dropdownButtonContents('<span class="note-current-fontsize"></span>',_this2.options),tooltip:_this2.lang.font.size,data:{toggle:"dropdown"}}),_this2.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:_this2.options.icons.menuCheck,items:_this2.options.fontSizes,title:_this2.lang.font.size,click:_this2.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()})),this.context.memo("button.fontsizeunit",(function(){return _this2.ui.buttonGroup([_this2.button({className:"dropdown-toggle",contents:_this2.ui.dropdownButtonContents('<span class="note-current-fontsizeunit"></span>',_this2.options),tooltip:_this2.lang.font.sizeunit,data:{toggle:"dropdown"}}),_this2.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:_this2.options.icons.menuCheck,items:_this2.options.fontSizeUnits,title:_this2.lang.font.sizeunit,click:_this2.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()})),this.context.memo("button.color",(function(){return _this2.colorPalette("note-color-all",_this2.lang.color.recent,!0,!0)})),this.context.memo("button.forecolor",(function(){return _this2.colorPalette("note-color-fore",_this2.lang.color.foreground,!1,!0)})),this.context.memo("button.backcolor",(function(){return _this2.colorPalette("note-color-back",_this2.lang.color.background,!0,!1)})),this.context.memo("button.ul",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.unorderedlist),tooltip:_this2.lang.lists.unordered+_this2.representShortcut("insertUnorderedList"),click:_this2.context.createInvokeHandler("editor.insertUnorderedList")}).render()})),this.context.memo("button.ol",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.orderedlist),tooltip:_this2.lang.lists.ordered+_this2.representShortcut("insertOrderedList"),click:_this2.context.createInvokeHandler("editor.insertOrderedList")}).render()}));var justifyLeft=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),justifyCenter=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),justifyRight=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),justifyFull=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),outdent=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),indent=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",func.invoke(justifyLeft,"render")),this.context.memo("button.justifyCenter",func.invoke(justifyCenter,"render")),this.context.memo("button.justifyRight",func.invoke(justifyRight,"render")),this.context.memo("button.justifyFull",func.invoke(justifyFull,"render")),this.context.memo("button.outdent",func.invoke(outdent,"render")),this.context.memo("button.indent",func.invoke(indent,"render")),this.context.memo("button.paragraph",(function(){return _this2.ui.buttonGroup([_this2.button({className:"dropdown-toggle",contents:_this2.ui.dropdownButtonContents(_this2.ui.icon(_this2.options.icons.alignLeft),_this2.options),tooltip:_this2.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),_this2.ui.dropdown([_this2.ui.buttonGroup({className:"note-align",children:[justifyLeft,justifyCenter,justifyRight,justifyFull]}),_this2.ui.buttonGroup({className:"note-list",children:[outdent,indent]})])]).render()})),this.context.memo("button.height",(function(){return _this2.ui.buttonGroup([_this2.button({className:"dropdown-toggle",contents:_this2.ui.dropdownButtonContents(_this2.ui.icon(_this2.options.icons.textHeight),_this2.options),tooltip:_this2.lang.font.height,data:{toggle:"dropdown"}}),_this2.ui.dropdownCheck({items:_this2.options.lineHeights,checkClassName:_this2.options.icons.menuCheck,className:"dropdown-line-height",title:_this2.lang.font.height,click:_this2.context.createInvokeHandler("editor.lineHeight")})]).render()})),this.context.memo("button.table",(function(){return _this2.ui.buttonGroup([_this2.button({className:"dropdown-toggle",contents:_this2.ui.dropdownButtonContents(_this2.ui.icon(_this2.options.icons.table),_this2.options),tooltip:_this2.lang.table.table,data:{toggle:"dropdown"}}),_this2.ui.dropdown({title:_this2.lang.table.table,className:"note-table",items:['<div class="note-dimension-picker">','<div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"></div>','<div class="note-dimension-picker-highlighted"></div>','<div class="note-dimension-picker-unhighlighted"></div>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function callback($node){var $catcher;$node.find(".note-dimension-picker-mousecatcher").css({width:_this2.options.insertTableMaxSize.col+"em",height:_this2.options.insertTableMaxSize.row+"em"}).mousedown(_this2.context.createInvokeHandler("editor.insertTable")).on("mousemove",_this2.tableMoveHandler.bind(_this2))}}).render()})),this.context.memo("button.link",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.link),tooltip:_this2.lang.link.link+_this2.representShortcut("linkDialog.show"),click:_this2.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.picture",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.picture),tooltip:_this2.lang.image.image,click:_this2.context.createInvokeHandler("imageDialog.show")}).render()})),this.context.memo("button.video",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.video),tooltip:_this2.lang.video.video,click:_this2.context.createInvokeHandler("videoDialog.show")}).render()})),this.context.memo("button.hr",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.minus),tooltip:_this2.lang.hr.insert+_this2.representShortcut("insertHorizontalRule"),click:_this2.context.createInvokeHandler("editor.insertHorizontalRule")}).render()})),this.context.memo("button.fullscreen",(function(){return _this2.button({className:"btn-fullscreen note-codeview-keep",contents:_this2.ui.icon(_this2.options.icons.arrowsAlt),tooltip:_this2.lang.options.fullscreen,click:_this2.context.createInvokeHandler("fullscreen.toggle")}).render()})),this.context.memo("button.codeview",(function(){return _this2.button({className:"btn-codeview note-codeview-keep",contents:_this2.ui.icon(_this2.options.icons.code),tooltip:_this2.lang.options.codeview,click:_this2.context.createInvokeHandler("codeview.toggle")}).render()})),this.context.memo("button.redo",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.redo),tooltip:_this2.lang.history.redo+_this2.representShortcut("redo"),click:_this2.context.createInvokeHandler("editor.redo")}).render()})),this.context.memo("button.undo",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.undo),tooltip:_this2.lang.history.undo+_this2.representShortcut("undo"),click:_this2.context.createInvokeHandler("editor.undo")}).render()})),this.context.memo("button.help",(function(){return _this2.button({contents:_this2.ui.icon(_this2.options.icons.question),tooltip:_this2.lang.options.help,click:_this2.context.createInvokeHandler("helpDialog.show")}).render()}))}},{key:"addImagePopoverButtons",value:function addImagePopoverButtons(){var _this3=this;this.context.memo("button.resizeFull",(function(){return _this3.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:_this3.lang.image.resizeFull,click:_this3.context.createInvokeHandler("editor.resize","1")}).render()})),this.context.memo("button.resizeHalf",(function(){return _this3.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:_this3.lang.image.resizeHalf,click:_this3.context.createInvokeHandler("editor.resize","0.5")}).render()})),this.context.memo("button.resizeQuarter",(function(){return _this3.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:_this3.lang.image.resizeQuarter,click:_this3.context.createInvokeHandler("editor.resize","0.25")}).render()})),this.context.memo("button.resizeNone",(function(){return _this3.button({contents:_this3.ui.icon(_this3.options.icons.rollback),tooltip:_this3.lang.image.resizeNone,click:_this3.context.createInvokeHandler("editor.resize","0")}).render()})),this.context.memo("button.floatLeft",(function(){return _this3.button({contents:_this3.ui.icon(_this3.options.icons.floatLeft),tooltip:_this3.lang.image.floatLeft,click:_this3.context.createInvokeHandler("editor.floatMe","left")}).render()})),this.context.memo("button.floatRight",(function(){return _this3.button({contents:_this3.ui.icon(_this3.options.icons.floatRight),tooltip:_this3.lang.image.floatRight,click:_this3.context.createInvokeHandler("editor.floatMe","right")}).render()})),this.context.memo("button.floatNone",(function(){return _this3.button({contents:_this3.ui.icon(_this3.options.icons.rollback),tooltip:_this3.lang.image.floatNone,click:_this3.context.createInvokeHandler("editor.floatMe","none")}).render()})),this.context.memo("button.removeMedia",(function(){return _this3.button({contents:_this3.ui.icon(_this3.options.icons.trash),tooltip:_this3.lang.image.remove,click:_this3.context.createInvokeHandler("editor.removeMedia")}).render()}))}},{key:"addLinkPopoverButtons",value:function addLinkPopoverButtons(){var _this4=this;this.context.memo("button.linkDialogShow",(function(){return _this4.button({contents:_this4.ui.icon(_this4.options.icons.link),tooltip:_this4.lang.link.edit,click:_this4.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.unlink",(function(){return _this4.button({contents:_this4.ui.icon(_this4.options.icons.unlink),tooltip:_this4.lang.link.unlink,click:_this4.context.createInvokeHandler("editor.unlink")}).render()}))}},{key:"addTablePopoverButtons",value:function addTablePopoverButtons(){var _this5=this;this.context.memo("button.addRowUp",(function(){return _this5.button({className:"btn-md",contents:_this5.ui.icon(_this5.options.icons.rowAbove),tooltip:_this5.lang.table.addRowAbove,click:_this5.context.createInvokeHandler("editor.addRow","top")}).render()})),this.context.memo("button.addRowDown",(function(){return _this5.button({className:"btn-md",contents:_this5.ui.icon(_this5.options.icons.rowBelow),tooltip:_this5.lang.table.addRowBelow,click:_this5.context.createInvokeHandler("editor.addRow","bottom")}).render()})),this.context.memo("button.addColLeft",(function(){return _this5.button({className:"btn-md",contents:_this5.ui.icon(_this5.options.icons.colBefore),tooltip:_this5.lang.table.addColLeft,click:_this5.context.createInvokeHandler("editor.addCol","left")}).render()})),this.context.memo("button.addColRight",(function(){return _this5.button({className:"btn-md",contents:_this5.ui.icon(_this5.options.icons.colAfter),tooltip:_this5.lang.table.addColRight,click:_this5.context.createInvokeHandler("editor.addCol","right")}).render()})),this.context.memo("button.deleteRow",(function(){return _this5.button({className:"btn-md",contents:_this5.ui.icon(_this5.options.icons.rowRemove),tooltip:_this5.lang.table.delRow,click:_this5.context.createInvokeHandler("editor.deleteRow")}).render()})),this.context.memo("button.deleteCol",(function(){return _this5.button({className:"btn-md",contents:_this5.ui.icon(_this5.options.icons.colRemove),tooltip:_this5.lang.table.delCol,click:_this5.context.createInvokeHandler("editor.deleteCol")}).render()})),this.context.memo("button.deleteTable",(function(){return _this5.button({className:"btn-md",contents:_this5.ui.icon(_this5.options.icons.trash),tooltip:_this5.lang.table.delTable,click:_this5.context.createInvokeHandler("editor.deleteTable")}).render()}))}},{key:"build",value:function build($container,groups){for(var groupIdx=0,groupLen=groups.length;groupIdx<groupLen;groupIdx++){for(var group=groups[groupIdx],groupName=Array.isArray(group)?group[0]:group,buttons=Array.isArray(group)?1===group.length?[group[0]]:group[1]:[group],$group=this.ui.buttonGroup({className:"note-"+groupName}).render(),idx=0,len=buttons.length;idx<len;idx++){var btn=this.context.memo("button."+buttons[idx]);btn&&$group.append("function"==typeof btn?btn(this.context):btn)}$group.appendTo($container)}}},{key:"updateCurrentStyle",value:function updateCurrentStyle($container){var _this6=this,$cont=$container||this.$toolbar,styleInfo=this.context.invoke("editor.currentStyle");if(this.updateBtnStates($cont,{".note-btn-bold":function noteBtnBold(){return"bold"===styleInfo["font-bold"]},".note-btn-italic":function noteBtnItalic(){return"italic"===styleInfo["font-italic"]},".note-btn-underline":function noteBtnUnderline(){return"underline"===styleInfo["font-underline"]},".note-btn-subscript":function noteBtnSubscript(){return"subscript"===styleInfo["font-subscript"]},".note-btn-superscript":function noteBtnSuperscript(){return"superscript"===styleInfo["font-superscript"]},".note-btn-strikethrough":function noteBtnStrikethrough(){return"strikethrough"===styleInfo["font-strikethrough"]}}),styleInfo["font-family"]){var fontNames=styleInfo["font-family"].split(",").map((function(name){return name.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")})),fontName=lists.find(fontNames,this.isFontInstalled.bind(this));$cont.find(".dropdown-fontname a").each((function(idx,item){var $item=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(item),isChecked=$item.data("value")+""==fontName+"";$item.toggleClass("checked",isChecked)})),$cont.find(".note-current-fontname").text(fontName).css("font-family",fontName)}if(styleInfo["font-size"]){var fontSize=styleInfo["font-size"];$cont.find(".dropdown-fontsize a").each((function(idx,item){var $item=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(item),isChecked=$item.data("value")+""==fontSize+"";$item.toggleClass("checked",isChecked)})),$cont.find(".note-current-fontsize").text(fontSize);var fontSizeUnit=styleInfo["font-size-unit"];$cont.find(".dropdown-fontsizeunit a").each((function(idx,item){var $item=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(item),isChecked=$item.data("value")+""==fontSizeUnit+"";$item.toggleClass("checked",isChecked)})),$cont.find(".note-current-fontsizeunit").text(fontSizeUnit)}if(styleInfo["line-height"]){var lineHeight=styleInfo["line-height"];$cont.find(".dropdown-line-height li a").each((function(idx,item){var isChecked=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(item).data("value")+""==lineHeight+"";_this6.className=isChecked?"checked":""}))}}},{key:"updateBtnStates",value:function updateBtnStates($container,infos){var _this7=this;external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.each(infos,(function(selector,pred){_this7.ui.toggleBtnActive($container.find(selector),pred())}))}},{key:"tableMoveHandler",value:function tableMoveHandler(event){var PX_PER_EM=18,$picker=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(event.target.parentNode),$dimensionDisplay=$picker.next(),$catcher=$picker.find(".note-dimension-picker-mousecatcher"),$highlighted=$picker.find(".note-dimension-picker-highlighted"),$unhighlighted=$picker.find(".note-dimension-picker-unhighlighted"),posOffset;if(void 0===event.offsetX){var posCatcher=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(event.target).offset();posOffset={x:event.pageX-posCatcher.left,y:event.pageY-posCatcher.top}}else posOffset={x:event.offsetX,y:event.offsetY};var dim_c=Math.ceil(posOffset.x/18)||1,dim_r=Math.ceil(posOffset.y/18)||1;$highlighted.css({width:dim_c+"em",height:dim_r+"em"}),$catcher.data("value",dim_c+"x"+dim_r),dim_c>3&&dim_c<this.options.insertTableMaxSize.col&&$unhighlighted.css({width:dim_c+1+"em"}),dim_r>3&&dim_r<this.options.insertTableMaxSize.row&&$unhighlighted.css({height:dim_r+1+"em"}),$dimensionDisplay.html(dim_c+" x "+dim_r)}}]),Buttons}();function Toolbar_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function Toolbar_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function Toolbar_createClass(Constructor,protoProps,staticProps){return protoProps&&Toolbar_defineProperties(Constructor.prototype,protoProps),staticProps&&Toolbar_defineProperties(Constructor,staticProps),Constructor}var Toolbar_Toolbar=function(){function Toolbar(context){Toolbar_classCallCheck(this,Toolbar),this.context=context,this.$window=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(window),this.$document=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document),this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.$note=context.layoutInfo.note,this.$editor=context.layoutInfo.editor,this.$toolbar=context.layoutInfo.toolbar,this.$editable=context.layoutInfo.editable,this.$statusbar=context.layoutInfo.statusbar,this.options=context.options,this.isFollowing=!1,this.followScroll=this.followScroll.bind(this)}return Toolbar_createClass(Toolbar,[{key:"shouldInitialize",value:function shouldInitialize(){return!this.options.airMode}},{key:"initialize",value:function initialize(){var _this=this;this.options.toolbar=this.options.toolbar||[],this.options.toolbar.length?this.context.invoke("buttons.build",this.$toolbar,this.options.toolbar):this.$toolbar.hide(),this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.changeContainer(!1),this.$note.on("summernote.keyup summernote.mouseup summernote.change",(function(){_this.context.invoke("buttons.updateCurrentStyle")})),this.context.invoke("buttons.updateCurrentStyle"),this.options.followingToolbar&&this.$window.on("scroll resize",this.followScroll)}},{key:"destroy",value:function destroy(){this.$toolbar.children().remove(),this.options.followingToolbar&&this.$window.off("scroll resize",this.followScroll)}},{key:"followScroll",value:function followScroll(){if(this.$editor.hasClass("fullscreen"))return!1;var editorHeight=this.$editor.outerHeight(),editorWidth=this.$editor.width(),toolbarHeight=this.$toolbar.height(),statusbarHeight=this.$statusbar.height(),otherBarHeight=0;this.options.otherStaticBar&&(otherBarHeight=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this.options.otherStaticBar).outerHeight());var currentOffset=this.$document.scrollTop(),editorOffsetTop=this.$editor.offset().top,editorOffsetBottom,activateOffset=editorOffsetTop-otherBarHeight,deactivateOffsetBottom=editorOffsetTop+editorHeight-otherBarHeight-toolbarHeight-statusbarHeight;!this.isFollowing&¤tOffset>activateOffset&¤tOffset<deactivateOffsetBottom-toolbarHeight?(this.isFollowing=!0,this.$editable.css({marginTop:this.$toolbar.outerHeight()}),this.$toolbar.css({position:"fixed",top:otherBarHeight,width:editorWidth,zIndex:1e3})):this.isFollowing&&(currentOffset<activateOffset||currentOffset>deactivateOffsetBottom)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}},{key:"changeContainer",value:function changeContainer(isFullscreen){isFullscreen?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}},{key:"updateFullscreen",value:function updateFullscreen(isFullscreen){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),isFullscreen),this.changeContainer(isFullscreen)}},{key:"updateCodeview",value:function updateCodeview(isCodeview){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),isCodeview),isCodeview?this.deactivate():this.activate()}},{key:"activate",value:function activate(isIncludeCodeview){var $btn=this.$toolbar.find("button");isIncludeCodeview||($btn=$btn.not(".note-codeview-keep")),this.ui.toggleBtn($btn,!0)}},{key:"deactivate",value:function deactivate(isIncludeCodeview){var $btn=this.$toolbar.find("button");isIncludeCodeview||($btn=$btn.not(".note-codeview-keep")),this.ui.toggleBtn($btn,!1)}}]),Toolbar}();function LinkDialog_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function LinkDialog_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function LinkDialog_createClass(Constructor,protoProps,staticProps){return protoProps&&LinkDialog_defineProperties(Constructor.prototype,protoProps),staticProps&&LinkDialog_defineProperties(Constructor,staticProps),Constructor}var LinkDialog_LinkDialog=function(){function LinkDialog(context){LinkDialog_classCallCheck(this,LinkDialog),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.$body=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document.body),this.$editor=context.layoutInfo.editor,this.options=context.options,this.lang=this.options.langInfo,context.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}return LinkDialog_createClass(LinkDialog,[{key:"initialize",value:function initialize(){var $container=this.options.dialogsInBody?this.$body:this.options.container,body=['<div class="form-group note-form-group">','<label for="note-dialog-link-txt-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.textToDisplay,"</label>"),'<input id="note-dialog-link-txt-'.concat(this.options.id,'" class="note-link-text form-control note-form-control note-input" type="text"/>'),"</div>",'<div class="form-group note-form-group">','<label for="note-dialog-link-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.url,"</label>"),'<input id="note-dialog-link-url-'.concat(this.options.id,'" class="note-link-url form-control note-form-control note-input" type="text" value="http://"/>'),"</div>",this.options.disableLinkTarget?"":external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),buttonClass,footer='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-link-btn",'" value="').concat(this.lang.link.insert,'" disabled>');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:body,footer:footer}).render().appendTo($container)}},{key:"destroy",value:function destroy(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function bindEnterKey($input,$btn){$input.on("keypress",(function(event){event.keyCode===core_key.code.ENTER&&(event.preventDefault(),$btn.trigger("click"))}))}},{key:"toggleLinkBtn",value:function toggleLinkBtn($linkBtn,$linkText,$linkUrl){this.ui.toggleBtn($linkBtn,$linkText.val()&&$linkUrl.val())}},{key:"showLinkDialog",value:function showLinkDialog(linkInfo){var _this=this;return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.Deferred((function(deferred){var $linkText=_this.$dialog.find(".note-link-text"),$linkUrl=_this.$dialog.find(".note-link-url"),$linkBtn=_this.$dialog.find(".note-link-btn"),$openInNewWindow=_this.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),$useProtocol=_this.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");_this.ui.onDialogShown(_this.$dialog,(function(){_this.context.triggerEvent("dialog.shown"),!linkInfo.url&&func.isValidUrl(linkInfo.text)&&(linkInfo.url=linkInfo.text),$linkText.on("input paste propertychange",(function(){linkInfo.text=$linkText.val(),_this.toggleLinkBtn($linkBtn,$linkText,$linkUrl)})).val(linkInfo.text),$linkUrl.on("input paste propertychange",(function(){linkInfo.text||$linkText.val($linkUrl.val()),_this.toggleLinkBtn($linkBtn,$linkText,$linkUrl)})).val(linkInfo.url),env.isSupportTouch||$linkUrl.trigger("focus"),_this.toggleLinkBtn($linkBtn,$linkText,$linkUrl),_this.bindEnterKey($linkUrl,$linkBtn),_this.bindEnterKey($linkText,$linkBtn);var isNewWindowChecked=void 0!==linkInfo.isNewWindow?linkInfo.isNewWindow:_this.context.options.linkTargetBlank;$openInNewWindow.prop("checked",isNewWindowChecked);var useProtocolChecked=!linkInfo.url&&_this.context.options.useProtocol;$useProtocol.prop("checked",useProtocolChecked),$linkBtn.one("click",(function(event){event.preventDefault(),deferred.resolve({range:linkInfo.range,url:$linkUrl.val(),text:$linkText.val(),isNewWindow:$openInNewWindow.is(":checked"),checkProtocol:$useProtocol.is(":checked")}),_this.ui.hideDialog(_this.$dialog)}))})),_this.ui.onDialogHidden(_this.$dialog,(function(){$linkText.off(),$linkUrl.off(),$linkBtn.off(),"pending"===deferred.state()&&deferred.reject()})),_this.ui.showDialog(_this.$dialog)})).promise()}},{key:"show",value:function show(){var _this2=this,linkInfo=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(linkInfo).then((function(linkInfo){_this2.context.invoke("editor.restoreRange"),_this2.context.invoke("editor.createLink",linkInfo)})).fail((function(){_this2.context.invoke("editor.restoreRange")}))}}]),LinkDialog}();function LinkPopover_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function LinkPopover_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function LinkPopover_createClass(Constructor,protoProps,staticProps){return protoProps&&LinkPopover_defineProperties(Constructor.prototype,protoProps),staticProps&&LinkPopover_defineProperties(Constructor,staticProps),Constructor}var LinkPopover_LinkPopover=function(){function LinkPopover(context){var _this=this;LinkPopover_classCallCheck(this,LinkPopover),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.options=context.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function summernoteKeyupSummernoteMouseupSummernoteChangeSummernoteScroll(){_this.update()},"summernote.disable summernote.dialog.shown summernote.blur":function summernoteDisableSummernoteDialogShownSummernoteBlur(){_this.hide()}}}return LinkPopover_createClass(LinkPopover,[{key:"shouldInitialize",value:function shouldInitialize(){return!lists.isEmpty(this.options.popover.link)}},{key:"initialize",value:function initialize(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function callback($node){var $content;$node.find(".popover-content,.note-popover-content").prepend('<span><a target="_blank"></a> </span>')}}).render().appendTo(this.options.container);var $content=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",$content,this.options.popover.link),this.$popover.on("mousedown",(function(e){e.preventDefault()}))}},{key:"destroy",value:function destroy(){this.$popover.remove()}},{key:"update",value:function update(){if(this.context.invoke("editor.hasFocus")){var rng=this.context.invoke("editor.getLastRange");if(rng.isCollapsed()&&rng.isOnAnchor()){var anchor=dom.ancestor(rng.sc,dom.isAnchor),href=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(anchor).attr("href");this.$popover.find("a").attr("href",href).text(href);var pos=dom.posFromPlaceholder(anchor),containerOffset=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this.options.container).offset();pos.top-=containerOffset.top,pos.left-=containerOffset.left,this.$popover.css({display:"block",left:pos.left,top:pos.top})}else this.hide()}else this.hide()}},{key:"hide",value:function hide(){this.$popover.hide()}}]),LinkPopover}();function ImageDialog_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function ImageDialog_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function ImageDialog_createClass(Constructor,protoProps,staticProps){return protoProps&&ImageDialog_defineProperties(Constructor.prototype,protoProps),staticProps&&ImageDialog_defineProperties(Constructor,staticProps),Constructor}var ImageDialog_ImageDialog=function(){function ImageDialog(context){ImageDialog_classCallCheck(this,ImageDialog),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.$body=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document.body),this.$editor=context.layoutInfo.editor,this.options=context.options,this.lang=this.options.langInfo}return ImageDialog_createClass(ImageDialog,[{key:"initialize",value:function initialize(){var imageLimitation="";if(this.options.maximumImageFileSize){var unit=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),readableSize=1*(this.options.maximumImageFileSize/Math.pow(1024,unit)).toFixed(2)+" "+" KMGTP"[unit]+"B";imageLimitation="<small>".concat(this.lang.image.maximumFileSize+" : "+readableSize,"</small>")}var $container=this.options.dialogsInBody?this.$body:this.options.container,body=['<div class="form-group note-form-group note-group-select-from-files">','<label for="note-dialog-image-file-'+this.options.id+'" class="note-form-label">'+this.lang.image.selectFromFiles+"</label>",'<input id="note-dialog-image-file-'+this.options.id+'" class="note-image-input form-control-file note-form-control note-input" ',' type="file" name="files" accept="image/*" multiple="multiple"/>',imageLimitation,"</div>",'<div class="form-group note-group-image-url">','<label for="note-dialog-image-url-'+this.options.id+'" class="note-form-label">'+this.lang.image.url+"</label>",'<input id="note-dialog-image-url-'+this.options.id+'" class="note-image-url form-control note-form-control note-input" type="text"/>',"</div>"].join(""),buttonClass,footer='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-image-btn",'" value="').concat(this.lang.image.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:body,footer:footer}).render().appendTo($container)}},{key:"destroy",value:function destroy(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function bindEnterKey($input,$btn){$input.on("keypress",(function(event){event.keyCode===core_key.code.ENTER&&(event.preventDefault(),$btn.trigger("click"))}))}},{key:"show",value:function show(){var _this=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then((function(data){_this.ui.hideDialog(_this.$dialog),_this.context.invoke("editor.restoreRange"),"string"==typeof data?_this.options.callbacks.onImageLinkInsert?_this.context.triggerEvent("image.link.insert",data):_this.context.invoke("editor.insertImage",data):_this.context.invoke("editor.insertImagesOrCallback",data)})).fail((function(){_this.context.invoke("editor.restoreRange")}))}},{key:"showImageDialog",value:function showImageDialog(){var _this2=this;return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.Deferred((function(deferred){var $imageInput=_this2.$dialog.find(".note-image-input"),$imageUrl=_this2.$dialog.find(".note-image-url"),$imageBtn=_this2.$dialog.find(".note-image-btn");_this2.ui.onDialogShown(_this2.$dialog,(function(){_this2.context.triggerEvent("dialog.shown"),$imageInput.replaceWith($imageInput.clone().on("change",(function(event){deferred.resolve(event.target.files||event.target.value)})).val("")),$imageUrl.on("input paste propertychange",(function(){_this2.ui.toggleBtn($imageBtn,$imageUrl.val())})).val(""),env.isSupportTouch||$imageUrl.trigger("focus"),$imageBtn.click((function(event){event.preventDefault(),deferred.resolve($imageUrl.val())})),_this2.bindEnterKey($imageUrl,$imageBtn)})),_this2.ui.onDialogHidden(_this2.$dialog,(function(){$imageInput.off(),$imageUrl.off(),$imageBtn.off(),"pending"===deferred.state()&&deferred.reject()})),_this2.ui.showDialog(_this2.$dialog)}))}}]),ImageDialog}();function ImagePopover_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function ImagePopover_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function ImagePopover_createClass(Constructor,protoProps,staticProps){return protoProps&&ImagePopover_defineProperties(Constructor.prototype,protoProps),staticProps&&ImagePopover_defineProperties(Constructor,staticProps),Constructor}var ImagePopover_ImagePopover=function(){function ImagePopover(context){var _this=this;ImagePopover_classCallCheck(this,ImagePopover),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.editable=context.layoutInfo.editable[0],this.options=context.options,this.events={"summernote.disable summernote.blur":function summernoteDisableSummernoteBlur(){_this.hide()}}}return ImagePopover_createClass(ImagePopover,[{key:"shouldInitialize",value:function shouldInitialize(){return!lists.isEmpty(this.options.popover.image)}},{key:"initialize",value:function initialize(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var $content=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",$content,this.options.popover.image),this.$popover.on("mousedown",(function(e){e.preventDefault()}))}},{key:"destroy",value:function destroy(){this.$popover.remove()}},{key:"update",value:function update(target,event){if(dom.isImg(target)){var position=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(target).offset(),containerOffset=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this.options.container).offset(),pos={};this.options.popatmouse?(pos.left=event.pageX-20,pos.top=event.pageY):pos=position,pos.top-=containerOffset.top,pos.left-=containerOffset.left,this.$popover.css({display:"block",left:pos.left,top:pos.top})}else this.hide()}},{key:"hide",value:function hide(){this.$popover.hide()}}]),ImagePopover}();function TablePopover_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function TablePopover_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function TablePopover_createClass(Constructor,protoProps,staticProps){return protoProps&&TablePopover_defineProperties(Constructor.prototype,protoProps),staticProps&&TablePopover_defineProperties(Constructor,staticProps),Constructor}var TablePopover_TablePopover=function(){function TablePopover(context){var _this=this;TablePopover_classCallCheck(this,TablePopover),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.options=context.options,this.events={"summernote.mousedown":function summernoteMousedown(we,e){_this.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function summernoteKeyupSummernoteScrollSummernoteChange(){_this.update()},"summernote.disable summernote.blur":function summernoteDisableSummernoteBlur(){_this.hide()}}}return TablePopover_createClass(TablePopover,[{key:"shouldInitialize",value:function shouldInitialize(){return!lists.isEmpty(this.options.popover.table)}},{key:"initialize",value:function initialize(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var $content=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",$content,this.options.popover.table),env.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",(function(e){e.preventDefault()}))}},{key:"destroy",value:function destroy(){this.$popover.remove()}},{key:"update",value:function update(target){if(this.context.isDisabled())return!1;var isCell=dom.isCell(target);if(isCell){var pos=dom.posFromPlaceholder(target),containerOffset=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this.options.container).offset();pos.top-=containerOffset.top,pos.left-=containerOffset.left,this.$popover.css({display:"block",left:pos.left,top:pos.top})}else this.hide();return isCell}},{key:"hide",value:function hide(){this.$popover.hide()}}]),TablePopover}();function VideoDialog_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function VideoDialog_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function VideoDialog_createClass(Constructor,protoProps,staticProps){return protoProps&&VideoDialog_defineProperties(Constructor.prototype,protoProps),staticProps&&VideoDialog_defineProperties(Constructor,staticProps),Constructor}var VideoDialog_VideoDialog=function(){function VideoDialog(context){VideoDialog_classCallCheck(this,VideoDialog),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.$body=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document.body),this.$editor=context.layoutInfo.editor,this.options=context.options,this.lang=this.options.langInfo}return VideoDialog_createClass(VideoDialog,[{key:"initialize",value:function initialize(){var $container=this.options.dialogsInBody?this.$body:this.options.container,body=['<div class="form-group note-form-group row-fluid">','<label for="note-dialog-video-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.video.url,' <small class="text-muted">').concat(this.lang.video.providers,"</small></label>"),'<input id="note-dialog-video-url-'.concat(this.options.id,'" class="note-video-url form-control note-form-control note-input" type="text"/>'),"</div>"].join(""),buttonClass,footer='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-video-btn",'" value="').concat(this.lang.video.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:body,footer:footer}).render().appendTo($container)}},{key:"destroy",value:function destroy(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function bindEnterKey($input,$btn){$input.on("keypress",(function(event){event.keyCode===core_key.code.ENTER&&(event.preventDefault(),$btn.trigger("click"))}))}},{key:"createVideoNode",value:function createVideoNode(url){var ytRegExp=/\/\/(?:(?:www|m)\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/,ytRegExpForStart=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/,ytMatch=url.match(ytRegExp),igRegExp=/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/,igMatch=url.match(igRegExp),vRegExp=/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/,vMatch=url.match(vRegExp),vimRegExp=/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/,vimMatch=url.match(vimRegExp),dmRegExp=/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/,dmMatch=url.match(dmRegExp),youkuRegExp=/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/,youkuMatch=url.match(youkuRegExp),qqRegExp=/\/\/v\.qq\.com.*?vid=(.+)/,qqMatch=url.match(qqRegExp),qqRegExp2=/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/,qqMatch2=url.match(qqRegExp2),mp4RegExp=/^.+.(mp4|m4v)$/,mp4Match=url.match(mp4RegExp),oggRegExp=/^.+.(ogg|ogv)$/,oggMatch=url.match(oggRegExp),webmRegExp=/^.+.(webm)$/,webmMatch=url.match(webmRegExp),fbRegExp=/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/,fbMatch=url.match(fbRegExp),$video;if(ytMatch&&11===ytMatch[1].length){var youtubeId=ytMatch[1],start=0;if(void 0!==ytMatch[2]){var ytMatchForStart=ytMatch[2].match(ytRegExpForStart);if(ytMatchForStart)for(var n=[3600,60,1],i=0,r=n.length;i<r;i++)start+=void 0!==ytMatchForStart[i+1]?n[i]*parseInt(ytMatchForStart[i+1],10):0}$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+youtubeId+(start>0?"?start="+start:"")).attr("width","640").attr("height","360")}else if(igMatch&&igMatch[0].length)$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+igMatch[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(vMatch&&vMatch[0].length)$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe>").attr("frameborder",0).attr("src",vMatch[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(vimMatch&&vimMatch[3].length)$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+vimMatch[3]).attr("width","640").attr("height","360");else if(dmMatch&&dmMatch[2].length)$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+dmMatch[2]).attr("width","640").attr("height","360");else if(youkuMatch&&youkuMatch[1].length)$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+youkuMatch[1]);else if(qqMatch&&qqMatch[1].length||qqMatch2&&qqMatch2[2].length){var vid=qqMatch&&qqMatch[1].length?qqMatch[1]:qqMatch2[2];$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","310").attr("width","500").attr("src","https://v.qq.com/txp/iframe/player.html?vid="+vid+"&auto=0")}else if(mp4Match||oggMatch||webmMatch)$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<video controls>").attr("src",url).attr("width","640").attr("height","360");else{if(!fbMatch||!fbMatch[0].length)return!1;$video=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<iframe>").attr("frameborder",0).attr("src","https://www.facebook.com/plugins/video.php?href="+encodeURIComponent(fbMatch[0])+"&show_text=0&width=560").attr("width","560").attr("height","301").attr("scrolling","no").attr("allowtransparency","true")}return $video.addClass("note-video-clip"),$video[0]}},{key:"show",value:function show(){var _this=this,text=this.context.invoke("editor.getSelectedText");this.context.invoke("editor.saveRange"),this.showVideoDialog(text).then((function(url){_this.ui.hideDialog(_this.$dialog),_this.context.invoke("editor.restoreRange");var $node=_this.createVideoNode(url);$node&&_this.context.invoke("editor.insertNode",$node)})).fail((function(){_this.context.invoke("editor.restoreRange")}))}},{key:"showVideoDialog",value:function showVideoDialog(){var _this2=this;return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.Deferred((function(deferred){var $videoUrl=_this2.$dialog.find(".note-video-url"),$videoBtn=_this2.$dialog.find(".note-video-btn");_this2.ui.onDialogShown(_this2.$dialog,(function(){_this2.context.triggerEvent("dialog.shown"),$videoUrl.on("input paste propertychange",(function(){_this2.ui.toggleBtn($videoBtn,$videoUrl.val())})),env.isSupportTouch||$videoUrl.trigger("focus"),$videoBtn.click((function(event){event.preventDefault(),deferred.resolve($videoUrl.val())})),_this2.bindEnterKey($videoUrl,$videoBtn)})),_this2.ui.onDialogHidden(_this2.$dialog,(function(){$videoUrl.off(),$videoBtn.off(),"pending"===deferred.state()&&deferred.reject()})),_this2.ui.showDialog(_this2.$dialog)}))}}]),VideoDialog}();function HelpDialog_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function HelpDialog_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function HelpDialog_createClass(Constructor,protoProps,staticProps){return protoProps&&HelpDialog_defineProperties(Constructor.prototype,protoProps),staticProps&&HelpDialog_defineProperties(Constructor,staticProps),Constructor}var HelpDialog_HelpDialog=function(){function HelpDialog(context){HelpDialog_classCallCheck(this,HelpDialog),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.$body=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(document.body),this.$editor=context.layoutInfo.editor,this.options=context.options,this.lang=this.options.langInfo}return HelpDialog_createClass(HelpDialog,[{key:"initialize",value:function initialize(){var $container=this.options.dialogsInBody?this.$body:this.options.container,body=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.8.18</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=this.ui.dialog({title:this.lang.options.help,fade:this.options.dialogsFade,body:this.createShortcutList(),footer:body,callback:function callback($node){$node.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo($container)}},{key:"destroy",value:function destroy(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"createShortcutList",value:function createShortcutList(){var _this=this,keyMap=this.options.keyMap[env.isMac?"mac":"pc"];return Object.keys(keyMap).map((function(key){var command=keyMap[key],$row=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()('<div><div class="help-list-item"></div></div>');return $row.append(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<label><kbd>"+key+"</kdb></label>").css({width:180,"margin-right":10})).append(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()("<span/>").html(_this.context.memo("help."+command)||command)),$row.html()})).join("")}},{key:"showHelpDialog",value:function showHelpDialog(){var _this2=this;return external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.Deferred((function(deferred){_this2.ui.onDialogShown(_this2.$dialog,(function(){_this2.context.triggerEvent("dialog.shown"),deferred.resolve()})),_this2.ui.showDialog(_this2.$dialog)})).promise()}},{key:"show",value:function show(){var _this3=this;this.context.invoke("editor.saveRange"),this.showHelpDialog().then((function(){_this3.context.invoke("editor.restoreRange")}))}}]),HelpDialog}();function AirPopover_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function AirPopover_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function AirPopover_createClass(Constructor,protoProps,staticProps){return protoProps&&AirPopover_defineProperties(Constructor.prototype,protoProps),staticProps&&AirPopover_defineProperties(Constructor,staticProps),Constructor}var AIRMODE_POPOVER_X_OFFSET=-5,AIRMODE_POPOVER_Y_OFFSET=5,AirPopover_AirPopover=function(){function AirPopover(context){var _this=this;AirPopover_classCallCheck(this,AirPopover),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.options=context.options,this.hidable=!0,this.onContextmenu=!1,this.pageX=null,this.pageY=null,this.events={"summernote.contextmenu":function summernoteContextmenu(e){_this.options.editing&&(e.preventDefault(),e.stopPropagation(),_this.onContextmenu=!0,_this.update(!0))},"summernote.mousedown":function summernoteMousedown(we,e){_this.pageX=e.pageX,_this.pageY=e.pageY},"summernote.keyup summernote.mouseup summernote.scroll":function summernoteKeyupSummernoteMouseupSummernoteScroll(we,e){_this.options.editing&&!_this.onContextmenu&&(_this.pageX=e.pageX,_this.pageY=e.pageY,_this.update()),_this.onContextmenu=!1},"summernote.disable summernote.change summernote.dialog.shown summernote.blur":function summernoteDisableSummernoteChangeSummernoteDialogShownSummernoteBlur(){_this.hide()},"summernote.focusout":function summernoteFocusout(){_this.$popover.is(":active,:focus")||_this.hide()}}}return AirPopover_createClass(AirPopover,[{key:"shouldInitialize",value:function shouldInitialize(){return this.options.airMode&&!lists.isEmpty(this.options.popover.air)}},{key:"initialize",value:function initialize(){var _this2=this;this.$popover=this.ui.popover({className:"note-air-popover"}).render().appendTo(this.options.container);var $content=this.$popover.find(".popover-content");this.context.invoke("buttons.build",$content,this.options.popover.air),this.$popover.on("mousedown",(function(){_this2.hidable=!1})),this.$popover.on("mouseup",(function(){_this2.hidable=!0}))}},{key:"destroy",value:function destroy(){this.$popover.remove()}},{key:"update",value:function update(forcelyOpen){var styleInfo=this.context.invoke("editor.currentStyle");if(!styleInfo.range||styleInfo.range.isCollapsed()&&!forcelyOpen)this.hide();else{var rect={left:this.pageX,top:this.pageY},containerOffset=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this.options.container).offset();rect.top-=containerOffset.top,rect.left-=containerOffset.left,this.$popover.css({display:"block",left:Math.max(rect.left,0)+-5,top:rect.top+5}),this.context.invoke("buttons.updateCurrentStyle",this.$popover)}}},{key:"updateCodeview",value:function updateCodeview(isCodeview){this.ui.toggleBtnActive(this.$popover.find(".btn-codeview"),isCodeview),isCodeview&&this.hide()}},{key:"hide",value:function hide(){this.hidable&&this.$popover.hide()}}]),AirPopover}();function HintPopover_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function HintPopover_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function HintPopover_createClass(Constructor,protoProps,staticProps){return protoProps&&HintPopover_defineProperties(Constructor.prototype,protoProps),staticProps&&HintPopover_defineProperties(Constructor,staticProps),Constructor}var POPOVER_DIST=5,HintPopover_HintPopover=function(){function HintPopover(context){var _this=this;HintPopover_classCallCheck(this,HintPopover),this.context=context,this.ui=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.ui,this.$editable=context.layoutInfo.editable,this.options=context.options,this.hint=this.options.hint||[],this.direction=this.options.hintDirection||"bottom",this.hints=Array.isArray(this.hint)?this.hint:[this.hint],this.events={"summernote.keyup":function summernoteKeyup(we,e){e.isDefaultPrevented()||_this.handleKeyup(e)},"summernote.keydown":function summernoteKeydown(we,e){_this.handleKeydown(e)},"summernote.disable summernote.dialog.shown summernote.blur":function summernoteDisableSummernoteDialogShownSummernoteBlur(){_this.hide()}}}return HintPopover_createClass(HintPopover,[{key:"shouldInitialize",value:function shouldInitialize(){return this.hints.length>0}},{key:"initialize",value:function initialize(){var _this2=this;this.lastWordRange=null,this.matchingWord=null,this.$popover=this.ui.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo(this.options.container),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",(function(e){_this2.$content.find(".active").removeClass("active"),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(e.currentTarget).addClass("active"),_this2.replace()})),this.$popover.on("mousedown",(function(e){e.preventDefault()}))}},{key:"destroy",value:function destroy(){this.$popover.remove()}},{key:"selectItem",value:function selectItem($item){this.$content.find(".active").removeClass("active"),$item.addClass("active"),this.$content[0].scrollTop=$item[0].offsetTop-this.$content.innerHeight()/2}},{key:"moveDown",value:function moveDown(){var $current=this.$content.find(".note-hint-item.active"),$next=$current.next();if($next.length)this.selectItem($next);else{var $nextGroup=$current.parent().next();$nextGroup.length||($nextGroup=this.$content.find(".note-hint-group").first()),this.selectItem($nextGroup.find(".note-hint-item").first())}}},{key:"moveUp",value:function moveUp(){var $current=this.$content.find(".note-hint-item.active"),$prev=$current.prev();if($prev.length)this.selectItem($prev);else{var $prevGroup=$current.parent().prev();$prevGroup.length||($prevGroup=this.$content.find(".note-hint-group").last()),this.selectItem($prevGroup.find(".note-hint-item").last())}}},{key:"replace",value:function replace(){var $item=this.$content.find(".note-hint-item.active");if($item.length){var node=this.nodeFromItem($item);if(null!==this.matchingWord&&0===this.matchingWord.length)this.lastWordRange.so=this.lastWordRange.eo;else if(null!==this.matchingWord&&this.matchingWord.length>0&&!this.lastWordRange.isCollapsed()){var rangeCompute=this.lastWordRange.eo-this.lastWordRange.so-this.matchingWord.length;rangeCompute>0&&(this.lastWordRange.so+=rangeCompute)}if(this.lastWordRange.insertNode(node),"next"===this.options.hintSelect){var blank=document.createTextNode("");external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(node).after(blank),range.createFromNodeBefore(blank).select()}else range.createFromNodeAfter(node).select();this.lastWordRange=null,this.hide(),this.context.invoke("editor.focus")}}},{key:"nodeFromItem",value:function nodeFromItem($item){var hint=this.hints[$item.data("index")],item=$item.data("item"),node=hint.content?hint.content(item):item;return"string"==typeof node&&(node=dom.createText(node)),node}},{key:"createItemTemplates",value:function createItemTemplates(hintIdx,items){var hint=this.hints[hintIdx];return items.map((function(item){var $item=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()('<div class="note-hint-item"/>');return $item.append(hint.template?hint.template(item):item+""),$item.data({index:hintIdx,item:item}),$item}))}},{key:"handleKeydown",value:function handleKeydown(e){this.$popover.is(":visible")&&(e.keyCode===core_key.code.ENTER?(e.preventDefault(),this.replace()):e.keyCode===core_key.code.UP?(e.preventDefault(),this.moveUp()):e.keyCode===core_key.code.DOWN&&(e.preventDefault(),this.moveDown()))}},{key:"searchKeyword",value:function searchKeyword(index,keyword,callback){var hint=this.hints[index];if(hint&&hint.match.test(keyword)&&hint.search){var matches=hint.match.exec(keyword);this.matchingWord=matches[0],hint.search(matches[1],callback)}else callback()}},{key:"createGroup",value:function createGroup(idx,keyword){var _this3=this,$group=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()('<div class="note-hint-group note-hint-group-'+idx+'"></div>');return this.searchKeyword(idx,keyword,(function(items){(items=items||[]).length&&($group.html(_this3.createItemTemplates(idx,items)),_this3.show())})),$group}},{key:"handleKeyup",value:function handleKeyup(e){var _this4=this;if(!lists.contains([core_key.code.ENTER,core_key.code.UP,core_key.code.DOWN],e.keyCode)){var _range=this.context.invoke("editor.getLastRange"),wordRange,keyword;if("words"===this.options.hintMode){if(wordRange=_range.getWordsRange(_range),keyword=wordRange.toString(),this.hints.forEach((function(hint){if(hint.match.test(keyword))return wordRange=_range.getWordsMatchRange(hint.match),!1})),!wordRange)return void this.hide();keyword=wordRange.toString()}else wordRange=_range.getWordRange(),keyword=wordRange.toString();if(this.hints.length&&keyword){this.$content.empty();var bnd=func.rect2bnd(lists.last(wordRange.getClientRects())),containerOffset=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(this.options.container).offset();bnd&&(bnd.top-=containerOffset.top,bnd.left-=containerOffset.left,this.$popover.hide(),this.lastWordRange=wordRange,this.hints.forEach((function(hint,idx){hint.match.test(keyword)&&_this4.createGroup(idx,keyword).appendTo(_this4.$content)})),this.$content.find(".note-hint-item:first").addClass("active"),"top"===this.direction?this.$popover.css({left:bnd.left,top:bnd.top-this.$popover.outerHeight()-5}):this.$popover.css({left:bnd.left,top:bnd.top+bnd.height+5}))}else this.hide()}}},{key:"show",value:function show(){this.$popover.show()}},{key:"hide",value:function hide(){this.$popover.hide()}}]),HintPopover}();external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote,{version:"0.8.18",plugins:{},dom:dom,range:range,lists:lists,options:{langInfo:external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.lang["en-US"],editing:!0,modules:{editor:Editor_Editor,clipboard:Clipboard_Clipboard,dropzone:Dropzone_Dropzone,codeview:Codeview_CodeView,statusbar:Statusbar_Statusbar,fullscreen:Fullscreen_Fullscreen,handle:Handle_Handle,hintPopover:HintPopover_HintPopover,autoLink:AutoLink_AutoLink,autoSync:AutoSync_AutoSync,autoReplace:AutoReplace_AutoReplace,placeholder:Placeholder_Placeholder,buttons:Buttons_Buttons,toolbar:Toolbar_Toolbar,linkDialog:LinkDialog_LinkDialog,linkPopover:LinkPopover_LinkPopover,imageDialog:ImageDialog_ImageDialog,imagePopover:ImagePopover_ImagePopover,tablePopover:TablePopover_TablePopover,videoDialog:VideoDialog_VideoDialog,helpDialog:HelpDialog_HelpDialog,airPopover:AirPopover_AirPopover},buttons:{},lang:"en-US",followingToolbar:!1,toolbarPosition:"top",otherStaticBar:"",codeviewKeepButton:!1,toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popatmouse:!0,popover:{image:[["resize",["resizeFull","resizeHalf","resizeQuarter","resizeNone"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]],["view",["fullscreen","codeview"]]]},airMode:!1,overrideContextMenu:!1,width:null,height:null,linkTargetBlank:!0,useProtocol:!0,defaultProtocol:"http://",focus:!1,tabDisabled:!1,tabSize:4,styleWithCSS:!1,shortcuts:!0,textareaAutoSync:!0,tooltip:"auto",container:null,maxTextLength:0,blockquoteBreakingLevel:2,spellCheck:!0,disableGrammar:!1,placeholder:null,inheritPlaceholder:!1,recordEveryKeystroke:!1,historyLimit:200,showDomainOnlyForAutolink:!1,hintMode:"word",hintSelect:"after",hintDirection:"bottom",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],addDefaultFonts:!0,fontSizes:["8","9","10","11","12","14","18","24","36"],fontSizeUnits:["px","pt"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],colorsName:[["Black","Tundora","Dove Gray","Star Dust","Pale Slate","Gallery","Alabaster","White"],["Red","Orange Peel","Yellow","Green","Cyan","Blue","Electric Violet","Magenta"],["Azalea","Karry","Egg White","Zanah","Botticelli","Tropical Blue","Mischka","Twilight"],["Tonys Pink","Peach Orange","Cream Brulee","Sprout","Casper","Perano","Cold Purple","Careys Pink"],["Mandy","Rajah","Dandelion","Olivine","Gulf Stream","Viking","Blue Marguerite","Puce"],["Guardsman Red","Fire Bush","Golden Dream","Chelsea Cucumber","Smalt Blue","Boston Blue","Butterfly Bush","Cadillac"],["Sangria","Mai Tai","Buddha Gold","Forest Green","Eden","Venice Blue","Meteorite","Claret"],["Rosewood","Cinnamon","Olive","Parsley","Tiber","Midnight Blue","Valentino","Loulou"]],colorButton:{foreColor:"#000000",backColor:"#FFFF00"},lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onBeforeCommand:null,onBlur:null,onBlurCodeview:null,onChange:null,onChangeCodeview:null,onDialogShown:null,onEnter:null,onFocus:null,onImageLinkInsert:null,onImageUpload:null,onImageUploadError:null,onInit:null,onKeydown:null,onKeyup:null,onMousedown:null,onMouseup:null,onPaste:null,onScroll:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},codeviewFilter:!1,codeviewFilterRegex:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,codeviewIframeFilter:!0,codeviewIframeWhitelistSrc:[],codeviewIframeWhitelistSrcBase:["www.youtube.com","www.youtube-nocookie.com","www.facebook.com","vine.co","instagram.com","player.vimeo.com","www.dailymotion.com","player.youku.com","v.qq.com"],keyMap:{pc:{ESC:"escape",ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ESC:"escape",ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",floatLeft:"note-icon-float-left",floatRight:"note-icon-float-right",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",rollback:"note-icon-rollback",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})},5:function(module,exports,__webpack_require__){},53:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_=__webpack_require__(0),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default=__webpack_require__.n(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_),renderer=__webpack_require__(1);function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}var editor=renderer.a.create('<div class="note-editor note-frame card"/>'),toolbar=renderer.a.create('<div class="note-toolbar card-header" role="toolbar"/>'),editingArea=renderer.a.create('<div class="note-editing-area"/>'),codable=renderer.a.create('<textarea class="note-codable" aria-multiline="true"/>'),editable=renderer.a.create('<div class="note-editable card-block" contentEditable="true" role="textbox" aria-multiline="true"/>'),statusbar=renderer.a.create(['<output class="note-status-output" role="status" aria-live="polite"></output>','<div class="note-statusbar" role="status">','<div class="note-resizebar" aria-label="Resize">','<div class="note-icon-bar"></div>','<div class="note-icon-bar"></div>','<div class="note-icon-bar"></div>',"</div>","</div>"].join("")),airEditor=renderer.a.create('<div class="note-editor note-airframe"/>'),airEditable=renderer.a.create(['<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"></div>','<output class="note-status-output" role="status" aria-live="polite"></output>'].join("")),buttonGroup=renderer.a.create('<div class="note-btn-group btn-group">'),dropdown=renderer.a.create('<div class="note-dropdown-menu dropdown-menu" role="list">',(function($node,options){var markup=Array.isArray(options.items)?options.items.map((function(item){var value="string"==typeof item?item:item.value||"",content=options.template?options.template(item):item,option="object"===_typeof(item)?item.option:void 0,dataValue,dataOption;return'<a class="dropdown-item" href="#" '+('data-value="'+value+'"'+(void 0!==option?' data-option="'+option+'"':""))+' role="listitem" aria-label="'+value+'">'+content+"</a>"})).join(""):options.items;$node.html(markup).attr({"aria-label":options.title}),options&&options.codeviewKeepButton&&$node.addClass("note-codeview-keep")})),dropdownButtonContents=function dropdownButtonContents(contents){return contents},dropdownCheck=renderer.a.create('<div class="note-dropdown-menu dropdown-menu note-check" role="list">',(function($node,options){var markup=Array.isArray(options.items)?options.items.map((function(item){var value="string"==typeof item?item:item.value||"",content=options.template?options.template(item):item;return'<a class="dropdown-item" href="#" data-value="'+value+'" role="listitem" aria-label="'+item+'">'+icon(options.checkClassName)+" "+content+"</a>"})).join(""):options.items;$node.html(markup).attr({"aria-label":options.title}),options&&options.codeviewKeepButton&&$node.addClass("note-codeview-keep")})),dialog=renderer.a.create('<div class="modal note-modal" aria-hidden="false" tabindex="-1" role="dialog"/>',(function($node,options){options.fade&&$node.addClass("fade"),$node.attr({"aria-label":options.title}),$node.html(['<div class="modal-dialog">','<div class="modal-content">',options.title?'<div class="modal-header"><h4 class="modal-title">'+options.title+'</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true">×</button></div>':"",'<div class="modal-body">'+options.body+"</div>",options.footer?'<div class="modal-footer">'+options.footer+"</div>":"","</div>","</div>"].join(""))})),popover=renderer.a.create(['<div class="note-popover popover in">','<div class="arrow"></div>','<div class="popover-content note-children-container"></div>',"</div>"].join(""),(function($node,options){var direction=void 0!==options.direction?options.direction:"bottom";$node.addClass(direction),options.hideArrow&&$node.find(".arrow").hide()})),ui_checkbox=renderer.a.create('<div class="form-check"></div>',(function($node,options){$node.html(['<label class="form-check-label"'+(options.id?' for="note-'+options.id+'"':"")+">",'<input type="checkbox" class="form-check-input"'+(options.id?' id="note-'+options.id+'"':""),options.checked?" checked":"",' aria-label="'+(options.text?options.text:"")+'"',' aria-checked="'+(options.checked?"true":"false")+'"/>'," "+(options.text?options.text:"")+"</label>"].join(""))})),icon=function icon(iconClassName,tagName){return"<"+(tagName=tagName||"i")+' class="'+iconClassName+'"></'+tagName+">"},ui_ui,bs4_ui=function ui(editorOptions){return{editor:editor,toolbar:toolbar,editingArea:editingArea,codable:codable,editable:editable,statusbar:statusbar,airEditor:airEditor,airEditable:airEditable,buttonGroup:buttonGroup,dropdown:dropdown,dropdownButtonContents:dropdownButtonContents,dropdownCheck:dropdownCheck,dialog:dialog,popover:popover,icon:icon,checkbox:ui_checkbox,options:editorOptions,palette:function palette($node,options){return renderer.a.create('<div class="note-color-palette"/>',(function($node,options){for(var contents=[],row=0,rowSize=options.colors.length;row<rowSize;row++){for(var eventName=options.eventName,colors=options.colors[row],colorsName=options.colorsName[row],buttons=[],col=0,colSize=colors.length;col<colSize;col++){var color=colors[col],colorName=colorsName[col];buttons.push(['<button type="button" class="note-color-btn"','style="background-color:',color,'" ','data-event="',eventName,'" ','data-value="',color,'" ','title="',colorName,'" ','aria-label="',colorName,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}contents.push('<div class="note-color-row">'+buttons.join("")+"</div>")}$node.html(contents.join("")),options.tooltip&&$node.find(".note-color-btn").tooltip({container:options.container||editorOptions.container,trigger:"hover",placement:"bottom"})}))($node,options)},button:function button($node,options){return renderer.a.create('<button type="button" class="note-btn btn btn-light btn-sm" tabindex="-1">',(function($node,options){options&&options.tooltip&&$node.attr({title:options.tooltip,"aria-label":options.tooltip}).tooltip({container:options.container||editorOptions.container,trigger:"hover",placement:"bottom"}).on("click",(function(e){external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default()(e.currentTarget).tooltip("hide")})),options&&options.codeviewButton&&$node.addClass("note-codeview-keep")}))($node,options)},toggleBtn:function toggleBtn($btn,isEnable){$btn.toggleClass("disabled",!isEnable),$btn.attr("disabled",!isEnable)},toggleBtnActive:function toggleBtnActive($btn,isActive){$btn.toggleClass("active",isActive)},onDialogShown:function onDialogShown($dialog,handler){$dialog.one("shown.bs.modal",handler)},onDialogHidden:function onDialogHidden($dialog,handler){$dialog.one("hidden.bs.modal",handler)},showDialog:function showDialog($dialog){$dialog.modal("show")},hideDialog:function hideDialog($dialog){$dialog.modal("hide")},createLayout:function createLayout($note){var $editor=(editorOptions.airMode?airEditor([editingArea([codable(),airEditable()])]):"bottom"===editorOptions.toolbarPosition?editor([editingArea([codable(),editable()]),toolbar(),statusbar()]):editor([toolbar(),editingArea([codable(),editable()]),statusbar()])).render();return $editor.insertAfter($note),{note:$note,editor:$editor,toolbar:$editor.find(".note-toolbar"),editingArea:$editor.find(".note-editing-area"),editable:$editor.find(".note-editable"),codable:$editor.find(".note-codable"),statusbar:$editor.find(".note-statusbar")}},removeLayout:function removeLayout($note,layoutInfo){$note.html(layoutInfo.editable.html()),layoutInfo.editor.remove(),$note.show()}}},settings=__webpack_require__(3),summernote_bs4=__webpack_require__(5);external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote=external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.extend(external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote,{ui_template:bs4_ui,interface:"bs4"}),external_root_jQuery_commonjs2_jquery_commonjs_jquery_amd_jquery_default.a.summernote.options.styleTags=["p",{title:"Blockquote",tag:"blockquote",className:"blockquote",value:"blockquote"},"pre","h1","h2","h3","h4","h5","h6"]}})})),function(expose){var Markdown=expose.Markdown=function(dialect){switch(typeof dialect){case"undefined":this.dialect=Markdown.dialects.Gruber;break;case"object":this.dialect=dialect;break;default:if(!(dialect in Markdown.dialects))throw new Error("Unknown Markdown dialect '"+String(dialect)+"'");this.dialect=Markdown.dialects[dialect]}this.em_state=[],this.strong_state=[],this.debug_indent=""};function mk_block_toSource(){return"Markdown.mk_block( "+uneval(this.toString())+", "+uneval(this.trailing)+", "+uneval(this.lineNumber)+" )"}function mk_block_inspect(){var util=require("util");return"Markdown.mk_block( "+util.inspect(this.toString())+", "+util.inspect(this.trailing)+", "+util.inspect(this.lineNumber)+" )"}expose.parse=function(source,dialect){var md;return new Markdown(dialect).toTree(source)},expose.toHTML=function toHTML(source,dialect,options){var input=expose.toHTMLTree(source,dialect,options);return expose.renderJsonML(input)},expose.toHTMLTree=function toHTMLTree(input,dialect,options){"string"==typeof input&&(input=this.parse(input,dialect));var attrs=extract_attr(input),refs={};attrs&&attrs.references&&(refs=attrs.references);var html=convert_tree_to_html(input,refs,options);return merge_text_nodes(html),html};var mk_block=Markdown.mk_block=function(block,trail,line){1==arguments.length&&(trail="\n\n");var s=new String(block);return s.trailing=trail,s.inspect=mk_block_inspect,s.toSource=mk_block_toSource,null!=line&&(s.lineNumber=line),s};function count_lines(str){for(var n=0,i=-1;-1!==(i=str.indexOf("\n",i+1));)n++;return n}function strong_em(tag,md){var state_slot=tag+"_state",other_slot="strong"==tag?"em_state":"strong_state";function CloseTag(len){this.len_after=len,this.name="close_"+md}return function(text,orig_match){if(this[state_slot][0]==md)return this[state_slot].shift(),[text.length,new CloseTag(text.length-md.length)];var other=this[other_slot].slice(),state=this[state_slot].slice();this[state_slot].unshift(md);var res=this.processInline(text.substr(md.length)),last=res[res.length-1],check=this[state_slot].shift(),consumed;return last instanceof CloseTag?(res.pop(),[text.length-last.len_after,[tag].concat(res)]):(this[other_slot]=other,this[state_slot]=state,[md.length,md])}}function split_meta_hash(meta_string){for(var meta=meta_string.split(""),parts=[""],in_quotes=!1;meta.length;){var letter=meta.shift();switch(letter){case" ":in_quotes?parts[parts.length-1]+=letter:parts.push("");break;case"'":case'"':in_quotes=!in_quotes;break;case"\\":letter=meta.shift();default:parts[parts.length-1]+=letter}}return parts}Markdown.prototype.split_blocks=function splitBlocks(input,startLine){input=input.replace(/(\r\n|\n|\r)/g,"\n");var re=/([\s\S]+?)($|\n#|\n(?:\s*\n|$)+)/g,blocks=[],m,line_no=1;for(null!=(m=/^(\s*\n)/.exec(input))&&(line_no+=count_lines(m[0]),re.lastIndex=m[0].length);null!==(m=re.exec(input));)"\n#"==m[2]&&(m[2]="\n",re.lastIndex--),blocks.push(mk_block(m[1],m[2],line_no)),line_no+=count_lines(m[0]);return blocks},Markdown.prototype.processBlock=function processBlock(block,next){var cbs=this.dialect.block,ord=cbs.__order__;if("__call__"in cbs)return cbs.__call__.call(this,block,next);for(var i=0;i<ord.length;i++){var res=cbs[ord[i]].call(this,block,next);if(res)return(!isArray(res)||res.length>0&&!isArray(res[0]))&&this.debug(ord[i],"didn't return a proper array"),res}return[]},Markdown.prototype.processInline=function processInline(block){return this.dialect.inline.__call__.call(this,String(block))},Markdown.prototype.toTree=function toTree(source,custom_root){var blocks=source instanceof Array?source:this.split_blocks(source),old_tree=this.tree;try{for(this.tree=custom_root||this.tree||["markdown"];blocks.length;){var b=this.processBlock(blocks.shift(),blocks);b.length&&this.tree.push.apply(this.tree,b)}return this.tree}finally{custom_root&&(this.tree=old_tree)}},Markdown.prototype.debug=function(){var args=Array.prototype.slice.call(arguments);args.unshift(this.debug_indent),"undefined"!=typeof print&&print.apply(print,args),"undefined"!=typeof console&&void 0!==console.log&&console.log.apply(null,args)},Markdown.prototype.loop_re_over_block=function(re,block,cb){for(var m,b=block.valueOf();b.length&&null!=(m=re.exec(b));)b=b.substr(m[0].length),cb.call(this,m);return b},Markdown.dialects={},Markdown.dialects.Gruber={block:{atxHeader:function atxHeader(block,next){var m=block.match(/^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/);if(m){var header=["header",{level:m[1].length}];return Array.prototype.push.apply(header,this.processInline(m[2])),m[0].length<block.length&&next.unshift(mk_block(block.substr(m[0].length),block.trailing,block.lineNumber+2)),[header]}},setextHeader:function setextHeader(block,next){var m=block.match(/^(.*)\n([-=])\2\2+(?:\n|$)/);if(m){var level,header=["header",{level:"="===m[2]?1:2},m[1]];return m[0].length<block.length&&next.unshift(mk_block(block.substr(m[0].length),block.trailing,block.lineNumber+2)),[header]}},code:function code(block,next){var ret=[],re=/^(?: {0,3}\t| {4})(.*)\n?/,lines;if(block.match(re)){block_search:for(;;){var b=this.loop_re_over_block(re,block.valueOf(),(function(m){ret.push(m[1])}));if(b.length){next.unshift(mk_block(b,block.trailing));break block_search}if(!next.length)break block_search;if(!next[0].match(re))break block_search;ret.push(block.trailing.replace(/[^\n]/g,"").substring(2)),block=next.shift()}return[["code_block",ret.join("\n")]]}},horizRule:function horizRule(block,next){var m=block.match(/^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/);if(m){var jsonml=[["hr"]];return m[1]&&jsonml.unshift.apply(jsonml,this.processBlock(m[1],[])),m[3]&&next.unshift(mk_block(m[3])),jsonml}},lists:function(){var any_list="[*+-]|\\d+\\.",bullet_list=/[*+-]/,number_list=/\d+\./,is_list_re=new RegExp("^( {0,3})("+any_list+")[ \t]+"),indent_re="(?: {0,3}\\t| {4})";function regex_for_depth(depth){return new RegExp("(?:^("+indent_re+"{0,"+depth+"} {0,3})("+any_list+")\\s+)|(^"+indent_re+"{0,"+(depth-1)+"}[ ]{0,4})")}function expand_tab(input){return input.replace(/ {0,3}\t/g," ")}function add(li,loose,inline,nl){if(loose)li.push(["para"].concat(inline));else{var add_to=li[li.length-1]instanceof Array&&"para"==li[li.length-1][0]?li[li.length-1]:li;nl&&li.length>1&&inline.unshift(nl);for(var i=0;i<inline.length;i++){var what=inline[i],is_str;"string"==typeof what&&add_to.length>1&&"string"==typeof add_to[add_to.length-1]?add_to[add_to.length-1]+=what:add_to.push(what)}}}function get_contained_blocks(depth,blocks){for(var re=new RegExp("^("+indent_re+"{"+depth+"}.*?\\n?)*$"),replace=new RegExp("^"+indent_re+"{"+depth+"}","gm"),ret=[];blocks.length>0&&re.exec(blocks[0]);){var b=blocks.shift(),x=b.replace(replace,"");ret.push(mk_block(x,b.trailing,b.lineNumber))}return ret}function paragraphify(s,i,stack){var list=s.list,last_li=list[list.length-1];if(!(last_li[1]instanceof Array&&"para"==last_li[1][0]))if(i+1==stack.length)last_li.push(["para"].concat(last_li.splice(1,last_li.length-1)));else{var sublist=last_li.pop();last_li.push(["para"].concat(last_li.splice(1,last_li.length-1)),sublist)}}return function(block,next){var m=block.match(is_list_re);if(m){for(var stack=[],list=make_list(m),last_li,loose=!1,ret=[stack[0].list],i;;){for(var lines=block.split(/(?=\n)/),li_accumulate="",line_no=0;line_no<lines.length;line_no++){var nl="",l=lines[line_no].replace(/^\n/,(function(n){return nl=n,""})),line_re=regex_for_depth(stack.length);if(void 0!==(m=l.match(line_re))[1]){li_accumulate.length&&(add(last_li,loose,this.processInline(li_accumulate),nl),loose=!1,li_accumulate=""),m[1]=expand_tab(m[1]);var wanted_depth=Math.floor(m[1].length/4)+1;if(wanted_depth>stack.length)list=make_list(m),last_li.push(list),last_li=list[1]=["listitem"];else{var found=!1;for(i=0;i<stack.length;i++)if(stack[i].indent==m[1]){list=stack[i].list,stack.splice(i+1,stack.length-(i+1)),found=!0;break}found||(++wanted_depth<=stack.length?(stack.splice(wanted_depth,stack.length-wanted_depth),list=stack[wanted_depth-1].list):(list=make_list(m),last_li.push(list))),last_li=["listitem"],list.push(last_li)}nl=""}l.length>m[0].length&&(li_accumulate+=nl+l.substr(m[0].length))}li_accumulate.length&&(add(last_li,loose,this.processInline(li_accumulate),nl),loose=!1,li_accumulate="");var contained=get_contained_blocks(stack.length,next);contained.length>0&&(forEach(stack,paragraphify,this),last_li.push.apply(last_li,this.toTree(contained,[])));var next_block=next[0]&&next[0].valueOf()||"";if(!next_block.match(is_list_re)&&!next_block.match(/^ /))break;block=next.shift();var hr=this.dialect.block.horizRule(block,next);if(hr){ret.push.apply(ret,hr);break}forEach(stack,paragraphify,this),loose=!0}return ret}function make_list(m){var list=bullet_list.exec(m[2])?["bulletlist"]:["numberlist"];return stack.push({list:list,indent:m[1]}),list}}}(),blockquote:function blockquote(block,next){if(block.match(/^>/m)){var jsonml=[];if(">"!=block[0]){for(var lines=block.split(/\n/),prev=[],line_no=block.lineNumber;lines.length&&">"!=lines[0][0];)prev.push(lines.shift()),line_no++;var abutting=mk_block(prev.join("\n"),"\n",block.lineNumber);jsonml.push.apply(jsonml,this.processBlock(abutting,[])),block=mk_block(lines.join("\n"),block.trailing,line_no)}for(;next.length&&">"==next[0][0];){var b=next.shift();block=mk_block(block+block.trailing+b,b.trailing,block.lineNumber)}var input=block.replace(/^> ?/gm,""),old_tree=this.tree,processedBlock=this.toTree(input,["blockquote"]),attr=extract_attr(processedBlock);return attr&&attr.references&&(delete attr.references,isEmpty(attr)&&processedBlock.splice(1,1)),jsonml.push(processedBlock),jsonml}},referenceDefn:function referenceDefn(block,next){var re=/^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/;if(block.match(re)){extract_attr(this.tree)||this.tree.splice(1,0,{});var attrs=extract_attr(this.tree);void 0===attrs.references&&(attrs.references={});var b=this.loop_re_over_block(re,block,(function(m){m[2]&&"<"==m[2][0]&&">"==m[2][m[2].length-1]&&(m[2]=m[2].substring(1,m[2].length-1));var ref=attrs.references[m[1].toLowerCase()]={href:m[2]};void 0!==m[4]?ref.title=m[4]:void 0!==m[5]&&(ref.title=m[5])}));return b.length&&next.unshift(mk_block(b,block.trailing)),[]}},para:function para(block,next){return[["para"].concat(this.processInline(block))]}}},Markdown.dialects.Gruber.inline={__oneElement__:function oneElement(text,patterns_or_re,previous_nodes){var m,res,lastIndex=0,re,res;return patterns_or_re=patterns_or_re||this.dialect.inline.__patterns__,(m=new RegExp("([\\s\\S]*?)("+(patterns_or_re.source||patterns_or_re)+")").exec(text))?m[1]?[m[1].length,m[1]]:(m[2]in this.dialect.inline&&(res=this.dialect.inline[m[2]].call(this,text.substr(m.index),m,previous_nodes||[])),res=res||[m[2].length,m[2]]):[text.length,text]},__call__:function inline(text,patterns){var out=[],res;function add(x){"string"==typeof x&&"string"==typeof out[out.length-1]?out[out.length-1]+=x:out.push(x)}for(;text.length>0;)res=this.dialect.inline.__oneElement__.call(this,text,patterns,out),text=text.substr(res.shift()),forEach(res,add);return out},"]":function(){},"}":function(){},__escape__:/^\\[\\`\*_{}\[\]()#\+.!\-]/,"\\":function escaped(text){return this.dialect.inline.__escape__.exec(text)?[2,text.charAt(1)]:[1,"\\"]},"![":function image(text){var m=text.match(/^!\[(.*?)\][ \t]*\([ \t]*([^")]*?)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/);if(m){m[2]&&"<"==m[2][0]&&">"==m[2][m[2].length-1]&&(m[2]=m[2].substring(1,m[2].length-1)),m[2]=this.dialect.inline.__call__.call(this,m[2],/\\/)[0];var attrs={alt:m[1],href:m[2]||""};return void 0!==m[4]&&(attrs.title=m[4]),[m[0].length,["img",attrs]]}return(m=text.match(/^!\[(.*?)\][ \t]*\[(.*?)\]/))?[m[0].length,["img_ref",{alt:m[1],ref:m[2].toLowerCase(),original:m[0]}]]:[2,"!["]},"[":function link(text){var orig=String(text),res=Markdown.DialectHelpers.inline_until_char.call(this,text.substr(1),"]");if(!res)return[1,"["];var consumed=1+res[0],children=res[1],link,attrs,m=(text=text.substr(consumed)).match(/^\s*\([ \t]*([^"']*)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/);if(m){var url=m[1];if(consumed+=m[0].length,url&&"<"==url[0]&&">"==url[url.length-1]&&(url=url.substring(1,url.length-1)),!m[3])for(var open_parens=1,len=0;len<url.length;len++)switch(url[len]){case"(":open_parens++;break;case")":0==--open_parens&&(consumed-=url.length-len,url=url.substring(0,len))}return attrs={href:(url=this.dialect.inline.__call__.call(this,url,/\\/)[0])||""},void 0!==m[3]&&(attrs.title=m[3]),link=["link",attrs].concat(children),[consumed,link]}return(m=text.match(/^\s*\[(.*?)\]/))?(consumed+=m[0].length,link=["link_ref",attrs={ref:(m[1]||String(children)).toLowerCase(),original:orig.substr(0,consumed)}].concat(children),[consumed,link]):1==children.length&&"string"==typeof children[0]?(link=["link_ref",attrs={ref:children[0].toLowerCase(),original:orig.substr(0,consumed)},children[0]],[consumed,link]):[1,"["]},"<":function autoLink(text){var m;return null!=(m=text.match(/^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/))?m[3]?[m[0].length,["link",{href:"mailto:"+m[3]},m[3]]]:"mailto"==m[2]?[m[0].length,["link",{href:m[1]},m[1].substr("mailto:".length)]]:[m[0].length,["link",{href:m[1]},m[1]]]:[1,"<"]},"`":function inlineCode(text){var m=text.match(/(`+)(([\s\S]*?)\1)/);return m&&m[2]?[m[1].length+m[2].length,["inlinecode",m[3]]]:[1,"`"]}," \n":function lineBreak(text){return[3,["linebreak"]]}},Markdown.dialects.Gruber.inline["**"]=strong_em("strong","**"),Markdown.dialects.Gruber.inline.__=strong_em("strong","__"),Markdown.dialects.Gruber.inline["*"]=strong_em("em","*"),Markdown.dialects.Gruber.inline._=strong_em("em","_"),Markdown.buildBlockOrder=function(d){var ord=[];for(var i in d)"__order__"!=i&&"__call__"!=i&&ord.push(i);d.__order__=ord},Markdown.buildInlinePatterns=function(d){var patterns=[];for(var i in d)if(!i.match(/^__.*__$/)){var l=i.replace(/([\\.*+?|()\[\]{}])/g,"\\$1").replace(/\n/,"\\n");patterns.push(1==i.length?l:"(?:"+l+")")}patterns=patterns.join("|"),d.__patterns__=patterns;var fn=d.__call__;d.__call__=function(text,pattern){return null!=pattern?fn.call(this,text,pattern):fn.call(this,text,patterns)}},Markdown.DialectHelpers={},Markdown.DialectHelpers.inline_until_char=function(text,want){for(var consumed=0,nodes=[];;){if(text.charAt(consumed)==want)return[++consumed,nodes];if(consumed>=text.length)return null;var res=this.dialect.inline.__oneElement__.call(this,text.substr(consumed));consumed+=res[0],nodes.push.apply(nodes,res.slice(1))}},Markdown.subclassDialect=function(d){function Block(){}function Inline(){}return Block.prototype=d.block,Inline.prototype=d.inline,{block:new Block,inline:new Inline}},Markdown.buildBlockOrder(Markdown.dialects.Gruber.block),Markdown.buildInlinePatterns(Markdown.dialects.Gruber.inline),Markdown.dialects.Maruku=Markdown.subclassDialect(Markdown.dialects.Gruber),Markdown.dialects.Maruku.processMetaHash=function processMetaHash(meta_string){for(var meta=split_meta_hash(meta_string),attr={},i=0;i<meta.length;++i)if(/^#/.test(meta[i]))attr.id=meta[i].substring(1);else if(/^\./.test(meta[i]))attr.class?attr.class=attr.class+meta[i].replace(/./," "):attr.class=meta[i].substring(1);else if(/\=/.test(meta[i])){var s=meta[i].split(/\=/);attr[s[0]]=s[1]}return attr},Markdown.dialects.Maruku.block.document_meta=function document_meta(block,next){if(!(block.lineNumber>1)&&block.match(/^(?:\w+:.*\n)*\w+:.*$/)){extract_attr(this.tree)||this.tree.splice(1,0,{});var pairs=block.split(/\n/);for(p in pairs){var m=pairs[p].match(/(\w+):\s*(.*)$/),key=m[1].toLowerCase(),value=m[2];this.tree[1][key]=value}return[]}},Markdown.dialects.Maruku.block.block_meta=function block_meta(block,next){var m=block.match(/(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/);if(m){var attr=this.dialect.processMetaHash(m[2]),hash;if(""===m[1]){var node=this.tree[this.tree.length-1];if(hash=extract_attr(node),"string"==typeof node)return;for(a in hash||(hash={},node.splice(1,0,hash)),attr)hash[a]=attr[a];return[]}var b=block.replace(/\n.*$/,""),result=this.processBlock(b,[]);for(a in(hash=extract_attr(result[0]))||(hash={},result[0].splice(1,0,hash)),attr)hash[a]=attr[a];return result}},Markdown.dialects.Maruku.block.definition_list=function definition_list(block,next){var tight=/^((?:[^\s:].*\n)+):\s+([\s\S]+)$/,list=["dl"],i,m;if(m=block.match(tight)){for(var blocks=[block];next.length&&tight.exec(next[0]);)blocks.push(next.shift());for(var b=0;b<blocks.length;++b){var m,terms=(m=blocks[b].match(tight))[1].replace(/\n$/,"").split(/\n/),defns=m[2].split(/\n:\s+/);for(i=0;i<terms.length;++i)list.push(["dt",terms[i]]);for(i=0;i<defns.length;++i)list.push(["dd"].concat(this.processInline(defns[i].replace(/(\n)\s+/,"$1"))))}return[list]}},Markdown.dialects.Maruku.block.table=function table(block,next){var _split_on_unescaped=function(s,ch){(ch=ch||"\\s").match(/^[\\|\[\]{}?*.+^$]$/)&&(ch="\\"+ch);for(var res=[],r=new RegExp("^((?:\\\\.|[^\\\\"+ch+"])*)"+ch+"(.*)"),m;m=s.match(r);)res.push(m[1]),s=m[2];return res.push(s),res},leading_pipe=/^ {0,3}\|(.+)\n {0,3}\|\s*([\-:]+[\-| :]*)\n((?:\s*\|.*(?:\n|$))*)(?=\n|$)/,no_leading_pipe=/^ {0,3}(\S(?:\\.|[^\\|])*\|.*)\n {0,3}([\-:]+\s*\|[\-| :]*)\n((?:(?:\\.|[^\\|])*\|.*(?:\n|$))*)(?=\n|$)/,i,m;if(m=block.match(leading_pipe))m[3]=m[3].replace(/^\s*\|/gm,"");else if(!(m=block.match(no_leading_pipe)))return;var table=["table",["thead",["tr"]],["tbody"]];m[2]=m[2].replace(/\|\s*$/,"").split("|");var html_attrs=[];for(forEach(m[2],(function(s){s.match(/^\s*-+:\s*$/)?html_attrs.push({align:"right"}):s.match(/^\s*:-+\s*$/)?html_attrs.push({align:"left"}):s.match(/^\s*:-+:\s*$/)?html_attrs.push({align:"center"}):html_attrs.push({})})),m[1]=_split_on_unescaped(m[1].replace(/\|\s*$/,""),"|"),i=0;i<m[1].length;i++)table[1][1].push(["th",html_attrs[i]||{}].concat(this.processInline(m[1][i].trim())));return forEach(m[3].replace(/\|\s*$/gm,"").split("\n"),(function(row){var html_row=["tr"];for(row=_split_on_unescaped(row,"|"),i=0;i<row.length;i++)html_row.push(["td",html_attrs[i]||{}].concat(this.processInline(row[i].trim())));table[2].push(html_row)}),this),[table]},Markdown.dialects.Maruku.inline["{:"]=function inline_meta(text,matches,out){if(!out.length)return[2,"{:"];var before=out[out.length-1];if("string"==typeof before)return[2,"{:"];var m=text.match(/^\{:\s*((?:\\\}|[^\}])*)\s*\}/);if(!m)return[2,"{:"];var meta=this.dialect.processMetaHash(m[1]),attr=extract_attr(before);for(var k in attr||(attr={},before.splice(1,0,attr)),meta)attr[k]=meta[k];return[m[0].length,""]},Markdown.dialects.Maruku.inline.__escape__=/^\\[\\`\*_{}\[\]()#\+.!\-|:]/,Markdown.buildBlockOrder(Markdown.dialects.Maruku.block),Markdown.buildInlinePatterns(Markdown.dialects.Maruku.inline);var isArray=Array.isArray||function(obj){return"[object Array]"==Object.prototype.toString.call(obj)},forEach;forEach=Array.prototype.forEach?function(arr,cb,thisp){return arr.forEach(cb,thisp)}:function(arr,cb,thisp){for(var i=0;i<arr.length;i++)cb.call(thisp||arr,arr[i],i,arr)};var isEmpty=function(obj){for(var key in obj)if(hasOwnProperty.call(obj,key))return!1;return!0};function extract_attr(jsonml){return isArray(jsonml)&&jsonml.length>1&&"object"==typeof jsonml[1]&&!isArray(jsonml[1])?jsonml[1]:void 0}function escapeHTML(text){return text.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function render_tree(jsonml){if("string"==typeof jsonml)return escapeHTML(jsonml);var tag=jsonml.shift(),attributes={},content=[];for(!jsonml.length||"object"!=typeof jsonml[0]||jsonml[0]instanceof Array||(attributes=jsonml.shift());jsonml.length;)content.push(render_tree(jsonml.shift()));var tag_attrs="";for(var a in attributes)tag_attrs+=" "+a+'="'+escapeHTML(attributes[a])+'"';return"img"==tag||"br"==tag||"hr"==tag?"<"+tag+tag_attrs+"/>":"<"+tag+tag_attrs+">"+content.join("")+"</"+tag+">"}function convert_tree_to_html(tree,references,options){var i;options=options||{};var jsonml=tree.slice(0);"function"==typeof options.preprocessTreeNode&&(jsonml=options.preprocessTreeNode(jsonml,references));var attrs=extract_attr(jsonml);if(attrs){for(i in jsonml[1]={},attrs)jsonml[1][i]=attrs[i];attrs=jsonml[1]}if("string"==typeof jsonml)return jsonml;switch(jsonml[0]){case"header":jsonml[0]="h"+jsonml[1].level,delete jsonml[1].level;break;case"bulletlist":jsonml[0]="ul";break;case"numberlist":jsonml[0]="ol";break;case"listitem":jsonml[0]="li";break;case"para":jsonml[0]="p";break;case"markdown":jsonml[0]="html",attrs&&delete attrs.references;break;case"code_block":jsonml[0]="pre",i=attrs?2:1;var code=["code"];code.push.apply(code,jsonml.splice(i,jsonml.length-i)),jsonml[i]=code;break;case"inlinecode":jsonml[0]="code";break;case"img":jsonml[1].src=jsonml[1].href,delete jsonml[1].href;break;case"linebreak":jsonml[0]="br";break;case"link":jsonml[0]="a";break;case"link_ref":var ref;if(jsonml[0]="a",!(ref=references[attrs.ref]))return attrs.original;delete attrs.ref,attrs.href=ref.href,ref.title&&(attrs.title=ref.title),delete attrs.original;break;case"img_ref":var ref;if(jsonml[0]="img",!(ref=references[attrs.ref]))return attrs.original;delete attrs.ref,attrs.src=ref.href,ref.title&&(attrs.title=ref.title),delete attrs.original}if(i=1,attrs){for(var key in jsonml[1]){i=2;break}1===i&&jsonml.splice(i,1)}for(;i<jsonml.length;++i)jsonml[i]=convert_tree_to_html(jsonml[i],references,options);return jsonml}function merge_text_nodes(jsonml){for(var i=extract_attr(jsonml)?2:1;i<jsonml.length;)"string"==typeof jsonml[i]?i+1<jsonml.length&&"string"==typeof jsonml[i+1]?jsonml[i]+=jsonml.splice(i+1,1)[0]:++i:(merge_text_nodes(jsonml[i]),++i)}expose.renderJsonML=function(jsonml,options){(options=options||{}).root=options.root||!1;var content=[];if(options.root)content.push(render_tree(jsonml));else for(jsonml.shift(),!jsonml.length||"object"!=typeof jsonml[0]||jsonml[0]instanceof Array||jsonml.shift();jsonml.length;)content.push(render_tree(jsonml.shift()));return content.join("\n\n")}}("undefined"==typeof exports?(window.markdown={},window.markdown):exports),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?factory(require("jquery")):factory(jQuery)}((function($){"use strict";var Markdown=function(element,options){var opts=["autofocus","savable","hideable","width","height","resize","iconlibrary","language","footer","fullscreen","hiddenButtons","disabledButtons"];$.each(opts,(function(_,opt){void 0!==$(element).data(opt)&&((options="object"==typeof options?options:{})[opt]=$(element).data(opt))})),this.$ns="bootstrap-markdown",this.$element=$(element),this.$editable={el:null,type:null,attrKeys:[],attrValues:[],content:null},this.$options=$.extend(!0,{},$.fn.markdown.defaults,options,this.$element.data("options")),this.$oldContent=null,this.$isPreview=!1,this.$isFullscreen=!1,this.$editor=null,this.$textarea=null,this.$handler=[],this.$callback=[],this.$nextTab=[],this.showEditor()};Markdown.prototype={constructor:Markdown,__alterButtons:function(name,alter){var handler=this.$handler,isAll="all"==name,that=this;$.each(handler,(function(k,v){var halt=!0;!1===(halt=!isAll&&v.indexOf(name)<0)&&alter(that.$editor.find('button[data-handler="'+v+'"]'))}))},__buildButtons:function(buttonsArray,container){var i,ns=this.$ns,handler=this.$handler,callback=this.$callback;for(i=0;i<buttonsArray.length;i++){var y,btnGroups=buttonsArray[i];for(y=0;y<btnGroups.length;y++){var z,buttons=btnGroups[y].data,btnGroupContainer=$("<div/>",{class:"btn-group"});for(z=0;z<buttons.length;z++){var button=buttons[z],buttonContainer,buttonIconContainer,buttonHandler=ns+"-"+button.name,buttonIcon=this.__getIcon(button.icon),btnText=button.btnText?button.btnText:"",btnClass=button.btnClass?button.btnClass:"btn",tabIndex=button.tabIndex?button.tabIndex:"-1",hotkey=void 0!==button.hotkey?button.hotkey:"",hotkeyCaption=void 0!==jQuery.hotkeys&&""!==hotkey?" ("+hotkey+")":"";(buttonContainer=$("<button></button>")).text(" "+this.__localize(btnText)).addClass("btn-default btn-sm").addClass(btnClass),btnClass.match(/btn\-(primary|success|info|warning|danger|link)/)&&buttonContainer.removeClass("btn-default"),buttonContainer.attr({type:"button",title:this.__localize(button.title)+hotkeyCaption,tabindex:tabIndex,"data-provider":ns,"data-handler":buttonHandler,"data-hotkey":hotkey}),!0===button.toggle&&buttonContainer.attr("data-toggle","button"),(buttonIconContainer=$("<span/>")).addClass(buttonIcon),buttonIconContainer.prependTo(buttonContainer),btnGroupContainer.append(buttonContainer),handler.push(buttonHandler),callback.push(button.callback)}container.append(btnGroupContainer)}}return container},__setListener:function(){var hasRows=void 0!==this.$textarea.attr("rows"),maxRows=this.$textarea.val().split("\n").length>5?this.$textarea.val().split("\n").length:"5",rowsVal=hasRows?this.$textarea.attr("rows"):maxRows;this.$textarea.attr("rows",rowsVal),this.$options.resize&&this.$textarea.css("resize",this.$options.resize),this.$textarea.on({focus:$.proxy(this.focus,this),keyup:$.proxy(this.keyup,this),change:$.proxy(this.change,this),select:$.proxy(this.select,this)}),this.eventSupported("keydown")&&this.$textarea.on("keydown",$.proxy(this.keydown,this)),this.eventSupported("keypress")&&this.$textarea.on("keypress",$.proxy(this.keypress,this)),this.$textarea.data("markdown",this)},__handle:function(e){var target=$(e.currentTarget),handler=this.$handler,callback=this.$callback,handlerName=target.attr("data-handler"),callbackIndex,callbackHandler=callback[handler.indexOf(handlerName)];$(e.currentTarget).focus(),callbackHandler(this),this.change(this),handlerName.indexOf("cmdSave")<0&&this.$textarea.focus(),e.preventDefault()},__localize:function(string){var messages=$.fn.markdown.messages,language=this.$options.language;return void 0!==messages&&void 0!==messages[language]&&void 0!==messages[language][string]?messages[language][string]:string},__getIcon:function(src){return"object"==typeof src?src[this.$options.iconlibrary]:src},setFullscreen:function(mode){var $editor=this.$editor,$textarea=this.$textarea;!0===mode?($editor.addClass("md-fullscreen-mode"),$("body").addClass("md-nooverflow"),this.$options.onFullscreen(this)):($editor.removeClass("md-fullscreen-mode"),$("body").removeClass("md-nooverflow"),1==this.$isPreview&&this.hidePreview().showPreview()),this.$isFullscreen=mode,$textarea.focus()},showEditor:function(){var instance=this,textarea,ns=this.$ns,container=this.$element,originalHeigth=container.css("height"),originalWidth=container.css("width"),editable=this.$editable,handler=this.$handler,callback=this.$callback,options=this.$options,editor=$("<div/>",{class:"md-editor",click:function(){instance.focus()}});if(null===this.$editor){var editorHeader=$("<div/>",{class:"md-header btn-toolbar"}),allBtnGroups=[];if(options.buttons.length>0&&(allBtnGroups=allBtnGroups.concat(options.buttons[0])),options.additionalButtons.length>0&&$.each(options.additionalButtons[0],(function(idx,buttonGroup){var matchingGroups=$.grep(allBtnGroups,(function(allButtonGroup,allIdx){return allButtonGroup.name===buttonGroup.name}));matchingGroups.length>0?matchingGroups[0].data=matchingGroups[0].data.concat(buttonGroup.data):allBtnGroups.push(options.additionalButtons[0][idx])})),options.reorderButtonGroups.length>0&&(allBtnGroups=allBtnGroups.filter((function(btnGroup){return options.reorderButtonGroups.indexOf(btnGroup.name)>-1})).sort((function(a,b){return options.reorderButtonGroups.indexOf(a.name)<options.reorderButtonGroups.indexOf(b.name)?-1:options.reorderButtonGroups.indexOf(a.name)>options.reorderButtonGroups.indexOf(b.name)?1:0}))),allBtnGroups.length>0&&(editorHeader=this.__buildButtons([allBtnGroups],editorHeader)),options.fullscreen.enable&&editorHeader.append('<div class="md-controls"><a class="md-control md-control-fullscreen" href="#"><span class="'+this.__getIcon(options.fullscreen.icons.fullscreenOn)+'"></span></a></div>').on("click",".md-control-fullscreen",(function(e){e.preventDefault(),instance.setFullscreen(!0)})),editor.append(editorHeader),container.is("textarea"))container.before(editor),(textarea=container).addClass("md-input"),editor.append(textarea);else{var rawContent="function"==typeof toMarkdown?toMarkdown(container.html()):container.html(),currentContent=$.trim(rawContent);textarea=$("<textarea/>",{class:"md-input",val:currentContent}),editor.append(textarea),editable.el=container,editable.type=container.prop("tagName").toLowerCase(),editable.content=container.html(),$(container[0].attributes).each((function(){editable.attrKeys.push(this.nodeName),editable.attrValues.push(this.nodeValue)})),container.replaceWith(editor)}var editorFooter=$("<div/>",{class:"md-footer"}),createFooter=!1,footer="";if(options.savable){createFooter=!0;var saveHandler="cmdSave";handler.push("cmdSave"),callback.push(options.onSave),editorFooter.append('<button class="btn btn-success" data-provider="'+ns+'" data-handler="cmdSave"><i class="icon icon-white icon-ok"></i> '+this.__localize("Save")+"</button>")}if(footer="function"==typeof options.footer?options.footer(this):options.footer,""!==$.trim(footer)&&(createFooter=!0,editorFooter.append(footer)),createFooter&&editor.append(editorFooter),options.width&&"inherit"!==options.width&&(jQuery.isNumeric(options.width)?(editor.css("display","table"),textarea.css("width",options.width+"px")):editor.addClass(options.width)),options.height&&"inherit"!==options.height)if(jQuery.isNumeric(options.height)){var height=options.height;editorHeader&&(height=Math.max(0,height-editorHeader.outerHeight())),editorFooter&&(height=Math.max(0,height-editorFooter.outerHeight())),textarea.css("height",height+"px")}else editor.addClass(options.height);this.$editor=editor,this.$textarea=textarea,this.$editable=editable,this.$oldContent=this.getContent(),this.__setListener(),this.$editor.attr("id",(new Date).getTime()),this.$editor.on("click",'[data-provider="bootstrap-markdown"]',$.proxy(this.__handle,this)),(this.$element.is(":disabled")||this.$element.is("[readonly]"))&&(this.$editor.addClass("md-editor-disabled"),this.disableButtons("all")),this.eventSupported("keydown")&&"object"==typeof jQuery.hotkeys&&editorHeader.find('[data-provider="bootstrap-markdown"]').each((function(){var $button=$(this),hotkey=$button.attr("data-hotkey");""!==hotkey.toLowerCase()&&textarea.bind("keydown",hotkey,(function(){return $button.trigger("click"),!1}))})),"preview"===options.initialstate?this.showPreview():"fullscreen"===options.initialstate&&options.fullscreen.enable&&this.setFullscreen(!0)}else this.$editor.show();return options.autofocus&&(this.$textarea.focus(),this.$editor.addClass("active")),options.fullscreen.enable&&!1!==options.fullscreen&&(this.$editor.append('<div class="md-fullscreen-controls"><a href="#" class="exit-fullscreen" title="Exit fullscreen"><span class="'+this.__getIcon(options.fullscreen.icons.fullscreenOff)+'"></span></a></div>'),this.$editor.on("click",".exit-fullscreen",(function(e){e.preventDefault(),instance.setFullscreen(!1)}))),this.hideButtons(options.hiddenButtons),this.disableButtons(options.disabledButtons),options.onShow(this),this},parseContent:function(val){var content,val=val||this.$textarea.val();return content=this.$options.parser?this.$options.parser(val):"object"==typeof markdown?markdown.toHTML(val):"function"==typeof marked?marked(val):val},showPreview:function(){var options=this.$options,container=this.$textarea,afterContainer=container.next(),replacementContainer=$("<div/>",{class:"md-preview","data-provider":"markdown-preview"}),content,callbackContent;return 1==this.$isPreview?this:(this.$isPreview=!0,this.disableButtons("all").enableButtons("cmdPreview"),content="string"==typeof(callbackContent=options.onPreview(this))?callbackContent:this.parseContent(),replacementContainer.html(content),afterContainer&&"md-footer"==afterContainer.attr("class")?replacementContainer.insertBefore(afterContainer):container.parent().append(replacementContainer),replacementContainer.css({width:container.outerWidth()+"px",height:container.outerHeight()+"px"}),this.$options.resize&&replacementContainer.css("resize",this.$options.resize),container.hide(),replacementContainer.data("markdown",this),(this.$element.is(":disabled")||this.$element.is("[readonly]"))&&(this.$editor.addClass("md-editor-disabled"),this.disableButtons("all")),this)},hidePreview:function(){var container;return this.$isPreview=!1,this.$editor.find('div[data-provider="markdown-preview"]').remove(),this.enableButtons("all"),this.disableButtons(this.$options.disabledButtons),this.$textarea.show(),this.__setListener(),this},isDirty:function(){return this.$oldContent!=this.getContent()},getContent:function(){return this.$textarea.val()},setContent:function(content){return this.$textarea.val(content),this},findSelection:function(chunk){var content,startChunkPosition;if((startChunkPosition=this.getContent().indexOf(chunk))>=0&&chunk.length>0){var oldSelection=this.getSelection(),selection;return this.setSelection(startChunkPosition,startChunkPosition+chunk.length),selection=this.getSelection(),this.setSelection(oldSelection.start,oldSelection.end),selection}return null},getSelection:function(){var e=this.$textarea[0];return("selectionStart"in e&&function(){var l=e.selectionEnd-e.selectionStart;return{start:e.selectionStart,end:e.selectionEnd,length:l,text:e.value.substr(e.selectionStart,l)}}||function(){return null})()},setSelection:function(start,end){var e=this.$textarea[0];return("selectionStart"in e&&function(){e.selectionStart=start,e.selectionEnd=end}||function(){return null})()},replaceSelection:function(text){var e=this.$textarea[0];return("selectionStart"in e&&function(){return e.value=e.value.substr(0,e.selectionStart)+text+e.value.substr(e.selectionEnd,e.value.length),e.selectionStart=e.value.length,this}||function(){return e.value+=text,jQuery(e)})()},getNextTab:function(){if(0===this.$nextTab.length)return null;var nextTab,tab=this.$nextTab.shift();return"function"==typeof tab?nextTab=tab():"object"==typeof tab&&tab.length>0&&(nextTab=tab),nextTab},setNextTab:function(start,end){if("string"==typeof start){var that=this;this.$nextTab.push((function(){return that.findSelection(start)}))}else if("number"==typeof start&&"number"==typeof end){var oldSelection=this.getSelection();this.setSelection(start,end),this.$nextTab.push(this.getSelection()),this.setSelection(oldSelection.start,oldSelection.end)}},__parseButtonNameParam:function(names){return"string"==typeof names?names.split(" "):names},enableButtons:function(name){var buttons=this.__parseButtonNameParam(name),that=this;return $.each(buttons,(function(i,v){that.__alterButtons(buttons[i],(function(el){el.removeAttr("disabled")}))})),this},disableButtons:function(name){var buttons=this.__parseButtonNameParam(name),that=this;return $.each(buttons,(function(i,v){that.__alterButtons(buttons[i],(function(el){el.attr("disabled","disabled")}))})),this},hideButtons:function(name){var buttons=this.__parseButtonNameParam(name),that=this;return $.each(buttons,(function(i,v){that.__alterButtons(buttons[i],(function(el){el.addClass("hidden")}))})),this},showButtons:function(name){var buttons=this.__parseButtonNameParam(name),that=this;return $.each(buttons,(function(i,v){that.__alterButtons(buttons[i],(function(el){el.removeClass("hidden")}))})),this},eventSupported:function(eventName){var isSupported=eventName in this.$element;return isSupported||(this.$element.setAttribute(eventName,"return;"),isSupported="function"==typeof this.$element[eventName]),isSupported},keyup:function(e){var blocked=!1;switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:var nextTab;if(null!==(nextTab=this.getNextTab())){var that=this;setTimeout((function(){that.setSelection(nextTab.start,nextTab.end)}),500),blocked=!0}else{var cursor=this.getSelection();cursor.start==cursor.end&&cursor.end==this.getContent().length?blocked=!1:(this.setSelection(this.getContent().length,this.getContent().length),blocked=!0)}break;case 13:blocked=!1;break;case 27:this.$isFullscreen&&this.setFullscreen(!1),blocked=!1;break;default:blocked=!1}blocked&&(e.stopPropagation(),e.preventDefault()),this.$options.onChange(this)},change:function(e){return this.$options.onChange(this),this},select:function(e){return this.$options.onSelect(this),this},focus:function(e){var options=this.$options,isHideable=options.hideable,editor=this.$editor;return editor.addClass("active"),$(document).find(".md-editor").each((function(){var attachedMarkdown;$(this).attr("id")!==editor.attr("id")&&(null===(attachedMarkdown=$(this).find("textarea").data("markdown"))&&(attachedMarkdown=$(this).find('div[data-provider="markdown-preview"]').data("markdown")),attachedMarkdown&&attachedMarkdown.blur())})),options.onFocus(this),this},blur:function(e){var options=this.$options,isHideable=options.hideable,editor=this.$editor,editable=this.$editable;if(editor.hasClass("active")||0===this.$element.parent().length){if(editor.removeClass("active"),isHideable)if(null!==editable.el){var oldElement=$("<"+editable.type+"/>"),content=this.getContent(),currentContent=this.parseContent(content);$(editable.attrKeys).each((function(k,v){oldElement.attr(editable.attrKeys[k],editable.attrValues[k])})),oldElement.html(currentContent),editor.replaceWith(oldElement)}else editor.hide();options.onBlur(this)}return this}};var old=$.fn.markdown;$.fn.markdown=function(option){return this.each((function(){var $this=$(this),data=$this.data("markdown"),options="object"==typeof option&&option;data||$this.data("markdown",data=new Markdown(this,options))}))},$.fn.markdown.messages={},$.fn.markdown.defaults={autofocus:!1,hideable:!1,savable:!1,width:"inherit",height:"inherit",resize:"none",iconlibrary:"glyph",language:"en",initialstate:"editor",parser:null,buttons:[[{name:"groupFont",data:[{name:"cmdBold",hotkey:"Ctrl+B",title:"Bold",icon:{glyph:"glyphicon glyphicon-bold",fa:"fa fa-bold","fa-3":"icon-bold"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent();chunk=0===selected.length?e.__localize("strong text"):selected.text,"**"===content.substr(selected.start-2,2)&&"**"===content.substr(selected.end,2)?(e.setSelection(selected.start-2,selected.end+2),e.replaceSelection(chunk),cursor=selected.start-2):(e.replaceSelection("**"+chunk+"**"),cursor=selected.start+2),e.setSelection(cursor,cursor+chunk.length)}},{name:"cmdItalic",title:"Italic",hotkey:"Ctrl+I",icon:{glyph:"glyphicon glyphicon-italic",fa:"fa fa-italic","fa-3":"icon-italic"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent();chunk=0===selected.length?e.__localize("emphasized text"):selected.text,"_"===content.substr(selected.start-1,1)&&"_"===content.substr(selected.end,1)?(e.setSelection(selected.start-1,selected.end+1),e.replaceSelection(chunk),cursor=selected.start-1):(e.replaceSelection("_"+chunk+"_"),cursor=selected.start+1),e.setSelection(cursor,cursor+chunk.length)}},{name:"cmdHeading",title:"Heading",hotkey:"Ctrl+H",icon:{glyph:"glyphicon glyphicon-header",fa:"fa fa-header","fa-3":"icon-font"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent(),pointer,prevChar;chunk=0===selected.length?e.__localize("heading text"):selected.text+"\n",pointer=4,"### "===content.substr(selected.start-pointer,pointer)||(pointer=3,"###"===content.substr(selected.start-pointer,pointer))?(e.setSelection(selected.start-pointer,selected.end),e.replaceSelection(chunk),cursor=selected.start-pointer):selected.start>0&&((prevChar=content.substr(selected.start-1,1))&&"\n"!=prevChar)?(e.replaceSelection("\n\n### "+chunk),cursor=selected.start+6):(e.replaceSelection("### "+chunk),cursor=selected.start+4),e.setSelection(cursor,cursor+chunk.length)}}]},{name:"groupLink",data:[{name:"cmdUrl",title:"URL/Link",hotkey:"Ctrl+L",icon:{glyph:"glyphicon glyphicon-link",fa:"fa fa-link","fa-3":"icon-link"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent(),link;chunk=0===selected.length?e.__localize("enter link description here"):selected.text,link=prompt(e.__localize("Insert Hyperlink"),"http://");var urlRegex=new RegExp("^((http|https)://|(mailto:)|(//))[a-z0-9]","i");if(null!==link&&""!==link&&"http://"!==link&&urlRegex.test(link)){var sanitizedLink=$("<div>"+link+"</div>").text();e.replaceSelection("["+chunk+"]("+sanitizedLink+")"),cursor=selected.start+1,e.setSelection(cursor,cursor+chunk.length)}}},{name:"cmdImage",title:"Image",hotkey:"Ctrl+G",icon:{glyph:"glyphicon glyphicon-picture",fa:"fa fa-picture-o","fa-3":"icon-picture"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent(),link;chunk=0===selected.length?e.__localize("enter image description here"):selected.text,link=prompt(e.__localize("Insert Image Hyperlink"),"http://");var urlRegex=new RegExp("^((http|https)://|(//))[a-z0-9]","i");if(null!==link&&""!==link&&"http://"!==link&&urlRegex.test(link)){var sanitizedLink=$("<div>"+link+"</div>").text();e.replaceSelection("!["+chunk+"]("+sanitizedLink+' "'+e.__localize("enter image title here")+'")'),cursor=selected.start+2,e.setNextTab(e.__localize("enter image title here")),e.setSelection(cursor,cursor+chunk.length)}}}]},{name:"groupMisc",data:[{name:"cmdList",hotkey:"Ctrl+U",title:"Unordered List",icon:{glyph:"glyphicon glyphicon-list",fa:"fa fa-list","fa-3":"icon-list-ul"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent();if(0===selected.length)chunk=e.__localize("list text here"),e.replaceSelection("- "+chunk),cursor=selected.start+2;else if(selected.text.indexOf("\n")<0)chunk=selected.text,e.replaceSelection("- "+chunk),cursor=selected.start+2;else{var list=[];chunk=(list=selected.text.split("\n"))[0],$.each(list,(function(k,v){list[k]="- "+v})),e.replaceSelection("\n\n"+list.join("\n")),cursor=selected.start+4}e.setSelection(cursor,cursor+chunk.length)}},{name:"cmdListO",hotkey:"Ctrl+O",title:"Ordered List",icon:{glyph:"glyphicon glyphicon-th-list",fa:"fa fa-list-ol","fa-3":"icon-list-ol"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent();if(0===selected.length)chunk=e.__localize("list text here"),e.replaceSelection("1. "+chunk),cursor=selected.start+3;else if(selected.text.indexOf("\n")<0)chunk=selected.text,e.replaceSelection("1. "+chunk),cursor=selected.start+3;else{var list=[];chunk=(list=selected.text.split("\n"))[0],$.each(list,(function(k,v){list[k]="1. "+v})),e.replaceSelection("\n\n"+list.join("\n")),cursor=selected.start+5}e.setSelection(cursor,cursor+chunk.length)}},{name:"cmdCode",hotkey:"Ctrl+K",title:"Code",icon:{glyph:"glyphicon glyphicon-asterisk",fa:"fa fa-code","fa-3":"icon-code"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent();chunk=0===selected.length?e.__localize("code text here"):selected.text,"```\n"===content.substr(selected.start-4,4)&&"\n```"===content.substr(selected.end,4)?(e.setSelection(selected.start-4,selected.end+4),e.replaceSelection(chunk),cursor=selected.start-4):"`"===content.substr(selected.start-1,1)&&"`"===content.substr(selected.end,1)?(e.setSelection(selected.start-1,selected.end+1),e.replaceSelection(chunk),cursor=selected.start-1):content.indexOf("\n")>-1?(e.replaceSelection("```\n"+chunk+"\n```"),cursor=selected.start+4):(e.replaceSelection("`"+chunk+"`"),cursor=selected.start+1),e.setSelection(cursor,cursor+chunk.length)}},{name:"cmdQuote",hotkey:"Ctrl+Q",title:"Quote",icon:{glyph:"glyphicon glyphicon-comment",fa:"fa fa-quote-left","fa-3":"icon-quote-left"},callback:function(e){var chunk,cursor,selected=e.getSelection(),content=e.getContent();if(0===selected.length)chunk=e.__localize("quote here"),e.replaceSelection("> "+chunk),cursor=selected.start+2;else if(selected.text.indexOf("\n")<0)chunk=selected.text,e.replaceSelection("> "+chunk),cursor=selected.start+2;else{var list=[];chunk=(list=selected.text.split("\n"))[0],$.each(list,(function(k,v){list[k]="> "+v})),e.replaceSelection("\n\n"+list.join("\n")),cursor=selected.start+4}e.setSelection(cursor,cursor+chunk.length)}}]},{name:"groupUtil",data:[{name:"cmdPreview",toggle:!0,hotkey:"Ctrl+P",title:"Preview",btnText:"Preview",btnClass:"btn btn-primary btn-sm",icon:{glyph:"glyphicon glyphicon-search",fa:"fa fa-search","fa-3":"icon-search"},callback:function(e){var isPreview,content;!1===e.$isPreview?e.showPreview():e.hidePreview()}}]}]],additionalButtons:[],reorderButtonGroups:[],hiddenButtons:[],disabledButtons:[],footer:"",fullscreen:{enable:!0,icons:{fullscreenOn:{fa:"fa fa-expand",glyph:"glyphicon glyphicon-fullscreen","fa-3":"icon-resize-full"},fullscreenOff:{fa:"fa fa-compress",glyph:"glyphicon glyphicon-fullscreen","fa-3":"icon-resize-small"}}},onShow:function(e){},onPreview:function(e){},onSave:function(e){},onBlur:function(e){},onFocus:function(e){},onChange:function(e){},onFullscreen:function(e){},onSelect:function(e){}},$.fn.markdown.Constructor=Markdown,$.fn.markdown.noConflict=function(){return $.fn.markdown=old,this};var initMarkdown=function(el){var $this=el;$this.data("markdown")?$this.data("markdown").showEditor():$this.markdown()},blurNonFocused=function(e){var $activeElement=$(document.activeElement);$(document).find(".md-editor").each((function(){var $this=$(this),focused=$activeElement.closest(".md-editor")[0]===this,attachedMarkdown=$this.find("textarea").data("markdown")||$this.find('div[data-provider="markdown-preview"]').data("markdown");attachedMarkdown&&!focused&&attachedMarkdown.blur()}))};$(document).on("click.markdown.data-api",'[data-provide="markdown-editable"]',(function(e){initMarkdown($(this)),e.preventDefault()})).on("click focusin",(function(e){blurNonFocused(e)})).ready((function(){$('textarea[data-provide="markdown"]').each((function(){initMarkdown($(this))}))}))})),$.fn.markdown.defaults.iconlibrary="fa",$.fn.markdown.defaults.buttons[0][0].data[2].icon.fa="fa fa-heading",$.fn.markdown.defaults.buttons[0][1].data[1].icon.fa="fa fa-image",$.fn.markdown.defaults.buttons[0][2].data[1].icon.fa="fa fa-list-ol",function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}((function(a){function b(b,d,e){var d={content:{message:"object"==typeof d?d.message:d,title:d.title?d.title:"",icon:d.icon?d.icon:"",url:d.url?d.url:"#",target:d.target?d.target:"-"}};e=a.extend(!0,{},d,e),this.settings=a.extend(!0,{},c,e),this._defaults=c,"-"==this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),this.init()}var c={element:"body",position:null,type:"info",allow_dismiss:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:'<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'};String.format=function(){for(var a=arguments[0],b=1;b<arguments.length;b++)a=a.replace(RegExp("\\{"+(b-1)+"\\}","gm"),arguments[b]);return a},a.extend(b.prototype,{init:function(){var a=this;this.buildNotify(),this.settings.content.icon&&this.setIcon(),"#"!=this.settings.content.url&&this.styleURL(),this.styleDismiss(),this.placement(),this.bind(),this.notify={$ele:this.$ele,update:function(b,c){var d={};for(var b in"string"==typeof b?d[b]=c:d=b,d)switch(b){case"type":this.$ele.removeClass("alert-"+a.settings.type),this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass("progress-bar-"+a.settings.type),a.settings.type=d[b],this.$ele.addClass("alert-"+d[b]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+d[b]);break;case"icon":var e=this.$ele.find('[data-notify="icon"]');"class"==a.settings.icon_type.toLowerCase()?e.removeClass(a.settings.content.icon).addClass(d[b]):(e.is("img")||e.find("img"),e.attr("src",d[b]));break;case"progress":var f=a.settings.delay-a.settings.delay*(d[b]/100);this.$ele.data("notify-delay",f),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",d[b]).css("width",d[b]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",d[b]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",d[b]);break;default:this.$ele.find('[data-notify="'+b+'"]').html(d[b])}var g=this.$ele.outerHeight()+parseInt(a.settings.spacing)+parseInt(a.settings.offset.y);a.reposition(g)},close:function(){a.close()}}},buildNotify:function(){var b=this.settings.content;this.$ele=a(String.format(this.settings.template,this.settings.type,b.title,b.message,b.url,b.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"==this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('<img src="'+this.settings.content.icon+'" alt="Notify Icon" />')},styleDismiss:function(){this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:"0px",position:"absolute",top:"0px",width:"100%",zIndex:this.settings.z_index+1})},placement:function(){var b=this,c=this.settings.offset.y,d={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},e=!1,f=this.settings;switch(a('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each((function(){return c=Math.max(c,parseInt(a(this).css(f.placement.from))+parseInt(a(this).outerHeight())+parseInt(f.spacing))})),1==this.settings.newest_on_top&&(c=this.settings.offset.y),d[this.settings.placement.from]=c+"px",this.settings.placement.align){case"left":case"right":d[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":d.left=0,d.right=0}this.$ele.css(d).addClass(this.settings.animate.enter),a.each(Array("webkit","moz","o","ms",""),(function(a,c){b.$ele[0].style[c+"AnimationIterationCount"]=1})),a(this.settings.element).append(this.$ele),1==this.settings.newest_on_top&&(c=parseInt(c)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(c)),a.isFunction(b.settings.onShow)&&b.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,(function(a){e=!0})).one(this.animations.end,(function(c){a.isFunction(b.settings.onShown)&&b.settings.onShown.call(this)})),setTimeout((function(){e||a.isFunction(b.settings.onShown)&&b.settings.onShown.call(this)}),600)},bind:function(){var b=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",(function(){b.close()})),this.$ele.mouseover((function(b){a(this).data("data-hover","true")})).mouseout((function(b){a(this).data("data-hover","false")})),this.$ele.data("data-hover","false"),this.settings.delay>0){b.$ele.data("notify-delay",b.settings.delay);var c=setInterval((function(){var a=parseInt(b.$ele.data("notify-delay"))-b.settings.timer;if("false"===b.$ele.data("data-hover")&&"pause"==b.settings.mouse_over||"pause"!=b.settings.mouse_over){var d=(b.settings.delay-a)/b.settings.delay*100;b.$ele.data("notify-delay",a),b.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",d).css("width",d+"%")}a<=-b.settings.timer&&(clearInterval(c),b.close())}),b.settings.timer)}},close:function(){var b=this,c=parseInt(this.$ele.css(this.settings.placement.from)),d=!1;this.$ele.data("closing","true").addClass(this.settings.animate.exit),b.reposition(c),a.isFunction(b.settings.onClose)&&b.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,(function(a){d=!0})).one(this.animations.end,(function(c){a(this).remove(),a.isFunction(b.settings.onClosed)&&b.settings.onClosed.call(this)})),setTimeout((function(){d||(b.$ele.remove(),b.settings.onClosed&&b.settings.onClosed(b.$ele))}),600)},reposition:function(b){var c=this,d='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',e=this.$ele.nextAll(d);1==this.settings.newest_on_top&&(e=this.$ele.prevAll(d)),e.each((function(){a(this).css(c.settings.placement.from,b),b=parseInt(b)+parseInt(c.settings.spacing)+a(this).outerHeight()}))}}),a.notify=function(a,c){var d;return new b(this,a,c).notify},a.notifyDefaults=function(b){return c=a.extend(!0,{},c,b)},a.notifyClose=function(b){void 0===b||"all"==b?a("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):a('[data-notify-position="'+b+'"]').find('[data-notify="dismiss"]').trigger("click")}})),$.notifyDefaults({template:'<div data-notify="container" class="alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss"></button><span data-notify="icon"></span><span data-notify="title">{1}</span><span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-animated bg-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'}),function(e){e(["jquery"],(function(e){return function(){function t(e,t,n){return g({type:O.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=m()),(v=e("#"+t.containerId)).length?v:(n&&(v=d(t)),v)}function o(e,t,n){return g({type:O.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function s(e){C=e}function i(e,t,n){return g({type:O.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return g({type:O.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e,t){var o=m();v||n(o),u(e,o,t)||l(o)}function c(t){var o=m();return v||n(o),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function l(t){for(var n=v.children(),o=n.length-1;o>=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length||(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),0))}function d(t){return(v=e("<div/>").attr("id",t.containerId).addClass(t.positionClass)).appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">×</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click((function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)})),E.onclick&&I.click((function(e){E.onclick(e),b()}))}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&!1!==E.closeMethod?E.closeMethod:E.hideMethod,o=t&&!1!==E.closeDuration?E.closeDuration:E.hideDuration,s=t&&!1!==E.closeEasing?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if(void 0!==t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("<div/>"),M=e("<div/>"),B=e("<div/>"),q=e("<div/>"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">×</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.4",warning:a};return b}()}))}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}),function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,(function(){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,i,s){return i&&t(e.prototype,i),s&&t(e,s),e}}(),a="dual-listbox",l="dual-listbox__container",o="dual-listbox__available",d="dual-listbox__selected",u="dual-listbox__title",c="dual-listbox__item",r="dual-listbox__buttons",h="dual-listbox__button",v="dual-listbox__search",f="dual-listbox__item--selected",b=function(){function t(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.setDefaults(),this.selected=[],this.available=[],t.isDomElement(e)?this.select=e:this.select=document.querySelector(e),this._initOptions(s),this._initReusableElements(),this._splitOptions(this.select.options),void 0!==s.options&&this._splitOptions(s.options),this._buildDualListbox(this.select.parentNode),this._addActions(),this.redraw()}return n(t,[{key:"setDefaults",value:function(){this.addEvent=null,this.removeEvent=null,this.availableTitle="Available options",this.selectedTitle="Selected options",this.addButtonText="add",this.removeButtonText="remove",this.addAllButtonText="add all",this.removeAllButtonText="remove all",this.searchPlaceholder="Search"}},{key:"addEventListener",value:function(t,e){this.dualListbox.addEventListener(t,e)}},{key:"addSelected",value:function(t){var e=this,i=this.available.indexOf(t);i>-1&&(this.available.splice(i,1),this.selected.push(t),this._selectOption(t.dataset.id),this.redraw(),setTimeout((function(){var i=document.createEvent("HTMLEvents");i.initEvent("added",!1,!0),i.addedElement=t,e.dualListbox.dispatchEvent(i)}),0))}},{key:"redraw",value:function(){this.updateAvailableListbox(),this.updateSelectedListbox()}},{key:"removeSelected",value:function(t){var e=this,i=this.selected.indexOf(t);i>-1&&(this.selected.splice(i,1),this.available.push(t),this._deselectOption(t.dataset.id),this.redraw(),setTimeout((function(){var i=document.createEvent("HTMLEvents");i.initEvent("removed",!1,!0),i.removedElement=t,e.dualListbox.dispatchEvent(i)}),0))}},{key:"searchLists",value:function(t,e){for(var i=e.querySelectorAll("."+c),s=t.toLowerCase(),n=0;n<i.length;n++){var a=i[n];-1===a.textContent.toLowerCase().indexOf(s)?a.style.display="none":a.style.display="list-item"}}},{key:"updateAvailableListbox",value:function(){this._updateListbox(this.availableList,this.available)}},{key:"updateSelectedListbox",value:function(){this._updateListbox(this.selectedList,this.selected)}},{key:"_actionAllSelected",value:function(t){var e=this;t.preventDefault(),this.available.filter((function(t){return"none"!==t.style.display})).forEach((function(t){return e.addSelected(t)}))}},{key:"_updateListbox",value:function(t,e){for(;t.firstChild;)t.removeChild(t.firstChild);for(var i=0;i<e.length;i++){var s=e[i];t.appendChild(s)}}},{key:"_actionItemSelected",value:function(t){t.preventDefault();var e=this.dualListbox.querySelector("."+f);e&&this.addSelected(e)}},{key:"_actionAllDeselected",value:function(t){var e=this;t.preventDefault(),this.selected.filter((function(t){return"none"!==t.style.display})).forEach((function(t){return e.removeSelected(t)}))}},{key:"_actionItemDeselected",value:function(t){t.preventDefault();var e=this.dualListbox.querySelector("."+f);e&&this.removeSelected(e)}},{key:"_actionItemDoubleClick",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e&&(e.preventDefault(),e.stopPropagation()),this.selected.indexOf(t)>-1?this.removeSelected(t):this.addSelected(t)}},{key:"_actionItemClick",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i&&i.preventDefault();for(var s=e.querySelectorAll("."+c),n=0;n<s.length;n++){var a=s[n];a!==t&&a.classList.remove(f)}t.classList.contains(f)?t.classList.remove(f):t.classList.add(f)}},{key:"_addActions",value:function(){this._addButtonActions(),this._addSearchActions()}},{key:"_addButtonActions",value:function(){var t=this;this.add_all_button.addEventListener("click",(function(e){return t._actionAllSelected(e)})),this.add_button.addEventListener("click",(function(e){return t._actionItemSelected(e)})),this.remove_button.addEventListener("click",(function(e){return t._actionItemDeselected(e)})),this.remove_all_button.addEventListener("click",(function(e){return t._actionAllDeselected(e)}))}},{key:"_addClickActions",value:function(t){var e=this;return t.addEventListener("dblclick",(function(i){return e._actionItemDoubleClick(t,i)})),t.addEventListener("click",(function(i){return e._actionItemClick(t,e.dualListbox,i)})),t}},{key:"_addSearchActions",value:function(){var t=this;this.search.addEventListener("change",(function(e){return t.searchLists(e.target.value,t.dualListbox)})),this.search.addEventListener("keyup",(function(e){return t.searchLists(e.target.value,t.dualListbox)}))}},{key:"_buildDualListbox",value:function(t){this.select.style.display="none",this.dualListBoxContainer.appendChild(this._createList(this.availableListTitle,this.availableList)),this.dualListBoxContainer.appendChild(this.buttons),this.dualListBoxContainer.appendChild(this._createList(this.selectedListTitle,this.selectedList)),this.dualListbox.appendChild(this.search),this.dualListbox.appendChild(this.dualListBoxContainer),t.insertBefore(this.dualListbox,this.select)}},{key:"_createList",value:function(t,e){var i=document.createElement("div");return i.appendChild(t),i.appendChild(e),i}},{key:"_createButtons",value:function(){this.buttons=document.createElement("div"),this.buttons.classList.add(r),this.add_all_button=document.createElement("button"),this.add_all_button.classList.add(h),this.add_all_button.innerHTML=this.addAllButtonText,this.add_button=document.createElement("button"),this.add_button.classList.add(h),this.add_button.innerHTML=this.addButtonText,this.remove_button=document.createElement("button"),this.remove_button.classList.add(h),this.remove_button.innerHTML=this.removeButtonText,this.remove_all_button=document.createElement("button"),this.remove_all_button.classList.add(h),this.remove_all_button.innerHTML=this.removeAllButtonText,this.buttons.appendChild(this.add_all_button),this.buttons.appendChild(this.add_button),this.buttons.appendChild(this.remove_button),this.buttons.appendChild(this.remove_all_button)}},{key:"_createListItem",value:function(t){var e=document.createElement("li");return e.classList.add(c),e.innerHTML=t.text,e.dataset.id=t.value,this._addClickActions(e),e}},{key:"_createSearch",value:function(){this.search=document.createElement("input"),this.search.classList.add(v),this.search.placeholder=this.searchPlaceholder}},{key:"_deselectOption",value:function(t){for(var e=this.select.options,i=0;i<e.length;i++){var s=e[i];s.value===t&&(s.selected=!1)}this.removeEvent&&this.removeEvent(t)}},{key:"_initOptions",value:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e])}},{key:"_initReusableElements",value:function(){this.dualListbox=document.createElement("div"),this.dualListbox.classList.add(a),this.select.id&&this.dualListbox.classList.add(this.select.id),this.dualListBoxContainer=document.createElement("div"),this.dualListBoxContainer.classList.add(l),this.availableList=document.createElement("ul"),this.availableList.classList.add(o),this.selectedList=document.createElement("ul"),this.selectedList.classList.add(d),this.availableListTitle=document.createElement("div"),this.availableListTitle.classList.add(u),this.availableListTitle.innerText=this.availableTitle,this.selectedListTitle=document.createElement("div"),this.selectedListTitle.classList.add(u),this.selectedListTitle.innerText=this.selectedTitle,this._createButtons(),this._createSearch()}},{key:"_selectOption",value:function(t){for(var e=this.select.options,i=0;i<e.length;i++){var s=e[i];s.value===t&&(s.selected=!0)}this.addEvent&&this.addEvent(t)}},{key:"_splitOptions",value:function(e){for(var i=0;i<e.length;i++){var s=e[i];t.isDomElement(s)?this._addOption({text:s.innerHTML,value:s.value,selected:s.attributes.selected}):this._addOption(s)}}},{key:"_addOption",value:function(t){var e=this._createListItem(t);t.selected?this.selected.push(e):this.available.push(e)}}],[{key:"isDomElement",value:function(t){return"object"===("undefined"==typeof HTMLElement?"undefined":s(HTMLElement))?t instanceof HTMLElement:t&&"object"===(void 0===t?"undefined":s(t))&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName}}]),t}();e.default=b,e.DualListbox=b}])})),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).ApexCharts=e()}(this,(function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function a(t,e,a){return e&&i(t.prototype,e),a&&i(t,a),t}function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function n(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var g=function(){function i(){e(this,i)}return a(i,[{key:"shadeRGBColor",value:function(t,e){var i=e.split(","),a=t<0?0:255,s=t<0?-1*t:t,r=parseInt(i[0].slice(4),10),n=parseInt(i[1],10),o=parseInt(i[2],10);return"rgb("+(Math.round((a-r)*s)+r)+","+(Math.round((a-n)*s)+n)+","+(Math.round((a-o)*s)+o)+")"}},{key:"shadeHexColor",value:function(t,e){var i=parseInt(e.slice(1),16),a=t<0?0:255,s=t<0?-1*t:t,r=i>>16,n=i>>8&255,o=255&i;return"#"+(16777216+65536*(Math.round((a-r)*s)+r)+256*(Math.round((a-n)*s)+n)+(Math.round((a-o)*s)+o)).toString(16).slice(1)}},{key:"shadeColor",value:function(t,e){return i.isColorHex(e)?this.shadeHexColor(t,e):this.shadeRGBColor(t,e)}}],[{key:"bind",value:function(t,e){return function(){return t.apply(e,arguments)}}},{key:"isObject",value:function(e){return e&&"object"===t(e)&&!Array.isArray(e)&&null!=e}},{key:"listToArray",value:function(t){var e,i=[];for(e=0;e<t.length;e++)i[e]=t[e];return i}},{key:"extend",value:function(t,e){var i=this;"function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var a=arguments[i];if(null!=a)for(var s in a)a.hasOwnProperty(s)&&(e[s]=a[s])}return e});var a=Object.assign({},t);return this.isObject(t)&&this.isObject(e)&&Object.keys(e).forEach((function(r){i.isObject(e[r])&&r in t?a[r]=i.extend(t[r],e[r]):Object.assign(a,s({},r,e[r]))})),a}},{key:"extendArray",value:function(t,e){var a=[];return t.map((function(t){a.push(i.extend(e,t))})),a}},{key:"monthMod",value:function(t){return t%12}},{key:"clone",value:function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var i=[],a=0;a<e.length;a++)i[a]=this.clone(e[a]);return i}if("[object Null]"===Object.prototype.toString.call(e))return null;if("object"===t(e)){var s={};for(var r in e)e.hasOwnProperty(r)&&(s[r]=this.clone(e[r]));return s}return e}},{key:"log10",value:function(t){return Math.log(t)/Math.LN10}},{key:"roundToBase10",value:function(t){return Math.pow(10,Math.floor(Math.log10(t)))}},{key:"roundToBase",value:function(t,e){return Math.pow(e,Math.floor(Math.log(t)/Math.log(e)))}},{key:"parseNumber",value:function(t){return null===t?t:parseFloat(t)}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(t){var e=String(t).split(/[eE]/);if(1===e.length)return e[0];var i="",a=t<0?"-":"",s=e[0].replace(".",""),r=Number(e[1])+1;if(r<0){for(i=a+"0.";r++;)i+="0";return i+s.replace(/^-/,"")}for(r-=s.length;r--;)i+="0";return s+i}},{key:"getDimensions",value:function(t){var e=getComputedStyle(t),i=[],a=t.clientHeight,s=t.clientWidth;return a-=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),s-=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),i.push(s),i.push(a),i}},{key:"getBoundingClientRect",value:function(t){var e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:t.clientWidth,height:t.clientHeight,x:e.left,y:e.top}}},{key:"getLargestStringFromArr",value:function(t){return t.reduce((function(t,e){return Array.isArray(e)&&(e=e.reduce((function(t,e){return t.length>e.length?t:e}))),t.length>e.length?t:e}),0)}},{key:"hexToRgba",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#999999",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.6;"#"!==t.substring(0,1)&&(t="#999999");var i=t.replace("#","");i=i.match(new RegExp("(.{"+i.length/3+"})","g"));for(var a=0;a<i.length;a++)i[a]=parseInt(1===i[a].length?i[a]+i[a]:i[a],16);return void 0!==e&&i.push(e),"rgba("+i.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(t){return parseFloat(t.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}},{key:"polarToCartesian",value:function(t,e,i,a){var s=(a-90)*Math.PI/180;return{x:t+i*Math.cos(s),y:e+i*Math.sin(s)}}},{key:"escapeString",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",i=t.toString().slice();return i.replace(/[` ~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]/gi,e)}},{key:"negToZero",value:function(t){return t<0?0:t}},{key:"moveIndexInArray",value:function(t,e,i){if(i>=t.length)for(var a=i-t.length+1;a--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t}},{key:"extractNumber",value:function(t){return parseFloat(t.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}},{key:"setELstyles",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style.key=e[i])}},{key:"isNumber",value:function(t){return!isNaN(t)&&parseFloat(Number(t))===t&&!isNaN(parseInt(t,10))}},{key:"isFloat",value:function(t){return Number(t)===t&&t%1!=0}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"isFirefox",value:function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}},{key:"isIE11",value:function(){if(-1!==window.navigator.userAgent.indexOf("MSIE")||window.navigator.appVersion.indexOf("Trident/")>-1)return!0}},{key:"isIE",value:function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("Trident/")>0){var i=t.indexOf("rv:");return parseInt(t.substring(i+3,t.indexOf(".",i)),10)}var a=t.indexOf("Edge/");return a>0&&parseInt(t.substring(a+5,t.indexOf(".",a)),10)}}]),i}(),u=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"getDefaultFilter",value:function(t,e){var i=this.w;t.unfilter(!0),(new window.SVG.Filter).size("120%","180%","-5%","-40%"),"none"!==i.config.states.normal.filter?this.applyFilter(t,e,i.config.states.normal.filter.type,i.config.states.normal.filter.value):i.config.chart.dropShadow.enabled&&this.dropShadow(t,i.config.chart.dropShadow,e)}},{key:"addNormalFilter",value:function(t,e){var i=this.w;i.config.chart.dropShadow.enabled&&!t.node.classList.contains("apexcharts-marker")&&this.dropShadow(t,i.config.chart.dropShadow,e)}},{key:"addLightenFilter",value:function(t,e,i){var a=this,s=this.w,r=i.intensity;g.isFirefox()||(t.unfilter(!0),new window.SVG.Filter,t.filter((function(t){var i=s.config.chart.dropShadow;(i.enabled?a.addShadow(t,e,i):t).componentTransfer({rgb:{type:"linear",slope:1.5,intercept:r}})})),t.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(t.filterer.node))}},{key:"addDarkenFilter",value:function(t,e,i){var a=this,s=this.w,r=i.intensity;g.isFirefox()||(t.unfilter(!0),new window.SVG.Filter,t.filter((function(t){var i=s.config.chart.dropShadow;(i.enabled?a.addShadow(t,e,i):t).componentTransfer({rgb:{type:"linear",slope:r}})})),t.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(t.filterer.node))}},{key:"applyFilter",value:function(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;switch(i){case"none":this.addNormalFilter(t,e);break;case"lighten":this.addLightenFilter(t,e,{intensity:a});break;case"darken":this.addDarkenFilter(t,e,{intensity:a})}}},{key:"addShadow",value:function(t,e,i){var a=i.blur,s=i.top,r=i.left,n=i.color,o=i.opacity,l=t.flood(Array.isArray(n)?n[e]:n,o).composite(t.sourceAlpha,"in").offset(r,s).gaussianBlur(a).merge(t.source);return t.blend(t.source,l)}},{key:"dropShadow",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=e.top,s=e.left,r=e.blur,n=e.color,o=e.opacity,l=e.noUserSpaceOnUse,h=this.w;return t.unfilter(!0),g.isIE()&&"radialBar"===h.config.chart.type?t:(n=Array.isArray(n)?n[i]:n,t.filter((function(t){var e=null;e=g.isSafari()||g.isFirefox()||g.isIE()?t.flood(n,o).composite(t.sourceAlpha,"in").offset(s,a).gaussianBlur(r):t.flood(n,o).composite(t.sourceAlpha,"in").offset(s,a).gaussianBlur(r).merge(t.source),t.blend(t.source,e)})),l||t.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(t.filterer.node),t)}},{key:"setSelectionFilter",value:function(t,e,i){var a=this.w;if(void 0!==a.globals.selectedDataPoints[e]&&a.globals.selectedDataPoints[e].indexOf(i)>-1){t.node.setAttribute("selected",!0);var s=a.config.states.active.filter;"none"!==s&&this.applyFilter(t,e,s.type,s.value)}}},{key:"_scaleFilterSize",value:function(t){!function(e){for(var i in e)e.hasOwnProperty(i)&&t.setAttribute(i,e[i])}({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),t}(),f=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.setEasingFunctions()}return a(t,[{key:"setEasingFunctions",value:function(){var t;if(!this.w.globals.easing){switch(this.w.config.chart.animations.easing){case"linear":t="-";break;case"easein":t="<";break;case"easeout":t=">";break;case"easeinout":t="<>";break;case"swing":t=function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1};break;case"bounce":t=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375};break;case"elastic":t=function(t){return t===!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1};break;default:t="<>"}this.w.globals.easing=t}}},{key:"animateLine",value:function(t,e,i,a){t.attr(e).animate(a).attr(i)}},{key:"animateCircleRadius",value:function(t,e,i,a,s,r){e||(e=0),t.attr({r:e}).animate(a,s).attr({r:i}).afterAll((function(){r()}))}},{key:"animateCircle",value:function(t,e,i,a,s){t.attr({r:e.r,cx:e.cx,cy:e.cy}).animate(a,s).attr({r:i.r,cx:i.cx,cy:i.cy})}},{key:"animateRect",value:function(t,e,i,a,s){t.attr(e).animate(a).attr(i).afterAll((function(){return s()}))}},{key:"animatePathsGradually",value:function(t){var e=t.el,i=t.realIndex,a=t.j,s=t.fill,r=t.pathFrom,n=t.pathTo,o=t.speed,l=t.delay,h=this.w,c=0;h.config.chart.animations.animateGradually.enabled&&(c=h.config.chart.animations.animateGradually.delay),h.config.chart.animations.dynamicAnimation.enabled&&h.globals.dataChanged&&"bar"!==h.config.chart.type&&(c=0),this.morphSVG(e,i,a,"line"!==h.config.chart.type||h.globals.comboCharts?s:"stroke",r,n,o,l*c)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach((function(t){t.el.classList.remove("apexcharts-element-hidden")}))}},{key:"animationCompleted",value:function(t){var e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}},{key:"morphSVG",value:function(t,e,i,a,s,r,n,o){var l=this,h=this.w;s||(s=t.attr("pathFrom")),r||(r=t.attr("pathTo"));var c=function(t){return"radar"===h.config.chart.type&&(n=1),"M 0 ".concat(h.globals.gridHeight)};(!s||s.indexOf("undefined")>-1||s.indexOf("NaN")>-1)&&(s=c()),(r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=c()),h.globals.shouldAnimate||(n=1),t.plot(s).animate(1,h.globals.easing,o).plot(s).animate(n,h.globals.easing,o).plot(r).afterAll((function(){g.isNumber(i)?i===h.globals.series[h.globals.maxValsInArrayIndex].length-2&&h.globals.shouldAnimate&&l.animationCompleted(t):"none"!==a&&h.globals.shouldAnimate&&(!h.globals.comboCharts&&e===h.globals.series.length-1||h.globals.comboCharts)&&l.animationCompleted(t),l.showDelayedElements()}))}}]),t}(),p=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"drawLine",value:function(t,e,i,a){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"#a8a8a8",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,n=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=this.w,l=o.globals.dom.Paper.line().attr({x1:t,y1:e,x2:i,y2:a,stroke:s,"stroke-dasharray":r,"stroke-width":n});return l}},{key:"drawRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"#fefefe",n=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,c=this.w,d=c.globals.dom.Paper.rect();return d.attr({x:t,y:e,width:i>0?i:0,height:a>0?a:0,rx:s,ry:s,opacity:n,"stroke-width":null!==o?o:0,stroke:null!==l?l:"none","stroke-dasharray":h}),d.node.setAttribute("fill",r),d}},{key:"drawPolygon",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#e1e1e1",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",s=this.w,r=s.globals.dom.Paper.polygon(t).attr({fill:a,stroke:e,"stroke-width":i});return r}},{key:"drawCircle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.w,a=i.globals.dom.Paper.circle(2*t);return null!==e&&a.attr(e),a}},{key:"drawPath",value:function(t){var e=t.d,i=void 0===e?"":e,a=t.stroke,s=void 0===a?"#a8a8a8":a,r=t.strokeWidth,n=void 0===r?1:r,o=t.fill,l=t.fillOpacity,h=void 0===l?1:l,c=t.strokeOpacity,d=void 0===c?1:c,g=t.classes,u=t.strokeLinecap,f=void 0===u?null:u,p=t.strokeDashArray,x=void 0===p?0:p,b=this.w;return null===f&&(f=b.config.stroke.lineCap),(i.indexOf("undefined")>-1||i.indexOf("NaN")>-1)&&(i="M 0 ".concat(b.globals.gridHeight)),b.globals.dom.Paper.path(i).attr({fill:o,"fill-opacity":h,stroke:s,"stroke-opacity":d,"stroke-linecap":f,"stroke-width":n,"stroke-dasharray":x,class:g})}},{key:"group",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.w,i=e.globals.dom.Paper.group();return null!==t&&i.attr(t),i}},{key:"move",value:function(t,e){var i;return["M",t,e].join(" ")}},{key:"line",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=null;return null===i?a=["L",t,e].join(" "):"H"===i?a=["H",t].join(" "):"V"===i&&(a=["V",e].join(" ")),a}},{key:"curve",value:function(t,e,i,a,s,r){var n;return["C",t,e,i,a,s,r].join(" ")}},{key:"quadraticCurve",value:function(t,e,i,a){return["Q",t,e,i,a].join(" ")}},{key:"arc",value:function(t,e,i,a,s,r,n){var o=arguments.length>7&&void 0!==arguments[7]&&arguments[7],l="A";o&&(l="a");var h=[l,t,e,i,a,s,r,n].join(" ");return h}},{key:"renderPaths",value:function(t){var e,i=t.j,a=t.realIndex,s=t.pathFrom,r=t.pathTo,o=t.stroke,l=t.strokeWidth,h=t.strokeLinecap,c=t.fill,d=t.animationDelay,g=t.initialSpeed,p=t.dataChangeSpeed,x=t.className,b=t.shouldClipToGrid,m=void 0===b||b,v=t.bindEventsOnPaths,y=void 0===v||v,w=t.drawShadow,k=void 0===w||w,A=this.w,S=new u(this.ctx),C=new f(this.ctx),L=this.w.config.chart.animations.enabled,P=L&&this.w.config.chart.animations.dynamicAnimation.enabled,T=!!(L&&!A.globals.resized||P&&A.globals.dataChanged&&A.globals.shouldAnimate);T?e=s:(e=r,A.globals.animationEnded=!0);var z=A.config.stroke.dashArray,I=0;I=Array.isArray(z)?z[a]:A.config.stroke.dashArray;var M=this.drawPath({d:e,stroke:o,strokeWidth:l,fill:c,fillOpacity:1,classes:x,strokeLinecap:h,strokeDashArray:I});if(M.attr("index",a),m&&M.attr({"clip-path":"url(#gridRectMask".concat(A.globals.cuid,")")}),"none"!==A.config.states.normal.filter.type)S.getDefaultFilter(M,a);else if(A.config.chart.dropShadow.enabled&&k&&(!A.config.chart.dropShadow.enabledOnSeries||A.config.chart.dropShadow.enabledOnSeries&&-1!==A.config.chart.dropShadow.enabledOnSeries.indexOf(a))){var E=A.config.chart.dropShadow;S.dropShadow(M,E,a)}y&&(M.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,M)),M.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,M)),M.node.addEventListener("mousedown",this.pathMouseDown.bind(this,M))),M.attr({pathTo:r,pathFrom:s});var X={el:M,j:i,realIndex:a,pathFrom:s,pathTo:r,fill:c,strokeWidth:l,delay:d};return!L||A.globals.resized||A.globals.dataChanged?!A.globals.resized&&A.globals.dataChanged||C.showDelayedElements():C.animatePathsGradually(n({},X,{speed:g})),A.globals.dataChanged&&P&&T&&C.animatePathsGradually(n({},X,{speed:p})),M}},{key:"drawPattern",value:function(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#a8a8a8",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=this.w,n=r.globals.dom.Paper.pattern(e,i,(function(r){"horizontalLines"===t?r.line(0,0,i,0).stroke({color:a,width:s+1}):"verticalLines"===t?r.line(0,0,0,e).stroke({color:a,width:s+1}):"slantedLines"===t?r.line(0,0,e,i).stroke({color:a,width:s}):"squares"===t?r.rect(e,i).fill("none").stroke({color:a,width:s}):"circles"===t&&r.circle(e).fill("none").stroke({color:a,width:s})}));return n}},{key:"drawGradient",value:function(t,e,i,a,s){var r,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:0,c=this.w;e.length<9&&0===e.indexOf("#")&&(e=g.hexToRgba(e,a)),i.length<9&&0===i.indexOf("#")&&(i=g.hexToRgba(i,s));var d=0,u=1,f=1,p=null;null!==o&&(d=void 0!==o[0]?o[0]/100:0,u=void 0!==o[1]?o[1]/100:1,f=void 0!==o[2]?o[2]/100:1,p=void 0!==o[3]?o[3]/100:null);var x=!("donut"!==c.config.chart.type&&"pie"!==c.config.chart.type&&"polarArea"!==c.config.chart.type&&"bubble"!==c.config.chart.type);if(r=null===l||0===l.length?c.globals.dom.Paper.gradient(x?"radial":"linear",(function(t){t.at(d,e,a),t.at(u,i,s),t.at(f,i,s),null!==p&&t.at(p,e,a)})):c.globals.dom.Paper.gradient(x?"radial":"linear",(function(t){(Array.isArray(l[h])?l[h]:l).forEach((function(e){t.at(e.offset/100,e.color,e.opacity)}))})),x){var b=c.globals.gridWidth/2,m=c.globals.gridHeight/2;"bubble"!==c.config.chart.type?r.attr({gradientUnits:"userSpaceOnUse",cx:b,cy:m,r:n}):r.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?r.from(0,0).to(0,1):"diagonal"===t?r.from(0,0).to(1,1):"horizontal"===t?r.from(0,1).to(1,1):"diagonal2"===t&&r.from(1,0).to(0,1);return r}},{key:"drawText",value:function(t){var e,i=t.x,a=t.y,s=t.text,r=t.textAnchor,n=t.fontSize,o=t.fontFamily,l=t.fontWeight,h=t.foreColor,c=t.opacity,d=t.cssClass,g=void 0===d?"":d,u=t.isPlainText,f=void 0===u||u,p=this.w;return void 0===s&&(s=""),r||(r="start"),h&&h.length||(h=p.config.chart.foreColor),o=o||p.config.chart.fontFamily,l=l||"regular",(e=Array.isArray(s)?p.globals.dom.Paper.text((function(t){for(var e=0;e<s.length;e++)0===e?t.tspan(s[e]):t.tspan(s[e]).newLine()})):f?p.globals.dom.Paper.plain(s):p.globals.dom.Paper.text((function(t){return t.tspan(s)}))).attr({x:i,y:a,"text-anchor":r,"dominant-baseline":"auto","font-size":n,"font-family":o,"font-weight":l,fill:h,class:"apexcharts-text "+g}),e.node.style.fontFamily=o,e.node.style.opacity=c,e}},{key:"drawMarker",value:function(t,e,i){t=t||0;var a=i.pSize||0,s=null;if("square"===i.shape){var r=void 0===i.pRadius?a/2:i.pRadius;null!==e&&a||(a=0,r=0);var n=1.2*a+r,o=this.drawRect(n,n,n,n,r);o.attr({x:t-n/2,y:e-n/2,cx:t,cy:e,class:i.class?i.class:"",fill:i.pointFillColor,"fill-opacity":i.pointFillOpacity?i.pointFillOpacity:1,stroke:i.pointStrokeColor,"stroke-width":i.pWidth?i.pWidth:0,"stroke-opacity":i.pointStrokeOpacity?i.pointStrokeOpacity:1}),s=o}else"circle"!==i.shape&&i.shape||(g.isNumber(e)||(a=0,e=0),s=this.drawCircle(a,{cx:t,cy:e,class:i.class?i.class:"",stroke:i.pointStrokeColor,fill:i.pointFillColor,"fill-opacity":i.pointFillOpacity?i.pointFillOpacity:1,"stroke-width":i.pWidth?i.pWidth:0,"stroke-opacity":i.pointStrokeOpacity?i.pointStrokeOpacity:1}));return s}},{key:"pathMouseEnter",value:function(t,e){var i=this.w,a=new u(this.ctx),s=parseInt(t.node.getAttribute("index"),10),r=parseInt(t.node.getAttribute("j"),10);if("function"==typeof i.config.chart.events.dataPointMouseEnter&&i.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}),this.ctx.events.fireEvent("dataPointMouseEnter",[e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}]),("none"===i.config.states.active.filter.type||"true"!==t.node.getAttribute("selected"))&&"none"!==i.config.states.hover.filter.type&&"none"!==i.config.states.active.filter.type&&!i.globals.isTouchDevice){var n=i.config.states.hover.filter;a.applyFilter(t,s,n.type,n.value)}}},{key:"pathMouseLeave",value:function(t,e){var i=this.w,a=new u(this.ctx),s=parseInt(t.node.getAttribute("index"),10),r=parseInt(t.node.getAttribute("j"),10);"function"==typeof i.config.chart.events.dataPointMouseLeave&&i.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}),this.ctx.events.fireEvent("dataPointMouseLeave",[e,this.ctx,{seriesIndex:s,dataPointIndex:r,w:i}]),"none"!==i.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==i.config.states.hover.filter.type&&a.getDefaultFilter(t,s)}},{key:"pathMouseDown",value:function(t,e){var i=this.w,a=new u(this.ctx),s=parseInt(t.node.getAttribute("index"),10),r=parseInt(t.node.getAttribute("j"),10),n="false";if("true"===t.node.getAttribute("selected")){if(t.node.setAttribute("selected","false"),i.globals.selectedDataPoints[s].indexOf(r)>-1){var o=i.globals.selectedDataPoints[s].indexOf(r);i.globals.selectedDataPoints[s].splice(o,1)}}else{if(!i.config.states.active.allowMultipleDataPointsSelection&&i.globals.selectedDataPoints.length>0){i.globals.selectedDataPoints=[];var l=i.globals.dom.Paper.select(".apexcharts-series path").members,h=i.globals.dom.Paper.select(".apexcharts-series circle, .apexcharts-series rect").members,c=function(t){Array.prototype.forEach.call(t,(function(t){t.node.setAttribute("selected","false"),a.getDefaultFilter(t,s)}))};c(l),c(h)}t.node.setAttribute("selected","true"),n="true",void 0===i.globals.selectedDataPoints[s]&&(i.globals.selectedDataPoints[s]=[]),i.globals.selectedDataPoints[s].push(r)}if("true"===n){var d=i.config.states.active.filter;"none"!==d&&a.applyFilter(t,s,d.type,d.value)}else"none"!==i.config.states.active.filter.type&&a.getDefaultFilter(t,s);"function"==typeof i.config.chart.events.dataPointSelection&&i.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:i.globals.selectedDataPoints,seriesIndex:s,dataPointIndex:r,w:i}),e&&this.ctx.events.fireEvent("dataPointSelection",[e,this.ctx,{selectedDataPoints:i.globals.selectedDataPoints,seriesIndex:s,dataPointIndex:r,w:i}])}},{key:"rotateAroundCenter",value:function(t){var e=t.getBBox();return{x:e.x+e.width/2,y:e.y+e.height/2}}},{key:"getTextRects",value:function(t,e,i,a){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.w,n=this.drawText({x:-200,y:-200,text:t,textAnchor:"start",fontSize:e,fontFamily:i,foreColor:"#fff",opacity:0});a&&n.attr("transform",a),r.globals.dom.Paper.add(n);var o=n.bbox();return s||(o=n.node.getBoundingClientRect()),n.remove(),{width:o.width,height:o.height}}},{key:"placeTextWithEllipsis",value:function(t,e,i){if("function"==typeof t.getComputedTextLength&&(t.textContent=e,e.length>0&&t.getComputedTextLength()>=i/.8)){for(var a=e.length-3;a>0;a-=3)if(t.getSubStringLength(0,a)<=i/.8)return void(t.textContent=e.substring(0,a)+"...");t.textContent="."}}}],[{key:"setAttrs",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&t.setAttribute(i,e[i])}}]),t}(),x=function(){function t(i){e(this,t),this.w=i.w,this.annoCtx=i}return a(t,[{key:"setOrientations",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.w;if("vertical"===t.label.orientation){var a=null!==e?e:0,s=i.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(a,"']"));if(null!==s){var r=s.getBoundingClientRect();s.setAttribute("x",parseFloat(s.getAttribute("x"))-r.height+4),"top"===t.label.position?s.setAttribute("y",parseFloat(s.getAttribute("y"))+r.width):s.setAttribute("y",parseFloat(s.getAttribute("y"))-r.width);var n=this.annoCtx.graphics.rotateAroundCenter(s),o=n.x,l=n.y;s.setAttribute("transform","rotate(-90 ".concat(o," ").concat(l,")"))}}}},{key:"addBackgroundToAnno",value:function(t,e){var i=this.w;if(!e.label.text||e.label.text&&!e.label.text.trim())return null;var a=i.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),s=t.getBoundingClientRect(),r=e.label.style.padding.left,n=e.label.style.padding.right,o=e.label.style.padding.top,l=e.label.style.padding.bottom;"vertical"===e.label.orientation&&(o=e.label.style.padding.left,l=e.label.style.padding.right,r=e.label.style.padding.top,n=e.label.style.padding.bottom);var h=s.left-a.left-r,c=s.top-a.top-o,d=this.annoCtx.graphics.drawRect(h-i.globals.barPadForNumericAxis,c,s.width+r+n,s.height+o+l,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&d.node.classList.add(e.id),d}},{key:"annotationsBackground",value:function(){var t=this,e=this.w,i=function(i,a,s){var r=e.globals.dom.baseEl.querySelector(".apexcharts-".concat(s,"-annotations .apexcharts-").concat(s,"-annotation-label[rel='").concat(a,"']"));if(r){var n=r.parentNode,o=t.addBackgroundToAnno(r,i);o&&n.insertBefore(o.node,r)}};e.config.annotations.xaxis.map((function(t,e){i(t,e,"xaxis")})),e.config.annotations.yaxis.map((function(t,e){i(t,e,"yaxis")})),e.config.annotations.points.map((function(t,e){i(t,e,"point")}))}},{key:"makeAnnotationDraggable",value:function(t,e,i){var a=this.w.config.annotations[e][i];t.draggable().on("dragend",(function(t){var e=t.target.getAttribute("x"),i=t.target.getAttribute("y"),s=t.target.getAttribute("cx"),r=t.target.getAttribute("cy");a.x=e,a.y=i,s&&r&&(a.x=s,a.y=r)})),t.node.addEventListener("mousedown",(function(e){e.stopPropagation(),t.selectize({pointSize:8,rotationPoint:!1,pointType:"rect"}),t.resize().on("resizedone",(function(t){var e=t.target.getAttribute("width"),i=t.target.getAttribute("height"),s=t.target.getAttribute("r");a.width=e,a.height=i,s&&(a.radius=s)}))}))}},{key:"getStringX",value:function(t){var e=this.w,i=t;e.config.xaxis.convertedCatToNumeric&&e.globals.categoryLabels.length&&(t=e.globals.categoryLabels.indexOf(t)+1);var a=e.globals.labels.indexOf(t),s=e.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child("+(a+1)+")");return s&&(i=parseFloat(s.getAttribute("x"))),i}}]),t}(),b=function(){function t(i){e(this,t),this.w=i.w,this.annoCtx=i,this.invertAxis=this.annoCtx.invertAxis}return a(t,[{key:"addXaxisAnnotation",value:function(t,e,i){var a=this.w,s=this.invertAxis?a.globals.minY:a.globals.minX,r=this.invertAxis?a.globals.maxY:a.globals.maxX,n=this.invertAxis?a.globals.yRange[0]:a.globals.xRange,o=(t.x-s)/(n/a.globals.gridWidth);this.annoCtx.inversedReversedAxis&&(o=(r-t.x)/(n/a.globals.gridWidth));var l=t.label.text;"category"!==a.config.xaxis.type&&!a.config.xaxis.convertedCatToNumeric||this.invertAxis||a.globals.dataFormatXNumeric||(o=this.annoCtx.helpers.getStringX(t.x));var h=t.strokeDashArray;if(g.isNumber(o)){if(null===t.x2||void 0===t.x2){var c=this.annoCtx.graphics.drawLine(o+t.offsetX,0+t.offsetY,o+t.offsetX,a.globals.gridHeight+t.offsetY,t.borderColor,h,t.borderWidth);e.appendChild(c.node),t.id&&c.node.classList.add(t.id)}else{var d=(t.x2-s)/(n/a.globals.gridWidth);if(this.annoCtx.inversedReversedAxis&&(d=(r-t.x2)/(n/a.globals.gridWidth)),"category"!==a.config.xaxis.type&&!a.config.xaxis.convertedCatToNumeric||this.invertAxis||a.globals.dataFormatXNumeric||(d=this.annoCtx.helpers.getStringX(t.x2)),d<o){var u=o;o=d,d=u}var f=this.annoCtx.graphics.drawRect(o+t.offsetX,0+t.offsetY,d-o,a.globals.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,h);f.node.classList.add("apexcharts-annotation-rect"),f.attr("clip-path","url(#gridRectMask".concat(a.globals.cuid,")")),e.appendChild(f.node),t.id&&f.node.classList.add(t.id)}var p="top"===t.label.position?4:a.globals.gridHeight,x=this.annoCtx.graphics.getTextRects(l,parseFloat(t.label.style.fontSize)),b=this.annoCtx.graphics.drawText({x:o+t.label.offsetX,y:p+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?x.width/2-12:-x.width/2:0),text:l,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-xaxis-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")});b.attr({rel:i}),e.appendChild(b.node),this.annoCtx.helpers.setOrientations(t,i)}}},{key:"drawXAxisAnnotations",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return e.config.annotations.xaxis.map((function(e,a){t.addXaxisAnnotation(e,i.node,a)})),i}}]),t}(),m=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"getStackedSeriesTotals",value:function(){var t=this.w,e=[];if(0===t.globals.series.length)return e;for(var i=0;i<t.globals.series[t.globals.maxValsInArrayIndex].length;i++){for(var a=0,s=0;s<t.globals.series.length;s++)void 0!==t.globals.series[s][i]&&(a+=t.globals.series[s][i]);e.push(a)}return t.globals.stackedSeriesTotals=e,e}},{key:"getSeriesTotalByIndex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===t?this.w.config.series.reduce((function(t,e){return t+e}),0):this.w.globals.series[t].reduce((function(t,e){return t+e}),0)}},{key:"isSeriesNull",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 0===(null===t?this.w.config.series.filter((function(t){return null!==t})):this.w.config.series[t].data.filter((function(t){return null!==t}))).length}},{key:"seriesHaveSameValues",value:function(t){return this.w.globals.series[t].every((function(t,e,i){return t===i[0]}))}},{key:"getCategoryLabels",value:function(t){var e=this.w,i=t.slice();return e.config.xaxis.convertedCatToNumeric&&(i=t.map((function(t){return e.config.xaxis.labels.formatter(t-e.globals.minX+1)}))),i}},{key:"getLargestSeries",value:function(){var t=this.w;t.globals.maxValsInArrayIndex=t.globals.series.map((function(t){return t.length})).indexOf(Math.max.apply(Math,t.globals.series.map((function(t){return t.length}))))}},{key:"getLargestMarkerSize",value:function(){var t=this.w,e=0;return t.globals.markers.size.forEach((function(t){e=Math.max(e,t)})),t.globals.markers.largestSize=e,e}},{key:"getSeriesTotals",value:function(){var t=this.w;t.globals.seriesTotals=t.globals.series.map((function(t,e){var i=0;if(Array.isArray(t))for(var a=0;a<t.length;a++)i+=t[a];else i+=t;return i}))}},{key:"getSeriesTotalsXRange",value:function(t,e){var i=this.w;return i.globals.series.map((function(a,s){for(var r=0,n=0;n<a.length;n++)i.globals.seriesX[s][n]>t&&i.globals.seriesX[s][n]<e&&(r+=a[n]);return r}))}},{key:"getPercentSeries",value:function(){var t=this.w;t.globals.seriesPercent=t.globals.series.map((function(e,i){var a=[];if(Array.isArray(e))for(var s=0;s<e.length;s++){var r=t.globals.stackedSeriesTotals[s],n=0;r&&(n=100*e[s]/r),a.push(n)}else{var o=100*e/t.globals.seriesTotals.reduce((function(t,e){return t+e}),0);a.push(o)}return a}))}},{key:"getCalculatedRatios",value:function(){var t,e,i,a,s=this.w.globals,r=[],n=0,o=[],l=.1,h=0;if(s.yRange=[],s.isMultipleYAxis)for(var c=0;c<s.minYArr.length;c++)s.yRange.push(Math.abs(s.minYArr[c]-s.maxYArr[c])),o.push(0);else s.yRange.push(Math.abs(s.minY-s.maxY));s.xRange=Math.abs(s.maxX-s.minX),s.zRange=Math.abs(s.maxZ-s.minZ);for(var d=0;d<s.yRange.length;d++)r.push(s.yRange[d]/s.gridHeight);if(e=s.xRange/s.gridWidth,i=Math.abs(s.initialMaxX-s.initialMinX)/s.gridWidth,t=s.yRange/s.gridWidth,a=s.xRange/s.gridHeight,(n=s.zRange/s.gridHeight*16)||(n=1),s.minY!==Number.MIN_VALUE&&0!==Math.abs(s.minY)&&(s.hasNegs=!0),s.isMultipleYAxis){o=[];for(var g=0;g<r.length;g++)o.push(-s.minYArr[g]/r[g])}else o.push(-s.minY/r[0]),s.minY!==Number.MIN_VALUE&&0!==Math.abs(s.minY)&&(l=-s.minY/t,h=s.minX/e);return{yRatio:r,invertedYRatio:t,zRatio:n,xRatio:e,initialXRatio:i,invertedXRatio:a,baseLineInvertedY:l,baseLineY:o,baseLineX:h}}},{key:"getLogSeries",value:function(t){var e=this,i=this.w;return i.globals.seriesLog=t.map((function(t,a){return i.config.yaxis[a]&&i.config.yaxis[a].logarithmic?t.map((function(t){return null===t?null:e.getLogVal(t,a)})):t})),i.globals.invalidLogScale?t:i.globals.seriesLog}},{key:"getLogVal",value:function(t,e){var i=this.w;return(Math.log(t)-Math.log(i.globals.minYArr[e]))/(Math.log(i.globals.maxYArr[e])-Math.log(i.globals.minYArr[e]))}},{key:"getLogYRatios",value:function(t){var e=this,i=this.w,a=this.w.globals;return a.yLogRatio=t.slice(),a.logYRange=a.yRange.map((function(t,s){if(i.config.yaxis[s]&&e.w.config.yaxis[s].logarithmic){var r,n=-Number.MAX_VALUE,o=Number.MIN_VALUE;return a.seriesLog.forEach((function(t,e){t.forEach((function(t){i.config.yaxis[e]&&i.config.yaxis[e].logarithmic&&(n=Math.max(t,n),o=Math.min(t,o))}))})),r=Math.pow(a.yRange[s],Math.abs(o-n)/a.yRange[s]),a.yLogRatio[s]=r/a.gridHeight,r}})),a.invalidLogScale?t.slice():a.yLogRatio}}],[{key:"checkComboSeries",value:function(t){var e=!1,i=0;return t.length&&void 0!==t[0].type&&(e=!0,t.forEach((function(t){"bar"!==t.type&&"column"!==t.type&&"candlestick"!==t.type||i++}))),{comboBarCount:i,comboCharts:e}}},{key:"extendArrayProps",value:function(t,e,i){return e.yaxis&&(e=t.extendYAxis(e,i)),e.annotations&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),e.annotations.xaxis&&(e=t.extendXAxisAnnotations(e)),e.annotations.points&&(e=t.extendPointAnnotations(e))),e}}]),t}(),v=function(){function t(i){e(this,t),this.w=i.w,this.annoCtx=i}return a(t,[{key:"addYaxisAnnotation",value:function(t,e,i){var a,s=this.w,r=t.strokeDashArray,n=this._getY1Y2("y1",t),o=t.label.text;if(null===t.y2||void 0===t.y2){var l=this.annoCtx.graphics.drawLine(0+t.offsetX,n+t.offsetY,s.globals.gridWidth+t.offsetX,n+t.offsetY,t.borderColor,r,t.borderWidth);e.appendChild(l.node),t.id&&l.node.classList.add(t.id)}else{if((a=this._getY1Y2("y2",t))>n){var h=n;n=a,a=h}var c=this.annoCtx.graphics.drawRect(0+t.offsetX,a+t.offsetY,s.globals.gridWidth+t.offsetX,n-a,0,t.fillColor,t.opacity,1,t.borderColor,r);c.node.classList.add("apexcharts-annotation-rect"),c.attr("clip-path","url(#gridRectMask".concat(s.globals.cuid,")")),e.appendChild(c.node),t.id&&c.node.classList.add(t.id)}var d="right"===t.label.position?s.globals.gridWidth:0,g=this.annoCtx.graphics.drawText({x:d+t.label.offsetX,y:(a||n)+t.label.offsetY-3,text:o,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")});g.attr({rel:i}),e.appendChild(g.node)}},{key:"_getY1Y2",value:function(t,e){var i,a="y1"===t?e.y:e.y2,s=this.w;if(this.annoCtx.invertAxis){var r=s.globals.labels.indexOf(a);s.config.xaxis.convertedCatToNumeric&&(r=s.globals.categoryLabels.indexOf(a));var n=s.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child("+(r+1)+")");n&&(i=parseFloat(n.getAttribute("y")))}else{var o;o=s.config.yaxis[e.yAxisIndex].logarithmic?(a=new m(this.annoCtx.ctx).getLogVal(a,e.yAxisIndex))/s.globals.yLogRatio[e.yAxisIndex]:(a-s.globals.minYArr[e.yAxisIndex])/(s.globals.yRange[e.yAxisIndex]/s.globals.gridHeight),i=s.globals.gridHeight-o,s.config.yaxis[e.yAxisIndex]&&s.config.yaxis[e.yAxisIndex].reversed&&(i=o)}return i}},{key:"drawYAxisAnnotations",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return e.config.annotations.yaxis.map((function(e,a){t.addYaxisAnnotation(e,i.node,a)})),i}}]),t}(),y=function(){function t(i){e(this,t),this.w=i.w,this.annoCtx=i}return a(t,[{key:"addPointAnnotation",value:function(t,e,i){var a=this.w,s=0,r=0,n=0;this.annoCtx.invertAxis&&console.warn("Point annotation is not supported in horizontal bar charts.");var o,l=parseFloat(t.y);if("string"==typeof t.x){var h=a.globals.labels.indexOf(t.x);a.config.xaxis.convertedCatToNumeric&&(h=a.globals.categoryLabels.indexOf(t.x)),s=this.annoCtx.helpers.getStringX(t.x),null===t.y&&(l=a.globals.series[t.seriesIndex][h])}else s=(t.x-a.globals.minX)/(a.globals.xRange/a.globals.gridWidth);if(o=a.config.yaxis[t.yAxisIndex].logarithmic?(l=new m(this.annoCtx.ctx).getLogVal(l,t.yAxisIndex))/a.globals.yLogRatio[t.yAxisIndex]:(l-a.globals.minYArr[t.yAxisIndex])/(a.globals.yRange[t.yAxisIndex]/a.globals.gridHeight),r=a.globals.gridHeight-o-parseFloat(t.label.style.fontSize)-t.marker.size,n=a.globals.gridHeight-o,a.config.yaxis[t.yAxisIndex]&&a.config.yaxis[t.yAxisIndex].reversed&&(r=o+parseFloat(t.label.style.fontSize)+t.marker.size,n=o),g.isNumber(s)){var c={pSize:t.marker.size,pWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:"apexcharts-point-annotation-marker ".concat(t.marker.cssClass," ").concat(t.id?t.id:"")},d=this.annoCtx.graphics.drawMarker(s+t.marker.offsetX,n+t.marker.offsetY,c);e.appendChild(d.node);var u=t.label.text?t.label.text:"",f=this.annoCtx.graphics.drawText({x:s+t.label.offsetX,y:r+t.label.offsetY,text:u,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(t.label.style.cssClass," ").concat(t.id?t.id:"")});if(f.attr({rel:i}),e.appendChild(f.node),t.customSVG.SVG){var p=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});p.attr({transform:"translate(".concat(s+t.customSVG.offsetX,", ").concat(r+t.customSVG.offsetY,")")}),p.node.innerHTML=t.customSVG.SVG,e.appendChild(p.node)}if(t.image.path){var x=t.image.width?t.image.width:20,b=t.image.height?t.image.height:20;this.annoCtx.addImage({x:s+t.image.offsetX-x/2,y:r+t.image.offsetY-b/2,width:x,height:b,path:t.image.path,appendTo:".apexcharts-point-annotations"})}}}},{key:"drawPointAnnotations",value:function(){var t=this,e=this.w,i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return e.config.annotations.points.map((function(e,a){t.addPointAnnotation(e,i.node,a)})),i}}]),t}(),w,k,A={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}},S=function(){function t(){e(this,t),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,tickAmount:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={x:0,y:null,yAxisIndex:0,seriesIndex:0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,radius:2,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2},this.shape={x:0,y:0,type:"rect",width:"100%",height:50,appendTo:".apexcharts-annotations",backgroundColor:"#fff",opacity:1,borderWidth:0,borderRadius:4,borderColor:"#c2c2c2"}}return a(t,[{key:"init",value:function(){return{annotations:{position:"front",yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"transparent",locales:[A],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.35},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,zoomed:void 0,scrolled:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,id:void 0,group:void 0,offsetX:0,offsetY:0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0},stacked:!1,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},plotOptions:{bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,startingShape:"flat",endingShape:"flat",rangeBarOverlap:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal"}},bubble:{minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(t){return t}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(t){return t+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce((function(t,e){return t+e}),0)/t.globals.series.length+"%"}}}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(t){return t}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(t){return t}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(t){return t.globals.seriesTotals.reduce((function(t,e){return t+e}),0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(t){return null!==t?t:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,labels:{colors:void 0,useSeriesColors:!1},markers:{width:12,height:12,strokeWidth:0,fillColors:void 0,strokeColor:"#fff",radius:12,customHTML:void 0,offsetX:0,offsetY:0,onClick:void 0},itemMargin:{horizontal:5,vertical:2},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",radius:2,offsetX:0,offsetY:0,onClick:void 0,onDblClick:void 0,showNullDataPoints:!0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{normal:{filter:{type:"none",value:0}},hover:{filter:{type:"lighten",value:.15}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken",value:.65}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:function(t){return t}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,sorted:!1,offsetX:0,offsetY:0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss"}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.4}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"light",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),t}(),C=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.graphics=new p(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new x(this),this.xAxisAnnotations=new b(this),this.yAxisAnnotations=new v(this),this.pointsAnnotations=new y(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return a(t,[{key:"drawAxesAnnotations",value:function(){var t=this.w;if(t.globals.axisCharts){for(var e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),a=this.pointsAnnotations.drawPointAnnotations(),s=t.config.chart.animations.enabled,r=[e,i,a],n=[i.node,e.node,a.node],o=0;o<3;o++)t.globals.dom.elGraphical.add(r[o]),!s||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&n[o].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:n[o],index:0});this.helpers.annotationsBackground()}}},{key:"drawShapeAnnos",value:function(){var t=this;this.w.config.annotations.shapes.map((function(e,i){t.addShape(e,i)}))}},{key:"drawImageAnnos",value:function(){var t=this;this.w.config.annotations.images.map((function(e,i){t.addImage(e,i)}))}},{key:"drawTextAnnos",value:function(){var t=this;this.w.config.annotations.texts.map((function(e,i){t.addText(e,i)}))}},{key:"addXaxisAnnotation",value:function(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}},{key:"addYaxisAnnotation",value:function(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}},{key:"addPointAnnotation",value:function(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}},{key:"addText",value:function(t,e){var i=t.x,a=t.y,s=t.text,r=t.textAnchor,n=t.foreColor,o=t.fontSize,l=t.fontFamily,h=t.fontWeight,c=t.cssClass,d=t.backgroundColor,g=t.borderWidth,u=t.strokeDashArray,f=t.borderRadius,p=t.borderColor,x=t.appendTo,b=void 0===x?".apexcharts-annotations":x,m=t.paddingLeft,v=void 0===m?4:m,y=t.paddingRight,w=void 0===y?4:y,k=t.paddingBottom,A=void 0===k?2:k,S=t.paddingTop,C=void 0===S?2:S,L=this.w,P=this.graphics.drawText({x:i,y:a,text:s,textAnchor:r||"start",fontSize:o||"12px",fontWeight:h||"regular",fontFamily:l||L.config.chart.fontFamily,foreColor:n||L.config.chart.foreColor,cssClass:c}),T=L.globals.dom.baseEl.querySelector(b);T&&T.appendChild(P.node);var z=P.bbox();if(t.draggable&&this.helpers.makeAnnotationDraggable(P,"texts",e),s){var I=this.graphics.drawRect(z.x-v,z.y-C,z.width+v+w,z.height+A+C,f,d||"transparent",1,g,p,u);T.insertBefore(I.node,P.node)}}},{key:"addShape",value:function(t,e){var i={type:t.type,x:t.x||0,y:t.y||0,width:t.width||"100%",height:t.height||50,circleRadius:t.radius||25,backgroundColor:t.backgroundColor||"#fff",opacity:t.opacity||1,borderWidth:t.borderWidth||0,borderRadius:t.borderRadius||4,borderColor:t.borderColor||"#c2c2c2",appendTo:t.appendTo||".apexcharts-annotations"},a=this.w;String(i.width).indexOf("%")>-1&&(i.width=parseInt(i.width,10)*parseInt(a.globals.svgWidth,10)/100);var s=null;s="circle"===i.type?this.graphics.drawCircle(i.circleRadius,{fill:i.backgroundColor,stroke:i.borderColor,"stroke-width":i.borderWidth,opacity:i.opacity,cx:i.x,cy:i.y}):this.graphics.drawRect(i.x,i.y,i.width,i.height,i.borderRadius,i.backgroundColor,i.opacity,i.borderWidth,i.borderColor);var r=a.globals.dom.baseEl.querySelector(i.appendTo);r&&r.appendChild(s.node),t.draggable&&(this.helpers.makeAnnotationDraggable(s,"shapes",e),s.node.classList.add("apexcharts-resizable-element"))}},{key:"addImage",value:function(t,e){var i=this.w,a=t.path,s=t.x,r=void 0===s?0:s,n=t.y,o=void 0===n?0:n,l=t.width,h=void 0===l?20:l,c=t.height,d=void 0===c?20:c,g=t.appendTo,u=void 0===g?".apexcharts-annotations":g,f=i.globals.dom.Paper.image(a);f.size(h,d).move(r,o);var p=i.globals.dom.baseEl.querySelector(u);p&&p.appendChild(f.node),t.draggable&&(this.helpers.makeAnnotationDraggable(f,"images",e),f.node.classList.add("apexcharts-resizable-element"))}},{key:"addXaxisAnnotationExternal",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}},{key:"addYaxisAnnotationExternal",value:function(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}},{key:"addPointAnnotationExternal",value:function(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}},{key:"addAnnotationExternal",value:function(t){var e=t.params,i=t.pushToMemory,a=t.context,s=t.type,r=t.contextMethod,n=a,o=n.w,l=o.globals.dom.baseEl.querySelector(".apexcharts-".concat(s,"-annotations")),h=l.childNodes.length+1,c=new S,d=Object.assign({},"xaxis"===s?c.xAxisAnnotation:"yaxis"===s?c.yAxisAnnotation:c.pointAnnotation),u=g.extend(d,e);switch(s){case"xaxis":this.addXaxisAnnotation(u,l,h);break;case"yaxis":this.addYaxisAnnotation(u,l,h);break;case"point":this.addPointAnnotation(u,l,h)}var f=o.globals.dom.baseEl.querySelector(".apexcharts-".concat(s,"-annotations .apexcharts-").concat(s,"-annotation-label[rel='").concat(h,"']")),p=this.helpers.addBackgroundToAnno(f,u);return p&&l.insertBefore(p.node,f),i&&o.globals.memory.methodsToExec.push({context:n,id:u.id?u.id:g.randomId(),method:r,label:"addAnnotation",params:e}),a}},{key:"clearAnnotations",value:function(t){var e=t.w,i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");e.globals.memory.methodsToExec.map((function(t,i){"addText"!==t.label&&"addAnnotation"!==t.label||e.globals.memory.methodsToExec.splice(i,1)})),i=g.listToArray(i),Array.prototype.forEach.call(i,(function(t){for(;t.firstChild;)t.removeChild(t.firstChild)}))}},{key:"removeAnnotation",value:function(t,e){var i=t.w,a=i.globals.dom.baseEl.querySelectorAll(".".concat(e));a&&(i.globals.memory.methodsToExec.map((function(t,a){t.id===e&&i.globals.memory.methodsToExec.splice(a,1)})),Array.prototype.forEach.call(a,(function(t){t.parentElement.removeChild(t)})))}}]),t}(),L=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.opts=null,this.seriesIndex=0}return a(t,[{key:"clippedImgArea",value:function(t){var e=this.w,i=e.config,a=parseInt(e.globals.gridWidth,10),s=parseInt(e.globals.gridHeight,10),r=a>s?a:s,n=t.image,o=0,l=0;void 0===t.width&&void 0===t.height?void 0!==i.fill.image.width&&void 0!==i.fill.image.height?(o=i.fill.image.width+1,l=i.fill.image.height):(o=r+1,l=r):(o=t.width,l=t.height);var h=document.createElementNS(e.globals.SVGNS,"pattern");p.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:o+"px",height:l+"px"});var c=document.createElementNS(e.globals.SVGNS,"image");h.appendChild(c),c.setAttributeNS(window.SVG.xlink,"href",n),p.setAttrs(c,{x:0,y:0,preserveAspectRatio:"none",width:o+"px",height:l+"px"}),c.style.opacity=t.opacity,e.globals.dom.elDefs.node.appendChild(h)}},{key:"getSeriesIndex",value:function(t){var e=this.w;return("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||"heatmap"===e.config.chart.type?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.globals.series.length,this.seriesIndex}},{key:"fillPath",value:function(t){var e=this.w;this.opts=t;var i,a,s,r=this.w.config;this.seriesIndex=this.getSeriesIndex(t);var n=this.getFillColors()[this.seriesIndex];"function"==typeof n&&(n=n({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:e}));var o=this.getFillType(this.seriesIndex),l=Array.isArray(r.fill.opacity)?r.fill.opacity[this.seriesIndex]:r.fill.opacity,h=n;if(t.color&&(n=t.color),-1===n.indexOf("rgb")?n.length<9&&(h=g.hexToRgba(n,l)):n.indexOf("rgba")>-1&&(l=g.getOpacityFromRGBA(n)),t.opacity&&(l=t.opacity),"pattern"===o&&(a=this.handlePatternFill(a,n,l,h)),"gradient"===o&&(s=this.handleGradientFill(n,l,this.seriesIndex)),"image"===o){var c=r.fill.image.src,d=t.patternID?t.patternID:"";this.clippedImgArea({opacity:l,image:Array.isArray(c)?t.seriesNumber<c.length?c[t.seriesNumber]:c[0]:c,width:t.width?t.width:void 0,height:t.height?t.height:void 0,patternUnits:t.patternUnits,patternID:"pattern".concat(e.globals.cuid).concat(t.seriesNumber+1).concat(d)}),i="url(#pattern".concat(e.globals.cuid).concat(t.seriesNumber+1).concat(d,")")}else i="gradient"===o?s:"pattern"===o?a:h;return t.solid&&(i=h),i}},{key:"getFillType",value:function(t){var e=this.w;return Array.isArray(e.config.fill.type)?e.config.fill.type[t]:e.config.fill.type}},{key:"getFillColors",value:function(){var t=this.w,e=t.config,i=this.opts,a=[];return t.globals.comboCharts?"line"===t.config.series[this.seriesIndex].type?t.globals.stroke.colors instanceof Array?a=t.globals.stroke.colors:a.push(t.globals.stroke.colors):t.globals.fill.colors instanceof Array?a=t.globals.fill.colors:a.push(t.globals.fill.colors):"line"===e.chart.type?t.globals.stroke.colors instanceof Array?a=t.globals.stroke.colors:a.push(t.globals.stroke.colors):t.globals.fill.colors instanceof Array?a=t.globals.fill.colors:a.push(t.globals.fill.colors),void 0!==i.fillColors&&(a=[],i.fillColors instanceof Array?a=i.fillColors.slice():a.push(i.fillColors)),a}},{key:"handlePatternFill",value:function(t,e,i,a){var s=this.w.config,r=this.opts,n=new p(this.ctx),o=void 0===s.fill.pattern.strokeWidth?Array.isArray(s.stroke.width)?s.stroke.width[this.seriesIndex]:s.stroke.width:Array.isArray(s.fill.pattern.strokeWidth)?s.fill.pattern.strokeWidth[this.seriesIndex]:s.fill.pattern.strokeWidth,l=e;return t=s.fill.pattern.style instanceof Array?void 0!==s.fill.pattern.style[r.seriesNumber]?n.drawPattern(s.fill.pattern.style[r.seriesNumber],s.fill.pattern.width,s.fill.pattern.height,l,o,i):a:n.drawPattern(s.fill.pattern.style,s.fill.pattern.width,s.fill.pattern.height,l,o,i)}},{key:"handleGradientFill",value:function(t,e,i){var a,s=this.w.config,r=this.opts,n=new p(this.ctx),o=new g,l=s.fill.gradient.type,h=t,c=void 0===s.fill.gradient.opacityFrom?e:Array.isArray(s.fill.gradient.opacityFrom)?s.fill.gradient.opacityFrom[i]:s.fill.gradient.opacityFrom;h.indexOf("rgba")>-1&&(c=g.getOpacityFromRGBA(h));var d=void 0===s.fill.gradient.opacityTo?e:Array.isArray(s.fill.gradient.opacityTo)?s.fill.gradient.opacityTo[i]:s.fill.gradient.opacityTo;if(void 0===s.fill.gradient.gradientToColors||0===s.fill.gradient.gradientToColors.length)a="dark"===s.fill.gradient.shade?o.shadeColor(-1*parseFloat(s.fill.gradient.shadeIntensity),t.indexOf("rgb")>-1?g.rgb2hex(t):t):o.shadeColor(parseFloat(s.fill.gradient.shadeIntensity),t.indexOf("rgb")>-1?g.rgb2hex(t):t);else{var u=s.fill.gradient.gradientToColors[r.seriesNumber];a=u,u.indexOf("rgba")>-1&&(d=g.getOpacityFromRGBA(u))}if(s.fill.gradient.inverseColors){var f=h;h=a,a=f}return h.indexOf("rgb")>-1&&(h=g.rgb2hex(h)),a.indexOf("rgb")>-1&&(a=g.rgb2hex(a)),n.drawGradient(l,h,a,c,d,r.size,s.fill.gradient.stops,s.fill.gradient.colorStops,i)}}]),t}(),P=function(){function t(i,a){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"setGlobalMarkerSize",value:function(){var t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.length<t.globals.series.length+1)for(var e=0;e<=t.globals.series.length;e++)void 0===t.globals.markers.size[e]&&t.globals.markers.size.push(t.globals.markers.size[0])}else t.globals.markers.size=t.config.series.map((function(e){return t.config.markers.size}))}},{key:"plotChartMarkers",value:function(t,e,i,a){var s,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=this.w,o=e,l=t,h=null,c=new p(this.ctx);if((n.globals.markers.size[e]>0||r)&&(h=c.group({class:r?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(n.globals.cuid,")")),l.x instanceof Array)for(var d=0;d<l.x.length;d++){var f=i;1===i&&0===d&&(f=0),1===i&&1===d&&(f=1);var x="apexcharts-marker";"line"!==n.config.chart.type&&"area"!==n.config.chart.type||n.globals.comboCharts||n.config.tooltip.intersect||(x+=" no-pointer-events");var b=Array.isArray(n.config.markers.size)?n.globals.markers.size[e]>0:n.config.markers.size>0;if(b||r){g.isNumber(l.y[d])?x+=" w".concat(g.randomId()):x="apexcharts-nullpoint";var m=this.getMarkerConfig(x,e,f);n.config.series[o].data[i]&&(n.config.series[o].data[i].fillColor&&(m.pointFillColor=n.config.series[o].data[i].fillColor),n.config.series[o].data[i].strokeColor&&(m.pointStrokeColor=n.config.series[o].data[i].strokeColor)),a&&(m.pSize=a),(s=c.drawMarker(l.x[d],l.y[d],m)).attr("rel",f),s.attr("j",f),s.attr("index",e),s.node.setAttribute("default-marker-size",m.pSize);var v=new u(this.ctx);v.setSelectionFilter(s,e,f),this.addEvents(s),h&&h.add(s)}else void 0===n.globals.pointsArray[e]&&(n.globals.pointsArray[e]=[]),n.globals.pointsArray[e].push([l.x[d],l.y[d]])}return h}},{key:"getMarkerConfig",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this.w,s=this.getMarkerStyle(e),r=a.globals.markers.size[e],n=a.config.markers;return null!==i&&n.discrete.length&&n.discrete.map((function(t){t.seriesIndex===e&&t.dataPointIndex===i&&(s.pointStrokeColor=t.strokeColor,s.pointFillColor=t.fillColor,r=t.size)})),{pSize:r,pRadius:n.radius,pWidth:n.strokeWidth instanceof Array?n.strokeWidth[e]:n.strokeWidth,pointStrokeColor:s.pointStrokeColor,pointFillColor:s.pointFillColor,shape:n.shape instanceof Array?n.shape[e]:n.shape,class:t,pointStrokeOpacity:n.strokeOpacity instanceof Array?n.strokeOpacity[e]:n.strokeOpacity,pointStrokeDashArray:n.strokeDashArray instanceof Array?n.strokeDashArray[e]:n.strokeDashArray,pointFillOpacity:n.fillOpacity instanceof Array?n.fillOpacity[e]:n.fillOpacity,seriesIndex:e}}},{key:"addEvents",value:function(t){var e=this.w,i=new p(this.ctx);t.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",i.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener("click",e.config.markers.onClick),t.node.addEventListener("dblclick",e.config.markers.onDblClick),t.node.addEventListener("touchstart",i.pathMouseDown.bind(this.ctx,t),{passive:!0})}},{key:"getMarkerStyle",value:function(t){var e=this.w,i=e.globals.markers.colors,a=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:a instanceof Array?a[t]:a,pointFillColor:i instanceof Array?i[t]:i}}}]),t}(),T=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled}return a(t,[{key:"draw",value:function(t,e,i){var a=this.w,s=new p(this.ctx),r=i.realIndex,n=i.pointsPos,o=i.zRatio,l=i.elParent,h=s.group({class:"apexcharts-series-markers apexcharts-series-".concat(a.config.chart.type)});if(h.attr("clip-path","url(#gridRectMarkerMask".concat(a.globals.cuid,")")),n.x instanceof Array)for(var c=0;c<n.x.length;c++){var d=e+1,g=!0;0===e&&0===c&&(d=0),0===e&&1===c&&(d=1);var u=0,f=a.globals.markers.size[r];if(o!==1/0){f=a.globals.seriesZ[r][d]/o;var x=a.config.plotOptions.bubble;x.minBubbleRadius&&f<x.minBubbleRadius&&(f=x.minBubbleRadius),x.maxBubbleRadius&&f>x.maxBubbleRadius&&(f=x.maxBubbleRadius)}a.config.chart.animations.enabled||(u=f);var b=n.x[c],m=n.y[c];if(u=u||0,null!==m&&void 0!==a.globals.series[r][d]||(g=!1),g){var v=this.drawPoint(b,m,u,f,r,d,e);h.add(v)}l.add(h)}}},{key:"drawPoint",value:function(t,e,i,a,s,r,n){var o=this.w,l=s,h=new f(this.ctx),c=new u(this.ctx),d=new L(this.ctx),g=new P(this.ctx),x=new p(this.ctx),b=g.getMarkerConfig("apexcharts-marker",l),m=d.fillPath({seriesNumber:s,dataPointIndex:r,patternUnits:"objectBoundingBox",value:o.globals.series[s][n]}),v=x.drawCircle(i);if(o.config.series[l].data[r]&&o.config.series[l].data[r].fillColor&&(m=o.config.series[l].data[r].fillColor),v.attr({cx:t,cy:e,fill:m,stroke:b.pointStrokeColor,"stroke-width":b.pWidth,"stroke-dasharray":b.pointStrokeDashArray,"stroke-opacity":b.pointStrokeOpacity}),o.config.chart.dropShadow.enabled){var y=o.config.chart.dropShadow;c.dropShadow(v,y,s)}if(this.initialAnim&&!o.globals.dataChanged){var w=1;o.globals.resized||(w=o.config.chart.animations.speed),h.animateCircleRadius(v,0,a,w,o.globals.easing,(function(){window.setTimeout((function(){h.animationCompleted(v)}),100)}))}if(o.globals.dataChanged)if(this.dynamicAnim){var k,A,S,C,T=o.config.chart.animations.dynamicAnimation.speed;null!=(C=o.globals.previousPaths[s]&&o.globals.previousPaths[s][n])&&(k=C.x,A=C.y,S=void 0!==C.r?C.r:a);for(var z=0;z<o.globals.collapsedSeries.length;z++)o.globals.collapsedSeries[z].index===s&&(T=1,a=0);0===t&&0===e&&(a=0),h.animateCircle(v,{cx:k,cy:A,r:S},{cx:t,cy:e,r:a},T,o.globals.easing)}else v.attr({r:a});return v.attr({rel:r,j:r,index:s,"default-marker-size":a}),c.setSelectionFilter(v,s,r),g.addEvents(v),v.node.classList.add("apexcharts-marker"),v}},{key:"centerTextInBubble",value:function(t){var e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}]),t}(),z=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"dataLabelsCorrection",value:function(t,e,i,a,s,r,n){var o=this.w,l=!1,h=new p(this.ctx).getTextRects(i,n),c=h.width,d=h.height;void 0===o.globals.dataLabelsRects[a]&&(o.globals.dataLabelsRects[a]=[]),o.globals.dataLabelsRects[a].push({x:t,y:e,width:c,height:d});var g=o.globals.dataLabelsRects[a].length-2,u=void 0!==o.globals.lastDrawnDataLabelsIndexes[a]?o.globals.lastDrawnDataLabelsIndexes[a][o.globals.lastDrawnDataLabelsIndexes[a].length-1]:0;if(void 0!==o.globals.dataLabelsRects[a][g]){var f=o.globals.dataLabelsRects[a][u];(t>f.x+f.width+2||e>f.y+f.height+2||t+c<f.x)&&(l=!0)}return(0===s||r)&&(l=!0),{x:t,y:e,textRects:h,drawnextLabel:l}}},{key:"drawDataLabel",value:function(t,e,i){var a=this,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=this.w,n=new p(this.ctx),o=r.config.dataLabels,l=0,h=0,c=i,d=null;if(!o.enabled||t.x instanceof Array!=1)return d;d=n.group({class:"apexcharts-data-labels"});for(var g=0;g<t.x.length;g++)if(l=t.x[g]+o.offsetX,h=t.y[g]+o.offsetY+s,!isNaN(l)){1===i&&0===g&&(c=0),1===i&&1===g&&(c=1);var u=r.globals.series[e][c],f="",x=function(t){return r.config.dataLabels.formatter(t,{ctx:a.ctx,seriesIndex:e,dataPointIndex:c,w:r})};if("bubble"===r.config.chart.type){f=x(u=r.globals.seriesZ[e][c]),h=t.y[g];var b=new T(this.ctx),m=b.centerTextInBubble(h,e,c);h=m.y}else void 0!==u&&(f=x(u));this.plotDataLabelsText({x:l,y:h,text:f,i:e,j:c,parent:d,offsetCorrection:!0,dataLabelsConfig:r.config.dataLabels})}return d}},{key:"plotDataLabelsText",value:function(t){var e=this.w,i=new p(this.ctx),a=t.x,s=t.y,r=t.i,n=t.j,o=t.text,l=t.textAnchor,h=t.parent,c=t.dataLabelsConfig,d=t.color,g=t.alwaysDrawDataLabel,f=t.offsetCorrection;if(!(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(r)<0)){var x={x:a,y:s,drawnextLabel:!0};f&&(x=this.dataLabelsCorrection(a,s,o,r,n,g,parseInt(c.style.fontSize,10))),e.globals.zoomed||(a=x.x,s=x.y),x.textRects&&(a+x.textRects.width<-20||a>e.globals.gridWidth+20)&&(o="");var b=e.globals.dataLabels.style.colors[r];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(b=e.globals.dataLabels.style.colors[n]),d&&(b=d);var m=c.offsetX,v=c.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(m=0,v=0),x.drawnextLabel){var y=i.drawText({width:100,height:parseInt(c.style.fontSize,10),x:a+m,y:s+v,foreColor:b,textAnchor:l||c.textAnchor,text:o,fontSize:c.style.fontSize,fontFamily:c.style.fontFamily,fontWeight:c.style.fontWeight||"normal"});if(y.attr({class:"apexcharts-datalabel",cx:a,cy:s}),c.dropShadow.enabled){var w=c.dropShadow;new u(this.ctx).dropShadow(y,w)}h.add(y),void 0===e.globals.lastDrawnDataLabelsIndexes[r]&&(e.globals.lastDrawnDataLabelsIndexes[r]=[]),e.globals.lastDrawnDataLabelsIndexes[r].push(n)}}}},{key:"addBackgroundToDataLabel",value:function(t,e){var i=this.w,a=i.config.dataLabels.background,s=a.padding,r=a.padding/2,n=e.width,o=e.height,l=new p(this.ctx).drawRect(e.x-s,e.y-r/2,n+2*s,o+r,a.borderRadius,"transparent"===i.config.chart.background?"#fff":i.config.chart.background,a.opacity,a.borderWidth,a.borderColor);return a.dropShadow.enabled&&new u(this.ctx).dropShadow(l,a.dropShadow),l}},{key:"dataLabelsBackground",value:function(){var t=this.w;if("bubble"!==t.config.chart.type)for(var e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),i=0;i<e.length;i++){var a=e[i],s=a.getBBox(),r=null;if(s.width&&s.height&&(r=this.addBackgroundToDataLabel(a,s)),r){a.parentNode.insertBefore(r.node,a);var n=a.getAttribute("fill");!t.config.chart.animations.enabled||t.globals.resized||t.globals.dataChanged?r.attr({fill:n}):r.animate().attr({fill:n}),a.setAttribute("fill",t.config.dataLabels.background.foreColor)}}}},{key:"bringForward",value:function(){for(var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName("apexcharts-datalabels"),i=t.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),a=0;a<e.length;a++)i&&i.insertBefore(e[a],i.nextSibling)}}]),t}(),I=function(){function t(i){e(this,t),this.w=i.w,this.barCtx=i}return a(t,[{key:"handleBarDataLabels",value:function(t){var e=t.x,i=t.y,a=t.y1,s=t.y2,r=t.i,n=t.j,o=t.realIndex,l=t.series,h=t.barHeight,c=t.barWidth,d=t.barYPosition,g=t.visibleSeries,u=t.renderedPath,f=this.w,x=new p(this.barCtx.ctx),b=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[o]:this.barCtx.strokeWidth,m=e+parseFloat(c*g),v=i+parseFloat(h*g);f.globals.isXNumeric&&!f.globals.isBarHorizontal&&(m=e+parseFloat(c*(g+1)),v=i+parseFloat(h*(g+1))-b);var y=e,w=i,k={},A=f.config.dataLabels,S=this.barCtx.barOptions.dataLabels;void 0!==d&&this.barCtx.isTimelineBar&&(v=d,w=d);var C=A.offsetX,L=A.offsetY,P={width:0,height:0};if(f.config.dataLabels.enabled){var T=String(f.globals.minY).length>String(f.globals.maxY).length?f.globals.minY:f.globals.maxY;P=x.getTextRects(f.globals.yLabelFormatters[0](T),parseFloat(A.style.fontSize))}var z={x:e,y:i,i:r,j:n,renderedPath:u,bcx:m,bcy:v,barHeight:h,barWidth:c,textRects:P,strokeWidth:b,dataLabelsX:y,dataLabelsY:w,barDataLabelsConfig:S,offX:C,offY:L};return k=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(z):this.calculateColumnsDataLabelsPosition(z),u.attr({cy:k.bcy,cx:k.bcx,j:n,val:l[r][n],barHeight:h,barWidth:c}),this.drawCalculatedDataLabels({x:k.dataLabelsX,y:k.dataLabelsY,val:this.barCtx.isTimelineBar?[a,s]:l[r][n],i:o,j:n,barWidth:c,barHeight:h,textRects:P,dataLabelsConfig:A})}},{key:"calculateColumnsDataLabelsPosition",value:function(t){var e,i=this.w,a=t.i,s=t.j,r=t.y,n=t.bcx,o=t.barWidth,l=t.barHeight,h=t.textRects,c=t.dataLabelsY,d=t.barDataLabelsConfig,g=t.strokeWidth,u=t.offX,f=t.offY;l=Math.abs(l);var p="vertical"===i.config.plotOptions.bar.dataLabels.orientation;n-=g/2;var x=i.globals.gridWidth/i.globals.dataPoints;e=i.globals.isXNumeric?n-o/2+u:n-x+o/2+u,p&&(e=e+h.height/2-g/2-2);var b=this.barCtx.series[a][s]<0,m=r;switch(this.barCtx.isReversed&&(m=r-l+(b?2*l:0),r-=l),d.position){case"center":c=p?b?m+l/2+f:m+l/2-f:b?m-l/2+h.height/2+f:m+l/2+h.height/2-f;break;case"bottom":c=p?b?m+l+f:m+l-f:b?m-l+h.height+g+f:m+l-h.height/2+g-f;break;case"top":c=p?b?m+f:m-f:b?m-h.height/2-f:m+h.height+f}return i.config.chart.stacked||(c<0?c=0+g:c+h.height/3>i.globals.gridHeight&&(c=i.globals.gridHeight-g)),{bcx:n,bcy:r,dataLabelsX:e,dataLabelsY:c}}},{key:"calculateBarsDataLabelsPosition",value:function(t){var e=this.w,i=t.x,a=t.i,s=t.j,r=t.bcy,n=t.barHeight,o=t.barWidth,l=t.textRects,h=t.dataLabelsX,c=t.strokeWidth,d=t.barDataLabelsConfig,g=t.offX,u=t.offY,f=e.globals.gridHeight/e.globals.dataPoints;o=Math.abs(o);var p=r-(this.barCtx.isTimelineBar?0:f)+n/2+l.height/2+u-3,x=this.barCtx.series[a][s]<0,b=i;switch(this.barCtx.isReversed&&(b=i+o-(x?2*o:0),i=e.globals.gridWidth-o),d.position){case"center":h=x?b+o/2-g:b-o/2+g;break;case"bottom":h=x?b+o-c-Math.round(l.width/2)-g:b-o+c+Math.round(l.width/2)+g;break;case"top":h=x?b-c+Math.round(l.width/2)-g:b-c-Math.round(l.width/2)+g}return e.config.chart.stacked||(h<0?h=h+l.width+c:h+l.width/2>e.globals.gridWidth&&(h=e.globals.gridWidth-l.width-c)),{bcx:i,bcy:r,dataLabelsX:h,dataLabelsY:p}}},{key:"drawCalculatedDataLabels",value:function(t){var e=t.x,i=t.y,a=t.val,s=t.i,r=t.j,o=t.textRects,l=t.barHeight,h=t.barWidth,c=t.dataLabelsConfig,d=this.w,g="rotate(0)";"vertical"===d.config.plotOptions.bar.dataLabels.orientation&&(g="rotate(-90, ".concat(e,", ").concat(i,")"));var u=new z(this.barCtx.ctx),f=new p(this.barCtx.ctx),x=c.formatter,b=null,m=d.globals.collapsedSeriesIndices.indexOf(s)>-1;if(c.enabled&&!m){b=f.group({class:"apexcharts-data-labels",transform:g});var v="";void 0!==a&&(v=x(a,{seriesIndex:s,dataPointIndex:r,w:d})),0===a&&d.config.chart.stacked&&(v="");var y=d.globals.series[s][r]<=0,w=d.config.plotOptions.bar.dataLabels.position;"vertical"===d.config.plotOptions.bar.dataLabels.orientation&&("top"===w&&(c.textAnchor=y?"end":"start"),"center"===w&&(c.textAnchor="middle"),"bottom"===w&&(c.textAnchor=y?"end":"start")),this.barCtx.isTimelineBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&h<f.getTextRects(v,parseFloat(c.style.fontSize)).width&&(v=""),d.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?((h=Math.abs(d.globals.series[s][r])/this.barCtx.invertedYRatio[this.barCtx.yaxisIndex])>0&&o.width/1.6>h||h<0&&o.width/1.6<h)&&(v=""):(l=Math.abs(d.globals.series[s][r])/this.barCtx.yRatio[this.barCtx.yaxisIndex],o.height/1.6>l&&(v="")));var k=n({},c);this.barCtx.isHorizontal&&a<0&&("start"===c.textAnchor?k.textAnchor="end":"end"===c.textAnchor&&(k.textAnchor="start")),u.plotDataLabelsText({x:e,y:i,text:v,i:s,j:r,parent:b,dataLabelsConfig:k,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return b}}]),t}(),M=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.legendInactiveClass="legend-mouseover-inactive"}return a(t,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series")}},{key:"getSeriesByName",value:function(t){return this.w.globals.dom.baseEl.querySelector("[seriesName='".concat(g.escapeString(t),"']"))}},{key:"isSeriesHidden",value:function(t){var e=this.getSeriesByName(t),i=parseInt(e.getAttribute("data:realIndex"),10);return{isHidden:e.classList.contains("apexcharts-series-collapsed"),realIndex:i}}},{key:"addCollapsedClassToSeries",value:function(t,e){var i=this.w;function a(i){for(var a=0;a<i.length;a++)i[a].index===e&&t.node.classList.add("apexcharts-series-collapsed")}a(i.globals.collapsedSeries),a(i.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(t){var e=this.isSeriesHidden(t);return this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,e.isHidden),e.isHidden}},{key:"showSeries",value:function(t){var e=this.isSeriesHidden(t);e.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!0)}},{key:"hideSeries",value:function(t){var e=this.isSeriesHidden(t);e.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!1)}},{key:"resetSeries",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this.w,s=g.clone(a.globals.initialSeries);a.globals.previousPaths=[],i?(a.globals.collapsedSeries=[],a.globals.ancillaryCollapsedSeries=[],a.globals.collapsedSeriesIndices=[],a.globals.ancillaryCollapsedSeriesIndices=[]):s=this.emptyCollapsedSeries(s),a.config.series=s,t&&(e&&(a.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(s,a.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(t){for(var e=this.w,i=0;i<t.length;i++)e.globals.collapsedSeriesIndices.indexOf(i)>-1&&(t[i].data=[]);return t}},{key:"toggleSeriesOnHover",value:function(t,e){var i=this.w,a=i.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels");if("mousemove"===t.type){var s=parseInt(e.getAttribute("rel"),10)-1,r=null,n=null;i.globals.axisCharts||"radialBar"===i.config.chart.type?i.globals.axisCharts?(r=i.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(s,"']")),n=i.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(s,"']"))):r=i.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(s+1,"']")):r=i.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(s+1,"'] path"));for(var o=0;o<a.length;o++)a[o].classList.add(this.legendInactiveClass);null!==r&&(i.globals.axisCharts||r.parentNode.classList.remove(this.legendInactiveClass),r.classList.remove(this.legendInactiveClass),null!==n&&n.classList.remove(this.legendInactiveClass))}else if("mouseout"===t.type)for(var l=0;l<a.length;l++)a[l].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(t,e){var i=this,a=this.w,s=a.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),r=function(t){for(var e=0;e<s.length;e++)s[e].classList[t](i.legendInactiveClass)};if("mousemove"===t.type){var n=parseInt(e.getAttribute("rel"),10)-1;r("add"),function(t){for(var e=0;e<s.length;e++){var a=parseInt(s[e].getAttribute("val"),10);a>=t.from&&a<=t.to&&s[e].classList.remove(i.legendInactiveClass)}}(a.config.plotOptions.heatmap.colorScale.ranges[n])}else"mouseout"===t.type&&r("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.w,i=0;if(e.config.series.length>1)for(var a=e.config.series.map((function(i,a){var s=!1;return t&&(s="bar"===e.config.series[a].type||"column"===e.config.series[a].type),i.data&&i.data.length>0&&!s?a:-1})),s=0;s<a.length;s++)if(-1!==a[s]){i=a[s];break}return i}},{key:"getPreviousPaths",value:function(){var t=this.w;function e(e,i,a){for(var s=e[i].childNodes,r={type:a,paths:[],realIndex:e[i].getAttribute("data:realIndex")},n=0;n<s.length;n++)if(s[n].hasAttribute("pathTo")){var o=s[n].getAttribute("pathTo");r.paths.push({d:o})}t.globals.previousPaths.push(r)}t.globals.previousPaths=[],["line","area","bar","candlestick","radar"].forEach((function(i){for(var a,s=(a=i,t.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(a,"-series .apexcharts-series"))),r=0;r<s.length;r++)e(s,r,i)})),this.handlePrevBubbleScatterPaths("bubble"),this.handlePrevBubbleScatterPaths("scatter");var i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-heatmap .apexcharts-series");if(i.length>0)for(var a=0;a<i.length;a++){for(var s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-heatmap .apexcharts-series[data\\:realIndex='".concat(a,"'] rect")),r=[],n=0;n<s.length;n++)r.push({color:s[n].getAttribute("color")});t.globals.previousPaths.push(r)}t.globals.axisCharts||(t.globals.previousPaths=t.globals.series)}},{key:"handlePrevBubbleScatterPaths",value:function(t){var e=this.w,i=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t,"-series .apexcharts-series"));if(i.length>0)for(var a=0;a<i.length;a++){for(var s=e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t,"-series .apexcharts-series[data\\:realIndex='").concat(a,"'] circle")),r=[],n=0;n<s.length;n++)r.push({x:s[n].getAttribute("cx"),y:s[n].getAttribute("cy"),r:s[n].getAttribute("r")});e.globals.previousPaths.push(r)}}},{key:"clearPreviousPaths",value:function(){var t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var t=this.w,e=t.config.noData,i=new p(this.ctx),a=t.globals.svgWidth/2,s=t.globals.svgHeight/2,r="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,"left"===e.align?(a=10,r="start"):"right"===e.align&&(a=t.globals.svgWidth-10,r="end"),"top"===e.verticalAlign?s=50:"bottom"===e.verticalAlign&&(s=t.globals.svgHeight-50),a+=e.offsetX,s=s+parseInt(e.style.fontSize,10)+2+e.offsetY,void 0!==e.text&&""!==e.text){var n=i.drawText({x:a,y:s,text:e.text,textAnchor:r,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,class:"apexcharts-text-nodata"});t.globals.dom.Paper.add(n)}}},{key:"setNullSeriesToZeroValues",value:function(t){for(var e=this.w,i=0;i<t.length;i++)if(0===t[i].length)for(var a=0;a<t[e.globals.maxValsInArrayIndex].length;a++)t[i].push(0);return t}},{key:"hasAllSeriesEqualX",value:function(){for(var t=!0,e=this.w,i=this.filteredSeriesX(),a=0;a<i.length-1;a++)if(i[a][0]!==i[a+1][0]){t=!1;break}return e.globals.allSeriesHasEqualX=t,t}},{key:"filteredSeriesX",value:function(){var t;return this.w.globals.seriesX.map((function(t){return t.length>0?t:[]}))}}]),t}(),E=function(){function t(i){e(this,t),this.w=i.w,this.barCtx=i}return a(t,[{key:"initVariables",value:function(t){var e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var i=0;i<t.length;i++)if(t[i].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[i].length),e.globals.isXNumeric)for(var a=0;a<t[i].length;a++)e.globals.seriesX[i][a]>e.globals.minX&&e.globals.seriesX[i][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}},{key:"initialPositions",value:function(){var t,e,i,a,s,r,n,o,l=this.w,h=l.globals.dataPoints;if(this.barCtx.isTimelineBar&&(h=l.globals.labels.length),this.barCtx.isHorizontal)s=(i=l.globals.gridHeight/h)/this.barCtx.seriesLen,l.globals.isXNumeric&&(s=(i=l.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),s=s*parseInt(this.barCtx.barOptions.barHeight,10)/100,o=this.barCtx.baseLineInvertedY+l.globals.padHorizontal+(this.barCtx.isReversed?l.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),e=(i-s*this.barCtx.seriesLen)/2;else{if(a=l.globals.gridWidth/this.barCtx.visibleItems,l.config.xaxis.convertedCatToNumeric&&(a=l.globals.gridWidth/l.globals.dataPoints),r=a/this.barCtx.seriesLen*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l.globals.isXNumeric){var c=this.barCtx.xRatio;l.config.xaxis.convertedCatToNumeric&&(c=this.barCtx.initialXRatio),l.globals.minXDiff&&.5!==l.globals.minXDiff&&l.globals.minXDiff/c>0&&(a=l.globals.minXDiff/c),(r=a/this.barCtx.seriesLen*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(r=1)}n=l.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.yaxisIndex]-(this.barCtx.isReversed?l.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.yaxisIndex]:0),t=l.globals.padHorizontal+(a-r*this.barCtx.seriesLen)/2}return{x:t,y:e,yDivision:i,xDivision:a,barHeight:s,barWidth:r,zeroH:n,zeroW:o}}},{key:"getPathFillColor",value:function(t,e,i,a){var s=this.w,r=new L(this.barCtx.ctx),n=null,o=this.barCtx.barOptions.distributed?i:e;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map((function(a){t[e][i]>=a.from&&t[e][i]<=a.to&&(n=a.color)})),s.config.series[e].data[i]&&s.config.series[e].data[i].fillColor&&(n=s.config.series[e].data[i].fillColor),r.fillPath({seriesNumber:this.barCtx.barOptions.distributed?o:a,dataPointIndex:i,color:n,value:t[e][i]})}},{key:"getStrokeWidth",value:function(t,e,i){var a=0,s=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,s.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),a}},{key:"barBackground",value:function(t){var e=t.bc,i=t.i,a=t.x1,s=t.x2,r=t.y1,n=t.y2,o=t.elSeries,l=this.w,h=new p(this.barCtx.ctx),c=new M(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&c===i){e>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(e=0);var d=this.barCtx.barOptions.colors.backgroundBarColors[e],g=h.drawRect(void 0!==a?a:0,void 0!==r?r:0,void 0!==s?s:l.globals.gridWidth,void 0!==n?n:l.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,d,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(g),g.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(t){var e=t.barWidth,i=t.barXPosition,a=t.yRatio,s=t.y1,r=t.y2,n=t.strokeWidth,o=t.series,l=t.realIndex,h=t.i,c=t.j,d=t.w,g=new p(this.barCtx.ctx);(n=Array.isArray(n)?n[l]:n)||(n=0);var u={barWidth:e,strokeWidth:n,yRatio:a,barXPosition:i,y1:s,y2:r},f=this.getRoundedBars(d,u,o,h,c),x=i,b=i+e,m=g.move(x,f.y1),v=g.move(x,f.y1);return d.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(l,c,!1)),{pathTo:m=m+g.line(x,f.y2)+f.endingPath+g.line(b-n,f.y2)+g.line(b-n,f.y1)+f.startingPath+"z",pathFrom:v=v+g.line(x,s)+g.line(b-n,s)+g.line(b-n,s)+g.line(b-n,s)+g.line(x,s)}}},{key:"getBarpaths",value:function(t){var e=t.barYPosition,i=t.barHeight,a=t.x1,s=t.x2,r=t.strokeWidth,n=t.series,o=t.realIndex,l=t.i,h=t.j,c=t.w,d=new p(this.barCtx.ctx);(r=Array.isArray(r)?r[o]:r)||(r=0);var g={barHeight:i,strokeWidth:r,barYPosition:e,x2:s,x1:a},u=this.getRoundedBars(c,g,n,l,h),f=d.move(u.x1,e),x=d.move(u.x1,e);c.globals.previousPaths.length>0&&(x=this.barCtx.getPreviousPath(o,h,!1));var b=e,m=e+i;return{pathTo:f=f+d.line(u.x2,b)+u.endingPath+d.line(u.x2,m-r)+d.line(u.x1,m-r)+u.startingPath+"z",pathFrom:x=x+d.line(a,b)+d.line(a,m-r)+d.line(a,m-r)+d.line(a,m-r)+d.line(a,b)}}},{key:"getRoundedBars",value:function(t,e,i,a,s){var r=new p(this.barCtx.ctx),n=Array.isArray(e.strokeWidth)?e.strokeWidth[a]:e.strokeWidth;if(n||(n=0),this.barCtx.isHorizontal){var o=null,l="",h=e.x2,c=e.x1;if(void 0!==i[a][s]||null!==i[a][s]){var d=i[a][s]<0,g=e.barHeight/2-n;switch(d&&(g=-e.barHeight/2-n),g>Math.abs(h-c)&&(g=Math.abs(h-c)),"rounded"===this.barCtx.barOptions.endingShape&&(h=e.x2-g/2),"rounded"===this.barCtx.barOptions.startingShape&&(c=e.x1+g/2),this.barCtx.barOptions.endingShape){case"flat":o=r.line(h,e.barYPosition+e.barHeight-n);break;case"rounded":o=r.quadraticCurve(h+g,e.barYPosition+(e.barHeight-n)/2,h,e.barYPosition+e.barHeight-n)}switch(this.barCtx.barOptions.startingShape){case"flat":l=r.line(c,e.barYPosition+e.barHeight-n);break;case"rounded":l=r.quadraticCurve(c-g,e.barYPosition+e.barHeight/2,c,e.barYPosition)}}return{endingPath:o,startingPath:l,x2:h,x1:c}}var u=null,f="",x=e.y2,b=e.y1;if(void 0!==i[a][s]||null!==i[a][s]){var m=i[a][s]<0,v=e.barWidth/2-n;switch(m&&(v=-e.barWidth/2-n),v>Math.abs(x-b)&&(v=Math.abs(x-b)),"rounded"===this.barCtx.barOptions.endingShape&&(x+=v/2),"rounded"===this.barCtx.barOptions.startingShape&&(b-=v/2),this.barCtx.barOptions.endingShape){case"flat":u=r.line(e.barXPosition+e.barWidth-n,x);break;case"rounded":u=r.quadraticCurve(e.barXPosition+(e.barWidth-n)/2,x-v,e.barXPosition+e.barWidth-n,x)}switch(this.barCtx.barOptions.startingShape){case"flat":f=r.line(e.barXPosition+e.barWidth-n,b);break;case"rounded":f=r.quadraticCurve(e.barXPosition+(e.barWidth-n)/2,b+v,e.barXPosition,b)}}return{endingPath:u,startingPath:f,y2:x,y1:b}}}]),t}(),X=function(){function t(i,a){e(this,t),this.ctx=i,this.w=i.w;var s=this.w;this.barOptions=s.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=s.config.stroke.width,this.isNullValue=!1,this.isTimelineBar="datetime"===s.config.xaxis.type&&s.globals.seriesRangeBarTimeline.length,this.xyRatios=a,null!==this.xyRatios&&(this.xRatio=a.xRatio,this.initialXRatio=a.initialXRatio,this.yRatio=a.yRatio,this.invertedXRatio=a.invertedXRatio,this.invertedYRatio=a.invertedYRatio,this.baseLineY=a.baseLineY,this.baseLineInvertedY=a.baseLineInvertedY),this.yaxisIndex=0,this.seriesLen=0,this.barHelpers=new E(this)}return a(t,[{key:"draw",value:function(t,e){var i=this.w,a=new p(this.ctx),s=new m(this.ctx,i);t=s.getLogSeries(t),this.series=t,this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);var r=a.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering.");for(var o=0,l=0;o<t.length;o++,l++){var h,c,d,u,f=void 0,x=void 0,b=[],v=[],y=i.globals.comboCharts?e[o]:o,w=a.group({class:"apexcharts-series",rel:o+1,seriesName:g.escapeString(i.globals.seriesNames[y]),"data:realIndex":y});this.ctx.series.addCollapsedClassToSeries(w,y),t[o].length>0&&(this.visibleI=this.visibleI+1);var k=0,A=0;this.yRatio.length>1&&(this.yaxisIndex=y),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;var S=this.barHelpers.initialPositions();x=S.y,k=S.barHeight,c=S.yDivision,u=S.zeroW,f=S.x,A=S.barWidth,h=S.xDivision,d=S.zeroH,this.horizontal||v.push(f+A/2);for(var C=a.group({class:"apexcharts-datalabels","data:realIndex":y}),L=0;L<i.globals.dataPoints;L++){var P=this.barHelpers.getStrokeWidth(o,L,y),T=null,z={indexes:{i:o,j:L,realIndex:y,bc:l},x:f,y:x,strokeWidth:P,elSeries:w};this.isHorizontal?(T=this.drawBarPaths(n({},z,{barHeight:k,zeroW:u,yDivision:c})),A=this.series[o][L]/this.invertedYRatio):(T=this.drawColumnPaths(n({},z,{xDivision:h,barWidth:A,zeroH:d})),k=this.series[o][L]/this.yRatio[this.yaxisIndex]),x=T.y,f=T.x,L>0&&v.push(f+A/2),b.push(x);var I=this.barHelpers.getPathFillColor(t,o,L,y);this.renderSeries({realIndex:y,pathFill:I,j:L,i:o,pathFrom:T.pathFrom,pathTo:T.pathTo,strokeWidth:P,elSeries:w,x:f,y:x,series:t,barHeight:k,barWidth:A,elDataLabelsWrap:C,visibleSeries:this.visibleI,type:"bar"})}i.globals.seriesXvalues[y]=v,i.globals.seriesYvalues[y]=b,r.add(w)}return r}},{key:"renderSeries",value:function(t){var e=t.realIndex,i=t.pathFill,a=t.lineFill,s=t.j,r=t.i,n=t.pathFrom,o=t.pathTo,l=t.strokeWidth,h=t.elSeries,c=t.x,d=t.y,g=t.y1,f=t.y2,x=t.series,b=t.barHeight,m=t.barWidth,v=t.barYPosition,y=t.elDataLabelsWrap,w=t.visibleSeries,k=t.type,A=this.w,S=new p(this.ctx);a||(a=this.barOptions.distributed?A.globals.stroke.colors[s]:A.globals.stroke.colors[e]),A.config.series[r].data[s]&&A.config.series[r].data[s].strokeColor&&(a=A.config.series[r].data[s].strokeColor),this.isNullValue&&(i="none");var C=s/A.config.chart.animations.animateGradually.delay*(A.config.chart.animations.speed/A.globals.dataPoints)/2.4,L=S.renderPaths({i:r,j:s,realIndex:e,pathFrom:n,pathTo:o,stroke:a,strokeWidth:l,strokeLineCap:A.config.stroke.lineCap,fill:i,animationDelay:C,initialSpeed:A.config.chart.animations.speed,dataChangeSpeed:A.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(k,"-area")});L.attr("clip-path","url(#gridRectMask".concat(A.globals.cuid,")")),void 0!==g&&void 0!==f&&(L.attr("data-range-y1",g),L.attr("data-range-y2",f)),new u(this.ctx).setSelectionFilter(L,e,s),h.add(L);var P=new I(this).handleBarDataLabels({x:c,y:d,y1:g,y2:f,i:r,j:s,series:x,realIndex:e,barHeight:b,barWidth:m,barYPosition:v,renderedPath:L,visibleSeries:w});return null!==P&&y.add(P),h.add(y),h}},{key:"drawBarPaths",value:function(t){var e=t.indexes,i=t.barHeight,a=t.strokeWidth,s=t.zeroW,r=t.x,n=t.y,o=t.yDivision,l=t.elSeries,h=this.w,c=e.i,d=e.j,g=e.bc;h.globals.isXNumeric&&(n=(h.globals.seriesX[c][d]-h.globals.minX)/this.invertedXRatio-i);var u=n+i*this.visibleI;r=void 0===this.series[c][d]||null===this.series[c][d]?s:s+this.series[c][d]/this.invertedYRatio-2*(this.isReversed?this.series[c][d]/this.invertedYRatio:0);var f=this.barHelpers.getBarpaths({barYPosition:u,barHeight:i,x1:s,x2:r,strokeWidth:a,series:this.series,realIndex:e.realIndex,i:c,j:d,w:h});return h.globals.isXNumeric||(n+=o),this.barHelpers.barBackground({bc:g,i:c,y1:u-i*this.visibleI,y2:i*this.seriesLen,elSeries:l}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x:r,y:n,barYPosition:u}}},{key:"drawColumnPaths",value:function(t){var e=t.indexes,i=t.x,a=t.y,s=t.xDivision,r=t.barWidth,n=t.zeroH,o=t.strokeWidth,l=t.elSeries,h=this.w,c=e.i,d=e.j,g=e.bc;if(h.globals.isXNumeric){var u=c;h.globals.seriesX[c].length||(u=h.globals.maxValsInArrayIndex),i=(h.globals.seriesX[u][d]-h.globals.minX)/this.xRatio-r*this.seriesLen/2}var f=i+r*this.visibleI;a=void 0===this.series[c][d]||null===this.series[c][d]?n:n-this.series[c][d]/this.yRatio[this.yaxisIndex]+2*(this.isReversed?this.series[c][d]/this.yRatio[this.yaxisIndex]:0);var p=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:r,y1:n,y2:a,strokeWidth:o,series:this.series,realIndex:e.realIndex,i:c,j:d,w:h});return h.globals.isXNumeric||(i+=s),this.barHelpers.barBackground({bc:g,i:c,x1:f-o/2-r*this.visibleI,x2:r*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:i,y:a,barXPosition:f}}},{key:"getPreviousPath",value:function(t,e){for(var i,a=this.w,s=0;s<a.globals.previousPaths.length;s++){var r=a.globals.previousPaths[s];r.paths&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(t,10)&&void 0!==a.globals.previousPaths[s].paths[e]&&(i=a.globals.previousPaths[s].paths[e].d)}return i}}]),t}(),Y=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}return a(t,[{key:"isValidDate",value:function(t){return!isNaN(this.parseDate(t))}},{key:"getTimeStamp",value:function(t){return Date.parse(t)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime():t}},{key:"getDate",value:function(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}},{key:"parseDate",value:function(t){var e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);var i=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return this.getTimeStamp(i)}},{key:"formatDate",value:function(t,e){var i=this.w.globals.locale,a=this.w.config.xaxis.labels.datetimeUTC,s=["\0"].concat(d(i.months)),r=[""].concat(d(i.shortMonths)),n=[""].concat(d(i.days)),o=[""].concat(d(i.shortDays));function l(t,e){var i=t+"";for(e=e||2;i.length<e;)i="0"+i;return i}var h=a?t.getUTCFullYear():t.getFullYear();e=(e=(e=e.replace(/(^|[^\\])yyyy+/g,"$1"+h)).replace(/(^|[^\\])yy/g,"$1"+h.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+h);var c=(a?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\])MMMM+/g,"$1"+s[0])).replace(/(^|[^\\])MMM/g,"$1"+r[0])).replace(/(^|[^\\])MM/g,"$1"+l(c))).replace(/(^|[^\\])M/g,"$1"+c);var g=a?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\])dddd+/g,"$1"+n[0])).replace(/(^|[^\\])ddd/g,"$1"+o[0])).replace(/(^|[^\\])dd/g,"$1"+l(g))).replace(/(^|[^\\])d/g,"$1"+g);var u=a?t.getUTCHours():t.getHours(),f=u>12?u-12:0===u?12:u;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(u))).replace(/(^|[^\\])H/g,"$1"+u)).replace(/(^|[^\\])hh+/g,"$1"+l(f))).replace(/(^|[^\\])h/g,"$1"+f);var p=a?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(p))).replace(/(^|[^\\])m/g,"$1"+p);var x=a?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(x))).replace(/(^|[^\\])s/g,"$1"+x);var b=a?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(b,3)),b=Math.round(b/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(b)),b=Math.round(b/10);var m=u<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+b)).replace(/(^|[^\\])TT+/g,"$1"+m)).replace(/(^|[^\\])T/g,"$1"+m.charAt(0));var v=m.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+v)).replace(/(^|[^\\])t/g,"$1"+v.charAt(0));var y=-t.getTimezoneOffset(),w=a||!y?"Z":y>0?"+":"-";if(!a){var k=(y=Math.abs(y))%60;w+=l(Math.floor(y/60))+":"+l(k)}e=e.replace(/(^|[^\\])K/g,"$1"+w);var A=(a?t.getUTCDay():t.getDay())+1;return(e=(e=(e=(e=e.replace(new RegExp(n[0],"g"),n[A])).replace(new RegExp(o[0],"g"),o[A])).replace(new RegExp(s[0],"g"),s[c])).replace(new RegExp(r[0],"g"),r[c])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(t,e,i){var a=this.w;void 0!==a.config.xaxis.min&&(t=a.config.xaxis.min),void 0!==a.config.xaxis.max&&(e=a.config.xaxis.max);var s=this.getDate(t),r=this.getDate(e),n=this.formatDate(s,"yyyy MM dd HH mm").split(" "),o=this.formatDate(r,"yyyy MM dd HH mm").split(" ");return{minMinute:parseInt(n[4],10),maxMinute:parseInt(o[4],10),minHour:parseInt(n[3],10),maxHour:parseInt(o[3],10),minDate:parseInt(n[2],10),maxDate:parseInt(o[2],10),minMonth:parseInt(n[1],10)-1,maxMonth:parseInt(o[1],10)-1,minYear:parseInt(n[0],10),maxYear:parseInt(o[0],10)}}},{key:"isLeapYear",value:function(t){return t%4==0&&t%100!=0||t%400==0}},{key:"calculcateLastDaysOfMonth",value:function(t,e,i){return this.determineDaysOfMonths(t,e)-i}},{key:"determineDaysOfYear",value:function(t){var e=365;return this.isLeapYear(t)&&(e=366),e}},{key:"determineRemainingDaysOfYear",value:function(t,e,i){var a=this.daysCntOfYear[e]+i;return e>1&&this.isLeapYear()&&a++,a}},{key:"determineDaysOfMonths",value:function(t,e){var i=30;switch(t=g.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(i=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:i=31}return i}}]),t}(),F=function(t){function i(){return e(this,i),c(this,l(i).apply(this,arguments))}return o(i,t),a(i,[{key:"draw",value:function(t,e){var i=this.w,a=new p(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=i.globals.seriesRangeStart,this.seriesRangeEnd=i.globals.seriesRangeEnd,this.barHelpers.initVariables(t);for(var s=a.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),r=0;r<t.length;r++){var o,l,h,c=void 0,d=void 0,u=void 0,f=i.globals.comboCharts?e[r]:r,x=a.group({class:"apexcharts-series",seriesName:g.escapeString(i.globals.seriesNames[f]),rel:r+1,"data:realIndex":f});t[r].length>0&&(this.visibleI=this.visibleI+1);var b=0,m=0;this.yRatio.length>1&&(this.yaxisIndex=f);var v=this.barHelpers.initialPositions();d=v.y,h=v.zeroW,c=v.x,m=v.barWidth,o=v.xDivision,l=v.zeroH;for(var y=a.group({class:"apexcharts-datalabels","data:realIndex":f}),w=0;w<i.globals.dataPoints;w++){var k=this.barHelpers.getStrokeWidth(r,w,f),A=this.seriesRangeStart[r][w],S=this.seriesRangeEnd[r][w],C=null,L=null,P={x:c,y:d,strokeWidth:k,elSeries:x};if(u=v.yDivision,b=v.barHeight,this.isHorizontal){L=d+b*this.visibleI;var T=(u-b*this.seriesLen)/2;if(void 0===i.config.series[r].data[w])break;if(this.isTimelineBar&&i.config.series[r].data[w].x){var z=this.detectOverlappingBars({i:r,j:w,barYPosition:L,srty:T,barHeight:b,yDivision:u,initPositions:v});b=z.barHeight,L=z.barYPosition}m=(C=this.drawRangeBarPaths(n({indexes:{i:r,j:w,realIndex:f},barHeight:b,barYPosition:L,zeroW:h,yDivision:u,y1:A,y2:S},P))).barWidth}else b=(C=this.drawRangeColumnPaths(n({indexes:{i:r,j:w,realIndex:f},zeroH:l,barWidth:m,xDivision:o},P))).barHeight;d=C.y,c=C.x;var I=this.barHelpers.getPathFillColor(t,r,w,f),M=i.globals.stroke.colors[f];this.renderSeries({realIndex:f,pathFill:I,lineFill:M,j:w,i:r,x:c,y:d,y1:A,y2:S,pathFrom:C.pathFrom,pathTo:C.pathTo,strokeWidth:k,elSeries:x,series:t,barHeight:b,barYPosition:L,barWidth:m,elDataLabelsWrap:y,visibleSeries:this.visibleI,type:"rangebar"})}s.add(x)}return s}},{key:"detectOverlappingBars",value:function(t){var e=t.i,i=t.j,a=t.barYPosition,s=t.srty,r=t.barHeight,n=t.yDivision,o=t.initPositions,l=this.w,h=[],c=l.config.series[e].data[i].rangeName,d=l.config.series[e].data[i].x,g=l.globals.labels.indexOf(d),u=l.globals.seriesRangeBarTimeline[e].findIndex((function(t){return t.x===d&&t.overlaps.length>0}));return a=s+r*this.visibleI+n*g,u>-1&&!l.config.plotOptions.bar.rangeBarOverlap&&(h=l.globals.seriesRangeBarTimeline[e][u].overlaps).indexOf(c)>-1&&(a=(r=o.barHeight/h.length)*this.visibleI+n*(100-parseInt(this.barOptions.barHeight,10))/100/2+r*(this.visibleI+h.indexOf(c))+n*g),{barYPosition:a,barHeight:r}}},{key:"drawRangeColumnPaths",value:function(t){var e=t.indexes,i=t.x,a=(t.strokeWidth,t.xDivision),s=t.barWidth,r=t.zeroH,n=this.w,o=e.i,l=e.j,h=this.yRatio[this.yaxisIndex],c=e.realIndex,d=this.getRangeValue(c,l),g=Math.min(d.start,d.end),u=Math.max(d.start,d.end);n.globals.isXNumeric&&(i=(n.globals.seriesX[o][l]-n.globals.minX)/this.xRatio-s/2);var f=i+s*this.visibleI;void 0===this.series[o][l]||null===this.series[o][l]?g=r:(g=r-g/h,u=r-u/h);var p=Math.abs(u-g),x=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:s,y1:g,y2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:c,j:l,w:n});return n.globals.isXNumeric||(i+=a),{pathTo:x.pathTo,pathFrom:x.pathFrom,barHeight:p,x:i,y:u,barXPosition:f}}},{key:"drawRangeBarPaths",value:function(t){var e=t.indexes,i=t.y,a=t.y1,s=t.y2,r=t.yDivision,n=t.barHeight,o=t.barYPosition,l=t.zeroW,h=this.w,c=l+a/this.invertedYRatio,d=l+s/this.invertedYRatio,g=Math.abs(d-c),u=this.barHelpers.getBarpaths({barYPosition:o,barHeight:n,x1:c,x2:d,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:e.realIndex,j:e.j,w:h});return h.globals.isXNumeric||(i+=r),{pathTo:u.pathTo,pathFrom:u.pathFrom,barWidth:g,x:d,y:i}}},{key:"getRangeValue",value:function(t,e){var i=this.w;return{start:i.globals.seriesRangeStart[t][e],end:i.globals.seriesRangeEnd[t][e]}}},{key:"getTooltipValues",value:function(t){var e=t.ctx,i=t.seriesIndex,a=t.dataPointIndex,s=t.y1,r=t.y2,n=t.w,o=n.globals.seriesRangeStart[i][a],l=n.globals.seriesRangeEnd[i][a],h=n.globals.labels[a],c=n.config.series[i].name,d=n.config.tooltip.y.formatter,g=n.config.tooltip.y.title.formatter,u={w:n,seriesIndex:i,dataPointIndex:a};"function"==typeof g&&(c=g(c,u)),s&&r&&(o=s,l=r,n.config.series[i].data[a].x&&(h=n.config.series[i].data[a].x+":"),"function"==typeof d&&(h=d(h,u)));var f="",p="",x=n.globals.colors[i];if(void 0===n.config.tooltip.x.formatter)if("datetime"===n.config.xaxis.type){var b=new Y(e);f=b.formatDate(b.getDate(o),n.config.tooltip.x.format),p=b.formatDate(b.getDate(l),n.config.tooltip.x.format)}else f=o,p=l;else f=n.config.tooltip.x.formatter(o),p=n.config.tooltip.x.formatter(l);return{start:o,end:l,startVal:f,endVal:p,ylabel:h,color:x,seriesName:c}}},{key:"buildCustomTooltipHTML",value:function(t){var e,i;return'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+t.color+'">'+(t.seriesName||"")+'</span></div><div> <span class="category">'+t.ylabel+' </span> <span class="value start-value">'+t.start+'</span> <span class="separator">-</span> <span class="value end-value">'+t.end+"</span></div></div>"}}]),i}(X),R=function(){function t(i){e(this,t),this.opts=i}return a(t,[{key:"line",value:function(){return{chart:{animations:{easing:"swing"}},dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(t){return this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0,g.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:"bar",value:function(){return{chart:{stacked:!1,animations:{easing:"swing"}},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square",radius:2,size:8}},tooltip:{shared:!1},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:"candlestick",value:function(){return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(t){var e=t.seriesIndex,i=t.dataPointIndex,a=t.w;return'<div class="apexcharts-tooltip-candlestick"><div>Open: <span class="value">'+a.globals.seriesCandleO[e][i]+'</span></div><div>High: <span class="value">'+a.globals.seriesCandleH[e][i]+'</span></div><div>Low: <span class="value">'+a.globals.seriesCandleL[e][i]+'</span></div><div>Close: <span class="value">'+a.globals.seriesCandleC[e][i]+"</span></div></div>"}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{stroke:{width:0,lineCap:"square"},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(t,e){e.ctx;var i=e.seriesIndex,a=e.dataPointIndex,s=e.w,r=s.globals.seriesRangeStart[i][a];return s.globals.seriesRangeEnd[i][a]-r},background:{enabled:!1},style:{colors:["#fff"]}},tooltip:{shared:!1,followCursor:!0,custom:function(t){return t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?function(t){var e=new F(t.ctx,null),i=e.getTooltipValues(t),a=i.color,s=i.seriesName,r=i.ylabel,n=i.startVal,o=i.endVal;return e.buildCustomTooltipHTML({color:a,seriesName:s,ylabel:r,start:n,end:o})}(t):function(t){var e=new F(t.ctx,null),i=e.getTooltipValues(t),a=i.color,s=i.seriesName,r=i.ylabel,n=i.start,o=i.end;return e.buildCustomTooltipHTML({color:a,seriesName:s,ylabel:r,start:n,end:o})}(t)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"area",value:function(){return{stroke:{width:4},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"brush",value:function(t){return g.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;var e=t.dataLabels.formatter;return t.yaxis.forEach((function(e,i){t.yaxis[i].min=0,t.yaxis[i].max=100})),"bar"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),t}},{key:"convertCatToNumeric",value:function(t){return t.xaxis.convertedCatToNumeric=!0,t}},{key:"convertCatToNumericXaxis",value:function(t,e,i){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return g.isNumber(t)?Math.floor(t):t};var a=t.xaxis.labels.formatter,s=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return i&&i.length&&(s=i.map((function(t){return t.toString()}))),s&&s.length&&(t.xaxis.labels.formatter=function(t){return g.isNumber(t)?a(s[Math.floor(t)-1]):a(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square",size:10,offsetY:2}},grid:{padding:{right:20}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"polarArea",value:function(){return this.opts.yaxis[0].tickAmount=this.opts.yaxis[0].tickAmount?this.opts.yaxis[0].tickAmount:6,{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:3,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1},xaxis:{labels:{formatter:function(t){return t},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0}}}}]),t}(),D=function(){function i(t){e(this,i),this.opts=t}return a(i,[{key:"init",value:function(e){var i=e.responsiveOverride,a=this.opts,s=new S,r=new R(a);this.chartType=a.chart.type,"histogram"===this.chartType&&(a.chart.type="bar",a=g.extend({plotOptions:{bar:{columnWidth:"99.99%"}}},a)),a=this.extendYAxis(a),a=this.extendAnnotations(a);var n=s.init(),o={};if(a&&"object"===t(a)){var l={};l=-1!==["line","area","bar","candlestick","rangeBar","histogram","bubble","scatter","heatmap","pie","polarArea","donut","radar","radialBar"].indexOf(a.chart.type)?r[a.chart.type]():r.line(),a.chart.brush&&a.chart.brush.enabled&&(l=r.brush(l)),a.chart.stacked&&"100%"===a.chart.stackType&&(a=r.stacked100(a)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(a),a.xaxis=a.xaxis||window.Apex.xaxis||{},i||(a.xaxis.convertedCatToNumeric=!1),((a=this.checkForCatToNumericXAxis(this.chartType,l,a)).chart.sparkline&&a.chart.sparkline.enabled||window.Apex.chart&&window.Apex.chart.sparkline&&window.Apex.chart.sparkline.enabled)&&(l=r.sparkline(l)),o=g.extend(n,l)}var h=g.extend(o,window.Apex);return n=g.extend(h,a),this.handleUserInputErrors(n)}},{key:"checkForCatToNumericXAxis",value:function(t,e,i){var a=new R(i),s="bar"===t&&i.plotOptions&&i.plotOptions.bar&&i.plotOptions.bar.horizontal,r="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,n="datetime"!==i.xaxis.type&&"numeric"!==i.xaxis.type,o=i.xaxis.tickPlacement?i.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return s||r||!n||"between"===o||(i=a.convertCatToNumeric(i)),i}},{key:"extendYAxis",value:function(t,e){var i=new S;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={}),t.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(t.yaxis=g.extend(t.yaxis,window.Apex.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[g.extend(i.yAxis,t.yaxis)]:t.yaxis=g.extendArray(t.yaxis,i.yAxis);var a=!1;t.yaxis.forEach((function(t){t.logarithmic&&(a=!0)}));var s=t.series;return e&&!s&&(s=e.config.series),a&&s.length!==t.yaxis.length&&s.length&&(t.yaxis=s.map((function(e,a){if(e.name||(s[a].name="series-".concat(a+1)),t.yaxis[a])return t.yaxis[a].seriesName=s[a].name,t.yaxis[a];var r=g.extend(i.yAxis,t.yaxis[0]);return r.show=!1,r}))),a&&s.length>1&&s.length!==t.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes. Please make sure to equalize both."),t}},{key:"extendAnnotations",value:function(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),this.extendPointAnnotations(t)}},{key:"extendYAxisAnnotations",value:function(t){var e=new S;return t.annotations.yaxis=g.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}},{key:"extendXAxisAnnotations",value:function(t){var e=new S;return t.annotations.xaxis=g.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}},{key:"extendPointAnnotations",value:function(t){var e=new S;return t.annotations.points=g.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}},{key:"checkForDarkTheme",value:function(t){t.theme&&"dark"===t.theme.mode&&(t.tooltip||(t.tooltip={}),"light"!==t.tooltip.theme&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.theme.palette||(t.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(t){var e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if(("bar"===e.chart.type||"rangeBar"===e.chart.type)&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return"bar"!==e.chart.type&&"rangeBar"!==e.chart.type||e.tooltip.shared&&("barWidth"===e.xaxis.crosshairs.width&&e.series.length>1&&(console.warn('crosshairs.width = "barWidth" is only supported in single series, not in a multi-series barChart.'),e.xaxis.crosshairs.width="tickWidth"),e.plotOptions.bar.horizontal&&(e.states.hover.type="none",e.tooltip.shared=!1),e.tooltip.followCursor||(console.warn("followCursor option in shared columns cannot be turned off. Please set %ctooltip.followCursor: true","color: blue;"),e.tooltip.followCursor=!0)),"candlestick"===e.chart.type&&e.yaxis[0].reversed&&(console.warn("Reversed y-axis in candlestick chart is not supported."),e.yaxis[0].reversed=!1),e.chart.group&&0===e.yaxis[0].labels.minWidth&&console.warn("It looks like you have multiple charts in synchronization. You must provide yaxis.labels.minWidth which must be EQUAL for all grouped charts to prevent incorrect behaviour."),Array.isArray(e.stroke.width)&&"line"!==e.chart.type&&"area"!==e.chart.type&&(console.warn("stroke.width option accepts array only for line and area charts. Reverted back to Number"),e.stroke.width=e.stroke.width[0]),e}}]),i}(),H=function(){function t(){e(this,t)}return a(t,[{key:"initGlobalVars",value:function(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRangeBarTimeline=[],t.seriesPercent=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.labels=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.isXNumeric=!1,t.xaxisLabelsCount=0,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0}},{key:"globalVars",value:function(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],goldenPadding:35,invalidLogScale:!1,ignoreYAxisIndexes:[],yAxisSameScaleIndices:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:"zoom"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:"pan"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:"selection"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,easing:null,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null}}},{key:"init",value:function(t){var e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=g.extend({},t),e.initialSeries=g.clone(t.series),e.lastXAxis=JSON.parse(JSON.stringify(e.initialConfig.xaxis)),e.lastYAxis=JSON.parse(JSON.stringify(e.initialConfig.yaxis)),e}}]),t}(),N=function(){function t(i){e(this,t),this.opts=i}return a(t,[{key:"init",value:function(){var t=new D(this.opts).init({responsiveOverride:!1});return{config:t,globals:(new H).init(t)}}}]),t}(),O=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.coreUtils=new m(this.ctx)}return a(t,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var t=this.w.config.series.slice(),e=new M(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&null!==t[this.activeSeriesIndex].data[0]&&void 0!==t[this.activeSeriesIndex].data[0].x&&null!==t[this.activeSeriesIndex].data[0])return!0}},{key:"isFormat2DArray",value:function(){var t=this.w.config.series.slice(),e=new M(this.ctx);if(this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),void 0!==t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&void 0!==t[this.activeSeriesIndex].data[0]&&null!==t[this.activeSeriesIndex].data[0]&&t[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(t,e){var i=this.w.config,a=this.w.globals;i.xaxis.sorted&&("datetime"===i.xaxis.type?t[e].data.sort((function(t,e){return new Date(t[0]).getTime()-new Date(e[0]).getTime()})):"numeric"===i.xaxis.type&&t[e].data.sort((function(t,e){return t[0]-e[0]})));for(var s=0;s<t[e].data.length;s++)if(void 0!==t[e].data[s][1]&&(Array.isArray(t[e].data[s][1])&&4===t[e].data[s][1].length?this.twoDSeries.push(g.parseNumber(t[e].data[s][1][3])):5===t[e].data[s].length?this.twoDSeries.push(g.parseNumber(t[e].data[s][4])):this.twoDSeries.push(g.parseNumber(t[e].data[s][1])),a.dataFormatXNumeric=!0),"datetime"===i.xaxis.type){var r=new Date(t[e].data[s][0]);r=new Date(r).getTime(),this.twoDSeriesX.push(r)}else this.twoDSeriesX.push(t[e].data[s][0]);for(var n=0;n<t[e].data.length;n++)void 0!==t[e].data[n][2]&&(this.threeDSeries.push(t[e].data[n][2]),a.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(t,e){var i=this.w.config,a=this.w.globals,s=new Y(this.ctx),r=e;a.collapsedSeriesIndices.indexOf(e)>-1&&(r=this.activeSeriesIndex),i.xaxis.sorted&&("datetime"===i.xaxis.type?t[e].data.sort((function(t,e){return new Date(t.x).getTime()-new Date(e.x).getTime()})):"numeric"===i.xaxis.type&&t[e].data.sort((function(t,e){return t.x-e.x})));for(var n=0;n<t[e].data.length;n++)void 0!==t[e].data[n].y&&(Array.isArray(t[e].data[n].y)?this.twoDSeries.push(g.parseNumber(t[e].data[n].y[t[e].data[n].y.length-1])):this.twoDSeries.push(g.parseNumber(t[e].data[n].y)));for(var o=0;o<t[r].data.length;o++){var l="string"==typeof t[r].data[o].x,h=Array.isArray(t[r].data[o].x),c=!h&&!!s.isValidDate(t[r].data[o].x.toString());if(l||c)if(l||i.xaxis.convertedCatToNumeric){var d=a.isBarHorizontal&&a.isRangeData;"datetime"!==i.xaxis.type||d?(this.fallbackToCategory=!0,this.twoDSeriesX.push(t[r].data[o].x)):this.twoDSeriesX.push(s.parseDate(t[r].data[o].x))}else"datetime"===i.xaxis.type?this.twoDSeriesX.push(s.parseDate(t[r].data[o].x.toString())):(a.dataFormatXNumeric=!0,a.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(t[r].data[o].x)));else h?(this.fallbackToCategory=!0,this.twoDSeriesX.push(t[r].data[o].x)):(a.isXNumeric=!0,a.dataFormatXNumeric=!0,this.twoDSeriesX.push(t[r].data[o].x))}if(t[e].data[0]&&void 0!==t[e].data[0].z){for(var u=0;u<t[e].data.length;u++)this.threeDSeries.push(t[e].data[u].z);a.isDataXYZ=!0}}},{key:"handleRangeData",value:function(t,e){var i=this.w.config,a=this.w.globals,s={};return this.isFormat2DArray()?s=this.handleRangeDataFormat("array",t,e):this.isFormatXY()&&(s=this.handleRangeDataFormat("xy",t,e)),a.seriesRangeStart.push(s.start),a.seriesRangeEnd.push(s.end),"datetime"===i.xaxis.type&&a.seriesRangeBarTimeline.push(s.rangeUniques),a.seriesRangeBarTimeline.forEach((function(t,e){t&&t.forEach((function(t,e){t.y.forEach((function(e,i){for(var a=0;a<t.y.length;a++)if(i!==a){var s=e.y1,r=e.y2,n=t.y[a].y1;s<=t.y[a].y2&&n<=r&&(t.overlaps.indexOf(e.rangeName)<0&&t.overlaps.push(e.rangeName),t.overlaps.indexOf(t.y[a].rangeName)<0&&t.overlaps.push(t.y[a].rangeName))}}))}))})),s}},{key:"handleCandleStickData",value:function(t,e){var i=this.w.globals,a={};return this.isFormat2DArray()?a=this.handleCandleStickDataFormat("array",t,e):this.isFormatXY()&&(a=this.handleCandleStickDataFormat("xy",t,e)),i.seriesCandleO[e]=a.o,i.seriesCandleH[e]=a.h,i.seriesCandleL[e]=a.l,i.seriesCandleC[e]=a.c,a}},{key:"handleRangeDataFormat",value:function(t,e,i){var a=[],s=[],r=e[i].data.filter((function(t,e,i){return e===i.findIndex((function(e){return e.x===t.x}))})).map((function(t,e){return{x:t.x,overlaps:[],y:[]}})),n="Please provide [Start, End] values in valid format. Read more https://apexcharts.com/docs/series/#rangecharts",o=new M(this.ctx).getActiveConfigSeriesIndex();if("array"===t){if(2!==e[o].data[0][1].length)throw new Error(n);for(var l=0;l<e[i].data.length;l++)a.push(e[i].data[l][1][0]),s.push(e[i].data[l][1][1])}else if("xy"===t){if(2!==e[o].data[0].y.length)throw new Error(n);for(var h=function(t){var n=g.randomId(),o=e[i].data[t].x,l={y1:e[i].data[t].y[0],y2:e[i].data[t].y[1],rangeName:n};e[i].data[t].rangeName=n;var h=r.findIndex((function(t){return t.x===o}));r[h].y.push(l),a.push(l.y1),s.push(l.y2)},c=0;c<e[i].data.length;c++)h(c)}return{start:a,end:s,rangeUniques:r}}},{key:"handleCandleStickDataFormat",value:function(t,e,i){var a=[],s=[],r=[],n=[],o="Please provide [Open, High, Low and Close] values in valid format. Read more https://apexcharts.com/docs/series/#candlestick";if("array"===t){if(!Array.isArray(e[i].data[0][1])&&5!==e[i].data[0].length||Array.isArray(e[i].data[0][1])&&4!==e[i].data[0][1].length)throw new Error(o);if(5===e[i].data[0].length)for(var l=0;l<e[i].data.length;l++)a.push(e[i].data[l][1]),s.push(e[i].data[l][2]),r.push(e[i].data[l][3]),n.push(e[i].data[l][4]);else for(var h=0;h<e[i].data.length;h++)a.push(e[i].data[h][1][0]),s.push(e[i].data[h][1][1]),r.push(e[i].data[h][1][2]),n.push(e[i].data[h][1][3])}else if("xy"===t){if(4!==e[i].data[0].y.length)throw new Error(o);for(var c=0;c<e[i].data.length;c++)a.push(e[i].data[c].y[0]),s.push(e[i].data[c].y[1]),r.push(e[i].data[c].y[2]),n.push(e[i].data[c].y[3])}return{o:a,h:s,l:r,c:n}}},{key:"parseDataAxisCharts",value:function(t){for(var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.ctx,a=this.w.config,s=this.w.globals,r=new Y(i),n=a.labels.length>0?a.labels.slice():a.xaxis.categories.slice(),o=function(){for(var t=0;t<n.length;t++)if("string"==typeof n[t]){if(!r.isValidDate(n[t]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");e.twoDSeriesX.push(r.parseDate(n[t]))}else{if(13!==String(n[t]).length)throw new Error("Please provide a valid JavaScript timestamp");e.twoDSeriesX.push(n[t])}},l=0;l<t.length;l++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[l].data)return void console.error("It is a possibility that you may have not included 'data' property in series.");if("rangeBar"!==a.chart.type&&"rangeArea"!==a.chart.type&&"rangeBar"!==t[l].type&&"rangeArea"!==t[l].type||(s.isRangeData=!0,this.handleRangeData(t,l)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,l):this.isFormatXY()&&this.handleFormatXY(t,l),"candlestick"!==a.chart.type&&"candlestick"!==t[l].type||this.handleCandleStickData(t,l),s.series.push(this.twoDSeries),s.labels.push(this.twoDSeriesX),s.seriesX.push(this.twoDSeriesX),l!==this.activeSeriesIndex||this.fallbackToCategory||(s.isXNumeric=!0);else{"datetime"===a.xaxis.type?(s.isXNumeric=!0,o(),s.seriesX.push(this.twoDSeriesX)):"numeric"===a.xaxis.type&&(s.isXNumeric=!0,n.length>0&&(this.twoDSeriesX=n,s.seriesX.push(this.twoDSeriesX))),s.labels.push(this.twoDSeriesX);var h=t[l].data.map((function(t){return g.parseNumber(t)}));s.series.push(h)}s.seriesZ.push(this.threeDSeries),void 0!==t[l].name?s.seriesNames.push(t[l].name):s.seriesNames.push("series-"+parseInt(l+1,10))}return this.w}},{key:"parseDataNonAxisCharts",value:function(t){var e=this.w.globals,i=this.w.config;e.series=t.slice(),e.seriesNames=i.labels.slice();for(var a=0;a<e.series.length;a++)void 0===e.seriesNames[a]&&e.seriesNames.push("series-"+(a+1));return this.w}},{key:"handleExternalLabelsData",value:function(t){var e=this.w.config,i=this.w.globals;e.xaxis.categories.length>0?i.labels=e.xaxis.categories:e.labels.length>0?i.labels=e.labels.slice():this.fallbackToCategory?(i.labels=i.labels[0],i.seriesRangeBarTimeline.length&&(i.seriesRangeBarTimeline.map((function(t){t.forEach((function(t){i.labels.indexOf(t.x)<0&&t.x&&i.labels.push(t.x)}))})),i.labels=i.labels.filter((function(t,e,i){return i.indexOf(t)===e}))),e.xaxis.convertedCatToNumeric&&(new R(e).convertCatToNumericXaxis(e,this.ctx,i.seriesX[0]),this._generateExternalLabels(t))):this._generateExternalLabels(t)}},{key:"_generateExternalLabels",value:function(t){var e=this.w.globals,i=this.w.config,a=[];if(e.axisCharts){if(e.series.length>0)for(var s=0;s<e.series[e.maxValsInArrayIndex].length;s++)a.push(s+1);e.seriesX=[];for(var r=0;r<t.length;r++)e.seriesX.push(a);e.isXNumeric=!0}if(0===a.length){a=e.axisCharts?[]:e.series.map((function(t,e){return e+1}));for(var n=0;n<t.length;n++)e.seriesX.push(a)}e.labels=a,i.xaxis.convertedCatToNumeric&&(e.categoryLabels=a.map((function(t){return i.xaxis.labels.formatter(t)}))),e.noLabelsProvided=!0}},{key:"parseData",value:function(t){var e=this.w,i=e.config,a=e.globals;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),a.axisCharts?this.parseDataAxisCharts(t):this.parseDataNonAxisCharts(t),this.coreUtils.getLargestSeries(),"bar"===i.chart.type&&i.chart.stacked){var s=new M(this.ctx);a.series=s.setNullSeriesToZeroValues(a.series)}this.coreUtils.getSeriesTotals(),a.axisCharts&&this.coreUtils.getStackedSeriesTotals(),this.coreUtils.getPercentSeries(),a.dataFormatXNumeric||a.isXNumeric&&("numeric"!==i.xaxis.type||0!==i.labels.length||0!==i.xaxis.categories.length)||this.handleExternalLabelsData(t);for(var r=this.coreUtils.getCategoryLabels(a.labels),n=0;n<r.length;n++)if(Array.isArray(r[n])){a.isMultiLineX=!0;break}}},{key:"excludeCollapsedSeriesInYAxis",value:function(){var t=this,e=this.w;e.globals.ignoreYAxisIndexes=e.globals.collapsedSeries.map((function(i,a){if(t.w.globals.isMultipleYAxis&&!e.config.chart.stacked)return i.index}))}}]),t}(),W=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.tooltipKeyFormat="dd MMM"}return a(t,[{key:"xLabelFormat",value:function(t,e,i){var a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){var s=new Y(this.ctx);return s.formatDate(s.getDate(e),a.config.tooltip.x.format)}return t(e,i)}},{key:"defaultGeneralFormatter",value:function(t){return Array.isArray(t)?t.map((function(t){return t})):t}},{key:"defaultYFormatter",value:function(t,e,i){var a=this.w;return g.isNumber(t)&&(t=0!==a.globals.yValueDecimal?t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:a.globals.yValueDecimal):a.globals.maxYArr[i]-a.globals.minYArr[i]<10?t.toFixed(1):t.toFixed(0)),t}},{key:"setLabelFormatters",value:function(){var t=this,e=this.w;return e.globals.xLabelFormatter=function(e){return t.defaultGeneralFormatter(e)},e.globals.xaxisTooltipFormatter=function(e){return t.defaultGeneralFormatter(e)},e.globals.ttKeyFormatter=function(e){return t.defaultGeneralFormatter(e)},e.globals.ttZFormatter=function(t){return t},e.globals.legendFormatter=function(e){return t.defaultGeneralFormatter(e)},void 0!==e.config.xaxis.labels.formatter?e.globals.xLabelFormatter=e.config.xaxis.labels.formatter:e.globals.xLabelFormatter=function(t){return g.isNumber(t)?!e.config.xaxis.convertedCatToNumeric&&"numeric"===e.config.xaxis.type&&e.globals.dataPoints<50?t.toFixed(1):e.globals.isBarHorizontal&&e.globals.maxY-e.globals.minYArr<4?t.toFixed(1):t.toFixed(0):t},"function"==typeof e.config.tooltip.x.formatter?e.globals.ttKeyFormatter=e.config.tooltip.x.formatter:e.globals.ttKeyFormatter=e.globals.xLabelFormatter,"function"==typeof e.config.xaxis.tooltip.formatter&&(e.globals.xaxisTooltipFormatter=e.config.xaxis.tooltip.formatter),Array.isArray(e.config.tooltip.y)?e.globals.ttVal=e.config.tooltip.y:void 0!==e.config.tooltip.y.formatter&&(e.globals.ttVal=e.config.tooltip.y),void 0!==e.config.tooltip.z.formatter&&(e.globals.ttZFormatter=e.config.tooltip.z.formatter),void 0!==e.config.legend.formatter&&(e.globals.legendFormatter=e.config.legend.formatter),e.config.yaxis.forEach((function(i,a){void 0!==i.labels.formatter?e.globals.yLabelFormatters[a]=i.labels.formatter:e.globals.yLabelFormatters[a]=function(s){return e.globals.xyCharts?Array.isArray(s)?s.map((function(e){return t.defaultYFormatter(e,i,a)})):t.defaultYFormatter(s,i,a):s}})),e.globals}},{key:"heatmapLabelFormatters",value:function(){var t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.globals.seriesNames.slice();var e=t.globals.seriesNames.reduce((function(t,e){return t.length>e.length?t:e}),0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}]),t}(),B=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"getLabel",value:function(t,e,i,a){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"12px",n=this.w,o=void 0===t[a]?"":t[a],l=o,h=n.globals.xLabelFormatter,c=n.config.xaxis.labels.formatter,d=!1,g=new W(this.ctx),u=o;l=g.xLabelFormat(h,o,u),void 0!==c&&(l=c(o,t[a],a));var f=function(t){var i=null;return e.forEach((function(t){"month"===t.unit?i="year":"day"===t.unit?i="month":"hour"===t.unit?i="day":"minute"===t.unit&&(i="hour")})),i===t};e.length>0?(d=f(e[a].unit),i=e[a].position,l=e[a].value):"datetime"===n.config.xaxis.type&&void 0===c&&(l=""),void 0===l&&(l=""),l=Array.isArray(l)?l:l.toString();var x=new p(this.ctx),b={};return b=n.globals.rotateXLabels?x.getTextRects(l,parseInt(r,10),null,"rotate(".concat(n.config.xaxis.labels.rotate," 0 0)"),!1):x.getTextRects(l,parseInt(r,10)),!Array.isArray(l)&&(0===l.indexOf("NaN")||0===l.toLowerCase().indexOf("invalid")||l.toLowerCase().indexOf("infinity")>=0||s.indexOf(l)>=0&&!n.config.xaxis.labels.showDuplicates)&&(l=""),{x:i,text:l,textRect:b,isBold:d}}},{key:"checkForOverflowingLabels",value:function(t,e,i,a,s){var r=this.w;if(0===t&&r.globals.skipFirstTimelinelabel&&(e.text=""),t===i-1&&r.globals.skipLastTimelinelabel&&(e.text=""),r.config.xaxis.labels.hideOverlappingLabels&&a.length>0){var n=s[s.length-1];e.x<n.textRect.width/(r.globals.rotateXLabels?Math.abs(r.config.xaxis.labels.rotate)/12:1.01)+n.x&&(e.text="")}return e}},{key:"checkForReversedLabels",value:function(t,e){var i=this.w;return i.config.yaxis[t]&&i.config.yaxis[t].reversed&&e.reverse(),e}},{key:"isYAxisHidden",value:function(t){var e=this.w,i=new m(this.ctx);return!e.config.yaxis[t].show||!e.config.yaxis[t].showForNullSeries&&i.isSeriesNull(t)&&-1===e.globals.collapsedSeriesIndices.indexOf(t)}},{key:"drawYAxisTicks",value:function(t,e,i,a,s,r,n){var o=this.w,l=new p(this.ctx),h=o.globals.translateY;if(a.show&&e>0){!0===o.config.yaxis[s].opposite&&(t+=a.width);for(var c=e;c>=0;c--){var d=h+e/10+o.config.yaxis[s].labels.offsetY-1;o.globals.isBarHorizontal&&(d=r*c),"heatmap"===o.config.chart.type&&(d+=r/2);var g=l.drawLine(t+i.offsetX-a.width+a.offsetX,d+a.offsetY,t+i.offsetX+a.offsetX,d+a.offsetY,a.color);n.add(g),h+=r}}}}]),t}(),V=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"fixSvgStringForIe11",value:function(t){if(!g.isIE11())return t;var e=0,i=t.replace(/xmlns="http:\/\/www.w3.org\/2000\/svg"/g,(function(t){return 2==++e?'xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs"':t}));return(i=i.replace(/xmlns:NS\d+=""/g,"")).replace(/NS\d+:(\w+:\w+=")/g,"$1")}},{key:"getSvgString",value:function(){var t=this.w.globals.dom.Paper.svg();return this.fixSvgStringForIe11(t)}},{key:"cleanup",value:function(){var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),i=t.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(a,(function(t){t.setAttribute("width",0)})),e&&e[0]&&(e[0].setAttribute("x",-500),e[0].setAttribute("x1",-500),e[0].setAttribute("x2",-500)),i&&i[0]&&(i[0].setAttribute("y",-100),i[0].setAttribute("y1",-100),i[0].setAttribute("y2",-100))}},{key:"svgUrl",value:function(){this.cleanup();var t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}},{key:"dataURI",value:function(){var t=this;return new Promise((function(e){var i=t.w;t.cleanup();var a=document.createElement("canvas");a.width=i.globals.svgWidth,a.height=parseInt(i.globals.dom.elWrap.style.height,10);var s="transparent"===i.config.chart.background?"#fff":i.config.chart.background,r=a.getContext("2d");r.fillStyle=s,r.fillRect(0,0,a.width,a.height);var n=t.getSvgString();if(window.canvg&&g.isIE11()){var o=window.canvg.Canvg.fromString(r,n,{ignoreClear:!0,ignoreDimensions:!0});o.start();var l=a.msToBlob();o.stop(),e({blob:l})}else{var h="data:image/svg+xml,"+encodeURIComponent(n),c=new Image;c.crossOrigin="anonymous",c.onload=function(){if(r.drawImage(c,0,0),a.msToBlob){var t=a.msToBlob();e({blob:t})}else{var i=a.toDataURL("image/png");e({imgURI:i})}},c.src=h}}))}},{key:"exportToSVG",value:function(){this.triggerDownload(this.svgUrl(),".svg")}},{key:"exportToPng",value:function(){var t=this;this.dataURI().then((function(e){var i=e.imgURI,a=e.blob;a?navigator.msSaveOrOpenBlob(a,t.w.globals.chartID+".png"):t.triggerDownload(i,".png")}))}},{key:"exportToCSV",value:function(t){var e=this,i=t.series,a=t.columnDelimiter,s=void 0===a?",":a,r=t.lineDelimiter,n=void 0===r?"\n":r,o=this.w,l=[],h=[],c="data:text/csv;charset=utf-8,",d=new O(this.ctx),g=new B(this.ctx),u=function(t){var i="";if(o.globals.axisCharts){if("category"===o.config.xaxis.type||o.config.xaxis.convertedCatToNumeric)if(o.globals.isBarHorizontal){var a=o.globals.yLabelFormatters[0],s=new M(e.ctx).getActiveConfigSeriesIndex();i=a(o.globals.labels[t],{seriesIndex:s,dataPointIndex:t,w:o})}else i=g.getLabel(o.globals.labels,o.globals.timescaleLabels,0,t).text;"datetime"===o.config.xaxis.type&&(o.config.xaxis.categories.length?i=o.config.xaxis.categories[t]:o.config.labels.length&&(i=o.config.labels[t]))}else i=o.config.labels[t];return i};l.push("category"),i.map((function(t,e){o.globals.axisCharts&&l.push(t.name?t.name:"series-".concat(e))})),o.globals.axisCharts||(l.push("value"),h.push(l.join(s))),i.map((function(t,e){o.globals.axisCharts?function(t,e){if(l.length&&0===e&&h.push(l.join(s)),t.data&&t.data.length)for(var a=0;a<t.data.length;a++){l=[];var r=u(a);if(r||(d.isFormatXY()?r=i[e].data[a].x:d.isFormat2DArray()&&(r=i[e].data[a]?i[e].data[a][0]:"")),0===e){l.push(r);for(var n=0;n<o.globals.series.length;n++)l.push(o.globals.series[n][a])}("candlestick"===o.config.chart.type||t.type&&"candlestick"===t.type)&&(l.pop(),l.push(o.globals.seriesCandleO[e][a]),l.push(o.globals.seriesCandleH[e][a]),l.push(o.globals.seriesCandleL[e][a]),l.push(o.globals.seriesCandleC[e][a])),"rangeBar"===o.config.chart.type&&(l.pop(),l.push(o.globals.seriesRangeStart[e][a]),l.push(o.globals.seriesRangeEnd[e][a])),l.length&&h.push(l.join(s))}}(t,e):((l=[]).push(o.globals.labels[e]),l.push(o.globals.series[e]),h.push(l.join(s)))})),c+=h.join(n),this.triggerDownload(encodeURI(c),".csv")}},{key:"triggerDownload",value:function(t,e){var i=document.createElement("a");i.href=t,i.download=this.w.globals.chartID+e,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}]),t}(),G=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w;var a=this.w;this.axesUtils=new B(i),this.xaxisLabels=a.globals.labels.slice(),a.globals.timescaleLabels.length>0&&!a.globals.isBarHorizontal&&(this.xaxisLabels=a.globals.timescaleLabels.slice()),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===a.config.xaxis.position?this.offY=0:this.offY=a.globals.gridHeight+1,this.offY=this.offY+a.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===a.config.chart.type&&a.config.plotOptions.bar.horizontal,this.xaxisFontSize=a.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=a.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=a.config.xaxis.labels.style.colors,this.xaxisBorderWidth=a.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=a.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf("%")>-1?this.xaxisBorderWidth=a.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=a.config.xaxis.axisBorder.height,this.yaxis=a.config.yaxis[0]}return a(t,[{key:"drawXaxis",value:function(){var t,e=this,i=this.w,a=new p(this.ctx),s=a.group({class:"apexcharts-xaxis",transform:"translate(".concat(i.config.xaxis.offsetX,", ").concat(i.config.xaxis.offsetY,")")}),r=a.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(i.globals.translateXAxisX,", ").concat(i.globals.translateXAxisY,")")});s.add(r);for(var n=i.globals.padHorizontal,o=[],l=0;l<this.xaxisLabels.length;l++)o.push(this.xaxisLabels[l]);var h=o.length;if(i.globals.isXNumeric){var c=h>1?h-1:h;t=i.globals.gridWidth/c,n=n+t/2+i.config.xaxis.labels.offsetX}else t=i.globals.gridWidth/o.length,n=n+t+i.config.xaxis.labels.offsetX;if(i.config.xaxis.labels.show)for(var d=function(s){var l=n-t/2+i.config.xaxis.labels.offsetX;0===s&&1===h&&t/2===n&&1===i.globals.dataPoints&&(l=i.globals.gridWidth/2);var c=e.axesUtils.getLabel(o,i.globals.timescaleLabels,l,s,e.drawnLabels,e.xaxisFontSize),d=28;i.globals.rotateXLabels&&(d=22),(c=e.axesUtils.checkForOverflowingLabels(s,c,h,e.drawnLabels,e.drawnLabelsRects)).text&&i.globals.xaxisLabelsCount++;var g=a.drawText({x:c.x,y:e.offY+i.config.xaxis.labels.offsetY+d-("top"===i.config.xaxis.position?i.globals.xAxisHeight+i.config.xaxis.axisTicks.height-2:0),text:c.text,textAnchor:"middle",fontWeight:c.isBold?600:i.config.xaxis.labels.style.fontWeight,fontSize:e.xaxisFontSize,fontFamily:e.xaxisFontFamily,foreColor:Array.isArray(e.xaxisForeColors)?i.config.xaxis.convertedCatToNumeric?e.xaxisForeColors[i.globals.minX+s-1]:e.xaxisForeColors[s]:e.xaxisForeColors,isPlainText:!1,cssClass:"apexcharts-xaxis-label "+i.config.xaxis.labels.style.cssClass});r.add(g);var u=document.createElementNS(i.globals.SVGNS,"title");u.textContent=c.text,g.node.appendChild(u),""!==c.text&&(e.drawnLabels.push(c.text),e.drawnLabelsRects.push(c)),n+=t},g=0;g<=h-1;g++)d(g);if(void 0!==i.config.xaxis.title.text){var u=a.group({class:"apexcharts-xaxis-title"}),f=a.drawText({x:i.globals.gridWidth/2+i.config.xaxis.title.offsetX,y:this.offY-parseFloat(this.xaxisFontSize)+i.globals.xAxisLabelsHeight+i.config.xaxis.title.offsetY,text:i.config.xaxis.title.text,textAnchor:"middle",fontSize:i.config.xaxis.title.style.fontSize,fontFamily:i.config.xaxis.title.style.fontFamily,fontWeight:i.config.xaxis.title.style.fontWeight,foreColor:i.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+i.config.xaxis.title.style.cssClass});u.add(f),s.add(u)}if(i.config.xaxis.axisBorder.show){var x=i.globals.barPadForNumericAxis,b=a.drawLine(i.globals.padHorizontal+i.config.xaxis.axisBorder.offsetX-x,this.offY,this.xaxisBorderWidth+x,this.offY,i.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);s.add(b)}return s}},{key:"drawXaxisInversed",value:function(t){var e,i,a=this.w,s=new p(this.ctx),r=a.config.yaxis[0].opposite?a.globals.translateYAxisX[t]:0,n=s.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:t}),o=s.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+r+", 0)"});n.add(o);var l=[];if(a.config.yaxis[t].show)for(var h=0;h<this.xaxisLabels.length;h++)l.push(this.xaxisLabels[h]);i=-(e=a.globals.gridHeight/l.length)/2.2;var c=a.globals.yLabelFormatters[0],d=a.config.yaxis[0].labels;if(d.show)for(var g=0;g<=l.length-1;g++){var u=void 0===l[g]?"":l[g];u=c(u,{seriesIndex:t,dataPointIndex:g,w:a});var f=0;Array.isArray(u)&&(f=u.length/2*parseInt(d.style.fontSize,10));var x=s.drawText({x:d.offsetX-15,y:i+e+d.offsetY-f,text:u,textAnchor:this.yaxis.opposite?"start":"end",foreColor:Array.isArray(d.style.colors)?d.style.colors[g]:d.style.colors,fontSize:d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+d.style.cssClass});o.add(x);var b=document.createElementNS(a.globals.SVGNS,"title");if(b.textContent=u.text,x.node.appendChild(b),0!==a.config.yaxis[t].labels.rotate){var m=s.rotateAroundCenter(x.node);x.node.setAttribute("transform","rotate(".concat(a.config.yaxis[t].labels.rotate," 0 ").concat(m.y,")"))}i+=e}if(void 0!==a.config.yaxis[0].title.text){var v=s.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+r+", 0)"}),y=s.drawText({x:0,y:a.globals.gridHeight/2,text:a.config.yaxis[0].title.text,textAnchor:"middle",foreColor:a.config.yaxis[0].title.style.color,fontSize:a.config.yaxis[0].title.style.fontSize,fontWeight:a.config.yaxis[0].title.style.fontWeight,fontFamily:a.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+a.config.yaxis[0].title.style.cssClass});v.add(y),n.add(v)}var w=0;this.isCategoryBarHorizontal&&a.config.yaxis[0].opposite&&(w=a.globals.gridWidth);var k=a.config.xaxis.axisBorder;if(k.show){var A=s.drawLine(a.globals.padHorizontal+k.offsetX+w,1+k.offsetY,a.globals.padHorizontal+k.offsetX+w,a.globals.gridHeight+k.offsetY,k.color,0);n.add(A)}return a.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(w,l.length,a.config.yaxis[0].axisBorder,a.config.yaxis[0].axisTicks,0,e,n),n}},{key:"drawXaxisTicks",value:function(t,e){var i=this.w,a=t;if(!(t<0||t-2>i.globals.gridWidth)){var s=this.offY+i.config.xaxis.axisTicks.offsetY,r=s+i.config.xaxis.axisTicks.height;if("top"===i.config.xaxis.position&&(r=s-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){var n=new p(this.ctx).drawLine(t+i.config.xaxis.axisTicks.offsetX,s+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,r+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);e.add(n),n.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var t=this.w,e=[],i=this.xaxisLabels.length,a=t.globals.padHorizontal;if(t.globals.timescaleLabels.length>0)for(var s=0;s<i;s++)a=this.xaxisLabels[s].position,e.push(a);else for(var r=i,n=0;n<r;n++){var o=r;t.globals.isXNumeric&&"bar"!==t.config.chart.type&&(o-=1),a+=t.globals.gridWidth/o,e.push(a)}return e}},{key:"xAxisLabelCorrections",value:function(){var t=this.w,e=new p(this.ctx),i=t.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text"),s=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),r=t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(t.globals.rotateXLabels||t.config.xaxis.labels.rotateAlways)for(var n=0;n<a.length;n++){var o=e.rotateAroundCenter(a[n]);o.y=o.y-1,o.x=o.x+1,a[n].setAttribute("transform","rotate(".concat(t.config.xaxis.labels.rotate," ").concat(o.x," ").concat(o.y,")")),a[n].setAttribute("text-anchor","end"),i.setAttribute("transform","translate(0, ".concat(-10,")"));var l=a[n].childNodes;t.config.xaxis.labels.trim&&Array.prototype.forEach.call(l,(function(i){e.placeTextWithEllipsis(i,i.textContent,t.config.xaxis.labels.maxHeight-("bottom"===t.config.legend.position?20:10))}))}else!function(){for(var i=t.globals.gridWidth/(t.globals.labels.length+1),s=0;s<a.length;s++){var r=a[s].childNodes;t.config.xaxis.labels.trim&&"datetime"!==t.config.xaxis.type&&Array.prototype.forEach.call(r,(function(t){e.placeTextWithEllipsis(t,t.textContent,i)}))}}();if(s.length>0){var h=s[s.length-1].getBBox(),c=s[0].getBBox();h.x<-20&&s[s.length-1].parentNode.removeChild(s[s.length-1]),c.x+c.width>t.globals.gridWidth&&!t.globals.isBarHorizontal&&s[0].parentNode.removeChild(s[0]);for(var d=0;d<r.length;d++)e.placeTextWithEllipsis(r[d],r[d].textContent,t.config.yaxis[0].labels.maxWidth-2*parseFloat(t.config.yaxis[0].title.style.fontSize)-20)}}}]),t}(),_=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w;var a=this.w;this.xaxisLabels=a.globals.labels.slice(),this.axesUtils=new B(i),this.isTimelineBar="datetime"===a.config.xaxis.type&&a.globals.seriesRangeBarTimeline.length,a.globals.timescaleLabels.length>0&&(this.xaxisLabels=a.globals.timescaleLabels.slice())}return a(t,[{key:"drawGridArea",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.w,i=new p(this.ctx);null===t&&(t=i.group({class:"apexcharts-grid"}));var a=i.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.globals.gridHeight,"transparent"),s=i.drawLine(e.globals.padHorizontal,e.globals.gridHeight,e.globals.gridWidth,e.globals.gridHeight,"transparent");return t.add(s),t.add(a),t}},{key:"drawGrid",value:function(){var t=null;return this.w.globals.axisCharts&&(t=this.renderGrid(),this.drawGridArea(t.el)),t}},{key:"createGridMask",value:function(){var t=this.w,e=t.globals,i=new p(this.ctx),a=Array.isArray(t.config.stroke.width)?0:t.config.stroke.width;if(Array.isArray(t.config.stroke.width)){var s=0;t.config.stroke.width.forEach((function(t){s=Math.max(s,t)})),a=s}e.dom.elGridRectMask=document.createElementNS(e.SVGNS,"clipPath"),e.dom.elGridRectMask.setAttribute("id","gridRectMask".concat(e.cuid)),e.dom.elGridRectMarkerMask=document.createElementNS(e.SVGNS,"clipPath"),e.dom.elGridRectMarkerMask.setAttribute("id","gridRectMarkerMask".concat(e.cuid));var r=t.config.chart.type,n=0,o=0;("bar"===r||"rangeBar"===r||t.globals.comboBarCount>0)&&t.globals.isXNumeric&&!t.globals.isBarHorizontal&&(n=t.config.grid.padding.left,o=t.config.grid.padding.right,e.barPadForNumericAxis>n&&(n=e.barPadForNumericAxis,o=e.barPadForNumericAxis)),e.dom.elGridRect=i.drawRect(-a/2-n-2,-a/2,e.gridWidth+a+o+n+4,e.gridHeight+a,0,"#fff"),new m(this).getLargestMarkerSize();var l=t.globals.markers.largestSize+1;e.dom.elGridRectMarker=i.drawRect(2*-l,2*-l,e.gridWidth+4*l,e.gridHeight+4*l,0,"#fff"),e.dom.elGridRectMask.appendChild(e.dom.elGridRect.node),e.dom.elGridRectMarkerMask.appendChild(e.dom.elGridRectMarker.node);var h=e.dom.baseEl.querySelector("defs");h.appendChild(e.dom.elGridRectMask),h.appendChild(e.dom.elGridRectMarkerMask)}},{key:"_drawGridLines",value:function(t){var e=t.i,i=t.x1,a=t.y1,s=t.x2,r=t.y2,n=t.xCount,o=t.parent,l=this.w;0===e&&l.globals.skipFirstTimelinelabel||e===n-1&&l.globals.skipLastTimelinelabel||"radar"===l.config.chart.type||(l.config.grid.xaxis.lines.show&&this._drawGridLine({x1:i,y1:a,x2:s,y2:r,parent:o}),new G(this.ctx).drawXaxisTicks(i,this.elg))}},{key:"_drawGridLine",value:function(t){var e=t.x1,i=t.y1,a=t.x2,s=t.y2,r=t.parent,n=this.w,o=r.node.classList.contains("apexcharts-gridlines-horizontal"),l=n.config.grid.strokeDashArray,h=n.globals.barPadForNumericAxis,c=new p(this).drawLine(e-(o?h:0),i,a+(o?h:0),s,n.config.grid.borderColor,l);c.node.classList.add("apexcharts-gridline"),r.add(c)}},{key:"_drawGridBandRect",value:function(t){var e=t.c,i=t.x1,a=t.y1,s=t.x2,r=t.y2,n=t.type,o=this.w,l=new p(this.ctx),h=o.globals.barPadForNumericAxis;if("column"!==n||"datetime"!==o.config.xaxis.type){var c=o.config.grid[n].colors[e],d=l.drawRect(i-("row"===n?h:0),a,s+("row"===n?2*h:0),r,0,c,o.config.grid[n].opacity);this.elg.add(d),d.attr("clip-path","url(#gridRectMask".concat(o.globals.cuid,")")),d.node.classList.add("apexcharts-grid-".concat(n))}}},{key:"_drawXYLines",value:function(t){var e=this,i=t.xCount,a=t.tickAmount,s=this.w;if(s.config.grid.xaxis.lines.show||s.config.xaxis.axisTicks.show){var r=s.globals.padHorizontal,n=s.globals.gridHeight;s.globals.timescaleLabels.length?function(t){for(var a=t.xC,s=t.x1,r=t.y1,n=t.x2,o=t.y2,l=0;l<a;l++)s=e.xaxisLabels[l].position,n=e.xaxisLabels[l].position,e._drawGridLines({i:l,x1:s,y1:r,x2:n,y2:o,xCount:i,parent:e.elgridLinesV})}({xC:i,x1:r,y1:0,x2:void 0,y2:n}):(s.globals.isXNumeric&&(i=s.globals.xAxisScale.result.length),s.config.xaxis.convertedCatToNumeric&&(i=s.globals.xaxisLabelsCount),function(t){for(var a=t.xC,r=t.x1,n=t.y1,o=t.x2,l=t.y2,h=0;h<a+(s.globals.isXNumeric?0:1);h++)0===h&&1===a&&1===s.globals.dataPoints&&(o=r=s.globals.gridWidth/2),e._drawGridLines({i:h,x1:r,y1:n,x2:o,y2:l,xCount:i,parent:e.elgridLinesV}),o=r+=s.globals.gridWidth/(s.globals.isXNumeric?a-1:a)}({xC:i,x1:r,y1:0,x2:void 0,y2:n}))}if(s.config.grid.yaxis.lines.show){var o=0,l=0,h=s.globals.gridWidth,c=a+1;this.isTimelineBar&&(c=s.globals.labels.length);for(var d=0;d<c+(this.isTimelineBar?1:0);d++)this._drawGridLine({x1:0,y1:o,x2:h,y2:l,parent:this.elgridLinesH}),l=o+=s.globals.gridHeight/(this.isTimelineBar?c:a)}}},{key:"_drawInvertedXYLines",value:function(t){var e=t.xCount,i=this.w;if(i.config.grid.xaxis.lines.show||i.config.xaxis.axisTicks.show)for(var a,s=i.globals.padHorizontal,r=i.globals.gridHeight,n=0;n<e+1;n++)i.config.grid.xaxis.lines.show&&this._drawGridLine({x1:s,y1:0,x2:a,y2:r,parent:this.elgridLinesV}),new G(this.ctx).drawXaxisTicks(s,this.elg),a=s=s+i.globals.gridWidth/e+.3;if(i.config.grid.yaxis.lines.show)for(var o=0,l=0,h=i.globals.gridWidth,c=0;c<i.globals.dataPoints+1;c++)this._drawGridLine({x1:0,y1:o,x2:h,y2:l,parent:this.elgridLinesH}),l=o+=i.globals.gridHeight/i.globals.dataPoints}},{key:"renderGrid",value:function(){var t=this.w,e=new p(this.ctx);this.elg=e.group({class:"apexcharts-grid"}),this.elgridLinesH=e.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=e.group({class:"apexcharts-gridlines-vertical"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),t.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide());for(var i,a=t.globals.yAxisScale.length?t.globals.yAxisScale[0].result.length-1:5,s=0;s<t.globals.series.length&&(void 0!==t.globals.yAxisScale[s]&&(a=t.globals.yAxisScale[s].result.length-1),!(a>2));s++);return!t.globals.isBarHorizontal||this.isTimelineBar?(i=this.xaxisLabels.length,this.isTimelineBar&&(a=t.globals.labels.length),this._drawXYLines({xCount:i,tickAmount:a})):(i=a,a=t.globals.xTickAmount,this._drawInvertedXYLines({xCount:i,tickAmount:a})),this.drawGridBands(i,a),{el:this.elg,xAxisTickWidth:t.globals.gridWidth/i}}},{key:"drawGridBands",value:function(t,e){var i=this.w;if(void 0!==i.config.grid.row.colors&&i.config.grid.row.colors.length>0)for(var a=0,s=i.globals.gridHeight/e,r=i.globals.gridWidth,n=0,o=0;n<e;n++,o++)o>=i.config.grid.row.colors.length&&(o=0),this._drawGridBandRect({c:o,x1:0,y1:a,x2:r,y2:s,type:"row"}),a+=i.globals.gridHeight/e;if(void 0!==i.config.grid.column.colors&&i.config.grid.column.colors.length>0)for(var l=i.globals.isBarHorizontal||"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric?t:t-1,h=i.globals.padHorizontal,c=i.globals.padHorizontal+i.globals.gridWidth/l,d=i.globals.gridHeight,g=0,u=0;g<t;g++,u++)u>=i.config.grid.column.colors.length&&(u=0),this._drawGridBandRect({c:u,x1:h,y1:0,x2:c,y2:d,type:"column"}),h+=i.globals.gridWidth/l}}]),t}(),j=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"niceScale",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,r=this.w;if("dataPoints"===i&&(i=r.globals.dataPoints-1),t===Number.MIN_VALUE&&0===e||!g.isNumber(t)&&!g.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE){t=0,e=i;var n=this.linearScale(t,e,i);return n}t>e?(console.warn("axis.min cannot be greater than axis.max"),e=t+.1):t===e&&(t=0===t?0:t-.5,e=0===e?2:e+.5);var o=[],l=Math.abs(e-t);l<1&&s&&("candlestick"===r.config.chart.type||"candlestick"===r.config.series[a].type||r.globals.isRangeData)&&(e*=1.01);var h=i+1;h<2?h=2:h>2&&(h-=2);var c=l/h,d=Math.floor(g.log10(c)),u=Math.pow(10,d),f=Math.round(c/u);f<1&&(f=1);var p=f*u,x=p*Math.floor(t/p),b=p*Math.ceil(e/p),m=x;if(s&&l>2){for(;o.push(m),!((m+=p)>b););return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}var v=t;(o=[]).push(v);for(var y=Math.abs(e-t)/i,w=0;w<=i;w++)v+=y,o.push(v);return o[o.length-2]>=e&&o.pop(),{result:o,niceMin:o[0],niceMax:o[o.length-1]}}},{key:"linearScale",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=Math.abs(e-t),s=a/i;i===Number.MAX_VALUE&&(i=10,s=1);for(var r=[],n=t;i>=0;)r.push(n),n+=s,i-=1;return{result:r,niceMin:r[0],niceMax:r[r.length-1]}}},{key:"logarithmicScale",value:function(t,e,i,a){(e<0||e===Number.MIN_VALUE)&&(e=.01);for(var s=Math.log(e)/Math.log(10),r=Math.log(i)/Math.log(10),n=Math.abs(i-e)/a,o=[],l=e;a>=0;)o.push(l),l+=n,a-=1;var h=o.map((function(t,a){t<=0&&(t=.01);var n=(r-s)/(i-e),o=Math.pow(10,s+n*(t-s));return Math.round(o/g.roundToBase(o,10))*g.roundToBase(o,10)}));return 0===h[0]&&(h[0]=1),{result:h,niceMin:h[0],niceMax:h[h.length-1]}}},{key:"setYScaleForIndex",value:function(t,e,i){var a=this.w.globals,s=this.w.config,r=a.isBarHorizontal?s.xaxis:s.yaxis[t];void 0===a.yAxisScale[t]&&(a.yAxisScale[t]=[]);var n=Math.abs(i-e);if(r.logarithmic&&n<=5&&(a.invalidLogScale=!0),r.logarithmic&&n>5)a.allSeriesCollapsed=!1,a.yAxisScale[t]=this.logarithmicScale(t,e,i,r.tickAmount?r.tickAmount:Math.floor(Math.log10(i)));else if(i!==-Number.MAX_VALUE&&g.isNumber(i))if(a.allSeriesCollapsed=!1,void 0===r.min&&void 0===r.max||r.forceNiceScale){var o=void 0===s.yaxis[t].max&&void 0===s.yaxis[t].min||s.yaxis[t].forceNiceScale;a.yAxisScale[t]=this.niceScale(e,i,r.tickAmount?r.tickAmount:n<5&&n>1?n+1:5,t,o)}else a.yAxisScale[t]=this.linearScale(e,i,r.tickAmount);else a.yAxisScale[t]=this.linearScale(0,5,5)}},{key:"setXScale",value:function(t,e){var i=this.w,a=i.globals,s=i.config.xaxis,r=Math.abs(e-t);return e!==-Number.MAX_VALUE&&g.isNumber(e)?a.xAxisScale=this.niceScale(t,e,s.tickAmount?s.tickAmount:r<5&&r>1?r+1:5,0):a.xAxisScale=this.linearScale(0,5,5),a.xAxisScale}},{key:"setMultipleYScales",value:function(){var t=this,e=this.w.globals,i=this.w.config,a=e.minYArr.concat([]),s=e.maxYArr.concat([]),r=[];i.yaxis.forEach((function(e,n){var o=n;i.series.forEach((function(t,i){t.name===e.seriesName&&(o=i,n!==i?r.push({index:i,similarIndex:n,alreadyExists:!0}):r.push({index:i}))}));var l=a[o],h=s[o];t.setYScaleForIndex(n,l,h)})),this.sameScaleInMultipleAxes(a,s,r)}},{key:"sameScaleInMultipleAxes",value:function(t,e,i){var a=this,s=this.w.config,r=this.w.globals,n=[];i.forEach((function(t){t.alreadyExists&&(void 0===n[t.index]&&(n[t.index]=[]),n[t.index].push(t.index),n[t.index].push(t.similarIndex))})),r.yAxisSameScaleIndices=n,n.forEach((function(t,e){n.forEach((function(i,a){var s,r;e!==a&&(s=t,r=i,s.filter((function(t){return-1!==r.indexOf(t)}))).length>0&&(n[e]=n[e].concat(n[a]))}))}));var o=n.map((function(t){return t.filter((function(e,i){return t.indexOf(e)===i}))})).map((function(t){return t.sort()}));n=n.filter((function(t){return!!t}));var l=o.slice(),h=l.map((function(t){return JSON.stringify(t)}));l=l.filter((function(t,e){return h.indexOf(JSON.stringify(t))===e}));var c=[],d=[];t.forEach((function(t,i){l.forEach((function(a,s){a.indexOf(i)>-1&&(void 0===c[s]&&(c[s]=[],d[s]=[]),c[s].push({key:i,value:t}),d[s].push({key:i,value:e[i]}))}))}));var g=Array.apply(null,Array(l.length)).map(Number.prototype.valueOf,Number.MIN_VALUE),u=Array.apply(null,Array(l.length)).map(Number.prototype.valueOf,-Number.MAX_VALUE);c.forEach((function(t,e){t.forEach((function(t,i){g[e]=Math.min(t.value,g[e])}))})),d.forEach((function(t,e){t.forEach((function(t,i){u[e]=Math.max(t.value,u[e])}))})),t.forEach((function(t,e){d.forEach((function(t,i){var n=g[i],o=u[i];s.chart.stacked&&(o=0,t.forEach((function(t,e){t.value!==-Number.MAX_VALUE&&(o+=t.value),n!==Number.MIN_VALUE&&(n+=c[i][e].value)}))),t.forEach((function(i,l){t[l].key===e&&(void 0!==s.yaxis[e].min&&(n="function"==typeof s.yaxis[e].min?s.yaxis[e].min(r.minY):s.yaxis[e].min),void 0!==s.yaxis[e].max&&(o="function"==typeof s.yaxis[e].max?s.yaxis[e].max(r.maxY):s.yaxis[e].max),a.setYScaleForIndex(e,n,o))}))}))}))}},{key:"autoScaleY",value:function(t,e,i){t||(t=this);var a=t.w;if(a.globals.isMultipleYAxis||a.globals.collapsedSeries.length)return console.warn("autoScaleYaxis is not supported in a multi-yaxis chart."),e;var s=a.globals.seriesX[0],r=a.config.chart.stacked;return e.forEach((function(t,n){for(var o=0,l=0;l<s.length;l++)if(s[l]>=i.xaxis.min){o=l;break}var h,c,d=a.globals.minYArr[n],g=a.globals.maxYArr[n],u=a.globals.stackedSeriesTotals;a.globals.series.forEach((function(n,l){var f=n[o];r?(f=u[o],h=c=f,u.forEach((function(t,e){s[e]<=i.xaxis.max&&s[e]>=i.xaxis.min&&(t>c&&null!==t&&(c=t),n[e]<h&&null!==n[e]&&(h=n[e]))}))):(h=c=f,n.forEach((function(t,e){if(s[e]<=i.xaxis.max&&s[e]>=i.xaxis.min){var r=t,n=t;a.globals.series.forEach((function(i,a){null!==t&&(r=Math.min(i[e],r),n=Math.max(i[e],n))})),n>c&&null!==n&&(c=n),r<h&&null!==r&&(h=r)}}))),void 0===h&&void 0===c&&(h=d,c=g),(c*=c<0?.9:1.1)<0&&c<g&&(c=g),(h*=h<0?1.1:.9)<0&&h>d&&(h=d),e.length>1?(e[l].min=void 0===t.min?h:t.min,e[l].max=void 0===t.max?c:t.max):(e[0].min=void 0===t.min?h:t.min,e[0].max=void 0===t.max?c:t.max)}))})),e}}]),t}(),U=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.scales=new j(i)}return a(t,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-Number.MAX_VALUE,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=this.w.config,r=this.w.globals,n=-Number.MAX_VALUE,o=Number.MIN_VALUE;null===a&&(a=t+1);var l=r.series,h=l,c=l;"candlestick"===s.chart.type?(h=r.seriesCandleL,c=r.seriesCandleH):r.isRangeData&&(h=r.seriesRangeStart,c=r.seriesRangeEnd);for(var d=t;d<a;d++){r.dataPoints=Math.max(r.dataPoints,l[d].length);for(var u=0;u<r.series[d].length;u++){var f=l[d][u];null!==f&&g.isNumber(f)?(n=Math.max(n,c[d][u]),e=Math.min(e,h[d][u]),i=Math.max(i,h[d][u]),"candlestick"===this.w.config.chart.type&&(n=Math.max(n,r.seriesCandleO[d][u]),n=Math.max(n,r.seriesCandleH[d][u]),n=Math.max(n,r.seriesCandleL[d][u]),i=n=Math.max(n,r.seriesCandleC[d][u])),g.isFloat(f)&&(f=g.noExponents(f),r.yValueDecimal=Math.max(r.yValueDecimal,f.toString().split(".")[1].length)),o>h[d][u]&&h[d][u]<0&&(o=h[d][u])):r.hasNullValues=!0}}return"rangeBar"===s.chart.type&&r.seriesRangeStart.length&&r.isBarHorizontal&&"datetime"===s.xaxis.type&&(o=e),"bar"===s.chart.type&&(o<0&&n<0&&(n=0),o===Number.MIN_VALUE&&(o=0)),{minY:o,maxY:n,lowestY:e,highestY:i}}},{key:"setYRange",value:function(){var t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;var i=Number.MAX_VALUE;if(t.isMultipleYAxis)for(var a=0;a<t.series.length;a++){var s=this.getMinYMaxY(a,i,null,a+1);t.minYArr.push(s.minY),t.maxYArr.push(s.maxY),i=s.lowestY}var r=this.getMinYMaxY(0,i,null,t.series.length);if(t.minY=r.minY,t.maxY=r.maxY,i=r.lowestY,e.chart.stacked&&this._setStackedMinMax(),("line"===e.chart.type||"area"===e.chart.type||"candlestick"===e.chart.type||"rangeBar"===e.chart.type&&!t.isBarHorizontal)&&t.minY===Number.MIN_VALUE&&i!==-Number.MAX_VALUE&&i!==t.maxY){var n=t.maxY-i;i>=0&&i<=10&&(n=0),t.minY=i-5*n/100,i>0&&t.minY<0&&(t.minY=0),t.maxY=t.maxY+5*n/100}return e.yaxis.forEach((function(e,i){void 0!==e.max&&("number"==typeof e.max?t.maxYArr[i]=e.max:"function"==typeof e.max&&(t.maxYArr[i]=e.max(t.maxY)),t.maxY=t.maxYArr[i]),void 0!==e.min&&("number"==typeof e.min?t.minYArr[i]=e.min:"function"==typeof e.min&&(t.minYArr[i]=e.min(t.minY)),t.minY=t.minYArr[i])})),t.isBarHorizontal&&["min","max"].forEach((function(i){void 0!==e.xaxis[i]&&"number"==typeof e.xaxis[i]&&("min"===i?t.minY=e.xaxis[i]:t.maxY=e.xaxis[i])})),t.isMultipleYAxis?(this.scales.setMultipleYScales(),t.minY=i,t.yAxisScale.forEach((function(e,i){t.minYArr[i]=e.niceMin,t.maxYArr[i]=e.niceMax}))):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.yAxisScale[0].niceMin,t.maxYArr[0]=t.yAxisScale[0].niceMax),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr}}},{key:"setXRange",value:function(){var t=this.w.globals,e=this.w.config,i="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!t.noLabelsProvided||t.noLabelsProvided||t.isXNumeric;if(t.isXNumeric&&function(){for(var e=0;e<t.series.length;e++)if(t.labels[e])for(var i=0;i<t.labels[e].length;i++)null!==t.labels[e][i]&&g.isNumber(t.labels[e][i])&&(t.maxX=Math.max(t.maxX,t.labels[e][i]),t.initialMaxX=Math.max(t.maxX,t.labels[e][i]),t.minX=Math.min(t.minX,t.labels[e][i]),t.initialMinX=Math.min(t.minX,t.labels[e][i]))}(),t.noLabelsProvided&&0===e.xaxis.categories.length&&(t.maxX=t.labels[t.labels.length-1],t.initialMaxX=t.labels[t.labels.length-1],t.minX=1,t.initialMinX=1),t.isXNumeric||t.noLabelsProvided||t.dataFormatXNumeric){var a;if(void 0===e.xaxis.tickAmount?(a=Math.round(t.svgWidth/150),"numeric"===e.xaxis.type&&t.dataPoints<30&&(a=t.dataPoints-1),a>t.dataPoints&&0!==t.dataPoints&&(a=t.dataPoints-1)):"dataPoints"===e.xaxis.tickAmount?(t.series.length>1&&(a=t.series[t.maxValsInArrayIndex].length-1),t.isXNumeric&&(a=t.maxX-t.minX-1)):a=e.xaxis.tickAmount,t.xTickAmount=a,void 0!==e.xaxis.max&&"number"==typeof e.xaxis.max&&(t.maxX=e.xaxis.max),void 0!==e.xaxis.min&&"number"==typeof e.xaxis.min&&(t.minX=e.xaxis.min),void 0!==e.xaxis.range&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!t.dataFormatXNumeric){for(var s=[],r=t.minX-1;r<t.maxX;r++)s.push(r+1);t.xAxisScale={result:s,niceMin:s[0],niceMax:s[s.length-1]}}else t.xAxisScale=this.scales.setXScale(t.minX,t.maxX);else t.xAxisScale=this.scales.linearScale(1,a,a),t.noLabelsProvided&&t.labels.length>0&&(t.xAxisScale=this.scales.linearScale(1,t.labels.length,a-1),t.seriesX=t.labels.slice());i&&(t.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&t.labels.length&&(t.xTickAmount=t.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}},{key:"setZRange",value:function(){var t=this.w.globals;if(t.isDataXYZ)for(var e=0;e<t.series.length;e++)if(void 0!==t.seriesZ[e])for(var i=0;i<t.seriesZ[e].length;i++)null!==t.seriesZ[e][i]&&g.isNumber(t.seriesZ[e][i])&&(t.maxZ=Math.max(t.maxZ,t.seriesZ[e][i]),t.minZ=Math.min(t.minZ,t.seriesZ[e][i]))}},{key:"_handleSingleDataPoint",value:function(){var t=this.w.globals,e=this.w.config;if(t.minX===t.maxX){var i=new Y(this.ctx);if("datetime"===e.xaxis.type){var a=i.getDate(t.minX);a.setUTCDate(a.getDate()-2),t.minX=new Date(a).getTime();var s=i.getDate(t.maxX);s.setUTCDate(s.getDate()+2),t.maxX=new Date(s).getTime()}else("numeric"===e.xaxis.type||"category"===e.xaxis.type&&!t.noLabelsProvided)&&(t.minX=t.minX-2,t.initialMinX=t.minX,t.maxX=t.maxX+2,t.initialMaxX=t.maxX)}}},{key:"_getMinXDiff",value:function(){var t=this.w.globals;t.isXNumeric&&t.seriesX.forEach((function(e,i){1===e.length&&e.push(t.seriesX[t.maxValsInArrayIndex][t.seriesX[t.maxValsInArrayIndex].length-1]);var a=e.slice();a.sort((function(t,e){return t-e})),a.forEach((function(e,a){if(a>0){var s=e-t.seriesX[i][a-1];s>0&&(t.minXDiff=Math.min(s,t.minXDiff))}})),1===t.dataPoints&&t.minXDiff===Number.MAX_VALUE&&(t.minXDiff=.5)}))}},{key:"_setStackedMinMax",value:function(){var t=this.w.globals,e=[],i=[];if(t.series.length)for(var a=0;a<t.series[t.maxValsInArrayIndex].length;a++)for(var s=0,r=0,n=0;n<t.series.length;n++)null!==t.series[n][a]&&g.isNumber(t.series[n][a])&&(t.series[n][a]>0?s=s+parseFloat(t.series[n][a])+1e-4:r+=parseFloat(t.series[n][a])),n===t.series.length-1&&(e.push(s),i.push(r));for(var o=0;o<e.length;o++)t.maxY=Math.max(t.maxY,e[o]),t.minY=Math.min(t.minY,i[o])}}]),t}(),q=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w;var a=this.w;this.xaxisFontSize=a.config.xaxis.labels.style.fontSize,this.axisFontFamily=a.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=a.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===a.config.chart.type&&a.config.plotOptions.bar.horizontal,this.xAxisoffX=0,"bottom"===a.config.xaxis.position&&(this.xAxisoffX=a.globals.gridHeight),this.drawnLabels=[],this.axesUtils=new B(i)}return a(t,[{key:"drawYaxis",value:function(t){var e=this.w,i=new p(this.ctx),a=e.config.yaxis[t].labels.style,s=a.fontSize,r=a.fontFamily,n=a.fontWeight,o=i.group({class:"apexcharts-yaxis",rel:t,transform:"translate("+e.globals.translateYAxisX[t]+", 0)"});if(this.axesUtils.isYAxisHidden(t))return o;var l=i.group({class:"apexcharts-yaxis-texts-g"});o.add(l);var h=e.globals.yAxisScale[t].result.length-1,c=e.globals.gridHeight/h,d=e.globals.translateY,g=e.globals.yLabelFormatters[t],u=e.globals.yAxisScale[t].result.slice();u=this.axesUtils.checkForReversedLabels(t,u);var f="";if(e.config.yaxis[t].labels.show)for(var x=function(o){var p=u[o];p=g(p,o);var x=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(x*=-1);var b=i.drawText({x:x,y:d+h/10+e.config.yaxis[t].labels.offsetY+1,text:p,textAnchor:e.config.yaxis[t].opposite?"start":"end",fontSize:s,fontFamily:r,fontWeight:n,foreColor:Array.isArray(a.colors)?a.colors[o]:a.colors,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+a.cssClass});if(o===h&&(f=b),l.add(b),0!==e.config.yaxis[t].labels.rotate){var m=i.rotateAroundCenter(f.node),v=i.rotateAroundCenter(b.node);b.node.setAttribute("transform","rotate(".concat(e.config.yaxis[t].labels.rotate," ").concat(m.x," ").concat(v.y,")"))}d+=c},b=h;b>=0;b--)x(b);if(void 0!==e.config.yaxis[t].title.text){var m=i.group({class:"apexcharts-yaxis-title"}),v=0;e.config.yaxis[t].opposite&&(v=e.globals.translateYAxisX[t]);var y=i.drawText({x:v,y:e.globals.gridHeight/2+e.globals.translateY+e.config.yaxis[t].title.offsetY,text:e.config.yaxis[t].title.text,textAnchor:"end",foreColor:e.config.yaxis[t].title.style.color,fontSize:e.config.yaxis[t].title.style.fontSize,fontWeight:e.config.yaxis[t].title.style.fontWeight,fontFamily:e.config.yaxis[t].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+e.config.yaxis[t].title.style.cssClass});m.add(y),o.add(m)}var w=e.config.yaxis[t].axisBorder,k=31+w.offsetX;if(e.config.yaxis[t].opposite&&(k=-31-w.offsetX),w.show){var A=i.drawLine(k,e.globals.translateY+w.offsetY-2,k,e.globals.gridHeight+e.globals.translateY+w.offsetY+2,w.color,0,w.width);o.add(A)}return e.config.yaxis[t].axisTicks.show&&this.axesUtils.drawYAxisTicks(k,h,w,e.config.yaxis[t].axisTicks,t,c,o),o}},{key:"drawYaxisInversed",value:function(t){var e=this.w,i=new p(this.ctx),a=i.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),s=i.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(e.globals.translateXAxisX,", ").concat(e.globals.translateXAxisY,")")});a.add(s);var r=e.globals.yAxisScale[t].result.length-1,n=e.globals.gridWidth/r+.1,o=n+e.config.xaxis.labels.offsetX,l=e.globals.xLabelFormatter,h=e.globals.yAxisScale[t].result.slice(),c=e.globals.timescaleLabels;c.length>0&&(this.xaxisLabels=c.slice(),r=(h=c.slice()).length),h=this.axesUtils.checkForReversedLabels(t,h);var d=c.length;if(e.config.xaxis.labels.show)for(var g=d?0:r;d?g<d:g>=0;d?g++:g--){var u=h[g];u=l(u,g);var f=e.globals.gridWidth+e.globals.padHorizontal-(o-n+e.config.xaxis.labels.offsetX);if(c.length){var x=this.axesUtils.getLabel(h,c,f,g,this.drawnLabels,this.xaxisFontSize);f=x.x,u=x.text,this.drawnLabels.push(x.text),0===g&&e.globals.skipFirstTimelinelabel&&(u=""),g===h.length-1&&e.globals.skipLastTimelinelabel&&(u="")}var b=i.drawText({x:f,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.globals.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:u,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label "+e.config.xaxis.labels.style.cssClass});s.add(b),b.tspan(u);var m=document.createElementNS(e.globals.SVGNS,"title");m.textContent=u,b.node.appendChild(m),o+=n}return this.inversedYAxisTitleText(a),this.inversedYAxisBorder(a),a}},{key:"inversedYAxisBorder",value:function(t){var e=this.w,i=new p(this.ctx),a=e.config.xaxis.axisBorder;if(a.show){var s=0;"bar"===e.config.chart.type&&e.globals.isXNumeric&&(s-=15);var r=i.drawLine(e.globals.padHorizontal+s+a.offsetX,this.xAxisoffX,e.globals.gridWidth,this.xAxisoffX,a.color,0,a.height);t.add(r)}}},{key:"inversedYAxisTitleText",value:function(t){var e=this.w,i=new p(this.ctx);if(void 0!==e.config.xaxis.title.text){var a=i.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),s=i.drawText({x:e.globals.gridWidth/2+e.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(e.config.xaxis.title.style.fontSize)+e.config.xaxis.title.offsetY+20,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,cssClass:"apexcharts-xaxis-title-text "+e.config.xaxis.title.style.cssClass});a.add(s),t.add(a)}}},{key:"yAxisTitleRotate",value:function(t,e){var i=this.w,a=new p(this.ctx),s={width:0,height:0},r={width:0,height:0},n=i.globals.dom.baseEl.querySelector(" .apexcharts-yaxis[rel='".concat(t,"'] .apexcharts-yaxis-texts-g"));null!==n&&(s=n.getBoundingClientRect());var o=i.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(t,"'] .apexcharts-yaxis-title text"));if(null!==o&&(r=o.getBoundingClientRect()),null!==o){var l=this.xPaddingForYAxisTitle(t,s,r,e);o.setAttribute("x",l.xPos-(e?10:0))}if(null!==o){var h=a.rotateAroundCenter(o);o.setAttribute("transform","rotate(".concat(e?"":"-").concat(i.config.yaxis[t].title.rotate," ").concat(h.x," ").concat(h.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(t,e,i,a){var s=this.w,r=0,n=0,o=10;return void 0===s.config.yaxis[t].title.text||t<0?{xPos:n,padd:0}:(a?(n=e.width+s.config.yaxis[t].title.offsetX+i.width/2+o/2,0===(r+=1)&&(n-=o/2)):(n=-1*e.width+s.config.yaxis[t].title.offsetX+o/2+i.width/2,s.globals.isBarHorizontal&&(o=25,n=-1*e.width-s.config.yaxis[t].title.offsetX-o)),{xPos:n,padd:o})}},{key:"setYAxisXPosition",value:function(t,e){var i=this.w,a=0,s=0,r=18,n=1;i.config.yaxis.length>1&&(this.multipleYs=!0),i.config.yaxis.map((function(o,l){var h=i.globals.ignoreYAxisIndexes.indexOf(l)>-1||!o.show||o.floating||0===t[l].width,c=t[l].width+e[l].width;o.opposite?i.globals.isBarHorizontal?(s=i.globals.gridWidth+i.globals.translateX-1,i.globals.translateYAxisX[l]=s-o.labels.offsetX):(s=i.globals.gridWidth+i.globals.translateX+n,h||(n=n+c+20),i.globals.translateYAxisX[l]=s-o.labels.offsetX+20):(a=i.globals.translateX-r,h||(r=r+c+20),i.globals.translateYAxisX[l]=a+o.labels.offsetX)}))}},{key:"setYAxisTextAlignments",value:function(){var t=this.w,e=t.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis");(e=g.listToArray(e)).forEach((function(e,i){var a=t.config.yaxis[i];if(void 0!==a.labels.align){var s=t.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(i,"'] .apexcharts-yaxis-texts-g")),r=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(i,"'] .apexcharts-yaxis-label"));r=g.listToArray(r);var n=s.getBoundingClientRect();"left"===a.labels.align?(r.forEach((function(t,e){t.setAttribute("text-anchor","start")})),a.opposite||s.setAttribute("transform","translate(-".concat(n.width,", 0)"))):"center"===a.labels.align?(r.forEach((function(t,e){t.setAttribute("text-anchor","middle")})),s.setAttribute("transform","translate(".concat(n.width/2*(a.opposite?1:-1),", 0)"))):"right"===a.labels.align&&(r.forEach((function(t,e){t.setAttribute("text-anchor","end")})),a.opposite&&s.setAttribute("transform","translate(".concat(n.width,", 0)")))}}))}}]),t}(),Z=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.documentEvent=g.bind(this.documentEvent,this)}return a(t,[{key:"addEventListener",value:function(t,e){var i=this.w;i.globals.events.hasOwnProperty(t)?i.globals.events[t].push(e):i.globals.events[t]=[e]}},{key:"removeEventListener",value:function(t,e){var i=this.w;if(i.globals.events.hasOwnProperty(t)){var a=i.globals.events[t].indexOf(e);-1!==a&&i.globals.events[t].splice(a,1)}}},{key:"fireEvent",value:function(t,e){var i=this.w;if(i.globals.events.hasOwnProperty(t)){e&&e.length||(e=[]);for(var a=i.globals.events[t],s=a.length,r=0;r<s;r++)a[r].apply(null,e)}}},{key:"setupEventHandlers",value:function(){var t=this,e=this.w,i=this.ctx,a=e.globals.dom.baseEl.querySelector(e.globals.chartClass);this.ctx.eventList.forEach((function(t){a.addEventListener(t,(function(t){var a=Object.assign({},e,{seriesIndex:e.globals.capturedSeriesIndex,dataPointIndex:e.globals.capturedDataPointIndex});"mousemove"===t.type||"touchmove"===t.type?"function"==typeof e.config.chart.events.mouseMove&&e.config.chart.events.mouseMove(t,i,a):("mouseup"===t.type&&1===t.which||"touchend"===t.type)&&("function"==typeof e.config.chart.events.click&&e.config.chart.events.click(t,i,a),i.ctx.events.fireEvent("click",[t,i,a]))}),{capture:!1,passive:!0})})),this.ctx.eventList.forEach((function(e){document.addEventListener(e,t.documentEvent)})),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(t){var e=this.w,i=t.target.className;if("click"===t.type){var a=e.globals.dom.baseEl.querySelector(".apexcharts-menu");a&&a.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==i&&a.classList.remove("apexcharts-menu-open")}if("mousedown"===t.type){var s=e.globals.dom.Paper.select(".apexcharts-resizable-element").members;Array.prototype.forEach.call(s,(function(e){t.target.classList.contains("apexcharts-resizable-element")||t.target.classList.contains("svg_select_points")||e.selectize(!1)}))}e.globals.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,e.globals.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}]),t}(),$=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"setCurrentLocaleValues",value:function(t){var e=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(window.Apex.chart.locales));var i=e.filter((function(e){return e.name===t}))[0];if(!i)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var a=g.extend(A,i);this.w.globals.locale=a.options}}]),t}(),J=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"drawAxis",value:function(t,e){var i,a,s=this.w.globals,r=this.w.config,n=new G(this.ctx),o=new q(this.ctx);s.axisCharts&&"radar"!==t&&(s.isBarHorizontal?(a=o.drawYaxisInversed(0),i=n.drawXaxisInversed(0),s.dom.elGraphical.add(i),s.dom.elGraphical.add(a)):(i=n.drawXaxis(),s.dom.elGraphical.add(i),r.yaxis.map((function(t,e){-1===s.ignoreYAxisIndexes.indexOf(e)&&(a=o.drawYaxis(e),s.dom.Paper.add(a))})))),r.yaxis.map((function(t,e){-1===s.ignoreYAxisIndexes.indexOf(e)&&o.yAxisTitleRotate(e,t.opposite)}))}}]),t}(),Q=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"drawXCrosshairs",value:function(){var t=this.w,e=new p(this.ctx),i=new u(this.ctx),a=t.config.xaxis.crosshairs.fill.gradient,s=t.config.xaxis.crosshairs.dropShadow,r=t.config.xaxis.crosshairs.fill.type,n=a.colorFrom,o=a.colorTo,l=a.opacityFrom,h=a.opacityTo,c=a.stops,d=s.enabled,f=s.left,x=s.top,b=s.blur,m=s.color,v=s.opacity,y=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===r&&(y=e.drawGradient("vertical",n,o,l,h,null,c,null));var w=e.drawRect();1===t.config.xaxis.crosshairs.width&&(w=e.drawLine()),w.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:t.globals.gridHeight,width:g.isNumber(t.config.xaxis.crosshairs.width)?t.config.xaxis.crosshairs.width:0,height:t.globals.gridHeight,fill:y,filter:"none","fill-opacity":t.config.xaxis.crosshairs.opacity,stroke:t.config.xaxis.crosshairs.stroke.color,"stroke-width":t.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":t.config.xaxis.crosshairs.stroke.dashArray}),d&&(w=i.dropShadow(w,{left:f,top:x,blur:b,color:m,opacity:v})),t.globals.dom.elGraphical.add(w)}}},{key:"drawYCrosshairs",value:function(){var t=this.w,e=new p(this.ctx),i=t.config.yaxis[0].crosshairs,a=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){var s=e.drawLine(-a,0,t.globals.gridWidth+a,0,i.stroke.color,i.stroke.dashArray,i.stroke.width);s.attr({class:"apexcharts-ycrosshairs"}),t.globals.dom.elGraphical.add(s)}var r=e.drawLine(-a,0,t.globals.gridWidth+a,0,i.stroke.color,0,0);r.attr({class:"apexcharts-ycrosshairs-hidden"}),t.globals.dom.elGraphical.add(r)}}]),t}(),K=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"checkResponsiveConfig",value:function(t){var e=this,i=this.w,a=i.config;if(0!==a.responsive.length){var s=a.responsive.slice();s.sort((function(t,e){return t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0})).reverse();var r=new D({}),n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=s[0].breakpoint,n=window.innerWidth>0?window.innerWidth:screen.width;if(n>a){var o=m.extendArrayProps(r,i.globals.initialConfig,i);t=g.extend(o,t),t=g.extend(i.config,t),e.overrideResponsiveOptions(t)}else for(var l=0;l<s.length;l++)n<s[l].breakpoint&&(t=m.extendArrayProps(r,s[l].options,i),t=g.extend(i.config,t),e.overrideResponsiveOptions(t))};if(t){var o=m.extendArrayProps(r,t,i);o=g.extend(i.config,o),n(o=g.extend(o,t))}else n({})}}},{key:"overrideResponsiveOptions",value:function(t){var e=new D(t).init({responsiveOverride:!0});this.w.config=e}}]),t}(),tt=function(){function t(i){e(this,t),this.ctx=i,this.colors=[],this.w=i.w;var a=this.w;this.isColorFn=!1,this.isBarDistributed=a.config.plotOptions.bar.distributed&&("bar"===a.config.chart.type||"rangeBar"===a.config.chart.type)}return a(t,[{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var t=this,e=this.w,i=new g;if(e.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(e.config.theme.mode)),void 0===e.config.colors?e.globals.colors=this.predefined():(e.globals.colors=e.config.colors,Array.isArray(e.config.colors)&&e.config.colors.length>0&&"function"==typeof e.config.colors[0]&&(e.globals.colors=e.config.series.map((function(i,a){var s=e.config.colors[a];return s||(s=e.config.colors[0]),"function"==typeof s?(t.isColorFn=!0,s({value:e.globals.axisCharts?e.globals.series[a][0]?e.globals.series[a][0]:0:e.globals.series[a],seriesIndex:a,dataPointIndex:a,w:e})):s})))),e.config.theme.monochrome.enabled){var a=[],s=e.globals.series.length;this.isBarDistributed&&(s=e.globals.series[0].length*e.globals.series.length);for(var r=e.config.theme.monochrome.color,n=1/(s/e.config.theme.monochrome.shadeIntensity),o=e.config.theme.monochrome.shadeTo,l=0,h=0;h<s;h++){var c=void 0;"dark"===o?(c=i.shadeColor(-1*l,r),l+=n):(c=i.shadeColor(l,r),l+=n),a.push(c)}e.globals.colors=a.slice()}var d=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),["fill","stroke"].forEach((function(i){void 0===e.config[i].colors?e.globals[i].colors=t.isColorFn?e.config.colors:d:e.globals[i].colors=e.config[i].colors.slice(),t.pushExtraColors(e.globals[i].colors)})),void 0===e.config.dataLabels.style.colors?e.globals.dataLabels.style.colors=d:e.globals.dataLabels.style.colors=e.config.dataLabels.style.colors.slice(),this.pushExtraColors(e.globals.dataLabels.style.colors,50),void 0===e.config.plotOptions.radar.polygons.fill.colors?e.globals.radarPolygons.fill.colors=["dark"===e.config.theme.mode?"#424242":"#fff"]:e.globals.radarPolygons.fill.colors=e.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(e.globals.radarPolygons.fill.colors,20),void 0===e.config.markers.colors?e.globals.markers.colors=d:e.globals.markers.colors=e.config.markers.colors.slice(),this.pushExtraColors(e.globals.markers.colors)}},{key:"pushExtraColors",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this.w,s=e||a.globals.series.length;if(null===i&&(i=this.isBarDistributed||"heatmap"===a.config.chart.type&&a.config.plotOptions.heatmap.colorScale.inverse),i&&(s=a.globals.series[0].length*a.globals.series.length),t.length<s)for(var r=s-t.length,n=0;n<r;n++)t.push(t[n])}},{key:"updateThemeOptions",value:function(t){t.chart=t.chart||{},t.tooltip=t.tooltip||{};var e=t.theme.mode||"light",i=t.theme.palette?t.theme.palette:"dark"===e?"palette4":"palette1",a=t.chart.foreColor?t.chart.foreColor:"dark"===e?"#f6f7f8":"#373d3f";return t.tooltip.theme=e,t.chart.foreColor=a,t.theme.palette=i,t}},{key:"predefined",value:function(){switch(this.w.config.theme.palette){case"palette1":this.colors=["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"];break;case"palette2":this.colors=["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#FF9800"];break;case"palette3":this.colors=["#33b2df","#546E7A","#d4526e","#13d8aa","#A5978B"];break;case"palette4":this.colors=["#4ecdc4","#c7f464","#81D4FA","#fd6a6a","#546E7A"];break;case"palette5":this.colors=["#2b908f","#f9a3a4","#90ee7e","#fa4443","#69d2e7"];break;case"palette6":this.colors=["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"];break;case"palette7":this.colors=["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"];break;case"palette8":this.colors=["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"];break;case"palette9":this.colors=["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"];break;case"palette10":this.colors=["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"];break;default:this.colors=["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"]}return this.colors}}]),t}(),et=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(t){var e=this.w,i="title"===t?e.config.title:e.config.subtitle,a=e.globals.svgWidth/2,s=i.offsetY,r="middle";if("left"===i.align?(a=10,r="start"):"right"===i.align&&(a=e.globals.svgWidth-10,r="end"),a+=i.offsetX,s=s+parseInt(i.style.fontSize,10)+i.margin/2,void 0!==i.text){var n=new p(this.ctx).drawText({x:a,y:s,text:i.text,textAnchor:r,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,foreColor:i.style.color,opacity:1});n.node.setAttribute("class","apexcharts-".concat(t,"-text")),e.globals.dom.Paper.add(n)}}}]),t}(),it=function(){function t(i){e(this,t),this.w=i.w,this.dCtx=i}return a(t,[{key:"getTitleSubtitleCoords",value:function(t){var e=this.w,i=0,a=0,s="title"===t?e.config.title.floating:e.config.subtitle.floating,r=e.globals.dom.baseEl.querySelector(".apexcharts-".concat(t,"-text"));if(null!==r&&!s){var n=r.getBoundingClientRect();i=n.width,a=e.globals.axisCharts?n.height+5:n.height}return{width:i,height:a}}},{key:"getLegendsRect",value:function(){var t=this.w,e=t.globals.dom.baseEl.querySelector(".apexcharts-legend"),i=Object.assign({},g.getBoundingClientRect(e));return null!==e&&!t.config.legend.floating&&t.config.legend.show?this.dCtx.lgRect={x:i.x,y:i.y,height:i.height,width:0===i.height?0:i.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},"left"!==t.config.legend.position&&"right"!==t.config.legend.position||1.5*this.dCtx.lgRect.width>t.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getLargestStringFromMultiArr",value:function(t,e){var i=t;if(this.w.globals.isMultiLineX){var a=e.map((function(t,e){return Array.isArray(t)?t.length:1})),s=Math.max.apply(Math,d(a));i=e[a.indexOf(s)]}return i}}]),t}(),at=function(){function t(i){e(this,t),this.w=i.w,this.dCtx=i}return a(t,[{key:"getxAxisLabelsCoords",value:function(){var t,e=this.w,i=e.globals.labels.slice();if(e.config.xaxis.convertedCatToNumeric&&0===i.length&&(i=e.globals.categoryLabels),e.globals.timescaleLabels.length>0){var a=this.getxAxisTimeScaleLabelsCoords();t={width:a.width,height:a.height},e.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==e.config.legend.position&&"right"!==e.config.legend.position||e.config.legend.floating?0:this.dCtx.lgRect.width;var s=e.globals.xLabelFormatter,r=g.getLargestStringFromArr(i),n=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,i);e.globals.isBarHorizontal&&(n=r=e.globals.yAxisScale[0].result.reduce((function(t,e){return t.length>e.length?t:e}),0));var o=new W(this.dCtx.ctx),l=r;r=o.xLabelFormat(s,r,l),n=o.xLabelFormat(s,n,l),(e.config.xaxis.convertedCatToNumeric&&void 0===r||""===String(r).trim())&&(n=r="1");var h=new p(this.dCtx.ctx),c=h.getTextRects(r,e.config.xaxis.labels.style.fontSize),d=c;if(r!==n&&(d=h.getTextRects(n,e.config.xaxis.labels.style.fontSize)),(t={width:c.width>=d.width?c.width:d.width,height:c.height>=d.height?c.height:d.height}).width*i.length>e.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==e.config.xaxis.labels.rotate||e.config.xaxis.labels.rotateAlways){if(!e.globals.isBarHorizontal){e.globals.rotateXLabels=!0;var u=function(t){return h.getTextRects(t,e.config.xaxis.labels.style.fontSize,e.config.xaxis.labels.style.fontFamily,"rotate(".concat(e.config.xaxis.labels.rotate," 0 0)"),!1)};c=u(r),r!==n&&(d=u(n)),t.height=(c.height>d.height?c.height:d.height)/1.5,t.width=c.width>d.width?c.width:d.width}}else e.globals.rotateXLabels=!1}return e.config.xaxis.labels.show||(t={width:0,height:0}),{width:t.width,height:t.height}}},{key:"getxAxisTitleCoords",value:function(){var t=this.w,e=0,i=0;if(void 0!==t.config.xaxis.title.text){var a=new p(this.dCtx.ctx).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=a.width,i=a.height}return{width:e,height:i}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var t,e=this.w;this.dCtx.timescaleLabels=e.globals.timescaleLabels.slice();var i=this.dCtx.timescaleLabels.map((function(t){return t.value})),a=i.reduce((function(t,e){return void 0===t?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):t.length>e.length?t:e}),0);return 1.05*(t=new p(this.dCtx.ctx).getTextRects(a,e.config.xaxis.labels.style.fontSize)).width*i.length>e.globals.gridWidth&&0!==e.config.xaxis.labels.rotate&&(e.globals.overlappingXLabels=!0),t}},{key:"additionalPaddingXLabels",value:function(t){var e=this,i=this.w,a=i.globals,s=i.config,r=s.xaxis.type,n=t.width;a.skipLastTimelinelabel=!1,a.skipFirstTimelinelabel=!1;var o=i.config.yaxis[0].opposite&&i.globals.isBarHorizontal,l=function(t,o){(function(t){return-1!==a.collapsedSeriesIndices.indexOf(t)})(o)||("datetime"!==r&&e.dCtx.gridPad.left<n/2-e.dCtx.yAxisWidthLeft&&!a.rotateXLabels&&!s.xaxis.labels.trim&&(e.dCtx.xPadLeft=n/2+1),function(t){if(e.dCtx.timescaleLabels&&e.dCtx.timescaleLabels.length){var s=e.dCtx.timescaleLabels[0],o=e.dCtx.timescaleLabels[e.dCtx.timescaleLabels.length-1].position+n/1.75-e.dCtx.yAxisWidthRight,l=s.position-n/1.75+e.dCtx.yAxisWidthLeft;o>a.gridWidth&&(a.skipLastTimelinelabel=!0),l<0&&(a.skipFirstTimelinelabel=!0)}else"datetime"===r?e.dCtx.gridPad.right<n&&!a.rotateXLabels&&(a.skipLastTimelinelabel=!0):"datetime"!==r&&e.dCtx.gridPad.right<n/2-e.dCtx.yAxisWidthRight&&!a.rotateXLabels&&("between"!==i.config.xaxis.tickPlacement||i.globals.isBarHorizontal)&&(e.dCtx.xPadRight=n/2+1)}())};s.yaxis.forEach((function(t,i){o?(e.dCtx.gridPad.left<n&&(e.dCtx.xPadLeft=n/2+1),e.dCtx.xPadRight=n/2+1):l(0,i)}))}}]),t}(),st=function(){function t(i){e(this,t),this.w=i.w,this.dCtx=i}return a(t,[{key:"getyAxisLabelsCoords",value:function(){var t=this,e=this.w,i=[],a=10,s=new B(this.dCtx.ctx);return e.config.yaxis.map((function(r,n){var o=e.globals.yAxisScale[n];if(!s.isYAxisHidden(n)&&r.labels.show&&o.result.length){var l=e.globals.yLabelFormatters[n],h=String(o.niceMin).length>String(o.niceMax).length?o.niceMin:o.niceMax,c=l(h,{seriesIndex:n,dataPointIndex:-1,w:e}),d=c;if(void 0!==c&&0!==c.length||(c=h),e.globals.isBarHorizontal){a=0;var u=e.globals.labels.slice();c=l(c=g.getLargestStringFromArr(u),{seriesIndex:n,dataPointIndex:-1,w:e}),d=t.dCtx.dimHelpers.getLargestStringFromMultiArr(c,u)}var f=new p(t.dCtx.ctx),x=f.getTextRects(c,r.labels.style.fontSize),b=x;c!==d&&(b=f.getTextRects(d,r.labels.style.fontSize)),i.push({width:(b.width>x.width?b.width:x.width)+a,height:b.height>x.height?b.height:x.height})}else i.push({width:0,height:0})})),i}},{key:"getyAxisTitleCoords",value:function(){var t=this,e=this.w,i=[];return e.config.yaxis.map((function(e,a){if(e.show&&void 0!==e.title.text){var s=new p(t.dCtx.ctx).getTextRects(e.title.text,e.title.style.fontSize,e.title.style.fontFamily,"rotate(-90 0 0)",!1);i.push({width:s.width,height:s.height})}else i.push({width:0,height:0})})),i}},{key:"getTotalYAxisWidth",value:function(){var t=this.w,e=0,i=0,a=0,s=t.globals.yAxisScale.length>1?10:0,r=new B(this.dCtx.ctx),n=function(n,o){var l=t.config.yaxis[o].floating,h=0;n.width>0&&!l?(h=n.width+s,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(o)&&(h=h-n.width-s)):h=l||r.isYAxisHidden(o)?0:5,t.config.yaxis[o].opposite?a+=h:i+=h,e+=h};return t.globals.yLabelsCoords.map((function(t,e){n(t,e)})),t.globals.yTitleCoords.map((function(t,e){n(t,e)})),t.globals.isBarHorizontal&&(e=t.globals.yLabelsCoords[0].width+t.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=i,this.dCtx.yAxisWidthRight=a,e}}]),t}(),rt=function(){function t(i){e(this,t),this.w=i.w,this.dCtx=i}return a(t,[{key:"gridPadForColumnsInNumericAxis",value:function(t){var e=this.w;if(e.globals.noData||e.globals.allSeriesCollapsed)return 0;var i=e.config.chart.type,a=0,s="bar"===i||"rangeBar"===i?e.config.series.length:1;if(e.globals.comboBarCount>0&&(s=e.globals.comboBarCount),e.globals.collapsedSeries.forEach((function(t){"bar"!==t.type&&"rangeBar"!==t.type||(s-=1)})),e.config.chart.stacked&&(s=1),("bar"===i||"rangeBar"===i||e.globals.comboBarCount>0)&&e.globals.isXNumeric&&!e.globals.isBarHorizontal&&s>0){var r,n,o=Math.abs(e.globals.initialMaxX-e.globals.initialMinX);o<=3&&(o=e.globals.dataPoints),r=o/t,e.globals.minXDiff&&e.globals.minXDiff/r>0&&(n=e.globals.minXDiff/r),n>t/2&&(n/=2),(a=n/s*parseInt(e.config.plotOptions.bar.columnWidth,10)/100)<1&&(a=1),a=a/(s>1?1:1.5)+5,e.globals.barPadForNumericAxis=a}return a}},{key:"gridPadFortitleSubtitle",value:function(){var t=this,e=this.w,i=e.globals,a=this.dCtx.isSparkline||!e.globals.axisCharts?0:10;["title","subtitle"].forEach((function(i){void 0!==e.config[i].text?a+=e.config[i].margin:a+=t.dCtx.isSparkline||!e.globals.axisCharts?0:5}));var s=e.config.series.length>1||!e.globals.axisCharts||e.config.legend.showForSingleSeries;e.config.legend.show&&"bottom"===e.config.legend.position&&!e.config.legend.floating&&s&&(a+=10);var r=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),n=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");i.gridHeight=i.gridHeight-r.height-n.height-a,i.translateY=i.translateY+r.height+n.height+a}},{key:"setGridXPosForDualYAxis",value:function(t,e){var i=this.w,a=new B(this.dCtx.ctx);i.config.yaxis.map((function(s,r){-1!==i.globals.ignoreYAxisIndexes.indexOf(r)||s.floating||a.isYAxisHidden(r)||(s.opposite&&(i.globals.translateX=i.globals.translateX-(e[r].width+t[r].width)-parseInt(i.config.yaxis[r].labels.style.fontSize,10)/1.2-12),i.globals.translateX<2&&(i.globals.translateX=2))}))}}]),t}(),nt=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new it(this),this.dimYAxis=new st(this),this.dimXAxis=new at(this),this.dimGrid=new rt(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return a(t,[{key:"plotCoords",value:function(){var t=this.w.globals;this.lgRect=this.dimHelpers.getLegendsRect(),t.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),t.gridHeight=t.gridHeight-this.gridPad.top-this.gridPad.bottom,t.gridWidth=t.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var e=this.dimGrid.gridPadForColumnsInNumericAxis(t.gridWidth);t.gridWidth=t.gridWidth-2*e,t.translateX=t.translateX+this.gridPad.left+this.xPadLeft+(e>0?e+4:0),t.translateY=t.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var t=this,e=this.w,i=e.globals,a=this.dimYAxis.getyAxisLabelsCoords(),s=this.dimYAxis.getyAxisTitleCoords();e.globals.yLabelsCoords=[],e.globals.yTitleCoords=[],e.config.yaxis.map((function(t,i){e.globals.yLabelsCoords.push({width:a[i].width,index:i}),e.globals.yTitleCoords.push({width:s[i].width,index:i})})),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var r=this.dimXAxis.getxAxisLabelsCoords(),n=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(r,n),i.translateXAxisY=e.globals.rotateXLabels?this.xAxisHeight/8:-4,i.translateXAxisX=e.globals.rotateXLabels&&e.globals.isXNumeric&&e.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,e.globals.isBarHorizontal&&(i.rotateXLabels=!1,i.translateXAxisY=parseInt(e.config.xaxis.labels.style.fontSize,10)/1.5*-1),i.translateXAxisY=i.translateXAxisY+e.config.xaxis.labels.offsetY,i.translateXAxisX=i.translateXAxisX+e.config.xaxis.labels.offsetX;var o=this.yAxisWidth,l=this.xAxisHeight;i.xAxisLabelsHeight=this.xAxisHeight,i.xAxisHeight=this.xAxisHeight;var h=10;("radar"===e.config.chart.type||this.isSparkline)&&(o=0,l=i.goldenPadding),this.isSparkline&&(this.lgRect={height:0,width:0},l=0,o=0,h=0),this.dimXAxis.additionalPaddingXLabels(r);var c=function(){i.translateX=o,i.gridHeight=i.svgHeight-t.lgRect.height-l-(t.isSparkline?0:e.globals.rotateXLabels?10:15),i.gridWidth=i.svgWidth-o};switch("top"===e.config.xaxis.position&&(h=i.xAxisHeight-e.config.xaxis.axisTicks.height-5),e.config.legend.position){case"bottom":i.translateY=h,c();break;case"top":i.translateY=this.lgRect.height+h,c();break;case"left":i.translateY=h,i.translateX=this.lgRect.width+o,i.gridHeight=i.svgHeight-l-12,i.gridWidth=i.svgWidth-this.lgRect.width-o;break;case"right":i.translateY=h,i.translateX=o,i.gridHeight=i.svgHeight-l-12,i.gridWidth=i.svgWidth-this.lgRect.width-o-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(s,a),new q(this.ctx).setYAxisXPosition(a,s)}},{key:"setDimensionsForNonAxisCharts",value:function(){var t=this.w,e=t.globals,i=t.config,a=0;t.config.legend.show&&!t.config.legend.floating&&(a=20);var s="pie"===i.chart.type||"polarArea"===i.chart.type||"donut"===i.chart.type?"pie":"radialBar",r=i.plotOptions[s].offsetY,n=i.plotOptions[s].offsetX;if(!i.legend.show||i.legend.floating)return e.gridHeight=e.svgHeight-i.grid.padding.left+i.grid.padding.right,e.gridWidth=e.gridHeight,e.translateY=r,void(e.translateX=n+(e.svgWidth-e.gridWidth)/2);switch(i.legend.position){case"bottom":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.gridHeight,e.translateY=r-10,e.translateX=n+(e.svgWidth-e.gridWidth)/2;break;case"top":e.gridHeight=e.svgHeight-this.lgRect.height-e.goldenPadding,e.gridWidth=e.gridHeight,e.translateY=this.lgRect.height+r+10,e.translateX=n+(e.svgWidth-e.gridWidth)/2;break;case"left":e.gridWidth=e.svgWidth-this.lgRect.width-a,e.gridHeight="auto"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=r,e.translateX=n+this.lgRect.width+a;break;case"right":e.gridWidth=e.svgWidth-this.lgRect.width-a-5,e.gridHeight="auto"!==i.chart.height?e.svgHeight:e.gridWidth,e.translateY=r,e.translateX=n+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(t,e){var i=this.w;this.xAxisHeight=(t.height+e.height)*(i.globals.isMultiLineX?1.2:i.globals.LINE_HEIGHT_RATIO)+(i.globals.rotateXLabels?22:10),this.xAxisWidth=t.width,this.xAxisHeight-e.height>i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeight<i.config.xaxis.labels.minHeight&&(this.xAxisHeight=i.config.xaxis.labels.minHeight),i.config.xaxis.floating&&(this.xAxisHeight=0);var a=0,s=0;i.config.yaxis.forEach((function(t){a+=t.labels.minWidth,s+=t.labels.maxWidth})),this.yAxisWidth<a&&(this.yAxisWidth=a),this.yAxisWidth>s&&(this.yAxisWidth=s)}}]),t}(),ot=function(){function t(i){e(this,t),this.w=i.w,this.lgCtx=i}return a(t,[{key:"getLegendStyles",value:function(){var t=document.createElement("style");t.setAttribute("type","text/css");var e=document.createTextNode("\t\n \t\n .apexcharts-legend {\t\n display: flex;\t\n overflow: auto;\t\n padding: 0 10px;\t\n }\t\n .apexcharts-legend.position-bottom, .apexcharts-legend.position-top {\t\n flex-wrap: wrap\t\n }\t\n .apexcharts-legend.position-right, .apexcharts-legend.position-left {\t\n flex-direction: column;\t\n bottom: 0;\t\n }\t\n .apexcharts-legend.position-bottom.apexcharts-align-left, .apexcharts-legend.position-top.apexcharts-align-left, .apexcharts-legend.position-right, .apexcharts-legend.position-left {\t\n justify-content: flex-start;\t\n }\t\n .apexcharts-legend.position-bottom.apexcharts-align-center, .apexcharts-legend.position-top.apexcharts-align-center {\t\n justify-content: center; \t\n }\t\n .apexcharts-legend.position-bottom.apexcharts-align-right, .apexcharts-legend.position-top.apexcharts-align-right {\t\n justify-content: flex-end;\t\n }\t\n .apexcharts-legend-series {\t\n cursor: pointer;\t\n line-height: normal;\t\n }\t\n .apexcharts-legend.position-bottom .apexcharts-legend-series, .apexcharts-legend.position-top .apexcharts-legend-series{\t\n display: flex;\t\n align-items: center;\t\n }\t\n .apexcharts-legend-text {\t\n position: relative;\t\n font-size: 14px;\t\n }\t\n .apexcharts-legend-text *, .apexcharts-legend-marker * {\t\n pointer-events: none;\t\n }\t\n .apexcharts-legend-marker {\t\n position: relative;\t\n display: inline-block;\t\n cursor: pointer;\t\n margin-right: 3px;\t\n border-style: solid;\n }\t\n \t\n .apexcharts-legend.apexcharts-align-right .apexcharts-legend-series, .apexcharts-legend.apexcharts-align-left .apexcharts-legend-series{\t\n display: inline-block;\t\n }\t\n .apexcharts-legend-series.apexcharts-no-click {\t\n cursor: auto;\t\n }\t\n .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\t\n display: none !important;\t\n }\t\n .apexcharts-inactive-legend {\t\n opacity: 0.45;\t\n }");return t.appendChild(e),t}},{key:"getLegendBBox",value:function(){var t=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),e=t.width;return{clwh:t.height,clww:e}}},{key:"appendToForeignObject",value:function(){var t=this.w.globals;t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject");var e=t.dom.elLegendForeign;e.setAttribute("x",0),e.setAttribute("y",0),e.setAttribute("width",t.svgWidth),e.setAttribute("height",t.svgHeight),t.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),e.appendChild(t.dom.elLegendWrap),e.appendChild(this.getLegendStyles()),t.dom.Paper.node.insertBefore(e,t.dom.elGraphical.node)}},{key:"toggleDataSeries",value:function(t,e){var i=this,a=this.w;if(a.globals.axisCharts||"radialBar"===a.config.chart.type){a.globals.resized=!0;var s=null,r=null;a.globals.risingSeries=[],a.globals.axisCharts?(s=a.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(t,"']")),r=parseInt(s.getAttribute("data:realIndex"),10)):(s=a.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(t+1,"']")),r=parseInt(s.getAttribute("rel"),10)-1),e?[{cs:a.globals.collapsedSeries,csi:a.globals.collapsedSeriesIndices},{cs:a.globals.ancillaryCollapsedSeries,csi:a.globals.ancillaryCollapsedSeriesIndices}].forEach((function(t){i.riseCollapsedSeries(t.cs,t.csi,r)})):this.hideSeries({seriesEl:s,realIndex:r})}else{var n=a.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(t+1,"'] path")),o=a.config.chart.type;if("pie"===o||"polarArea"===o||"donut"===o){var l=a.config.plotOptions.pie.donut.labels;new p(this.lgCtx.ctx).pathMouseDown(n.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(n.members[0].node,l)}n.fire("click")}}},{key:"hideSeries",value:function(t){var e=t.seriesEl,i=t.realIndex,a=this.w,s=g.clone(a.config.series);if(a.globals.axisCharts){var r=!1;if(a.config.yaxis[i]&&a.config.yaxis[i].show&&a.config.yaxis[i].showAlways&&(r=!0,a.globals.ancillaryCollapsedSeriesIndices.indexOf(i)<0&&(a.globals.ancillaryCollapsedSeries.push({index:i,data:s[i].data.slice(),type:e.parentNode.className.baseVal.split("-")[1]}),a.globals.ancillaryCollapsedSeriesIndices.push(i))),!r){a.globals.collapsedSeries.push({index:i,data:s[i].data.slice(),type:e.parentNode.className.baseVal.split("-")[1]}),a.globals.collapsedSeriesIndices.push(i);var n=a.globals.risingSeries.indexOf(i);a.globals.risingSeries.splice(n,1)}s[i].data=[]}else a.globals.collapsedSeries.push({index:i,data:s[i]}),a.globals.collapsedSeriesIndices.push(i),s[i]=0;for(var o=e.childNodes,l=0;l<o.length;l++)o[l].classList.contains("apexcharts-series-markers-wrap")&&(o[l].classList.contains("apexcharts-hide")?o[l].classList.remove("apexcharts-hide"):o[l].classList.add("apexcharts-hide"));a.globals.allSeriesCollapsed=a.globals.collapsedSeries.length===a.config.series.length,this.lgCtx.ctx.updateHelpers._updateSeries(s,a.config.chart.animations.dynamicAnimation.enabled)}},{key:"riseCollapsedSeries",value:function(t,e,i){var a=this.w;if(t.length>0)for(var s=0;s<t.length;s++)t[s].index===i&&(a.globals.axisCharts?(a.config.series[i].data=t[s].data.slice(),t.splice(s,1),e.splice(s,1),a.globals.risingSeries.push(i)):(a.config.series[i]=t[s].data,t.splice(s,1),e.splice(s,1),a.globals.risingSeries.push(i)),this.lgCtx.ctx.updateHelpers._updateSeries(a.config.series,a.config.chart.animations.dynamicAnimation.enabled))}}]),t}(),lt=function(){function t(i,a){e(this,t),this.ctx=i,this.w=i.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new ot(this)}return a(t,[{key:"init",value:function(){var t=this.w,e=t.globals,i=t.config;if((i.legend.showForSingleSeries&&1===e.series.length||this.isBarsDistributed||e.series.length>1||!e.axisCharts)&&i.legend.show){for(;e.dom.elLegendWrap.firstChild;)e.dom.elLegendWrap.removeChild(e.dom.elLegendWrap.firstChild);this.drawLegends(),g.isIE11()?document.getElementsByTagName("head")[0].appendChild(this.legendHelpers.getLegendStyles()):this.legendHelpers.appendToForeignObject(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical()}}},{key:"drawLegends",value:function(){var t=this.w,e=t.config.legend.fontFamily,i=t.globals.seriesNames,a=t.globals.colors.slice();if("heatmap"===t.config.chart.type){var s=t.config.plotOptions.heatmap.colorScale.ranges;i=s.map((function(t){return t.name?t.name:t.from+" - "+t.to})),a=s.map((function(t){return t.color}))}else this.isBarsDistributed&&(i=t.globals.labels.slice());for(var r=t.globals.legendFormatter,n=t.config.legend.inverseOrder,o=n?i.length-1:0;n?o>=0:o<=i.length-1;n?o--:o++){var l=r(i[o],{seriesIndex:o,w:t}),h=!1,c=!1;if(t.globals.collapsedSeries.length>0)for(var d=0;d<t.globals.collapsedSeries.length;d++)t.globals.collapsedSeries[d].index===o&&(h=!0);if(t.globals.ancillaryCollapsedSeriesIndices.length>0)for(var g=0;g<t.globals.ancillaryCollapsedSeriesIndices.length;g++)t.globals.ancillaryCollapsedSeriesIndices[g]===o&&(c=!0);var u=document.createElement("span");u.classList.add("apexcharts-legend-marker");var f=t.config.legend.markers.offsetX,x=t.config.legend.markers.offsetY,b=t.config.legend.markers.height,v=t.config.legend.markers.width,y=t.config.legend.markers.strokeWidth,w=t.config.legend.markers.strokeColor,k=t.config.legend.markers.radius,A=u.style;A.background=a[o],A.color=a[o],t.config.legend.markers.fillColors&&t.config.legend.markers.fillColors[o]&&(A.background=t.config.legend.markers.fillColors[o]),A.height=Array.isArray(b)?parseFloat(b[o])+"px":parseFloat(b)+"px",A.width=Array.isArray(v)?parseFloat(v[o])+"px":parseFloat(v)+"px",A.left=Array.isArray(f)?f[o]:f,A.top=Array.isArray(x)?x[o]:x,A.borderWidth=Array.isArray(y)?y[o]:y,A.borderColor=Array.isArray(w)?w[o]:w,A.borderRadius=Array.isArray(k)?parseFloat(k[o])+"px":parseFloat(k)+"px",t.config.legend.markers.customHTML&&(Array.isArray(t.config.legend.markers.customHTML)?t.config.legend.markers.customHTML[o]&&(u.innerHTML=t.config.legend.markers.customHTML[o]()):u.innerHTML=t.config.legend.markers.customHTML()),p.setAttrs(u,{rel:o+1,"data:collapsed":h||c}),(h||c)&&u.classList.add("apexcharts-inactive-legend");var S=document.createElement("div"),C=document.createElement("span");C.classList.add("apexcharts-legend-text"),C.innerHTML=Array.isArray(l)?l.join(" "):l;var L=t.config.legend.labels.useSeriesColors?t.globals.colors[o]:t.config.legend.labels.colors;L||(L=t.config.chart.foreColor),C.style.color=L,C.style.fontSize=parseFloat(t.config.legend.fontSize)+"px",C.style.fontWeight=t.config.legend.fontWeight,C.style.fontFamily=e||t.config.chart.fontFamily,p.setAttrs(C,{rel:o+1,i:o,"data:default-text":encodeURIComponent(l),"data:collapsed":h||c}),S.appendChild(u),S.appendChild(C);var P=new m(this.ctx);t.config.legend.showForZeroSeries||0===P.getSeriesTotalByIndex(o)&&P.seriesHaveSameValues(o)&&!P.isSeriesNull(o)&&-1===t.globals.collapsedSeriesIndices.indexOf(o)&&-1===t.globals.ancillaryCollapsedSeriesIndices.indexOf(o)&&S.classList.add("apexcharts-hidden-zero-series"),t.config.legend.showForNullSeries||P.isSeriesNull(o)&&-1===t.globals.collapsedSeriesIndices.indexOf(o)&&-1===t.globals.ancillaryCollapsedSeriesIndices.indexOf(o)&&S.classList.add("apexcharts-hidden-null-series"),t.globals.dom.elLegendWrap.appendChild(S),t.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(t.config.legend.horizontalAlign)),t.globals.dom.elLegendWrap.classList.add("position-"+t.config.legend.position),S.classList.add("apexcharts-legend-series"),S.style.margin="".concat(t.config.legend.itemMargin.vertical,"px ").concat(t.config.legend.itemMargin.horizontal,"px"),t.globals.dom.elLegendWrap.style.width=t.config.legend.width?t.config.legend.width+"px":"",t.globals.dom.elLegendWrap.style.height=t.config.legend.height?t.config.legend.height+"px":"",p.setAttrs(S,{rel:o+1,"data:collapsed":h||c}),(h||c)&&S.classList.add("apexcharts-inactive-legend"),t.config.legend.onItemClick.toggleDataSeries||S.classList.add("apexcharts-no-click")}"heatmap"!==t.config.chart.type&&!this.isBarsDistributed&&t.config.legend.onItemClick.toggleDataSeries&&t.globals.dom.elWrap.addEventListener("click",this.onLegendClick,!0),t.config.legend.onItemHover.highlightDataSeries&&(t.globals.dom.elWrap.addEventListener("mousemove",this.onLegendHovered,!0),t.globals.dom.elWrap.addEventListener("mouseout",this.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(t,e){var i=this.w,a=i.globals.dom.baseEl.querySelector(".apexcharts-legend"),s=a.getBoundingClientRect(),r=0,n=0;if("bottom"===i.config.legend.position)n+=i.globals.svgHeight-s.height/2;else if("top"===i.config.legend.position){var o=new nt(this.ctx),l=o.dimHelpers.getTitleSubtitleCoords("title").height,h=o.dimHelpers.getTitleSubtitleCoords("subtitle").height;n=n+(l>0?l-10:0)+(h>0?h-10:0)}a.style.position="absolute",r=r+t+i.config.legend.offsetX,n=n+e+i.config.legend.offsetY,a.style.left=r+"px",a.style.top=n+"px","bottom"===i.config.legend.position?(a.style.top="auto",a.style.bottom=5-i.config.legend.offsetY+"px"):"right"===i.config.legend.position&&(a.style.left="auto",a.style.right=25+i.config.legend.offsetX+"px"),["width","height"].forEach((function(t){a.style[t]&&(a.style[t]=parseInt(i.config.legend[t],10)+"px")}))}},{key:"legendAlignHorizontal",value:function(){var t=this.w;t.globals.dom.baseEl.querySelector(".apexcharts-legend").style.right=0;var e=this.legendHelpers.getLegendBBox(),i=new nt(this.ctx),a=i.dimHelpers.getTitleSubtitleCoords("title"),s=i.dimHelpers.getTitleSubtitleCoords("subtitle"),r=0;"bottom"===t.config.legend.position?r=-e.clwh/1.8:"top"===t.config.legend.position&&(r=a.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,r)}},{key:"legendAlignVertical",value:function(){var t=this.w,e=this.legendHelpers.getLegendBBox(),i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}},{key:"onLegendHovered",value:function(t){var e=this.w,i=t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker");if("heatmap"===e.config.chart.type||this.isBarsDistributed){if(i){var a=parseInt(t.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,a,this.w]),new M(this.ctx).highlightRangeInSeries(t,t.target)}}else!t.target.classList.contains("apexcharts-inactive-legend")&&i&&new M(this.ctx).toggleSeriesOnHover(t,t.target)}},{key:"onLegendClick",value:function(t){if(t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker")){var e=parseInt(t.target.getAttribute("rel"),10)-1,i="true"===t.target.getAttribute("data:collapsed"),a=this.w.config.chart.events.legendClick;"function"==typeof a&&a(this.ctx,e,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,e,this.w]);var s=this.w.config.legend.markers.onClick;"function"==typeof s&&t.target.classList.contains("apexcharts-legend-marker")&&(s(this.ctx,e,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,e,this.w])),this.legendHelpers.toggleDataSeries(e,i)}}}]),t}(),ht=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar}return a(t,[{key:"createToolbar",value:function(){var t=this,e=this.w,i=function(){return document.createElement("div")},a=i();if(a.setAttribute("class","apexcharts-toolbar"),a.style.top=e.config.chart.toolbar.offsetY+"px",a.style.right=3-e.config.chart.toolbar.offsetX+"px",e.globals.dom.elWrap.appendChild(a),this.elZoom=i(),this.elZoomIn=i(),this.elZoomOut=i(),this.elPan=i(),this.elSelection=i(),this.elZoomReset=i(),this.elMenuIcon=i(),this.elMenu=i(),this.elCustomIcons=[],this.t=e.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var s=0;s<this.t.customIcons.length;s++)this.elCustomIcons.push(i());var r=[],n=function(i,a,s){var n=i.toLowerCase();t.t[n]&&e.config.chart.zoom.enabled&&r.push({el:a,icon:"string"==typeof t.t[n]?t.t[n]:s,title:t.localeValues[i],class:"apexcharts-".concat(n,"-icon")})};n("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n'),n("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n');var o=function(i){t.t[i]&&e.config.chart[i].enabled&&r.push({el:"zoom"===i?t.elZoom:t.elSelection,icon:"string"==typeof t.t[i]?t.t[i]:"zoom"===i?'<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>\n <path d="M0 0h24v24H0V0z" fill="none"/>\n <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>\n</svg>':'<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>\n</svg>',title:t.localeValues["zoom"===i?"selectionZoom":"selection"],class:e.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(i,"-icon")})};o("zoom"),o("selection"),this.t.pan&&e.config.chart.zoom.enabled&&r.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <defs>\n <path d="M0 0h24v24H0z" id="a"/>\n </defs>\n <clipPath id="b">\n <use overflow="visible" xlink:href="#a"/>\n </clipPath>\n <path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>\n</svg>',title:this.localeValues.pan,class:e.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),n("reset",this.elZoomReset,'<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>\n <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'),this.t.download&&r.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var l=0;l<this.elCustomIcons.length;l++)r.push({el:this.elCustomIcons[l],icon:this.t.customIcons[l].icon,title:this.t.customIcons[l].title,index:this.t.customIcons[l].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[l].class});r.forEach((function(t,e){t.index&&g.moveIndexInArray(r,e,t.index)}));for(var h=0;h<r.length;h++)p.setAttrs(r[h].el,{class:r[h].class,title:r[h].title}),r[h].el.innerHTML=r[h].icon,a.appendChild(r[h].el);this._createHamburgerMenu(a),e.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):e.globals.panEnabled?this.elPan.classList.add(this.selectedClass):e.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(t){this.elMenuItems=[],t.appendChild(this.elMenu),p.setAttrs(this.elMenu,{class:"apexcharts-menu"});var e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];this.w.globals.allSeriesHasEqualX||e.splice(2,1);for(var i=0;i<e.length;i++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[i].innerHTML=e[i].title,p.setAttrs(this.elMenuItems[i],{class:"apexcharts-menu-item ".concat(e[i].name),title:e[i].title}),this.elMenu.appendChild(this.elMenuItems[i])}},{key:"addToolbarEventListeners",value:function(){var t=this;this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach((function(e){e.classList.contains("exportSVG")?e.addEventListener("click",t.handleDownload.bind(t,"svg")):e.classList.contains("exportPNG")?e.addEventListener("click",t.handleDownload.bind(t,"png")):e.classList.contains("exportCSV")&&e.addEventListener("click",t.handleDownload.bind(t,"csv"))}));for(var e=0;e<this.t.customIcons.length;e++)this.elCustomIcons[e].addEventListener("click",this.t.customIcons[e].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(t){this.ctx.getSyncedCharts().forEach((function(e){e.ctx.toolbar.toggleOtherControls();var i="selection"===t?e.ctx.toolbar.elSelection:e.ctx.toolbar.elZoom,a="selection"===t?"selectionEnabled":"zoomEnabled";e.w.globals[a]=!e.w.globals[a],i.classList.contains(e.ctx.toolbar.selectedClass)?i.classList.remove(e.ctx.toolbar.selectedClass):i.classList.add(e.ctx.toolbar.selectedClass)}))}},{key:"getToolbarIconsReference",value:function(){var t=this.w;this.elZoom||(this.elZoom=t.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(t){this.toggleOtherControls(),"pan"===t?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach((function(t){t.ctx.toolbar.toggleOtherControls(),t.w.globals.panEnabled=!t.w.globals.panEnabled,t.ctx.toolbar.elPan.classList.contains(t.ctx.toolbar.selectedClass)?t.ctx.toolbar.elPan.classList.remove(t.ctx.toolbar.selectedClass):t.ctx.toolbar.elPan.classList.add(t.ctx.toolbar.selectedClass)}))}},{key:"toggleOtherControls",value:function(){var t=this,e=this.w;e.globals.panEnabled=!1,e.globals.zoomEnabled=!1,e.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach((function(e){e&&e.classList.remove(t.selectedClass)}))}},{key:"handleZoomIn",value:function(){var t=this.w,e=(t.globals.minX+t.globals.maxX)/2,i=(t.globals.minX+e)/2,a=(t.globals.maxX+e)/2,s=this._getNewMinXMaxX(i,a);t.globals.disableZoomIn||this.zoomUpdateOptions(s.minX,s.maxX)}},{key:"handleZoomOut",value:function(){var t=this.w;if(!("datetime"===t.config.xaxis.type&&new Date(t.globals.minX).getUTCFullYear()<1e3)){var e=(t.globals.minX+t.globals.maxX)/2,i=t.globals.minX-(e-t.globals.minX),a=t.globals.maxX-(e-t.globals.maxX),s=this._getNewMinXMaxX(i,a);t.globals.disableZoomOut||this.zoomUpdateOptions(s.minX,s.maxX)}}},{key:"_getNewMinXMaxX",value:function(t,e){var i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}},{key:"zoomUpdateOptions",value:function(t,e){var i=this.w;if(void 0!==t||void 0!==e){if(!(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))){var a={min:t,max:e},s=this.getBeforeZoomRange(a);s&&(a=s.xaxis);var r={xaxis:a},n=g.clone(i.globals.initialConfig.yaxis);i.config.chart.zoom.autoScaleYaxis&&(n=new j(this.ctx).autoScaleY(this.ctx,n,{xaxis:a})),i.config.chart.group||(r.yaxis=n),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(a,n)}}else this.handleZoomReset()}},{key:"zoomCallback",value:function(t,e){"function"==typeof this.ev.zoomed&&this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e})}},{key:"getBeforeZoomRange",value:function(t,e){var i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}},{key:"toggleMenu",value:function(){var t=this;window.setTimeout((function(){t.elMenu.classList.contains("apexcharts-menu-open")?t.elMenu.classList.remove("apexcharts-menu-open"):t.elMenu.classList.add("apexcharts-menu-open")}),0)}},{key:"handleDownload",value:function(t){var e=this.w,i=new V(this.ctx);switch(t){case"svg":i.exportToSVG(this.ctx);break;case"png":i.exportToPng(this.ctx);break;case"csv":i.exportToCSV({series:e.config.series})}}},{key:"handleZoomReset",value:function(t){this.ctx.getSyncedCharts().forEach((function(t){var e=t.w;e.globals.lastXAxis.min=void 0,e.globals.lastXAxis.max=void 0,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max}),e.globals.zoomed=!1;var i=t.ctx.series.emptyCollapsedSeries(g.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled)}))}},{key:"destroy",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),t}(),ct=function(t){function i(t){var a;return e(this,i),(a=c(this,l(i).call(this,t))).ctx=t,a.w=t.w,a.dragged=!1,a.graphics=new p(a.ctx),a.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],a.clientX=0,a.clientY=0,a.startX=0,a.endX=0,a.dragX=0,a.startY=0,a.endY=0,a.dragY=0,a.moveDirection="none",a}return o(i,t),a(i,[{key:"init",value:function(t){var e=this,i=t.xyRatios,a=this.w,s=this;this.xyRatios=i,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=a.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),a.globals.dom.elGraphical.add(this.zoomRect),a.globals.dom.elGraphical.add(this.selectionRect),"x"===a.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:a.globals.gridWidth,maxY:a.globals.gridHeight}).on("dragmove",this.selectionDragging.bind(this,"dragging")):"y"===a.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:a.globals.gridWidth}).on("dragmove",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=a.globals.dom.baseEl.querySelector(a.globals.chartClass),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach((function(t){e.hoverArea.addEventListener(t,s.svgMouseEvents.bind(s,i),{capture:!1,passive:!0})}))}},{key:"destroy",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:"svgMouseEvents",value:function(t,e){var i=this.w,a=this,s=this.ctx.toolbar,r=i.globals.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,n=i.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===n?"zoom":"pan")):this.shiftWasPressed&&(s.enableZoomPanFromToolbar(n),this.shiftWasPressed=!1),!e.target.classList.contains("apexcharts-selection-rect")&&!e.target.parentNode.classList.contains("apexcharts-toolbar")){if(a.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,a.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which){var o=a.gridRect.getBoundingClientRect();a.startX=a.clientX-o.left,a.startY=a.clientY-o.top,a.dragged=!1,a.w.globals.mousedown=!0}if(("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(a.dragged=!0,i.globals.panEnabled?(i.globals.selection=null,a.w.globals.mousedown&&a.panDragging({context:a,zoomtype:r,xyRatios:t})):(a.w.globals.mousedown&&i.globals.zoomEnabled||a.w.globals.mousedown&&i.globals.selectionEnabled)&&(a.selection=a.selectionDrawing({context:a,zoomtype:r}))),"mouseup"===e.type||"touchend"===e.type||"mouseleave"===e.type){var l=a.gridRect.getBoundingClientRect();a.w.globals.mousedown&&(a.endX=a.clientX-l.left,a.endY=a.clientY-l.top,a.dragX=Math.abs(a.endX-a.startX),a.dragY=Math.abs(a.endY-a.startY),(i.globals.zoomEnabled||i.globals.selectionEnabled)&&a.selectionDrawn({context:a,zoomtype:r}),i.globals.panEnabled&&i.config.xaxis.convertedCatToNumeric&&a.delayedPanScrolled()),i.globals.zoomEnabled&&a.hideSelectionRect(this.selectionRect),a.dragged=!1,a.w.globals.mousedown=!1}this.makeSelectionRectDraggable()}}},{key:"makeSelectionRectDraggable",value:function(){var t=this.w;if(this.selectionRect){var e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&this.slDraggableRect.selectize({points:"l, r",pointSize:8,pointType:"rect"}).resize({constraint:{minX:0,minY:0,maxX:t.globals.gridWidth,maxY:t.globals.gridHeight}}).on("resizing",this.selectionDragging.bind(this,"resizing"))}}},{key:"preselectedSelection",value:function(){var t=this.w,e=this.xyRatios;if(!t.globals.zoomEnabled)if(void 0!==t.globals.selection&&null!==t.globals.selection)this.drawSelectionRect(t.globals.selection);else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){var i=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,a={x:i,y:0,width:t.globals.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-i,height:t.globals.gridHeight,translateX:0,translateY:0,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}},{key:"drawSelectionRect",value:function(t){var e=t.x,i=t.y,a=t.width,s=t.height,r=t.translateX,n=void 0===r?0:r,o=t.translateY,l=void 0===o?0:o,h=this.w,c=this.zoomRect,d=this.selectionRect;if(this.dragged||null!==h.globals.selection){var g={transform:"translate("+n+", "+l+")"};h.globals.zoomEnabled&&this.dragged&&(a<0&&(a=1),c.attr({x:e,y:i,width:a,height:s,fill:h.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":h.config.chart.zoom.zoomedArea.fill.opacity,stroke:h.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":h.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":h.config.chart.zoom.zoomedArea.stroke.opacity}),p.setAttrs(c.node,g)),h.globals.selectionEnabled&&(d.attr({x:e,y:i,width:a>0?a:0,height:s>0?s:0,fill:h.config.chart.selection.fill.color,"fill-opacity":h.config.chart.selection.fill.opacity,stroke:h.config.chart.selection.stroke.color,"stroke-width":h.config.chart.selection.stroke.width,"stroke-dasharray":h.config.chart.selection.stroke.dashArray,"stroke-opacity":h.config.chart.selection.stroke.opacity}),p.setAttrs(d.node,g))}}},{key:"hideSelectionRect",value:function(t){t&&t.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(t){var e=t.context,i=t.zoomtype,a=this.w,s=e,r=this.gridRect.getBoundingClientRect(),n=s.startX-1,o=s.startY,l=!1,h=!1,c=s.clientX-r.left-n,d=s.clientY-r.top-o,g={};return Math.abs(c+n)>a.globals.gridWidth?c=a.globals.gridWidth-n:s.clientX-r.left<0&&(c=n),n>s.clientX-r.left&&(l=!0,c=Math.abs(c)),o>s.clientY-r.top&&(h=!0,d=Math.abs(d)),g="x"===i?{x:l?n-c:n,y:0,width:c,height:a.globals.gridHeight}:"y"===i?{x:0,y:h?o-d:o,width:a.globals.gridWidth,height:d}:{x:l?n-c:n,y:h?o-d:o,width:c,height:d},s.drawSelectionRect(g),s.selectionDragging("resizing"),g}},{key:"selectionDragging",value:function(t,e){var i=this,a=this.w,s=this.xyRatios,r=this.selectionRect,n=0;"resizing"===t&&(n=30);var o=function(t){return parseFloat(r.node.getAttribute(t))},l={x:o("x"),y:o("y"),width:o("width"),height:o("height")};a.globals.selection=l,"function"==typeof a.config.chart.events.selection&&a.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout((function(){var t=i.gridRect.getBoundingClientRect(),e=r.node.getBoundingClientRect(),n=a.globals.xAxisScale.niceMin+(e.left-t.left)*s.xRatio,o=a.globals.xAxisScale.niceMin+(e.right-t.left)*s.xRatio,l=a.globals.yAxisScale[0].niceMin+(t.bottom-e.bottom)*s.yRatio[0],h=a.globals.yAxisScale[0].niceMax-(e.top-t.top)*s.yRatio[0];a.config.chart.events.selection(i.ctx,{xaxis:{min:n,max:o},yaxis:{min:l,max:h}})}),n))}},{key:"selectionDrawn",value:function(t){var e=t.context,i=t.zoomtype,a=this.w,s=e,r=this.xyRatios,n=this.ctx.toolbar;if(s.startX>s.endX){var o=s.startX;s.startX=s.endX,s.endX=o}if(s.startY>s.endY){var l=s.startY;s.startY=s.endY,s.endY=l}var h=a.globals.xAxisScale.niceMin+s.startX*r.xRatio,c=a.globals.xAxisScale.niceMin+s.endX*r.xRatio,d=[],u=[];if(a.config.yaxis.forEach((function(t,e){d.push(a.globals.yAxisScale[e].niceMax-r.yRatio[e]*s.startY),u.push(a.globals.yAxisScale[e].niceMax-r.yRatio[e]*s.endY)})),s.dragged&&(s.dragX>10||s.dragY>10)&&h!==c)if(a.globals.zoomEnabled){var f=g.clone(a.globals.initialConfig.yaxis),p=g.clone(a.globals.initialConfig.xaxis);if(a.globals.zoomed=!0,a.globals.zoomed||(a.globals.lastXAxis=g.clone(a.config.xaxis),a.globals.lastYAxis=g.clone(a.config.yaxis)),a.config.xaxis.convertedCatToNumeric&&(h=Math.floor(h),c=Math.floor(c),h<1&&(h=1,c=a.globals.dataPoints),c-h<2&&(c=h+1)),"xy"!==i&&"x"!==i||(p={min:h,max:c}),"xy"!==i&&"y"!==i||f.forEach((function(t,e){f[e].min=u[e],f[e].max=d[e]})),a.config.chart.zoom.autoScaleYaxis){var x=new j(s.ctx);f=x.autoScaleY(s.ctx,f,{xaxis:p})}if(n){var b=n.getBeforeZoomRange(p,f);b&&(p=b.xaxis?b.xaxis:p,f=b.yaxis?b.yaxe:f)}var m={xaxis:p};a.config.chart.group||(m.yaxis=f),s.ctx.updateHelpers._updateOptions(m,!1,s.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof a.config.chart.events.zoomed&&n.zoomCallback(p,f)}else if(a.globals.selectionEnabled){var v,y=null;v={min:h,max:c},"xy"!==i&&"y"!==i||(y=g.clone(a.config.yaxis)).forEach((function(t,e){y[e].min=u[e],y[e].max=d[e]})),a.globals.selection=s.selection,"function"==typeof a.config.chart.events.selection&&a.config.chart.events.selection(s.ctx,{xaxis:v,yaxis:y})}}},{key:"panDragging",value:function(t){var e=t.context,i=this.w,a=e;if(void 0!==i.globals.lastClientPosition.x){var s=i.globals.lastClientPosition.x-a.clientX,r=i.globals.lastClientPosition.y-a.clientY;Math.abs(s)>Math.abs(r)&&s>0?this.moveDirection="left":Math.abs(s)>Math.abs(r)&&s<0?this.moveDirection="right":Math.abs(r)>Math.abs(s)&&r>0?this.moveDirection="up":Math.abs(r)>Math.abs(s)&&r<0&&(this.moveDirection="down")}i.globals.lastClientPosition={x:a.clientX,y:a.clientY};var n=i.globals.minX,o=i.globals.maxX;i.config.xaxis.convertedCatToNumeric||a.panScrolled(n,o)}},{key:"delayedPanScrolled",value:function(){var t=this.w,e=t.globals.minX,i=t.globals.maxX,a=(t.globals.maxX-t.globals.minX)/2;"left"===this.moveDirection?(e=t.globals.minX+a,i=t.globals.maxX+a):"right"===this.moveDirection&&(e=t.globals.minX-a,i=t.globals.maxX-a),e=Math.floor(e),i=Math.floor(i),this.updateScrolledChart({xaxis:{min:e,max:i}},e,i)}},{key:"panScrolled",value:function(t,e){var i=this.w,a=this.xyRatios,s=g.clone(i.globals.initialConfig.yaxis);"left"===this.moveDirection?(t=i.globals.minX+i.globals.gridWidth/15*a.xRatio,e=i.globals.maxX+i.globals.gridWidth/15*a.xRatio):"right"===this.moveDirection&&(t=i.globals.minX-i.globals.gridWidth/15*a.xRatio,e=i.globals.maxX-i.globals.gridWidth/15*a.xRatio),(t<i.globals.initialMinX||e>i.globals.initialMaxX)&&(t=i.globals.minX,e=i.globals.maxX);var r={min:t,max:e};i.config.chart.zoom.autoScaleYaxis&&(s=new j(this.ctx).autoScaleY(this.ctx,s,{xaxis:r}));var n={xaxis:{min:t,max:e}};i.config.chart.group||(n.yaxis=s),this.updateScrolledChart(n,t,e)}},{key:"updateScrolledChart",value:function(t,e,i){var a=this.w;this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof a.config.chart.events.scrolled&&a.config.chart.events.scrolled(this.ctx,{xaxis:{min:e,max:i}})}}]),i}(ht),dt=function(){function t(i){e(this,t),this.w=i.w,this.ttCtx=i,this.ctx=i.ctx}return a(t,[{key:"getNearestValues",value:function(t){var e=t.hoverArea,i=t.elGrid,a=t.clientX,s=t.clientY,r=this.w,n=r.globals.gridWidth,o=n/(r.globals.dataPoints-1),l=i.getBoundingClientRect(),h=this.hasBars();!r.globals.comboCharts&&!h||r.config.xaxis.convertedCatToNumeric||(o=n/r.globals.dataPoints);var c=a-l.left-r.globals.barPadForNumericAxis,d=s-l.top;c<0||d<0||c>r.globals.gridWidth||d>r.globals.gridHeight?(e.classList.remove("hovering-zoom"),e.classList.remove("hovering-pan")):r.globals.zoomEnabled?(e.classList.remove("hovering-pan"),e.classList.add("hovering-zoom")):r.globals.panEnabled&&(e.classList.remove("hovering-zoom"),e.classList.add("hovering-pan"));var u=Math.round(c/o);h&&!r.config.xaxis.convertedCatToNumeric&&(u=Math.ceil(c/o),u-=1);for(var f,p=null,x=null,b=[],m=0;m<r.globals.seriesXvalues.length;m++)b.push([r.globals.seriesXvalues[m][0]-1e-6].concat(r.globals.seriesXvalues[m]));return b=b.map((function(t){return t.filter((function(t){return t}))})),f=r.globals.seriesYvalues.map((function(t){return t.filter((function(t){return g.isNumber(t)}))})),r.globals.isXNumeric&&(p=(x=this.closestInMultiArray(c,d,b,f)).index,u=x.j,null!==p&&(b=r.globals.seriesXvalues[p],u=(x=this.closestInArray(c,b)).index)),r.globals.capturedSeriesIndex=null===p?-1:p,(!u||u<1)&&(u=0),r.globals.capturedDataPointIndex=u,{capturedSeries:p,j:u,hoverX:c,hoverY:d}}},{key:"closestInMultiArray",value:function(t,e,i,a){var s=this.w,r=0,n=null,o=-1;s.globals.series.length>1?r=this.getFirstActiveXArray(i):n=0;var l=a[r][0],h=i[r][0],c=Math.abs(t-h),d=Math.abs(e-l),g=d+c;return a.map((function(s,r){s.map((function(s,l){var h=Math.abs(e-a[r][l]),u=Math.abs(t-i[r][l]),f=u+h;f<g&&(g=f,c=u,d=h,n=r,o=l)}))})),{index:n,j:o}}},{key:"getFirstActiveXArray",value:function(t){for(var e=0,i=new m(this.ctx),a=t.map((function(t,e){return t.length>0?e:-1})),s=0;s<a.length;s++){var r=i.getSeriesTotalByIndex(s);if(-1!==a[s]&&0!==r&&!i.seriesHaveSameValues(s)){e=a[s];break}}return e}},{key:"closestInArray",value:function(t,e){for(var i=e[0],a=null,s=Math.abs(t-i),r=0;r<e.length;r++){var n=Math.abs(t-e[r]);n<s&&(s=n,a=r)}return{index:a}}},{key:"isXoverlap",value:function(t){var e=[],i=this.w.globals.seriesX.filter((function(t){return void 0!==t[0]}));if(i.length>0)for(var a=0;a<i.length-1;a++)void 0!==i[a][t]&&void 0!==i[a+1][t]&&i[a][t]!==i[a+1][t]&&e.push("unEqual");return 0===e.length}},{key:"isInitialSeriesSameLen",value:function(){for(var t=!0,e=this.w.globals.initialSeries,i=0;i<e.length-1;i++)if(e[i].data.length!==e[i+1].data.length){t=!1;break}return t}},{key:"getBarsHeight",value:function(t){return d(t).reduce((function(t,e){return t+e.getBBox().height}),0)}},{key:"getElMarkers",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(" .apexcharts-series-markers")}},{key:"getAllMarkers",value:function(){var t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");(t=d(t)).sort((function(t,e){return Number(e.getAttribute("data:realIndex"))<Number(t.getAttribute("data:realIndex"))?0:-1}));var e=[];return t.forEach((function(t){e.push(t.querySelector(".apexcharts-marker"))})),e}},{key:"hasMarkers",value:function(){return this.getElMarkers().length>0}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return this.getElBars().length>0}},{key:"getHoverMarkerSize",value:function(t){var e=this.w,i=e.config.markers.hover.size;return void 0===i&&(i=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),i}},{key:"toggleAllTooltipSeriesGroups",value:function(t){var e=this.w,i=this.ttCtx;0===i.allTooltipSeriesGroups.length&&(i.allTooltipSeriesGroups=e.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var a=i.allTooltipSeriesGroups,s=0;s<a.length;s++)"enable"===t?(a[s].classList.add("apexcharts-active"),a[s].style.display=e.config.tooltip.items.display):(a[s].classList.remove("apexcharts-active"),a[s].style.display="none")}}]),t}(),gt=function(){function t(i){e(this,t),this.w=i.w,this.ctx=i.ctx,this.ttCtx=i,this.tooltipUtil=new dt(i)}return a(t,[{key:"drawSeriesTexts",value:function(t){var e=t.shared,i=void 0===e||e,a=t.ttItems,s=t.i,r=void 0===s?0:s,n=t.j,o=void 0===n?null:n,l=t.y1,h=t.y2,c=this.w;void 0!==c.config.tooltip.custom?this.handleCustomTooltip({i:r,j:o,y1:l,y2:h,w:c}):this.toggleActiveInactiveSeries(i);var d=this.getValuesToPrint({i:r,j:o});this.printLabels({i:r,j:o,values:d,ttItems:a,shared:i});var g=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=g.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=g.getBoundingClientRect().height}},{key:"printLabels",value:function(t){var e,i=this,a=t.i,s=t.j,r=t.values,n=t.ttItems,o=t.shared,l=this.w,h=r.xVal,c=r.zVal,d=r.xAxisTTVal,g="",u=l.globals.colors[a];null!==s&&l.config.plotOptions.bar.distributed&&(u=l.globals.colors[s]);for(var f=function(t,r){var f=i.getFormatters(a);g=i.getSeriesName({fn:f.yLbTitleFormatter,index:a,seriesIndex:a,j:s});var p=l.config.tooltip.inverseOrder?r:t;if(l.globals.axisCharts){var x=function(t){return f.yLbFormatter(l.globals.series[t][s],{series:l.globals.series,seriesIndex:t,dataPointIndex:s,w:l})};o?(f=i.getFormatters(p),g=i.getSeriesName({fn:f.yLbTitleFormatter,index:p,seriesIndex:a,j:s}),u=l.globals.colors[p],e=x(p)):e=x(a)}null===s&&(e=f.yLbFormatter(l.globals.series[a],l)),i.DOMHandling({i:a,t:p,j:s,ttItems:n,values:{val:e,xVal:h,xAxisTTVal:d,zVal:c},seriesName:g,shared:o,pColor:u})},p=0,x=l.globals.series.length-1;p<l.globals.series.length;p++,x--)f(p,x)}},{key:"getFormatters",value:function(t){var e,i=this.w,a=i.globals.yLabelFormatters[t];return void 0!==i.globals.ttVal?Array.isArray(i.globals.ttVal)?(a=i.globals.ttVal[t]&&i.globals.ttVal[t].formatter,e=i.globals.ttVal[t]&&i.globals.ttVal[t].title&&i.globals.ttVal[t].title.formatter):(a=i.globals.ttVal.formatter,"function"==typeof i.globals.ttVal.title.formatter&&(e=i.globals.ttVal.title.formatter)):e=i.config.tooltip.y.title.formatter,"function"!=typeof a&&(a=i.globals.yLabelFormatters[0]?i.globals.yLabelFormatters[0]:function(t){return t}),"function"!=typeof e&&(e=function(t){return t}),{yLbFormatter:a,yLbTitleFormatter:e}}},{key:"getSeriesName",value:function(t){var e=t.fn,i=t.index,a=t.seriesIndex,s=t.j,r=this.w;return e(String(r.globals.seriesNames[i]),{series:r.globals.series,seriesIndex:a,dataPointIndex:s,w:r})}},{key:"DOMHandling",value:function(t){var e=t.i,i=t.t,a=(t.j,t.ttItems),s=t.values,r=t.seriesName,n=t.shared,o=t.pColor,l=this.w,h=this.ttCtx,c=s.val,d=s.xVal,g=s.xAxisTTVal,u=s.zVal,f=null;f=a[i].children,l.config.tooltip.fillSeriesColor&&(a[i].style.backgroundColor=o,f[0].style.display="none"),h.showTooltipTitle&&(null===h.tooltipTitle&&(h.tooltipTitle=l.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),h.tooltipTitle.innerHTML=d),h.blxaxisTooltip&&(h.xaxisTooltipText.innerHTML=""!==g?g:d);var p=a[i].querySelector(".apexcharts-tooltip-text-label");p&&(p.innerHTML=r?r+": ":"");var x=a[i].querySelector(".apexcharts-tooltip-text-value");x&&(x.innerHTML=void 0!==c?c:""),f[0]&&f[0].classList.contains("apexcharts-tooltip-marker")&&(l.config.tooltip.marker.fillColors&&Array.isArray(l.config.tooltip.marker.fillColors)&&(o=l.config.tooltip.marker.fillColors[e]),f[0].style.backgroundColor=o),l.config.tooltip.marker.show||(f[0].style.display="none"),null!==u&&(a[i].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=l.config.tooltip.z.title,a[i].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==u?u:""),n&&f[0]&&(null==c||l.globals.collapsedSeriesIndices.indexOf(i)>-1?f[0].parentNode.style.display="none":f[0].parentNode.style.display=l.config.tooltip.items.display)}},{key:"toggleActiveInactiveSeries",value:function(t){var e=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var i=e.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group");i&&(i.classList.add("apexcharts-active"),i.style.display=e.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(t){var e=t.i,i=t.j,a=this.w,s=this.ctx.series.filteredSeriesX(),r="",n="",o=null,l=null,h={series:a.globals.series,seriesIndex:e,dataPointIndex:i,w:a},c=a.globals.ttZFormatter;null===i?l=a.globals.series[e]:a.globals.isXNumeric?(r=s[e][i],0===s[e].length&&(r=s[this.tooltipUtil.getFirstActiveXArray(s)][i])):r=void 0!==a.globals.labels[i]?a.globals.labels[i]:"";var d=r;return a.globals.isXNumeric&&"datetime"===a.config.xaxis.type?r=new W(this.ctx).xLabelFormat(a.globals.ttKeyFormatter,d,d):a.globals.isBarHorizontal||(r=a.globals.xLabelFormatter(d,h)),void 0!==a.config.tooltip.x.formatter&&(r=a.globals.ttKeyFormatter(d,h)),a.globals.seriesZ.length>0&&a.globals.seriesZ[0].length>0&&(o=c(a.globals.seriesZ[e][i],a)),n="function"==typeof a.config.xaxis.tooltip.formatter?a.globals.xaxisTooltipFormatter(d,h):r,{val:Array.isArray(l)?l.join(" "):l,xVal:Array.isArray(r)?r.join(" "):r,xAxisTTVal:Array.isArray(n)?n.join(" "):n,zVal:o}}},{key:"handleCustomTooltip",value:function(t){var e=t.i,i=t.j,a=t.y1,s=t.y2,r=t.w,n=this.ttCtx.getElTooltip(),o=r.config.tooltip.custom;Array.isArray(o)&&o[e]&&(o=o[e]),n.innerHTML=o({ctx:this.ctx,series:r.globals.series,seriesIndex:e,dataPointIndex:i,y1:a,y2:s,w:r})}}]),t}(),ut=function(){function t(i){e(this,t),this.ttCtx=i,this.ctx=i.ctx,this.w=i.w}return a(t,[{key:"moveXCrosshairs",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.ttCtx,a=this.w,s=i.getElXCrosshairs(),r=t-i.xcrosshairsWidth/2,n=a.globals.labels.slice().length;if(null!==e&&(r=a.globals.gridWidth/n*e),null!==s&&(s.setAttribute("x",r),s.setAttribute("x1",r),s.setAttribute("x2",r),s.setAttribute("y2",a.globals.gridHeight),s.classList.add("apexcharts-active")),r<0&&(r=0),r>a.globals.gridWidth&&(r=a.globals.gridWidth),i.blxaxisTooltip){var o=r;"tickWidth"!==a.config.xaxis.crosshairs.width&&"barWidth"!==a.config.xaxis.crosshairs.width||(o=r+i.xcrosshairsWidth/2),this.moveXAxisTooltip(o)}}},{key:"moveYCrosshairs",value:function(t){var e=this.ttCtx;null!==e.ycrosshairs&&p.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&&p.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}},{key:"moveXAxisTooltip",value:function(t){var e=this.w,i=this.ttCtx;if(null!==i.xaxisTooltip){i.xaxisTooltip.classList.add("apexcharts-active");var a=i.xaxisOffY+e.config.xaxis.tooltip.offsetY+e.globals.translateY+1+e.config.xaxis.offsetY,s;if(t-=i.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(t))t+=e.globals.translateX,s=new p(this.ctx).getTextRects(i.xaxisTooltipText.innerHTML),i.xaxisTooltipText.style.minWidth=s.width+"px",i.xaxisTooltip.style.left=t+"px",i.xaxisTooltip.style.top=a+"px"}}},{key:"moveYAxisTooltip",value:function(t){var e=this.w,i=this.ttCtx;null===i.yaxisTTEls&&(i.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var a=parseInt(i.ycrosshairsHidden.getAttribute("y1"),10),s=e.globals.translateY+a,r=i.yaxisTTEls[t].getBoundingClientRect().height,n=e.globals.translateYAxisX[t]-2;e.config.yaxis[t].opposite&&(n-=26),s-=r/2,-1===e.globals.ignoreYAxisIndexes.indexOf(t)?(i.yaxisTTEls[t].classList.add("apexcharts-active"),i.yaxisTTEls[t].style.top=s+"px",i.yaxisTTEls[t].style.left=n+e.config.yaxis[t].tooltip.offsetX+"px"):i.yaxisTTEls[t].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this.w,s=this.ttCtx,r=s.getElTooltip(),n=s.tooltipRect,o=null!==i?parseFloat(i):1,l=parseFloat(t)+o+5,h=parseFloat(e)+o/2;if(l>a.globals.gridWidth/2&&(l=l-n.ttWidth-o-15),l>a.globals.gridWidth-n.ttWidth-10&&(l=a.globals.gridWidth-n.ttWidth),l<-20&&(l=-20),a.config.tooltip.followCursor){var c=s.getElGrid(),d=c.getBoundingClientRect();h=s.e.clientY+a.globals.translateY-d.top-n.ttHeight/2}if(!a.config.tooltip.followCursor){var g=this.positionChecks(n,l,h);l=g.x,h=g.y}isNaN(l)||(l+=a.globals.translateX,r.style.left=l+"px",r.style.top=h+"px")}},{key:"positionChecks",value:function(t,e,i){var a=this.w;return t.ttHeight/2+i>a.globals.gridHeight&&(i=a.globals.gridHeight-t.ttHeight+a.globals.translateY),i<0&&(i=0),{x:e,y:i}}},{key:"moveMarkers",value:function(t,e){var i=this.w,a=this.ttCtx;if(i.globals.markers.size[t]>0)for(var s=i.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(t,"'] .apexcharts-marker")),r=0;r<s.length;r++)parseInt(s[r].getAttribute("rel"),10)===e&&(a.marker.resetPointsSize(),a.marker.enlargeCurrentPoint(e,s[r]));else a.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}},{key:"moveDynamicPointOnHover",value:function(t,e){var i,a,s=this.w,r=this.ttCtx,n=s.globals.pointsArray,o=r.tooltipUtil.getHoverMarkerSize(e),l=s.config.series[e].type;if(!l||"column"!==l&&"candlestick"!==l){i=n[e][t][0],a=n[e][t][1]?n[e][t][1]:0;var h=s.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(e,"'] .apexcharts-series-markers circle"));h&&a<s.globals.gridHeight&&a>0&&(h.setAttribute("r",o),h.setAttribute("cx",i),h.setAttribute("cy",a)),this.moveXCrosshairs(i),r.fixedTooltip||this.moveTooltip(i,a,o)}}},{key:"moveDynamicPointsOnHover",value:function(t){var e,i=this.ttCtx,a=i.w,s=0,r=0,n=a.globals.pointsArray;e=new M(this.ctx).getActiveConfigSeriesIndex(!0);var o=i.tooltipUtil.getHoverMarkerSize(e);n[e]&&(s=n[e][t][0],r=n[e][t][1]);var l=i.tooltipUtil.getAllMarkers();if(null!==l)for(var h=0;h<a.globals.series.length;h++){var c=n[h];if(a.globals.comboCharts&&void 0===c&&l.splice(h,0,null),c&&c.length){var d=n[h][t][1];l[h].setAttribute("cx",s),null!==d&&!isNaN(d)&&d<a.globals.gridHeight&&d>0?(l[h]&&l[h].setAttribute("r",o),l[h]&&l[h].setAttribute("cy",d)):l[h]&&l[h].setAttribute("r",0)}}if(this.moveXCrosshairs(s),!i.fixedTooltip){var g=r||a.globals.gridHeight;this.moveTooltip(s,g,o)}}},{key:"moveStickyTooltipOverBars",value:function(t){var e,i=this.w,a=this.ttCtx,s=i.globals.columnSeries?i.globals.columnSeries.length:i.globals.series.length,r=s>=2&&s%2==0?Math.floor(s/2):Math.floor(s/2)+1,n=i.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(r,"'] path[j='").concat(t,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(r,"'] path[j='").concat(t,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(r,"'] path[j='").concat(t,"']")),o=n?parseFloat(n.getAttribute("cx")):0,l=n?parseFloat(n.getAttribute("barWidth")):0;i.globals.isXNumeric?o-=s%2!=0?l/2:0:(o=a.xAxisTicksPositions[t-1]+a.dataPointsDividedWidth/2,isNaN(o)&&(o=a.xAxisTicksPositions[t]-a.dataPointsDividedWidth/2));var h=a.getElGrid().getBoundingClientRect();if(e=a.e.clientY-h.top-a.tooltipRect.ttHeight/2,this.moveXCrosshairs(o),!a.fixedTooltip){var c=e||i.globals.gridHeight;this.moveTooltip(o,c)}}}]),t}(),ft=function(){function t(i){e(this,t),this.w=i.w,this.ttCtx=i,this.ctx=i.ctx,this.tooltipPosition=new ut(i)}return a(t,[{key:"drawDynamicPoints",value:function(){var t=this.w,e=new p(this.ctx),i=new P(this.ctx),a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series");(a=d(a)).sort((function(t,e){return Number(e.getAttribute("data:realIndex"))<Number(t.getAttribute("data:realIndex"))?0:-1}));for(var s=0;s<a.length;s++){var r=a[s].querySelector(".apexcharts-series-markers-wrap");if(null!==r){var n=void 0,o="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4));"line"!==t.config.chart.type&&"area"!==t.config.chart.type||t.globals.comboCharts||t.config.tooltip.intersect||(o+=" no-pointer-events");var l=i.getMarkerConfig(o,s);(n=e.drawMarker(0,0,l)).node.setAttribute("default-marker-size",0);var h=document.createElementNS(t.globals.SVGNS,"g");h.classList.add("apexcharts-series-markers"),h.appendChild(n.node),r.appendChild(h)}}}},{key:"enlargeCurrentPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=this.w;"bubble"!==s.config.chart.type&&this.newPointSize(t,e);var r=e.getAttribute("cx"),n=e.getAttribute("cy");if(null!==i&&null!==a&&(r=i,n=a),this.tooltipPosition.moveXCrosshairs(r),!this.fixedTooltip){if("radar"===s.config.chart.type){var o=this.ttCtx.getElGrid(),l=o.getBoundingClientRect();r=this.ttCtx.e.clientX-l.left}this.tooltipPosition.moveTooltip(r,n,s.config.markers.hover.size)}}},{key:"enlargePoints",value:function(t){for(var e=this.w,i=this.ttCtx,a=t,s=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),r=e.config.markers.hover.size,n=0;n<s.length;n++){var o=s[n].getAttribute("rel"),l=s[n].getAttribute("index");if(void 0===r&&(r=e.globals.markers.size[l]+e.config.markers.hover.sizeOffset),a===parseInt(o,10)){this.newPointSize(a,s[n]);var h=s[n].getAttribute("cx"),c=s[n].getAttribute("cy");this.tooltipPosition.moveXCrosshairs(h),i.fixedTooltip||this.tooltipPosition.moveTooltip(h,c,r)}else this.oldPointSize(s[n])}}},{key:"newPointSize",value:function(t,e){var i=this.w,a=i.config.markers.hover.size,s=0===t?e.parentNode.firstChild:e.parentNode.lastChild;if("0"!==s.getAttribute("default-marker-size")){var r=parseInt(s.getAttribute("index"),10);void 0===a&&(a=i.globals.markers.size[r]+i.config.markers.hover.sizeOffset),s.setAttribute("r",a)}}},{key:"oldPointSize",value:function(t){var e=parseFloat(t.getAttribute("default-marker-size"));t.setAttribute("r",e)}},{key:"resetPointsSize",value:function(){for(var t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),e=0;e<t.length;e++){var i=parseFloat(t[e].getAttribute("default-marker-size"));g.isNumber(i)?t[e].setAttribute("r",i):t[e].setAttribute("r",0)}}}]),t}(),pt=function(){function t(i){e(this,t),this.w=i.w,this.ttCtx=i}return a(t,[{key:"getAttr",value:function(t,e){return parseFloat(t.target.getAttribute(e))}},{key:"handleHeatTooltip",value:function(t){var e=t.e,i=t.opt,a=t.x,s=t.y,r=this.ttCtx,n=this.w;if(e.target.classList.contains("apexcharts-heatmap-rect")){var o=this.getAttr(e,"i"),l=this.getAttr(e,"j"),h=this.getAttr(e,"cx"),c=this.getAttr(e,"cy"),d=this.getAttr(e,"width"),g=this.getAttr(e,"height");if(r.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:o,j:l,shared:!1}),n.globals.capturedSeriesIndex=o,n.globals.capturedDataPointIndex=l,a=h+r.tooltipRect.ttWidth/2+d,s=c+r.tooltipRect.ttHeight/2-g/2,r.tooltipPosition.moveXCrosshairs(h+d/2),a>n.globals.gridWidth/2&&(a=h-r.tooltipRect.ttWidth/2+d),r.w.config.tooltip.followCursor){var u=r.getElGrid().getBoundingClientRect();s=r.e.clientY-u.top+n.globals.translateY/2-10}}return{x:a,y:s}}},{key:"handleMarkerTooltip",value:function(t){var e,i,a=t.e,s=t.opt,r=t.x,n=t.y,o=this.w,l=this.ttCtx;if(a.target.classList.contains("apexcharts-marker")){var h=parseInt(s.paths.getAttribute("cx"),10),c=parseInt(s.paths.getAttribute("cy"),10),d=parseFloat(s.paths.getAttribute("val"));if(i=parseInt(s.paths.getAttribute("rel"),10),e=parseInt(s.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,l.intersect){var u=g.findAncestor(s.paths,"apexcharts-series");u&&(e=parseInt(u.getAttribute("data:realIndex"),10))}if(l.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:e,j:i,shared:!l.showOnIntersect&&o.config.tooltip.shared}),"mouseup"===a.type&&l.markerClick(a,e,i),o.globals.capturedSeriesIndex=e,o.globals.capturedDataPointIndex=i,r=h,n=c+o.globals.translateY-1.4*l.tooltipRect.ttHeight,l.w.config.tooltip.followCursor){var f=l.getElGrid().getBoundingClientRect();n=l.e.clientY+o.globals.translateY-f.top}d<0&&(n=c),l.marker.enlargeCurrentPoint(i,s.paths,r,n)}return{x:r,y:n}}},{key:"handleBarTooltip",value:function(t){var e,i,a=t.e,s=t.opt,r=this.w,n=this.ttCtx,o=n.getElTooltip(),l=0,h=0,c=0,d=this.getBarTooltipXY({e:a,opt:s});e=d.i;var g=d.barHeight,u=d.j;if(r.globals.capturedSeriesIndex=e,r.globals.capturedDataPointIndex=u,r.globals.isBarHorizontal&&n.tooltipUtil.hasBars()||!r.config.tooltip.shared?(h=d.x,c=d.y,i=Array.isArray(r.config.stroke.width)?r.config.stroke.width[e]:r.config.stroke.width,l=h):r.globals.comboCharts||r.config.tooltip.shared||(l/=2),isNaN(c)?c=r.globals.svgHeight-n.tooltipRect.ttHeight:c<0&&(c=0),h+n.tooltipRect.ttWidth>r.globals.gridWidth?h-=n.tooltipRect.ttWidth:h<0&&(h=0),n.w.config.tooltip.followCursor){var f=n.getElGrid().getBoundingClientRect();c=n.e.clientY-f.top}if(null===n.tooltip&&(n.tooltip=r.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),r.config.tooltip.shared||(r.globals.comboBarCount>0?n.tooltipPosition.moveXCrosshairs(l+i/2):n.tooltipPosition.moveXCrosshairs(l)),!n.fixedTooltip&&(!r.config.tooltip.shared||r.globals.isBarHorizontal&&n.tooltipUtil.hasBars())){var p=r.globals.isMultipleYAxis?r.config.yaxis[x]&&r.config.yaxis[x].reversed:r.config.yaxis[0].reversed;p&&(h-=n.tooltipRect.ttWidth)<0&&(h=0),o.style.left=h+r.globals.translateX+"px";var x=parseInt(s.paths.parentNode.getAttribute("data:realIndex"),10);!p||r.globals.isBarHorizontal&&n.tooltipUtil.hasBars()||(c=c+g-2*(r.globals.series[e][u]<0?g:0)),n.tooltipRect.ttHeight+c>r.globals.gridHeight?(c=r.globals.gridHeight-n.tooltipRect.ttHeight+r.globals.translateY,o.style.top=c+"px"):o.style.top=c+r.globals.translateY-n.tooltipRect.ttHeight/2+"px"}}},{key:"getBarTooltipXY",value:function(t){var e=t.e,i=t.opt,a=this.w,s=null,r=this.ttCtx,n=0,o=0,l=0,h=0,c=0,d=e.target.classList;if(d.contains("apexcharts-bar-area")||d.contains("apexcharts-candlestick-area")||d.contains("apexcharts-rangebar-area")){var g=e.target,u=g.getBoundingClientRect(),f=i.elGrid.getBoundingClientRect(),p=u.height;c=u.height;var x=u.width,b=parseInt(g.getAttribute("cx"),10),m=parseInt(g.getAttribute("cy"),10);h=parseFloat(g.getAttribute("barWidth"));var v="touchmove"===e.type?e.touches[0].clientX:e.clientX;s=parseInt(g.getAttribute("j"),10),n=parseInt(g.parentNode.getAttribute("rel"),10)-1;var y=g.getAttribute("data-range-y1"),w=g.getAttribute("data-range-y2");a.globals.comboCharts&&(n=parseInt(g.parentNode.getAttribute("data:realIndex"),10)),r.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:n,j:s,y1:y?parseInt(y,10):null,y2:w?parseInt(w,10):null,shared:!r.showOnIntersect&&a.config.tooltip.shared}),a.config.tooltip.followCursor?a.globals.isBarHorizontal?(o=v-f.left+15,l=m-r.dataPointsDividedHeight+p/2-r.tooltipRect.ttHeight/2):(o=a.globals.isXNumeric?b-x/2:b-r.dataPointsDividedWidth+x/2,l=e.clientY-f.top-r.tooltipRect.ttHeight/2-15):a.globals.isBarHorizontal?((o=b)<r.xyRatios.baseLineInvertedY&&(o=b-r.tooltipRect.ttWidth),l=m-r.dataPointsDividedHeight+p/2-r.tooltipRect.ttHeight/2):(o=a.globals.isXNumeric?b-x/2:b-r.dataPointsDividedWidth+x/2,l=m)}return{x:o,y:l,barHeight:c,barWidth:h,i:n,j:s}}}]),t}(),xt=function(){function t(i){e(this,t),this.w=i.w,this.ttCtx=i}return a(t,[{key:"drawXaxisTooltip",value:function(){var t=this.w,e=this.ttCtx,i="bottom"===t.config.xaxis.position;e.xaxisOffY=i?t.globals.gridHeight+1:-t.globals.xAxisHeight-t.config.xaxis.axisTicks.height+3;var a=i?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",s=t.globals.dom.elWrap;e.blxaxisTooltip&&null===t.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(e.xaxisTooltip=document.createElement("div"),e.xaxisTooltip.setAttribute("class",a+" apexcharts-theme-"+t.config.tooltip.theme),s.appendChild(e.xaxisTooltip),e.xaxisTooltipText=document.createElement("div"),e.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),e.xaxisTooltipText.style.fontFamily=t.config.xaxis.tooltip.style.fontFamily||t.config.chart.fontFamily,e.xaxisTooltipText.style.fontSize=t.config.xaxis.tooltip.style.fontSize,e.xaxisTooltip.appendChild(e.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var t=this.w,e=this.ttCtx,i=function(i){var a=t.config.yaxis[i].opposite||t.config.yaxis[i].crosshairs.opposite;e.yaxisOffX=a?t.globals.gridWidth+1:1;var s="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i,a?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left");t.globals.yAxisSameScaleIndices.map((function(e,a){e.map((function(e,a){a===i&&(s+=t.config.yaxis[a].show?" ":" apexcharts-yaxistooltip-hidden")}))}));var r=t.globals.dom.elWrap;null===t.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i))&&(e.yaxisTooltip=document.createElement("div"),e.yaxisTooltip.setAttribute("class",s+" apexcharts-theme-"+t.config.tooltip.theme),r.appendChild(e.yaxisTooltip),0===i&&(e.yaxisTooltipText=[]),e.yaxisTooltipText[i]=document.createElement("div"),e.yaxisTooltipText[i].classList.add("apexcharts-yaxistooltip-text"),e.yaxisTooltip.appendChild(e.yaxisTooltipText[i]))},a=0;a<t.config.yaxis.length;a++)i(a)}},{key:"setXCrosshairWidth",value:function(){var t=this.w,e=this.ttCtx,i=e.getElXCrosshairs();if(e.xcrosshairsWidth=parseInt(t.config.xaxis.crosshairs.width,10),t.globals.comboCharts){var a=t.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==a&&"barWidth"===t.config.xaxis.crosshairs.width){var s=parseFloat(a.getAttribute("barWidth"));e.xcrosshairsWidth=s}else if("tickWidth"===t.config.xaxis.crosshairs.width){var r=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/r}}else if("tickWidth"===t.config.xaxis.crosshairs.width){var n=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/n}else if("barWidth"===t.config.xaxis.crosshairs.width){var o=t.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==o){var l=parseFloat(o.getAttribute("barWidth"));e.xcrosshairsWidth=l}else e.xcrosshairsWidth=1}t.globals.isBarHorizontal&&(e.xcrosshairsWidth=0),null!==i&&e.xcrosshairsWidth>0&&i.setAttribute("width",e.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var t=this.w,e=this.ttCtx;e.ycrosshairs=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(t,e,i){var a=this.ttCtx,s=this.w,r=s.globals.yLabelFormatters[t];if(a.yaxisTooltips[t]){var n=a.getElGrid().getBoundingClientRect(),o=(e-n.top)*i.yRatio[t],l=s.globals.maxYArr[t]-s.globals.minYArr[t],h=s.globals.minYArr[t]+(l-o);a.tooltipPosition.moveYCrosshairs(e-n.top),a.yaxisTooltipText[t].innerHTML=r(h),a.tooltipPosition.moveYAxisTooltip(t)}}}]),t}(),bt=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w;var a=this.w;this.tConfig=a.config.tooltip,this.tooltipUtil=new dt(this),this.tooltipLabels=new gt(this),this.tooltipPosition=new ut(this),this.marker=new ft(this),this.intersect=new pt(this),this.axesTooltip=new xt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!a.globals.isBarHorizontal&&this.tConfig.shared}return a(t,[{key:"getElTooltip",value:function(t){return t||(t=this),t.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip")}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(t){var e=this.w;this.xyRatios=t,this.blxaxisTooltip=e.config.xaxis.tooltip.enabled&&e.globals.axisCharts,this.yaxisTooltips=e.config.yaxis.map((function(t,i){return!!(t.show&&t.tooltip.enabled&&e.globals.axisCharts)})),this.allTooltipSeriesGroups=[],e.globals.axisCharts||(this.showTooltipTitle=!1);var i=document.createElement("div");if(i.classList.add("apexcharts-tooltip"),i.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),e.globals.dom.elWrap.appendChild(i),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var a=new G(this.ctx);this.xAxisTicksPositions=a.getXAxisTicksPositions()}if(!e.globals.comboCharts&&!this.tConfig.intersect&&"bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==e.config.markers.size&&0!==e.globals.markers.largestSize||this.marker.drawDynamicPoints(this),e.globals.collapsedSeries.length!==e.globals.series.length){this.dataPointsDividedHeight=e.globals.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.globals.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,i.appendChild(this.tooltipTitle));var s=e.globals.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(s=this.showOnIntersect?1:e.globals.series.length),this.legendLabels=e.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(s),this.addSVGEvents()}}},{key:"createTTElements",value:function(t){for(var e=this.w,i=[],a=this.getElTooltip(),s=0;s<t;s++){var r=document.createElement("div");r.classList.add("apexcharts-tooltip-series-group"),this.tConfig.shared&&this.tConfig.enabledOnSeries&&Array.isArray(this.tConfig.enabledOnSeries)&&this.tConfig.enabledOnSeries.indexOf(s)<0&&r.classList.add("apexcharts-tooltip-series-group-hidden");var n=document.createElement("span");n.classList.add("apexcharts-tooltip-marker"),n.style.backgroundColor=e.globals.colors[s],r.appendChild(n);var o=document.createElement("div");o.classList.add("apexcharts-tooltip-text"),o.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,o.style.fontSize=this.tConfig.style.fontSize;var l=document.createElement("div");l.classList.add("apexcharts-tooltip-y-group");var h=document.createElement("span");h.classList.add("apexcharts-tooltip-text-label"),l.appendChild(h);var c=document.createElement("span");c.classList.add("apexcharts-tooltip-text-value"),l.appendChild(c);var d=document.createElement("div");d.classList.add("apexcharts-tooltip-z-group");var g=document.createElement("span");g.classList.add("apexcharts-tooltip-text-z-label"),d.appendChild(g);var u=document.createElement("span");u.classList.add("apexcharts-tooltip-text-z-value"),d.appendChild(u),o.appendChild(l),o.appendChild(d),r.appendChild(o),a.appendChild(r),i.push(r)}return i}},{key:"addSVGEvents",value:function(){var t=this.w,e=t.config.chart.type,i=this.getElTooltip(),a=!("bar"!==e&&"candlestick"!==e&&"rangeBar"!==e),s="area"===e||"line"===e||"scatter"===e||"bubble"===e||"radar"===e,r=t.globals.dom.Paper.node,n=this.getElGrid();n&&(this.seriesBound=n.getBoundingClientRect());var o,l=[],h=[],c={hoverArea:r,elGrid:n,tooltipEl:i,tooltipY:l,tooltipX:h,ttItems:this.ttItems};if(t.globals.axisCharts&&(s?o=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):a?o=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"===e&&(o=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap")),o&&o.length))for(var d=0;d<o.length;d++)l.push(o[d].getAttribute("cy")),h.push(o[d].getAttribute("cx"));if(t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||a&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([r],c);else if(a&&!t.globals.comboCharts||s&&this.showOnIntersect)this.addDatapointEventsListeners(c);else if(!t.globals.axisCharts||"heatmap"===e){var g=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(g,c)}if(this.showOnIntersect){var u=t.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");u.length>0&&this.addPathsEventListeners(u,c),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(c)}}},{key:"drawFixedTooltipRect",value:function(){var t=this.w,e=this.getElTooltip(),i=e.getBoundingClientRect(),a=i.width+10,s=i.height+10,r=this.tConfig.fixed.offsetX,n=this.tConfig.fixed.offsetY,o=this.tConfig.fixed.position.toLowerCase();return o.indexOf("right")>-1&&(r=r+t.globals.svgWidth-a+10),o.indexOf("bottom")>-1&&(n=n+t.globals.svgHeight-s-10),e.style.left=r+"px",e.style.top=n+"px",{x:r,y:n,ttWidth:a,ttHeight:s}}},{key:"addDatapointEventsListeners",value:function(t){var e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-rangebar-area");this.addPathsEventListeners(e,t)}},{key:"addPathsEventListeners",value:function(t,e){for(var i=this,a=function(a){var s={paths:t[a],tooltipEl:e.tooltipEl,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:e.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map((function(e){return t[a].addEventListener(e,i.seriesHover.bind(i,s),{capture:!1,passive:!0})}))},s=0;s<t.length;s++)a(s)}},{key:"seriesHover",value:function(t,e){var i=this,a=[],s=this.w;s.config.chart.group&&(a=this.ctx.getGroupedCharts()),s.globals.axisCharts&&(s.globals.minX===-1/0&&s.globals.maxX===1/0||0===s.globals.dataPoints)||(a.length?a.forEach((function(a){var s=i.getElTooltip(a),r={paths:t.paths,tooltipEl:s,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:a.w.globals.tooltip.ttItems};a.w.globals.minX===i.w.globals.minX&&a.w.globals.maxX===i.w.globals.maxX&&a.w.globals.tooltip.seriesHoverByContext({chartCtx:a,ttCtx:a.w.globals.tooltip,opt:r,e:e})})):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:t,e:e}))}},{key:"seriesHoverByContext",value:function(t){var e=t.chartCtx,i=t.ttCtx,a=t.opt,s=t.e,r=e.w,n=this.getElTooltip();i.tooltipRect={x:0,y:0,ttWidth:n.getBoundingClientRect().width,ttHeight:n.getBoundingClientRect().height},i.e=s,!i.tooltipUtil.hasBars()||r.globals.comboCharts||i.isBarShared||this.tConfig.onDatasetHover.highlightDataSeries&&new M(e).toggleSeriesOnHover(s,s.target.parentNode),i.fixedTooltip&&i.drawFixedTooltipRect(),r.globals.axisCharts?i.axisChartsTooltips({e:s,opt:a,tooltipRect:i.tooltipRect}):i.nonAxisChartsTooltips({e:s,opt:a,tooltipRect:i.tooltipRect})}},{key:"axisChartsTooltips",value:function(t){var e,i,a=t.e,s=t.opt,r=this.w,n=s.elGrid.getBoundingClientRect(),o="touchmove"===a.type?a.touches[0].clientX:a.clientX,l="touchmove"===a.type?a.touches[0].clientY:a.clientY;if(this.clientY=l,this.clientX=o,r.globals.capturedSeriesIndex=-1,r.globals.capturedDataPointIndex=-1,l<n.top||l>n.top+n.height)this.handleMouseOut(s);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!r.config.tooltip.shared){var h=parseInt(s.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(h)<0)return void this.handleMouseOut(s)}var c=this.getElTooltip(),d=this.getElXCrosshairs(),g=r.globals.xyCharts||"bar"===r.config.chart.type&&!r.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||r.globals.comboCharts&&this.tooltipUtil.hasBars();if(r.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&(g=!1),"mousemove"===a.type||"touchmove"===a.type||"mouseup"===a.type){null!==d&&d.classList.add("apexcharts-active");var u=this.yaxisTooltips.filter((function(t){return!0===t}));if(null!==this.ycrosshairs&&u.length&&this.ycrosshairs.classList.add("apexcharts-active"),g&&!this.showOnIntersect)this.handleStickyTooltip(a,o,l,s);else if("heatmap"===r.config.chart.type){var f=this.intersect.handleHeatTooltip({e:a,opt:s,x:e,y:i});e=f.x,i=f.y,c.style.left=e+"px",c.style.top=i+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:a,opt:s}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:a,opt:s,x:e,y:i});if(this.yaxisTooltips.length)for(var p=0;p<r.config.yaxis.length;p++)this.axesTooltip.drawYaxisTooltipText(p,l,this.xyRatios);s.tooltipEl.classList.add("apexcharts-active")}else"mouseout"!==a.type&&"touchend"!==a.type||this.handleMouseOut(s)}}},{key:"nonAxisChartsTooltips",value:function(t){var e=t.e,i=t.opt,a=t.tooltipRect,s=this.w,r=i.paths.getAttribute("rel"),n=this.getElTooltip(),o=s.globals.dom.elWrap.getBoundingClientRect();if("mousemove"===e.type||"touchmove"===e.type){n.classList.add("apexcharts-active"),this.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:parseInt(r,10)-1,shared:!1});var l=s.globals.clientX-o.left-a.ttWidth/2,h=s.globals.clientY-o.top-a.ttHeight-10;n.style.left=l+"px",n.style.top=h+"px"}else"mouseout"!==e.type&&"touchend"!==e.type||n.classList.remove("apexcharts-active")}},{key:"handleStickyTooltip",value:function(t,e,i,a){var s=this.w,r=this.tooltipUtil.getNearestValues({context:this,hoverArea:a.hoverArea,elGrid:a.elGrid,clientX:e,clientY:i}),n=r.j,o=r.capturedSeries;r.hoverX<0||r.hoverX>s.globals.gridWidth?this.handleMouseOut(a):null!==o?this.handleStickyCapturedSeries(t,o,a,n):this.tooltipUtil.isXoverlap(n)&&this.create(t,this,0,n,a.ttItems)}},{key:"handleStickyCapturedSeries",value:function(t,e,i,a){var s=this.w;null===s.globals.series[e][a]?this.handleMouseOut(i):void 0!==s.globals.series[e][a]?this.tConfig.shared&&this.tooltipUtil.isXoverlap(a)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,a,i.ttItems):this.create(t,this,e,a,i.ttItems,!1):this.tooltipUtil.isXoverlap(a)&&this.create(t,this,0,a,i.ttItems)}},{key:"deactivateHoverFilter",value:function(){for(var t=this.w,e=new p(this.ctx),i=t.globals.dom.Paper.select(".apexcharts-bar-area"),a=0;a<i.length;a++)e.pathMouseLeave(i[a])}},{key:"handleMouseOut",value:function(t){var e=this.w,i=this.getElXCrosshairs();if(t.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),"bubble"!==e.config.chart.type&&this.marker.resetPointsSize(),null!==i&&i.classList.remove("apexcharts-active"),null!==this.ycrosshairs&&this.ycrosshairs.classList.remove("apexcharts-active"),this.blxaxisTooltip&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var a=0;a<this.yaxisTTEls.length;a++)this.yaxisTTEls[a].classList.remove("apexcharts-active")}e.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach((function(t){var e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)}))}},{key:"markerClick",value:function(t,e,i){var a=this.w;"function"==typeof a.config.chart.events.markerClick&&a.config.chart.events.markerClick(t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:a}),this.ctx.events.fireEvent("markerClick",[t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:a}])}},{key:"create",value:function(t,e,i,a,s){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,n=this.w,o=e;"mouseup"===t.type&&this.markerClick(t,i,a),null===r&&(r=this.tConfig.shared);var l=this.tooltipUtil.hasMarkers(),h=this.tooltipUtil.getElBars();if(n.config.legend.tooltipHoverFormatter){var c=n.config.legend.tooltipHoverFormatter,d=Array.from(this.legendLabels);d.forEach((function(t){var e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)}));for(var g=0;g<d.length;g++){var u=d[g],f=parseInt(u.getAttribute("i"),10),x=decodeURIComponent(u.getAttribute("data:default-text")),b=c(x,{seriesIndex:r?f:i,dataPointIndex:a,w:n});if(r)u.innerHTML=n.globals.collapsedSeriesIndices.indexOf(f)<0?b:x;else if(u.innerHTML=f===i?b:x,i===f)break}}if(r){if(o.tooltipLabels.drawSeriesTexts({ttItems:s,i:i,j:a,shared:!this.showOnIntersect&&this.tConfig.shared}),l&&(n.globals.markers.largestSize>0?o.marker.enlargePoints(a):o.tooltipPosition.moveDynamicPointsOnHover(a)),this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(h),this.barSeriesHeight>0)){var m=new p(this.ctx),v=n.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(a,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(a);for(var y=0;y<v.length;y++)m.pathMouseEnter(v[y])}}else o.tooltipLabels.drawSeriesTexts({shared:!1,ttItems:s,i:i,j:a}),this.tooltipUtil.hasBars()&&o.tooltipPosition.moveStickyTooltipOverBars(a),l&&o.tooltipPosition.moveMarkers(i,a)}}]),t}(),mt=function(t){function i(){return e(this,i),c(this,l(i).apply(this,arguments))}return o(i,t),a(i,[{key:"draw",value:function(t,e){var i=this,a=this.w;this.graphics=new p(this.ctx),this.bar=new X(this.ctx,this.xyRatios);var s=new m(this.ctx,a);t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===a.config.chart.stackType&&(t=a.globals.seriesPercent.slice()),this.series=t,this.totalItems=0,this.prevY=[],this.prevX=[],this.prevYF=[],this.prevXF=[],this.prevYVal=[],this.prevXVal=[],this.xArrj=[],this.xArrjF=[],this.xArrjVal=[],this.yArrj=[],this.yArrjF=[],this.yArrjVal=[];for(var r=0;r<t.length;r++)t[r].length>0&&(this.totalItems+=t[r].length);for(var o=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),l=0,h=0,c=function(s,r){var c=void 0,d=void 0,u=void 0,f=void 0,p=[],x=[],b=a.globals.comboCharts?e[s]:s;i.yRatio.length>1&&(i.yaxisIndex=b),i.isReversed=a.config.yaxis[i.yaxisIndex]&&a.config.yaxis[i.yaxisIndex].reversed;var m=i.graphics.group({class:"apexcharts-series",seriesName:g.escapeString(a.globals.seriesNames[b]),rel:s+1,"data:realIndex":b});i.ctx.series.addCollapsedClassToSeries(m,b);var v=i.graphics.group({class:"apexcharts-datalabels","data:realIndex":b}),y=0,w=0,k=i.initialPositions(l,h,c,d,u,f);h=k.y,y=k.barHeight,d=k.yDivision,f=k.zeroW,l=k.x,w=k.barWidth,c=k.xDivision,u=k.zeroH,i.yArrj=[],i.yArrjF=[],i.yArrjVal=[],i.xArrj=[],i.xArrjF=[],i.xArrjVal=[],1===i.prevY.length&&i.prevY[0].every((function(t){return isNaN(t)}))&&(i.prevY[0]=i.prevY[0].map((function(t){return u})),i.prevYF[0]=i.prevYF[0].map((function(t){return 0})));for(var A=0;A<a.globals.dataPoints;A++){var S=i.barHelpers.getStrokeWidth(s,A,b),C={indexes:{i:s,j:A,realIndex:b,bc:r},strokeWidth:S,x:l,y:h,elSeries:m},L=null;i.isHorizontal?(L=i.drawStackedBarPaths(n({},C,{zeroW:f,barHeight:y,yDivision:d})),w=i.series[s][A]/i.invertedYRatio):(L=i.drawStackedColumnPaths(n({},C,{xDivision:c,barWidth:w,zeroH:u})),y=i.series[s][A]/i.yRatio[i.yaxisIndex]),h=L.y,l=L.x,p.push(l),x.push(h);var P=i.barHelpers.getPathFillColor(t,s,A,b);m=i.renderSeries({realIndex:b,pathFill:P,j:A,i:s,pathFrom:L.pathFrom,pathTo:L.pathTo,strokeWidth:S,elSeries:m,x:l,y:h,series:t,barHeight:y,barWidth:w,elDataLabelsWrap:v,type:"bar",visibleSeries:0})}a.globals.seriesXvalues[b]=p,a.globals.seriesYvalues[b]=x,i.prevY.push(i.yArrj),i.prevYF.push(i.yArrjF),i.prevYVal.push(i.yArrjVal),i.prevX.push(i.xArrj),i.prevXF.push(i.xArrjF),i.prevXVal.push(i.xArrjVal),o.add(m)},d=0,u=0;d<t.length;d++,u++)c(d,u);return o}},{key:"initialPositions",value:function(t,e,i,a,s,r){var n,o,l=this.w;return this.isHorizontal?(n=(n=a=l.globals.gridHeight/l.globals.dataPoints)*parseInt(l.config.plotOptions.bar.barHeight,10)/100,r=this.baseLineInvertedY+l.globals.padHorizontal+(this.isReversed?l.globals.gridWidth:0)-(this.isReversed?2*this.baseLineInvertedY:0),e=(a-n)/2):(o=i=l.globals.gridWidth/l.globals.dataPoints,o=l.globals.isXNumeric&&l.globals.dataPoints>1?(i=l.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:o*parseInt(l.config.plotOptions.bar.columnWidth,10)/100,s=this.baseLineY[this.yaxisIndex]+(this.isReversed?l.globals.gridHeight:0)-(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),t=l.globals.padHorizontal+(i-o)/2),{x:t,y:e,yDivision:a,xDivision:i,barHeight:n,barWidth:o,zeroH:s,zeroW:r}}},{key:"drawStackedBarPaths",value:function(t){for(var e,i=t.indexes,a=t.barHeight,s=t.strokeWidth,r=t.zeroW,n=t.x,o=t.y,l=t.yDivision,h=t.elSeries,c=this.w,d=o,g=i.i,u=i.j,f=i.bc,p=0,x=0;x<this.prevXF.length;x++)p+=this.prevXF[x][u];if(g>0){var b=r;this.prevXVal[g-1][u]<0?b=this.series[g][u]>=0?this.prevX[g-1][u]+p-2*(this.isReversed?p:0):this.prevX[g-1][u]:this.prevXVal[g-1][u]>=0&&(b=this.series[g][u]>=0?this.prevX[g-1][u]:this.prevX[g-1][u]-p+2*(this.isReversed?p:0)),e=b}else e=r;n=null===this.series[g][u]?e:e+this.series[g][u]/this.invertedYRatio-2*(this.isReversed?this.series[g][u]/this.invertedYRatio:0),this.xArrj.push(n),this.xArrjF.push(Math.abs(e-n)),this.xArrjVal.push(this.series[g][u]);var m=this.barHelpers.getBarpaths({barYPosition:d,barHeight:a,x1:e,x2:n,strokeWidth:s,series:this.series,realIndex:i.realIndex,i:g,j:u,w:c});return this.barHelpers.barBackground({bc:f,i:g,y1:d,y2:a,elSeries:h}),o+=l,{pathTo:m.pathTo,pathFrom:m.pathFrom,x:n,y:o}}},{key:"drawStackedColumnPaths",value:function(t){var e=t.indexes,i=t.x,a=t.y,s=t.xDivision,r=t.barWidth,n=t.zeroH,o=(t.strokeWidth,t.elSeries),l=this.w,h=e.i,c=e.j,d=e.bc;if(l.globals.isXNumeric){var g=l.globals.seriesX[h][c];g||(g=0),i=(g-l.globals.minX)/this.xRatio-r/2}for(var u,f=i,p=0,x=0;x<this.prevYF.length;x++)p+=isNaN(this.prevYF[x][c])?0:this.prevYF[x][c];if(h>0&&!l.globals.isXNumeric||h>0&&l.globals.isXNumeric&&l.globals.seriesX[h-1][c]===l.globals.seriesX[h][c]){var b,m,v=Math.min(this.yRatio.length+1,h+1);if(void 0!==this.prevY[h-1])for(var y=1;y<v;y++)if(!isNaN(this.prevY[h-y][c])){m=this.prevY[h-y][c];break}for(var w=1;w<v;w++){if(this.prevYVal[h-w][c]<0){b=this.series[h][c]>=0?m-p+2*(this.isReversed?p:0):m;break}if(this.prevYVal[h-w][c]>=0){b=this.series[h][c]>=0?m:m+p-2*(this.isReversed?p:0);break}}void 0===b&&(b=l.globals.gridHeight),u=this.prevYF[0].every((function(t){return 0===t}))&&this.prevYF.slice(1,h).every((function(t){return t.every((function(t){return isNaN(t)}))}))?l.globals.gridHeight-n:b}else u=l.globals.gridHeight-n;a=u-this.series[h][c]/this.yRatio[this.yaxisIndex]+2*(this.isReversed?this.series[h][c]/this.yRatio[this.yaxisIndex]:0),this.yArrj.push(a),this.yArrjF.push(Math.abs(u-a)),this.yArrjVal.push(this.series[h][c]);var k=this.barHelpers.getColumnPaths({barXPosition:f,barWidth:r,y1:u,y2:a,yRatio:this.yRatio[this.yaxisIndex],strokeWidth:this.strokeWidth,series:this.series,realIndex:e.realIndex,i:h,j:c,w:l});return this.barHelpers.barBackground({bc:d,i:h,x1:f,x2:r,elSeries:o}),i+=s,{pathTo:k.pathTo,pathFrom:k.pathFrom,x:l.globals.isXNumeric?i-s:i,y:a}}}]),i}(X),vt=function(t){function i(){return e(this,i),c(this,l(i).apply(this,arguments))}return o(i,t),a(i,[{key:"draw",value:function(t,e){var i=this.w,a=new p(this.ctx),s=new L(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick;var r=new m(this.ctx,i);t=r.getLogSeries(t),this.series=t,this.yRatio=r.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);for(var n=a.group({class:"apexcharts-candlestick-series apexcharts-plot-series"}),o=0;o<t.length;o++){var l,h,c=void 0,d=void 0,u=[],f=[],x=i.globals.comboCharts?e[o]:o,b=a.group({class:"apexcharts-series",seriesName:g.escapeString(i.globals.seriesNames[x]),rel:o+1,"data:realIndex":x}),v,y;t[o].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=x);var w=this.barHelpers.initialPositions();d=w.y,v=w.barHeight,c=w.x,y=w.barWidth,l=w.xDivision,h=w.zeroH,f.push(c+y/2);for(var k=a.group({class:"apexcharts-datalabels","data:realIndex":x}),A=0;A<i.globals.dataPoints;A++){var S,C=this.barHelpers.getStrokeWidth(o,A,x),P=this.drawCandleStickPaths({indexes:{i:o,j:A,realIndex:x},x:c,y:d,xDivision:l,barWidth:y,zeroH:h,strokeWidth:C,elSeries:b});d=P.y,c=P.x,S=P.color,A>0&&f.push(c+y/2),u.push(d);var T=s.fillPath({seriesNumber:x,dataPointIndex:A,color:S,value:t[o][A]}),z=this.candlestickOptions.wick.useFillColor?S:void 0;this.renderSeries({realIndex:x,pathFill:T,lineFill:z,j:A,i:o,pathFrom:P.pathFrom,pathTo:P.pathTo,strokeWidth:C,elSeries:b,x:c,y:d,series:t,barHeight:v,barWidth:y,elDataLabelsWrap:k,visibleSeries:this.visibleI,type:"candlestick"})}i.globals.seriesXvalues[x]=f,i.globals.seriesYvalues[x]=u,n.add(b)}return n}},{key:"drawCandleStickPaths",value:function(t){var e=t.indexes,i=t.x,a=(t.y,t.xDivision),s=t.barWidth,r=t.zeroH,n=t.strokeWidth,o=this.w,l=new p(this.ctx),h=e.i,c=e.j,d=!0,g=o.config.plotOptions.candlestick.colors.upward,u=o.config.plotOptions.candlestick.colors.downward,f=this.yRatio[this.yaxisIndex],x=e.realIndex,b=this.getOHLCValue(x,c),m=r,v=r;b.o>b.c&&(d=!1);var y=Math.min(b.o,b.c),w=Math.max(b.o,b.c);o.globals.isXNumeric&&(i=(o.globals.seriesX[x][c]-o.globals.minX)/this.xRatio-s/2);var k=i+s*this.visibleI;void 0===this.series[h][c]||null===this.series[h][c]?y=r:(y=r-y/f,w=r-w/f,m=r-b.h/f,v=r-b.l/f);var A=l.move(k,r),S=l.move(k,y);return o.globals.previousPaths.length>0&&(S=this.getPreviousPath(x,c,!0)),A=l.move(k,w)+l.line(k+s/2,w)+l.line(k+s/2,m)+l.line(k+s/2,w)+l.line(k+s,w)+l.line(k+s,y)+l.line(k+s/2,y)+l.line(k+s/2,v)+l.line(k+s/2,y)+l.line(k,y)+l.line(k,w-n/2),S+=l.move(k,y),o.globals.isXNumeric||(i+=a),{pathTo:A,pathFrom:S,x:i,y:w,barXPosition:k,color:d?g:u}}},{key:"getOHLCValue",value:function(t,e){var i=this.w;return{o:i.globals.seriesCandleO[t][e],h:i.globals.seriesCandleH[t][e],l:i.globals.seriesCandleL[t][e],c:i.globals.seriesCandleC[t][e]}}}]),i}(X),yt=function(){function t(i,a){e(this,t),this.ctx=i,this.w=i.w,this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.negRange=!1,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return a(t,[{key:"draw",value:function(t){var e=this.w,i=new p(this.ctx),a=i.group({class:"apexcharts-heatmap"});a.attr("clip-path","url(#gridRectMask".concat(e.globals.cuid,")"));var s=e.globals.gridWidth/e.globals.dataPoints,r=e.globals.gridHeight/e.globals.series.length,n=0,o=!1;this.checkColorRange();var l=t.slice();e.config.yaxis[0].reversed&&(o=!0,l.reverse());for(var h=o?0:l.length-1;o?h<l.length:h>=0;o?h++:h--){var c=i.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:g.escapeString(e.globals.seriesNames[h]),rel:h+1,"data:realIndex":h});if(this.ctx.series.addCollapsedClassToSeries(c,h),e.config.chart.dropShadow.enabled){var d=e.config.chart.dropShadow;new u(this.ctx).dropShadow(c,d,h)}for(var f=0,x=0;x<l[h].length;x++){var b=1,m=e.config.plotOptions.heatmap.shadeIntensity,v=this.determineHeatColor(h,x);b=e.globals.hasNegs||this.negRange?e.config.plotOptions.heatmap.reverseNegativeShade?v.percent<0?v.percent/100*(1.25*m):(1-v.percent/100)*(1.25*m):v.percent<=0?1-(1+v.percent/100)*m:(1-v.percent/100)*m:1-v.percent/100;var y=v.color,w=new g;e.config.plotOptions.heatmap.enableShades&&(b<0&&(b=0),y=g.hexToRgba(w.shadeColor(b,v.color),e.config.fill.opacity)),"image"===e.config.fill.type&&(y=new L(this.ctx).fillPath({seriesNumber:h,dataPointIndex:x,opacity:e.globals.hasNegs?v.percent<0?1-(1+v.percent/100):m+v.percent/100:v.percent/100,patternID:g.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:s,height:e.config.fill.image.height?e.config.fill.image.height:r}));var k=this.rectRadius,A=i.drawRect(f,n,s,r,k);if(A.attr({cx:f,cy:n}),A.node.classList.add("apexcharts-heatmap-rect"),c.add(A),A.attr({fill:y,i:h,index:h,j:x,val:l[h][x],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?y:e.globals.stroke.colors[0],color:y}),A.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this,A)),A.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this,A)),A.node.addEventListener("mousedown",i.pathMouseDown.bind(this,A)),e.config.chart.animations.enabled&&!e.globals.dataChanged){var S=1;e.globals.resized||(S=e.config.chart.animations.speed),this.animateHeatMap(A,f,n,s,r,S)}if(e.globals.dataChanged){var C=1;if(this.dynamicAnim.enabled&&e.globals.shouldAnimate){C=this.dynamicAnim.speed;var P=e.globals.previousPaths[h]&&e.globals.previousPaths[h][x]&&e.globals.previousPaths[h][x].color;P||(P="rgba(255, 255, 255, 0)"),this.animateHeatColor(A,g.isColorHex(P)?P:g.rgb2hex(P),g.isColorHex(y)?y:g.rgb2hex(y),C)}}var T=this.calculateHeatmapDataLabels({x:f,y:n,i:h,j:x,heatColorProps:v,series:l,rectHeight:r,rectWidth:s});null!==T&&c.add(T),f+=s}n+=r,a.add(c)}var z=e.globals.yAxisScale[0].result.slice();e.config.yaxis[0].reversed?z.unshift(""):z.push(""),e.globals.yAxisScale[0].result=z;var I=e.globals.gridHeight/e.globals.series.length;return e.config.yaxis[0].labels.offsetY=-I/2,a}},{key:"checkColorRange",value:function(){var t=this,e=this.w.config.plotOptions.heatmap;e.colorScale.ranges.length>0&&e.colorScale.ranges.map((function(e,i){e.from<=0&&(t.negRange=!0)}))}},{key:"determineHeatColor",value:function(t,e){var i=this.w,a=i.globals.series[t][e],s=i.config.plotOptions.heatmap,r=s.colorScale.inverse?e:t,n=i.globals.colors[r],o=null,l=Math.min.apply(Math,d(i.globals.series[t])),h=Math.max.apply(Math,d(i.globals.series[t]));s.distributed||(l=i.globals.minY,h=i.globals.maxY),void 0!==s.colorScale.min&&(l=s.colorScale.min<i.globals.minY?s.colorScale.min:i.globals.minY,h=s.colorScale.max>i.globals.maxY?s.colorScale.max:i.globals.maxY);var c=Math.abs(h)+Math.abs(l),g=100*a/(0===c?c-1e-6:c);return s.colorScale.ranges.length>0&&s.colorScale.ranges.map((function(t,e){if(a>=t.from&&a<=t.to){n=t.color,o=t.foreColor?t.foreColor:null,l=t.from,h=t.to;var i=Math.abs(h)+Math.abs(l);g=100*a/(0===i?i-1e-6:i)}})),{color:n,foreColor:o,percent:g}}},{key:"calculateHeatmapDataLabels",value:function(t){var e=t.x,i=t.y,a=t.i,s=t.j,r=t.heatColorProps,n=(t.series,t.rectHeight),o=t.rectWidth,l=this.w,h=l.config.dataLabels,c=new p(this.ctx),d=new z(this.ctx),g=h.formatter,u=null;if(h.enabled){u=c.group({class:"apexcharts-data-labels"});var f=h.offsetX,x=h.offsetY,b=e+o/2+f,m=i+n/2+parseFloat(h.style.fontSize)/3+x,v=g(l.globals.series[a][s],{seriesIndex:a,dataPointIndex:s,w:l});d.plotDataLabelsText({x:b,y:m,text:v,i:a,j:s,color:r.foreColor,parent:u,dataLabelsConfig:h})}return u}},{key:"animateHeatMap",value:function(t,e,i,a,s,r){var n=new f(this.ctx);n.animateRect(t,{x:e+a/2,y:i+s/2,width:0,height:0},{x:e,y:i,width:a,height:s},r,(function(){n.animationCompleted(t)}))}},{key:"animateHeatColor",value:function(t,e,i,a){t.attr({fill:e}).animate(a).attr({fill:i})}}]),t}(),wt=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"drawYAxisTexts",value:function(t,e,i,a){var s=this.w,r=s.config.yaxis[0],n=s.globals.yLabelFormatters[0];return new p(this.ctx).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:n(a,i),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[i]:r.labels.style.colors})}}]),t}(),kt=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w;var a=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==a.globals.stroke.colors?a.globals.stroke.colors:a.globals.colors,this.defaultSize=a.globals.svgHeight<a.globals.svgWidth?a.globals.gridHeight:a.globals.gridWidth,this.centerY=this.defaultSize/2,this.centerX=a.globals.gridWidth/2,this.fullAngle=360,a.globals.radialSize=this.defaultSize/2.05-a.config.stroke.width-(a.config.chart.sparkline.enabled?0:a.config.chart.dropShadow.blur),this.donutSize=a.globals.radialSize*parseInt(a.config.plotOptions.pie.donut.size,10)/100,this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return a(t,[{key:"draw",value:function(t){var e=this,i=this.w,a=new p(this.ctx);if(this.ret=a.group({class:"apexcharts-pie"}),i.globals.noData)return this.ret;for(var s=0,r=0;r<t.length;r++)s+=g.negToZero(t[r]);var n=[],o=a.group();0===s&&(s=1e-5),t.forEach((function(t){e.maxY=Math.max(e.maxY,t)})),"polarArea"===this.chartType&&this.drawPolarElements();for(var l=0;l<t.length;l++){var h=this.fullAngle*g.negToZero(t[l])/s;n.push(h),"polarArea"===this.chartType?(n[l]=this.fullAngle/t.length,this.sliceSizes.push(i.globals.radialSize*t[l]/this.maxY)):this.sliceSizes.push(i.globals.radialSize)}if(i.globals.dataChanged){for(var c,d=0,u=0;u<i.globals.previousPaths.length;u++)d+=g.negToZero(i.globals.previousPaths[u]);for(var f=0;f<i.globals.previousPaths.length;f++)c=this.fullAngle*g.negToZero(i.globals.previousPaths[f])/d,this.prevSectorAngleArr.push(c)}this.donutSize<0&&(this.donutSize=0);var x=i.config.plotOptions.pie.customScale,b=i.globals.gridWidth/2,m=i.globals.gridHeight/2,v=b-i.globals.gridWidth/2*x,y=m-i.globals.gridHeight/2*x;if("donut"===this.chartType){var w=a.drawCircle(this.donutSize);w.attr({cx:this.centerX,cy:this.centerY,fill:i.config.plotOptions.pie.donut.background?i.config.plotOptions.pie.donut.background:"transparent"}),o.add(w)}var k=this.drawArcs(n,t);if(this.sliceLabels.forEach((function(t){k.add(t)})),o.attr({transform:"translate(".concat(v,", ").concat(y,") scale(").concat(x,")")}),o.add(k),this.ret.add(o),this.donutDataLabels.show){var A=this.renderInnerDataLabels(this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show,translateX:v,translateY:y});this.ret.add(A)}return this.ret}},{key:"drawArcs",value:function(t,e){var i=this.w,a=new u(this.ctx),s=new p(this.ctx),r=new L(this.ctx),n=s.group({class:"apexcharts-slices"}),o=i.config.plotOptions.pie.startAngle%this.fullAngle,l=o,h=o,c=o,d=o;this.strokeWidth=i.config.stroke.show?i.config.stroke.width:0;for(var f=0;f<t.length;f++){var x=s.group({class:"apexcharts-series apexcharts-pie-series",seriesName:g.escapeString(i.globals.seriesNames[f]),rel:f+1,"data:realIndex":f});n.add(x),h=d,c=(l=c)+t[f],d=h+this.prevSectorAngleArr[f];var b=c<l?this.fullAngle+c-l:c-l,m=r.fillPath({seriesNumber:f,size:this.sliceSizes[f],value:e[f]}),v=this.getChangedPath(h,d),y=s.drawPath({d:v,stroke:this.lineColorArr instanceof Array?this.lineColorArr[f]:this.lineColorArr,strokeWidth:0,fill:m,fillOpacity:i.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(f)});if(y.attr({index:0,j:f}),i.config.chart.dropShadow.enabled){var w=i.config.chart.dropShadow;a.dropShadow(y,w,f)}this.addListeners(y,this.donutDataLabels),p.setAttrs(y.node,{"data:angle":b,"data:startAngle":l,"data:strokeWidth":this.strokeWidth,"data:value":e[f]});var k={x:0,y:0};"pie"===this.chartType||"polarArea"===this.chartType?k=g.polarToCartesian(this.centerX,this.centerY,i.globals.radialSize/1.25+i.config.plotOptions.pie.dataLabels.offset,(l+b/2)%this.fullAngle):"donut"===this.chartType&&(k=g.polarToCartesian(this.centerX,this.centerY,(i.globals.radialSize+this.donutSize)/2+i.config.plotOptions.pie.dataLabels.offset,(l+b/2)%this.fullAngle)),x.add(y);var A=0;if(!this.initialAnim||i.globals.resized||i.globals.dataChanged?this.animBeginArr.push(0):(0==(A=b/this.fullAngle*i.config.chart.animations.speed)&&(A=1),this.animDur=A+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&i.globals.dataChanged?this.animatePaths(y,{size:this.sliceSizes[f],endAngle:c,startAngle:l,prevStartAngle:h,prevEndAngle:d,animateStartingPos:!0,i:f,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:i.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(y,{size:this.sliceSizes[f],endAngle:c,startAngle:l,i:f,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:A}),i.config.plotOptions.pie.expandOnClick&&"polarArea"!==this.chartType&&y.click(this.pieClicked.bind(this,f)),i.config.dataLabels.enabled){var S=k.x,C=k.y,P=100*b/this.fullAngle+"%";if(0!==b&&i.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[f]){var T=i.config.dataLabels.formatter;void 0!==T&&(P=T(i.globals.seriesPercent[f][0],{seriesIndex:f,w:i}));var z=i.globals.dataLabels.style.colors[f],I=s.drawText({x:S,y:C,text:P,textAnchor:"middle",fontSize:i.config.dataLabels.style.fontSize,fontFamily:i.config.dataLabels.style.fontFamily,fontWeight:i.config.dataLabels.style.fontWeight,foreColor:z});if(i.config.dataLabels.dropShadow.enabled){var M=i.config.dataLabels.dropShadow;a.dropShadow(I,M)}I.node.classList.add("apexcharts-pie-label"),i.config.chart.animations.animate&&!1===i.globals.resized&&(I.node.classList.add("apexcharts-pie-label-delay"),I.node.style.animationDelay=i.config.chart.animations.speed/940+"s"),this.sliceLabels.push(I)}}}return n}},{key:"addListeners",value:function(t,e){var i=new p(this.ctx);t.node.addEventListener("mouseenter",i.pathMouseEnter.bind(this,t)),t.node.addEventListener("mouseleave",i.pathMouseLeave.bind(this,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",i.pathMouseDown.bind(this,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}},{key:"animatePaths",value:function(t,e){var i=this.w,a=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,s=a,r=e.startAngle,n=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(r=e.prevEndAngle,s=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),e.i===i.config.series.length-1&&(a+n>this.fullAngle?e.endAngle=e.endAngle-(a+n):a+n<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(a+n)))),a===this.fullAngle&&(a=this.fullAngle-.01),this.animateArc(t,r,n,a,s,e)}},{key:"animateArc",value:function(t,e,i,a,s,r){var n,o=this,l=this.w,h=new f(this.ctx),c=r.size;(isNaN(e)||isNaN(s))&&(e=i,s=a,r.dur=0);var d=a,g=i,u=e<i?this.fullAngle+e-i:e-i;l.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(n=o.getPiePath({me:o,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:c}),t.attr({d:n})),0!==r.dur?t.animate(r.dur,l.globals.easing,r.animBeginArr[r.i]).afterAll((function(){"pie"!==o.chartType&&"donut"!==o.chartType&&"polarArea"!==o.chartType||this.animate(l.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":o.strokeWidth}),r.i===l.config.series.length-1&&h.animationCompleted(t)})).during((function(l){d=u+(a-u)*l,r.animateStartingPos&&(d=s+(a-s)*l,g=e-s+(i-(e-s))*l),n=o.getPiePath({me:o,startAngle:g,angle:d,size:c}),t.node.setAttribute("data:pathOrig",n),t.attr({d:n})})):(n=o.getPiePath({me:o,startAngle:g,angle:a,size:c}),r.isTrack||(l.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",n),t.attr({d:n,"stroke-width":o.strokeWidth}))}},{key:"pieClicked",value:function(t){var e,i=this.w,a=this.sliceSizes[t]+(i.config.plotOptions.pie.expandOnClick?4:0),s=i.globals.dom.Paper.select(".apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(t)).members[0];if("true"!==s.attr("data:pieClicked")){var r=i.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(r,(function(t){t.setAttribute("data:pieClicked","false");var e=t.getAttribute("data:pathOrig");t.setAttribute("d",e)})),s.attr("data:pieClicked","true");var n=parseInt(s.attr("data:startAngle"),10),o=parseInt(s.attr("data:angle"),10);e=this.getPiePath({me:this,startAngle:n,angle:o,size:a}),360!==o&&s.plot(e)}else{s.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(s.node,this.donutDataLabels);var l=s.attr("data:pathOrig");s.attr({d:l})}}},{key:"getChangedPath",value:function(t,e){var i="";return this.dynamicAnim&&this.w.globals.dataChanged&&(i=this.getPiePath({me:this,startAngle:t,angle:e-t,size:this.size})),i}},{key:"getPiePath",value:function(t){var e=t.me,i=t.startAngle,a=t.angle,s=t.size,r=i,n=Math.PI*(r-90)/180,o=a+i;Math.ceil(o)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(o=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(o)>this.fullAngle&&(o-=this.fullAngle);var l=Math.PI*(o-90)/180,h=e.centerX+s*Math.cos(n),c=e.centerY+s*Math.sin(n),d=e.centerX+s*Math.cos(l),u=e.centerY+s*Math.sin(l),f=g.polarToCartesian(e.centerX,e.centerY,e.donutSize,o),p=g.polarToCartesian(e.centerX,e.centerY,e.donutSize,r),x=a>180?1:0,b=["M",h,c,"A",s,s,0,x,1,d,u];return"donut"===e.chartType?[].concat(b,["L",f.x,f.y,"A",e.donutSize,e.donutSize,0,x,0,p.x,p.y,"L",h,c,"z"]).join(" "):"pie"===e.chartType||"polarArea"===e.chartType?[].concat(b,["L",e.centerX,e.centerY,"L",h,c]).join(" "):[].concat(b).join(" ")}},{key:"drawPolarElements",value:function(){var t=this.w,e=new j(this.ctx),i=new p(this.ctx),a=new wt(this.ctx),s=i.group(),r=i.group(),n=void 0===t.config.yaxis[0].max&&void 0===t.config.yaxis[0].min,o=e.niceScale(0,Math.ceil(this.maxY),t.config.yaxis[0].tickAmount,0,n),l=o.result.reverse(),h=o.result.length;this.maxY=o.niceMax;for(var c=t.globals.radialSize,d=c/(h-1),g=0;g<h-1;g++){var u=i.drawCircle(c);if(u.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":t.config.plotOptions.polarArea.rings.strokeWidth,stroke:t.config.plotOptions.polarArea.rings.strokeColor}),t.config.yaxis[0].show){var f=a.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(t.config.yaxis[0].labels.style.fontSize,10)/2,g,l[g]);r.add(f)}s.add(u),c-=d}this.ret.add(s),this.ret.add(r)}},{key:"renderInnerDataLabels",value:function(t,e){var i=this.w,a=new p(this.ctx),s=a.group({class:"apexcharts-datalabels-group",transform:"translate(".concat(e.translateX?e.translateX:0,", ").concat(e.translateY?e.translateY:0,") scale(").concat(i.config.plotOptions.pie.customScale,")")}),r=t.total.show;s.node.style.opacity=e.opacity;var n,o,l=e.centerX,h=e.centerY;n=void 0===t.name.color?i.globals.colors[0]:t.name.color;var c=t.name.fontSize,d=t.name.fontFamily,g=t.value.fontWeight;o=void 0===t.value.color?i.config.chart.foreColor:t.value.color;var u=t.value.formatter,f="",x="";if(r?(n=t.total.color,c=t.total.fontSize,d=t.total.fontFamily,g=t.total.fontWeight,x=t.total.label,f=t.total.formatter(i)):1===i.globals.series.length&&(f=u(i.globals.series[0],i),x=i.globals.seriesNames[0]),x&&(x=t.name.formatter(x,t.total.show,i)),t.name.show){var b=a.drawText({x:l,y:h+parseFloat(t.name.offsetY),text:x,textAnchor:"middle",foreColor:n,fontSize:c,fontWeight:g,fontFamily:d});b.node.classList.add("apexcharts-datalabel-label"),s.add(b)}if(t.value.show){var m=t.name.show?parseFloat(t.value.offsetY)+16:t.value.offsetY,v=a.drawText({x:l,y:h+m,text:f,textAnchor:"middle",foreColor:o,fontWeight:t.value.fontWeight,fontSize:t.value.fontSize,fontFamily:t.value.fontFamily});v.node.classList.add("apexcharts-datalabel-value"),s.add(v)}return s}},{key:"printInnerLabels",value:function(t,e,i,a){var s,r=this.w;a?s=void 0===t.name.color?r.globals.colors[parseInt(a.parentNode.getAttribute("rel"),10)-1]:t.name.color:r.globals.series.length>1&&t.total.show&&(s=t.total.color);var n=r.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),o=r.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,t.value.formatter)(i,r),a||"function"!=typeof t.total.formatter||(i=t.total.formatter(r));var l=e===t.total.label;e=t.name.formatter(e,l,r),null!==n&&(n.textContent=e),null!==o&&(o.textContent=i),null!==n&&(n.style.fill=s)}},{key:"printDataLabelsInner",value:function(t,e){var i=this.w,a=t.getAttribute("data:value"),s=i.globals.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];i.globals.series.length>1&&this.printInnerLabels(e,s,a,t);var r=i.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");null!==r&&(r.style.opacity=1)}},{key:"revertDataLabelsInner",value:function(t,e,i){var a=this,s=this.w,r=s.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group"),n=!1,o=s.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area"),l=function(t){var i=t.makeSliceOut,s=t.printLabel;Array.prototype.forEach.call(o,(function(t){"true"===t.getAttribute("data:pieClicked")&&(i&&(n=!0),s&&a.printDataLabelsInner(t,e))}))};if(l({makeSliceOut:!0,printLabel:!1}),e.total.show&&s.globals.series.length>1)n&&!e.total.showAlways?l({makeSliceOut:!1,printLabel:!0}):this.printInnerLabels(e,e.total.label,e.total.formatter(s));else if(l({makeSliceOut:!1,printLabel:!0}),!n)if(s.globals.selectedDataPoints.length&&s.globals.series.length>1)if(s.globals.selectedDataPoints[0].length>0){var h=s.globals.selectedDataPoints[0],c=s.globals.dom.baseEl.querySelector(".apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(h));this.printDataLabelsInner(c,e)}else r&&s.globals.selectedDataPoints.length&&0===s.globals.selectedDataPoints[0].length&&(r.style.opacity=0);else r&&s.globals.series.length>1&&(r.style.opacity=0)}}]),t}(),At=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var a=this.w;this.graphics=new p(this.ctx),this.lineColorArr=void 0!==a.globals.stroke.colors?a.globals.stroke.colors:a.globals.colors,this.defaultSize=a.globals.svgHeight<a.globals.svgWidth?a.globals.gridHeight+1.5*a.globals.goldenPadding:a.globals.gridWidth,this.maxValue=this.w.globals.maxY,this.minValue=this.w.globals.minY,this.polygons=a.config.plotOptions.radar.polygons;var s=a.globals.labels.slice().sort((function(t,e){return e.length-t.length}))[0],r=this.graphics.getTextRects(s,a.config.xaxis.labels.style.fontSize);this.strokeWidth=a.config.stroke.show?a.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-a.config.chart.dropShadow.blur,a.config.xaxis.labels.show&&(this.size=this.size-r.width/1.75),void 0!==a.config.plotOptions.radar.size&&(this.size=a.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return a(t,[{key:"draw",value:function(t){var e=this,i=this.w,a=new L(this.ctx),s=[],r=new z(this.ctx);t.length&&(this.dataPointsLen=t[i.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var o=i.globals.gridWidth/2,l=i.globals.gridHeight/2,h=o+i.config.plotOptions.radar.offsetX,c=l+i.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(h||0,", ").concat(c||0,")")}),f=[],p=null,x=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((function(t,o){var l=t.length===i.globals.dataPoints,h=e.graphics.group().attr({class:"apexcharts-series","data:longestSeries":l,seriesName:g.escapeString(i.globals.seriesNames[o]),rel:o+1,"data:realIndex":o});e.dataRadiusOfPercent[o]=[],e.dataRadius[o]=[],e.angleArr[o]=[],t.forEach((function(t,i){var a=Math.abs(e.maxValue-e.minValue);t+=Math.abs(e.minValue),e.dataRadiusOfPercent[o][i]=t/a,e.dataRadius[o][i]=e.dataRadiusOfPercent[o][i]*e.size,e.angleArr[o][i]=i*e.disAngle})),f=e.getDataPointsPos(e.dataRadius[o],e.angleArr[o]);var c=e.createPaths(f,{x:0,y:0});p=e.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),x=e.graphics.group({class:"apexcharts-datalabels","data:realIndex":o}),i.globals.delayedElements.push({el:p.node,index:o});var d={i:o,realIndex:o,animationDelay:o,initialSpeed:i.config.chart.animations.speed,dataChangeSpeed:i.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:i.globals.stroke.colors[o],strokeLineCap:i.config.stroke.lineCap},b=null;i.globals.previousPaths.length>0&&(b=e.getPreviousPath(o));for(var m=0;m<c.linePathsTo.length;m++){var v=e.graphics.renderPaths(n({},d,{pathFrom:null===b?c.linePathsFrom[m]:b,pathTo:c.linePathsTo[m],strokeWidth:Array.isArray(e.strokeWidth)?e.strokeWidth[o]:e.strokeWidth,fill:"none",drawShadow:!1}));h.add(v);var y=a.fillPath({seriesNumber:o}),w=e.graphics.renderPaths(n({},d,{pathFrom:null===b?c.areaPathsFrom[m]:b,pathTo:c.areaPathsTo[m],strokeWidth:0,fill:y,drawShadow:!1}));if(i.config.chart.dropShadow.enabled){var k=new u(e.ctx),A=i.config.chart.dropShadow;k.dropShadow(w,Object.assign({},A,{noUserSpaceOnUse:!0}),o)}h.add(w)}t.forEach((function(t,a){var s=new P(e.ctx).getMarkerConfig("apexcharts-marker",o,a),l=e.graphics.drawMarker(f[a].x,f[a].y,s);l.attr("rel",a),l.attr("j",a),l.attr("index",o),l.node.setAttribute("default-marker-size",s.pSize);var c=e.graphics.group({class:"apexcharts-series-markers"});c&&c.add(l),p.add(c),h.add(p);var d=i.config.dataLabels;if(d.enabled){var g=d.formatter(i.globals.series[o][a],{seriesIndex:o,dataPointIndex:a,w:i});r.plotDataLabelsText({x:f[a].x,y:f[a].y,text:g,textAnchor:"middle",i:o,j:o,parent:x,offsetCorrection:!1,dataLabelsConfig:n({},d)})}h.add(x)})),s.push(h)})),this.drawPolygons({parent:d}),i.config.xaxis.labels.show){var b=this.drawXAxisTexts();d.add(b)}return d.add(this.yaxisLabels),s.forEach((function(t){d.add(t)})),d}},{key:"drawPolygons",value:function(t){for(var e=this,i=this.w,a=t.parent,s=new wt(this.ctx),r=i.globals.yAxisScale[0].result.reverse(),n=r.length,o=[],l=this.size/(n-1),h=0;h<n;h++)o[h]=l*h;o.reverse();var c=[],d=[];o.forEach((function(t,i){var a=e.getPolygonPos(t),s="";a.forEach((function(t,a){if(0===i){var r=e.graphics.drawLine(t.x,t.y,0,0,Array.isArray(e.polygons.connectorColors)?e.polygons.connectorColors[a]:e.polygons.connectorColors);d.push(r)}0===a&&e.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),s+=t.x+","+t.y+" "})),c.push(s)})),c.forEach((function(t,s){var r=e.polygons.strokeColors,n=e.polygons.strokeWidth,o=e.graphics.drawPolygon(t,Array.isArray(r)?r[s]:r,Array.isArray(n)?n[s]:n,i.globals.radarPolygons.fill.colors[s]);a.add(o)})),d.forEach((function(t){a.add(t)})),i.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((function(t,i){var a=s.drawYAxisTexts(t.x,t.y,i,r[i]);e.yaxisLabels.add(a)}))}},{key:"drawXAxisTexts",value:function(){var t=this,e=this.w,i=e.config.xaxis.labels,a=this.graphics.group({class:"apexcharts-xaxis"}),s=this.getPolygonPos(this.size);return e.globals.labels.forEach((function(r,o){var l=e.config.xaxis.labels.formatter,h=new z(t.ctx);if(s[o]){var c=t.getTextPos(s[o],t.size),d=l(r,{seriesIndex:-1,dataPointIndex:o,w:e});h.plotDataLabelsText({x:c.newX,y:c.newY,text:d,textAnchor:c.textAnchor,i:o,j:o,parent:a,color:i.style.colors[o]?i.style.colors[o]:"#a8a8a8",dataLabelsConfig:n({textAnchor:c.textAnchor,dropShadow:{enabled:!1}},i),offsetCorrection:!1})}})),a}},{key:"createPaths",value:function(t,e){var i=this,a=[],s=[],r=[],n=[];if(t.length){s=[this.graphics.move(e.x,e.y)],n=[this.graphics.move(e.x,e.y)];var o=this.graphics.move(t[0].x,t[0].y),l=this.graphics.move(t[0].x,t[0].y);t.forEach((function(e,a){o+=i.graphics.line(e.x,e.y),l+=i.graphics.line(e.x,e.y),a===t.length-1&&(o+="Z",l+="Z")})),a.push(o),r.push(l)}return{linePathsFrom:s,linePathsTo:a,areaPathsFrom:n,areaPathsTo:r}}},{key:"getTextPos",value:function(t,e){var i="middle",a=t.x,s=t.y;return Math.abs(t.x)>=10?t.x>0?(i="start",a+=10):t.x<0&&(i="end",a-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?s-=10:t.y>0&&(s+=10)),{textAnchor:i,newX:a,newY:s}}},{key:"getPreviousPath",value:function(t){for(var e=this.w,i=null,a=0;a<e.globals.previousPaths.length;a++){var s=e.globals.previousPaths[a];s.paths.length>0&&parseInt(s.realIndex,10)===parseInt(t,10)&&void 0!==e.globals.previousPaths[a].paths[0]&&(i=e.globals.previousPaths[a].paths[0].d)}return i}},{key:"getDataPointsPos",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dataPointsLen;t=t||[],e=e||[];for(var a=[],s=0;s<i;s++){var r={};r.x=t[s]*Math.sin(e[s]),r.y=-t[s]*Math.cos(e[s]),a.push(r)}return a}},{key:"getPolygonPos",value:function(t){for(var e=[],i=2*Math.PI/this.dataPointsLen,a=0;a<this.dataPointsLen;a++){var s={};s.x=t*Math.sin(a*i),s.y=-t*Math.cos(a*i),e.push(s)}return e}}]),t}(),St=function(t){function i(t){var a;e(this,i),(a=c(this,l(i).call(this,t))).ctx=t,a.w=t.w,a.animBeginArr=[0],a.animDur=0;var s=a.w;return a.startAngle=s.config.plotOptions.radialBar.startAngle,a.endAngle=s.config.plotOptions.radialBar.endAngle,a.totalAngle=Math.abs(s.config.plotOptions.radialBar.endAngle-s.config.plotOptions.radialBar.startAngle),a.trackStartAngle=s.config.plotOptions.radialBar.track.startAngle,a.trackEndAngle=s.config.plotOptions.radialBar.track.endAngle,a.radialDataLabels=s.config.plotOptions.radialBar.dataLabels,a.trackStartAngle||(a.trackStartAngle=a.startAngle),a.trackEndAngle||(a.trackEndAngle=a.endAngle),360===a.endAngle&&(a.endAngle=359.99),a.margin=parseInt(s.config.plotOptions.radialBar.track.margin,10),a}return o(i,t),a(i,[{key:"draw",value:function(t){var e=this.w,i=new p(this.ctx),a=i.group({class:"apexcharts-radialbar"});if(e.globals.noData)return a;var s=i.group(),r=this.defaultSize/2,n=e.globals.gridWidth/2,o=this.defaultSize/2.05;e.config.chart.sparkline.enabled||(o=o-e.config.stroke.width-e.config.chart.dropShadow.blur);var l=e.globals.fill.colors;if(e.config.plotOptions.radialBar.track.show){var h=this.drawTracks({size:o,centerX:n,centerY:r,colorArr:l,series:t});s.add(h)}var c=this.drawArcs({size:o,centerX:n,centerY:r,colorArr:l,series:t}),d=360;e.config.plotOptions.radialBar.startAngle<0&&(d=this.totalAngle);var g=(360-d)/360;if(e.globals.radialSize=o-o*g,this.radialDataLabels.value.show){var u=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);e.globals.radialSize+=u*g}return s.add(c.g),"front"===e.config.plotOptions.radialBar.hollow.position&&(c.g.add(c.elHollow),c.dataLabels&&c.g.add(c.dataLabels)),a.add(s),a}},{key:"drawTracks",value:function(t){var e=this.w,i=new p(this.ctx),a=i.group({class:"apexcharts-tracks"}),s=new u(this.ctx),r=new L(this.ctx),n=this.getStrokeWidth(t);t.size=t.size-n/2;for(var o=0;o<t.series.length;o++){var l=i.group({class:"apexcharts-radialbar-track apexcharts-track"});a.add(l),l.attr({rel:o+1}),t.size=t.size-n-this.margin;var h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[o]:h.background,solid:!0}),d=this.trackStartAngle,g=this.trackEndAngle;Math.abs(g)+Math.abs(d)>=360&&(g=360-Math.abs(this.startAngle)-.1);var f=i.drawPath({d:"",stroke:c,strokeWidth:n*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){var x=h.dropShadow;s.dropShadow(f,x)}l.add(f),f.attr("id","apexcharts-radialbarTrack-"+o),this.animatePaths(f,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:o,totalItems:2,animBeginArr:0,dur:0,isTrack:!0,easing:e.globals.easing})}return a}},{key:"drawArcs",value:function(t){var e=this.w,i=new p(this.ctx),a=new L(this.ctx),s=new u(this.ctx),r=i.group(),n=this.getStrokeWidth(t);t.size=t.size-n/2;var o=e.config.plotOptions.radialBar.hollow.background,l=t.size-n*t.series.length-this.margin*t.series.length-n*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,h=l-e.config.plotOptions.radialBar.hollow.margin;void 0!==e.config.plotOptions.radialBar.hollow.image&&(o=this.drawHollowImage(t,r,l,o));var c=this.drawHollow({size:h,centerX:t.centerX,centerY:t.centerY,fill:o||"transparent"});if(e.config.plotOptions.radialBar.hollow.dropShadow.enabled){var d=e.config.plotOptions.radialBar.hollow.dropShadow;s.dropShadow(c,d)}var f=1;!this.radialDataLabels.total.show&&e.globals.series.length>1&&(f=0);var x=null;this.radialDataLabels.show&&(x=this.renderInnerDataLabels(this.radialDataLabels,{hollowSize:l,centerX:t.centerX,centerY:t.centerY,opacity:f})),"back"===e.config.plotOptions.radialBar.hollow.position&&(r.add(c),x&&r.add(x));var b=!1;e.config.plotOptions.radialBar.inverseOrder&&(b=!0);for(var m=b?t.series.length-1:0;b?m>=0:m<t.series.length;b?m--:m++){var v=i.group({class:"apexcharts-series apexcharts-radial-series",seriesName:g.escapeString(e.globals.seriesNames[m])});r.add(v),v.attr({rel:m+1,"data:realIndex":m}),this.ctx.series.addCollapsedClassToSeries(v,m),t.size=t.size-n-this.margin;var y=a.fillPath({seriesNumber:m,size:t.size,value:t.series[m]}),w=this.startAngle,k=void 0,A=g.negToZero(t.series[m]>100?100:t.series[m])/100,S=Math.round(this.totalAngle*A)+this.startAngle,C=void 0;e.globals.dataChanged&&(k=this.startAngle,C=Math.round(this.totalAngle*g.negToZero(e.globals.previousPaths[m])/100)+k),Math.abs(S)+Math.abs(w)>=360&&(S-=.01),Math.abs(C)+Math.abs(k)>=360&&(C-=.01);var P=S-w,T=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[m]:e.config.stroke.dashArray,z=i.drawPath({d:"",stroke:y,strokeWidth:n,fill:"none",fillOpacity:e.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+m,strokeDashArray:T});if(p.setAttrs(z.node,{"data:angle":P,"data:value":t.series[m]}),e.config.chart.dropShadow.enabled){var I=e.config.chart.dropShadow;s.dropShadow(z,I,m)}this.addListeners(z,this.radialDataLabels),v.add(z),z.attr({index:0,j:m});var M=0;!this.initialAnim||e.globals.resized||e.globals.dataChanged||(M=(S-w)/360*e.config.chart.animations.speed,this.animDur=M/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur)),e.globals.dataChanged&&(M=(S-w)/360*e.config.chart.animations.dynamicAnimation.speed,this.animDur=M/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur)),this.animatePaths(z,{centerX:t.centerX,centerY:t.centerY,endAngle:S,startAngle:w,prevEndAngle:C,prevStartAngle:k,size:t.size,i:m,totalItems:2,animBeginArr:this.animBeginArr,dur:M,shouldSetPrevPaths:!0,easing:e.globals.easing})}return{g:r,elHollow:c,dataLabels:x}}},{key:"drawHollow",value:function(t){var e=new p(this.ctx).drawCircle(2*t.size);return e.attr({class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),e}},{key:"drawHollowImage",value:function(t,e,i,a){var s=this.w,r=new L(this.ctx),n=g.randomId(),o=s.config.plotOptions.radialBar.hollow.image;if(s.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:i,height:i,image:o,patternID:"pattern".concat(s.globals.cuid).concat(n)}),a="url(#pattern".concat(s.globals.cuid).concat(n,")");else{var l=s.config.plotOptions.radialBar.hollow.imageWidth,h=s.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===l&&void 0===h){var c=s.globals.dom.Paper.image(o).loaded((function(e){this.move(t.centerX-e.width/2+s.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+s.config.plotOptions.radialBar.hollow.imageOffsetY)}));e.add(c)}else{var d=s.globals.dom.Paper.image(o).loaded((function(e){this.move(t.centerX-l/2+s.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-h/2+s.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(l,h)}));e.add(d)}}return a}},{key:"getStrokeWidth",value:function(t){var e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}}]),i}(kt),Ct=function(){function t(i){e(this,t),this.w=i.w,this.lineCtx=i}return a(t,[{key:"sameValueSeriesFix",value:function(t,e){var i=this.w;if("line"===i.config.chart.type&&("gradient"===i.config.fill.type||"gradient"===i.config.fill.type[t])&&new m(this.lineCtx.ctx,i).seriesHaveSameValues(t)){var a=e[t].slice();a[a.length-1]=a[a.length-1]+1e-6,e[t]=a}return e}},{key:"calculatePoints",value:function(t){var e=t.series,i=t.realIndex,a=t.x,s=t.y,r=t.i,n=t.j,o=t.prevY,l=this.w,h=[],c=[];if(0===n){var d=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;l.globals.isXNumeric&&(d=(l.globals.seriesX[i][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),h.push(d),c.push(g.isNumber(e[r][0])?o+l.config.markers.offsetY:null),h.push(a+l.config.markers.offsetX),c.push(g.isNumber(e[r][n+1])?s+l.config.markers.offsetY:null)}else h.push(a+l.config.markers.offsetX),c.push(g.isNumber(e[r][n+1])?s+l.config.markers.offsetY:null);return{x:h,y:c}}},{key:"checkPreviousPaths",value:function(t){for(var e=t.pathFromLine,i=t.pathFromArea,a=t.realIndex,s=this.w,r=0;r<s.globals.previousPaths.length;r++){var n=s.globals.previousPaths[r];("line"===n.type||"area"===n.type)&&n.paths.length>0&&parseInt(n.realIndex,10)===parseInt(a,10)&&("line"===n.type?(this.lineCtx.appendPathFrom=!1,e=s.globals.previousPaths[r].paths[0].d):"area"===n.type&&(this.lineCtx.appendPathFrom=!1,i=s.globals.previousPaths[r].paths[0].d,s.config.stroke.show&&s.globals.previousPaths[r].paths[1]&&(e=s.globals.previousPaths[r].paths[1].d)))}return{pathFromLine:e,pathFromArea:i}}},{key:"determineFirstPrevY",value:function(t){var e=t.i,i=t.series,a=t.prevY,s=t.lineYPosition,r=this.w;if(void 0!==i[e][0])a=(s=r.config.chart.stacked&&e>0?this.lineCtx.prevSeriesY[e-1][0]:this.lineCtx.zeroY)-i[e][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]+2*(this.lineCtx.isReversed?i[e][0]/this.lineCtx.yRatio[this.lineCtx.yaxisIndex]:0);else if(r.config.chart.stacked&&e>0&&void 0===i[e][0])for(var n=e-1;n>=0;n--)if(null!==i[n][0]&&void 0!==i[n][0]){a=s=this.lineCtx.prevSeriesY[n][0];break}return{prevY:a,lineYPosition:s}}}]),t}(),Lt=function(){function t(i,a,s){e(this,t),this.ctx=i,this.w=i.w,this.xyRatios=a,this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||s,this.scatter=new T(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Ct(this),this.markers=new P(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return a(t,[{key:"draw",value:function(t,e,i){var a=this.w,s=new p(this.ctx),r=a.globals.comboCharts?e:a.config.chart.type,n=s.group({class:"apexcharts-".concat(r,"-series apexcharts-plot-series")}),o=new m(this.ctx,a);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=o.getLogSeries(t),this.yRatio=o.getLogYRatios(this.yRatio);for(var l=[],h=0;h<t.length;h++){t=this.lineHelpers.sameValueSeriesFix(h,t);var c=a.globals.comboCharts?i[h]:h;this._initSerieVariables(t,h,c);var d=[],g=[],u=a.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,c),a.globals.isXNumeric&&a.globals.seriesX.length>0&&(u=(a.globals.seriesX[c][0]-a.globals.minX)/this.xRatio),g.push(u);var f,x=u,b=x,v=this.zeroY;v=this.lineHelpers.determineFirstPrevY({i:h,series:t,prevY:v,lineYPosition:0}).prevY,d.push(v),f=v;var y=this._calculatePathsFrom({series:t,i:h,realIndex:c,prevX:b,prevY:v}),w=this._iterateOverDataPoints({series:t,realIndex:c,i:h,x:u,y:1,pX:x,pY:f,pathsFrom:y,linePaths:[],areaPaths:[],seriesIndex:i,lineYPosition:0,xArrj:g,yArrj:d});this._handlePaths({type:r,realIndex:c,i:h,paths:w}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),l.push(this.elSeries)}for(var k=l.length;k>0;k--)n.add(l[k-1]);return n}},{key:"_initSerieVariables",value:function(t,e,i){var a=this.w,s=new p(this.ctx);this.xDivision=a.globals.gridWidth/(a.globals.dataPoints-("on"===a.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(a.config.stroke.width)?a.config.stroke.width[i]:a.config.stroke.width,this.yRatio.length>1&&(this.yaxisIndex=i),this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed,this.zeroY=a.globals.gridHeight-this.baseLineY[this.yaxisIndex]-(this.isReversed?a.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[this.yaxisIndex]:0),this.areaBottomY=this.zeroY,this.zeroY>a.globals.gridHeight&&(this.areaBottomY=a.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=s.group({class:"apexcharts-series",seriesName:g.escapeString(a.globals.seriesNames[i])}),this.elPointsMain=s.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),this.elDataLabelsWrap=s.group({class:"apexcharts-datalabels","data:realIndex":i});var r=t[e].length===a.globals.dataPoints;this.elSeries.attr({"data:longestSeries":r,rel:e+1,"data:realIndex":i}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(t){var e,i,a,s,r=t.series,n=t.i,o=t.realIndex,l=t.prevX,h=t.prevY,c=this.w,d=new p(this.ctx);if(null===r[n][0]){for(var g=0;g<r[n].length;g++)if(null!==r[n][g]){l=this.xDivision*g,h=this.zeroY-r[n][g]/this.yRatio[this.yaxisIndex],e=d.move(l,h),i=d.move(l,this.areaBottomY);break}}else e=d.move(l,h),i=d.move(l,this.areaBottomY)+d.line(l,h);if(a=d.move(-1,this.zeroY)+d.line(-1,this.zeroY),s=d.move(-1,this.zeroY)+d.line(-1,this.zeroY),c.globals.previousPaths.length>0){var u=this.lineHelpers.checkPreviousPaths({pathFromLine:a,pathFromArea:s,realIndex:o});a=u.pathFromLine,s=u.pathFromArea}return{prevX:l,prevY:h,linePath:e,areaPath:i,pathFromLine:a,pathFromArea:s}}},{key:"_handlePaths",value:function(t){var e=t.type,i=t.realIndex,a=t.i,s=t.paths,r=this.w,o=new p(this.ctx),l=new L(this.ctx);this.prevSeriesY.push(s.yArrj),r.globals.seriesXvalues[i]=s.xArrj,r.globals.seriesYvalues[i]=s.yArrj,this.pointsChart||r.globals.delayedElements.push({el:this.elPointsMain.node,index:i});var h={i:a,realIndex:i,animationDelay:a,initialSpeed:r.config.chart.animations.speed,dataChangeSpeed:r.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(e)};if("area"===e)for(var c=l.fillPath({seriesNumber:i}),d=0;d<s.areaPaths.length;d++){var g=o.renderPaths(n({},h,{pathFrom:s.pathFromArea,pathTo:s.areaPaths[d],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:c}));this.elSeries.add(g)}if(r.config.stroke.show&&!this.pointsChart){var u=null;u="line"===e?l.fillPath({seriesNumber:i,i:a}):r.globals.stroke.colors[i];for(var f=0;f<s.linePaths.length;f++){var x=o.renderPaths(n({},h,{pathFrom:s.pathFromLine,pathTo:s.linePaths[f],stroke:u,strokeWidth:this.strokeWidth,strokeLineCap:r.config.stroke.lineCap,fill:"none"}));this.elSeries.add(x)}}}},{key:"_iterateOverDataPoints",value:function(t){for(var e=t.series,i=t.realIndex,a=t.i,s=t.x,r=t.y,n=t.pX,o=t.pY,l=t.pathsFrom,h=t.linePaths,c=t.areaPaths,d=t.seriesIndex,u=t.lineYPosition,f=t.xArrj,x=t.yArrj,b=this.w,m=new p(this.ctx),v=this.yRatio,y=l.prevY,w=l.linePath,k=l.areaPath,A=l.pathFromLine,S=l.pathFromArea,C=g.isNumber(b.globals.minYArr[i])?b.globals.minYArr[i]:b.globals.minY,L=b.globals.dataPoints>1?b.globals.dataPoints-1:b.globals.dataPoints,P=0;P<L;P++){var T=void 0===e[a][P+1]||null===e[a][P+1];if(b.globals.isXNumeric){var z=b.globals.seriesX[i][P+1];void 0===b.globals.seriesX[i][P+1]&&(z=b.globals.seriesX[i][L-1]),s=(z-b.globals.minX)/this.xRatio}else s+=this.xDivision;u=b.config.chart.stacked&&a>0&&b.globals.collapsedSeries.length<b.config.series.length-1?this.prevSeriesY[function(t){for(var e=t,i=0;i<b.globals.series.length;i++)if(b.globals.collapsedSeriesIndices.indexOf(t)>-1){e--;break}return e>=0?e:0}(a-1)][P+1]:this.zeroY,r=T?u-C/v[this.yaxisIndex]+2*(this.isReversed?C/v[this.yaxisIndex]:0):u-e[a][P+1]/v[this.yaxisIndex]+2*(this.isReversed?e[a][P+1]/v[this.yaxisIndex]:0),f.push(s),x.push(r);var I=this.lineHelpers.calculatePoints({series:e,x:s,y:r,realIndex:i,i:a,j:P,prevY:y}),M=this._createPaths({series:e,i:a,realIndex:i,j:P,x:s,y:r,pX:n,pY:o,linePath:w,areaPath:k,linePaths:h,areaPaths:c,seriesIndex:d});c=M.areaPaths,h=M.linePaths,n=M.pX,o=M.pY,k=M.areaPath,w=M.linePath,this.appendPathFrom&&(A+=m.line(s,this.zeroY),S+=m.line(s,this.zeroY)),this.handleNullDataPoints(e,I,a,P,i),this._handleMarkersAndLabels({pointsPos:I,series:e,x:s,y:r,prevY:y,i:a,j:P,realIndex:i})}return{yArrj:x,xArrj:f,pathFromArea:S,areaPaths:c,pathFromLine:A,linePaths:h}}},{key:"_handleMarkersAndLabels",value:function(t){var e=t.pointsPos,i=(t.series,t.x,t.y,t.prevY,t.i),a=t.j,s=t.realIndex,r=this.w,n=new z(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:s,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{r.globals.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var o=this.markers.plotChartMarkers(e,s,a+1);null!==o&&this.elPointsMain.add(o)}var l=n.drawDataLabel(e,s,a+1,null);null!==l&&this.elDataLabelsWrap.add(l)}},{key:"_createPaths",value:function(t){var e=t.series,i=t.i,a=t.realIndex,s=t.j,r=t.x,n=t.y,o=t.pX,l=t.pY,h=t.linePath,c=t.areaPath,d=t.linePaths,g=t.areaPaths,u=t.seriesIndex,f=this.w,x=new p(this.ctx),b=f.config.stroke.curve,m=this.areaBottomY;if(Array.isArray(f.config.stroke.curve)&&(b=Array.isArray(u)?f.config.stroke.curve[u[i]]:f.config.stroke.curve[i]),"smooth"===b){var v=.35*(r-o);f.globals.hasNullValues?(null!==e[i][s]&&(null!==e[i][s+1]?(h=x.move(o,l)+x.curve(o+v,l,r-v,n,r+1,n),c=x.move(o+1,l)+x.curve(o+v,l,r-v,n,r+1,n)+x.line(r,m)+x.line(o,m)+"z"):(h=x.move(o,l),c=x.move(o,l)+"z")),d.push(h),g.push(c)):(h+=x.curve(o+v,l,r-v,n,r,n),c+=x.curve(o+v,l,r-v,n,r,n)),o=r,l=n,s===e[i].length-2&&(c=c+x.curve(o,l,r,n,r,m)+x.move(r,n)+"z",f.globals.hasNullValues||(d.push(h),g.push(c)))}else{if(null===e[i][s+1]){h+=x.move(r,n);var y=f.globals.isXNumeric?(f.globals.seriesX[a][s]-f.globals.minX)/this.xRatio:r-this.xDivision;c=c+x.line(y,m)+x.move(r,n)+"z"}null===e[i][s]&&(h+=x.move(r,n),c+=x.move(r,m)),"stepline"===b?(h=h+x.line(r,null,"H")+x.line(null,n,"V"),c=c+x.line(r,null,"H")+x.line(null,n,"V")):"straight"===b&&(h+=x.line(r,n),c+=x.line(r,n)),s===e[i].length-2&&(c=c+x.line(r,m)+x.move(r,n)+"z",d.push(h),g.push(c))}return{linePaths:d,areaPaths:g,pX:o,pY:l,linePath:h,areaPath:c}}},{key:"handleNullDataPoints",value:function(t,e,i,a,s){var r=this.w;if(null===t[i][a]&&r.config.markers.showNullDataPoints||1===t[i].length){var n=this.markers.plotChartMarkers(e,s,a+1,this.strokeWidth-r.config.markers.strokeWidth/2,!0);null!==n&&this.elPointsMain.add(n)}}}]),t}(),Pt=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return a(t,[{key:"calculateTimeScaleTicks",value:function(t,e){var i=this,a=this.w;if(a.globals.allSeriesCollapsed)return a.globals.labels=[],a.globals.timescaleLabels=[],[];var s=new Y(this.ctx),r=(e-t)/864e5;this.determineInterval(r),a.globals.disableZoomIn=!1,a.globals.disableZoomOut=!1,r<.005?a.globals.disableZoomIn=!0:r>5e4&&(a.globals.disableZoomOut=!0);var o=s.getTimeUnitsfromTimestamp(t,e,this.utc),l=a.globals.gridWidth/r,h=l/24,c=h/60,d=Math.floor(24*r),g=Math.floor(24*r*60),u=Math.floor(r),f=Math.floor(r/30),p=Math.floor(r/365),x={minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear},b={firstVal:x,currentMinute:x.minMinute,currentHour:x.minHour,currentMonthDate:x.minDate,currentDate:x.minDate,currentMonth:x.minMonth,currentYear:x.minYear,daysWidthOnXAxis:l,hoursWidthOnXAxis:h,minutesWidthOnXAxis:c,numberOfMinutes:g,numberOfHours:d,numberOfDays:u,numberOfMonths:f,numberOfYears:p};switch(this.tickInterval){case"years":this.generateYearScale(b);break;case"months":case"half_year":this.generateMonthScale(b);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(b);break;case"hours":this.generateHourScale(b);break;case"minutes":this.generateMinuteScale(b)}var m=this.timeScaleArray.map((function(t){var e={position:t.position,unit:t.unit,year:t.year,day:t.day?t.day:1,hour:t.hour?t.hour:0,month:t.month+1};return"month"===t.unit?n({},e,{day:1,value:t.value+1}):"day"===t.unit||"hour"===t.unit?n({},e,{value:t.value}):"minute"===t.unit?n({},e,{value:t.value,minute:t.value}):t}));return m.filter((function(t){var e=1,s=Math.ceil(a.globals.gridWidth/120),r=t.value;void 0!==a.config.xaxis.tickAmount&&(s=a.config.xaxis.tickAmount),m.length>s&&(e=Math.floor(m.length/s));var n=!1,o=!1;switch(i.tickInterval){case"years":"year"===t.unit&&(n=!0);break;case"half_year":e=7,"year"===t.unit&&(n=!0);break;case"months":e=1,"year"===t.unit&&(n=!0);break;case"months_fortnight":e=15,"year"!==t.unit&&"month"!==t.unit||(n=!0),30===r&&(o=!0);break;case"months_days":e=10,"month"===t.unit&&(n=!0),30===r&&(o=!0);break;case"week_days":e=8,"month"===t.unit&&(n=!0);break;case"days":e=1,"month"===t.unit&&(n=!0);break;case"hours":"day"===t.unit&&(n=!0);break;case"minutes":r%5!=0&&(o=!0)}if("minutes"===i.tickInterval||"hours"===i.tickInterval){if(!o)return!0}else if((r%e==0||n)&&!o)return!0}))}},{key:"recalcDimensionsBasedOnFormat",value:function(t,e){var i=this.w,a=this.formatDates(t),s=this.removeOverlappingTS(a);i.globals.timescaleLabels=s.slice(),new nt(this.ctx).plotCoords()}},{key:"determineInterval",value:function(t){switch(!0){case t>1825:this.tickInterval="years";break;case t>800&&t<=1825:this.tickInterval="half_year";break;case t>180&&t<=800:this.tickInterval="months";break;case t>90&&t<=180:this.tickInterval="months_fortnight";break;case t>60&&t<=90:this.tickInterval="months_days";break;case t>30&&t<=60:this.tickInterval="week_days";break;case t>2&&t<=30:this.tickInterval="days";break;case t>.1&&t<=2:this.tickInterval="hours";break;case t<.1:this.tickInterval="minutes";break;default:this.tickInterval="days"}}},{key:"generateYearScale",value:function(t){var e=t.firstVal,i=t.currentMonth,a=t.currentYear,s=t.daysWidthOnXAxis,r=t.numberOfYears,n=e.minYear,o=0,l=new Y(this.ctx);if(e.minDate>1||e.minMonth>0){var h=l.determineRemainingDaysOfYear(e.minYear,e.minMonth,e.minDate);o=(l.determineDaysOfYear(e.minYear)-h+1)*s,n=e.minYear+1,this.timeScaleArray.push({position:o,value:n,unit:"year",year:n,month:g.monthMod(i+1)})}else 1===e.minDate&&0===e.minMonth&&this.timeScaleArray.push({position:o,value:n,unit:"year",year:a,month:g.monthMod(i+1)});for(var c=n,d=o,u=0;u<r;u++)c++,d=l.determineDaysOfYear(c-1)*s+d,this.timeScaleArray.push({position:d,value:c,unit:"year",year:c,month:1})}},{key:"generateMonthScale",value:function(t){var e=t.firstVal,i=t.currentMonthDate,a=t.currentMonth,s=t.currentYear,r=t.daysWidthOnXAxis,n=t.numberOfMonths,o=a,l=0,h=new Y(this.ctx),c="month",d=0;if(e.minDate>1){l=(h.determineDaysOfMonths(a+1,e.minYear)-i+1)*r,o=g.monthMod(a+1);var u=s+d,f=g.monthMod(o),p=o;0===o&&(c="year",p=u,f=1,u+=d+=1),this.timeScaleArray.push({position:l,value:p,unit:c,year:u,month:f})}else this.timeScaleArray.push({position:l,value:o,unit:c,year:s,month:g.monthMod(a)});for(var x=o+1,b=l,m=0,v=1;m<n;m++,v++){0===(x=g.monthMod(x))?(c="year",d+=1):c="month";var y=this._getYear(s,x,d);b=h.determineDaysOfMonths(x,y)*r+b;var w=0===x?y:x;this.timeScaleArray.push({position:b,value:w,unit:c,year:y,month:0===x?1:x}),x++}}},{key:"generateDayScale",value:function(t){var e=t.firstVal,i=t.currentMonth,a=t.currentYear,s=t.hoursWidthOnXAxis,r=t.numberOfDays,n=new Y(this.ctx),o="day",l=e.minDate+1,h=l,c=function(t,e,i){return t>n.determineDaysOfMonths(e+1,i)?(h=1,o="month",u=e+=1,e):e},d=(24-e.minHour)*s,u=l,f=c(h,i,a);0===e.minHour&&1===e.minDate&&(d=0,u=g.monthMod(e.minMonth),o="month",h=e.minDate,r++),this.timeScaleArray.push({position:d,value:u,unit:o,year:this._getYear(a,f,0),month:g.monthMod(f),day:h});for(var p=d,x=0;x<r;x++){o="day",f=c(h+=1,f,this._getYear(a,f,0));var b=this._getYear(a,f,0);p=24*s+p;var m=1===h?g.monthMod(f):h;this.timeScaleArray.push({position:p,value:m,unit:o,year:b,month:g.monthMod(f),day:m})}}},{key:"generateHourScale",value:function(t){var e=t.firstVal,i=t.currentDate,a=t.currentMonth,s=t.currentYear,r=t.minutesWidthOnXAxis,n=t.numberOfHours,o=new Y(this.ctx),l="hour",h=function(t,e){return t>o.determineDaysOfMonths(e+1,s)&&(x=1,e+=1),{month:e,date:x}},c=function(t,e){return t>o.determineDaysOfMonths(e+1,s)?e+=1:e},d=60-e.minMinute,u=d*r,f=e.minHour+1,p=f+1;60===d&&(u=0,p=(f=e.minHour)+1);var x=i,b=c(x,a);this.timeScaleArray.push({position:u,value:f,unit:l,day:x,hour:p,year:s,month:g.monthMod(b)});for(var m=u,v=0;v<n;v++){l="hour",p>=24&&(p=0,l="day",b=h(x+=1,b).month,b=c(x,b));var y=this._getYear(s,b,0);m=0===p&&0===v?d*r:60*r+m;var w=0===p?x:p;this.timeScaleArray.push({position:m,value:w,unit:l,hour:p,day:x,year:y,month:g.monthMod(b)}),p++}}},{key:"generateMinuteScale",value:function(t){var e=t.firstVal,i=t.currentMinute,a=t.currentHour,s=t.currentDate,r=t.currentMonth,n=t.currentYear,o=t.minutesWidthOnXAxis,l=t.numberOfMinutes,h=o-(i-e.minMinute),c=e.minMinute+1,d=c+1,u=s,f=r,p=n,x=a;this.timeScaleArray.push({position:h,value:c,unit:"minute",day:u,hour:x,minute:d,year:p,month:g.monthMod(f)});for(var b=h,m=0;m<l;m++)d>=60&&(d=0,24===(x+=1)&&(x=0)),b=o+b,this.timeScaleArray.push({position:b,value:d,unit:"minute",hour:x,minute:d,day:u,year:this._getYear(n,f,0),month:g.monthMod(f)}),d++}},{key:"createRawDateString",value:function(t,e){var i=t.year;return i+="-"+("0"+t.month.toString()).slice(-2),"day"===t.unit?i+="day"===t.unit?"-"+("0"+e).slice(-2):"-01":i+="-"+("0"+(t.day?t.day:"1")).slice(-2),"hour"===t.unit?i+="hour"===t.unit?"T"+("0"+e).slice(-2):"T00":i+="T"+("0"+(t.hour?t.hour:"0")).slice(-2),i+="minute"===t.unit?":"+("0"+e).slice(-2)+":00":":00:00",this.utc&&(i+=".000Z"),i}},{key:"formatDates",value:function(t){var e=this,i=this.w;return t.map((function(t){var a=t.value.toString(),s=new Y(e.ctx),r=e.createRawDateString(t,a),n=s.getDate(r);if(void 0===i.config.xaxis.labels.format){var o="dd MMM",l=i.config.xaxis.labels.datetimeFormatter;"year"===t.unit&&(o=l.year),"month"===t.unit&&(o=l.month),"day"===t.unit&&(o=l.day),"hour"===t.unit&&(o=l.hour),"minute"===t.unit&&(o=l.minute),a=s.formatDate(n,o)}else a=s.formatDate(n,i.config.xaxis.labels.format);return{dateString:r,position:t.position,value:a,unit:t.unit,year:t.year,month:t.month}}))}},{key:"removeOverlappingTS",value:function(t){var e,i=this,a=new p(this.ctx),s=!1;t.length>0&&t[0].value&&t.every((function(e){return e.value.length===t[0].value.length}))&&(s=!0,e=a.getTextRects(t[0].value).width);var r=0,n=t.map((function(n,o){if(o>0&&i.w.config.xaxis.labels.hideOverlappingLabels){var l=s?e:a.getTextRects(t[r].value).width,h=t[r].position;return n.position>h+l+10?(r=o,n):null}return n}));return n.filter((function(t){return null!==t}))}},{key:"_getYear",value:function(t,e,i){return t+Math.floor(e/12)+i}}]),t}(),Tt=function(){function t(i,a){e(this,t),this.ctx=a,this.w=a.w,this.el=i}return a(t,[{key:"setupElements",value:function(){var t=this.w.globals,e=this.w.config,i=e.chart.type;t.axisCharts=["line","area","bar","rangeBar","candlestick","scatter","bubble","radar","heatmap"].indexOf(i)>-1,t.xyCharts=["line","area","bar","rangeBar","candlestick","scatter","bubble"].indexOf(i)>-1,t.isBarHorizontal=("bar"===e.chart.type||"rangeBar"===e.chart.type)&&e.plotOptions.bar.horizontal,t.chartClass=".apexcharts"+t.cuid,t.dom.baseEl=this.el,t.dom.elWrap=document.createElement("div"),p.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:"apexcharts-canvas "+t.chartClass.substring(1)}),this.el.appendChild(t.dom.elWrap),t.dom.Paper=new window.SVG.Doc(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(e.chart.offsetX,", ").concat(e.chart.offsetY,")")}),t.dom.Paper.node.style.background=e.chart.background,this.setSVGDimensions(),t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elAnnotations=t.dom.Paper.group().attr({class:"apexcharts-annotations"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}},{key:"plotChartType",value:function(t,e){var i=this.w,a=i.config,s=i.globals,r={series:[],i:[]},n={series:[],i:[]},o={series:[],i:[]},l={series:[],i:[]},h={series:[],i:[]},c={series:[],i:[]};s.series.map((function(e,d){void 0!==t[d].type?("column"===t[d].type||"bar"===t[d].type?(s.series.length>1&&a.plotOptions.bar.horizontal&&console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"),h.series.push(e),h.i.push(d),i.globals.columnSeries=h.series):"area"===t[d].type?(n.series.push(e),n.i.push(d)):"line"===t[d].type?(r.series.push(e),r.i.push(d)):"scatter"===t[d].type?(o.series.push(e),o.i.push(d)):"bubble"===t[d].type?(l.series.push(e),l.i.push(d)):"candlestick"===t[d].type?(c.series.push(e),c.i.push(d)):console.warn("You have specified an unrecognized chart type. Available types for this propery are line/area/column/bar/scatter/bubble"),s.comboCharts=!0):(r.series.push(e),r.i.push(d))}));var d=new Lt(this.ctx,e),g=new vt(this.ctx,e);this.ctx.pie=new kt(this.ctx);var u=new St(this.ctx),f=new F(this.ctx,e),p=new At(this.ctx),x=[];if(s.comboCharts){if(n.series.length>0&&x.push(d.draw(n.series,"area",n.i)),h.series.length>0)if(i.config.chart.stacked){var b=new mt(this.ctx,e);x.push(b.draw(h.series,h.i))}else{var m=new X(this.ctx,e);x.push(m.draw(h.series,h.i))}if(r.series.length>0&&x.push(d.draw(r.series,"line",r.i)),c.series.length>0&&x.push(g.draw(c.series,c.i)),o.series.length>0){var v=new Lt(this.ctx,e,!0);x.push(v.draw(o.series,"scatter",o.i))}if(l.series.length>0){var y=new Lt(this.ctx,e,!0);x.push(y.draw(l.series,"bubble",l.i))}}else switch(a.chart.type){case"line":x=d.draw(s.series,"line");break;case"area":x=d.draw(s.series,"area");break;case"bar":x=a.chart.stacked?new mt(this.ctx,e).draw(s.series):new X(this.ctx,e).draw(s.series);break;case"candlestick":x=new vt(this.ctx,e).draw(s.series);break;case"rangeBar":x=f.draw(s.series);break;case"heatmap":x=new yt(this.ctx,e).draw(s.series);break;case"pie":case"donut":case"polarArea":x=this.ctx.pie.draw(s.series);break;case"radialBar":x=u.draw(s.series);break;case"radar":x=p.draw(s.series);break;default:x=d.draw(s.series)}return x}},{key:"setSVGDimensions",value:function(){var t=this.w.globals,e=this.w.config;t.svgWidth=e.chart.width,t.svgHeight=e.chart.height;var i=g.getDimensions(this.el),a=e.chart.width.toString().split(/[0-9]+/g).pop();if("%"===a?g.isNumber(i[0])&&(0===i[0].width&&(i=g.getDimensions(this.el.parentNode)),t.svgWidth=i[0]*parseInt(e.chart.width,10)/100):"px"!==a&&""!==a||(t.svgWidth=parseInt(e.chart.width,10)),"auto"!==t.svgHeight&&""!==t.svgHeight)if("%"===e.chart.height.toString().split(/[0-9]+/g).pop()){var s=g.getDimensions(this.el.parentNode);t.svgHeight=s[1]*parseInt(e.chart.height,10)/100}else t.svgHeight=parseInt(e.chart.height,10);else t.axisCharts?t.svgHeight=t.svgWidth/1.61:t.svgHeight=t.svgWidth/1.2;t.svgWidth<0&&(t.svgWidth=0),t.svgHeight<0&&(t.svgHeight=0),p.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight});var r=e.chart.sparkline.enabled?0:t.axisCharts?e.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight=t.svgHeight+r+"px",t.dom.elWrap.style.width=t.svgWidth+"px",t.dom.elWrap.style.height=t.svgHeight+"px"}},{key:"shiftGraphPosition",value:function(){var t=this.w.globals,e=t.translateY,i={transform:"translate("+t.translateX+", "+e+")"};p.setAttrs(t.dom.elGraphical.node,i)}},{key:"resizeNonAxisCharts",value:function(){var t=this.w,e=t.globals,i=0,a=t.config.chart.sparkline.enabled?1:15;a+=t.config.grid.padding.bottom,"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||!t.config.legend.show||t.config.legend.floating||(i=new lt(this.ctx).legendHelpers.getLegendBBox().clwh+10);var s=t.globals.dom.baseEl.querySelector(".apexcharts-radialbar"),r=2.05*t.globals.radialSize;if(s&&!t.config.chart.sparkline.enabled){var n=g.getBoundingClientRect(s);r=n.bottom;var o=n.bottom-n.top;r=Math.max(2.05*t.globals.radialSize,o)}var l=r+e.translateY+i+a;e.dom.elLegendForeign&&e.dom.elLegendForeign.setAttribute("height",l),e.dom.elWrap.style.height=l+"px",p.setAttrs(e.dom.Paper.node,{height:l}),e.dom.Paper.node.parentNode.parentNode.style.minHeight=l+"px"}},{key:"coreCalculations",value:function(){new U(this.ctx).init()}},{key:"resetGlobals",value:function(){var t=this,e=function(){return t.w.config.series.map((function(t){return[]}))},i=new H,a=this.w.globals;i.initGlobalVars(a),a.seriesXvalues=e(),a.seriesYvalues=e()}},{key:"isMultipleY",value:function(){if(this.w.config.yaxis.constructor===Array&&this.w.config.yaxis.length>1)return this.w.globals.isMultipleYAxis=!0,!0}},{key:"xySettings",value:function(){var t=null,e=this.w;if(e.globals.axisCharts){if("back"===e.config.xaxis.crosshairs.position&&new Q(this.ctx).drawXCrosshairs(),"back"===e.config.yaxis[0].crosshairs.position&&new Q(this.ctx).drawYCrosshairs(),"datetime"===e.config.xaxis.type&&void 0===e.config.xaxis.labels.formatter){var i=new Pt(this.ctx),a=[];isFinite(e.globals.minX)&&isFinite(e.globals.maxX)&&!e.globals.isBarHorizontal?a=i.calculateTimeScaleTicks(e.globals.minX,e.globals.maxX):e.globals.isBarHorizontal&&(a=i.calculateTimeScaleTicks(e.globals.minY,e.globals.maxY)),i.recalcDimensionsBasedOnFormat(a)}t=new m(this.ctx).getCalculatedRatios()}return t}},{key:"updateSourceChart",value:function(t){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var t=this,e=this.w;if(e.config.chart.brush.enabled&&"function"!=typeof e.config.chart.events.selection){var i=e.config.chart.brush.targets||[e.config.chart.brush.target];i.forEach((function(e){var i=ApexCharts.getChartByID(e);i.w.globals.brushSource=t.ctx,"function"!=typeof i.w.config.chart.events.zoomed&&(i.w.config.chart.events.zoomed=function(){t.updateSourceChart(i)}),"function"!=typeof i.w.config.chart.events.scrolled&&(i.w.config.chart.events.scrolled=function(){t.updateSourceChart(i)})})),e.config.chart.events.selection=function(t,a){i.forEach((function(t){var i=ApexCharts.getChartByID(t),s=g.clone(e.config.yaxis);if(e.config.chart.brush.autoScaleYaxis&&1===i.w.globals.series.length){var r=new j(i);s=r.autoScaleY(i,s,a)}var o=i.w.config.yaxis.reduce((function(t,e,a){return[].concat(d(t),[n({},i.w.config.yaxis[a],{min:s[0].min,max:s[0].max})])}),[]);i.ctx.updateHelpers._updateOptions({xaxis:{min:a.xaxis.min,max:a.xaxis.max},yaxis:o},!1,!1,!1,!1)}))}}}}]),t}(),zt=function(){function i(t){e(this,i),this.ctx=t,this.w=t.w}return a(i,[{key:"_updateOptions",value:function(e){var i=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[this.ctx];r&&(o=this.ctx.getSyncedCharts()),this.ctx.w.globals.isExecCalled&&(o=[this.ctx],this.ctx.w.globals.isExecCalled=!1),o.forEach((function(r){var o=r.w;return o.globals.shouldAnimate=s,a||(o.globals.resized=!0,o.globals.dataChanged=!0,s&&r.series.getPreviousPaths()),e&&"object"===t(e)&&(r.config=new D(e),e=m.extendArrayProps(r.config,e,o),r.w.globals.chartID!==i.ctx.w.globals.chartID&&delete e.series,o.config=g.extend(o.config,e),n&&(o.globals.lastXAxis=[],o.globals.lastYAxis=[],o.globals.initialConfig=g.extend({},o.config),o.globals.initialSeries=JSON.parse(JSON.stringify(o.config.series)))),r.update(e)}))}},{key:"_updateSeries",value:function(t,e){var i,a=this,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.w;return r.globals.shouldAnimate=e,r.globals.dataChanged=!0,e&&this.ctx.series.getPreviousPaths(),r.globals.axisCharts?(0===(i=t.map((function(t,e){return a._extendSeries(t,e)}))).length&&(i=[{data:[]}]),r.config.series=i):r.config.series=t.slice(),s&&(r.globals.initialConfig.series=JSON.parse(JSON.stringify(r.config.series)),r.globals.initialSeries=JSON.parse(JSON.stringify(r.config.series))),this.ctx.update()}},{key:"_extendSeries",value:function(t,e){var i=this.w;return n({},i.config.series[e],{name:t.name?t.name:i.config.series[e]&&i.config.series[e].name,type:t.type?t.type:i.config.series[e]&&i.config.series[e].type,data:t.data?t.data:i.config.series[e]&&i.config.series[e].data})}},{key:"toggleDataPointSelection",value:function(t,e){var i=this.w,a=null,s=".apexcharts-series[data\\:realIndex='".concat(t,"']");return i.globals.axisCharts?a=i.globals.dom.Paper.select("".concat(s," path[j='").concat(e,"'], ").concat(s," circle[j='").concat(e,"'], ").concat(s," rect[j='").concat(e,"']")).members[0]:void 0===e&&(a=i.globals.dom.Paper.select("".concat(s," path[j='").concat(t,"']")).members[0],"pie"!==i.config.chart.type&&"polarArea"!==i.config.chart.type&&"donut"!==i.config.chart.type||this.ctx.pie.pieClicked(t)),a?(new p(this.ctx).pathMouseDown(a,null),a.node?a.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(t){var e=this.w;if(["min","max"].forEach((function(i){void 0!==t.xaxis[i]&&(e.config.xaxis[i]=t.xaxis[i],e.globals.lastXAxis[i]=t.xaxis[i])})),t.xaxis.categories&&t.xaxis.categories.length&&(e.config.xaxis.categories=t.xaxis.categories),e.config.xaxis.convertedCatToNumeric){var i=new R(t);t=i.convertCatToNumericXaxis(t,this.ctx)}return t}},{key:"forceYAxisUpdate",value:function(t){var e=this.w;return e.config.chart.stacked&&"100%"===e.config.chart.stackType&&(Array.isArray(t.yaxis)?t.yaxis.forEach((function(e,i){t.yaxis[i].min=0,t.yaxis[i].max=100})):(t.yaxis.min=0,t.yaxis.max=100)),t}},{key:"revertDefaultAxisMinMax",value:function(){var t=this,e=this.w;e.config.xaxis.min=e.globals.lastXAxis.min,e.config.xaxis.max=e.globals.lastXAxis.max,e.config.yaxis.map((function(i,a){e.globals.zoomed?void 0!==e.globals.lastYAxis[a]&&(i.min=e.globals.lastYAxis[a].min,i.max=e.globals.lastYAxis[a].max):void 0!==t.ctx.opts.yaxis[a]&&(i.min=t.ctx.opts.yaxis[a].min,i.max=t.ctx.opts.yaxis[a].max)}))}}]),i}();w="undefined"!=typeof window?window:void 0,k=function(e,i){var a=(void 0!==this?this:e).SVG=function(t){if(a.supported)return t=new a.Doc(t),a.parser.draw||a.prepare(),t};if(a.ns="http://www.w3.org/2000/svg",a.xmlns="http://www.w3.org/2000/xmlns/",a.xlink="http://www.w3.org/1999/xlink",a.svgjs="http://svgjs.com/svgjs",a.supported=!0,!a.supported)return!1;a.did=1e3,a.eid=function(t){return"Svgjs"+d(t)+a.did++},a.create=function(t){var e=i.createElementNS(this.ns,t);return e.setAttribute("id",this.eid(t)),e},a.extend=function(){var t,e;e=(t=[].slice.call(arguments)).pop();for(var i=t.length-1;i>=0;i--)if(t[i])for(var s in e)t[i].prototype[s]=e[s];a.Set&&a.Set.inherit&&a.Set.inherit()},a.invent=function(t){var e="function"==typeof t.create?t.create:function(){this.constructor.call(this,a.create(t.create))};return t.inherit&&(e.prototype=new t.inherit),t.extend&&a.extend(e,t.extend),t.construct&&a.extend(t.parent||a.Container,t.construct),e},a.adopt=function(t){return t?t.instance?t.instance:((i="svg"==t.nodeName?t.parentNode instanceof e.SVGElement?new a.Nested:new a.Doc:"linearGradient"==t.nodeName?new a.Gradient("linear"):"radialGradient"==t.nodeName?new a.Gradient("radial"):a[d(t.nodeName)]?new(a[d(t.nodeName)]):new a.Element(t)).type=t.nodeName,i.node=t,t.instance=i,i instanceof a.Doc&&i.namespace().defs(),i.setData(JSON.parse(t.getAttribute("svgjs:data"))||{}),i):null;var i},a.prepare=function(){var t=i.getElementsByTagName("body")[0],e=(t?new a.Doc(t):a.adopt(i.documentElement).nested()).size(2,0);a.parser={body:t||i.documentElement,draw:e.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node,poly:e.polyline().node,path:e.path().node,native:a.create("svg")}},a.parser={native:a.create("svg")},i.addEventListener("DOMContentLoaded",(function(){a.parser.draw||a.prepare()}),!1),a.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},a.utils={map:function(t,e){for(var i=t.length,a=[],s=0;s<i;s++)a.push(e(t[s]));return a},filter:function(t,e){for(var i=t.length,a=[],s=0;s<i;s++)e(t[s])&&a.push(t[s]);return a},filterSVGElements:function(t){return this.filter(t,(function(t){return t instanceof e.SVGElement}))}},a.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},a.Color=function(e){var i,s;this.r=0,this.g=0,this.b=0,e&&("string"==typeof e?a.regex.isRgb.test(e)?(i=a.regex.rgb.exec(e.replace(a.regex.whitespace,"")),this.r=parseInt(i[1]),this.g=parseInt(i[2]),this.b=parseInt(i[3])):a.regex.isHex.test(e)&&(i=a.regex.hex.exec(4==(s=e).length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s),this.r=parseInt(i[1],16),this.g=parseInt(i[2],16),this.b=parseInt(i[3],16)):"object"===t(e)&&(this.r=e.r,this.g=e.g,this.b=e.b))},a.extend(a.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+g(this.r)+g(this.g)+g(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(t){return this.destination=new a.Color(t),this},at:function(t){return this.destination?(t=t<0?0:t>1?1:t,new a.Color({r:~~(this.r+(this.destination.r-this.r)*t),g:~~(this.g+(this.destination.g-this.g)*t),b:~~(this.b+(this.destination.b-this.b)*t)})):this}}),a.Color.test=function(t){return t+="",a.regex.isHex.test(t)||a.regex.isRgb.test(t)},a.Color.isRgb=function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b},a.Color.isColor=function(t){return a.Color.isRgb(t)||a.Color.test(t)},a.Array=function(t,e){0==(t=(t||[]).valueOf()).length&&e&&(t=e.valueOf()),this.value=this.parse(t)},a.extend(a.Array,{toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(t){return t=t.valueOf(),Array.isArray(t)?t:this.split(t)}}),a.PointArray=function(t,e){a.Array.call(this,t,e||[[0,0]])},a.PointArray.prototype=new a.Array,a.PointArray.prototype.constructor=a.PointArray;for(var s={M:function(t,e,i){return e.x=i.x=t[0],e.y=i.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},Z:function(t,e,i){return e.x=i.x,e.y=i.y,["Z"]}},r="mlhvqtcsaz".split(""),n=0,o=r.length;n<o;++n)s[r[n]]=function(t){return function(e,i,a){if("H"==t)e[0]=e[0]+i.x;else if("V"==t)e[0]=e[0]+i.y;else if("A"==t)e[5]=e[5]+i.x,e[6]=e[6]+i.y;else for(var r=0,n=e.length;r<n;++r)e[r]=e[r]+(r%2?i.y:i.x);return s[t](e,i,a)}}(r[n].toUpperCase());a.PathArray=function(t,e){a.Array.call(this,t,e||[["M",0,0]])},a.PathArray.prototype=new a.Array,a.PathArray.prototype.constructor=a.PathArray,a.extend(a.PathArray,{toString:function(){return function(t){for(var e=0,i=t.length,a="";e<i;e++)a+=t[e][0],null!=t[e][1]&&(a+=t[e][1],null!=t[e][2]&&(a+=" ",a+=t[e][2],null!=t[e][3]&&(a+=" ",a+=t[e][3],a+=" ",a+=t[e][4],null!=t[e][5]&&(a+=" ",a+=t[e][5],a+=" ",a+=t[e][6],null!=t[e][7]&&(a+=" ",a+=t[e][7])))));return a+" "}(this.value)},move:function(t,e){var i=this.bbox();return i.x,i.y,this},at:function(t){if(!this.destination)return this;for(var e=this.value,i=this.destination.value,s=[],r=new a.PathArray,n=0,o=e.length;n<o;n++){s[n]=[e[n][0]];for(var l=1,h=e[n].length;l<h;l++)s[n][l]=e[n][l]+(i[n][l]-e[n][l])*t;"A"===s[n][0]&&(s[n][4]=+(0!=s[n][4]),s[n][5]=+(0!=s[n][5]))}return r.value=s,r},parse:function(t){if(t instanceof a.PathArray)return t.valueOf();var e,i={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};t="string"==typeof t?t.replace(a.regex.numbersWithDots,h).replace(a.regex.pathLetters," $& ").replace(a.regex.hyphen,"$1 -").trim().split(a.regex.delimiter):t.reduce((function(t,e){return[].concat.call(t,e)}),[]);var r=[],n=new a.Point,o=new a.Point,l=0,c=t.length;do{a.regex.isPathLetter.test(t[l])?(e=t[l],++l):"M"==e?e="L":"m"==e&&(e="l"),r.push(s[e].call(null,t.slice(l,l+=i[e.toUpperCase()]).map(parseFloat),n,o))}while(c>l);return r},bbox:function(){return a.parser.draw||a.prepare(),a.parser.path.setAttribute("d",this.toString()),a.parser.path.getBBox()}}),a.Number=a.invent({create:function(t,e){this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(a.regex.numberAndUnit))&&(this.value=parseFloat(e[1]),"%"==e[5]?this.value/=100:"s"==e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof a.Number&&(this.value=t.valueOf(),this.unit=t.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(t){return t=new a.Number(t),new a.Number(this+t,this.unit||t.unit)},minus:function(t){return t=new a.Number(t),new a.Number(this-t,this.unit||t.unit)},times:function(t){return t=new a.Number(t),new a.Number(this*t,this.unit||t.unit)},divide:function(t){return t=new a.Number(t),new a.Number(this/t,this.unit||t.unit)},to:function(t){var e=new a.Number(this);return"string"==typeof t&&(e.unit=t),e},morph:function(t){return this.destination=new a.Number(t),t.relative&&(this.destination.value+=this.value),this},at:function(t){return this.destination?new a.Number(this.destination).minus(this).times(t).plus(this):this}}}),a.Element=a.invent({create:function(t){this._stroke=a.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=t)&&(this.type=t.nodeName,this.node.instance=this,this._stroke=t.getAttribute("stroke")||this._stroke)},extend:{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var i=u(this,t,e);return this.width(new a.Number(i.width)).height(new a.Number(i.height))},clone:function(t){this.writeDataToDom();var e=x(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(t){return this.after(t).remove(),t},addTo:function(t){return t.put(this)},putIn:function(t){return t.add(this)},id:function(t){return this.attr("id",t)},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return"none"!=this.style("display")},toString:function(){return this.attr("id")},classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(a.regex.delimiter)},hasClass:function(t){return-1!=this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!=t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)},reference:function(t){return a.get(this.attr(t))},parent:function(t){var i=this;if(!i.node.parentNode)return null;if(i=a.adopt(i.node.parentNode),!t)return i;for(;i&&i.node instanceof e.SVGElement;){if("string"==typeof t?i.matches(t):i instanceof t)return i;if(!i.node.parentNode||"#document"==i.node.parentNode.nodeName)return null;i=a.adopt(i.node.parentNode)}},doc:function(){return this instanceof a.Doc?this:this.parent(a.Doc)},parents:function(t){var e=[],i=this;do{if(!(i=i.parent(t))||!i.node)break;e.push(i)}while(i.parent);return e},matches:function(t){return function(t,e){return(t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector).call(t,e)}(this.node,t)},native:function(){return this.node},svg:function(t){var e=i.createElement("svg");if(!(t&&this instanceof a.Parent))return e.appendChild(t=i.createElement("svg")),this.writeDataToDom(),t.appendChild(this.node.cloneNode(!0)),e.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");e.innerHTML="<svg>"+t.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var s=0,r=e.firstChild.childNodes.length;s<r;s++)this.node.appendChild(e.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each((function(){this.writeDataToDom()})),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(t){return this.dom=t,this},is:function(t){return function(t,e){return t instanceof e}(this,t)}}}),a.easing={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)}},a.morph=function(t){return function(e,i){return new a.MorphObj(e,i).at(t)}},a.Situation=a.invent({create:function(t){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new a.Number(t.duration).valueOf(),this.delay=new a.Number(t.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=t.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),a.FX=a.invent({create:function(t){this._target=t,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(e,i,s){"object"===t(e)&&(i=e.ease,s=e.delay,e=e.duration);var r=new a.Situation({duration:e||1e3,delay:s||0,ease:a.easing[i||"-"]||i});return this.queue(r),this},target:function(t){return t&&t instanceof a.Element?(this._target=t,this):this._target},timeToAbsPos:function(t){return(t-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(t){return this.situation.duration/this._speed*t+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=e.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){e.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(t){return("function"==typeof t||t instanceof a.Situation)&&this.situations.push(t),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof a.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var t,e=this.situation;if(e.init)return this;for(var i in e.animations){t=this.target()[i](),Array.isArray(t)||(t=[t]),Array.isArray(e.animations[i])||(e.animations[i]=[e.animations[i]]);for(var s=t.length;s--;)e.animations[i][s]instanceof a.Number&&(t[s]=new a.Number(t[s])),e.animations[i][s]=t[s].morph(e.animations[i][s])}for(var i in e.attrs)e.attrs[i]=new a.MorphObj(this.target().attr(i),e.attrs[i]);for(var i in e.styles)e.styles[i]=new a.MorphObj(this.target().style(i),e.styles[i]);return e.initialTransformation=this.target().matrixify(),e.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(t,e){var i=this.active;return this.active=!1,e&&this.clearQueue(),t&&this.situation&&(!i&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},after:function(t){var e=this.last();return this.target().on("finished.fx",(function i(a){a.detail.situation==e&&(t.call(this,e),this.off("finished.fx",i))})),this._callStart()},during:function(t){var e=this.last(),i=function(i){i.detail.situation==e&&t.call(this,i.detail.pos,a.morph(i.detail.pos),i.detail.eased,e)};return this.target().off("during.fx",i).on("during.fx",i),this.after((function(){this.off("during.fx",i)})),this._callStart()},afterAll:function(t){var e=function e(i){t.call(this),this.off("allfinished.fx",e)};return this.target().off("allfinished.fx",e).on("allfinished.fx",e),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(t,e,i){return this.last()[i||"animations"][t]=e,this._callStart()},step:function(t){var e,i,a;t||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops?(e=Math.max(this.absPos,0),i=Math.floor(e),!0===this.situation.loops||i<this.situation.loops?(this.pos=e-i,a=this.situation.loop,this.situation.loop=i):(this.absPos=this.situation.loops,this.pos=1,a=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=Boolean((this.situation.loop-a)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var s=this.situation.ease(this.pos);for(var r in this.situation.once)r>this.lastPos&&r<=s&&(this.situation.once[r].call(this.target(),this.pos,s),delete this.situation.once[r]);return this.active&&this.target().fire("during",{pos:this.pos,eased:s,fx:this,situation:this.situation}),this.situation?(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=s,this):this},eachAt:function(){var t,e=this,i=this.target(),s=this.situation;for(var r in s.animations)t=[].concat(s.animations[r]).map((function(t){return"string"!=typeof t&&t.at?t.at(s.ease(e.pos),e.pos):t})),i[r].apply(i,t);for(var r in s.attrs)t=[r].concat(s.attrs[r]).map((function(t){return"string"!=typeof t&&t.at?t.at(s.ease(e.pos),e.pos):t})),i.attr.apply(i,t);for(var r in s.styles)t=[r].concat(s.styles[r]).map((function(t){return"string"!=typeof t&&t.at?t.at(s.ease(e.pos),e.pos):t})),i.style.apply(i,t);if(s.transforms.length){t=s.initialTransformation,r=0;for(var n=s.transforms.length;r<n;r++){var o=s.transforms[r];o instanceof a.Matrix?t=o.relative?t.multiply((new a.Matrix).morph(o).at(s.ease(this.pos))):t.morph(o).at(s.ease(this.pos)):(o.relative||o.undo(t.extract()),t=t.multiply(o.at(s.ease(this.pos))))}i.matrix(t)}return this},once:function(t,e,i){var a=this.last();return i||(t=a.ease(t)),a.once[t]=e,this},_callStart:function(){return setTimeout(function(){this.start()}.bind(this),0),this}},parent:a.Element,construct:{animate:function(t,e,i){return(this.fx||(this.fx=new a.FX(this))).animate(t,e,i)},delay:function(t){return(this.fx||(this.fx=new a.FX(this))).delay(t)},stop:function(t,e){return this.fx&&this.fx.stop(t,e),this},finish:function(){return this.fx&&this.fx.finish(),this}}}),a.MorphObj=a.invent({create:function(t,e){return a.Color.isColor(e)?new a.Color(t).morph(e):a.regex.delimiter.test(t)?a.regex.pathLetters.test(t)?new a.PathArray(t).morph(e):new a.Array(t).morph(e):a.regex.numberAndUnit.test(e)?new a.Number(t).morph(e):(this.value=t,void(this.destination=e))},extend:{at:function(t,e){return e<1?this.value:this.destination},valueOf:function(){return this.value}}}),a.extend(a.FX,{attr:function(e,i,a){if("object"===t(e))for(var s in e)this.attr(s,e[s]);else this.add(e,i,"attrs");return this},plot:function(t,e,i,a){return 4==arguments.length?this.plot([t,e,i,a]):this.add("plot",new(this.target().morphArray)(t))}}),a.Box=a.invent({create:function(e,i,s,r){if(!("object"!==t(e)||e instanceof a.Element))return a.Box.call(this,null!=e.left?e.left:e.x,null!=e.top?e.top:e.y,e.width,e.height);4==arguments.length&&(this.x=e,this.y=i,this.width=s,this.height=r),b(this)}}),a.BBox=a.invent({create:function(t){if(a.Box.apply(this,[].slice.call(arguments)),t instanceof a.Element){var e;try{if(!i.documentElement.contains){for(var s=t.node;s.parentNode;)s=s.parentNode;if(s!=i)throw new Error("Element not in the dom")}e=t.node.getBBox()}catch(i){if(t instanceof a.Shape){a.parser.draw||a.prepare();var r=t.clone(a.parser.draw.instance).show();e=r.node.getBBox(),r.remove()}else e={x:t.node.clientLeft,y:t.node.clientTop,width:t.node.clientWidth,height:t.node.clientHeight}}a.Box.call(this,e)}},inherit:a.Box,parent:a.Element,construct:{bbox:function(){return new a.BBox(this)}}}),a.BBox.prototype.constructor=a.BBox,a.Matrix=a.invent({create:function(e){var i=p([1,0,0,1,0,0]);e=e instanceof a.Element?e.matrixify():"string"==typeof e?p(e.split(a.regex.delimiter).map(parseFloat)):6==arguments.length?p([].slice.call(arguments)):Array.isArray(e)?p(e):"object"===t(e)?e:i;for(var s=v.length-1;s>=0;--s)this[v[s]]=null!=e[v[s]]?e[v[s]]:i[v[s]]},extend:{extract:function(){var t=f(this,0,1),e=(f(this,1,0),180/Math.PI*Math.atan2(t.y,t.x)-90);return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(e*Math.PI/180)+this.f*Math.sin(e*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(e*Math.PI/180)+this.e*Math.sin(-e*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),rotation:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new a.Matrix(this)}},clone:function(){return new a.Matrix(this)},morph:function(t){return this.destination=new a.Matrix(t),this},multiply:function(t){return new a.Matrix(this.native().multiply(function(t){return t instanceof a.Matrix||(t=new a.Matrix(t)),t}(t).native()))},inverse:function(){return new a.Matrix(this.native().inverse())},translate:function(t,e){return new a.Matrix(this.native().translate(t||0,e||0))},native:function(){for(var t=a.parser.native.createSVGMatrix(),e=v.length-1;e>=0;e--)t[v[e]]=this[v[e]];return t},toString:function(){return"matrix("+m(this.a)+","+m(this.b)+","+m(this.c)+","+m(this.d)+","+m(this.e)+","+m(this.f)+")"}},parent:a.Element,construct:{ctm:function(){return new a.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof a.Nested){var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new a.Matrix(e)}return new a.Matrix(this.node.getScreenCTM())}}}),a.Point=a.invent({create:function(e,i){var a;a=Array.isArray(e)?{x:e[0],y:e[1]}:"object"===t(e)?{x:e.x,y:e.y}:null!=e?{x:e,y:null!=i?i:e}:{x:0,y:0},this.x=a.x,this.y=a.y},extend:{clone:function(){return new a.Point(this)},morph:function(t,e){return this.destination=new a.Point(t,e),this}}}),a.extend(a.Element,{point:function(t,e){return new a.Point(t,e).transform(this.screenCTM().inverse())}}),a.extend(a.Element,{attr:function(e,i,s){if(null==e){for(e={},s=(i=this.node.attributes).length-1;s>=0;s--)e[i[s].nodeName]=a.regex.isNumber.test(i[s].nodeValue)?parseFloat(i[s].nodeValue):i[s].nodeValue;return e}if("object"===t(e))for(var r in e)this.attr(r,e[r]);else if(null===i)this.node.removeAttribute(e);else{if(null==i)return null==(i=this.node.getAttribute(e))?a.defaults.attrs[e]:a.regex.isNumber.test(i)?parseFloat(i):i;"stroke-width"==e?this.attr("stroke",parseFloat(i)>0?this._stroke:null):"stroke"==e&&(this._stroke=i),"fill"!=e&&"stroke"!=e||(a.regex.isImage.test(i)&&(i=this.doc().defs().image(i,0,0)),i instanceof a.Image&&(i=this.doc().defs().pattern(0,0,(function(){this.add(i)})))),"number"==typeof i?i=new a.Number(i):a.Color.isColor(i)?i=new a.Color(i):Array.isArray(i)&&(i=new a.Array(i)),"leading"==e?this.leading&&this.leading(i):"string"==typeof s?this.node.setAttributeNS(s,e,i.toString()):this.node.setAttribute(e,i.toString()),!this.rebuild||"font-size"!=e&&"x"!=e||this.rebuild(e,i)}return this}}),a.extend(a.Element,{transform:function(e,i){var s;return"object"!==t(e)?(s=new a.Matrix(this).extract(),"string"==typeof e?s[e]:s):(s=new a.Matrix(this),i=!!i||!!e.relative,null!=e.a&&(s=i?s.multiply(new a.Matrix(e)):new a.Matrix(e)),this.attr("transform",s))}}),a.extend(a.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(a.regex.transforms).slice(0,-1).map((function(t){var e=t.trim().split("(");return[e[0],e[1].split(a.regex.delimiter).map((function(t){return parseFloat(t)}))]})).reduce((function(t,e){return"matrix"==e[0]?t.multiply(p(e[1])):t[e[0]].apply(t,e[1])}),new a.Matrix)},toParent:function(t){if(this==t)return this;var e=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t).untransform().transform(i.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())}}),a.Transformation=a.invent({create:function(e,i){if(arguments.length>1&&"boolean"!=typeof i)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(e))for(var a=0,s=this.arguments.length;a<s;++a)this[this.arguments[a]]=e[a];else if("object"===t(e))for(a=0,s=this.arguments.length;a<s;++a)this[this.arguments[a]]=e[this.arguments[a]];this.inversed=!1,!0===i&&(this.inversed=!0)}}),a.Translate=a.invent({parent:a.Matrix,inherit:a.Transformation,create:function(t,e){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),a.extend(a.Element,{style:function(e,i){if(0==arguments.length)return this.node.style.cssText||"";if(arguments.length<2)if("object"===t(e))for(var s in e)this.style(s,e[s]);else{if(!a.regex.isCss.test(e))return this.node.style[c(e)];for(e=e.split(/\s*;\s*/).filter((function(t){return!!t})).map((function(t){return t.split(/\s*:\s*/)}));i=e.pop();)this.style(i[0],i[1])}else this.node.style[c(e)]=null===i||a.regex.isBlank.test(i)?"":i;return this}}),a.Parent=a.invent({create:function(t){this.constructor.call(this,t)},inherit:a.Element,extend:{children:function(){return a.utils.map(a.utils.filterSVGElements(this.node.childNodes),(function(t){return a.adopt(t)}))},add:function(t,e){return null==e?this.node.appendChild(t.node):t.node!=this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this},put:function(t,e){return this.add(t,e),t},has:function(t){return this.index(t)>=0},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return a.adopt(this.node.childNodes[t])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(t,e){for(var i=this.children(),s=0,r=i.length;s<r;s++)i[s]instanceof a.Element&&t.apply(i[s],[s,i]),e&&i[s]instanceof a.Container&&i[s].each(t,e);return this},removeElement:function(t){return this.node.removeChild(t.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),a.extend(a.Parent,{ungroup:function(t,e){return 0===e||this instanceof a.Defs||this.node==a.parser.draw?this:(t=t||(this instanceof a.Doc?this:this.parent(a.Parent)),e=e||1/0,this.each((function(){return this instanceof a.Defs?this:this instanceof a.Parent?this.ungroup(t,e-1):this.toParent(t)})),this.node.firstChild||this.remove(),this)},flatten:function(t,e){return this.ungroup(t,e)}}),a.Container=a.invent({create:function(t){this.constructor.call(this,t)},inherit:a.Parent}),a.ViewBox=a.invent({parent:a.Container,construct:{}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach((function(t){a.Element.prototype[t]=function(e){return a.on(this.node,t,e),this}})),a.listeners=[],a.handlerMap=[],a.listenerId=0,a.on=function(t,e,i,s,r){var n=i.bind(s||t.instance||t),o=(a.handlerMap.indexOf(t)+1||a.handlerMap.push(t))-1,l=e.split(".")[0],h=e.split(".")[1]||"*";a.listeners[o]=a.listeners[o]||{},a.listeners[o][l]=a.listeners[o][l]||{},a.listeners[o][l][h]=a.listeners[o][l][h]||{},i._svgjsListenerId||(i._svgjsListenerId=++a.listenerId),a.listeners[o][l][h][i._svgjsListenerId]=n,t.addEventListener(l,n,r||!1)},a.off=function(t,e,i){var s=a.handlerMap.indexOf(t),r=e&&e.split(".")[0],n=e&&e.split(".")[1],o="";if(-1!=s)if(i){if("function"==typeof i&&(i=i._svgjsListenerId),!i)return;a.listeners[s][r]&&a.listeners[s][r][n||"*"]&&(t.removeEventListener(r,a.listeners[s][r][n||"*"][i],!1),delete a.listeners[s][r][n||"*"][i])}else if(n&&r){if(a.listeners[s][r]&&a.listeners[s][r][n]){for(var l in a.listeners[s][r][n])a.off(t,[r,n].join("."),l);delete a.listeners[s][r][n]}}else if(n)for(var h in a.listeners[s])for(var o in a.listeners[s][h])n===o&&a.off(t,[h,n].join("."));else if(r){if(a.listeners[s][r]){for(var o in a.listeners[s][r])a.off(t,[r,o].join("."));delete a.listeners[s][r]}}else{for(var h in a.listeners[s])a.off(t,h);delete a.listeners[s],delete a.handlerMap[s]}},a.extend(a.Element,{on:function(t,e,i,s){return a.on(this.node,t,e,i,s),this},off:function(t,e){return a.off(this.node,t,e),this},fire:function(t,i){return t instanceof e.Event?this.node.dispatchEvent(t):this.node.dispatchEvent(t=new a.CustomEvent(t,{detail:i,cancelable:!0})),this._event=t,this},event:function(){return this._event}}),a.Defs=a.invent({create:"defs",inherit:a.Container}),a.G=a.invent({create:"g",inherit:a.Container,extend:{x:function(t){return null==t?this.transform("x"):this.transform({x:t-this.x()},!0)}},construct:{group:function(){return this.put(new a.G)}}}),a.Doc=a.invent({create:function(t){t&&("svg"==(t="string"==typeof t?i.getElementById(t):t).nodeName?this.constructor.call(this,t):(this.constructor.call(this,a.create("svg")),t.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:a.Container,extend:{namespace:function(){return this.attr({xmlns:a.ns,version:"1.1"}).attr("xmlns:xlink",a.xlink,a.xmlns).attr("xmlns:svgjs",a.svgjs,a.xmlns)},defs:function(){var t;return this._defs||((t=this.node.getElementsByTagName("defs")[0])?this._defs=a.adopt(t):this._defs=new a.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName?this.node.parentNode:null},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,a.parser.draw&&!a.parser.draw.parentNode&&this.node.appendChild(a.parser.draw),this},clone:function(t){this.writeDataToDom();var e=this.node,i=x(e.cloneNode(!0));return t?(t.node||t).appendChild(i.node):e.parentNode.insertBefore(i.node,e.nextSibling),i}}}),a.extend(a.Element,{}),a.Gradient=a.invent({create:function(t){this.constructor.call(this,a.create(t+"Gradient")),this.type=t},inherit:a.Container,extend:{at:function(t,e,i){return this.put(new a.Stop).update(t,e,i)},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(t,e,i){return"transform"==t&&(t="gradientTransform"),a.Container.prototype.attr.call(this,t,e,i)}},construct:{gradient:function(t,e){return this.defs().gradient(t,e)}}}),a.extend(a.Gradient,a.FX,{from:function(t,e){return"radial"==(this._target||this).type?this.attr({fx:new a.Number(t),fy:new a.Number(e)}):this.attr({x1:new a.Number(t),y1:new a.Number(e)})},to:function(t,e){return"radial"==(this._target||this).type?this.attr({cx:new a.Number(t),cy:new a.Number(e)}):this.attr({x2:new a.Number(t),y2:new a.Number(e)})}}),a.extend(a.Defs,{gradient:function(t,e){return this.put(new a.Gradient(t)).update(e)}}),a.Stop=a.invent({create:"stop",inherit:a.Element,extend:{update:function(t){return("number"==typeof t||t instanceof a.Number)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new a.Number(t.offset)),this}}}),a.Pattern=a.invent({create:"pattern",inherit:a.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},toString:function(){return this.fill()},attr:function(t,e,i){return"transform"==t&&(t="patternTransform"),a.Container.prototype.attr.call(this,t,e,i)}},construct:{pattern:function(t,e,i){return this.defs().pattern(t,e,i)}}}),a.extend(a.Defs,{pattern:function(t,e,i){return this.put(new a.Pattern).update(i).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}}),a.Shape=a.invent({create:function(t){this.constructor.call(this,t)},inherit:a.Element}),a.Symbol=a.invent({create:"symbol",inherit:a.Container,construct:{symbol:function(){return this.put(new a.Symbol)}}}),a.Use=a.invent({create:"use",inherit:a.Shape,extend:{element:function(t,e){return this.attr("href",(e||"")+"#"+t,a.xlink)}},construct:{use:function(t,e){return this.put(new a.Use).element(t,e)}}}),a.Rect=a.invent({create:"rect",inherit:a.Shape,construct:{rect:function(t,e){return this.put(new a.Rect).size(t,e)}}}),a.Circle=a.invent({create:"circle",inherit:a.Shape,construct:{circle:function(t){return this.put(new a.Circle).rx(new a.Number(t).divide(2)).move(0,0)}}}),a.extend(a.Circle,a.FX,{rx:function(t){return this.attr("r",t)},ry:function(t){return this.rx(t)}}),a.Ellipse=a.invent({create:"ellipse",inherit:a.Shape,construct:{ellipse:function(t,e){return this.put(new a.Ellipse).size(t,e).move(0,0)}}}),a.extend(a.Ellipse,a.Rect,a.FX,{rx:function(t){return this.attr("rx",t)},ry:function(t){return this.attr("ry",t)}}),a.extend(a.Circle,a.Ellipse,{x:function(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())},y:function(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())},cx:function(t){return null==t?this.attr("cx"):this.attr("cx",t)},cy:function(t){return null==t?this.attr("cy"):this.attr("cy",t)},width:function(t){return null==t?2*this.rx():this.rx(new a.Number(t).divide(2))},height:function(t){return null==t?2*this.ry():this.ry(new a.Number(t).divide(2))},size:function(t,e){var i=u(this,t,e);return this.rx(new a.Number(i.width).divide(2)).ry(new a.Number(i.height).divide(2))}}),a.Line=a.invent({create:"line",inherit:a.Shape,extend:{array:function(){return new a.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(t,e,i,s){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:i,y2:s}:new a.PointArray(t).toLine(),this.attr(t))},move:function(t,e){return this.attr(this.array().move(t,e).toLine())},size:function(t,e){var i=u(this,t,e);return this.attr(this.array().size(i.width,i.height).toLine())}},construct:{line:function(t,e,i,s){return a.Line.prototype.plot.apply(this.put(new a.Line),null!=t?[t,e,i,s]:[0,0,0,0])}}}),a.Polyline=a.invent({create:"polyline",inherit:a.Shape,construct:{polyline:function(t){return this.put(new a.Polyline).plot(t||new a.PointArray)}}}),a.Polygon=a.invent({create:"polygon",inherit:a.Shape,construct:{polygon:function(t){return this.put(new a.Polygon).plot(t||new a.PointArray)}}}),a.extend(a.Polyline,a.Polygon,{array:function(){return this._array||(this._array=new a.PointArray(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new a.PointArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var i=u(this,t,e);return this.attr("points",this.array().size(i.width,i.height))}}),a.extend(a.Line,a.Polyline,a.Polygon,{morphArray:a.PointArray,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}}),a.Path=a.invent({create:"path",inherit:a.Shape,extend:{morphArray:a.PathArray,array:function(){return this._array||(this._array=new a.PathArray(this.attr("d")))},plot:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new a.PathArray(t))},clear:function(){return delete this._array,this}},construct:{path:function(t){return this.put(new a.Path).plot(t||new a.PathArray)}}}),a.Image=a.invent({create:"image",inherit:a.Shape,extend:{load:function(t){if(!t)return this;var i=this,s=new e.Image;return a.on(s,"load",(function(){a.off(s);var e=i.parent(a.Pattern);null!==e&&(0==i.width()&&0==i.height()&&i.size(s.width,s.height),e&&0==e.width()&&0==e.height()&&e.size(i.width(),i.height()),"function"==typeof i._loaded&&i._loaded.call(i,{width:s.width,height:s.height,ratio:s.width/s.height,url:t}))})),a.on(s,"error",(function(t){a.off(s),"function"==typeof i._error&&i._error.call(i,t)})),this.attr("href",s.src=this.src=t,a.xlink)},loaded:function(t){return this._loaded=t,this},error:function(t){return this._error=t,this}},construct:{image:function(t,e,i){return this.put(new a.Image).load(t).size(e||0,i||e||0)}}}),a.Text=a.invent({create:function(){this.constructor.call(this,a.create("text")),this.dom.leading=new a.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",a.defaults.attrs["font-family"])},inherit:a.Shape,extend:{x:function(t){return null==t?this.attr("x"):this.attr("x",t)},text:function(t){if(void 0===t){t="";for(var e=this.node.childNodes,i=0,s=e.length;i<s;++i)0!=i&&3!=e[i].nodeType&&1==a.adopt(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent;return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else{i=0;for(var r=(t=t.split("\n")).length;i<r;i++)this.tspan(t[i]).newLine()}return this.build(!1).rebuild()},size:function(t){return this.attr("font-size",t).rebuild()},leading:function(t){return null==t?this.dom.leading:(this.dom.leading=new a.Number(t),this.rebuild())},lines:function(){var t=(this.textPath&&this.textPath()||this).node,e=a.utils.map(a.utils.filterSVGElements(t.childNodes),(function(t){return a.adopt(t)}));return new a.Set(e)},rebuild:function(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){var e=this,i=0,s=this.dom.leading*new a.Number(this.attr("font-size"));this.lines().each((function(){this.dom.newLined&&(e.textPath()||this.attr("x",e.attr("x")),"\n"==this.text()?i+=s:(this.attr("dy",s+i),i=0))})),this.fire("rebuild")}return this},build:function(t){return this._build=!!t,this},setData:function(t){return this.dom=t,this.dom.leading=new a.Number(t.leading||1.3),this}},construct:{text:function(t){return this.put(new a.Text).text(t)},plain:function(t){return this.put(new a.Text).plain(t)}}}),a.Tspan=a.invent({create:"tspan",inherit:a.Shape,extend:{text:function(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)},dx:function(t){return this.attr("dx",t)},dy:function(t){return this.attr("dy",t)},newLine:function(){var t=this.parent(a.Text);return this.dom.newLined=!0,this.dy(t.dom.leading*t.attr("font-size")).attr("x",t.x())}}}),a.extend(a.Text,a.Tspan,{plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(i.createTextNode(t)),this},tspan:function(t){var e=(this.textPath&&this.textPath()||this).node,i=new a.Tspan;return!1===this._build&&this.clear(),e.appendChild(i.node),i.text(t)},clear:function(){for(var t=(this.textPath&&this.textPath()||this).node;t.hasChildNodes();)t.removeChild(t.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),a.TextPath=a.invent({create:"textPath",inherit:a.Parent,parent:a.Text,construct:{morphArray:a.PathArray,array:function(){var t=this.track();return t?t.array():null},plot:function(t){var e=this.track(),i=null;return e&&(i=e.plot(t)),null==t?i:this},track:function(){var t=this.textPath();if(t)return t.reference("href")},textPath:function(){if(this.node.firstChild&&"textPath"==this.node.firstChild.nodeName)return a.adopt(this.node.firstChild)}}}),a.Nested=a.invent({create:function(){this.constructor.call(this,a.create("svg")),this.style("overflow","visible")},inherit:a.Container,construct:{nested:function(){return this.put(new a.Nested)}}});var l={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"==e?t:t+"-"+e}};function h(t,e,i,s){return i+s.replace(a.regex.dots," .")}function c(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function d(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t){var e=t.toString(16);return 1==e.length?"0"+e:e}function u(t,e,i){if(null==e||null==i){var a=t.bbox();null==e?e=a.width/a.height*i:null==i&&(i=a.height/a.width*e)}return{width:e,height:i}}function f(t,e,i){return{x:e*t.a+i*t.c+0,y:e*t.b+i*t.d+0}}function p(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}function x(t){for(var i=t.childNodes.length-1;i>=0;i--)t.childNodes[i]instanceof e.SVGElement&&x(t.childNodes[i]);return a.adopt(t).id(a.eid(t.nodeName))}function b(t){return null==t.x&&(t.x=0,t.y=0,t.width=0,t.height=0),t.w=t.width,t.h=t.height,t.x2=t.x+t.width,t.y2=t.y+t.height,t.cx=t.x+t.width/2,t.cy=t.y+t.height/2,t}function m(t){return Math.abs(t)>1e-37?t:0}["fill","stroke"].forEach((function(t){var e={};e[t]=function(e){if(void 0===e)return this;if("string"==typeof e||a.Color.isRgb(e)||e&&"function"==typeof e.fill)this.attr(t,e);else for(var i=l[t].length-1;i>=0;i--)null!=e[l[t][i]]&&this.attr(l.prefix(t,l[t][i]),e[l[t][i]]);return this},a.extend(a.Element,a.FX,e)})),a.extend(a.Element,a.FX,{translate:function(t,e){return this.transform({x:t,y:e})},matrix:function(t){return this.attr("transform",new a.Matrix(6==arguments.length?[].slice.call(arguments):t))},opacity:function(t){return this.attr("opacity",t)},dx:function(t){return this.x(new a.Number(t).plus(this instanceof a.FX?0:this.x()),!0)},dy:function(t){return this.y(new a.Number(t).plus(this instanceof a.FX?0:this.y()),!0)}}),a.extend(a.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(t){return this.node.getPointAtLength(t)}}),a.Set=a.invent({create:function(t){Array.isArray(t)?this.members=t:this.clear()},extend:{add:function(){for(var t=[].slice.call(arguments),e=0,i=t.length;e<i;e++)this.members.push(t[e]);return this},remove:function(t){var e=this.index(t);return e>-1&&this.members.splice(e,1),this},each:function(t){for(var e=0,i=this.members.length;e<i;e++)t.apply(this.members[e],[e,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(t){return this.index(t)>=0},index:function(t){return this.members.indexOf(t)},get:function(t){return this.members[t]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members}},construct:{set:function(t){return new a.Set(t)}}}),a.FX.Set=a.invent({create:function(t){this.set=t}}),a.Set.inherit=function(){var t=[];for(var e in a.Shape.prototype)"function"==typeof a.Shape.prototype[e]&&"function"!=typeof a.Set.prototype[e]&&t.push(e);for(var e in t.forEach((function(t){a.Set.prototype[t]=function(){for(var e=0,i=this.members.length;e<i;e++)this.members[e]&&"function"==typeof this.members[e][t]&&this.members[e][t].apply(this.members[e],arguments);return"animate"==t?this.fx||(this.fx=new a.FX.Set(this)):this}})),t=[],a.FX.prototype)"function"==typeof a.FX.prototype[e]&&"function"!=typeof a.FX.Set.prototype[e]&&t.push(e);t.forEach((function(t){a.FX.Set.prototype[t]=function(){for(var e=0,i=this.set.members.length;e<i;e++)this.set.members[e].fx[t].apply(this.set.members[e].fx,arguments);return this}}))},a.extend(a.Element,{}),a.extend(a.Element,{remember:function(e,i){if("object"===t(arguments[0]))for(var a in e)this.remember(a,e[a]);else{if(1==arguments.length)return this.memory()[e];this.memory()[e]=i}return this},forget:function(){if(0==arguments.length)this._memory={};else for(var t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory||(this._memory={})}}),a.get=function(t){var e=i.getElementById(function(t){var e=(t||"").toString().match(a.regex.reference);if(e)return e[1]}(t)||t);return a.adopt(e)},a.select=function(t,e){return new a.Set(a.utils.map((e||i).querySelectorAll(t),(function(t){return a.adopt(t)})))},a.extend(a.Parent,{select:function(t){return a.select(t,this.node)}});var v="abcdef".split("");if("function"!=typeof e.CustomEvent){var y=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var a=i.createEvent("CustomEvent");return a.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),a};y.prototype=e.Event.prototype,a.CustomEvent=y}else a.CustomEvent=e.CustomEvent;return a},"function"==typeof define&&define.amd?define((function(){return k(w,w.document)})):"object"===("undefined"==typeof exports?"undefined":t(exports))&&"undefined"!=typeof module?module.exports=w.document?k(w,w.document):function(t){return k(t,t.document)}:w.SVG=k(w,w.document),
|
||
/*! svg.filter.js - v2.0.2 - 2016-02-24
|
||
* https://github.com/wout/svg.filter.js
|
||
* Copyright (c) 2016 Wout Fierens; Licensed MIT */
|
||
function(){SVG.Filter=SVG.invent({create:"filter",inherit:SVG.Parent,extend:{source:"SourceGraphic",sourceAlpha:"SourceAlpha",background:"BackgroundImage",backgroundAlpha:"BackgroundAlpha",fill:"FillPaint",stroke:"StrokePaint",autoSetIn:!0,put:function(t,e){return this.add(t,e),!t.attr("in")&&this.autoSetIn&&t.attr("in",this.source),t.attr("result")||t.attr("result",t),t},blend:function(t,e,i){return this.put(new SVG.BlendEffect(t,e,i))},colorMatrix:function(t,e){return this.put(new SVG.ColorMatrixEffect(t,e))},convolveMatrix:function(t){return this.put(new SVG.ConvolveMatrixEffect(t))},componentTransfer:function(t){return this.put(new SVG.ComponentTransferEffect(t))},composite:function(t,e,i){return this.put(new SVG.CompositeEffect(t,e,i))},flood:function(t,e){return this.put(new SVG.FloodEffect(t,e))},offset:function(t,e){return this.put(new SVG.OffsetEffect(t,e))},image:function(t){return this.put(new SVG.ImageEffect(t))},merge:function(){var t=[void 0];for(var e in arguments)t.push(arguments[e]);return this.put(new(SVG.MergeEffect.bind.apply(SVG.MergeEffect,t)))},gaussianBlur:function(t,e){return this.put(new SVG.GaussianBlurEffect(t,e))},morphology:function(t,e){return this.put(new SVG.MorphologyEffect(t,e))},diffuseLighting:function(t,e,i){return this.put(new SVG.DiffuseLightingEffect(t,e,i))},displacementMap:function(t,e,i,a,s){return this.put(new SVG.DisplacementMapEffect(t,e,i,a,s))},specularLighting:function(t,e,i,a){return this.put(new SVG.SpecularLightingEffect(t,e,i,a))},tile:function(){return this.put(new SVG.TileEffect)},turbulence:function(t,e,i,a,s){return this.put(new SVG.TurbulenceEffect(t,e,i,a,s))},toString:function(){return"url(#"+this.attr("id")+")"}}}),SVG.extend(SVG.Defs,{filter:function(t){var e=this.put(new SVG.Filter);return"function"==typeof t&&t.call(e,e),e}}),SVG.extend(SVG.Container,{filter:function(t){return this.defs().filter(t)}}),SVG.extend(SVG.Element,SVG.G,SVG.Nested,{filter:function(t){return this.filterer=t instanceof SVG.Element?t:this.doc().filter(t),this.doc()&&this.filterer.doc()!==this.doc()&&this.doc().defs().add(this.filterer),this.attr("filter",this.filterer),this.filterer},unfilter:function(t){return this.filterer&&!0===t&&this.filterer.remove(),delete this.filterer,this.attr("filter",null)}}),SVG.Effect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(t){return null==t?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",t)},result:function(t){return null==t?this.attr("result"):this.attr("result",t)},toString:function(){return this.result()}}}),SVG.ParentEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Parent,extend:{in:function(t){return null==t?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",t)},result:function(t){return null==t?this.attr("result"):this.attr("result",t)},toString:function(){return this.result()}}});var t={blend:function(t,e){return this.parent()&&this.parent().blend(this,t,e)},colorMatrix:function(t,e){return this.parent()&&this.parent().colorMatrix(t,e).in(this)},convolveMatrix:function(t){return this.parent()&&this.parent().convolveMatrix(t).in(this)},componentTransfer:function(t){return this.parent()&&this.parent().componentTransfer(t).in(this)},composite:function(t,e){return this.parent()&&this.parent().composite(this,t,e)},flood:function(t,e){return this.parent()&&this.parent().flood(t,e)},offset:function(t,e){return this.parent()&&this.parent().offset(t,e).in(this)},image:function(t){return this.parent()&&this.parent().image(t)},merge:function(){return this.parent()&&this.parent().merge.apply(this.parent(),[this].concat(arguments))},gaussianBlur:function(t,e){return this.parent()&&this.parent().gaussianBlur(t,e).in(this)},morphology:function(t,e){return this.parent()&&this.parent().morphology(t,e).in(this)},diffuseLighting:function(t,e,i){return this.parent()&&this.parent().diffuseLighting(t,e,i).in(this)},displacementMap:function(t,e,i,a){return this.parent()&&this.parent().displacementMap(this,t,e,i,a)},specularLighting:function(t,e,i,a){return this.parent()&&this.parent().specularLighting(t,e,i,a).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(t,e,i,a,s){return this.parent()&&this.parent().turbulence(t,e,i,a,s).in(this)}};SVG.extend(SVG.Effect,t),SVG.extend(SVG.ParentEffect,t),SVG.ChildEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(t){this.attr("in",t)}}});var e={blend:function(t,e,i){this.attr({in:t,in2:e,mode:i||"normal"})},colorMatrix:function(t,e){"matrix"==t&&(e=s(e)),this.attr({type:t,values:void 0===e?null:e})},convolveMatrix:function(t){t=s(t),this.attr({order:Math.sqrt(t.split(" ").length),kernelMatrix:t})},composite:function(t,e,i){this.attr({in:t,in2:e,operator:i})},flood:function(t,e){this.attr("flood-color",t),null!=e&&this.attr("flood-opacity",e)},offset:function(t,e){this.attr({dx:t,dy:e})},image:function(t){this.attr("href",t,SVG.xlink)},displacementMap:function(t,e,i,a,s){this.attr({in:t,in2:e,scale:i,xChannelSelector:a,yChannelSelector:s})},gaussianBlur:function(t,e){null!=t||null!=e?this.attr("stdDeviation",r(Array.prototype.slice.call(arguments))):this.attr("stdDeviation","0 0")},morphology:function(t,e){this.attr({operator:t,radius:e})},tile:function(){},turbulence:function(t,e,i,a,s){this.attr({numOctaves:e,seed:i,stitchTiles:a,baseFrequency:t,type:s})}},i={merge:function(){var t;if(arguments[0]instanceof SVG.Set){var e=this;arguments[0].each((function(t){this instanceof SVG.MergeNode?e.put(this):(this instanceof SVG.Effect||this instanceof SVG.ParentEffect)&&e.put(new SVG.MergeNode(this))}))}else{t=Array.isArray(arguments[0])?arguments[0]:arguments;for(var i=0;i<t.length;i++)t[i]instanceof SVG.MergeNode?this.put(t[i]):this.put(new SVG.MergeNode(t[i]))}},componentTransfer:function(t){if(this.rgb=new SVG.Set,["r","g","b","a"].forEach(function(t){this[t]=new(SVG["Func"+t.toUpperCase()])("identity"),this.rgb.add(this[t]),this.node.appendChild(this[t].node)}.bind(this)),t)for(var e in t.rgb&&(["r","g","b"].forEach(function(e){this[e].attr(t.rgb)}.bind(this)),delete t.rgb),t)this[e].attr(t[e])},diffuseLighting:function(t,e,i){this.attr({surfaceScale:t,diffuseConstant:e,kernelUnitLength:i})},specularLighting:function(t,e,i,a){this.attr({surfaceScale:t,diffuseConstant:e,specularExponent:i,kernelUnitLength:a})}},a={distantLight:function(t,e){this.attr({azimuth:t,elevation:e})},pointLight:function(t,e,i){this.attr({x:t,y:e,z:i})},spotLight:function(t,e,i,a,s,r){this.attr({x:t,y:e,z:i,pointsAtX:a,pointsAtY:s,pointsAtZ:r})},mergeNode:function(t){this.attr("in",t)}};function s(t){return Array.isArray(t)&&(t=new SVG.Array(t)),t.toString().replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ")}function r(t){if(!Array.isArray(t))return t;for(var e=0,i=t.length,a=[];e<i;e++)a.push(t[e]);return a.join(" ")}function n(){var t=function(){};for(var e in"function"==typeof arguments[arguments.length-1]&&(t=arguments[arguments.length-1],Array.prototype.splice.call(arguments,arguments.length-1,1)),arguments)for(var i in arguments[e])t(arguments[e][i],i,arguments[e])}["r","g","b","a"].forEach((function(t){a["Func"+t.toUpperCase()]=function(t){switch(this.attr("type",t),t){case"table":this.attr("tableValues",arguments[1]);break;case"linear":this.attr("slope",arguments[1]),this.attr("intercept",arguments[2]);break;case"gamma":this.attr("amplitude",arguments[1]),this.attr("exponent",arguments[2]),this.attr("offset",arguments[2])}}})),n(e,(function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+i)),t.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.Effect,extend:{}})})),n(i,(function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+i)),t.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.ParentEffect,extend:{}})})),n(a,(function(t,e){var i=e.charAt(0).toUpperCase()+e.slice(1);SVG[i]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+i)),t.apply(this,arguments)},inherit:SVG.ChildEffect,extend:{}})})),SVG.extend(SVG.MergeEffect,{in:function(t){return t instanceof SVG.MergeNode?this.add(t,0):this.add(new SVG.MergeNode(t),0),this}}),SVG.extend(SVG.CompositeEffect,SVG.BlendEffect,SVG.DisplacementMapEffect,{in2:function(t){return null==t?this.parent()&&this.parent().select('[result="'+this.attr("in2")+'"]').get(0)||this.attr("in2"):this.attr("in2",t)}}),SVG.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]}}.call(void 0),function(){function t(t,s,r,n,o,l,h){for(var c=t.slice(s,r||h),d=n.slice(o,l||h),g=0,u={pos:[0,0],start:[0,0]},f={pos:[0,0],start:[0,0]};c[g]=e.call(u,c[g]),d[g]=e.call(f,d[g]),c[g][0]!=d[g][0]||"M"==c[g][0]||"A"==c[g][0]&&(c[g][4]!=d[g][4]||c[g][5]!=d[g][5])?(Array.prototype.splice.apply(c,[g,1].concat(a.call(u,c[g]))),Array.prototype.splice.apply(d,[g,1].concat(a.call(f,d[g])))):(c[g]=i.call(u,c[g]),d[g]=i.call(f,d[g])),++g!=c.length||g!=d.length;)g==c.length&&c.push(["C",u.pos[0],u.pos[1],u.pos[0],u.pos[1],u.pos[0],u.pos[1]]),g==d.length&&d.push(["C",f.pos[0],f.pos[1],f.pos[0],f.pos[1],f.pos[0],f.pos[1]]);return{start:c,dest:d}}function e(t){switch(t[0]){case"z":case"Z":t[0]="L",t[1]=this.start[0],t[2]=this.start[1];break;case"H":t[0]="L",t[2]=this.pos[1];break;case"V":t[0]="L",t[2]=t[1],t[1]=this.pos[0];break;case"T":t[0]="Q",t[3]=t[1],t[4]=t[2],t[1]=this.reflection[1],t[2]=this.reflection[0];break;case"S":t[0]="C",t[6]=t[4],t[5]=t[3],t[4]=t[2],t[3]=t[1],t[2]=this.reflection[1],t[1]=this.reflection[0]}return t}function i(t){var e=t.length;return this.pos=[t[e-2],t[e-1]],-1!="SCQT".indexOf(t[0])&&(this.reflection=[2*this.pos[0]-t[e-4],2*this.pos[1]-t[e-3]]),t}function a(t){var e=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],e;case"L":t[5]=t[3]=t[1],t[6]=t[4]=t[2],t[1]=this.pos[0],t[2]=this.pos[1];break;case"Q":t[6]=t[4],t[5]=t[3],t[4]=1*t[4]/3+2*t[2]/3,t[3]=1*t[3]/3+2*t[1]/3,t[2]=1*this.pos[1]/3+2*t[2]/3,t[1]=1*this.pos[0]/3+2*t[1]/3;break;case"A":t=(e=function(t,e){var i,a,s,r,n,o,l,h,c,d,g,u,f,p,x,b,m,v,y,w,k,A,S,C,L,P,T=Math.abs(e[1]),z=Math.abs(e[2]),I=e[3]%360,M=e[4],E=e[5],X=e[6],Y=e[7],F=new SVG.Point(t),R=new SVG.Point(X,Y),D=[];if(0===T||0===z||F.x===R.x&&F.y===R.y)return[["C",F.x,F.y,R.x,R.y,R.x,R.y]];for((a=(i=new SVG.Point((F.x-R.x)/2,(F.y-R.y)/2).transform((new SVG.Matrix).rotate(I))).x*i.x/(T*T)+i.y*i.y/(z*z))>1&&(T*=a=Math.sqrt(a),z*=a),s=(new SVG.Matrix).rotate(I).scale(1/T,1/z).rotate(-I),F=F.transform(s),o=(r=[(R=R.transform(s)).x-F.x,R.y-F.y])[0]*r[0]+r[1]*r[1],n=Math.sqrt(o),r[0]/=n,r[1]/=n,l=o<4?Math.sqrt(1-o/4):0,M===E&&(l*=-1),h=new SVG.Point((R.x+F.x)/2+l*-r[1],(R.y+F.y)/2+l*r[0]),c=new SVG.Point(F.x-h.x,F.y-h.y),d=new SVG.Point(R.x-h.x,R.y-h.y),g=Math.acos(c.x/Math.sqrt(c.x*c.x+c.y*c.y)),c.y<0&&(g*=-1),u=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(u*=-1),E&&g>u&&(u+=2*Math.PI),!E&&g<u&&(u-=2*Math.PI),b=[],m=g,f=(u-g)/(p=Math.ceil(2*Math.abs(g-u)/Math.PI)),x=4*Math.tan(f/4)/3,k=0;k<=p;k++)y=Math.cos(m),v=Math.sin(m),w=new SVG.Point(h.x+y,h.y+v),b[k]=[new SVG.Point(w.x+x*v,w.y-x*y),w,new SVG.Point(w.x-x*v,w.y+x*y)],m+=f;for(b[0][0]=b[0][1].clone(),b[b.length-1][2]=b[b.length-1][1].clone(),s=(new SVG.Matrix).rotate(I).scale(T,z).rotate(-I),k=0,A=b.length;k<A;k++)b[k][0]=b[k][0].transform(s),b[k][1]=b[k][1].transform(s),b[k][2]=b[k][2].transform(s);for(k=1,A=b.length;k<A;k++)S=(w=b[k-1][2]).x,C=w.y,L=(w=b[k][0]).x,P=w.y,X=(w=b[k][1]).x,Y=w.y,D.push(["C",S,C,L,P,X,Y]);return D}(this.pos,t))[0]}return t[0]="C",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],e}function s(t,e){if(!1===e)return!1;for(var i=e,a=t.length;i<a;++i)if("M"==t[i][0])return i;return!1}SVG.extend(SVG.PathArray,{morph:function(e){for(var i=this.value,a=this.parse(e),r=0,n=0,o=!1,l=!1;!1!==r||!1!==n;){var h;o=s(i,!1!==r&&r+1),l=s(a,!1!==n&&n+1),!1===r&&(r=0==(h=new SVG.PathArray(c.start).bbox()).height||0==h.width?i.push(i[0])-1:i.push(["M",h.x+h.width/2,h.y+h.height/2])-1),!1===n&&(n=0==(h=new SVG.PathArray(c.dest).bbox()).height||0==h.width?a.push(a[0])-1:a.push(["M",h.x+h.width/2,h.y+h.height/2])-1);var c=t(i,r,o,a,n,l);i=i.slice(0,r).concat(c.start,!1===o?[]:i.slice(o)),a=a.slice(0,n).concat(c.dest,!1===l?[]:a.slice(l)),r=!1!==o&&r+c.start.length,n=!1!==l&&n+c.dest.length}return this.value=i,this.destination=new SVG.PathArray,this.destination.value=a,this}})}(),
|
||
/*! svg.draggable.js - v2.2.2 - 2019-01-08
|
||
* https://github.com/svgdotjs/svg.draggable.js
|
||
* Copyright (c) 2019 Wout Fierens; Licensed MIT */
|
||
function(){function t(t){t.remember("_draggable",this),this.el=t}t.prototype.init=function(t,e){var i=this;this.constraint=t,this.value=e,this.el.on("mousedown.drag",(function(t){i.start(t)})),this.el.on("touchstart.drag",(function(t){i.start(t)}))},t.prototype.transformPoint=function(t,e){var i=(t=t||window.event).changedTouches&&t.changedTouches[0]||t;return this.p.x=i.clientX-(e||0),this.p.y=i.clientY,this.p.matrixTransform(this.m)},t.prototype.getBBox=function(){var t=this.el.bbox();return this.el instanceof SVG.Nested&&(t=this.el.rbox()),(this.el instanceof SVG.G||this.el instanceof SVG.Use||this.el instanceof SVG.Nested)&&(t.x=this.el.x(),t.y=this.el.y()),t},t.prototype.start=function(t){if("click"!=t.type&&"mousedown"!=t.type&&"mousemove"!=t.type||1==(t.which||t.buttons)){var e=this;if(this.el.fire("beforedrag",{event:t,handler:this}),!this.el.event().defaultPrevented){t.preventDefault(),t.stopPropagation(),this.parent=this.parent||this.el.parent(SVG.Nested)||this.el.parent(SVG.Doc),this.p=this.parent.node.createSVGPoint(),this.m=this.el.node.getScreenCTM().inverse();var i,a=this.getBBox();if(this.el instanceof SVG.Text)switch(i=this.el.node.getComputedTextLength(),this.el.attr("text-anchor")){case"middle":i/=2;break;case"start":i=0}this.startPoints={point:this.transformPoint(t,i),box:a,transform:this.el.transform()},SVG.on(window,"mousemove.drag",(function(t){e.drag(t)})),SVG.on(window,"touchmove.drag",(function(t){e.drag(t)})),SVG.on(window,"mouseup.drag",(function(t){e.end(t)})),SVG.on(window,"touchend.drag",(function(t){e.end(t)})),this.el.fire("dragstart",{event:t,p:this.startPoints.point,m:this.m,handler:this})}}},t.prototype.drag=function(t){var e=this.getBBox(),i=this.transformPoint(t),a=this.startPoints.box.x+i.x-this.startPoints.point.x,s=this.startPoints.box.y+i.y-this.startPoints.point.y,r=this.constraint,n=i.x-this.startPoints.point.x,o=i.y-this.startPoints.point.y;if(this.el.fire("dragmove",{event:t,p:i,m:this.m,handler:this}),this.el.event().defaultPrevented)return i;if("function"==typeof r){var l=r.call(this.el,a,s,this.m);"boolean"==typeof l&&(l={x:l,y:l}),!0===l.x?this.el.x(a):!1!==l.x&&this.el.x(l.x),!0===l.y?this.el.y(s):!1!==l.y&&this.el.y(l.y)}else"object"==typeof r&&(null!=r.minX&&a<r.minX?n=(a=r.minX)-this.startPoints.box.x:null!=r.maxX&&a>r.maxX-e.width&&(n=(a=r.maxX-e.width)-this.startPoints.box.x),null!=r.minY&&s<r.minY?o=(s=r.minY)-this.startPoints.box.y:null!=r.maxY&&s>r.maxY-e.height&&(o=(s=r.maxY-e.height)-this.startPoints.box.y),null!=r.snapToGrid&&(a-=a%r.snapToGrid,s-=s%r.snapToGrid,n-=n%r.snapToGrid,o-=o%r.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:n,y:o},!0):this.el.move(a,s));return i},t.prototype.end=function(t){var e=this.drag(t);this.el.fire("dragend",{event:t,p:e,m:this.m,handler:this}),SVG.off(window,"mousemove.drag"),SVG.off(window,"touchmove.drag"),SVG.off(window,"mouseup.drag"),SVG.off(window,"touchend.drag")},SVG.extend(SVG.Element,{draggable:function(e,i){"function"!=typeof e&&"object"!=typeof e||(i=e,e=!0);var a=this.remember("_draggable")||new t(this);return(e=void 0===e||e)?a.init(i||{},e):(this.off("mousedown.drag"),this.off("touchstart.drag")),this}})}.call(void 0),function(){function t(t){this.el=t,t.remember("_selectHandler",this),this.pointSelection={isSelected:!1},this.rectSelection={isSelected:!1},this.pointsList={lt:[0,0],rt:["width",0],rb:["width","height"],lb:[0,"height"],t:["width",0],r:["width","height"],b:["width","height"],l:[0,"height"]},this.pointCoord=function(t,e,i){var a="string"!=typeof t?t:e[t];return i?a/2:a},this.pointCoords=function(t,e){var i=this.pointsList[t];return{x:this.pointCoord(i[0],e,"t"===t||"b"===t),y:this.pointCoord(i[1],e,"r"===t||"l"===t)}}}t.prototype.init=function(t,e){var i=this.el.bbox();this.options={};var a=this.el.selectize.defaults.points;for(var s in this.el.selectize.defaults)this.options[s]=this.el.selectize.defaults[s],void 0!==e[s]&&(this.options[s]=e[s]);var r=["points","pointsExclude"];for(var s in r){var n=this.options[r[s]];"string"==typeof n?n=n.length>0?n.split(/\s*,\s*/i):[]:"boolean"==typeof n&&"points"===r[s]&&(n=n?a:[]),this.options[r[s]]=n}this.options.points=[a,this.options.points].reduce((function(t,e){return t.filter((function(t){return e.indexOf(t)>-1}))})),this.options.points=[this.options.points,this.options.pointsExclude].reduce((function(t,e){return t.filter((function(t){return e.indexOf(t)<0}))})),this.parent=this.el.parent(),this.nested=this.nested||this.parent.group(),this.nested.matrix(new SVG.Matrix(this.el).translate(i.x,i.y)),this.options.deepSelect&&-1!==["line","polyline","polygon"].indexOf(this.el.type)?this.selectPoints(t):this.selectRect(t),this.observe(),this.cleanup()},t.prototype.selectPoints=function(t){return this.pointSelection.isSelected=t,this.pointSelection.set?this:(this.pointSelection.set=this.parent.set(),this.drawPoints(),this)},t.prototype.getPointArray=function(){var t=this.el.bbox();return this.el.array().valueOf().map((function(e){return[e[0]-t.x,e[1]-t.y]}))},t.prototype.drawPoints=function(){for(var t=this,e=this.getPointArray(),i=0,a=e.length;i<a;++i){var s=function(e){return function(i){(i=i||window.event).preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation();var a=i.pageX||i.touches[0].pageX,s=i.pageY||i.touches[0].pageY;t.el.fire("point",{x:a,y:s,i:e,event:i})}}(i),r=this.drawPoint(e[i][0],e[i][1]).addClass(this.options.classPoints).addClass(this.options.classPoints+"_point").on("touchstart",s).on("mousedown",s);this.pointSelection.set.add(r)}},t.prototype.drawPoint=function(t,e){var i=this.options.pointType;switch(i){case"circle":return this.drawCircle(t,e);case"rect":return this.drawRect(t,e);default:if("function"==typeof i)return i.call(this,t,e);throw new Error("Unknown "+i+" point type!")}},t.prototype.drawCircle=function(t,e){return this.nested.circle(this.options.pointSize).center(t,e)},t.prototype.drawRect=function(t,e){return this.nested.rect(this.options.pointSize,this.options.pointSize).center(t,e)},t.prototype.updatePointSelection=function(){var t=this.getPointArray();this.pointSelection.set.each((function(e){this.cx()===t[e][0]&&this.cy()===t[e][1]||this.center(t[e][0],t[e][1])}))},t.prototype.updateRectSelection=function(){var t=this,e=this.el.bbox();if(this.rectSelection.set.get(0).attr({width:e.width,height:e.height}),this.options.points.length&&this.options.points.map((function(i,a){var s=t.pointCoords(i,e);t.rectSelection.set.get(a+1).center(s.x,s.y)})),this.options.rotationPoint){var i=this.rectSelection.set.length();this.rectSelection.set.get(i-1).center(e.width/2,20)}},t.prototype.selectRect=function(t){var e=this,i=this.el.bbox();function a(t){return function(i){(i=i||window.event).preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation();var a=i.pageX||i.touches[0].pageX,s=i.pageY||i.touches[0].pageY;e.el.fire(t,{x:a,y:s,event:i})}}if(this.rectSelection.isSelected=t,this.rectSelection.set=this.rectSelection.set||this.parent.set(),this.rectSelection.set.get(0)||this.rectSelection.set.add(this.nested.rect(i.width,i.height).addClass(this.options.classRect)),this.options.points.length&&this.rectSelection.set.length()<2&&(this.options.points.map((function(t,s){var r=e.pointCoords(t,i),n=e.drawPoint(r.x,r.y).attr("class",e.options.classPoints+"_"+t).on("mousedown",a(t)).on("touchstart",a(t));e.rectSelection.set.add(n)})),this.rectSelection.set.each((function(){this.addClass(e.options.classPoints)}))),this.options.rotationPoint&&(this.options.points&&!this.rectSelection.set.get(9)||!this.options.points&&!this.rectSelection.set.get(1))){var s=function(t){(t=t||window.event).preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation();var i=t.pageX||t.touches[0].pageX,a=t.pageY||t.touches[0].pageY;e.el.fire("rot",{x:i,y:a,event:t})},r=this.drawPoint(i.width/2,20).attr("class",this.options.classPoints+"_rot").on("touchstart",s).on("mousedown",s);this.rectSelection.set.add(r)}},t.prototype.handler=function(){var t=this.el.bbox();this.nested.matrix(new SVG.Matrix(this.el).translate(t.x,t.y)),this.rectSelection.isSelected&&this.updateRectSelection(),this.pointSelection.isSelected&&this.updatePointSelection()},t.prototype.observe=function(){var t=this;if(MutationObserver)if(this.rectSelection.isSelected||this.pointSelection.isSelected)this.observerInst=this.observerInst||new MutationObserver((function(){t.handler()})),this.observerInst.observe(this.el.node,{attributes:!0});else try{this.observerInst.disconnect(),delete this.observerInst}catch(t){}else this.el.off("DOMAttrModified.select"),(this.rectSelection.isSelected||this.pointSelection.isSelected)&&this.el.on("DOMAttrModified.select",(function(){t.handler()}))},t.prototype.cleanup=function(){!this.rectSelection.isSelected&&this.rectSelection.set&&(this.rectSelection.set.each((function(){this.remove()})),this.rectSelection.set.clear(),delete this.rectSelection.set),!this.pointSelection.isSelected&&this.pointSelection.set&&(this.pointSelection.set.each((function(){this.remove()})),this.pointSelection.set.clear(),delete this.pointSelection.set),this.pointSelection.isSelected||this.rectSelection.isSelected||(this.nested.remove(),delete this.nested)},SVG.extend(SVG.Element,{selectize:function(e,i){return"object"==typeof e&&(i=e,e=!0),(this.remember("_selectHandler")||new t(this)).init(void 0===e||e,i||{}),this}}),SVG.Element.prototype.selectize.defaults={points:["lt","rt","rb","lb","t","r","b","l"],pointsExclude:[],classRect:"svg_select_boundingRect",classPoints:"svg_select_points",pointSize:7,rotationPoint:!0,deepSelect:!1,pointType:"circle"}}(),function(){(function(){function t(t){t.remember("_resizeHandler",this),this.el=t,this.parameters={},this.lastUpdateCall=null,this.p=t.doc().node.createSVGPoint()}t.prototype.transformPoint=function(t,e,i){return this.p.x=t-(this.offset.x-window.pageXOffset),this.p.y=e-(this.offset.y-window.pageYOffset),this.p.matrixTransform(i||this.m)},t.prototype._extractPosition=function(t){return{x:null!=t.clientX?t.clientX:t.touches[0].clientX,y:null!=t.clientY?t.clientY:t.touches[0].clientY}},t.prototype.init=function(t){var e=this;if(this.stop(),"stop"!==t){for(var i in this.options={},this.el.resize.defaults)this.options[i]=this.el.resize.defaults[i],void 0!==t[i]&&(this.options[i]=t[i]);this.el.on("lt.resize",(function(t){e.resize(t||window.event)})),this.el.on("rt.resize",(function(t){e.resize(t||window.event)})),this.el.on("rb.resize",(function(t){e.resize(t||window.event)})),this.el.on("lb.resize",(function(t){e.resize(t||window.event)})),this.el.on("t.resize",(function(t){e.resize(t||window.event)})),this.el.on("r.resize",(function(t){e.resize(t||window.event)})),this.el.on("b.resize",(function(t){e.resize(t||window.event)})),this.el.on("l.resize",(function(t){e.resize(t||window.event)})),this.el.on("rot.resize",(function(t){e.resize(t||window.event)})),this.el.on("point.resize",(function(t){e.resize(t||window.event)})),this.update()}},t.prototype.stop=function(){return this.el.off("lt.resize"),this.el.off("rt.resize"),this.el.off("rb.resize"),this.el.off("lb.resize"),this.el.off("t.resize"),this.el.off("r.resize"),this.el.off("b.resize"),this.el.off("l.resize"),this.el.off("rot.resize"),this.el.off("point.resize"),this},t.prototype.resize=function(t){var e=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset};var i=this._extractPosition(t.detail.event);if(this.parameters={type:this.el.type,p:this.transformPoint(i.x,i.y),x:t.detail.x,y:t.detail.y,box:this.el.bbox(),rotation:this.el.transform().rotation},"text"===this.el.type&&(this.parameters.fontSize=this.el.attr()["font-size"]),void 0!==t.detail.i){var a=this.el.array().valueOf();this.parameters.i=t.detail.i,this.parameters.pointCoords=[a[t.detail.i][0],a[t.detail.i][1]]}switch(t.type){case"lt":this.calc=function(t,e){var i=this.snapToGrid(t,e);if(this.parameters.box.width-i[0]>0&&this.parameters.box.height-i[1]>0){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x+i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-i[0]);i=this.checkAspectRatio(i),this.el.move(this.parameters.box.x+i[0],this.parameters.box.y+i[1]).size(this.parameters.box.width-i[0],this.parameters.box.height-i[1])}};break;case"rt":this.calc=function(t,e){var i=this.snapToGrid(t,e,2);if(this.parameters.box.width+i[0]>0&&this.parameters.box.height-i[1]>0){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x-i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+i[0]);i=this.checkAspectRatio(i,!0),this.el.move(this.parameters.box.x,this.parameters.box.y+i[1]).size(this.parameters.box.width+i[0],this.parameters.box.height-i[1])}};break;case"rb":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(this.parameters.box.width+i[0]>0&&this.parameters.box.height+i[1]>0){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x-i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+i[0]);i=this.checkAspectRatio(i),this.el.move(this.parameters.box.x,this.parameters.box.y).size(this.parameters.box.width+i[0],this.parameters.box.height+i[1])}};break;case"lb":this.calc=function(t,e){var i=this.snapToGrid(t,e,1);if(this.parameters.box.width-i[0]>0&&this.parameters.box.height+i[1]>0){if("text"===this.parameters.type)return this.el.move(this.parameters.box.x+i[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-i[0]);i=this.checkAspectRatio(i,!0),this.el.move(this.parameters.box.x+i[0],this.parameters.box.y).size(this.parameters.box.width-i[0],this.parameters.box.height+i[1])}};break;case"t":this.calc=function(t,e){var i=this.snapToGrid(t,e,2);if(this.parameters.box.height-i[1]>0){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y+i[1]).height(this.parameters.box.height-i[1])}};break;case"r":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(this.parameters.box.width+i[0]>0){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y).width(this.parameters.box.width+i[0])}};break;case"b":this.calc=function(t,e){var i=this.snapToGrid(t,e,0);if(this.parameters.box.height+i[1]>0){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x,this.parameters.box.y).height(this.parameters.box.height+i[1])}};break;case"l":this.calc=function(t,e){var i=this.snapToGrid(t,e,1);if(this.parameters.box.width-i[0]>0){if("text"===this.parameters.type)return;this.el.move(this.parameters.box.x+i[0],this.parameters.box.y).width(this.parameters.box.width-i[0])}};break;case"rot":this.calc=function(t,e){var i=t+this.parameters.p.x,a=e+this.parameters.p.y,s=Math.atan2(this.parameters.p.y-this.parameters.box.y-this.parameters.box.height/2,this.parameters.p.x-this.parameters.box.x-this.parameters.box.width/2),r=Math.atan2(a-this.parameters.box.y-this.parameters.box.height/2,i-this.parameters.box.x-this.parameters.box.width/2),n=this.parameters.rotation+180*(r-s)/Math.PI+this.options.snapToAngle/2;this.el.center(this.parameters.box.cx,this.parameters.box.cy).rotate(n-n%this.options.snapToAngle,this.parameters.box.cx,this.parameters.box.cy)};break;case"point":this.calc=function(t,e){var i=this.snapToGrid(t,e,this.parameters.pointCoords[0],this.parameters.pointCoords[1]),a=this.el.array().valueOf();a[this.parameters.i][0]=this.parameters.pointCoords[0]+i[0],a[this.parameters.i][1]=this.parameters.pointCoords[1]+i[1],this.el.plot(a)}}this.el.fire("resizestart",{dx:this.parameters.x,dy:this.parameters.y,event:t}),SVG.on(window,"touchmove.resize",(function(t){e.update(t||window.event)})),SVG.on(window,"touchend.resize",(function(){e.done()})),SVG.on(window,"mousemove.resize",(function(t){e.update(t||window.event)})),SVG.on(window,"mouseup.resize",(function(){e.done()}))},t.prototype.update=function(t){if(t){var e=this._extractPosition(t),i=this.transformPoint(e.x,e.y),a=i.x-this.parameters.p.x,s=i.y-this.parameters.p.y;this.lastUpdateCall=[a,s],this.calc(a,s),this.el.fire("resizing",{dx:a,dy:s,event:t})}else this.lastUpdateCall&&this.calc(this.lastUpdateCall[0],this.lastUpdateCall[1])},t.prototype.done=function(){this.lastUpdateCall=null,SVG.off(window,"mousemove.resize"),SVG.off(window,"mouseup.resize"),SVG.off(window,"touchmove.resize"),SVG.off(window,"touchend.resize"),this.el.fire("resizedone")},t.prototype.snapToGrid=function(t,e,i,a){var s;return void 0!==a?s=[(i+t)%this.options.snapToGrid,(a+e)%this.options.snapToGrid]:(i=null==i?3:i,s=[(this.parameters.box.x+t+(1&i?0:this.parameters.box.width))%this.options.snapToGrid,(this.parameters.box.y+e+(2&i?0:this.parameters.box.height))%this.options.snapToGrid]),t<0&&(s[0]-=this.options.snapToGrid),e<0&&(s[1]-=this.options.snapToGrid),t-=Math.abs(s[0])<this.options.snapToGrid/2?s[0]:s[0]-(t<0?-this.options.snapToGrid:this.options.snapToGrid),e-=Math.abs(s[1])<this.options.snapToGrid/2?s[1]:s[1]-(e<0?-this.options.snapToGrid:this.options.snapToGrid),this.constraintToBox(t,e,i,a)},t.prototype.constraintToBox=function(t,e,i,a){var s,r,n=this.options.constraint||{};return void 0!==a?(s=i,r=a):(s=this.parameters.box.x+(1&i?0:this.parameters.box.width),r=this.parameters.box.y+(2&i?0:this.parameters.box.height)),void 0!==n.minX&&s+t<n.minX&&(t=n.minX-s),void 0!==n.maxX&&s+t>n.maxX&&(t=n.maxX-s),void 0!==n.minY&&r+e<n.minY&&(e=n.minY-r),void 0!==n.maxY&&r+e>n.maxY&&(e=n.maxY-r),[t,e]},t.prototype.checkAspectRatio=function(t,e){if(!this.options.saveAspectRatio)return t;var i=t.slice(),a=this.parameters.box.width/this.parameters.box.height,s=this.parameters.box.width+t[0],r=this.parameters.box.height-t[1],n=s/r;return n<a?(i[1]=s/a-this.parameters.box.height,e&&(i[1]=-i[1])):n>a&&(i[0]=this.parameters.box.width-r*a,e&&(i[0]=-i[0])),i},SVG.extend(SVG.Element,{resize:function(e){return(this.remember("_resizeHandler")||new t(this)).init(e||{}),this}}),SVG.Element.prototype.resize.defaults={snapToAngle:.1,snapToGrid:1,constraint:{},saveAspectRatio:!1}}).call(this)}(),function(t,e){void 0===e&&(e={});var i=e.insertAt;if("undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&a.firstChild?a.insertBefore(s,a.firstChild):a.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}('.apexcharts-canvas {\n position: relative;\n user-select: none;\n /* cannot give overflow: hidden as it will crop tooltips which overflow outside chart area */\n}\n\n\n/* scrollbar is not visible by default for legend, hence forcing the visibility */\n.apexcharts-canvas ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 6px;\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 0, 0, .5);\n box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n}\n\n.apexcharts-canvas.apexcharts-theme-dark {\n background: #424242;\n}\n\n.apexcharts-inner {\n position: relative;\n}\n\n.apexcharts-text tspan {\n font-family: inherit;\n}\n\n.legend-mouseover-inactive {\n transition: 0.15s ease all;\n opacity: 0.20;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0;\n}\n\n.apexcharts-tooltip {\n border-radius: 5px;\n box-shadow: 2px 2px 6px -4px #999;\n cursor: default;\n font-size: 14px;\n left: 62px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 20px;\n overflow: hidden;\n white-space: nowrap;\n z-index: 12;\n transition: 0.15s ease all;\n}\n\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: 0.15s ease all;\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n border: 1px solid #e3e3e3;\n background: rgba(255, 255, 255, 0.96);\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n color: #fff;\n background: rgba(30, 30, 30, 0.8);\n}\n\n.apexcharts-tooltip * {\n font-family: inherit;\n}\n\n\n.apexcharts-tooltip-title {\n padding: 6px;\n font-size: 15px;\n margin-bottom: 4px;\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\n background: #ECEFF1;\n border-bottom: 1px solid #ddd;\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, 0.7);\n border-bottom: 1px solid #333;\n}\n\n.apexcharts-tooltip-text-value,\n.apexcharts-tooltip-text-z-value {\n display: inline-block;\n font-weight: 600;\n margin-left: 5px;\n}\n\n.apexcharts-tooltip-text-z-label:empty,\n.apexcharts-tooltip-text-z-value:empty {\n display: none;\n}\n\n.apexcharts-tooltip-text-value,\n.apexcharts-tooltip-text-z-value {\n font-weight: 600;\n}\n\n.apexcharts-tooltip-marker {\n width: 12px;\n height: 12px;\n position: relative;\n top: 0px;\n margin-right: 10px;\n border-radius: 50%;\n}\n\n.apexcharts-tooltip-series-group {\n padding: 0 10px;\n display: none;\n text-align: left;\n justify-content: left;\n align-items: center;\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n opacity: 1;\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 4px;\n}\n\n.apexcharts-tooltip-series-group-hidden {\n opacity: 0;\n height: 0;\n line-height: 0;\n padding: 0 !important;\n}\n\n.apexcharts-tooltip-y-group {\n padding: 6px 0 5px;\n}\n\n.apexcharts-tooltip-candlestick {\n padding: 4px 8px;\n}\n\n.apexcharts-tooltip-candlestick>div {\n margin: 4px 0;\n}\n\n.apexcharts-tooltip-candlestick span.value {\n font-weight: bold;\n}\n\n.apexcharts-tooltip-rangebar {\n padding: 5px 8px;\n}\n\n.apexcharts-tooltip-rangebar .category {\n font-weight: 600;\n color: #777;\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n font-weight: bold;\n display: block;\n margin-bottom: 5px;\n}\n\n.apexcharts-xaxistooltip {\n opacity: 0;\n padding: 9px 10px;\n pointer-events: none;\n color: #373d3f;\n font-size: 13px;\n text-align: center;\n border-radius: 2px;\n position: absolute;\n z-index: 10;\n background: #ECEFF1;\n border: 1px solid #90A4AE;\n transition: 0.15s ease all;\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, 0.7);\n border: 1px solid rgba(0, 0, 0, 0.5);\n color: #fff;\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n left: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n\n.apexcharts-xaxistooltip:after {\n border-color: rgba(236, 239, 241, 0);\n border-width: 6px;\n margin-left: -6px;\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: rgba(144, 164, 174, 0);\n border-width: 7px;\n margin-left: -7px;\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n bottom: 100%;\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n top: 100%;\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n border-bottom-color: #ECEFF1;\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: #90A4AE;\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after {\n border-bottom-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\n border-bottom-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: #ECEFF1\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: #90A4AE;\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after {\n border-top-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\n border-top-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: 0.15s ease all;\n}\n\n.apexcharts-yaxistooltip {\n opacity: 0;\n padding: 4px 10px;\n pointer-events: none;\n color: #373d3f;\n font-size: 13px;\n text-align: center;\n border-radius: 2px;\n position: absolute;\n z-index: 10;\n background: #ECEFF1;\n border: 1px solid #90A4AE;\n}\n\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, 0.7);\n border: 1px solid rgba(0, 0, 0, 0.5);\n color: #fff;\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n top: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n\n.apexcharts-yaxistooltip:after {\n border-color: rgba(236, 239, 241, 0);\n border-width: 6px;\n margin-top: -6px;\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: rgba(144, 164, 174, 0);\n border-width: 7px;\n margin-top: -7px;\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n left: 100%;\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n right: 100%;\n}\n\n.apexcharts-yaxistooltip-left:after {\n border-left-color: #ECEFF1;\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: #90A4AE;\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after {\n border-left-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\n border-left-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: #ECEFF1;\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: #90A4AE;\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after {\n border-right-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\n border-right-color: rgba(0, 0, 0, 0.5);\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n opacity: 1;\n}\n\n.apexcharts-yaxistooltip-hidden {\n display: none;\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n pointer-events: none;\n opacity: 0;\n transition: 0.15s ease all;\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n opacity: 1;\n transition: 0.15s ease all;\n}\n\n.apexcharts-ycrosshairs-hidden {\n opacity: 0;\n}\n\n.apexcharts-selection-rect {\n cursor: move;\n}\n\n.svg_select_boundingRect, .svg_select_points_rot {\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n}\n.apexcharts-selection-rect + g .svg_select_boundingRect,\n.apexcharts-selection-rect + g .svg_select_points_rot {\n opacity: 0;\n visibility: hidden;\n}\n\n.apexcharts-selection-rect + g .svg_select_points_l,\n.apexcharts-selection-rect + g .svg_select_points_r {\n cursor: ew-resize;\n opacity: 1;\n visibility: visible;\n}\n\n.svg_select_points {\n fill: #efefef;\n stroke: #333;\n rx: 2;\n}\n\n.apexcharts-canvas.apexcharts-zoomable .hovering-zoom {\n cursor: crosshair\n}\n\n.apexcharts-canvas.apexcharts-zoomable .hovering-pan {\n cursor: move\n}\n\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon,\n.apexcharts-reset-icon,\n.apexcharts-pan-icon,\n.apexcharts-selection-icon,\n.apexcharts-menu-icon,\n.apexcharts-toolbar-custom-icon {\n cursor: pointer;\n width: 20px;\n height: 20px;\n line-height: 24px;\n color: #6E8192;\n text-align: center;\n}\n\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-menu-icon svg {\n fill: #6E8192;\n}\n\n.apexcharts-selection-icon svg {\n fill: #444;\n transform: scale(0.76)\n}\n\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg,\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg {\n fill: #f3f4f5;\n}\n\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg {\n fill: #008FFB;\n}\n\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg,\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg {\n fill: #333;\n}\n\n.apexcharts-selection-icon,\n.apexcharts-menu-icon {\n position: relative;\n}\n\n.apexcharts-reset-icon {\n margin-left: 5px;\n}\n\n.apexcharts-zoom-icon,\n.apexcharts-reset-icon,\n.apexcharts-menu-icon {\n transform: scale(0.85);\n}\n\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n transform: scale(0.7)\n}\n\n.apexcharts-zoomout-icon {\n margin-right: 3px;\n}\n\n.apexcharts-pan-icon {\n transform: scale(0.62);\n position: relative;\n left: 1px;\n top: 0px;\n}\n\n.apexcharts-pan-icon svg {\n fill: #fff;\n stroke: #6E8192;\n stroke-width: 2;\n}\n\n.apexcharts-pan-icon.apexcharts-selected svg {\n stroke: #008FFB;\n}\n\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\n stroke: #333;\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n max-width: 176px;\n text-align: right;\n border-radius: 3px;\n padding: 0px 6px 2px 6px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.apexcharts-menu {\n background: #fff;\n position: absolute;\n top: 100%;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 3px;\n right: 10px;\n opacity: 0;\n min-width: 110px;\n transition: 0.15s ease all;\n pointer-events: none;\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n pointer-events: all;\n transition: 0.15s ease all;\n}\n\n.apexcharts-menu-item {\n padding: 6px 7px;\n font-size: 12px;\n cursor: pointer;\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: #eee;\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n}\n\n@media screen and (min-width: 768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1;\n }\n}\n\n.apexcharts-datalabel.apexcharts-element-hidden {\n opacity: 0;\n}\n\n.apexcharts-pie-label,\n.apexcharts-datalabels,\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value {\n cursor: default;\n pointer-events: none;\n}\n\n.apexcharts-pie-label-delay {\n opacity: 0;\n animation-name: opaque;\n animation-duration: 0.3s;\n animation-fill-mode: forwards;\n animation-timing-function: ease;\n}\n\n.apexcharts-canvas .apexcharts-element-hidden {\n opacity: 0;\n}\n\n.apexcharts-hide .apexcharts-series-points {\n opacity: 0;\n}\n\n.apexcharts-gridline,\n.apexcharts-annotation-rect,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-line,\n.apexcharts-zoom-rect,\n.apexcharts-toolbar svg,\n.apexcharts-area-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,\n.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,\n.apexcharts-radar-series path,\n.apexcharts-radar-series polygon {\n pointer-events: none;\n}\n\n\n/* markers */\n\n.apexcharts-marker {\n transition: 0.15s ease all;\n}\n\n@keyframes opaque {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n\n/* Resize generated styles */\n\n@keyframes resizeanim {\n from {\n opacity: 0;\n }\n to {\n opacity: 0;\n }\n}\n\n.resize-triggers {\n animation: 1ms resizeanim;\n visibility: hidden;\n opacity: 0;\n}\n\n.resize-triggers,\n.resize-triggers>div,\n.contract-trigger:before {\n content: " ";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n overflow: hidden;\n}\n\n.resize-triggers>div {\n background: #eee;\n overflow: auto;\n}\n\n.contract-trigger:before {\n width: 200%;\n height: 200%;\n}'),function(){function t(t){var e=t.__resizeTriggers__,i=e.firstElementChild,a=e.lastElementChild,s=i?i.firstElementChild:null;a&&(a.scrollLeft=a.scrollWidth,a.scrollTop=a.scrollHeight),s&&(s.style.width=i.offsetWidth+1+"px",s.style.height=i.offsetHeight+1+"px"),i&&(i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight)}function e(e){var i=this;t(this),this.__resizeRAF__&&r(this.__resizeRAF__),this.__resizeRAF__=s((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(i)&&(i.__resizeLast__.width=i.offsetWidth,i.__resizeLast__.height=i.offsetHeight,i.__resizeListeners__.forEach((function(t){t.call(e)})))}))}var i,a,s=(i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)},function(t){return i(t)}),r=(a=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(t){return a(t)}),n=!1,o="animationstart",l="Webkit Moz O ms".split(" "),h="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),c=document.createElement("fakeelement");if(void 0!==c.style.animationName&&(n=!0),!1===n)for(var d=0;d<l.length;d++)if(void 0!==c.style[l[d]+"AnimationName"]){o=h[d];break}window.addResizeListener=function(i,a){i.__resizeTriggers__||("static"==getComputedStyle(i).position&&(i.style.position="relative"),i.__resizeLast__={},i.__resizeListeners__=[],(i.__resizeTriggers__=document.createElement("div")).className="resize-triggers",i.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',i.appendChild(i.__resizeTriggers__),t(i),i.addEventListener("scroll",e,!0),o&&i.__resizeTriggers__.addEventListener(o,(function(e){"resizeanim"==e.animationName&&t(i)}))),i.__resizeListeners__.push(a)},window.removeResizeListener=function(t,i){t&&(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(i),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",e),t.__resizeTriggers__.parentNode&&(t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__))))}}(),window.Apex={};var It=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","touchstart","touchmove","mouseup","touchend"],this.ctx.animations=new f(this.ctx),this.ctx.axes=new J(this.ctx),this.ctx.core=new Tt(this.ctx.el,this.ctx),this.ctx.config=new D({}),this.ctx.data=new O(this.ctx),this.ctx.grid=new _(this.ctx),this.ctx.graphics=new p(this.ctx),this.ctx.coreUtils=new m(this.ctx),this.ctx.crosshairs=new Q(this.ctx),this.ctx.events=new Z(this.ctx),this.ctx.exports=new V(this.ctx),this.ctx.localization=new $(this.ctx),this.ctx.options=new S,this.ctx.responsive=new K(this.ctx),this.ctx.series=new M(this.ctx),this.ctx.theme=new tt(this.ctx),this.ctx.formatters=new W(this.ctx),this.ctx.titleSubtitle=new et(this.ctx),this.ctx.legend=new lt(this.ctx),this.ctx.toolbar=new ht(this.ctx),this.ctx.dimensions=new nt(this.ctx),this.ctx.updateHelpers=new zt(this.ctx),this.ctx.zoomPanSelection=new ct(this.ctx),this.ctx.w.globals.tooltip=new bt(this.ctx)}}]),t}(),Mt=function(){function t(i){e(this,t),this.ctx=i,this.w=i.w}return a(t,[{key:"clear",value:function(){this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements()}},{key:"killSVG",value:function(t){t.each((function(t,e){this.removeClass("*"),this.off(),this.stop()}),!0),t.ungroup(),t.clear()}},{key:"clearDomElements",value:function(){var t=this;this.ctx.eventList.forEach((function(e){document.removeEventListener(e,t.ctx.events.documentEvent)}));var e=this.w.globals.dom;if(null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(e.Paper),e.Paper.remove(),e.elWrap=null,e.elGraphical=null,e.elAnnotations=null,e.elLegendWrap=null,e.baseEl=null,e.elGridRect=null,e.elGridRectMask=null,e.elGridRectMarkerMask=null,e.elDefs=null}}]),t}();return function(){function t(i,a){e(this,t),this.opts=a,this.ctx=this,this.w=new N(a).init(),this.el=i,this.w.globals.cuid=g.randomId(),this.w.globals.chartID=this.w.config.chart.id?this.w.config.chart.id:this.w.globals.cuid,new It(this).initModules(),this.create=g.bind(this.create,this),this.windowResizeHandler=this._windowResize.bind(this)}return a(t,[{key:"render",value:function(){var t=this;return new Promise((function(e,i){if(null!==t.el){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),t.w.config.chart.id&&Apex._chartInstances.push({id:t.w.globals.chartID,group:t.w.config.chart.group,chart:t}),t.setLocale(t.w.config.chart.defaultLocale);var a=t.w.config.chart.events.beforeMount;"function"==typeof a&&a(t,t.w),t.events.fireEvent("beforeMount",[t,t.w]),window.addEventListener("resize",t.windowResizeHandler),window.addResizeListener(t.el.parentNode,t._parentResizeCallback.bind(t));var s=t.create(t.w.config.series,{});if(!s)return e(t);t.mount(s).then((function(){"function"==typeof t.w.config.chart.events.mounted&&t.w.config.chart.events.mounted(t,t.w),t.events.fireEvent("mounted",[t,t.w]),e(s)})).catch((function(t){i(t)}))}else i(new Error("Element not found"))}))}},{key:"create",value:function(t,e){var i=this.w;new It(this).initModules();var a=this.w.globals;if(a.noData=!1,a.animationEnded=!1,this.responsive.checkResponsiveConfig(e),i.config.xaxis.convertedCatToNumeric&&new R(i.config).convertCatToNumericXaxis(i.config,this.ctx),null===this.el)return a.animationEnded=!0,null;if(this.core.setupElements(),0===a.svgWidth)return a.animationEnded=!0,null;var s=m.checkComboSeries(t);a.comboCharts=s.comboCharts,a.comboBarCount=s.comboBarCount;var r=t.every((function(t){return t.data&&0===t.data.length}));(0===t.length||r)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(t),this.theme.init(),new P(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),a.noData&&a.collapsedSeries.length!==a.series.length&&!i.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),a.axisCharts&&(this.core.coreCalculations(),"category"!==i.config.xaxis.type&&this.formatters.setLabelFormatters()),this.formatters.heatmapLabelFormatters(),this.dimensions.plotCoords();var n=this.core.xySettings();this.grid.createGridMask();var o=this.core.plotChartType(t,n),l=new z(this);l.bringForward(),i.config.dataLabels.background.enabled&&l.dataLabelsBackground(),this.core.shiftGraphPosition();var h={plot:{left:i.globals.translateX,top:i.globals.translateY,width:i.globals.gridWidth,height:i.globals.gridHeight}};return{elGraph:o,xyRatios:n,elInner:i.globals.dom.elGraphical,dimensions:h}}},{key:"mount",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=this,a=i.w;return new Promise((function(s,r){if(null===i.el)return r(new Error("Not enough data to display or target element not found"));(null===e||a.globals.allSeriesCollapsed)&&i.series.handleNoData(),i.axes.drawAxis(a.config.chart.type,e.xyRatios),i.grid=new _(i);var n=i.grid.drawGrid();i.annotations=new C(i),i.annotations.drawShapeAnnos(),i.annotations.drawImageAnnos(),i.annotations.drawTextAnnos(),"back"===a.config.grid.position&&n&&a.globals.dom.elGraphical.add(n.el);var o=new G(t.ctx),l=new q(t.ctx);if(null!==n&&(o.xAxisLabelCorrections(n.xAxisTickWidth),l.setYAxisTextAlignments()),"back"===a.config.annotations.position&&(a.globals.dom.Paper.add(a.globals.dom.elAnnotations),i.annotations.drawAxesAnnotations()),e.elGraph instanceof Array)for(var h=0;h<e.elGraph.length;h++)a.globals.dom.elGraphical.add(e.elGraph[h]);else a.globals.dom.elGraphical.add(e.elGraph);if("front"===a.config.grid.position&&n&&a.globals.dom.elGraphical.add(n.el),"front"===a.config.xaxis.crosshairs.position&&i.crosshairs.drawXCrosshairs(),"front"===a.config.yaxis[0].crosshairs.position&&i.crosshairs.drawYCrosshairs(),"front"===a.config.annotations.position&&(a.globals.dom.Paper.add(a.globals.dom.elAnnotations),i.annotations.drawAxesAnnotations()),!a.globals.noData){if(a.config.tooltip.enabled&&!a.globals.noData&&i.w.globals.tooltip.drawTooltip(e.xyRatios),a.globals.axisCharts&&(a.globals.isXNumeric||a.config.xaxis.convertedCatToNumeric))(a.config.chart.zoom.enabled||a.config.chart.selection&&a.config.chart.selection.enabled||a.config.chart.pan&&a.config.chart.pan.enabled)&&i.zoomPanSelection.init({xyRatios:e.xyRatios});else{var c=a.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach((function(t){c[t]=!1}))}a.config.chart.toolbar.show&&!a.globals.allSeriesCollapsed&&i.toolbar.createToolbar()}a.globals.memory.methodsToExec.length>0&&a.globals.memory.methodsToExec.forEach((function(t){t.method(t.params,!1,t.context)})),a.globals.axisCharts||a.globals.noData||i.core.resizeNonAxisCharts(),s(i)}))}},{key:"destroy",value:function(){window.removeEventListener("resize",this.windowResizeHandler),window.removeResizeListener(this.el.parentNode,this._parentResizeCallback.bind(this));var t=this.w.config.chart.id;t&&Apex._chartInstances.forEach((function(e,i){e.id===t&&Apex._chartInstances.splice(i,1)})),new Mt(this.ctx).clear()}},{key:"updateOptions",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],n=this.w;return n.globals.selection=void 0,t.series&&(this.series.resetSeries(!1,!0,!1),t.series.length&&t.series[0].data&&(t.series=t.series.map((function(t,i){return e.updateHelpers._extendSeries(t,i)}))),this.updateHelpers.revertDefaultAxisMinMax()),t.xaxis&&(t=this.updateHelpers.forceXAxisUpdate(t)),t.yaxis&&(t=this.updateHelpers.forceYAxisUpdate(t)),n.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),t.theme&&(t=this.theme.updateThemeOptions(t)),this.updateHelpers._updateOptions(t,i,a,s,r)}},{key:"updateSeries",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(t,e,i)}},{key:"appendSeries",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this.w.config.series.slice();return a.push(t),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(a,e,i)}},{key:"appendData",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this;i.w.globals.dataChanged=!0,i.series.getPreviousPaths();for(var a=i.w.config.series.slice(),s=0;s<a.length;s++)if(null!==t[s]&&void 0!==t[s])for(var r=0;r<t[s].data.length;r++)a[s].data.push(t[s].data[r]);return i.w.config.series=a,e&&(i.w.globals.initialSeries=JSON.parse(JSON.stringify(i.w.config.series))),this.update()}},{key:"update",value:function(t){var e=this;return new Promise((function(i,a){new Mt(e.ctx).clear();var s=e.create(e.w.config.series,t);if(!s)return i(e);e.mount(s).then((function(){"function"==typeof e.w.config.chart.events.updated&&e.w.config.chart.events.updated(e,e.w),e.events.fireEvent("updated",[e,e.w]),e.w.globals.isDirty=!0,i(e)})).catch((function(t){a(t)}))}))}},{key:"getSyncedCharts",value:function(){var t=this.getGroupedCharts(),e=[this];return t.length&&(e=[],t.forEach((function(t){e.push(t)}))),e}},{key:"getGroupedCharts",value:function(){var t=this;return Apex._chartInstances.filter((function(t){if(t.group)return!0})).map((function(e){return t.w.config.chart.group===e.group?e.chart:t}))}},{key:"toggleSeries",value:function(t){return this.series.toggleSeries(t)}},{key:"showSeries",value:function(t){this.series.showSeries(t)}},{key:"hideSeries",value:function(t){this.series.hideSeries(t)}},{key:"resetSeries",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.series.resetSeries(t,e)}},{key:"addEventListener",value:function(t,e){this.events.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.events.removeEventListener(t,e)}},{key:"addXaxisAnnotation",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addXaxisAnnotationExternal(t,e,a)}},{key:"addYaxisAnnotation",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addYaxisAnnotationExternal(t,e,a)}},{key:"addPointAnnotation",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=this;i&&(a=i),a.annotations.addPointAnnotationExternal(t,e,a)}},{key:"clearAnnotations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=this;t&&(e=t),e.annotations.clearAnnotations(e)}},{key:"removeAnnotation",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=this;e&&(i=e),i.annotations.removeAnnotation(i,t)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}},{key:"getHighestValueInSeries",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=new U(this.ctx);return e.getMinYMaxY(t).highestY}},{key:"getLowestValueInSeries",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=new U(this.ctx);return e.getMinYMaxY(t).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}},{key:"zoomX",value:function(t,e){this.ctx.toolbar.zoomUpdateOptions(t,e)}},{key:"setLocale",value:function(t){this.localization.setCurrentLocaleValues(t)}},{key:"dataURI",value:function(){return new V(this.ctx).dataURI()}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){!this.w.globals.noData&&this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var t=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout((function(){t.w.globals.resized=!0,t.w.globals.dataChanged=!1,t.ctx.update()}),150)}}],[{key:"getChartByID",value:function(t){var e=Apex._chartInstances.filter((function(e){return e.id===t}))[0];return e&&e.chart}},{key:"initOnLoad",value:function(){for(var e=document.querySelectorAll("[data-apexcharts]"),i=0;i<e.length;i++)new t(e[i],JSON.parse(e[i].getAttribute("data-options"))).render()}},{key:"exec",value:function(t,e){var i=this.getChartByID(t);if(i){i.w.globals.isExecCalled=!0;var a=null;if(-1!==i.publicMethods.indexOf(e)){for(var s=arguments.length,r=new Array(s>2?s-2:0),n=2;n<s;n++)r[n-2]=arguments[n];a=i[e].apply(i,r)}return a}}},{key:"merge",value:function(t,e){return g.extend(t,e)}}]),t}()})),function(a){"use strict";a.sessionTimeout=function(b){function c(){n||(a.ajax({type:i.ajaxType,url:i.keepAliveUrl,data:i.ajaxData}),n=!0,setTimeout((function(){n=!1}),i.keepAliveInterval))}function d(){clearTimeout(g),(i.countdownMessage||i.countdownBar)&&f("session",!0),"function"==typeof i.onStart&&i.onStart(i),i.keepAlive&&c(),g=setTimeout((function(){"function"!=typeof i.onWarn?a("#session-timeout-dialog").modal("show"):i.onWarn(i),e()}),i.warnAfter)}function e(){clearTimeout(g),a("#session-timeout-dialog").hasClass("in")||!i.countdownMessage&&!i.countdownBar||f("dialog",!0),g=setTimeout((function(){"function"!=typeof i.onRedir?window.location=i.redirUrl:i.onRedir(i)}),i.redirAfter-i.warnAfter)}function f(b,c){clearTimeout(j.timer),"dialog"===b&&c?j.timeLeft=Math.floor((i.redirAfter-i.warnAfter)/1e3):"session"===b&&c&&(j.timeLeft=Math.floor(i.redirAfter/1e3)),i.countdownBar&&"dialog"===b?j.percentLeft=Math.floor(j.timeLeft/((i.redirAfter-i.warnAfter)/1e3)*100):i.countdownBar&&"session"===b&&(j.percentLeft=Math.floor(j.timeLeft/(i.redirAfter/1e3)*100));var d=a(".countdown-holder"),e=j.timeLeft>=0?j.timeLeft:0;if(i.countdownSmart){var g=Math.floor(e/60),h=e%60,k=g>0?g+"m":"";k.length>0&&(k+=" "),k+=h+"s",d.text(k)}else d.text(e+"s");i.countdownBar&&a(".countdown-bar").css("width",j.percentLeft+"%"),j.timeLeft=j.timeLeft-1,j.timer=setTimeout((function(){f(b)}),1e3)}var g,h={title:"Your Session is About to Expire!",message:"Your session is about to expire.",logoutButton:"Logout",keepAliveButton:"Stay Connected",keepAliveUrl:"/keep-alive",ajaxType:"POST",ajaxData:"",redirUrl:"/timed-out",logoutUrl:"/log-out",warnAfter:9e5,redirAfter:12e5,keepAliveInterval:5e3,keepAlive:!0,ignoreUserActivity:!1,onStart:!1,onWarn:!1,onRedir:!1,countdownMessage:!1,countdownBar:!1,countdownSmart:!1},i=h,j={};if(b&&(i=a.extend(h,b)),i.warnAfter>=i.redirAfter)return console.error('Bootstrap-session-timeout plugin is miss-configured. Option "redirAfter" must be equal or greater than "warnAfter".'),!1;if("function"!=typeof i.onWarn){var k=i.countdownMessage?"<p>"+i.countdownMessage.replace(/{timer}/g,'<span class="countdown-holder"></span>')+"</p>":"",l=i.countdownBar?'<div class="progress"> <div class="progress-bar progress-bar-striped countdown-bar active" role="progressbar" style="min-width: 15px; width: 100%;"> <span class="countdown-holder"></span> </div> </div>':"";a("body").append('<div class="modal fade" id="session-timeout-dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">'+i.title+'</h4> </div> <div class="modal-body"> <p>'+i.message+"</p> "+k+" "+l+' </div> <div class="modal-footer"> <button id="session-timeout-dialog-logout" type="button" class="btn btn-default">'+i.logoutButton+'</button> <button id="session-timeout-dialog-keepalive" type="button" class="btn btn-primary" data-dismiss="modal">'+i.keepAliveButton+"</button> </div> </div> </div> </div>"),a("#session-timeout-dialog-logout").on("click",(function(){window.location=i.logoutUrl})),a("#session-timeout-dialog").on("hide.bs.modal",(function(){d()}))}if(!i.ignoreUserActivity){var m=[-1,-1];a(document).on("keyup mouseup mousemove touchend touchmove",(function(b){if("mousemove"===b.type){if(b.clientX===m[0]&&b.clientY===m[1])return;m[0]=b.clientX,m[1]=b.clientY}d(),a("#session-timeout-dialog").length>0&&a("#session-timeout-dialog").data("bs.modal")&&a("#session-timeout-dialog").data("bs.modal").isShown&&(a("#session-timeout-dialog").modal("hide"),a("body").removeClass("modal-open"),a("div.modal-backdrop").remove())}))}var n=!1;d()}}(jQuery),function(a){a.idleTimer=function(b,c){var d;"object"==typeof b?(d=b,b=null):"number"==typeof b&&(d={timeout:b},b=null),c=c||document,d=a.extend({idle:!1,timeout:3e4,events:"mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove"},d);var e=a(c),f=e.data("idleTimerObj")||{},g=function(b){var d=a.data(c,"idleTimerObj")||{};d.idle=!d.idle,d.olddate=+new Date;var e=a.Event((d.idle?"idle":"active")+".idleTimer");a(c).trigger(e,[c,a.extend({},d),b])},h=function(b){var d=a.data(c,"idleTimerObj")||{};if(("storage"!==b.type||b.originalEvent.key===d.timerSyncId)&&null==d.remaining){if("mousemove"===b.type){if(b.pageX===d.pageX&&b.pageY===d.pageY)return;if(void 0===b.pageX&&void 0===b.pageY)return;var e;if(200>+new Date-d.olddate)return}clearTimeout(d.tId),d.idle&&g(b),d.lastActive=+new Date,d.pageX=b.pageX,d.pageY=b.pageY,"storage"!==b.type&&d.timerSyncId&&"undefined"!=typeof localStorage&&localStorage.setItem(d.timerSyncId,d.lastActive),d.tId=setTimeout(g,d.timeout)}},i=function(){var b=a.data(c,"idleTimerObj")||{};b.idle=b.idleBackup,b.olddate=+new Date,b.lastActive=b.olddate,b.remaining=null,clearTimeout(b.tId),b.idle||(b.tId=setTimeout(g,b.timeout))},j=function(){var b=a.data(c,"idleTimerObj")||{};null==b.remaining&&(b.remaining=b.timeout-(+new Date-b.olddate),clearTimeout(b.tId))},k=function(){var b=a.data(c,"idleTimerObj")||{};null!=b.remaining&&(b.idle||(b.tId=setTimeout(g,b.remaining)),b.remaining=null)},l=function(){var b=a.data(c,"idleTimerObj")||{};clearTimeout(b.tId),e.removeData("idleTimerObj"),e.off("._idleTimer")},m=function(){var b=a.data(c,"idleTimerObj")||{};if(b.idle)return 0;if(null!=b.remaining)return b.remaining;var d=b.timeout-(+new Date-b.lastActive);return 0>d&&(d=0),d};if(null===b&&void 0!==f.idle)return i(),e;if(null===b);else{if(null!==b&&void 0===f.idle)return!1;if("destroy"===b)return l(),e;if("pause"===b)return j(),e;if("resume"===b)return k(),e;if("reset"===b)return i(),e;if("getRemainingTime"===b)return m();if("getElapsedTime"===b)return+new Date-f.olddate;if("getLastActiveTime"===b)return f.lastActive;if("isIdle"===b)return f.idle}return e.on(a.trim((d.events+" ").split(" ").join("._idleTimer ")),(function(a){h(a)})),d.timerSyncId&&a(window).bind("storage",h),(f=a.extend({},{olddate:+new Date,lastActive:+new Date,idle:d.idle,idleBackup:d.idle,timeout:d.timeout,remaining:null,timerSyncId:d.timerSyncId,tId:null,pageX:null,pageY:null})).idle||(f.tId=setTimeout(g,f.timeout)),a.data(c,"idleTimerObj",f),e},a.fn.idleTimer=function(b){return this[0]?a.idleTimer(b,this[0]):this}}(jQuery),
|
||
/*!
|
||
Waypoints - 4.0.1
|
||
Copyright © 2011-2016 Caleb Troughton
|
||
Licensed under the MIT license.
|
||
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
|
||
*/
|
||
function(){"use strict";var keyCounter=0,allWaypoints={};function Waypoint(options){if(!options)throw new Error("No options passed to Waypoint constructor");if(!options.element)throw new Error("No element option passed to Waypoint constructor");if(!options.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+keyCounter,this.options=Waypoint.Adapter.extend({},Waypoint.defaults,options),this.element=this.options.element,this.adapter=new Waypoint.Adapter(this.element),this.callback=options.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=Waypoint.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=Waypoint.Context.findOrCreateByElement(this.options.context),Waypoint.offsetAliases[this.options.offset]&&(this.options.offset=Waypoint.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),allWaypoints[this.key]=this,keyCounter+=1}Waypoint.prototype.queueTrigger=function(direction){this.group.queueTrigger(this,direction)},Waypoint.prototype.trigger=function(args){this.enabled&&this.callback&&this.callback.apply(this,args)},Waypoint.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete allWaypoints[this.key]},Waypoint.prototype.disable=function(){return this.enabled=!1,this},Waypoint.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},Waypoint.prototype.next=function(){return this.group.next(this)},Waypoint.prototype.previous=function(){return this.group.previous(this)},Waypoint.invokeAll=function(method){var allWaypointsArray=[];for(var waypointKey in allWaypoints)allWaypointsArray.push(allWaypoints[waypointKey]);for(var i=0,end=allWaypointsArray.length;i<end;i++)allWaypointsArray[i][method]()},Waypoint.destroyAll=function(){Waypoint.invokeAll("destroy")},Waypoint.disableAll=function(){Waypoint.invokeAll("disable")},Waypoint.enableAll=function(){for(var waypointKey in Waypoint.Context.refreshAll(),allWaypoints)allWaypoints[waypointKey].enabled=!0;return this},Waypoint.refreshAll=function(){Waypoint.Context.refreshAll()},Waypoint.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},Waypoint.viewportWidth=function(){return document.documentElement.clientWidth},Waypoint.adapters=[],Waypoint.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},Waypoint.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=Waypoint}(),function(){"use strict";function requestAnimationFrameShim(callback){window.setTimeout(callback,1e3/60)}var keyCounter=0,contexts={},Waypoint=window.Waypoint,oldWindowLoad=window.onload;function Context(element){this.element=element,this.Adapter=Waypoint.Adapter,this.adapter=new this.Adapter(element),this.key="waypoint-context-"+keyCounter,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},element.waypointContextKey=this.key,contexts[element.waypointContextKey]=this,keyCounter+=1,Waypoint.windowContext||(Waypoint.windowContext=!0,Waypoint.windowContext=new Context(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}Context.prototype.add=function(waypoint){var axis=waypoint.options.horizontal?"horizontal":"vertical";this.waypoints[axis][waypoint.key]=waypoint,this.refresh()},Context.prototype.checkEmpty=function(){var horizontalEmpty=this.Adapter.isEmptyObject(this.waypoints.horizontal),verticalEmpty=this.Adapter.isEmptyObject(this.waypoints.vertical),isWindow=this.element==this.element.window;horizontalEmpty&&verticalEmpty&&!isWindow&&(this.adapter.off(".waypoints"),delete contexts[this.key])},Context.prototype.createThrottledResizeHandler=function(){var self=this;function resizeHandler(){self.handleResize(),self.didResize=!1}this.adapter.on("resize.waypoints",(function(){self.didResize||(self.didResize=!0,Waypoint.requestAnimationFrame(resizeHandler))}))},Context.prototype.createThrottledScrollHandler=function(){var self=this;function scrollHandler(){self.handleScroll(),self.didScroll=!1}this.adapter.on("scroll.waypoints",(function(){self.didScroll&&!Waypoint.isTouch||(self.didScroll=!0,Waypoint.requestAnimationFrame(scrollHandler))}))},Context.prototype.handleResize=function(){Waypoint.Context.refreshAll()},Context.prototype.handleScroll=function(){var triggeredGroups={},axes={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var axisKey in axes){var axis=axes[axisKey],isForward,direction=axis.newScroll>axis.oldScroll?axis.forward:axis.backward;for(var waypointKey in this.waypoints[axisKey]){var waypoint=this.waypoints[axisKey][waypointKey];if(null!==waypoint.triggerPoint){var wasBeforeTriggerPoint=axis.oldScroll<waypoint.triggerPoint,nowAfterTriggerPoint=axis.newScroll>=waypoint.triggerPoint,crossedForward,crossedBackward;(wasBeforeTriggerPoint&&nowAfterTriggerPoint||!wasBeforeTriggerPoint&&!nowAfterTriggerPoint)&&(waypoint.queueTrigger(direction),triggeredGroups[waypoint.group.id]=waypoint.group)}}}for(var groupKey in triggeredGroups)triggeredGroups[groupKey].flushTriggers();this.oldScroll={x:axes.horizontal.newScroll,y:axes.vertical.newScroll}},Context.prototype.innerHeight=function(){return this.element==this.element.window?Waypoint.viewportHeight():this.adapter.innerHeight()},Context.prototype.remove=function(waypoint){delete this.waypoints[waypoint.axis][waypoint.key],this.checkEmpty()},Context.prototype.innerWidth=function(){return this.element==this.element.window?Waypoint.viewportWidth():this.adapter.innerWidth()},Context.prototype.destroy=function(){var allWaypoints=[];for(var axis in this.waypoints)for(var waypointKey in this.waypoints[axis])allWaypoints.push(this.waypoints[axis][waypointKey]);for(var i=0,end=allWaypoints.length;i<end;i++)allWaypoints[i].destroy()},Context.prototype.refresh=function(){var isWindow=this.element==this.element.window,contextOffset=isWindow?void 0:this.adapter.offset(),triggeredGroups={},axes;for(var axisKey in this.handleScroll(),axes={horizontal:{contextOffset:isWindow?0:contextOffset.left,contextScroll:isWindow?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:isWindow?0:contextOffset.top,contextScroll:isWindow?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var axis=axes[axisKey];for(var waypointKey in this.waypoints[axisKey]){var waypoint=this.waypoints[axisKey][waypointKey],adjustment=waypoint.options.offset,oldTriggerPoint=waypoint.triggerPoint,elementOffset=0,freshWaypoint=null==oldTriggerPoint,contextModifier,wasBeforeScroll,nowAfterScroll,triggeredBackward,triggeredForward;waypoint.element!==waypoint.element.window&&(elementOffset=waypoint.adapter.offset()[axis.offsetProp]),"function"==typeof adjustment?adjustment=adjustment.apply(waypoint):"string"==typeof adjustment&&(adjustment=parseFloat(adjustment),waypoint.options.offset.indexOf("%")>-1&&(adjustment=Math.ceil(axis.contextDimension*adjustment/100))),contextModifier=axis.contextScroll-axis.contextOffset,waypoint.triggerPoint=Math.floor(elementOffset+contextModifier-adjustment),wasBeforeScroll=oldTriggerPoint<axis.oldScroll,nowAfterScroll=waypoint.triggerPoint>=axis.oldScroll,triggeredForward=!wasBeforeScroll&&!nowAfterScroll,!freshWaypoint&&(triggeredBackward=wasBeforeScroll&&nowAfterScroll)?(waypoint.queueTrigger(axis.backward),triggeredGroups[waypoint.group.id]=waypoint.group):!freshWaypoint&&triggeredForward?(waypoint.queueTrigger(axis.forward),triggeredGroups[waypoint.group.id]=waypoint.group):freshWaypoint&&axis.oldScroll>=waypoint.triggerPoint&&(waypoint.queueTrigger(axis.forward),triggeredGroups[waypoint.group.id]=waypoint.group)}}return Waypoint.requestAnimationFrame((function(){for(var groupKey in triggeredGroups)triggeredGroups[groupKey].flushTriggers()})),this},Context.findOrCreateByElement=function(element){return Context.findByElement(element)||new Context(element)},Context.refreshAll=function(){for(var contextId in contexts)contexts[contextId].refresh()},Context.findByElement=function(element){return contexts[element.waypointContextKey]},window.onload=function(){oldWindowLoad&&oldWindowLoad(),Context.refreshAll()},Waypoint.requestAnimationFrame=function(callback){var requestFn;(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||requestAnimationFrameShim).call(window,callback)},Waypoint.Context=Context}(),function(){"use strict";function byTriggerPoint(a,b){return a.triggerPoint-b.triggerPoint}function byReverseTriggerPoint(a,b){return b.triggerPoint-a.triggerPoint}var groups={vertical:{},horizontal:{}},Waypoint=window.Waypoint;function Group(options){this.name=options.name,this.axis=options.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),groups[this.axis][this.name]=this}Group.prototype.add=function(waypoint){this.waypoints.push(waypoint)},Group.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},Group.prototype.flushTriggers=function(){for(var direction in this.triggerQueues){var waypoints=this.triggerQueues[direction],reverse="up"===direction||"left"===direction;waypoints.sort(reverse?byReverseTriggerPoint:byTriggerPoint);for(var i=0,end=waypoints.length;i<end;i+=1){var waypoint=waypoints[i];(waypoint.options.continuous||i===waypoints.length-1)&&waypoint.trigger([direction])}}this.clearTriggerQueues()},Group.prototype.next=function(waypoint){this.waypoints.sort(byTriggerPoint);var index=Waypoint.Adapter.inArray(waypoint,this.waypoints),isLast;return index===this.waypoints.length-1?null:this.waypoints[index+1]},Group.prototype.previous=function(waypoint){this.waypoints.sort(byTriggerPoint);var index=Waypoint.Adapter.inArray(waypoint,this.waypoints);return index?this.waypoints[index-1]:null},Group.prototype.queueTrigger=function(waypoint,direction){this.triggerQueues[direction].push(waypoint)},Group.prototype.remove=function(waypoint){var index=Waypoint.Adapter.inArray(waypoint,this.waypoints);index>-1&&this.waypoints.splice(index,1)},Group.prototype.first=function(){return this.waypoints[0]},Group.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},Group.findOrCreate=function(options){return groups[options.axis][options.name]||new Group(options)},Waypoint.Group=Group}(),function(){"use strict";var $=window.jQuery,Waypoint=window.Waypoint;function JQueryAdapter(element){this.$element=$(element)}$.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],(function(i,method){JQueryAdapter.prototype[method]=function(){var args=Array.prototype.slice.call(arguments);return this.$element[method].apply(this.$element,args)}})),$.each(["extend","inArray","isEmptyObject"],(function(i,method){JQueryAdapter[method]=$[method]})),Waypoint.adapters.push({name:"jquery",Adapter:JQueryAdapter}),Waypoint.Adapter=JQueryAdapter}(),function(){"use strict";var Waypoint=window.Waypoint;function createExtension(framework){return function(){var waypoints=[],overrides=arguments[0];return framework.isFunction(arguments[0])&&((overrides=framework.extend({},arguments[1])).handler=arguments[0]),this.each((function(){var options=framework.extend({},overrides,{element:this});"string"==typeof options.context&&(options.context=framework(this).closest(options.context)[0]),waypoints.push(new Waypoint(options))})),waypoints}}window.jQuery&&(window.jQuery.fn.waypoint=createExtension(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=createExtension(window.Zepto))}(),function(t){"use strict";t.fn.counterUp=function(e){var u=t.extend({time:400,delay:10},e);return this.each((function(){var e=t(this),n=u,a=function(){var t=n.time/n.delay,u=e.attr("data-value"),a=[u],r=/[0-9]+,[0-9]+/.test(u);u=u.replace(/,/g,"");for(var o=(/^[0-9]+$/.test(u),/^[0-9]+\.[0-9]+$/.test(u)),c=o?(u.split(".")[1]||[]).length:0,d=t;d>=1;d--){var s=parseInt(u/t*d);if(o&&(s=parseFloat(u/t*d).toFixed(c)),r)for(;/(\d+)(\d{3})/.test(s.toString());)s=s.toString().replace(/(\d+)(\d{3})/,"$1,$2");a.unshift(s)}e.data("counterup-nums",a),e.text("0");var i=function(){e.data("counterup-nums")&&(e.text(e.data("counterup-nums").shift()),e.data("counterup-nums").length?setTimeout(e.data("counterup-func"),n.delay):(e.data("counterup-nums"),e.data("counterup-nums",null),e.data("counterup-func",null)))};e.data("counterup-func",i),setTimeout(e.data("counterup-func"),n.delay)};e.waypoint(a,{offset:"100%",triggerOnce:!0})}))}}(jQuery),function(t){function z(){for(var a=0;a<g.length;a++)g[a][0](g[a][1]);g=[],m=!1}function n(a,b){g.push([a,b]),m||(m=!0,A(z,0))}function B(a,b){function c(a){p(b,a)}function h(a){k(b,a)}try{a(c,h)}catch(d){h(d)}}function u(a){var b,c=(b=a.owner).state_,b=b.data_,h=a[c];if(a=a.then,"function"==typeof h){c=l;try{b=h(b)}catch(d){k(a,d)}}v(a,b)||(c===l&&p(a,b),c===q&&k(a,b))}function v(a,b){var c;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(b&&("function"==typeof b||"object"==typeof b)){var h=b.then;if("function"==typeof h)return h.call(b,(function(d){c||(c=!0,b!==d?p(a,d):w(a,d))}),(function(b){c||(c=!0,k(a,b))})),!0}}catch(d){return c||k(a,d),!0}return!1}function p(a,b){a!==b&&v(a,b)||w(a,b)}function w(a,b){a.state_===r&&(a.state_=x,a.data_=b,n(C,a))}function k(a,b){a.state_===r&&(a.state_=x,a.data_=b,n(D,a))}function y(a){var b=a.then_;for(a.then_=void 0,a=0;a<b.length;a++)u(b[a])}function C(a){a.state_=l,y(a)}function D(a){a.state_=q,y(a)}function e(a){if("function"!=typeof a)throw new TypeError("Promise constructor takes a function argument");if(!1==this instanceof e)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],B(a,this)}var f=t.Promise,s=f&&"resolve"in f&&"reject"in f&&"all"in f&&"race"in f&&function(){var a;return new f((function(b){a=b})),"function"==typeof a}();"undefined"!=typeof exports&&exports?(exports.Promise=s?f:e,exports.Polyfill=e):"function"==typeof define&&define.amd?define((function(){return s?f:e})):s||(t.Promise=e);var r="pending",x="sealed",l="fulfilled",q="rejected",E=function(){},A="undefined"!=typeof setImmediate?setImmediate:setTimeout,g=[],m;e.prototype={constructor:e,state_:r,then_:null,data_:void 0,then:function(a,b){var c={owner:this,then:new this.constructor(E),fulfilled:a,rejected:b};return this.state_===l||this.state_===q?n(u,c):this.then_.push(c),c.then},catch:function(a){return this.then(null,a)}},e.all=function(a){if("[object Array]"!==Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.all().");return new this((function(b,c){function h(a){return e++,function(c){d[a]=c,--e||b(d)}}for(var d=[],e=0,f=0,g;f<a.length;f++)(g=a[f])&&"function"==typeof g.then?g.then(h(f),c):d[f]=g;e||b(d)}))},e.race=function(a){if("[object Array]"!==Object.prototype.toString.call(a))throw new TypeError("You must pass an array to Promise.race().");return new this((function(b,c){for(var e=0,d;e<a.length;e++)(d=a[e])&&"function"==typeof d.then?d.then(b,c):b(d)}))},e.resolve=function(a){return a&&"object"==typeof a&&a.constructor===this?a:new this((function(b){b(a)}))},e.reject=function(a){return new this((function(b,c){c(a)}))}}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sweetalert2=e()}(this,(function(){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function c(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function i(t,e,n){return(i=d()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var i=new(Function.bind.apply(t,o));return n&&l(i,n.prototype),i}).apply(null,arguments)}function p(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t,e,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var o=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function m(e){return Object.keys(e).map((function(t){return e[t]}))}function h(t){return Array.prototype.slice.call(t)}function g(t,e){var n;n='"'.concat(t,'" is deprecated and will be removed in the next major release. Please use "').concat(e,'" instead.'),-1===_.indexOf(n)&&(_.push(n),N(n))}function v(t){return t&&Promise.resolve(t)===t}function b(t){return t instanceof Element||"object"===r(e=t)&&e.jquery;var e}function t(t){var e={};for(var n in t)e[t[n]]="swal2-"+t[n];return e}function y(t){var e=Y();return e?e.querySelector(t):null}function e(t){return y(".".concat(t))}function n(){var t;return h(Z().querySelectorAll(".".concat(W.icon)))}function w(){var t=n().filter((function(t){return ht(t)}));return t.length?t[0]:null}function C(){return e(W.title)}function k(){return e(W.content)}function x(){return e(W.image)}function P(){return e(W["progress-steps"])}function A(){return e(W["validation-message"])}function B(){return y(".".concat(W.actions," .").concat(W.confirm))}function S(){return y(".".concat(W.actions," .").concat(W.cancel))}function E(){return e(W.actions)}function O(){return e(W.header)}function T(){return e(W.footer)}function L(){return e(W["timer-progress-bar"])}function q(){return e(W.close)}function I(){var t=h(Z().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((function(t,e){return t=parseInt(t.getAttribute("tabindex")),(e=parseInt(e.getAttribute("tabindex")))<t?1:t<e?-1:0})),e=h(Z().querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter((function(t){return"-1"!==t.getAttribute("tabindex")}));return function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(t.concat(e)).filter((function(t){return ht(t)}))}function j(){return!Q()&&!document.body.classList.contains(W["no-backdrop"])}function M(){return Z().hasAttribute("data-loading")}function V(e,t){var n;e.textContent="",t&&(h((n=(new DOMParser).parseFromString(t,"text/html")).querySelector("head").childNodes).forEach((function(t){e.appendChild(t)})),h(n.querySelector("body").childNodes).forEach((function(t){e.appendChild(t)})))}function R(t,e){if(e){for(var n=e.split(/\s+/),o=0;o<n.length;o++)if(!t.classList.contains(n[o]))return;return 1}}function H(t,e,n){var o,i;if(i=e,h((o=t).classList).forEach((function(t){-1===m(W).indexOf(t)&&-1===m(K).indexOf(t)&&-1===m(i.showClass).indexOf(t)&&o.classList.remove(t)})),e.customClass&&e.customClass[n]){if("string"!=typeof e.customClass[n]&&!e.customClass[n].forEach)return N("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(r(e.customClass[n]),'"'));pt(t,e.customClass[n])}}var D="SweetAlert2:",N=function(t){console.warn("".concat(D," ").concat(t))},U=function(t){console.error("".concat(D," ").concat(t))},_=[],F=function(t){return"function"==typeof t?t():t},z=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),W=t(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","toast-column","show","hide","close","title","header","content","html-container","actions","confirm","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),K=t(["success","warning","info","question","error"]),Y=function(){return document.body.querySelector(".".concat(W.container))},Z=function(){return e(W.popup)},Q=function(){return document.body.classList.contains(W["toast-shown"])},$={previousBodyPadding:null};function J(t,e){if(!e)return null;switch(e){case"select":case"textarea":case"file":return mt(t,W[e]);case"checkbox":return t.querySelector(".".concat(W.checkbox," input"));case"radio":return t.querySelector(".".concat(W.radio," input:checked"))||t.querySelector(".".concat(W.radio," input:first-child"));case"range":return t.querySelector(".".concat(W.range," input"));default:return mt(t,W.input)}}function X(t){var e;t.focus(),"file"!==t.type&&(e=t.value,t.value="",t.value=e)}function G(t,e,n){t&&e&&("string"==typeof e&&(e=e.split(/\s+/).filter(Boolean)),e.forEach((function(e){t.forEach?t.forEach((function(t){n?t.classList.add(e):t.classList.remove(e)})):n?t.classList.add(e):t.classList.remove(e)})))}function tt(t,e,n){n||0===parseInt(n)?t.style[e]="number"==typeof n?"".concat(n,"px"):n:t.style.removeProperty(e)}function et(t,e){var n=1<arguments.length&&void 0!==e?e:"flex";t.style.opacity="",t.style.display=n}function nt(t){t.style.opacity="",t.style.display="none"}function ot(t,e,n){e?et(t,n):nt(t)}function it(t){return!!(t.scrollHeight>t.clientHeight)}function rt(t){var e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),o=parseFloat(e.getPropertyValue("transition-duration")||"0");return 0<n||0<o}function at(t,e){var n=1<arguments.length&&void 0!==e&&e,o=L();ht(o)&&(n&&(o.style.transition="none",o.style.width="100%"),setTimeout((function(){o.style.transition="width ".concat(t/1e3,"s linear"),o.style.width="0%"}),10))}function ct(){return"undefined"==typeof window||"undefined"==typeof document}function st(t){rn.isVisible()&&dt!==t.target.value&&rn.resetValidationMessage(),dt=t.target.value}function ut(t,e){t instanceof HTMLElement?e.appendChild(t):"object"===r(t)?bt(t,e):t&&V(e,t)}function lt(t,e){var n=E(),o=B(),i=S();e.showConfirmButton||e.showCancelButton||nt(n),H(n,e,"actions"),Ct(o,"confirm",e),Ct(i,"cancel",e),e.buttonsStyling?function(t,e,n){var o;pt([t,e],W.styled),n.confirmButtonColor&&(t.style.backgroundColor=n.confirmButtonColor),n.cancelButtonColor&&(e.style.backgroundColor=n.cancelButtonColor),M()||(o=window.getComputedStyle(t).getPropertyValue("background-color"),t.style.borderLeftColor=o,t.style.borderRightColor=o)}(o,i,e):(ft([o,i],W.styled),o.style.backgroundColor=o.style.borderLeftColor=o.style.borderRightColor="",i.style.backgroundColor=i.style.borderLeftColor=i.style.borderRightColor=""),e.reverseButtons&&o.parentNode.insertBefore(i,o)}var dt,pt=function(t,e){G(t,e,!0)},ft=function(t,e){G(t,e,!1)},mt=function(t,e){for(var n=0;n<t.childNodes.length;n++)if(R(t.childNodes[n],e))return t.childNodes[n]},ht=function(t){return!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))},gt='\n <div aria-labelledby="'.concat(W.title,'" aria-describedby="').concat(W.content,'" class="').concat(W.popup,'" tabindex="-1">\n <div class="').concat(W.header,'">\n <ul class="').concat(W["progress-steps"],'"></ul>\n <div class="').concat(W.icon," ").concat(K.error,'"></div>\n <div class="').concat(W.icon," ").concat(K.question,'"></div>\n <div class="').concat(W.icon," ").concat(K.warning,'"></div>\n <div class="').concat(W.icon," ").concat(K.info,'"></div>\n <div class="').concat(W.icon," ").concat(K.success,'"></div>\n <img class="').concat(W.image,'" />\n <h2 class="').concat(W.title,'" id="').concat(W.title,'"></h2>\n <button type="button" class="').concat(W.close,'"></button>\n </div>\n <div class="').concat(W.content,'">\n <div id="').concat(W.content,'" class="').concat(W["html-container"],'"></div>\n <input class="').concat(W.input,'" />\n <input type="file" class="').concat(W.file,'" />\n <div class="').concat(W.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(W.select,'"></select>\n <div class="').concat(W.radio,'"></div>\n <label for="').concat(W.checkbox,'" class="').concat(W.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(W.label,'"></span>\n </label>\n <textarea class="').concat(W.textarea,'"></textarea>\n <div class="').concat(W["validation-message"],'" id="').concat(W["validation-message"],'"></div>\n </div>\n <div class="').concat(W.actions,'">\n <button type="button" class="').concat(W.confirm,'">OK</button>\n <button type="button" class="').concat(W.cancel,'">Cancel</button>\n </div>\n <div class="').concat(W.footer,'"></div>\n <div class="').concat(W["timer-progress-bar-container"],'">\n <div class="').concat(W["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),vt=function(t){var e,n,o,i,r,a,c,s,u,l,d,p,f,m,h,g=!!(e=Y())&&(e.parentNode.removeChild(e),ft([document.documentElement,document.body],[W["no-backdrop"],W["toast-shown"],W["has-column"]]),!0);ct()?U("SweetAlert2 requires document to initialize"):((n=document.createElement("div")).className=W.container,g&&pt(n,W["no-transition"]),V(n,gt),(o="string"==typeof(i=t.target)?document.querySelector(i):i).appendChild(n),r=t,(a=Z()).setAttribute("role",r.toast?"alert":"dialog"),a.setAttribute("aria-live",r.toast?"polite":"assertive"),r.toast||a.setAttribute("aria-modal","true"),c=o,"rtl"===window.getComputedStyle(c).direction&&pt(Y(),W.rtl),s=k(),u=mt(s,W.input),l=mt(s,W.file),d=s.querySelector(".".concat(W.range," input")),p=s.querySelector(".".concat(W.range," output")),f=mt(s,W.select),m=s.querySelector(".".concat(W.checkbox," input")),h=mt(s,W.textarea),u.oninput=st,l.onchange=st,f.onchange=st,m.onchange=st,h.oninput=st,d.oninput=function(t){st(t),p.value=d.value},d.onchange=function(t){st(t),d.nextSibling.value=d.value})},bt=function(t,e){t.jquery?yt(e,t):V(e,t.toString())},yt=function(t,e){if(t.textContent="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},wt=function(){if(ct())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&void 0!==t.style[n])return e[n];return!1}();function Ct(t,e,n){var o;ot(t,n["show".concat((o=e).charAt(0).toUpperCase()+o.slice(1),"Button")],"inline-block"),V(t,n["".concat(e,"ButtonText")]),t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=W[e],H(t,n,"".concat(e,"Button")),pt(t,n["".concat(e,"ButtonClass")])}function kt(t,e){var n,o,i,r,a,c,s,u,l=Y();l&&(n=l,"string"==typeof(o=e.backdrop)?n.style.background=o:o||pt([document.documentElement,document.body],W["no-backdrop"]),!e.backdrop&&e.allowOutsideClick&&N('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),i=l,(r=e.position)in W?pt(i,W[r]):(N('The "position" parameter is not valid, defaulting to "center"'),pt(i,W.center)),a=l,!(c=e.grow)||"string"!=typeof c||(s="grow-".concat(c))in W&&pt(a,W[s]),H(l,e,"container"),(u=document.body.getAttribute("data-swal2-queue-step"))&&(l.setAttribute("data-queue-step",u),document.body.removeAttribute("data-swal2-queue-step")))}function xt(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}var Pt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},At=["input","file","range","select","radio","checkbox","textarea"],Bt=function(t){if(!Tt[t.input])return U('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=Ot(t.input),n=Tt[t.input](e,t);et(n),setTimeout((function(){X(n)}))},St=function(t,e){var n=J(k(),t);if(n)for(var o in function(t){for(var e=0;e<t.attributes.length;e++){var n=t.attributes[e].name;-1===["type","value","style"].indexOf(n)&&t.removeAttribute(n)}}(n),e)"range"===t&&"placeholder"===o||n.setAttribute(o,e[o])},Et=function(t){var e=Ot(t.input);t.customClass&&pt(e,t.customClass.input)},Ot=function(t){var e=W[t]?W[t]:W.input;return mt(k(),e)},Tt={};function Lt(t,e){var n,o,i,r,a,c=k().querySelector("#".concat(W.content));e.html?(ut(e.html,c),et(c,"block")):e.text?(c.textContent=e.text,et(c,"block")):nt(c),n=t,o=e,i=k(),r=Pt.innerParams.get(n),a=!r||o.input!==r.input,At.forEach((function(t){var e=W[t],n=mt(i,e);St(t,o.inputAttributes),n.className=e,a&&nt(n)})),o.input&&(a&&Bt(o),Et(o)),H(k(),e,"content")}function qt(){return Y()&&Y().getAttribute("data-queue-step")}function It(t,s){var u=P();if(!s.progressSteps||0===s.progressSteps.length)return nt(u),0;et(u),u.textContent="";var l=parseInt(void 0===s.currentProgressStep?qt():s.currentProgressStep);l>=s.progressSteps.length&&N("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.progressSteps.forEach((function(t,e){var n,o,i,r,a,c=(n=t,o=document.createElement("li"),pt(o,W["progress-step"]),V(o,n),o);u.appendChild(c),e===l&&pt(c,W["active-progress-step"]),e!==s.progressSteps.length-1&&(r=t,a=document.createElement("li"),pt(a,W["progress-step-line"]),r.progressStepsDistance&&(a.style.width=r.progressStepsDistance),i=a,u.appendChild(i))}))}function jt(t,e){var n,o,i,r,a,c,s,u,l;H(O(),e,"header"),It(0,e),n=t,o=e,(r=Pt.innerParams.get(n))&&o.icon===r.icon&&w()?H(w(),o,"icon"):(Rt(),o.icon&&(-1!==Object.keys(K).indexOf(o.icon)?(et(i=y(".".concat(W.icon,".").concat(K[o.icon]))),Dt(i,o),Ht(),H(i,o,"icon"),pt(i,o.showClass.icon)):U('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(o.icon,'"')))),function(t){var e=x();if(!t.imageUrl)return nt(e);et(e,""),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),tt(e,"width",t.imageWidth),tt(e,"height",t.imageHeight),e.className=W.image,H(e,t,"image")}(e),a=e,ot(c=C(),a.title||a.titleText),a.title&&ut(a.title,c),a.titleText&&(c.innerText=a.titleText),H(c,a,"title"),s=e,V(u=q(),s.closeButtonHtml),H(u,s,"closeButton"),ot(u,s.showCloseButton),u.setAttribute("aria-label",s.closeButtonAriaLabel)}function Mt(t,e){var n,o,i,r;n=e,tt(o=Z(),"width",n.width),tt(o,"padding",n.padding),n.background&&(o.style.background=n.background),_t(o,n),kt(0,e),jt(t,e),Lt(t,e),lt(0,e),i=e,ot(r=T(),i.footer),i.footer&&ut(i.footer,r),H(r,i,"footer"),"function"==typeof e.onRender&&e.onRender(Z())}function Vt(){return B()&&B().click()}Tt.text=Tt.email=Tt.password=Tt.number=Tt.tel=Tt.url=function(t,e){return"string"==typeof e.inputValue||"number"==typeof e.inputValue?t.value=e.inputValue:v(e.inputValue)||N('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(r(e.inputValue),'"')),xt(t,e),t.type=e.input,t},Tt.file=function(t,e){return xt(t,e),t},Tt.range=function(t,e){var n=t.querySelector("input"),o=t.querySelector("output");return n.value=e.inputValue,n.type=e.input,o.value=e.inputValue,t},Tt.select=function(t,e){var n;return t.textContent="",e.inputPlaceholder&&(V(n=document.createElement("option"),e.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,t.appendChild(n)),t},Tt.radio=function(t){return t.textContent="",t},Tt.checkbox=function(t,e){var n=J(k(),"checkbox"),o;return n.value=1,n.id=W.checkbox,n.checked=Boolean(e.inputValue),V(t.querySelector("span"),e.inputPlaceholder),t},Tt.textarea=function(e,t){var n,o;return e.value=t.inputValue,xt(e,t),"MutationObserver"in window&&(n=parseInt(window.getComputedStyle(Z()).width),o=parseInt(window.getComputedStyle(Z()).paddingLeft)+parseInt(window.getComputedStyle(Z()).paddingRight),new MutationObserver((function(){var t=e.offsetWidth+o;Z().style.width=n<t?"".concat(t,"px"):null})).observe(e,{attributes:!0,attributeFilter:["style"]})),e};var Rt=function(){for(var t=n(),e=0;e<t.length;e++)nt(t[e])},Ht=function(){for(var t=Z(),e=window.getComputedStyle(t).getPropertyValue("background-color"),n=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),o=0;o<n.length;o++)n[o].style.backgroundColor=e},Dt=function(t,e){t.textContent="",e.iconHtml?V(t,Nt(e.iconHtml)):"success"===e.icon?V(t,'\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n '):"error"===e.icon?V(t,'\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n '):V(t,Nt({question:"?",warning:"!",info:"i"}[e.icon]))},Nt=function(t){return'<div class="'.concat(W["icon-content"],'">').concat(t,"</div>")},Ut=[],_t=function(t,e){t.className="".concat(W.popup," ").concat(ht(t)?e.showClass.popup:""),e.toast?(pt([document.documentElement,document.body],W["toast-shown"]),pt(t,W.toast)):pt(t,W.modal),H(t,e,"popup"),"string"==typeof e.customClass&&pt(t,e.customClass),e.icon&&pt(t,W["icon-".concat(e.icon)])};function Ft(){var t=Z();t||rn.fire(),t=Z();var e=E(),n=B();et(e),et(n,"inline-block"),pt([t,e],W.loading),n.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()}function zt(){return new Promise((function(t){var e=window.scrollX,n=window.scrollY;$t.restoreFocusTimeout=setTimeout((function(){$t.previousActiveElement&&$t.previousActiveElement.focus?($t.previousActiveElement.focus(),$t.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)}))}function Wt(){if($t.timeout)return function(){var t=L(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),o=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(o,"%")}(),$t.timeout.stop()}function Kt(){if($t.timeout){var t=$t.timeout.start();return at(t),t}}function Yt(t){return Object.prototype.hasOwnProperty.call(Jt,t)}function Zt(t){return Gt[t]}function Qt(t){for(var e in t)Yt(i=e)||N('Unknown parameter "'.concat(i,'"')),t.toast&&(o=e,-1!==te.indexOf(o)&&N('The parameter "'.concat(o,'" is incompatible with toasts'))),Zt(n=e)&&g(n,Zt(n));var n,o,i}var $t={},Jt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,onRender:void 0,onClose:void 0,onAfterClose:void 0,onDestroy:void 0,scrollbarPadding:!0},Xt=["title","titleText","text","html","footer","icon","hideClass","customClass","allowOutsideClick","allowEscapeKey","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","buttonsStyling","reverseButtons","imageUrl","imageWidth","imageHeight","imageAlt","progressSteps","currentProgressStep","onClose","onAfterClose","onDestroy"],Gt={animation:'showClass" and "hideClass'},te=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],ee=Object.freeze({isValidParameter:Yt,isUpdatableParameter:function(t){return-1!==Xt.indexOf(t)},isDeprecatedParameter:Zt,argsToParams:function(o){var i={};return"object"!==r(o[0])||b(o[0])?["title","html","icon"].forEach((function(t,e){var n=o[e];"string"==typeof n||b(n)?i[t]=n:void 0!==n&&U("Unexpected type of ".concat(t,'! Expected "string" or "Element", got ').concat(r(n)))})):s(i,o[0]),i},isVisible:function(){return ht(Z())},clickConfirm:Vt,clickCancel:function(){return S()&&S().click()},getContainer:Y,getPopup:Z,getTitle:C,getContent:k,getHtmlContainer:function(){return e(W["html-container"])},getImage:x,getIcon:w,getIcons:n,getCloseButton:q,getActions:E,getConfirmButton:B,getCancelButton:S,getHeader:O,getFooter:T,getTimerProgressBar:L,getFocusableElements:I,getValidationMessage:A,isLoading:M,fire:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return i(this,e)},mixin:function(r){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(i,t);var n,o,e=(n=i,o=d(),function(){var t,e=u(n);return p(this,o?(t=u(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))});function i(){return a(this,i),e.apply(this,arguments)}return c(i,[{key:"_main",value:function(t){return f(u(i.prototype),"_main",this).call(this,s({},r,t))}}]),i}(this)},queue:function(t){var r=this;function a(t,e){Ut=[],t(e)}Ut=t;var c=[];return new Promise((function(i){!function e(n,o){n<Ut.length?(document.body.setAttribute("data-swal2-queue-step",n),r.fire(Ut[n]).then((function(t){void 0!==t.value?(c.push(t.value),e(n+1,o)):a(i,{dismiss:t.dismiss})}))):a(i,{value:c})}(0)}))},getQueueStep:qt,insertQueueStep:function(t,e){return e&&e<Ut.length?Ut.splice(e,0,t):Ut.push(t)},deleteQueueStep:function(t){void 0!==Ut[t]&&Ut.splice(t,1)},showLoading:Ft,enableLoading:Ft,getTimerLeft:function(){return $t.timeout&&$t.timeout.getTimerLeft()},stopTimer:Wt,resumeTimer:Kt,toggleTimer:function(){var t=$t.timeout;return t&&(t.running?Wt:Kt)()},increaseTimer:function(t){if($t.timeout){var e=$t.timeout.increase(t);return at(e,!0),e}},isTimerRunning:function(){return $t.timeout&&$t.timeout.isRunning()}});function ne(){var t,e=Pt.innerParams.get(this);e&&(t=Pt.domCache.get(this),e.showConfirmButton||(nt(t.confirmButton),e.showCancelButton||nt(t.actions)),ft([t.popup,t.actions],W.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.cancelButton.disabled=!1)}function oe(){null===$.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&($.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat($.previousBodyPadding+function(){var t=document.createElement("div");t.className=W["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))}function ie(){return!!window.MSInputMethodContext&&!!document.documentMode}function re(){var t=Y(),e=Z();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")}var ae=function(){var e,t=Y();t.ontouchstart=function(t){e=ce(t.target)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())}},ce=function(t){var e=Y();return t===e||!(it(e)||"INPUT"===t.tagName||it(k())&&k().contains(t))},se={swalPromiseResolve:new WeakMap};function ue(t,e,n,o){var i;n?pe(t,o):(zt().then((function(){return pe(t,o)})),$t.keydownTarget.removeEventListener("keydown",$t.keydownHandler,{capture:$t.keydownListenerCapture}),$t.keydownHandlerAdded=!1),e.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&e.parentNode.removeChild(e),j()&&(null!==$.previousBodyPadding&&(document.body.style.paddingRight="".concat($.previousBodyPadding,"px"),$.previousBodyPadding=null),R(document.body,W.iosfix)&&(i=parseInt(document.body.style.top,10),ft(document.body,W.iosfix),document.body.style.top="",document.body.scrollTop=-1*i),"undefined"!=typeof window&&ie()&&window.removeEventListener("resize",re),h(document.body.children).forEach((function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")}))),ft([document.documentElement,document.body],[W.shown,W["height-auto"],W["no-backdrop"],W["toast-shown"],W["toast-column"]])}function le(t){var e,n,o,i=Z();i&&(e=Pt.innerParams.get(this))&&!R(i,e.hideClass.popup)&&(n=se.swalPromiseResolve.get(this),ft(i,e.showClass.popup),pt(i,e.hideClass.popup),o=Y(),ft(o,e.showClass.backdrop),pt(o,e.hideClass.backdrop),function(t,e,n){var o=Y(),i=wt&&rt(e),r=n.onClose,a=n.onAfterClose;null!==r&&"function"==typeof r&&r(e),i?de(t,e,o,a):ue(t,o,Q(),a)}(this,i,e),void 0!==t?(t.isDismissed=void 0!==t.dismiss,t.isConfirmed=void 0===t.dismiss):t={isDismissed:!0,isConfirmed:!1},n(t||{}))}var de=function(t,e,n,o){$t.swalCloseEventFinishedCallback=ue.bind(null,t,n,Q(),o),e.addEventListener(wt,(function(t){t.target===e&&($t.swalCloseEventFinishedCallback(),delete $t.swalCloseEventFinishedCallback)}))},pe=function(t,e){setTimeout((function(){"function"==typeof e&&e(),t._destroy()}))};function fe(t,e,n){var o=Pt.domCache.get(t);e.forEach((function(t){o[t].disabled=n}))}function me(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode.querySelectorAll("input"),o=0;o<n.length;o++)n[o].disabled=e;else t.disabled=e}var he=function(){function n(t,e){a(this,n),this.callback=t,this.remaining=e,this.running=!1,this.start()}return c(n,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date-this.started),this.remaining}},{key:"increase",value:function(t){var e=this.running;return e&&this.stop(),this.remaining+=t,e&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}]),n}(),ge={email:function(t,e){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address")},url:function(t,e){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")}};function ve(t){var e,n;(e=t).inputValidator||Object.keys(ge).forEach((function(t){e.input===t&&(e.inputValidator=ge[t])})),t.showLoaderOnConfirm&&!t.preConfirm&&N("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),t.animation=F(t.animation),(n=t).target&&("string"!=typeof n.target||document.querySelector(n.target))&&("string"==typeof n.target||n.target.appendChild)||(N('Target parameter is not valid, defaulting to "body"'),n.target="body"),"string"==typeof t.title&&(t.title=t.title.split("\n").join("<br />")),vt(t)}function be(t){var e=Y(),n=Z();"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n),Oe(e,n,t),Se(e,n),j()&&Ee(e,t.scrollbarPadding),Q()||$t.previousActiveElement||($t.previousActiveElement=document.activeElement),"function"==typeof t.onOpen&&setTimeout((function(){return t.onOpen(n)})),ft(e,W["no-transition"])}function ye(t){var e,n=Z();t.target===n&&(e=Y(),n.removeEventListener(wt,ye),e.style.overflowY="auto")}function we(t,e){"select"===e.input||"radio"===e.input?Ie(t,e):-1!==["text","email","number","tel","textarea"].indexOf(e.input)&&v(e.inputValue)&&je(t,e)}function Ce(t,e){t.disableButtons(),e.input?Re(t,e):He(t,e,!0)}function ke(t,e){t.disableButtons(),e(z.cancel)}function xe(t,e){t.closePopup({value:e})}function Pe(e,t,n,o){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1),n.toast||(t.keydownHandler=function(t){return Ue(e,t,o)},t.keydownTarget=n.keydownListenerCapture?window:Z(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}function Ae(t,e,n){var o=I(),i=0;if(0<o.length)return(e+=n)===o.length?e=0:-1===e&&(e=o.length-1),o[e].focus();Z().focus()}function Be(t,e,n){Pt.innerParams.get(t).toast?Ke(t,e,n):(Ze(e),Qe(e),$e(t,e,n))}var Se=function(t,e){wt&&rt(e)?(t.style.overflowY="hidden",e.addEventListener(wt,ye)):t.style.overflowY="auto"},Ee=function(t,e){var n;(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints)&&!R(document.body,W.iosfix)&&(n=document.body.scrollTop,document.body.style.top="".concat(-1*n,"px"),pt(document.body,W.iosfix),ae()),"undefined"!=typeof window&&ie()&&(re(),window.addEventListener("resize",re)),h(document.body.children).forEach((function(t){t===Y()||function(t,e){if("function"==typeof t.contains)return t.contains(e)}(t,Y())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})),e&&oe(),setTimeout((function(){t.scrollTop=0}))},Oe=function(t,e,n){pt(t,n.showClass.backdrop),et(e),pt(e,n.showClass.popup),pt([document.documentElement,document.body],W.shown),n.heightAuto&&n.backdrop&&!n.toast&&pt([document.documentElement,document.body],W["height-auto"])},Te=function(t){return t.checked?1:0},Le=function(t){return t.checked?t.value:null},qe=function(t){return t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null},Ie=function(e,n){function o(t){return Me[n.input](i,Ve(t),n)}var i=k();v(n.inputOptions)?(Ft(),n.inputOptions.then((function(t){e.hideLoading(),o(t)}))):"object"===r(n.inputOptions)?o(n.inputOptions):U("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(r(n.inputOptions)))},je=function(e,n){var o=e.getInput();nt(o),n.inputValue.then((function(t){o.value="number"===n.input?parseFloat(t)||0:"".concat(t),et(o),o.focus(),e.hideLoading()})).catch((function(t){U("Error in inputValue promise: ".concat(t)),o.value="",et(o),o.focus(),e.hideLoading()}))},Me={select:function(t,e,i){var r=mt(t,W.select);e.forEach((function(t){var e=t[0],n=t[1],o=document.createElement("option");o.value=e,V(o,n),i.inputValue.toString()===e.toString()&&(o.selected=!0),r.appendChild(o)})),r.focus()},radio:function(t,e,a){var c=mt(t,W.radio);e.forEach((function(t){var e=t[0],n=t[1],o=document.createElement("input"),i=document.createElement("label");o.type="radio",o.name=W.radio,o.value=e,a.inputValue.toString()===e.toString()&&(o.checked=!0);var r=document.createElement("span");V(r,n),r.className=W.label,i.appendChild(o),i.appendChild(r),c.appendChild(i)}));var n=c.querySelectorAll("input");n.length&&n[0].focus()}},Ve=function(e){var n=[];return"undefined"!=typeof Map&&e instanceof Map?e.forEach((function(t,e){n.push([e,t])})):Object.keys(e).forEach((function(t){n.push([t,e[t]])})),n},Re=function(e,n){var o=function(t,e){var n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return Te(n);case"radio":return Le(n);case"file":return qe(n);default:return e.inputAutoTrim?n.value.trim():n.value}}(e,n);n.inputValidator?(e.disableInput(),Promise.resolve().then((function(){return n.inputValidator(o,n.validationMessage)})).then((function(t){e.enableButtons(),e.enableInput(),t?e.showValidationMessage(t):He(e,n,o)}))):e.getInput().checkValidity()?He(e,n,o):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},He=function(e,t,n){t.showLoaderOnConfirm&&Ft(),t.preConfirm?(e.resetValidationMessage(),Promise.resolve().then((function(){return t.preConfirm(n,t.validationMessage)})).then((function(t){ht(A())||!1===t?e.hideLoading():xe(e,void 0===t?n:t)}))):xe(e,n)},De=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Left","Right","Up","Down"],Ne=["Escape","Esc"],Ue=function(t,e,n){var o=Pt.innerParams.get(t);o.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?_e(t,e,o):"Tab"===e.key?Fe(e,o):-1!==De.indexOf(e.key)?ze():-1!==Ne.indexOf(e.key)&&We(e,o,n)},_e=function(t,e,n){if(!e.isComposing&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(-1!==["textarea","file"].indexOf(n.input))return;Vt(),e.preventDefault()}},Fe=function(t){for(var e=t.target,n=I(),o=-1,i=0;i<n.length;i++)if(e===n[i]){o=i;break}t.shiftKey?Ae(0,o,-1):Ae(0,o,1),t.stopPropagation(),t.preventDefault()},ze=function(){var t=B(),e=S();document.activeElement===t&&ht(e)?e.focus():document.activeElement===e&&ht(t)&&t.focus()},We=function(t,e,n){F(e.allowEscapeKey)&&(t.preventDefault(),n(z.esc))},Ke=function(e,t,n){t.popup.onclick=function(){var t=Pt.innerParams.get(e);t.showConfirmButton||t.showCancelButton||t.showCloseButton||t.input||n(z.close)}},Ye=!1,Ze=function(e){e.popup.onmousedown=function(){e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Ye=!0)}}},Qe=function(e){e.container.onmousedown=function(){e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,t.target!==e.popup&&!e.popup.contains(t.target)||(Ye=!0)}}},$e=function(n,o,i){o.container.onclick=function(t){var e=Pt.innerParams.get(n);Ye?Ye=!1:t.target===o.container&&F(e.allowOutsideClick)&&i(z.backdrop)}},Je=function(t,e,n){var o=L();nt(o),e.timer&&(t.timeout=new he((function(){n("timer"),delete t.timeout}),e.timer),e.timerProgressBar&&(et(o),setTimeout((function(){t.timeout.running&&at(e.timer)}))))},Xe=function(t,e){if(!e.toast)return F(e.allowEnterKey)?e.focusCancel&&ht(t.cancelButton)?t.cancelButton.focus():e.focusConfirm&&ht(t.confirmButton)?t.confirmButton.focus():void Ae(0,-1,1):Ge()},Ge=function(){document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()},tn,en=function(t){for(var e in t)t[e]=new WeakMap},nn=Object.freeze({hideLoading:ne,disableLoading:ne,getInput:function(t){var e=Pt.innerParams.get(t||this),n=Pt.domCache.get(t||this);return n?J(n.content,e.input):null},close:le,closePopup:le,closeModal:le,closeToast:le,enableButtons:function(){fe(this,["confirmButton","cancelButton"],!1)},disableButtons:function(){fe(this,["confirmButton","cancelButton"],!0)},enableInput:function(){return me(this.getInput(),!1)},disableInput:function(){return me(this.getInput(),!0)},showValidationMessage:function(t){var e=Pt.domCache.get(this);V(e.validationMessage,t);var n=window.getComputedStyle(e.popup);e.validationMessage.style.marginLeft="-".concat(n.getPropertyValue("padding-left")),e.validationMessage.style.marginRight="-".concat(n.getPropertyValue("padding-right")),et(e.validationMessage);var o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedBy",W["validation-message"]),X(o),pt(o,W.inputerror))},resetValidationMessage:function(){var t=Pt.domCache.get(this);t.validationMessage&&nt(t.validationMessage);var e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedBy"),ft(e,W.inputerror))},getProgressSteps:function(){return Pt.domCache.get(this).progressSteps},_main:function(t){Qt(t),$t.currentInstance&&$t.currentInstance._destroy(),$t.currentInstance=this;var e=function(t){var e=s({},Jt.showClass,t.showClass),n=s({},Jt.hideClass,t.hideClass),o=s({},Jt,t);return o.showClass=e,o.hideClass=n,!1===t.animation&&(o.showClass={popup:"swal2-noanimation",backdrop:"swal2-noanimation"},o.hideClass={}),o}(t);ve(e),Object.freeze(e),$t.timeout&&($t.timeout.stop(),delete $t.timeout),clearTimeout($t.restoreFocusTimeout);var n=function(t){var e={popup:Z(),container:Y(),content:k(),actions:E(),confirmButton:B(),cancelButton:S(),closeButton:q(),validationMessage:A(),progressSteps:P()};return Pt.domCache.set(t,e),e}(this);return Mt(this,e),Pt.innerParams.set(this,e),function(n,o,i){return new Promise((function(t){var e=function t(e){n.closePopup({dismiss:e})};se.swalPromiseResolve.set(n,t),o.confirmButton.onclick=function(){return Ce(n,i)},o.cancelButton.onclick=function(){return ke(n,e)},o.closeButton.onclick=function(){return e(z.close)},Be(n,o,e),Pe(n,$t,i,e),i.toast&&(i.input||i.footer||i.showCloseButton)?pt(document.body,W["toast-column"]):ft(document.body,W["toast-column"]),we(n,i),be(i),Je($t,i,e),Xe(o,i),setTimeout((function(){o.container.scrollTop=0}))}))}(this,n,e)},update:function(e){var t=Z(),n=Pt.innerParams.get(this);if(!t||R(t,n.hideClass.popup))return N("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");var o={};Object.keys(e).forEach((function(t){rn.isUpdatableParameter(t)?o[t]=e[t]:N('Invalid parameter to update: "'.concat(t,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js'))}));var i=s({},n,o);Mt(this,i),Pt.innerParams.set(this,i),Object.defineProperties(this,{params:{value:s({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){var t=Pt.domCache.get(this),e=Pt.innerParams.get(this);e&&(t.popup&&$t.swalCloseEventFinishedCallback&&($t.swalCloseEventFinishedCallback(),delete $t.swalCloseEventFinishedCallback),$t.deferDisposalTimer&&(clearTimeout($t.deferDisposalTimer),delete $t.deferDisposalTimer),"function"==typeof e.onDestroy&&e.onDestroy(),delete this.params,delete $t.keydownHandler,delete $t.keydownTarget,en(Pt),en(se))}}),on=function(){function r(){if(a(this,r),"undefined"!=typeof window){"undefined"==typeof Promise&&U("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)"),tn=this;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var o=Object.freeze(this.constructor.argsToParams(e));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0,configurable:!0}});var i=this._main(this.params);Pt.promise.set(this,i)}}return c(r,[{key:"then",value:function(t){return Pt.promise.get(this).then(t)}},{key:"finally",value:function(t){return Pt.promise.get(this).finally(t)}}]),r}();s(on.prototype,nn),s(on,ee),Object.keys(nn).forEach((function(t){on[t]=function(){if(tn)return tn[t].apply(tn,arguments)}})),on.DismissReason=z,on.version="9.13.1";var rn=on;return rn.default=rn})),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),swal.mixin({width:400,heightAuto:!1,padding:"2.5rem",buttonsStyling:!1,confirmButtonClass:"btn btn-success",confirmButtonColor:null,cancelButtonClass:"btn btn-secondary",cancelButtonColor:null});var Sticky=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,e),this.selector=t,this.elements=[],this.version="1.3.0",this.vp=this.getViewportSize(),this.body=document.querySelector("body"),this.options={wrap:i.wrap||!1,wrapWith:i.wrapWith||"<span></span>",marginTop:i.marginTop||0,marginBottom:i.marginBottom||0,stickyFor:i.stickyFor||0,stickyClass:i.stickyClass||null,stickyContainer:i.stickyContainer||"body"},this.updateScrollTopPosition=this.updateScrollTopPosition.bind(this),this.updateScrollTopPosition(),window.addEventListener("load",this.updateScrollTopPosition),window.addEventListener("scroll",this.updateScrollTopPosition),this.run()}return _createClass(e,[{key:"run",value:function(){var i=this,e=setInterval((function(){if("complete"===document.readyState){clearInterval(e);var t=document.querySelectorAll(i.selector);i.forEach(t,(function(t){return i.renderElement(t)}))}}),10)}},{key:"renderElement",value:function(t){var i=this;t.sticky={},t.sticky.active=!1,t.sticky.marginTop=parseInt(t.getAttribute("data-margin-top"))||this.options.marginTop,t.sticky.marginBottom=parseInt(t.getAttribute("data-margin-bottom"))||this.options.marginBottom,t.sticky.stickyFor=parseInt(t.getAttribute("data-sticky-for"))||this.options.stickyFor,t.sticky.stickyClass=t.getAttribute("data-sticky-class")||this.options.stickyClass,t.sticky.wrap=!!t.hasAttribute("data-sticky-wrap")||this.options.wrap,t.sticky.stickyContainer=this.options.stickyContainer,t.sticky.container=this.getStickyContainer(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect=this.getRectangle(t),"img"===t.tagName.toLowerCase()&&(t.onload=function(){return t.sticky.rect=i.getRectangle(t)}),t.sticky.wrap&&this.wrapElement(t),this.activate(t)}},{key:"wrapElement",value:function(t){t.insertAdjacentHTML("beforebegin",t.getAttribute("data-sticky-wrapWith")||this.options.wrapWith),t.previousSibling.appendChild(t)}},{key:"activate",value:function(t){t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active&&(t.sticky.active=!0),this.elements.indexOf(t)<0&&this.elements.push(t),t.sticky.resizeEvent||(this.initResizeEvents(t),t.sticky.resizeEvent=!0),t.sticky.scrollEvent||(this.initScrollEvents(t),t.sticky.scrollEvent=!0),this.setPosition(t)}},{key:"initResizeEvents",value:function(t){var i=this;t.sticky.resizeListener=function(){return i.onResizeEvents(t)},window.addEventListener("resize",t.sticky.resizeListener)}},{key:"destroyResizeEvents",value:function(t){window.removeEventListener("resize",t.sticky.resizeListener)}},{key:"onResizeEvents",value:function(t){this.vp=this.getViewportSize(),t.sticky.rect=this.getRectangle(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active?t.sticky.active=!0:(t.sticky.rect.top+t.sticky.rect.height>=t.sticky.container.rect.top+t.sticky.container.rect.height||t.sticky.stickyFor>=this.vp.width&&t.sticky.active)&&(t.sticky.active=!1),this.setPosition(t)}},{key:"initScrollEvents",value:function(t){var i=this;t.sticky.scrollListener=function(){return i.onScrollEvents(t)},window.addEventListener("scroll",t.sticky.scrollListener)}},{key:"destroyScrollEvents",value:function(t){window.removeEventListener("scroll",t.sticky.scrollListener)}},{key:"onScrollEvents",value:function(t){t.sticky&&t.sticky.active&&this.setPosition(t)}},{key:"setPosition",value:function(t){this.css(t,{position:"",width:"",top:"",left:""}),this.vp.height<t.sticky.rect.height||!t.sticky.active||(t.sticky.rect.width||(t.sticky.rect=this.getRectangle(t)),t.sticky.wrap&&this.css(t.parentNode,{display:"block",width:t.sticky.rect.width+"px",height:t.sticky.rect.height+"px"}),0===t.sticky.rect.top&&t.sticky.container===this.body?(this.css(t,{position:"fixed",top:t.sticky.rect.top+"px",left:t.sticky.rect.left+"px",width:t.sticky.rect.width+"px"}),t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass)):this.scrollTop>t.sticky.rect.top-t.sticky.marginTop?(this.css(t,{position:"fixed",width:t.sticky.rect.width+"px",left:t.sticky.rect.left+"px"}),this.scrollTop+t.sticky.rect.height+t.sticky.marginTop>t.sticky.container.rect.top+t.sticky.container.offsetHeight-t.sticky.marginBottom?(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{top:t.sticky.container.rect.top+t.sticky.container.offsetHeight-(this.scrollTop+t.sticky.rect.height+t.sticky.marginBottom)+"px"})):(t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass),this.css(t,{top:t.sticky.marginTop+"px"}))):(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{position:"",width:"",top:"",left:""}),t.sticky.wrap&&this.css(t.parentNode,{display:"",width:"",height:""})))}},{key:"update",value:function(){var i=this;this.forEach(this.elements,(function(t){t.sticky.rect=i.getRectangle(t),t.sticky.container.rect=i.getRectangle(t.sticky.container),i.activate(t),i.setPosition(t)}))}},{key:"destroy",value:function(){var i=this;window.removeEventListener("load",this.updateScrollTopPosition),window.removeEventListener("scroll",this.updateScrollTopPosition),this.forEach(this.elements,(function(t){i.destroyResizeEvents(t),i.destroyScrollEvents(t),delete t.sticky}))}},{key:"getStickyContainer",value:function(t){for(var i=t.parentNode;!i.hasAttribute("data-sticky-container")&&!i.parentNode.querySelector(t.sticky.stickyContainer)&&i!==this.body;)i=i.parentNode;return i}},{key:"getRectangle",value:function(t){this.css(t,{position:"",width:"",top:"",left:""});for(var i=Math.max(t.offsetWidth,t.clientWidth,t.scrollWidth),e=Math.max(t.offsetHeight,t.clientHeight,t.scrollHeight),s=0,n=0;s+=t.offsetTop||0,n+=t.offsetLeft||0,t=t.offsetParent;);return{top:s,left:n,width:i,height:e}}},{key:"getViewportSize",value:function(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}},{key:"updateScrollTopPosition",value:function(){this.scrollTop=(window.pageYOffset||document.scrollTop)-(document.clientTop||0)||0}},{key:"forEach",value:function(t,i){for(var e=0,s=t.length;e<s;e++)i(t[e])}},{key:"css",value:function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t.style[e]=i[e])}}]),e}();!function(t,i){"undefined"!=typeof exports?module.exports=i:"function"==typeof define&&define.amd?define([],(function(){return i})):t.Sticky=i}(this,Sticky);var identity=function(x){return x},isArray=function(value){return $.isArray(value)},isObject=function(value){return!isArray(value)&&value instanceof Object},isNumber=function(value){return value instanceof Number},isFunction=function(value){return value instanceof Function},indexOf=function(object,value){return $.inArray(value,object)},inArray=function(array,value){return-1!==indexOf(array,value)},foreach=function(collection,callback){for(var i in collection)collection.hasOwnProperty(i)&&callback(collection[i],i,collection)},last=function(array){return array[array.length-1]},argumentsToArray=function(args){return Array.prototype.slice.call(args)},extend=function(){var extended={};return foreach(argumentsToArray(arguments),(function(o){foreach(o,(function(val,key){extended[key]=val}))})),extended},mapToArray=function(collection,callback){var mapped=[];return foreach(collection,(function(value,key,coll){mapped.push(callback(value,key,coll))})),mapped},mapToObject=function(collection,callback,keyCallback){var mapped={};return foreach(collection,(function(value,key,coll){key=keyCallback?keyCallback(key,value):key,mapped[key]=callback(value,key,coll)})),mapped},map=function(collection,callback,keyCallback){return isArray(collection)?mapToArray(collection,callback):mapToObject(collection,callback,keyCallback)},pluck=function(arrayOfObjects,key){return map(arrayOfObjects,(function(val){return val[key]}))},filter=function(collection,callback){var filtered;return isArray(collection)?(filtered=[],foreach(collection,(function(val,key,coll){callback(val,key,coll)&&filtered.push(val)}))):(filtered={},foreach(collection,(function(val,key,coll){callback(val,key,coll)&&(filtered[key]=val)}))),filtered},call=function(collection,functionName,args){return map(collection,(function(object,name){return object[functionName].apply(object,args||[])}))},throttle=function(minimumInterval,callback){var timeout=null;return function(){var that=this,args=arguments;null===timeout&&(timeout=setTimeout((function(){timeout=null}),minimumInterval),callback.apply(that,args))}},mixinPubSub=function(object){var topics={};return(object=object||{}).publish=function(topic,data){foreach(topics[topic],(function(callback){callback(data)}))},object.subscribe=function(topic,callback){topics[topic]=topics[topic]||[],topics[topic].push(callback)},object.unsubscribe=function(callback){foreach(topics,(function(subscribers){var index=indexOf(subscribers,callback);-1!==index&&subscribers.splice(index,1)}))},object};!function($){"use strict";var createBaseInput=function(fig,my){var self=mixinPubSub(),$self=fig.$,oldValue;return self.getType=function(){throw'implement me (return type. "text", "radio", etc.)'},self.$=function(selector){return selector?$self.find(selector):$self},self.disable=function(){self.$().prop("disabled",!0),self.publish("isEnabled",!1)},self.enable=function(){self.$().prop("disabled",!1),self.publish("isEnabled",!0)},my.equalTo=function(a,b){return a===b},my.publishChange=function(e,domElement){var newValue=self.get();my.equalTo(newValue,oldValue)||self.publish("change",{e:e,domElement:domElement}),oldValue=newValue},self},createInput=function(fig,my){var self=createBaseInput(fig,my);return self.get=function(){return self.$().val()},self.set=function(newValue){self.$().val(newValue)},self.clear=function(){self.set("")},my.buildSetter=function(callback){return function(newValue){callback.call(self,newValue)}},self},inputEqualToArray=function(a,b){a=isArray(a)?a:[a],b=isArray(b)?b:[b];var isEqual=!0;return a.length!==b.length?isEqual=!1:foreach(a,(function(value){inArray(b,value)||(isEqual=!1)})),isEqual},createInputButton=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"button"},self.$().on("change",(function(e){my.publishChange(e,this)})),self},createInputCheckbox=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"checkbox"},self.get=function(){var values=[];return self.$().filter(":checked").each((function(){values.push($(this).val())})),values},self.set=function(newValues){newValues=isArray(newValues)?newValues:[newValues],self.$().each((function(){$(this).prop("checked",!1)})),foreach(newValues,(function(value){self.$().filter('[value="'+value+'"]').prop("checked",!0)}))},my.equalTo=inputEqualToArray,self.$().change((function(e){my.publishChange(e,this)})),self},createInputEmail=function(fig){var my,self=createInputText(fig,{});return self.getType=function(){return"email"},self},createInputFile=function(fig){var my={},self=createBaseInput(fig,my);return self.getType=function(){return"file"},self.get=function(){return last(self.$().val().split("\\"))},self.clear=function(){this.$().each((function(){$(this).wrap("<form>").closest("form").get(0).reset(),$(this).unwrap()}))},self.$().change((function(e){my.publishChange(e,this)})),self},createInputHidden=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"hidden"},self.$().change((function(e){my.publishChange(e,this)})),self},createInputMultipleFile=function(fig){var my={},self=createBaseInput(fig,my);return self.getType=function(){return"file[multiple]"},self.get=function(){var fileListObject=self.$().get(0).files||[],names=[],i;for(i=0;i<(fileListObject.length||0);i+=1)names.push(fileListObject[i].name);return names},self.clear=function(){this.$().each((function(){$(this).wrap("<form>").closest("form").get(0).reset(),$(this).unwrap()}))},self.$().change((function(e){my.publishChange(e,this)})),self},createInputMultipleSelect=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"select[multiple]"},self.get=function(){return self.$().val()||[]},self.set=function(newValues){self.$().val(""===newValues?[]:isArray(newValues)?newValues:[newValues])},my.equalTo=inputEqualToArray,self.$().change((function(e){my.publishChange(e,this)})),self},createInputPassword=function(fig){var my,self=createInputText(fig,{});return self.getType=function(){return"password"},self},createInputRadio=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"radio"},self.get=function(){return self.$().filter(":checked").val()||null},self.set=function(newValue){newValue?self.$().filter('[value="'+newValue+'"]').prop("checked",!0):self.$().each((function(){$(this).prop("checked",!1)}))},self.$().change((function(e){my.publishChange(e,this)})),self},createInputRange=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"range"},self.$().change((function(e){my.publishChange(e,this)})),self},createInputSelect=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"select"},self.$().change((function(e){my.publishChange(e,this)})),self},createInputText=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"text"},self.$().on("change keyup keydown",(function(e){my.publishChange(e,this)})),self},createInputTextarea=function(fig){var my={},self=createInput(fig,my);return self.getType=function(){return"textarea"},self.$().on("change keyup keydown",(function(e){my.publishChange(e,this)})),self},createInputURL=function(fig){var my,self=createInputText(fig,{});return self.getType=function(){return"url"},self},buildFormInputs=function(fig){var inputs={},$self=fig.$,constructor=fig.constructorOverride||{button:createInputButton,text:createInputText,url:createInputURL,email:createInputEmail,password:createInputPassword,range:createInputRange,textarea:createInputTextarea,select:createInputSelect,"select[multiple]":createInputMultipleSelect,radio:createInputRadio,checkbox:createInputCheckbox,file:createInputFile,"file[multiple]":createInputMultipleFile,hidden:createInputHidden},addInputsBasic=function(type,selector){var $input;(isObject(selector)?selector:$self.find(selector)).each((function(){var name=$(this).attr("name");inputs[name]=constructor[type]({$:$(this)})}))},addInputsGroup=function(type,selector){var names=[],$input=isObject(selector)?selector:$self.find(selector);isObject(selector)?inputs[$input.attr("name")]=constructor[type]({$:$input}):($input.each((function(){-1===indexOf(names,$(this).attr("name"))&&names.push($(this).attr("name"))})),foreach(names,(function(name){inputs[name]=constructor[type]({$:$self.find('input[name="'+name+'"]')})})))};return $self.is("input, select, textarea")?$self.is('input[type="button"], button, input[type="submit"]')?addInputsBasic("button",$self):$self.is("textarea")?addInputsBasic("textarea",$self):$self.is('input[type="text"]')||$self.is("input")&&!$self.attr("type")?addInputsBasic("text",$self):$self.is('input[type="password"]')?addInputsBasic("password",$self):$self.is('input[type="email"]')?addInputsBasic("email",$self):$self.is('input[type="url"]')?addInputsBasic("url",$self):$self.is('input[type="range"]')?addInputsBasic("range",$self):$self.is("select")?$self.is("[multiple]")?addInputsBasic("select[multiple]",$self):addInputsBasic("select",$self):$self.is('input[type="file"]')?$self.is("[multiple]")?addInputsBasic("file[multiple]",$self):addInputsBasic("file",$self):$self.is('input[type="hidden"]')?addInputsBasic("hidden",$self):$self.is('input[type="radio"]')?addInputsGroup("radio",$self):$self.is('input[type="checkbox"]')?addInputsGroup("checkbox",$self):addInputsBasic("text",$self):(addInputsBasic("button",'input[type="button"], button, input[type="submit"]'),addInputsBasic("text",'input[type="text"]'),addInputsBasic("password",'input[type="password"]'),addInputsBasic("email",'input[type="email"]'),addInputsBasic("url",'input[type="url"]'),addInputsBasic("range",'input[type="range"]'),addInputsBasic("textarea","textarea"),addInputsBasic("select","select:not([multiple])"),addInputsBasic("select[multiple]","select[multiple]"),addInputsBasic("file",'input[type="file"]:not([multiple])'),addInputsBasic("file[multiple]",'input[type="file"][multiple]'),addInputsBasic("hidden",'input[type="hidden"]'),addInputsGroup("radio",'input[type="radio"]'),addInputsGroup("checkbox",'input[type="checkbox"]')),inputs};$.fn.inputVal=function(newValue){var $self=$(this),inputs=buildFormInputs({$:$self});return $self.is("input, textarea, select")?void 0===newValue?inputs[$self.attr("name")].get():(inputs[$self.attr("name")].set(newValue),$self):void 0===newValue?call(inputs,"get"):(foreach(newValue,(function(value,inputName){inputs[inputName].set(value)})),$self)},$.fn.inputOnChange=function(callback){var $self=$(this),inputs=buildFormInputs({$:$self});return foreach(inputs,(function(input){input.subscribe("change",(function(data){callback.call(data.domElement,data.e)}))})),$self},$.fn.inputDisable=function(){var $self=$(this);return call(buildFormInputs({$:$self}),"disable"),$self},$.fn.inputEnable=function(){var $self=$(this);return call(buildFormInputs({$:$self}),"enable"),$self},$.fn.inputClear=function(){var $self=$(this);return call(buildFormInputs({$:$self}),"clear"),$self}}(jQuery),$.fn.repeaterVal=function(){var parse,build=function(parsed){if(1===parsed.length&&(0===parsed[0].key.length||1===parsed[0].key.length&&!parsed[0].key[0]))return parsed[0].val;foreach(parsed,(function(p){p.head=p.key.shift()}));var grouped=function(){var grouped={};return foreach(parsed,(function(p){grouped[p.head]||(grouped[p.head]=[]),grouped[p.head].push(p)})),grouped}(),built;return/^[0-9]+$/.test(parsed[0].head)?(built=[],foreach(grouped,(function(group){built.push(build(group))}))):(built={},foreach(grouped,(function(group,key){built[key]=build(group)}))),built};return build(function(raw){var parsed=[];return foreach(raw,(function(val,key){var parsedKey=[];"undefined"!==key&&(parsedKey.push(key.match(/^[^\[]*/)[0]),parsedKey=parsedKey.concat(map(key.match(/\[[^\]]*\]/g),(function(bracketed){return bracketed.replace(/[\[\]]/g,"")}))),parsed.push({val:val,key:parsedKey}))})),parsed}($(this).inputVal()))},$.fn.repeater=function(fig){var setList;return fig=fig||{},$(this).each((function(){var $self=$(this),show=fig.show||function(){$(this).show()},hide=fig.hide||function(removeElement){removeElement()},$list=$self.find("[data-repeater-list]").first(),$filterNested=function($items,repeaters){return $items.filter((function(){return!repeaters||0===$(this).closest(pluck(repeaters,"selector").join(",")).length}))},$items=function(){return $filterNested($list.find("[data-repeater-item]"),fig.repeaters)},$itemTemplate=$list.find("[data-repeater-item]").first().clone().hide(),$firstDeleteButton=$filterNested($filterNested($(this).find("[data-repeater-item]"),fig.repeaters).first().find("[data-repeater-delete]"),fig.repeaters);fig.isFirstItemUndeletable&&$firstDeleteButton&&$firstDeleteButton.remove();var getGroupName=function(){var groupName=$list.data("repeater-list");return fig.$parent?fig.$parent.data("item-name")+"["+groupName+"]":groupName},initNested=function($listItems){fig.repeaters&&$listItems.each((function(){var $item=$(this);foreach(fig.repeaters,(function(nestedFig){$item.find(nestedFig.selector).repeater(extend(nestedFig,{$parent:$item}))}))}))},$foreachRepeaterInItem=function(repeaters,$item,cb){repeaters&&foreach(repeaters,(function(nestedFig){cb.call($item.find(nestedFig.selector)[0],nestedFig)}))},setIndexes=function($items,groupName,repeaters){$items.each((function(index){var $item=$(this);$item.data("item-name",groupName+"["+index+"]"),$filterNested($item.find("[name]"),repeaters).each((function(){var $input=$(this),matches=$input.attr("name").match(/\[[^\]]+\]/g),name=matches?last(matches).replace(/\[|\]/g,""):$input.attr("name"),newName=groupName+"["+index+"]["+name+"]"+($input.is(":checkbox")||$input.attr("multiple")?"[]":"");$input.attr("name",newName),$foreachRepeaterInItem(repeaters,$item,(function(nestedFig){var $repeater=$(this);setIndexes($filterNested($repeater.find("[data-repeater-item]"),nestedFig.repeaters||[]),groupName+"["+index+"]["+$repeater.find("[data-repeater-list]").first().data("repeater-list")+"]",nestedFig.repeaters)}))}))})),$list.find("input[name][checked]").removeAttr("checked").prop("checked",!0)};setIndexes($items(),getGroupName(),fig.repeaters),initNested($items()),fig.initEmpty&&$items().remove(),fig.ready&&fig.ready((function(){setIndexes($items(),getGroupName(),fig.repeaters)}));var appendItem=(setItemsValues=function($item,data,repeaters){if(data||fig.defaultValues){var inputNames={};$filterNested($item.find("[name]"),repeaters).each((function(){var key=$(this).attr("name").match(/\[([^\]]*)(\]|\]\[\])$/)[1];inputNames[key]=$(this).attr("name")})),$item.inputVal(map(filter(data||fig.defaultValues,(function(val,name){return inputNames[name]})),identity,(function(name){return inputNames[name]})))}$foreachRepeaterInItem(repeaters,$item,(function(nestedFig){var $repeater=$(this);$filterNested($repeater.find("[data-repeater-item]"),nestedFig.repeaters).each((function(){var fieldName=$repeater.find("[data-repeater-list]").data("repeater-list");if(data&&data[fieldName]){var $template=$(this).clone();$repeater.find("[data-repeater-item]").remove(),foreach(data[fieldName],(function(data){var $item=$template.clone();setItemsValues($item,data,nestedFig.repeaters||[]),$repeater.find("[data-repeater-list]").append($item)}))}else setItemsValues($(this),nestedFig.defaultValues,nestedFig.repeaters||[])}))}))},function($item,data){$list.append($item),setIndexes($items(),getGroupName(),fig.repeaters),$item.find("[name]").each((function(){$(this).inputClear()})),setItemsValues($item,data||fig.defaultValues,fig.repeaters)}),setItemsValues,addItem=function(data){var $item=$itemTemplate.clone();appendItem($item,data),fig.repeaters&&initNested($item),show.call($item.get(0))};setList=function(rows){$items().remove(),foreach(rows,addItem)},$filterNested($self.find("[data-repeater-create]"),fig.repeaters).click((function(){addItem()})),$list.on("click","[data-repeater-delete]",(function(){var self=$(this).closest("[data-repeater-item]").get(0);hide.call(self,(function(){$(self).remove(),setIndexes($items(),getGroupName(),fig.repeaters)}))}))})),this.setList=setList,this}; |