Firstly, we'd like to express deepest appreciation to the community that makes open-source projects possible.
The contributions, feedback, and support from various individuals and organizations are invaluable, and have played an integral part in the development and refinement of jest-allure2-reporter.
Those icons have been licensed under the Creative Commons Attribution 3.0 Unported license, and hereby we express our gratitude to the creators for making them available to the public.
Finally, a big thank you to everyone who has used, contributed to, or otherwise supported Jest Allure 2 Reporter. Your feedback and support are incredibly valuable and greatly appreciated.
Finally, a big thank you to everyone who has used, contributed to, or otherwise supported Jest Allure 2 Reporter. Your feedback and support are incredibly valuable and greatly appreciated.
"))}},9237:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return o}});var r=n(566);function o(t,e){return r.Ay.t(t,e?e.hash:{})}},6827:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return a}});var r=n(3633),o=/((?:(https?:\/\/|ftp:\/\/|mailto:)|www\.)\S+?)(\s|"|'|\)|]|}|>|$)/gm,i=function(t){return t.replace(/[\u00A0-\u9999<>&]/gim,(function(t){return"".concat(t.charCodeAt(0),";")}))};function a(t){return void 0!==t&&t.match(o)?new r.SafeString(i(t).replace(o,(function(t,e,n,r){return'').concat(e,"").concat(r," ")}))):t}},4336:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return i}});var r=n(7777),o=n.n(r);function i(t,e){return t?(t instanceof Date||(t=new Date(t)),"boolean"!=typeof e&&(e=!1),[t.getHours(),o()(t.getMinutes(),2,"0"),o()(t.getSeconds(),2,"0")+(e?".".concat(t.getMilliseconds()):"")].join(":")):"unknown"}},8563:function(t,e,n){"use strict";n.d(e,{A:function(){return et}});var r,o,i,a,s=n(3029),l=n(2901),u=n(388),c=n(3954),h=n(5361),f=n(4467),p=n(8603),d=n(2319),m=n(793),g=n(3633),v=n(4523),y=n(2854),b=n(734),w=n(8681),_=n(1248),x=n(566),k=n(991),A=n(4838),O=n(9922),E=n(4692),C=n.n(E),S=n(4965),P=n.n(S);function j(t,e,n){return e=(0,c.A)(e),(0,u.A)(t,T()?Reflect.construct(e,n||[],(0,c.A)(t).constructor):e.apply(t,n))}function T(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(T=function(){return!!t})()}var R,M,N,D,B,V,I,L,z=(r=(0,y.s7)("language-select popover"),o=(0,y.on)("click .language-select__item"),r((a=function(t){function e(){return(0,s.A)(this,e),j(this,e,arguments)}return(0,h.A)(e,t),(0,l.A)(e,[{key:"initialize",value:function(){(0,k.A)((0,c.A)(e.prototype),"initialize",this).call(this,{position:"right"})}},{key:"setContent",value:function(){this.$el.html(P()({languages:x.Yj,currentLang:_.A.getLanguage()}))}},{key:"show",value:function(t){var n=this;(0,k.A)((0,c.A)(e.prototype),"show",this).call(this,null,t),this.delegateEvents(),setTimeout((function(){C()(document).one("click",(function(){return n.hide()}))}))}},{key:"onLanguageClick",value:function(t){var e=this.$(t.currentTarget).data("id");_.A.setLanguage(e),x.Ay.changeLanguage(e),(0,O.A)("language_change",{language:e})}}])}(A.A),(0,m.A)(a.prototype,"onLanguageClick",[o],Object.getOwnPropertyDescriptor(a.prototype,"onLanguageClick"),a.prototype),i=a))||i),$=z,F=n(3678),U=n(9409),H=n.n(U);function q(t,e,n){return e=(0,c.A)(e),(0,u.A)(t,W()?Reflect.construct(e,n||[],(0,c.A)(t).constructor):e.apply(t,n))}function W(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(W=function(){return!!t})()}var G,K=(R=(0,y.s7)("side-nav"),M=(0,y.on)("mouseenter [data-tooltip]"),N=(0,y.on)("mouseleave [data-tooltip]"),D=(0,y.on)("click .side-nav__collapse"),B=(0,y.on)("click .side-nav__language"),V=(0,y.on)("click .side-nav__language-small"),R((L=function(t){function e(){var t;(0,s.A)(this,e);for(var n=arguments.length,r=new Array(n),o=0;o9999?"+"+l(e,6):l(e,4))+"-"+l(t.getUTCMonth()+1,2)+"-"+l(t.getUTCDate(),2)+(i?"T"+l(n,2)+":"+l(r,2)+":"+l(o,2)+"."+l(i,3)+"Z":o?"T"+l(n,2)+":"+l(r,2)+":"+l(o,2)+"Z":r||n?"T"+l(n,2)+":"+l(r,2)+"Z":"")}function c(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,a=[],s=t.length,l=0,u=0,c=s<=0,h=!1;function f(){if(c)return i;if(h)return h=!1,o;var e,r,a=l;if(34===t.charCodeAt(a)){for(;l++=s?c=!0:10===(r=t.charCodeAt(l++))?h=!0:13===r&&(h=!0,10===t.charCodeAt(l)&&++l),t.slice(a+1,e-1).replace(/""/g,'"')}for(;l0})).map((function(t){return{comment:0===t.indexOf("#"),text:t}}))}};case"application/x-tar":case"application/x-gtar":case"application/x-bzip2":case"application/gzip":case"application/zip":return{type:"archive",icon:"fa fa-file-archive-o"};default:return{type:null,icon:"fa fa-file-o"}}}},2415:function(t){"use strict";t.exports=function(t){var e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.contain="strict",e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt";var n=getSelection(),r=!1;n.rangeCount>0&&(r=n.getRangeAt(0)),document.body.appendChild(e),e.select();var o=!1;try{o=document.execCommand("copy")}catch(t){}return document.body.removeChild(e),r&&(n.removeAllRanges(),n.addRange(r)),o}},9922:function(t,e,n){"use strict";function r(t,e){!function(){window.dataLayer=Array.isArray(window.dataLayer)?window.dataLayer:[],window.dataLayer.push(arguments)}("event",t,e)}n.d(e,{A:function(){return r}})},8681:function(t,e,n){"use strict";n.d(e,{A:function(){return x}});var r=n(3029),o=n(2901),i=n(4467),a=n(4755),s=n(388),l=n(991),u=n(3954),c=n(5361),h=n(1391),f=n(5193);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=e.title,r=e.icon,o=e.route,i=e.onEnter,s=void 0===i?a.mX:i;n=n||t,this.tabs.push({tabName:t,title:n,icon:r}),b.A.route(o,t),b.A.on("route:".concat(t),(0,a.nZ)(s))}},{key:"addWidget",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:v;this.widgets[t]||(this.widgets[t]={}),this.widgets[t][e]={widget:n,model:r}}},{key:"addTranslation",value:function(t,e){(0,w.XY)(t,e)}},{key:"translate",value:function(t,e){return(0,y.default)(t,e)}},{key:"addTestResultBlock",value:function(t,e){var n=e.position;this.testResultBlocks[n].push(t)}},{key:"addAttachmentViewer",value:function(t,e){var n=e.View,r=e.icon,o=void 0===r?"fa fa-file-o":r;this.attachmentViews[t]={View:n,icon:o}}},{key:"addTestResultTab",value:function(t,e,n){this.testResultTabs.push({id:t,name:e,View:n})}}])}(),x=new _},1248:function(t,e,n){"use strict";var r=(0,n(1109).fv)();e.A=r},1109:function(t,e,n){"use strict";n.d(e,{fv:function(){return v},gU:function(){return y},O$:function(){return w},gW:function(){return b}});var r=n(4467),o=n(3029),i=n(2901),a=n(388),s=n(3954),l=n(5361);function u(t,e,n){return e=(0,s.A)(e),(0,a.A)(t,c()?Reflect.construct(e,n||[],(0,s.A)(t).constructor):e.apply(t,n))}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(c=function(){return!!t})()}var h=function(t){function e(){return(0,o.A)(this,e),u(this,e,arguments)}return(0,l.A)(e,t),(0,i.A)(e,[{key:"storageKey",value:function(){return"ALLURE_REPORT_SETTINGS"}},{key:"fetch",value:function(){var t=this;return new Promise((function(e){var n=window.localStorage.getItem(t.storageKey());n&&t.set(JSON.parse(n)),e()}))}},{key:"save",value:function(t,e){this.set(t,e);var n=this.toJSON();window.localStorage.setItem(this.storageKey(),JSON.stringify(n))}}])}(n(1391).Model);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=new(h.extend({storageKey:function(){return"ALLURE_REPORT_SETTINGS_".concat(t.toUpperCase())},defaults:function(){return e}}));return n.fetch(),n}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g,n=new(h.extend({storageKey:function(){return"ALLURE_REPORT_SETTINGS_".concat(t.toUpperCase())},defaults:function(){return e},getWidgetsArrangement:function(){return this.get("widgets")},setWidgetsArrangement:function(t){this.save("widgets",t)}}));return n.fetch(),n}function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m,n=new(h.extend({storageKey:function(){return"ALLURE_REPORT_SETTINGS_".concat(t.toUpperCase())},defaults:function(){return e},getVisibleStatuses:function(){return this.get("visibleStatuses")},setVisibleStatuses:function(t){return this.save("visibleStatuses",t)},getVisibleMarks:function(){return this.get("visibleMarks")},setVisibleMarks:function(t){return this.save("visibleMarks",t)},getTreeSorting:function(){return this.get("treeSorting")},setTreeSorting:function(t){this.save("treeSorting",t)},isShowGroupInfo:function(){return this.get("showGroupInfo")},setShowGroupInfo:function(t){this.save("showGroupInfo",t)}}));return n.fetch(),n}},5731:function(t,e,n){"use strict";n.d(e,{z:function(){return r}});var r=["failed","broken","passed","skipped","unknown"]},566:function(t,e,n){"use strict";n.d(e,{Yj:function(){return rt},XY:function(){return it},Ay:function(){return at},vM:function(){return ot}});var r=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.init(e,n)}return t.prototype.init=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||o,this.options=e,this.debug=e.debug},t.prototype.setDebug=function(t){this.debug=t},t.prototype.log=function(){for(var t=arguments.length,e=Array(t),n=0;n-1&&n.observers[t].splice(r,1)}else delete n.observers[t]}))},t.prototype.emit=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var i="string"!=typeof e?[].concat(e):e.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!t[a]&&n&&(t[a]=new n),t=t[a]}return o()?{}:{obj:t,k:r(i.shift())}}function h(t,e,n){var r=c(t,e,Object);r.obj[r.k]=n}function f(t,e){var n=c(t,e),r=n.obj,o=n.k;if(r)return r[o]}function p(t,e,n){for(var r in e)r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):p(t[r],e[r],n):t[r]=e[r];return t}function d(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var m={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function g(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return m[t]})):t}var v=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return o.data=n,o.options=r,o}return y(e,t),e.prototype.addNamespaces=function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)},e.prototype.removeNamespaces=function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)},e.prototype.getResource=function(t,e,n){var r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).keySeparator||this.options.keySeparator;void 0===r&&(r=".");var o=[t,e];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(r?n.split(r):n)),t.indexOf(".")>-1&&(o=t.split(".")),f(this.data,o)},e.prototype.addResource=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[t,e];n&&(a=a.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(r=e,e=(a=t.split("."))[1]),this.addNamespaces(e),h(this.data,a,r),o.silent||this.emit("added",t,e,n,r)},e.prototype.addResources=function(t,e,n){for(var r in n)"string"==typeof n[r]&&this.addResource(t,e,r,n[r],{silent:!0});this.emit("added",t,e,n)},e.prototype.addResourceBundle=function(t,e,n,r,o){var i=[t,e];t.indexOf(".")>-1&&(r=n,n=e,e=(i=t.split("."))[1]),this.addNamespaces(e);var a=f(this.data,i)||{};r?p(a,n,o):a=v({},a,n),h(this.data,i,a),this.emit("added",t,e,n)},e.prototype.removeResourceBundle=function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)},e.prototype.hasResourceBundle=function(t,e){return void 0!==this.getResource(t,e)},e.prototype.getResourceBundle=function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?v({},this.getResource(t,e)):this.getResource(t,e)},e.prototype.toJSON=function(){return this.data},e}(l),w=b,_={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,o){var i=this;return t.forEach((function(t){i.processors[t]&&(e=i.processors[t].process(e,n,r,o))})),e}};function x(t){return t.interpolation={unescapeSuffix:"HTML"},t.interpolation.prefix=t.interpolationPrefix||"__",t.interpolation.suffix=t.interpolationSuffix||"__",t.interpolation.escapeValue=t.escapeInterpolation||!1,t.interpolation.nestingPrefix=t.reusePrefix||"$t(",t.interpolation.nestingSuffix=t.reuseSuffix||")",t}function k(t){return(t.interpolationPrefix||t.interpolationSuffix||void 0!==t.escapeInterpolation)&&(t=x(t)),t.nsSeparator=t.nsseparator,t.keySeparator=t.keyseparator,t.returnObjects=t.returnObjectTrees,t}var A=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return function(t,e,n){t.forEach((function(t){e[t]&&(n[t]=e[t])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector"],n,o),o.options=r,o.logger=a.create("translator"),o}return E(e,t),e.prototype.changeLanguage=function(t){t&&(this.language=t)},e.prototype.exists=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};return"v1"===this.options.compatibilityAPI&&(e=k(e)),void 0!==this.resolve(t,e)},e.prototype.extractFromKey=function(t,e){var n=e.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var r=e.keySeparator||this.options.keySeparator||".",o=e.ns||this.options.defaultNS;if(n&&t.indexOf(n)>-1){var i=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),t=i.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}},e.prototype.translate=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!==(void 0===e?"undefined":O(e))?e=this.options.overloadTranslationOptionHandler(arguments):"v1"===this.options.compatibilityAPI&&(e=k(e)),null==t||""===t)return"";"number"==typeof t&&(t=String(t)),"string"==typeof t&&(t=[t]);var n=e.keySeparator||this.options.keySeparator||".",r=this.extractFromKey(t[t.length-1],e),o=r.key,i=r.namespaces,a=i[i.length-1],s=e.lng||this.language,l=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase())return l?a+(e.nsSeparator||this.options.nsSeparator)+o:o;var u=this.resolve(t,e),c=Object.prototype.toString.apply(u),h=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays;if(u&&"string"!=typeof u&&["[object Number]","[object Function]","[object RegExp]"].indexOf(c)<0&&(!h||"[object Array]"!==c)){if(!e.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(o,u,e):"key '"+o+" ("+this.language+")' returned an object instead of string.";if(e.keySeparator||this.options.keySeparator){var f="[object Array]"===c?[]:{};for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(f[p]=this.translate(""+o+n+p,A({},e,{joinArrays:!1,ns:i})));u=f}}else if(h&&"[object Array]"===c)(u=u.join(h))&&(u=this.extendTranslation(u,o,e));else{var d=!1,m=!1;if(this.isValidLookup(u)||void 0===e.defaultValue||(d=!0,u=e.defaultValue),this.isValidLookup(u)||(m=!0,u=o),m||d){this.logger.log("missingKey",s,a,o,u);var g=[],v=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&v&&v[0])for(var y=0;y1&&void 0!==arguments[1]?arguments[1]:{},r=void 0;return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!e.isValidLookup(r)){var o=e.extractFromKey(t,n),i=o.key,a=o.namespaces;e.options.fallbackNS&&(a=a.concat(e.options.fallbackNS));var s=void 0!==n.count&&"string"!=typeof n.count,l=void 0!==n.context&&"string"==typeof n.context&&""!==n.context,u=n.lngs?n.lngs:e.languageUtils.toResolveHierarchy(n.lng||e.language);a.forEach((function(t){e.isValidLookup(r)||u.forEach((function(o){if(!e.isValidLookup(r)){var a=i,u=[a],c=void 0;s&&(c=e.pluralResolver.getSuffix(o,n.count)),s&&l&&u.push(a+c),l&&u.push(a+=""+e.options.contextSeparator+n.context),s&&u.push(a+=c);for(var h=void 0;h=u.pop();)e.isValidLookup(r)||(r=e.getResource(o,t,h,n))}}))}))}})),r},e.prototype.isValidLookup=function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)},e.prototype.getResource=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.resourceStore.getResource(t,e,n,r)},e}(l),S=C;function P(t){return t.charAt(0).toUpperCase()+t.slice(1)}var j=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.whitelist=this.options.whitelist||!1,this.logger=a.create("languageUtils")}return t.prototype.getScriptPartFromCode=function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),this.formatLanguageCode(e.join("-")))},t.prototype.getLanguagePartFromCode=function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])},t.prototype.formatLanguageCode=function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=P(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t},t.prototype.isWhitelisted=function(t){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(t=this.getLanguagePartFromCode(t)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(t)>-1},t.prototype.getFallbackCodes=function(t,e){if(!t)return[];if("string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t.default),n||[]},t.prototype.toResolveHierarchy=function(t,e){var n=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),o=[],i=function(t){t&&(n.isWhitelisted(t)?o.push(t):n.logger.warn("rejecting non-whitelisted language code: "+t))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),r.forEach((function(t){o.indexOf(t)<0&&i(n.formatLanguageCode(t))})),o},t}();var T=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","es_ar","et","eu","fi","fo","fur","fy","gl","gu","ha","he","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt","pt_br","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21}],R={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0===t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0===t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0===t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)}};var M=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.languageUtils=e,this.options=r,this.logger=a.create("pluralResolver"),this.rules=(n={},T.forEach((function(t){t.lngs.forEach((function(e){n[e]={numbers:t.nr,plurals:R[t.fc]}}))})),n)}return t.prototype.addRule=function(t,e){this.rules[t]=e},t.prototype.getRule=function(t){return this.rules[this.languageUtils.getLanguagePartFromCode(t)]},t.prototype.needsPlural=function(t){var e=this.getRule(t);return e&&e.numbers.length>1},t.prototype.getSuffix=function(t,e){var n=this,r=this.getRule(t);if(r){if(1===r.numbers.length)return"";var o=r.noAbs?r.plurals(e):r.plurals(Math.abs(e)),i=r.numbers[o];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var a=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_"+i.toString():a():"v2"===this.options.compatibilityJSON||2===r.numbers.length&&1===r.numbers[0]||2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: "+t),""},t}(),N=M,D=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.logger=a.create("interpolator"),this.init(e,!0)}return t.prototype.init=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};arguments[1]&&(this.options=t,this.format=t.interpolation&&t.interpolation.format||function(t){return t},this.escape=t.interpolation&&t.interpolation.escape||g),t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.prefix=e.prefix?d(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?d(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?d(e.nestingPrefix):e.nestingPrefixEscaped||d("$t("),this.nestingSuffix=e.nestingSuffix?d(e.nestingSuffix):e.nestingSuffixEscaped||d(")"),this.resetRegExp()},t.prototype.reset=function(){this.options&&this.init(this.options)},t.prototype.resetRegExp=function(){var t=this.prefix+"(.+?)"+this.suffix;this.regexp=new RegExp(t,"g");var e=""+this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix;this.regexpUnescape=new RegExp(e,"g");var n=this.nestingPrefix+"(.+?)"+this.nestingSuffix;this.nestingRegexp=new RegExp(n,"g")},t.prototype.interpolate=function(t,e,n){var r=this,o=void 0,i=void 0;function a(t){return t.replace(/\$/g,"$$$$")}var s=function(t){if(t.indexOf(r.formatSeparator)<0)return f(e,t);var o=t.split(r.formatSeparator),i=o.shift().trim(),a=o.join(r.formatSeparator).trim();return r.format(f(e,i),a,n)};for(this.resetRegExp();o=this.regexpUnescape.exec(t);)i=s(o[1].trim()),t=t.replace(o[0],i),this.regexpUnescape.lastIndex=0;for(;o=this.regexp.exec(t);)"string"!=typeof(i=s(o[1].trim()))&&(i=u(i)),i||(this.logger.warn("missed to pass in variable "+o[1]+" for interpolating "+t),i=""),i=this.escapeValue?a(this.escape(i)):a(i),t=t.replace(o[0],i),this.regexp.lastIndex=0;return t},t.prototype.nest=function(t,e){var n=void 0,r=void 0,o=D({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});function i(t){if(t.indexOf(",")<0)return t;var e=t.split(",");t=e.shift();var n=e.join(",");n=(n=this.interpolate(n,o)).replace(/'/g,'"');try{o=JSON.parse(n)}catch(e){this.logger.error("failed parsing options string in nesting for key "+t,e)}return t}for(o.applyPostProcessor=!1;n=this.nestingRegexp.exec(t);){if((r=e(i.call(this,n[1].trim()),o))&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=u(r)),r||(this.logger.warn("missed to resolve "+n[1]+" for nesting "+t),r=""),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t},t}(),V=B,I=Object.assign||function(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return s.backend=n,s.store=r,s.services=o,s.options=i,s.logger=a.create("backendConnector"),s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,i.backend,i),s}return z(e,t),e.prototype.queueLoad=function(t,e,n){var r=this,o=[],i=[],a=[],s=[];return t.forEach((function(t){var n=!0;e.forEach((function(e){var a=t+"|"+e;r.store.hasResourceBundle(t,e)?r.state[a]=2:r.state[a]<0||(1===r.state[a]?i.indexOf(a)<0&&i.push(a):(r.state[a]=1,n=!1,i.indexOf(a)<0&&i.push(a),o.indexOf(a)<0&&o.push(a),s.indexOf(e)<0&&s.push(e)))})),n||a.push(t)})),(o.length||i.length)&&this.queue.push({pending:i,loaded:{},errors:[],callback:n}),{toLoad:o,pending:i,toLoadLanguages:a,toLoadNamespaces:s}},e.prototype.loaded=function(t,e,n){var r=this,o=t.split("|"),i=L(o,2),a=i[0],s=i[1];e&&this.emit("failedLoading",a,s,e),n&&this.store.addResourceBundle(a,s,n),this.state[t]=e?-1:2,this.queue.forEach((function(n){var o,i,l,u,h,f;o=n.loaded,i=s,u=c(o,[a],Object),h=u.obj,f=u.k,h[f]=h[f]||[],l&&(h[f]=h[f].concat(i)),l||h[f].push(i),function(t,e){for(var n=t.indexOf(e);-1!==n;)t.splice(n,1),n=t.indexOf(e)}(n.pending,t),e&&n.errors.push(e),0!==n.pending.length||n.done||(r.emit("loaded",n.loaded),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.queue=this.queue.filter((function(t){return!t.done}))},e.prototype.read=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=this,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,a=arguments[5];return t.length?this.backend[n](t,e,(function(s,l){s&&l&&r<5?setTimeout((function(){o.read.call(o,t,e,n,r+1,2*i,a)}),i):a(s,l)})):a(null,{})},e.prototype.load=function(t,e,n){var r=this;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();var o=I({},this.backend.options,this.options.backend);"string"==typeof t&&(t=this.services.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var i=this.queueLoad(t,e,n);if(!i.toLoad.length)return i.pending.length||n(),null;o.allowMultiLoading&&this.backend.readMulti?this.read(i.toLoadLanguages,i.toLoadNamespaces,"readMulti",null,null,(function(t,e){t&&r.logger.warn("loading namespaces "+i.toLoadNamespaces.join(", ")+" for languages "+i.toLoadLanguages.join(", ")+" via multiloading failed",t),!t&&e&&r.logger.log("successfully loaded namespaces "+i.toLoadNamespaces.join(", ")+" for languages "+i.toLoadLanguages.join(", ")+" via multiloading",e),i.toLoad.forEach((function(n){var o=n.split("|"),i=L(o,2),a=i[0],s=i[1],l=f(e,[a,s]);if(l)r.loaded(n,t,l);else{var u="loading namespace "+s+" for language "+a+" via multiloading failed";r.loaded(n,u),r.logger.error(u)}}))})):i.toLoad.forEach((function(t){r.loadOne(t)}))},e.prototype.reload=function(t,e){var n=this;this.backend||this.logger.warn("No backend was added via i18next.use. Will not load resources.");var r=I({},this.backend.options,this.options.backend);"string"==typeof t&&(t=this.services.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]),r.allowMultiLoading&&this.backend.readMulti?this.read(t,e,"readMulti",null,null,(function(r,o){r&&n.logger.warn("reloading namespaces "+e.join(", ")+" for languages "+t.join(", ")+" via multiloading failed",r),!r&&o&&n.logger.log("successfully reloaded namespaces "+e.join(", ")+" for languages "+t.join(", ")+" via multiloading",o),t.forEach((function(t){e.forEach((function(e){var i=f(o,[t,e]);if(i)n.loaded(t+"|"+e,r,i);else{var a="reloading namespace "+e+" for language "+t+" via multiloading failed";n.loaded(t+"|"+e,a),n.logger.error(a)}}))}))})):t.forEach((function(t){e.forEach((function(e){n.loadOne(t+"|"+e,"re")}))}))},e.prototype.loadOne=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=L(r,2),i=o[0],a=o[1];this.read(i,a,"read",null,null,(function(r,o){r&&e.logger.warn(n+"loading namespace "+a+" for language "+i+" failed",r),!r&&o&&e.logger.log(n+"loaded namespace "+a+" for language "+i,o),e.loaded(t,r,o)}))},e.prototype.saveMissing=function(t,e,n,r){this.backend&&this.backend.create&&this.backend.create(t,e,n,r),t&&t[0]&&this.store.addResource(t[0],e,n,r)},e}(l),F=$,U=Object.assign||function(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));return s.cache=n,s.store=r,s.services=o,s.options=i,s.logger=a.create("cacheConnector"),s.cache&&s.cache.init&&s.cache.init(o,i.cache,i),s}return H(e,t),e.prototype.load=function(t,e,n){var r=this;if(!this.cache)return n&&n();var o=U({},this.cache.options,this.options.cache),i="string"==typeof t?this.services.languageUtils.toResolveHierarchy(t):t;o.enabled?this.cache.load(i,(function(t,e){if(t&&r.logger.error("loading languages "+i.join(", ")+" from cache failed",t),e)for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))for(var a in e[o])if(Object.prototype.hasOwnProperty.call(e[o],a)&&"i18nStamp"!==a){var s=e[o][a];s&&r.store.addResourceBundle(o,a,s)}n&&n()})):n&&n()},e.prototype.save=function(){this.cache&&this.options.cache&&this.options.cache.enabled&&this.cache.save(this.store.data)},e}(l),W=q;function G(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&t.whitelist.indexOf("cimode")<0&&t.whitelist.push("cimode"),t}var K=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var o=X(this,t.call(this));if(o.options=G(n),o.services={},o.logger=a,o.modules={external:[]},r&&!o.isInitialized&&!n.isClone){var i;if(!o.options.initImmediate)return i=o.init(n,r),X(o,i);setTimeout((function(){o.init(n,r)}),0)}return o}return Y(e,t),e.prototype.init=function(t,e){var n=this;function r(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof t&&(e=t,t={}),t||(t={}),"v1"===t.compatibilityAPI?this.options=K({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",saveMissing:!1,saveMissingTo:"fallback",missingKeyHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){return{defaultValue:t[1]}},interpolation:{escapeValue:!0,format:function(t,e,n){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",defaultVariables:void 0}},G(function(t){return t.resStore&&(t.resources=t.resStore),t.ns&&t.ns.defaultNs?(t.defaultNS=t.ns.defaultNs,t.ns=t.ns.namespaces):t.defaultNS=t.ns||"translation",t.fallbackToDefaultNS&&t.defaultNS&&(t.fallbackNS=t.defaultNS),t.saveMissing=t.sendMissing,t.saveMissingTo=t.sendMissingTo||"current",t.returnNull=!t.fallbackOnNull,t.returnEmptyString=!t.fallbackOnEmpty,t.returnObjects=t.returnObjectTrees,t.joinArrays="\n",t.returnedObjectHandler=t.objectTreeKeyHandler,t.parseMissingKeyHandler=t.parseMissingKey,t.appendNamespaceToMissingKey=!0,t.nsSeparator=t.nsseparator||":",t.keySeparator=t.keyseparator||".","sprintf"===t.shortcutFunction&&(t.overloadTranslationOptionHandler=function(t){for(var e=[],n=1;n1?e-1:0),o=1;o1?e-1:0),o=1;o1?e-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:J;if(this.options.resources)e(null);else{if(this.language&&"cimode"===this.language.toLowerCase())return e();var n=[],r=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(t){n.indexOf(t)<0&&n.push(t)}))};if(this.language)r(this.language);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(t){return r(t)}));this.options.preload&&this.options.preload.forEach((function(t){return r(t)})),this.services.cacheConnector.load(n,this.options.ns,(function(){t.services.backendConnector.load(n,t.options.ns,e)}))}},e.prototype.reloadResources=function(t,e){t||(t=this.languages),e||(e=this.options.ns),this.services.backendConnector.reload(t,e)},e.prototype.use=function(t){return"backend"===t.type&&(this.modules.backend=t),"cache"===t.type&&(this.modules.cache=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"postProcessor"===t.type&&_.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this},e.prototype.changeLanguage=function(t,e){var n=this,r=function(t){t&&(n.language=t,n.languages=n.services.languageUtils.toResolveHierarchy(t),n.translator.changeLanguage(t),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(t)),n.loadResources((function(r){!function(t,r){r&&(n.emit("languageChanged",r),n.logger.log("languageChanged",r)),e&&e(t,(function(){return n.t.apply(n,arguments)}))}(r,t)}))};t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(t):r(this.services.languageDetector.detect())},e.prototype.getFixedT=function(t,e){var n=this,r=function t(e){var r=K({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return r.lng=r.lng||t.lng,r.lngs=r.lngs||t.lngs,r.ns=r.ns||t.ns,n.t(e,r)};return"string"==typeof t?r.lng=t:r.lngs=t,r.ns=e,r},e.prototype.t=function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)},e.prototype.exists=function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)},e.prototype.setDefaultNamespace=function(t){this.options.defaultNS=t},e.prototype.loadNamespaces=function(t,e){var n=this;if(!this.options.ns)return e&&e();"string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources(e)},e.prototype.loadLanguages=function(t,e){"string"==typeof t&&(t=[t]);var n=this.options.preload||[],r=t.filter((function(t){return n.indexOf(t)<0}));if(!r.length)return e();this.options.preload=n.concat(r),this.loadResources(e)},e.prototype.dir=function(t){if(t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),!t)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"},e.prototype.createInstance=function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments[1])},e.prototype.cloneInstance=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J,o=K({},this.options,n,{isClone:!0}),i=new e(o,r);return["store","services","language"].forEach((function(e){i[e]=t[e]})),i.translator=new S(i.services,i.options),i.translator.on("*",(function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r1?n-1:0),o=1;o1?n-1:0),o=1;o1?n-1:0),o=1;o1&&a("Multiple handlers for a single event are deprecated. If needed, use a single handler to call multiple methods."),e.each(s,(function(e){var o=t[e];if(!o)throw new T('Method "'+e+'" was configured as an event handler, but does not exist.');t[i](n,r,o)}))}function M(t,n,r,o){if(!e.isObject(r))throw new T({message:"Bindings must be an object.",url:"marionette.functions.html#marionettebindevents"});e.each(r,(function(r,i){e.isString(r)?R(t,n,i,r,o):t[o](n,i,r)}))}function N(t,e){return t&&e?(M(this,t,e,"listenTo"),this):this}function D(t,e){return t?e?(M(this,t,e,"stopListening"),this):(this.stopListening(t),this):this}function B(t,n,r,o){if(!e.isObject(r))throw new T({message:"Bindings must be an object.",url:"marionette.functions.html#marionettebindrequests"});var i=c.call(t,r);n[o](i,t)}function V(t,e){return t&&e?(B(this,t,e,"reply"),this):this}function I(t,e){return t?e?(B(this,t,e,"stopReplying"),this):(t.stopReplying(null,null,this),this):this}T.extend=i;var L={normalizeMethods:c,_setOptions:function(t){this.options=e.extend({},e.result(this,"options"),t)},mergeOptions:l,getOption:u,bindEvents:N,unbindEvents:D},z={_initRadio:function(){var t=e.result(this,"channelName");if(t){if(!n)throw new T({name:"BackboneRadioMissing",message:'The dependency "backbone.radio" is missing.'});var r=this._channel=n.channel(t),o=e.result(this,"radioEvents");this.bindEvents(r,o);var i=e.result(this,"radioRequests");this.bindRequests(r,i),this.on("destroy",this._destroyRadio)}},_destroyRadio:function(){this._channel.stopReplying(null,null,this)},getChannel:function(){return this._channel},bindEvents:N,unbindEvents:D,bindRequests:V,unbindRequests:I},$=["channelName","radioEvents","radioRequests"],F=function(t){this.hasOwnProperty("options")||this._setOptions(t),this.mergeOptions(t,$),this._setCid(),this._initRadio(),this.initialize.apply(this,arguments)};F.extend=i,e.extend(F.prototype,t.Events,L,z,{cidPrefix:"mno",_isDestroyed:!1,isDestroyed:function(){return this._isDestroyed},initialize:function(){},_setCid:function(){this.cid||(this.cid=e.uniqueId(this.cidPrefix))},destroy:function(){if(this._isDestroyed)return this;for(var t=arguments.length,e=Array(t),n=0;n0)for(t=0;t2&&void 0!==arguments[2]?arguments[2]:at(t)).find(e)},hasEl:function(t,e){return t.contains(e&&e.parentNode)},detachEl:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:at(t)).detach()},replaceEl:function(t,e){if(t!==e){var n=e.parentNode;n&&n.replaceChild(t,e)}},swapEl:function(t,e){if(t!==e){var n=t.parentNode,r=e.parentNode;if(n&&r){var o=t.nextSibling,i=e.nextSibling;n.insertBefore(e,o),r.insertBefore(t,i)}}},setContents:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:at(t)).html(e)},appendContents:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n._$el,o=void 0===r?at(t):r,i=n._$contents,a=void 0===i?at(e):i;o.append(a)},hasContents:function(t){return!!t&&t.hasChildNodes()},detachContents:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:at(t)).contents().detach()}},ut={Dom:lt,supportsRenderLifecycle:!0,supportsDestroyLifecycle:!0,_isDestroyed:!1,isDestroyed:function(){return!!this._isDestroyed},_isRendered:!1,isRendered:function(){return!!this._isRendered},_isAttached:!1,isAttached:function(){return!!this._isAttached},delegateEvents:function(n){this._proxyBehaviorViewProperties(),this._buildEventProxies();var r=this._getEvents(n);void 0===n&&(this.events=r);var o=e.extend({},this._getBehaviorEvents(),r,this._getBehaviorTriggers(),this.getTriggers());return t.View.prototype.delegateEvents.call(this,o),this},_getEvents:function(t){var n=t||this.events;return e.isFunction(n)?this.normalizeUIKeys(n.call(this)):this.normalizeUIKeys(n)},getTriggers:function(){if(this.triggers){var t=this.normalizeUIKeys(e.result(this,"triggers"));return this._getViewTriggers(this,t)}},delegateEntityEvents:function(){return this._delegateEntityEvents(this.model,this.collection),this._delegateBehaviorEntityEvents(),this},undelegateEntityEvents:function(){return this._undelegateEntityEvents(this.model,this.collection),this._undelegateBehaviorEntityEvents(),this},destroy:function(){if(this._isDestroyed)return this;for(var t=this._isAttached&&!this._shouldDisableEvents,e=arguments.length,n=Array(e),r=0;r1?r-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{},r=!t._isAttached&&s(this.el)&&!this._shouldDisableMonitoring(),o=void 0===n.replaceElement?!!e.result(this,"replaceElement"):!!n.replaceElement;r&&m(t,"before:attach",t),o?this._replaceEl(t):this.attachHtml(t),r&&(t._isAttached=!0,m(t,"attach",t))},_ensureElement:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.isObject(this.el)||(this.$el=this.getEl(this.el),this.el=this.$el[0],this.$el=this.Dom.getEl(this.el)),!this.$el||0===this.$el.length){if(void 0===t.allowMissingEl?e.result(this,"allowMissingEl"):t.allowMissingEl)return!1;throw new T('An "el" must exist in DOM for this region '+this.cid)}return!0},_getView:function(e){if(!e)throw new T({name:"ViewNotValid",message:"The view passed is undefined and therefore invalid. You must pass a view instance to show."});if(e._isDestroyed)throw new T({name:"ViewDestroyedError",message:'View (cid: "'+e.cid+'") has already been destroyed and cannot be used.'});if(e instanceof t.View)return e;var n=this._getViewOptions(e);return new wt(n)},_getViewOptions:function(t){return e.isFunction(t)?{template:t}:e.isObject(t)?t:{template:function(){return t}}},getEl:function(t){var n=e.result(this,"parentEl");return n&&e.isString(t)?this.Dom.findEl(n,t):this.Dom.getEl(t)},_replaceEl:function(t){this._restoreEl(),t.on("before:destroy",this._restoreEl,this),this.Dom.replaceEl(t.el,this.el),this._isReplaced=!0},_restoreEl:function(){if(this._isReplaced){var t=this.currentView;t&&(this._detachView(t),this._isReplaced=!1)}},isReplaced:function(){return!!this._isReplaced},isSwappingView:function(){return!!this._isSwappingView},attachHtml:function(t){this.Dom.appendContents(this.el,t.el,{_$el:this.$el,_$contents:t.$el})},empty:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{allowMissingEl:!0},e=this.currentView;if(!e)return this._ensureElement(t)&&this.detachHtml(),this;var n=!t.preventDestroy;return n||a("The preventDestroy option is deprecated. Use Region#detachView"),this._empty(e,n),this},_empty:function(t,e){t.off("destroy",this._empty,this),this.triggerMethod("before:empty",this,t),this._restoreEl(),delete this.currentView,t._isDestroyed||(e?this.removeView(t):this._detachView(t),this._stopChildViewEvents(t)),this.triggerMethod("empty",this,t)},_stopChildViewEvents:function(t){this._parentView&&this._parentView.stopListening(t)},destroyView:function(t){return t._isDestroyed||(t._shouldDisableEvents=this._shouldDisableMonitoring(),ht(t)),t},removeView:function(t){this.destroyView(t)},detachView:function(){var t=this.currentView;if(t)return this._empty(t),t},_detachView:function(t){var e=t._isAttached&&!this._shouldDisableMonitoring(),n=this._isReplaced;e&&m(t,"before:detach",t),n?this.Dom.replaceEl(this.el,t.el):this.detachHtml(),e&&(t._isAttached=!1,m(t,"detach",t))},detachHtml:function(){this.Dom.detachContents(this.el,this.$el)},hasView:function(){return!!this.currentView},reset:function(t){return this.empty(t),this.$el&&(this.el=this._initEl),delete this.$el,this},destroy:function(t){return this._isDestroyed?this:(this.reset(t),this._name&&this._parentView._removeReferences(this._name),delete this._parentView,delete this._name,F.prototype.destroy.apply(this,arguments))}},{setDomApi:st}),dt=function(t,e){return t instanceof pt?t:mt(t,e)};function mt(t,n){var r=e.extend({},n);if(e.isString(t))return e.extend(r,{el:t}),gt(r);if(e.isFunction(t))return e.extend(r,{regionClass:t}),gt(r);if(e.isObject(t))return t.selector&&a("The selector option on a Region definition object is deprecated. Use el to pass a selector string"),e.extend(r,{el:t.selector},t),gt(r);throw new T({message:"Improper region configuration type.",url:"marionette.region.html#region-configuration-types"})}function gt(t){return new(0,t.regionClass)(e.omit(t,"regionClass"))}var vt={regionClass:pt,_initRegions:function(){this.regions=this.regions||{},this._regions={},this.addRegions(e.result(this,"regions"))},_reInitRegions:function(){H(this._regions,"reset")},addRegion:function(t,e){var n={};return n[t]=e,this.addRegions(n)[t]},addRegions:function(t){if(!e.isEmpty(t))return t=this.normalizeUIValues(t,["selector","el"]),this.regions=e.extend({},this.regions,t),this._addRegions(t)},_addRegions:function(t){var n=this,r={regionClass:this.regionClass,parentEl:e.partial(e.result,this,"el")};return e.reduce(t,(function(t,e,o){return t[o]=dt(e,r),n._addRegion(t[o],o),t}),{})},_addRegion:function(t,e){this.triggerMethod("before:add:region",this,e,t),t._parentView=this,t._name=e,this._regions[e]=t,this.triggerMethod("add:region",this,e,t)},removeRegion:function(t){var e=this._regions[t];return this._removeRegion(e,t),e},removeRegions:function(){var t=this._getRegions();return e.each(this._regions,e.bind(this._removeRegion,this)),t},_removeRegion:function(t,e){this.triggerMethod("before:remove:region",this,e,t),t.destroy(),this.triggerMethod("remove:region",this,e,t)},_removeReferences:function(t){delete this.regions[t],delete this._regions[t]},emptyRegions:function(){var t=this.getRegions();return H(t,"empty"),t},hasRegion:function(t){return!!this.getRegion(t)},getRegion:function(t){return this._isRendered||this.render(),this._regions[t]},_getRegions:function(){return e.clone(this._regions)},getRegions:function(){return this._isRendered||this.render(),this._getRegions()},showChildView:function(t,e){for(var n=this.getRegion(t),r=arguments.length,o=Array(r>2?r-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:{},n=e.result(this,"templateContext");return e.extend(t,n)},attachElContent:function(t){return this.Dom.setContents(this.el,t,this.$el),this},_removeChildren:function(){this.removeRegions()},_getImmediateChildren:function(){return e.chain(this._getRegions()).map("currentView").compact().value()}},{setRenderer:function(t){return this.prototype._renderHtml=t,this},setDomApi:st});e.extend(wt.prototype,ut,vt);var _t=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck","reduce","partition"],xt=function(t,n){e.each(_t,(function(r){t[r]=function(){var t=e.result(this,n),o=Array.prototype.slice.call(arguments);return e[r].apply(e,[t].concat(o))}}))},kt=function(t){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),e.each(t,e.bind(this.add,this))};xt(kt.prototype,"_getViews"),e.extend(kt.prototype,{_getViews:function(){return e.values(this._views)},add:function(t,e){return this._add(t,e)._updateLength()},_add:function(t,e){var n=t.cid;return this._views[n]=t,t.model&&(this._indexByModel[t.model.cid]=n),e&&(this._indexByCustom[e]=n),this},findByModel:function(t){return this.findByModelCid(t.cid)},findByModelCid:function(t){var e=this._indexByModel[t];return this.findByCid(e)},findByCustom:function(t){var e=this._indexByCustom[t];return this.findByCid(e)},findByIndex:function(t){return e.values(this._views)[t]},findByCid:function(t){return this._views[t]},remove:function(t){return this._remove(t)._updateLength()},_remove:function(t){var n=t.cid;return t.model&&delete this._indexByModel[t.model.cid],e.some(this._indexByCustom,e.bind((function(t,e){if(t===n)return delete this._indexByCustom[e],!0}),this)),delete this._views[n],this},_updateLength:function(){return this.length=e.size(this._views),this}});var At=["behaviors","childView","childViewEventPrefix","childViewEvents","childViewOptions","childViewTriggers","collectionEvents","events","filter","emptyView","emptyViewOptions","modelEvents","reorderOnSort","sort","triggers","ui","viewComparator"],Ot=t.View.extend({sort:!0,constructor:function(n){this.render=e.bind(this.render,this),this._setOptions(n),this.mergeOptions(n,At),P(this),this._initBehaviors(),this.once("render",this._initialEvents),this._initChildViewStorage(),this._bufferedChildren=[];var r=Array.prototype.slice.call(arguments);r[0]=this.options,t.View.prototype.constructor.apply(this,r),this.delegateEntityEvents(),this._triggerEventOnBehaviors("initialize",this)},_startBuffering:function(){this._isBuffering=!0},_endBuffering:function(){var t=this._isAttached&&!1!==this.monitorViewEvents?this._getImmediateChildren():[];this._isBuffering=!1,e.each(t,(function(t){m(t,"before:attach",t)})),this.attachBuffer(this,this._createBuffer()),e.each(t,(function(t){t._isAttached=!0,m(t,"attach",t)})),this._bufferedChildren=[]},_getImmediateChildren:function(){return e.values(this.children._views)},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"update",this._onCollectionUpdate),this.listenTo(this.collection,"reset",this.render),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(t,n,r){var o=void 0!==r.at&&(r.index||n.indexOf(t));(this.filter||!1===o)&&(o=e.indexOf(this._filteredSortedModels(o),t)),this._shouldAddChild(t,o)&&(this._destroyEmptyView(),this._addChild(t,o))},_onCollectionUpdate:function(t,e){var n=e.changes;this._removeChildModels(n.removed)},_removeChildModels:function(t){var e=this._getRemovedViews(t);e.length&&(this.children._updateLength(),this._updateIndices(e,!1),this.isEmpty()&&this._showEmptyView())},_getRemovedViews:function(t){var n=this;return e.reduce(t,(function(t,e){var r=e&&n.children.findByModel(e);return!r||r._isDestroyed||(n._removeChildView(r),t.push(r)),t}),[])},_removeChildView:function(t){this.triggerMethod("before:remove:child",this,t),this.children._remove(t),t._shouldDisableEvents=!1===this.monitorViewEvents,ht(t),this.stopListening(t),this.triggerMethod("remove:child",this,t)},setElement:function(){return t.View.prototype.setElement.apply(this,arguments),this._isAttached=s(this.el),this},render:function(){return this._isDestroyed||(this.triggerMethod("before:render",this),this._renderChildren(),this._isRendered=!0,this.triggerMethod("render",this)),this},setFilter:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).preventRender,n=this._isRendered&&!this._isDestroyed,r=this.filter!==t;if(n&&r&&!e){var o=this._filteredSortedModels();this.filter=t;var i=this._filteredSortedModels();this._applyModelDeltas(i,o)}else this.filter=t;return this},removeFilter:function(t){return this.setFilter(null,t)},_applyModelDeltas:function(t,n){var r=this,o={};e.each(t,(function(t,e){!r.children.findByModel(t)&&r._onCollectionAdd(t,r.collection,{at:e}),o[t.cid]=!0}));var i=e.filter(n,(function(t){return!o[t.cid]&&r.children.findByModel(t)}));this._removeChildModels(i)},reorder:function(){var t=this,n=this.children,r=this._filteredSortedModels();if(!r.length&&this._showingEmptyView)return this;if(e.some(r,(function(t){return!n.findByModel(t)})))this.render();else{var o=[],i=e.reduce(this.children._views,(function(t,n){var i=e.indexOf(r,n.model);return-1===i?(o.push(n.model),t):(n._index=i,t[i]=n.el,t)}),new Array(r.length));this.triggerMethod("before:reorder",this);var a=this.Dom.createBuffer();e.each(i,(function(e){t.Dom.appendContents(a,e)})),this._appendReorderedChildren(a),this._removeChildModels(o),this.triggerMethod("reorder",this)}return this},resortView:function(){return this.reorderOnSort?this.reorder():this._renderChildren(),this},_sortViews:function(){var t=this,n=this._filteredSortedModels();e.find(n,(function(e,n){var r=t.children.findByModel(e);return!r||r._index!==n}))&&this.resortView()},_emptyViewIndex:-1,_appendReorderedChildren:function(t){this.Dom.appendContents(this.el,t,{_$el:this.$el})},_renderChildren:function(){this._isRendered&&(this._destroyEmptyView(),this._destroyChildren());var t=this._filteredSortedModels();this.isEmpty({processedModels:t})?this._showEmptyView():(this.triggerMethod("before:render:children",this),this._startBuffering(),this._showCollection(t),this._endBuffering(),this.triggerMethod("render:children",this))},_createView:function(t,e){var n=this._getChildView(t),r=this._getChildViewOptions(t,e);return this.buildChildView(t,n,r)},_setupChildView:function(t,e){P(t),this._proxyChildViewEvents(t),this.sort&&(t._index=e)},_showCollection:function(t){e.each(t,e.bind(this._addChild,this)),this.children._updateLength()},_filteredSortedModels:function(t){if(!this.collection||!this.collection.length)return[];var e=this.getViewComparator(),n=this.collection.models;if(t=Math.min(Math.max(t,0),n.length-1),e){var r=void 0;t&&(r=n[t],n=n.slice(0,t).concat(n.slice(t+1))),n=this._sortModelsBy(n,e),r&&n.splice(t,0,r)}return n=this._filterModels(n)},getViewComparator:function(){return this.viewComparator},_filterModels:function(t){var n=this;return this.filter&&(t=e.filter(t,(function(t,e){return n._shouldAddChild(t,e)}))),t},_sortModelsBy:function(t,n){return"string"==typeof n?e.sortBy(t,(function(t){return t.get(n)})):1===n.length?e.sortBy(t,e.bind(n,this)):e.clone(t).sort(e.bind(n,this))},_showEmptyView:function(){var n=this._getEmptyView();if(n&&!this._showingEmptyView){this._showingEmptyView=!0;var r=new t.Model,o=this.emptyViewOptions||this.childViewOptions;e.isFunction(o)&&(o=o.call(this,r,this._emptyViewIndex));var i=this.buildChildView(r,n,o);this.triggerMethod("before:render:empty",this,i),this.addChildView(i,0),this.triggerMethod("render:empty",this,i)}},_destroyEmptyView:function(){this._showingEmptyView&&(this.triggerMethod("before:remove:empty",this),this._destroyChildren(),delete this._showingEmptyView,this.triggerMethod("remove:empty",this))},_getEmptyView:function(){var t=this.emptyView;if(t)return this._getView(t)},_getChildView:function(t){var e=this.childView;if(!e)throw new T({name:"NoChildViewError",message:'A "childView" must be specified'});if(!(e=this._getView(e,t)))throw new T({name:"InvalidChildViewError",message:'"childView" must be a view class or a function that returns a view class'});return e},_getView:function(n,r){return n.prototype instanceof t.View||n===t.View?n:e.isFunction(n)?n.call(this,r):void 0},_addChild:function(t,e){var n=this._createView(t,e);return this.addChildView(n,e),n},_getChildViewOptions:function(t,n){return e.isFunction(this.childViewOptions)?this.childViewOptions(t,n):this.childViewOptions},addChildView:function(t,e){return this.triggerMethod("before:add:child",this,t),this._setupChildView(t,e),this._isBuffering?this.children._add(t):(this._updateIndices(t,!0),this.children.add(t)),ct(t),this._attachView(t,e),this.triggerMethod("add:child",this,t),t},_updateIndices:function(t,n){if(this.sort)if(n){var r=e.isArray(t)?e.max(t,"_index"):t;e.isObject(r)&&e.each(this.children._views,(function(t){t._index>=r._index&&(t._index+=1)}))}else e.each(e.sortBy(this.children._views,"_index"),(function(t,e){t._index=e}))},_attachView:function(t,e){var n=!t._isAttached&&!this._isBuffering&&this._isAttached&&!1!==this.monitorViewEvents;n&&m(t,"before:attach",t),this.attachHtml(this,t,e),n&&(t._isAttached=!0,m(t,"attach",t))},buildChildView:function(t,n,r){return new n(e.extend({model:t},r))},removeChildView:function(t){return!t||t._isDestroyed||(this._removeChildView(t),this.children._updateLength(),this._updateIndices(t,!1)),t},isEmpty:function(t){var n=void 0;return e.result(t,"processedModels")?n=t.processedModels:(n=this.collection?this.collection.models:[],n=this._filterModels(n)),0===n.length},attachBuffer:function(t,e){this.Dom.appendContents(t.el,e,{_$el:t.$el})},_createBuffer:function(){var t=this,n=this.Dom.createBuffer();return e.each(this._bufferedChildren,(function(e){t.Dom.appendContents(n,e.el,{_$contents:e.$el})})),n},attachHtml:function(t,e,n){t._isBuffering?t._bufferedChildren.splice(n,0,e):t._insertBefore(e,n)||t._insertAfter(e)},_insertBefore:function(t,n){var r=void 0;return this.sort&&n1&&void 0!==arguments[1]?arguments[1]:this._views.length,n=t.cid;this._viewsByCid[n]=t,t.model&&(this._indexByModel[t.model.cid]=n),this._views.splice(e,0,t),this._updateLength()},_sort:function(t,n){return"string"==typeof t?(t=e.partial(Ct,t),this._sortBy(t)):1===t.length?this._sortBy(e.bind(t,n)):this._views.sort(e.bind(t,n))},_sortBy:function(t){var n=e.sortBy(this._views,t);return this._set(n),n},_set:function(t){this._views.length=0,this._views.push.apply(this._views,t.slice(0)),this._updateLength()},_swap:function(t,e){var n=this.findIndexByView(t),r=this.findIndexByView(e);if(-1!==n&&-1!==r){var o=this._views[n];this._views[n]=this._views[r],this._views[r]=o}},findByModel:function(t){return this.findByModelCid(t.cid)},findByModelCid:function(t){var e=this._indexByModel[t];return this.findByCid(e)},findByIndex:function(t){return this._views[t]},findIndexByView:function(t){return this._views.indexOf(t)},findByCid:function(t){return this._viewsByCid[t]},hasView:function(t){return!!this.findByCid(t.cid)},_remove:function(t){if(this._viewsByCid[t.cid]){t.model&&delete this._indexByModel[t.model.cid],delete this._viewsByCid[t.cid];var e=this.findIndexByView(t);this._views.splice(e,1),this._updateLength()}},_updateLength:function(){this.length=this._views.length}});var St=["behaviors","childView","childViewEventPrefix","childViewEvents","childViewOptions","childViewTriggers","collectionEvents","emptyView","emptyViewOptions","events","modelEvents","sortWithCollection","triggers","ui","viewComparator","viewFilter"],Pt=t.View.extend({sortWithCollection:!0,constructor:function(e){this._setOptions(e),this.mergeOptions(e,St),P(this),this.once("render",this._initialEvents),this._initChildViewStorage(),this._initBehaviors();var n=Array.prototype.slice.call(arguments);n[0]=this.options,t.View.prototype.constructor.apply(this,n),this.getEmptyRegion(),this.delegateEntityEvents(),this._triggerEventOnBehaviors("initialize",this)},_initChildViewStorage:function(){this.children=new Et},getEmptyRegion:function(){return this._emptyRegion&&!this._emptyRegion.isDestroyed()||(this._emptyRegion=new pt({el:this.el,replaceElement:!1}),this._emptyRegion._parentView=this),this._emptyRegion},_initialEvents:function(){this.listenTo(this.collection,{sort:this._onCollectionSort,reset:this._onCollectionReset,update:this._onCollectionUpdate})},_onCollectionSort:function(t,e){var n=e.add,r=e.merge,o=e.remove;this.sortWithCollection&&!1!==this.viewComparator&&(n||o||r||this.sort())},_onCollectionReset:function(){this.render()},_onCollectionUpdate:function(t,e){var n=e.changes,r=n.removed.length&&this._removeChildModels(n.removed);this._addedViews=n.added.length&&this._addChildModels(n.added),this._detachChildren(r),this._showChildren(),this._removeChildViews(r)},_removeChildModels:function(t){var n=this;return e.reduce(t,(function(t,e){var r=n._removeChildModel(e);return r&&t.push(r),t}),[])},_removeChildModel:function(t){var e=this.children.findByModel(t);return e&&this._removeChild(e),e},_removeChild:function(t){this.triggerMethod("before:remove:child",this,t),this.children._remove(t),this.triggerMethod("remove:child",this,t)},_addChildModels:function(t){return e.map(t,e.bind(this._addChildModel,this))},_addChildModel:function(t){var e=this._createChildView(t);return this._addChild(e),e},_createChildView:function(t){var e=this._getChildView(t),n=this._getChildViewOptions(t);return this.buildChildView(t,e,n)},_addChild:function(t,e){this.triggerMethod("before:add:child",this,t),this._setupChildView(t),this.children._add(t,e),this.triggerMethod("add:child",this,t)},_getChildView:function(t){var e=this.childView;if(!e)throw new T({name:"NoChildViewError",message:'A "childView" must be specified'});if(!(e=this._getView(e,t)))throw new T({name:"InvalidChildViewError",message:'"childView" must be a view class or a function that returns a view class'});return e},_getView:function(n,r){return n.prototype instanceof t.View||n===t.View?n:e.isFunction(n)?n.call(this,r):void 0},_getChildViewOptions:function(t){return e.isFunction(this.childViewOptions)?this.childViewOptions(t):this.childViewOptions},buildChildView:function(t,n,r){return new n(e.extend({model:t},r))},_setupChildView:function(t){P(t),t.on("destroy",this.removeChildView,this),this._proxyChildViewEvents(t)},_getImmediateChildren:function(){return this.children._views},setElement:function(){return t.View.prototype.setElement.apply(this,arguments),this._isAttached=s(this.el),this},render:function(){return this._isDestroyed||(this.triggerMethod("before:render",this),this._destroyChildren(),this.children._init(),this.collection&&this._addChildModels(this.collection.models),this._showChildren(),this._isRendered=!0,this.triggerMethod("render",this)),this},sort:function(){return this._isDestroyed?this:this.children.length?(this._showChildren(),this):this},_showChildren:function(){this.isEmpty()?this._showEmptyView():(this._sortChildren(),this.filter())},isEmpty:function(t){return t||!this.children.length},_showEmptyView:function(){var t=this._getEmptyView();if(t){var e=this._getEmptyViewOptions();this.getEmptyRegion().show(new t(e))}},_getEmptyView:function(){var t=this.emptyView;if(t)return this._getView(t)},_destroyEmptyView:function(){var t=this.getEmptyRegion();t.hasView()&&t.empty()},_getEmptyViewOptions:function(){var t=this.emptyViewOptions||this.childViewOptions;return e.isFunction(t)?t.call(this):t},_sortChildren:function(){var t=this.getComparator();t&&(delete this._addedViews,this.triggerMethod("before:sort",this),this.children._sort(t,this),this.triggerMethod("sort",this))},setComparator:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).preventRender,n=this.viewComparator!==t&&!e;return this.viewComparator=t,n&&this.sort(),this},removeComparator:function(t){return this.setComparator(null,t)},getComparator:function(){return this.viewComparator?this.viewComparator:!(!this.sortWithCollection||!1===this.viewComparator||!this.collection)&&this._viewComparator},_viewComparator:function(t){return this.collection.indexOf(t.model)},filter:function(){if(this._isDestroyed)return this;if(!this.children.length)return this;var t=this._filterChildren();return this._renderChildren(t),this},_filterChildren:function(){var t=this,n=this._getFilter(),r=this._addedViews;if(delete this._addedViews,!n)return r||this.children._views;this.triggerMethod("before:filter",this);var o=[],i=[];return e.each(this.children._views,(function(e,r,a){(n.call(t,e,r,a)?o:i).push(e)})),this._detachChildren(i),this.triggerMethod("filter",this,o,i),o},_getFilter:function(){var t=this.getFilter();if(!t)return!1;if(e.isFunction(t))return t;if(e.isObject(t)){var n=e.matches(t);return function(t){return n(t.model&&t.model.attributes)}}if(e.isString(t))return function(e){return e.model&&e.model.get(t)};throw new T({name:"InvalidViewFilterError",message:'"viewFilter" must be a function, predicate object literal, a string indicating a model attribute, or falsy'})},getFilter:function(){return this.viewFilter},setFilter:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).preventRender,n=this.viewFilter!==t&&!e;return this.viewFilter=t,n&&this.filter(),this},removeFilter:function(t){return this.setFilter(null,t)},_detachChildren:function(t){e.each(t,e.bind(this._detachChildView,this))},_detachChildView:function(t){var e=t._isAttached&&!1!==this.monitorViewEvents;e&&m(t,"before:detach",t),this.detachHtml(t),e&&(t._isAttached=!1,m(t,"detach",t))},detachHtml:function(t){this.Dom.detachEl(t.el,t.$el)},_renderChildren:function(t){if(this.isEmpty(!t.length))this._showEmptyView();else{this._destroyEmptyView(),this.triggerMethod("before:render:children",this,t);var e=this._getBuffer(t);this._attachChildren(e,t),this.triggerMethod("render:children",this,t)}},_attachChildren:function(t,n){n=this._isAttached&&!1!==this.monitorViewEvents?n:[],e.each(n,(function(t){t._isAttached||m(t,"before:attach",t)})),this.attachHtml(t),e.each(n,(function(t){t._isAttached||(t._isAttached=!0,m(t,"attach",t))}))},_getBuffer:function(t){var n=this,r=this.Dom.createBuffer();return e.each(t,(function(t){ct(t),n.Dom.appendContents(r,t.el,{_$contents:t.$el})})),r},attachHtml:function(t){this.Dom.appendContents(this.el,t,{_$el:this.$el})},swapChildViews:function(t,e){if(!this.children.hasView(t)||!this.children.hasView(e))throw new T({name:"ChildSwapError",message:"Both views must be children of the collection view"});return this.children._swap(t,e),this.Dom.swapEl(t.el,e.el),this.Dom.hasEl(this.el,t.el)!==this.Dom.hasEl(this.el,e.el)&&this.filter(),this},addChildView:function(t,e){return!t||t._isDestroyed||((!e||e>=this.children.length)&&(this._addedViews=[t]),this._addChild(t,e),this._showChildren()),t},detachChildView:function(t){return this.removeChildView(t,{shouldDetach:!0}),t},removeChildView:function(t,e){return t?(this._removeChildView(t,e),this._removeChild(t),this.isEmpty()&&this._showEmptyView(),t):t},_removeChildViews:function(t){e.each(t,e.bind(this._removeChildView,this))},_removeChildView:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).shouldDetach;t.off("destroy",this.removeChildView,this),e?this._detachChildView(t):this._destroyChildView(t),this.stopListening(t)},_destroyChildView:function(t){t._isDestroyed||(t._shouldDisableEvents=!1===this.monitorViewEvents,ht(t))},_removeChildren:function(){this._destroyChildren(),this.getEmptyRegion().destroy(),delete this._addedViews},_destroyChildren:function(){this.children&&this.children.length&&(this.triggerMethod("before:destroy:children",this),!1===this.monitorViewEvents&&this.Dom.detachContents(this.el,this.$el),e.each(this.children._views,e.bind(this._removeChildView,this)),this.triggerMethod("destroy:children",this))}},{setDomApi:st});e.extend(Pt.prototype,ut);var jt=["childViewContainer","template","templateContext"],Tt=Ot.extend({constructor:function(t){a("CompositeView is deprecated. Convert to View at your earliest convenience"),this.mergeOptions(t,jt),Ot.prototype.constructor.apply(this,arguments)},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"update",this._onCollectionUpdate),this.listenTo(this.collection,"reset",this.renderChildren),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_getChildView:function(t){var e=this.childView;if(!e)return this.constructor;if(!(e=this._getView(e,t)))throw new T({name:"InvalidChildViewError",message:'"childView" must be a view class or a function that returns a view class'});return e},serializeData:function(){return this.serializeModel()},render:function(){return this._isDestroyed||(this._isRendering=!0,this.resetChildViewContainer(),this.triggerMethod("before:render",this),this._renderTemplate(),this.bindUIElements(),this.renderChildren(),this._isRendering=!1,this._isRendered=!0,this.triggerMethod("render",this)),this},renderChildren:function(){(this._isRendered||this._isRendering)&&Ot.prototype._renderChildren.call(this)},attachBuffer:function(t,e){var n=this.getChildViewContainer(t);this.Dom.appendContents(n[0],e,{_$el:n})},_insertAfter:function(t){var e=this.getChildViewContainer(this,t);this.Dom.appendContents(e[0],t.el,{_$el:e,_$contents:t.$el})},_appendReorderedChildren:function(t){var e=this.getChildViewContainer(this);this.Dom.appendContents(e[0],t,{_$el:e})},getChildViewContainer:function(t,n){if(t.$childViewContainer)return t.$childViewContainer;var r=void 0;if(t.childViewContainer){var o=e.result(t,"childViewContainer");if((r="@"===o.charAt(0)&&t.ui?t.ui[o.substr(4)]:this.$(o)).length<=0)throw new T({name:"ChildViewContainerMissingError",message:'The specified "childViewContainer" was not found: '+t.childViewContainer})}else r=t.$el;return t.$childViewContainer=r,r},resetChildViewContainer:function(){this.$childViewContainer&&(this.$childViewContainer=void 0)}}),Rt=e.pick(wt.prototype,"serializeModel","getTemplate","_renderTemplate","_renderHtml","mixinTemplateContext","attachElContent");e.extend(Tt.prototype,Rt);var Mt=["collectionEvents","events","modelEvents","triggers","ui"],Nt=F.extend({cidPrefix:"mnb",constructor:function(t,n){this.view=n,this.defaults&&a("Behavior defaults are deprecated. For similar functionality set options on the Behavior class."),this.defaults=e.clone(e.result(this,"defaults",{})),this._setOptions(e.extend({},this.defaults,t)),this.mergeOptions(this.options,Mt),this.ui=e.extend({},e.result(this,"ui"),e.result(n,"ui")),F.apply(this,arguments)},$:function(){return this.view.$.apply(this.view,arguments)},destroy:function(){return this.stopListening(),this.view._removeBehavior(this),this},proxyViewProperties:function(){return this.$el=this.view.$el,this.el=this.view.el,this},bindUIElements:function(){return this._bindUIElements(),this},unbindUIElements:function(){return this._unbindUIElements(),this},getUI:function(t){return this._getUI(t)},delegateEntityEvents:function(){return this._delegateEntityEvents(this.view.model,this.view.collection),this},undelegateEntityEvents:function(){return this._undelegateEntityEvents(this.view.model,this.view.collection),this},getEvents:function(){var t=this,n=this.normalizeUIKeys(e.result(this,"events"));return e.reduce(n,(function(n,r,o){return e.isFunction(r)||(r=t[r]),r?(n[o=Y(o,t.cid)]=e.bind(r,t),n):n}),{})},getTriggers:function(){if(this.triggers){var t=this.normalizeUIKeys(e.result(this,"triggers"));return this._getViewTriggers(this.view,t)}}});e.extend(Nt.prototype,K,et,it);var Dt=["region","regionClass"],Bt=F.extend({cidPrefix:"mna",constructor:function(t){this._setOptions(t),this.mergeOptions(t,Dt),this._initRegion(),F.prototype.constructor.apply(this,arguments)},regionClass:pt,_initRegion:function(){var t=this.region;if(t){var e={regionClass:this.regionClass};this._region=dt(t,e)}},getRegion:function(){return this._region},showView:function(t){for(var e=this.getRegion(),n=arguments.length,r=Array(n>1?n-1:0),o=1;othis.length&&(o=this.length),o<0&&(o+=this.length+1);var i,a,s=[],l=[],u=[],c=[],h={},f=e.add,p=e.merge,d=e.remove,m=!1,g=this.comparator&&null==o&&!1!==e.sort,v=n.isString(this.comparator)?this.comparator:null;for(a=0;a0&&!e.silent&&delete e.index,n},_isModel:function(t){return t instanceof v},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes,t.idAttribute);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes,t.idAttribute);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"changeId"===t){var o=this.modelId(e.previousAttributes(),e.idAttribute),i=this.modelId(e.attributes,e.idAttribute);null!=o&&delete this._byId[o],null!=i&&(this._byId[i]=e)}}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,n){this.has(t)||this._onModelEvent("error",t,e,n)}});var x="function"==typeof Symbol&&Symbol.iterator;x&&(y.prototype[x]=y.prototype.values);var k=function(t,e){this._collection=t,this._kind=e,this._index=0},A=1,O=2,E=3;x&&(k.prototype[x]=function(){return this}),k.prototype.next=function(){if(this._collection){if(this._index7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(H,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,o=r.insertBefore(this.iframe,r.firstChild).contentWindow;o.document.open(),o.document.close(),o.location.hash="#"+this.fragment}var i=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?i("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?i("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),F.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!this.matchRoot()&&this.notfound();this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return this.matchRoot()?(t=this.fragment=this.getFragment(t),n.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0}))||this.notfound()):this.notfound()},notfound:function(){return this.trigger("notfound"),!1},navigate:function(t,e){if(!F.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;this._trailingSlash||""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;t=t.replace(q,"");var o=this.decodeFragment(t);if(this.fragment!==o){if(this.fragment=o,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new F;var W=function(t,e){var r,o=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(r,o,e),r.prototype=n.create(o.prototype,t),r.prototype.constructor=r,r.__super__=o.prototype,r};v.extend=y.extend=V.extend=C.extend=F.extend=W;var G=function(){throw new Error('A "url" property or function must be specified')},K=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e._debug=function(){return{root:t,_:n}},e}(i,n,t,e)}.apply(e,r),void 0===o||(t.exports=o)},8075:function(t,e,n){"use strict";var r=n(453),o=n(487),i=o(r("String.prototype.indexOf"));t.exports=function(t,e){var n=r(t,!!e);return"function"==typeof n&&i(t,".prototype.")>-1?o(n):n}},487:function(t,e,n){"use strict";var r=n(6743),o=n(453),i=n(6897),a=n(9675),s=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||r.call(l,s),c=n(655),h=o("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=u(r,l,arguments);return i(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(r,s,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},41:function(t,e,n){"use strict";var r=n(655),o=n(8068),i=n(9675),a=n(5795);t.exports=function(t,e,n){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new i("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(r)r(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===s&&h?h.enumerable:!s,value:n,writable:null===l&&h?h.writable:!l});else{if(!c&&(s||l||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=n}}},655:function(t,e,n){"use strict";var r=n(453)("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(t){r=!1}t.exports=r},1237:function(t){"use strict";t.exports=EvalError},9383:function(t){"use strict";t.exports=Error},9290:function(t){"use strict";t.exports=RangeError},9538:function(t){"use strict";t.exports=ReferenceError},8068:function(t){"use strict";t.exports=SyntaxError},9675:function(t){"use strict";t.exports=TypeError},5345:function(t){"use strict";t.exports=URIError},9353:function(t){"use strict";var e=Object.prototype.toString,n=Math.max,r=function(t,e){for(var n=[],r=0;r1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(t){var e=j(t,0,1),n=j(t,-1);if("%"===e&&"%"!==n)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var r=[];return P(t,R,(function(t,e,n,o){r[r.length]=n?P(o,M,"$1"):e||t})),r}(t),r=n.length>0?n[0]:"",o=N("%"+r+"%",e),i=o.name,a=o.value,s=!1,c=o.alias;c&&(r=c[0],S(n,C([0,1],c)));for(var h=1,f=!0;h=n.length){var v=p(a,d);a=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:a[d]}else f=E(a,d),a=a[d];f&&!s&&(_[i]=a)}}return a}},5795:function(t,e,n){"use strict";var r=n(453)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(t){r=null}t.exports=r},2417:function(t,e,n){var r=n(3633);function o(t){return t&&(t.__esModule?t.default:t)}t.exports=(r.default||r).template({1:function(t,e,n,r,o){var i=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return" "+t.escapeExpression(t.lambda(null!=e?i(e,"name"):e,e))+"\n"},3:function(t,e,n,r,o){var i=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return" "+t.escapeExpression(t.lambda(null!=e?i(e,"source"):e,e))+"\n"},compiler:[8,">= 4.3.0"],main:function(t,e,r,i,a){var s,l=t.lambda,u=t.escapeExpression,c=null!=e?e:t.nullContext||{},h=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return'