1(function ($) { 2 3 /** 4 * Makes icons available to JavaScript and CSS files. 5 */ 6 Backdrop.behaviors.icons = { 7 attach: function (context, settings) { 8 if (!Backdrop.icons) { 9 Backdrop.icons = []; 10 } 11 if (settings.icons) { 12 for (const iconName in settings.icons) { 13 const iconPath = settings.icons[iconName]; 14 Backdrop.addIcon(iconName, iconPath); 15 } 16 } 17 } 18 }; 19 20 /** 21 * Add an individual icon to the Backdrop.icons namespace. 22 * 23 * This also makes the icon path available within CSS files via a CSS 24 * variable by the name --icon-[icon-name]. 25 */ 26 Backdrop.addIcon = function (iconName, iconPath) { 27 Backdrop.icons[iconName] = iconPath; 28 document.documentElement.style.setProperty('--icon-' + iconName, 'url(' + iconPath + ')'); 29 }; 30 31})(jQuery); 32; 33var luxon=function(e){"use strict";function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){e=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof e?e:String(e)}(r.key),r)}}function i(e,t,n){t&&L(e.prototype,t),n&&L(e,n),Object.defineProperty(e,"prototype",{writable:!1})}function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){e.prototype=Object.create(t.prototype),z(e.prototype.constructor=e,t)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function z(e,t){return(z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function A(e,t,n){return(A=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),1}catch(e){}}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);t=new(Function.bind.apply(e,r));return n&&z(t,n.prototype),t}).apply(null,arguments)}function q(e){var n="function"==typeof Map?new Map:void 0;return function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return A(e,arguments,j(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),z(t,e)}(e)}function _(e,t){if(null==e)return{};for(var n,r={},i=Object.keys(e),o=0;o<i.length;o++)n=i[o],0<=t.indexOf(n)||(r[n]=e[n]);return r}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){var n,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){var n;if(e)return"string"==typeof e?U(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(e,t):void 0}(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),n=0,function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(q(Error)),P=function(t){function e(e){return t.call(this,"Invalid DateTime: "+e.toMessage())||this}return o(e,t),e}(t),Y=function(t){function e(e){return t.call(this,"Invalid Interval: "+e.toMessage())||this}return o(e,t),e}(t),H=function(t){function e(e){return t.call(this,"Invalid Duration: "+e.toMessage())||this}return o(e,t),e}(t),w=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),J=function(t){function e(e){return t.call(this,"Invalid unit "+e)||this}return o(e,t),e}(t),u=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),n=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return o(t,e),t}(t),t="numeric",r="short",a="long",G={year:t,month:t,day:t},$={year:t,month:r,day:t},B={year:t,month:r,day:t,weekday:r},Q={year:t,month:a,day:t},K={year:t,month:a,day:t,weekday:a},X={hour:t,minute:t},ee={hour:t,minute:t,second:t},te={hour:t,minute:t,second:t,timeZoneName:r},ne={hour:t,minute:t,second:t,timeZoneName:a},re={hour:t,minute:t,hourCycle:"h23"},ie={hour:t,minute:t,second:t,hourCycle:"h23"},oe={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:r},ae={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:a},se={year:t,month:t,day:t,hour:t,minute:t},ue={year:t,month:t,day:t,hour:t,minute:t,second:t},le={year:t,month:r,day:t,hour:t,minute:t},ce={year:t,month:r,day:t,hour:t,minute:t,second:t},fe={year:t,month:r,day:t,weekday:r,hour:t,minute:t},de={year:t,month:a,day:t,hour:t,minute:t,timeZoneName:r},he={year:t,month:a,day:t,hour:t,minute:t,second:t,timeZoneName:r},me={year:t,month:a,day:t,weekday:a,hour:t,minute:t,timeZoneName:a},ye={year:t,month:a,day:t,weekday:a,hour:t,minute:t,second:t,timeZoneName:a},s=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new n},t.formatOffset=function(e,t){throw new n},t.offset=function(e){throw new n},t.equals=function(e){throw new n},i(e,[{key:"type",get:function(){throw new n}},{key:"name",get:function(){throw new n}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new n}},{key:"isValid",get:function(){throw new n}}]),e}(),ve=null,ge=function(e){function t(){return e.apply(this,arguments)||this}o(t,e);var n=t.prototype;return n.offsetName=function(e,t){return bt(e,t.format,t.locale)},n.formatOffset=function(e,t){return Nt(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},i(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return ve=null===ve?new t:ve}}]),t}(s),pe={};var ke={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var we={},c=function(n){function r(e){var t=n.call(this)||this;return t.zoneName=e,t.valid=r.isValidZone(e),t}o(r,n),r.create=function(e){return we[e]||(we[e]=new r(e)),we[e]},r.resetCache=function(){we={},pe={}},r.isValidSpecifier=function(e){return this.isValidZone(e)},r.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var e=r.prototype;return e.offsetName=function(e,t){return bt(e,t.format,t.locale,this.name)},e.formatOffset=function(e,t){return Nt(this.offset(e),t)},e.offset=function(e){var t,n,r,i,o,a,s,u,e=new Date(e);return isNaN(e)?NaN:(i=this.name,pe[i]||(pe[i]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),a=(i=(i=pe[i]).formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;i<n.length;i++){var o=n[i],a=o.type,o=o.value,s=ke[a];"era"===a?r[s]=o:N(s)||(r[s]=parseInt(o,10))}return r}
vendor: 6,703 bytes, line 33
33(i,e):(o=e,i=(i=i).format(o).replace(/\u200E/g,""),i=(o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i))[1],a=o[2],[o[3],i,a,o[4],o[5],o[6],o[7]]))[0],o=i[1],t=i[2],n=i[3],s=i[4],r=i[5],i=i[6],s=24===s?0:s,u=(e=+e)%1e3,(gt({year:a="BC"===n?1-Math.abs(a):a,month:o,day:t,hour:s,minute:r,second:i,millisecond:0})-(e-=0<=u?u:1e3+u))/6e4)},e.equals=function(e){return"iana"===e.type&&e.name===this.name},i(r,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),r}(s),be=["base"],Se=["padTo","floor"],Oe={};var Te={};function Ne(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=Te[n];return r||(r=new Intl.DateTimeFormat(e,t),Te[n]=r),r}var De={};var Me={};var Ie=null;var Ve={};function Ee(e,t,n,r){e=e.listingMode();return"error"===e?null:("en"===e?n:r)(t)}var xe=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=_(n,Se);(!t||0<Object.keys(r).length)&&(t=l({useGrouping:!1},n),0<n.padTo&&(t.minimumIntegerDigits=n.padTo),this.inf=(r=e,void 0===(n=t)&&(n={}),e=JSON.stringify([r,n]),(t=De[e])||(t=new Intl.NumberFormat(r,n),De[e]=t),t))}return e.prototype.format=function(e){var t;return this.inf?(t=this.floor?Math.floor(e):e,this.inf.format(t)):m(this.floor?Math.floor(e):ht(e,3),this.padTo)},e}(),Fe=function(){function e(e,t,n){this.opts=n;var n=this.originalZone=void 0,r=(this.opts.timeZone?this.dt=e:"fixed"===e.zone.type?(r=0<=(r=e.offset/60*-1)?"Etc/GMT+"+r:"Etc/GMT"+r,0!==e.offset&&c.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)):"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?n=(this.dt=e).zone.name:(this.dt=e.setZone(n="UTC").plus({minutes:e.offset}),this.originalZone=e.zone),l({},this.opts));r.timeZone=r.timeZone||n,this.dtf=Ne(t,r)}var t=e.prototype;return t.format=function(){return this.originalZone?this.formatToParts().map(function(e){return e.value}).join(""):this.dtf.format(this.dt.toJSDate())},t.formatToParts=function(){var t=this,e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(function(e){return"timeZoneName"===e.type?l({},e,{value:t.originalZone.offsetName(t.dt.ts,{locale:t.dt.locale,format:t.opts.timeZoneName})}):e}):e},t.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),Ce=function(){function e(e,t,n){var r;this.opts=l({style:"long"},n),!t&&ut()&&(this.rtf=(t=e,(n=e=void 0===(e=n)?{}:e).base,n=_(n=e,be),n=JSON.stringify([t,n]),(r=Me[n])||(r=new Intl.RelativeTimeFormat(t,e),Me[n]=r),r))}var t=e.prototype;return t.format=function(e,t){if(this.rtf)return this.rtf.format(e,t);var n=t,t=e,e=this.opts.numeric,r="long"!==this.opts.style,i=(void 0===e&&(e="always"),void 0===r&&(r=!1),{years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]}),o=-1===["hours","minutes","seconds"].indexOf(n);if("auto"===e&&o){var a="days"===n;switch(t){case 1:return a?"tomorrow":"next "+i[n][0];case-1:return a?"yesterday":"last "+i[n][0];case 0:return a?"today":"this "+i[n][0]}}var e=Object.is(t,-0)||t<0,t=1===(o=Math.abs(t)),s=i[n],r=r?!t&&s[2]||s[1]:t?i[n][0]:n;return e?o+" "+r+" ago":"in "+o+" "+r},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),Ze={firstDay:1,minimalDays:4,weekend:[6,7]},b=function(){function o(e,t,n,r,i){var e=function(t){var n=t.indexOf("-x-");if(-1===(n=(t=-1!==n?t.substring(0,n):t).indexOf("-u-")))return[t];try{r=Ne(t).resolvedOptions(),i=t}catch(e){var t=t.substring(0,n),r=Ne(t).resolvedOptions(),i=t}return[i,(n=r).numberingSystem,n.calendar]}(e),o=e[0],a=e[1],e=e[2];this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=n||e||null,this.weekSettings=r,this.intl=(o=this.locale,t=this.numberingSystem,((a=this.outputCalendar)||t)&&(o.includes("-u-")||(o+="-u"),a&&(o+="-ca-"+a),t)&&(o+="-nu-"+t),o),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}o.fromOpts=function(e){return o.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)},o.create=function(e,t,n,r,i){void 0===i&&(i=!1);e=e||O.defaultLocale;return new o(e||(i?"en-US":Ie=Ie||(new Intl.DateTimeFormat).resolvedOptions().locale),t||O.defaultNumberingSystem,n||O.defaultOutputCalendar,ft(r)||O.defaultWeekSettings,e)},o.resetCache=function(){Ie=null,Te={},De={},Me={}},o.fromObject=function(e){var e=void 0===e?{}:e,t=e.locale,n=e.numberingSystem,r=e.outputCalendar,e=e.weekSettings;return o.create(t,n,r,e)};var e=o.prototype;return e.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},e.clone=function(e){return e&&0!==Object.getOwnPropertyNames(e).length?o.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ft(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this},e.redefaultToEN=function(e){return this.clone(l({},e=void 0===e?{}:e,{defaultToEN:!0}))},e.redefaultToSystem=function(e){return this.clone(l({},e=void 0===e?{}:e,{defaultToEN:!1}))},e.months=function(n,r){var i=this;return void 0===r&&(r=!1),Ee(this,n,Et,function(){var t=r?{month:n,day:"numeric"}:{month:n},e=r?"format":"standalone";return i.monthsCache[e][n]||(i.monthsCache[e][n]=function(e){for(var t=[],n=1;n<=12;n++){var r=W.utc(2009,n,1);t.push(e(r))}return t}(function(e){return i.extract(e,t,"month")})),i.monthsCache[e][n]})},e.weekdays=function(n,r){var i=this;return void 0===r&&(r=!1),Ee(this,n,Zt,function(){var t=r?{weekday:n,year:"numeric",month:"long",day:"numeric"}:{weekday:n},e=r?"format":"standalone";return i.weekdaysCache[e][n]||(i.weekdaysCache[e][n]=function(e){for(var t=[],n=1;n<=7;n++){var r=W.utc(2016,11,13+n);t.push(e(r))}return t}(function(e){return i.extract(e,t,"weekday")})),i.weekdaysCache[e][n]})},e.meridiems=function(){var n=this;return Ee(this,void 0,function(){return Wt},function(){var t;return n.meridiemCache||(t={hour:"numeric",hourCycle:"h12"},n.meridiemCache=[W.utc(2016,11,13,9),W.utc(2016,11,13,19)].map(function(e){return n.extract(e,t,"dayperiod")})),n.meridiemCache})},e.eras=function(e){var n=this;return Ee(this,e,At,function(){var t={era:e};return n.eraCache[e]||(n.eraCache[e]=[W.utc(-40,1,1),W.utc(2017,1,1)].map(function(e){return n.extract(e,t,"era")})),n.eraCache[e]}
33)},e.extract=function(e,t,n){e=this.dtFormatter(e,t).formatToParts().find(function(e){return e.type.toLowerCase()===n});return e?e.value:null},e.numberFormatter=function(e){return new xe(this.intl,(e=void 0===e?{}:e).forceSimple||this.fastNumbers,e)},e.dtFormatter=function(e,t){return new Fe(e,this.intl,t=void 0===t?{}:t)},e.relFormatter=function(e){return void 0===e&&(e={}),new Ce(this.intl,this.isEnglish(),e)},e.listFormatter=function(e){return void 0===e&&(e={}),t=this.intl,void 0===(e=e)&&(e={}),n=JSON.stringify([t,e]),(r=Oe[n])||(r=new Intl.ListFormat(t,e),Oe[n]=r),r;var t,n,r},e.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},e.getWeekSettings=function(){return this.weekSettings||(lt()?(e=this.locale,(n=Ve[e])||(n="getWeekInfo"in(t=new Intl.Locale(e))?t.getWeekInfo():t.weekInfo,Ve[e]=n),n):Ze);var e,t,n},e.getStartOfWeek=function(){return this.getWeekSettings().firstDay},e.getMinDaysInFirstWeek=function(){return this.getWeekSettings().minimalDays},e.getWeekendDays=function(){return this.getWeekSettings().weekend},e.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},e.toString=function(){return"Locale("+this.locale+", "+this.numberingSystem+", "+this.outputCalendar+")"},i(o,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),o}(),We=null,f=function(n){function t(e){var t=n.call(this)||this;return t.fixed=e,t}o(t,n),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){e=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new t(St(e[1],e[2]))}return null};var e=t.prototype;return e.offsetName=function(){return this.name},e.formatOffset=function(e,t){return Nt(this.fixed,t)},e.offset=function(){return this.fixed},e.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},i(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+Nt(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+Nt(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return We=null===We?new t(0):We}}]),t}(s),Le=function(n){function e(e){var t=n.call(this)||this;return t.zoneName=e,t}o(e,n);var t=e.prototype;return t.offsetName=function(){return null},t.formatOffset=function(){return""},t.offset=function(){return NaN},t.equals=function(){return!1},i(e,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),e}(s);function S(e,t){var n;return N(e)||null===e?t:e instanceof s?e:"string"==typeof e?"default"===(n=e.toLowerCase())?t:"local"===n||"system"===n?ge.instance:"utc"===n||"gmt"===n?f.utcInstance:f.parseSpecifier(n)||c.create(e):v(e)?f.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new Le(e)}var je={arab:"[Ù -Ù©]",arabext:"[Û°-Û¹]",bali:"[á-á]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[ï¼-ï¼]",gujr:"[૦-૯]",hanidec:"[ã|ä¸|äº|ä¸|å|äº|å
|ä¸|å
«|ä¹]",khmr:"[á -á©]",knda:"[೦-೯]",laoo:"[à»-à»]",limb:"[á¥-á¥]",mlym:"[൦-൯]",mong:"[á -á ]",mymr:"[á-á]",orya:"[à¦-à¯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[à¹-à¹]",tibt:"[༠-༩]",latn:"\\d"},ze={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ae=je.hanidec.replace(/[\[|\]]/g,"").split("");var d={};function y(e,t){void 0===t&&(t="");e=e.numberingSystem||"latn";return d[e]||(d[e]={}),d[e][t]||(d[e][t]=new RegExp(""+je[e]+t)),d[e][t]}var qe,_e=function(){return Date.now()},Ue="system",Re=null,Pe=null,Ye=null,He=60,Je=null,O=function(){function e(){}return e.resetCaches=function(){b.resetCache(),c.resetCache(),W.resetCache(),d={}},i(e,null,[{key:"now",get:function(){return _e},set:function(e){_e=e}},{key:"defaultZone",get:function(){return S(Ue,ge.instance)},set:function(e){Ue=e}},{key:"defaultLocale",get:function(){return Re},set:function(e){Re=e}},{key:"defaultNumberingSystem",get:function(){return Pe},set:function(e){Pe=e}},{key:"defaultOutputCalendar",get:function(){return Ye},set:function(e){Ye=e}},{key:"defaultWeekSettings",get:function(){return Je},set:function(e){Je=ft(e)}},{key:"twoDigitCutoffYear",get:function(){return He},set:function(e){He=e%100}}
vendor: 47,605 bytes, line 33
33,{key:"throwOnInvalid",get:function(){return qe},set:function(e){qe=e}}]),e}(),h=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),Ge=[0,31,59,90,120,151,181,212,243,273,304,334],$e=[0,31,60,91,121,152,182,213,244,274,305,335];function T(e,t){return new h("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function Be(e,t,n){t=new Date(Date.UTC(e,t-1,n)),e<100&&0<=e&&t.setUTCFullYear(t.getUTCFullYear()-1900),n=t.getUTCDay();return 0===n?7:n}function Qe(e,t,n){return n+(mt(e)?$e:Ge)[t-1]}function Ke(e,t){var e=mt(e)?$e:Ge,n=e.findIndex(function(e){return e<t});return{month:n+1,day:t-e[n]}}function Xe(e,t){return(e-t+7)%7+1}function et(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.year,o=e.month,a=e.day,s=Qe(i,o,a),o=Xe(Be(i,o,a),n),a=Math.floor((s-o+14-t)/7);return a<1?a=kt(r=i-1,t,n):a>kt(i,t,n)?(r=i+1,a=1):r=i,l({weekYear:r,weekNumber:a,weekday:o},Dt(e))}function tt(e,t,n){void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,a=e.weekday,n=Xe(Be(i,1,t=void 0===t?4:t),n),s=yt(i),o=7*o+a-n-7+t,a=(o<1?o+=yt(r=i-1):s<o?(r=i+1,o-=yt(i)):r=i,Ke(r,o));return l({year:r,month:a.month,day:a.day},Dt(e))}function nt(e){var t=e.year;return l({year:t,ordinal:Qe(t,e.month,e.day)},Dt(e))}function rt(e){var t=e.year,n=Ke(t,e.ordinal);return l({year:t,month:n.month,day:n.day},Dt(e))}function it(e,t){if(N(e.localWeekday)&&N(e.localWeekNumber)&&N(e.localWeekYear))return{minDaysInFirstWeek:4,startOfWeek:1};if(N(e.weekday)&&N(e.weekNumber)&&N(e.weekYear))return N(e.localWeekday)||(e.weekday=e.localWeekday),N(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),N(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()};throw new w("Cannot mix locale-based week fields with ISO-based week fields")}function ot(e){var t=st(e.year),n=D(e.month,1,12),r=D(e.day,1,vt(e.year,e.month));return t?n?!r&&T("day",e.day):T("month",e.month):T("year",e.year)}function at(e){var t=e.hour,n=e.minute,r=e.second,e=e.millisecond,i=D(t,0,23)||24===t&&0===n&&0===r&&0===e,o=D(n,0,59),a=D(r,0,59),s=D(e,0,999);return i?o?a?!s&&T("millisecond",e):T("second",r):T("minute",n):T("hour",t)}function N(e){return void 0===e}function v(e){return"number"==typeof e}function st(e){return"number"==typeof e&&e%1==0}function ut(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function lt(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function ct(e,n,r){if(0!==e.length)return e.reduce(function(e,t){t=[n(t),t];return e&&r(e[0],t[0])===e[0]?e:t},null)[1]}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ft(e){if(null==e)return null;if("object"!=typeof e)throw new u("Week settings must be an object");if(D(e.firstDay,1,7)&&D(e.minimalDays,1,7)&&Array.isArray(e.weekend)&&!e.weekend.some(function(e){return!D(e,1,7)}))return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)};throw new u("Invalid week settings")}function D(e,t,n){return st(e)&&t<=e&&e<=n}function m(e,t){void 0===t&&(t=2);e=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0");return e}function p(e){if(!N(e)&&null!==e&&""!==e)return parseInt(e,10)}function k(e){if(!N(e)&&null!==e&&""!==e)return parseFloat(e)}function dt(e){if(!N(e)&&null!==e&&""!==e)return e=1e3*parseFloat("0."+e),Math.floor(e)}function ht(e,t,n){void 0===n&&(n=!1);t=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*t)/t}function mt(e){return e%4==0&&(e%100!=0||e%400==0)}function yt(e){return mt(e)?366:365}function vt(e,t){var n,r=(r=t-1)-(n=12)*Math.floor(r/n)+1;return 2==r?mt(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function gt(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&0<=e.year&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function pt(e,t,n){return-Xe(Be(e,1,t),n)+t-1}function kt(e,t,n){var r=pt(e,t=void 0===t?4:t,n=void 0===n?1:n),t=pt(e+1,t,n);return(yt(e)-r+t)/7}function wt(e){return 99<e?e:e>O.twoDigitCutoffYear?1900+e:2e3+e}function bt(e,t,n,r){void 0===r&&(r=null);var e=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},r=(r&&(i.timeZone=r),l({timeZoneName:t},i)),t=new Intl.DateTimeFormat(n,r).formatToParts(e).find(function(e){return"timezonename"===e.type.toLowerCase()});return t?t.value:null}function St(e,t){e=parseInt(e,10),Number.isNaN(e)&&(e=0),t=parseInt(t,10)||0;return 60*e+(e<0||Object.is(e,-0)?-t:t)}function Ot(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new u("Invalid unit value "+e);return t}function Tt(e,t){var n,r,i={};for(n in e)g(e,n)&&null!=(r=e[n])&&(i[t(n)]=Ot(r));return i}function Nt(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=0<=e?"+":"-";switch(t){case"short":return i+m(n,2)+":"+m(r,2);case"narrow":return i+n+(0<r?":"+r:"");case"techie":return i+m(n,2)+m(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function Dt(e){return n=e,["hour","minute","second","millisecond"].reduce(function(e,t){return e[t]=n[t],e},{});var n}var Mt=["January","February","March","April","May","June","July","August","September","October","November","December"],It=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vt=["J","F","M","A","M","J","J","A","S","O","N","D"];function Et(e){switch(e){case"narrow":return[].concat(Vt);case"short":return[].concat(It);case"long":return[].concat(Mt);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var xt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ft=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ct=["M","T","W","T","F","S","S"];function Zt(e){switch(e){case"narrow":return[].concat(Ct);case"short":return[].concat(Ft);case"long":return[].concat(xt);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Wt=["AM","PM"],Lt=["Before Christ","Anno Domini"],jt=["BC","AD"],zt=["B","A"];function At(e){switch(e){case"narrow":return[].concat(zt);case"short":return[].concat(jt);case"long":return[].concat(Lt);default:return null}}function qt(e,t){for(var n="",r=R(e);!(i=r()).done;){var i=i.value;i.literal?n+=i.val:n+=t(i.val)}return n}var _t={D:G,DD:$,DDD:Q,DDDD:K,t:X,tt:ee,ttt:te,tttt:ne,T:re,TT:ie,TTT:oe,TTTT:ae,f:se,ff:le,fff:de,ffff:me,F:ue,FF:ce,FFF:he,FFFF:ye},M=function(){function d(e,t){this.opts=t,this.loc=e,this.systemLoc=null}d.create=function(e,t){return new d(e,t=void 0===t?{}:t)},d.parseFormat=function(e){for(var t=null,n="",r=!1,i=[],o=0;o<e.length;o++){var a=e.charAt(o);"'"===a?(0<n.length&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||a===t?n+=a:(0<n.length&&i.push({literal:/^\s+$/.test(n),val:n}),t=n=a)}return 0<n.length&&i.push({literal:r||/^\s+$/.test(n),val:n}),i},d.macroTokenToFormatOpts=function(e){return _t[e]};var e=d.prototype;return e.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,l({},this.opts,t)).format()},e.dtFormatter=function(e,t){return this.loc.dtFormatter(e,l({},this.opts,t=void 0===t?{}:t))},e.formatDateTime=function(e,t){return this.dtFormatter(e,t).format()},e.formatDateTimeParts=function(e,t){return this.dtFormatter(e,t).formatToParts()},e.formatInterval=function(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},e.resolvedOptions=function(e,t){return this.dtFormatter(e,t).resolvedOptions()},e.num=function(e,t){var n;return void 0===t&&(t=0),this.opts.forceSimple?m(e,t):(n=l({},this.opts),0<t&&(n.padTo=t),this.loc.numberFormatter(n).format(e))},e.formatDateTimeFromString=function(r,e){var n=this,i="en"===this.loc.listingMode(),t=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=function(e,t){return n.loc.extract(r,e,t)},a=function(e){return r.isOffsetFixed&&0===r.offset&&e.allowZ?"Z":r.isValid?r.zone.formatOffset(r.ts,e.format):""},s=function(){return i?Wt[r.hour<12?0:1]:o({hour:"numeric",hourCycle:"h12"},"dayperiod")},u=function(e,t){return i?(n=r,Et(e)[n.month-1]):o(t?{month:e}:{month:e,day:"numeric"},"month");var n},l=function(e,t){return i?(n=r,Zt(e)[n.weekday-1]):o(t?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday");var n},c=function(e){var t=d.macroTokenToFormatOpts(e);return t?n.formatWithSystemDefault(r,t):e},f=function(e){return i?(t=r,At(e)[t.year<0?0:1]):o({era:e},"era");var t};return qt(d.parseFormat(e),function(e){switch(e){case"S":return n.num(r.millisecond);case"u":case"SSS":return n.num(r.millisecond,3);case"s":return n.num(r.second);case"ss":return n.num(r.second,2);case"uu":return n.num(Math.floor(r.millisecond/10),2);case"uuu":return n.num(Math.floor(r.millisecond/100));case"m":return n.num(r.minute);case"mm":return n.num(r.minute,2);case"h":return n.num(r.hour%12==0?12:r.hour%12);case"hh":return n.num(r.hour%12==0?12:r.hour%12,2);case"H":return n.num(r.hour);case"HH":return n.num(r.hour,2);case"Z":return a({format:"narrow",allowZ:n.opts.allowZ});case"ZZ":return a({format:"short",allowZ:n.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:n.opts.allowZ});case"ZZZZ":return r.zone.offsetName(r.ts,{format:"short",locale:n.loc.locale});case"ZZZZZ":return r.zone.offsetName(r.ts,{format:"long",locale:n.loc.locale});case"z":return r.zoneName;case"a":return s();case"d":return t?o({day:"numeric"},"day"):n.num(r.day);case"dd":return t?o({day:"2-digit"},"day"):n.num(r.day,2);case"c":return n.num(r.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return n.num(r.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return t?o({month:"numeric",day:"numeric"},"month"):n.num(r.month);case"LL":return t?o({month:"2-digit",day:"numeric"},"month"):n.num(r.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return t?o({month:"numeric"},"month"):n.num(r.month);case"MM":return t?o({month:"2-digit"},"month"):n.num(r.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return t?o({year:"numeric"},"year"):n.num(r.year);case"yy":return t?o({year:"2-digit"},"year"):n.num(r.year.toString().slice(-2),2);case"yyyy":return t?o({year:"numeric"},"year"):n.num(r.year,4);case"yyyyyy":return t?o({year:"numeric"},"year"):n.num(r.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return n.num(r.weekYear.toString().slice(-2),2);case"kkkk":return n.num(r.weekYear,4);case"W":return n.num(r.weekNumber);case"WW":return n.num(r.weekNumber,2);case"n":return n.num(r.localWeekNumber);case"nn":return n.num(r.localWeekNumber,2);case"ii":return n.num(r.localWeekYear.toString().slice(-2),2);case"iiii":return n.num(r.localWeekYear,4);case"o":return n.num(r.ordinal);case"ooo":return n.num(r.ordinal,3);case"q":return n.num(r.quarter);case"qq":return n.num(r.quarter,2);case"X":return n.num(Math.floor(r.ts/1e3));case"x":return n.num(r.ts);default:return c(e)}})},e.formatDurationFromString=function(e,t){var n,r=this,i=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},t=d.parseFormat(t),o=t.reduce(function(e,t){var n=t.literal,t=t.val;return n?e:e.concat(t)},[]),e=e.shiftTo.apply(e,o.map(i).filter(function(e){return e}));return qt(t,(n=e,function(e){var t=i(e);return t?r.num(n.get(t),e.length):e}))},d}(),r=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ut(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce(function(e,t){return e+t.source},"");return RegExp("^"+r+"$")}function Rt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(o){return t.reduce(function(e,t){var n=e[0],r=e[1],e=e[2],t=t(o,e),e=t[0],i=t[1],t=t[2];return[l({},n,e),i||r,t]},[{},null,1]).slice(0,2)}}function Pt(e){if(null!=e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i],s=a[0],a=a[1],s=s.exec(e);if(s)return a(s)}}return[null,null]}function Yt(){for(var e=arguments.length,i=new Array(e),t=0;t<e;t++)i[t]=arguments[t];return function(e,t){for(var n={},r=0;r<i.length;r++)n[i[r]]=p(e[t+r]);return[n,null,t+r]}}var t=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,a=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ht=RegExp(a.source+("(?:"+t.source+"?(?:\\[("+r.source+")\\])?)?")),I=RegExp("(?:T"+Ht.source+")?"),Jt=Yt("weekYear","weekNumber","weekDay"),Gt=Yt("year","ordinal"),t=RegExp(a.source+" ?(?:"+t.source+"|("+r.source+"))?"),r=RegExp("(?: "+t.source+")?");function $t(e,t,n){e=e[t];return N(e)?n:p(e)}function Bt(e,t){return[{hours:$t(e,t,0),minutes:$t(e,t+1,0),seconds:$t(e,t+2,0),milliseconds:dt(e[t+3])},null,t+4]}function Qt(e,t){var n=!e[t]&&!e[t+1],e=St(e[t+1],e[t+2]);return[{},n?null:f.instance(e),t+3]}function Kt(e,t){return[{},e[t]?c.create(e[t]):null,t+1]}var Xt=RegExp("^T?"+a.source+"$"),en=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function tn(e){function t(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&c)?-e:e}var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],e=e[8],c="-"===n[0],n=l&&"-"===l[0];return[{years:t(k(r)),months:t(k(i)),weeks:t(k(o)),days:t(k(a)),hours:t(k(s)),minutes:t(k(u)),seconds:t(k(l),"-0"===l),milliseconds:t(dt(e),n)}]}var nn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function rn(e,t,n,r,i,o,a){t={year:2===t.length?wt(p(t)):p(t),month:It.indexOf(n)+1,day:p(r),hour:p(i),minute:p(o)};return a&&(t.second=p(a)),e&&(t.weekday=3<e.length?xt.indexOf(e)+1:Ft.indexOf(e)+1),t}var on=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function an(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],a=e[6],s=e[7],u=e[8],l=e[9],c=e[10],e=e[11],t=rn(t,i,r,n,o,a,s),i=u?nn[u]:l?0:St(c,e);return[t,new f(i)]}var sn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,un=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ln=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function cn(e){var t=e[1],n=e[2],r=e[3];return[rn(t,e[4],r,n,e[5],e[6],e[7]),f.utcInstance]}function fn(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],a=e[6];return[rn(t,e[7],n,r,i,o,a),f.utcInstance]}var dn=Ut(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,I),hn=Ut(/(\d{4})-?W(\d\d)(?:-?(\d))?/,I),mn=Ut(/(\d{4})-?(\d{3})/,I),yn=Ut(Ht),vn=Rt(function(e,t){return[{year:$t(e,t),month:$t(e,t+1,1),day:$t(e,t+2,1)},null,t+3]},Bt,Qt,Kt),gn=Rt(Jt,Bt,Qt,Kt),pn=Rt(Gt,Bt,Qt,Kt),kn=Rt(Bt,Qt,Kt);var wn=Rt(Bt);var bn=Ut(/(\d{4})-(\d\d)-(\d\d)/,r),Sn=Ut(t),On=Rt(Bt,Qt,Kt);var Tn="Invalid Duration",a={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Nn=l({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},a),I=365.2425,Ht=30.436875,Dn=l({years:{quarters:4,months:12,weeks:I/7,days:I,hours:24*I,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:I/28,days:I/4,hours:24*I/4,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:Ht/7,days:Ht,hours:24*Ht,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},a),V=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Mn=V.slice(0).reverse();function E(e,t,n){n={values:(n=void 0===n?!1:n)?t.values:l({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new x(n)}function In(e,t){for(var n,r=null!=(n=t.milliseconds)?n:0,i=R(Mn.slice(1));!(o=i()).done;){var o=o.value;t[o]&&(r+=t[o]*e[o].milliseconds)}return r}function Vn(i,o){var a=In(i,o)<0?-1:1;V.reduceRight(function(e,t){var n,r;return N(o[t])?e:(e&&(r=o[e]*a,n=i[t][e],r=Math.floor(r/n),o[t]+=r*a,o[e]-=r*n*a),t)},null),V.reduce(function(e,t){var n;return N(o[t])?e:(e&&(n=o[e]%1,o[e]-=n,o[t]+=n*i[e][t]),t)},null)}var x=function(e){function m(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Dn:Nn;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||b.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}m.fromMillis=function(e,t){return m.fromObject({milliseconds:e},t)},m.fromObject=function(e,t){if(void 0===t&&(t={}),null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new m({values:Tt(e,m.normalizeUnit),loc:b.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})},m.fromDurationLike=function(e){if(v(e))return m.fromMillis(e);if(m.isDuration(e))return e;if("object"==typeof e)return m.fromObject(e);throw new u("Unknown duration argument "+e+" of type "+typeof e)},m.fromISO=function(e,t){var n=Pt(e,[en,tn])[0];return n?m.fromObject(n,t):m.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},m.fromISOTime=function(e,t){var n=Pt(e,[Xt,wn])[0];return n?m.fromObject(n,t):m.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},m.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new u("need to specify a reason the Duration is invalid");e=e instanceof h?e:new h(e,t);if(O.throwOnInvalid)throw new H(e);return new m({invalid:e})},m.normalizeUnit=function(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(t)return t;throw new J(e)},m.isDuration=function(e){return e&&e.isLuxonDuration||!1};var t=m.prototype;return t.toFormat=function(e,t){t=l({},t=void 0===t?{}:t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?M.create(this.loc,t).formatDurationFromString(this,e):Tn},t.toHuman=function(n){var e,r=this;return void 0===n&&(n={}),this.isValid?(e=V.map(function(e){var t=r.values[e];return N(t)?null:r.loc.numberFormatter(l({style:"unit",unitDisplay:"long"},n,{unit:e.slice(0,-1)})).format(t)}).filter(function(e){return e}),this.loc.listFormatter(l({type:"conjunction",style:n.listStyle||"narrow"},n)).format(e)):Tn},t.toObject=function(){return this.isValid?l({},this.values):{}},t.toISO=function(){var e;return this.isValid?(e="P",0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=ht(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e):null},t.toISOTime=function(e){var t;return void 0===e&&(e={}),!this.isValid||(t=this.toMillis())<0||864e5<=t?null:(e=l({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),W.fromMillis(t,{zone:"UTC"}).toISOTime(e))},t.toJSON=function(){return this.toISO()},t.toString=function(){return this.toISO()},t[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},t.toMillis=function(){return this.isValid?In(this.matrix,this.values):NaN},t.valueOf=function(){return this.toMillis()},t.plus=function(e){if(!this.isValid)return this;for(var t=m.fromDurationLike(e),n={},r=0,i=V;r<i.length;r++){var o=i[r];(g(t.values,o)||g(this.values,o))&&(n[o]=t.get(o)+this.get(o))}return E(this,{values:n},!0)},t.minus=function(e){return this.isValid?(e=m.fromDurationLike(e),this.plus(e.negate())):this},t.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=Ot(e(this.values[i],i))}return E(this,{values:t},!0)},t.get=function(e){return this[m.normalizeUnit(e)]},t.set=function(e){return this.isValid?E(this,{values:l({},this.values,Tt(e,m.normalizeUnit))}):this},t.reconfigure=function(e){var e=void 0===e?{}:e,t=e.locale,n=e.numberingSystem,r=e.conversionAccuracy,e=e.matrix,t=this.loc.clone({locale:t,numberingSystem:n});return E(this,{loc:t,matrix:e,conversionAccuracy:r})},t.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},t.normalize=function(){var e;return this.isValid?(e=this.toObject(),Vn(this.matrix,e),E(this,{values:e},!0)):this},t.rescale=function(){var e;return this.isValid?(e=function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],o=i[0],i=i[1];0!==i&&(t[o]=i)}return t}(this.normalize().shiftToAll().toObject()),E(this,{values:e},!0)):this},t.shiftTo=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!this.isValid)return this;if(0===t.length)return this;for(var r,t=t.map(function(e){return m.normalizeUnit(e)}),i={},o={},a=this.toObject(),s=0,u=V;s<u.length;s++){var l=u[s];if(0<=t.indexOf(l)){var c,f=l,d=0;for(c in o)d+=this.matrix[c][l]*o[c],o[c]=0;v(a[l])&&(d+=a[l]);var h=Math.trunc(d);o[l]=(1e3*d-1e3*(i[l]=h))/1e3}else v(a[l])&&(o[l]=a[l])}for(r in o)0!==o[r]&&(i[f]+=r===f?o[r]:o[r]/this.matrix[f][r]);return Vn(this.matrix,i),E(this,{values:i},!0)},t.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},t.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=0===this.values[r]?0:-this.values[r]}return E(this,{values:e},!0)},t.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t,n=0,r=V;n<r.length;n++){var i=r[n];if(t=this.values[i],i=e.values[i],!(void 0===t||0===t?void 0===i||0===i:t===i))return!1}return!0},i(m,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),m}(Symbol.for("nodejs.util.inspect.custom")),En="Invalid Interval";var xn=function(e){function l(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}l.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new u("need to specify a reason the Interval is invalid");e=e instanceof h?e:new h(e,t);if(O.throwOnInvalid)throw new Y(e);return new l({invalid:e})},l.fromDateTimes=function(e,t){var n,e=kr(e),t=kr(t),r=(n=t,(r=e)&&r.isValid?n&&n.isValid?n<r?xn.invalid("end before start","The end of an interval must be after its start, but you had start="+r.toISO()+" and end="+n.toISO()):null:xn.invalid("missing or invalid end"):xn.invalid("missing or invalid start"));return null==r?new l({start:e,end:t}):r},l.after=function(e,t){t=x.fromDurationLike(t),e=kr(e);return l.fromDateTimes(e,e.plus(t))},l.before=function(e,t){t=x.fromDurationLike(t),e=kr(e);return l.fromDateTimes(e.minus(t),e)},l.fromISO=function(e,t){var n,r,i,o=(e||"").split("/",2),a=o[0],s=o[1];if(a&&s){try{u=(n=W.fromISO(a,t)).isValid}catch(s){u=!1}try{i=(r=W.fromISO(s,t)).isValid}catch(s){i=!1}if(u&&i)return l.fromDateTimes(n,r);if(u){o=x.fromISO(s,t);if(o.isValid)return l.after(n,o)}else if(i){var u=x.fromISO(a,t);if(u.isValid)return l.before(r,u)}}return l.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},l.isInterval=function(e){return e&&e.isLuxonInterval||!1};var t=l.prototype;return t.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},t.count=function(e,t){var n,r;return this.isValid?(n=this.start.startOf(e=void 0===e?"milliseconds":e,t),r=(r=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end).startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())):NaN},t.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},t.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},t.isAfter=function(e){return!!this.isValid&&this.s>e},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&this.s<=e&&this.e>e},t.set=function(e){var e=void 0===e?{}:e,t=e.start,e=e.end;return this.isValid?l.fromDateTimes(t||this.s,e||this.e):this},t.splitAt=function(){var t=this;if(!this.isValid)return[];for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var i=n.map(kr).filter(function(e){return t.contains(e)}).sort(function(e,t){return e.toMillis()-t.toMillis()}),o=[],a=this.s,s=0;a<this.e;){var u=i[s]||this.e,u=+u>+this.e?this.e:u;o.push(l.fromDateTimes(a,u)),a=u,s+=1}return o},t.splitBy=function(e){var t=x.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var n=this.s,r=1,i=[];n<this.e;){var o=this.start.plus(t.mapUnits(function(e){return e*r})),o=+o>+this.e?this.e:o;i.push(l.fromDateTimes(n,o)),n=o,r+=1}return i},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s<e.e},t.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},t.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},t.engulfs=function(e){return!!this.isValid&&this.s<=e.s&&this.e>=e.e},t.equals=function(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)},t.intersection=function(e){var t;return this.isValid?(t=(this.s>e.s?this:e).s,(e=(this.e<e.e?this:e).e)<=t?null:l.fromDateTimes(t,e)):this},t.union=function(e){var t;return this.isValid?(t=(this.s<e.s?this:e).s,e=(this.e>e.e?this:e).e,l.fromDateTimes(t,e)):this},l.merge=function(e){var e=e.sort(function(e,t){return e.s-t.s}).reduce(function(e,t){var n=e[0],e=e[1];return e?e.overlaps(t)||e.abutsStart(t)?[n,e.union(t)]:[n.concat([e]),t]:[n,t]},[[],null]),t=e[0],e=e[1];return e&&t.push(e),t},l.xor=function(e){for(var t,n=null,r=0,i=[],e=e.map(function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]}),o=R((t=Array.prototype).concat.apply(t,e).sort(function(e,t){return e.time-t.time}));!(a=o()).done;)var a=a.value,n=1===(r+="s"===a.type?1:-1)?a.time:(n&&+n!=+a.time&&i.push(l.fromDateTimes(n,a.time)),null);return l.merge(i)},t.difference=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return l.xor([this].concat(n)).map(function(e){return t.intersection(e)}).filter(function(e){return e&&!e.isEmpty()})},t.toString=function(){return this.isValid?"["+this.s.toISO()+" â "+this.e.toISO()+")":En},t[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},t.toLocaleString=function(e,t){return void 0===e&&(e=G),void 0===t&&(t={}),this.isValid?M.create(this.s.loc.clone(t),e).formatInterval(this):En},t.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):En},t.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():En},t.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):En},t.toFormat=function(e,t){t=(void 0===t?{}:t).separator,t=void 0===t?" â ":t;return this.isValid?""+this.s.toFormat(e)+t+this.e.toFormat(e):En},t.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):x.invalid(this.invalidReason)},t.mapEndpoints=function(e){return l.fromDateTimes(e(this.s),e(this.e))},i(l,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),l}(Symbol.for("nodejs.util.inspect.custom")),Fn=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=O.defaultZone);var t=W.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return c.isValidZone(e)},e.normalizeZone=function(e){return S(e,O.defaultZone)},e.getStartOfWeek=function(e){var e=void 0===e?{}:e,t=e.locale,e=e.locObj;return((void 0===e?null:e)||b.create(void 0===t?null:t)).getStartOfWeek()},e.getMinimumDaysInFirstWeek=function(e){var e=void 0===e?{}:e,t=e.locale,e=e.locObj;return((void 0===e?null:e)||b.create(void 0===t?null:t)).getMinDaysInFirstWeek()},e.getWeekendWeekdays=function(e){var e=void 0===e?{}:e,t=e.locale,e=e.locObj;return((void 0===e?null:e)||b.create(void 0===t?null:t)).getWeekendDays().slice()},e.months=function(e,t){void 0===e&&(e="long");var t=void 0===t?{}:t,n=t.locale,r=t.numberingSystem,i=t.locObj,i=void 0===i?null:i,t=t.outputCalendar;return(i||b.create(void 0===n?null:n,void 0===r?null:r,void 0===t?"gregory":t)).months(e)},e.monthsFormat=function(e,t){void 0===e&&(e="long");var t=void 0===t?{}:t,n=t.locale,r=t.numberingSystem,i=t.locObj,i=void 0===i?null:i,t=t.outputCalendar;return(i||b.create(void 0===n?null:n,void 0===r?null:r,void 0===t?"gregory":t)).months(e,!0)},e.weekdays=function(e,t){void 0===e&&(e="long");var t=void 0===t?{}:t,n=t.locale,r=t.numberingSystem,t=t.locObj;return((void 0===t?null:t)||b.create(void 0===n?null:n,void 0===r?null:r,null)).weekdays(e)},e.weekdaysFormat=function(e,t){void 0===e&&(e="long");var t=void 0===t?{}:t,n=t.locale,r=t.numberingSystem,t=t.locObj;return((void 0===t?null:t)||b.create(void 0===n?null:n,void 0===r?null:r,null)).weekdays(e,!0)},e.meridiems=function(e){e=(void 0===e?{}:e).locale;return b.create(void 0===e?null:e).meridiems()},e.eras=function(e,t){void 0===e&&(e="short");t=(void 0===t?{}:t).locale;return b.create(void 0===t?null:t,null,"gregory").eras(e)},e.features=function(){return{relative:ut(),localeWeek:lt()}},e}();function Cn(e,t){function n(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()}t=n(t)-n(e);return Math.floor(x.fromMillis(t).as("days"))}function Zn(e,t,n,r){var e=function(e,t,n){for(var r,i,o={},a=e,s=0,u=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter+4*(t.year-e.year)}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){e=Cn(e,t);return(e-e%7)/7}],["days",Cn]];s<u.length;s++){var l=u[s],c=l[0],l=l[1];0<=n.indexOf(c)&&(o[r=c]=l(e,t),t<(i=a.plus(o))?(o[c]--,t<(e=a.plus(o))&&(i=e,o[c]--,e=a.plus(o))):e=i)}return[e,o,i,r]}(e,t,n),i=e[0],o=e[1],a=e[2],e=e[3],s=t-i,n=n.filter(function(e){return 0<=["hours","minutes","seconds","milliseconds"].indexOf(e)}),t=(0===n.length&&(a=a<t?i.plus(((t={})[e]=1,t)):a)!==i&&(o[e]=(o[e]||0)+s/(a-i)),x.fromObject(o,r));return 0<n.length?(e=x.fromMillis(s,r)).shiftTo.apply(e,n).plus(t):t}var Wn="missing Intl.DateTimeFormat.formatToParts support";function F(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){e=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(je.hanidec))t+=Ae.indexOf(e[n]);else for(var i in ze){var i=ze[i],o=i[0],i=i[1];o<=r&&r<=i&&(t+=r-o)}}return parseInt(t,10)}return t}(e))}}}var Ln="[ "+String.fromCharCode(160)+"]",jn=new RegExp(Ln,"g");function zn(e){return e.replace(/\./g,"\\.?").replace(jn,Ln)}function An(e){return e.replace(/\./g,"").replace(jn," ").toLowerCase()}function C(n,r){return null===n?null:{regex:RegExp(n.map(zn).join("|")),deser:function(e){var t=e[0];return n.findIndex(function(e){return An(t)===An(e)})+r}}}function qn(e,t){return{regex:e,deser:function(e){return St(e[1],e[2])},groups:t}}function _n(e){return{regex:e,deser:function(e){return e[0]}}}function Un(t,n){function r(e){return{regex:RegExp(e.val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")),deser:function(e){return e[0]},literal:!0}}var i=y(n),o=y(n,"{2}"),a=y(n,"{3}"),s=y(n,"{4}"),u=y(n,"{6}"),l=y(n,"{1,2}"),c=y(n,"{1,3}"),f=y(n,"{1,6}"),d=y(n,"{1,9}"),h=y(n,"{2,4}"),m=y(n,"{4,6}"),e=function(e){if(t.literal)return r(e);switch(e.val){case"G":return C(n.eras("short"),0);case"GG":return C(n.eras("long"),0);case"y":return F(f);case"yy":return F(h,wt);case"yyyy":return F(s);case"yyyyy":return F(m);case"yyyyyy":return F(u);case"M":return F(l);case"MM":return F(o);case"MMM":return C(n.months("short",!0),1);case"MMMM":return C(n.months("long",!0),1);case"L":return F(l);case"LL":return F(o);case"LLL":return C(n.months("short",!1),1);case"LLLL":return C(n.months("long",!1),1);case"d":return F(l);case"dd":return F(o);case"o":return F(c);case"ooo":return F(a);case"HH":return F(o);case"H":return F(l);case"hh":return F(o);case"h":return F(l);case"mm":return F(o);case"m":case"q":return F(l);case"qq":return F(o);case"s":return F(l);case"ss":return F(o);case"S":return F(c);case"SSS":return F(a);case"u":return _n(d);case"uu":return _n(l);case"uuu":return F(i);case"a":return C(n.meridiems(),0);case"kkkk":return F(s);case"kk":return F(h,wt);case"W":return F(l);case"WW":return F(o);case"E":case"c":return F(i);case"EEE":return C(n.weekdays("short",!1),1);case"EEEE":return C(n.weekdays("long",!1),1);case"ccc":return C(n.weekdays("short",!0),1);case"cccc":return C(n.weekdays("long",!0),1);case"Z":case"ZZ":return qn(new RegExp("([+-]"+l.source+")(?::("+o.source+"))?"),2);case"ZZZ":return qn(new RegExp("([+-]"+l.source+")("+o.source+")?"),2);case"z":return _n(/[a-z_+-/]{1,256}?/i);case" ":return _n(/[^\S\n\r]/);default:return r(e)}}(t)||{invalidReason:Wn};return e.token=t,e}var Rn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var Pn=null;function Yn(e,n){var t;return(t=Array.prototype).concat.apply(t,e.map(function(e){return t=n,(e=e).literal||null==(t=Gn(M.macroTokenToFormatOpts(e.val),t))||t.includes(void 0)?e:t;var t}))}var Hn=function(){function e(t,e){var n;this.locale=t,this.format=e,this.tokens=Yn(M.parseFormat(e),t),this.units=this.tokens.map(function(e){return Un(e,t)}),this.disqualifyingUnit=this.units.find(function(e){return e.invalidReason}),this.disqualifyingUnit||(n=(e=["^"+(e=this.units).map(function(e){return e.regex}).reduce(function(e,t){return e+"("+t.source+")"},"")+"$",e])[1],this.regex=RegExp(e[0],"i"),this.handlers=n)}return e.prototype.explainFromTokens=function(e){if(this.isValid){var t=function(e,t,n){var r=e.match(t);if(r){var i,o,a,s={},u=1;for(i in n)g(n,i)&&(a=(o=n[i]).groups?o.groups+1:1,!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(r.slice(u,u+a))),u+=a);return[r,s]}return[r,{}]}(e,this.regex,this.handlers),n=t[0],t=t[1],r=t?(r=null,N((s=t).z)||(r=c.create(s.z)),N(s.Z)||(r=r||new f(s.Z),i=s.Z),N(s.q)||(s.M=3*(s.q-1)+1),N(s.h)||(s.h<12&&1===s.a?s.h+=12:12===s.h&&0===s.a&&(s.h=0)),0===s.G&&s.y&&(s.y=-s.y),N(s.u)||(s.S=dt(s.u)),[Object.keys(s).reduce(function(e,t){var n=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(t);return n&&(e[n]=s[t]),e},{}),r,i]):[null,null,void 0],i=r[0],o=r[1],a=r[2];if(g(t,"a")&&g(t,"H"))throw new w("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:t,result:i,zone:o,specificOffset:a}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason};var s,i,r},i(e,[{key:"isValid",get:function(){return!this.disqualifyingUnit}},{key:"invalidReason",get:function(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}]),e}();function Jn(e,t,n){return new Hn(e,n).explainFromTokens(t)}function Gn(o,e){var t,a;return o?(t=(e=M.create(e,o).dtFormatter(Pn=Pn||W.fromMillis(1555555555555))).formatToParts(),a=e.resolvedOptions(),t.map(function(e){return t=o,n=a,i=(e=e).type,e=e.value,"literal"===i?{literal:!(r=/^\s+$/.test(e)),val:r?" ":e}:(r=t[i],"hour"===(e=i)&&(e=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24"),(i="object"==typeof(i=Rn[e])?i[r]:i)?{literal:!1,val:i}:void 0);var t,n,r,i})):null}var $n="Invalid DateTime";function Bn(e){return new h("unsupported zone",'the zone "'+e.name+'" is not supported')}function Qn(e){return null===e.weekData&&(e.weekData=et(e.c)),e.weekData}function Kn(e){return null===e.localWeekData&&(e.localWeekData=et(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Z(e,t){e={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new W(l({},e,t,{old:e}))}function Xn(e,t,n){var r=e-60*t*1e3,i=n.offset(r);return t===i?[r,t]:i===(n=n.offset(r-=60*(i-t)*1e3))?[r,i]:[e-60*Math.min(i,n)*1e3,Math.max(i,n)]}function er(e,t){e+=60*t*1e3;t=new Date(e);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function tr(e,t,n){return Xn(gt(e),t,n)}function nr(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),r=l({},e.c,{year:r,month:i,day:Math.min(e.c.day,vt(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),i=x.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),t=Xn(gt(r),n,e.zone),r=t[0],n=t[1];return 0!==i&&(n=e.zone.offset(r+=i)),{ts:r,o:n}}function rr(e,t,n,r,i,o){var a=n.setZone,s=n.zone;return e&&0!==Object.keys(e).length||t?(e=W.fromObject(e,l({},n,{zone:t||s,specificOffset:o})),a?e:e.setZone(s)):W.invalid(new h("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function ir(e,t,n){return void 0===n&&(n=!0),e.isValid?M.create(b.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function or(e,t){var n=9999<e.c.year||e.c.year<0,r="";return n&&0<=e.c.year&&(r+="+"),r+=m(e.c.year,n?6:4),r=t?(r=(r+="-")+m(e.c.month)+"-")+m(e.c.day):(r+=m(e.c.month))+m(e.c.day)}function ar(e,t,n,r,i,o){var a=m(e.c.hour);return t?(a=(a+=":")+m(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(a+=":")):a+=m(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(a+=m(e.c.second),0===e.c.millisecond&&r)||(a=(a+=".")+m(e.c.millisecond,3)),i&&(e.isOffsetFixed&&0===e.offset&&!o?a+="Z":a=e.o<0?(a=(a+="-")+m(Math.trunc(-e.o/60))+":")+m(Math.trunc(-e.o%60)):(a=(a+="+")+m(Math.trunc(e.o/60))+":")+m(Math.trunc(e.o%60))),o&&(a+="["+e.zone.ianaName+"]"),a}var sr,ur={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},lr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},cr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},fr=["year","month","day","hour","minute","second","millisecond"],dr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],hr=["year","ordinal","hour","minute","second","millisecond"];function mr(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:var t=e,n={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(n)return n;throw new J(t)}}function yr(e,t){var n=S(t.zone,O.defaultZone);if(!n.isValid)return W.invalid(Bn(n));t=b.fromObject(t);if(N(e.year))s=O.now();else{for(var r=0,i=fr;r<i.length;r++){var o=i[r];N(e[o])&&(e[o]=ur[o])}var a=ot(e)||at(e);if(a)return W.invalid(a);pr[a=n]||(void 0===sr&&(sr=O.now()),pr[a]=a.offset(sr));var a=tr(e,pr[a],n),s=a[0],a=a[1]}return new W({ts:s,zone:n,loc:t,o:a})}function vr(t,n,r){function e(e,t){return e=ht(e,o||r.calendary?0:2,!0),n.loc.clone(r).relFormatter(r).format(e,t)}function i(e){return r.calendary?n.hasSame(t,e)?0:n.startOf(e).diff(t.startOf(e),e).get(e):n.diff(t,e).get(e)}var o=!!N(r.round)||r.round;if(r.unit)return e(i(r.unit),r.unit);for(var a=R(r.units);!(s=a()).done;){var s=s.value,u=i(s);if(1<=Math.abs(u))return e(u,s)}return e(n<t?-0:0,r.units[r.units.length-1])}function gr(e){var t={},e=0<e.length&&"object"==typeof e[e.length-1]?(t=e[e.length-1],Array.from(e).slice(0,e.length-1)):Array.from(e);return[t,e]}var pr={},W=function(e){function k(e){var t,n=e.zone||O.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new h("invalid input"):null)||(n.isValid?null:Bn(n)),i=(this.ts=N(e.ts)?O.now():e.ts,null),o=null;r||(o=e.old&&e.old.ts===this.ts&&e.old.zone.equals(n)?(i=(t=[e.old.c,e.old.o])[0],t[1]):(t=v(e.o)&&!e.old?e.o:n.offset(this.ts),i=er(this.ts,t),i=(r=Number.isNaN(i.year)?new h("invalid input"):null)?null:i,r?null:t)),this._zone=n,this.loc=e.loc||b.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}k.now=function(){return new k({})},k.local=function(){var e=gr(arguments),t=e[0],e=e[1];return yr({year:e[0],month:e[1],day:e[2],hour:e[3],minute:e[4],second:e[5],millisecond:e[6]},t)},k.utc=function(){var e=gr(arguments),t=e[0],e=e[1],n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],e=e[6];return t.zone=f.utcInstance,yr({year:n,month:r,day:i,hour:o,minute:a,second:s,millisecond:e},t)},k.fromJSDate=function(e,t){void 0===t&&(t={});var n,e="[object Date]"===Object.prototype.toString.call(e)?e.valueOf():NaN;return Number.isNaN(e)?k.invalid("invalid input"):(n=S(t.zone,O.defaultZone)).isValid?new k({ts:e,zone:n,loc:b.fromObject(t)}):k.invalid(Bn(n))},k.fromMillis=function(e,t){if(void 0===t&&(t={}),v(e))return e<-864e13||864e13<e?k.invalid("Timestamp out of range"):new k({ts:e,zone:S(t.zone,O.defaultZone),loc:b.fromObject(t)});throw new u("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},k.fromSeconds=function(e,t){if(void 0===t&&(t={}),v(e))return new k({ts:1e3*e,zone:S(t.zone,O.defaultZone),loc:b.fromObject(t)});throw new u("fromSeconds requires a numerical input")},k.fromObject=function(e,t){e=e||{};var n=S((t=void 0===t?{}:t).zone,O.defaultZone);if(!n.isValid)return k.invalid(Bn(n));var r=b.fromObject(t),i=Tt(e,mr),o=it(i,r),a=o.minDaysInFirstWeek,o=o.startOfWeek,s=O.now(),t=N(t.specificOffset)?n.offset(s):t.specificOffset,u=!N(i.ordinal),l=!N(i.year),c=!N(i.month)||!N(i.day),l=l||c,f=i.weekYear||i.weekNumber;if((l||u)&&f)throw new w("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&u)throw new w("Can't mix ordinal dates with month/day");for(var d,c=f||i.weekday&&!l,h=er(s,t),m=(c?(p=dr,d=lr,h=et(h,a,o)):u?(p=hr,d=cr,h=nt(h)):(p=fr,d=ur),!1),y=R(p);!(v=y()).done;){var v=v.value;N(i[v])?i[v]=(m?d:h)[v]:m=!0}var g,p=(c?(f=a,s=o,g=st((p=i).weekYear),f=D(p.weekNumber,1,kt(p.weekYear,f=void 0===f?4:f,s=void 0===s?1:s)),s=D(p.weekday,1,7),g?f?!s&&T("weekday",p.weekday):T("week",p.weekNumber):T("weekYear",p.weekYear)):u?(f=st((g=i).year),s=D(g.ordinal,1,yt(g.year)),f?!s&&T("ordinal",g.ordinal):T("year",g.year)):ot(i))||at(i);return p?k.invalid(p):(s=new k({ts:(f=tr(c?tt(i,a,o):u?rt(i):i,t,n))[0],zone:n,o:f[1],loc:r}),i.weekday&&l&&e.weekday!==s.weekday?k.invalid("mismatched weekday","you can't specify both a weekday of "+i.weekday+" and a date of "+s.toISO()):s.isValid?s:k.invalid(s.invalid))},k.fromISO=function(e,t){void 0===t&&(t={});var n=Pt(e,[dn,vn],[hn,gn],[mn,pn],[yn,kn]);return rr(n[0],n[1],t,"ISO 8601",e)},k.fromRFC2822=function(e,t){void 0===t&&(t={});var n=Pt(e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim(),[on,an]);return rr(n[0],n[1],t,"RFC 2822",e)},k.fromHTTP=function(e,t){void 0===t&&(t={});e=Pt(e,[sn,cn],[un,cn],[ln,fn]);return rr(e[0],e[1],t,"HTTP",t)},k.fromFormat=function(e,t,n){if(void 0===n&&(n={}),N(e)||N(t))throw new u("fromFormat requires an input string and a format");var r=n,i=r.locale,r=r.numberingSystem,i=b.fromOpts({locale:void 0===i?null:i,numberingSystem:void 0===r?null:r,defaultToEN:!0}),i=[(r=Jn(r=i,e,t)).result,r.zone,r.specificOffset,r.invalidReason],r=i[0],o=i[1],a=i[2],i=i[3];return i?k.invalid(i):rr(r,o,n,"format "+t,e,a)},k.fromString=function(e,t,n){return k.fromFormat(e,t,n=void 0===n?{}:n)},k.fromSQL=function(e,t){void 0===t&&(t={});var n=Pt(e,[bn,vn],[Sn,On]);return rr(n[0],n[1],t,"SQL",e)},k.invalid=function(e,t){if(void 0===t&&(t=null),!e)throw new u("need to specify a reason the DateTime is invali
33d");e=e instanceof h?e:new h(e,t);if(O.throwOnInvalid)throw new P(e);return new k({invalid:e})},k.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},k.parseFormatForOpts=function(e,t){e=Gn(e,b.fromObject(t=void 0===t?{}:t));return e?e.map(function(e){return e?e.val:null}).join(""):null},k.expandFormat=function(e,t){return void 0===t&&(t={}),Yn(M.parseFormat(e),b.fromObject(t)).map(function(e){return e.val}).join("")},k.resetCache=function(){sr=void 0,pr={}};var t=k.prototype;return t.get=function(e){return this[e]},t.getPossibleOffsets=function(){var e,t,n,r;return this.isValid&&!this.isOffsetFixed&&(e=gt(this.c),n=this.zone.offset(e-864e5),r=this.zone.offset(e+864e5),(n=this.zone.offset(e-6e4*n))!==(r=this.zone.offset(e-6e4*r)))&&(t=e-6e4*r,n=er(e=e-6e4*n,n),r=er(t,r),n.hour===r.hour)&&n.minute===r.minute&&n.second===r.second&&n.millisecond===r.millisecond?[Z(this,{ts:e}),Z(this,{ts:t})]:[this]},t.resolvedLocaleOptions=function(e){e=M.create(this.loc.clone(e=void 0===e?{}:e),e).resolvedOptions(this);return{locale:e.locale,numberingSystem:e.numberingSystem,outputCalendar:e.calendar}},t.toUTC=function(e,t){return void 0===t&&(t={}),this.setZone(f.instance(e=void 0===e?0:e),t)},t.toLocal=function(){return this.setZone(O.defaultZone)},t.setZone=function(e,t){var n,t=void 0===t?{}:t,r=t.keepLocalTime,r=void 0!==r&&r,t=t.keepCalendarTime,t=void 0!==t&&t;return(e=S(e,O.defaultZone)).equals(this.zone)?this:e.isValid?(n=this.ts,(r||t)&&(r=e.offset(this.ts),n=tr(this.toObject(),r,e)[0]),Z(this,{ts:n,zone:e})):k.invalid(Bn(e))},t.reconfigure=function(e){var e=void 0===e?{}:e,t=e.locale,n=e.numberingSystem,e=e.outputCalendar,t=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:e});return Z(this,{loc:t})},t.setLocale=function(e){return this.reconfigure({locale:e})},t.set=function(e){if(!this.isValid)return this;var t,e=Tt(e,mr),n=it(e,this.loc),r=n.minDaysInFirstWeek,n=n.startOfWeek,i=!N(e.weekYear)||!N(e.weekNumber)||!N(e.weekday),o=!N(e.ordinal),a=!N(e.year),s=!N(e.month)||!N(e.day),u=e.weekYear||e.weekNumber;if((a||s||o)&&u)throw new w("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&o)throw new w("Can't mix ordinal dates with month/day");i?t=tt(l({},et(this.c,r,n),e),r,n):N(e.ordinal)?(t=l({},this.toObject(),e),N(e.day)&&(t.day=Math.min(vt(t.year,t.month),t.day))):t=rt(l({},nt(this.c),e));a=tr(t,this.o,this.zone);return Z(this,{ts:a[0],o:a[1]})},t.plus=function(e){return this.isValid?Z(this,nr(this,x.fromDurationLike(e))):this},t.minus=function(e){return this.isValid?Z(this,nr(this,x.fromDurationLike(e).negate())):this},t.startOf=function(e,t){t=(void 0===t?{}:t).useLocaleWeeks,t=void 0!==t&&t;if(!this.isValid)return this;var n={},e=x.normalizeUnit(e);switch(e){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}return"weeks"===e&&(t?(t=this.loc.getStartOfWeek(),this.weekday<t&&(n.weekNumber=this.weekNumber-1),n.weekday=t):n.weekday=1),"quarters"===e&&(t=Math.ceil(this.month/3),n.month=3*(t-1)+1),this.set(n)},t.endOf=function(e,t){var n;return this.isValid?this.plus(((n={})[e]=1,n)).startOf(e,t).minus(1):this},t.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?M.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):$n},t.toLocaleString=function(e,t){return void 0===e&&(e=G),void 0===t&&(t={}),this.isValid?M.create(this.loc.clone(t),e).formatDateTime(this):$n},t.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?M.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},t.toISO=function(e){var t,e=void 0===e?{}:e,n=e.format,r=e.suppressSeconds,r=void 0!==r&&r,i=e.suppressMilliseconds,i=void 0!==i&&i,o=e.includeOffset,o=void 0===o||o,e=e.extendedZone,e=void 0!==e&&e;return this.isValid?(t=or(this,n="extended"===(void 0===n?"extended":n)),(t+="T")+ar(this,n,r,i,o,e)):null},t.toISODate=function(e){e=(void 0===e?{}:e).format;return this.isValid?or(this,"extended"===(void 0===e?"extended":e)):null},t.toISOWeekDate=function(){return ir(this,"kkkk-'W'WW-c")},t.toISOTime=function(e){var e=void 0===e?{}:e,t=e.suppressMilliseconds,n=e.suppressSeconds,r=e.includeOffset,i=e.includePrefix,o=e.extendedZone,e=e.format;return this.isValid?(void 0!==i&&i?"T":"")+ar(this,"extended"===(void 0===e?"extended":e),void 0!==n&&n,void 0!==t&&t,void 0===r||r,void 0!==o&&o):null},t.toRFC2822=function(){return ir(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},t.toHTTP=function(){return ir(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},t.toSQLDate=function(){return this.isValid?or(this,!0):null},t.toSQLTime=function(e){var e=void 0===e?{}:e,t=e.includeOffset,t=void 0===t||t,n=e.includeZone,n=void 0!==n&&n,e=e.includeOffsetSpace,r="HH:mm:ss.SSS";return(n||t)&&((void 0===e||e)&&(r+=" "),n?r+="z":t&&(r+="ZZ")),ir(this,r,!0)},t.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},t.toString=function(){return this.isValid?this.toISO():$n},t[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},t.valueOf=function(){return this.toMillis()},t.toMillis=function(){return this.isValid?this.ts:NaN},t.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},t.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},t.toJSON=function(){return this.toISO()},t.toBSON=function(){return this.toJSDate()},t.toObject=function(e){var t;return void 0===e&&(e={}),this.isValid?(t=l({},this.c),e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t):{}},t.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},t.diff=function(e,t,n){var r;return void 0===t&&(t="milliseconds"),void 0===n&&(n={}),this.isValid&&e.isValid?(n=l({locale:this.locale,numberingSystem:this.numberingSystem},n),t=t,t=(Array.isArray(t)?t:[t]).map(x.normalizeUnit),e=Zn((r=e.valueOf()>this.valueOf())?this:e,r?e:this,t,n),r?e.negate():e):x.invalid("created by diffing an invali
33d DateTime")},t.diffNow=function(e,t){return void 0===e&&(e="milliseconds"),void 0===t&&(t={}),this.diff(k.now(),e,t)},t.until=function(e){return this.isValid?xn.fromDateTimes(this,e):this},t.hasSame=function(e,t,n){var r;return!!this.isValid&&(r=e.valueOf(),(e=this.setZone(e.zone,{keepLocalTime:!0})).startOf(t,n)<=r)&&r<=e.endOf(t,n)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(e){var t,n,r,i;return this.isValid?(t=(e=void 0===e?{}:e).base||k.fromObject({},{zone:this.zone}),n=e.padding?this<t?-e.padding:e.padding:0,r=["years","months","days","hours","minutes","seconds"],i=e.unit,Array.isArray(e.unit)&&(r=e.unit,i=void 0),vr(t,this.plus(n),l({},e,{numeric:"always",units:r,unit:i}))):null},t.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?vr(e.base||k.fromObject({},{zone:this.zone}),this,l({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},k.min=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.every(k.isDateTime))return ct(t,function(e){return e.valueOf()},Math.min);throw new u("min requires all arguments be DateTimes")},k.max=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.every(k.isDateTime))return ct(t,function(e){return e.valueOf()},Math.max);throw new u("max requires all arguments be DateTimes")},k.fromFormatExplain=function(e,t,n){var n=n=void 0===n?{}:n,r=n.locale,n=n.numberingSystem;return Jn(b.fromOpts({locale:void 0===r?null:r,numberingSystem:void 0===n?null:n,defaultToEN:!0}),e,t)},k.fromStringExplain=function(e,t,n){return k.fromFormatExplain(e,t,n=void 0===n?{}:n)},k.buildFormatParser=function(e,t){var t=t=void 0===t?{}:t,n=t.locale,t=t.numberingSystem,n=b.fromOpts({locale:void 0===n?null:n,numberingSystem:void 0===t?null:t,defaultToEN:!0});return new Hn(n,e)},k.fromFormatParser=function(e,t,n){if(void 0===n&&(n={}),N(e)||N(t))throw new u("fromFormatParser requires an input string and a format parser");var r,i,o,a=n,s=a.locale,a=a.numberingSystem,s=b.fromOpts({locale:void 0===s?null:s,numberingSystem:void 0===a?null:a,defaultToEN:!0});if(s.equals(t.locale))return r=(a=t.explainFromTokens(e)).result,i=a.zone,o=a.specificOffset,(a=a.invalidReason)?k.invalid(a):rr(r,i,n,"format "+t.format,e,o);throw new u("fromFormatParser called with a locale of "+s+", but the format parser was created for "+t.locale)},i(k,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?Qn(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?Qn(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?Qn(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?Kn(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?Kn(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?Kn(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?nt(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Fn.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Fn.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Fn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Fn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return mt(this.year)}},{key:"daysInMonth",get:function(){return vt(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?yt(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?kt(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?kt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return G}},{key:"DATE_MED",get:function(){return $}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return B}},{key:"DATE_FULL",get:function(){return Q}},{key:"DATE_HUGE",get:function(){return K}},{key:"TIME_SIMPLE",get:function(){return X}},{key:"TIME_WITH_SECONDS",get:function(){return ee}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return te}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return ne}},{key:"TIME_24_SIMPLE",get:function(){return re}},{key:"TIME_24_WITH_SECONDS",get:function(){return ie}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return oe}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return ae}},{key:"DATETIME_SHORT",get:function(){return se}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return ue}},{key:"DATETIME_MED",get:function(){return le}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return ce}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return fe}},{key:"DATETIME_FULL",get:function(){return de}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return he}},{key:"DATETIME_HUGE",get:function(){return me}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return ye}}]),k}(Symbol.for("nodejs.util.inspect.custom"));function kr(e){if(W.isDateTime(e))return e;if(e&&e.valueOf&&v(e.valueOf()))return W.fromJSDate(e);if(e&&"object"==typeof e)return W.fromObject(e);throw new u("Unknown datetime argument: "+e+", of type "+typeof e)}return e.DateTime=W,e.Duration=x,e.FixedOffsetZone=f,e.IANAZone=c,e.Info=Fn,e.Interval=xn,e.InvalidZone=Le,e.Settings=O,e.SystemZone=ge,e.VERSION="3.5.0",e.Zone=s,Object.defineProperty(e,"__esMo
33dule",{value:!0}),e}({});; 34/** 35 * @file layout.admin.js 36 * 37 * Behaviors for editing a layout. 38 */ 39 40(function ($) { 41 42"use strict"; 43 44/** 45 * Behavior for showing a list of layouts. 46 * 47 * Detect flexbox support for displaying our list of layouts with vertical 48 * height matching for each row of layout template icons. 49 */ 50Backdrop.behaviors.gridFloatFallback = { 51 attach: function() { 52 var $body = $('body'); 53 if (!$body.hasClass('grid-float-fallback-processed') && !Backdrop.featureDetect.flexbox()) { 54 $('head').append('<link rel="stylesheet" type="text/css" href="/core/modules/layout/css/grid-float.css">'); 55 $body.addClass('grid-float-fallback-processed'); 56 } 57 } 58}; 59 60})(jQuery); 61; 62/*! 63 * SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 64 * http://www.smartmenus.org/ 65 * 66 * Copyright Vasil Dinkov, Vadikom Web Ltd. 67 * http://vadikom.com 68 * 69 * Licensed MIT 70 */ 71 72(function(factory) { 73 if (typeof define === 'function' && define.amd) { 74 // AMD 75 define(['jquery'], factory); 76 } else if (typeof module === 'object' && typeof module.exports === 'object') { 77 // CommonJS 78 module.exports = factory(require('jquery')); 79 } else { 80 // Global jQuery 81 factory(jQuery); 82 } 83} (function($) { 84 85 var menuTrees = [], 86 mouse = false, // optimize for touch by default - we will detect for mouse input 87 touchEvents = 'ontouchstart' in window, // we use this just to choose between toucn and pointer events, not for touch screen detection 88 mouseDetectionEnabled = false, 89 requestAnimationFrame = window.requestAnimationFrame || function(callback) { return setTimeout(callback, 1000 / 60); }, 90 cancelAnimationFrame = window.cancelAnimationFrame || function(id) { clearTimeout(id); }, 91 canAnimate = !!$.fn.animate; 92 93 // Handle detection for mouse input (i.e. desktop browsers, tablets with a mouse, etc.) 94 function initMouseDetection(disable) { 95 var eNS = '.smartmenus_mouse'; 96 if (!mouseDetectionEnabled && !disable) { 97 // if we get two consecutive mousemoves within 2 pixels from each other and within 300ms, we assume a real mouse/cursor is present 98 // in practice, this seems like impossible to trick unintentianally with a real mouse and a pretty safe detection on touch devices (even with older browsers that do not support touch events) 99 var firstTime = true, 100 lastMove = null, 101 events = { 102 'mousemove': function(e) { 103 var thisMove = { x: e.pageX, y: e.pageY, timeStamp: new Date().getTime() }; 104 if (lastMove) { 105 var deltaX = Math.abs(lastMove.x - thisMove.x), 106 deltaY = Math.abs(lastMove.y - thisMove.y); 107 if ((deltaX > 0 || deltaY > 0) && deltaX <= 2 && deltaY <= 2 && thisMove.timeStamp - lastMove.timeStamp <= 300) { 108 mouse = true; 109 // if this is the first check after page load, check if we are not over some item by chance and call the mouseenter handler if yes 110 if (firstTime) { 111 var $a = $(e.target).closest('a'); 112 if ($a.is('a')) { 113 $.each(menuTrees, function() { 114 if ($.contains(this.$root[0], $a[0])) { 115 this.itemEnter({ currentTarget: $a[0] }); 116 return false; 117 } 118 }); 119 } 120 firstTime = false; 121 } 122 } 123 } 124 lastMove = thisMove; 125 } 126 }; 127 events[touchEvents ? 'touchstart' : 'pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut'] = function(e) { 128 if (isTouchEvent(e.originalEvent)) { 129 mouse = false; 130 } 131 }; 132 $(document).on(getEventsNS(events, eNS)); 133 mouseDetectionEnabled = true; 134 } else if (mouseDetectionEnabled && disable) { 135 $(document).off(eNS); 136 mouseDetectionEnabled = false; 137 } 138 } 139 140 function isTouchEvent(e) { 141 return !/^(4|mouse)$/.test(e.pointerType); 142 } 143 144 // returns a jQuery on() ready object 145 function getEventsNS(events, eNS) { 146 if (!eNS) { 147 eNS = ''; 148 } 149 var eventsNS = {}; 150 for (var i in events) { 151 eventsNS[i.split(' ').join(eNS + ' ') + eNS] = events[i]; 152 } 153 return eventsNS; 154 } 155 156 $.SmartMenus = function(elm, options) { 157 this.$root = $(elm); 158 this.opts = options; 159 this.rootId = ''; // internal 160 this.accessIdPrefix = ''; 161 this.$subArrow = null; 162 this.activatedItems = []; // stores last activated A's for each level 163 this.visibleSubMenus = []; // stores visible sub menus UL's (might be in no particular order) 164 this.showTimeout = 0; 165 this.hideTimeout = 0; 166 this.scrollTimeout = 0; 167 this.clickActivated = false;
168 this.focusActivated = false; 169 this.zIndexInc = 0; 170 this.idInc = 0; 171 this.$firstLink = null; // we'll use these for some tests 172 this.$firstSub = null; // at runtime so we'll cache them 173 this.disabled = false; 174 this.$disableOverlay = null; 175 this.$touchScrollingSub = null; 176 this.cssTransforms3d = 'perspective' in elm.style || 'webkitPerspective' in elm.style; 177 this.wasCollapsible = false; 178 this.init(); 179 }; 180 181 $.extend($.SmartMenus, { 182 hideAll: function() { 183 $.each(menuTrees, function() { 184 this.menuHideAll(); 185 }); 186 }, 187 destroy: function() { 188 while (menuTrees.length) { 189 menuTrees[0].destroy(); 190 } 191 initMouseDetection(true); 192 }, 193 prototype: { 194 init: function(refresh) { 195 var self = this; 196 197 if (!refresh) { 198 menuTrees.push(this); 199 200 this.rootId = (new Date().getTime() + Math.random() + '').replace(/\D/g, ''); 201 this.accessIdPrefix = 'sm-' + this.rootId + '-'; 202 203 if (this.$root.hasClass('sm-rtl')) { 204 this.opts.rightToLeftSubMenus = true; 205 } 206 207 // init root (main menu) 208 var eNS = '.smartmenus'; 209 this.$root 210 .data('smartmenus', this) 211 .attr('data-smartmenus-id', this.rootId) 212 .dataSM('level', 1) 213 .on(getEventsNS({ 214 'mouseover focusin': $.proxy(this.rootOver, this), 215 'mouseout focusout': $.proxy(this.rootOut, this), 216 'keydown': $.proxy(this.rootKeyDown, this) 217 }, eNS)) 218 .on(getEventsNS({ 219 'mouseenter': $.proxy(this.itemEnter, this), 220 'mouseleave': $.proxy(this.itemLeave, this), 221 'mousedown': $.proxy(this.itemDown, this), 222 'focus': $.proxy(this.itemFocus, this), 223 'blur': $.proxy(this.itemBlur, this), 224 'click': $.proxy(this.itemClick, this) 225 }, eNS), 'a'); 226 227 // hide menus on tap or click outside the root UL 228 eNS += this.rootId; 229 if (this.opts.hideOnClick) { 230 $(document).on(getEventsNS({ 231 'touchstart': $.proxy(this.docTouchStart, this), 232 'touchmove': $.proxy(this.docTouchMove, this), 233 'touchend': $.proxy(this.docTouchEnd, this), 234 // for Opera Mobile < 11.5, webOS browser, etc. we'll check click too 235 'click': $.proxy(this.docClick, this) 236 }, eNS)); 237 } 238 // hide sub menus on resize 239 $(window).on(getEventsNS({ 'resize orientationchange': $.proxy(this.winResize, this) }, eNS)); 240 241 if (this.opts.subIndicators) { 242 this.$subArrow = $('<span/>').addClass('sub-arrow'); 243 if (this.opts.subIndicatorsText) { 244 this.$subArrow.html(this.opts.subIndicatorsText); 245 } 246 } 247 248 // make sure mouse detection is enabled 249 initMouseDetection(); 250 } 251 252 // init sub menus 253 this.$firstSub = this.$root.find('ul').each(function() { self.menuInit($(this)); }).eq(0); 254 255 this.$firstLink = this.$root.find('a').eq(0); 256 257 // find current item 258 if (this.opts.markCurrentItem) { 259 var reDefaultDoc = /(index|default)\.[^#\?\/]*/i, 260 reHash = /#.*/, 261 locHref = window.location.href.replace(reDefaultDoc, ''), 262 locHrefNoHash = locHref.replace(reHash, ''); 263 this.$root.find('a').each(function() { 264 var href = this.href.replace(reDefaultDoc, ''), 265 $this = $(this); 266 if (href == locHref || href == locHrefNoHash) { 267 $this.addClass('current'); 268 if (self.opts.markCurrentTree) { 269 $this.parentsUntil('[data-smartmenus-id]', 'ul').each(function() { 270 $(this).dataSM('parent-a').addClass('current'); 271 }); 272 } 273 } 274 }); 275 } 276 277 // save initial state 278 this.wasCollapsible = this.isCollapsible(); 279 }, 280 destroy: function(refresh) { 281 if (!refresh) { 282 var eNS = '.smartmenus'; 283 this.$root 284 .removeData('smartmenus') 285 .removeAttr('data-smartmenus-id') 286 .removeDataSM('level') 287 .off(eNS); 288 eNS += this.rootId; 289 $(document).off(eNS); 290 $(window).off(eNS); 291 if (this.opts.subIndicators) { 292 this.$subArrow = null; 293 } 294 } 295 this.menuHideAll(); 296 var self = this; 297 this.$root.find('ul').each(function() { 298 var $this = $(this); 299 if ($this.dataSM('scroll-arrows')) { 300 $this.dataSM('scroll-arrows').remove(); 301 } 302 if ($this.dataSM('shown-before')) { 303 if (self.opts.subMenusMinWidth || self.opts.subMenusMaxWidth) { 304 $this.css({ width: '', minWidth: '', maxWidth: '' }).removeClass('sm-nowrap'); 305 } 306 if ($this.dataSM('scroll-arrows')) { 307 $this.dataSM('scroll-arrows').remove(); 308 } 309 $this.css({ zIndex: '', top: '', left: '', marginLeft: '', marginTop: '', display: '' }); 310 } 311 if (($this.attr('id') || '').indexOf(self.accessIdPrefix) == 0) { 312 $this.removeAttr('id'); 313 } 314 }) 315 .removeDataSM('in-mega') 316 .removeDataSM('shown-before') 317 .removeDataSM('scroll-arrows') 318 .removeDataSM('parent-a') 319 .removeDataSM('level') 320 .removeDataSM('beforefirstshowfired') 321 .removeAttr('role') 322 .removeAttr('aria-hidden') 323 .removeAttr('aria-labelledby') 324 .removeAttr('aria-expanded'); 325 this.$root.find('a.has-submenu').each(function() { 326 var $this = $(this); 327 if ($this.attr('id').indexOf(self.accessIdPrefix) == 0) { 328 $this.removeAttr('id'); 329 } 330 }) 331 .removeClass('has-submenu') 332 .removeDataSM('sub') 333 .removeAttr('aria-haspopup') 334 .removeAttr('aria-controls') 335 .removeAttr('aria-expanded') 336 .closest('li').removeDataSM('sub'); 337 if (this.opts.subIndicators) { 338 this.$root.find('span.sub-arrow').remove(); 339 } 340 if (this.opts.markCurrentItem) { 341 this.$root.find('a.current').removeClass('current'); 342 } 343 if (!refresh) { 344 this.$root = null; 345 this.$firstLink = null; 346 this.$firstSub = null; 347 if (this.$disableOverlay) { 348 this.$disableOverlay.remove(); 349 this.$disableOverlay = null; 350 } 351 menuTrees.splice($.inArray(this, menuTrees), 1); 352 } 353 }, 354 disable: function(noOverlay) { 355 if (!this.disabled) { 356 this.menuHideAll(); 357 // display overlay over the menu to prevent interaction 358 if (!noOverlay && !this.opts.isPopup && this.$root.is(':visible')) { 359 var pos = this.$root.offset(); 360 this.$disableOverlay = $('<div class="sm-jquery-disable-overlay"/>').css({ 361 position: 'absolute', 362 top: pos.top, 363 left: pos.left, 364 width: this.$root.outerWidth(), 365 height: this.$root.outerHeight(),
366 zIndex: this.getStartZIndex(true), 367 opacity: 0 368 }).appendTo(document.body); 369 } 370 this.disabled = true; 371 } 372 }, 373 docClick: function(e) { 374 if (this.$touchScrollingSub) { 375 this.$touchScrollingSub = null; 376 return; 377 } 378 // hide on any click outside the menu or on a menu link 379 if (this.visibleSubMenus.length && !$.contains(this.$root[0], e.target) || $(e.target).closest('a').length) { 380 this.menuHideAll(); 381 } 382 }, 383 docTouchEnd: function(e) { 384 if (!this.lastTouch) { 385 return; 386 } 387 if (this.visibleSubMenus.length && (this.lastTouch.x2 === undefined || this.lastTouch.x1 == this.lastTouch.x2) && (this.lastTouch.y2 === undefined || this.lastTouch.y1 == this.lastTouch.y2) && (!this.lastTouch.target || !$.contains(this.$root[0], this.lastTouch.target))) { 388 if (this.hideTimeout) { 389 clearTimeout(this.hideTimeout); 390 this.hideTimeout = 0; 391 } 392 // hide with a delay to prevent triggering accidental unwanted click on some page element 393 var self = this; 394 this.hideTimeout = setTimeout(function() { self.menuHideAll(); }, 350); 395 } 396 this.lastTouch = null; 397 }, 398 docTouchMove: function(e) { 399 if (!this.lastTouch) { 400 return; 401 } 402 var touchPoint = e.originalEvent.touches[0]; 403 this.lastTouch.x2 = touchPoint.pageX; 404 this.lastTouch.y2 = touchPoint.pageY; 405 }, 406 docTouchStart: function(e) { 407 var touchPoint = e.originalEvent.touches[0]; 408 this.lastTouch = { x1: touchPoint.pageX, y1: touchPoint.pageY, target: touchPoint.target }; 409 }, 410 enable: function() { 411 if (this.disabled) { 412 if (this.$disableOverlay) { 413 this.$disableOverlay.remove(); 414 this.$disableOverlay = null; 415 } 416 this.disabled = false; 417 } 418 }, 419 getClosestMenu: function(elm) { 420 var $closestMenu = $(elm).closest('ul'); 421 while ($closestMenu.dataSM('in-mega')) { 422 $closestMenu = $closestMenu.parent().closest('ul'); 423 } 424 return $closestMenu[0] || null; 425 }, 426 getHeight: function($elm) { 427 return this.getOffset($elm, true); 428 }, 429 // returns precise width/height float values 430 getOffset: function($elm, height) { 431 var old; 432 if ($elm.css('display') == 'none') { 433 old = { position: $elm[0].style.position, visibility: $elm[0].style.visibility }; 434 $elm.css({ position: 'absolute', visibility: 'hidden' }).show(); 435 } 436 var box = $elm[0].getBoundingClientRect && $elm[0].getBoundingClientRect(), 437 val = box && (height ? box.height || box.bottom - box.top : box.width || box.right - box.left); 438 if (!val && val !== 0) { 439 val = height ? $elm[0].offsetHeight : $elm[0].offsetWidth; 440 } 441 if (old) { 442 $elm.hide().css(old); 443 } 444 return val; 445 }, 446 getStartZIndex: function(root) { 447 var zIndex = parseInt(this[root ? '$root' : '$firstSub'].css('z-index')); 448 if (!root && isNaN(zIndex)) { 449 zIndex = parseInt(this.$root.css('z-index')); 450 } 451 return !isNaN(zIndex) ? zIndex : 1; 452 }, 453 getTouchPoint: function(e) { 454 return e.touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e; 455 }, 456 getViewport: function(height) { 457 var name = height ? 'Height' : 'Width', 458 val = document.documentElement['client' + name], 459 val2 = window['inner' + name]; 460 if (val2) { 461 val = Math.min(val, val2); 462 } 463 return val; 464 }, 465 getViewportHeight: function() { 466 return this.getViewport(true); 467 }, 468 getViewportWidth: function() { 469 return this.getViewport(); 470 }, 471 getWidth: function($elm) { 472 return this.getOffset($elm); 473 }, 474 handleEvents: function() { 475 return !this.disabled && this.isCSSOn(); 476 }, 477 handleItemEvents: function($a) { 478 return this.handleEvents() && !this.isLinkInMegaMenu($a); 479 }, 480 isCollapsible: function() { 481 return this.$firstSub.css('position') == 'static'; 482 }, 483 isCSSOn: function() { 484 return this.$firstLink.css('display') != 'inline'; 485 }, 486 isFixed: function() { 487 var isFixed = this.$root.css('position') == 'fixed'; 488 if (!isFixed) { 489 this.$root.parentsUntil('body').each(function() { 490 if ($(this).css('position') == 'fixed') { 491 isFixed = true; 492 return false;
493 } 494 }); 495 } 496 return isFixed; 497 }, 498 isLinkInMegaMenu: function($a) { 499 return $(this.getClosestMenu($a[0])).hasClass('mega-menu'); 500 }, 501 isTouchMode: function() { 502 return !mouse || this.opts.noMouseOver || this.isCollapsible(); 503 }, 504 itemActivate: function($a, hideDeeperSubs) { 505 var $ul = $a.closest('ul'), 506 level = $ul.dataSM('level'); 507 // if for some reason the parent item is not activated (e.g. this is an API call to activate the item), activate all parent items first 508 if (level > 1 && (!this.activatedItems[level - 2] || this.activatedItems[level - 2][0] != $ul.dataSM('parent-a')[0])) { 509 var self = this; 510 $($ul.parentsUntil('[data-smartmenus-id]', 'ul').get().reverse()).add($ul).each(function() { 511 self.itemActivate($(this).dataSM('parent-a')); 512 }); 513 } 514 // hide any visible deeper level sub menus 515 if (!this.isCollapsible() || hideDeeperSubs) { 516 this.menuHideSubMenus(!this.activatedItems[level - 1] || this.activatedItems[level - 1][0] != $a[0] ? level - 1 : level); 517 } 518 // save new active item for this level 519 this.activatedItems[level - 1] = $a; 520 if (this.$root.triggerHandler('activate.smapi', $a[0]) === false) { 521 return; 522 } 523 // show the sub menu if this item has one 524 var $sub = $a.dataSM('sub'); 525 if ($sub && (this.isTouchMode() || (!this.opts.showOnClick || this.clickActivated))) { 526 this.menuShow($sub); 527 } 528 }, 529 itemBlur: function(e) { 530 var $a = $(e.currentTarget); 531 if (!this.handleItemEvents($a)) { 532 return; 533 } 534 this.$root.triggerHandler('blur.smapi', $a[0]); 535 }, 536 itemClick: function(e) { 537 var $a = $(e.currentTarget); 538 if (!this.handleItemEvents($a)) { 539 return; 540 } 541 if (this.$touchScrollingSub && this.$touchScrollingSub[0] == $a.closest('ul')[0]) { 542 this.$touchScrollingSub = null; 543 e.stopPropagation(); 544 return false; 545 } 546 if (this.$root.triggerHandler('click.smapi', $a[0]) === false) { 547 return false; 548 } 549 var subArrowClicked = $(e.target).is('.sub-arrow'), 550 $sub = $a.dataSM('sub'), 551 firstLevelSub = $sub ? $sub.dataSM('level') == 2 : false, 552 collapsible = this.isCollapsible(), 553 behaviorToggle = /toggle$/.test(this.opts.collapsibleBehavior), 554 behaviorLink = /link$/.test(this.opts.collapsibleBehavior), 555 behaviorAccordion = /^accordion/.test(this.opts.collapsibleBehavior); 556 // if the sub is hidden, try to show it 557 if ($sub && !$sub.is(':visible')) { 558 if (!behaviorLink || !collapsible || subArrowClicked) { 559 if (this.opts.showOnClick && firstLevelSub) { 560 this.clickActivated = true; 561 } 562 // try to activate the item and show the sub 563 this.itemActivate($a, behaviorAccordion); 564 // if "itemActivate" showed the sub, prevent the click so that the link is not loaded 565 // if it couldn't show it, then the sub menus are disabled with an !important declaration (e.g. via mobile styles) so let the link get loaded 566 if ($sub.is(':visible')) { 567 this.focusActivated = true; 568 return false; 569 } 570 } 571 // if the sub is visible and we are in collapsible mode 572 } else if (collapsible && (behaviorToggle || subArrowClicked)) { 573 this.itemActivate($a, behaviorAccordion); 574 this.menuHide($sub); 575 if (behaviorToggle) { 576 this.focusActivated = false; 577 } 578 return false; 579 } 580 if (this.opts.showOnClick && firstLevelSub || $a.hasClass('disabled') || this.$root.triggerHandler('select.smapi', $a[0]) === false) { 581 return false; 582 } 583 }, 584 itemDown: function(e) { 585 var $a = $(e.currentTarget); 586 if (!this.handleItemEvents($a)) { 587 return; 588 } 589 $a.dataSM('mousedown', true); 590 }, 591 itemEnter: function(e) { 592 var $a = $(e.currentTarget); 593 if (!this.handleItemEvents($a)) { 594 return; 595 } 596 if (!this.isTouchMode()) { 597 if (this.showTimeout) { 598 clearTimeout(this.showTimeout); 599 this.showTimeout = 0; 600 } 601 var self = this; 602 this.showTimeout = setTimeout(function() { self.itemActivate($a); }, this.opts.showOnClick && $a.closest('ul').dataSM('level') == 1 ? 1 : this.opts.showTimeout); 603 } 604 this.$root.triggerHandler('mouseenter.smapi', $a[0]); 605 }, 606 itemFocus: function(e) { 607 var $a = $(e.currentTarget); 608 if (!this.handleItemEvents($a)) { 609 return; 610 } 611 // fix (the mousedown check): in some browsers a tap/click produces consecutive focus + click events so we don't need to activate the item on focus 612 if (this.focusActivated && (!this.isTouchMode() || !$a.dataSM('mousedown')) && (!this.activatedItems.length || this.activatedItems[this.activatedItems.length - 1][0] != $a[0])) { 613 this.itemActivate($a, true); 614 } 615 this.$root.triggerHandler('focus.smapi', $a[0]); 616 }, 617 itemLeave: function(e) { 618 var $a = $(e.currentTarget); 619 if (!this.handleItemEvents($a)) { 620 return; 621 } 622 if (!this.isTouchMode()) { 623 $a[0].blur(); 624 if (this.showTimeout) { 625 clearTimeout(this.showTimeout); 626 this.showTimeout = 0; 627 } 628 } 629 $a.removeDataSM('mousedown');
630 this.$root.triggerHandler('mouseleave.smapi', $a[0]); 631 }, 632 menuHide: function($sub) { 633 if (this.$root.triggerHandler('beforehide.smapi', $sub[0]) === false) { 634 return; 635 } 636 if (canAnimate) { 637 $sub.stop(true, true); 638 } 639 if ($sub.css('display') != 'none') { 640 var complete = function() { 641 // unset z-index 642 $sub.css('z-index', ''); 643 }; 644 // if sub is collapsible (mobile view) 645 if (this.isCollapsible()) { 646 if (canAnimate && this.opts.collapsibleHideFunction) { 647 this.opts.collapsibleHideFunction.call(this, $sub, complete); 648 } else { 649 $sub.hide(this.opts.collapsibleHideDuration, complete); 650 } 651 } else { 652 if (canAnimate && this.opts.hideFunction) { 653 this.opts.hideFunction.call(this, $sub, complete); 654 } else { 655 $sub.hide(this.opts.hideDuration, complete); 656 } 657 } 658 // deactivate scrolling if it is activated for this sub 659 if ($sub.dataSM('scroll')) { 660 this.menuScrollStop($sub); 661 $sub.css({ 'touch-action': '', '-ms-touch-action': '', '-webkit-transform': '', transform: '' }) 662 .off('.smartmenus_scroll').removeDataSM('scroll').dataSM('scroll-arrows').hide(); 663 } 664 // unhighlight parent item + accessibility 665 $sub.dataSM('parent-a').removeClass('highlighted').attr('aria-expanded', 'false'); 666 $sub.attr({ 667 'aria-expanded': 'false', 668 'aria-hidden': 'true' 669 }); 670 var level = $sub.dataSM('level'); 671 this.activatedItems.splice(level - 1, 1); 672 this.visibleSubMenus.splice($.inArray($sub, this.visibleSubMenus), 1); 673 this.$root.triggerHandler('hide.smapi', $sub[0]); 674 } 675 }, 676 menuHideAll: function() { 677 if (this.showTimeout) { 678 clearTimeout(this.showTimeout); 679 this.showTimeout = 0; 680 } 681 // hide all subs 682 // if it's a popup, this.visibleSubMenus[0] is the root UL 683 var level = this.opts.isPopup ? 1 : 0; 684 for (var i = this.visibleSubMenus.length - 1; i >= level; i--) { 685 this.menuHide(this.visibleSubMenus[i]); 686 } 687 // hide root if it's popup 688 if (this.opts.isPopup) { 689 if (canAnimate) { 690 this.$root.stop(true, true); 691 } 692 if (this.$root.is(':visible')) { 693 if (canAnimate && this.opts.hideFunction) { 694 this.opts.hideFunction.call(this, this.$root); 695 } else { 696 this.$root.hide(this.opts.hideDuration); 697 } 698 } 699 } 700 this.activatedItems = []; 701 this.visibleSubMenus = []; 702 this.clickActivated = false; 703 this.focusActivated = false; 704 // reset z-index increment 705 this.zIndexInc = 0; 706 this.$root.triggerHandler('hideAll.smapi'); 707 }, 708 menuHideSubMenus: function(level) { 709 for (var i = this.activatedItems.length - 1; i >= level; i--) { 710 var $sub = this.activatedItems[i].dataSM('sub'); 711 if ($sub) { 712 this.menuHide($sub); 713 } 714 } 715 }, 716 menuInit: function($ul) { 717 if (!$ul.dataSM('in-mega')) { 718 // mark UL's in mega drop downs (if any) so we can neglect them 719 if ($ul.hasClass('mega-menu')) { 720 $ul.find('ul').dataSM('in-mega', true); 721 } 722 // get level (much faster than, for example, using parentsUntil) 723 var level = 2, 724 par = $ul[0]; 725 while ((par = par.parentNode.parentNode) != this.$root[0]) { 726 level++; 727 } 728 // cache stuff for quick access 729 var $a = $ul.prevAll('a').eq(-1); 730 // if the link is nested (e.g. in a heading) 731 if (!$a.length) { 732 $a = $ul.prevAll().find('a').eq(-1); 733 } 734 $a.addClass('has-submenu').dataSM('sub', $ul); 735 $ul.dataSM('parent-a', $a) 736 .dataSM('level', level) 737 .parent().dataSM('sub', $ul); 738 // accessibility 739 var aId = $a.attr('id') || this.accessIdPrefix + (++this.idInc), 740 ulId = $ul.attr('id') || this.accessIdPrefix + (++this.idInc); 741 $a.attr({ 742 id: aId, 743 'aria-haspopup': 'true', 744 'aria-controls': ulId, 745 'aria-expanded': 'false' 746 }); 747 $ul.attr({ 748 id: ulId, 749 'role': 'group', 750 'aria-hidden': 'true', 751 'aria-labelledby': aId, 752 'aria-expanded': 'false' 753 }); 754 // add sub indicator to parent item 755 if (this.opts.subIndicators) { 756 $a[this.opts.subIndicatorsPos](this.$subArrow.clone()); 757 } 758 } 759 }, 760 menuPosition: function($sub) { 761 var $a = $sub.dataSM('parent-a'), 762 $li = $a.closest('li'), 763 $ul = $li.parent(), 764 level = $sub.dataSM('level'), 765 subW = this.getWidth($sub), 766 subH = this.getHeight($sub), 767 itemOffset = $a.offset(), 768 itemX = itemOffset.left, 769 itemY = itemOffset.top, 770 itemW = this.getWidth($a), 771 itemH = this.getHeight($a), 772 $win = $(window), 773 winX = $win.scrollLeft(), 774 winY = $win.scrollTop(), 775 winW = this.getViewportWidth(),
776 winH = this.getViewportHeight(), 777 horizontalParent = $ul.parent().is('[data-sm-horizontal-sub]') || level == 2 && !$ul.hasClass('sm-vertical'), 778 rightToLeft = this.opts.rightToLeftSubMenus && !$li.is('[data-sm-reverse]') || !this.opts.rightToLeftSubMenus && $li.is('[data-sm-reverse]'), 779 subOffsetX = level == 2 ? this.opts.mainMenuSubOffsetX : this.opts.subMenusSubOffsetX, 780 subOffsetY = level == 2 ? this.opts.mainMenuSubOffsetY : this.opts.subMenusSubOffsetY, 781 x, y; 782 if (horizontalParent) { 783 x = rightToLeft ? itemW - subW - subOffsetX : subOffsetX; 784 y = this.opts.bottomToTopSubMenus ? -subH - subOffsetY : itemH + subOffsetY; 785 } else { 786 x = rightToLeft ? subOffsetX - subW : itemW - subOffsetX; 787 y = this.opts.bottomToTopSubMenus ? itemH - subOffsetY - subH : subOffsetY; 788 } 789 if (this.opts.keepInViewport) { 790 var absX = itemX + x, 791 absY = itemY + y; 792 if (rightToLeft && absX < winX) { 793 x = horizontalParent ? winX - absX + x : itemW - subOffsetX; 794 } else if (!rightToLeft && absX + subW > winX + winW) { 795 x = horizontalParent ? winX + winW - subW - absX + x : subOffsetX - subW; 796 } 797 if (!horizontalParent) { 798 if (subH < winH && absY + subH > winY + winH) { 799 y += winY + winH - subH - absY; 800 } else if (subH >= winH || absY < winY) { 801 y += winY - absY; 802 } 803 } 804 // do we need scrolling? 805 // 0.49 used for better precision when dealing with float values 806 if (horizontalParent && (absY + subH > winY + winH + 0.49 || absY < winY) || !horizontalParent && subH > winH + 0.49) { 807 var self = this; 808 if (!$sub.dataSM('scroll-arrows')) { 809 $sub.dataSM('scroll-arrows', $([$('<span class="scroll-up"><span class="scroll-up-arrow"></span></span>')[0], $('<span class="scroll-down"><span class="scroll-down-arrow"></span></span>')[0]]) 810 .on({ 811 mouseenter: function() { 812 $sub.dataSM('scroll').up = $(this).hasClass('scroll-up'); 813 self.menuScroll($sub); 814 }, 815 mouseleave: function(e) { 816 self.menuScrollStop($sub); 817 self.menuScrollOut($sub, e); 818 }, 819 'mousewheel DOMMouseScroll': function(e) { e.preventDefault(); } 820 }) 821 .insertAfter($sub) 822 ); 823 } 824 // bind scroll events and save scroll data for this sub 825 var eNS = '.smartmenus_scroll'; 826 $sub.dataSM('scroll', { 827 y: this.cssTransforms3d ? 0 : y - itemH, 828 step: 1, 829 // cache stuff for faster recalcs later 830 itemH: itemH, 831 subH: subH, 832 arrowDownH: this.getHeight($sub.dataSM('scroll-arrows').eq(1)) 833 }) 834 .on(getEventsNS({ 835 'mouseover': function(e) { self.menuScrollOver($sub, e); }, 836 'mouseout': function(e) { self.menuScrollOut($sub, e); }, 837 'mousewheel DOMMouseScroll': function(e) { self.menuScrollMousewheel($sub, e); } 838 }, eNS)) 839 .dataSM('scroll-arrows').css({ top: 'auto', left: '0', marginLeft: x + (parseInt($sub.css('border-left-width')) || 0), width: subW - (parseInt($sub.css('border-left-width')) || 0) - (parseInt($sub.css('border-right-width')) || 0), zIndex: $sub.css('z-index') }) 840 .eq(horizontalParent && this.opts.bottomToTopSubMenus ? 0 : 1).show(); 841 // when a menu tree is fixed positioned we allow scrolling via touch too 842 // since there is no other way to access such long sub menus if no mouse is present 843 if (this.isFixed()) { 844 var events = {}; 845 events[touchEvents ? 'touchstart touchmove touchend' : 'pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp'] = function(e) { 846 self.menuScrollTouch($sub, e); 847 }; 848 $sub.css({ 'touch-action': 'none', '-ms-touch-action': 'none' }).on(getEventsNS(events, eNS)); 849 } 850 } 851 } 852 $sub.css({ top: 'auto', left: '0', marginLeft: x, marginTop: y - itemH }); 853 }, 854 menuScroll: function($sub, once, step) { 855 var data = $sub.dataSM('scroll'), 856 $arrows = $sub.dataSM('scroll-arrows'), 857 end = data.up ? data.upEnd : data.downEnd, 858 diff; 859 if (!once && data.momentum) { 860 data.momentum *= 0.92; 861 diff = data.momentum; 862 if (diff < 0.5) { 863 this.menuScrollStop($sub); 864 return; 865 } 866 } else { 867 diff = step || (once || !this.opts.scrollAccelerate ? this.opts.scrollStep : Math.floor(data.step)); 868 } 869 // hide any visible deeper level sub menus 870 var level = $sub.dataSM('level'); 871 if (this.activatedItems[level - 1] && this.activatedItems[level - 1].dataSM('sub') && this.activatedItems[level - 1].dataSM('sub').is(':visible')) {
872 this.menuHideSubMenus(level - 1); 873 } 874 data.y = data.up && end <= data.y || !data.up && end >= data.y ? data.y : (Math.abs(end - data.y) > diff ? data.y + (data.up ? diff : -diff) : end); 875 $sub.css(this.cssTransforms3d ? { '-webkit-transform': 'translate3d(0, ' + data.y + 'px, 0)', transform: 'translate3d(0, ' + data.y + 'px, 0)' } : { marginTop: data.y }); 876 // show opposite arrow if appropriate 877 if (mouse && (data.up && data.y > data.downEnd || !data.up && data.y < data.upEnd)) { 878 $arrows.eq(data.up ? 1 : 0).show(); 879 } 880 // if we've reached the end 881 if (data.y == end) { 882 if (mouse) { 883 $arrows.eq(data.up ? 0 : 1).hide(); 884 } 885 this.menuScrollStop($sub); 886 } else if (!once) { 887 if (this.opts.scrollAccelerate && data.step < this.opts.scrollStep) { 888 data.step += 0.2; 889 } 890 var self = this; 891 this.scrollTimeout = requestAnimationFrame(function() { self.menuScroll($sub); }); 892 } 893 }, 894 menuScrollMousewheel: function($sub, e) { 895 if (this.getClosestMenu(e.target) == $sub[0]) { 896 e = e.originalEvent; 897 var up = (e.wheelDelta || -e.detail) > 0; 898 if ($sub.dataSM('scroll-arrows').eq(up ? 0 : 1).is(':visible')) { 899 $sub.dataSM('scroll').up = up; 900 this.menuScroll($sub, true); 901 } 902 } 903 e.preventDefault(); 904 }, 905 menuScrollOut: function($sub, e) { 906 if (mouse) { 907 if (!/^scroll-(up|down)/.test((e.relatedTarget || '').className) && ($sub[0] != e.relatedTarget && !$.contains($sub[0], e.relatedTarget) || this.getClosestMenu(e.relatedTarget) != $sub[0])) { 908 $sub.dataSM('scroll-arrows').css('visibility', 'hidden'); 909 } 910 } 911 }, 912 menuScrollOver: function($sub, e) { 913 if (mouse) { 914 if (!/^scroll-(up|down)/.test(e.target.className) && this.getClosestMenu(e.target) == $sub[0]) { 915 this.menuScrollRefreshData($sub); 916 var data = $sub.dataSM('scroll'), 917 upEnd = $(window).scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH; 918 $sub.dataSM('scroll-arrows').eq(0).css('margin-top', upEnd).end() 919 .eq(1).css('margin-top', upEnd + this.getViewportHeight() - data.arrowDownH).end() 920 .css('visibility', 'visible'); 921 } 922 } 923 }, 924 menuScrollRefreshData: function($sub) { 925 var data = $sub.dataSM('scroll'), 926 upEnd = $(window).scrollTop() - $sub.dataSM('parent-a').offset().top - data.itemH; 927 if (this.cssTransforms3d) { 928 upEnd = -(parseFloat($sub.css('margin-top')) - upEnd); 929 } 930 $.extend(data, { 931 upEnd: upEnd, 932 downEnd: upEnd + this.getViewportHeight() - data.subH 933 }); 934 }, 935 menuScrollStop: function($sub) { 936 if (this.scrollTimeout) { 937 cancelAnimationFrame(this.scrollTimeout); 938 this.scrollTimeout = 0; 939 $sub.dataSM('scroll').step = 1; 940 return true; 941 } 942 }, 943 menuScrollTouch: function($sub, e) { 944 e = e.originalEvent; 945 if (isTouchEvent(e)) { 946 var touchPoint = this.getTouchPoint(e); 947 // neglect event if we touched a visible deeper level sub menu 948 if (this.getClosestMenu(touchPoint.target) == $sub[0]) { 949 var data = $sub.dataSM('scroll'); 950 if (/(start|down)$/i.test(e.type)) { 951 if (this.menuScrollStop($sub)) { 952 // if we were scrolling, just stop and don't activate any link on the first touch 953 e.preventDefault(); 954 this.$touchScrollingSub = $sub; 955 } else { 956 this.$touchScrollingSub = null; 957 } 958 // update scroll data since the user might have zoomed, etc. 959 this.menuScrollRefreshData($sub); 960 // extend it with the touch properties 961 $.extend(data, { 962 touchStartY: touchPoint.pageY, 963 touchStartTime: e.timeStamp 964 }); 965 } else if (/move$/i.test(e.type)) { 966 var prevY = data.touchY !== undefined ? data.touchY : data.touchStartY; 967 if (prevY !== undefined && prevY != touchPoint.pageY) { 968 this.$touchScrollingSub = $sub; 969 var up = prevY < touchPoint.pageY; 970 // changed direction? reset... 971 if (data.up !== undefined && data.up != up) { 972 $.extend(data, { 973 touchStartY: touchPoint.pageY, 974 touchStartTime: e.timeStamp 975 }); 976 } 977 $.extend(data, { 978 up: up, 979 touchY: touchPoint.pageY 980 }); 981 this.menuScroll($sub, true, Math.abs(touchPoint.pageY - prevY)); 982 } 983 e.preventDefault(); 984 } else { // touchend/pointerup 985 if (data.touchY !== undefined) { 986 if (data.momentum = Math.pow(Math.abs(touchPoint.pageY - data.touchStartY) / (e.timeStamp - data.touchStartTime), 2) * 15) { 987 this.menuScrollStop($sub); 988 this.menuScroll($sub); 989 e.preventDefault(); 990 } 991 delete data.touchY; 992 } 993 } 994 } 995 } 996 }, 997 menuShow: function($sub) { 998 if (!$sub.dataSM('beforefirstshowfired')) { 999 $sub.dataSM('beforefirstshowfired', true); 1000 if (this.$root.triggerHandler('beforefirstshow.smapi', $sub[0]) === false) { 1001 return; 1002 } 1003 } 1004 if (this.$root.triggerHandler('beforeshow.smapi', $sub[0]) === false) { 1005 return; 1006 } 1007 $sub.dataSM('shown-before', true); 1008 if (canAnimate) { 1009 $sub.stop(true, true); 1010 } 1011 if (!$sub.is(':visible')) { 1012 // highlight parent item 1013 var $a = $sub.dataSM('parent-a'), 1014 collapsible = this.isCollapsible(); 1015 if (this.opts.keepHighlighted || collapsible) { 1016 $a.addClass('highlighted'); 1017 } 1018 if (collapsible) { 1019 $sub.removeClass('sm-nowrap').css({ zIndex: '', width: 'auto', minWidth: '', maxWidth: '', top: '', left: '', marginLeft: '', marginTop: '' }); 1020 } else { 1021 // set z-index 1022 $sub.css('z-index', this.zIndexInc = (this.zIndexInc || this.get
1022StartZIndex()) + 1); 1023 // min/max-width fix - no way to rely purely on CSS as all UL's are nested 1024 if (this.opts.subMenusMinWidth || this.opts.subMenusMaxWidth) { 1025 $sub.css({ width: 'auto', minWidth: '', maxWidth: '' }).addClass('sm-nowrap'); 1026 if (this.opts.subMenusMinWidth) { 1027 $sub.css('min-width', this.opts.subMenusMinWidth); 1028 } 1029 if (this.opts.subMenusMaxWidth) { 1030 var noMaxWidth = this.getWidth($sub); 1031 $sub.css('max-width', this.opts.subMenusMaxWidth); 1032 if (noMaxWidth > this.getWidth($sub)) { 1033 $sub.removeClass('sm-nowrap').css('width', this.opts.subMenusMaxWidth); 1034 } 1035 } 1036 } 1037 this.menuPosition($sub); 1038 } 1039 var complete = function() { 1040 // fix: "overflow: hidden;" is not reset on animation complete in jQuery < 1.9.0 in Chrome when global "box-sizing: border-box;" is used 1041 $sub.css('overflow', ''); 1042 }; 1043 // if sub is collapsible (mobile view) 1044 if (collapsible) { 1045 if (canAnimate && this.opts.collapsibleShowFunction) { 1046 this.opts.collapsibleShowFunction.call(this, $sub, complete); 1047 } else { 1048 $sub.show(this.opts.collapsibleShowDuration, complete); 1049 } 1050 } else { 1051 if (canAnimate && this.opts.showFunction) { 1052 this.opts.showFunction.call(this, $sub, complete); 1053 } else { 1054 $sub.show(this.opts.showDuration, complete); 1055 } 1056 } 1057 // accessibility 1058 $a.attr('aria-expanded', 'true'); 1059 $sub.attr({ 1060 'aria-expanded': 'true', 1061 'aria-hidden': 'false' 1062 }); 1063 // store sub menu in visible array 1064 this.visibleSubMenus.push($sub); 1065 this.$root.triggerHandler('show.smapi', $sub[0]); 1066 } 1067 }, 1068 popupHide: function(noHideTimeout) { 1069 if (this.hideTimeout) { 1070 clearTimeout(this.hideTimeout); 1071 this.hideTimeout = 0; 1072 } 1073 var self = this; 1074 this.hideTimeout = setTimeout(function() { 1075 self.menuHideAll(); 1076 }, noHideTimeout ? 1 : this.opts.hideTimeout); 1077 }, 1078 popupShow: function(left, top) { 1079 if (!this.opts.isPopup) { 1080 alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'); 1081 return; 1082 } 1083 if (this.hideTimeout) { 1084 clearTimeout(this.hideTimeout); 1085 this.hideTimeout = 0; 1086 } 1087 this.$root.dataSM('shown-before', true); 1088 if (canAnimate) { 1089 this.$root.stop(true, true); 1090 } 1091 if (!this.$root.is(':visible')) { 1092 this.$root.css({ left: left, top: top }); 1093 // show menu 1094 var self = this, 1095 complete = function() { 1096 self.$root.css('overflow', ''); 1097 }; 1098 if (canAnimate && this.opts.showFunction) { 1099 this.opts.showFunction.call(this, this.$root, complete); 1100 } else { 1101 this.$root.show(this.opts.showDuration, complete); 1102 } 1103 this.visibleSubMenus[0] = this.$root; 1104 } 1105 }, 1106 refresh: function() { 1107 this.destroy(true); 1108 this.init(true); 1109 }, 1110 rootKeyDown: function(e) { 1111 if (!this.handleEvents()) { 1112 return; 1113 } 1114 switch (e.keyCode) { 1115 case 27: // reset on Esc 1116 var $activeTopItem = this.activatedItems[0]; 1117 if ($activeTopItem) { 1118 this.menuHideAll(); 1119 $activeTopItem[0].focus(); 1120 var $sub = $activeTopItem.dataSM('sub'); 1121 if ($sub) { 1122 this.menuHide($sub); 1123 } 1124 } 1125 break; 1126 case 32: // activate item's sub on Space 1127 var $target = $(e.target); 1128 if ($target.is('a') && this.handleItemEvents($target)) { 1129 var $sub = $target.dataSM('sub'); 1130 if ($sub && !$sub.is(':visible')) { 1131 this.itemClick({ currentTarget: e.target }); 1132 e.preventDefault(); 1133 } 1134 } 1135 break; 1136 } 1137 }, 1138 rootOut: function(e) { 1139 if (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) { 1140 return; 1141 } 1142 if (this.hideTimeout) { 1143 clearTimeout(this.hideTimeout); 1144 this.hideTimeout = 0; 1145 } 1146 if (!this.opts.showOnClick || !this.opts.hideOnClick) { 1147 var self = this; 1148 this.hideTimeout = setTimeout(function() { self.menuHideAll(); }, this.opts.hideTimeout); 1149 } 1150 }, 1151 rootOver: function(e) { 1152 if (!this.handleEvents() || this.isTouchMode() || e.target == this.$root[0]) { 1153 return; 1154 } 1155 if (this.hideTimeout) { 1156 clearTimeout(this.hideTimeout); 1157 this.hideTimeout = 0; 1158 } 1159 }, 1160 winResize: function(e) { 1161 if (!this.handleEvents()) { 1162 // we still need to resize the disable overlay if it's visible 1163 if (this.$disableOverlay) { 1164 var pos = this.$root.offset(); 1165 this.$disableOverlay.css({ 1166 top: pos.top, 1167 left: pos.left, 1168 width: this.$root.outerWidth(), 1169 height: this.$root.outerHeight() 1170 }); 1171 } 1172 return; 1173 } 1174 // hide sub menus on resize - on mobile do it only on orientation change 1175 if (!('onorientationchange' in window) || e.type == 'orientationchange') { 1176 var collapsible = this.isCollapsible(); 1177 // if it was collapsible before resize and still is, don't do it 1178 if (!(this.wasCollapsible && collapsible)) { 1179 if (this.activatedItems.length) { 1180 this.activatedItems[this.activatedItems.length - 1][0].blur(); 1181 } 1182 this.menuHideAll(); 1183 } 1184 this.wasCollapsible = collapsible; 1185 } 1186 } 1187 } 1188 }); 1189 1190 $.fn.dataSM = function(key, val) { 1191 if (val) { 1192 return this.data(key + '_smartmenus', val); 1193 } 1194 return this.data(key + '_smartmenus'); 1195 }; 1196 1197 $.fn.removeDataSM = function(key) { 1198 return this.removeData(key + '_smartmenus'); 1199 }; 1200 1201 $.fn.smartmenus = function(options) { 1202 if (typeof options == 'string') { 1203 var args = arguments, 1204 method = options; 1205 Array.prototype.shift.call(args); 1206 return this.each(function() { 1207 var smartmenus = $(this).data('smartmenus'); 1208 if (smartmenus && smartmenus[method]) { 1209 smartmenus[method].apply(smartmenus, args); 1210 } 1211 }); 1212 } 1213 return this.each(function() { 1214 // [data-sm-options] attribute on the root UL 1215 var dataOpts = $(this).data('sm-options') || null; 1216 if (dataOpts) { 1217 try { 1218 dataOpts = eval('(' + dataOpts + ')'); 1219 } catch(e) { 1220 dataOpts = null;
1221 alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.'); 1222 }; 1223 } 1224 new $.SmartMenus(this, $.extend({}, $.fn.smartmenus.defaults, options, dataOpts)); 1225 }); 1226 }; 1227 1228 // default settings 1229 $.fn.smartmenus.defaults = { 1230 isPopup: false, // is this a popup menu (can be shown via the popupShow/popupHide methods) or a permanent menu bar 1231 mainMenuSubOffsetX: 0, // pixels offset from default position 1232 mainMenuSubOffsetY: 0, // pixels offset from default position 1233 subMenusSubOffsetX: 0, // pixels offset from default position 1234 subMenusSubOffsetY: 0, // pixels offset from default position 1235 subMenusMinWidth: '10em', // min-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored 1236 subMenusMaxWidth: '20em', // max-width for the sub menus (any CSS unit) - if set, the fixed width set in CSS will be ignored 1237 subIndicators: true, // create sub menu indicators - creates a SPAN and inserts it in the A 1238 subIndicatorsPos: 'append', // position of the SPAN relative to the menu item content ('append', 'prepend') 1239 subIndicatorsText: '', // [optionally] add text in the SPAN (e.g. '+') (you may want to check the CSS for the sub indicators too) 1240 scrollStep: 30, // pixels step when scrolling long sub menus that do not fit in the viewport height 1241 scrollAccelerate: true, // accelerate scrolling or use a fixed step 1242 showTimeout: 250, // timeout before showing the sub menus 1243 hideTimeout: 500, // timeout before hiding the sub menus 1244 showDuration: 0, // duration for show animation - set to 0 for no animation - matters only if showFunction:null 1245 showFunction: null, // custom function to use when showing a sub menu (the default is the jQuery 'show') 1246 // don't forget to call complete() at the end of whatever you do 1247 // e.g.: function($ul, complete) { $ul.fadeIn(250, complete); } 1248 hideDuration: 0, // duration for hide animation - set to 0 for no animation - matters only if hideFunction:null 1249 hideFunction: function($ul, complete) { $ul.fadeOut(200, complete); }, // custom function to use when hiding a sub menu (the default is the jQuery 'hide') 1250 // don't forget to call complete() at the end of whatever you do 1251 // e.g.: function($ul, complete) { $ul.fadeOut(250, complete); } 1252 collapsibleShowDuration:0, // duration for show animation for collapsible sub menus - matters only if collapsibleShowFunction:null 1253 collapsibleShowFunction:function($ul, complete) { $ul.slideDown(200, complete); }, // custom function to use when showing a collapsible sub menu 1254 // (i.e. when mobile styles are used to make the sub menus collapsible) 1255 collapsibleHideDuration:0, // duration for hide animation for collapsible sub menus - matters only if collapsibleHideFunction:null 1256 collapsibleHideFunction:function($ul, complete) { $ul.slideUp(200, complete); }, // custom function to use when hiding a collapsible sub menu 1257 // (i.e. when mobile styles are used to make the sub menus collapsible) 1258 showOnClick: false, // show the first-level sub menus onclick instead of onmouseover (i.e. mimic desktop app menus) (matters only for mouse input) 1259 hideOnClick: true, // hide the sub menus on click/tap anywhere on the page 1260 noMouseOver: false, // disable sub menus activation onmouseover (i.e. behave like in touch mode - use just mouse clicks) (matters only for mouse input) 1261 keepInViewport: true, // reposition the sub menus if needed to make sure they always appear inside the viewport 1262 keepHighlighted: true, // keep all ancestor items of the current sub menu highlighted (adds the 'highlighted' class to the A's) 1263 markCurrentItem: false, // automatically add the 'current' class to the A element of the item linking to the current URL 1264 markCurrentTree: true, // add the 'current' class also to the A elements of all ancestor items of the current item 1265 rightToLeftSubMenus: false, // right to left display of the sub menus (check the CSS for the sub indicators' position) 1266 bottomToTopSubMenus: false, // bottom to top display of the sub menus 1267 collapsibleBehavior: 'default' // parent items behavior in collapsible (mobile) view ('default', 'toggle', 'link', 'accordion', 'accordion-toggle', 'accordion-link') 1268 // 'default' - first tap on parent item expands sub, second tap loads its link 1269 // 'toggle' - the whole parent item acts just as a toggle button for its sub menu (expands/collapses on each tap) 1270 // 'link' - the parent item acts as a regular item (first tap loads its link), the sub menu can be expanded only via the +/- button 1271 // 'accordion' - like 'default' but on expand also resets any visible sub menus from deeper levels or other branches 1272 // 'accordion-toggle' - like 'toggle' but on expand also resets any visible sub menus from deeper levels or other branches 1273 // 'accordion-link' - like 'link' but on expand also resets any visible sub menus from deeper levels or other branches 1274 }; 1275 1276 return $; 1277}));; 1278/*! 1279 * SmartMenus jQuery Plugin Keyboard Addon - v0.4.0 - September 17, 2017 1280 * http://www.smartmenus.org/ 1281 * 1282 * Copyright Vasil Dinkov, Vadikom Web Ltd. 1283 * http://vadikom.com 1284 * 1285 * Licensed MIT 1286 */ 1287 1288(function(factory) { 1289 if (typeof define === 'function' && define.amd) { 1290 // AMD 1291 define(['jquery', 'smartmenus'], factory); 1292 } else if (typeof module === 'object' && typeof module.exports === 'object') { 1293 // CommonJS 1294 module.exports = factory(require('jquery')); 1295 } else { 1296 // Global jQuery 1297 factory(jQuery); 1298 } 1299} (function($) { 1300 1301 function getFirstItemLink($ul) { 1302 // make sure we also allow the link to be nested deeper inside the LI's (e.g. in a heading) 1303 return $ul.find('> li > a:not(.disabled), > li > :not(ul) a:not(.disabled)').eq(0); 1304 } 1305 function getLastItemLink($ul) { 1306 return $ul.find('> li > a:not(.disabled), > li > :not(ul) a:not(.disabled)').eq(-1); 1307 } 1308 function getNextItemLink($li, noLoop) { 1309 var $a = $li.nextAll('li').find('> a:not(.disabled), > :not(ul) a:not(.disabled)').eq(0); 1310 return noLoop || $a.length ? $a : getFirstItemLink($li.parent()); 1311 } 1312 function getPreviousItemLink($li, noLoop) { 1313 // bug workaround: elements are returned in reverse order just in jQuery 1.8.x 1314 var $a = $li.prevAll('li').find('> a:not(.disabled), > :not(ul) a:not(.disabled)').eq(/^1\.8\./.test($.fn.jquery) ? 0 : -1); 1315 return noLoop || $a.length ? $a : getLastItemLink($li.parent()); 1316 } 1317
1318 // jQuery's .focus() is unreliable in some versions, so we're going to call the links' native JS focus method 1319 $.fn.focusSM = function() { 1320 if (this.length && this[0].focus) { 1321 this[0].focus(); 1322 } 1323 return this; 1324 }; 1325 1326 $.extend($.SmartMenus.Keyboard = {}, { 1327 docKeydown: function(e) { 1328 var keyCode = e.keyCode; 1329 if (!/^(37|38|39|40)$/.test(keyCode)) { 1330 return; 1331 } 1332 var $root = $(this), 1333 obj = $root.data('smartmenus'), 1334 $target = $(e.target); 1335 // exit if this is an A inside a mega drop-down 1336 if (!obj || !$target.is('a') || !obj.handleItemEvents($target)) { 1337 return; 1338 } 1339 var $li = $target.closest('li'), 1340 $ul = $li.parent(), 1341 level = $ul.dataSM('level'); 1342 // swap left & right keys 1343 if ($root.hasClass('sm-rtl')) { 1344 if (keyCode == 37) { 1345 keyCode = 39; 1346 } else if (keyCode == 39) { 1347 keyCode = 37; 1348 } 1349 } 1350 switch (keyCode) { 1351 case 37: // Left 1352 if (obj.isCollapsible()) { 1353 break; 1354 } 1355 if (level > 2 || level == 2 && $root.hasClass('sm-vertical')) { 1356 obj.activatedItems[level - 2].focusSM(); 1357 // move to previous non-disabled parent item (make sure we cycle so it might be the last item) 1358 } else if (!$root.hasClass('sm-vertical')) { 1359 getPreviousItemLink((obj.activatedItems[0] || $target).closest('li')).focusSM(); 1360 } 1361 break; 1362 case 38: // Up 1363 if (obj.isCollapsible()) { 1364 var $firstItem; 1365 // if this is the first item of a sub menu, move to the parent item 1366 if (level > 1 && ($firstItem = getFirstItemLink($ul)).length && $target[0] == $firstItem[0]) { 1367 obj.activatedItems[level - 2].focusSM(); 1368 } else { 1369 getPreviousItemLink($li).focusSM(); 1370 } 1371 } else { 1372 if (level == 1 && !$root.hasClass('sm-vertical') && obj.opts.bottomToTopSubMenus) { 1373 if (!obj.activatedItems[0] && $target.dataSM('sub')) { 1374 if (obj.opts.showOnClick) { 1375 obj.clickActivated = true; 1376 } 1377 obj.itemActivate($target); 1378 if ($target.dataSM('sub').is(':visible')) { 1379 obj.focusActivated = true; 1380 } 1381 } 1382 if (obj.activatedItems[0] && obj.activatedItems[0].dataSM('sub') && obj.activatedItems[0].dataSM('sub').is(':visible') && !obj.activatedItems[0].dataSM('sub').hasClass('mega-menu')) { 1383 getLastItemLink(obj.activatedItems[0].dataSM('sub')).focusSM(); 1384 } 1385 } else if (level > 1 || $root.hasClass('sm-vertical')) { 1386 getPreviousItemLink($li).focusSM(); 1387 } 1388 } 1389 break; 1390 case 39: // Right 1391 if (obj.isCollapsible()) { 1392 break; 1393 } 1394 if (level == 1 && $root.hasClass('sm-vertical')) { 1395 if (!obj.activatedItems[0] && $target.dataSM('sub')) { 1396 if (obj.opts.showOnClick) { 1397 obj.clickActivated = true; 1398 } 1399 obj.itemActivate($target); 1400 if ($target.dataSM('sub').is(':visible')) { 1401 obj.focusActivated = true; 1402 } 1403 } 1404 if (obj.activatedItems[0] && obj.activatedItems[0].dataSM('sub') && obj.activatedItems[0].dataSM('sub').is(':visible') && !obj.activatedItems[0].dataSM('sub').hasClass('mega-menu')) { 1405 getFirstItemLink(obj.activatedItems[0].dataSM('sub')).focusSM(); 1406 } 1407 // move to next non-disabled parent item (make sure we cycle so it might be the last item) 1408 } else if ((level == 1 || obj.activatedItems[level - 1] && (!obj.activatedItems[level - 1].dataSM('sub') || !obj.activatedItems[level - 1].dataSM('sub').is(':visible') || obj.activatedItems[level - 1].dataSM('sub').hasClass('mega-menu'))) && !$root.hasClass('sm-vertical')) { 1409 getNextItemLink((obj.activatedItems[0] || $target).closest('li')).focusSM(); 1410 } else if (obj.activatedItems[level - 1] && obj.activatedItems[level - 1].dataSM('sub') && obj.activatedItems[level - 1].dataSM('sub').is(':visible') && !obj.activatedItems[level - 1].dataSM('sub').hasClass('mega-menu')) { 1411 getFirstItemLink(obj.activatedItems[level - 1].dataSM('sub')).focusSM(); 1412 } 1413 break; 1414 case 40: // Down 1415 if (obj.isCollapsible()) { 1416 var $firstSubItem, 1417 $lastItem; 1418 // move to sub menu if appropriate 1419 if (obj.activatedItems[level - 1] && obj.activatedItems[level - 1].dataSM('sub') && obj.activatedItems[level - 1].dataSM('sub').is(':visible') && !obj.activatedItems[level - 1].dataSM('sub').hasClass('mega-menu') && ($firstSubItem = getFirstItemLink(obj.activatedItems[level - 1].dataSM('sub'))).length) { 1420 $firstSubItem.focusSM(); 1421 // if this is the last item of a sub menu, move to the next parent item 1422 } else if (level > 1 && ($lastItem = getLastItemLink($ul)).length && $target[0] == $lastItem[0]) { 1423 var $parentItem = obj.activatedItems[level - 2].closest('li'), 1424 $nextParentItem = null; 1425 while ($parentItem.is('li') && !($nextParentItem = getNextItemLink($parentItem, true)).length) { 1426 $parentItem = $parentItem.parent().parent(); 1427 } 1428 if ($nextParentItem.length) { 1429 $nextParentItem.focusSM(); 1430 } else { 1431 getFirstItemLink($root).focusSM(); 1432 } 1433 } else { 1434 getNextItemLink($li).focusSM(); 1435 } 1436 } else { 1437 if (level == 1 && !$root.hasClass('sm-vertical') && !obj.opts.bottomToTopSubMenus) { 1438 if (!obj.activatedItems[0] && $target.dataSM('sub')) { 1439 if (obj.opts.showOnClick) { 1440 obj.clickActivated = true; 1441 } 1442 obj.itemActivate($target); 1443 if ($target.dataSM('sub').is(':visible')) { 1444 obj.focusActivated = true; 1445 } 1446 } 1447 if (obj.activatedItems[0] && obj.activatedItems[0].dataSM('sub') && obj.activatedItems[0].dataSM('sub').is(':visible') && !obj.activatedItems[0].dataSM('sub').hasClass('mega-menu')) { 1448 getFirstItemLink(obj.activatedItems[0].dataSM('sub')).focusSM(); 1449 } 1450 } else if (level > 1 || $root.hasClass('sm-vertical')) { 1451 getNextItemLink($li).focusSM(); 1452 } 1453 } 1454 break; 1455 } 1456 e.stopPropagation(); 1457 e.preventDefault(); 1458 } 1459 }); 1460 1461 // hook it 1462 $(document).on('keydown.smartmenus', 'ul.sm, ul.navbar-nav:not([data-sm-skip])', $.SmartMenus.Keyboard.docKeydown); 1463 1464 $.extend($.SmartMenus.prototype, { 1465 keyboardSetHotkey: function(keyCode, modifiers) { 1466 var self = this; 1467 $(document).on('keydown.smartmenus' + this.rootId, function(e) { 1468 if (keyCode == e.keyCode) { 1469 var procede = true; 1470 if (modifiers) { 1471 if (typeof modifiers == 'string') { 1472 modifiers = [modifiers]; 1473 } 1474 $.each(['ctrlKey', 'shiftKey', 'altKey', 'metaKey'], function(index, value) { 1475 if ($.inArray(value, modifiers) >= 0 && !e[value] || $.inArray(value, modifiers) < 0 && e[value]) { 1476 procede = false;
1477 return false; 1478 } 1479 }); 1480 } 1481 if (procede) { 1482 getFirstItemLink(self.$root).focusSM(); 1483 e.stopPropagation(); 1484 e.preventDefault(); 1485 } 1486 } 1487 }); 1488 } 1489 }); 1490 1491 return $; 1492}));; 1493(function ($) { 1494 1495/** 1496 * Retrieves the summary for the first element. 1497 */ 1498$.fn.backdropGetSummary = function () { 1499 var callback = this.data('summaryCallback'); 1500 var returnValue = (this[0] && callback) ? callback(this[0]) : ''; 1501 return typeof returnValue === 'string' ? returnValue.trim() : ''; 1502}; 1503 1504/** 1505 * Sets the summary for all matched elements. 1506 * 1507 * @param callback 1508 * Either a function that will be called each time the summary is 1509 * retrieved or a string (which is returned each time). 1510 */ 1511$.fn.backdropSetSummary = function (callback) { 1512 var self = this; 1513 1514 // To facilitate things, the callback should always be a function. If it's 1515 // not, we wrap it into an anonymous function which just returns the value. 1516 if (typeof callback != 'function') { 1517 var val = callback; 1518 callback = function () { return val; }; 1519 } 1520 1521 return this 1522 .data('summaryCallback', callback) 1523 // To prevent duplicate events, the handlers are first removed and then 1524 // (re-)added. 1525 .off('formUpdated.summary') 1526 .on('formUpdated.summary', function () { 1527 self.trigger('summaryUpdated'); 1528 }) 1529 // The actual summaryUpdated handler doesn't fire when the callback is 1530 // changed, so we have to do this manually. 1531 .trigger('summaryUpdated'); 1532}; 1533 1534/** 1535 * Sends a 'formUpdated' event each time a form element is modified. 1536 */ 1537Backdrop.behaviors.formUpdated = { 1538 attach: function (context) { 1539 // These events are namespaced so that we can remove them later. 1540 var events = 'change.formUpdated click.formUpdated blur.formUpdated keyup.formUpdated'; 1541 $(context) 1542 // Since context could be an input element itself, it's added back to 1543 // the jQuery object and filtered again. 1544 .find(':input').addBack().filter(':input') 1545 // To prevent duplicate events, the handlers are first removed and then 1546 // (re-)added. 1547 .off(events).on(events, function () { 1548 $(this).trigger('formUpdated'); 1549 }); 1550 } 1551}; 1552 1553/** 1554 * Prevents consecutive form submissions of identical form values. 1555 * 1556 * Repetitive form submissions that would submit the identical form values are 1557 * prevented, unless the form values are different from the previously 1558 * submitted values. 1559 * 1560 * This is a simplified re-implementation of a user-agent behavior that should 1561 * be natively supported by major web browsers, but at this time, only Firefox 1562 * has a built-in protection. 1563 * 1564 * A form value-based approach ensures that the constraint is triggered for 1565 * consecutive, identical form submissions only. Compared to that, a form 1566 * button-based approach would (1) rely on [visible] buttons to exist where 1567 * technically not required and (2) require more complex state management if 1568 * there are multiple buttons in a form. 1569 * 1570 * This implementation is based on form-level submit events only, and relies on 1571 * jQuery's serialize() method to determine submitted form values. As such, the 1572 * following limitations exist: 1573 * 1574 * - Event handlers on form buttons that preventDefault() do not receive a 1575 * double-submit protection. That is deemed to be fine, since such button 1576 * events typically trigger reversible client-side or server-side operations 1577 * that are local to the context of a form only. 1578 * - Changed values in advanced form controls, such as file inputs, are not part 1579 * of the form values being compared between consecutive form submits (due to 1580 * limitations of jQuery.serialize()). That is deemed to be acceptable, 1581 * because if the user forgot to attach a file, then the size of HTTP payload 1582 * will most likely be small enough to be fully passed to the server endpoint 1583 * within (milli)seconds. If a user mistakenly attached a wrong file and is 1584 * technically versed enough to cancel the form submission (and HTTP payload) 1585 * in order to attach a different file, then that edge-case is not supported 1586 * here. 1587 * 1588 * Lastly, all forms submitted via HTTP GET are idempotent by definition of HTTP 1589 * standards, so excluded in this implementation. 1590 */ 1591Backdrop.behaviors.formSingleSubmit = { 1592 attach: function () { 1593 function onFormSubmit (e) { 1594 // Prevent this from firing multiple times per request. 1595 e.stopImmediatePropagation(); 1596 if (e.isDefaultPrevented()) { 1597 // Don't act on form submissions that have been prevented by other JS. 1598 return; 1599 } 1600 var $form = $(e.currentTarget); 1601 var formValues = $form.serialize(); 1602 var previousValues = $form.attr('data-backdrop-form-submit-last'); 1603 if (previousValues === formValues) { 1604 e.preventDefault(); 1605 } 1606 else { 1607 $form.attr('data-backdrop-form-submit-last', formValues); 1608 } 1609 } 1610 1611 $('body').once('form-single-submit') 1612 .on('submit.singleSubmit', 'form:not([method~="GET"])', onFormSubmit); 1613 1614 } 1615}; 1616 1617/** 1618 * Prepopulate form fields with information from the visitor cookie. 1619 */ 1620Backdrop.behaviors.fillUserInfoFromCookie = { 1621 attach: function (context, settings) { 1622 $('form.user-info-from-cookie').once('user-info-from-cookie', function () { 1623 var formContext = this; 1624 $.each(['name', 'mail', 'homepage'], function () { 1625 var $element = $('[name=' + this + ']', formContext); 1626 var cookie = $.cookie('Backdrop.visitor.' + this); 1627 if ($element.length && cookie) { 1628 $element.val(cookie); 1629 } 1630 }); 1631 }); 1632 } 1633}; 1634 1635})(jQuery); 1636;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.