/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.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(e,n){ce.fn[n]=function(e,t){return 0{function u(i,{target:e=document,detail:t={},bubbles:r=!0,cancelable:s=!0}={}){let n=new CustomEvent(i,{detail:t,bubbles:r,cancelable:s});return e.dispatchEvent(n),n}function $e(i){setTimeout(i,1)}function k(i,...e){let t=ft(pt(i,e)).split(` `),r=t[0].match(/^\s+/),s=r?r[0].length:0;return t.map(n=>n.slice(s)).join(` `)}function ft(i){return i.replace(/^\n/,"")}function pt(i,e){return i.reduce((t,r,s)=>{let n=e[s]==null?"":e[s];return t+r+n},"")}function w(i){return Array.prototype.slice.call(i)}function x(){return Array.apply(null,{length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}var mt=/[^.]*(?=\..*)\.|.*/,gt=/\..*/,yt=/::\d+$/,Ie={},Je=1,Ke={mouseenter:"mouseover",mouseleave:"mouseout"},vt=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]),d=class{static on(e,t,r,s,n){We(e,t,r,s,n,!1)}static one(e,t,r,s,n){We(e,t,r,s,n,!0)}static off(e,t,r,s,n){if(typeof t!="string"||!e)return;let[o,a,l,f]=Ze(t,r,s,n),h=l!==t,c=Xe(e),p=c[l]||{},g=t.startsWith(".");if(typeof a<"u"){if(!p)return;Fe(e,c,l,a,o?r:null,f);return}if(g)for(let m of Object.keys(c))wt(e,c,m,t.slice(1));for(let m of Object.keys(p)){let N=m.replace(yt,"");if(!h||t.includes(N)){let X=p[m];Fe(e,c,l,X.callable,X.delegationSelector,f)}}}static dispatch(e,{target:t=document,detail:r={},bubbles:s=!0,cancelable:n=!0}={}){return u(e,{target:t,detail:r,bubbles:s,cancelable:n})}static trigger(e,t,{detail:r={},bubbles:s=!0,cancelable:n=!0}={}){return u(t,{target:e,detail:r,bubbles:s,cancelable:n})}};function ze(i,e){return e&&`${e}::${Je++}`||i.uidEvent||Je++}function Xe(i){let e=ze(i);return i.uidEvent=e,Ie[e]=Ie[e]||{},Ie[e]}function Qe(i,e,t=null){return Object.values(i).find(r=>r.callable===e&&r.delegationSelector===t)}function Ze(i,e,t,r){let s=typeof e=="string",n=s?t:e,o=s?r:t,a=xt(i);return vt.has(a)||(a=i),[s,n,a,o]}function We(i,e,t,r,s,n){if(typeof e!="string"||!i)return;let[o,a,l,f]=Ze(e,t,r,s);e in Ke&&(a=(X=>function(j){if(!j.relatedTarget||j.relatedTarget!==j.delegateTarget&&!j.delegateTarget.contains(j.relatedTarget))return X.call(this,j)})(a));let h=Xe(i),c=h[l]||(h[l]={}),p=Qe(c,a,o?t:null);if(p){p.oneOff=p.oneOff&&n;return}let g=ze(a,e.replace(mt,"")),m=o?bt(i,t,a):Et(i,a);m.delegationSelector=o?t:null,m.callable=a,m.oneOff=n,m.uidEvent=g,c[g]=m,i.addEventListener(l,m,f)}function Fe(i,e,t,r,s,n){let o=Qe(e[t],r,s);o&&(i.removeEventListener(t,o,n),delete e[t][o.uidEvent])}function Et(i,e){return function t(r){return r.delegateTarget=i,t.oneOff&&d.off(i,r.type,e),e.apply(i,[r])}}function bt(i,e,t){return function r(s){let n=i.querySelectorAll(e);for(let{target:o}=s;o&&o!==this;o=o.parentNode)for(let a of n)if(a===o)return s.delegateTarget=o,r.oneOff&&d.off(i,s.type,e,t),t.apply(o,[s])}}function wt(i,e,t,r){let s=e[t]||{};for(let n of Object.keys(s))if(n.includes(r)){let o=s[n];Fe(i,e,t,o.callable,o.delegationSelector)}}function xt(i){return i=i.replace(gt,""),Ke[i]||i}var Q=class{constructor(e={},t=200){let{__ajax:r,...s}=e;this.ok=!!r.ok,this.severity=r.severity||"info",this.message=r.message??null,this.data=s||{},this.invalid=r.invalid||{},this.ops=Array.isArray(r.ops)?r.ops:[],this.redirect=null,this.status=t}isFatal(){return this.severity==="fatal"||this.status>=500&&this.status<=599}isError(){return this.severity==="error"||this.isFatal()||this.ok===!1}getMessage(){return this.message}getInvalid(){return this.invalid||{}}getData(){return this.data||{}}getStatus(){return this.status}getSeverity(){return this.severity}getOps(e){return e?this.ops.filter(t=>t?.op===e):this.ops}getFlash(){return this.getOps("flash").map(({level:e="info",text:t=""})=>({level:e,text:t}))}getBrowserEvents(){return this.getOps("dispatch").map(({selector:e=null,event:t,detail:r,async:s})=>({selector:e,event:t,detail:r,async:s}))}getDomPatches(){return this.getOps("patchDom").map(({selector:e,html:t="",swap:r="update"})=>({selector:e,html:t,swap:r}))}getPartials(){return this.getOps("partial").map(({name:e,html:t=""})=>({name:e,html:t}))}getAssets(){let e={js:[],css:[],img:[]},t={js:new Set,css:new Set,img:new Set};for(let{type:r,assets:s=[]}of this.getOps("loadAssets"))if(e[r])for(let n of s){if(n.inline){e[r].push(n);continue}let o=typeof n=="string"?n:n.url;t[r].has(o)||(t[r].add(o),e[r].push(typeof n=="string"?{url:n}:n))}return e}getRedirectUrl(){return this.getOps("redirect")[0]?.url||this.redirect||null}getReload(){return this.getOps("reload")[0]||null}};var Z=class{constructor(e,t){if(!e)throw new Error("The request handler name is not specified.");if(!e.match(/^(?:\w+\:{2})?on*/))throw new Error('Invalid handler name. The correct handler name format is: "onEvent".');if(typeof FormData>"u")throw new Error("The browser does not support the FormData interface.");this.options=t,this.handler=e}static fetch(e,t){return new this(e,t).getRequestOptions()}getRequestOptions(){return{method:"POST",url:this.options.url?this.options.url:window.location.href,headers:this.buildHeaders()}}buildHeaders(){let{handler:e,options:t}=this,r={"X-Requested-With":"XMLHttpRequest","X-AJAX-HANDLER":e};t.files||(r["Content-Type"]=t.bulk?"application/json":"application/x-www-form-urlencoded"),t.flash&&(r["X-AJAX-FLASH"]=1),t.partial&&(r["X-AJAX-PARTIAL"]=t.partial);var s=this.extractPartials(t.update,t.partial);s&&(r["X-AJAX-PARTIALS"]=s);var n=this.getXSRFToken();n&&(r["X-XSRF-TOKEN"]=n);var o=this.getCSRFToken();return o&&(r["X-CSRF-TOKEN"]=o),t.headers&&t.headers.constructor==={}.constructor&&Object.assign(r,t.headers),r}extractPartials(e={},t){var r=[];if(e){if(typeof e!="object")throw new Error("Invalid update value. The correct format is an object ({...})");for(var s in e)s==="_self"&&t?r.push(t):r.push(s)}return r.join("&")}getCSRFToken(){var e=document.querySelector('meta[name="csrf-token"]');return e?e.getAttribute("content"):null}getXSRFToken(){var e=null;if(document.cookie&&document.cookie!="")for(var t=document.cookie.split(";"),r=0;rt()),s}async loadCollection(e={}){let t=(e.js??[]).map(Oe).filter(n=>n.inline||!Ge(n.url)),r=(e.css??[]).map(Oe).filter(n=>!Ye(n.url)),s=(e.img??[]).map(Oe);!t.length&&!r.length&&!s.length||await Promise.all([this.loadJavaScript(t),Promise.all(r.map(n=>this.loadStyleSheet(n))),this.loadImages(s)])}loadStyleSheet(e){let{url:t,attributes:r={}}=e;return new Promise((s,n)=>{if(Ye(t)){s(null);return}let o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=t;for(let[a,l]of Object.entries(r))l===!0?o.setAttribute(a,""):l!==!1&&l!=null&&o.setAttribute(a,l);o.onload=()=>s(o),o.onerror=()=>n(new Error(`Failed to load CSS: ${t}`)),document.head.appendChild(o)})}loadJavaScript(e){return e.reduce((t,r)=>{if(r.inline)return t.then(()=>new Promise((o,a)=>{let l=document.createElement("script"),f=r.attributes||{};f.type&&(l.type=f.type);for(let[h,c]of Object.entries(f))h!=="type"&&(c===!0?l.setAttribute(h,""):c!==!1&&c!=null&&l.setAttribute(h,c));if(l.type==="module"){let h="_lj"+ ++At;window[h]=()=>{delete window[h],o(l)},l.textContent=r.inline+` window['${h}']();`}else l.textContent=r.inline;document.head.appendChild(l),l.type!=="module"&&o(l)}));let{url:s,attributes:n={}}=r;return t.then(()=>new Promise((o,a)=>{if(Ge(s)){o(null);return}let l=document.createElement("script");n.type?l.type=n.type:l.type="text/javascript",l.src=s;for(let[f,h]of Object.entries(n))f!=="type"&&(h===!0?l.setAttribute(f,""):h!==!1&&h!=null&&l.setAttribute(f,h));l.onload=()=>o(l),l.onerror=()=>a(new Error(`Failed to load JS: ${s}`)),document.head.appendChild(l)}))},Promise.resolve())}loadImages(e){return e.length?Promise.all(e.map(t=>new Promise((r,s)=>{let{url:n}=t,o=new Image;o.onload=()=>r(n),o.onerror=()=>s(new Error(`Failed to load image: ${n}`)),o.src=n}))):Promise.resolve()}},At=0;function Ge(i){return!!document.querySelector(`head script[src="${_e(i)}"]`)}function Ye(i){return!!document.querySelector(`head link[href="${_e(i)}"]`)}function Oe(i){return typeof i=="string"?{url:i}:i}function _e(i){return String(i).replace(/"/g,'\\"')}var G={replace:"replace",prepend:"prepend",append:"append",update:"update"},Y=class{constructor(e,t,r={}){this.options=r,this.envelope=e,this.partialMap=t,this.afterUpdateCallback=null}apply(){this.applyPartialUpdates(),this.applyDomUpdates()}afterUpdate(e){this.afterUpdateCallback=e}applyPartialUpdates(){this.envelope.getPartials().forEach(t=>{let r=this.partialMap[t.name],s=[];this.partialMap._self&&t.name==this.options.partial&&this.options.partialEl?(r=this.partialMap._self,s=[this.options.partialEl]):r&&(s=De(r,'[data-ajax-partial="'+t.name+'"]')),s.forEach(n=>{this.patchDom(n,t.html,St(r,n))})})}applyDomUpdates(){this.envelope.getDomPatches().forEach(t=>{document.querySelectorAll(t.selector).forEach(r=>{this.patchDom(r,t.html,t.swap)})})}patchDom(e,t,r){let s=e.parentNode;switch(r){case"append":case"beforeend":e.insertAdjacentHTML("beforeend",t),H(e,t);break;case"after":case"afterend":e.insertAdjacentHTML("afterend",t),H(e,t);break;case"before":case"beforebegin":e.insertAdjacentHTML("beforebegin",t),H(e,t);break;case"prepend":case"afterbegin":e.insertAdjacentHTML("afterbegin",t),H(e,t);break;case"replace":case"outerHTML":e.outerHTML=t,H(s,t);break;default:case"update":case"innerHTML":e.innerHTML=t,Lt(e);break}this.afterUpdateCallback&&this.afterUpdateCallback(e)}};function De(i,e){return i===!0?document.querySelectorAll(e):typeof i!="string"?[i]:["#",".","@","^","!","="].indexOf(i.charAt(0))===-1?[]:(["@","^","!","="].indexOf(i.charAt(0))!==-1&&(i=i.substring(1)),i||(i=e),document.querySelectorAll(i))}function St(i,e){if(typeof i=="string"){if(i.charAt(0)==="!")return G.replace;if(i.charAt(0)==="@")return G.append;if(i.charAt(0)==="^")return G.prepend}return e.dataset.ajaxUpdateMode!==void 0?e.dataset.ajaxUpdateMode:G.update}function Lt(i){Array.from(i.querySelectorAll("script")).forEach(e=>{let t=document.createElement("script");Array.from(e.attributes).forEach(r=>t.setAttribute(r.name,r.value)),t.appendChild(document.createTextNode(e.innerHTML)),e.parentNode.replaceChild(t,e)})}function H(i,e){let t=document.createElement("div");t.innerHTML=e,Array.from(t.querySelectorAll("script")).forEach(r=>{let s=document.createElement("script");Array.from(r.attributes).forEach(n=>s.setAttribute(n.name,n.value)),s.appendChild(document.createTextNode(r.innerHTML)),i.appendChild(s),i.removeChild(s)})}var P=null;function et(i){P=i}function B(){return P?.isEnabled()??!1}function $(i,e){return P?(P.visit(i,e),!0):!1}function tt(){return P?.controller??null}function rt(){return P?.pageReady()??null}function _(){let i=B()?tt().getLastVisitUrl():Tt();return!i||Bt(i)?null:i}function Tt(){if(!document.referrer)return null;try{let i=new URL(document.referrer);if(i.origin!==location.origin)return null;let e=localStorage.getItem("ocPushStateReferrer");return e&&e.indexOf(i.pathname)===0?e:document.referrer}catch{}}function Bt(i){let e=new URL(i,window.location.origin),t=new URL(window.location.href);return e.origin===t.origin&&e.pathname===t.pathname}function ee(i,e=null){return(...t)=>{let r=Promise.resolve().then(()=>i.apply(e,t));return st(r)}}function st(i){return Object.assign(i,{done(e){return i.then(e),this},fail(e){return i.catch(e),this},always(e){return i.finally(e),this}})}function it(i){i||(i=()=>{});let e=!1,t=()=>{},r,s,n=new Promise((o,a)=>{r=o,s=a,i(l=>{e||o(l)},l=>{e||a(l)},l=>{t=l})});return n.abort=()=>{e=!0,t()},n.cancel=n.abort,n.onCancel=o=>(t=typeof o=="function"?o:t,n),n.resolve=o=>{e||r(o)},n.reject=o=>{e||s(o)},st(n)}var te=class{constructor(e,t,r){this.el=e.el,this.delegate=e,this.context=t,this.options=r,this.context.start=this.start.bind(this),this.context.success=ee(this.success,this),this.context.error=ee(this.error,this),this.context.complete=ee(this.complete,this),this.context.cancel=this.cancel.bind(this),this.context.handleErrorMessage=this.handleErrorMessage.bind(this),this.context.handleBrowserEvents=this.handleBrowserEvents.bind(this)}invoke(e,t=[]){if(this.options[e])return this.options[e].apply(this.context,t);if(this[e])return this[e](...t)}invokeFunc(e,t=null){if(this.options[e])return this.options[e](this.el,this.context,t)}start(e){this.invoke("markAsUpdating",[!0]),this.delegate.options.message&&this.invoke("handleProgressMessage",[this.delegate.options.message,!1])}async success(e,t,r){if(this.invoke("beforeUpdate",[e,t,r])!==!1&&this.invokeFunc("beforeUpdateFunc",e)!==!1&&this.delegate.applicationAllowsUpdate(e,t,r)){if(e instanceof Blob){this.invoke("handleFileDownload",[e,r]),this.delegate.notifyApplicationRequestSuccess(e,t,r),this.invokeFunc("successFunc",e);return}e.$env?.isFatal()||(await this.invoke("handleUpdateOperations",[e,t,r]),await this.invoke("handleUpdateResponse",[e,t,r])),this.delegate.notifyApplicationRequestSuccess(e,t,r),this.invokeFunc("successFunc",e)}}async error(e,t,r){let s=e.$env?.getMessage();window.jaxUnloading!==void 0&&window.jaxUnloading||(this.delegate.toggleRedirect(!1),e.$env&&!e.$env.isFatal()?(await this.invoke("handleUpdateOperations",[e,t,r]),await this.invoke("handleUpdateResponse",[e,t,r])):s||(e.constructor==={}.constructor?e.message?s=e.message:(s="Something went wrong! Check the browser console.",console.warn(e)):s=e),this.el!==document&&this.el.setAttribute("data-error-message",s),this.delegate.applicationAllowsError(e,t,r)&&this.invokeFunc("errorFunc",e)!==!1&&this.invoke("handleErrorMessage",[s,e.$env?.getSeverity()]))}async complete(e,t,r){this.delegate.notifyApplicationRequestComplete(e,t,r),this.invokeFunc("completeFunc",e),this.invoke("markAsUpdating",[!1]),this.delegate.options.message&&this.invoke("handleProgressMessage",[null,!0])}cancel(){this.invokeFunc("cancelFunc"),this.delegate.notifyApplicationRequestCancel()}handleConfirmMessage(e){let t,r;if(new Promise((o,a)=>{t=o,r=a}).then(()=>{this.delegate.sendInternal()}).catch(()=>{this.invoke("cancel",[])}),this.delegate.notifyApplicationConfirmMessage(e,{resolve:t,reject:r}).defaultPrevented)return!1;if(e){let o=confirm(e);return o||this.invoke("cancel",[]),o}}handleProgressMessage(e,t){}handleFlashMessage(e,t){}handleErrorMessage(e,t){this.delegate.notifyApplicationErrorMessage(e).defaultPrevented||e&&alert(e)}handleValidationMessage(e,t){if(this.delegate.notifyApplicationBeforeValidate(e,t),!!this.delegate.formEl){var r=!0;for(var s in t){var n,o=[];n=s.replace(/\.(\w+)/g,"[$1]"),o.push('[name="'+n+'"]:not([disabled])'),o.push('[name="'+n+'[]"]:not([disabled])'),n=("."+s).replace(/\.(\w+)/g,"[$1]"),o.push('[name$="'+n+'"]:not([disabled])'),o.push('[name$="'+n+'[]"]:not([disabled])');var a=s.replace(/\.[0-9]+$/g,"");s!==a&&(n=a.replace(/\.(\w+)/g,"[$1]"),o.push('[name="'+n+'[]"]:not([disabled])'),n=("."+a).replace(/\.(\w+)/g,"[$1]"),o.push('[name$="'+n+'[]"]:not([disabled])'));var l=this.delegate.formEl.querySelector(o.join(", "));if(l){let f=this.delegate.notifyApplicationFieldInvalid(l,s,t[s],r);r&&(f.defaultPrevented||l.focus(),r=!1)}}}}async handleBrowserEvents(e=[]){if(!e.length)return!1;let t=!1;for(let r of e)r?.async===!0?await new Promise((n,o)=>{let a=!1,l=c=>{a||(a=!0,n(c))},f=c=>{a||(a=!0,o(c))};this.delegate.notifyApplicationCustomEvent(r.event,{...r.detail||{},context:this.context,promise:{resolve:l,reject:f}})?.defaultPrevented&&(t=!0)}):this.delegate.notifyApplicationCustomEvent(r.event,{...r.detail||{},context:this.context})?.defaultPrevented&&(t=!0);return t}handleRedirectResponse(e){this.delegate.notifyApplicationBeforeRedirect().defaultPrevented||(this.options.browserRedirectBack&&(e=_()||e),B()?$(e):(this.delegate.markNavigating(),location.assign(e)))}handleReloadResponse(){this.delegate.markNavigating(),location.reload()}markAsUpdating(e){var t=this.options.update||{};for(var r in t){let s=t[r],n=[];t._self&&r==this.options.partial&&this.delegate.partialEl?(s=t._self,n=[this.delegate.partialEl]):n=De(s,'[data-ajax-partial="'+r+'"]'),n.forEach(function(o){e?o.setAttribute("data-ajax-updating",""):o.removeAttribute("data-ajax-updating")})}}async handleUpdateResponse(e,t,r){if(!e.$env)return;let s=this.options.update||{},n=new Y(e.$env,s,{partial:this.options.partial,partialEl:this.delegate.partialEl});n.afterUpdate(o=>{this.delegate.notifyApplicationAjaxUpdate(o,e,t,r)}),n.apply(),setTimeout(()=>{this.delegate.notifyApplicationUpdateComplete(e,t,r),this.invoke("afterUpdate",[e,t,r]),this.invokeFunc("afterUpdateFunc",e)},0)}async handleUpdateOperations(e,t,r){let s=this.delegate.options.flash?e.$env?.getFlash():null;if(s)for(let f of s)this.invoke("handleFlashMessage",[f.text,f.level]);let n=e.$env?.getBrowserEvents();if(n&&await this.invoke("handleBrowserEvents",[n]))return;let o=e.$env?.getRedirectUrl();o&&this.delegate.toggleRedirect(o),this.delegate.isRedirect&&this.invoke("handleRedirectResponse",[this.delegate.options.redirect]),e.$env?.getReload()&&this.invoke("handleReloadResponse");let a=e.$env?.getInvalid();a&&this.invoke("handleValidationMessage",[e.$env?.getMessage(),a]);let l=e.$env?.getAssets();l&&await q.load(l)}handleFileDownload(e,t){if(this.options.browserTarget){window.open(window.URL.createObjectURL(e),this.options.browserTarget);return}let r=Rt(t);if(!r)return;let s=document.createElement("a");s.href=window.URL.createObjectURL(e),s.download=r,s.target="_blank",s.click(),window.URL.revokeObjectURL(s.href)}applyQueryToUrl(e){let t=new URLSearchParams(window.location.search);for(let n of Object.keys(e)){let o=e[n];Array.isArray(o)?(t.delete(n),t.delete(`${n}[]`),o.forEach(a=>t.append(`${n}[]`,a))):o===null?(t.delete(n),t.delete(`${n}[]`)):t.set(n,o)}var r=window.location.pathname,s=t.toString();s&&(r+="?"+s.replaceAll("%5B%5D=","[]=")),B()?$(r,{action:"swap",scroll:!1}):(history.replaceState(null,"",r),localStorage.setItem("ocPushStateReferrer",r))}};function Rt(i){let e=i.getResponseHeader("Content-Disposition");if(!e)return null;let t=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/g,r=null,s=null;for(;(s=t.exec(e))!==null;)r=s;return r!==null&&r[1]?/filename[^;*=\n]*\*=[^']*''/.exec(r[0])===null?r[1].replace(/['"]/g,""):decodeURIComponent(r[1].substring(r[1].indexOf("''")+2)):null}var C=class i{static assignToObj(e,t,r){new i().assignObjectInternal(e,t,r)}static serializeAsJSON(e){return typeof e=="string"&&(e=document.querySelector(e)),new i().parseContainer(e)}parseContainer(e){let t={};return e.querySelectorAll("input, textarea, select").forEach(r=>{if(!(!r.name||r.disabled||["file","reset","submit","button"].indexOf(r.type)>-1)&&!(["checkbox","radio"].indexOf(r.type)>-1&&!r.checked)){if(r.type==="select-multiple"){var s=[];Array.from(r.options).forEach(function(n){n.selected&&s.push({name:r.name,value:n.value})}),this.assignObjectInternal(t,r.name,s);return}this.assignObjectInternal(t,r.name,r.value)}}),t}assignObjectInternal(e,t,r){this.assignObjectNested(e,this.nameToArray(t),r,t.endsWith("[]"))}assignObjectNested(e,t,r,s){var n=e,o=t.length-1;t.forEach(function(a,l){s&&l===o?(Array.isArray(n[a])||(n[a]=[]),Array.isArray(r)?n[a].push(...r):n[a].push(r)):((n[a]===void 0||n[a].constructor!=={}.constructor)&&(n[a]={}),l===o&&(n[a]=r),n=n[a])})}nameToArray(e){for(var t=/([^\]\[]+)/g,r=[],s;s=t.exec(e);)r.push(s[0]);return r}};var re=class{constructor(e,t,r){this.userData=e||{},this.targetEl=t,this.formEl=r}getRequestData(){let e;return this.formEl?e=new FormData(this.formEl):e=new FormData,this.appendSingleInputElement(e),e}getAsFormData(){return this.appendJsonToFormData(this.getRequestData(),this.userData)}getAsQueryString(){return this.convertFormDataToQuery(this.getAsFormData())}getAsJsonObject(){return this.convertFormDataToJson(this.getAsFormData())}getAsJsonData(){let e=this.getAsFormData(),t=this.convertFormDataToJson(e),r=this.buildOrderManifest(e);return r.length&&(t.__ajax={orders:r}),JSON.stringify(t)}appendSingleInputElement(e){if(this.formEl||!this.targetEl||!jt(this.targetEl))return;let t=this.targetEl.name;!t||this.userData[t]!==void 0||(this.targetEl.type==="file"?this.targetEl.files.forEach(function(r){e.append(t,r)}):e.append(t,this.targetEl.value))}appendJsonToFormData(e,t,r){var s=this;for(var n in t){var o=n;r&&(o=r+"["+n+"]");var a=t[n];a&&a.constructor==={}.constructor?this.appendJsonToFormData(e,a,o):a&&a.constructor===[].constructor?a.forEach(function(l,f){l.constructor==={}.constructor||l.constructor===[].constructor?s.appendJsonToFormData(e,l,o+"["+f+"]"):e.append(o+"[]",s.castJsonToFormData(l))}):e.append(o,this.castJsonToFormData(a))}return e}convertFormDataToQuery(e){let t=this.formDataToArray(e);return Object.keys(t).map(function(r){return r.endsWith("[]")?t[r].map(function(s){return encodeURIComponent(r)+"="+encodeURIComponent(s)}).join("&"):encodeURIComponent(r)+"="+encodeURIComponent(t[r])}).join("&")}buildOrderManifest(e){let t={};return Array.from(e.keys()).forEach(r=>{let s=r.match(/[^\]\[]+/g)||[];for(let n=1;nr.keys.length>1)}convertFormDataToJson(e){let t=this.formDataToArray(e),r={};for(var s in t)C.assignToObj(r,s,t[s]);return r}formDataToArray(e){return Object.fromEntries(Array.from(e.keys()).map(t=>[t,t.endsWith("[]")?e.getAll(t):e.getAll(t).pop()]))}castJsonToFormData(e){return e==null?"":e===!0?"1":e===!1?"0":e}};function jt(i){return["input","select","textarea"].includes((i.tagName||"").toLowerCase())}function kt(i){return/^(0|[1-9][0-9]*)$/.test(i)}var b={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2,userAborted:-3},M=class{constructor(e,t,r){this.failed=!1,this.progress=0,this.sent=!1,this.aborted=!1,this.timedOut=!1,this.delegate=e,this.url=t,this.options=r,this.context=r.context||null,this.headers=r.headers||{},this.method=r.method||"GET",this.data=r.data,this.timeout=r.timeout||0,this.controller=new AbortController,this.timeoutId=null,this.xhr=this.createXhrWrapper()}send(){this.sent||(this.sent=!0,this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.delegate.requestStarted(),this.timeout>0&&(this.timeoutId=setTimeout(()=>{this.timedOut=!0,this.controller.abort()},this.timeout*1e3)),this.performFetch())}async performFetch(){try{let e=await fetch(this.url,{method:this.method,headers:this.headers,body:this.data||null,signal:this.controller.signal});this.clearTimeout(),this.updateXhrWrapper(e),await this.handleResponse(e)}catch(e){this.clearTimeout(),e.name==="AbortError"?this.timedOut?this.handleTimeout():this.handleAbort():this.handleNetworkError()}}async handleResponse(e){let t=e.headers.get("Content-Type"),r=e.headers.get("Content-Disposition")||"";if(this.options.htmlOnly&&!qt(t)){this.failed=!0,this.notifyApplicationAfterRequestEnd(),await this.settleWithDelegate(()=>this.delegate.requestFailedWithStatusCode(b.contentTypeMismatch));return}let s;r.startsWith("attachment")||r.startsWith("inline")?s=await e.blob():Pt(t)?s=await e.json():s=await e.text(),e.status>=200&&e.status<300?(this.notifyApplicationAfterRequestEnd(),await this.settleWithDelegate(()=>this.delegate.requestCompletedWithResponse(s,e.status,this.getRedirectLocation(e)))):(this.failed=!0,this.notifyApplicationAfterRequestEnd(),await this.settleWithDelegate(()=>this.delegate.requestFailedWithStatusCode(e.status,s)))}async settleWithDelegate(e){try{await e()}catch(t){Promise.reject(t)}finally{this.destroy()}}getRedirectLocation(e){let t=e.headers.get("X-AJAX-LOCATION");if(t)return t;var r=this.url.match(/^(.*)#/),s=r?r[1]:this.url;return s!==e.url?e.url:null}handleTimeout(){this.failed=!0,this.notifyApplicationAfterRequestEnd(),this.delegate.requestFailedWithStatusCode(b.timeoutFailure),this.destroy()}handleAbort(){this.options.trackAbort?(this.failed=!0,this.notifyApplicationAfterRequestEnd(),this.delegate.requestFailedWithStatusCode(b.userAborted)):this.notifyApplicationAfterRequestEnd(),this.destroy()}handleNetworkError(){this.failed=!0,this.notifyApplicationAfterRequestEnd(),this.delegate.requestFailedWithStatusCode(b.networkFailure),this.destroy()}abort(){this.sent&&!this.aborted&&(this.aborted=!0,this.controller.abort())}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}notifyApplicationBeforeRequestStart(){d.dispatch("ajax:request-start",{detail:{url:this.url,xhr:this.xhr,context:this.context},cancelable:!1})}notifyApplicationAfterRequestEnd(){d.dispatch("ajax:request-end",{detail:{url:this.url,xhr:this.xhr,context:this.context},cancelable:!1})}createXhrWrapper(){return{status:0,statusText:"",responseURL:this.url,getResponseHeader:e=>null,getAllResponseHeaders:()=>""}}updateXhrWrapper(e){this.xhr={status:e.status,statusText:e.statusText,responseURL:e.url,getResponseHeader:t=>e.headers.get(t),getAllResponseHeaders:()=>[...e.headers].map(([t,r])=>`${t}: ${r}`).join(`\r `)}}setProgress(e){this.progress=e,this.delegate.requestProgressed(e)}destroy(){this.setProgress(1),this.delegate.requestFinished()}};function qt(i){return(i||"").match(/^text\/html|^application\/xhtml\+xml/)}function Pt(i){return(i||"").includes("application/json")}var v=class i{static instance=null;static stylesheetReady=!1;static animationDuration=300;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)}}static get defaultCSS(){return k` .jax-progress-bar { position: fixed; display: block; top: 0; left: 0; height: 3px; background: #0076ff; z-index: 9999; transition: width ${i.animationDuration}ms ease-out, opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in; transform: translate3d(0, 0, 0); } `}static get progressBar(){return{show:function(){let e=nt();e.setValue(0),e.show()},hide:function(){let e=nt();e.setValue(100),e.hide()}}}show(e={}){e.cssClass&&this.progressElement.classList.add(e.cssClass),this.visible||(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){i.stylesheetReady||(document.head.insertBefore(this.stylesheetElement,document.head.firstChild),i.stylesheetReady=!0)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=setInterval(this.trickle,i.animationDuration))}stopTrickling(){clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.textContent=i.defaultCSS,e}createProgressElement(){let e=document.createElement("div");return e.className="jax-progress-bar",e}};function nt(){return v.instance||(v.instance=new v),v.instance}var se=!1,ie=class i{constructor(e,t,r){this.el=e,this.handler=t,this.options={...this.constructor.DEFAULTS,...r||{}},this.context={el:e,handler:t,options:this.options},this.progressBar=new v,this.showProgressBar=()=>{this.progressBar.show({cssClass:"is-ajax"})}}static get DEFAULTS(){return{handler:null,update:{},files:!1,bulk:!1,browserTarget:null,browserValidate:!1,browserRedirectBack:!1,progressBarDelay:500,progressBar:null}}start(){return this.promise=it(),this.applicationAllowsSetup()?(this.initOtherElements(),this.preprocessOptions(),this.actions=new te(this,this.context,this.options),this.actions.invokeFunc("beforeSendFunc")===!1?this.promise:!this.validateClientSideForm()||!this.applicationAllowsRequest()?this.promise:this.options.confirm&&!this.actions.invoke("handleConfirmMessage",[this.options.confirm])?this.promise:(this.sendInternal(),this.promise)):this.promise}sendInternal(){let e=new re(this.options.data,this.el,this.formEl),t;this.options.files?t=e.getAsFormData():this.options.bulk?t=e.getAsJsonData():t=e.getAsQueryString(),this.options.query&&this.actions.invoke("applyQueryToUrl",[this.options.query!==!0?this.options.query:e.getAsJsonObject()]);let{url:r,headers:s,method:n}=Z.fetch(this.handler,this.options);this.request=new M(this,r,{method:n,headers:s,data:t,trackAbort:!0,context:this.context}),this.isRedirect=this.options.redirect&&this.options.redirect.length>0,this.notifyApplicationBeforeSend(),this.notifyApplicationAjaxPromise(),this.promise.onCancel(()=>{this.request.abort()}).then(o=>{this.isRedirect||(this.notifyApplicationAjaxDone(o,o.$status,o.$xhr),this.notifyApplicationAjaxAlways(o,o.$status,o.$xhr),this.notifyApplicationSendComplete(o,o.$status,o.$xhr))}).catch(o=>{this.isRedirect||(this.notifyApplicationAjaxFail(o,o.$status,o.$xhr),this.notifyApplicationAjaxAlways(o,o.$status,o.$xhr),this.notifyApplicationSendComplete(o,o.$status,o.$xhr))}),this.request.send()}static send(e,t){return new i(document,e,t).start()}static sendElement(e,t,r){return typeof e=="string"&&(e=document.querySelector(e)),new i(e,t,r).start()}static markNavigating(){se=!0}markNavigating(){se=!0}toggleRedirect(e){e?(this.options.redirect=e,this.isRedirect=!0):(this.options.redirect=null,this.isRedirect=!1)}applicationAllowsSetup(){return!this.notifyApplicationAjaxSetup().defaultPrevented}applicationAllowsRequest(){return!this.notifyApplicationBeforeRequest().defaultPrevented}applicationAllowsUpdate(e,t,r){return!this.notifyApplicationBeforeUpdate(e,t,r).defaultPrevented}applicationAllowsError(e,t,r){return!this.notifyApplicationRequestError(e,t,r).defaultPrevented}notifyApplicationAjaxSetup(){return u("ajax:setup",{target:this.el,detail:{context:this.context}})}notifyApplicationAjaxPromise(){return u("ajax:promise",{target:this.el,detail:{context:this.context}})}notifyApplicationAjaxFail(e,t,r){return u("ajax:fail",{target:this.el,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationAjaxDone(e,t,r){return u("ajax:done",{target:this.el,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationAjaxAlways(e,t,r){return u("ajax:always",{target:this.el,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationAjaxUpdate(e,t,r,s){return u("ajax:update",{target:e,detail:{context:this.context,data:t,responseCode:r,xhr:s}})}notifyApplicationBeforeRedirect(){return u("ajax:before-redirect",{target:this.el})}notifyApplicationBeforeRequest(){return u("ajax:before-request",{target:this.triggerEl,detail:{context:this.context}})}notifyApplicationBeforeUpdate(e,t,r){return u("ajax:before-update",{target:this.triggerEl,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationRequestSuccess(e,t,r){return u("ajax:request-success",{target:this.triggerEl,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationRequestError(e,t,r){return u("ajax:request-error",{target:this.triggerEl,detail:{context:this.context,message:e,responseCode:t,xhr:r}})}notifyApplicationRequestComplete(e,t,r){return u("ajax:request-complete",{target:this.triggerEl,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationRequestCancel(){return u("ajax:request-cancel",{target:this.triggerEl,detail:{context:this.context}})}notifyApplicationBeforeValidate(e,t){return u("ajax:before-validate",{target:this.triggerEl,detail:{context:this.context,message:e,fields:t}})}notifyApplicationBeforeReplace(e){return u("ajax:before-replace",{target:e})}notifyApplicationBeforeSend(){return u("ajax:before-send",{target:window,detail:{context:this.context}})}notifyApplicationUpdateComplete(e,t,r){return u("ajax:update-complete",{target:window,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationSendComplete(e,t,r){return u("ajax:send-complete",{target:window,detail:{context:this.context,data:e,responseCode:t,xhr:r}})}notifyApplicationFieldInvalid(e,t,r,s){return u("ajax:invalid-field",{target:window,detail:{element:e,fieldName:t,errorMsg:r,isFirst:s}})}notifyApplicationConfirmMessage(e,t){return u("ajax:confirm-message",{target:window,detail:{message:e,promise:t}})}notifyApplicationErrorMessage(e){return u("ajax:error-message",{target:window,detail:{message:e}})}notifyApplicationCustomEvent(e,t){let r=this.el instanceof Node&&document.contains(this.el)?this.el:document;return u(e,{target:r,detail:t})}requestStarted(){this.markAsProgress(!0),this.toggleLoadingElement(!0),this.options.progressBar&&this.showProgressBarAfterDelay(),this.actions.invoke("start",[this.request.xhr])}requestProgressed(e){}async requestCompletedWithResponse(e,t){let r=ot(e,t,this.request.xhr);await this.actions.invoke("success",[r,t,this.request.xhr]),await this.actions.invoke("complete",[r,t,this.request.xhr]),this.promise.resolve(r)}async requestFailedWithStatusCode(e,t){let r=ot(t,e,this.request.xhr);e==b.userAborted?await this.actions.invoke("cancel",[]):await this.actions.invoke("error",[r,e,this.request.xhr]),await this.actions.invoke("complete",[r,e,this.request.xhr]),this.promise.reject(r)}requestFinished(){if(se){window.addEventListener("pageshow",()=>{se=!1,this.requestFinished()},{once:!0});return}this.markAsProgress(!1),this.toggleLoadingElement(!1),this.options.progressBar&&this.hideProgressBar()}initOtherElements(){typeof this.options.form=="string"?this.formEl=document.querySelector(this.options.form):this.options.form?this.formEl=this.options.form:this.formEl=this.el&&this.el!==document?this.el.closest("form"):null,this.triggerEl=this.formEl||this.el!==document&&this.el.closest("[data-request-scope]")||document.body,this.partialEl=this.el&&this.el!==document?this.el.closest("[data-ajax-partial]"):null,this.loadingEl=typeof this.options.loading=="string"?document.querySelector(this.options.loading):this.options.loading}preprocessOptions(){this.options.partial===void 0&&this.partialEl&&this.partialEl.dataset.ajaxPartial!==void 0&&(this.options.partial=this.partialEl.dataset.ajaxPartial||!0)}validateClientSideForm(){return this.options.browserValidate&&typeof document.createElement("input").reportValidity=="function"&&this.formEl&&!this.formEl.checkValidity()?(this.formEl.reportValidity(),!1):!0}toggleLoadingElement(e){if(this.loadingEl){if(typeof this.loadingEl.show!="function"||typeof this.loadingEl.hide!="function"){this.loadingEl.style.display=e?"block":"none";return}e?this.loadingEl.show():this.loadingEl.hide()}}showProgressBarAfterDelay(){this.progressBar.setValue(0),this.progressBarTimeout=window.setTimeout(this.showProgressBar,this.options.progressBarDelay)}hideProgressBar(){this.progressBar.setValue(100),this.progressBar.hide(),this.progressBarTimeout!=null&&(window.clearTimeout(this.progressBarTimeout),delete this.progressBarTimeout)}markAsProgress(e){e?(document.documentElement.setAttribute("data-ajax-progress",""),this.formEl&&this.formEl.setAttribute("data-ajax-progress",this.handler)):(document.documentElement.removeAttribute("data-ajax-progress"),this.formEl&&this.formEl.removeAttribute("data-ajax-progress"))}};function ot(i,e,t){if(!i||i.constructor!=={}.constructor||!i.__ajax)return i||{};let{__ajax:r,...s}=i,n=new Q(i,e),o={env:n,status:e,xhr:t};for(let[a,l]of Object.entries(o))Object.defineProperty(s,`$${a}`,{value:l,enumerable:!1,writable:!1,configurable:!0});return s}var J=ie;var A=class i{static paramToObj(e,t){if(t===void 0&&(t=""),typeof t=="object")return t;t.charAt(0)!=="{"&&(t="{"+t+"}");try{return this.parseJSON(t)}catch(r){throw new Error("Error parsing the "+e+" attribute value. "+r)}}static parseJSON(e){return JSON.parse(new i().parseString(e))}parseString(e){if(e=e.trim(),!e.length)throw new Error("Broken JSON object.");for(var t="";e&&e[0]===",";)e=e.substr(1);if(e[0]==='"'||e[0]==="'"){if(e[e.length-1]!==e[0])throw new Error("Invalid string JSON object.");for(var r='"',s=1;s="0"&&e[t]<="9"){for(var r="",s=t;s="0"&&e[s]<="9")r+=e[s];else return{originLength:r.length,body:r};throw new Error("Broken JSON number body near "+r)}if(e[t]==="{"||e[t]==="["){for(var n=[e[t]],r=e[t],s=t+1;s=0?t-5:0,50))}canBeKeyHead(e){return e[0]==="\\"?!1:e[0]>="a"&&e[0]<="z"||e[0]>="A"&&e[0]<="Z"||e[0]==="_"||e[0]>="0"&&e[0]<="9"||e[0]==="$"||e.charCodeAt(0)>255}isBlankChar(e){return e===" "||e===` `||e===" "}};var I=class i{constructor(e,t,r){return this.options=r||{},this.ogElement=e,this.element=this.findElement(e),this.element?(this.assignAsEval("beforeSendFunc","requestBeforeSend"),this.assignAsEval("beforeUpdateFunc","requestBeforeUpdate"),this.assignAsEval("afterUpdateFunc","requestAfterUpdate"),this.assignAsEval("successFunc","requestSuccess"),this.assignAsEval("errorFunc","requestError"),this.assignAsEval("cancelFunc","requestCancel"),this.assignAsEval("completeFunc","requestComplete"),this.assignAsData("progressBar","requestProgressBar"),this.assignAsData("message","requestMessage"),this.assignAsData("confirm","requestConfirm"),this.assignAsData("redirect","requestRedirect"),this.assignAsData("loading","requestLoading"),this.assignAsData("form","requestForm"),this.assignAsData("url","requestUrl"),this.assignAsData("bulk","requestBulk",{emptyAsTrue:!0}),this.assignAsData("files","requestFiles",{emptyAsTrue:!0}),this.assignAsData("flash","requestFlash",{emptyAsTrue:!0}),this.assignAsData("update","requestUpdate",{parseJson:!0}),this.assignAsData("query","requestQuery",{emptyAsTrue:!0,parseJson:!0}),this.assignAsData("browserTarget","browserTarget"),this.assignAsData("browserValidate","browserValidate",{emptyAsTrue:!0}),this.assignAsData("browserRedirectBack","browserRedirectBack",{emptyAsTrue:!0}),this.assignAsMetaData("update","ajaxRequestUpdate",{parseJson:!0,mergeValue:!0}),this.assignRequestData(),t||(t=this.getHandlerName()),J.sendElement(this.element,this.normalizeHandler(t),this.options)):J.send(this.normalizeHandler(t),this.options)}static fromElement(e,t,r){return typeof e=="string"&&(e=document.querySelector(e)),new i(e,t,r)}findElement(e){if(!e||e===document)return null;if(e.matches("[data-request]"))return e;var t=e.closest("[data-request]");return t||e}getHandlerName(){return this.element.dataset.dataRequest?this.element.dataset.dataRequest:this.element.getAttribute("data-request")}normalizeHandler(e){return e&&!Mt(e)?(this.options.url===void 0&&(this.options.url=e),"onAjax"):e}assignAsEval(e,t){if(this.options[e]===void 0){var r;this.element.dataset[t]?r=this.element.dataset[t]:r=this.element.getAttribute("data-"+W(t)),r&&(this.options[e]=function(s,n,o){return new Function("context","data",r).apply(s,[n,o])})}}assignAsData(e,t,{parseJson:r=!1,emptyAsTrue:s=!1}={}){if(this.options[e]===void 0){var n;this.element.dataset[t]?n=this.element.dataset[t]:n=this.element.getAttribute("data-"+W(t)),n!==null&&(n=this.castAttrToOption(n,s),r&&typeof n=="string"&&(n=A.paramToObj("data-"+W(t),n)),this.options[e]=n)}}assignAsMetaData(e,t,{mergeValue:r=!0,parseJson:s=!1,emptyAsTrue:n=!1}={}){let o=document.documentElement.querySelector('head meta[name="'+W(t)+'"]');if(o){var a=o.getAttribute("content");s?a=A.paramToObj(W(t),a):a=this.castAttrToOption(a,n),r?this.options[e]={...this.options[e]||{},...a}:this.options[e]=a}}castAttrToOption(e,t){return t&&e===""||e==="true"||e==="1"?!0:e==="false"||e==="0"?!1:e}assignRequestData(){let e={};Ct(this.ogElement,"[data-request-data]").forEach(function(r){Object.assign(e,A.paramToObj("data-request-data",r.getAttribute("data-request-data")))});let t=this.ogElement.getAttribute("data-request-data");t&&Object.assign(e,A.paramToObj("data-request-data",t)),this.options.data&&Object.assign(e,this.options.data),this.options.data=e}};function Ct(i,e){let t=[];if(!i.parentNode)return t;let r=i.parentNode.closest(e);for(;r;)t.push(r),r=r.parentNode.closest(e);return t}function W(i){return i.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Mt(i){return/^(?:\w+\:{2})?on[A-Z]{1}[\w+]*$/.test(i)}var ne=class{constructor(e){this.element=e,this.config=this.parse(),this.timer=null,this.throttleTimer=null,this.lastValue=null,this.fired=!1,this.throttled=!1,this.lastRequest=null}parse(){let e=this.element.dataset.requestTrigger,t=this.element.dataset.requestPoll;if(!e&&this.element.dataset.trackInput!==void 0&&(e=`input changed delay:${this.element.dataset.trackInput||300}`),!e&&this.element.dataset.autoSubmit!==void 0){let s=this.element.dataset.autoSubmit||0;e=s>0?`load delay:${s}`:"load"}e||(e=this.getDefaultTrigger());let r=this.parseString(e);return t&&(r.poll=this.parseTime(t)),r}parseString(e){let t=e.trim().split(/\s+/),r={event:t[0]||"click",delay:0,throttle:0,once:!1,changed:!1,poll:0};for(let s=1;s0&&this.throttled)&&(t>0?this.timer=setTimeout(()=>this.fire(),t):this.fire()))}hasChanged(){let e=this.element.value;return this.lastValue===e?!1:(this.lastValue=e,!0)}fire(){this.isConnected()&&(this.lastRequest&&this.lastRequest.abort&&this.lastRequest.abort(),this.fired=!0,this.lastRequest=I.fromElement(this.element),this.config.throttle>0&&(this.throttled=!0,this.throttleTimer=setTimeout(()=>{this.throttled=!1},this.config.throttle)))}observeVisibility(){let e=new IntersectionObserver(t=>{t.forEach(r=>{if(!this.isConnected()){e.disconnect();return}r.isIntersecting&&(u("ajax:trigger",{target:this.element}),(this.config.once||this.config.event==="intersect")&&e.disconnect())})},{threshold:.1});e.observe(this.element)}startPolling(){let e=setInterval(()=>{if(!this.isConnected()){clearInterval(e);return}document.hidden||u("ajax:trigger",{target:this.element})},this.config.poll)}};function at(i,e){return new Promise((t,r)=>{let s=()=>{i()&&(clearInterval(n),t())},n=setInterval(s,100);s(),e&&setTimeout(()=>{clearInterval(n),r()},e)})}function oe(){return new Promise(i=>{document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}var ae=class{constructor(){this.started=!1,this.triggers=new WeakMap}start(){this.started||(addEventListener("beforeunload",this.documentOnBeforeUnload),d.on(document,"click","[data-request]",this.onTriggerEvent),d.on(document,"submit","[data-request]",this.onTriggerEvent),d.on(document,"change","[data-request]",this.onTriggerEvent),d.on(document,"input","[data-request]",this.onTriggerEvent),d.on(document,"ajax:trigger","[data-request]",this.onTriggerEvent),addEventListener("DOMContentLoaded",this.onRender),addEventListener("page:updated",this.onRender),addEventListener("ajax:update-complete",this.onRender),this.started=!0)}stop(){this.started&&(removeEventListener("beforeunload",this.documentOnBeforeUnload),d.off(document,"click","[data-request]",this.onTriggerEvent),d.off(document,"submit","[data-request]",this.onTriggerEvent),d.off(document,"change","[data-request]",this.onTriggerEvent),d.off(document,"input","[data-request]",this.onTriggerEvent),d.off(document,"ajax:trigger","[data-request]",this.onTriggerEvent),removeEventListener("DOMContentLoaded",this.onRender),removeEventListener("page:updated",this.onRender),removeEventListener("ajax:update-complete",this.onRender),this.started=!1)}onRender=()=>{this.render()};render(){d.dispatch("before-render"),d.dispatch("render"),dispatchEvent(new Event("resize")),this.bindCustomTriggers()}bindCustomTriggers(){document.querySelectorAll("[data-request]:not([data-trigger-bound])").forEach(e=>{let t=this.getTrigger(e),r=t.config.event;(r==="load"||r==="revealed"||r==="intersect")&&(e.setAttribute("data-trigger-bound",""),t.bind()),t.config.poll>0&&(e.setAttribute("data-trigger-bound",""),t.startPolling())})}getTrigger(e){let t=this.triggers.get(e);return t||(t=new ne(e),this.triggers.set(e,t)),t}onTriggerEvent=e=>{let t=e.delegateTarget,r=this.getTrigger(t),s=r.config.event;if(e.type==="ajax:trigger"){r.handleEvent(e);return}e.type===s&&r.handleEvent(e)};documentOnBeforeUnload(e){window.jaxUnloading=!0}pageReady(){return rt()??oe()}};var le=new ae,Ue={controller:le,parseJSON:A.parseJSON,serializeAsJSON:C.serializeAsJSON,requestElement:I.fromElement,pageReady(){return le.pageReady()},start(){le.start()},stop(){le.stop()}};var ce=class{submit(e){var t=e.closest("form");t&&(t.querySelectorAll("[data-validate-for]").forEach(function(r){r.classList.remove("jax-visible")}),t.querySelectorAll("[data-validate-error]").forEach(function(r){r.classList.remove("jax-visible")}))}validate(e,t,r,s){var n=e.closest("form"),o=[];if(n){for(var a in t){var l=t[a];o=[...o,...l];var f=n.querySelector('[data-validate-for="'+a+'"]');f&&((!f.innerHTML||f.dataset.emptyMode)&&(f.dataset.emptyMode=!0,f.innerHTML=l.join(", ")),f.classList.add("jax-visible"))}var h=n.querySelector("[data-validate-error]");if(h){h.classList.add("jax-visible");var c=h.querySelectorAll("[data-message]");if(c.length>0){var p=c[0];o.forEach(function(g){var m=p.cloneNode(!0);m.innerHTML=g,p.parentNode.insertBefore(m,p.nextSibling)}),c.forEach(function(g){g.remove()})}else h.innerHTML=r}s||d.one(n,"ajax:request-error",function(g){g.preventDefault()})}}};var F=class i{static stylesheetReady=!1;constructor(){this.stylesheetElement=this.createStylesheetElement()}static get defaultCSS(){return k` .jax-attach-loader:after { content: ''; display: inline-block; vertical-align: middle; margin-left: .4em; height: 1em; width: 1em; animation: jax-rotate-loader 0.8s infinite linear; border: .2em solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: .5; } @keyframes jax-rotate-loader { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } `}static get attachLoader(){return{show:function(e){new i().show(lt(e))},hide:function(e){new i().hide(lt(e))},hideAll:function(){new i().hideAll()}}}show(e){if(this.installStylesheetElement(),he(e)){let t=document.createElement("span");t.className="jax-attach-loader is-inline",e.parentNode.insertBefore(t,e.nextSibling)}else e.classList.add("jax-attach-loader"),e.disabled=!0}hide(e){he(e)?e.nextElementSibling&&e.nextElementSibling.classList.contains("jax-attach-loader")&&e.nextElementSibling.remove():(e.classList.remove("jax-attach-loader"),e.disabled=!1)}hideAll(){document.querySelectorAll(".jax-attach-loader.is-inline").forEach(e=>{e.remove()}),document.querySelectorAll(".jax-attach-loader").forEach(e=>{e.classList.remove("jax-attach-loader"),e.disabled=!1})}showForm(e){if(e.dataset.attachLoading!==void 0&&this.show(e),e.matches("form")){var t=this;e.querySelectorAll("[data-attach-loading][type=submit]").forEach(function(r){he(r)||t.show(r)})}}hideForm(e){if(e.dataset.attachLoading!==void 0&&this.hide(e),e.matches("form")){var t=this;e.querySelectorAll("[data-attach-loading]").forEach(function(r){he(r)||t.hide(r)})}}installStylesheetElement(){i.stylesheetReady||(document.head.insertBefore(this.stylesheetElement,document.head.firstChild),i.stylesheetReady=!0)}createStylesheetElement(){let e=document.createElement("style");return e.textContent=i.defaultCSS,e}};function he(i){return["input","select","textarea"].includes((i.tagName||"").toLowerCase())}function lt(i){if(typeof i=="string"&&(i=document.querySelector(i)),!i)throw new Error("Invalid element for attach loader.");return i}var E=class i{static instance=null;static stylesheetReady=!1;constructor(){this.queue=[],this.lastUniqueId=0,this.displayedMessage=null,this.stylesheetElement=this.createStylesheetElement()}static get defaultCSS(){return k` .jax-flash-message { display: flex; position: fixed; z-index: 10300; width: 500px; left: 50%; top: 50px; margin-left: -250px; color: #fff; font-size: 1rem; padding: 10px 15px; border-radius: 5px; opacity: 0; transition: all 0.5s, width 0s; transform: scale(0.9); } @media (max-width: 768px) { .jax-flash-message { left: 1rem; right: 1rem; top: 1rem; margin-left: 0; width: auto; } } .jax-flash-message.flash-show { opacity: 1; transform: scale(1); } .jax-flash-message.loading { transition: opacity 0.2s; transform: scale(1); } .jax-flash-message.success { background: #86cb43; } .jax-flash-message.error { background: #cc3300; } .jax-flash-message.warning { background: #f0ad4e; } .jax-flash-message.info, .jax-flash-message.loading { background: #5fb6f5; } .jax-flash-message span.flash-message { flex-grow: 1; } .jax-flash-message a.flash-close { box-sizing: content-box; width: 1em; height: 1em; padding: .25em .25em; background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FFF'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat; border: 0; border-radius: .25rem; opacity: .5; text-decoration: none; cursor: pointer; } .jax-flash-message a.flash-close:hover, .jax-flash-message a.flash-close:focus { opacity: 1; } .jax-flash-message.loading a.flash-close { display: none; } .jax-flash-message span.flash-loader { margin-right: 1em; } .jax-flash-message span.flash-loader:after { position: relative; top: 2px; content: ''; display: inline-block; height: 1.2em; width: 1.2em; animation: jax-flash-loader 0.8s infinite linear; border: .2em solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: .5; } @keyframes jax-flash-loader { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } `}static flashMsg(e){return It().show(e)}runQueue(){if(!this.displayedMessage){var e=this.queue.shift();e!==void 0&&this.buildFlashMessage(e)}}clearQueue(){this.queue=[],this.displayedMessage&&this.displayedMessage.uniqueId&&this.hide(this.displayedMessage.uniqueId,!0)}removeFromQueue(e){for(var t=0;t{clearInterval(f),o.removeEventListener("click",l),o.removeEventListener("extras:flash-remove",a),o.querySelector(".flash-close").removeEventListener("click",a),o.classList.remove("flash-show"),h&&h.detail.isReplace?(o.remove(),this.displayedMessage=null,this.runQueue()):setTimeout(()=>{o.remove(),this.displayedMessage=null,this.runQueue()},600)},l=()=>{clearInterval(f)};o.addEventListener("click",l,{once:!0}),o.addEventListener("extras:flash-remove",a,{once:!0}),o.querySelector(".flash-close").addEventListener("click",a,{once:!0});var f;n&&n!==0&&(f=setTimeout(a,n*1e3)),setTimeout(()=>{o.classList.add("flash-show")},20)}render(){document.querySelectorAll("[data-control=flash-message]").forEach(e=>{this.show({...e.dataset,target:e,message:e.innerHTML}),e.remove()})}hide(e,t){this.displayedMessage&&e===this.displayedMessage.uniqueId&&this.displayedMessage.element.dispatchEvent(new CustomEvent("extras:flash-remove",{detail:{isReplace:t}}))}hideAll(){this.clearQueue(),this.displayedMessage=null,document.querySelectorAll(".jax-flash-message, [data-control=flash-message]").forEach(e=>{e.remove()})}createFlashElement(e,t){let r=document.createElement("div"),s=t==="loading"?'':"",n='';return r.className="jax-flash-message "+t,r.innerHTML=s+''+e+""+n,r}installStylesheetElement(){i.stylesheetReady||(document.head.insertBefore(this.stylesheetElement,document.head.firstChild),i.stylesheetReady=!0)}createStylesheetElement(){let e=document.createElement("style");return e.textContent=i.defaultCSS,e}createMessagesElement(){let e=document.querySelector(".jax-flash-messages");if(e)return e;let t=document.createElement("div");return t.className="jax-flash-messages",document.body.appendChild(t),t}};function It(){return E.instance||(E.instance=new E),E.instance}var ue=class{constructor(){this.started=!1,this.enableProgressBar=function(e){let{options:t}=e.detail.context;t.progressBar===null&&(t.progressBar=!0)},this.showAttachLoader=e=>{this.attachLoader.showForm(e.target)},this.hideAttachLoader=e=>{this.attachLoader.hideForm(e.target)},this.handlePageRestore=e=>{e.persisted&&this.attachLoader.hideAll()},this.validatorSubmit=e=>{this.validator.submit(e.target)},this.validatorValidate=e=>{this.validator.validate(e.target,e.detail.fields,e.detail.message,de(e.detail.context.options.flash,"validate"))},this.flashMessageBind=e=>{let{options:t}=e.detail.context,r=e.detail.context;t.flash&&(t.handleErrorMessage=(n,o)=>{if(o==="fatal")return r.handleErrorMessage(n,o);n&&(de(t.flash,"error")||de(t.flash,"validate"))&&this.flashMessage.show({message:n,type:"error"})},t.handleFlashMessage=(n,o)=>{n&&de(t.flash,o)&&this.flashMessage.show({message:n,type:o})});var s=e.detail;t.handleProgressMessage=(n,o)=>{o?(this.flashMessage.show(s.progressMessageId?{replace:s.progressMessageId}:{hideAll:!0}),s=null):s.progressMessageId=this.flashMessage.show({message:n,type:"loading",interval:10})}},this.flashMessageRender=e=>{this.flashMessage.render()},this.hideAllFlashMessages=e=>{this.flashMessage.hideAll()},this.handleBrowserRedirect=function(e){if(e.defaultPrevented)return;let t=_();t&&(e.preventDefault(),B()?$(t):location.assign(t))}}start(){this.started||(addEventListener("ajax:setup",this.enableProgressBar),this.attachLoader=new F,d.on(document,"ajax:promise","form, [data-attach-loading]",this.showAttachLoader),d.on(document,"ajax:fail","form, [data-attach-loading]",this.hideAttachLoader),d.on(document,"ajax:done","form, [data-attach-loading]",this.hideAttachLoader),addEventListener("pageshow",this.handlePageRestore),this.validator=new ce,d.on(document,"ajax:before-validate","[data-request-validate]",this.validatorValidate),d.on(document,"ajax:promise","[data-request-validate]",this.validatorSubmit),this.flashMessage=E.instance??(E.instance=new E),addEventListener("render",this.flashMessageRender),addEventListener("ajax:setup",this.flashMessageBind),d.on(document,"click","[data-browser-redirect-back]",this.handleBrowserRedirect),this.started=!0)}stop(){this.started&&(removeEventListener("ajax:setup",this.enableProgressBar),this.attachLoader=null,d.off(document,"ajax:promise","form, [data-attach-loading]",this.showAttachLoader),d.off(document,"ajax:fail","form, [data-attach-loading]",this.hideAttachLoader),d.off(document,"ajax:done","form, [data-attach-loading]",this.hideAttachLoader),removeEventListener("pageshow",this.handlePageRestore),this.validator=null,d.off(document,"ajax:before-validate","[data-request-validate]",this.validatorValidate),d.off(document,"ajax:promise","[data-request-validate]",this.validatorSubmit),this.flashMessage=null,removeEventListener("render",this.flashMessageRender),removeEventListener("ajax:setup",this.flashMessageBind),d.off(document,"click","[data-browser-redirect-back]",this.handleBrowserRedirect),this.started=!1)}};function de(i,e){if(i===!0)return!0;if(typeof i!="string")return!1;let t=i.split(",").map(o=>o.trim()),r=t.some(o=>o.startsWith("-")),s=t.includes("-"+e),n=t.includes(e);return r?!s:n}var Ve=new ue,Ne={controller:Ve,flashMsg:E.flashMsg,progressBar:v.progressBar,attachLoader:F.attachLoader,start(){Ve.start()},stop(){Ve.stop()}};var fe=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=Ft(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,s=t.index;return rs?1:0})}};function Ft(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var pe=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:s}=e,n=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,s);n.delete(o),n.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:s}=e;return this.fetchEventListener(t,r,s)}fetchEventListener(e,t,r){let s=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,r),o=s.get(n);return o||(o=this.createEventListener(e,t,r),s.set(n,o)),o}createEventListener(e,t,r){let s=new fe(e,t,r);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(s=>{r.push(`${t[s]?"":"!"}${s}`)}),r.join(":")}};var me=class{constructor(e,t){this.module=e,this.scope=t,this.control=new e.controlConstructor(this);try{this.control.initBefore(),this.control.init(),this.control.initAfter()}catch(r){this.handleError(r,"initializing control")}}connect(){try{this.control.connectBefore(),this.control.connect(),this.control.connectAfter()}catch(e){this.handleError(e,"connecting control")}}refresh(){}disconnect(){try{this.control.disconnectBefore(),this.control.disconnect(),this.control.disconnectAfter()}catch(e){this.handleError(e,"disconnecting control")}}get application(){return this.module.application}get identifier(){return this.module.identifier}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){let{identifier:s,control:n,element:o}=this;r=Object.assign({identifier:s,control:n,element:o},r),this.application.handleError(e,`Error ${t}`,r)}};var ge=class{constructor(e,t){this.application=e,this.definition=Ot(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controlConstructor(){return this.definition.controlConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new me(this,e),this.contextsByScope.set(e,t)),t}};function Ot(i){return{identifier:i.identifier,controlConstructor:i.controlConstructor}}var ye=class i{constructor(e,t){this.element=e,this.identifier=t,this.containsElement=r=>r.closest(this.controlSelector)===this.element}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controlSelector(){return Dt("data-control",this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(document.documentElement,this.identifier)}};function Dt(i,e){return`[${i}~="${e}"]`}var K=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&!this.elementIsActive(r)&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}};var ve=class{constructor(e,t,r){this.delegate=r,this.attributeName=t,this.elementObserver=new K(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function ct(i,e,t){dt(i,e).add(t)}function ht(i,e,t){dt(i,e).delete(t),Ut(i,e)}function dt(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function Ut(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var R=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),React.createElement(V,null),[]>[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){ct(this.valuesByKey,e,t)}delete(e,t){ht(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var Ee=class{constructor(e,t,r){this.delegate=r,this.attributeObserver=new ve(e,t,this),this.tokensByElement=new R}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),s=Nt(t,r).findIndex(([n,o])=>!Ht(n,o));return s==-1?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Vt(r,e,t)}};function Vt(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,s)=>({element:e,attributeName:t,content:r,index:s}))}function Nt(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,s)=>[i[s],e[s]])}function Ht(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var be=class{constructor(e,t,r){this.tokenListObserver=new Ee(e,t,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}};var we=class{constructor(e,t){this.element=e,this.delegate=t,this.valueListObserver=new be(this.element,this.controlAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap,this.parkedScopesByElement=new Map,this.parkedElementsByBoundary=new Map,this.boundaryByElement=new Map,this.intersectionObserver=null}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop(),this.stopParkedScopes()}get controlAttribute(){return"data-control"}get lazyAttribute(){return"data-lazy-controls"}parseValueForToken(e){let{element:t,content:r}=e,s=this.fetchScopesByIdentifierForElement(t),n=s.get(r);return n||(n=this.delegate.createScopeForElementAndIdentifier(t,r),s.set(r,n)),n}elementMatchedValue(e,t){let r=this.findLazyBoundary(e);if(r){this.parkScope(e,t,r);return}this.connectScope(t)}elementUnmatchedValue(e,t){if(this.unparkScope(e,t))return;let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}connectScope(e){let t=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,t),t==1&&this.delegate.scopeConnected(e)}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}findLazyBoundary(e){return typeof IntersectionObserver>"u"||typeof e.closest!="function"?null:e.closest("["+this.lazyAttribute+"]")}parkScope(e,t,r){let s=this.parkedScopesByElement.get(e);if(!s){s=new Set,this.parkedScopesByElement.set(e,s),this.boundaryByElement.set(e,r);let n=this.parkedElementsByBoundary.get(r);n||(n=new Set,this.parkedElementsByBoundary.set(r,n),this.fetchIntersectionObserver().observe(r)),n.add(e)}s.add(t)}unparkScope(e,t){let r=this.parkedScopesByElement.get(e);return!r||!r.has(t)?!1:(r.delete(t),r.size||this.forgetParkedElement(e),!0)}forgetParkedElement(e){this.parkedScopesByElement.delete(e);let t=this.boundaryByElement.get(e);this.boundaryByElement.delete(e);let r=this.parkedElementsByBoundary.get(t);r&&(r.delete(e),r.size||(this.parkedElementsByBoundary.delete(t),this.intersectionObserver&&this.intersectionObserver.unobserve(t)))}fetchIntersectionObserver(){return this.intersectionObserver||(this.intersectionObserver=new IntersectionObserver(e=>this.processIntersections(e))),this.intersectionObserver}processIntersections(e){for(let t of e)t.isIntersecting&&this.activateBoundary(t.target)}activateBoundary(e){let t=this.parkedElementsByBoundary.get(e);if(t){this.parkedElementsByBoundary.delete(e),this.intersectionObserver&&this.intersectionObserver.unobserve(e);for(let r of Array.from(t)){let s=this.parkedScopesByElement.get(r);if(this.parkedScopesByElement.delete(r),this.boundaryByElement.delete(r),s)for(let n of s)this.connectScope(n)}}}stopParkedScopes(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.parkedScopesByElement.clear(),this.parkedElementsByBoundary.clear(),this.boundaryByElement.clear()}};var xe=class{constructor(e){this.application=e,this.scopeObserver=new we(this.element,this),this.scopesByIdentifier=new R,this.modulesByIdentifier=new Map,this.loadersByIdentifier=new Map}get element(){return this.application.element}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new ge(this.application,e);this.connectModule(t);let r=e.controlConstructor.afterLoad;r&&r.call(e.controlConstructor,e.identifier,this.application)}registerLoader(e,t){this.unloadIdentifier(e),this.loadersByIdentifier.set(e,{loader:t,promise:null}),this.scopesByIdentifier.hasKey(e)&&this.runLoader(e)}unloadIdentifier(e){this.loadersByIdentifier.delete(e);let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getModuleForIdentifier(e){return this.modulesByIdentifier.get(e)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(s=>s.element==e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new ye(e,t)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t?t.connectContextForScope(e):this.loadersByIdentifier.has(e.identifier)&&this.runLoader(e.identifier)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}runLoader(e){let t=this.loadersByIdentifier.get(e);t.promise||(t.promise=Promise.resolve().then(()=>t.loader()).then(r=>{let s=r?.default||r;if(typeof s!="function"||!("shouldLoad"in s))throw new Error(`Loader for control "${e}" did not return a control class`);this.loadersByIdentifier.get(e)===t&&this.application.register(e,s)}).catch(r=>{this.handleError(r,`Error loading control "${e}"`,{identifier:e})}))}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}};var Ae=class{constructor(){this.started=!1,this.element=document.documentElement,this.dispatcher=new pe(this),this.container=new xe(this)}startAsync(){oe().then(()=>{this.start()})}start(){this.started||(this.started=!0,this.dispatcher.start(),this.container.start())}stop(){this.started&&(this.dispatcher.stop(),this.container.stop(),this.started=!1)}register(e,t){if(typeof t=="function"&&!("shouldLoad"in t)){this.container.registerLoader(e,t);return}this.load({identifier:e,controlConstructor:t})}observe(e,t){let r=this.container.scopeObserver;r.elementMatchedValue(e,r.parseValueForToken({element:e,content:t}));let s=this.getControlForElementAndIdentifier(e,t);return e.matches(`[data-control~="${t}"]`)||(e.dataset.control=((e.dataset.control||"")+" "+t).trim()),s}import(e){let t=this.container.getModuleForIdentifier(e);if(!t)throw new Error(`Control is not registered [${e}]`);return t.controlConstructor}fetch(e,t){return typeof e=="string"&&(e=document.querySelector(e)),t||(t=e.dataset.control),e?this.getControlForElementAndIdentifier(e,t):null}fetchAll(e,t){typeof e=="string"&&(e=document.querySelectorAll(e));let r=[];return e.forEach(s=>{let n=this.fetch(s,t);n&&r.push(n)}),r}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>{s.controlConstructor.shouldLoad&&this.container.loadDefinition(s)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>this.container.unloadIdentifier(s))}get controls(){return this.container.contexts.map(e=>e.control)}getControlForElementAndIdentifier(e,t){let r=this.container.getContextForElementAndIdentifier(e,t);return r?r.control:null}handleError(e,t,r){var s;console.error(`%s %o %o`,t,e,r),(s=window.onerror)===null||s===void 0||s.call(window,t,"",0,0,e)}};var L=new Ae,He={application:L,registerControl(i,e){return L.register(i,e)},importControl(i){return L.import(i)},observeControl(i,e){return L.observe(i,e)},fetchControl(i,e){return L.fetch(i,e)},fetchControls(i,e){return L.fetchAll(i,e)},start(){L.startAsync()},stop(){L.stop()}};var Se=class{constructor(e){this.progressBar=new v,this.showProgressBar=()=>{this.progressBar.show({cssClass:"is-turbo"})},this.controller=e}visitProposedToLocationWithAction(e,t){let r=x();this.controller.startVisitToLocationWithAction(e,t,r)}visitStarted(e){e.issueRequest(),e.changeHistory(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),this.showProgressBarAfterDelay()}visitRequestProgressed(e){this.progressBar.setValue(e.progress)}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case b.networkFailure:case b.timeoutFailure:case b.contentTypeMismatch:case b.userAborted:return this.reload();default:return e.loadResponse()}}visitRequestFinished(e){this.hideProgressBar()}visitCompleted(e){e.followRedirect()}pageInvalidated(){this.reload()}visitFailed(e){}visitRendered(e){}showProgressBarAfterDelay(){this.controller.progressBarVisible&&(this.progressBarTimeout=window.setTimeout(this.showProgressBar,this.controller.progressBarDelay))}hideProgressBar(){this.controller.progressBarVisible&&(this.progressBar.hide(),this.progressBarTimeout!==null&&(window.clearTimeout(this.progressBarTimeout),delete this.progressBarTimeout))}reload(){window.location.reload()}};var y=class i{constructor(e){let t=document.createElement("a");t.href=e,this.absoluteURL=t.href;let r=t.hash.length;r<2?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-r),this.anchor=t.hash.slice(1))}static get currentLocation(){return this.wrap(window.location.toString())}static wrap(e){if(typeof e=="string")return new i(e);if(e!=null)return e}getOrigin(){return this.absoluteURL.split("/",3).join("/")}getPath(){return(this.requestURL.match(/\/\/[^/]*(\/[^?;]*)/)||[])[1]||"/"}getPathComponents(){return this.getPath().split("/").slice(1)}getLastPathComponent(){return this.getPathComponents().slice(-1)[0]}getExtension(){return(this.getLastPathComponent().match(/\.[^.]*$/)||[])[0]||""}isHTML(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)}isPrefixedBy(e){let t=$t(e);return this.isEqualTo(e)||Wt(this.absoluteURL,t)}isEqualTo(e){return e&&this.absoluteURL===e.absoluteURL}toJSON(){return this.absoluteURL}toString(){return this.absoluteURL}valueOf(){return this.absoluteURL}};function $t(i){return Jt(i.getOrigin()+i.getPath())}function Jt(i){return Kt(i,"/")?i:i+"/"}function Wt(i,e){return i.slice(0,e.length)===e}function Kt(i,e){return i.slice(-e.length)===e}var Le=class{constructor(e){this.started=!1,this.pageLoaded=!1,this.currentPosition=0,this.onPopState=t=>{if(!this.shouldHandlePopState()||!t.state||!t.state.ajaxTurbo)return;let{ajaxTurbo:r}=t.state,s=y.currentLocation,{restorationIdentifier:n,position:o}=r,a=typeof o=="number"&&o>this.currentPosition?"forward":"back";this.currentPosition=typeof o=="number"?o:this.currentPosition,this.delegate.historyPoppedToLocationWithRestorationIdentifier(s,n,a)},this.onPageLoad=t=>{$e(()=>{this.pageLoaded=!0})},this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0)}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.currentPosition++,this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}update(e,t,r){let s={ajaxTurbo:{restorationIdentifier:r,position:this.currentPosition}};e.call(history,s,"",t.absoluteURL)}};var Te=class{constructor(e){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}scrollToElement(e){e.scrollIntoView()}scrollToPosition({x:e,y:t}){window.scrollTo(e,t)}updatePosition(e){this.delegate.scrollPositionChanged(e)}};var O=class{renderView(e){let t=()=>{let n=()=>{e(),this.delegate.viewRendered(this.newBody)};if(this.willPerformViewTransition()){let o=document.startViewTransition(()=>n());typeof this.delegate.setViewTransitionFinished=="function"&&this.delegate.setViewTransitionFinished(o.finished)}else n()},r={resume:t};this.delegate.viewAllowsImmediateRender(this.newBody,r)&&t()}willPerformViewTransition(){return typeof document.startViewTransition=="function"&&typeof this.delegate.viewTransitionEnabled=="function"&&this.delegate.viewTransitionEnabled()}invalidateView(){this.delegate.viewInvalidated()}createScriptElement(e){if(e.getAttribute("data-turbo-eval")==="false"||this.delegate.applicationHasSeenInlineScript(e))return e;let t=document.createElement("script");return t.textContent=e.textContent,t.async=!1,zt(t,e),t}};function zt(i,e){for(let{name:t,value:r}of w(e.attributes))i.setAttribute(t,r)}var Be=class extends O{constructor(e,t){super(),this.delegate=e,this.htmlElement=(()=>{let r=document.createElement("html");return r.innerHTML=t,r})(),this.newHead=this.htmlElement.querySelector("head")||document.createElement("head"),this.newBody=this.htmlElement.querySelector("body")||document.createElement("body")}static render(e,t,r){return new this(e,r).render(t)}render(e){this.renderView(()=>{this.replaceHeadAndBody(),this.activateBodyScriptElements(),e()})}replaceHeadAndBody(){let{documentElement:e,head:t,body:r}=document;e.replaceChild(this.newHead,t),e.replaceChild(this.newBody,r)}activateBodyScriptElements(){for(let e of this.getScriptElements()){let t=e.parentNode;if(t){let r=this.createScriptElement(e);t.replaceChild(r,e)}}}getScriptElements(){return w(document.documentElement.querySelectorAll("script"))}};var Re=class{constructor(e){this.detailsByOuterHTML=e.reduce((t,r)=>{let{outerHTML:s}=r,n=s in t?t[s]:{type:Xt(r),tracked:Qt(r),elements:[]};return Object.assign(Object.assign({},t),{[s]:Object.assign(Object.assign({},n),{elements:[...n.elements,r]})})},{})}static fromHeadElement(e){let t=e?w(e.children):[];return new this(t)}getTrackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInDetails(e){return this.getElementsMatchingTypeNotInDetails("script",e)}getStylesheetElementsNotInDetails(e){return this.getElementsMatchingTypeNotInDetails("stylesheet",e)}getElementsMatchingTypeNotInDetails(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}getProvisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:s,elements:n}=this.detailsByOuterHTML[t];return r==null&&!s?[...e,...n]:n.length>1?[...e,...n.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[s]}=this.detailsByOuterHTML[r];return Yt(s,e)?s:t},void 0)}};function Xt(i){if(Zt(i))return"script";if(Gt(i))return"stylesheet"}function Qt(i){return i.getAttribute("data-turbo-track")=="reload"}function Zt(i){return i.tagName.toLowerCase()=="script"}function Gt(i){let e=i.tagName.toLowerCase();return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function Yt(i,e){return i.tagName.toLowerCase()=="meta"&&i.getAttribute("name")==e}var D=class{constructor(e,t){this.headDetails=e,this.bodyElement=t}static fromHTMLString(e){let t=document.createElement("html");return t.innerHTML=e,this.fromHTMLElement(t)}static fromHTMLElement(e){let t=e.querySelector("head"),r=e.querySelector("body")||document.createElement("body"),s=Re.fromHeadElement(t);return new this(s,r)}getRootLocation(){let e=this.getSetting("root","/");return new y(e)}getElementForAnchor(e){try{return this.bodyElement.querySelector(`[id='${e}'], a[name='${e}']`)}catch{return null}}getPermanentElements(){return w(this.bodyElement.querySelectorAll("[id][data-turbo-permanent]"))}getPermanentElementById(e){return this.bodyElement.querySelector(`#${e}[data-turbo-permanent]`)}getPermanentElementsPresentInPage(e){return this.getPermanentElements().filter(({id:t})=>e.getPermanentElementById(t))}findFirstAutofocusableElement(){return this.bodyElement.querySelector("[autofocus]")}isNativeError(){return this.getSetting("visit-control",!1)!=!1}isEnabled(){return this.getSetting("visit-control")!="disable"}isVisitable(){return this.isEnabled()&&this.getSetting("visit-control")!="reload"}isViewTransitionEnabled(){return this.getSetting("view-transition")==="same-origin"}getSetting(e,t){let r=this.headDetails.getMetaValue(`turbo-${e}`);return r??t}};var je=class extends O{constructor(e,t,r){super(),this.delegate=e,this.currentPage=t,this.currentHeadDetails=t.headDetails,this.newPage=r,this.newHeadDetails=r.headDetails,this.newBody=r.bodyElement}static render(e,t,r,s){return new this(e,r,s).render(t)}render(e){this.shouldRender()?(this.delegate.beginPendingAssets(),this.mergeHead(),this.renderView(()=>{this.replaceBody(),this.focusFirstAutofocusableElement(),e()})):this.invalidateView()}mergeHead(){this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()}replaceBody(){let e=this.relocateCurrentBodyPermanentElements();this.activateNewBodyScriptElements(),this.assignNewBody(),this.replacePlaceholderElementsWithClonedPermanentElements(e)}shouldRender(){return this.currentPage.isEnabled()&&this.newPage.isVisitable()&&this.trackedElementsAreIdentical()}trackedElementsAreIdentical(){return this.currentHeadDetails.getTrackedElementSignature()==this.newHeadDetails.getTrackedElementSignature()}copyNewHeadStylesheetElements(){for(let e of this.getNewHeadStylesheetElements())document.head.appendChild(e)}copyNewHeadScriptElements(){for(let e of this.getNewHeadScriptElements()){let t=this.createScriptElement(e);document.head.appendChild(t),t!==e&&this.bindPendingScriptElement(t)}}bindPendingScriptElement(e){if(!_t(e))return;let t=this.delegate.trackPendingAsset();e.hasAttribute("src")?er(e,t):tr(e,t)}removeCurrentHeadProvisionalElements(){for(let e of this.getCurrentHeadProvisionalElements())document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.getNewHeadProvisionalElements())document.head.appendChild(e)}relocateCurrentBodyPermanentElements(){return this.getCurrentBodyPermanentElements().reduce((e,t)=>{let r=this.newPage.getPermanentElementById(t.id);if(r){let s=rr(t);return z(t,s.element),z(r,t),[...e,s]}else return e},[])}replacePlaceholderElementsWithClonedPermanentElements(e){for(let{element:t,permanentElement:r}of e){let s=r.cloneNode(!0);z(t,s)}}activateNewBodyScriptElements(){for(let e of this.getNewBodyScriptElements()){let t=this.createScriptElement(e);t!==e&&(z(e,t),this.bindPendingScriptElement(t))}}assignNewBody(){z(document.body,this.newBody)}focusFirstAutofocusableElement(){let e=this.newPage.findFirstAutofocusableElement();sr(e)&&e.focus()}getNewHeadStylesheetElements(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)}getNewHeadScriptElements(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)}getCurrentHeadProvisionalElements(){return this.currentHeadDetails.getProvisionalElements()}getNewHeadProvisionalElements(){return this.newHeadDetails.getProvisionalElements()}getCurrentBodyPermanentElements(){return this.currentPage.getPermanentElementsPresentInPage(this.newPage)}getNewBodyScriptElements(){return w(this.newBody.querySelectorAll("script"))}};function _t(i){let e=(i.getAttribute("type")||"").trim().toLowerCase();return i.hasAttribute("async")?!1:e==="module"?!0:i.hasAttribute("src")&&!i.hasAttribute("nomodule")&&(e===""||/^(text|application)\/(x-)?(java|ecma)script$/.test(e))}function er(i,e){let t=()=>{i.removeEventListener("load",t),i.removeEventListener("error",t),e()};i.addEventListener("load",t),i.addEventListener("error",t)}function tr(i,e){let t=x(),r=document.createElement("script"),s=n=>{n.detail===t&&(removeEventListener("turbo:module-loaded",s),r.remove(),e())};r.setAttribute("type","module"),r.async=!1,i.nonce&&(r.nonce=i.nonce),r.textContent="dispatchEvent(new CustomEvent('turbo:module-loaded', { detail: '"+t+"' }));",addEventListener("turbo:module-loaded",s),i.parentNode.insertBefore(r,i.nextSibling)}function rr(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),{element:e,permanentElement:i}}function z(i,e){let t=i.parentElement;if(t)return t.replaceChild(e,i)}function sr(i){return i&&typeof i.focus=="function"}var ke=class{constructor(e){this.htmlElement=document.documentElement,this.delegate=e}getRootLocation(){return this.getPage().getRootLocation()}getElementForAnchor(e){return this.getPage().getElementForAnchor(e)}getPage(){return D.fromHTMLElement(this.htmlElement)}render({page:e,error:t},r){e?this.renderPage(e,r):this.renderError(t,r)}renderPage(e,t){je.render(this.delegate,t,this.getPage(),e)}renderError(e,t){Be.render(this.delegate,t,e||"")}};var qe={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},S={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},Pe=class{constructor(e,t,r,s=x()){this.identifier=x(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.progress=0,this.scrolled=!1,this.state=S.initialized,this.performScroll=()=>{this.scrolled||(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},this.controller=e,this.location=t,this.action=r,this.adapter=e.adapter,this.restorationIdentifier=s,this.isSamePage=this.locationChangeIsSamePage()}start(){this.state==S.initialized&&(this.recordTimingMetric(qe.visitStart),this.state=S.started,this.adapter.visitStarted(this))}cancel(){this.state==S.started&&(this.request&&this.request.abort(),this.cancelRender(),this.state=S.canceled)}complete(){this.state==S.started&&(this.recordTimingMetric(qe.visitEnd),this.state=S.completed,this.adapter.visitCompleted(this),this.controller.visitCompleted(this))}fail(){this.state==S.started&&(this.state=S.failed,this.adapter.visitFailed(this))}changeHistory(){if(!this.historyChanged){let e=this.location.isEqualTo(this.referrer)?"replace":this.action;this.getHistoryMethodForAction(e).call(this.controller,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){if(this.shouldIssueRequest()&&!this.request){let e=y.wrap(this.location).absoluteURL,t={method:"GET",headers:{},htmlOnly:!0,timeout:240};t.headers.Accept="text/html, application/xhtml+xml",t.headers["X-PJAX"]=1,this.referrer&&(t.headers["X-PJAX-REFERRER"]=y.wrap(this.referrer).absoluteURL),this.progress=0,this.request=new M(this,e,t),this.request.send()}}loadResponse(){let{request:e,response:t}=this;e&&t&&this.render(()=>{let r=D.fromHTMLString(t);e.failed&&!r.isNativeError()?this.controller.render({error:t},()=>{this.performScroll(),this.adapter.visitRendered(this),this.fail()}):this.controller.render({page:r},()=>{this.performScroll(),this.adapter.visitRendered(this),this.complete()})})}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(()=>{this.performScroll(),this.adapter.visitRendered(this)})}requestStarted(){this.recordTimingMetric(qe.requestStart),this.adapter.visitRequestStarted(this)}requestProgressed(e){this.progress=e,this.adapter.visitRequestProgressed&&this.adapter.visitRequestProgressed(this)}requestCompletedWithResponse(e,t,r){this.response=e,this.redirectedToLocation=y.wrap(r),this.adapter.visitRequestCompleted(this)}requestFailedWithStatusCode(e,t){this.response=t,this.adapter.visitRequestFailedWithStatusCode(this,e)}requestFinished(){this.recordTimingMetric(qe.requestEnd),this.adapter.visitRequestFinished(this)}scrollToRestoredPosition(){let e=this.restorationData?this.restorationData.scrollPosition:void 0;if(e)return this.controller.scrollToPosition(e),!0}scrollToAnchor(){if(this.location.anchor!=null)return this.controller.scrollToAnchor(this.location.anchor),!0}scrollToTop(){this.controller.scrollToPosition({x:0,y:0})}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(e){switch(e){case"swap":case"replace":return this.controller.replaceHistoryWithLocationAndRestorationIdentifier;case"advance":case"restore":return this.controller.pushHistoryWithLocationAndRestorationIdentifier}}shouldIssueRequest(){return!this.isSamePage}locationChangeIsSamePage(){if(this.action=="swap")return!0;let e=this.action=="restore"&&this.controller.lastRenderedLocation;return this.controller.locationIsSamePageAnchor(e||this.location)}render(e){this.cancelRender(),this.frame=requestAnimationFrame(()=>{delete this.frame,e.call(this)})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};var U=class i{constructor(){this.adapter=new Se(this),this.history=new Le(this),this.restorationData={},this.restorationDataKeys=[],this.restorationDataLimit=20,this.scrollManager=new Te(this),this.useScroll=!0,this.view=new ke(this),this.enabled=!0,this.pendingAssets=0,this.progressBarDelay=500,this.progressBarVisible=!0,this.started=!1,this.uniqueInlineScripts=new Set,this.uniqueInlineScriptsLimit=100,this.currentVisit=null,this.historyVisit=null,this.pageIsReady=!1,this.viewTransitionFinished=null,this.pageLoaded=()=>{this.pageIsReady=!0,this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad(),this.notifyApplicationAfterPageAndScriptsLoad(),this.observeInlineScripts()},this.clickCaptured=()=>{removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=e=>{if(this.enabled&&this.clickEventIsSignificant(e)){let t=this.getVisitableLinkForTarget(e.target);if(t){let r=this.getVisitableLocationForLink(t);if(r&&this.applicationAllowsFollowingLinkToLocation(t,r)){e.preventDefault();let s=this.getActionForLink(t),n=this.useScrollForLink(t);this.visit(r,{action:s,scroll:n})}}}}}start(){i.supported&&!this.started&&(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.startHistory(),this.scrollManager.start(),this.started=!0,this.enabled=this.documentIsEnabled())}takeOverScrollRestoration(){"scrollRestoration"in history&&!this.scrollRestorationTakenOver&&(this.previousScrollRestoration=history.scrollRestoration,history.scrollRestoration="manual",this.scrollRestorationTakenOver=!0)}disable(){this.enabled=!1}stop(){this.started&&(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1,"scrollRestoration"in history&&this.scrollRestorationTakenOver&&this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,this.scrollRestorationTakenOver=!1))}isEnabled(){return this.started&&this.enabled}pageReady(){return new Promise(e=>{this.pageIsReady?e():addEventListener("render",()=>e(),{once:!0})})}visit(e,t={}){e=y.wrap(e);let r=t.action||"advance";this.applicationAllowsVisitingLocation(e,r)&&(this.locationIsVisitable(e)?(this.useScroll=t.scroll!==!1,this.takeOverScrollRestoration(),this.adapter.visitProposedToLocationWithAction(e,r)):window.location.href=e.toString())}startVisitToLocationWithAction(e,t,r){if(i.supported){let s=this.getRestorationDataForIdentifier(r);this.startVisit(y.wrap(e),t,{restorationData:s})}else window.location.href=e.toString()}setProgressBarVisible(e){this.progressBarVisible=e}setProgressBarDelay(e){this.progressBarDelay=e}startHistory(){this.location=y.currentLocation,this.restorationIdentifier=x(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)}stopHistory(){this.history.stop()}getLastVisitUrl(){if(this.historyVisit)return this.historyVisit.referrer.absoluteURL}pushHistoryWithLocationAndRestorationIdentifier(e,t){this.historyVisit=this.currentVisit,this.location=y.wrap(e),this.restorationIdentifier=t,this.history.push(this.location,this.restorationIdentifier)}replaceHistoryWithLocationAndRestorationIdentifier(e,t){this.location=y.wrap(e),this.restorationIdentifier=t,this.history.replace(this.location,this.restorationIdentifier)}historyPoppedToLocationWithRestorationIdentifier(e,t,r){if(this.enabled){this.location=e,this.restorationIdentifier=t,this.takeOverScrollRestoration();let s=this.getRestorationDataForIdentifier(t);this.startVisit(e,"restore",{restorationIdentifier:t,restorationData:s,historyChanged:!0,direction:r})}else this.adapter.pageInvalidated()}scrollToAnchor(e){let t=this.view.getElementForAnchor(e);t?this.scrollToElement(t):this.scrollToPosition({x:0,y:0})}scrollToElement(e){this.scrollManager.scrollToElement(e)}scrollToPosition(e){this.scrollManager.scrollToPosition(e)}scrollPositionChanged(e){let t=this.getCurrentRestorationData();t.scrollPosition=e}beginPendingAssets(){this.pageIsReady=!1,this.pendingAssets=0,this.pendingAssetsRender={},this.settleVisitCompleted=this.trackPendingAsset()}trackPendingAsset(){let e=this.pendingAssetsRender,t=!1;return this.pendingAssets++,()=>{!t&&e===this.pendingAssetsRender&&(t=!0,this.decrementPendingAsset())}}decrementPendingAsset(){this.pendingAssets--,this.pendingAssets===0&&(this.pageIsReady=!0,this.notifyApplicationAfterPageAndScriptsLoad(),this.notifyApplicationAfterLoadScripts())}render(e,t){this.view.render(e,t)}viewInvalidated(){this.adapter.pageInvalidated()}viewAllowsImmediateRender(e,t){return this.pageIsReady=!1,this.notifyApplicationUnload(),!this.notifyApplicationBeforeRender(e,t).defaultPrevented}viewRendered(){this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()}setViewTransitionFinished(e){this.viewTransitionFinished=e}viewTransitionEnabled(){return this.view.getPage().isViewTransitionEnabled()}markVisitDirection(e,t){t||(t={advance:"forward",restore:"back"}[e]||"none"),document.documentElement.setAttribute("data-turbo-visit-direction",t)}unmarkVisitDirection(){document.documentElement.removeAttribute("data-turbo-visit-direction")}observeInlineScripts(){document.documentElement.querySelectorAll("script[data-turbo-eval-once]").forEach(e=>this.applicationHasSeenInlineScript(e))}applicationHasSeenInlineScript(e){let t=e.getAttribute("data-turbo-eval-once");if(!t)return!1;let r=this.uniqueInlineScripts.has(t);if(!r){if(this.uniqueInlineScripts.size>=this.uniqueInlineScriptsLimit){let s=this.uniqueInlineScripts.values();this.uniqueInlineScripts.delete(s.next().value)}this.uniqueInlineScripts.add(t)}return r}applicationAllowsFollowingLinkToLocation(e,t){return!this.notifyApplicationAfterClickingLinkToLocation(e,t).defaultPrevented}applicationAllowsVisitingLocation(e,t){return!this.notifyApplicationBeforeVisitingLocation(e,t).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t){return u("page:click",{target:e,detail:{url:t.absoluteURL}})}notifyApplicationBeforeVisitingLocation(e,t){return u("page:before-visit",{detail:{url:e.absoluteURL,action:t}})}notifyApplicationAfterVisitingLocation(e){return u("page:visit",{detail:{url:e.absoluteURL},cancelable:!1})}notifyApplicationBeforeRender(e,t){return u("page:before-render",{detail:{newBody:e,...t}})}notifyApplicationAfterRender(){return u("page:render",{cancelable:!1})}notifyApplicationAfterPageLoad(e={}){return u("page:load",{detail:{url:this.location.absoluteURL,timing:e},cancelable:!1})}notifyApplicationAfterPageAndScriptsLoad(){return u("page:loaded",{cancelable:!1})}notifyApplicationAfterLoadScripts(){return u("page:updated",{cancelable:!1})}notifyApplicationUnload(){return u("page:unload",{cancelable:!1})}startVisit(e,t,r){this.currentVisit&&this.currentVisit.cancel(),this.currentVisit=this.createVisit(e,t,r),this.currentVisit.scrolled=!this.useScroll,this.markVisitDirection(t,r.direction),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(e)}createVisit(e,t,r){let s=new Pe(this,e,t,r.restorationIdentifier);return s.restorationData=Object.assign({},r.restorationData||{}),s.historyChanged=!!r.historyChanged,s.referrer=this.location,s}visitCompleted(e){this.viewTransitionFinished?(this.viewTransitionFinished.then(()=>{this.unmarkVisitDirection()}).catch(()=>{this.unmarkVisitDirection()}),this.viewTransitionFinished=null):this.unmarkVisitDirection(),this.notifyApplicationAfterPageLoad(e.getTimingMetrics());let t=this.settleVisitCompleted||this.trackPendingAsset();this.settleVisitCompleted=null,t()}clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}getVisitableLinkForTarget(e){if(e instanceof Element&&this.elementIsVisitable(e)){var t=e.closest("a[href]:not([download])");return t&&t.getAttribute("target")&&t.getAttribute("target")!="_self"?null:t}}getVisitableLocationForLink(e){let t=new y(e.getAttribute("href")||"");if(this.locationIsVisitable(t))return t}getActionForLink(e){let t=e.getAttribute("data-turbo-action");return this.isAction(t)?t:"advance"}useScrollForLink(e){return e.getAttribute("data-turbo-no-scroll")===null}isAction(e){return e=="advance"||e=="replace"||e=="restore"||e=="swap"}documentIsEnabled(){let e=document.documentElement.querySelector('head meta[name="turbo-visit-control"]');return e?e.getAttribute("content")=="enable":!1}elementIsVisitable(e){let t=e.closest("[data-turbo]");return t?t.getAttribute("data-turbo")!="false":!0}locationIsVisitable(e){return e.isPrefixedBy(this.view.getRootLocation())&&e.isHTML()}locationIsSamePageAnchor(e){return typeof e.anchor<"u"&&e.requestURL==this.location.requestURL}getCurrentRestorationData(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)}getRestorationDataForIdentifier(e){return e in this.restorationData||(this.restorationData[e]={},this.restorationDataKeys.push(e),this.trimRestorationData()),this.restorationData[e]}trimRestorationData(){for(;this.restorationDataKeys.length>this.restorationDataLimit;){let e=this.restorationDataKeys.shift();delete this.restorationData[e]}}};U.supported=!!(window.history.pushState&&window.requestAnimationFrame&&window.addEventListener);var T=new U,Ce={get supported(){return U.supported},controller:T,visit(i,e){T.isEnabled()?T.visit(i,e):window.location.assign(i)},setProgressBarVisible(i){T.setProgressBarVisible(i)},setProgressBarDelay(i){T.setProgressBarDelay(i)},start(){T.start()},isEnabled(){return T.isEnabled()},pageReady(){return T.pageReady()}};var Me=class i{static proxyCounter=0;static get shouldLoad(){return!0}static afterLoad(e,t){}constructor(e){this.context=e,this.config=this.parseDataset(e.scope.element.dataset||{})}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}init(){}connect(){}disconnect(){}initBefore(){this.proxiedEvents={},this.proxiedMethods={}}initAfter(){}connectBefore(){}connectAfter(){}disconnectBefore(){}disconnectAfter(){for(let e in this.proxiedEvents)this.forget(...this.proxiedEvents[e]),delete this.proxiedEvents[e];for(let e in this.proxiedMethods)this.proxiedMethods[e]=void 0}listen(e,t,r,s){typeof t=="string"?d.on(this.element,e,t,this.proxy(r),s):t instanceof Element?d.on(t,e,this.proxy(r),s):d.on(this.element,e,this.proxy(t),r),i.proxyCounter++,this.proxiedEvents[i.proxyCounter]=arguments}forget(e,t,r,s){typeof t=="string"?d.off(this.element,e,t,this.proxy(r),s):t instanceof Element?d.off(t,e,this.proxy(r),s):d.off(this.element,e,this.proxy(t),r);let n=(o,a)=>{if(o.length!==a.length)return!1;for(var l=0;ls.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s}); !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function o(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function t(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(c," ")),u.json?JSON.parse(e):e}catch(e){}}function r(n,o){var i=u.raw?n:t(n);return e.isFunction(o)?o(i):i}var c=/\+/g,u=e.cookie=function(t,c,s){if(arguments.length>1&&!e.isFunction(c)){if(s=e.extend({},u.defaults,s),"number"==typeof s.expires){var d=s.expires,f=s.expires=new Date;f.setMilliseconds(f.getMilliseconds()+864e5*d)}return document.cookie=[n(t),"=",i(c),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("")}for(var a=t?void 0:{},p=document.cookie?document.cookie.split("; "):[],l=0,m=p.length;lPrevious',nextArrow:'',autoplay:false,autoplaySpeed:3e3,centerMode:false,centerPadding:"50px",cssEase:"ease",customPaging:function(slider,i){return $('',close:'',arrowLeft:'',arrowRight:'',smallBtn:''},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded.
Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden.
Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){var t,n=e.createElement("fakeelement"),a={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in a)if(n.style[t]!==o)return a[t];return"transitionend"}(),f=function(t){return t&&t.length&&t[0].offsetHeight},p=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},h=function(o){for(var a,i=o[0],s=i.getBoundingClientRect(),r=[],c=n(t).height(),l=n(e).scrollTop(),d=s.top+l,u=l-d,f=d+s.height-(l+c);null!==i.parentElement;)"hidden"!==n(i.parentElement).css("overflow")&&"auto"!==n(i.parentElement).css("overflow")||r.push(i.parentElement.getBoundingClientRect()),i=i.parentElement;return a=r.every(function(t){var e=Math.min(s.right,t.right)-Math.max(s.left,t.left),n=Math.min(s.bottom,t.bottom)-Math.max(s.top,t.top);return e>0&&n>0}),!a||l>d+s.height||d>l+c?0:u>0?100-100*u/s.height:f>0?100-100*f/s.height:100},g=function(t,e,o){var a=this;a.opts=p({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(a.opts=p(a.opts,e)),n.fancybox.isMobile&&(a.opts=p(a.opts,a.opts.mobile)),a.id=a.opts.id||++c,a.currIndex=parseInt(a.opts.index,10)||0,a.prevIndex=null,a.prevPos=null,a.currPos=0,a.firstRun=!0,a.group=[],a.slides={},a.addContent(t),a.group.length&&a.init()};n.extend(g.prototype,{init:function(){var o,a,i=this,s=i.group[i.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&r.hideScrollbar!==!1&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('"),n("body").addClass("compensate-for-scrollbar")),a="",n.each(r.buttons,function(t,e){a+=r.btnTpl[e]||""}),o=n(i.translate(i,r.baseTpl.replace("{{buttons}}",a).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+i.id).addClass(r.baseClass).data("FancyBox",i).appendTo(r.parentEl),i.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){i.$refs[t]=o.find(".fancybox-"+t)}),i.trigger("onInit"),i.activate(),i.jumpTo(i.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang];return e.replace(/\{\{(\w+)\}\}/g,function(t,e){var a=n[e];return a===o?t:a})},addContent:function(t){var e,a=this,i=n.makeArray(t);n.each(i,function(t,e){var i,s,r,c,l,d={},u={};n.isPlainObject(e)?(d=e,u=e.opts||e):"object"===n.type(e)&&n(e).length?(i=n(e),u=i.data()||{},u=n.extend(!0,{},u,u.options),u.$orig=i,d.src=a.opts.src||u.src||i.attr("href"),d.type||d.src||(d.type="inline",d.src=e)):d={type:"html",src:e+""},d.opts=n.extend(!0,{},a.opts,u),n.isArray(u.buttons)&&(d.opts.buttons=u.buttons),n.fancybox.isMobile&&d.opts.mobile&&(d.opts=p(d.opts,d.opts.mobile)),s=d.type||d.opts.type,c=d.src||"",!s&&c&&((r=c.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(s="video",d.opts.video.format||(d.opts.video.format="video/"+("ogv"===r[1]?"ogg":r[1]))):c.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":c.match(/\.(pdf)((\?|#).*)?$/i)?s="iframe":"#"===c.charAt(0)&&(s="inline")),s?d.type=s:a.trigger("objectNeedsType",d),d.contentType||(d.contentType=n.inArray(d.type,["html","inline","ajax"])>-1?"html":d.type),d.index=a.group.length,"auto"==d.opts.smallBtn&&(d.opts.smallBtn=n.inArray(d.type,["html","inline","ajax"])>-1),"auto"===d.opts.toolbar&&(d.opts.toolbar=!d.opts.smallBtn),d.opts.$trigger&&d.index===a.opts.index&&(d.opts.$thumb=d.opts.$trigger.find("img:first"),d.opts.$thumb.length&&(d.opts.$orig=d.opts.$trigger)),d.opts.$thumb&&d.opts.$thumb.length||!d.opts.$orig||(d.opts.$thumb=d.opts.$orig.find("img:first")),"function"===n.type(d.opts.caption)&&(d.opts.caption=d.opts.caption.apply(e,[a,d])),"function"===n.type(a.opts.caption)&&(d.opts.caption=a.opts.caption.apply(e,[a,d])),d.opts.caption instanceof n||(d.opts.caption=d.opts.caption===o?"":d.opts.caption+""),"ajax"===d.type&&(l=c.split(/\s+/,2),l.length>1&&(d.src=l.shift(),d.opts.filter=l.shift())),d.opts.modal&&(d.opts=n.extend(!0,d.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),a.group.push(d)}),Object.keys(a.slides).length&&(a.updateControls(),e=a.Thumbs,e&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),e.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),e.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),e.next()}).on("click.fb","[data-fancybox-zoom]",function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?d(function(){e.update()}):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout(function(){e.$refs.stage.show(),e.update()},n.fancybox.isMobile?600:250))}),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,a=o.current,i=t.keyCode||t.which;if(9==i)return void(a.opts.trapFocus&&e.focus(t));if(!(!a.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input")||n(t.target).is("textarea")))return 8===i||27===i?(t.preventDefault(),void e.close(t)):37===i||38===i?(t.preventDefault(),void e.previous()):39===i||40===i?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,i)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1}),e.idleInterval=t.setInterval(function(){e.idleSecondsCounter++,e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var a,i,s,r,c,l,u,p,h=this,g=h.group.length;if(!(h.isDragging||h.isClosing||h.isAnimating&&h.firstRun)){if(t=parseInt(t,10),s=h.current?h.current.opts.loop:h.opts.loop,!s&&(t<0||t>=g))return!1;if(a=h.firstRun=!Object.keys(h.slides).length,c=h.current,h.prevIndex=h.currIndex,h.prevPos=h.currPos,r=h.createSlide(t),g>1&&((s||r.index0)&&h.createSlide(t-1)),h.current=r,h.currIndex=r.index,h.currPos=r.pos,h.trigger("beforeShow",a),h.updateControls(),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=h.isMoved(c),r.$slide.addClass("fancybox-slide--current"),a)return r.opts.animationEffect&&e&&h.$refs.container.css("transition-duration",e+"ms"),h.$refs.container.addClass("fancybox-is-open").trigger("focus"),h.loadSlide(r),void h.preload("image");l=n.fancybox.getTranslate(c.$slide),u=n.fancybox.getTranslate(h.$refs.stage),n.each(h.slides,function(t,e){n.fancybox.stop(e.$slide,!0)}),c.pos!==r.pos&&(c.isComplete=!1,c.$slide.removeClass("fancybox-slide--complete fancybox-slide--current")),i?(p=l.left-(c.pos*l.width+c.pos*c.opts.gutter),n.each(h.slides,function(t,o){var a=o.pos*l.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:a+p-u.left}),o.pos!==r.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>r.pos?"next":"previous")),f(o.$slide),d(function(){n.fancybox.animate(o.$slide,{top:0,left:(o.pos-r.pos)*l.width+(o.pos-r.pos)*o.opts.gutter},e,function(){o.$slide.removeAttr("style").removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===h.currPos&&h.complete()})})})):(r.$slide.parent().children().removeAttr("style"),e&&r.opts.transitionEffect&&n.fancybox.animate(c.$slide,"fancybox-animated fancybox-slide--"+(c.pos>r.pos?"next":"previous")+" fancybox-fx-"+r.opts.transitionEffect,e,null,!1)),r.isLoaded?h.revealContent(r):h.loadSlide(r),h.preload("image")}},createSlide:function(t){var e,o,a=this;return o=t%a.group.length,o=o<0?a.group.length+o:o,!a.slides[t]&&a.group[o]&&(e=n('
').appendTo(a.$refs.stage),a.slides[t]=n.extend(!0,{},a.group[o],{pos:t,$slide:e,isLoaded:!1}),a.updateSlide(a.slides[t])),a.slides[t]},scaleToActual:function(t,e,a){var i,s,r,c,l,d=this,u=d.current,f=u.$content,p=n.fancybox.getTranslate(u.$slide).width,h=n.fancybox.getTranslate(u.$slide).height,g=u.width,b=u.height;!d.isAnimating&&f&&"image"==u.type&&u.isLoaded&&!u.hasError&&(n.fancybox.stop(f),d.isAnimating=!0,t=t===o?.5*p:t,e=e===o?.5*h:e,i=n.fancybox.getTranslate(f),i.top-=n.fancybox.getTranslate(u.$slide).top,i.left-=n.fancybox.getTranslate(u.$slide).left,c=g/i.width,l=b/i.height,s=.5*p-.5*g,r=.5*h-.5*b,g>p&&(s=i.left*c-(t*c-t),s>0&&(s=0),sh&&(r=i.top*l-(e*l-e),r>0&&(r=0),re-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(i=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/i?d=l/i:l>d*i&&(l=d*i)),u.width=l,u.height=d,u)},update:function(){var t=this;n.each(t.slides,function(e,n){t.updateSlide(n)})},updateSlide:function(t){var e=this,o=t&&t.$content,a=t.width||t.opts.width,i=t.height||t.opts.height,s=t.$slide;o&&(a||i||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(o),n.fancybox.setTranslate(o,e.getFitPos(t)),t.pos===e.currPos&&(e.isAnimating=!1,e.updateCursor())),s.length&&(s.trigger("refresh"),e.$refs.toolbar.toggleClass("compensate-for-scrollbar",s.get(0).scrollHeight>s.get(0).clientHeight)),e.trigger("onUpdate",t)},centerSlide:function(t,e){var a,i,s=this;s.current&&(a=Math.round(t.$slide.width()),i=t.pos-s.current.pos,n.fancybox.animate(t.$slide,{top:0,left:i*a+i*t.opts.gutter,opacity:1},e===o?0:e,function(){t.$slide.siblings().removeAttr("style").removeClass("fancybox-slide--previous fancybox-slide--next"),t.isComplete||s.complete()},!1))},isMoved:function(t){var e,o,a=t||this.current;return!!a&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(a.$slide),(Math.abs(e.top-o.top)>0||Math.abs(e.left-o.left)>0)&&!a.$slide.hasClass("fancybox-animated"))},updateCursor:function(t,e){var o,a=this,i=a.current,s=a.$refs.container;i&&!a.isClosing&&a.Guestures&&(s.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),o=a.isZoomable(),s.toggleClass("fancybox-is-zoomable",o),n("[data-fancybox-zoom]").prop("disabled",!o),a.canPan(t,e)?s.addClass("fancybox-can-pan"):o&&("zoom"===i.opts.clickContent||n.isFunction(i.opts.clickContent)&&"zoom"==i.opts.clickContent(i))?s.addClass("fancybox-can-zoomIn"):i.opts.touch&&(i.opts.touch.vertical||a.group.length>1)&&"video"!==i.contentType&&s.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if(t=e.getFitPos(n),n.width>t.width||n.height>t.height)return!0}return!1},isScaledDown:function(t,e){var a=this,i=!1,s=a.current,r=s.$content;return t!==o&&e!==o?i=t1.5||Math.abs(i.height-r.height)>1.5),r},loadSlide:function(t){var e,o,a,i=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,i.trigger("beforeLoad",t)===!1)return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":i.setImage(t);break;case"iframe":i.setIframe(t);break;case"html":i.setContent(t,t.src||t.content);break;case"video":i.setContent(t,t.opts.video.tpl.replace("{{src}}",t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format));break;case"inline":n(t.src).length?i.setContent(t,n(t.src)):i.setError(t);break;case"ajax":i.showLoading(t),a=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&i.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&i.setError(t)}})),o.one("onReset",function(){a.abort()});break;default:i.setError(t)}return!0}},setImage:function(e){var o,a,i,s,r,c=this,l=e.opts.srcset||e.opts.image.srcset;if(d(function(){d(function(){var t=e.$image;c.isClosing||!e.isLoading||t&&t.length&&t[0].complete||e.hasError||c.showLoading(e)})}),l){s=t.devicePixelRatio||1,r=t.innerWidth*s,i=l.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);return 0===n?e.url=t:void(o&&(e.value=o,e.postfix=t[t.length-1]))}),e}),i.sort(function(t,e){return t.value-e.value});for(var u=0;u=r||"x"===f.postfix&&f.value>=s){a=f;break}}!a&&i.length&&(a=i[i.length-1]),a&&(e.src=a.url,e.width&&e.height&&"w"==a.postfix&&(e.height=e.width/e.height*a.value,e.width=a.value),e.opts.srcset=l)}e.$content=n('
').addClass("fancybox-is-hidden").appendTo(e.$slide.addClass("fancybox-slide--image")),o=e.opts.thumb||!(!e.opts.$thumb||!e.opts.$thumb.length)&&e.opts.$thumb.attr("src"),e.opts.preload!==!1&&e.opts.width&&e.opts.height&&o&&(e.width=e.opts.width,e.height=e.opts.height,e.$ghost=n("").one("error",function(){n(this).remove(),e.$ghost=null}).one("load",function(){c.afterLoad(e)}).addClass("fancybox-image").appendTo(e.$content).attr("src",o)),c.setBigImage(e)},setBigImage:function(t){var e=this,o=n("");t.$image=o.one("error",function(){e.setError(t)}).one("load",function(){var n;t.$ghost||(e.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),e.afterLoad(t)),e.isClosing||(t.opts.srcset&&(n=t.opts.sizes,n&&"auto"!==n||(n=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),o.attr("sizes",n).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!e.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),e.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(o[0].complete||"complete"==o[0].readyState)&&o[0].naturalWidth&&o[0].naturalHeight?o.trigger("load"):o[0].error&&o.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),a=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),a>0&&(t.width=Math.floor(a*e/n),t.height=a)},setIframe:function(t){var e,a=this,i=t.opts.iframe,s=t.$slide;t.$content=n('
').css(i.css).appendTo(s),s.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(a.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),a.afterLoad(t)}),s.on("refresh.fb",function(){var n,a,r=t.$content,c=i.css.width,l=i.css.height;if(1===e[0].isReady){try{n=e.contents(),a=n.find("body")}catch(t){}a&&a.length&&a.children().length&&(s.css("overflow","visible"),r.css({width:"100%","max-width":"100%",height:"9999px"}),c===o&&(c=Math.ceil(Math.max(a[0].clientWidth,a.outerWidth(!0)))),r.css("width",c?c:"").css("max-width",""),l===o&&(l=Math.ceil(Math.max(a[0].clientHeight,a.outerHeight(!0)))),r.css("height",l?l:""),s.css("overflow","auto")),r.removeClass("fancybox-is-hidden")}})):this.afterLoad(t),e.attr("src",t.src),s.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?(e.hasClass("fancybox-content")&&e.parent(".fancybox-slide--html").trigger("onReset"),t.$placeholder=n("
").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("
").append(n.trim(e)).contents()),t.opts.filter&&(e=n("
").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("
"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("
").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),this.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;t=t||e.current,t&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn())},hideLoading:function(t){var e=this;t=t||e.current,t&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),t.pos===e.currPos&&e.updateCursor(),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('
').appendTo(t.$content)),e.revealContent(t))},revealContent:function(t){var e,a,i,s,r=this,c=t.$slide,l=!1,d=!1,u=r.isMoved(t),f=t.isRevealed;return t.isRevealed=!0,e=t.opts[r.firstRun?"animationEffect":"transitionEffect"],i=t.opts[r.firstRun?"animationDuration":"transitionDuration"],i=parseInt(t.forcedDuration===o?i:t.forcedDuration,10),t.pos===r.currPos&&(t.isComplete||(r.isAnimating=!0)),!u&&t.pos===r.currPos&&i||(e=!1),"zoom"===e&&(t.pos===r.currPos&&i&&"image"===t.type&&!t.hasError&&(d=r.getThumbPos(t))?l=r.getFitPos(t):e="fade"),"zoom"===e?(l.scaleX=l.width/d.width,l.scaleY=l.height/d.height,s=t.opts.zoomOpacity,"auto"==s&&(s=Math.abs(t.width/t.height-d.width/d.height)>.1),s&&(d.opacity=.1,l.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),d),void n.fancybox.animate(t.$content,l,i,function(){r.isAnimating=!1,r.complete()})):(r.updateSlide(t),e?(n.fancybox.stop(c),a="fancybox-animated fancybox-slide--"+(t.pos>=r.prevPos?"next":"previous")+" fancybox-fx-"+e,c.removeClass("fancybox-slide--current").addClass(a),t.$content.removeClass("fancybox-is-hidden"),c.hide().show(0),void n.fancybox.animate(c,"fancybox-slide--current",i,function(){c.removeClass(a).removeAttr("style"),t.pos===r.currPos&&r.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),void(f||!u||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"))))},getThumbPos:function(t){var n,o=this,a=!1,i=t.opts.$thumb,s=i&&i.length&&i[0].ownerDocument===e?i.offset():0;return s&&h(i)>=10&&(n=o.$refs.stage.offset(),a={top:s.top-n.top+parseFloat(i.css("border-top-width")||0),left:s.left-n.left+parseFloat(i.css("border-left-width")||0),width:i.width(),height:i.height(),scaleX:1,scaleY:1}),a},complete:function(){var t,e=this,o=e.current,a={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),f(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?a[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=a),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").on("ended",n.proxy(e.next,e)),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e=this,n=e.slides[e.currPos+1],o=e.slides[e.currPos-1];o&&o.type===t&&e.loadSlide(o),n&&n.type===t&&e.loadSlide(n)},focus:function(t,o){var a,i,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(a=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),a=a.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),a.length?(i=a.index(e.activeElement),t&&t.shiftKey?(i<0||0==i)&&(t.preventDefault(),a.eq(a.length-1).trigger("focus")):(i<0||i==a.length-1)&&(t&&t.preventDefault(),a.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,a,i,s,r,c,l,p=this,h=p.current,g=function(){p.cleanUp(t)};return!p.isClosing&&(p.isClosing=!0,p.trigger("beforeClose",t)===!1?(p.isClosing=!1,d(function(){p.update()}),!1):(p.removeEvents(),i=h.$content,o=h.opts.animationEffect,a=n.isNumeric(e)?e:o?h.opts.animationDuration:0,h.$slide.off(u).removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),h.$slide.siblings().trigger("onReset").remove(),a&&p.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing"),p.hideLoading(h),p.hideControls(),p.updateCursor(),"zoom"!==o||t!==!0&&i&&a&&"image"===h.type&&!h.hasError&&(l=p.getThumbPos(h))||(o="fade"),"zoom"===o?(n.fancybox.stop(i),s=n.fancybox.getTranslate(i),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=h.opts.zoomOpacity,"auto"==r&&(r=Math.abs(h.width/h.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(i,c),f(i),n.fancybox.animate(i,l,a,g),!0):(o&&a?t===!0?setTimeout(g,a):n.fancybox.animate(h.$slide.removeClass("fancybox-slide--current"),"fancybox-animated fancybox-slide--previous fancybox-fx-"+o,a,g):g(),!0)))},cleanUp:function(e){var o,a,i,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(a=t.scrollX,i=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(i).scrollLeft(a))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,a=Array.prototype.slice.call(arguments,1),i=this,s=e&&e.opts?e:i.current;return s?a.unshift(s):s=i,a.unshift(i),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,a)),o===!1?o:void("afterClose"!==t&&i.$refs?i.$refs.container.trigger(t+".fb",a):r.trigger(t+".fb",a))},updateControls:function(){var t=this,o=t.current,a=o.index,i=o.opts.caption,s=t.$refs.container,r=t.$refs.caption;o.$slide.trigger("refresh"),t.$caption=i&&i.length?r.html(i):null,t.isHiddenControls||t.isIdle||t.showControls(),s.find("[data-fancybox-count]").html(t.group.length),s.find("[data-fancybox-index]").html(a+1),s.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&a<=0),s.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&a>=t.group.length-1),"image"===o.type?s.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&s.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(){this.isHiddenControls=!0,this.$refs.container.removeClass("fancybox-show-infobar fancybox-show-toolbar fancybox-show-caption fancybox-show-nav")},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.isHiddenControls=!1, t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.isHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.4.2",defaults:i,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof g&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new g(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close(t))},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",a={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o?n+=" scale("+e.scaleX+", "+e.scaleY+")":e.scaleX!==o&&(n+=" scaleX("+e.scaleX+")"),n.length&&(a.transform=n),e.opacity!==o&&(a.opacity=e.opacity),e.width!==o&&(a.width=e.width),e.height!==o&&(a.height=e.height),t.css(a)},animate:function(t,e,a,i,s){var r,c=this,l=!1;n.isFunction(a)&&(i=a,a=null),n.isPlainObject(e)||t.removeAttr("style"),c.stop(t),t.on(u,function(o){(!o||!o.originalEvent||t.is(o.originalEvent.target)&&"z-index"!=o.originalEvent.propertyName)&&(c.stop(t),l&&c.setTranslate(t,l),n.isNumeric(a)&&t.css("transition-duration",""),n.isPlainObject(e)?s===!1&&t.removeAttr("style"):s!==!0&&t.removeClass(e),n.isFunction(i)&&i(o))}),n.isNumeric(a)&&t.css("transition-duration",a+"ms"),n.isPlainObject(e)?(e.scaleX!==o&&e.scaleY!==o&&(r=n.fancybox.getTranslate(t),l=n.extend({},e,{width:r.width*e.scaleX,height:r.height*e.scaleY,scaleX:1,scaleY:1}),delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger("transitionend")},a+16))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(u),t.off(u).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},a):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},a),this},r.on("click.fb-start","[data-fancybox]",a),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=".fancybox-button",e="fancybox-focus",o=null;r.on("mousedown mouseup focus blur",t,function(a){switch(a.type){case"mousedown":o=n(this);break;case"mouseup":o=null;break;case"focusin":n(t).removeClass(e),n(this).is(o)||n(this).is("[disabled]")||n(this).addClass(e);break;case"focusout":n(t).removeClass(e)}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"//www.youtube-nocookie.com/embed/$4",thumb:"//img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,a,i){var s,r,c,l,d,u,f,p=i.src||"",h=!1;s=t.extend(!0,{},e,i.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var a=0;a1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),a=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),i=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,a=o.length;ee.clientHeight,i=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return a||i},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){this.$container.off(".fb.touch")},d.prototype.ontouchstart=function(o){var a=this,c=n(o.target),d=a.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&a.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||d.isClosing)return o.stopPropagation(),void o.preventDefault();if(a.realPoints=a.startPoints=i(o),a.startPoints.length){if(u.touch&&o.stopPropagation(),a.startEvent=o,a.canTap=!u.$slide.hasClass("fancybox-animated"),a.$target=c,a.$content=p,a.opts=u.opts.touch,a.isPanning=!1,a.isSwiping=!1,a.isZooming=!1,a.isScrolling=!1,a.canPan=d.canPan(),a.startTime=(new Date).getTime(),a.distanceX=a.distanceY=a.distance=0,a.canvasWidth=Math.round(f[0].clientWidth),a.canvasHeight=Math.round(f[0].clientHeight),a.contentLastPos=null,a.contentStartPos=n.fancybox.getTranslate(a.$content)||{top:0,left:0},a.sliderStartPos=a.sliderLastPos||n.fancybox.getTranslate(f),a.stagePos=n.fancybox.getTranslate(d.$refs.stage),a.sliderStartPos.top-=a.stagePos.top,a.sliderStartPos.left-=a.stagePos.left,a.contentStartPos.top-=a.stagePos.top,a.contentStartPos.left-=a.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(a,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(a,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",a.onscroll,!0),!a.opts&&!a.canPan||!c.is(a.$stage)&&!a.$stage.find(c).length)return void(c.is(".fancybox-image")&&o.preventDefault());a.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&a.isScrollable||o.preventDefault(),(1===a.startPoints.length||u.hasError)&&(a.canPan?(n.fancybox.stop(a.$content),a.isPanning=!0):a.isSwiping=!0,a.$container.addClass("fancybox-is-grabbing")),2===a.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(a.canTap=!1,a.isSwiping=!1,a.isPanning=!1,a.isZooming=!0,n.fancybox.stop(a.$content),a.centerPointStartX=.5*(a.startPoints[0].x+a.startPoints[1].x)-n(t).scrollLeft(),a.centerPointStartY=.5*(a.startPoints[0].y+a.startPoints[1].y)-n(t).scrollTop(),a.percentageOfImageAtPinchPointX=(a.centerPointStartX-a.contentStartPos.left)/a.contentStartPos.width,a.percentageOfImageAtPinchPointY=(a.centerPointStartY-a.contentStartPos.top)/a.contentStartPos.height,a.startDistanceBetweenFingers=s(a.startPoints[0],a.startPoints[1]))}}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=i(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&e.isSwiping===!0||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var i,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(c!==!0)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(a(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||s.opts.vertical===!1||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(i=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=i>45&&i<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,a;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),a=n.fancybox.getTranslate(r.$refs.stage),e.$slide.removeAttr("style").removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.left=o.left-a.left),n.fancybox.setTranslate(e.$slide,{top:o.top-a.top,left:o.left-a.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;return s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?void(t.startPoints=t.newPoints):(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&(a(t.requestId),t.requestId=null),void(t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},d.prototype.limitMovement=function(){var t,e,n,o,a,i,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return a=h>r?f+l:f,i=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&a>t&&(a=t-1+Math.pow(-t+f+l,.8)||0),l<0&&a0&&i>e&&(i=e-1+Math.pow(-e+p+d,.8)||0),d<0&&ii?(t=t>0?0:t,t=ts?(e=e>0?0:e,e=e1&&(o.dMs>130&&r>10||r>50),l=Math.abs(s*o.canvasWidth/o.canvasWidth)>.8?366:500;o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),a=o.instance.close(!0,200)):c&&o.distanceX>0?a=o.instance.previous(l):c&&o.distanceX<0&&(a=o.instance.next(l)),a!==!1||"x"!=t&&"y"!=t||o.instance.centerSlide(o.instance.current,150),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,a=this;a.contentLastPos&&(a.opts.momentum===!1||a.dMs>350?(t=a.contentLastPos.left,e=a.contentLastPos.top):(t=a.contentLastPos.left+500*a.velocityX,e=a.contentLastPos.top+500*a.velocityY),o=a.limitPosition(t,e,a.contentStartPos.width,a.contentStartPos.height),o.width=a.contentStartPos.width,o.height=a.contentStartPos.height,n.fancybox.animate(a.$content,o,330))},d.prototype.endZooming=function(){var t,e,o,a,i=this,s=i.instance.current,r=i.newWidth,c=i.newHeight;i.contentLastPos&&(t=i.contentLastPos.left,e=i.contentLastPos.top,a={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(i.$content,a),rs.width||c>s.height?i.instance.scaleToActual(i.centerPointStartX,i.centerPointStartY,150):(o=i.limitPosition(t,e,r,c),n.fancybox.setTranslate(i.$content,n.fancybox.getTranslate(i.$content)),n.fancybox.animate(i.$content,o,150)))},d.prototype.onTap=function(e){var o,a=this,s=n(e.target),r=a.instance,c=r.current,l=e&&i(e)||a.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-a.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-a.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(a.startEvent);break;case"toggleControls":r.toggleControls(!0);break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(a.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(a.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(a.tapped){if(clearTimeout(a.tapped),a.tapped=null,Math.abs(d-a.tapX)>50||Math.abs(u-a.tapY)>50)return this;f("dblclick"+o)}else a.tapX=d,a.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?a.tapped=setTimeout(function(){a.tapped=null,f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:''},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('
').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,a=o.current;a&&(t===!0||a.opts.loop||o.currIndex'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.current.$content.css("transition","none"),n.isAnimating=!1,n.update(!0,!0,0)),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var a;return n?void(e&&e.group[e.currIndex].opts.fullScreen?(a=e.$refs.container,a.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()):void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove()},"afterKeydown.fb":function(t,e,n,o,a){e&&e.FullScreen&&70===a&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs",o=n+"-active";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:''},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var a=function(t){this.init(t)};e.extend(a.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e,n,o=this;o.instance=t,t.Thumbs=o,o.opts=t.group[t.currIndex].opts.thumbs,e=t.group[0],e=e.opts.thumb||!(!e.opts.$thumb||!e.opts.$thumb.length)&&e.opts.$thumb.attr("src"),t.group.length>1&&(n=t.group[1],n=n.opts.thumb||!(!n.opts.$thumb||!n.opts.$thumb.length)&&n.opts.$thumb.attr("src")),o.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]"),o.opts&&e&&n?(o.$button.show().on("click",function(){o.toggle()}),o.isActive=!0):o.$button.hide()},create:function(){var t,o=this,a=o.instance,i=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('
').appendTo(a.$refs.container.find(i).addBack().filter(i)),o.$grid.on("click","a",function(){a.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('
').appendTo(o.$grid)),e.each(a.group,function(e,n){t=n.opts.thumb||(n.opts.$thumb?n.opts.$thumb.attr("src"):null),t||"image"!==n.type||(t=n.src),s.push('")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+a.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,a=this,i=a.$list,s=a.$grid;a.instance.current&&(e=i.children().removeClass(o).filter('[data-index="'+a.instance.current.index+'"]').addClass(o),n=e.position(),"y"===a.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===a.opts.axis&&(n.lefts.scrollLeft()+(s.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new a(e),n.isActive&&n.opts.autoStart===!0&&n.show())},"beforeShow.fb":function(t,e,n,o){var a=e&&e.Thumbs;a&&a.isVisible&&a.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,a){var i=e&&e.Thumbs;i&&i.isActive&&71===a&&(o.preventDefault(),i.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&n.opts.hideOnClose!==!1&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:''},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},tpl:''}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,a=e.fancybox.getInstance(),i=a.current||null;i&&("function"===e.type(i.opts.share.url)&&(t=i.opts.share.url.apply(i,[a,i])),o=i.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===i.type?encodeURIComponent(i.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,a.$caption?encodeURIComponent(a.$caption.text()):""),e.fancybox.open({src:a.translate(a,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){a.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})},mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,a=n.join("-");return{hash:e,index:o<1?1:o,gallery:a}}function a(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function i(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""),""!==n&&n)}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)}),n(function(){n.fancybox.defaults.hash!==!1&&(n(e).on({"onInit.fb":function(t,e){var n,a;e.group[e.currIndex].opts.hash!==!1&&(n=o(),a=i(e),a&&n.gallery&&a==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,a,s){var r;a&&a.opts.hash!==!1&&(r=i(o),r&&(o.currentHash=r+(o.group.length>1?"-"+(a.index+1):""), t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300))))},"beforeClose.fb":function(n,o,a){a.opts.hash!==!1&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var a=n(o).data("FancyBox");if(a&&a.currentHash)return e=a,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&a(t)}),setTimeout(function(){n.fancybox.getInstance()||a(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,a=(new Date).getTime();e.group.length<2||o.opts.wheel===!1||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,a-n<250||(n=a,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery); /** * Author: Fatima Aurelia * Date: 01/22/2017 * Version: 1.0 */ document.addEventListener('click', function (e) { e = e || window.event; var target = e.target || e.srcElement; var body = document.getElementsByTagName("BODY")[0]; if (target.hasAttribute('data-toggle') && target.getAttribute('data-toggle') == 'modal') { if (target.hasAttribute('data-target')) { var m_ID = target.getAttribute('data-target'); document.getElementById(m_ID).classList.add('open'); body.classList.add('modal-open'); e.preventDefault(); } } // Close modal window with 'data-dismiss' attribute or when the backdrop is clicked if ((target.hasAttribute('data-dismiss') && target.getAttribute('data-dismiss') == 'modal') || target.classList.contains('modal')) { var modal = document.querySelector('[class="modal open"]'); modal.classList.remove('open'); body.classList.remove('modal-open'); e.preventDefault(); } }, false); !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=function(){function e(){var e=this,n=function(){var n=["br-wrapper"];""!==e.options.theme&&n.push("br-theme-"+e.options.theme),e.$elem.wrap(t("
",{"class":n.join(" ")}))},i=function(){e.$elem.unwrap()},a=function(n){return t.isNumeric(n)&&(n=Math.floor(n)),t('option[value="'+n+'"]',e.$elem)},r=function(){var n=e.options.initialRating;return n?a(n):t("option:selected",e.$elem)},o=function(){var n=e.$elem.find('option[value="'+e.options.emptyValue+'"]');return!n.length&&e.options.allowEmpty?(n=t("