cozy-bar 7.17.2 → 7.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cozy-bar.min.js
CHANGED
|
@@ -53,5 +53,5 @@ object-assign
|
|
|
53
53
|
* Released under MIT license <https://lodash.com/license>
|
|
54
54
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
55
55
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
56
|
-
*/(function(){var i="Expected a function",a="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",s="[object Array]",l="[object Boolean]",f="[object Date]",p="[object Error]",d="[object Function]",h="[object GeneratorFunction]",v="[object Map]",y="[object Number]",g="[object Object]",m="[object RegExp]",b="[object Set]",w="[object String]",k="[object Symbol]",x="[object WeakMap]",_="[object ArrayBuffer]",O="[object DataView]",S="[object Float32Array]",E="[object Float64Array]",j="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",A="[object Uint16Array]",D="[object Uint32Array]",R=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(z.source),L=RegExp(M.source),U=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,G=RegExp($.source),V=/^\s+|\s+$/g,J=/^\s+/,Y=/\s+$/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,oe=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,ue=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,se=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,fe=/['\n\r\u2028\u2029\\]/g,pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",he="[\\ud800-\\udfff]",ve="["+de+"]",ye="["+pe+"]",ge="\\d+",me="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",we="[^\\ud800-\\udfff"+de+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ke="\\ud83c[\\udffb-\\udfff]",xe="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",Oe="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="(?:"+be+"|"+we+")",je="(?:"+Se+"|"+we+")",Pe="(?:"+ye+"|"+ke+")"+"?",Ce="[\\ufe0e\\ufe0f]?"+Pe+("(?:\\u200d(?:"+[xe,_e,Oe].join("|")+")[\\ufe0e\\ufe0f]?"+Pe+")*"),Te="(?:"+[me,_e,Oe].join("|")+")"+Ce,Ae="(?:"+[xe+ye+"?",ye,_e,Oe,he].join("|")+")",De=RegExp("['’]","g"),Re=RegExp(ye,"g"),Ie=RegExp(ke+"(?="+ke+")|"+Ae+Ce,"g"),Ne=RegExp([Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",je+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+Ee,"$"].join("|")+")",Se+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Te].join("|"),"g"),ze=RegExp("[\\u200d\\ud800-\\udfff"+pe+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Le=-1,Ue={};Ue[S]=Ue[E]=Ue[j]=Ue[P]=Ue[C]=Ue[T]=Ue["[object Uint8ClampedArray]"]=Ue[A]=Ue[D]=!0,Ue[c]=Ue[s]=Ue[_]=Ue[l]=Ue[O]=Ue[f]=Ue[p]=Ue[d]=Ue[v]=Ue[y]=Ue[g]=Ue[m]=Ue[b]=Ue[w]=Ue[x]=!1;var Be={};Be[c]=Be[s]=Be[_]=Be[O]=Be[l]=Be[f]=Be[S]=Be[E]=Be[j]=Be[P]=Be[C]=Be[v]=Be[y]=Be[g]=Be[m]=Be[b]=Be[w]=Be[k]=Be[T]=Be["[object Uint8ClampedArray]"]=Be[A]=Be[D]=!0,Be[p]=Be[d]=Be[x]=!1;var qe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},He=parseFloat,We=parseInt,Qe="object"==typeof e&&e&&e.Object===Object&&e,$e="object"==typeof self&&self&&self.Object===Object&&self,Ge=Qe||$e||Function("return this")(),Ve=t&&!t.nodeType&&t,Je=Ve&&"object"==typeof r&&r&&!r.nodeType&&r,Ye=Je&&Je.exports===Ve,Ke=Ye&&Qe.process,Xe=function(){try{var e=Je&&Je.require&&Je.require("util").types;return e||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ze=Xe&&Xe.isArrayBuffer,et=Xe&&Xe.isDate,tt=Xe&&Xe.isMap,nt=Xe&&Xe.isRegExp,rt=Xe&&Xe.isSet,ot=Xe&&Xe.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function ut(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function st(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function lt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function ft(e,t){return!!(null==e?0:e.length)&&kt(e,t,0)>-1}function pt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function dt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ht(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function vt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function yt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function gt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=St("length");function bt(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}function wt(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function kt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):wt(e,_t,n)}function xt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function _t(e){return e!=e}function Ot(e,t){var n=null==e?0:e.length;return n?Pt(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Et(e){return function(t){return null==e?void 0:e[t]}}function jt(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}function Pt(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Ct(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Tt(e){return function(t){return e(t)}}function At(e,t){return dt(t,(function(t){return e[t]}))}function Dt(e,t){return e.has(t)}function Rt(e,t){for(var n=-1,r=e.length;++n<r&&kt(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&&kt(t,e[n],0)>-1;);return n}function Nt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var zt=Et({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mt=Et({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+qe[e]}function Lt(e){return ze.test(e)}function Ut(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Bt(e,t){return function(n){return e(t(n))}}function qt(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var u=e[n];u!==t&&u!==a||(e[n]=a,i[o++]=n)}return i}function Ht(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function Wt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function Qt(e){return Lt(e)?function(e){var t=Ie.lastIndex=0;for(;Ie.test(e);)++t;return t}(e):mt(e)}function $t(e){return Lt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}var Gt=Et({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Vt=function e(t){var n,r=(t=null==t?Ge:Vt.defaults(Ge.Object(),t,Vt.pick(Ge,Fe))).Array,o=t.Date,pe=t.Error,de=t.Function,he=t.Math,ve=t.Object,ye=t.RegExp,ge=t.String,me=t.TypeError,be=r.prototype,we=de.prototype,ke=ve.prototype,xe=t["__core-js_shared__"],_e=we.toString,Oe=ke.hasOwnProperty,Se=0,Ee=(n=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",je=ke.toString,Pe=_e.call(ve),Ce=Ge._,Te=ye("^"+_e.call(Oe).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=Ye?t.Buffer:void 0,Ie=t.Symbol,ze=t.Uint8Array,qe=Ae?Ae.allocUnsafe:void 0,Qe=Bt(ve.getPrototypeOf,ve),$e=ve.create,Ve=ke.propertyIsEnumerable,Je=be.splice,Ke=Ie?Ie.isConcatSpreadable:void 0,Xe=Ie?Ie.iterator:void 0,mt=Ie?Ie.toStringTag:void 0,Et=function(){try{var e=ei(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Jt=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Yt=o&&o.now!==Ge.Date.now&&o.now,Kt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Xt=he.ceil,Zt=he.floor,en=ve.getOwnPropertySymbols,tn=Ae?Ae.isBuffer:void 0,nn=t.isFinite,rn=be.join,on=Bt(ve.keys,ve),an=he.max,un=he.min,cn=o.now,sn=t.parseInt,ln=he.random,fn=be.reverse,pn=ei(t,"DataView"),dn=ei(t,"Map"),hn=ei(t,"Promise"),vn=ei(t,"Set"),yn=ei(t,"WeakMap"),gn=ei(ve,"create"),mn=yn&&new yn,bn={},wn=ji(pn),kn=ji(dn),xn=ji(hn),_n=ji(vn),On=ji(yn),Sn=Ie?Ie.prototype:void 0,En=Sn?Sn.valueOf:void 0,jn=Sn?Sn.toString:void 0;function Pn(e){if(Wa(e)&&!Ra(e)&&!(e instanceof Dn)){if(e instanceof An)return e;if(Oe.call(e,"__wrapped__"))return Pi(e)}return new An(e)}var Cn=function(){function e(){}return function(t){if(!Ha(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function An(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Dn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function In(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Nn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new In(e);this.size=t.size}function Fn(e,t){var n=Ra(e),r=!n&&Da(e),o=!n&&!r&&Ma(e),i=!n&&!r&&!o&&Xa(e),a=n||r||o||i,u=a?Ct(e.length,ge):[],c=u.length;for(var s in e)!t&&!Oe.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ui(s,c))||u.push(s);return u}function Ln(e){var t=e.length;return t?e[zr(0,t-1)]:void 0}function Un(e,t){return Oi(mo(e),Jn(t,0,e.length))}function Bn(e){return Oi(mo(e))}function qn(e,t,n){(void 0!==n&&!Ca(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Hn(e,t,n){var r=e[t];Oe.call(e,t)&&Ca(r,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function Wn(e,t){for(var n=e.length;n--;)if(Ca(e[n][0],t))return n;return-1}function Qn(e,t,n,r){return er(e,(function(e,o,i){t(r,e,n(e),i)})),r}function $n(e,t){return e&&bo(t,wu(t),e)}function Gn(e,t,n){"__proto__"==t&&Et?Et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Vn(e,t){for(var n=-1,o=t.length,i=r(o),a=null==e;++n<o;)i[n]=a?void 0:vu(e,t[n]);return i}function Jn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Yn(e,t,n,r,o,i){var a,u=1&t,s=2&t,p=4&t;if(n&&(a=o?n(e,r,o,i):n(e)),void 0!==a)return a;if(!Ha(e))return e;var x=Ra(e);if(x){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return mo(e,a)}else{var R=ri(e),I=R==d||R==h;if(Ma(e))return fo(e,u);if(R==g||R==c||I&&!o){if(a=s||I?{}:ii(e),!u)return s?function(e,t){return bo(e,ni(e),t)}(e,function(e,t){return e&&bo(t,ku(t),e)}(a,e)):function(e,t){return bo(e,ti(e),t)}(e,$n(a,e))}else{if(!Be[R])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case _:return po(e);case l:case f:return new r(+e);case O:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case S:case E:case j:case P:case C:case T:case"[object Uint8ClampedArray]":case A:case D:return ho(e,n);case v:return new r;case y:case w:return new r(e);case m:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case k:return o=e,En?ve(En.call(o)):{}}var o}(e,R,u)}}i||(i=new Mn);var N=i.get(e);if(N)return N;i.set(e,a),Ja(e)?e.forEach((function(r){a.add(Yn(r,t,n,r,e,i))})):Qa(e)&&e.forEach((function(r,o){a.set(o,Yn(r,t,n,o,e,i))}));var z=x?void 0:(p?s?Go:$o:s?ku:wu)(e);return ut(z||e,(function(r,o){z&&(r=e[o=r]),Hn(a,o,Yn(r,t,n,o,e,i))})),a}function Kn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ve(e);r--;){var o=n[r],i=t[o],a=e[o];if(void 0===a&&!(o in e)||!i(a))return!1}return!0}function Xn(e,t,n){if("function"!=typeof e)throw new me(i);return wi((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,r){var o=-1,i=ft,a=!0,u=e.length,c=[],s=t.length;if(!u)return c;n&&(t=dt(t,Tt(n))),r?(i=pt,a=!1):t.length>=200&&(i=Dt,a=!1,t=new zn(t));e:for(;++o<u;){var l=e[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,a&&f==f){for(var p=s;p--;)if(t[p]===f)continue e;c.push(l)}else i(t,f,r)||c.push(l)}return c}Pn.templateSettings={escape:U,evaluate:B,interpolate:q,variable:"",imports:{_:Pn}},Pn.prototype=Tn.prototype,Pn.prototype.constructor=Pn,An.prototype=Cn(Tn.prototype),An.prototype.constructor=An,Dn.prototype=Cn(Tn.prototype),Dn.prototype.constructor=Dn,Rn.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Oe.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:Oe.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gn&&void 0===t?"__lodash_hash_undefined__":t,this},In.prototype.clear=function(){this.__data__=[],this.size=0},In.prototype.delete=function(e){var t=this.__data__,n=Wn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Je.call(t,n,1),--this.size,!0)},In.prototype.get=function(e){var t=this.__data__,n=Wn(t,e);return n<0?void 0:t[n][1]},In.prototype.has=function(e){return Wn(this.__data__,e)>-1},In.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Nn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(dn||In),string:new Rn}},Nn.prototype.delete=function(e){var t=Xo(this,e).delete(e);return this.size-=t?1:0,t},Nn.prototype.get=function(e){return Xo(this,e).get(e)},Nn.prototype.has=function(e){return Xo(this,e).has(e)},Nn.prototype.set=function(e,t){var n=Xo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},zn.prototype.add=zn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},zn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new In,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof In){var r=n.__data__;if(!dn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(e,t),this.size=n.size,this};var er=xo(cr),tr=xo(sr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],a=t(i);if(null!=a&&(void 0===u?a==a&&!Ka(a):n(a,u)))var u=a,c=i}return c}function or(e,t){var n=[];return er(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function ir(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ai),o||(o=[]);++i<a;){var u=e[i];t>0&&n(u)?t>1?ir(u,t-1,n,r,o):ht(o,u):r||(o[o.length]=u)}return o}var ar=_o(),ur=_o(!0);function cr(e,t){return e&&ar(e,t,wu)}function sr(e,t){return e&&ur(e,t,wu)}function lr(e,t){return lt(t,(function(t){return Ua(e[t])}))}function fr(e,t){for(var n=0,r=(t=uo(t,e)).length;null!=e&&n<r;)e=e[Ei(t[n++])];return n&&n==r?e:void 0}function pr(e,t,n){var r=t(e);return Ra(e)?r:ht(r,n(e))}function dr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":mt&&mt in ve(e)?function(e){var t=Oe.call(e,mt),n=e[mt];try{e[mt]=void 0;var r=!0}catch(e){}var o=je.call(e);r&&(t?e[mt]=n:delete e[mt]);return o}(e):function(e){return je.call(e)}(e)}function hr(e,t){return e>t}function vr(e,t){return null!=e&&Oe.call(e,t)}function yr(e,t){return null!=e&&t in ve(e)}function gr(e,t,n){for(var o=n?pt:ft,i=e[0].length,a=e.length,u=a,c=r(a),s=1/0,l=[];u--;){var f=e[u];u&&t&&(f=dt(f,Tt(t))),s=un(f.length,s),c[u]=!n&&(t||i>=120&&f.length>=120)?new zn(u&&f):void 0}f=e[0];var p=-1,d=c[0];e:for(;++p<i&&l.length<s;){var h=f[p],v=t?t(h):h;if(h=n||0!==h?h:0,!(d?Dt(d,v):o(l,v,n))){for(u=a;--u;){var y=c[u];if(!(y?Dt(y,v):o(e[u],v,n)))continue e}d&&d.push(v),l.push(h)}}return l}function mr(e,t,n){var r=null==(e=yi(e,t=uo(t,e)))?e:e[Ei(Li(t))];return null==r?void 0:it(r,e,n)}function br(e){return Wa(e)&&dr(e)==c}function wr(e,t,n,r,o){return e===t||(null==e||null==t||!Wa(e)&&!Wa(t)?e!=e&&t!=t:function(e,t,n,r,o,i){var a=Ra(e),u=Ra(t),d=a?s:ri(e),h=u?s:ri(t),x=(d=d==c?g:d)==g,S=(h=h==c?g:h)==g,E=d==h;if(E&&Ma(e)){if(!Ma(t))return!1;a=!0,x=!1}if(E&&!x)return i||(i=new Mn),a||Xa(e)?Wo(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!i(new ze(e),new ze(t)));case l:case f:case y:return Ca(+e,+t);case p:return e.name==t.name&&e.message==t.message;case m:case w:return e==t+"";case v:var u=Ut;case b:var c=1&r;if(u||(u=Ht),e.size!=t.size&&!c)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var d=Wo(u(e),u(t),r,o,i,a);return a.delete(e),d;case k:if(En)return En.call(e)==En.call(t)}return!1}(e,t,d,n,r,o,i);if(!(1&n)){var j=x&&Oe.call(e,"__wrapped__"),P=S&&Oe.call(t,"__wrapped__");if(j||P){var C=j?e.value():e,T=P?t.value():t;return i||(i=new Mn),o(C,T,n,r,i)}}if(!E)return!1;return i||(i=new Mn),function(e,t,n,r,o,i){var a=1&n,u=$o(e),c=u.length,s=$o(t).length;if(c!=s&&!a)return!1;var l=c;for(;l--;){var f=u[l];if(!(a?f in t:Oe.call(t,f)))return!1}var p=i.get(e),d=i.get(t);if(p&&d)return p==t&&d==e;var h=!0;i.set(e,t),i.set(t,e);var v=a;for(;++l<c;){f=u[l];var y=e[f],g=t[f];if(r)var m=a?r(g,y,f,t,e,i):r(y,g,f,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){h=!1;break}v||(v="constructor"==f)}if(h&&!v){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i)}(e,t,n,r,wr,o))}function kr(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=ve(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=n[o])[0],s=e[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in e))return!1}else{var f=new Mn;if(r)var p=r(s,l,c,e,t,f);if(!(void 0===p?wr(l,s,3,r,f):p))return!1}}return!0}function xr(e){return!(!Ha(e)||(t=e,Ee&&Ee in t))&&(Ua(e)?Te:ae).test(ji(e));var t}function _r(e){return"function"==typeof e?e:null==e?$u:"object"==typeof e?Ra(e)?Cr(e[0],e[1]):Pr(e):tc(e)}function Or(e){if(!pi(e))return on(e);var t=[];for(var n in ve(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Sr(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=pi(e),n=[];for(var r in e)("constructor"!=r||!t&&Oe.call(e,r))&&n.push(r);return n}function Er(e,t){return e<t}function jr(e,t){var n=-1,o=Na(e)?r(e.length):[];return er(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}function Pr(e){var t=Zo(e);return 1==t.length&&t[0][2]?hi(t[0][0],t[0][1]):function(n){return n===e||kr(n,e,t)}}function Cr(e,t){return si(e)&&di(t)?hi(Ei(e),t):function(n){var r=vu(n,e);return void 0===r&&r===t?yu(n,e):wr(t,r,3)}}function Tr(e,t,n,r,o){e!==t&&ar(t,(function(i,a){if(o||(o=new Mn),Ha(i))!function(e,t,n,r,o,i,a){var u=mi(e,n),c=mi(t,n),s=a.get(c);if(s)return void qn(e,n,s);var l=i?i(u,c,n+"",e,t,a):void 0,f=void 0===l;if(f){var p=Ra(c),d=!p&&Ma(c),h=!p&&!d&&Xa(c);l=c,p||d||h?Ra(u)?l=u:za(u)?l=mo(u):d?(f=!1,l=fo(c,!0)):h?(f=!1,l=ho(c,!0)):l=[]:Ga(c)||Da(c)?(l=u,Da(u)?l=au(u):Ha(u)&&!Ua(u)||(l=ii(c))):f=!1}f&&(a.set(c,l),o(l,c,r,i,a),a.delete(c));qn(e,n,l)}(e,t,a,n,Tr,r,o);else{var u=r?r(mi(e,a),i,a+"",e,t,o):void 0;void 0===u&&(u=i),qn(e,a,u)}}),ku)}function Ar(e,t){var n=e.length;if(n)return ui(t+=t<0?n:0,n)?e[t]:void 0}function Dr(e,t,n){t=t.length?dt(t,(function(e){return Ra(e)?function(t){return fr(t,1===e.length?e[0]:e)}:e})):[$u];var r=-1;return t=dt(t,Tt(Ko())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(jr(e,(function(e,n,o){return{criteria:dt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,u=n.length;for(;++r<a;){var c=vo(o[r],i[r]);if(c){if(r>=u)return c;var s=n[r];return c*("desc"==s?-1:1)}}return e.index-t.index}(e,t,n)}))}function Rr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],u=fr(e,a);n(u,a)&&Br(i,uo(a,e),u)}return i}function Ir(e,t,n,r){var o=r?xt:kt,i=-1,a=t.length,u=e;for(e===t&&(t=mo(t)),n&&(u=dt(e,Tt(n)));++i<a;)for(var c=0,s=t[i],l=n?n(s):s;(c=o(u,l,c,r))>-1;)u!==e&&Je.call(u,c,1),Je.call(e,c,1);return e}function Nr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;ui(o)?Je.call(e,o,1):Zr(e,o)}}return e}function zr(e,t){return e+Zt(ln()*(t-e+1))}function Mr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Fr(e,t){return ki(vi(e,t,$u),e+"")}function Lr(e){return Ln(Cu(e))}function Ur(e,t){var n=Cu(e);return Oi(n,Jn(t,0,n.length))}function Br(e,t,n,r){if(!Ha(e))return e;for(var o=-1,i=(t=uo(t,e)).length,a=i-1,u=e;null!=u&&++o<i;){var c=Ei(t[o]),s=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=u[c];void 0===(s=r?r(l,c,u):void 0)&&(s=Ha(l)?l:ui(t[o+1])?[]:{})}Hn(u,c,s),u=u[c]}return e}var qr=mn?function(e,t){return mn.set(e,t),e}:$u,Hr=Et?function(e,t){return Et(e,"toString",{configurable:!0,enumerable:!1,value:Hu(t),writable:!0})}:$u;function Wr(e){return Oi(Cu(e))}function Qr(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function $r(e,t){var n;return er(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!Ka(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return Vr(e,t,$u,n)}function Vr(e,t,n,r){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,u=null===t,c=Ka(t),s=void 0===t;o<i;){var l=Zt((o+i)/2),f=n(e[l]),p=void 0!==f,d=null===f,h=f==f,v=Ka(f);if(a)var y=r||h;else y=s?h&&(r||p):u?h&&p&&(r||!d):c?h&&p&&!d&&(r||!v):!d&&!v&&(r?f<=t:f<t);y?o=l+1:i=l}return un(i,4294967294)}function Jr(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],u=t?t(a):a;if(!n||!Ca(u,c)){var c=u;i[o++]=0===a?0:a}}return i}function Yr(e){return"number"==typeof e?e:Ka(e)?NaN:+e}function Kr(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,Kr)+"";if(Ka(e))return jn?jn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xr(e,t,n){var r=-1,o=ft,i=e.length,a=!0,u=[],c=u;if(n)a=!1,o=pt;else if(i>=200){var s=t?null:Fo(e);if(s)return Ht(s);a=!1,o=Dt,c=new zn}else c=t?[]:u;e:for(;++r<i;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var p=c.length;p--;)if(c[p]===f)continue e;t&&c.push(f),u.push(l)}else o(c,f,n)||(c!==u&&c.push(f),u.push(l))}return u}function Zr(e,t){return null==(e=yi(e,t=uo(t,e)))||delete e[Ei(Li(t))]}function eo(e,t,n,r){return Br(e,t,n(fr(e,t)),r)}function to(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?Qr(e,r?0:i,r?i+1:o):Qr(e,r?i+1:0,r?o:i)}function no(e,t){var n=e;return n instanceof Dn&&(n=n.value()),vt(t,(function(e,t){return t.func.apply(t.thisArg,ht([e],t.args))}),n)}function ro(e,t,n){var o=e.length;if(o<2)return o?Xr(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var u=e[i],c=-1;++c<o;)c!=i&&(a[i]=Zn(a[i]||u,e[c],t,n));return Xr(ir(a,1),t,n)}function oo(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;){var u=r<i?t[r]:void 0;n(a,e[r],u)}return a}function io(e){return za(e)?e:[]}function ao(e){return"function"==typeof e?e:$u}function uo(e,t){return Ra(e)?e:si(e,t)?[e]:Si(uu(e))}var co=Fr;function so(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Qr(e,t,n)}var lo=Jt||function(e){return Ge.clearTimeout(e)};function fo(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function ho(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Ka(e),a=void 0!==t,u=null===t,c=t==t,s=Ka(t);if(!u&&!s&&!i&&e>t||i&&a&&c&&!u&&!s||r&&a&&c||!n&&c||!o)return 1;if(!r&&!i&&!s&&e<t||s&&n&&o&&!r&&!i||u&&n&&o||!a&&o||!c)return-1}return 0}function yo(e,t,n,o){for(var i=-1,a=e.length,u=n.length,c=-1,s=t.length,l=an(a-u,0),f=r(s+l),p=!o;++c<s;)f[c]=t[c];for(;++i<u;)(p||i<a)&&(f[n[i]]=e[i]);for(;l--;)f[c++]=e[i++];return f}function go(e,t,n,o){for(var i=-1,a=e.length,u=-1,c=n.length,s=-1,l=t.length,f=an(a-c,0),p=r(f+l),d=!o;++i<f;)p[i]=e[i];for(var h=i;++s<l;)p[h+s]=t[s];for(;++u<c;)(d||i<a)&&(p[h+n[u]]=e[i++]);return p}function mo(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function bo(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var u=t[i],c=r?r(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),o?Gn(n,u,c):Hn(n,u,c)}return n}function wo(e,t){return function(n,r){var o=Ra(n)?at:Qn,i=t?t():{};return o(n,e,Ko(r,2),i)}}function ko(e){return Fr((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ci(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=ve(t);++r<o;){var u=n[r];u&&e(t,u,r,i)}return t}))}function xo(e,t){return function(n,r){if(null==n)return n;if(!Na(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=ve(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function _o(e){return function(t,n,r){for(var o=-1,i=ve(t),a=r(t),u=a.length;u--;){var c=a[e?u:++o];if(!1===n(i[c],c,i))break}return t}}function Oo(e){return function(t){var n=Lt(t=uu(t))?$t(t):void 0,r=n?n[0]:t.charAt(0),o=n?so(n,1).join(""):t.slice(1);return r[e]()+o}}function So(e){return function(t){return vt(Uu(Du(t).replace(De,"")),e,"")}}function Eo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Cn(e.prototype),r=e.apply(n,t);return Ha(r)?r:n}}function jo(e){return function(t,n,r){var o=ve(t);if(!Na(t)){var i=Ko(n,3);t=wu(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[i?t[a]:a]:void 0}}function Po(e){return Qo((function(t){var n=t.length,r=n,o=An.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new me(i);if(o&&!u&&"wrapper"==Jo(a))var u=new An([],!0)}for(r=u?r:n;++r<n;){var c=Jo(a=t[r]),s="wrapper"==c?Vo(a):void 0;u=s&&li(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?u[Jo(s[0])].apply(u,s[3]):1==a.length&&li(a)?u[c]():u.thru(a)}return function(){var e=arguments,r=e[0];if(u&&1==e.length&&Ra(r))return u.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}function Co(e,t,n,o,i,a,u,c,s,l){var f=128&t,p=1&t,d=2&t,h=24&t,v=512&t,y=d?void 0:Eo(e);return function g(){for(var m=arguments.length,b=r(m),w=m;w--;)b[w]=arguments[w];if(h)var k=Yo(g),x=Nt(b,k);if(o&&(b=yo(b,o,i,h)),a&&(b=go(b,a,u,h)),m-=x,h&&m<l){var _=qt(b,k);return zo(e,t,Co,g.placeholder,n,b,_,c,s,l-m)}var O=p?n:this,S=d?O[e]:e;return m=b.length,c?b=gi(b,c):v&&m>1&&b.reverse(),f&&s<m&&(b.length=s),this&&this!==Ge&&this instanceof g&&(S=y||Eo(S)),S.apply(O,b)}}function To(e,t){return function(n,r){return function(e,t,n,r){return cr(e,(function(e,o,i){t(r,n(e),o,i)})),r}(n,e,t(r),{})}}function Ao(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Kr(n),r=Kr(r)):(n=Yr(n),r=Yr(r)),o=e(n,r)}return o}}function Do(e){return Qo((function(t){return t=dt(t,Tt(Ko())),Fr((function(n){var r=this;return e(t,(function(e){return it(e,r,n)}))}))}))}function Ro(e,t){var n=(t=void 0===t?" ":Kr(t)).length;if(n<2)return n?Mr(t,e):t;var r=Mr(t,Xt(e/Qt(t)));return Lt(t)?so($t(r),0,e).join(""):r.slice(0,e)}function Io(e){return function(t,n,o){return o&&"number"!=typeof o&&ci(t,n,o)&&(n=o=void 0),t=nu(t),void 0===n?(n=t,t=0):n=nu(n),function(e,t,n,o){for(var i=-1,a=an(Xt((t-e)/(n||1)),0),u=r(a);a--;)u[o?a:++i]=e,e+=n;return u}(t,n,o=void 0===o?t<n?1:-1:nu(o),e)}}function No(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=iu(t),n=iu(n)),e(t,n)}}function zo(e,t,n,r,o,i,a,u,c,s){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var f=[e,t,o,l?i:void 0,l?a:void 0,l?void 0:i,l?void 0:a,u,c,s],p=n.apply(void 0,f);return li(e)&&bi(p,f),p.placeholder=r,xi(p,e,t)}function Mo(e){var t=he[e];return function(e,n){if(e=iu(e),(n=null==n?0:un(ru(n),292))&&nn(e)){var r=(uu(e)+"e").split("e");return+((r=(uu(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Fo=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Ku;function Lo(e){return function(t){var n=ri(t);return n==v?Ut(t):n==b?Wt(t):function(e,t){return dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Uo(e,t,n,o,u,c,s,l){var f=2&t;if(!f&&"function"!=typeof e)throw new me(i);var p=o?o.length:0;if(p||(t&=-97,o=u=void 0),s=void 0===s?s:an(ru(s),0),l=void 0===l?l:ru(l),p-=u?u.length:0,64&t){var d=o,h=u;o=u=void 0}var v=f?void 0:Vo(e),y=[e,t,n,o,u,d,h,c,s,l];if(v&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,u=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!u)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var s=e[3];e[3]=s?yo(s,c,t[4]):c,e[4]=s?qt(e[3],a):t[4]}(c=t[5])&&(s=e[5],e[5]=s?go(s,c,t[6]):c,e[6]=s?qt(e[5],a):t[6]);(c=t[7])&&(e[7]=c);128&r&&(e[8]=null==e[8]?t[8]:un(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(y,v),e=y[0],t=y[1],n=y[2],o=y[3],u=y[4],!(l=y[9]=void 0===y[9]?f?0:e.length:an(y[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var o=Eo(e);return function i(){for(var a=arguments.length,u=r(a),c=a,s=Yo(i);c--;)u[c]=arguments[c];var l=a<3&&u[0]!==s&&u[a-1]!==s?[]:qt(u,s);if((a-=l.length)<n)return zo(e,t,Co,i.placeholder,void 0,u,l,void 0,void 0,n-a);var f=this&&this!==Ge&&this instanceof i?o:e;return it(f,this,u)}}(e,t,l):32!=t&&33!=t||u.length?Co.apply(void 0,y):function(e,t,n,o){var i=1&t,a=Eo(e);return function t(){for(var u=-1,c=arguments.length,s=-1,l=o.length,f=r(l+c),p=this&&this!==Ge&&this instanceof t?a:e;++s<l;)f[s]=o[s];for(;c--;)f[s++]=arguments[++u];return it(p,i?n:this,f)}}(e,t,n,o);else var g=function(e,t,n){var r=1&t,o=Eo(e);return function t(){var i=this&&this!==Ge&&this instanceof t?o:e;return i.apply(r?n:this,arguments)}}(e,t,n);return xi((v?qr:bi)(g,y),e,t)}function Bo(e,t,n,r){return void 0===e||Ca(e,ke[n])&&!Oe.call(r,n)?t:e}function qo(e,t,n,r,o,i){return Ha(e)&&Ha(t)&&(i.set(t,e),Tr(e,t,void 0,qo,i),i.delete(t)),e}function Ho(e){return Ga(e)?void 0:e}function Wo(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),l=i.get(t);if(s&&l)return s==t&&l==e;var f=-1,p=!0,d=2&n?new zn:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var h=e[f],v=t[f];if(r)var y=a?r(v,h,f,t,e,i):r(h,v,f,e,t,i);if(void 0!==y){if(y)continue;p=!1;break}if(d){if(!gt(t,(function(e,t){if(!Dt(d,t)&&(h===e||o(h,e,n,r,i)))return d.push(t)}))){p=!1;break}}else if(h!==v&&!o(h,v,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Qo(e){return ki(vi(e,void 0,Ii),e+"")}function $o(e){return pr(e,wu,ti)}function Go(e){return pr(e,ku,ni)}var Vo=mn?function(e){return mn.get(e)}:Ku;function Jo(e){for(var t=e.name+"",n=bn[t],r=Oe.call(bn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function Yo(e){return(Oe.call(Pn,"placeholder")?Pn:e).placeholder}function Ko(){var e=Pn.iteratee||Gu;return e=e===Gu?_r:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Zo(e){for(var t=wu(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,di(o)]}return t}function ei(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return xr(n)?n:void 0}var ti=en?function(e){return null==e?[]:(e=ve(e),lt(en(e),(function(t){return Ve.call(e,t)})))}:oc,ni=en?function(e){for(var t=[];e;)ht(t,ti(e)),e=Qe(e);return t}:oc,ri=dr;function oi(e,t,n){for(var r=-1,o=(t=uo(t,e)).length,i=!1;++r<o;){var a=Ei(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&qa(o)&&ui(a,o)&&(Ra(e)||Da(e))}function ii(e){return"function"!=typeof e.constructor||pi(e)?{}:Cn(Qe(e))}function ai(e){return Ra(e)||Da(e)||!!(Ke&&e&&e[Ke])}function ui(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ce.test(e))&&e>-1&&e%1==0&&e<t}function ci(e,t,n){if(!Ha(n))return!1;var r=typeof t;return!!("number"==r?Na(n)&&ui(t,n.length):"string"==r&&t in n)&&Ca(n[t],e)}function si(e,t){if(Ra(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ka(e))||(W.test(e)||!H.test(e)||null!=t&&e in ve(t))}function li(e){var t=Jo(e),n=Pn[t];if("function"!=typeof n||!(t in Dn.prototype))return!1;if(e===n)return!0;var r=Vo(n);return!!r&&e===r[0]}(pn&&ri(new pn(new ArrayBuffer(1)))!=O||dn&&ri(new dn)!=v||hn&&"[object Promise]"!=ri(hn.resolve())||vn&&ri(new vn)!=b||yn&&ri(new yn)!=x)&&(ri=function(e){var t=dr(e),n=t==g?e.constructor:void 0,r=n?ji(n):"";if(r)switch(r){case wn:return O;case kn:return v;case xn:return"[object Promise]";case _n:return b;case On:return x}return t});var fi=xe?Ua:ic;function pi(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ke)}function di(e){return e==e&&!Ha(e)}function hi(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in ve(n)))}}function vi(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=an(o.length-t,0),u=r(a);++i<a;)u[i]=o[t+i];i=-1;for(var c=r(t+1);++i<t;)c[i]=o[i];return c[t]=n(u),it(e,this,c)}}function yi(e,t){return t.length<2?e:fr(e,Qr(t,0,-1))}function gi(e,t){for(var n=e.length,r=un(t.length,n),o=mo(e);r--;){var i=t[r];e[r]=ui(i,n)?o[i]:void 0}return e}function mi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var bi=_i(qr),wi=Kt||function(e,t){return Ge.setTimeout(e,t)},ki=_i(Hr);function xi(e,t,n){var r=t+"";return ki(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return ut(u,(function(n){var r="_."+n[0];t&n[1]&&!ft(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Z):[]}(r),n)))}function _i(e){var t=0,n=0;return function(){var r=cn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Oi(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var i=zr(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Si=function(e){var t=_a(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,(function(e,n,r,o){t.push(r?o.replace(te,"$1"):n||e)})),t}));function Ei(e){if("string"==typeof e||Ka(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ji(e){if(null!=e){try{return _e.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pi(e){if(e instanceof Dn)return e.clone();var t=new An(e.__wrapped__,e.__chain__);return t.__actions__=mo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ci=Fr((function(e,t){return za(e)?Zn(e,ir(t,1,za,!0)):[]})),Ti=Fr((function(e,t){var n=Li(t);return za(n)&&(n=void 0),za(e)?Zn(e,ir(t,1,za,!0),Ko(n,2)):[]})),Ai=Fr((function(e,t){var n=Li(t);return za(n)&&(n=void 0),za(e)?Zn(e,ir(t,1,za,!0),void 0,n):[]}));function Di(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ru(n);return o<0&&(o=an(r+o,0)),wt(e,Ko(t,3),o)}function Ri(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ru(n),o=n<0?an(r+o,0):un(o,r-1)),wt(e,Ko(t,3),o,!0)}function Ii(e){return(null==e?0:e.length)?ir(e,1):[]}function Ni(e){return e&&e.length?e[0]:void 0}var zi=Fr((function(e){var t=dt(e,io);return t.length&&t[0]===e[0]?gr(t):[]})),Mi=Fr((function(e){var t=Li(e),n=dt(e,io);return t===Li(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gr(n,Ko(t,2)):[]})),Fi=Fr((function(e){var t=Li(e),n=dt(e,io);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gr(n,void 0,t):[]}));function Li(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ui=Fr(Bi);function Bi(e,t){return e&&e.length&&t&&t.length?Ir(e,t):e}var qi=Qo((function(e,t){var n=null==e?0:e.length,r=Vn(e,t);return Nr(e,dt(t,(function(e){return ui(e,n)?+e:e})).sort(vo)),r}));function Hi(e){return null==e?e:fn.call(e)}var Wi=Fr((function(e){return Xr(ir(e,1,za,!0))})),Qi=Fr((function(e){var t=Li(e);return za(t)&&(t=void 0),Xr(ir(e,1,za,!0),Ko(t,2))})),$i=Fr((function(e){var t=Li(e);return t="function"==typeof t?t:void 0,Xr(ir(e,1,za,!0),void 0,t)}));function Gi(e){if(!e||!e.length)return[];var t=0;return e=lt(e,(function(e){if(za(e))return t=an(e.length,t),!0})),Ct(t,(function(t){return dt(e,St(t))}))}function Vi(e,t){if(!e||!e.length)return[];var n=Gi(e);return null==t?n:dt(n,(function(e){return it(t,void 0,e)}))}var Ji=Fr((function(e,t){return za(e)?Zn(e,t):[]})),Yi=Fr((function(e){return ro(lt(e,za))})),Ki=Fr((function(e){var t=Li(e);return za(t)&&(t=void 0),ro(lt(e,za),Ko(t,2))})),Xi=Fr((function(e){var t=Li(e);return t="function"==typeof t?t:void 0,ro(lt(e,za),void 0,t)})),Zi=Fr(Gi);var ea=Fr((function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Vi(e,n)}));function ta(e){var t=Pn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=Qo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Vn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Dn&&ui(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[o],thisArg:void 0}),new An(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(o)}));var oa=wo((function(e,t,n){Oe.call(e,n)?++e[n]:Gn(e,n,1)}));var ia=jo(Di),aa=jo(Ri);function ua(e,t){return(Ra(e)?ut:er)(e,Ko(t,3))}function ca(e,t){return(Ra(e)?ct:tr)(e,Ko(t,3))}var sa=wo((function(e,t,n){Oe.call(e,n)?e[n].push(t):Gn(e,n,[t])}));var la=Fr((function(e,t,n){var o=-1,i="function"==typeof t,a=Na(e)?r(e.length):[];return er(e,(function(e){a[++o]=i?it(t,e,n):mr(e,t,n)})),a})),fa=wo((function(e,t,n){Gn(e,n,t)}));function pa(e,t){return(Ra(e)?dt:jr)(e,Ko(t,3))}var da=wo((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ha=Fr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ci(e,t[0],t[1])?t=[]:n>2&&ci(t[0],t[1],t[2])&&(t=[t[0]]),Dr(e,ir(t,1),[])})),va=Yt||function(){return Ge.Date.now()};function ya(e,t,n){return t=n?void 0:t,Uo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(e,t){var n;if("function"!=typeof t)throw new me(i);return e=ru(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ma=Fr((function(e,t,n){var r=1;if(n.length){var o=qt(n,Yo(ma));r|=32}return Uo(e,r,t,n,o)})),ba=Fr((function(e,t,n){var r=3;if(n.length){var o=qt(n,Yo(ba));r|=32}return Uo(t,r,e,n,o)}));function wa(e,t,n){var r,o,a,u,c,s,l=0,f=!1,p=!1,d=!0;if("function"!=typeof e)throw new me(i);function h(t){var n=r,i=o;return r=o=void 0,l=t,u=e.apply(i,n)}function v(e){return l=e,c=wi(g,t),f?h(e):u}function y(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-l>=a}function g(){var e=va();if(y(e))return m(e);c=wi(g,function(e){var n=t-(e-s);return p?un(n,a-(e-l)):n}(e))}function m(e){return c=void 0,d&&r?h(e):(r=o=void 0,u)}function b(){var e=va(),n=y(e);if(r=arguments,o=this,s=e,n){if(void 0===c)return v(s);if(p)return lo(c),c=wi(g,t),h(s)}return void 0===c&&(c=wi(g,t)),u}return t=iu(t)||0,Ha(n)&&(f=!!n.leading,a=(p="maxWait"in n)?an(iu(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==c&&lo(c),l=0,r=s=o=c=void 0},b.flush=function(){return void 0===c?u:m(va())},b}var ka=Fr((function(e,t){return Xn(e,1,t)})),xa=Fr((function(e,t,n){return Xn(e,iu(t)||0,n)}));function _a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(_a.Cache||Nn),n}function Oa(e){if("function"!=typeof e)throw new me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}_a.Cache=Nn;var Sa=co((function(e,t){var n=(t=1==t.length&&Ra(t[0])?dt(t[0],Tt(Ko())):dt(ir(t,1),Tt(Ko()))).length;return Fr((function(r){for(var o=-1,i=un(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return it(e,this,r)}))})),Ea=Fr((function(e,t){return Uo(e,32,void 0,t,qt(t,Yo(Ea)))})),ja=Fr((function(e,t){return Uo(e,64,void 0,t,qt(t,Yo(ja)))})),Pa=Qo((function(e,t){return Uo(e,256,void 0,void 0,void 0,t)}));function Ca(e,t){return e===t||e!=e&&t!=t}var Ta=No(hr),Aa=No((function(e,t){return e>=t})),Da=br(function(){return arguments}())?br:function(e){return Wa(e)&&Oe.call(e,"callee")&&!Ve.call(e,"callee")},Ra=r.isArray,Ia=Ze?Tt(Ze):function(e){return Wa(e)&&dr(e)==_};function Na(e){return null!=e&&qa(e.length)&&!Ua(e)}function za(e){return Wa(e)&&Na(e)}var Ma=tn||ic,Fa=et?Tt(et):function(e){return Wa(e)&&dr(e)==f};function La(e){if(!Wa(e))return!1;var t=dr(e);return t==p||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ga(e)}function Ua(e){if(!Ha(e))return!1;var t=dr(e);return t==d||t==h||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ba(e){return"number"==typeof e&&e==ru(e)}function qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wa(e){return null!=e&&"object"==typeof e}var Qa=tt?Tt(tt):function(e){return Wa(e)&&ri(e)==v};function $a(e){return"number"==typeof e||Wa(e)&&dr(e)==y}function Ga(e){if(!Wa(e)||dr(e)!=g)return!1;var t=Qe(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_e.call(n)==Pe}var Va=nt?Tt(nt):function(e){return Wa(e)&&dr(e)==m};var Ja=rt?Tt(rt):function(e){return Wa(e)&&ri(e)==b};function Ya(e){return"string"==typeof e||!Ra(e)&&Wa(e)&&dr(e)==w}function Ka(e){return"symbol"==typeof e||Wa(e)&&dr(e)==k}var Xa=ot?Tt(ot):function(e){return Wa(e)&&qa(e.length)&&!!Ue[dr(e)]};var Za=No(Er),eu=No((function(e,t){return e<=t}));function tu(e){if(!e)return[];if(Na(e))return Ya(e)?$t(e):mo(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=ri(e);return(t==v?Ut:t==b?Ht:Cu)(e)}function nu(e){return e?(e=iu(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ru(e){var t=nu(e),n=t%1;return t==t?n?t-n:t:0}function ou(e){return e?Jn(ru(e),0,4294967295):0}function iu(e){if("number"==typeof e)return e;if(Ka(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(V,"");var n=ie.test(e);return n||ue.test(e)?We(e.slice(2),n?2:8):oe.test(e)?NaN:+e}function au(e){return bo(e,ku(e))}function uu(e){return null==e?"":Kr(e)}var cu=ko((function(e,t){if(pi(t)||Na(t))bo(t,wu(t),e);else for(var n in t)Oe.call(t,n)&&Hn(e,n,t[n])})),su=ko((function(e,t){bo(t,ku(t),e)})),lu=ko((function(e,t,n,r){bo(t,ku(t),e,r)})),fu=ko((function(e,t,n,r){bo(t,wu(t),e,r)})),pu=Qo(Vn);var du=Fr((function(e,t){e=ve(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&ci(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],a=ku(i),u=-1,c=a.length;++u<c;){var s=a[u],l=e[s];(void 0===l||Ca(l,ke[s])&&!Oe.call(e,s))&&(e[s]=i[s])}return e})),hu=Fr((function(e){return e.push(void 0,qo),it(_u,void 0,e)}));function vu(e,t,n){var r=null==e?void 0:fr(e,t);return void 0===r?n:r}function yu(e,t){return null!=e&&oi(e,t,yr)}var gu=To((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=n}),Hu($u)),mu=To((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Oe.call(e,t)?e[t].push(n):e[t]=[n]}),Ko),bu=Fr(mr);function wu(e){return Na(e)?Fn(e):Or(e)}function ku(e){return Na(e)?Fn(e,!0):Sr(e)}var xu=ko((function(e,t,n){Tr(e,t,n)})),_u=ko((function(e,t,n,r){Tr(e,t,n,r)})),Ou=Qo((function(e,t){var n={};if(null==e)return n;var r=!1;t=dt(t,(function(t){return t=uo(t,e),r||(r=t.length>1),t})),bo(e,Go(e),n),r&&(n=Yn(n,7,Ho));for(var o=t.length;o--;)Zr(n,t[o]);return n}));var Su=Qo((function(e,t){return null==e?{}:function(e,t){return Rr(e,t,(function(t,n){return yu(e,n)}))}(e,t)}));function Eu(e,t){if(null==e)return{};var n=dt(Go(e),(function(e){return[e]}));return t=Ko(t),Rr(e,n,(function(e,n){return t(e,n[0])}))}var ju=Lo(wu),Pu=Lo(ku);function Cu(e){return null==e?[]:At(e,wu(e))}var Tu=So((function(e,t,n){return t=t.toLowerCase(),e+(n?Au(t):t)}));function Au(e){return Lu(uu(e).toLowerCase())}function Du(e){return(e=uu(e))&&e.replace(se,zt).replace(Re,"")}var Ru=So((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Iu=So((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Nu=Oo("toLowerCase");var zu=So((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Mu=So((function(e,t,n){return e+(n?" ":"")+Lu(t)}));var Fu=So((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Lu=Oo("toUpperCase");function Uu(e,t,n){return e=uu(e),void 0===(t=n?void 0:t)?function(e){return Me.test(e)}(e)?function(e){return e.match(Ne)||[]}(e):function(e){return e.match(ee)||[]}(e):e.match(t)||[]}var Bu=Fr((function(e,t){try{return it(e,void 0,t)}catch(e){return La(e)?e:new pe(e)}})),qu=Qo((function(e,t){return ut(t,(function(t){t=Ei(t),Gn(e,t,ma(e[t],e))})),e}));function Hu(e){return function(){return e}}var Wu=Po(),Qu=Po(!0);function $u(e){return e}function Gu(e){return _r("function"==typeof e?e:Yn(e,1))}var Vu=Fr((function(e,t){return function(n){return mr(n,e,t)}})),Ju=Fr((function(e,t){return function(n){return mr(e,n,t)}}));function Yu(e,t,n){var r=wu(t),o=lr(t,r);null!=n||Ha(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=lr(t,wu(t)));var i=!(Ha(n)&&"chain"in n&&!n.chain),a=Ua(e);return ut(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=mo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ht([this.value()],arguments))})})),e}function Ku(){}var Xu=Do(dt),Zu=Do(st),ec=Do(gt);function tc(e){return si(e)?St(Ei(e)):function(e){return function(t){return fr(t,e)}}(e)}var nc=Io(),rc=Io(!0);function oc(){return[]}function ic(){return!1}var ac=Ao((function(e,t){return e+t}),0),uc=Mo("ceil"),cc=Ao((function(e,t){return e/t}),1),sc=Mo("floor");var lc,fc=Ao((function(e,t){return e*t}),1),pc=Mo("round"),dc=Ao((function(e,t){return e-t}),0);return Pn.after=function(e,t){if("function"!=typeof t)throw new me(i);return e=ru(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=ya,Pn.assign=cu,Pn.assignIn=su,Pn.assignInWith=lu,Pn.assignWith=fu,Pn.at=pu,Pn.before=ga,Pn.bind=ma,Pn.bindAll=qu,Pn.bindKey=ba,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Pn.chain=ta,Pn.chunk=function(e,t,n){t=(n?ci(e,t,n):void 0===t)?1:an(ru(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,u=r(Xt(o/t));i<o;)u[a++]=Qr(e,i,i+=t);return u},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return ht(Ra(n)?mo(n):[n],ir(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,n=Ko();return e=t?dt(e,(function(e){if("function"!=typeof e[1])throw new me(i);return[n(e[0]),e[1]]})):[],Fr((function(n){for(var r=-1;++r<t;){var o=e[r];if(it(o[0],this,n))return it(o[1],this,n)}}))},Pn.conforms=function(e){return function(e){var t=wu(e);return function(n){return Kn(n,e,t)}}(Yn(e,1))},Pn.constant=Hu,Pn.countBy=oa,Pn.create=function(e,t){var n=Cn(e);return null==t?n:$n(n,t)},Pn.curry=function e(t,n,r){var o=Uo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Pn.curryRight=function e(t,n,r){var o=Uo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Pn.debounce=wa,Pn.defaults=du,Pn.defaultsDeep=hu,Pn.defer=ka,Pn.delay=xa,Pn.difference=Ci,Pn.differenceBy=Ti,Pn.differenceWith=Ai,Pn.drop=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,(t=n||void 0===t?1:ru(t))<0?0:t,r):[]},Pn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,0,(t=r-(t=n||void 0===t?1:ru(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!0):[]},Pn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ci(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ru(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ru(r))<0&&(r+=o),r=n>r?0:ou(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Pn.filter=function(e,t){return(Ra(e)?lt:or)(e,Ko(t,3))},Pn.flatMap=function(e,t){return ir(pa(e,t),1)},Pn.flatMapDeep=function(e,t){return ir(pa(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ru(n),ir(pa(e,t),n)},Pn.flatten=Ii,Pn.flattenDeep=function(e){return(null==e?0:e.length)?ir(e,1/0):[]},Pn.flattenDepth=function(e,t){return(null==e?0:e.length)?ir(e,t=void 0===t?1:ru(t)):[]},Pn.flip=function(e){return Uo(e,512)},Pn.flow=Wu,Pn.flowRight=Qu,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Pn.functions=function(e){return null==e?[]:lr(e,wu(e))},Pn.functionsIn=function(e){return null==e?[]:lr(e,ku(e))},Pn.groupBy=sa,Pn.initial=function(e){return(null==e?0:e.length)?Qr(e,0,-1):[]},Pn.intersection=zi,Pn.intersectionBy=Mi,Pn.intersectionWith=Fi,Pn.invert=gu,Pn.invertBy=mu,Pn.invokeMap=la,Pn.iteratee=Gu,Pn.keyBy=fa,Pn.keys=wu,Pn.keysIn=ku,Pn.map=pa,Pn.mapKeys=function(e,t){var n={};return t=Ko(t,3),cr(e,(function(e,r,o){Gn(n,t(e,r,o),e)})),n},Pn.mapValues=function(e,t){var n={};return t=Ko(t,3),cr(e,(function(e,r,o){Gn(n,r,t(e,r,o))})),n},Pn.matches=function(e){return Pr(Yn(e,1))},Pn.matchesProperty=function(e,t){return Cr(e,Yn(t,1))},Pn.memoize=_a,Pn.merge=xu,Pn.mergeWith=_u,Pn.method=Vu,Pn.methodOf=Ju,Pn.mixin=Yu,Pn.negate=Oa,Pn.nthArg=function(e){return e=ru(e),Fr((function(t){return Ar(t,e)}))},Pn.omit=Ou,Pn.omitBy=function(e,t){return Eu(e,Oa(Ko(t)))},Pn.once=function(e){return ga(2,e)},Pn.orderBy=function(e,t,n,r){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(n=r?void 0:n)||(n=null==n?[]:[n]),Dr(e,t,n))},Pn.over=Xu,Pn.overArgs=Sa,Pn.overEvery=Zu,Pn.overSome=ec,Pn.partial=Ea,Pn.partialRight=ja,Pn.partition=da,Pn.pick=Su,Pn.pickBy=Eu,Pn.property=tc,Pn.propertyOf=function(e){return function(t){return null==e?void 0:fr(e,t)}},Pn.pull=Ui,Pn.pullAll=Bi,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ir(e,t,Ko(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ir(e,t,void 0,n):e},Pn.pullAt=qi,Pn.range=nc,Pn.rangeRight=rc,Pn.rearg=Pa,Pn.reject=function(e,t){return(Ra(e)?lt:or)(e,Oa(Ko(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=Ko(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Nr(e,o),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new me(i);return Fr(e,t=void 0===t?t:ru(t))},Pn.reverse=Hi,Pn.sampleSize=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:ru(t),(Ra(e)?Un:Ur)(e,t)},Pn.set=function(e,t,n){return null==e?e:Br(e,t,n)},Pn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Br(e,t,n,r)},Pn.shuffle=function(e){return(Ra(e)?Bn:Wr)(e)},Pn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ci(e,t,n)?(t=0,n=r):(t=null==t?0:ru(t),n=void 0===n?r:ru(n)),Qr(e,t,n)):[]},Pn.sortBy=ha,Pn.sortedUniq=function(e){return e&&e.length?Jr(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Jr(e,Ko(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ci(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=uu(e))&&("string"==typeof t||null!=t&&!Va(t))&&!(t=Kr(t))&&Lt(e)?so($t(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new me(i);return t=null==t?0:an(ru(t),0),Fr((function(n){var r=n[t],o=so(n,0,t);return r&&ht(o,r),it(e,this,o)}))},Pn.tail=function(e){var t=null==e?0:e.length;return t?Qr(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?Qr(e,0,(t=n||void 0===t?1:ru(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,(t=r-(t=n||void 0===t?1:ru(t)))<0?0:t,r):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?to(e,Ko(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new me(i);return Ha(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),wa(e,t,{leading:r,maxWait:t,trailing:o})},Pn.thru=na,Pn.toArray=tu,Pn.toPairs=ju,Pn.toPairsIn=Pu,Pn.toPath=function(e){return Ra(e)?dt(e,Ei):Ka(e)?[e]:mo(Si(uu(e)))},Pn.toPlainObject=au,Pn.transform=function(e,t,n){var r=Ra(e),o=r||Ma(e)||Xa(e);if(t=Ko(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Ha(e)&&Ua(i)?Cn(Qe(e)):{}}return(o?ut:cr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Pn.unary=function(e){return ya(e,1)},Pn.union=Wi,Pn.unionBy=Qi,Pn.unionWith=$i,Pn.uniq=function(e){return e&&e.length?Xr(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Xr(e,Ko(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xr(e,void 0,t):[]},Pn.unset=function(e,t){return null==e||Zr(e,t)},Pn.unzip=Gi,Pn.unzipWith=Vi,Pn.update=function(e,t,n){return null==e?e:eo(e,t,ao(n))},Pn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:eo(e,t,ao(n),r)},Pn.values=Cu,Pn.valuesIn=function(e){return null==e?[]:At(e,ku(e))},Pn.without=Ji,Pn.words=Uu,Pn.wrap=function(e,t){return Ea(ao(t),e)},Pn.xor=Yi,Pn.xorBy=Ki,Pn.xorWith=Xi,Pn.zip=Zi,Pn.zipObject=function(e,t){return oo(e||[],t||[],Hn)},Pn.zipObjectDeep=function(e,t){return oo(e||[],t||[],Br)},Pn.zipWith=ea,Pn.entries=ju,Pn.entriesIn=Pu,Pn.extend=su,Pn.extendWith=lu,Yu(Pn,Pn),Pn.add=ac,Pn.attempt=Bu,Pn.camelCase=Tu,Pn.capitalize=Au,Pn.ceil=uc,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=iu(n))==n?n:0),void 0!==t&&(t=(t=iu(t))==t?t:0),Jn(iu(e),t,n)},Pn.clone=function(e){return Yn(e,4)},Pn.cloneDeep=function(e){return Yn(e,5)},Pn.cloneDeepWith=function(e,t){return Yn(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return Yn(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Kn(e,t,wu(t))},Pn.deburr=Du,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=cc,Pn.endsWith=function(e,t,n){e=uu(e),t=Kr(t);var r=e.length,o=n=void 0===n?r:Jn(ru(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Pn.eq=Ca,Pn.escape=function(e){return(e=uu(e))&&L.test(e)?e.replace(M,Mt):e},Pn.escapeRegExp=function(e){return(e=uu(e))&&G.test(e)?e.replace($,"\\$&"):e},Pn.every=function(e,t,n){var r=Ra(e)?st:nr;return n&&ci(e,t,n)&&(t=void 0),r(e,Ko(t,3))},Pn.find=ia,Pn.findIndex=Di,Pn.findKey=function(e,t){return bt(e,Ko(t,3),cr)},Pn.findLast=aa,Pn.findLastIndex=Ri,Pn.findLastKey=function(e,t){return bt(e,Ko(t,3),sr)},Pn.floor=sc,Pn.forEach=ua,Pn.forEachRight=ca,Pn.forIn=function(e,t){return null==e?e:ar(e,Ko(t,3),ku)},Pn.forInRight=function(e,t){return null==e?e:ur(e,Ko(t,3),ku)},Pn.forOwn=function(e,t){return e&&cr(e,Ko(t,3))},Pn.forOwnRight=function(e,t){return e&&sr(e,Ko(t,3))},Pn.get=vu,Pn.gt=Ta,Pn.gte=Aa,Pn.has=function(e,t){return null!=e&&oi(e,t,vr)},Pn.hasIn=yu,Pn.head=Ni,Pn.identity=$u,Pn.includes=function(e,t,n,r){e=Na(e)?e:Cu(e),n=n&&!r?ru(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Ya(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&kt(e,t,n)>-1},Pn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ru(n);return o<0&&(o=an(r+o,0)),kt(e,t,o)},Pn.inRange=function(e,t,n){return t=nu(t),void 0===n?(n=t,t=0):n=nu(n),function(e,t,n){return e>=un(t,n)&&e<an(t,n)}(e=iu(e),t,n)},Pn.invoke=bu,Pn.isArguments=Da,Pn.isArray=Ra,Pn.isArrayBuffer=Ia,Pn.isArrayLike=Na,Pn.isArrayLikeObject=za,Pn.isBoolean=function(e){return!0===e||!1===e||Wa(e)&&dr(e)==l},Pn.isBuffer=Ma,Pn.isDate=Fa,Pn.isElement=function(e){return Wa(e)&&1===e.nodeType&&!Ga(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Na(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Xa(e)||Da(e)))return!e.length;var t=ri(e);if(t==v||t==b)return!e.size;if(pi(e))return!Or(e).length;for(var n in e)if(Oe.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return wr(e,t)},Pn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?wr(e,t,void 0,n):!!r},Pn.isError=La,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=Ua,Pn.isInteger=Ba,Pn.isLength=qa,Pn.isMap=Qa,Pn.isMatch=function(e,t){return e===t||kr(e,t,Zo(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,kr(e,t,Zo(t),n)},Pn.isNaN=function(e){return $a(e)&&e!=+e},Pn.isNative=function(e){if(fi(e))throw new pe("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return xr(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=$a,Pn.isObject=Ha,Pn.isObjectLike=Wa,Pn.isPlainObject=Ga,Pn.isRegExp=Va,Pn.isSafeInteger=function(e){return Ba(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Ja,Pn.isString=Ya,Pn.isSymbol=Ka,Pn.isTypedArray=Xa,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Wa(e)&&ri(e)==x},Pn.isWeakSet=function(e){return Wa(e)&&"[object WeakSet]"==dr(e)},Pn.join=function(e,t){return null==e?"":rn.call(e,t)},Pn.kebabCase=Ru,Pn.last=Li,Pn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ru(n))<0?an(r+o,0):un(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):wt(e,_t,o,!0)},Pn.lowerCase=Iu,Pn.lowerFirst=Nu,Pn.lt=Za,Pn.lte=eu,Pn.max=function(e){return e&&e.length?rr(e,$u,hr):void 0},Pn.maxBy=function(e,t){return e&&e.length?rr(e,Ko(t,2),hr):void 0},Pn.mean=function(e){return Ot(e,$u)},Pn.meanBy=function(e,t){return Ot(e,Ko(t,2))},Pn.min=function(e){return e&&e.length?rr(e,$u,Er):void 0},Pn.minBy=function(e,t){return e&&e.length?rr(e,Ko(t,2),Er):void 0},Pn.stubArray=oc,Pn.stubFalse=ic,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=fc,Pn.nth=function(e,t){return e&&e.length?Ar(e,ru(t)):void 0},Pn.noConflict=function(){return Ge._===this&&(Ge._=Ce),this},Pn.noop=Ku,Pn.now=va,Pn.pad=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Ro(Zt(o),n)+e+Ro(Xt(o),n)},Pn.padEnd=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;return t&&r<t?e+Ro(t-r,n):e},Pn.padStart=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;return t&&r<t?Ro(t-r,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(uu(e).replace(J,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ci(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nu(e),void 0===t?(t=e,e=0):t=nu(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=ln();return un(e+o*(t-e+He("1e-"+((o+"").length-1))),t)}return zr(e,t)},Pn.reduce=function(e,t,n){var r=Ra(e)?vt:jt,o=arguments.length<3;return r(e,Ko(t,4),n,o,er)},Pn.reduceRight=function(e,t,n){var r=Ra(e)?yt:jt,o=arguments.length<3;return r(e,Ko(t,4),n,o,tr)},Pn.repeat=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:ru(t),Mr(uu(e),t)},Pn.replace=function(){var e=arguments,t=uu(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var r=-1,o=(t=uo(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var i=null==e?void 0:e[Ei(t[r])];void 0===i&&(r=o,i=n),e=Ua(i)?i.call(e):i}return e},Pn.round=pc,Pn.runInContext=e,Pn.sample=function(e){return(Ra(e)?Ln:Lr)(e)},Pn.size=function(e){if(null==e)return 0;if(Na(e))return Ya(e)?Qt(e):e.length;var t=ri(e);return t==v||t==b?e.size:Or(e).length},Pn.snakeCase=zu,Pn.some=function(e,t,n){var r=Ra(e)?gt:$r;return n&&ci(e,t,n)&&(t=void 0),r(e,Ko(t,3))},Pn.sortedIndex=function(e,t){return Gr(e,t)},Pn.sortedIndexBy=function(e,t,n){return Vr(e,t,Ko(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Ca(e[r],t))return r}return-1},Pn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Vr(e,t,Ko(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=Gr(e,t,!0)-1;if(Ca(e[n],t))return n}return-1},Pn.startCase=Mu,Pn.startsWith=function(e,t,n){return e=uu(e),n=null==n?0:Jn(ru(n),0,e.length),t=Kr(t),e.slice(n,n+t.length)==t},Pn.subtract=dc,Pn.sum=function(e){return e&&e.length?Pt(e,$u):0},Pn.sumBy=function(e,t){return e&&e.length?Pt(e,Ko(t,2)):0},Pn.template=function(e,t,n){var r=Pn.templateSettings;n&&ci(e,t,n)&&(t=void 0),e=uu(e),t=lu({},t,r,Bo);var o,i,a=lu({},t.imports,r.imports,Bo),u=wu(a),c=At(a,u),s=0,l=t.interpolate||le,f="__p += '",p=ye((t.escape||le).source+"|"+l.source+"|"+(l===q?ne:le).source+"|"+(t.evaluate||le).source+"|$","g"),d="//# sourceURL="+(Oe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Le+"]")+"\n";e.replace(p,(function(t,n,r,a,u,c){return r||(r=a),f+=e.slice(s,c).replace(fe,Ft),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),u&&(i=!0,f+="';\n"+u+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+t.length,t})),f+="';\n";var h=Oe.call(t,"variable")&&t.variable;h||(f="with (obj) {\n"+f+"\n}\n"),f=(i?f.replace(R,""):f).replace(I,"$1").replace(N,"$1;"),f="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Bu((function(){return de(u,d+"return "+f).apply(void 0,c)}));if(v.source=f,La(v))throw v;return v},Pn.times=function(e,t){if((e=ru(e))<1||e>9007199254740991)return[];var n=4294967295,r=un(e,4294967295);e-=4294967295;for(var o=Ct(r,t=Ko(t));++n<e;)t(n);return o},Pn.toFinite=nu,Pn.toInteger=ru,Pn.toLength=ou,Pn.toLower=function(e){return uu(e).toLowerCase()},Pn.toNumber=iu,Pn.toSafeInteger=function(e){return e?Jn(ru(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=uu,Pn.toUpper=function(e){return uu(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(V,"");if(!e||!(t=Kr(t)))return e;var r=$t(e),o=$t(t);return so(r,Rt(r,o),It(r,o)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Kr(t)))return e;var r=$t(e);return so(r,0,It(r,$t(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(J,"");if(!e||!(t=Kr(t)))return e;var r=$t(e);return so(r,Rt(r,$t(t))).join("")},Pn.truncate=function(e,t){var n=30,r="...";if(Ha(t)){var o="separator"in t?t.separator:o;n="length"in t?ru(t.length):n,r="omission"in t?Kr(t.omission):r}var i=(e=uu(e)).length;if(Lt(e)){var a=$t(e);i=a.length}if(n>=i)return e;var u=n-Qt(r);if(u<1)return r;var c=a?so(a,0,u).join(""):e.slice(0,u);if(void 0===o)return c+r;if(a&&(u+=c.length-u),Va(o)){if(e.slice(u).search(o)){var s,l=c;for(o.global||(o=ye(o.source,uu(re.exec(o))+"g")),o.lastIndex=0;s=o.exec(l);)var f=s.index;c=c.slice(0,void 0===f?u:f)}}else if(e.indexOf(Kr(o),u)!=u){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Pn.unescape=function(e){return(e=uu(e))&&F.test(e)?e.replace(z,Gt):e},Pn.uniqueId=function(e){var t=++Se;return uu(e)+t},Pn.upperCase=Fu,Pn.upperFirst=Lu,Pn.each=ua,Pn.eachRight=ca,Pn.first=Ni,Yu(Pn,(lc={},cr(Pn,(function(e,t){Oe.call(Pn.prototype,t)||(lc[t]=e)})),lc),{chain:!1}),Pn.VERSION="4.17.19",ut(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Pn[e].placeholder=Pn})),ut(["drop","take"],(function(e,t){Dn.prototype[e]=function(n){n=void 0===n?1:an(ru(n),0);var r=this.__filtered__&&!t?new Dn(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Dn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),ut(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Dn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ko(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),ut(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Dn.prototype[e]=function(){return this[n](1).value()[0]}})),ut(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Dn.prototype[e]=function(){return this.__filtered__?new Dn(this):this[n](1)}})),Dn.prototype.compact=function(){return this.filter($u)},Dn.prototype.find=function(e){return this.filter(e).head()},Dn.prototype.findLast=function(e){return this.reverse().find(e)},Dn.prototype.invokeMap=Fr((function(e,t){return"function"==typeof e?new Dn(this):this.map((function(n){return mr(n,e,t)}))})),Dn.prototype.reject=function(e){return this.filter(Oa(Ko(e)))},Dn.prototype.slice=function(e,t){e=ru(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Dn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ru(t))<0?n.dropRight(-t):n.take(t-e)),n)},Dn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Dn.prototype.toArray=function(){return this.take(4294967295)},cr(Dn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Pn[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(Pn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof Dn,c=a[0],s=u||Ra(t),l=function(e){var t=o.apply(Pn,ht([e],a));return r&&f?t[0]:t};s&&n&&"function"==typeof c&&1!=c.length&&(u=s=!1);var f=this.__chain__,p=!!this.__actions__.length,d=i&&!f,h=u&&!p;if(!i&&s){t=h?t:new Dn(this);var v=e.apply(t,a);return v.__actions__.push({func:na,args:[l],thisArg:void 0}),new An(v,f)}return d&&h?e.apply(this,a):(v=this.thru(l),d?r?v.value()[0]:v.value():v)})})),ut(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ra(o)?o:[],e)}return this[n]((function(n){return t.apply(Ra(n)?n:[],e)}))}})),cr(Dn.prototype,(function(e,t){var n=Pn[t];if(n){var r=n.name+"";Oe.call(bn,r)||(bn[r]=[]),bn[r].push({name:t,func:n})}})),bn[Co(void 0,2).name]=[{name:"wrapper",func:void 0}],Dn.prototype.clone=function(){var e=new Dn(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e},Dn.prototype.reverse=function(){if(this.__filtered__){var e=new Dn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Dn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ra(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=un(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,u=i.end,c=u-a,s=r?u:a-1,l=this.__iteratees__,f=l.length,p=0,d=un(c,this.__takeCount__);if(!n||!r&&o==c&&d==c)return no(e,this.__actions__);var h=[];e:for(;c--&&p<d;){for(var v=-1,y=e[s+=t];++v<f;){var g=l[v],m=g.iteratee,b=g.type,w=m(y);if(2==b)y=w;else if(!w){if(1==b)continue e;break e}}h[p++]=y}return h},Pn.prototype.at=ra,Pn.prototype.chain=function(){return ta(this)},Pn.prototype.commit=function(){return new An(this.value(),this.__chain__)},Pn.prototype.next=function(){void 0===this.__values__&&(this.__values__=tu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var r=Pi(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Dn){var t=e;return this.__actions__.length&&(t=new Dn(this)),(t=t.reverse()).__actions__.push({func:na,args:[Hi],thisArg:void 0}),new An(t,this.__chain__)}return this.thru(Hi)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return no(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,Xe&&(Pn.prototype[Xe]=function(){return this}),Pn}();Ge._=Vt,void 0===(o=function(){return Vt}.call(t,n,t,r))||(r.exports=o)}).call(this)}).call(this,n(30),n(110)(e))},function(e){e.exports=JSON.parse('{"qualifications":[{"label":"identity_photo","purpose":"attestation","subjects":["identity"]},{"label":"national_id_card","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity"]},{"label":"passport","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity"]},{"label":"residence_permit","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"immigration","subjects":["permit","identity"]},{"label":"family_record_book","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"birth_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity","family"]},{"label":"driver_license","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"transport","subjects":["permit","driving"]},{"label":"other_identity_document","purpose":"attestation","subjects":["identity"]},{"label":"wedding","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"pacs","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"divorce","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"large_family_card","purpose":"attestation","sourceCategory":"transport","subjects":["right"]},{"label":"caf","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"family","subjects":["right"]},{"label":"other_family_document","subjects":["family"]},{"label":"diploma","purpose":"attestation","sourceCategory":"education","subjects":["achievement"]},{"label":"work_contract","purpose":"contract","sourceCategory":"employer","subjects":["work","employment"]},{"label":"pay_sheet","purpose":"attestation","sourceCategory":"employer","subjects":["work","revenues"]},{"label":"unemployment_benefit","purpose":"attestation","sourceCategory":"gov","subjects":["revenues"]},{"label":"pension","purpose":"attestation","sourceCategory":"gov","subjects":["revenues"]},{"label":"other_revenue","purpose":"attestation","subjects":["revenues"]},{"label":"gradebook","purpose":"report","sourceCategory":"education","subjects":["history"]},{"label":"student_card","purpose":"attestation","sourceCategory":"education","subjects":["identity","right","employment","education"]},{"label":"resume","purpose":"description","subjects":["employment"]},{"label":"motivation_letter","purpose":"description","subjects":["employment"]},{"label":"other_work_document","purpose":"employment"},{"label":"health_book","purpose":"attestation","sourceCategory":"health","subjects":["capacity","vaccine"]},{"label":"health_certificate","purpose":"attestation","sourceCategory":"health","subjects":["capacity","vaccine"]},{"label":"pregnancy_medical_certificate","purpose":"attestation","sourceCategory":"health","subjects":["pregnancy"]},{"label":"work_disability_recognition","purpose":"attestation","sourceCategory":"health","subjects":["right"]},{"label":"national_health_insurance_card","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"health","subjects":["insurance"]},{"label":"national_health_insurance_right_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"health","subjects":["right","insurance"]},{"label":"health_insurance_card","purpose":"attestation","sourceCategory":"insurance","sourceSubCategory":"health","subjects":["insurance"]},{"label":"prescription","purpose":"attestation","sourceCategory":"health","subjects":["right","medecine"]},{"label":"health_invoice","purpose":"invoice","sourceCategory":"health"},{"label":"other_health_document","subjects":["health"]},{"label":"vehicle_registration","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"transport","subjects":["vehicule","identity","right"]},{"label":"car_insurance","purpose":"attestation","sourceCategory":"insurance","sourceSubCategory":"transport","subjects":["insurance","car"]},{"label":"mechanic_invoice","purpose":"invoice","sourceCategory":"transport"},{"label":"transport_invoice","purpose":"invoice","sourceCategory":"transport"},{"label":"other_transport_document","sourceCategory":"transport"},{"label":"house_sale_agreeement","purpose":"contract","sourceCategory":"real_estate","subjects":["house"]},{"label":"building_permit","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"real_estate","subjects":["permit","house"]},{"label":"technical_diagnostic_record","purpose":"report","sourceCategory":"real_estate","subjects":["compliance","house"]},{"label":"lease","purpose":"contract","sourceCategory":"real_estate","subjects":["house"]},{"label":"rent_receipt","purpose":"invoice","sourceCategory":"real_estate","subjects":["house"]},{"label":"house_insurance","purpose":"contract","sourceCategory":"insurance","sourceSubCategory":"real_estate","subjects":["insurance","house"]},{"label":"work_quote","purpose":"description","sourceCategory":"building","subjects":["building","house"]},{"label":"work_invoice","purpose":"invoice","sourceCategory":"building","subjects":["building","house"]},{"label":"other_house_document","subjects":["house"]},{"label":"phone_invoice","purpose":"invoice","sourceCategory":"telecom","sourceSubCategory":"mobile"},{"label":"isp_invoice","purpose":"invoice","sourceCategory":"telecom","sourceSubCategory":"internet","subjects":["subscription"]},{"label":"telecom_invoice","purpose":"invoice","sourceCategory":"telecom"},{"label":"energy_invoice","purpose":"invoice","sourceCategory":"energy"},{"label":"water_invoice","purpose":"invoice","sourceCategory":"water"},{"label":"appliance_invoice","purpose":"invoice","sourceCategory":"retail"},{"label":"web_service_invoice","purpose":"invoice","sourceCategory":"web"},{"label":"restaurant_invoice","purpose":"invoice","sourceCategory":"alimentation"},{"label":"other_invoice","purpose":"invoice"},{"label":"tax_return","purpose":"report","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"tax_notice","purpose":"invoice","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"tax_timetable","purpose":"report","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"other_tax_document","subjects":["tax"]},{"label":"bank_details","purpose":"attestation","sourceCategory":"bank","subjects":["bank_account"]},{"label":"bank_statement","purpose":"report","sourceCategory":"bank","subjects":["history"]},{"label":"loan_agreement","purpose":"contract","sourceCategory":"bank"},{"label":"other_bank_document","sourceCategory":"bank"},{"label":"receipt","purpose":"report"},{"label":"payment_proof_family_allowance","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["subvention"]},{"label":"school_attendance_certificate","purpose":"attestation","sourceCategory":"education","subjects":["identity","right","education"]},{"label":"unfit_for_habitation_declaration","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"real_estate","subjects":["compliance"]},{"label":"accommodation_proof","purpose":"attestation","sourceCategory":"individual","subjects":["address"]},{"label":"citizen_registration_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["achievement","education"]},{"label":"personal_sporting_licence","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"sport","subjects":["permit","invoice"]},{"label":"other_activity_document","sourceSubCategory":"sport","subjects":["permit","invoice"]}],"purposeKnownValues":["attestation","contract","invoice","report","description","evaluation","employment"],"sourceCategoryKnownValues":["bank","insurance","retail","telecom","energy","water","health","gov","association","education","employer","transport","goods","alimentation","building","real_estate","web","individual"],"sourceSubCategoryKnownValues":["civil_registration","immigration","transport","family","tax","health","real_estate","mobile","internet","citizen","sport"],"subjectsKnownValues":["identity","permit","family","address","driving","right","subvention","achievement","degree","work","employment","revenues","history","insurance","medical_act","vehicule","car","moto","truck","boat","subscription","buy/sale","house","compliance","building","food","real_estate","tax","address","education","statement","course","internet","phone","vaccine","capacity","health","drugs","child","pregnancy","bank_account"]}')},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getReferencedFolder=t.createFolderWithReference=t.ensureMagicFolder=t.MAGIC_FOLDERS=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(596)),u=(r(n(41)),n(19),n(57)),c={ADMINISTRATIVE:"".concat("io.cozy.apps","/").concat("administrative"),PHOTOS:"".concat("io.cozy.apps","/").concat("photos"),PHOTOS_BACKUP:"".concat("io.cozy.apps","/").concat("photos","/mobile"),PHOTOS_UPLOAD:"".concat("io.cozy.apps","/").concat("photos","/upload"),NOTES:"".concat("io.cozy.apps","/notes"),HOME:"".concat("io.cozy.apps","/home"),PAPERS:"".concat("io.cozy.apps","/").concat("administrative","/papers")};t.MAGIC_FOLDERS=c;var s=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={_type:"io.cozy.apps",_id:n},e.next=3,f(t,i);case 3:if(!(a=e.sent)){e.next=6;break}return e.abrupt("return",a);case 6:if((u=Object.values(c)).includes(n)){e.next=9;break}throw new Error("Cannot create Magic folder with id ".concat(n,". Allowed values are ").concat(u.join(", "),"."));case 9:if(r){e.next=11;break}throw new Error("Magic folder default path must be defined");case 11:return e.abrupt("return",l(t,r,i));case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.ensureMagicFolder=s;var l=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,c,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.collection(u.DOCTYPE_FILES),e.next=3,i.ensureDirectoryExists(n);case 3:return a=e.sent,e.next=6,i.addReferencesTo(r,[{_id:a}]);case 6:return e.next=8,i.get(a);case 8:return c=e.sent,s=c.data,e.abrupt("return",s);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.createFolderWithReference=l;var f=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.collection(u.DOCTYPE_FILES).findReferencedBy(n);case 2:return r=e.sent,i=r.included,c=i.filter((function(e){return!/^\/\.cozy_trash/.test(e.attributes.path)})),e.abrupt("return",c.length>0?(0,a.default)(c,"created_at").pop():null);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.getReferencedFolder=f},function(e,t,n){var r=n(116),o=n(284),i=n(55),a=n(288),u=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=u},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchURL=t.generateUrlForNote=t.generatePrivateUrl=void 0;var o=r(n(5)),i=r(n(8)),a=n(183),u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.returnUrl,o=new URL(e);return r&&o.searchParams.set("returnUrl",r),o.hash="#/n/".concat(t.id),o.toString()};t.generatePrivateUrl=u;t.generateUrlForNote=function(e,t){return console.warn("generateUrlForNote is deprecated. Please use models.note.generatePrivateUrl instead"),u(e,t)};var c=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,u,c,s,l,f,p,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getStackClient().collection("io.cozy.notes").fetchURL({_id:n.id});case 2:if(r=e.sent,i=r.data,u=i.note_id,c=i.subdomain,s=i.protocol,l=i.instance,f=i.sharecode,p=i.public_name,!f){e.next=17;break}return(d=[["id",u]]).push(["sharecode",f]),p&&d.push(["username",p]),e.abrupt("return",(0,a.generateWebLink)({cozyUrl:"".concat(s,"://").concat(l),searchParams:d,pathname:"/public/",slug:"notes",subDomainType:c}));case 17:return e.abrupt("return",(0,a.generateWebLink)({cozyUrl:"".concat(s,"://").concat(l),pathname:"",slug:"notes",subDomainType:c,hash:"/n/".concat(u)}));case 18:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchURL=c},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.isReadOnly=v,t.fetchOwn=y,t.isForType=m,t.isDocumentReadOnly=function(e){return k.apply(this,arguments)},t.isShortcutCreatedOnTheRecipientCozy=void 0;var o=r(n(2)),i=r(n(5)),a=r(n(8)),u=r(n(32)),c=r(n(281)),s=r(n(16)),l=(r(n(41)),n(18)),f=n(301),p=n(57);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.writability,r=void 0===n?["PATCH","POST","PUT","DELETE"]:n;return e.verbs&&e.verbs.length>0&&0===(0,c.default)(e.verbs,["ALL"].concat((0,u.default)(r))).length}function y(e){return g.apply(this,arguments)}function g(){return(g=(0,a.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.collection("io.cozy.permissions"),e.next=3,n.fetchOwnPermissions();case 3:if(r=e.sent,o=(0,s.default)(r,"data.attributes.permissions")){e.next=7;break}throw"Can't get self permissions";case 7:return e.abrupt("return",Object.values(o));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e,t){return e.type===t||e.type+".*"===t}function b(e){return w.apply(this,arguments)}function w(){return(w=(0,a.default)(i.default.mark((function e(t){var n,r,o,u,c,s,d,v,g,b,w,k;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k=function(){return(k=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.doc,r=t.client,o=t.perms,!(a=o.find((function(e){if(e.values){var t=e.selector||"id",r=n[t];return e.values.includes(r)}return!0})))){e.next=6;break}return e.abrupt("return",a);case 6:if(c!==p.DOCTYPE_FILES){e.next=16;break}if(u=(0,f.getParentFolderId)(n),e.t0=u,!e.t0){e.next=13;break}return e.next=12,g(u);case 12:e.t0=e.sent;case 13:if(!(s=e.t0)){e.next=16;break}return e.abrupt("return",w({doc:s,perms:o,client:r}));case 16:return e.abrupt("return",void 0);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)},w=function(e){return k.apply(this,arguments)},b=function(){return(b=(0,a.default)(i.default.mark((function e(t){var n,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,l.Q)(p.DOCTYPE_FILES).getById(t),e.next=3,r.query(n);case 3:return o=e.sent,e.abrupt("return",o&&o.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e){return b.apply(this,arguments)},n=t.document,r=t.client,o=t.permissions,u=n._id||n.id,c=n._type||n.type,s=h(h({},n),{},{id:u,type:c}),!o){e.next=12;break}e.t0=o,e.next=15;break;case 12:return e.next=14,y(r);case 14:e.t0=e.sent;case 15:return d=e.t0,v=d.filter((function(e){return m(e,c)})),e.abrupt("return",w({doc:s,client:r,perms:v}));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.document,r=t.client,o=t.writability,void 0!==(a=t.permissions)){e.next=10;break}return e.next=7,y(r);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=a;case 11:if(!((u=e.t0).length<=1)){e.next=16;break}e.t1=u[0],e.next=19;break;case 16:return e.next=18,b({document:n,client:r,permissions:u});case 18:e.t1=e.sent;case 19:if(!(c=e.t1)){e.next=24;break}return e.abrupt("return",v(c,{writability:o}));case 24:return console.warn("can't find the document in current attached permissions"),e.abrupt("return",void 0);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.isShortcutCreatedOnTheRecipientCozy=function(e){if(!e.included)return!1;var t=e.included.find((function(e){return"io.cozy.sharings.members"===e.type}));return!(!t||!t.attributes.instance)}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getCreatedByApp=t.hasBeenUpdatedByApp=void 0;var o=r(n(16));t.hasBeenUpdatedByApp=function(e,t){var n=(0,o.default)(e,"cozyMetadata.updatedByApps");return Boolean(n&&n.find((function(e){return e.slug===t})))};t.getCreatedByApp=function(e){return(0,o.default)(e,"cozyMetadata.createdByApp")}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getIndexByFamilyNameGivenNameEmailCozyUrl=t.getDefaultSortIndexValue=t.makeDefaultSortIndexValue=t.getDisplayName=t.makeDisplayName=t.getFullname=t.makeFullname=t.getPrimaryAddress=t.getPrimaryPhone=t.getPrimaryCozyDomain=t.getPrimaryCozy=t.getPrimaryEmail=t.getInitials=t.getPrimaryOrFirst=void 0;var o=r(n(16)),i=r(n(601)),a=function(e){return function(t){return t[e]&&0!==t[e].length?t[e].find((function(e){return e.primary}))||t[e][0]:""}};t.getPrimaryOrFirst=a;t.getInitials=function(e){if(e.name&&!(0,i.default)(e.name))return["givenName","familyName"].map((function(t){return(0,o.default)(e,["name",t,0],"")})).join("").toUpperCase();var t=u(e);if(t)return t[0].toUpperCase();var n=s(e);return n?n[0].toUpperCase():""};var u=function(e){return Array.isArray(e.email)?a("email")(e).address||"":e.email};t.getPrimaryEmail=u;var c=function(e){return Array.isArray(e.cozy)?a("cozy")(e).url||"":e.url};t.getPrimaryCozy=c;var s=function(e){try{return new URL(c(e)).hostname.replace(/^(www.)/g,"")}catch(t){return c(e)}};t.getPrimaryCozyDomain=s;t.getPrimaryPhone=function(e){return a("phone")(e).number||""};t.getPrimaryAddress=function(e){return a("address")(e).formattedAddress||""};var l=function(e){return e.name?["namePrefix","givenName","additionalName","familyName","nameSuffix"].map((function(t){return e.name[t]})).filter((function(e){return void 0!==e})).join(" ").trim():""};t.makeFullname=l;t.getFullname=function(e){return(0,o.default)(e,"fullname")?e.fullname:l(e)};var f=function(e){var t=l(e),n=u(e),r=s(e);return t&&t.length>0?t:n&&n.length>0?n:r&&r.length>0?r:""};t.makeDisplayName=f;t.getDisplayName=function(e){return(0,o.default)(e,"displayName")?e.displayName:f(e)};var p=function(e){var t=[(0,o.default)(e,"name.familyName",""),(0,o.default)(e,"name.givenName",""),u(e),s(e)].join("").trim().toLowerCase();return 0===t.length?null:t};t.makeDefaultSortIndexValue=p;var d=function(e){var t=(0,o.default)(e,"indexes.byFamilyNameGivenNameEmailCozyUrl",null);return null!==t?(0,i.default)(t)?null:t:p(e)};t.getDefaultSortIndexValue=d;t.getIndexByFamilyNameGivenNameEmailCozyUrl=function(e){return console.warn("Deprecation: `getIndexByFamilyNameGivenNameEmailCozyUrl` is deprecated, please use `getDefaultSortIndexValue` instead"),d(e)}},function(e,t,n){var r=n(150),o=n(66),i=n(81),a=n(22),u=n(47),c=n(82),s=n(112),l=n(111),f=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(u(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||l(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!r(e).length;for(var n in e)if(f.call(e,n))return!1;return!0}},function(e,t,n){"use strict";var r=n(17);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Qualification",{enumerable:!0,get:function(){return o.Qualification}}),Object.defineProperty(t,"setQualification",{enumerable:!0,get:function(){return o.setQualification}}),Object.defineProperty(t,"getQualification",{enumerable:!0,get:function(){return o.getQualification}}),t.helpers=t.themes=t.locales=void 0;var o=n(188),i=r(n(603));t.locales=i;var a=r(n(313));t.themes=a;var u=r(n(651));t.helpers=u},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundT=void 0;for(var o=r(n(604)),i={},a=0,u=["fr","en"];a<u.length;a++){var c=u[a],s={};try{s=n(648)("./".concat(c,".json"))}catch(e){}var l=new o.default;l.extend(s),i[c]=l}t.getBoundT=function(e){var t=i[e]||i.en;return t.t.bind(t)}},function(e,t,n){"use strict";var r=n(605),o=n(642),i=n(237),a=n(163),u=n(645),c=function(e){i(!1,e)},s=String.prototype.replace,l=String.prototype.split,f=function(e){var t=e%100,n=t%10;return 11!==t&&1===n?0:2<=n&&n<=4&&!(t>=12&&t<=14)?1:2},p={pluralTypes:{arabic:function(e){if(e<3)return e;var t=e%100;return t>=3&&t<=10?3:t>=11?4:5},bosnian_serbian:f,chinese:function(){return 0},croatian:f,french:function(e){return e>=2?1:0},german:function(e){return 1!==e?1:0},russian:f,lithuanian:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?1:2},czech:function(e){return 1===e?0:e>=2&&e<=4?1:2},polish:function(e){if(1===e)return 0;var t=e%10;return 2<=t&&t<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!=1||e%100==11?1:0},slovenian:function(e){var t=e%100;return 1===t?0:2===t?1:3===t||4===t?2:3}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is"],slovenian:["sl-SL"]}};function d(e,t){var n,i,a=(n=e.pluralTypeToLanguages,i={},r(o(n),(function(e){var t=e[0],n=e[1];r(n,(function(e){i[e]=t}))})),i);return a[t]||a[l.call(t,/-/,1)[0]]||a.en}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var v,y=(v={},function(e,t){var n=v[t];return n&&!e.pluralTypes[n]&&(n=null,v[t]=n),n||(n=d(e,t))&&(v[t]=n),n}),g=/%\{(.*?)\}/g;function m(e,t,n,r,o){if("string"!=typeof e)throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(null==t)return e;var i=e,c=r||g,f="number"==typeof t?{smart_count:t}:t;if(null!=f.smart_count&&e){var d=o||p,h=l.call(e,"||||"),v=function(e,t,n){return e.pluralTypes[t](n)}(d,y(d,n||"en"),f.smart_count);i=u(h[v]||h[0])}return i=s.call(i,c,(function(e,t){return a(f,t)&&null!=f[t]?f[t]:e}))}function b(e){var t=e||{};this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en";var n=t.allowMissing?m:null;this.onMissingKey="function"==typeof t.onMissingKey?t.onMissingKey:n,this.warn=t.warn||c,this.tokenRegex=function(e){var t=e&&e.prefix||"%{",n=e&&e.suffix||"}";if("||||"===t||"||||"===n)throw new RangeError('"||||" token is reserved for pluralization');return new RegExp(h(t)+"(.*?)"+h(n),"g")}(t.interpolation),this.pluralRules=t.pluralRules||p}b.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},b.prototype.extend=function(e,t){r(o(e||{}),(function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;"object"==typeof r?this.extend(r,o):this.phrases[o]=r}),this)},b.prototype.unset=function(e,t){"string"==typeof e?delete this.phrases[e]:r(o(e||{}),(function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;"object"==typeof r?this.unset(r,o):delete this.phrases[o]}),this)},b.prototype.clear=function(){this.phrases={}},b.prototype.replace=function(e){this.clear(),this.extend(e)},b.prototype.t=function(e,t){var n,r,o=null==t?{}:t;if("string"==typeof this.phrases[e])n=this.phrases[e];else if("string"==typeof o._)n=o._;else if(this.onMissingKey){r=(0,this.onMissingKey)(e,o,this.currentLocale,this.tokenRegex,this.pluralRules)}else this.warn('Missing translation for key: "'+e+'"'),r=e;return"string"==typeof n&&(r=m(n,o,this.currentLocale,this.tokenRegex,this.pluralRules)),r},b.prototype.has=function(e){return a(this.phrases,e)},b.transformPhrase=function(e,t,n){return m(e,t,n)},e.exports=b},function(e,t,n){"use strict";var r=n(49),o=n(94),i=n(60),a=n(302),u=n(303),c=n(307),s=c(),l=n(641),f=i("Array.prototype.slice"),p=o.apply(s),d=function(e,t){return a(e),p(e,f(arguments,1))};r(d,{getPolyfill:c,implementation:u,shim:l}),e.exports=d},function(e,t,n){"use strict";var r=n(27)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(27),o=n(60),i=r("%TypeError%"),a=n(608),u=r("%Reflect.apply%",!0)||o("%Function.prototype.apply%");e.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!a(n))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(e,t,n)}},function(e,t,n){"use strict";var r=n(27)("%Array%"),o=!r.isArray&&n(60)("Object.prototype.toString");e.exports=r.isArray||function(e){return"[object Array]"===o(e)}},function(e,t,n){var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,v=Object.prototype.toString,y=Function.prototype.toString,g=String.prototype.match,m=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,k=String.prototype.toLowerCase,x=RegExp.prototype.test,_=Array.prototype.concat,O=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,j="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,D=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||x.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=m.call(t,o.length+1);return b.call(o,n,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,n,"$&_")}var N=n(610).custom,z=N&&U(N)?N:null;function M(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return b.call(String(e),/"/g,""")}function L(e){return!("[object Array]"!==H(e)||A&&"object"==typeof e&&A in e)}function U(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var u=n||{};if(q(u,"quoteStyle")&&"single"!==u.quoteStyle&&"double"!==u.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(u,"maxStringLength")&&("number"==typeof u.maxStringLength?u.maxStringLength<0&&u.maxStringLength!==1/0:null!==u.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!q(u,"customInspect")||u.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(u,"indent")&&null!==u.indent&&"\t"!==u.indent&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(u,"numericSeparator")&&"boolean"!=typeof u.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var v=u.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,n){if(t.length>n.maxStringLength){var r=t.length-n.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return e(m.call(t,0,n.maxStringLength),n)+o}return M(b.call(b.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Q),"single",n)}(t,u);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return v?I(t,w):w}if("bigint"==typeof t){var x=String(t)+"n";return v?I(t,x):x}var E=void 0===u.depth?5:u.depth;if(void 0===r&&(r=0),r>=E&&E>0&&"object"==typeof t)return L(t)?"[Array]":"[Object]";var P=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=O.call(Array(e.indent+1)," ")}return{base:n,prev:O.call(Array(t+1),n)}}(u,r);if(void 0===o)o=[];else if(W(o,t)>=0)return"[Circular]";function N(t,n,i){if(n&&(o=S.call(o)).push(n),i){var a={depth:u.depth};return q(u,"quoteStyle")&&(a.quoteStyle=u.quoteStyle),e(t,a,r+1,o)}return e(t,u,r+1,o)}if("function"==typeof t){var B=function(e){if(e.name)return e.name;var t=g.call(y.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),K=Y(t,N);return"[Function"+(B?": "+B:" (anonymous)")+"]"+(K.length>0?" { "+O.call(K,", ")+" }":"")}if(U(t)){var X=T?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(t);return"object"!=typeof t||T?X:$(X)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var Z="<"+k.call(String(t.nodeName)),ee=t.attributes||[],te=0;te<ee.length;te++)Z+=" "+ee[te].name+"="+M(F(ee[te].value),"double",u);return Z+=">",t.childNodes&&t.childNodes.length&&(Z+="..."),Z+="</"+k.call(String(t.nodeName))+">"}if(L(t)){if(0===t.length)return"[]";var ne=Y(t,N);return P&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(ne)?"["+J(ne,P)+"]":"[ "+O.call(ne,", ")+" ]"}if(function(e){return!("[object Error]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)){var re=Y(t,N);return"cause"in t&&!D.call(t,"cause")?"{ ["+String(t)+"] "+O.call(_.call("[cause]: "+N(t.cause),re),", ")+" }":0===re.length?"["+String(t)+"]":"{ ["+String(t)+"] "+O.call(re,", ")+" }"}if("object"==typeof t&&c){if(z&&"function"==typeof t[z])return t[z]();if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{s.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var oe=[];return a.call(t,(function(e,n){oe.push(N(n,t,!0)+" => "+N(e,t))})),V("Map",i.call(t),oe,P)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ie=[];return l.call(t,(function(e){ie.push(N(e,t))})),V("Set",s.call(t),ie,P)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return G("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return G("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return G("WeakRef");if(function(e){return!("[object Number]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(N(Number(t)));if(function(e){if(!e||"object"!=typeof e||!j)return!1;try{return j.call(e),!0}catch(e){}return!1}(t))return $(N(j.call(t)));if(function(e){return!("[object Boolean]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(h.call(t));if(function(e){return!("[object String]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(N(String(t)));if(!function(e){return!("[object Date]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)&&!function(e){return!("[object RegExp]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Y(t,N),ue=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",se=!ue&&A&&Object(t)===t&&A in t?m.call(H(t),8,-1):ce?"Object":"",le=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(se||ce?"["+O.call(_.call([],se||[],ce||[]),": ")+"] ":"");return 0===ae.length?le+"{}":P?le+"{"+J(ae,P)+"}":le+"{ "+O.call(ae,", ")+" }"}return String(t)};var B=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return B.call(e,t)}function H(e){return v.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Q(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function $(e){return"Object("+e+")"}function G(e){return e+" { ? }"}function V(e,t,n,r){return e+" ("+t+") {"+(r?J(n,r):O.call(n,", "))+"}"}function J(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+O.call(e,","+n)+"\n"+t.prev}function Y(e,t){var n=L(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=q(e,o)?t(e[o],e):""}var i,a="function"==typeof P?P(e):[];if(T){i={};for(var u=0;u<a.length;u++)i["$"+a[u]]=a[u]}for(var c in e)q(e,c)&&(n&&String(Number(c))===c&&c<e.length||T&&i["$"+c]instanceof Symbol||(x.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var s=0;s<a.length;s++)D.call(e,a[s])&&r.push("["+t(a[s])+"]: "+t(e[a[s]],e));return r}},function(e,t){},function(e,t,n){"use strict";e.exports=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0}},function(e,t,n){"use strict";var r=n(27)("%TypeError%"),o=n(305),i=n(189);e.exports=function(e,t){if("Object"!==i(e))throw new r("Assertion failed: `O` must be an Object");if(!o(t))throw new r("Assertion failed: `P` must be a Property Key");return t in e}},function(e,t,n){"use strict";e.exports=n(614)},function(e,t,n){"use strict";var r,o,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw o}}),o={},a((function(){throw 42}),null,r)}catch(e){e!==o&&(a=null)}else a=null;var u=/^\s*class\b/,c=function(e){try{var t=i.call(e);return u.test(t)}catch(e){return!1}},s=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,f="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=a?function(e){if(e===f)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{a(e,null,r)}catch(e){if(e!==o)return!1}return!c(e)}:function(e){if(e===f)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(l)return function(e){try{return!c(e)&&(i.call(e),!0)}catch(e){return!1}}(e);if(c(e))return!1;var t=s.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,n){"use strict";var r=n(27)("%TypeError%"),o=n(304),i=n(616),a=n(189);e.exports=function(e){if("Object"!==a(e))throw new r("Assertion failed: `obj` must be an Object");return i(o(e,"length"))}},function(e,t,n){"use strict";var r=n(617),o=n(618);e.exports=function(e){var t=o(e);return t<=0?0:t>r?r:t}},function(e,t,n){"use strict";var r=n(27),o=r("%Math%"),i=r("%Number%");e.exports=i.MAX_SAFE_INTEGER||o.pow(2,53)-1},function(e,t,n){"use strict";var r=n(619),o=n(628);e.exports=function(e){var t=o(e);return 0!==t&&(t=r(t)),0===t?0:t}},function(e,t,n){"use strict";var r=n(620),o=n(621),i=n(622),a=n(625),u=n(626),c=n(627);e.exports=function(e){var t=i(e);return a(t)?0:0!==t&&u(t)?c(t)*o(r(t)):t}},function(e,t,n){"use strict";var r=n(27)("%Math.abs%");e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=Math.floor;e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=n(623);e.exports=function(e){var t=r(e,Number);if("string"!=typeof t)return+t;var n=t.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,"");return/^0[ob]|^[+-]0x/.test(n)?NaN:+n}},function(e,t,n){"use strict";e.exports=n(624)},function(e,t,n){"use strict";var r=Object.prototype.toString,o=n(306),i=n(162),a=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===r.call(e)?String:Number)===String||t===Number){var n,a,u=t===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<u.length;++a)if(i(e[u[a]])&&(n=e[u[a]](),o(n)))return n;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")};e.exports=function(e){return o(e)?e:arguments.length>1?a(e,arguments[1]):a(e)}},function(e,t,n){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},function(e,t,n){"use strict";var r=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!r(e)&&e!==1/0&&e!==-1/0}},function(e,t,n){"use strict";e.exports=function(e){return e>=0?1:-1}},function(e,t,n){"use strict";var r=n(27),o=r("%TypeError%"),i=r("%Number%"),a=r("%RegExp%"),u=r("%parseInt%"),c=n(60),s=n(629),l=n(630),f=c("String.prototype.slice"),p=s(/^0b[01]+$/i),d=s(/^0o[0-7]+$/i),h=s(/^[-+]0x[0-9a-f]+$/i),v=s(new a("["+["
","",""].join("")+"]","g")),y=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),g=new RegExp("(^["+y+"]+)|(["+y+"]+$)","g"),m=c("String.prototype.replace"),b=n(631);e.exports=function e(t){var n=l(t)?t:b(t,i);if("symbol"==typeof n)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(p(n))return e(u(f(n,2),2));if(d(n))return e(u(f(n,2),8));if(v(n)||h(n))return NaN;var r=function(e){return m(e,g,"")}(n);if(r!==n)return e(r)}return i(n)}},function(e,t,n){"use strict";var r=n(27)("RegExp.prototype.test"),o=n(94);e.exports=function(e){return o(r,e)}},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=n(632);e.exports=function(e){return arguments.length>1?r(e,arguments[1]):r(e)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=n(306),i=n(162),a=n(633),u=n(634),c=function(e,t){if(null==e)throw new TypeError("Cannot call method on "+e);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var n,r,a,u="string"===t?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<u.length;++a)if(n=e[u[a]],i(n)&&(r=n.call(e),o(r)))return r;throw new TypeError("No default value")},s=function(e,t){var n=e[t];if(null!=n){if(!i(n))throw new TypeError(n+" returned for property "+t+" of object "+e+" is not a function");return n}};e.exports=function(e){if(o(e))return e;var t,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?t=s(e,Symbol.toPrimitive):u(e)&&(t=Symbol.prototype.valueOf)),void 0!==t){var i=t.call(e,n);if(o(i))return i;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(e)||u(e))&&(n="string"),c(e,"default"===n?"number":n)}},function(e,t,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(164)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";var r=n(27)("%Object%"),o=n(302);e.exports=function(e){return o(e),r(e)}},function(e,t,n){"use strict";var r=n(27),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i=n(638)();e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,n){"use strict";var r=n(639);e.exports=function(){return r()&&!!Symbol.toStringTag}},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t){e.exports=function(e){var t=!0,n=!0,r=!1;if("function"==typeof e){try{e.call("f",(function(e,n,r){"object"!=typeof r&&(t=!1)})),e.call([null],(function(){"use strict";n="string"==typeof this}),"x")}catch(e){r=!0}return!r&&t&&n}return!1}},function(e,t,n){"use strict";var r=n(49),o=n(307);e.exports=function(){var e=o();return r(Array.prototype,{forEach:e},{forEach:function(){return Array.prototype.forEach!==e}}),e}},function(e,t,n){"use strict";var r=n(49),o=n(94),i=n(308),a=n(310),u=n(644),c=o(a(),Object);r(c,{getPolyfill:a,implementation:i,shim:u}),e.exports=c},function(e,t,n){"use strict";var r=n(27)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(310),o=n(49);e.exports=function(){var e=r();return o(Object,{entries:e},{entries:function(){return Object.entries!==e}}),e}},function(e,t,n){"use strict";var r=n(94),o=n(49),i=n(311),a=n(312),u=n(647),c=r(a());o(c,{getPolyfill:a,implementation:i,shim:u}),e.exports=c},function(e,t,n){"use strict";var r=n(27),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=n(49),o=n(312);e.exports=function(){var e=o();return r(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},function(e,t,n){var r={"./en.json":649,"./fr.json":650};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=648},function(e){e.exports=JSON.parse('{"Scan":{"scan_a_doc":"Scan a doc","save_doc":"Save the doc","filename":"Filename","save":"Save","cancel":"Cancel","qualify":"Describe","apply":"Apply","error":{"offline":"You are currently offline and you can\'t use this functionality. Please, try again later.","uploading":"You are already uploading a file. Please wait until the end of this upload and try again.","generic":"Something went wrong. Please try again."},"successful":{"qualified_ok":"You just have successfully described your file! "},"items":{"identity":"Identity","family":"Family","work_study":"Work & Study","health":"Health","home":"Home","transport":"Transport","invoice":"Invoice","others":"Others","identity_photo":"Identity photo","national_id_card":"ID card","passport":"Passeport","residence_permit":"Residence permit","family_record_book":"Family record book","birth_certificate":"Birth certificate","citizen_registration_certificate":"Certificate of citizen registration","driver_license":"Driving license","other_identity_document":"Other document of identity","wedding":"Wedding contract","pacs":"Civil union","divorce":"Divorce","large_family_card":" Large Family Card","caf":"Social benefit rate","payment_proof_family_allowance":"family allowance payment proof","other_family_document":"Other family document","diploma":"Diploma","work_contract":"Work contract","pay_sheet":"Pay sheet","unemployment_benefit":"Unemployment benefit","pension":"Pension","other_revenue":"Other revenues","gradebook":"Gradebook","student_card":"Student card","school_attendance_certificate":"Certificate of school attendance","resume":"Resume","motivation_letter":"Motivation letter","other_work_document":"Other work document","health_book":"Health book","health_certificate":"Health/Vaccination certificate","disability_recognition":"Recognition of disability","pregnancy_medical_certificate":"Certificate of pregnancy","national_health_insurance_card":"National health insurance card","national_health_insurance_right_certificate":"National health insurance right certificate","health_insurance_card":"Insurance card","prescription":"Prescription","health_invoice":"Health invoice","other_health_document":"Other health document","vehicle_registration":"Vehicle registration","car_insurance":"Car insurance certificate","mechanic_invoice":"Repair bill","transport_invoice":"Transport invoice","other_transport_document":"Other transport document","phone_invoice":"Phone invoice","isp_invoice":"ISP invoice","telecom_invoice":"Telecom invoice","energy_invoice":"Energy invoice","water_invoice":"Water invoice","web_service_invoice":"Web service invoice","appliance_invoice":"Appliance invoice","restaurant_invoice":"Restaurant invoice","house_sale_agreeement":"House sale agreement","building_permit":"Building permit","technical_diagnostic_record":"Technical diagnostic record","lease":"Lease","house_insurance":"Home insurance","unfit_for_habitation_declaration":"Declaration of unfit for habitation","rent_receipt":"Rent receipt","accommodation_proof":"Proof of accommodation","work_quote":"Work quote","work_invoice":"Work invoice","other_house_document":"Other house document","tax_return":"Tax return","tax_notice":"Tax notice","tax_timetable":"Payment Plans Installment Agreements","receipt":"Receipt","other_tax_document":"Other tax document","bank_details":"IBAN","bank_statement":"Bank statement","loan_agreement":"Loan agreement","other_bank_document":"Other banking document","invoices":"Invoices","personal_sporting_licence":"Sporting licence","other_invoice":"Other invoice","other_activity_document":"Other sports document"},"themes":{"identity":"Identity","family":"Family","work_study":"Work & Study","health":"Health","home":"Home","transport":"Transport","invoice":"Invoice","others":"Others","undefined":"Undefined","finance":"Finance","activity":"Activities"}}}')},function(e){e.exports=JSON.parse('{"Scan":{"scan_a_doc":"Numériser un doc","save_doc":"Enregistrer le document","filename":"Nom du fichier","save":"Sauvegarder","cancel":"Annuler","qualify":"Qualifier","apply":"Appliquer","error":{"offline":"Vous êtes actuellement déconnecté, vous ne pouvez donc pas utiliser cette fonctionnalité. Connectez-vous à internet et recommencez. ","uploading":"Vous avez déjà un fichier en cours de téléchargement. Attendez la fin et recommencez.","generic":"Un problème est survenu. Veuillez réessayer. "},"successful":{"qualified_ok":"Vous venez de qualifier votre fichier avec succès !"},"items":{"identity":"Identité","family":"Famille","work_study":"Travail & Études","health":"Santé","home":"Logement","transport":"Transport","invoice":"Factures","others":"Autres","identity_photo":"Photo d\'identité","national_id_card":"Carte d\'identité","passport":"Passeport","residence_permit":"Titre de séjour","family_record_book":"Livret de famille","birth_certificate":"Certificat de naissance","citizen_registration_certificate":"Attestation de recensement citoyen","driver_license":"Permis","other_identity_document":"Autre document d\'identité","wedding":"Contrat de mariage","pacs":"Attestation de PACS","divorce":"Attestation de divorce","large_family_card":"Carte famille nombreuse","caf":"Attestation de quotient familial (CAF)","payment_proof_family_allowance":"Attestation de paiement CAF","other_family_document":"Autre document de famille","diploma":"Diplôme","work_contract":"Contrat de travail","pay_sheet":"Fiche de paie","unemployment_benefit":"Allocations chômage","pension":"Retraite","other_revenue":"Autres revenues","gradebook":"Bulletin de notes","student_card":"Carte d\'étudiant","school_attendance_certificate":"Certificat de scolarité","resume":"CV","motivation_letter":"Lettre de motivation","other_work_document":"Autre document de travail","health_book":"Carnet de santé","health_certificate":"Certificat de santé/vaccination","work_disability_recognition":"Reconnaissance de handicap - RQTH","pregnancy_medical_certificate":"Certificat de grossesse","national_health_insurance_card":"Carte vitale","national_health_insurance_right_certificate":"Attestation de droits de l\'Assurance Maladie (vitale)","health_insurance_card":"Carte de mutuelle","prescription":"Ordonnance","health_invoice":"Facture médicale","other_health_document":"Autre document de santé","vehicle_registration":"Carte grise","car_insurance":"Attestation d\'assurance auto","mechanic_invoice":"Facture de réparation","transport_invoice":"Facture de transport","other_transport_document":"Autre document de transport","phone_invoice":"Facture de téléphone","isp_invoice":"Facture d\'internet","telecom_invoice":"Facture de télécom","energy_invoice":"Facture d\'électricité","water_invoice":"Facture d\'eau","web_service_invoice":"Facture de service web","appliance_invoice":"Facture d\'électroménager","restaurant_invoice":"Facture de restaurant","house_sale_agreeement":"Compromis de vente","building_permit":"Permis de construire","technical_diagnostic_record":"Dossier de diagnostic technique","lease":"Bail","unfit_for_habitation_declaration":"Arrêté d\'insalubrité","house_insurance":"Assurance logement","rent_receipt":"Quittance de loyer","accommodation_proof":"Attestation d\'hébergement","work_quote":"Devis de travaux","work_invoice":"Facture de travaux","other_house_document":"Autre document de logement","tax_return":"Impôts - Déclaration de revenus","tax_notice":"Impôts - Avis d\'imposition","tax_timetable":"Impôts - Echéancier","receipt":"Accusé de réception","other_tax_document":"Impôts - Autre document","bank_details":"IBAN","bank_statement":"Relevé de compte","loan_agreement":"Contrat de prêt","other_bank_document":"Autre document bancaire","invoices":"Factures","personal_sporting_licence":"Licences sportives","other_invoice":"Autre facture","other_activity_document":"Autre document sportif"},"themes":{"identity":"Identité","family":"Famille","work_study":"Travail & Études","health":"Santé","home":"Logement","transport":"Transport","invoice":"Factures","others":"Autres","undefined":"Indéfini","finance":"Finances","activity":"Activités & loisirs"}}}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getThemeByItem=void 0;n(19);var r=n(313);t.getThemeByItem=function(e){var t=function(e){return r.themesList.find((function(t){return t.defaultItems&&t.defaultItems.includes(e.label)}))}(e);return t||r.themesList.find((function(t){return t.items.some((function(t){return t.label===e.label}))}))}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchTimeSeriesByIntervalAndSource=t.saveTimeSeries=void 0;var o=r(n(5)),i=r(n(8)),a=n(18),u=(n(19),function(e){if(!e.startDate||!e.endDate)throw new Error("You must specify a startDate and endDate for the time serie");if(!Date.parse(e.startDate)||!Date.parse(e.endDate))throw new Error("Invalid date format for the time serie");if(!e.dataType)throw new Error("You must specify a dataType for the time serie");if(!e.series||!Array.isArray(e.series))throw new Error("You must specify a series array for the time serie")}),c=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,a,c,s,l,f,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.dataType,i=n.series,a=n.startDate,c=n.endDate,s=n.source,l=n.theme,u({dataType:r,series:i,startDate:a,endDate:c,source:s}),f="io.cozy.timeseries.".concat(r),p={_type:f,startDate:a,endDate:c,source:s,theme:l,series:i},e.abrupt("return",t.save(p));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.saveTimeSeries=c;var s=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,u,c,s,l,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.startDate,i=n.endDate,u=n.dataType,c=n.source,s=n.limit,l="io.cozy.timeseries.".concat(u),f=(0,a.Q)(l).where({source:c,startDate:{$gte:r},endDate:{$lte:i}}).indexFields(["source","startDate","endDate"]).sortBy([{source:"desc"},{startDate:"desc"},{endDate:"desc"}]).limitBy(s||5),e.abrupt("return",t.query(f));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchTimeSeriesByIntervalAndSource=s},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.createMockClient=void 0;var o=r(n(24)),i=r(n(2)),a=r(n(25)),u=r(n(41)),c=n(58),s=n(254),l=n(18);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var p=function(e,t,n){var r=n.definition,o=n.doctype,u=n.data,p=(0,a.default)(n,["definition","doctype","data"]);e.store.dispatch((0,c.initQuery)(t,r||(0,l.Q)(o))),e.store.dispatch((0,c.receiveQueryResult)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({data:u?u.map((function(e){return(0,s.normalizeDoc)(e,o)})):u},p)))};t.createMockClient=function(e){var t,n=e.queries,r=e.remote,i=e.clientOptions,a=new u.default(i||{});a.ensureStore();for(var c=0,s=Object.entries(n||{});c<s.length;c++){var l=(0,o.default)(s[c],2),f=l[0],d=l[1];p(a,f,d)}return a.query=jest.fn().mockImplementation((t=r,function(e){return t?t[e.doctype]?{data:t[e.doctype]}:{data:[]}:{data:null}})),a.save=jest.fn(),a.saveAll=jest.fn(),a.stackClient.fetchJSON=jest.fn(),a}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useAppLinkWithStoreFallback",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"useCapabilities",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"useFetchShortcut",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"useClient",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"useQuery",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"useAppsInMaintenance",{enumerable:!0,get:function(){return s.default}});var o=r(n(655)),i=r(n(656)),a=r(n(657)),u=r(n(127)),c=r(n(298)),s=r(n(658))},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=n(18),s=n(300),l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(0,u.useState)("loading"),l=(0,a.default)(r,2),f=l[0],p=l[1],d=(0,u.useState)(!0),h=(0,a.default)(d,2),v=h[0],y=h[1],g=(0,u.useState)(null),m=(0,a.default)(g,2),b=m[0],w=m[1];return(0,u.useEffect)((function(){(function(){var r=(0,i.default)(o.default.mark((function r(){var i,a,u;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t.query((0,c.Q)("io.cozy.apps"));case 3:i=r.sent,a={slug:e},u=(0,s.isInstalled)(i.data,a),y(!!u),w(u?(0,s.getUrl)(u)+n:(0,s.getStoreURL)(i.data,a)),p("loaded"),r.next=14;break;case 11:r.prev=11,r.t0=r.catch(0),p("errored");case 14:case"end":return r.stop()}}),r,null,[[0,11]])})));return function(){return r.apply(this,arguments)}})()()}),[t,e,n]),{fetchStatus:f,isInstalled:v,url:b}};t.default=l},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=n(18),s=function(e){var t=(0,u.useState)(),n=(0,a.default)(t,2),r=n[0],s=n[1],l=(0,u.useState)("idle"),f=(0,a.default)(l,2),p=f[0],d=f[1];return(0,u.useEffect)((function(){(function(){var t=(0,i.default)(o.default.mark((function t(){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d("loading"),t.prev=1,t.next=4,e.query((0,c.Q)("io.cozy.settings").getById("capabilities"));case 4:n=t.sent,s(n),d("loaded"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),d("failed");case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(){return t.apply(this,arguments)}})()()}),[e]),{capabilities:r,fetchStatus:p}};t.default=s},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=function(e,t){var n=(0,u.useState)(null),r=(0,a.default)(n,2),c=r[0],s=r[1],l=(0,u.useState)(null),f=(0,a.default)(l,2),p=f[0],d=f[1],h=(0,u.useState)("idle"),v=(0,a.default)(h,2),y=v[0],g=v[1];return(0,u.useEffect)((function(){(function(){var n=(0,i.default)(o.default.mark((function n(){var r,i,a;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return g("loading"),n.prev=1,n.next=4,e.getStackClient().fetchJSON("GET","/shortcuts/".concat(t));case 4:r=n.sent,i=new URL(r.data.attributes.url),a="".concat(e.getStackClient().uri,"/bitwarden/icons/").concat(i.host,"/icon.png"),d(a),s(r),g("loaded"),n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),g("failed");case 15:case"end":return n.stop()}}),n,null,[[1,12]])})));return function(){return n.apply(this,arguments)}})()()}),[e,t]),{shortcutInfos:c,shortcutImg:p,fetchStatus:y}};t.default=c},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=r(n(172)),s=(r(n(41)),n(19),function(e){var t=(0,u.useState)([]),n=(0,a.default)(t,2),r=n[0],s=n[1];return(0,u.useEffect)((function(){(function(){var t=(0,i.default)(o.default.mark((function t(){var n,r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new c.default({client:e}),t.next=3,n.fetchAppsInMaintenance();case 3:r=t.sent,s(r||[]);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}})()()}),[e]),r});t.default=s},function(e,t,n){var r=n(34),o=n(660),i=n(264),a=Math.max,u=Math.min;e.exports=function(e,t,n){var c,s,l,f,p,d,h=0,v=!1,y=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=c,r=s;return c=s=void 0,h=t,f=e.apply(r,n)}function b(e){return h=e,p=setTimeout(k,t),v?m(e):f}function w(e){var n=e-d;return void 0===d||n>=t||n<0||y&&e-h>=l}function k(){var e=o();if(w(e))return x(e);p=setTimeout(k,function(e){var n=t-(e-d);return y?u(n,l-(e-h)):n}(e))}function x(e){return p=void 0,g&&c?m(e):(c=s=void 0,f)}function _(){var e=o(),n=w(e);if(c=arguments,s=this,d=e,n){if(void 0===p)return b(d);if(y)return clearTimeout(p),p=setTimeout(k,t),m(d)}return void 0===p&&(p=setTimeout(k,t)),f}return t=i(t)||0,r(n)&&(v=!!n.leading,l=(y="maxWait"in n)?a(i(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),_.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=d=s=p=void 0},_.flush=function(){return void 0===p?f:x(o())},_}},function(e,t,n){var r=n(38);e.exports=function(){return r.Date.now()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=f(i),u=f(n(1)),c=f(n(662)),s=f(n(663)),l=n(671);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return h.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,c.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,i=n.highlightFirstSuggestion;if(!(0,c.default)(r,e.suggestions)&&r.length>0&&i)this.highlightFirstSuggestion();else if(o){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&o({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,u=t.renderSuggestion,c=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,h=t.id,v=t.getSectionSuggestions,y=t.theme,g=t.getSuggestionValue,m=t.alwaysRenderSuggestions,b=t.highlightFirstSuggestion,w=this.state,k=w.isFocused,x=w.isCollapsed,_=w.highlightedSectionIndex,O=w.highlightedSuggestionIndex,S=w.valueBeforeUpDown,E=m?p:this.props.shouldRenderSuggestions,j=c.value,P=c.onFocus,C=c.onKeyDown,T=this.willRenderSuggestions(this.props),A=m||k&&!x&&T,D=A?n:[],R=r({},c,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=E(j);e.setState({isFocused:!0,isCollapsed:!n}),P&&P(t),n&&i({value:j,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,o=E(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},b?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!o})),o?i({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(x)E(j)&&(i({value:j,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,u=r.newHighlightedItemIndex,c=void 0;c=null===u?null===S?j:S:e.getSuggestionValueByIndex(a,u),e.updateHighlightedSuggestion(a,u,j),e.maybeCallOnChange(t,c,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var s=e.getHighlightedSuggestion();if(A&&!m&&e.closeSuggestions(),null!=s){var l=g(s);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:l,suggestionIndex:O,sectionIndex:_,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:A&&t.preventDefault();var f=A&&!m;if(null===S){if(!f){e.maybeCallOnChange(t,"","escape"),E("")?i({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,S,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}C&&C(t)}}),I={query:this.getQuery()};return a.default.createElement(s.default,{multiSection:f,items:D,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:u,renderItemData:I,renderSectionTitle:d,getSectionItems:v,highlightedSectionIndex:_,highlightedItemIndex:O,inputProps:R,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:h,ref:this.storeAutowhateverRef})}}]),t}(i.Component);d.propTypes={suggestions:u.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:u.default.func,onSuggestionHighlighted:u.default.func,renderInputComponent:u.default.func,renderSuggestionsContainer:u.default.func,getSuggestionValue:u.default.func.isRequired,renderSuggestion:u.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:u.default.func,alwaysRenderSuggestions:u.default.bool,multiSection:u.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:u.default.bool,highlightFirstSuggestion:u.default.bool,theme:u.default.object,id:u.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var h=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;i&&i(t,n),o?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=i.sectionIndex,u=i.suggestionIndex,c=e.getSuggestion(a,u),s=e.props.getSuggestionValue(c);e.maybeCallOnChange(t,s,"click"),e.onSuggestionSelected(t,{suggestion:c,suggestionValue:s,suggestionIndex:u,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,a=e.getHighlightedSuggestion(),u=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!u}),i&&i(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(664).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),u=d(a),c=d(n(1)),s=d(n(665)),l=d(n(666)),f=d(n(668)),p=d(n(669));function d(e){return e&&e.__esModule?e:{default:e}}var h={},v=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,i=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var u="ArrowDown"===e.key?"next":"prev",c=n.sectionIterator[u]([i,a]),s=o(c,2),l=s[0],f=s[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:i,highlightedItemIndex:a})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,s.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,a=n.renderItemData,c=n.renderSectionTitle,s=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return o.map((function(n,o){var h="react-autowhatever-"+r+"-",v=h+"section-"+o+"-",y=0===o;return u.default.createElement("div",t(v+"container","sectionContainer",y&&"sectionContainerFirst"),u.default.createElement(f.default,{section:n,renderSectionTitle:c,theme:t,sectionKeyPrefix:v}),u.default.createElement(p.default,{items:e.sectionsItems[o],itemProps:d,renderItem:i,renderItemData:a,sectionIndex:o,highlightedItemIndex:s===o?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:h,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,a=n.highlightedSectionIndex,c=n.highlightedItemIndex,s=n.itemProps;return u.default.createElement(p.default,{items:e,itemProps:s,renderItem:o,renderItemData:i,highlightedItemIndex:null===a?c:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,i=t.renderInputComponent,a=t.renderItemsContainer,c=t.highlightedSectionIndex,s=t.highlightedItemIndex,l=this.state.isInputFocused,f=o?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(c,s),h="react-autowhatever-"+n,v=r({role:"combobox","aria-haspopup":"listbox","aria-owns":h,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=i(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":h,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),g=a({containerProps:r({id:h,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return u.default.createElement("div",v,y,g)}}]),t}(a.Component);v.propTypes={id:c.default.string,multiSection:c.default.bool,renderInputComponent:c.default.func,renderItemsContainer:c.default.func,items:c.default.array.isRequired,renderItem:c.default.func,renderItemData:c.default.object,renderSectionTitle:c.default.func,getSectionItems:c.default.func,containerProps:c.default.object,inputProps:c.default.object,itemProps:c.default.oneOfType([c.default.object,c.default.func]),highlightedSectionIndex:c.default.number,highlightedItemIndex:c.default.number,theme:c.default.oneOfType([c.default.object,c.default.array])},v.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return u.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return u.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:h,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:h,inputProps:h,itemProps:h,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=v},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function o(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||a===t[i]-1?null===(i=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(i))?[null,null]:[i,0]:[i,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:o,prev:function(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||0===a?null===(i=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,t[i]-1]:[i,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===o(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i,a=n(667),u=(i=a)&&i.__esModule?i:{default:i},c=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),i=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var s=n.map((function(e){return i[e]})).filter(c);return"string"==typeof s[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,o(s)):s.join(" ")}:{key:e,style:u.default.apply(void 0,[{}].concat(o(s)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function i(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,a=o(e),u=1;u<arguments.length;u++){n=arguments[u],r=i(Object(n));for(var c=0;c<r.length;c++)a[r[c]]=n[r[c]]}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=c(o),a=c(n(1)),u=c(n(190));function c(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return s(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,a=n(t);return a?i.default.createElement("div",r(o+"title","sectionTitle"),a):null}}]),t}(o.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=l(i),u=l(n(1)),c=l(n(670)),s=l(n(190));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,i=t.renderItem,u=t.renderItemData,s=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,h=null===s?d:d+"section-"+s+"-",v="function"==typeof o;return a.default.createElement("ul",r({role:"listbox"},p(h+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,g=h+"item-"+n,m=v?o({sectionIndex:s,itemIndex:n}):o,b=r({id:f(s,n),"aria-selected":y},p(g,"item",d&&"itemFirst",y&&"itemHighlighted"),m);return y&&(b.ref=e.storeHighlightedItemReference),a.default.createElement(c.default,r({},b,{sectionIndex:s,isHighlighted:y,itemIndex:n,item:t,renderItem:i,renderItemData:u}))})))}}]),t}(i.Component);d.propTypes={items:u.default.array.isRequired,itemProps:u.default.oneOfType([u.default.object,u.default.func]),renderItem:u.default.func.isRequired,renderItemData:u.default.object.isRequired,sectionIndex:u.default.number,highlightedItemIndex:u.default.number,onHighlightedItemChange:u.default.func.isRequired,getItemId:u.default.func.isRequired,theme:u.default.func.isRequired,keyPrefix:u.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=s(i),u=s(n(1)),c=s(n(190));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:o})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,o=e.renderItem,i=e.renderItemData,u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete u.sectionIndex,delete u.itemIndex,"function"==typeof u.onMouseEnter&&(u.onMouseEnter=this.onMouseEnter),"function"==typeof u.onMouseLeave&&(u.onMouseLeave=this.onMouseLeave),"function"==typeof u.onMouseDown&&(u.onMouseDown=this.onMouseDown),"function"==typeof u.onClick&&(u.onClick=this.onClick),a.default.createElement("li",r({role:"option"},u,{ref:this.storeItemReference}),o(n,r({isHighlighted:t},i)))}}]),t}(i.Component);p.propTypes={sectionIndex:u.default.number,isHighlighted:u.default.bool.isRequired,itemIndex:u.default.number.isRequired,item:u.default.any.isRequired,renderItem:u.default.func.isRequired,renderItemData:u.default.object.isRequired,onMouseEnter:u.default.func,onMouseLeave:u.default.func,onMouseDown:u.default.func,onClick:u.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";(function(t){var r=n(673),o=n(674),i={_isShim:!0,track:function(){},push:function(e){},setUserId:function(e){},trackError:function(e){},connectToHistory:function(e,t){return e},disconnectFromHistory:function(){}},a=null,u=null;"undefined"==typeof window?e.exports=function(){return i}:e.exports=function(e){var n=function(){return t&&Object({USE_REACT:!0})?"production".toLowerCase():"development"},c=function(){if(void 0===window._paq||"function"!=typeof window._paq.push)return!1;var e=!1,t=!1;if(void 0===window._paq.length)return!0;for(var n=0,r=window._paq.length;n<r;n++)if(~window._paq[n].indexOf("setSiteId")&&(e=!0),~window._paq[n].indexOf("setTrackerUrl")&&(t=!0),t&&e)return!0;return!1};(e=e||{}).trackErrors=void 0!==e.trackErrors&&e.trackErrors,e.trackErrorHandler=void 0!==e.trackErrorHandler?e.trackErrorHandler:function(e,t){d(["trackEvent",t=t||"JavaScript Error",e.message,e.filename+": "+e.lineno])},e.enableLinkTracking=void 0===e.enableLinkTracking||e.enableLinkTracking,e.updateDocumentTitle=void 0===e.updateDocumentTitle||e.updateDocumentTitle,e.ignoreInitialVisit=void 0!==e.ignoreInitialVisit&&e.ignoreInitialVisit,e.injectScript=void 0===e.injectScript||e.injectScript,e.clientTrackerName=void 0!==e.clientTrackerName?e.clientTrackerName:"piwik.js",e.serverTrackerName=void 0!==e.serverTrackerName?e.serverTrackerName:"piwik.php";var s=c();window._paq=window._paq||[];var l=!(e.url&&e.siteId||s),f=!e.injectScript&&!s;if(l||f)return"test"!==n()&&r(null,"PiwikTracker cannot be initialized! You haven't passed a url and siteId to it."),i;var p=function(t){var n;n=t.path?t.path:t.basename?o(t.basename,t.pathname,t.search):o(t.pathname,t.search),a!==n&&(e.updateDocumentTitle&&d(["setDocumentTitle",document.title]),d(["setCustomUrl",n]),d(["trackPageView"]),a=n)},d=function(e){window._paq.push(e)},h=function(e){window._paq.push(["setUserId",e])};return e.trackErrors&&(window.addEventListener?window.addEventListener("error",e.trackErrorHandler,!1):window.attachEvent?window.attachEvent("onerror",e.trackErrorHandler):window.onerror=e.trackErrorHandler),function(){var t,n=c();if(!n){var r=-1!==(t=e.url).indexOf("http://")||-1!==t.indexOf("https://")?t+"/":"https:"==document.location.protocol?"https://"+t+"/":"http://"+t+"/";d(["setSiteId",e.siteId]),d(["setTrackerUrl",r+e.serverTrackerName])}if(e.userId&&h(e.userId),e.enableLinkTracking&&d(["enableLinkTracking"]),e.injectScript&&!n){var o=document,i=o.createElement("script"),a=o.getElementsByTagName("script")[0];i.type="text/javascript",i.defer=!0,i.async=!0,i.src=r+e.clientTrackerName,a.parentNode.insertBefore(i,a)}}(),{_isShim:!1,track:p,push:d,setUserId:h,trackError:e.trackErrorHandler,connectToHistory:function(t,o){o="function"==typeof o?o:function(e){return e};var i=function(e,t){var o=e(t);void 0!==o?p(o):"development"===n()&&r(null,"The modifier given to .connectToHistory did not return any object. Please make sure to return the modified location object in your modifier.")};return u=t.listen((function(e){i(o,e)})),!e.ignoreInitialVisit&&t.location&&i(o,t.location),t},disconnectFromHistory:function(){return!!u&&(u(),!0)}}}}).call(this,n(248))},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){var r,o,i;i=function(){function e(e,t){return e=(e=(e=(e=e.replace(/:\//g,"://")).replace(/([^:\s])\/+/g,"$1/")).replace(/\/(\?|&|#[^!])/g,"$1")).replace(/(\?.+)\?/g,"$1&")}return function(){var t=arguments;"object"==typeof arguments[0]&&(t=arguments[0]);var n=[].slice.call(t,0).join("/");return e(n)}},e.exports?e.exports=i():void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){var r={"./de":314,"./de.json":314,"./en":315,"./en.json":315,"./es":316,"./es.json":316,"./fr":317,"./fr.json":317,"./it":318,"./it.json":318,"./ja":319,"./ja.json":319,"./nl_NL":320,"./nl_NL.json":320,"./pl":321,"./pl.json":321,"./ru":322,"./ru.json":322,"./sq":323,"./sq.json":323,"./zh_CN":324,"./zh_CN.json":324};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=675},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t=(0,i.default)(e);return{getItem:function(e){return new Promise((function(n,r){n(t.getItem(e))}))},setItem:function(e,n){return new Promise((function(r,o){r(t.setItem(e,n))}))},removeItem:function(e){return new Promise((function(n,r){n(t.removeItem(e))}))}}};var r,o=n(677),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(){}t.default=function(e){var t=e+"Storage";return function(e){if("object"!==("undefined"==typeof self?"undefined":r(self))||!(e in self))return!1;try{var t=self[e],n="redux-persist "+e+" test";t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch(e){return!1}return!0}(t)?self[t]:i};var i={getItem:o,setItem:o,removeItem:o}},function(e,t,n){"use strict";n.r(t);var r=n(13),o=n.n(r),i=n(4),a=n.n(i),u=n(7),c=n.n(u),s=n(11),l=n.n(s),f=n(9),p=n.n(f),d=n(10),h=n.n(d),v=n(6),y=n.n(v),g=n(2),m=n.n(g),b=n(0),w=n.n(b),k=n(37),x=n(20),_=n(26),O=n.n(_),S=n(25),E=n.n(S),j=n(1),P=n.n(j),C=n(195),T=n.n(C),A=n(14),D=n.n(A);function R(e){var t=e.icon,n=e.width,r=e.height,o=e.color,i=e.className,a=e.preserveColor,u=e.rotate,c=e.size,s=e.spin,l=E()(e,["icon","width","height","color","className","preserveColor","rotate","size","spin"]),f=Object(b.useMemo)((function(){return t instanceof Function?t:function(e){var t;return(t=e.id?"#".concat(e.id):"#"===e[0]?e:"#"+e)?function(e){return w.a.createElement("svg",e,w.a.createElement("use",{xlinkHref:t}))}:(console.warn("Icon not found ".concat(e,".")),null)}(t)}),[t]),p=e.style;p=Object.assign({},p),o&&(p.fill=o),u&&(p.transform="rotate(".concat(u,"deg)"));var d=a?"icon--preserveColor":"icon",h=D()(i,T.a[d],m()({},T.a["icon--spin"],s));return f?w.a.createElement(f,O()({className:h,style:p,width:n||c||"16",height:r||c||"16"},l)):null}R.isProperIcon=function(e){return e&&!!e.id||"string"==typeof e};var I=P.a.oneOfType([P.a.string,P.a.object,P.a.func]);R.propTypes={icon:I.isRequired,width:P.a.oneOfType([P.a.string,P.a.number]),height:P.a.oneOfType([P.a.string,P.a.number]),color:P.a.oneOfType([P.a.string,P.a.object]),className:P.a.string,preserveColor:P.a.bool,size:P.a.oneOfType([P.a.string,P.a.number]),spin:P.a.bool},R.defaultProps={spin:!1};var N=R,z=n(128),M=null,F=n.n(z)()((function(){var e=document.querySelector("[role=application]");if(e&&e.dataset){var t=e.dataset.cozyTracking;if(""===t||"true"===t)return!0;if("false"===t)return!1}})),L=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!F())return null;if(null!==M)return M;try{!1===o&&Piwik.getTracker();var i=n(672);return M=i({url:e||"https://matomo.cozycloud.cc",siteId:t||8,injectScript:o}),r&&U(),M}catch(e){return console.warn(e),M=null,null}},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!==M){var t,n,r=document.querySelector("[role=application]");if(r&&r.dataset){n=r.dataset.cozyAppName;var o=(t=r.dataset.cozyDomain||"").indexOf(":");o>=0&&(t=t.substring(0,o))}e=Object.assign({userId:t,appDimensionId:1,app:n,heartbeat:15},e),parseInt(e.heartbeat)>0&&M.push(["enableHeartBeatTimer",parseInt(e.heartbeat)]),M.push(["setUserId",e.userId]),M.push(["setCustomDimension",e.appDimensionId,e.app])}},B=n(23),q=n(5),H=n.n(q),W=n(8),Q=n.n(W),$=n(29),G=n(76),V=n.n(G),J=n(74),Y=n.n(J),K={},X=function(){var e=Q()(H.a.mark((function e(t,n,r){var o;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Cannot fetch icon: missing domain");case 2:if(o=Z(t,n,r)){e.next=5;break}throw new Error("Cannot get icon source for app ".concat(t.name));case 5:return e.abrupt("return",new Promise((function(e,t){var n=document.createElement("img");n.onload=function(){K[o]=!0,e(o)},n.onerror=function(){var e=new Error("Error while preloading ".concat(o));console.error(e.message),t(e)},n.src=o})));case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Z=function(e,t,n){if(!t)return null;var r=ee(e);return(r=r||te(e))?"".concat(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return"http".concat(e?"s":"",":")}(n),"//").concat(t).concat(r):null},ee=function(e){return e.links&&e.links.icon},te=function(e){return"string"==typeof e?"/registry/".concat(e,"/icon"):e.latest_version&&e.latest_version.version&&"/registry/".concat(e.slug,"/").concat(e.latest_version.version,"/icon")},ne=P.a.shape({name:P.a.string,slug:P.a.string,developer:P.a.object,links:P.a.shape({icon:P.a.string}),latest_version:P.a.shape({version:P.a.string})});P.a.shape({_id:P.a.string,class:P.a.string,mime:P.a.string,name:P.a.string});function re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var oe=function(e){p()(r,e);var t,n=re(r);function r(e,t){var o;a()(this,r),(o=n.call(this,e,t)).isUnmounting=!1,o.handleError=o.handleError.bind(l()(o));try{var i=e.app,u=e.client,c=new URL(u.getStackClient().uri);o.domain=c.host,o.secure="https:"===c.protocol;var s=function(e,t,n){var r=Z(e,t,n);return r&&K[r]?r:null}(i,o.domain,o.secure);o.state={error:null,icon:s,status:s?"done":"fetching"}}catch(e){o.state={error:e,status:"errored"}}return o}return c()(r,[{key:"componentWillUnmount",value:function(){this.isUnmounting=!0}},{key:"componentDidMount",value:function(){this.isUnmounting=!1,this.load()}},{key:"componentDidUpdate",value:function(e){this.props.fetchIcon!==e.fetchIcon&&this.load()}},{key:"load",value:(t=Q()(H.a.mark((function e(){var t,n,r,o,i,a,u;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.app,r=t.fetchIcon,o=t.onReady,i=r||X,e.prev=2,e.next=5,i(n,this.domain,this.secure);case 5:a=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),u=e.t0;case 11:this.isUnmounting||(this.setState({error:u,icon:a,status:u?"errored":"done"}),"function"==typeof o&&o());case 12:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(){return t.apply(this,arguments)})},{key:"handleError",value:function(){this.setState({status:"errored"})}},{key:"render",value:function(){var e=this.props,t=e.alt,n=e.className,r=e.fallbackIcon,o=this.state,i=o.icon;switch(o.status){case"fetching":return w.a.createElement("div",{className:D()(V.a["c-loading-placeholder"],V.a["c-app-icon"],n)});case"done":return w.a.createElement("img",{alt:t,className:D()(V.a["c-app-icon"],n),src:i,onError:this.handleError});case"errored":default:return w.a.createElement(N,{className:D()(V.a["c-app-icon"],V.a["c-app-icon-default"],n),height:"100%",icon:r||"cube",width:"100%",color:Y.a.coolGrey})}}}]),r}(b.Component);oe.propTypes={alt:P.a.string,app:P.a.oneOfType([ne,P.a.string]),fallbackIcon:I,fetchIcon:P.a.func,client:P.a.object.isRequired,className:P.a.string,onReady:P.a.func};var ie=Object($.withClient)(oe),ae=n(21),ue=n(43),ce=n.n(ue),se=n(44),le=n.n(se),fe=new ce.a({id:"icon-cozy-home",use:"icon-cozy-home-usage",viewBox:"0 0 32 32",content:'<symbol viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="icon-cozy-home">\n <defs></defs>\n <g id="icon-cozy-home_📦-components" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="icon-cozy-home_components/header/2_1" transform="translate(-16.000000, -12.000000)">\n <g id="icon-cozy-home_icon-cozy-home" transform="translate(16.000000, 12.000000)">\n <g id="icon-cozy-home_logo">\n <g id="icon-cozy-home_logo/cozypastille">\n <circle id="icon-cozy-home_Oval" fill="#297EF2" fill-rule="nonzero" cx="16" cy="16" r="16" />\n <path d="M19.31364,17.56136 C19.15384,17.81024 18.79956,17.88504 18.55544,17.72184 C18.53436,17.70892 18.51396,17.69464 18.49492,17.68036 C17.78296,18.23864 16.90644,18.54328 15.99524,18.54328 C15.08608,18.54328 14.2116,18.24 13.501,17.68376 C13.48264,17.69668 13.46428,17.71028 13.44524,17.72184 C13.19364,17.88572 12.8448,17.80752 12.68636,17.5634 C12.52588,17.31588 12.59592,16.98064 12.84208,16.8154 C13.0556,16.67464 13.07056,16.3938 13.07056,16.39108 C13.076,16.2442 13.13992,16.10412 13.24668,16.00552 C13.35276,15.90692 13.48604,15.8498 13.63292,15.86136 C13.92736,15.86816 14.16672,16.11568 14.16128,16.41352 C14.16128,16.4176 14.1606,16.56652 14.10688,16.77324 C15.20508,17.68512 16.79696,17.68172 17.89108,16.76576 C17.85096,16.60732 17.84076,16.48084 17.83804,16.42236 C17.83532,16.26936 17.88972,16.13064 17.9924,16.02524 C18.09304,15.92188 18.22904,15.8634 18.37388,15.86068 L18.3834,15.86068 C18.67784,15.86068 18.92196,16.098 18.92876,16.39312 C18.92876,16.39312 18.9444,16.67532 19.15588,16.81472 C19.4034,16.97792 19.47412,17.3118 19.31364,17.56136 M21.63584,11.19248 C21.47876,9.86376 20.89056,8.63568 19.94604,7.6864 C18.8628,6.59772 17.4314,6 15.91636,6 C14.40132,6 12.9706,6.59772 11.88736,7.68708 C10.93876,8.63976 10.3492,9.87464 10.19552,11.21084 C8.89468,11.3686 7.69176,11.97448 6.76288,12.94756 C5.70344,14.05936 5.12,15.52884 5.12,17.08468 C5.12,20.34664 7.704,23 10.88164,23 L21.11768,23 C24.29396,23 26.88,20.34664 26.88,17.08468 C26.88,14.00224 24.57072,11.46244 21.63584,11.19248" id="icon-cozy-home_Fill-1" fill="#FFFFFF" fill-rule="evenodd" />\n </g>\n </g>\n </g>\n </g>\n </g>\n</symbol>'}),pe=(le.a.add(fe),fe);function de(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var he=function(e){p()(n,e);var t=de(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props.className;return w.a.createElement(ie,{fetchIcon:function(){return"".concat(ae.b.get.cozyURL(),"/assets/images/icon-cozy-home.svg")},fallbackIcon:pe,className:e})}}]),n}(b.PureComponent),ve=function(e){var t=e.webviewContext,n=e.homeHref;return t?w.a.createElement("button",{onClick:function(){t.call("backToHome")},className:"coz-nav-apps-btns-home --flagship"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"})):n?w.a.createElement("a",{href:n,className:"coz-nav-apps-btns-home"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"})):w.a.createElement("span",{className:"coz-nav-apps-btns-home"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"}))},ye=n(50),ge=n.n(ye),me=function(e){var t,n=e.className,r=e.extension,o=e.size,i=e.theme,a=e.variant,u=e.round,c=e.align;return D()(ge.a["c-btn"],(t={},m()(t,ge.a["c-btn--".concat(i)],i),m()(t,ge.a["c-btn--".concat(o)],"normal"!==o),m()(t,ge.a["c-btn--".concat(a)],a),m()(t,ge.a["c-btn--".concat(r)],r),m()(t,ge.a["c-btn--".concat(c)],c),m()(t,ge.a["c-btn--round"],u),t),n)},be=function(e){return function(t){var n=t.busy,r=t.disabled,o=E()(t,["busy","disabled"]);return n&&(o["aria-busy"]=!0),r&&(o["aria-disabled"]=!0),"button"===e&&r&&(o.disabled=!0),o}},we={button:be("button"),a:be("a")},ke=function(e){return e},xe={tiny:8,small:12,large:18},_e=function(e){var t=e.children,n=e.icon,r=e.iconOnly,o=e.label,i=e.subtle,a=e.className,u=e.extension,c=e.round,s=e.size,l=e.theme,f=e.align,p=e.extraRight,d=e.tag,h=E()(e,["children","icon","iconOnly","label","subtle","className","extension","round","size","theme","align","extraRight","tag"]),v=we[d]||ke,y=r?o:null,g=r?"u-visuallyhidden":null;return w.a.createElement(d,O()({},v(h),{className:me({extension:u,align:f,round:c,size:s,theme:l,className:a,variant:i&&"subtle"}),title:y}),w.a.createElement("span",null,N.isProperIcon(n)?w.a.createElement(N,{size:xe[s],icon:n,"aria-hidden":!0,focusable:"false"}):n,o&&w.a.createElement("span",{className:g},o),t,p&&w.a.createElement("span",{className:"u-ml-auto"},p),h.busy&&w.a.createElement(N,{size:xe[s],icon:"spinner",spin:!0,className:"u-ml-half","aria-hidden":!0,focusable:"false"})))},Oe=function(e){return w.a.createElement(_e,e)},Se=function(e){return w.a.createElement(_e,e)};function Ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}Oe.propTypes={children:P.a.node,label:P.a.node.isRequired,icon:P.a.oneOfType([P.a.node,I]),iconOnly:P.a.bool,theme:P.a.string,size:P.a.oneOf(["tiny","small","large","normal"]),extension:P.a.oneOf(["narrow","full"]),align:P.a.oneOf(["left","right","center"]),round:P.a.bool,className:P.a.string,onClick:P.a.func,extraRight:P.a.PropTypes.node,busy:P.a.bool,disabled:P.a.bool,type:P.a.oneOf(["button","reset","submit"]),subtle:P.a.bool},Oe.defaultProps={type:"submit",tag:"button",size:"normal",align:"center"},Se.defaultProps={tag:"a"};var je=function(e){p()(n,e);var t=Ee(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).state={unmounted:!0},r.animate=r.animate.bind(l()(r)),r}return c()(n,[{key:"animate",value:function(){var e=this;return setTimeout((function(){e.setState((function(){return{unmounted:!1}}))}),100)}},{key:"componentDidMount",value:function(){this.animate()}},{key:"render",value:function(){var e=this.props,t=e.t,n=e.code,r=e.links,o=this.state.unmounted;return w.a.createElement("div",{className:"coz-bar-banner".concat(o?" unmounted":"")},w.a.createElement("p",null,t("banner.".concat(n,".description"))),w.a.createElement(Se,{className:"coz-bar-banner-button",size:"tiny",href:r,label:t("banner.".concat(n,".CTA"))}))}}]),n}(b.Component),Pe=Object(x.translate)()(je),Ce=n(132),Te=n.n(Ce),Ae=n(334),De=n.n(Ae),Re=n(24),Ie=n.n(Re),Ne=n(72),ze=n.n(Ne),Me=function(e){var t=window.innerWidth;return ze()(e,(function(e){var n=Ie()(e,2),r=n[0],o=n[1];return t>=r&&(void 0===o||t<=o)}))},Fe={isExtraLarge:[1201],isLarge:[1024,1200],isMedium:[769,1023],isSmall:[544,768],isTiny:[0,543],isDesktop:[1024],isTablet:[769,1023],isMobile:[0,768]};function Le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}P.a.shape(Object.keys(Fe).reduce((function(e,t){return e[t]=P.a.bool.isRequired,e}),{}));var Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fe;return function(t){var n=function(n){p()(o,n);var r=Le(o);function o(t){var n;return a()(this,o),(n=r.call(this,t)).state={breakpoints:Me(e)},n.checkBreakpoints=De()((function(){n.setState({breakpoints:Me(e)})}),100,{trailing:!0}),n}return c()(o,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.checkBreakpoints)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.checkBreakpoints)}},{key:"render",value:function(){var e=this.props,n=this.state.breakpoints;return w.a.createElement(t,O()({},e,{breakpoints:n}))}}]),o}(b.Component);return n.displayName="withBreakpoints(".concat(t.displayName||t.name,")"),n}},Be=n(12),qe=n(16),He=n.n(qe),We=P.a.shape({slug:P.a.string.isRequired,name:P.a.string.isRequired,namePrefix:P.a.string,comingSoon:P.a.bool,href:P.a.string,links:P.a.shape({icon:P.a.string.isRequired})}),Qe={drive:{appId:"io.cozy.drive.mobile",uri:"cozydrive://",name:"Cozy Drive"},banks:{appId:Object(B.isAndroidApp)()?"io.cozy.banks.mobile":"io.cozy.banks",uri:"cozybanks://",name:"Cozy Banks"}},$e=function(e){return e?e.startsWith("/")?e:"/"+e:"/"},Ge=function(e){var t=e.slug,n=e.cozyUrl,r=e.subDomainType,o=e.fallbackUrl,i=e.nativePath;if(i=$e(i),!n&&!o)throw new Error("Must have either cozyUrl or fallbackUrl to generate universal link.");n&&!o&&(o=function(e){var t=e.cozyUrl,n=e.nativePath,r=e.slug,o=e.subDomainType;n=$e(n);var i=new URL(t);return i.host="nested"===o?"".concat(r,".").concat(i.host):i.host.split(".").map((function(e,t){return 0===t?e+"-"+r:e})).join("."),i.hash=n,i.toString()}({cozyUrl:n,nativePath:i,slug:t,subDomainType:r}));var a=new URL("https://links.mycozy.cloud/"+t+i);return a.searchParams.append("fallback",o),a.toString()};function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Je,Ye,Ke,Xe,Ze=(Je=function(e){return Object(B.checkApp)(e).catch((function(){return!1}))},Ye=1e4,Ke=function(e){return e.appId},Xe={},function(e){var t=Ke(e),n=Xe[t];return n&&n.result&&n.date-Date.now()<Ye||(Xe[t]={result:Je(e),date:Date.now()}),Xe[t].result}),et=function(e){p()(r,e);var t,n=Ve(r);function r(e){var t;return a()(this,r),t=n.call(this,e),m()(l()(t),"state",{nativeAppIsAvailable:null,isFetchingAppInfo:!1}),t}return c()(r,[{key:"componentDidMount",value:function(){Object(B.isMobileApp)()&&this.checkAppAvailability()}},{key:"checkAppAvailability",value:(t=Q()(H.a.mark((function e(){var t,n,r;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.slug,!(n=Qe[t])){e.next=9;break}return e.t0=Boolean,e.next=6,Ze(n);case 6:e.t1=e.sent,r=(0,e.t0)(e.t1),this.setState({nativeAppIsAvailable:r});case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.props,t=e.children,n=e.slug,i=this.state.nativeAppIsAvailable,a=Qe[n],u=r.getOnClickHref(this.props,i),c=u.href,s=u.onClick;return t(o()({},a,{onClick:s,href:c}))}}],[{key:"getOnClickHref",value:function(e,t){var n=e.slug,o=e.nativePath,i=e.href,a=null,u=Object(B.isMobileApp)(),c=Qe[n];if(u)t?(a=r.openNativeFromNative.bind(this,e),i="#"):a=r.openWeb.bind(this,e);else if(Object(B.isMobile)()&&c)if(Object(B.isAndroid)())a=r.openNativeFromWeb.bind(this,e);else try{i=Ge({slug:n,nativePath:o,fallbackUrl:i})}catch(e){console.error(e),i="#"}return{href:i,onClick:a}}},{key:"openNativeFromWeb",value:function(e,t){var n=e.href,o=e.slug,i=e.nativePath,a=e.onAppSwitch,u=Qe[o];t&&t.preventDefault(),r.onAppSwitch(a),Object(B.openDeeplinkOrRedirect)(u.uri+("/"===i?"":i),(function(){window.location.href=n}))}},{key:"onAppSwitch",value:function(e){"function"==typeof e&&e()}},{key:"openNativeFromNative",value:function(e,t){var n=e.slug,o=e.onAppSwitch;t&&t.preventDefault();var i=Qe[n];r.onAppSwitch(o),Object(B.startApp)(i).catch((function(e){console.error("AppLinker: Could not open native app",e)}))}},{key:"openWeb",value:function(e){r.onAppSwitch(e.onAppSwitch)}}]),r}(w.a.Component);et.defaultProps={nativePath:"/"},et.propTypes={slug:P.a.string.isRequired,href:P.a.string.isRequired,nativePath:P.a.string,onAppSwitch:P.a.func};var tt=et;function nt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var rt=He()($.models,"applications.getAppDisplayName",(function(e){return e.namePrefix&&"cozy"!==e.namePrefix.toLowerCase()?"".concat(e.namePrefix," ").concat(e.name):e.name})),ot=function(e){p()(n,e);var t=nt(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).onAppSwitch=r.onAppSwitch.bind(l()(r)),r}return c()(n,[{key:"componentWillUnmount",value:function(){this.switchTimeout&&clearTimeout(this.switchTimeout)}},{key:"buildAppUrl",value:function(e){var t;try{t=new URL(e)}catch(e){return console.error(e.message),null}var r=n.buildQueryParams(this.props,this.context);if(r)for(var o in r)t.searchParams.append(o,r[o]);return t.toString()}},{key:"onAppSwitch",value:function(){var e=this.props.onAppSwitch;"function"==typeof e&&(this.switchTimeout=setTimeout((function(){e()}),1e3))}},{key:"render",value:function(){var e=this.props,t=e.useHomeIcon,n=e.app,r=n.slug?"icon-".concat(n.slug):"",o=rt(n);return w.a.createElement(tt,{onAppSwitch:this.onAppSwitch,slug:n.slug,href:this.buildAppUrl(n.href)||""},(function(e){var i=e.onClick,a=e.href;return w.a.createElement("li",{className:"coz-nav-apps-item".concat(n.isCurrentApp?" --current":"")},w.a.createElement("a",{role:"menuitem",href:a,"data-icon":r,title:o,onClick:i},t?w.a.createElement(he,{className:"coz-nav-apps-item-icon"}):w.a.createElement(ie,O()({app:n,className:"coz-nav-apps-item-icon",key:n.slug},ae.b.get.iconProps())),w.a.createElement("p",{className:"coz-label"},o)))}))}}]),n}(w.a.Component);m()(ot,"buildQueryParams",(function(){return null})),ot.propTypes={app:We.isRequired,useHomeIcon:P.a.bool};var it=ot,at=function(){return w.a.createElement("li",{className:"coz-nav-apps-item"},w.a.createElement("span",{role:"menuitem",disabled:!0},w.a.createElement("div",{className:"coz-nav-apps-item-icon coz-loading-placeholder"}),w.a.createElement("p",{className:"coz-label coz-loading-placeholder"})))},ut=n(333),ct=n.n(ut);function st(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var lt=function(e){p()(n,e);var t=st(n);function n(e,r){var o;return a()(this,n),(o=t.call(this,e,r)).translateApp=ft(o.props.t),o}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.t,n=e.apps,r=e.breakpoints,o=e.homeApp,i=e.isFetchingApps,a=e.onAppSwitch,u=r.isMobile,c=o&&o.isCurrentApp,s=o&&o.slug;return i||n&&n.length?w.a.createElement("div",{className:"coz-nav-pop-content"},w.a.createElement("ul",{className:"coz-nav-group"},u&&o&&w.a.createElement(it,{app:o,useHomeIcon:!0,onAppSwitch:a}),i?new Array(3).fill({}).map((function(e,t){return w.a.createElement(at,{key:t})})):n.filter((function(e){return e.slug!==s})).sort(function(e){return function(t,n){return e(t)>e(n)}}(this.translateApp)).map((function(e,t){return w.a.createElement(it,{app:e,key:t,onAppSwitch:a})}))),o&&!u&&!c&&w.a.createElement("a",{role:"menuitem",href:o.href,className:"coz-apps-home-btn"},w.a.createElement("img",{src:ct.a}),t("menu.home"))):w.a.createElement("p",{className:"coz-nav--error coz-nav-group"},t("no_apps"))}}]),n}(b.Component);lt.propTypes={homeApp:P.a.shape({isCurrentApp:P.a.bool,slug:P.a.string}),apps:P.a.array,isFetchingApps:P.a.bool.isRequired};var ft=function(e){return function(t){var n=t.namePrefix?e("".concat(t.slug,".namePrefix"),{_:t.namePrefix}):null,r=e("".concat(t.slug,".name"),{_:t.name});return n?"".concat(n," ").concat(r):"".concat(r)}},pt=Object(k.connect)((function(e){return{apps:Object(Be.d)(e),homeApp:Object(Be.f)(e),isFetchingApps:Object(Be.n)(e)}}))(Object(x.translate)()(Ue()(lt))),dt=Object(x.translate)()((function(e){var t=e.t,n=e.data,r=Number.isInteger(n.quota)?(n.quota/1e9).toFixed(2):n.quota,o=Number.isInteger(n.usage)?(n.usage/1e9).toFixed(2):n.usage;return w.a.createElement("div",{className:"coz-nav-storage"},w.a.createElement("p",{className:"coz-nav-storage-text"},t("storage_phrase",{diskUsage:o,diskQuota:r})),w.a.createElement("progress",{className:"cozy-nav-storage-bar",value:o,max:r,min:"0"}))})),ht=function(e){var t=e.t,n=e.onLogOut,r=e.settingsAppURL,o=e.storageData,i=e.onClaudy,a=e.isDrawer,u=void 0!==a&&a,c=e.isClaudyLoading,s=e.toggleSupport,l=e.shoulDisplayViewOfferButton,f=e.managerUrlPremiumLink,p=e.viewOfferButtonText;return w.a.createElement("div",{className:"coz-nav-pop-content"},u&&w.a.createElement("hr",null),r&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem",href:"".concat(r,"#/profile"),target:"_self","data-icon":"icon-profile",title:t("profile")},w.a.createElement("p",{className:"coz-label"},t("profile")))),w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem",href:"".concat(r,"#/connectedDevices"),target:"_self","data-icon":"icon-connectedDevices",title:t("connectedDevices")},w.a.createElement("p",{className:"coz-label"},t("connectedDevices"))))),u&&i&&!Object(B.isMobileApp)()&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Oe,{type:"button",role:"menuitem",className:"coz-nav-settings-item-btn",icon:"cloud",busy:c,onClick:i,title:t("claudy.title"),label:t("claudy.title")}))),!u&&o&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem","data-icon":"icon-storage",target:"_self",title:t("storage"),href:"".concat(r,"#/storage")},t("storage"),w.a.createElement(dt,{data:o})))),(!u||!Object(B.isMobileApp)())&&l&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Se,{subtle:!0,role:"menuitem",className:"coz-nav-settings-item-btn",icon:"cloud-happy",title:p,label:p,href:f}))),!Object(B.isMobileApp)()&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Oe,{type:"button",role:"menuitem",className:"coz-nav-settings-item-btn",onClick:s,icon:"help",title:t("help"),label:t("help")}))),w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("button",{type:"button",role:"menuitem","data-icon":"icon-logout",onClick:n,title:t("logout")},t("logout")))))};ht.defaultProps={shoulDisplayViewOfferButton:!1},ht.propTypes={shoulDisplayViewOfferButton:P.a.bool,t:P.a.func.isRequired,onLogOut:P.a.func.isRequired,settingsAppURL:P.a.string,storageData:P.a.object,onClaudy:P.a.oneOfType([P.a.bool,P.a.func]),isDrawer:P.a.bool,isClaudyLoading:P.a.bool,toggleSupport:P.a.func.isRequired,viewOfferButtonText:P.a.string};var vt=Object(x.translate)()(ht);function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var gt=function(e){p()(o,e);var t,n,r=yt(o);function o(e){var t;return a()(this,o),t=r.call(this,e),m()(l()(t),"onDrawerClick",(function(e){e.target===t.wrapperRef&&t.close()})),m()(l()(t),"onTransitionEnd",(function(){t.props.visible?(t.gesturesHandler||t.attachGestures(),t.preventBackgroundScrolling()):(t.restoreBackgroundScrolling(),t.setState({isClosing:!1})),t.props.drawerListener()})),m()(l()(t),"componentWillReceiveProps",function(){var e=Q()(H.a.mark((function e(n){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.UNSAFE_componentWillReceiveProps(n);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),m()(l()(t),"UNSAFE_componentWillReceiveProps",function(){var e=Q()(H.a.mark((function e(n){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.props.visible||!n.visible){e.next=3;break}return e.next=3,t.props.fetchSettingsData();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),m()(l()(t),"close",(function(){t.state.isClosing||(t.detachGestures(),t.setState((function(){return{isClosing:!0}})),t.turnTransitionsOn(),t.props.onClose(),t.asideRef.style.transform="")})),t.state={isScrolling:!1,isClosing:!1},t.handleLogout=t.handleLogout.bind(l()(t)),t}return c()(o,[{key:"componentDidMount",value:(n=Q()(H.a.mark((function e(){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.turnTransitionsOn();case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"turnTransitionsOn",value:function(){this.asideRef.classList.add("with-transition"),this.asideRef.addEventListener("transitionend",this.onTransitionEnd)}},{key:"turnTransitionsOff",value:function(){this.asideRef.classList.remove("with-transition"),this.asideRef.removeEventListener("transitionend",this.onTransitionEnd)}},{key:"preventBackgroundScrolling",value:function(){document.body.style.overflow="hidden"}},{key:"restoreBackgroundScrolling",value:function(){document.body.style.overflow="auto"}},{key:"detachGestures",value:function(){this.gesturesHandler.destroy(),this.gesturesHandler=null}},{key:"attachGestures",value:function(){var e=this;this.gesturesHandler=new Te.a.Manager(document.documentElement,{recognizers:[[Te.a.Pan,{direction:Te.a.DIRECTION_ALL}]]});var t=this.asideRef.getBoundingClientRect().width,n=null;this.gesturesHandler.on("panstart",(function(t){e.state.isClosing||("panup"===t.additionalEvent||"pandown"===t.additionalEvent?e.setState({isScrolling:!0}):(e.turnTransitionsOff(),n=0))})),this.gesturesHandler.on("pan",(function(r){e.state.isClosing||e.state.isScrolling||(n=-r.deltaX/t,e.applyTransformation(n))})),this.gesturesHandler.on("panend",(function(n){if(!e.state.isClosing)if(e.state.isScrolling)e.setState({isScrolling:!1});else{var r=-n.deltaX/t>=.4,o=n.velocity<0&&Math.abs(n.velocity)>=.2;r||o?e.close():(e.turnTransitionsOn(),e.applyTransformation(0))}}))}},{key:"applyTransformation",value:function(e){e=Math.min(1.1,Math.max(0,e)),this.asideRef.style.transform="translateX(-"+100*e+"%)"}},{key:"handleLogout",value:(t=Q()(H.a.mark((function e(){var t,n,r,o;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props,n=t.onLogOut,r=t.logOut,!n||"function"!=typeof n){e.next=6;break}if(!((o=n())instanceof Promise)){e.next=6;break}return e.next=6,o;case 6:r();case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props,n=t.onClaudy,r=t.visible,o=t.isClaudyLoading,i=t.toggleSupport,a=t.settingsAppURL,u=t.storageData;return w.a.createElement("div",{className:"coz-drawer-wrapper",onClick:this.onDrawerClick,"aria-hidden":r?"false":"true",ref:function(t){e.wrapperRef=t}},w.a.createElement("aside",{ref:function(t){e.asideRef=t}},w.a.createElement("nav",{className:"coz-drawer--apps"},w.a.createElement(pt,{onAppSwitch:this.close})),w.a.createElement("hr",{className:"coz-sep-flex"}),w.a.createElement("nav",{className:"coz-drawer--settings"},w.a.createElement(vt,{onLogOut:this.handleLogout,storageData:u,settingsAppURL:a,isClaudyLoading:o,onClaudy:n,toggleSupport:i,isDrawer:!0}))))}}]),o}(b.Component),mt=Object(k.connect)((function(e){return{storageData:Object(Be.i)(e),settingsAppURL:Object(Be.h)(e)}}),(function(e){return{fetchSettingsData:function(){return e(Object(Be.c)())},logOut:function(){return e(Object(Be.q)())}}}))(gt),bt=n(33),wt={query:function(){return Object($.Q)("io.cozy.settings").getById("instance")},as:"instanceQuery"},kt={query:function(){return Object($.Q)("io.cozy.settings").getById("context")},as:"contextQuery"},xt={query:function(){return Object($.Q)("io.cozy.settings").getById("disk-usage")},as:"diskUsageQuery"},_t=n(130),Ot=function(){return Object(_t.a)("8.3.0")};function St(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Et=void 0,jt=void 0,Pt=void 0;$.models&&(Et=$.models.instance,Pt=function(e){var t=He()(e,"diskUsage.data.attributes.quota",!1);return parseInt(t)<5e10},jt=function(e){return!Et.isSelfHosted(e)&&Et.arePremiumLinksEnabled(e)&&Et.getUuid(e)&&!Pt(e)});var Ct=function(e){p()(n,e);var t=St(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"onClickOutside",(function(e){(r.props.isFetching||r.state.opened)&&(r.rootRef.contains(e.target)||(r.setState({opened:!1}),e.stopPropagation()))})),m()(l()(r),"toggleMenu",(function(){if(r.state.opened)return r.setState({opened:!1});r.props.fetchSettingsData(),r.setState({opened:!0})})),r.state={opened:!1},r}return c()(n,[{key:"componentDidMount",value:function(){document.body.addEventListener("click",this.onClickOutside)}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.onClickOutside)}},{key:"render",value:function(){var e,t,n=this,r=this.props,o=r.isBusy,i=r.logOut,a=r.onLogOut,u=r.t,c=r.toggleSupport,s=r.diskUsageQuery,l=r.instanceQuery,f=r.contextQuery,p=r.storageData,d=r.settingsAppURL,h=r.isFetching,v=!1,y="",g=Ot();if(g&&!(t=[s,l,f].some((function(e){return"loading"===e.fetchStatus})))){var m={context:f,diskUsage:s,instance:l};(v=Et.shouldDisplayOffers(m)||jt(m))&&!jt(m)?y=u("view_offers"):jt(m)&&(y=u("view_my_offer")),e=Et.buildPremiumLink(m)}var b=!1;b=g?!t&&!h:!h;var k=this.state.opened&&b;return w.a.createElement("div",{className:"coz-nav coz-nav-settings",ref:function(e){n.rootRef=e}},w.a.createElement(Oe,{type:"button",theme:"text",onClick:this.toggleMenu,className:"coz-nav-settings-btn","aria-controls":"coz-nav-pop--settings",busy:o,icon:"gear",label:u("menu.settings")}),w.a.createElement("div",{className:"coz-nav-pop coz-nav-pop--settings",id:"coz-nav-pop--settings","aria-hidden":!k},b&&w.a.createElement(w.a.Fragment,null,w.a.createElement(vt,{onLogOut:function(){a&&"function"==typeof a?a():i()},toggleSupport:c,storageData:p,settingsAppURL:d,shoulDisplayViewOfferButton:v,managerUrlPremiumLink:e,viewOfferButtonText:y}))))}}]),n}(b.Component),Tt=function(e){return{storageData:Object(Be.i)(e),settingsAppURL:Object(Be.h)(e),isBusy:Object(Be.p)(e),isFetching:Object(Be.o)(e)}},At=function(e){return{fetchSettingsData:function(){return e(Object(Be.c)())},logOut:function(){return e(Object(Be.q)())}}},Dt=Ot()?Object(bt.d)(Object(x.translate)(),Object($.queryConnect)({instanceQuery:wt,contextQuery:kt,diskUsageQuery:xt}),Object(k.connect)(Tt,At))(Ct):Object(bt.d)(Object(x.translate)(),Object(k.connect)(Tt,At))(Ct);function Rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var It=function(e){p()(n,e);var t=Rt(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.homeApp,n=e.handleClick,r=e.appName,o=e.appNamePrefix,i=e.appSlug,a=e.iconPath,u=e.isFetchingApps,c=e.isPublic,s=e.opened,l=e.t,f=t&&t.isCurrentApp;if(!c&&u)return w.a.createElement("div",{className:"coz-nav-apps-btns --loading"},w.a.createElement("div",{className:"coz-nav-apps-btns-home coz-loading-placeholder"}),w.a.createElement("div",{className:"coz-nav-apps-btns-main coz-loading-placeholder"}));var p=!f&&o?[l("".concat(i,".name_prefix"),{_:o}),l("".concat(i,".name"),{_:r})].join(" "):l("".concat(i,".name"),{_:r}),d=!c&&t&&t.href;return w.a.createElement("div",{className:"coz-nav-apps-btns".concat(f?" --currentHome":"")},w.a.createElement(ve,{homeHref:d}),!f&&w.a.createElement("span",{className:"coz-nav-apps-btns-sep"}),w.a.createElement("button",{type:"button",onClick:c?null:n,className:"coz-nav-apps-btns-main","aria-controls":"coz-nav-pop--apps","data-tutorial":"apps",disabled:c},!f&&w.a.createElement("img",{className:"coz-bar-hide-sm",src:a,width:"28",alt:""}),w.a.createElement("span",{className:"coz-nav-app-name"},p),!c&&w.a.createElement(N,{icon:s?"top":"bottom",color:"#95999d",size:"12"})))}}]),n}(b.Component),Nt=Object(k.connect)((function(e){return{homeApp:Object(Be.f)(e),isFetchingApps:Object(Be.n)(e)}}),(function(){return{}}))(Object(x.translate)()(It));function zt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Mt=function(e){p()(n,e);var t=zt(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"onClickOutside",(function(e){r.state.opened&&(r.rootRef.contains(e.target)||r.modalContainer.contains(e.target)||(r.setState({opened:!1}),e.stopPropagation()))})),m()(l()(r),"toggleMenu",(function(){r.setState({opened:!r.state.opened})})),r.state={opened:!1},r}return c()(n,[{key:"componentDidMount",value:function(){document.body.addEventListener("click",this.onClickOutside),this.modalContainer=document.getElementById("cozy-bar-modal-dom-place")}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.onClickOutside)}},{key:"render",value:function(){var e=this,t=this.props,n=t.replaceTitleOnMobile,r=t.appName,o=t.appNamePrefix,i=t.appSlug,a=t.iconPath,u=t.isPublic,c=this.state.opened;return w.a.createElement("nav",{className:"coz-nav coz-nav-apps".concat(n?" coz-bar-hide-sm":""),ref:function(t){e.rootRef=t}},w.a.createElement(Nt,{appName:r,appNamePrefix:o,appSlug:i,iconPath:a,handleClick:this.toggleMenu,opened:c,isPublic:u}),w.a.createElement("div",{className:"coz-nav-pop coz-nav-pop--apps",id:"coz-nav-pop--apps","aria-hidden":!c},w.a.createElement(pt,null)))}}]),n}(b.Component),Ft=n(32),Lt=n.n(Ft),Ut=n(335),Bt=n.n(Ut),qt=n(336),Ht=n.n(qt);var Wt=n(129);function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var $t=function(e){return e.toString().toLowerCase().replace(/\//g," ").normalize("NFD").replace(/[\u0300-\u036f]/g,"").split(" ")},Gt=function(e,t){var n=$t(t),r=$t(e),o=[],i=0;r.forEach((function(e){n.forEach((function(t){var n=e.indexOf(t);n>=0&&o.push({from:i+n,to:i+n+t.length})})),i+=e.length+1}));for(var a=o.sort((function(e,t){return e.from>t.from})).reduce((function(e,t){return 0===e.length||e[e.length-1].to<t.from?e.push(t):e[e.length-1].to<t.to&&(e[e.length-1].to=t.to),e}),[]),u=a.length>0?[e.slice(0,a[0].from)]:e,c=0,s=a.length;c<s;++c)u.push(w.a.createElement("b",null,e.slice(a[c].from,a[c].to))),c+1<s&&u.push(e.slice(a[c].to,a[c+1].from));return a.length>0&&u.push(e.slice(a[a.length-1].to,e.length)),u},Vt=function(e){p()(n,e);var t=Qt(n);function n(){var e;a()(this,n);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return e=t.call.apply(t,[this].concat(i)),m()(l()(e),"state",{input:"",query:null,searching:!1,focused:!1,suggestionsBySource:[],sourceURLs:[]}),m()(l()(e),"sources",[]),m()(l()(e),"onMessageFromSource",(function(e){return function(t){var n=e.find((function(e){return e.origin===t.origin}));if(!n)return null;t.data.type==="intent-".concat(n.id,":ready")?(n.ready=!0,n.window=t.source,n.window.postMessage({},t.origin)):t.data.type==="intent-".concat(n.id,":data")&&n.resolvers[t.data.id]?(n.resolvers[t.data.id]({id:n.id,suggestions:t.data.suggestions}),delete n.resolvers[t.data.id]):Wt.a.log("unhandled message:",t)}})),m()(l()(e),"onChange",(function(t,n){var r=n.newValue;e.setState({input:r})})),m()(l()(e),"changeFocusState",(function(t){e.setState({focused:t})})),m()(l()(e),"clearSuggestions",(function(){e.setState({suggestionsBySource:[]})})),m()(l()(e),"onSuggestionsFetchRequested",(function(t){var n=t.value,r=e.sources.filter((function(e){return e.ready}));r.length>0&&(e.setState((function(e){return o()({},e,{searching:!0})})),r.forEach(function(){var t=Q()(H.a.mark((function t(r){var i,a,u,c;return H.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(e){var t=(new Date).getTime().toString();r.resolvers[t]=e,r.window.postMessage({query:n,id:t},r.origin)}));case 2:i=t.sent,a=i.id,u=i.suggestions,c=e.sources.find((function(e){return e.id===a})).slug,e.state.query!==n?e.setState((function(e){return o()({},e,{searching:!1,query:n,suggestionsBySource:[{title:c,suggestions:u}]})})):e.setState((function(e){return o()({},e,{suggestionsBySource:[].concat(Lt()(e.suggestionsBySource),[{title:c,suggestions:u}])})}));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()))})),m()(l()(e),"onSuggestionsClearRequested",(function(){e.clearSuggestions(),e.debouncedOnSuggestionsFetchRequested.cancel(),e.setState({query:null,searching:!1})})),m()(l()(e),"onSuggestionSelected",(function(t,n){var r=n.suggestion.onSelect;if(/^open:/.test(r)){var o=r.substr(5);window.location.href=o}else console.log("suggestion onSelect ("+r+") could not be executed");e.setState({input:"",query:null})})),m()(l()(e),"getSectionSuggestions",(function(e){return e.suggestions.slice(0,10)})),m()(l()(e),"getSuggestionValue",(function(e){return e.subtitle})),m()(l()(e),"renderSectionTitle",(function(){return null})),m()(l()(e),"renderSuggestion",(function(t){return w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-item"},t.icon&&w.a.createElement("img",{className:"coz-searchbar-autosuggest-suggestion-icon",src:t.icon,alt:"icon"}),w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-content"},w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-title"},Gt(t.title,e.state.query)),t.subtitle&&w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-subtitle"},Gt(t.subtitle,e.state.query))))})),e}return c()(n,[{key:"componentWillMount",value:function(){this.debouncedOnSuggestionsFetchRequested=Ht()(this.onSuggestionsFetchRequested,250)}},{key:"componentDidMount",value:function(){var e=this;(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object(ae.a)(null,"POST","/intents",{data:{type:"io.cozy.intents",attributes:{action:e,type:t,data:n,permissions:r}}})})("OPEN","io.cozy.suggestions").then((function(t){var n=t.attributes.services;if(!n)return null;e.sources=n.map((function(n){var r=n.href;e.setState((function(e){return o()({},e,{sourceURLs:[].concat(Lt()(e.sourceURLs),[r])})}));var i=r.split("/",3).join("/");return{slug:n.slug,origin:i,id:t._id,ready:!1,window:null,resolvers:{}}})),window.addEventListener("message",e.onMessageFromSource(e.sources))}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.input,r=t.query,o=t.searching,i=t.focused,a=t.suggestionsBySource,u=t.sourceURLs;if(0===u.length)return null;var c=this.props.t,s=""!==n&&null===r,l=a.reduce((function(e,t){return e+t.suggestions.length}),0)>0,f={placeholder:c("searchbar.placeholder"),value:n,onChange:this.onChange,onFocus:function(){return e.changeFocusState(!0)},onBlur:function(){return e.changeFocusState(!1)}},p={container:"coz-searchbar-autosuggest-container"+(o?" --searching":"")+(i?" --focused":""),input:"coz-searchbar-autosuggest-input",inputFocused:"coz-searchbar-autosuggest-input-focused",suggestionsContainer:"coz-searchbar-autosuggest-suggestions-container",suggestionsContainerOpen:"coz-searchbar-autosuggest-suggestions-container--open",suggestionsList:"coz-searchbar-autosuggest-suggestions-list",suggestion:"coz-searchbar-autosuggest-suggestion",suggestionHighlighted:"coz-searchbar-autosuggest-suggestion-highlighted",sectionTitle:"coz-searchbar-autosuggest-section-title"};return w.a.createElement("div",{className:"coz-searchbar",role:"search"},u.map((function(e,t){return w.a.createElement("iframe",{src:e,style:{visibility:"hidden",height:"0px",width:"0px"},key:e+t})})),w.a.createElement(Bt.a,{theme:p,suggestions:a,multiSection:!0,onSuggestionsFetchRequested:this.debouncedOnSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,getSuggestionValue:this.getSuggestionValue,getSectionSuggestions:this.getSectionSuggestions,renderSectionTitle:this.renderSectionTitle,renderSuggestion:this.renderSuggestion,inputProps:f,focusInputOnSuggestionClick:!1}),""!==n&&!s&&i&&!l&&w.a.createElement("div",{className:"coz-searchbar-autosuggest-status-container"},c("searchbar.empty",{query:n})))}}]),n}(b.Component),Jt=Object(x.translate)()(Vt);function Yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Kt=function(e){p()(n,e);var t=Yt(n);function n(e,r){var o;return a()(this,n),o=t.call(this,e),m()(l()(o),"toggle",(function(){o.props.opened||o.intentWrapperRef.childNodes.length?(o.setState({isActive:!o.state.isActive}),o.props.onToggle()):(o.setState({isLoading:!0}),o.intents.create("CLAUDY","io.cozy.settings",{exposeIntentFrameRemoval:!0}).start(o.intentWrapperRef,(function(){o.setState({isLoading:!1,isActive:!0}),o.props.onToggle()})).then((function(e){var t=e.removeIntentIframe;o.intentWrapperRef.addEventListener("transitionend",(function e(n){"transform"===n.propertyName&&(t(),o.setState({isActive:!1}),n.target.removeEventListener("transitionend",e))}),!1),o.props.onToggle()})))})),o.store=r.barStore,o.state={isLoading:!1,isActive:!1},o.intents=Object(ae.c)(),o}return c()(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.claudyFired&&this.toggle()}},{key:"componentWillReceiveProps",value:function(e){return this.UNSAFE_componentWillReceiveProps(e)}},{key:"render",value:function(){var e=this,t=this.props.opened,n=this.state,r=n.isLoading,o=n.isActive;return w.a.createElement("div",{className:"coz-claudy ".concat(t?"coz-claudy--opened":"")},w.a.createElement("button",{type:"button",className:"coz-claudy-icon coz-bar-hide-sm","data-claudy-opened":o,"data-claudy-loading":r,onClick:this.toggle}),w.a.createElement("div",{className:"coz-claudy-intent-wrapper",ref:function(t){e.intentWrapperRef=t}}))}}]),n}(b.Component),Xt=n(338),Zt=n.n(Xt),en=n(73),tn=n.n(en),nn=n(133);function rn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var on=["onEscape","children","className"],an=function(e){p()(n,e);var t=rn(n);function n(){var e;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),m()(l()(e),"handleKeydown",(function(t){27===t.keyCode&&e.props.onEscape()})),m()(l()(e),"handleClick",(function(t){e.props.onClick&&t.target===t.currentTarget&&e.props.onClick()})),e}return c()(n,[{key:"componentDidMount",value:function(){document.body.getBoundingClientRect().height>window.innerHeight&&(Object(nn.disableBodyScroll)(document.body),Object(nn.disableBodyScroll)(document.body.parentNode)),this.props.onEscape&&document.addEventListener("keydown",this.handleKeydown)}},{key:"componentWillUnmount",value:function(){Object(nn.clearAllBodyScrollLocks)(),this.props.onEscape&&document.removeEventListener("keydown",this.handleKeydown)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=tn()(this.props,on);return w.a.createElement("div",O()({onClick:this.handleClick,className:D()(Zt.a["c-overlay"],n)},r),t)}}]),n}(b.Component);an.propTypes={className:P.a.string,children:P.a.node,onEscape:P.a.func};var un=an;function cn(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return sn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sn(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}var ln;if(Object({USE_REACT:!0}).USE_PREACT)try{ln=n(!function(){var e=new Error("Cannot find module 'preact-portal'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}else{var fn=n(117);ln=function(e){var t=e.into,n=e.children,r=document.querySelector(t);return fn.createPortal(n,r)}}var pn=ln,dn=n(337),hn=n.n(dn),vn=n(15),yn=n.n(vn);function gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var mn=function(e){p()(n,e);var t=gn(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){return this.props.children}}]),n}(b.Component);function bn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var wn=function(e){p()(n,e);var t=bn(n);function n(e){var r;a()(this,n),r=t.call(this,e),m()(l()(r),"UNSAFE_componentWillUpdate",(function(e){var t=e.children;r.refreshComputedParts(t)})),m()(l()(r),"handleScroll",(function(){if(r.contentHeader){var e=l()(r).headerHeight;e||!r.contentHeader.clientHeight?!r.state.displayGhostHeader&&r.scrollingContent.scrollTop>e-20?r.setState((function(){return{displayGhostHeader:!0}})):r.state.displayGhostHeader&&r.scrollingContent.scrollTop<e-20&&r.setState((function(){return{displayGhostHeader:!1}})):r.headerHeight=r.contentHeader.clientHeight}}));var o=r.props.children;return r.refreshComputedParts(o),r.state={displayGhostHeader:!1},r}return c()(n,[{key:"componentWillUpdate",value:function(e,t){this.UNSAFE_componentWillUpdate(e,t)}},{key:"refreshComputedParts",value:function(e){var t=function(e){return w.a.Children.toArray(e).find((function(e){return e&&e.nodeName===mn}))}(e);this.animatedHeader=t,this.childrenToRender=t?function(e){return w.a.Children.map(e,(function(e){return e&&e.nodeName!==mn?e:null}))}(e):e}},{key:"componentDidMount",value:function(){this.scrollingContent.addEventListener("scroll",this.handleScroll,{passive:!0})}},{key:"componentWillUnmount",value:function(){this.scrollingContent.removeEventListener("scroll",this.handleScroll)}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.fixed,o=this.state.displayGhostHeader,i=this.animatedHeader,a=this.childrenToRender;return w.a.createElement("div",{className:D()(yn.a["c-modal-content".concat(r?"-fixed":"")],n),ref:function(t){e.scrollingContent=t}},i&&w.a.createElement("div",{className:i.attributes.className,ref:function(t){e.contentHeader=t}},w.a.createElement("h2",{className:yn.a["c-modal-illu-header"]},i.children),w.a.createElement("div",{className:D()(yn.a["c-modal-illu-header--ghost"],i.attributes.activeClassName,m()({},yn.a["is-active"],o))},i.children)),a)}}]),n}(b.Component),kn=function(e){var t=e.children,n=e.className;return w.a.createElement("div",{className:D()(yn.a["c-modal-content"],yn.a["c-modal-section"],n)},t)},xn=function(e){var t=e.title,n=e.children,r=e.className,o=e.appIcon,i=e.appName,a=e.appEditor,u=e.style,c=e.id,s="string"==typeof n;return w.a.createElement("div",{className:D()(yn.a["c-modal-header"],r),style:u,id:c},t&&w.a.createElement("h2",null,t),s?w.a.createElement("h2",null,n):n,i&&w.a.createElement("h2",{className:yn.a["c-modal-app"]},o&&w.a.createElement("img",{className:yn.a["c-modal-app-icon"],src:o}),a&&w.a.createElement("span",{className:yn.a["c-app-editor"]},a," "),i))},_n=function(e){var t=e.logo,n=e.bg,r=e.className,i=e.style,a=void 0===i?{}:i;return w.a.createElement("h2",{className:D()(yn.a["c-modal-header--branded"],r),style:o()({background:n},a)},w.a.createElement("img",{src:t,alt:""}))},On=Ue()((function(e){var t=e.onClick,n=e.color,r=e.className,o=e.breakpoints.isMobile;return w.a.createElement("button",{className:D()(yn.a["c-modal-close"],r),onClick:t,type:"button","aria-label":"close"},w.a.createElement(N,{icon:"cross",size:o?"16":"24",color:n||Y.a.coolGrey}))})),Sn=function(e){var t=e.children,n=e.className;return w.a.createElement("div",{className:D()(yn.a["c-modal-footer"],n)},t)},En=function(e){var t=e.secondaryText,n=e.secondaryAction,r=e.secondaryType,o=e.primaryText,i=e.primaryAction,a=e.primaryType,u=e.children,c=e.className;return w.a.createElement("div",{className:D()("u-flex","u-flex-wrap-reverse","u-flex-justify-end",yn.a["c-modal-footer--button"],c)},u,t&&n&&w.a.createElement(Oe,{theme:r,onClick:n,label:t,className:"u-flex-auto-s"}),o&&i&&w.a.createElement(Oe,{theme:a,onClick:i,label:o,className:"u-flex-auto-s"}))};En.defaultProps={primaryType:"regular",secondaryType:"secondary"};var jn=En,Pn=Ue()((function(e){var t=e.breakpoints.isMobile,n=e.className,r=E()(e,["breakpoints","className"]);return w.a.createElement(Oe,O()({icon:"previous",iconOnly:!0,extension:"narrow",theme:"text",label:"back",className:D()(yn.a["c-modal-back-button"],"u-m-0 u-pos-absolute",{"u-p-1":t,"u-p-half":!t,"u-h-3":t},n)},r))})),Cn=Object(b.createContext)();function Tn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var An=wn,Dn=function(e){p()(n,e);var t=Tn(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"handleOutsideClick",(function(e){e.target===e.currentTarget&&r.props.dismissAction&&r.props.dismissAction()})),r.titleID=hn()("modal_"),r}return c()(n,[{key:"componentDidMount",value:function(){this.props.title||this.props["aria-label"]||console.warn("If your modal does not provide a `title` prop, please provide the `aria-label` prop for a11y purposes."),document.body.classList.contains("has-modal")||(document.body.classList.add("has-modal"),this.shouldRemoveBodyClass=!0)}},{key:"componentWillUnmount",value:function(){this.shouldRemoveBodyClass&&document.body.classList.remove("has-modal")}},{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.description,o=t.title,i=t.closable,a=t.dismissAction,u=t.overflowHidden,c=t.className,s=t.closeBtnClassName,l=t.closeBtnColor,f=t.into,p=t.size,d=t.height,h=t.width,v=t.spacing,y=t.mobileFullscreen,g=t.overlayClassName,k=t.wrapperClassName,x=t.primaryText,_=t.primaryAction,S=t.primaryType,j=t.secondaryText,P=t.secondaryAction,C=t.secondaryType,T=t.containerClassName,A=E()(t,["children","description","title","closable","dismissAction","overflowHidden","className","closeBtnClassName","closeBtnColor","into","size","height","width","spacing","mobileFullscreen","overlayClassName","wrapperClassName","primaryText","primaryAction","primaryType","secondaryText","secondaryAction","secondaryType","containerClassName"]),R=this.titleID,I=Object.assign({},d&&{height:d},h&&{width:h}),N=Object(b.createRef)();return w.a.createElement(Cn.Provider,{value:N},w.a.createElement(pn,{into:f},w.a.createElement("div",{className:D()(yn.a["c-modal-container"],T)},w.a.createElement(un,{onEscape:i?a:void 0,className:g},w.a.createElement("div",{className:D()(yn.a["c-modal-wrapper"],m()({},yn.a["c-modal-wrapper--fullscreen"],y),k),onClick:i?this.handleOutsideClick:void 0},w.a.createElement("div",{ref:N}),w.a.createElement("div",O()({className:D()(yn.a["c-modal"],yn.a["c-modal--".concat(p)],(e={},m()(e,yn.a["c-modal--overflowHidden"],u),m()(e,yn.a["c-modal--".concat(v,"-spacing")],v),m()(e,yn.a["c-modal--fullscreen"],y),m()(e,yn.a["c-modal--closable"],i),e),c),style:I,role:"dialog","aria-modal":"true","aria-labelledby":o?R:null},A),i&&w.a.createElement(On,{className:D()(s,m()({},yn.a["c-modal-close--notitle"],!o)),onClick:a,color:l}),o&&w.a.createElement(xn,{title:o,id:R}),r&&w.a.createElement(An,null,r),n,x&&_||j&&P?w.a.createElement(Sn,null,w.a.createElement(jn,{primaryText:x,primaryAction:_,primaryType:S,secondaryText:j,secondaryAction:P,secondaryType:C})):null))))))}}]),n}(b.Component);Dn.propTypes={title:P.a.node,description:P.a.node,secondaryType:P.a.string,secondaryText:P.a.string,secondaryAction:P.a.func,primaryType:P.a.string,primaryText:P.a.string,primaryAction:P.a.func,closable:P.a.bool,overflowHidden:P.a.bool,className:P.a.string,closeBtnClassName:P.a.string,closeBtnColor:P.a.string,into:P.a.string,size:P.a.oneOf(["xsmall","small","medium","large","xlarge","xxlarge"]),height:P.a.string,width:P.a.string,spacing:P.a.oneOf(["small","large"]),mobileFullscreen:P.a.bool,overlayClassName:P.a.string,wrapperClassName:P.a.string,containerClassName:P.a.string,dismissAction:P.a.func},Dn.defaultProps={primaryType:"regular",secondaryType:"secondary",closable:!0,overflowHidden:!1,size:"small",into:"body",mobileFullscreen:!1},_n.propTypes={bg:P.a.string.isRequired,logo:P.a.string.isRequired},xn.propTypes={appIcon:P.a.string,appEditor:P.a.string,appName:P.a.string},wn.propTypes={iconSrc:P.a.node,iconDest:P.a.node,fixed:P.a.bool};var Rn,In=(Rn=[{src:"withCross",dest:"closable"},{src:"crossClassName",dest:"closeBtnClassName"},{src:"crossColor",dest:"closeBtnColor"},{fn:function(e){var t;return e.secondaryAction&&!e.dismissAction?((t=o()({},e)).dismissAction=e.secondaryAction,[t,"In the future, `secondaryAction` will not be bound to closing actions (clicking on cross, clicking outside), please use `dismissAction` for that"]):[e,null]}}],function(e){var t=function(t){var n=function(e,t){var n,r,i,a=cn(t);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(u.src&&u.dest){var c=u.src,s=u.dest;if(void 0===e[c])continue;(n=n||o()({},e))[s]=e[c],delete n[c],r="`".concat(c,"` is deprecated and has been migrated automatically, you should use `").concat(s,"` now")}else if(u.fn){var l=u.fn(n||e);if(2!==l.length)throw new Error("migrateOption `fn` should return [newProps, msg].");var f=Ie()(l,2);n=f[0],r=f[1]}else console.warn("migrateProps option is not valid, valid properties are `src`, `dest`, `fn`. You passed",u);window.SHOW_DEPRECATION_WARNINGS&&r&&(console.warn("Deprecation: ".concat(r)),r=null)}}catch(e){a.e(e)}finally{a.f()}return n||e}(t,Rn);return w.a.createElement(e,n)};return t.displayName=e.displayName||e.name,t})(Dn);In.propTypes=Dn.propTypes,In.defaultProps=Dn.defaultProps,Object.assign(In,{ModalContent:wn,ModalSection:kn,ModalFooter:Sn,ModalHeader:xn,AnimatedContentHeader:mn,ModalBrandedHeader:_n,ModalDescription:An,ModalBackButton:Pn});var Nn=In,zn=n(134),Mn=n.n(zn),Fn=function(e){var t,n=e.t,r=e.loadingType,o=e.middle,i=e.noMargin,a=e.color,u=e.size,c=e.className,s={tiny:8,small:12,medium:16,large:24,xlarge:36,xxlarge:80}[u];return w.a.createElement("div",{className:D()(Mn.a["c-spinner"],(t={},m()(t,Mn.a["c-spinner--middle"],o),m()(t,Mn.a["c-spinner--nomargin"],i),t),c)},w.a.createElement(N,{icon:"spinner",color:a,spin:!0,size:s}),r&&w.a.createElement("p",null,n("loading.".concat(r))))};Fn.propTypes={loadingType:P.a.string,middle:P.a.bool,noMargin:P.a.bool,color:P.a.string,size:P.a.oneOf(["tiny","small","medium","large","xlarge","xxlarge"]),className:P.a.string},Fn.defaultProps={loadingType:"",middle:!1,noMargin:!1,color:Y.a.primaryColor,size:"medium",className:""};var Ln=Object(x.translate)()(Fn);function Un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Bn=function(e){p()(n,e);var t=Un(n);function n(e,r){var o;return a()(this,n),o=t.call(this,e),m()(l()(o),"toggle",(function(){o.setState({isLoading:!0}),o.intents.create("SUPPORT","io.cozy.settings").start(o.intentWrapperRef,(function(){o.setState({isLoading:!1})}))})),o.store=r.barStore,o.state={isLoading:!1},o.intents=Object(ae.c)(),o}return c()(n,[{key:"componentDidMount",value:function(){this.toggle()}},{key:"render",value:function(){var e=this,t=this.state.isLoading;return w.a.createElement("div",null,w.a.createElement(Nn,{secondaryAction:this.props.onClose,className:"coz-support-modal",into:"#cozy-bar-modal-dom-place",closeBtnClassName:"coz-support-modal-close"},w.a.createElement(wn,{className:"coz-support-modal-wrapper u-mt-1"},w.a.createElement("div",{className:"coz-support-modal-content"},t&&w.a.createElement(Ln,{size:"xxlarge",middle:!0}),w.a.createElement("div",{className:"coz-support-intent-wrapper".concat(t?" coz-hidden":""),ref:function(t){e.intentWrapperRef=t}})))))}}]),n}(b.Component),qn=new ce.a({id:"icon-apps",use:"icon-apps-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="icon-apps"><path d="M0 0h4v4H0V0zm0 6h4v4H0V6zm0 6h4v4H0v-4zM6 0h4v4H6V0zm0 6h4v4H6V6zm0 6h4v4H6v-4zm6-12h4v4h-4V0zm0 6h4v4h-4V6zm0 6h4v4h-4v-4z" fill-rule="evenodd" /></symbol>'}),Hn=(le.a.add(qn),qn);function Wn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}n.d(t,"Bar",(function(){return Qn})),n.d(t,"mapStateToProps",(function(){return $n})),n.d(t,"mapDispatchToProps",(function(){return Gn}));var Qn=function(e){p()(n,e);var t=Wn(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"toggleDrawer",(function(){if(!r.state.claudyOpened&&!r.state.claudyFired){var e=!r.state.drawerVisible;e&&r.props.onDrawer(e),r.setState({drawerVisible:e})}})),m()(l()(r),"toggleClaudy",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(r.props.claudyEnabled){var t=r.state,n=t.usageTracker,o=t.claudyOpened;if(e&&!o)return r.setState({claudyFired:!0});r.state.claudyFired&&r.setState({claudyFired:!1}),n&&n.push(["trackEvent","Claudy",o?"close":"open","claudy"]),r.setState({claudyOpened:!o})}})),m()(l()(r),"toggleSupport",(function(){var e=r.state.supportDisplayed;r.setState({supportDisplayed:!e})})),m()(l()(r),"renderLeft",(function(){var e=r.props,t=e.t,n=e.isPublic,o=e.webviewContext;return o?w.a.createElement(ve,{webviewContext:o}):n?null:w.a.createElement("button",{type:"button",className:"coz-bar-btn coz-bar-burger",onClick:r.toggleDrawer,"data-tutorial":"apps-mobile"},w.a.createElement(N,{icon:Hn,width:16,height:16,color:"currentColor"}),w.a.createElement("span",{className:"coz-bar-hidden"},t("drawer")))})),m()(l()(r),"renderRight",(function(){return r.props.isPublic?null:w.a.createElement(Dt,{toggleSupport:r.toggleSupport,onLogOut:r.props.onLogOut})})),r.state={claudyFired:!1,claudyOpened:!1,drawerVisible:!1,usageTracker:null,supportDisplayed:!1,searchBarEnabled:e.isDrive&&!e.isPublic&&!Object(B.isMobileApp)()},r.fetchApps=r.fetchApps.bind(l()(r)),r.fetchInitialData=r.fetchInitialData.bind(l()(r)),r.handleTokenRefreshed=r.handleTokenRefreshed.bind(l()(r)),r}return c()(n,[{key:"componentDidMount",value:function(){F()&&this.initPiwikTracker(),this.fetchInitialData(),this.props.cozyClient.on("tokenRefreshed",this.handleTokenRefreshed)}},{key:"componentWillUnmount",value:function(){this.props.cozyClient.removeListener("tokenRefreshed",this.handleTokenRefreshed)}},{key:"componentDidUpdate",value:function(e,t){!this.props.hasFetchedApps&&this.state.drawerVisible&&t.drawerVisible!==this.state.drawerVisible&&this.fetchApps()}},{key:"handleTokenRefreshed",value:function(){this.fetchInitialData()}},{key:"initPiwikTracker",value:function(){var e=L("https://matomo.cozycloud.cc",8,!1,!1);U({appDimensionId:1,app:"Cozy Bar",heartbeat:0}),this.setState({usageTracker:e})}},{key:"fetchApps",value:function(){this.props.fetchApps()}},{key:"fetchInitialData",value:function(){this.props.isPublic||(this.props.fetchContext(),this.props.fetchSettingsData(!1),this.fetchApps())}},{key:"renderCenter",value:function(){var e=this.props,t=e.appName,n=e.appNamePrefix,r=e.appSlug,o=e.iconPath,i=e.replaceTitleOnMobile,a=e.isPublic;return w.a.createElement(Mt,{appName:t,appNamePrefix:n,appSlug:r,iconPath:o,replaceTitleOnMobile:i,isPublic:a})}},{key:"render",value:function(){var e=this,t=this.state,n=t.claudyFired,r=t.claudyOpened,i=t.drawerVisible,a=t.searchBarEnabled,u=t.supportDisplayed,c=t.usageTracker,s=this.props,l=s.theme,f=s.themeOverrides,p=s.barLeft,d=s.barRight,h=s.barCenter,v=s.barSearch,y=s.claudyEnabled,g=s.onDrawer,m=s.isPublic,b=s.onLogOut,k=s.userActionRequired,x=f.primaryColor,_=f.primaryContrastTextColor,O=x?{"--cozBarThemePrimaryColor":x}:{},S=_?{"--cozBarThemePrimaryContrastTextColor":_}:{},E=o()({},O,S);return w.a.createElement("div",{className:"coz-bar-wrapper coz-theme-".concat(l),style:E},w.a.createElement("div",{id:"cozy-bar-modal-dom-place"}),w.a.createElement("div",{className:"coz-bar-container"},p||this.renderLeft(),h||this.renderCenter(),w.a.createElement("div",{className:"u-flex-grow"},v||(a?w.a.createElement(Jt,null):null)),d||this.renderRight(),m?null:w.a.createElement(mt,{visible:i,onClose:this.toggleDrawer,onClaudy:y&&function(){return e.toggleClaudy(!0)}||!1,isClaudyLoading:n,drawerListener:function(){return g(i)},toggleSupport:this.toggleSupport,onLogOut:b}),y&&w.a.createElement(Kt,{usageTracker:c,claudyFired:n,onToggle:function(){return e.toggleClaudy(!1)},opened:r}),u&&w.a.createElement(Bn,{onClose:this.toggleSupport})),k&&w.a.createElement(Pe,k))}}]),n}(b.Component),$n=function(e){return{theme:Object(Be.j)(e).name,themeOverrides:Object(Be.j)(e).overrides,barLeft:Object(Be.e)(e,"left"),barRight:Object(Be.e)(e,"right"),barCenter:Object(Be.e)(e,"center"),barSearch:Object(Be.e)(e,"search"),isDrive:Object(Be.m)(e,{slug:"drive"}),claudyEnabled:Object(Be.z)(e),hasFetchedApps:Object(Be.l)(e),webviewContext:Object(Be.k)(e)}},Gn=function(e){return{fetchApps:function(){return e(Object(Be.a)())},fetchContext:function(){return e(Object(Be.b)())},fetchSettingsData:function(t){return e(Object(Be.c)(t))}}};t.default=Object(x.translate)()(Object(k.connect)($n,Gn)(Qn))},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=(n(1),o.a.createContext(null));var a=function(e){e()},u={notify:function(){}};function c(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var s=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=u,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=c())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=u)},e}();var l=function(e){var t=e.store,n=e.context,a=e.children,u=Object(r.useMemo)((function(){var e=new s(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),c=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=u.subscription;return e.trySubscribe(),c!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[u,c]);var l=n||i;return o.a.createElement(l.Provider,{value:u},a)},f=n(28),p=n(36),d=n(98),h=n.n(d),v=n(97),y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,g=[],m=[null,null];function b(e,t){var n=e[1];return[t.payload,n+1]}function w(e,t,n){y((function(){return e.apply(void 0,t)}),n)}function k(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function x(e,t,n,r,o,i,a,u,c,s){if(e){var l=!1,f=null,p=function(){if(!l){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,f=e}n||(f=null),e===i.current?a.current||c():(i.current=e,u.current=e,a.current=!0,s({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var _=function(){return[null,0]};function O(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,u=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,c=n.methodName,l=void 0===c?"connectAdvanced":c,d=n.renderCountProp,y=void 0===d?void 0:d,O=n.shouldHandleStateChanges,S=void 0===O||O,E=n.storeKey,j=void 0===E?"store":E,P=(n.withRef,n.forwardRef),C=void 0!==P&&P,T=n.context,A=void 0===T?i:T,D=Object(p.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),R=A;return function(t){var n=t.displayName||t.name||"Component",i=u(n),a=Object(f.a)({},D,{getDisplayName:u,methodName:l,renderCountProp:y,shouldHandleStateChanges:S,storeKey:j,displayName:i,wrappedComponentName:n,WrappedComponent:t}),c=D.pure;var d=c?r.useMemo:function(e){return e()};function O(n){var i=Object(r.useMemo)((function(){var e=n.forwardedRef,t=Object(p.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),u=i[0],c=i[1],l=i[2],h=Object(r.useMemo)((function(){return u&&u.Consumer&&Object(v.isContextConsumer)(o.a.createElement(u.Consumer,null))?u:R}),[u,R]),y=Object(r.useContext)(h),O=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(y)&&Boolean(y.store);var E=O?n.store:y.store,j=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,a)}(E)}),[E]),P=Object(r.useMemo)((function(){if(!S)return m;var e=new s(E,O?null:y.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[E,O,y]),C=P[0],T=P[1],A=Object(r.useMemo)((function(){return O?y:Object(f.a)({},y,{subscription:C})}),[O,y,C]),D=Object(r.useReducer)(b,g,_),I=D[0][0],N=D[1];if(I&&I.error)throw I.error;var z=Object(r.useRef)(),M=Object(r.useRef)(l),F=Object(r.useRef)(),L=Object(r.useRef)(!1),U=d((function(){return F.current&&l===M.current?F.current:j(E.getState(),l)}),[E,I,l]);w(k,[M,z,L,l,U,F,T]),w(x,[S,E,C,j,M,z,L,F,T,N],[E,C,j]);var B=Object(r.useMemo)((function(){return o.a.createElement(t,Object(f.a)({},U,{ref:c}))}),[c,t,U]);return Object(r.useMemo)((function(){return S?o.a.createElement(h.Provider,{value:A},B):B}),[h,B,A])}var E=c?o.a.memo(O):O;if(E.WrappedComponent=t,E.displayName=i,C){var P=o.a.forwardRef((function(e,t){return o.a.createElement(E,Object(f.a)({},e,{forwardedRef:t}))}));return P.displayName=i,P.WrappedComponent=t,h()(P,t)}return h()(E,t)}}function S(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function E(e,t){if(S(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!S(e[n[o]],t[n[o]]))return!1;return!0}var j=n(192);function P(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function C(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function T(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=C(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=C(o),o=r(t,n)),o},r}}var A=[function(e){return"function"==typeof e?T(e):void 0},function(e){return e?void 0:P((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?P((function(t){return Object(j.bindActionCreators)(e,t)})):void 0}];var D=[function(e){return"function"==typeof e?T(e):void 0},function(e){return e?void 0:P((function(){return{}}))}];function R(e,t,n){return Object(f.a)({},n,{},e,{},t)}var I=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,u){var c=e(t,n,u);return a?o&&i(c,r)||(r=c):(a=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return R}}];function N(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function z(e,t,n,r,o){var i,a,u,c,s,l=o.areStatesEqual,f=o.areOwnPropsEqual,p=o.areStatePropsEqual,d=!1;function h(o,d){var h,v,y=!f(d,a),g=!l(o,i);return i=o,a=d,y&&g?(u=e(i,a),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):y?(e.dependsOnOwnProps&&(u=e(i,a)),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):g?(h=e(i,a),v=!p(h,u),u=h,v&&(s=n(u,c,a)),s):s}return function(o,l){return d?h(o,l):(u=e(i=o,a=l),c=t(r,a),s=n(u,c,a),d=!0,s)}}function M(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=Object(p.a)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),a=n(e,i),u=r(e,i),c=o(e,i);return(i.pure?z:N)(a,u,c,e,i)}function F(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function L(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?O:n,o=t.mapStateToPropsFactories,i=void 0===o?D:o,a=t.mapDispatchToPropsFactories,u=void 0===a?A:a,c=t.mergePropsFactories,s=void 0===c?I:c,l=t.selectorFactory,d=void 0===l?M:l;return function(e,t,n,o){void 0===o&&(o={});var a=o,c=a.pure,l=void 0===c||c,h=a.areStatesEqual,v=void 0===h?L:h,y=a.areOwnPropsEqual,g=void 0===y?E:y,m=a.areStatePropsEqual,b=void 0===m?E:m,w=a.areMergedPropsEqual,k=void 0===w?E:w,x=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),_=F(e,i,"mapStateToProps"),O=F(t,u,"mapDispatchToProps"),S=F(n,s,"mergeProps");return r(d,Object(f.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:_,initMapDispatchToProps:O,initMergeProps:S,pure:l,areStatesEqual:v,areOwnPropsEqual:g,areStatePropsEqual:b,areMergedPropsEqual:k},x))}}var B=U();function q(){return Object(r.useContext)(i)}function H(e){void 0===e&&(e=i);var t=e===i?q:function(){return Object(r.useContext)(e)};return function(){return t().store}}var W=H();function Q(e){void 0===e&&(e=i);var t=e===i?W:H(e);return function(){return t().dispatch}}var $=Q(),G=function(e,t){return e===t};function V(e){void 0===e&&(e=i);var t=e===i?q:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=G);var o=t();return function(e,t,n,o){var i,a=Object(r.useReducer)((function(e){return e+1}),0)[1],u=Object(r.useMemo)((function(){return new s(n,o)}),[n,o]),c=Object(r.useRef)(),l=Object(r.useRef)(),f=Object(r.useRef)();try{i=e!==l.current||c.current?e(n.getState()):f.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return y((function(){l.current=e,f.current=i,c.current=void 0})),y((function(){function e(){try{var e=l.current(n.getState());if(t(e,f.current))return;f.current=e}catch(e){c.current=e}a({})}return u.onStateChange=e,u.trySubscribe(),e(),function(){return u.tryUnsubscribe()}}),[n,u]),i}(e,n,o.store,o.subscription)}}var J,Y=V(),K=n(117);n.d(t,"Provider",(function(){return l})),n.d(t,"connectAdvanced",(function(){return O})),n.d(t,"ReactReduxContext",(function(){return i})),n.d(t,"connect",(function(){return B})),n.d(t,"batch",(function(){return K.unstable_batchedUpdates})),n.d(t,"useDispatch",(function(){return $})),n.d(t,"createDispatchHook",(function(){return Q})),n.d(t,"useSelector",(function(){return Y})),n.d(t,"createSelectorHook",(function(){return V})),n.d(t,"useStore",(function(){return W})),n.d(t,"createStoreHook",(function(){return H})),n.d(t,"shallowEqual",(function(){return E})),J=K.unstable_batchedUpdates,a=J},function(e,t,n){"use strict";n.r(t);var r=n(13),o=n.n(r),i=n(33),a=n(2),u=n.n(a),c=n(95),s=n(75),l=function(e){return function(t){var n=t.langs,r=t.locales,o=n&&n.length;if(!o)return t;var i=o&&n.includes(e)?e:n[0],a=r&&Object.keys(r);return a&&a.length&&a.includes(i)?(Object(c.a)(u()({},t.slug,r[i])),t):t}},f=function(e){var t=e.getState;return function(e){return function(n){var r=t();switch(n.type){case s.a:!function(e,t){e&&e.forEach(l(t))}(r.apps&&r.apps.apps,n.lang);break;case"RECEIVE_APP_LIST":n.apps&&n.apps.length&&n.apps.forEach(l(r.locale));break;case"RECEIVE_APP":n.app&&l(r.locale&&r.locale.lang)(n.app)}return e(n)}}},p=n(191),d="persist/REHYDRATE",h="persist/REGISTER",v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function g(e,t,n,r){r.debug;var o=y({},n);return e&&"object"===(void 0===e?"undefined":v(e))&&Object.keys(e).forEach((function(r){"_persist"!==r&&t[r]===n[r]&&(o[r]=e[r])})),o}function m(e){var t=e.blacklist||null,n=e.whitelist||null,r=e.transforms||[],o=e.throttle||0,i=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key,a=e.storage,u=!1===e.serialize?function(e){return e}:b,c={},s={},l=[],f=null,p=null;function d(){if(0===l.length)return f&&clearInterval(f),void(f=null);var e=l.shift(),t=r.reduce((function(t,n){return n.in(t,e,c)}),c[e]);if(void 0!==t)try{s[e]=u(t)}catch(e){console.error("redux-persist/createPersistoid: error serializing state",e)}else delete s[e];0===l.length&&(Object.keys(s).forEach((function(e){void 0===c[e]&&delete s[e]})),p=a.setItem(i,u(s)).catch(h))}function h(e){0}return{update:function(e){Object.keys(e).forEach((function(r){(function(e){return(!n||-1!==n.indexOf(e)||"_persist"===e)&&(!t||-1===t.indexOf(e))})(r)&&c[r]!==e[r]&&-1===l.indexOf(r)&&l.push(r)})),Object.keys(c).forEach((function(t){void 0===e[t]&&l.push(t)})),null===f&&(f=setInterval(d,o)),c=e},flush:function(){for(;0!==l.length;)d();return p||Promise.resolve()}}}function b(e){return JSON.stringify(e)}function w(e){var t=e.transforms||[],n=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key,r=e.storage,o=(e.debug,!1===e.serialize?function(e){return e}:k);return r.getItem(n).then((function(e){if(e)try{var n={},r=o(e);return Object.keys(r).forEach((function(e){n[e]=t.reduceRight((function(t,n){return n.out(t,e,r)}),o(r[e]))})),n}catch(e){throw e}}))}function k(e){return JSON.parse(e)}function x(e){0}var _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function O(e,t){var n=void 0!==e.version?e.version:-1,r=(e.debug,void 0===e.stateReconciler?g:e.stateReconciler),o=e.getStoredState||w,i=void 0!==e.timeout?e.timeout:5e3,a=null,u=!1,c=!0,s=function(e){return e._persist.rehydrated&&a&&!c&&a.update(e),e};return function(l,f){var p=l||{},h=p._persist,v=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(p,["_persist"]);if("persist/PERSIST"===f.type){var y=!1,g=function(t,n){y||(f.rehydrate(e.key,t,n),y=!0)};if(i&&setTimeout((function(){!y&&g(void 0,new Error('redux-persist: persist timed out for persist key "'+e.key+'"'))}),i),c=!1,a||(a=m(e)),h)return l;if("function"!=typeof f.rehydrate||"function"!=typeof f.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(e.key),o(e).then((function(t){(e.migrate||function(e,t){return Promise.resolve(e)})(t,n).then((function(e){g(e)}),(function(e){g(void 0,e)}))}),(function(e){g(void 0,e)})),_({},t(v,f),{_persist:{version:n,rehydrated:!1}})}if("persist/PURGE"===f.type)return u=!0,f.result(function(e){var t=e.storage,n=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key;return t.removeItem(n,x)}(e)),_({},t(v,f),{_persist:h});if("persist/FLUSH"===f.type)return f.result(a&&a.flush()),_({},t(v,f),{_persist:h});if("persist/PAUSE"===f.type)c=!0;else if(f.type===d){if(u)return _({},v,{_persist:_({},h,{rehydrated:!0})});if(f.key===e.key){var b=t(v,f),w=f.payload,k=!1!==r&&void 0!==w?r(w,l,b,e):b,O=_({},k,{_persist:_({},h,{rehydrated:!0})});return s(O)}}if(!h)return t(l,f);var S=t(v,f);return S===v?l:(S._persist=h,s(S))}}var S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function j(e,t,n,r){r.debug;var o=E({},n);return e&&"object"===(void 0===e?"undefined":S(e))&&Object.keys(e).forEach((function(r){var i;"_persist"!==r&&(t[r]===n[r]&&(null===(i=n[r])||Array.isArray(i)||"object"!==(void 0===i?"undefined":S(i))?o[r]=e[r]:o[r]=E({},o[r],e[r])))})),o}var P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function C(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var T={registry:[],bootstrapped:!1},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T,t=arguments[1];switch(t.type){case h:return P({},e,{registry:[].concat(C(e.registry),[t.key])});case d:var n=e.registry.indexOf(t.key),r=[].concat(C(e.registry));return r.splice(n,1),P({},e,{registry:r,bootstrapped:0===r.length});default:return e}};var D=n(12),R=n(339),I=n(340),N=n.n(I),z=n(341),M=n.n(z),F=n(129);n.d(t,"createStore",(function(){return Q}));var L={storage:N.a,key:"cozy-bar",whitelist:M.a};Object(R.createLogger)({titleFormatter:function(e,t){var n=["[COZY-BAR]"];return n.push("".concat(String(e.type))),t&&n.push("@ ".concat(t)),n.join(" ")},logger:F.a});var U,B,q=(U=L,B=o()({},D.t),U.stateReconciler=void 0===U.stateReconciler?j:U.stateReconciler,O(U,Object(i.c)(B))),H=[f,p.default];var W,Q=function(){var e,t,n,r,o,a,u,c;return W=Object(i.e)(q,i.a.apply(null,H)),e=W,r=n||!1,o=Object(i.e)(A,T,t?t.enhancer:void 0),a=function(e){o.dispatch({type:h,key:e})},u=function(t,n,i){var a={type:d,payload:n,err:i,key:t};e.dispatch(a),o.dispatch(a),r&&c.getState().bootstrapped&&(r(),r=!1)},(c=P({},o,{purge:function(){var t=[];return e.dispatch({type:"persist/PURGE",result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:"persist/FLUSH",result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:"persist/PAUSE"})},persist:function(){e.dispatch({type:"persist/PERSIST",register:a,rehydrate:u})}})).persist(),W};t.default=function(){return W||(W=Q()),W}},function(e,t,n){"use strict";n.r(t);var r=n(5),o=n.n(r),i=n(8),a=n.n(i),u=n(23),c=n(21),s=n(12),l=n(4),f=n.n(l),p=n(7),d=n.n(p),h=n(9),v=n.n(h),y=n(10),g=n.n(y),m=n(6),b=n.n(m),w=n(0),k=n.n(w),x=["left","center","right","search"],_=function(e){return e[0].toUpperCase()+e.slice(1)},O=function(e){return"setBar".concat(_(e))},S=function(e){return"Bar".concat(_(e))};function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g()(this,n)}}var j=0,P=function(e){var t={};return x.forEach((function(n){t[O(n)]=function(t){return e.dispatch(Object(s.u)(n,"string"==typeof(r=t)?k.a.createElement("span",{dangerouslySetInnerHTML:{__html:r}}):r,"js"));var r},t[S(n)]=function(e,t){return function(n){v()(o,n);var r=E(o);function o(){return f()(this,o),r.apply(this,arguments)}return d()(o,[{key:"componentDidMount",value:function(){this.componentId=j++,this.setContent(this.props.children)}},{key:"setContent",value:function(n){try{n=k.a.Children.only(n)}catch(e){}e.dispatch(Object(s.u)(t,n,this.componentId))}},{key:"unsetContent",value:function(){e.dispatch(Object(s.A)(t,this.componentId))}},{key:"componentWillUnmount",value:function(){this.unsetContent()}},{key:"componentDidUpdate",value:function(e){this.props.children!==e.children&&this.setContent(this.props.children)}},{key:"render",value:function(){return null}}]),o}(w.Component)}(e,n)})),t.setLocale=function(){e.dispatch(s.w.apply(void 0,arguments))},t.setTheme=function(){e.dispatch(s.x.apply(void 0,arguments))},t.setWebviewContext=function(){e.dispatch(s.y.apply(void 0,arguments))},t},C=function(e){console.error("You tried to use the CozyBar API (".concat(e,") but the CozyBar is not initialised yet via cozy.bar.init(...)."))},T=function(e,t){return function(){if(e[t])return e[t].apply(e,arguments);C(t)}},A=function(){var e=document.querySelector("[role=application]");return e&&e.dataset?e.dataset:{}},D=function(){var e=document.querySelector('link[rel="icon"][sizes^="32"]');return null!==e?e.getAttribute("href"):"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},R=function(){return A().cozyAppNamePrefix||null},I=function(){return A().cozyAppSlug||null},N=function(){var e=document.querySelector("meta[name=user-action-required]"),t=e&&e.dataset;if(t){var n=t.title,r=t.code,o=t.detail,i=t.links;if(r)return{title:n,code:r,detail:o,links:i}}};n(447),n(448);n.d(t,"init",(function(){return U})),n.d(t,"version",(function(){return Z})),n.d(t,"setBarCenter",(function(){return H})),n.d(t,"setBarLeft",(function(){return W})),n.d(t,"setBarRight",(function(){return Q})),n.d(t,"setBarSearch",(function(){return $})),n.d(t,"BarLeft",(function(){return J})),n.d(t,"BarRight",(function(){return V})),n.d(t,"BarCenter",(function(){return G})),n.d(t,"BarSearch",(function(){return Y})),n.d(t,"setTheme",(function(){return K})),n.d(t,"setWebviewContext",(function(){return X})),n.d(t,"updateAccessToken",(function(){return B})),n.d(t,"setLocale",(function(){return s.w}));var z=function(e){if(null===document.getElementById("coz-bar")){var t=function(){var e=Object(u.isMobileApp)()?"mobile":"browser",t=document.createElement("div");return t.setAttribute("id","coz-bar"),t.setAttribute("role","banner"),t.classList.add("coz-target--".concat(e)),t}(),n=document.querySelector("[role=application]");return n?(document.body.insertBefore(t,n),e.onDrawer=function(e){t.dataset.drawerVisible=e},e.userActionRequired&&document.body.classList.add("has-banner"),t):(console.warn('Cozy-bar is looking for a "'.concat("[role=application]","\" tag that contains your application and can't find it :'(… The BAR is now disabled")),null)}},M=function(e,t){var r=n(0),o=n(117).render,i=n(37),a=i.connect,u=i.Provider,c=n(20).default,l=n(678).default,f=n(29).CozyProvider,p=t.cozyClient,d=a((function(e){return{lang:Object(s.g)(e)}}))(c),h=r.createElement(u,{store:t.reduxStore},r.createElement(d,{dictRequire:function(e){return n(675)("./".concat(e))}},p?r.createElement(f,{client:p},r.createElement(l,t)):r.createElement(l,t)));return o(h,e),h},F=function(e){var t=e.cozyURL,r=e.token,o=e.isPublic,i={uri:t||function(e){var t=A();if(!t.cozyDomain)return e||console.warn("Cozy-bar can't discover the cozy's URL, and will probably fail to initialize the connection with the stack."),"";var n=window.location.protocol;return"".concat(n,"//").concat(t.cozyDomain)}(o),token:r||function(e){var t=A();return t.cozyToken?t.cozyToken:(e||console.warn("Cozy-bar can't discover the app's token, and will probably fail to initialize the connection with the stack."),"")}(o)},a=n(29).default;return console.warn("Automatically made cozyClient. Options: ",i),new a(i)},L={},U=function(){var e=a()(o.a.mark((function e(){var t,r,i,a,u,l,f,p,d,h,v,y,g,m,b,w,k,x,_,O,S,E,j=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=j.length>0&&void 0!==j[0]?j[0]:{},r=t.appName,i=t.appNamePrefix,a=void 0===i?R():i,u=t.appSlug,l=void 0===u?I():u,f=t.lang,p=t.iconPath,d=void 0===p?D():p,h=t.cozyClient,v=t.cozyURL,y=t.token,g=t.replaceTitleOnMobile,m=void 0!==g&&g,b=t.isPublic,w=void 0!==b&&b,k=t.onLogOut,!w&&/^\/public/.test(window.location.pathname)&&(w=!0),h||(h=F({cozyURL:v,token:y,isPublic:w})),x=n(680).default,(_=x()).dispatch(Object(s.v)(r,a,l)),c.b.init({cozyClient:h,onCreate:function(e){return _.dispatch(Object(s.r)(e))},onDelete:function(e){return _.dispatch(Object(s.s)(e))}}),f&&_.dispatch(Object(s.w)(f)),O=P(_),Object.assign(L,O),S={appName:r,appNamePrefix:a,appSlug:l,cozyClient:h,iconPath:d,replaceTitleOnMobile:m,isPublic:w,onLogOut:k,userActionRequired:N(),reduxStore:_},E=z(S),M(E,S);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(e){c.b.updateAccessToken(e)},q=function(e){var t={};x.forEach((function(n){var r=O(n),o=S(n);t[r]=T(e,r),t[o]=function(t){if(e[o])return k.a.createElement(e[o],t);C(o)}}));for(var n=0,r=["setLocale","setTheme","setWebviewContext"];n<r.length;n++){var o=r[n];t[o]=T(e,o)}return t}(L),H=q.setBarCenter,W=q.setBarLeft,Q=q.setBarRight,$=q.setBarSearch,G=q.BarCenter,V=q.BarRight,J=q.BarLeft,Y=q.BarSearch,K=q.setTheme,X=q.setWebviewContext,Z="7.17.2"}])}));
|
|
56
|
+
*/(function(){var i="Expected a function",a="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",s="[object Array]",l="[object Boolean]",f="[object Date]",p="[object Error]",d="[object Function]",h="[object GeneratorFunction]",v="[object Map]",y="[object Number]",g="[object Object]",m="[object RegExp]",b="[object Set]",w="[object String]",k="[object Symbol]",x="[object WeakMap]",_="[object ArrayBuffer]",O="[object DataView]",S="[object Float32Array]",E="[object Float64Array]",j="[object Int8Array]",P="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",A="[object Uint16Array]",D="[object Uint32Array]",R=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(z.source),L=RegExp(M.source),U=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,G=RegExp($.source),V=/^\s+|\s+$/g,J=/^\s+/,Y=/\s+$/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,oe=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,ue=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,se=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,fe=/['\n\r\u2028\u2029\\]/g,pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",he="[\\ud800-\\udfff]",ve="["+de+"]",ye="["+pe+"]",ge="\\d+",me="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",we="[^\\ud800-\\udfff"+de+ge+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ke="\\ud83c[\\udffb-\\udfff]",xe="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",Oe="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="(?:"+be+"|"+we+")",je="(?:"+Se+"|"+we+")",Pe="(?:"+ye+"|"+ke+")"+"?",Ce="[\\ufe0e\\ufe0f]?"+Pe+("(?:\\u200d(?:"+[xe,_e,Oe].join("|")+")[\\ufe0e\\ufe0f]?"+Pe+")*"),Te="(?:"+[me,_e,Oe].join("|")+")"+Ce,Ae="(?:"+[xe+ye+"?",ye,_e,Oe,he].join("|")+")",De=RegExp("['’]","g"),Re=RegExp(ye,"g"),Ie=RegExp(ke+"(?="+ke+")|"+Ae+Ce,"g"),Ne=RegExp([Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",je+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Se+Ee,"$"].join("|")+")",Se+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ge,Te].join("|"),"g"),ze=RegExp("[\\u200d\\ud800-\\udfff"+pe+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Le=-1,Ue={};Ue[S]=Ue[E]=Ue[j]=Ue[P]=Ue[C]=Ue[T]=Ue["[object Uint8ClampedArray]"]=Ue[A]=Ue[D]=!0,Ue[c]=Ue[s]=Ue[_]=Ue[l]=Ue[O]=Ue[f]=Ue[p]=Ue[d]=Ue[v]=Ue[y]=Ue[g]=Ue[m]=Ue[b]=Ue[w]=Ue[x]=!1;var Be={};Be[c]=Be[s]=Be[_]=Be[O]=Be[l]=Be[f]=Be[S]=Be[E]=Be[j]=Be[P]=Be[C]=Be[v]=Be[y]=Be[g]=Be[m]=Be[b]=Be[w]=Be[k]=Be[T]=Be["[object Uint8ClampedArray]"]=Be[A]=Be[D]=!0,Be[p]=Be[d]=Be[x]=!1;var qe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},He=parseFloat,We=parseInt,Qe="object"==typeof e&&e&&e.Object===Object&&e,$e="object"==typeof self&&self&&self.Object===Object&&self,Ge=Qe||$e||Function("return this")(),Ve=t&&!t.nodeType&&t,Je=Ve&&"object"==typeof r&&r&&!r.nodeType&&r,Ye=Je&&Je.exports===Ve,Ke=Ye&&Qe.process,Xe=function(){try{var e=Je&&Je.require&&Je.require("util").types;return e||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ze=Xe&&Xe.isArrayBuffer,et=Xe&&Xe.isDate,tt=Xe&&Xe.isMap,nt=Xe&&Xe.isRegExp,rt=Xe&&Xe.isSet,ot=Xe&&Xe.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function ut(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ct(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function st(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function lt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function ft(e,t){return!!(null==e?0:e.length)&&kt(e,t,0)>-1}function pt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function dt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ht(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function vt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function yt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function gt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=St("length");function bt(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}function wt(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function kt(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):wt(e,_t,n)}function xt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function _t(e){return e!=e}function Ot(e,t){var n=null==e?0:e.length;return n?Pt(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Et(e){return function(t){return null==e?void 0:e[t]}}function jt(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}function Pt(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Ct(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Tt(e){return function(t){return e(t)}}function At(e,t){return dt(t,(function(t){return e[t]}))}function Dt(e,t){return e.has(t)}function Rt(e,t){for(var n=-1,r=e.length;++n<r&&kt(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&&kt(t,e[n],0)>-1;);return n}function Nt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var zt=Et({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mt=Et({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ft(e){return"\\"+qe[e]}function Lt(e){return ze.test(e)}function Ut(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Bt(e,t){return function(n){return e(t(n))}}function qt(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var u=e[n];u!==t&&u!==a||(e[n]=a,i[o++]=n)}return i}function Ht(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function Wt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function Qt(e){return Lt(e)?function(e){var t=Ie.lastIndex=0;for(;Ie.test(e);)++t;return t}(e):mt(e)}function $t(e){return Lt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}var Gt=Et({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Vt=function e(t){var n,r=(t=null==t?Ge:Vt.defaults(Ge.Object(),t,Vt.pick(Ge,Fe))).Array,o=t.Date,pe=t.Error,de=t.Function,he=t.Math,ve=t.Object,ye=t.RegExp,ge=t.String,me=t.TypeError,be=r.prototype,we=de.prototype,ke=ve.prototype,xe=t["__core-js_shared__"],_e=we.toString,Oe=ke.hasOwnProperty,Se=0,Ee=(n=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",je=ke.toString,Pe=_e.call(ve),Ce=Ge._,Te=ye("^"+_e.call(Oe).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=Ye?t.Buffer:void 0,Ie=t.Symbol,ze=t.Uint8Array,qe=Ae?Ae.allocUnsafe:void 0,Qe=Bt(ve.getPrototypeOf,ve),$e=ve.create,Ve=ke.propertyIsEnumerable,Je=be.splice,Ke=Ie?Ie.isConcatSpreadable:void 0,Xe=Ie?Ie.iterator:void 0,mt=Ie?Ie.toStringTag:void 0,Et=function(){try{var e=ei(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Jt=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Yt=o&&o.now!==Ge.Date.now&&o.now,Kt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Xt=he.ceil,Zt=he.floor,en=ve.getOwnPropertySymbols,tn=Ae?Ae.isBuffer:void 0,nn=t.isFinite,rn=be.join,on=Bt(ve.keys,ve),an=he.max,un=he.min,cn=o.now,sn=t.parseInt,ln=he.random,fn=be.reverse,pn=ei(t,"DataView"),dn=ei(t,"Map"),hn=ei(t,"Promise"),vn=ei(t,"Set"),yn=ei(t,"WeakMap"),gn=ei(ve,"create"),mn=yn&&new yn,bn={},wn=ji(pn),kn=ji(dn),xn=ji(hn),_n=ji(vn),On=ji(yn),Sn=Ie?Ie.prototype:void 0,En=Sn?Sn.valueOf:void 0,jn=Sn?Sn.toString:void 0;function Pn(e){if(Wa(e)&&!Ra(e)&&!(e instanceof Dn)){if(e instanceof An)return e;if(Oe.call(e,"__wrapped__"))return Pi(e)}return new An(e)}var Cn=function(){function e(){}return function(t){if(!Ha(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function An(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Dn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function In(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Nn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new In(e);this.size=t.size}function Fn(e,t){var n=Ra(e),r=!n&&Da(e),o=!n&&!r&&Ma(e),i=!n&&!r&&!o&&Xa(e),a=n||r||o||i,u=a?Ct(e.length,ge):[],c=u.length;for(var s in e)!t&&!Oe.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ui(s,c))||u.push(s);return u}function Ln(e){var t=e.length;return t?e[zr(0,t-1)]:void 0}function Un(e,t){return Oi(mo(e),Jn(t,0,e.length))}function Bn(e){return Oi(mo(e))}function qn(e,t,n){(void 0!==n&&!Ca(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function Hn(e,t,n){var r=e[t];Oe.call(e,t)&&Ca(r,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function Wn(e,t){for(var n=e.length;n--;)if(Ca(e[n][0],t))return n;return-1}function Qn(e,t,n,r){return er(e,(function(e,o,i){t(r,e,n(e),i)})),r}function $n(e,t){return e&&bo(t,wu(t),e)}function Gn(e,t,n){"__proto__"==t&&Et?Et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Vn(e,t){for(var n=-1,o=t.length,i=r(o),a=null==e;++n<o;)i[n]=a?void 0:vu(e,t[n]);return i}function Jn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Yn(e,t,n,r,o,i){var a,u=1&t,s=2&t,p=4&t;if(n&&(a=o?n(e,r,o,i):n(e)),void 0!==a)return a;if(!Ha(e))return e;var x=Ra(e);if(x){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Oe.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return mo(e,a)}else{var R=ri(e),I=R==d||R==h;if(Ma(e))return fo(e,u);if(R==g||R==c||I&&!o){if(a=s||I?{}:ii(e),!u)return s?function(e,t){return bo(e,ni(e),t)}(e,function(e,t){return e&&bo(t,ku(t),e)}(a,e)):function(e,t){return bo(e,ti(e),t)}(e,$n(a,e))}else{if(!Be[R])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case _:return po(e);case l:case f:return new r(+e);case O:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case S:case E:case j:case P:case C:case T:case"[object Uint8ClampedArray]":case A:case D:return ho(e,n);case v:return new r;case y:case w:return new r(e);case m:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case k:return o=e,En?ve(En.call(o)):{}}var o}(e,R,u)}}i||(i=new Mn);var N=i.get(e);if(N)return N;i.set(e,a),Ja(e)?e.forEach((function(r){a.add(Yn(r,t,n,r,e,i))})):Qa(e)&&e.forEach((function(r,o){a.set(o,Yn(r,t,n,o,e,i))}));var z=x?void 0:(p?s?Go:$o:s?ku:wu)(e);return ut(z||e,(function(r,o){z&&(r=e[o=r]),Hn(a,o,Yn(r,t,n,o,e,i))})),a}function Kn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ve(e);r--;){var o=n[r],i=t[o],a=e[o];if(void 0===a&&!(o in e)||!i(a))return!1}return!0}function Xn(e,t,n){if("function"!=typeof e)throw new me(i);return wi((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,r){var o=-1,i=ft,a=!0,u=e.length,c=[],s=t.length;if(!u)return c;n&&(t=dt(t,Tt(n))),r?(i=pt,a=!1):t.length>=200&&(i=Dt,a=!1,t=new zn(t));e:for(;++o<u;){var l=e[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,a&&f==f){for(var p=s;p--;)if(t[p]===f)continue e;c.push(l)}else i(t,f,r)||c.push(l)}return c}Pn.templateSettings={escape:U,evaluate:B,interpolate:q,variable:"",imports:{_:Pn}},Pn.prototype=Tn.prototype,Pn.prototype.constructor=Pn,An.prototype=Cn(Tn.prototype),An.prototype.constructor=An,Dn.prototype=Cn(Tn.prototype),Dn.prototype.constructor=Dn,Rn.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Oe.call(t,e)?t[e]:void 0},Rn.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:Oe.call(t,e)},Rn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gn&&void 0===t?"__lodash_hash_undefined__":t,this},In.prototype.clear=function(){this.__data__=[],this.size=0},In.prototype.delete=function(e){var t=this.__data__,n=Wn(t,e);return!(n<0)&&(n==t.length-1?t.pop():Je.call(t,n,1),--this.size,!0)},In.prototype.get=function(e){var t=this.__data__,n=Wn(t,e);return n<0?void 0:t[n][1]},In.prototype.has=function(e){return Wn(this.__data__,e)>-1},In.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Nn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(dn||In),string:new Rn}},Nn.prototype.delete=function(e){var t=Xo(this,e).delete(e);return this.size-=t?1:0,t},Nn.prototype.get=function(e){return Xo(this,e).get(e)},Nn.prototype.has=function(e){return Xo(this,e).has(e)},Nn.prototype.set=function(e,t){var n=Xo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},zn.prototype.add=zn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},zn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new In,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof In){var r=n.__data__;if(!dn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(e,t),this.size=n.size,this};var er=xo(cr),tr=xo(sr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],a=t(i);if(null!=a&&(void 0===u?a==a&&!Ka(a):n(a,u)))var u=a,c=i}return c}function or(e,t){var n=[];return er(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function ir(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ai),o||(o=[]);++i<a;){var u=e[i];t>0&&n(u)?t>1?ir(u,t-1,n,r,o):ht(o,u):r||(o[o.length]=u)}return o}var ar=_o(),ur=_o(!0);function cr(e,t){return e&&ar(e,t,wu)}function sr(e,t){return e&&ur(e,t,wu)}function lr(e,t){return lt(t,(function(t){return Ua(e[t])}))}function fr(e,t){for(var n=0,r=(t=uo(t,e)).length;null!=e&&n<r;)e=e[Ei(t[n++])];return n&&n==r?e:void 0}function pr(e,t,n){var r=t(e);return Ra(e)?r:ht(r,n(e))}function dr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":mt&&mt in ve(e)?function(e){var t=Oe.call(e,mt),n=e[mt];try{e[mt]=void 0;var r=!0}catch(e){}var o=je.call(e);r&&(t?e[mt]=n:delete e[mt]);return o}(e):function(e){return je.call(e)}(e)}function hr(e,t){return e>t}function vr(e,t){return null!=e&&Oe.call(e,t)}function yr(e,t){return null!=e&&t in ve(e)}function gr(e,t,n){for(var o=n?pt:ft,i=e[0].length,a=e.length,u=a,c=r(a),s=1/0,l=[];u--;){var f=e[u];u&&t&&(f=dt(f,Tt(t))),s=un(f.length,s),c[u]=!n&&(t||i>=120&&f.length>=120)?new zn(u&&f):void 0}f=e[0];var p=-1,d=c[0];e:for(;++p<i&&l.length<s;){var h=f[p],v=t?t(h):h;if(h=n||0!==h?h:0,!(d?Dt(d,v):o(l,v,n))){for(u=a;--u;){var y=c[u];if(!(y?Dt(y,v):o(e[u],v,n)))continue e}d&&d.push(v),l.push(h)}}return l}function mr(e,t,n){var r=null==(e=yi(e,t=uo(t,e)))?e:e[Ei(Li(t))];return null==r?void 0:it(r,e,n)}function br(e){return Wa(e)&&dr(e)==c}function wr(e,t,n,r,o){return e===t||(null==e||null==t||!Wa(e)&&!Wa(t)?e!=e&&t!=t:function(e,t,n,r,o,i){var a=Ra(e),u=Ra(t),d=a?s:ri(e),h=u?s:ri(t),x=(d=d==c?g:d)==g,S=(h=h==c?g:h)==g,E=d==h;if(E&&Ma(e)){if(!Ma(t))return!1;a=!0,x=!1}if(E&&!x)return i||(i=new Mn),a||Xa(e)?Wo(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!i(new ze(e),new ze(t)));case l:case f:case y:return Ca(+e,+t);case p:return e.name==t.name&&e.message==t.message;case m:case w:return e==t+"";case v:var u=Ut;case b:var c=1&r;if(u||(u=Ht),e.size!=t.size&&!c)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var d=Wo(u(e),u(t),r,o,i,a);return a.delete(e),d;case k:if(En)return En.call(e)==En.call(t)}return!1}(e,t,d,n,r,o,i);if(!(1&n)){var j=x&&Oe.call(e,"__wrapped__"),P=S&&Oe.call(t,"__wrapped__");if(j||P){var C=j?e.value():e,T=P?t.value():t;return i||(i=new Mn),o(C,T,n,r,i)}}if(!E)return!1;return i||(i=new Mn),function(e,t,n,r,o,i){var a=1&n,u=$o(e),c=u.length,s=$o(t).length;if(c!=s&&!a)return!1;var l=c;for(;l--;){var f=u[l];if(!(a?f in t:Oe.call(t,f)))return!1}var p=i.get(e),d=i.get(t);if(p&&d)return p==t&&d==e;var h=!0;i.set(e,t),i.set(t,e);var v=a;for(;++l<c;){f=u[l];var y=e[f],g=t[f];if(r)var m=a?r(g,y,f,t,e,i):r(y,g,f,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){h=!1;break}v||(v="constructor"==f)}if(h&&!v){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i)}(e,t,n,r,wr,o))}function kr(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=ve(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=n[o])[0],s=e[c],l=u[1];if(a&&u[2]){if(void 0===s&&!(c in e))return!1}else{var f=new Mn;if(r)var p=r(s,l,c,e,t,f);if(!(void 0===p?wr(l,s,3,r,f):p))return!1}}return!0}function xr(e){return!(!Ha(e)||(t=e,Ee&&Ee in t))&&(Ua(e)?Te:ae).test(ji(e));var t}function _r(e){return"function"==typeof e?e:null==e?$u:"object"==typeof e?Ra(e)?Cr(e[0],e[1]):Pr(e):tc(e)}function Or(e){if(!pi(e))return on(e);var t=[];for(var n in ve(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Sr(e){if(!Ha(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=pi(e),n=[];for(var r in e)("constructor"!=r||!t&&Oe.call(e,r))&&n.push(r);return n}function Er(e,t){return e<t}function jr(e,t){var n=-1,o=Na(e)?r(e.length):[];return er(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}function Pr(e){var t=Zo(e);return 1==t.length&&t[0][2]?hi(t[0][0],t[0][1]):function(n){return n===e||kr(n,e,t)}}function Cr(e,t){return si(e)&&di(t)?hi(Ei(e),t):function(n){var r=vu(n,e);return void 0===r&&r===t?yu(n,e):wr(t,r,3)}}function Tr(e,t,n,r,o){e!==t&&ar(t,(function(i,a){if(o||(o=new Mn),Ha(i))!function(e,t,n,r,o,i,a){var u=mi(e,n),c=mi(t,n),s=a.get(c);if(s)return void qn(e,n,s);var l=i?i(u,c,n+"",e,t,a):void 0,f=void 0===l;if(f){var p=Ra(c),d=!p&&Ma(c),h=!p&&!d&&Xa(c);l=c,p||d||h?Ra(u)?l=u:za(u)?l=mo(u):d?(f=!1,l=fo(c,!0)):h?(f=!1,l=ho(c,!0)):l=[]:Ga(c)||Da(c)?(l=u,Da(u)?l=au(u):Ha(u)&&!Ua(u)||(l=ii(c))):f=!1}f&&(a.set(c,l),o(l,c,r,i,a),a.delete(c));qn(e,n,l)}(e,t,a,n,Tr,r,o);else{var u=r?r(mi(e,a),i,a+"",e,t,o):void 0;void 0===u&&(u=i),qn(e,a,u)}}),ku)}function Ar(e,t){var n=e.length;if(n)return ui(t+=t<0?n:0,n)?e[t]:void 0}function Dr(e,t,n){t=t.length?dt(t,(function(e){return Ra(e)?function(t){return fr(t,1===e.length?e[0]:e)}:e})):[$u];var r=-1;return t=dt(t,Tt(Ko())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(jr(e,(function(e,n,o){return{criteria:dt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,u=n.length;for(;++r<a;){var c=vo(o[r],i[r]);if(c){if(r>=u)return c;var s=n[r];return c*("desc"==s?-1:1)}}return e.index-t.index}(e,t,n)}))}function Rr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],u=fr(e,a);n(u,a)&&Br(i,uo(a,e),u)}return i}function Ir(e,t,n,r){var o=r?xt:kt,i=-1,a=t.length,u=e;for(e===t&&(t=mo(t)),n&&(u=dt(e,Tt(n)));++i<a;)for(var c=0,s=t[i],l=n?n(s):s;(c=o(u,l,c,r))>-1;)u!==e&&Je.call(u,c,1),Je.call(e,c,1);return e}function Nr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;ui(o)?Je.call(e,o,1):Zr(e,o)}}return e}function zr(e,t){return e+Zt(ln()*(t-e+1))}function Mr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Fr(e,t){return ki(vi(e,t,$u),e+"")}function Lr(e){return Ln(Cu(e))}function Ur(e,t){var n=Cu(e);return Oi(n,Jn(t,0,n.length))}function Br(e,t,n,r){if(!Ha(e))return e;for(var o=-1,i=(t=uo(t,e)).length,a=i-1,u=e;null!=u&&++o<i;){var c=Ei(t[o]),s=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=u[c];void 0===(s=r?r(l,c,u):void 0)&&(s=Ha(l)?l:ui(t[o+1])?[]:{})}Hn(u,c,s),u=u[c]}return e}var qr=mn?function(e,t){return mn.set(e,t),e}:$u,Hr=Et?function(e,t){return Et(e,"toString",{configurable:!0,enumerable:!1,value:Hu(t),writable:!0})}:$u;function Wr(e){return Oi(Cu(e))}function Qr(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function $r(e,t){var n;return er(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!Ka(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return Vr(e,t,$u,n)}function Vr(e,t,n,r){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,u=null===t,c=Ka(t),s=void 0===t;o<i;){var l=Zt((o+i)/2),f=n(e[l]),p=void 0!==f,d=null===f,h=f==f,v=Ka(f);if(a)var y=r||h;else y=s?h&&(r||p):u?h&&p&&(r||!d):c?h&&p&&!d&&(r||!v):!d&&!v&&(r?f<=t:f<t);y?o=l+1:i=l}return un(i,4294967294)}function Jr(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],u=t?t(a):a;if(!n||!Ca(u,c)){var c=u;i[o++]=0===a?0:a}}return i}function Yr(e){return"number"==typeof e?e:Ka(e)?NaN:+e}function Kr(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,Kr)+"";if(Ka(e))return jn?jn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xr(e,t,n){var r=-1,o=ft,i=e.length,a=!0,u=[],c=u;if(n)a=!1,o=pt;else if(i>=200){var s=t?null:Fo(e);if(s)return Ht(s);a=!1,o=Dt,c=new zn}else c=t?[]:u;e:for(;++r<i;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var p=c.length;p--;)if(c[p]===f)continue e;t&&c.push(f),u.push(l)}else o(c,f,n)||(c!==u&&c.push(f),u.push(l))}return u}function Zr(e,t){return null==(e=yi(e,t=uo(t,e)))||delete e[Ei(Li(t))]}function eo(e,t,n,r){return Br(e,t,n(fr(e,t)),r)}function to(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?Qr(e,r?0:i,r?i+1:o):Qr(e,r?i+1:0,r?o:i)}function no(e,t){var n=e;return n instanceof Dn&&(n=n.value()),vt(t,(function(e,t){return t.func.apply(t.thisArg,ht([e],t.args))}),n)}function ro(e,t,n){var o=e.length;if(o<2)return o?Xr(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var u=e[i],c=-1;++c<o;)c!=i&&(a[i]=Zn(a[i]||u,e[c],t,n));return Xr(ir(a,1),t,n)}function oo(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;){var u=r<i?t[r]:void 0;n(a,e[r],u)}return a}function io(e){return za(e)?e:[]}function ao(e){return"function"==typeof e?e:$u}function uo(e,t){return Ra(e)?e:si(e,t)?[e]:Si(uu(e))}var co=Fr;function so(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Qr(e,t,n)}var lo=Jt||function(e){return Ge.clearTimeout(e)};function fo(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function ho(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Ka(e),a=void 0!==t,u=null===t,c=t==t,s=Ka(t);if(!u&&!s&&!i&&e>t||i&&a&&c&&!u&&!s||r&&a&&c||!n&&c||!o)return 1;if(!r&&!i&&!s&&e<t||s&&n&&o&&!r&&!i||u&&n&&o||!a&&o||!c)return-1}return 0}function yo(e,t,n,o){for(var i=-1,a=e.length,u=n.length,c=-1,s=t.length,l=an(a-u,0),f=r(s+l),p=!o;++c<s;)f[c]=t[c];for(;++i<u;)(p||i<a)&&(f[n[i]]=e[i]);for(;l--;)f[c++]=e[i++];return f}function go(e,t,n,o){for(var i=-1,a=e.length,u=-1,c=n.length,s=-1,l=t.length,f=an(a-c,0),p=r(f+l),d=!o;++i<f;)p[i]=e[i];for(var h=i;++s<l;)p[h+s]=t[s];for(;++u<c;)(d||i<a)&&(p[h+n[u]]=e[i++]);return p}function mo(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function bo(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var u=t[i],c=r?r(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),o?Gn(n,u,c):Hn(n,u,c)}return n}function wo(e,t){return function(n,r){var o=Ra(n)?at:Qn,i=t?t():{};return o(n,e,Ko(r,2),i)}}function ko(e){return Fr((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ci(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=ve(t);++r<o;){var u=n[r];u&&e(t,u,r,i)}return t}))}function xo(e,t){return function(n,r){if(null==n)return n;if(!Na(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=ve(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function _o(e){return function(t,n,r){for(var o=-1,i=ve(t),a=r(t),u=a.length;u--;){var c=a[e?u:++o];if(!1===n(i[c],c,i))break}return t}}function Oo(e){return function(t){var n=Lt(t=uu(t))?$t(t):void 0,r=n?n[0]:t.charAt(0),o=n?so(n,1).join(""):t.slice(1);return r[e]()+o}}function So(e){return function(t){return vt(Uu(Du(t).replace(De,"")),e,"")}}function Eo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Cn(e.prototype),r=e.apply(n,t);return Ha(r)?r:n}}function jo(e){return function(t,n,r){var o=ve(t);if(!Na(t)){var i=Ko(n,3);t=wu(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[i?t[a]:a]:void 0}}function Po(e){return Qo((function(t){var n=t.length,r=n,o=An.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new me(i);if(o&&!u&&"wrapper"==Jo(a))var u=new An([],!0)}for(r=u?r:n;++r<n;){var c=Jo(a=t[r]),s="wrapper"==c?Vo(a):void 0;u=s&&li(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?u[Jo(s[0])].apply(u,s[3]):1==a.length&&li(a)?u[c]():u.thru(a)}return function(){var e=arguments,r=e[0];if(u&&1==e.length&&Ra(r))return u.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}function Co(e,t,n,o,i,a,u,c,s,l){var f=128&t,p=1&t,d=2&t,h=24&t,v=512&t,y=d?void 0:Eo(e);return function g(){for(var m=arguments.length,b=r(m),w=m;w--;)b[w]=arguments[w];if(h)var k=Yo(g),x=Nt(b,k);if(o&&(b=yo(b,o,i,h)),a&&(b=go(b,a,u,h)),m-=x,h&&m<l){var _=qt(b,k);return zo(e,t,Co,g.placeholder,n,b,_,c,s,l-m)}var O=p?n:this,S=d?O[e]:e;return m=b.length,c?b=gi(b,c):v&&m>1&&b.reverse(),f&&s<m&&(b.length=s),this&&this!==Ge&&this instanceof g&&(S=y||Eo(S)),S.apply(O,b)}}function To(e,t){return function(n,r){return function(e,t,n,r){return cr(e,(function(e,o,i){t(r,n(e),o,i)})),r}(n,e,t(r),{})}}function Ao(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Kr(n),r=Kr(r)):(n=Yr(n),r=Yr(r)),o=e(n,r)}return o}}function Do(e){return Qo((function(t){return t=dt(t,Tt(Ko())),Fr((function(n){var r=this;return e(t,(function(e){return it(e,r,n)}))}))}))}function Ro(e,t){var n=(t=void 0===t?" ":Kr(t)).length;if(n<2)return n?Mr(t,e):t;var r=Mr(t,Xt(e/Qt(t)));return Lt(t)?so($t(r),0,e).join(""):r.slice(0,e)}function Io(e){return function(t,n,o){return o&&"number"!=typeof o&&ci(t,n,o)&&(n=o=void 0),t=nu(t),void 0===n?(n=t,t=0):n=nu(n),function(e,t,n,o){for(var i=-1,a=an(Xt((t-e)/(n||1)),0),u=r(a);a--;)u[o?a:++i]=e,e+=n;return u}(t,n,o=void 0===o?t<n?1:-1:nu(o),e)}}function No(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=iu(t),n=iu(n)),e(t,n)}}function zo(e,t,n,r,o,i,a,u,c,s){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var f=[e,t,o,l?i:void 0,l?a:void 0,l?void 0:i,l?void 0:a,u,c,s],p=n.apply(void 0,f);return li(e)&&bi(p,f),p.placeholder=r,xi(p,e,t)}function Mo(e){var t=he[e];return function(e,n){if(e=iu(e),(n=null==n?0:un(ru(n),292))&&nn(e)){var r=(uu(e)+"e").split("e");return+((r=(uu(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Fo=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Ku;function Lo(e){return function(t){var n=ri(t);return n==v?Ut(t):n==b?Wt(t):function(e,t){return dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Uo(e,t,n,o,u,c,s,l){var f=2&t;if(!f&&"function"!=typeof e)throw new me(i);var p=o?o.length:0;if(p||(t&=-97,o=u=void 0),s=void 0===s?s:an(ru(s),0),l=void 0===l?l:ru(l),p-=u?u.length:0,64&t){var d=o,h=u;o=u=void 0}var v=f?void 0:Vo(e),y=[e,t,n,o,u,d,h,c,s,l];if(v&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,u=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!u)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var c=t[3];if(c){var s=e[3];e[3]=s?yo(s,c,t[4]):c,e[4]=s?qt(e[3],a):t[4]}(c=t[5])&&(s=e[5],e[5]=s?go(s,c,t[6]):c,e[6]=s?qt(e[5],a):t[6]);(c=t[7])&&(e[7]=c);128&r&&(e[8]=null==e[8]?t[8]:un(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(y,v),e=y[0],t=y[1],n=y[2],o=y[3],u=y[4],!(l=y[9]=void 0===y[9]?f?0:e.length:an(y[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var o=Eo(e);return function i(){for(var a=arguments.length,u=r(a),c=a,s=Yo(i);c--;)u[c]=arguments[c];var l=a<3&&u[0]!==s&&u[a-1]!==s?[]:qt(u,s);if((a-=l.length)<n)return zo(e,t,Co,i.placeholder,void 0,u,l,void 0,void 0,n-a);var f=this&&this!==Ge&&this instanceof i?o:e;return it(f,this,u)}}(e,t,l):32!=t&&33!=t||u.length?Co.apply(void 0,y):function(e,t,n,o){var i=1&t,a=Eo(e);return function t(){for(var u=-1,c=arguments.length,s=-1,l=o.length,f=r(l+c),p=this&&this!==Ge&&this instanceof t?a:e;++s<l;)f[s]=o[s];for(;c--;)f[s++]=arguments[++u];return it(p,i?n:this,f)}}(e,t,n,o);else var g=function(e,t,n){var r=1&t,o=Eo(e);return function t(){var i=this&&this!==Ge&&this instanceof t?o:e;return i.apply(r?n:this,arguments)}}(e,t,n);return xi((v?qr:bi)(g,y),e,t)}function Bo(e,t,n,r){return void 0===e||Ca(e,ke[n])&&!Oe.call(r,n)?t:e}function qo(e,t,n,r,o,i){return Ha(e)&&Ha(t)&&(i.set(t,e),Tr(e,t,void 0,qo,i),i.delete(t)),e}function Ho(e){return Ga(e)?void 0:e}function Wo(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),l=i.get(t);if(s&&l)return s==t&&l==e;var f=-1,p=!0,d=2&n?new zn:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var h=e[f],v=t[f];if(r)var y=a?r(v,h,f,t,e,i):r(h,v,f,e,t,i);if(void 0!==y){if(y)continue;p=!1;break}if(d){if(!gt(t,(function(e,t){if(!Dt(d,t)&&(h===e||o(h,e,n,r,i)))return d.push(t)}))){p=!1;break}}else if(h!==v&&!o(h,v,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Qo(e){return ki(vi(e,void 0,Ii),e+"")}function $o(e){return pr(e,wu,ti)}function Go(e){return pr(e,ku,ni)}var Vo=mn?function(e){return mn.get(e)}:Ku;function Jo(e){for(var t=e.name+"",n=bn[t],r=Oe.call(bn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function Yo(e){return(Oe.call(Pn,"placeholder")?Pn:e).placeholder}function Ko(){var e=Pn.iteratee||Gu;return e=e===Gu?_r:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Zo(e){for(var t=wu(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,di(o)]}return t}function ei(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return xr(n)?n:void 0}var ti=en?function(e){return null==e?[]:(e=ve(e),lt(en(e),(function(t){return Ve.call(e,t)})))}:oc,ni=en?function(e){for(var t=[];e;)ht(t,ti(e)),e=Qe(e);return t}:oc,ri=dr;function oi(e,t,n){for(var r=-1,o=(t=uo(t,e)).length,i=!1;++r<o;){var a=Ei(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&qa(o)&&ui(a,o)&&(Ra(e)||Da(e))}function ii(e){return"function"!=typeof e.constructor||pi(e)?{}:Cn(Qe(e))}function ai(e){return Ra(e)||Da(e)||!!(Ke&&e&&e[Ke])}function ui(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ce.test(e))&&e>-1&&e%1==0&&e<t}function ci(e,t,n){if(!Ha(n))return!1;var r=typeof t;return!!("number"==r?Na(n)&&ui(t,n.length):"string"==r&&t in n)&&Ca(n[t],e)}function si(e,t){if(Ra(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ka(e))||(W.test(e)||!H.test(e)||null!=t&&e in ve(t))}function li(e){var t=Jo(e),n=Pn[t];if("function"!=typeof n||!(t in Dn.prototype))return!1;if(e===n)return!0;var r=Vo(n);return!!r&&e===r[0]}(pn&&ri(new pn(new ArrayBuffer(1)))!=O||dn&&ri(new dn)!=v||hn&&"[object Promise]"!=ri(hn.resolve())||vn&&ri(new vn)!=b||yn&&ri(new yn)!=x)&&(ri=function(e){var t=dr(e),n=t==g?e.constructor:void 0,r=n?ji(n):"";if(r)switch(r){case wn:return O;case kn:return v;case xn:return"[object Promise]";case _n:return b;case On:return x}return t});var fi=xe?Ua:ic;function pi(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ke)}function di(e){return e==e&&!Ha(e)}function hi(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in ve(n)))}}function vi(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=an(o.length-t,0),u=r(a);++i<a;)u[i]=o[t+i];i=-1;for(var c=r(t+1);++i<t;)c[i]=o[i];return c[t]=n(u),it(e,this,c)}}function yi(e,t){return t.length<2?e:fr(e,Qr(t,0,-1))}function gi(e,t){for(var n=e.length,r=un(t.length,n),o=mo(e);r--;){var i=t[r];e[r]=ui(i,n)?o[i]:void 0}return e}function mi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var bi=_i(qr),wi=Kt||function(e,t){return Ge.setTimeout(e,t)},ki=_i(Hr);function xi(e,t,n){var r=t+"";return ki(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return ut(u,(function(n){var r="_."+n[0];t&n[1]&&!ft(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Z):[]}(r),n)))}function _i(e){var t=0,n=0;return function(){var r=cn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Oi(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var i=zr(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Si=function(e){var t=_a(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,(function(e,n,r,o){t.push(r?o.replace(te,"$1"):n||e)})),t}));function Ei(e){if("string"==typeof e||Ka(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ji(e){if(null!=e){try{return _e.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pi(e){if(e instanceof Dn)return e.clone();var t=new An(e.__wrapped__,e.__chain__);return t.__actions__=mo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ci=Fr((function(e,t){return za(e)?Zn(e,ir(t,1,za,!0)):[]})),Ti=Fr((function(e,t){var n=Li(t);return za(n)&&(n=void 0),za(e)?Zn(e,ir(t,1,za,!0),Ko(n,2)):[]})),Ai=Fr((function(e,t){var n=Li(t);return za(n)&&(n=void 0),za(e)?Zn(e,ir(t,1,za,!0),void 0,n):[]}));function Di(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ru(n);return o<0&&(o=an(r+o,0)),wt(e,Ko(t,3),o)}function Ri(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ru(n),o=n<0?an(r+o,0):un(o,r-1)),wt(e,Ko(t,3),o,!0)}function Ii(e){return(null==e?0:e.length)?ir(e,1):[]}function Ni(e){return e&&e.length?e[0]:void 0}var zi=Fr((function(e){var t=dt(e,io);return t.length&&t[0]===e[0]?gr(t):[]})),Mi=Fr((function(e){var t=Li(e),n=dt(e,io);return t===Li(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gr(n,Ko(t,2)):[]})),Fi=Fr((function(e){var t=Li(e),n=dt(e,io);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gr(n,void 0,t):[]}));function Li(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ui=Fr(Bi);function Bi(e,t){return e&&e.length&&t&&t.length?Ir(e,t):e}var qi=Qo((function(e,t){var n=null==e?0:e.length,r=Vn(e,t);return Nr(e,dt(t,(function(e){return ui(e,n)?+e:e})).sort(vo)),r}));function Hi(e){return null==e?e:fn.call(e)}var Wi=Fr((function(e){return Xr(ir(e,1,za,!0))})),Qi=Fr((function(e){var t=Li(e);return za(t)&&(t=void 0),Xr(ir(e,1,za,!0),Ko(t,2))})),$i=Fr((function(e){var t=Li(e);return t="function"==typeof t?t:void 0,Xr(ir(e,1,za,!0),void 0,t)}));function Gi(e){if(!e||!e.length)return[];var t=0;return e=lt(e,(function(e){if(za(e))return t=an(e.length,t),!0})),Ct(t,(function(t){return dt(e,St(t))}))}function Vi(e,t){if(!e||!e.length)return[];var n=Gi(e);return null==t?n:dt(n,(function(e){return it(t,void 0,e)}))}var Ji=Fr((function(e,t){return za(e)?Zn(e,t):[]})),Yi=Fr((function(e){return ro(lt(e,za))})),Ki=Fr((function(e){var t=Li(e);return za(t)&&(t=void 0),ro(lt(e,za),Ko(t,2))})),Xi=Fr((function(e){var t=Li(e);return t="function"==typeof t?t:void 0,ro(lt(e,za),void 0,t)})),Zi=Fr(Gi);var ea=Fr((function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Vi(e,n)}));function ta(e){var t=Pn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var ra=Qo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Vn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Dn&&ui(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:na,args:[o],thisArg:void 0}),new An(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(o)}));var oa=wo((function(e,t,n){Oe.call(e,n)?++e[n]:Gn(e,n,1)}));var ia=jo(Di),aa=jo(Ri);function ua(e,t){return(Ra(e)?ut:er)(e,Ko(t,3))}function ca(e,t){return(Ra(e)?ct:tr)(e,Ko(t,3))}var sa=wo((function(e,t,n){Oe.call(e,n)?e[n].push(t):Gn(e,n,[t])}));var la=Fr((function(e,t,n){var o=-1,i="function"==typeof t,a=Na(e)?r(e.length):[];return er(e,(function(e){a[++o]=i?it(t,e,n):mr(e,t,n)})),a})),fa=wo((function(e,t,n){Gn(e,n,t)}));function pa(e,t){return(Ra(e)?dt:jr)(e,Ko(t,3))}var da=wo((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ha=Fr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ci(e,t[0],t[1])?t=[]:n>2&&ci(t[0],t[1],t[2])&&(t=[t[0]]),Dr(e,ir(t,1),[])})),va=Yt||function(){return Ge.Date.now()};function ya(e,t,n){return t=n?void 0:t,Uo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(e,t){var n;if("function"!=typeof t)throw new me(i);return e=ru(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ma=Fr((function(e,t,n){var r=1;if(n.length){var o=qt(n,Yo(ma));r|=32}return Uo(e,r,t,n,o)})),ba=Fr((function(e,t,n){var r=3;if(n.length){var o=qt(n,Yo(ba));r|=32}return Uo(t,r,e,n,o)}));function wa(e,t,n){var r,o,a,u,c,s,l=0,f=!1,p=!1,d=!0;if("function"!=typeof e)throw new me(i);function h(t){var n=r,i=o;return r=o=void 0,l=t,u=e.apply(i,n)}function v(e){return l=e,c=wi(g,t),f?h(e):u}function y(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-l>=a}function g(){var e=va();if(y(e))return m(e);c=wi(g,function(e){var n=t-(e-s);return p?un(n,a-(e-l)):n}(e))}function m(e){return c=void 0,d&&r?h(e):(r=o=void 0,u)}function b(){var e=va(),n=y(e);if(r=arguments,o=this,s=e,n){if(void 0===c)return v(s);if(p)return lo(c),c=wi(g,t),h(s)}return void 0===c&&(c=wi(g,t)),u}return t=iu(t)||0,Ha(n)&&(f=!!n.leading,a=(p="maxWait"in n)?an(iu(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==c&&lo(c),l=0,r=s=o=c=void 0},b.flush=function(){return void 0===c?u:m(va())},b}var ka=Fr((function(e,t){return Xn(e,1,t)})),xa=Fr((function(e,t,n){return Xn(e,iu(t)||0,n)}));function _a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(_a.Cache||Nn),n}function Oa(e){if("function"!=typeof e)throw new me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}_a.Cache=Nn;var Sa=co((function(e,t){var n=(t=1==t.length&&Ra(t[0])?dt(t[0],Tt(Ko())):dt(ir(t,1),Tt(Ko()))).length;return Fr((function(r){for(var o=-1,i=un(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return it(e,this,r)}))})),Ea=Fr((function(e,t){return Uo(e,32,void 0,t,qt(t,Yo(Ea)))})),ja=Fr((function(e,t){return Uo(e,64,void 0,t,qt(t,Yo(ja)))})),Pa=Qo((function(e,t){return Uo(e,256,void 0,void 0,void 0,t)}));function Ca(e,t){return e===t||e!=e&&t!=t}var Ta=No(hr),Aa=No((function(e,t){return e>=t})),Da=br(function(){return arguments}())?br:function(e){return Wa(e)&&Oe.call(e,"callee")&&!Ve.call(e,"callee")},Ra=r.isArray,Ia=Ze?Tt(Ze):function(e){return Wa(e)&&dr(e)==_};function Na(e){return null!=e&&qa(e.length)&&!Ua(e)}function za(e){return Wa(e)&&Na(e)}var Ma=tn||ic,Fa=et?Tt(et):function(e){return Wa(e)&&dr(e)==f};function La(e){if(!Wa(e))return!1;var t=dr(e);return t==p||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ga(e)}function Ua(e){if(!Ha(e))return!1;var t=dr(e);return t==d||t==h||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ba(e){return"number"==typeof e&&e==ru(e)}function qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wa(e){return null!=e&&"object"==typeof e}var Qa=tt?Tt(tt):function(e){return Wa(e)&&ri(e)==v};function $a(e){return"number"==typeof e||Wa(e)&&dr(e)==y}function Ga(e){if(!Wa(e)||dr(e)!=g)return!1;var t=Qe(e);if(null===t)return!0;var n=Oe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_e.call(n)==Pe}var Va=nt?Tt(nt):function(e){return Wa(e)&&dr(e)==m};var Ja=rt?Tt(rt):function(e){return Wa(e)&&ri(e)==b};function Ya(e){return"string"==typeof e||!Ra(e)&&Wa(e)&&dr(e)==w}function Ka(e){return"symbol"==typeof e||Wa(e)&&dr(e)==k}var Xa=ot?Tt(ot):function(e){return Wa(e)&&qa(e.length)&&!!Ue[dr(e)]};var Za=No(Er),eu=No((function(e,t){return e<=t}));function tu(e){if(!e)return[];if(Na(e))return Ya(e)?$t(e):mo(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=ri(e);return(t==v?Ut:t==b?Ht:Cu)(e)}function nu(e){return e?(e=iu(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ru(e){var t=nu(e),n=t%1;return t==t?n?t-n:t:0}function ou(e){return e?Jn(ru(e),0,4294967295):0}function iu(e){if("number"==typeof e)return e;if(Ka(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(V,"");var n=ie.test(e);return n||ue.test(e)?We(e.slice(2),n?2:8):oe.test(e)?NaN:+e}function au(e){return bo(e,ku(e))}function uu(e){return null==e?"":Kr(e)}var cu=ko((function(e,t){if(pi(t)||Na(t))bo(t,wu(t),e);else for(var n in t)Oe.call(t,n)&&Hn(e,n,t[n])})),su=ko((function(e,t){bo(t,ku(t),e)})),lu=ko((function(e,t,n,r){bo(t,ku(t),e,r)})),fu=ko((function(e,t,n,r){bo(t,wu(t),e,r)})),pu=Qo(Vn);var du=Fr((function(e,t){e=ve(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&ci(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],a=ku(i),u=-1,c=a.length;++u<c;){var s=a[u],l=e[s];(void 0===l||Ca(l,ke[s])&&!Oe.call(e,s))&&(e[s]=i[s])}return e})),hu=Fr((function(e){return e.push(void 0,qo),it(_u,void 0,e)}));function vu(e,t,n){var r=null==e?void 0:fr(e,t);return void 0===r?n:r}function yu(e,t){return null!=e&&oi(e,t,yr)}var gu=To((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=n}),Hu($u)),mu=To((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Oe.call(e,t)?e[t].push(n):e[t]=[n]}),Ko),bu=Fr(mr);function wu(e){return Na(e)?Fn(e):Or(e)}function ku(e){return Na(e)?Fn(e,!0):Sr(e)}var xu=ko((function(e,t,n){Tr(e,t,n)})),_u=ko((function(e,t,n,r){Tr(e,t,n,r)})),Ou=Qo((function(e,t){var n={};if(null==e)return n;var r=!1;t=dt(t,(function(t){return t=uo(t,e),r||(r=t.length>1),t})),bo(e,Go(e),n),r&&(n=Yn(n,7,Ho));for(var o=t.length;o--;)Zr(n,t[o]);return n}));var Su=Qo((function(e,t){return null==e?{}:function(e,t){return Rr(e,t,(function(t,n){return yu(e,n)}))}(e,t)}));function Eu(e,t){if(null==e)return{};var n=dt(Go(e),(function(e){return[e]}));return t=Ko(t),Rr(e,n,(function(e,n){return t(e,n[0])}))}var ju=Lo(wu),Pu=Lo(ku);function Cu(e){return null==e?[]:At(e,wu(e))}var Tu=So((function(e,t,n){return t=t.toLowerCase(),e+(n?Au(t):t)}));function Au(e){return Lu(uu(e).toLowerCase())}function Du(e){return(e=uu(e))&&e.replace(se,zt).replace(Re,"")}var Ru=So((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Iu=So((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Nu=Oo("toLowerCase");var zu=So((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Mu=So((function(e,t,n){return e+(n?" ":"")+Lu(t)}));var Fu=So((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Lu=Oo("toUpperCase");function Uu(e,t,n){return e=uu(e),void 0===(t=n?void 0:t)?function(e){return Me.test(e)}(e)?function(e){return e.match(Ne)||[]}(e):function(e){return e.match(ee)||[]}(e):e.match(t)||[]}var Bu=Fr((function(e,t){try{return it(e,void 0,t)}catch(e){return La(e)?e:new pe(e)}})),qu=Qo((function(e,t){return ut(t,(function(t){t=Ei(t),Gn(e,t,ma(e[t],e))})),e}));function Hu(e){return function(){return e}}var Wu=Po(),Qu=Po(!0);function $u(e){return e}function Gu(e){return _r("function"==typeof e?e:Yn(e,1))}var Vu=Fr((function(e,t){return function(n){return mr(n,e,t)}})),Ju=Fr((function(e,t){return function(n){return mr(e,n,t)}}));function Yu(e,t,n){var r=wu(t),o=lr(t,r);null!=n||Ha(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=lr(t,wu(t)));var i=!(Ha(n)&&"chain"in n&&!n.chain),a=Ua(e);return ut(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=mo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ht([this.value()],arguments))})})),e}function Ku(){}var Xu=Do(dt),Zu=Do(st),ec=Do(gt);function tc(e){return si(e)?St(Ei(e)):function(e){return function(t){return fr(t,e)}}(e)}var nc=Io(),rc=Io(!0);function oc(){return[]}function ic(){return!1}var ac=Ao((function(e,t){return e+t}),0),uc=Mo("ceil"),cc=Ao((function(e,t){return e/t}),1),sc=Mo("floor");var lc,fc=Ao((function(e,t){return e*t}),1),pc=Mo("round"),dc=Ao((function(e,t){return e-t}),0);return Pn.after=function(e,t){if("function"!=typeof t)throw new me(i);return e=ru(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=ya,Pn.assign=cu,Pn.assignIn=su,Pn.assignInWith=lu,Pn.assignWith=fu,Pn.at=pu,Pn.before=ga,Pn.bind=ma,Pn.bindAll=qu,Pn.bindKey=ba,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Pn.chain=ta,Pn.chunk=function(e,t,n){t=(n?ci(e,t,n):void 0===t)?1:an(ru(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,u=r(Xt(o/t));i<o;)u[a++]=Qr(e,i,i+=t);return u},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return ht(Ra(n)?mo(n):[n],ir(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,n=Ko();return e=t?dt(e,(function(e){if("function"!=typeof e[1])throw new me(i);return[n(e[0]),e[1]]})):[],Fr((function(n){for(var r=-1;++r<t;){var o=e[r];if(it(o[0],this,n))return it(o[1],this,n)}}))},Pn.conforms=function(e){return function(e){var t=wu(e);return function(n){return Kn(n,e,t)}}(Yn(e,1))},Pn.constant=Hu,Pn.countBy=oa,Pn.create=function(e,t){var n=Cn(e);return null==t?n:$n(n,t)},Pn.curry=function e(t,n,r){var o=Uo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Pn.curryRight=function e(t,n,r){var o=Uo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Pn.debounce=wa,Pn.defaults=du,Pn.defaultsDeep=hu,Pn.defer=ka,Pn.delay=xa,Pn.difference=Ci,Pn.differenceBy=Ti,Pn.differenceWith=Ai,Pn.drop=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,(t=n||void 0===t?1:ru(t))<0?0:t,r):[]},Pn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,0,(t=r-(t=n||void 0===t?1:ru(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!0):[]},Pn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ci(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ru(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ru(r))<0&&(r+=o),r=n>r?0:ou(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Pn.filter=function(e,t){return(Ra(e)?lt:or)(e,Ko(t,3))},Pn.flatMap=function(e,t){return ir(pa(e,t),1)},Pn.flatMapDeep=function(e,t){return ir(pa(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ru(n),ir(pa(e,t),n)},Pn.flatten=Ii,Pn.flattenDeep=function(e){return(null==e?0:e.length)?ir(e,1/0):[]},Pn.flattenDepth=function(e,t){return(null==e?0:e.length)?ir(e,t=void 0===t?1:ru(t)):[]},Pn.flip=function(e){return Uo(e,512)},Pn.flow=Wu,Pn.flowRight=Qu,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Pn.functions=function(e){return null==e?[]:lr(e,wu(e))},Pn.functionsIn=function(e){return null==e?[]:lr(e,ku(e))},Pn.groupBy=sa,Pn.initial=function(e){return(null==e?0:e.length)?Qr(e,0,-1):[]},Pn.intersection=zi,Pn.intersectionBy=Mi,Pn.intersectionWith=Fi,Pn.invert=gu,Pn.invertBy=mu,Pn.invokeMap=la,Pn.iteratee=Gu,Pn.keyBy=fa,Pn.keys=wu,Pn.keysIn=ku,Pn.map=pa,Pn.mapKeys=function(e,t){var n={};return t=Ko(t,3),cr(e,(function(e,r,o){Gn(n,t(e,r,o),e)})),n},Pn.mapValues=function(e,t){var n={};return t=Ko(t,3),cr(e,(function(e,r,o){Gn(n,r,t(e,r,o))})),n},Pn.matches=function(e){return Pr(Yn(e,1))},Pn.matchesProperty=function(e,t){return Cr(e,Yn(t,1))},Pn.memoize=_a,Pn.merge=xu,Pn.mergeWith=_u,Pn.method=Vu,Pn.methodOf=Ju,Pn.mixin=Yu,Pn.negate=Oa,Pn.nthArg=function(e){return e=ru(e),Fr((function(t){return Ar(t,e)}))},Pn.omit=Ou,Pn.omitBy=function(e,t){return Eu(e,Oa(Ko(t)))},Pn.once=function(e){return ga(2,e)},Pn.orderBy=function(e,t,n,r){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(n=r?void 0:n)||(n=null==n?[]:[n]),Dr(e,t,n))},Pn.over=Xu,Pn.overArgs=Sa,Pn.overEvery=Zu,Pn.overSome=ec,Pn.partial=Ea,Pn.partialRight=ja,Pn.partition=da,Pn.pick=Su,Pn.pickBy=Eu,Pn.property=tc,Pn.propertyOf=function(e){return function(t){return null==e?void 0:fr(e,t)}},Pn.pull=Ui,Pn.pullAll=Bi,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ir(e,t,Ko(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ir(e,t,void 0,n):e},Pn.pullAt=qi,Pn.range=nc,Pn.rangeRight=rc,Pn.rearg=Pa,Pn.reject=function(e,t){return(Ra(e)?lt:or)(e,Oa(Ko(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=Ko(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Nr(e,o),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new me(i);return Fr(e,t=void 0===t?t:ru(t))},Pn.reverse=Hi,Pn.sampleSize=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:ru(t),(Ra(e)?Un:Ur)(e,t)},Pn.set=function(e,t,n){return null==e?e:Br(e,t,n)},Pn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Br(e,t,n,r)},Pn.shuffle=function(e){return(Ra(e)?Bn:Wr)(e)},Pn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ci(e,t,n)?(t=0,n=r):(t=null==t?0:ru(t),n=void 0===n?r:ru(n)),Qr(e,t,n)):[]},Pn.sortBy=ha,Pn.sortedUniq=function(e){return e&&e.length?Jr(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Jr(e,Ko(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ci(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=uu(e))&&("string"==typeof t||null!=t&&!Va(t))&&!(t=Kr(t))&&Lt(e)?so($t(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new me(i);return t=null==t?0:an(ru(t),0),Fr((function(n){var r=n[t],o=so(n,0,t);return r&&ht(o,r),it(e,this,o)}))},Pn.tail=function(e){var t=null==e?0:e.length;return t?Qr(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?Qr(e,0,(t=n||void 0===t?1:ru(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Qr(e,(t=r-(t=n||void 0===t?1:ru(t)))<0?0:t,r):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?to(e,Ko(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?to(e,Ko(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new me(i);return Ha(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),wa(e,t,{leading:r,maxWait:t,trailing:o})},Pn.thru=na,Pn.toArray=tu,Pn.toPairs=ju,Pn.toPairsIn=Pu,Pn.toPath=function(e){return Ra(e)?dt(e,Ei):Ka(e)?[e]:mo(Si(uu(e)))},Pn.toPlainObject=au,Pn.transform=function(e,t,n){var r=Ra(e),o=r||Ma(e)||Xa(e);if(t=Ko(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Ha(e)&&Ua(i)?Cn(Qe(e)):{}}return(o?ut:cr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Pn.unary=function(e){return ya(e,1)},Pn.union=Wi,Pn.unionBy=Qi,Pn.unionWith=$i,Pn.uniq=function(e){return e&&e.length?Xr(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Xr(e,Ko(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xr(e,void 0,t):[]},Pn.unset=function(e,t){return null==e||Zr(e,t)},Pn.unzip=Gi,Pn.unzipWith=Vi,Pn.update=function(e,t,n){return null==e?e:eo(e,t,ao(n))},Pn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:eo(e,t,ao(n),r)},Pn.values=Cu,Pn.valuesIn=function(e){return null==e?[]:At(e,ku(e))},Pn.without=Ji,Pn.words=Uu,Pn.wrap=function(e,t){return Ea(ao(t),e)},Pn.xor=Yi,Pn.xorBy=Ki,Pn.xorWith=Xi,Pn.zip=Zi,Pn.zipObject=function(e,t){return oo(e||[],t||[],Hn)},Pn.zipObjectDeep=function(e,t){return oo(e||[],t||[],Br)},Pn.zipWith=ea,Pn.entries=ju,Pn.entriesIn=Pu,Pn.extend=su,Pn.extendWith=lu,Yu(Pn,Pn),Pn.add=ac,Pn.attempt=Bu,Pn.camelCase=Tu,Pn.capitalize=Au,Pn.ceil=uc,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=iu(n))==n?n:0),void 0!==t&&(t=(t=iu(t))==t?t:0),Jn(iu(e),t,n)},Pn.clone=function(e){return Yn(e,4)},Pn.cloneDeep=function(e){return Yn(e,5)},Pn.cloneDeepWith=function(e,t){return Yn(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return Yn(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Kn(e,t,wu(t))},Pn.deburr=Du,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=cc,Pn.endsWith=function(e,t,n){e=uu(e),t=Kr(t);var r=e.length,o=n=void 0===n?r:Jn(ru(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Pn.eq=Ca,Pn.escape=function(e){return(e=uu(e))&&L.test(e)?e.replace(M,Mt):e},Pn.escapeRegExp=function(e){return(e=uu(e))&&G.test(e)?e.replace($,"\\$&"):e},Pn.every=function(e,t,n){var r=Ra(e)?st:nr;return n&&ci(e,t,n)&&(t=void 0),r(e,Ko(t,3))},Pn.find=ia,Pn.findIndex=Di,Pn.findKey=function(e,t){return bt(e,Ko(t,3),cr)},Pn.findLast=aa,Pn.findLastIndex=Ri,Pn.findLastKey=function(e,t){return bt(e,Ko(t,3),sr)},Pn.floor=sc,Pn.forEach=ua,Pn.forEachRight=ca,Pn.forIn=function(e,t){return null==e?e:ar(e,Ko(t,3),ku)},Pn.forInRight=function(e,t){return null==e?e:ur(e,Ko(t,3),ku)},Pn.forOwn=function(e,t){return e&&cr(e,Ko(t,3))},Pn.forOwnRight=function(e,t){return e&&sr(e,Ko(t,3))},Pn.get=vu,Pn.gt=Ta,Pn.gte=Aa,Pn.has=function(e,t){return null!=e&&oi(e,t,vr)},Pn.hasIn=yu,Pn.head=Ni,Pn.identity=$u,Pn.includes=function(e,t,n,r){e=Na(e)?e:Cu(e),n=n&&!r?ru(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Ya(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&kt(e,t,n)>-1},Pn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ru(n);return o<0&&(o=an(r+o,0)),kt(e,t,o)},Pn.inRange=function(e,t,n){return t=nu(t),void 0===n?(n=t,t=0):n=nu(n),function(e,t,n){return e>=un(t,n)&&e<an(t,n)}(e=iu(e),t,n)},Pn.invoke=bu,Pn.isArguments=Da,Pn.isArray=Ra,Pn.isArrayBuffer=Ia,Pn.isArrayLike=Na,Pn.isArrayLikeObject=za,Pn.isBoolean=function(e){return!0===e||!1===e||Wa(e)&&dr(e)==l},Pn.isBuffer=Ma,Pn.isDate=Fa,Pn.isElement=function(e){return Wa(e)&&1===e.nodeType&&!Ga(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Na(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Xa(e)||Da(e)))return!e.length;var t=ri(e);if(t==v||t==b)return!e.size;if(pi(e))return!Or(e).length;for(var n in e)if(Oe.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return wr(e,t)},Pn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?wr(e,t,void 0,n):!!r},Pn.isError=La,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=Ua,Pn.isInteger=Ba,Pn.isLength=qa,Pn.isMap=Qa,Pn.isMatch=function(e,t){return e===t||kr(e,t,Zo(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,kr(e,t,Zo(t),n)},Pn.isNaN=function(e){return $a(e)&&e!=+e},Pn.isNative=function(e){if(fi(e))throw new pe("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return xr(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=$a,Pn.isObject=Ha,Pn.isObjectLike=Wa,Pn.isPlainObject=Ga,Pn.isRegExp=Va,Pn.isSafeInteger=function(e){return Ba(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Ja,Pn.isString=Ya,Pn.isSymbol=Ka,Pn.isTypedArray=Xa,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Wa(e)&&ri(e)==x},Pn.isWeakSet=function(e){return Wa(e)&&"[object WeakSet]"==dr(e)},Pn.join=function(e,t){return null==e?"":rn.call(e,t)},Pn.kebabCase=Ru,Pn.last=Li,Pn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ru(n))<0?an(r+o,0):un(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):wt(e,_t,o,!0)},Pn.lowerCase=Iu,Pn.lowerFirst=Nu,Pn.lt=Za,Pn.lte=eu,Pn.max=function(e){return e&&e.length?rr(e,$u,hr):void 0},Pn.maxBy=function(e,t){return e&&e.length?rr(e,Ko(t,2),hr):void 0},Pn.mean=function(e){return Ot(e,$u)},Pn.meanBy=function(e,t){return Ot(e,Ko(t,2))},Pn.min=function(e){return e&&e.length?rr(e,$u,Er):void 0},Pn.minBy=function(e,t){return e&&e.length?rr(e,Ko(t,2),Er):void 0},Pn.stubArray=oc,Pn.stubFalse=ic,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=fc,Pn.nth=function(e,t){return e&&e.length?Ar(e,ru(t)):void 0},Pn.noConflict=function(){return Ge._===this&&(Ge._=Ce),this},Pn.noop=Ku,Pn.now=va,Pn.pad=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Ro(Zt(o),n)+e+Ro(Xt(o),n)},Pn.padEnd=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;return t&&r<t?e+Ro(t-r,n):e},Pn.padStart=function(e,t,n){e=uu(e);var r=(t=ru(t))?Qt(e):0;return t&&r<t?Ro(t-r,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(uu(e).replace(J,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ci(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=nu(e),void 0===t?(t=e,e=0):t=nu(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=ln();return un(e+o*(t-e+He("1e-"+((o+"").length-1))),t)}return zr(e,t)},Pn.reduce=function(e,t,n){var r=Ra(e)?vt:jt,o=arguments.length<3;return r(e,Ko(t,4),n,o,er)},Pn.reduceRight=function(e,t,n){var r=Ra(e)?yt:jt,o=arguments.length<3;return r(e,Ko(t,4),n,o,tr)},Pn.repeat=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:ru(t),Mr(uu(e),t)},Pn.replace=function(){var e=arguments,t=uu(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var r=-1,o=(t=uo(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var i=null==e?void 0:e[Ei(t[r])];void 0===i&&(r=o,i=n),e=Ua(i)?i.call(e):i}return e},Pn.round=pc,Pn.runInContext=e,Pn.sample=function(e){return(Ra(e)?Ln:Lr)(e)},Pn.size=function(e){if(null==e)return 0;if(Na(e))return Ya(e)?Qt(e):e.length;var t=ri(e);return t==v||t==b?e.size:Or(e).length},Pn.snakeCase=zu,Pn.some=function(e,t,n){var r=Ra(e)?gt:$r;return n&&ci(e,t,n)&&(t=void 0),r(e,Ko(t,3))},Pn.sortedIndex=function(e,t){return Gr(e,t)},Pn.sortedIndexBy=function(e,t,n){return Vr(e,t,Ko(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Ca(e[r],t))return r}return-1},Pn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Vr(e,t,Ko(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=Gr(e,t,!0)-1;if(Ca(e[n],t))return n}return-1},Pn.startCase=Mu,Pn.startsWith=function(e,t,n){return e=uu(e),n=null==n?0:Jn(ru(n),0,e.length),t=Kr(t),e.slice(n,n+t.length)==t},Pn.subtract=dc,Pn.sum=function(e){return e&&e.length?Pt(e,$u):0},Pn.sumBy=function(e,t){return e&&e.length?Pt(e,Ko(t,2)):0},Pn.template=function(e,t,n){var r=Pn.templateSettings;n&&ci(e,t,n)&&(t=void 0),e=uu(e),t=lu({},t,r,Bo);var o,i,a=lu({},t.imports,r.imports,Bo),u=wu(a),c=At(a,u),s=0,l=t.interpolate||le,f="__p += '",p=ye((t.escape||le).source+"|"+l.source+"|"+(l===q?ne:le).source+"|"+(t.evaluate||le).source+"|$","g"),d="//# sourceURL="+(Oe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Le+"]")+"\n";e.replace(p,(function(t,n,r,a,u,c){return r||(r=a),f+=e.slice(s,c).replace(fe,Ft),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),u&&(i=!0,f+="';\n"+u+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+t.length,t})),f+="';\n";var h=Oe.call(t,"variable")&&t.variable;h||(f="with (obj) {\n"+f+"\n}\n"),f=(i?f.replace(R,""):f).replace(I,"$1").replace(N,"$1;"),f="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Bu((function(){return de(u,d+"return "+f).apply(void 0,c)}));if(v.source=f,La(v))throw v;return v},Pn.times=function(e,t){if((e=ru(e))<1||e>9007199254740991)return[];var n=4294967295,r=un(e,4294967295);e-=4294967295;for(var o=Ct(r,t=Ko(t));++n<e;)t(n);return o},Pn.toFinite=nu,Pn.toInteger=ru,Pn.toLength=ou,Pn.toLower=function(e){return uu(e).toLowerCase()},Pn.toNumber=iu,Pn.toSafeInteger=function(e){return e?Jn(ru(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=uu,Pn.toUpper=function(e){return uu(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(V,"");if(!e||!(t=Kr(t)))return e;var r=$t(e),o=$t(t);return so(r,Rt(r,o),It(r,o)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Kr(t)))return e;var r=$t(e);return so(r,0,It(r,$t(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=uu(e))&&(n||void 0===t))return e.replace(J,"");if(!e||!(t=Kr(t)))return e;var r=$t(e);return so(r,Rt(r,$t(t))).join("")},Pn.truncate=function(e,t){var n=30,r="...";if(Ha(t)){var o="separator"in t?t.separator:o;n="length"in t?ru(t.length):n,r="omission"in t?Kr(t.omission):r}var i=(e=uu(e)).length;if(Lt(e)){var a=$t(e);i=a.length}if(n>=i)return e;var u=n-Qt(r);if(u<1)return r;var c=a?so(a,0,u).join(""):e.slice(0,u);if(void 0===o)return c+r;if(a&&(u+=c.length-u),Va(o)){if(e.slice(u).search(o)){var s,l=c;for(o.global||(o=ye(o.source,uu(re.exec(o))+"g")),o.lastIndex=0;s=o.exec(l);)var f=s.index;c=c.slice(0,void 0===f?u:f)}}else if(e.indexOf(Kr(o),u)!=u){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Pn.unescape=function(e){return(e=uu(e))&&F.test(e)?e.replace(z,Gt):e},Pn.uniqueId=function(e){var t=++Se;return uu(e)+t},Pn.upperCase=Fu,Pn.upperFirst=Lu,Pn.each=ua,Pn.eachRight=ca,Pn.first=Ni,Yu(Pn,(lc={},cr(Pn,(function(e,t){Oe.call(Pn.prototype,t)||(lc[t]=e)})),lc),{chain:!1}),Pn.VERSION="4.17.19",ut(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Pn[e].placeholder=Pn})),ut(["drop","take"],(function(e,t){Dn.prototype[e]=function(n){n=void 0===n?1:an(ru(n),0);var r=this.__filtered__&&!t?new Dn(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Dn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),ut(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Dn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ko(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),ut(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Dn.prototype[e]=function(){return this[n](1).value()[0]}})),ut(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Dn.prototype[e]=function(){return this.__filtered__?new Dn(this):this[n](1)}})),Dn.prototype.compact=function(){return this.filter($u)},Dn.prototype.find=function(e){return this.filter(e).head()},Dn.prototype.findLast=function(e){return this.reverse().find(e)},Dn.prototype.invokeMap=Fr((function(e,t){return"function"==typeof e?new Dn(this):this.map((function(n){return mr(n,e,t)}))})),Dn.prototype.reject=function(e){return this.filter(Oa(Ko(e)))},Dn.prototype.slice=function(e,t){e=ru(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Dn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ru(t))<0?n.dropRight(-t):n.take(t-e)),n)},Dn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Dn.prototype.toArray=function(){return this.take(4294967295)},cr(Dn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Pn[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(Pn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof Dn,c=a[0],s=u||Ra(t),l=function(e){var t=o.apply(Pn,ht([e],a));return r&&f?t[0]:t};s&&n&&"function"==typeof c&&1!=c.length&&(u=s=!1);var f=this.__chain__,p=!!this.__actions__.length,d=i&&!f,h=u&&!p;if(!i&&s){t=h?t:new Dn(this);var v=e.apply(t,a);return v.__actions__.push({func:na,args:[l],thisArg:void 0}),new An(v,f)}return d&&h?e.apply(this,a):(v=this.thru(l),d?r?v.value()[0]:v.value():v)})})),ut(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ra(o)?o:[],e)}return this[n]((function(n){return t.apply(Ra(n)?n:[],e)}))}})),cr(Dn.prototype,(function(e,t){var n=Pn[t];if(n){var r=n.name+"";Oe.call(bn,r)||(bn[r]=[]),bn[r].push({name:t,func:n})}})),bn[Co(void 0,2).name]=[{name:"wrapper",func:void 0}],Dn.prototype.clone=function(){var e=new Dn(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e},Dn.prototype.reverse=function(){if(this.__filtered__){var e=new Dn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Dn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ra(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=un(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,u=i.end,c=u-a,s=r?u:a-1,l=this.__iteratees__,f=l.length,p=0,d=un(c,this.__takeCount__);if(!n||!r&&o==c&&d==c)return no(e,this.__actions__);var h=[];e:for(;c--&&p<d;){for(var v=-1,y=e[s+=t];++v<f;){var g=l[v],m=g.iteratee,b=g.type,w=m(y);if(2==b)y=w;else if(!w){if(1==b)continue e;break e}}h[p++]=y}return h},Pn.prototype.at=ra,Pn.prototype.chain=function(){return ta(this)},Pn.prototype.commit=function(){return new An(this.value(),this.__chain__)},Pn.prototype.next=function(){void 0===this.__values__&&(this.__values__=tu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var r=Pi(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Dn){var t=e;return this.__actions__.length&&(t=new Dn(this)),(t=t.reverse()).__actions__.push({func:na,args:[Hi],thisArg:void 0}),new An(t,this.__chain__)}return this.thru(Hi)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return no(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,Xe&&(Pn.prototype[Xe]=function(){return this}),Pn}();Ge._=Vt,void 0===(o=function(){return Vt}.call(t,n,t,r))||(r.exports=o)}).call(this)}).call(this,n(30),n(110)(e))},function(e){e.exports=JSON.parse('{"qualifications":[{"label":"identity_photo","purpose":"attestation","subjects":["identity"]},{"label":"national_id_card","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity"]},{"label":"passport","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity"]},{"label":"residence_permit","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"immigration","subjects":["permit","identity"]},{"label":"family_record_book","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"birth_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["identity","family"]},{"label":"driver_license","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"transport","subjects":["permit","driving"]},{"label":"other_identity_document","purpose":"attestation","subjects":["identity"]},{"label":"wedding","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"pacs","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"divorce","purpose":"contract","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["family"]},{"label":"large_family_card","purpose":"attestation","sourceCategory":"transport","subjects":["right"]},{"label":"caf","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"family","subjects":["right"]},{"label":"other_family_document","subjects":["family"]},{"label":"diploma","purpose":"attestation","sourceCategory":"education","subjects":["achievement"]},{"label":"work_contract","purpose":"contract","sourceCategory":"employer","subjects":["work","employment"]},{"label":"pay_sheet","purpose":"attestation","sourceCategory":"employer","subjects":["work","revenues"]},{"label":"unemployment_benefit","purpose":"attestation","sourceCategory":"gov","subjects":["revenues"]},{"label":"pension","purpose":"attestation","sourceCategory":"gov","subjects":["revenues"]},{"label":"other_revenue","purpose":"attestation","subjects":["revenues"]},{"label":"gradebook","purpose":"report","sourceCategory":"education","subjects":["history"]},{"label":"student_card","purpose":"attestation","sourceCategory":"education","subjects":["identity","right","employment","education"]},{"label":"resume","purpose":"description","subjects":["employment"]},{"label":"motivation_letter","purpose":"description","subjects":["employment"]},{"label":"other_work_document","purpose":"employment"},{"label":"health_book","purpose":"attestation","sourceCategory":"health","subjects":["capacity","vaccine"]},{"label":"health_certificate","purpose":"attestation","sourceCategory":"health","subjects":["capacity","vaccine"]},{"label":"pregnancy_medical_certificate","purpose":"attestation","sourceCategory":"health","subjects":["pregnancy"]},{"label":"work_disability_recognition","purpose":"attestation","sourceCategory":"health","subjects":["right"]},{"label":"national_health_insurance_card","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"health","subjects":["insurance"]},{"label":"national_health_insurance_right_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"health","subjects":["right","insurance"]},{"label":"health_insurance_card","purpose":"attestation","sourceCategory":"insurance","sourceSubCategory":"health","subjects":["insurance"]},{"label":"prescription","purpose":"attestation","sourceCategory":"health","subjects":["right","medecine"]},{"label":"health_invoice","purpose":"invoice","sourceCategory":"health"},{"label":"other_health_document","subjects":["health"]},{"label":"vehicle_registration","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"transport","subjects":["vehicule","identity","right"]},{"label":"car_insurance","purpose":"attestation","sourceCategory":"insurance","sourceSubCategory":"transport","subjects":["insurance","car"]},{"label":"mechanic_invoice","purpose":"invoice","sourceCategory":"transport"},{"label":"transport_invoice","purpose":"invoice","sourceCategory":"transport"},{"label":"other_transport_document","sourceCategory":"transport"},{"label":"house_sale_agreeement","purpose":"contract","sourceCategory":"real_estate","subjects":["house"]},{"label":"building_permit","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"real_estate","subjects":["permit","house"]},{"label":"technical_diagnostic_record","purpose":"report","sourceCategory":"real_estate","subjects":["compliance","house"]},{"label":"lease","purpose":"contract","sourceCategory":"real_estate","subjects":["house"]},{"label":"rent_receipt","purpose":"invoice","sourceCategory":"real_estate","subjects":["house"]},{"label":"house_insurance","purpose":"contract","sourceCategory":"insurance","sourceSubCategory":"real_estate","subjects":["insurance","house"]},{"label":"work_quote","purpose":"description","sourceCategory":"building","subjects":["building","house"]},{"label":"work_invoice","purpose":"invoice","sourceCategory":"building","subjects":["building","house"]},{"label":"other_house_document","subjects":["house"]},{"label":"phone_invoice","purpose":"invoice","sourceCategory":"telecom","sourceSubCategory":"mobile"},{"label":"isp_invoice","purpose":"invoice","sourceCategory":"telecom","sourceSubCategory":"internet","subjects":["subscription"]},{"label":"telecom_invoice","purpose":"invoice","sourceCategory":"telecom"},{"label":"energy_invoice","purpose":"invoice","sourceCategory":"energy"},{"label":"water_invoice","purpose":"invoice","sourceCategory":"water"},{"label":"appliance_invoice","purpose":"invoice","sourceCategory":"retail"},{"label":"web_service_invoice","purpose":"invoice","sourceCategory":"web"},{"label":"restaurant_invoice","purpose":"invoice","sourceCategory":"alimentation"},{"label":"other_invoice","purpose":"invoice"},{"label":"tax_return","purpose":"report","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"tax_notice","purpose":"invoice","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"tax_timetable","purpose":"report","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["tax"]},{"label":"other_tax_document","subjects":["tax"]},{"label":"bank_details","purpose":"attestation","sourceCategory":"bank","subjects":["bank_account"]},{"label":"bank_statement","purpose":"report","sourceCategory":"bank","subjects":["history"]},{"label":"loan_agreement","purpose":"contract","sourceCategory":"bank"},{"label":"other_bank_document","sourceCategory":"bank"},{"label":"receipt","purpose":"report"},{"label":"payment_proof_family_allowance","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"tax","subjects":["subvention"]},{"label":"school_attendance_certificate","purpose":"attestation","sourceCategory":"education","subjects":["identity","right","education"]},{"label":"unfit_for_habitation_declaration","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"real_estate","subjects":["compliance"]},{"label":"accommodation_proof","purpose":"attestation","sourceCategory":"individual","subjects":["address"]},{"label":"citizen_registration_certificate","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"civil_registration","subjects":["achievement","education"]},{"label":"personal_sporting_licence","purpose":"attestation","sourceCategory":"gov","sourceSubCategory":"sport","subjects":["permit","invoice"]},{"label":"other_activity_document","sourceSubCategory":"sport","subjects":["permit","invoice"]}],"purposeKnownValues":["attestation","contract","invoice","report","description","evaluation","employment"],"sourceCategoryKnownValues":["bank","insurance","retail","telecom","energy","water","health","gov","association","education","employer","transport","goods","alimentation","building","real_estate","web","individual"],"sourceSubCategoryKnownValues":["civil_registration","immigration","transport","family","tax","health","real_estate","mobile","internet","citizen","sport"],"subjectsKnownValues":["identity","permit","family","address","driving","right","subvention","achievement","degree","work","employment","revenues","history","insurance","medical_act","vehicule","car","moto","truck","boat","subscription","buy/sale","house","compliance","building","food","real_estate","tax","address","education","statement","course","internet","phone","vaccine","capacity","health","drugs","child","pregnancy","bank_account"]}')},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getReferencedFolder=t.createFolderWithReference=t.ensureMagicFolder=t.MAGIC_FOLDERS=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(596)),u=(r(n(41)),n(19),n(57)),c={ADMINISTRATIVE:"".concat("io.cozy.apps","/").concat("administrative"),PHOTOS:"".concat("io.cozy.apps","/").concat("photos"),PHOTOS_BACKUP:"".concat("io.cozy.apps","/").concat("photos","/mobile"),PHOTOS_UPLOAD:"".concat("io.cozy.apps","/").concat("photos","/upload"),NOTES:"".concat("io.cozy.apps","/notes"),HOME:"".concat("io.cozy.apps","/home"),PAPERS:"".concat("io.cozy.apps","/").concat("administrative","/papers")};t.MAGIC_FOLDERS=c;var s=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={_type:"io.cozy.apps",_id:n},e.next=3,f(t,i);case 3:if(!(a=e.sent)){e.next=6;break}return e.abrupt("return",a);case 6:if((u=Object.values(c)).includes(n)){e.next=9;break}throw new Error("Cannot create Magic folder with id ".concat(n,". Allowed values are ").concat(u.join(", "),"."));case 9:if(r){e.next=11;break}throw new Error("Magic folder default path must be defined");case 11:return e.abrupt("return",l(t,r,i));case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.ensureMagicFolder=s;var l=function(){var e=(0,i.default)(o.default.mark((function e(t,n,r){var i,a,c,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.collection(u.DOCTYPE_FILES),e.next=3,i.ensureDirectoryExists(n);case 3:return a=e.sent,e.next=6,i.addReferencesTo(r,[{_id:a}]);case 6:return e.next=8,i.get(a);case 8:return c=e.sent,s=c.data,e.abrupt("return",s);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();t.createFolderWithReference=l;var f=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.collection(u.DOCTYPE_FILES).findReferencedBy(n);case 2:return r=e.sent,i=r.included,c=i.filter((function(e){return!/^\/\.cozy_trash/.test(e.attributes.path)})),e.abrupt("return",c.length>0?(0,a.default)(c,"created_at").pop():null);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.getReferencedFolder=f},function(e,t,n){var r=n(116),o=n(284),i=n(55),a=n(288),u=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])}));e.exports=u},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchURL=t.generateUrlForNote=t.generatePrivateUrl=void 0;var o=r(n(5)),i=r(n(8)),a=n(183),u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.returnUrl,o=new URL(e);return r&&o.searchParams.set("returnUrl",r),o.hash="#/n/".concat(t.id),o.toString()};t.generatePrivateUrl=u;t.generateUrlForNote=function(e,t){return console.warn("generateUrlForNote is deprecated. Please use models.note.generatePrivateUrl instead"),u(e,t)};var c=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,u,c,s,l,f,p,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getStackClient().collection("io.cozy.notes").fetchURL({_id:n.id});case 2:if(r=e.sent,i=r.data,u=i.note_id,c=i.subdomain,s=i.protocol,l=i.instance,f=i.sharecode,p=i.public_name,!f){e.next=17;break}return(d=[["id",u]]).push(["sharecode",f]),p&&d.push(["username",p]),e.abrupt("return",(0,a.generateWebLink)({cozyUrl:"".concat(s,"://").concat(l),searchParams:d,pathname:"/public/",slug:"notes",subDomainType:c}));case 17:return e.abrupt("return",(0,a.generateWebLink)({cozyUrl:"".concat(s,"://").concat(l),pathname:"",slug:"notes",subDomainType:c,hash:"/n/".concat(u)}));case 18:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchURL=c},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.isReadOnly=v,t.fetchOwn=y,t.isForType=m,t.isDocumentReadOnly=function(e){return k.apply(this,arguments)},t.isShortcutCreatedOnTheRecipientCozy=void 0;var o=r(n(2)),i=r(n(5)),a=r(n(8)),u=r(n(32)),c=r(n(281)),s=r(n(16)),l=(r(n(41)),n(18)),f=n(301),p=n(57);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.writability,r=void 0===n?["PATCH","POST","PUT","DELETE"]:n;return e.verbs&&e.verbs.length>0&&0===(0,c.default)(e.verbs,["ALL"].concat((0,u.default)(r))).length}function y(e){return g.apply(this,arguments)}function g(){return(g=(0,a.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.collection("io.cozy.permissions"),e.next=3,n.fetchOwnPermissions();case 3:if(r=e.sent,o=(0,s.default)(r,"data.attributes.permissions")){e.next=7;break}throw"Can't get self permissions";case 7:return e.abrupt("return",Object.values(o));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e,t){return e.type===t||e.type+".*"===t}function b(e){return w.apply(this,arguments)}function w(){return(w=(0,a.default)(i.default.mark((function e(t){var n,r,o,u,c,s,d,v,g,b,w,k;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k=function(){return(k=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.doc,r=t.client,o=t.perms,!(a=o.find((function(e){if(e.values){var t=e.selector||"id",r=n[t];return e.values.includes(r)}return!0})))){e.next=6;break}return e.abrupt("return",a);case 6:if(c!==p.DOCTYPE_FILES){e.next=16;break}if(u=(0,f.getParentFolderId)(n),e.t0=u,!e.t0){e.next=13;break}return e.next=12,g(u);case 12:e.t0=e.sent;case 13:if(!(s=e.t0)){e.next=16;break}return e.abrupt("return",w({doc:s,perms:o,client:r}));case 16:return e.abrupt("return",void 0);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)},w=function(e){return k.apply(this,arguments)},b=function(){return(b=(0,a.default)(i.default.mark((function e(t){var n,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,l.Q)(p.DOCTYPE_FILES).getById(t),e.next=3,r.query(n);case 3:return o=e.sent,e.abrupt("return",o&&o.data);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e){return b.apply(this,arguments)},n=t.document,r=t.client,o=t.permissions,u=n._id||n.id,c=n._type||n.type,s=h(h({},n),{},{id:u,type:c}),!o){e.next=12;break}e.t0=o,e.next=15;break;case 12:return e.next=14,y(r);case 14:e.t0=e.sent;case 15:return d=e.t0,v=d.filter((function(e){return m(e,c)})),e.abrupt("return",w({doc:s,client:r,perms:v}));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=(0,a.default)(i.default.mark((function e(t){var n,r,o,a,u,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.document,r=t.client,o=t.writability,void 0!==(a=t.permissions)){e.next=10;break}return e.next=7,y(r);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=a;case 11:if(!((u=e.t0).length<=1)){e.next=16;break}e.t1=u[0],e.next=19;break;case 16:return e.next=18,b({document:n,client:r,permissions:u});case 18:e.t1=e.sent;case 19:if(!(c=e.t1)){e.next=24;break}return e.abrupt("return",v(c,{writability:o}));case 24:return console.warn("can't find the document in current attached permissions"),e.abrupt("return",void 0);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.isShortcutCreatedOnTheRecipientCozy=function(e){if(!e.included)return!1;var t=e.included.find((function(e){return"io.cozy.sharings.members"===e.type}));return!(!t||!t.attributes.instance)}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getCreatedByApp=t.hasBeenUpdatedByApp=void 0;var o=r(n(16));t.hasBeenUpdatedByApp=function(e,t){var n=(0,o.default)(e,"cozyMetadata.updatedByApps");return Boolean(n&&n.find((function(e){return e.slug===t})))};t.getCreatedByApp=function(e){return(0,o.default)(e,"cozyMetadata.createdByApp")}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getIndexByFamilyNameGivenNameEmailCozyUrl=t.getDefaultSortIndexValue=t.makeDefaultSortIndexValue=t.getDisplayName=t.makeDisplayName=t.getFullname=t.makeFullname=t.getPrimaryAddress=t.getPrimaryPhone=t.getPrimaryCozyDomain=t.getPrimaryCozy=t.getPrimaryEmail=t.getInitials=t.getPrimaryOrFirst=void 0;var o=r(n(16)),i=r(n(601)),a=function(e){return function(t){return t[e]&&0!==t[e].length?t[e].find((function(e){return e.primary}))||t[e][0]:""}};t.getPrimaryOrFirst=a;t.getInitials=function(e){if(e.name&&!(0,i.default)(e.name))return["givenName","familyName"].map((function(t){return(0,o.default)(e,["name",t,0],"")})).join("").toUpperCase();var t=u(e);if(t)return t[0].toUpperCase();var n=s(e);return n?n[0].toUpperCase():""};var u=function(e){return Array.isArray(e.email)?a("email")(e).address||"":e.email};t.getPrimaryEmail=u;var c=function(e){return Array.isArray(e.cozy)?a("cozy")(e).url||"":e.url};t.getPrimaryCozy=c;var s=function(e){try{return new URL(c(e)).hostname.replace(/^(www.)/g,"")}catch(t){return c(e)}};t.getPrimaryCozyDomain=s;t.getPrimaryPhone=function(e){return a("phone")(e).number||""};t.getPrimaryAddress=function(e){return a("address")(e).formattedAddress||""};var l=function(e){return e.name?["namePrefix","givenName","additionalName","familyName","nameSuffix"].map((function(t){return e.name[t]})).filter((function(e){return void 0!==e})).join(" ").trim():""};t.makeFullname=l;t.getFullname=function(e){return(0,o.default)(e,"fullname")?e.fullname:l(e)};var f=function(e){var t=l(e),n=u(e),r=s(e);return t&&t.length>0?t:n&&n.length>0?n:r&&r.length>0?r:""};t.makeDisplayName=f;t.getDisplayName=function(e){return(0,o.default)(e,"displayName")?e.displayName:f(e)};var p=function(e){var t=[(0,o.default)(e,"name.familyName",""),(0,o.default)(e,"name.givenName",""),u(e),s(e)].join("").trim().toLowerCase();return 0===t.length?null:t};t.makeDefaultSortIndexValue=p;var d=function(e){var t=(0,o.default)(e,"indexes.byFamilyNameGivenNameEmailCozyUrl",null);return null!==t?(0,i.default)(t)?null:t:p(e)};t.getDefaultSortIndexValue=d;t.getIndexByFamilyNameGivenNameEmailCozyUrl=function(e){return console.warn("Deprecation: `getIndexByFamilyNameGivenNameEmailCozyUrl` is deprecated, please use `getDefaultSortIndexValue` instead"),d(e)}},function(e,t,n){var r=n(150),o=n(66),i=n(81),a=n(22),u=n(47),c=n(82),s=n(112),l=n(111),f=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(u(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||l(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!r(e).length;for(var n in e)if(f.call(e,n))return!1;return!0}},function(e,t,n){"use strict";var r=n(17);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Qualification",{enumerable:!0,get:function(){return o.Qualification}}),Object.defineProperty(t,"setQualification",{enumerable:!0,get:function(){return o.setQualification}}),Object.defineProperty(t,"getQualification",{enumerable:!0,get:function(){return o.getQualification}}),t.helpers=t.themes=t.locales=void 0;var o=n(188),i=r(n(603));t.locales=i;var a=r(n(313));t.themes=a;var u=r(n(651));t.helpers=u},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundT=void 0;for(var o=r(n(604)),i={},a=0,u=["fr","en"];a<u.length;a++){var c=u[a],s={};try{s=n(648)("./".concat(c,".json"))}catch(e){}var l=new o.default;l.extend(s),i[c]=l}t.getBoundT=function(e){var t=i[e]||i.en;return t.t.bind(t)}},function(e,t,n){"use strict";var r=n(605),o=n(642),i=n(237),a=n(163),u=n(645),c=function(e){i(!1,e)},s=String.prototype.replace,l=String.prototype.split,f=function(e){var t=e%100,n=t%10;return 11!==t&&1===n?0:2<=n&&n<=4&&!(t>=12&&t<=14)?1:2},p={pluralTypes:{arabic:function(e){if(e<3)return e;var t=e%100;return t>=3&&t<=10?3:t>=11?4:5},bosnian_serbian:f,chinese:function(){return 0},croatian:f,french:function(e){return e>=2?1:0},german:function(e){return 1!==e?1:0},russian:f,lithuanian:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?1:2},czech:function(e){return 1===e?0:e>=2&&e<=4?1:2},polish:function(e){if(1===e)return 0;var t=e%10;return 2<=t&&t<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!=1||e%100==11?1:0},slovenian:function(e){var t=e%100;return 1===t?0:2===t?1:3===t||4===t?2:3}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is"],slovenian:["sl-SL"]}};function d(e,t){var n,i,a=(n=e.pluralTypeToLanguages,i={},r(o(n),(function(e){var t=e[0],n=e[1];r(n,(function(e){i[e]=t}))})),i);return a[t]||a[l.call(t,/-/,1)[0]]||a.en}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var v,y=(v={},function(e,t){var n=v[t];return n&&!e.pluralTypes[n]&&(n=null,v[t]=n),n||(n=d(e,t))&&(v[t]=n),n}),g=/%\{(.*?)\}/g;function m(e,t,n,r,o){if("string"!=typeof e)throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(null==t)return e;var i=e,c=r||g,f="number"==typeof t?{smart_count:t}:t;if(null!=f.smart_count&&e){var d=o||p,h=l.call(e,"||||"),v=function(e,t,n){return e.pluralTypes[t](n)}(d,y(d,n||"en"),f.smart_count);i=u(h[v]||h[0])}return i=s.call(i,c,(function(e,t){return a(f,t)&&null!=f[t]?f[t]:e}))}function b(e){var t=e||{};this.phrases={},this.extend(t.phrases||{}),this.currentLocale=t.locale||"en";var n=t.allowMissing?m:null;this.onMissingKey="function"==typeof t.onMissingKey?t.onMissingKey:n,this.warn=t.warn||c,this.tokenRegex=function(e){var t=e&&e.prefix||"%{",n=e&&e.suffix||"}";if("||||"===t||"||||"===n)throw new RangeError('"||||" token is reserved for pluralization');return new RegExp(h(t)+"(.*?)"+h(n),"g")}(t.interpolation),this.pluralRules=t.pluralRules||p}b.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},b.prototype.extend=function(e,t){r(o(e||{}),(function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;"object"==typeof r?this.extend(r,o):this.phrases[o]=r}),this)},b.prototype.unset=function(e,t){"string"==typeof e?delete this.phrases[e]:r(o(e||{}),(function(e){var n=e[0],r=e[1],o=t?t+"."+n:n;"object"==typeof r?this.unset(r,o):delete this.phrases[o]}),this)},b.prototype.clear=function(){this.phrases={}},b.prototype.replace=function(e){this.clear(),this.extend(e)},b.prototype.t=function(e,t){var n,r,o=null==t?{}:t;if("string"==typeof this.phrases[e])n=this.phrases[e];else if("string"==typeof o._)n=o._;else if(this.onMissingKey){r=(0,this.onMissingKey)(e,o,this.currentLocale,this.tokenRegex,this.pluralRules)}else this.warn('Missing translation for key: "'+e+'"'),r=e;return"string"==typeof n&&(r=m(n,o,this.currentLocale,this.tokenRegex,this.pluralRules)),r},b.prototype.has=function(e){return a(this.phrases,e)},b.transformPhrase=function(e,t,n){return m(e,t,n)},e.exports=b},function(e,t,n){"use strict";var r=n(49),o=n(94),i=n(60),a=n(302),u=n(303),c=n(307),s=c(),l=n(641),f=i("Array.prototype.slice"),p=o.apply(s),d=function(e,t){return a(e),p(e,f(arguments,1))};r(d,{getPolyfill:c,implementation:u,shim:l}),e.exports=d},function(e,t,n){"use strict";var r=n(27)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(27),o=n(60),i=r("%TypeError%"),a=n(608),u=r("%Reflect.apply%",!0)||o("%Function.prototype.apply%");e.exports=function(e,t){var n=arguments.length>2?arguments[2]:[];if(!a(n))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return u(e,t,n)}},function(e,t,n){"use strict";var r=n(27)("%Array%"),o=!r.isArray&&n(60)("Object.prototype.toString");e.exports=r.isArray||function(e){return"[object Array]"===o(e)}},function(e,t,n){var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=u&&c&&"function"==typeof c.get?c.get:null,l=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,v=Object.prototype.toString,y=Function.prototype.toString,g=String.prototype.match,m=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,k=String.prototype.toLowerCase,x=RegExp.prototype.test,_=Array.prototype.concat,O=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,j="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,D=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||x.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=m.call(t,o.length+1);return b.call(o,n,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,n,"$&_")}var N=n(610).custom,z=N&&U(N)?N:null;function M(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function F(e){return b.call(String(e),/"/g,""")}function L(e){return!("[object Array]"!==H(e)||A&&"object"==typeof e&&A in e)}function U(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var u=n||{};if(q(u,"quoteStyle")&&"single"!==u.quoteStyle&&"double"!==u.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(u,"maxStringLength")&&("number"==typeof u.maxStringLength?u.maxStringLength<0&&u.maxStringLength!==1/0:null!==u.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!q(u,"customInspect")||u.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(u,"indent")&&null!==u.indent&&"\t"!==u.indent&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(u,"numericSeparator")&&"boolean"!=typeof u.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var v=u.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,n){if(t.length>n.maxStringLength){var r=t.length-n.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return e(m.call(t,0,n.maxStringLength),n)+o}return M(b.call(b.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Q),"single",n)}(t,u);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return v?I(t,w):w}if("bigint"==typeof t){var x=String(t)+"n";return v?I(t,x):x}var E=void 0===u.depth?5:u.depth;if(void 0===r&&(r=0),r>=E&&E>0&&"object"==typeof t)return L(t)?"[Array]":"[Object]";var P=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=O.call(Array(e.indent+1)," ")}return{base:n,prev:O.call(Array(t+1),n)}}(u,r);if(void 0===o)o=[];else if(W(o,t)>=0)return"[Circular]";function N(t,n,i){if(n&&(o=S.call(o)).push(n),i){var a={depth:u.depth};return q(u,"quoteStyle")&&(a.quoteStyle=u.quoteStyle),e(t,a,r+1,o)}return e(t,u,r+1,o)}if("function"==typeof t){var B=function(e){if(e.name)return e.name;var t=g.call(y.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),K=Y(t,N);return"[Function"+(B?": "+B:" (anonymous)")+"]"+(K.length>0?" { "+O.call(K,", ")+" }":"")}if(U(t)){var X=T?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(t);return"object"!=typeof t||T?X:$(X)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var Z="<"+k.call(String(t.nodeName)),ee=t.attributes||[],te=0;te<ee.length;te++)Z+=" "+ee[te].name+"="+M(F(ee[te].value),"double",u);return Z+=">",t.childNodes&&t.childNodes.length&&(Z+="..."),Z+="</"+k.call(String(t.nodeName))+">"}if(L(t)){if(0===t.length)return"[]";var ne=Y(t,N);return P&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(ne)?"["+J(ne,P)+"]":"[ "+O.call(ne,", ")+" ]"}if(function(e){return!("[object Error]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)){var re=Y(t,N);return"cause"in t&&!D.call(t,"cause")?"{ ["+String(t)+"] "+O.call(_.call("[cause]: "+N(t.cause),re),", ")+" }":0===re.length?"["+String(t)+"]":"{ ["+String(t)+"] "+O.call(re,", ")+" }"}if("object"==typeof t&&c){if(z&&"function"==typeof t[z])return t[z]();if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{s.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var oe=[];return a.call(t,(function(e,n){oe.push(N(n,t,!0)+" => "+N(e,t))})),V("Map",i.call(t),oe,P)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ie=[];return l.call(t,(function(e){ie.push(N(e,t))})),V("Set",s.call(t),ie,P)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return G("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return G("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return G("WeakRef");if(function(e){return!("[object Number]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(N(Number(t)));if(function(e){if(!e||"object"!=typeof e||!j)return!1;try{return j.call(e),!0}catch(e){}return!1}(t))return $(N(j.call(t)));if(function(e){return!("[object Boolean]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(h.call(t));if(function(e){return!("[object String]"!==H(e)||A&&"object"==typeof e&&A in e)}(t))return $(N(String(t)));if(!function(e){return!("[object Date]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)&&!function(e){return!("[object RegExp]"!==H(e)||A&&"object"==typeof e&&A in e)}(t)){var ae=Y(t,N),ue=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",se=!ue&&A&&Object(t)===t&&A in t?m.call(H(t),8,-1):ce?"Object":"",le=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(se||ce?"["+O.call(_.call([],se||[],ce||[]),": ")+"] ":"");return 0===ae.length?le+"{}":P?le+"{"+J(ae,P)+"}":le+"{ "+O.call(ae,", ")+" }"}return String(t)};var B=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return B.call(e,t)}function H(e){return v.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Q(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function $(e){return"Object("+e+")"}function G(e){return e+" { ? }"}function V(e,t,n,r){return e+" ("+t+") {"+(r?J(n,r):O.call(n,", "))+"}"}function J(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+O.call(e,","+n)+"\n"+t.prev}function Y(e,t){var n=L(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=q(e,o)?t(e[o],e):""}var i,a="function"==typeof P?P(e):[];if(T){i={};for(var u=0;u<a.length;u++)i["$"+a[u]]=a[u]}for(var c in e)q(e,c)&&(n&&String(Number(c))===c&&c<e.length||T&&i["$"+c]instanceof Symbol||(x.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if("function"==typeof P)for(var s=0;s<a.length;s++)D.call(e,a[s])&&r.push("["+t(a[s])+"]: "+t(e[a[s]],e));return r}},function(e,t){},function(e,t,n){"use strict";e.exports=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0}},function(e,t,n){"use strict";var r=n(27)("%TypeError%"),o=n(305),i=n(189);e.exports=function(e,t){if("Object"!==i(e))throw new r("Assertion failed: `O` must be an Object");if(!o(t))throw new r("Assertion failed: `P` must be a Property Key");return t in e}},function(e,t,n){"use strict";e.exports=n(614)},function(e,t,n){"use strict";var r,o,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw o}}),o={},a((function(){throw 42}),null,r)}catch(e){e!==o&&(a=null)}else a=null;var u=/^\s*class\b/,c=function(e){try{var t=i.call(e);return u.test(t)}catch(e){return!1}},s=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,f="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=a?function(e){if(e===f)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{a(e,null,r)}catch(e){if(e!==o)return!1}return!c(e)}:function(e){if(e===f)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(l)return function(e){try{return!c(e)&&(i.call(e),!0)}catch(e){return!1}}(e);if(c(e))return!1;var t=s.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,n){"use strict";var r=n(27)("%TypeError%"),o=n(304),i=n(616),a=n(189);e.exports=function(e){if("Object"!==a(e))throw new r("Assertion failed: `obj` must be an Object");return i(o(e,"length"))}},function(e,t,n){"use strict";var r=n(617),o=n(618);e.exports=function(e){var t=o(e);return t<=0?0:t>r?r:t}},function(e,t,n){"use strict";var r=n(27),o=r("%Math%"),i=r("%Number%");e.exports=i.MAX_SAFE_INTEGER||o.pow(2,53)-1},function(e,t,n){"use strict";var r=n(619),o=n(628);e.exports=function(e){var t=o(e);return 0!==t&&(t=r(t)),0===t?0:t}},function(e,t,n){"use strict";var r=n(620),o=n(621),i=n(622),a=n(625),u=n(626),c=n(627);e.exports=function(e){var t=i(e);return a(t)?0:0!==t&&u(t)?c(t)*o(r(t)):t}},function(e,t,n){"use strict";var r=n(27)("%Math.abs%");e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=Math.floor;e.exports=function(e){return r(e)}},function(e,t,n){"use strict";var r=n(623);e.exports=function(e){var t=r(e,Number);if("string"!=typeof t)return+t;var n=t.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,"");return/^0[ob]|^[+-]0x/.test(n)?NaN:+n}},function(e,t,n){"use strict";e.exports=n(624)},function(e,t,n){"use strict";var r=Object.prototype.toString,o=n(306),i=n(162),a=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===r.call(e)?String:Number)===String||t===Number){var n,a,u=t===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<u.length;++a)if(i(e[u[a]])&&(n=e[u[a]](),o(n)))return n;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")};e.exports=function(e){return o(e)?e:arguments.length>1?a(e,arguments[1]):a(e)}},function(e,t,n){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},function(e,t,n){"use strict";var r=Number.isNaN||function(e){return e!=e};e.exports=Number.isFinite||function(e){return"number"==typeof e&&!r(e)&&e!==1/0&&e!==-1/0}},function(e,t,n){"use strict";e.exports=function(e){return e>=0?1:-1}},function(e,t,n){"use strict";var r=n(27),o=r("%TypeError%"),i=r("%Number%"),a=r("%RegExp%"),u=r("%parseInt%"),c=n(60),s=n(629),l=n(630),f=c("String.prototype.slice"),p=s(/^0b[01]+$/i),d=s(/^0o[0-7]+$/i),h=s(/^[-+]0x[0-9a-f]+$/i),v=s(new a("["+["
","",""].join("")+"]","g")),y=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),g=new RegExp("(^["+y+"]+)|(["+y+"]+$)","g"),m=c("String.prototype.replace"),b=n(631);e.exports=function e(t){var n=l(t)?t:b(t,i);if("symbol"==typeof n)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(p(n))return e(u(f(n,2),2));if(d(n))return e(u(f(n,2),8));if(v(n)||h(n))return NaN;var r=function(e){return m(e,g,"")}(n);if(r!==n)return e(r)}return i(n)}},function(e,t,n){"use strict";var r=n(27)("RegExp.prototype.test"),o=n(94);e.exports=function(e){return o(r,e)}},function(e,t,n){"use strict";e.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},function(e,t,n){"use strict";var r=n(632);e.exports=function(e){return arguments.length>1?r(e,arguments[1]):r(e)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=n(306),i=n(162),a=n(633),u=n(634),c=function(e,t){if(null==e)throw new TypeError("Cannot call method on "+e);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var n,r,a,u="string"===t?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<u.length;++a)if(n=e[u[a]],i(n)&&(r=n.call(e),o(r)))return r;throw new TypeError("No default value")},s=function(e,t){var n=e[t];if(null!=n){if(!i(n))throw new TypeError(n+" returned for property "+t+" of object "+e+" is not a function");return n}};e.exports=function(e){if(o(e))return e;var t,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?t=s(e,Symbol.toPrimitive):u(e)&&(t=Symbol.prototype.valueOf)),void 0!==t){var i=t.call(e,n);if(o(i))return i;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(e)||u(e))&&(n="string"),c(e,"default"===n?"number":n)}},function(e,t,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"object"==typeof e&&null!==e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object Date]"===o.call(e))}},function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(164)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";var r=n(27)("%Object%"),o=n(302);e.exports=function(e){return o(e),r(e)}},function(e,t,n){"use strict";var r=n(27),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i=n(638)();e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,n){"use strict";var r=n(639);e.exports=function(){return r()&&!!Symbol.toStringTag}},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t){e.exports=function(e){var t=!0,n=!0,r=!1;if("function"==typeof e){try{e.call("f",(function(e,n,r){"object"!=typeof r&&(t=!1)})),e.call([null],(function(){"use strict";n="string"==typeof this}),"x")}catch(e){r=!0}return!r&&t&&n}return!1}},function(e,t,n){"use strict";var r=n(49),o=n(307);e.exports=function(){var e=o();return r(Array.prototype,{forEach:e},{forEach:function(){return Array.prototype.forEach!==e}}),e}},function(e,t,n){"use strict";var r=n(49),o=n(94),i=n(308),a=n(310),u=n(644),c=o(a(),Object);r(c,{getPolyfill:a,implementation:i,shim:u}),e.exports=c},function(e,t,n){"use strict";var r=n(27)("%TypeError%");e.exports=function(e,t){if(null==e)throw new r(t||"Cannot call method on "+e);return e}},function(e,t,n){"use strict";var r=n(310),o=n(49);e.exports=function(){var e=r();return o(Object,{entries:e},{entries:function(){return Object.entries!==e}}),e}},function(e,t,n){"use strict";var r=n(94),o=n(49),i=n(311),a=n(312),u=n(647),c=r(a());o(c,{getPolyfill:a,implementation:i,shim:u}),e.exports=c},function(e,t,n){"use strict";var r=n(27),o=r("%String%"),i=r("%TypeError%");e.exports=function(e){if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a string");return o(e)}},function(e,t,n){"use strict";var r=n(49),o=n(312);e.exports=function(){var e=o();return r(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}},function(e,t,n){var r={"./en.json":649,"./fr.json":650};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=648},function(e){e.exports=JSON.parse('{"Scan":{"scan_a_doc":"Scan a doc","save_doc":"Save the doc","filename":"Filename","save":"Save","cancel":"Cancel","qualify":"Describe","apply":"Apply","error":{"offline":"You are currently offline and you can\'t use this functionality. Please, try again later.","uploading":"You are already uploading a file. Please wait until the end of this upload and try again.","generic":"Something went wrong. Please try again."},"successful":{"qualified_ok":"You just have successfully described your file! "},"items":{"identity":"Identity","family":"Family","work_study":"Work & Study","health":"Health","home":"Home","transport":"Transport","invoice":"Invoice","others":"Others","identity_photo":"Identity photo","national_id_card":"ID card","passport":"Passeport","residence_permit":"Residence permit","family_record_book":"Family record book","birth_certificate":"Birth certificate","citizen_registration_certificate":"Certificate of citizen registration","driver_license":"Driving license","other_identity_document":"Other document of identity","wedding":"Wedding contract","pacs":"Civil union","divorce":"Divorce","large_family_card":" Large Family Card","caf":"Social benefit rate","payment_proof_family_allowance":"family allowance payment proof","other_family_document":"Other family document","diploma":"Diploma","work_contract":"Work contract","pay_sheet":"Pay sheet","unemployment_benefit":"Unemployment benefit","pension":"Pension","other_revenue":"Other revenues","gradebook":"Gradebook","student_card":"Student card","school_attendance_certificate":"Certificate of school attendance","resume":"Resume","motivation_letter":"Motivation letter","other_work_document":"Other work document","health_book":"Health book","health_certificate":"Health/Vaccination certificate","disability_recognition":"Recognition of disability","pregnancy_medical_certificate":"Certificate of pregnancy","national_health_insurance_card":"National health insurance card","national_health_insurance_right_certificate":"National health insurance right certificate","health_insurance_card":"Insurance card","prescription":"Prescription","health_invoice":"Health invoice","other_health_document":"Other health document","vehicle_registration":"Vehicle registration","car_insurance":"Car insurance certificate","mechanic_invoice":"Repair bill","transport_invoice":"Transport invoice","other_transport_document":"Other transport document","phone_invoice":"Phone invoice","isp_invoice":"ISP invoice","telecom_invoice":"Telecom invoice","energy_invoice":"Energy invoice","water_invoice":"Water invoice","web_service_invoice":"Web service invoice","appliance_invoice":"Appliance invoice","restaurant_invoice":"Restaurant invoice","house_sale_agreeement":"House sale agreement","building_permit":"Building permit","technical_diagnostic_record":"Technical diagnostic record","lease":"Lease","house_insurance":"Home insurance","unfit_for_habitation_declaration":"Declaration of unfit for habitation","rent_receipt":"Rent receipt","accommodation_proof":"Proof of accommodation","work_quote":"Work quote","work_invoice":"Work invoice","other_house_document":"Other house document","tax_return":"Tax return","tax_notice":"Tax notice","tax_timetable":"Payment Plans Installment Agreements","receipt":"Receipt","other_tax_document":"Other tax document","bank_details":"IBAN","bank_statement":"Bank statement","loan_agreement":"Loan agreement","other_bank_document":"Other banking document","invoices":"Invoices","personal_sporting_licence":"Sporting licence","other_invoice":"Other invoice","other_activity_document":"Other sports document"},"themes":{"identity":"Identity","family":"Family","work_study":"Work & Study","health":"Health","home":"Home","transport":"Transport","invoice":"Invoice","others":"Others","undefined":"Undefined","finance":"Finance","activity":"Activities"}}}')},function(e){e.exports=JSON.parse('{"Scan":{"scan_a_doc":"Numériser un doc","save_doc":"Enregistrer le document","filename":"Nom du fichier","save":"Sauvegarder","cancel":"Annuler","qualify":"Qualifier","apply":"Appliquer","error":{"offline":"Vous êtes actuellement déconnecté, vous ne pouvez donc pas utiliser cette fonctionnalité. Connectez-vous à internet et recommencez. ","uploading":"Vous avez déjà un fichier en cours de téléchargement. Attendez la fin et recommencez.","generic":"Un problème est survenu. Veuillez réessayer. "},"successful":{"qualified_ok":"Vous venez de qualifier votre fichier avec succès !"},"items":{"identity":"Identité","family":"Famille","work_study":"Travail & Études","health":"Santé","home":"Logement","transport":"Transport","invoice":"Factures","others":"Autres","identity_photo":"Photo d\'identité","national_id_card":"Carte d\'identité","passport":"Passeport","residence_permit":"Titre de séjour","family_record_book":"Livret de famille","birth_certificate":"Certificat de naissance","citizen_registration_certificate":"Attestation de recensement citoyen","driver_license":"Permis","other_identity_document":"Autre document d\'identité","wedding":"Contrat de mariage","pacs":"Attestation de PACS","divorce":"Attestation de divorce","large_family_card":"Carte famille nombreuse","caf":"Attestation de quotient familial (CAF)","payment_proof_family_allowance":"Attestation de paiement CAF","other_family_document":"Autre document de famille","diploma":"Diplôme","work_contract":"Contrat de travail","pay_sheet":"Fiche de paie","unemployment_benefit":"Allocations chômage","pension":"Retraite","other_revenue":"Autres revenues","gradebook":"Bulletin de notes","student_card":"Carte d\'étudiant","school_attendance_certificate":"Certificat de scolarité","resume":"CV","motivation_letter":"Lettre de motivation","other_work_document":"Autre document de travail","health_book":"Carnet de santé","health_certificate":"Certificat de santé/vaccination","work_disability_recognition":"Reconnaissance de handicap - RQTH","pregnancy_medical_certificate":"Certificat de grossesse","national_health_insurance_card":"Carte vitale","national_health_insurance_right_certificate":"Attestation de droits de l\'Assurance Maladie (vitale)","health_insurance_card":"Carte de mutuelle","prescription":"Ordonnance","health_invoice":"Facture médicale","other_health_document":"Autre document de santé","vehicle_registration":"Carte grise","car_insurance":"Attestation d\'assurance auto","mechanic_invoice":"Facture de réparation","transport_invoice":"Facture de transport","other_transport_document":"Autre document de transport","phone_invoice":"Facture de téléphone","isp_invoice":"Facture d\'internet","telecom_invoice":"Facture de télécom","energy_invoice":"Facture d\'électricité","water_invoice":"Facture d\'eau","web_service_invoice":"Facture de service web","appliance_invoice":"Facture d\'électroménager","restaurant_invoice":"Facture de restaurant","house_sale_agreeement":"Compromis de vente","building_permit":"Permis de construire","technical_diagnostic_record":"Dossier de diagnostic technique","lease":"Bail","unfit_for_habitation_declaration":"Arrêté d\'insalubrité","house_insurance":"Assurance logement","rent_receipt":"Quittance de loyer","accommodation_proof":"Attestation d\'hébergement","work_quote":"Devis de travaux","work_invoice":"Facture de travaux","other_house_document":"Autre document de logement","tax_return":"Impôts - Déclaration de revenus","tax_notice":"Impôts - Avis d\'imposition","tax_timetable":"Impôts - Echéancier","receipt":"Accusé de réception","other_tax_document":"Impôts - Autre document","bank_details":"IBAN","bank_statement":"Relevé de compte","loan_agreement":"Contrat de prêt","other_bank_document":"Autre document bancaire","invoices":"Factures","personal_sporting_licence":"Licences sportives","other_invoice":"Autre facture","other_activity_document":"Autre document sportif"},"themes":{"identity":"Identité","family":"Famille","work_study":"Travail & Études","health":"Santé","home":"Logement","transport":"Transport","invoice":"Factures","others":"Autres","undefined":"Indéfini","finance":"Finances","activity":"Activités & loisirs"}}}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getThemeByItem=void 0;n(19);var r=n(313);t.getThemeByItem=function(e){var t=function(e){return r.themesList.find((function(t){return t.defaultItems&&t.defaultItems.includes(e.label)}))}(e);return t||r.themesList.find((function(t){return t.items.some((function(t){return t.label===e.label}))}))}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchTimeSeriesByIntervalAndSource=t.saveTimeSeries=void 0;var o=r(n(5)),i=r(n(8)),a=n(18),u=(n(19),function(e){if(!e.startDate||!e.endDate)throw new Error("You must specify a startDate and endDate for the time serie");if(!Date.parse(e.startDate)||!Date.parse(e.endDate))throw new Error("Invalid date format for the time serie");if(!e.dataType)throw new Error("You must specify a dataType for the time serie");if(!e.series||!Array.isArray(e.series))throw new Error("You must specify a series array for the time serie")}),c=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,a,c,s,l,f,p;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.dataType,i=n.series,a=n.startDate,c=n.endDate,s=n.source,l=n.theme,u({dataType:r,series:i,startDate:a,endDate:c,source:s}),f="io.cozy.timeseries.".concat(r),p={_type:f,startDate:a,endDate:c,source:s,theme:l,series:i},e.abrupt("return",t.save(p));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.saveTimeSeries=c;var s=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,u,c,s,l,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.startDate,i=n.endDate,u=n.dataType,c=n.source,s=n.limit,l="io.cozy.timeseries.".concat(u),f=(0,a.Q)(l).where({source:c,startDate:{$gte:r},endDate:{$lte:i}}).indexFields(["source","startDate","endDate"]).sortBy([{source:"desc"},{startDate:"desc"},{endDate:"desc"}]).limitBy(s||5),e.abrupt("return",t.query(f));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.fetchTimeSeriesByIntervalAndSource=s},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.createMockClient=void 0;var o=r(n(24)),i=r(n(2)),a=r(n(25)),u=r(n(41)),c=n(58),s=n(254),l=n(18);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var p=function(e,t,n){var r=n.definition,o=n.doctype,u=n.data,p=(0,a.default)(n,["definition","doctype","data"]);e.store.dispatch((0,c.initQuery)(t,r||(0,l.Q)(o))),e.store.dispatch((0,c.receiveQueryResult)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({data:u?u.map((function(e){return(0,s.normalizeDoc)(e,o)})):u},p)))};t.createMockClient=function(e){var t,n=e.queries,r=e.remote,i=e.clientOptions,a=new u.default(i||{});a.ensureStore();for(var c=0,s=Object.entries(n||{});c<s.length;c++){var l=(0,o.default)(s[c],2),f=l[0],d=l[1];p(a,f,d)}return a.query=jest.fn().mockImplementation((t=r,function(e){return t?t[e.doctype]?{data:t[e.doctype]}:{data:[]}:{data:null}})),a.save=jest.fn(),a.saveAll=jest.fn(),a.stackClient.fetchJSON=jest.fn(),a}},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useAppLinkWithStoreFallback",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"useCapabilities",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"useFetchShortcut",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"useClient",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"useQuery",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"useAppsInMaintenance",{enumerable:!0,get:function(){return s.default}});var o=r(n(655)),i=r(n(656)),a=r(n(657)),u=r(n(127)),c=r(n(298)),s=r(n(658))},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=n(18),s=n(300),l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(0,u.useState)("loading"),l=(0,a.default)(r,2),f=l[0],p=l[1],d=(0,u.useState)(!0),h=(0,a.default)(d,2),v=h[0],y=h[1],g=(0,u.useState)(null),m=(0,a.default)(g,2),b=m[0],w=m[1];return(0,u.useEffect)((function(){(function(){var r=(0,i.default)(o.default.mark((function r(){var i,a,u;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t.query((0,c.Q)("io.cozy.apps"));case 3:i=r.sent,a={slug:e},u=(0,s.isInstalled)(i.data,a),y(!!u),w(u?(0,s.getUrl)(u)+n:(0,s.getStoreURL)(i.data,a)),p("loaded"),r.next=14;break;case 11:r.prev=11,r.t0=r.catch(0),p("errored");case 14:case"end":return r.stop()}}),r,null,[[0,11]])})));return function(){return r.apply(this,arguments)}})()()}),[t,e,n]),{fetchStatus:f,isInstalled:v,url:b}};t.default=l},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=n(18),s=function(e){var t=(0,u.useState)(),n=(0,a.default)(t,2),r=n[0],s=n[1],l=(0,u.useState)("idle"),f=(0,a.default)(l,2),p=f[0],d=f[1];return(0,u.useEffect)((function(){(function(){var t=(0,i.default)(o.default.mark((function t(){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d("loading"),t.prev=1,t.next=4,e.query((0,c.Q)("io.cozy.settings").getById("capabilities"));case 4:n=t.sent,s(n),d("loaded"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),d("failed");case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(){return t.apply(this,arguments)}})()()}),[e]),{capabilities:r,fetchStatus:p}};t.default=s},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=function(e,t){var n=(0,u.useState)(null),r=(0,a.default)(n,2),c=r[0],s=r[1],l=(0,u.useState)(null),f=(0,a.default)(l,2),p=f[0],d=f[1],h=(0,u.useState)("idle"),v=(0,a.default)(h,2),y=v[0],g=v[1];return(0,u.useEffect)((function(){(function(){var n=(0,i.default)(o.default.mark((function n(){var r,i,a;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return g("loading"),n.prev=1,n.next=4,e.getStackClient().fetchJSON("GET","/shortcuts/".concat(t));case 4:r=n.sent,i=new URL(r.data.attributes.url),a="".concat(e.getStackClient().uri,"/bitwarden/icons/").concat(i.host,"/icon.png"),d(a),s(r),g("loaded"),n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),g("failed");case 15:case"end":return n.stop()}}),n,null,[[1,12]])})));return function(){return n.apply(this,arguments)}})()()}),[e,t]),{shortcutInfos:c,shortcutImg:p,fetchStatus:y}};t.default=c},function(e,t,n){"use strict";var r=n(3);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(5)),i=r(n(8)),a=r(n(24)),u=n(0),c=r(n(172)),s=(r(n(41)),n(19),function(e){var t=(0,u.useState)([]),n=(0,a.default)(t,2),r=n[0],s=n[1];return(0,u.useEffect)((function(){(function(){var t=(0,i.default)(o.default.mark((function t(){var n,r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new c.default({client:e}),t.next=3,n.fetchAppsInMaintenance();case 3:r=t.sent,s(r||[]);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}})()()}),[e]),r});t.default=s},function(e,t,n){var r=n(34),o=n(660),i=n(264),a=Math.max,u=Math.min;e.exports=function(e,t,n){var c,s,l,f,p,d,h=0,v=!1,y=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=c,r=s;return c=s=void 0,h=t,f=e.apply(r,n)}function b(e){return h=e,p=setTimeout(k,t),v?m(e):f}function w(e){var n=e-d;return void 0===d||n>=t||n<0||y&&e-h>=l}function k(){var e=o();if(w(e))return x(e);p=setTimeout(k,function(e){var n=t-(e-d);return y?u(n,l-(e-h)):n}(e))}function x(e){return p=void 0,g&&c?m(e):(c=s=void 0,f)}function _(){var e=o(),n=w(e);if(c=arguments,s=this,d=e,n){if(void 0===p)return b(d);if(y)return clearTimeout(p),p=setTimeout(k,t),m(d)}return void 0===p&&(p=setTimeout(k,t)),f}return t=i(t)||0,r(n)&&(v=!!n.leading,l=(y="maxWait"in n)?a(i(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),_.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=d=s=p=void 0},_.flush=function(){return void 0===p?f:x(o())},_}},function(e,t,n){var r=n(38);e.exports=function(){return r.Date.now()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=f(i),u=f(n(1)),c=f(n(662)),s=f(n(663)),l=n(671);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return h.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,c.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,o=n.onSuggestionHighlighted,i=n.highlightFirstSuggestion;if(!(0,c.default)(r,e.suggestions)&&r.length>0&&i)this.highlightFirstSuggestion();else if(o){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&o({suggestion:a})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(o){var i=o.valueBeforeUpDown;return null===t?i=null:null===i&&void 0!==n&&(i=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:i}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,o=t.renderInputComponent,i=t.onSuggestionsFetchRequested,u=t.renderSuggestion,c=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,h=t.id,v=t.getSectionSuggestions,y=t.theme,g=t.getSuggestionValue,m=t.alwaysRenderSuggestions,b=t.highlightFirstSuggestion,w=this.state,k=w.isFocused,x=w.isCollapsed,_=w.highlightedSectionIndex,O=w.highlightedSuggestionIndex,S=w.valueBeforeUpDown,E=m?p:this.props.shouldRenderSuggestions,j=c.value,P=c.onFocus,C=c.onKeyDown,T=this.willRenderSuggestions(this.props),A=m||k&&!x&&T,D=A?n:[],R=r({},c,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=E(j);e.setState({isFocused:!0,isCollapsed:!n}),P&&P(t),n&&i({value:j,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,o=E(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},b?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!o})),o?i({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var o=t.keyCode;switch(o){case 40:case 38:if(x)E(j)&&(i({value:j,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,u=r.newHighlightedItemIndex,c=void 0;c=null===u?null===S?j:S:e.getSuggestionValueByIndex(a,u),e.updateHighlightedSuggestion(a,u,j),e.maybeCallOnChange(t,c,40===o?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var s=e.getHighlightedSuggestion();if(A&&!m&&e.closeSuggestions(),null!=s){var l=g(s);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:l,suggestionIndex:O,sectionIndex:_,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:A&&t.preventDefault();var f=A&&!m;if(null===S){if(!f){e.maybeCallOnChange(t,"","escape"),E("")?i({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,S,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}C&&C(t)}}),I={query:this.getQuery()};return a.default.createElement(s.default,{multiSection:f,items:D,renderInputComponent:o,renderItemsContainer:this.renderSuggestionsContainer,renderItem:u,renderItemData:I,renderSectionTitle:d,getSectionItems:v,highlightedSectionIndex:_,highlightedItemIndex:O,inputProps:R,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:h,ref:this.storeAutowhateverRef})}}]),t}(i.Component);d.propTypes={suggestions:u.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:u.default.func,onSuggestionHighlighted:u.default.func,renderInputComponent:u.default.func,renderSuggestionsContainer:u.default.func,getSuggestionValue:u.default.func.isRequired,renderSuggestion:u.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:u.default.func,alwaysRenderSuggestions:u.default.bool,multiSection:u.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:u.default.bool,highlightFirstSuggestion:u.default.bool,theme:u.default.object,id:u.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return a.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var h=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;i&&i(t,n),o?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=i.sectionIndex,u=i.suggestionIndex,c=e.getSuggestion(a,u),s=e.props.getSuggestionValue(c);e.maybeCallOnChange(t,s,"click"),e.onSuggestionSelected(t,{suggestion:c,suggestionValue:s,suggestionIndex:u,sectionIndex:a,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,a=e.getHighlightedSuggestion(),u=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!u}),i&&i(e.blurEvent,{highlightedSuggestion:a})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(664).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),u=d(a),c=d(n(1)),s=d(n(665)),l=d(n(666)),f=d(n(668)),p=d(n(669));function d(e){return e&&e.__esModule?e:{default:e}}var h={},v=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,i=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var u="ArrowDown"===e.key?"next":"prev",c=n.sectionIterator[u]([i,a]),s=o(c,2),l=s[0],f=s[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:i,highlightedItemIndex:a})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,s.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,a=n.renderItemData,c=n.renderSectionTitle,s=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return o.map((function(n,o){var h="react-autowhatever-"+r+"-",v=h+"section-"+o+"-",y=0===o;return u.default.createElement("div",t(v+"container","sectionContainer",y&&"sectionContainerFirst"),u.default.createElement(f.default,{section:n,renderSectionTitle:c,theme:t,sectionKeyPrefix:v}),u.default.createElement(p.default,{items:e.sectionsItems[o],itemProps:d,renderItem:i,renderItemData:a,sectionIndex:o,highlightedItemIndex:s===o?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:h,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,a=n.highlightedSectionIndex,c=n.highlightedItemIndex,s=n.itemProps;return u.default.createElement(p.default,{items:e,itemProps:s,renderItem:o,renderItemData:i,highlightedItemIndex:null===a?c:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,o=t.multiSection,i=t.renderInputComponent,a=t.renderItemsContainer,c=t.highlightedSectionIndex,s=t.highlightedItemIndex,l=this.state.isInputFocused,f=o?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(c,s),h="react-autowhatever-"+n,v=r({role:"combobox","aria-haspopup":"listbox","aria-owns":h,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=i(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":h,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),g=a({containerProps:r({id:h,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return u.default.createElement("div",v,y,g)}}]),t}(a.Component);v.propTypes={id:c.default.string,multiSection:c.default.bool,renderInputComponent:c.default.func,renderItemsContainer:c.default.func,items:c.default.array.isRequired,renderItem:c.default.func,renderItemData:c.default.object,renderSectionTitle:c.default.func,getSectionItems:c.default.func,containerProps:c.default.object,inputProps:c.default.object,itemProps:c.default.oneOfType([c.default.object,c.default.func]),highlightedSectionIndex:c.default.number,highlightedItemIndex:c.default.number,theme:c.default.oneOfType([c.default.object,c.default.array])},v.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return u.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return u.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:h,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:h,inputProps:h,itemProps:h,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=v},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function o(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||a===t[i]-1?null===(i=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(i))?[null,null]:[i,0]:[i,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:o,prev:function(e){var o=r(e,2),i=o[0],a=o[1];return n?null===a||0===a?null===(i=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(i))?[null,null]:[i,t[i]-1]:[i,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-1]},isLast:function(e){return null===o(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i,a=n(667),u=(i=a)&&i.__esModule?i:{default:i},c=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),i=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var s=n.map((function(e){return i[e]})).filter(c);return"string"==typeof s[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,o(s)):s.join(" ")}:{key:e,style:u.default.apply(void 0,[{}].concat(o(s)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function i(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,a=o(e),u=1;u<arguments.length;u++){n=arguments[u],r=i(Object(n));for(var c=0;c<r.length;c++)a[r[c]]=n[r[c]]}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=c(o),a=c(n(1)),u=c(n(190));function c(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return s(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,a=n(t);return a?i.default.createElement("div",r(o+"title","sectionTitle"),a):null}}]),t}(o.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=l(i),u=l(n(1)),c=l(n(670)),s=l(n(190));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,o=t.itemProps,i=t.renderItem,u=t.renderItemData,s=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,h=null===s?d:d+"section-"+s+"-",v="function"==typeof o;return a.default.createElement("ul",r({role:"listbox"},p(h+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,g=h+"item-"+n,m=v?o({sectionIndex:s,itemIndex:n}):o,b=r({id:f(s,n),"aria-selected":y},p(g,"item",d&&"itemFirst",y&&"itemHighlighted"),m);return y&&(b.ref=e.storeHighlightedItemReference),a.default.createElement(c.default,r({},b,{sectionIndex:s,isHighlighted:y,itemIndex:n,item:t,renderItem:i,renderItemData:u}))})))}}]),t}(i.Component);d.propTypes={items:u.default.array.isRequired,itemProps:u.default.oneOfType([u.default.object,u.default.func]),renderItem:u.default.func.isRequired,renderItemData:u.default.object.isRequired,sectionIndex:u.default.number,highlightedItemIndex:u.default.number,onHighlightedItemChange:u.default.func.isRequired,getItemId:u.default.func.isRequired,theme:u.default.func.isRequired,keyPrefix:u.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=s(i),u=s(n(1)),c=s(n(190));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:o})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,o=e.renderItem,i=e.renderItemData,u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete u.sectionIndex,delete u.itemIndex,"function"==typeof u.onMouseEnter&&(u.onMouseEnter=this.onMouseEnter),"function"==typeof u.onMouseLeave&&(u.onMouseLeave=this.onMouseLeave),"function"==typeof u.onMouseDown&&(u.onMouseDown=this.onMouseDown),"function"==typeof u.onClick&&(u.onClick=this.onClick),a.default.createElement("li",r({role:"option"},u,{ref:this.storeItemReference}),o(n,r({isHighlighted:t},i)))}}]),t}(i.Component);p.propTypes={sectionIndex:u.default.number,isHighlighted:u.default.bool.isRequired,itemIndex:u.default.number.isRequired,item:u.default.any.isRequired,renderItem:u.default.func.isRequired,renderItemData:u.default.object.isRequired,onMouseEnter:u.default.func,onMouseLeave:u.default.func,onMouseDown:u.default.func,onClick:u.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";(function(t){var r=n(673),o=n(674),i={_isShim:!0,track:function(){},push:function(e){},setUserId:function(e){},trackError:function(e){},connectToHistory:function(e,t){return e},disconnectFromHistory:function(){}},a=null,u=null;"undefined"==typeof window?e.exports=function(){return i}:e.exports=function(e){var n=function(){return t&&Object({USE_REACT:!0})?"production".toLowerCase():"development"},c=function(){if(void 0===window._paq||"function"!=typeof window._paq.push)return!1;var e=!1,t=!1;if(void 0===window._paq.length)return!0;for(var n=0,r=window._paq.length;n<r;n++)if(~window._paq[n].indexOf("setSiteId")&&(e=!0),~window._paq[n].indexOf("setTrackerUrl")&&(t=!0),t&&e)return!0;return!1};(e=e||{}).trackErrors=void 0!==e.trackErrors&&e.trackErrors,e.trackErrorHandler=void 0!==e.trackErrorHandler?e.trackErrorHandler:function(e,t){d(["trackEvent",t=t||"JavaScript Error",e.message,e.filename+": "+e.lineno])},e.enableLinkTracking=void 0===e.enableLinkTracking||e.enableLinkTracking,e.updateDocumentTitle=void 0===e.updateDocumentTitle||e.updateDocumentTitle,e.ignoreInitialVisit=void 0!==e.ignoreInitialVisit&&e.ignoreInitialVisit,e.injectScript=void 0===e.injectScript||e.injectScript,e.clientTrackerName=void 0!==e.clientTrackerName?e.clientTrackerName:"piwik.js",e.serverTrackerName=void 0!==e.serverTrackerName?e.serverTrackerName:"piwik.php";var s=c();window._paq=window._paq||[];var l=!(e.url&&e.siteId||s),f=!e.injectScript&&!s;if(l||f)return"test"!==n()&&r(null,"PiwikTracker cannot be initialized! You haven't passed a url and siteId to it."),i;var p=function(t){var n;n=t.path?t.path:t.basename?o(t.basename,t.pathname,t.search):o(t.pathname,t.search),a!==n&&(e.updateDocumentTitle&&d(["setDocumentTitle",document.title]),d(["setCustomUrl",n]),d(["trackPageView"]),a=n)},d=function(e){window._paq.push(e)},h=function(e){window._paq.push(["setUserId",e])};return e.trackErrors&&(window.addEventListener?window.addEventListener("error",e.trackErrorHandler,!1):window.attachEvent?window.attachEvent("onerror",e.trackErrorHandler):window.onerror=e.trackErrorHandler),function(){var t,n=c();if(!n){var r=-1!==(t=e.url).indexOf("http://")||-1!==t.indexOf("https://")?t+"/":"https:"==document.location.protocol?"https://"+t+"/":"http://"+t+"/";d(["setSiteId",e.siteId]),d(["setTrackerUrl",r+e.serverTrackerName])}if(e.userId&&h(e.userId),e.enableLinkTracking&&d(["enableLinkTracking"]),e.injectScript&&!n){var o=document,i=o.createElement("script"),a=o.getElementsByTagName("script")[0];i.type="text/javascript",i.defer=!0,i.async=!0,i.src=r+e.clientTrackerName,a.parentNode.insertBefore(i,a)}}(),{_isShim:!1,track:p,push:d,setUserId:h,trackError:e.trackErrorHandler,connectToHistory:function(t,o){o="function"==typeof o?o:function(e){return e};var i=function(e,t){var o=e(t);void 0!==o?p(o):"development"===n()&&r(null,"The modifier given to .connectToHistory did not return any object. Please make sure to return the modified location object in your modifier.")};return u=t.listen((function(e){i(o,e)})),!e.ignoreInitialVisit&&t.location&&i(o,t.location),t},disconnectFromHistory:function(){return!!u&&(u(),!0)}}}}).call(this,n(248))},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){var r,o,i;i=function(){function e(e,t){return e=(e=(e=(e=e.replace(/:\//g,"://")).replace(/([^:\s])\/+/g,"$1/")).replace(/\/(\?|&|#[^!])/g,"$1")).replace(/(\?.+)\?/g,"$1&")}return function(){var t=arguments;"object"==typeof arguments[0]&&(t=arguments[0]);var n=[].slice.call(t,0).join("/");return e(n)}},e.exports?e.exports=i():void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){var r={"./de":314,"./de.json":314,"./en":315,"./en.json":315,"./es":316,"./es.json":316,"./fr":317,"./fr.json":317,"./it":318,"./it.json":318,"./ja":319,"./ja.json":319,"./nl_NL":320,"./nl_NL.json":320,"./pl":321,"./pl.json":321,"./ru":322,"./ru.json":322,"./sq":323,"./sq.json":323,"./zh_CN":324,"./zh_CN.json":324};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=675},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t=(0,i.default)(e);return{getItem:function(e){return new Promise((function(n,r){n(t.getItem(e))}))},setItem:function(e,n){return new Promise((function(r,o){r(t.setItem(e,n))}))},removeItem:function(e){return new Promise((function(n,r){n(t.removeItem(e))}))}}};var r,o=n(677),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(){}t.default=function(e){var t=e+"Storage";return function(e){if("object"!==("undefined"==typeof self?"undefined":r(self))||!(e in self))return!1;try{var t=self[e],n="redux-persist "+e+" test";t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch(e){return!1}return!0}(t)?self[t]:i};var i={getItem:o,setItem:o,removeItem:o}},function(e,t,n){"use strict";n.r(t);var r=n(13),o=n.n(r),i=n(4),a=n.n(i),u=n(7),c=n.n(u),s=n(11),l=n.n(s),f=n(9),p=n.n(f),d=n(10),h=n.n(d),v=n(6),y=n.n(v),g=n(2),m=n.n(g),b=n(0),w=n.n(b),k=n(37),x=n(20),_=n(26),O=n.n(_),S=n(25),E=n.n(S),j=n(1),P=n.n(j),C=n(195),T=n.n(C),A=n(14),D=n.n(A);function R(e){var t=e.icon,n=e.width,r=e.height,o=e.color,i=e.className,a=e.preserveColor,u=e.rotate,c=e.size,s=e.spin,l=E()(e,["icon","width","height","color","className","preserveColor","rotate","size","spin"]),f=Object(b.useMemo)((function(){return t instanceof Function?t:function(e){var t;return(t=e.id?"#".concat(e.id):"#"===e[0]?e:"#"+e)?function(e){return w.a.createElement("svg",e,w.a.createElement("use",{xlinkHref:t}))}:(console.warn("Icon not found ".concat(e,".")),null)}(t)}),[t]),p=e.style;p=Object.assign({},p),o&&(p.fill=o),u&&(p.transform="rotate(".concat(u,"deg)"));var d=a?"icon--preserveColor":"icon",h=D()(i,T.a[d],m()({},T.a["icon--spin"],s));return f?w.a.createElement(f,O()({className:h,style:p,width:n||c||"16",height:r||c||"16"},l)):null}R.isProperIcon=function(e){return e&&!!e.id||"string"==typeof e};var I=P.a.oneOfType([P.a.string,P.a.object,P.a.func]);R.propTypes={icon:I.isRequired,width:P.a.oneOfType([P.a.string,P.a.number]),height:P.a.oneOfType([P.a.string,P.a.number]),color:P.a.oneOfType([P.a.string,P.a.object]),className:P.a.string,preserveColor:P.a.bool,size:P.a.oneOfType([P.a.string,P.a.number]),spin:P.a.bool},R.defaultProps={spin:!1};var N=R,z=n(128),M=null,F=n.n(z)()((function(){var e=document.querySelector("[role=application]");if(e&&e.dataset){var t=e.dataset.cozyTracking;if(""===t||"true"===t)return!0;if("false"===t)return!1}})),L=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!F())return null;if(null!==M)return M;try{!1===o&&Piwik.getTracker();var i=n(672);return M=i({url:e||"https://matomo.cozycloud.cc",siteId:t||8,injectScript:o}),r&&U(),M}catch(e){return console.warn(e),M=null,null}},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!==M){var t,n,r=document.querySelector("[role=application]");if(r&&r.dataset){n=r.dataset.cozyAppName;var o=(t=r.dataset.cozyDomain||"").indexOf(":");o>=0&&(t=t.substring(0,o))}e=Object.assign({userId:t,appDimensionId:1,app:n,heartbeat:15},e),parseInt(e.heartbeat)>0&&M.push(["enableHeartBeatTimer",parseInt(e.heartbeat)]),M.push(["setUserId",e.userId]),M.push(["setCustomDimension",e.appDimensionId,e.app])}},B=n(23),q=n(5),H=n.n(q),W=n(8),Q=n.n(W),$=n(29),G=n(76),V=n.n(G),J=n(74),Y=n.n(J),K={},X=function(){var e=Q()(H.a.mark((function e(t,n,r){var o;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Cannot fetch icon: missing domain");case 2:if(o=Z(t,n,r)){e.next=5;break}throw new Error("Cannot get icon source for app ".concat(t.name));case 5:return e.abrupt("return",new Promise((function(e,t){var n=document.createElement("img");n.onload=function(){K[o]=!0,e(o)},n.onerror=function(){var e=new Error("Error while preloading ".concat(o));console.error(e.message),t(e)},n.src=o})));case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Z=function(e,t,n){if(!t)return null;var r=ee(e);return(r=r||te(e))?"".concat(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return"http".concat(e?"s":"",":")}(n),"//").concat(t).concat(r):null},ee=function(e){return e.links&&e.links.icon},te=function(e){return"string"==typeof e?"/registry/".concat(e,"/icon"):e.latest_version&&e.latest_version.version&&"/registry/".concat(e.slug,"/").concat(e.latest_version.version,"/icon")},ne=P.a.shape({name:P.a.string,slug:P.a.string,developer:P.a.object,links:P.a.shape({icon:P.a.string}),latest_version:P.a.shape({version:P.a.string})});P.a.shape({_id:P.a.string,class:P.a.string,mime:P.a.string,name:P.a.string});function re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var oe=function(e){p()(r,e);var t,n=re(r);function r(e,t){var o;a()(this,r),(o=n.call(this,e,t)).isUnmounting=!1,o.handleError=o.handleError.bind(l()(o));try{var i=e.app,u=e.client,c=new URL(u.getStackClient().uri);o.domain=c.host,o.secure="https:"===c.protocol;var s=function(e,t,n){var r=Z(e,t,n);return r&&K[r]?r:null}(i,o.domain,o.secure);o.state={error:null,icon:s,status:s?"done":"fetching"}}catch(e){o.state={error:e,status:"errored"}}return o}return c()(r,[{key:"componentWillUnmount",value:function(){this.isUnmounting=!0}},{key:"componentDidMount",value:function(){this.isUnmounting=!1,this.load()}},{key:"componentDidUpdate",value:function(e){this.props.fetchIcon!==e.fetchIcon&&this.load()}},{key:"load",value:(t=Q()(H.a.mark((function e(){var t,n,r,o,i,a,u;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.app,r=t.fetchIcon,o=t.onReady,i=r||X,e.prev=2,e.next=5,i(n,this.domain,this.secure);case 5:a=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),u=e.t0;case 11:this.isUnmounting||(this.setState({error:u,icon:a,status:u?"errored":"done"}),"function"==typeof o&&o());case 12:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(){return t.apply(this,arguments)})},{key:"handleError",value:function(){this.setState({status:"errored"})}},{key:"render",value:function(){var e=this.props,t=e.alt,n=e.className,r=e.fallbackIcon,o=this.state,i=o.icon;switch(o.status){case"fetching":return w.a.createElement("div",{className:D()(V.a["c-loading-placeholder"],V.a["c-app-icon"],n)});case"done":return w.a.createElement("img",{alt:t,className:D()(V.a["c-app-icon"],n),src:i,onError:this.handleError});case"errored":default:return w.a.createElement(N,{className:D()(V.a["c-app-icon"],V.a["c-app-icon-default"],n),height:"100%",icon:r||"cube",width:"100%",color:Y.a.coolGrey})}}}]),r}(b.Component);oe.propTypes={alt:P.a.string,app:P.a.oneOfType([ne,P.a.string]),fallbackIcon:I,fetchIcon:P.a.func,client:P.a.object.isRequired,className:P.a.string,onReady:P.a.func};var ie=Object($.withClient)(oe),ae=n(21),ue=n(43),ce=n.n(ue),se=n(44),le=n.n(se),fe=new ce.a({id:"icon-cozy-home",use:"icon-cozy-home-usage",viewBox:"0 0 32 32",content:'<symbol viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="icon-cozy-home">\n <defs></defs>\n <g id="icon-cozy-home_📦-components" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="icon-cozy-home_components/header/2_1" transform="translate(-16.000000, -12.000000)">\n <g id="icon-cozy-home_icon-cozy-home" transform="translate(16.000000, 12.000000)">\n <g id="icon-cozy-home_logo">\n <g id="icon-cozy-home_logo/cozypastille">\n <circle id="icon-cozy-home_Oval" fill="#297EF2" fill-rule="nonzero" cx="16" cy="16" r="16" />\n <path d="M19.31364,17.56136 C19.15384,17.81024 18.79956,17.88504 18.55544,17.72184 C18.53436,17.70892 18.51396,17.69464 18.49492,17.68036 C17.78296,18.23864 16.90644,18.54328 15.99524,18.54328 C15.08608,18.54328 14.2116,18.24 13.501,17.68376 C13.48264,17.69668 13.46428,17.71028 13.44524,17.72184 C13.19364,17.88572 12.8448,17.80752 12.68636,17.5634 C12.52588,17.31588 12.59592,16.98064 12.84208,16.8154 C13.0556,16.67464 13.07056,16.3938 13.07056,16.39108 C13.076,16.2442 13.13992,16.10412 13.24668,16.00552 C13.35276,15.90692 13.48604,15.8498 13.63292,15.86136 C13.92736,15.86816 14.16672,16.11568 14.16128,16.41352 C14.16128,16.4176 14.1606,16.56652 14.10688,16.77324 C15.20508,17.68512 16.79696,17.68172 17.89108,16.76576 C17.85096,16.60732 17.84076,16.48084 17.83804,16.42236 C17.83532,16.26936 17.88972,16.13064 17.9924,16.02524 C18.09304,15.92188 18.22904,15.8634 18.37388,15.86068 L18.3834,15.86068 C18.67784,15.86068 18.92196,16.098 18.92876,16.39312 C18.92876,16.39312 18.9444,16.67532 19.15588,16.81472 C19.4034,16.97792 19.47412,17.3118 19.31364,17.56136 M21.63584,11.19248 C21.47876,9.86376 20.89056,8.63568 19.94604,7.6864 C18.8628,6.59772 17.4314,6 15.91636,6 C14.40132,6 12.9706,6.59772 11.88736,7.68708 C10.93876,8.63976 10.3492,9.87464 10.19552,11.21084 C8.89468,11.3686 7.69176,11.97448 6.76288,12.94756 C5.70344,14.05936 5.12,15.52884 5.12,17.08468 C5.12,20.34664 7.704,23 10.88164,23 L21.11768,23 C24.29396,23 26.88,20.34664 26.88,17.08468 C26.88,14.00224 24.57072,11.46244 21.63584,11.19248" id="icon-cozy-home_Fill-1" fill="#FFFFFF" fill-rule="evenodd" />\n </g>\n </g>\n </g>\n </g>\n </g>\n</symbol>'}),pe=(le.a.add(fe),fe);function de(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var he=function(e){p()(n,e);var t=de(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props.className;return w.a.createElement(ie,{fetchIcon:function(){return"".concat(ae.b.get.cozyURL(),"/assets/images/icon-cozy-home.svg")},fallbackIcon:pe,className:e})}}]),n}(b.PureComponent),ve=function(e){var t=e.webviewContext,n=e.homeHref;return t?w.a.createElement("button",{onClick:function(){t.call("backToHome")},className:"coz-nav-apps-btns-home --flagship"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"})):n?w.a.createElement("a",{href:n,className:"coz-nav-apps-btns-home"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"})):w.a.createElement("span",{className:"coz-nav-apps-btns-home"},w.a.createElement(he,{className:"coz-nav-apps-btns-home-svg"}))},ye=n(50),ge=n.n(ye),me=function(e){var t,n=e.className,r=e.extension,o=e.size,i=e.theme,a=e.variant,u=e.round,c=e.align;return D()(ge.a["c-btn"],(t={},m()(t,ge.a["c-btn--".concat(i)],i),m()(t,ge.a["c-btn--".concat(o)],"normal"!==o),m()(t,ge.a["c-btn--".concat(a)],a),m()(t,ge.a["c-btn--".concat(r)],r),m()(t,ge.a["c-btn--".concat(c)],c),m()(t,ge.a["c-btn--round"],u),t),n)},be=function(e){return function(t){var n=t.busy,r=t.disabled,o=E()(t,["busy","disabled"]);return n&&(o["aria-busy"]=!0),r&&(o["aria-disabled"]=!0),"button"===e&&r&&(o.disabled=!0),o}},we={button:be("button"),a:be("a")},ke=function(e){return e},xe={tiny:8,small:12,large:18},_e=function(e){var t=e.children,n=e.icon,r=e.iconOnly,o=e.label,i=e.subtle,a=e.className,u=e.extension,c=e.round,s=e.size,l=e.theme,f=e.align,p=e.extraRight,d=e.tag,h=E()(e,["children","icon","iconOnly","label","subtle","className","extension","round","size","theme","align","extraRight","tag"]),v=we[d]||ke,y=r?o:null,g=r?"u-visuallyhidden":null;return w.a.createElement(d,O()({},v(h),{className:me({extension:u,align:f,round:c,size:s,theme:l,className:a,variant:i&&"subtle"}),title:y}),w.a.createElement("span",null,N.isProperIcon(n)?w.a.createElement(N,{size:xe[s],icon:n,"aria-hidden":!0,focusable:"false"}):n,o&&w.a.createElement("span",{className:g},o),t,p&&w.a.createElement("span",{className:"u-ml-auto"},p),h.busy&&w.a.createElement(N,{size:xe[s],icon:"spinner",spin:!0,className:"u-ml-half","aria-hidden":!0,focusable:"false"})))},Oe=function(e){return w.a.createElement(_e,e)},Se=function(e){return w.a.createElement(_e,e)};function Ee(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}Oe.propTypes={children:P.a.node,label:P.a.node.isRequired,icon:P.a.oneOfType([P.a.node,I]),iconOnly:P.a.bool,theme:P.a.string,size:P.a.oneOf(["tiny","small","large","normal"]),extension:P.a.oneOf(["narrow","full"]),align:P.a.oneOf(["left","right","center"]),round:P.a.bool,className:P.a.string,onClick:P.a.func,extraRight:P.a.PropTypes.node,busy:P.a.bool,disabled:P.a.bool,type:P.a.oneOf(["button","reset","submit"]),subtle:P.a.bool},Oe.defaultProps={type:"submit",tag:"button",size:"normal",align:"center"},Se.defaultProps={tag:"a"};var je=function(e){p()(n,e);var t=Ee(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).state={unmounted:!0},r.animate=r.animate.bind(l()(r)),r}return c()(n,[{key:"animate",value:function(){var e=this;return setTimeout((function(){e.setState((function(){return{unmounted:!1}}))}),100)}},{key:"componentDidMount",value:function(){this.animate()}},{key:"render",value:function(){var e=this.props,t=e.t,n=e.code,r=e.links,o=this.state.unmounted;return w.a.createElement("div",{className:"coz-bar-banner".concat(o?" unmounted":"")},w.a.createElement("p",null,t("banner.".concat(n,".description"))),w.a.createElement(Se,{className:"coz-bar-banner-button",size:"tiny",href:r,label:t("banner.".concat(n,".CTA"))}))}}]),n}(b.Component),Pe=Object(x.translate)()(je),Ce=n(132),Te=n.n(Ce),Ae=n(334),De=n.n(Ae),Re=n(24),Ie=n.n(Re),Ne=n(72),ze=n.n(Ne),Me=function(e){var t=window.innerWidth;return ze()(e,(function(e){var n=Ie()(e,2),r=n[0],o=n[1];return t>=r&&(void 0===o||t<=o)}))},Fe={isExtraLarge:[1201],isLarge:[1024,1200],isMedium:[769,1023],isSmall:[544,768],isTiny:[0,543],isDesktop:[1024],isTablet:[769,1023],isMobile:[0,768]};function Le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}P.a.shape(Object.keys(Fe).reduce((function(e,t){return e[t]=P.a.bool.isRequired,e}),{}));var Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fe;return function(t){var n=function(n){p()(o,n);var r=Le(o);function o(t){var n;return a()(this,o),(n=r.call(this,t)).state={breakpoints:Me(e)},n.checkBreakpoints=De()((function(){n.setState({breakpoints:Me(e)})}),100,{trailing:!0}),n}return c()(o,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.checkBreakpoints)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.checkBreakpoints)}},{key:"render",value:function(){var e=this.props,n=this.state.breakpoints;return w.a.createElement(t,O()({},e,{breakpoints:n}))}}]),o}(b.Component);return n.displayName="withBreakpoints(".concat(t.displayName||t.name,")"),n}},Be=n(12),qe=n(16),He=n.n(qe),We=P.a.shape({slug:P.a.string.isRequired,name:P.a.string.isRequired,namePrefix:P.a.string,comingSoon:P.a.bool,href:P.a.string,links:P.a.shape({icon:P.a.string.isRequired})}),Qe={drive:{appId:"io.cozy.drive.mobile",uri:"cozydrive://",name:"Cozy Drive"},banks:{appId:Object(B.isAndroidApp)()?"io.cozy.banks.mobile":"io.cozy.banks",uri:"cozybanks://",name:"Cozy Banks"}},$e=function(e){return e?e.startsWith("/")?e:"/"+e:"/"},Ge=function(e){var t=e.slug,n=e.cozyUrl,r=e.subDomainType,o=e.fallbackUrl,i=e.nativePath;if(i=$e(i),!n&&!o)throw new Error("Must have either cozyUrl or fallbackUrl to generate universal link.");n&&!o&&(o=function(e){var t=e.cozyUrl,n=e.nativePath,r=e.slug,o=e.subDomainType;n=$e(n);var i=new URL(t);return i.host="nested"===o?"".concat(r,".").concat(i.host):i.host.split(".").map((function(e,t){return 0===t?e+"-"+r:e})).join("."),i.hash=n,i.toString()}({cozyUrl:n,nativePath:i,slug:t,subDomainType:r}));var a=new URL("https://links.mycozy.cloud/"+t+i);return a.searchParams.append("fallback",o),a.toString()};function Ve(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Je,Ye,Ke,Xe,Ze=(Je=function(e){return Object(B.checkApp)(e).catch((function(){return!1}))},Ye=1e4,Ke=function(e){return e.appId},Xe={},function(e){var t=Ke(e),n=Xe[t];return n&&n.result&&n.date-Date.now()<Ye||(Xe[t]={result:Je(e),date:Date.now()}),Xe[t].result}),et=function(e){p()(r,e);var t,n=Ve(r);function r(e){var t;return a()(this,r),t=n.call(this,e),m()(l()(t),"state",{nativeAppIsAvailable:null,isFetchingAppInfo:!1}),t}return c()(r,[{key:"componentDidMount",value:function(){Object(B.isMobileApp)()&&this.checkAppAvailability()}},{key:"checkAppAvailability",value:(t=Q()(H.a.mark((function e(){var t,n,r;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.slug,!(n=Qe[t])){e.next=9;break}return e.t0=Boolean,e.next=6,Ze(n);case 6:e.t1=e.sent,r=(0,e.t0)(e.t1),this.setState({nativeAppIsAvailable:r});case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this.props,t=e.children,n=e.slug,i=this.state.nativeAppIsAvailable,a=Qe[n],u=r.getOnClickHref(this.props,i),c=u.href,s=u.onClick;return t(o()({},a,{onClick:s,href:c}))}}],[{key:"getOnClickHref",value:function(e,t){var n=e.slug,o=e.nativePath,i=e.href,a=null,u=Object(B.isMobileApp)(),c=Qe[n];if(u)t?(a=r.openNativeFromNative.bind(this,e),i="#"):a=r.openWeb.bind(this,e);else if(Object(B.isMobile)()&&c)if(Object(B.isAndroid)())a=r.openNativeFromWeb.bind(this,e);else try{i=Ge({slug:n,nativePath:o,fallbackUrl:i})}catch(e){console.error(e),i="#"}return{href:i,onClick:a}}},{key:"openNativeFromWeb",value:function(e,t){var n=e.href,o=e.slug,i=e.nativePath,a=e.onAppSwitch,u=Qe[o];t&&t.preventDefault(),r.onAppSwitch(a),Object(B.openDeeplinkOrRedirect)(u.uri+("/"===i?"":i),(function(){window.location.href=n}))}},{key:"onAppSwitch",value:function(e){"function"==typeof e&&e()}},{key:"openNativeFromNative",value:function(e,t){var n=e.slug,o=e.onAppSwitch;t&&t.preventDefault();var i=Qe[n];r.onAppSwitch(o),Object(B.startApp)(i).catch((function(e){console.error("AppLinker: Could not open native app",e)}))}},{key:"openWeb",value:function(e){r.onAppSwitch(e.onAppSwitch)}}]),r}(w.a.Component);et.defaultProps={nativePath:"/"},et.propTypes={slug:P.a.string.isRequired,href:P.a.string.isRequired,nativePath:P.a.string,onAppSwitch:P.a.func};var tt=et;function nt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var rt=He()($.models,"applications.getAppDisplayName",(function(e){return e.namePrefix&&"cozy"!==e.namePrefix.toLowerCase()?"".concat(e.namePrefix," ").concat(e.name):e.name})),ot=function(e){p()(n,e);var t=nt(n);function n(e){var r;return a()(this,n),(r=t.call(this,e)).onAppSwitch=r.onAppSwitch.bind(l()(r)),r}return c()(n,[{key:"componentWillUnmount",value:function(){this.switchTimeout&&clearTimeout(this.switchTimeout)}},{key:"buildAppUrl",value:function(e){var t;try{t=new URL(e)}catch(e){return console.error(e.message),null}var r=n.buildQueryParams(this.props,this.context);if(r)for(var o in r)t.searchParams.append(o,r[o]);return t.toString()}},{key:"onAppSwitch",value:function(){var e=this.props.onAppSwitch;"function"==typeof e&&(this.switchTimeout=setTimeout((function(){e()}),1e3))}},{key:"render",value:function(){var e=this.props,t=e.useHomeIcon,n=e.app,r=n.slug?"icon-".concat(n.slug):"",o=rt(n);return w.a.createElement(tt,{onAppSwitch:this.onAppSwitch,slug:n.slug,href:this.buildAppUrl(n.href)||""},(function(e){var i=e.onClick,a=e.href;return w.a.createElement("li",{className:"coz-nav-apps-item".concat(n.isCurrentApp?" --current":"")},w.a.createElement("a",{role:"menuitem",href:a,"data-icon":r,title:o,onClick:i},t?w.a.createElement(he,{className:"coz-nav-apps-item-icon"}):w.a.createElement(ie,O()({app:n,className:"coz-nav-apps-item-icon",key:n.slug},ae.b.get.iconProps())),w.a.createElement("p",{className:"coz-label"},o)))}))}}]),n}(w.a.Component);m()(ot,"buildQueryParams",(function(){return null})),ot.propTypes={app:We.isRequired,useHomeIcon:P.a.bool};var it=ot,at=function(){return w.a.createElement("li",{className:"coz-nav-apps-item"},w.a.createElement("span",{role:"menuitem",disabled:!0},w.a.createElement("div",{className:"coz-nav-apps-item-icon coz-loading-placeholder"}),w.a.createElement("p",{className:"coz-label coz-loading-placeholder"})))},ut=n(333),ct=n.n(ut);function st(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var lt=function(e){p()(n,e);var t=st(n);function n(e,r){var o;return a()(this,n),(o=t.call(this,e,r)).translateApp=ft(o.props.t),o}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.t,n=e.apps,r=e.breakpoints,o=e.homeApp,i=e.isFetchingApps,a=e.onAppSwitch,u=r.isMobile,c=o&&o.isCurrentApp,s=o&&o.slug;return i||n&&n.length?w.a.createElement("div",{className:"coz-nav-pop-content"},w.a.createElement("ul",{className:"coz-nav-group"},u&&o&&w.a.createElement(it,{app:o,useHomeIcon:!0,onAppSwitch:a}),i?new Array(3).fill({}).map((function(e,t){return w.a.createElement(at,{key:t})})):n.filter((function(e){return e.slug!==s})).sort(function(e){return function(t,n){return e(t)>e(n)}}(this.translateApp)).map((function(e,t){return w.a.createElement(it,{app:e,key:t,onAppSwitch:a})}))),o&&!u&&!c&&w.a.createElement("a",{role:"menuitem",href:o.href,className:"coz-apps-home-btn"},w.a.createElement("img",{src:ct.a}),t("menu.home"))):w.a.createElement("p",{className:"coz-nav--error coz-nav-group"},t("no_apps"))}}]),n}(b.Component);lt.propTypes={homeApp:P.a.shape({isCurrentApp:P.a.bool,slug:P.a.string}),apps:P.a.array,isFetchingApps:P.a.bool.isRequired};var ft=function(e){return function(t){var n=t.namePrefix?e("".concat(t.slug,".namePrefix"),{_:t.namePrefix}):null,r=e("".concat(t.slug,".name"),{_:t.name});return n?"".concat(n," ").concat(r):"".concat(r)}},pt=Object(k.connect)((function(e){return{apps:Object(Be.d)(e),homeApp:Object(Be.f)(e),isFetchingApps:Object(Be.n)(e)}}))(Object(x.translate)()(Ue()(lt))),dt=Object(x.translate)()((function(e){var t=e.t,n=e.data,r=Number.isInteger(n.quota)?(n.quota/1e9).toFixed(2):n.quota,o=Number.isInteger(n.usage)?(n.usage/1e9).toFixed(2):n.usage;return w.a.createElement("div",{className:"coz-nav-storage"},w.a.createElement("p",{className:"coz-nav-storage-text"},t("storage_phrase",{diskUsage:o,diskQuota:r})),w.a.createElement("progress",{className:"cozy-nav-storage-bar",value:o,max:r,min:"0"}))})),ht=function(e){var t=e.t,n=e.onLogOut,r=e.settingsAppURL,o=e.storageData,i=e.onClaudy,a=e.isDrawer,u=void 0!==a&&a,c=e.isClaudyLoading,s=e.toggleSupport,l=e.shoulDisplayViewOfferButton,f=e.managerUrlPremiumLink,p=e.viewOfferButtonText;return w.a.createElement("div",{className:"coz-nav-pop-content"},u&&w.a.createElement("hr",null),r&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem",href:"".concat(r,"#/profile"),target:"_self","data-icon":"icon-profile",title:t("profile")},w.a.createElement("p",{className:"coz-label"},t("profile")))),w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem",href:"".concat(r,"#/connectedDevices"),target:"_self","data-icon":"icon-connectedDevices",title:t("connectedDevices")},w.a.createElement("p",{className:"coz-label"},t("connectedDevices"))))),u&&i&&!Object(B.isMobileApp)()&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Oe,{type:"button",role:"menuitem",className:"coz-nav-settings-item-btn",icon:"cloud",busy:c,onClick:i,title:t("claudy.title"),label:t("claudy.title")}))),!u&&o&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("a",{role:"menuitem","data-icon":"icon-storage",target:"_self",title:t("storage"),href:"".concat(r,"#/storage")},t("storage"),w.a.createElement(dt,{data:o})))),(!u||!Object(B.isMobileApp)())&&l&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Se,{subtle:!0,role:"menuitem",className:"coz-nav-settings-item-btn",icon:"cloud-happy",title:p,label:p,href:f}))),!Object(B.isMobileApp)()&&w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement(Oe,{type:"button",role:"menuitem",className:"coz-nav-settings-item-btn",onClick:s,icon:"help",title:t("help"),label:t("help")}))),w.a.createElement("ul",{className:"coz-nav-group"},w.a.createElement("li",{className:"coz-nav-settings-item"},w.a.createElement("button",{type:"button",role:"menuitem","data-icon":"icon-logout",onClick:n,title:t("logout")},t("logout")))))};ht.defaultProps={shoulDisplayViewOfferButton:!1},ht.propTypes={shoulDisplayViewOfferButton:P.a.bool,t:P.a.func.isRequired,onLogOut:P.a.func.isRequired,settingsAppURL:P.a.string,storageData:P.a.object,onClaudy:P.a.oneOfType([P.a.bool,P.a.func]),isDrawer:P.a.bool,isClaudyLoading:P.a.bool,toggleSupport:P.a.func.isRequired,viewOfferButtonText:P.a.string};var vt=Object(x.translate)()(ht);function yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var gt=function(e){p()(o,e);var t,n,r=yt(o);function o(e){var t;return a()(this,o),t=r.call(this,e),m()(l()(t),"onDrawerClick",(function(e){e.target===t.wrapperRef&&t.close()})),m()(l()(t),"onTransitionEnd",(function(){t.props.visible?(t.gesturesHandler||t.attachGestures(),t.preventBackgroundScrolling()):(t.restoreBackgroundScrolling(),t.setState({isClosing:!1})),t.props.drawerListener()})),m()(l()(t),"componentWillReceiveProps",function(){var e=Q()(H.a.mark((function e(n){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.UNSAFE_componentWillReceiveProps(n);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),m()(l()(t),"UNSAFE_componentWillReceiveProps",function(){var e=Q()(H.a.mark((function e(n){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.props.visible||!n.visible){e.next=3;break}return e.next=3,t.props.fetchSettingsData();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),m()(l()(t),"close",(function(){t.state.isClosing||(t.detachGestures(),t.setState((function(){return{isClosing:!0}})),t.turnTransitionsOn(),t.props.onClose(),t.asideRef.style.transform="")})),t.state={isScrolling:!1,isClosing:!1},t.handleLogout=t.handleLogout.bind(l()(t)),t}return c()(o,[{key:"componentDidMount",value:(n=Q()(H.a.mark((function e(){return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.turnTransitionsOn();case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"turnTransitionsOn",value:function(){this.asideRef.classList.add("with-transition"),this.asideRef.addEventListener("transitionend",this.onTransitionEnd)}},{key:"turnTransitionsOff",value:function(){this.asideRef.classList.remove("with-transition"),this.asideRef.removeEventListener("transitionend",this.onTransitionEnd)}},{key:"preventBackgroundScrolling",value:function(){document.body.style.overflow="hidden"}},{key:"restoreBackgroundScrolling",value:function(){document.body.style.overflow="auto"}},{key:"detachGestures",value:function(){this.gesturesHandler.destroy(),this.gesturesHandler=null}},{key:"attachGestures",value:function(){var e=this;this.gesturesHandler=new Te.a.Manager(document.documentElement,{recognizers:[[Te.a.Pan,{direction:Te.a.DIRECTION_ALL}]]});var t=this.asideRef.getBoundingClientRect().width,n=null;this.gesturesHandler.on("panstart",(function(t){e.state.isClosing||("panup"===t.additionalEvent||"pandown"===t.additionalEvent?e.setState({isScrolling:!0}):(e.turnTransitionsOff(),n=0))})),this.gesturesHandler.on("pan",(function(r){e.state.isClosing||e.state.isScrolling||(n=-r.deltaX/t,e.applyTransformation(n))})),this.gesturesHandler.on("panend",(function(n){if(!e.state.isClosing)if(e.state.isScrolling)e.setState({isScrolling:!1});else{var r=-n.deltaX/t>=.4,o=n.velocity<0&&Math.abs(n.velocity)>=.2;r||o?e.close():(e.turnTransitionsOn(),e.applyTransformation(0))}}))}},{key:"applyTransformation",value:function(e){e=Math.min(1.1,Math.max(0,e)),this.asideRef.style.transform="translateX(-"+100*e+"%)"}},{key:"handleLogout",value:(t=Q()(H.a.mark((function e(){var t,n,r,o;return H.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props,n=t.onLogOut,r=t.logOut,!n||"function"!=typeof n){e.next=6;break}if(!((o=n())instanceof Promise)){e.next=6;break}return e.next=6,o;case 6:r();case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.props,n=t.onClaudy,r=t.visible,o=t.isClaudyLoading,i=t.toggleSupport,a=t.settingsAppURL,u=t.storageData;return w.a.createElement("div",{className:"coz-drawer-wrapper",onClick:this.onDrawerClick,"aria-hidden":r?"false":"true",ref:function(t){e.wrapperRef=t}},w.a.createElement("aside",{ref:function(t){e.asideRef=t}},w.a.createElement("nav",{className:"coz-drawer--apps"},w.a.createElement(pt,{onAppSwitch:this.close})),w.a.createElement("hr",{className:"coz-sep-flex"}),w.a.createElement("nav",{className:"coz-drawer--settings"},w.a.createElement(vt,{onLogOut:this.handleLogout,storageData:u,settingsAppURL:a,isClaudyLoading:o,onClaudy:n,toggleSupport:i,isDrawer:!0}))))}}]),o}(b.Component),mt=Object(k.connect)((function(e){return{storageData:Object(Be.i)(e),settingsAppURL:Object(Be.h)(e)}}),(function(e){return{fetchSettingsData:function(){return e(Object(Be.c)())},logOut:function(){return e(Object(Be.q)())}}}))(gt),bt=n(33),wt={query:function(){return Object($.Q)("io.cozy.settings").getById("instance")},as:"instanceQuery"},kt={query:function(){return Object($.Q)("io.cozy.settings").getById("context")},as:"contextQuery"},xt={query:function(){return Object($.Q)("io.cozy.settings").getById("disk-usage")},as:"diskUsageQuery"},_t=n(130),Ot=function(){return Object(_t.a)("8.3.0")};function St(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Et=void 0,jt=void 0,Pt=void 0;$.models&&(Et=$.models.instance,Pt=function(e){var t=He()(e,"diskUsage.data.attributes.quota",!1);return parseInt(t)<5e10},jt=function(e){return!Et.isSelfHosted(e)&&Et.arePremiumLinksEnabled(e)&&Et.getUuid(e)&&!Pt(e)});var Ct=function(e){p()(n,e);var t=St(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"onClickOutside",(function(e){(r.props.isFetching||r.state.opened)&&(r.rootRef.contains(e.target)||(r.setState({opened:!1}),e.stopPropagation()))})),m()(l()(r),"toggleMenu",(function(){if(r.state.opened)return r.setState({opened:!1});r.props.fetchSettingsData(),r.setState({opened:!0})})),r.state={opened:!1},r}return c()(n,[{key:"componentDidMount",value:function(){document.body.addEventListener("click",this.onClickOutside)}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.onClickOutside)}},{key:"render",value:function(){var e,t,n=this,r=this.props,o=r.isBusy,i=r.logOut,a=r.onLogOut,u=r.t,c=r.toggleSupport,s=r.diskUsageQuery,l=r.instanceQuery,f=r.contextQuery,p=r.storageData,d=r.settingsAppURL,h=r.isFetching,v=!1,y="",g=Ot();if(g&&!(t=[s,l,f].some((function(e){return"loading"===e.fetchStatus})))){var m={context:f,diskUsage:s,instance:l};(v=Et.shouldDisplayOffers(m)||jt(m))&&!jt(m)?y=u("view_offers"):jt(m)&&(y=u("view_my_offer")),e=Et.buildPremiumLink(m)}var b=!1;b=g?!t&&!h:!h;var k=this.state.opened&&b;return w.a.createElement("div",{className:"coz-nav coz-nav-settings",ref:function(e){n.rootRef=e}},w.a.createElement(Oe,{type:"button",theme:"text",onClick:this.toggleMenu,className:"coz-nav-settings-btn","aria-controls":"coz-nav-pop--settings",busy:o,icon:"gear",label:u("menu.settings")}),w.a.createElement("div",{className:"coz-nav-pop coz-nav-pop--settings",id:"coz-nav-pop--settings","aria-hidden":!k},b&&w.a.createElement(w.a.Fragment,null,w.a.createElement(vt,{onLogOut:function(){a&&"function"==typeof a?a():i()},toggleSupport:c,storageData:p,settingsAppURL:d,shoulDisplayViewOfferButton:v,managerUrlPremiumLink:e,viewOfferButtonText:y}))))}}]),n}(b.Component),Tt=function(e){return{storageData:Object(Be.i)(e),settingsAppURL:Object(Be.h)(e),isBusy:Object(Be.p)(e),isFetching:Object(Be.o)(e)}},At=function(e){return{fetchSettingsData:function(){return e(Object(Be.c)())},logOut:function(){return e(Object(Be.q)())}}},Dt=Ot()?Object(bt.d)(Object(x.translate)(),Object($.queryConnect)({instanceQuery:wt,contextQuery:kt,diskUsageQuery:xt}),Object(k.connect)(Tt,At))(Ct):Object(bt.d)(Object(x.translate)(),Object(k.connect)(Tt,At))(Ct);function Rt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var It=function(e){p()(n,e);var t=Rt(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.homeApp,n=e.handleClick,r=e.appName,o=e.appNamePrefix,i=e.appSlug,a=e.iconPath,u=e.isFetchingApps,c=e.isPublic,s=e.opened,l=e.t,f=t&&t.isCurrentApp;if(!c&&u)return w.a.createElement("div",{className:"coz-nav-apps-btns --loading"},w.a.createElement("div",{className:"coz-nav-apps-btns-home coz-loading-placeholder"}),w.a.createElement("div",{className:"coz-nav-apps-btns-main coz-loading-placeholder"}));var p=!f&&o?[l("".concat(i,".name_prefix"),{_:o}),l("".concat(i,".name"),{_:r})].join(" "):l("".concat(i,".name"),{_:r}),d=!c&&t&&t.href;return w.a.createElement("div",{className:"coz-nav-apps-btns".concat(f?" --currentHome":"")},w.a.createElement(ve,{homeHref:d}),!f&&w.a.createElement("span",{className:"coz-nav-apps-btns-sep"}),w.a.createElement("button",{type:"button",onClick:c?null:n,className:"coz-nav-apps-btns-main","aria-controls":"coz-nav-pop--apps","data-tutorial":"apps",disabled:c},!f&&w.a.createElement("img",{className:"coz-bar-hide-sm",src:a,width:"28",alt:""}),w.a.createElement("span",{className:"coz-nav-app-name"},p),!c&&w.a.createElement(N,{icon:s?"top":"bottom",color:"#95999d",size:"12"})))}}]),n}(b.Component),Nt=Object(k.connect)((function(e){return{homeApp:Object(Be.f)(e),isFetchingApps:Object(Be.n)(e)}}),(function(){return{}}))(Object(x.translate)()(It));function zt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Mt=function(e){p()(n,e);var t=zt(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"onClickOutside",(function(e){r.state.opened&&(r.rootRef.contains(e.target)||r.modalContainer.contains(e.target)||(r.setState({opened:!1}),e.stopPropagation()))})),m()(l()(r),"toggleMenu",(function(){r.setState({opened:!r.state.opened})})),r.state={opened:!1},r}return c()(n,[{key:"componentDidMount",value:function(){document.body.addEventListener("click",this.onClickOutside),this.modalContainer=document.getElementById("cozy-bar-modal-dom-place")}},{key:"componentWillUnmount",value:function(){document.body.removeEventListener("click",this.onClickOutside)}},{key:"render",value:function(){var e=this,t=this.props,n=t.replaceTitleOnMobile,r=t.appName,o=t.appNamePrefix,i=t.appSlug,a=t.iconPath,u=t.isPublic,c=this.state.opened;return w.a.createElement("nav",{className:"coz-nav coz-nav-apps".concat(n?" coz-bar-hide-sm":""),ref:function(t){e.rootRef=t}},w.a.createElement(Nt,{appName:r,appNamePrefix:o,appSlug:i,iconPath:a,handleClick:this.toggleMenu,opened:c,isPublic:u}),w.a.createElement("div",{className:"coz-nav-pop coz-nav-pop--apps",id:"coz-nav-pop--apps","aria-hidden":!c},w.a.createElement(pt,null)))}}]),n}(b.Component),Ft=n(32),Lt=n.n(Ft),Ut=n(335),Bt=n.n(Ut),qt=n(336),Ht=n.n(qt);var Wt=n(129);function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var $t=function(e){return e.toString().toLowerCase().replace(/\//g," ").normalize("NFD").replace(/[\u0300-\u036f]/g,"").split(" ")},Gt=function(e,t){var n=$t(t),r=$t(e),o=[],i=0;r.forEach((function(e){n.forEach((function(t){var n=e.indexOf(t);n>=0&&o.push({from:i+n,to:i+n+t.length})})),i+=e.length+1}));for(var a=o.sort((function(e,t){return e.from>t.from})).reduce((function(e,t){return 0===e.length||e[e.length-1].to<t.from?e.push(t):e[e.length-1].to<t.to&&(e[e.length-1].to=t.to),e}),[]),u=a.length>0?[e.slice(0,a[0].from)]:e,c=0,s=a.length;c<s;++c)u.push(w.a.createElement("b",null,e.slice(a[c].from,a[c].to))),c+1<s&&u.push(e.slice(a[c].to,a[c+1].from));return a.length>0&&u.push(e.slice(a[a.length-1].to,e.length)),u},Vt=function(e){p()(n,e);var t=Qt(n);function n(){var e;a()(this,n);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return e=t.call.apply(t,[this].concat(i)),m()(l()(e),"state",{input:"",query:null,searching:!1,focused:!1,suggestionsBySource:[],sourceURLs:[]}),m()(l()(e),"sources",[]),m()(l()(e),"onMessageFromSource",(function(e){return function(t){var n=e.find((function(e){return e.origin===t.origin}));if(!n)return null;t.data.type==="intent-".concat(n.id,":ready")?(n.ready=!0,n.window=t.source,n.window.postMessage({},t.origin)):t.data.type==="intent-".concat(n.id,":data")&&n.resolvers[t.data.id]?(n.resolvers[t.data.id]({id:n.id,suggestions:t.data.suggestions}),delete n.resolvers[t.data.id]):Wt.a.log("unhandled message:",t)}})),m()(l()(e),"onChange",(function(t,n){var r=n.newValue;e.setState({input:r})})),m()(l()(e),"changeFocusState",(function(t){e.setState({focused:t})})),m()(l()(e),"clearSuggestions",(function(){e.setState({suggestionsBySource:[]})})),m()(l()(e),"onSuggestionsFetchRequested",(function(t){var n=t.value,r=e.sources.filter((function(e){return e.ready}));r.length>0&&(e.setState((function(e){return o()({},e,{searching:!0})})),r.forEach(function(){var t=Q()(H.a.mark((function t(r){var i,a,u,c;return H.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(e){var t=(new Date).getTime().toString();r.resolvers[t]=e,r.window.postMessage({query:n,id:t},r.origin)}));case 2:i=t.sent,a=i.id,u=i.suggestions,c=e.sources.find((function(e){return e.id===a})).slug,e.state.query!==n?e.setState((function(e){return o()({},e,{searching:!1,query:n,suggestionsBySource:[{title:c,suggestions:u}]})})):e.setState((function(e){return o()({},e,{suggestionsBySource:[].concat(Lt()(e.suggestionsBySource),[{title:c,suggestions:u}])})}));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()))})),m()(l()(e),"onSuggestionsClearRequested",(function(){e.clearSuggestions(),e.debouncedOnSuggestionsFetchRequested.cancel(),e.setState({query:null,searching:!1})})),m()(l()(e),"onSuggestionSelected",(function(t,n){var r=n.suggestion.onSelect;if(/^open:/.test(r)){var o=r.substr(5);window.location.href=o}else console.log("suggestion onSelect ("+r+") could not be executed");e.setState({input:"",query:null})})),m()(l()(e),"getSectionSuggestions",(function(e){return e.suggestions.slice(0,10)})),m()(l()(e),"getSuggestionValue",(function(e){return e.subtitle})),m()(l()(e),"renderSectionTitle",(function(){return null})),m()(l()(e),"renderSuggestion",(function(t){return w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-item"},t.icon&&w.a.createElement("img",{className:"coz-searchbar-autosuggest-suggestion-icon",src:t.icon,alt:"icon"}),w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-content"},w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-title"},Gt(t.title,e.state.query)),t.subtitle&&w.a.createElement("div",{className:"coz-searchbar-autosuggest-suggestion-subtitle"},Gt(t.subtitle,e.state.query))))})),e}return c()(n,[{key:"componentWillMount",value:function(){this.debouncedOnSuggestionsFetchRequested=Ht()(this.onSuggestionsFetchRequested,250)}},{key:"componentDidMount",value:function(){var e=this;(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object(ae.a)(null,"POST","/intents",{data:{type:"io.cozy.intents",attributes:{action:e,type:t,data:n,permissions:r}}})})("OPEN","io.cozy.suggestions").then((function(t){var n=t.attributes.services;if(!n)return null;e.sources=n.map((function(n){var r=n.href;e.setState((function(e){return o()({},e,{sourceURLs:[].concat(Lt()(e.sourceURLs),[r])})}));var i=r.split("/",3).join("/");return{slug:n.slug,origin:i,id:t._id,ready:!1,window:null,resolvers:{}}})),window.addEventListener("message",e.onMessageFromSource(e.sources))}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.input,r=t.query,o=t.searching,i=t.focused,a=t.suggestionsBySource,u=t.sourceURLs;if(0===u.length)return null;var c=this.props.t,s=""!==n&&null===r,l=a.reduce((function(e,t){return e+t.suggestions.length}),0)>0,f={placeholder:c("searchbar.placeholder"),value:n,onChange:this.onChange,onFocus:function(){return e.changeFocusState(!0)},onBlur:function(){return e.changeFocusState(!1)}},p={container:"coz-searchbar-autosuggest-container"+(o?" --searching":"")+(i?" --focused":""),input:"coz-searchbar-autosuggest-input",inputFocused:"coz-searchbar-autosuggest-input-focused",suggestionsContainer:"coz-searchbar-autosuggest-suggestions-container",suggestionsContainerOpen:"coz-searchbar-autosuggest-suggestions-container--open",suggestionsList:"coz-searchbar-autosuggest-suggestions-list",suggestion:"coz-searchbar-autosuggest-suggestion",suggestionHighlighted:"coz-searchbar-autosuggest-suggestion-highlighted",sectionTitle:"coz-searchbar-autosuggest-section-title"};return w.a.createElement("div",{className:"coz-searchbar",role:"search"},u.map((function(e,t){return w.a.createElement("iframe",{src:e,style:{visibility:"hidden",height:"0px",width:"0px"},key:e+t})})),w.a.createElement(Bt.a,{theme:p,suggestions:a,multiSection:!0,onSuggestionsFetchRequested:this.debouncedOnSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSuggestionSelected:this.onSuggestionSelected,getSuggestionValue:this.getSuggestionValue,getSectionSuggestions:this.getSectionSuggestions,renderSectionTitle:this.renderSectionTitle,renderSuggestion:this.renderSuggestion,inputProps:f,focusInputOnSuggestionClick:!1}),""!==n&&!s&&i&&!l&&w.a.createElement("div",{className:"coz-searchbar-autosuggest-status-container"},c("searchbar.empty",{query:n})))}}]),n}(b.Component),Jt=Object(x.translate)()(Vt);function Yt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Kt=function(e){p()(n,e);var t=Yt(n);function n(e,r){var o;return a()(this,n),o=t.call(this,e),m()(l()(o),"toggle",(function(){o.props.opened||o.intentWrapperRef.childNodes.length?(o.setState({isActive:!o.state.isActive}),o.props.onToggle()):(o.setState({isLoading:!0}),o.intents.create("CLAUDY","io.cozy.settings",{exposeIntentFrameRemoval:!0}).start(o.intentWrapperRef,(function(){o.setState({isLoading:!1,isActive:!0}),o.props.onToggle()})).then((function(e){var t=e.removeIntentIframe;o.intentWrapperRef.addEventListener("transitionend",(function e(n){"transform"===n.propertyName&&(t(),o.setState({isActive:!1}),n.target.removeEventListener("transitionend",e))}),!1),o.props.onToggle()})))})),o.store=r.barStore,o.state={isLoading:!1,isActive:!1},o.intents=Object(ae.c)(),o}return c()(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.claudyFired&&this.toggle()}},{key:"componentWillReceiveProps",value:function(e){return this.UNSAFE_componentWillReceiveProps(e)}},{key:"render",value:function(){var e=this,t=this.props.opened,n=this.state,r=n.isLoading,o=n.isActive;return w.a.createElement("div",{className:"coz-claudy ".concat(t?"coz-claudy--opened":"")},w.a.createElement("button",{type:"button",className:"coz-claudy-icon coz-bar-hide-sm","data-claudy-opened":o,"data-claudy-loading":r,onClick:this.toggle}),w.a.createElement("div",{className:"coz-claudy-intent-wrapper",ref:function(t){e.intentWrapperRef=t}}))}}]),n}(b.Component),Xt=n(338),Zt=n.n(Xt),en=n(73),tn=n.n(en),nn=n(133);function rn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var on=["onEscape","children","className"],an=function(e){p()(n,e);var t=rn(n);function n(){var e;a()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),m()(l()(e),"handleKeydown",(function(t){27===t.keyCode&&e.props.onEscape()})),m()(l()(e),"handleClick",(function(t){e.props.onClick&&t.target===t.currentTarget&&e.props.onClick()})),e}return c()(n,[{key:"componentDidMount",value:function(){document.body.getBoundingClientRect().height>window.innerHeight&&(Object(nn.disableBodyScroll)(document.body),Object(nn.disableBodyScroll)(document.body.parentNode)),this.props.onEscape&&document.addEventListener("keydown",this.handleKeydown)}},{key:"componentWillUnmount",value:function(){Object(nn.clearAllBodyScrollLocks)(),this.props.onEscape&&document.removeEventListener("keydown",this.handleKeydown)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=tn()(this.props,on);return w.a.createElement("div",O()({onClick:this.handleClick,className:D()(Zt.a["c-overlay"],n)},r),t)}}]),n}(b.Component);an.propTypes={className:P.a.string,children:P.a.node,onEscape:P.a.func};var un=an;function cn(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return sn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sn(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}var ln;if(Object({USE_REACT:!0}).USE_PREACT)try{ln=n(!function(){var e=new Error("Cannot find module 'preact-portal'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}else{var fn=n(117);ln=function(e){var t=e.into,n=e.children,r=document.querySelector(t);return fn.createPortal(n,r)}}var pn=ln,dn=n(337),hn=n.n(dn),vn=n(15),yn=n.n(vn);function gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var mn=function(e){p()(n,e);var t=gn(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){return this.props.children}}]),n}(b.Component);function bn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var wn=function(e){p()(n,e);var t=bn(n);function n(e){var r;a()(this,n),r=t.call(this,e),m()(l()(r),"UNSAFE_componentWillUpdate",(function(e){var t=e.children;r.refreshComputedParts(t)})),m()(l()(r),"handleScroll",(function(){if(r.contentHeader){var e=l()(r).headerHeight;e||!r.contentHeader.clientHeight?!r.state.displayGhostHeader&&r.scrollingContent.scrollTop>e-20?r.setState((function(){return{displayGhostHeader:!0}})):r.state.displayGhostHeader&&r.scrollingContent.scrollTop<e-20&&r.setState((function(){return{displayGhostHeader:!1}})):r.headerHeight=r.contentHeader.clientHeight}}));var o=r.props.children;return r.refreshComputedParts(o),r.state={displayGhostHeader:!1},r}return c()(n,[{key:"componentWillUpdate",value:function(e,t){this.UNSAFE_componentWillUpdate(e,t)}},{key:"refreshComputedParts",value:function(e){var t=function(e){return w.a.Children.toArray(e).find((function(e){return e&&e.nodeName===mn}))}(e);this.animatedHeader=t,this.childrenToRender=t?function(e){return w.a.Children.map(e,(function(e){return e&&e.nodeName!==mn?e:null}))}(e):e}},{key:"componentDidMount",value:function(){this.scrollingContent.addEventListener("scroll",this.handleScroll,{passive:!0})}},{key:"componentWillUnmount",value:function(){this.scrollingContent.removeEventListener("scroll",this.handleScroll)}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.fixed,o=this.state.displayGhostHeader,i=this.animatedHeader,a=this.childrenToRender;return w.a.createElement("div",{className:D()(yn.a["c-modal-content".concat(r?"-fixed":"")],n),ref:function(t){e.scrollingContent=t}},i&&w.a.createElement("div",{className:i.attributes.className,ref:function(t){e.contentHeader=t}},w.a.createElement("h2",{className:yn.a["c-modal-illu-header"]},i.children),w.a.createElement("div",{className:D()(yn.a["c-modal-illu-header--ghost"],i.attributes.activeClassName,m()({},yn.a["is-active"],o))},i.children)),a)}}]),n}(b.Component),kn=function(e){var t=e.children,n=e.className;return w.a.createElement("div",{className:D()(yn.a["c-modal-content"],yn.a["c-modal-section"],n)},t)},xn=function(e){var t=e.title,n=e.children,r=e.className,o=e.appIcon,i=e.appName,a=e.appEditor,u=e.style,c=e.id,s="string"==typeof n;return w.a.createElement("div",{className:D()(yn.a["c-modal-header"],r),style:u,id:c},t&&w.a.createElement("h2",null,t),s?w.a.createElement("h2",null,n):n,i&&w.a.createElement("h2",{className:yn.a["c-modal-app"]},o&&w.a.createElement("img",{className:yn.a["c-modal-app-icon"],src:o}),a&&w.a.createElement("span",{className:yn.a["c-app-editor"]},a," "),i))},_n=function(e){var t=e.logo,n=e.bg,r=e.className,i=e.style,a=void 0===i?{}:i;return w.a.createElement("h2",{className:D()(yn.a["c-modal-header--branded"],r),style:o()({background:n},a)},w.a.createElement("img",{src:t,alt:""}))},On=Ue()((function(e){var t=e.onClick,n=e.color,r=e.className,o=e.breakpoints.isMobile;return w.a.createElement("button",{className:D()(yn.a["c-modal-close"],r),onClick:t,type:"button","aria-label":"close"},w.a.createElement(N,{icon:"cross",size:o?"16":"24",color:n||Y.a.coolGrey}))})),Sn=function(e){var t=e.children,n=e.className;return w.a.createElement("div",{className:D()(yn.a["c-modal-footer"],n)},t)},En=function(e){var t=e.secondaryText,n=e.secondaryAction,r=e.secondaryType,o=e.primaryText,i=e.primaryAction,a=e.primaryType,u=e.children,c=e.className;return w.a.createElement("div",{className:D()("u-flex","u-flex-wrap-reverse","u-flex-justify-end",yn.a["c-modal-footer--button"],c)},u,t&&n&&w.a.createElement(Oe,{theme:r,onClick:n,label:t,className:"u-flex-auto-s"}),o&&i&&w.a.createElement(Oe,{theme:a,onClick:i,label:o,className:"u-flex-auto-s"}))};En.defaultProps={primaryType:"regular",secondaryType:"secondary"};var jn=En,Pn=Ue()((function(e){var t=e.breakpoints.isMobile,n=e.className,r=E()(e,["breakpoints","className"]);return w.a.createElement(Oe,O()({icon:"previous",iconOnly:!0,extension:"narrow",theme:"text",label:"back",className:D()(yn.a["c-modal-back-button"],"u-m-0 u-pos-absolute",{"u-p-1":t,"u-p-half":!t,"u-h-3":t},n)},r))})),Cn=Object(b.createContext)();function Tn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var An=wn,Dn=function(e){p()(n,e);var t=Tn(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"handleOutsideClick",(function(e){e.target===e.currentTarget&&r.props.dismissAction&&r.props.dismissAction()})),r.titleID=hn()("modal_"),r}return c()(n,[{key:"componentDidMount",value:function(){this.props.title||this.props["aria-label"]||console.warn("If your modal does not provide a `title` prop, please provide the `aria-label` prop for a11y purposes."),document.body.classList.contains("has-modal")||(document.body.classList.add("has-modal"),this.shouldRemoveBodyClass=!0)}},{key:"componentWillUnmount",value:function(){this.shouldRemoveBodyClass&&document.body.classList.remove("has-modal")}},{key:"render",value:function(){var e,t=this.props,n=t.children,r=t.description,o=t.title,i=t.closable,a=t.dismissAction,u=t.overflowHidden,c=t.className,s=t.closeBtnClassName,l=t.closeBtnColor,f=t.into,p=t.size,d=t.height,h=t.width,v=t.spacing,y=t.mobileFullscreen,g=t.overlayClassName,k=t.wrapperClassName,x=t.primaryText,_=t.primaryAction,S=t.primaryType,j=t.secondaryText,P=t.secondaryAction,C=t.secondaryType,T=t.containerClassName,A=E()(t,["children","description","title","closable","dismissAction","overflowHidden","className","closeBtnClassName","closeBtnColor","into","size","height","width","spacing","mobileFullscreen","overlayClassName","wrapperClassName","primaryText","primaryAction","primaryType","secondaryText","secondaryAction","secondaryType","containerClassName"]),R=this.titleID,I=Object.assign({},d&&{height:d},h&&{width:h}),N=Object(b.createRef)();return w.a.createElement(Cn.Provider,{value:N},w.a.createElement(pn,{into:f},w.a.createElement("div",{className:D()(yn.a["c-modal-container"],T)},w.a.createElement(un,{onEscape:i?a:void 0,className:g},w.a.createElement("div",{className:D()(yn.a["c-modal-wrapper"],m()({},yn.a["c-modal-wrapper--fullscreen"],y),k),onClick:i?this.handleOutsideClick:void 0},w.a.createElement("div",{ref:N}),w.a.createElement("div",O()({className:D()(yn.a["c-modal"],yn.a["c-modal--".concat(p)],(e={},m()(e,yn.a["c-modal--overflowHidden"],u),m()(e,yn.a["c-modal--".concat(v,"-spacing")],v),m()(e,yn.a["c-modal--fullscreen"],y),m()(e,yn.a["c-modal--closable"],i),e),c),style:I,role:"dialog","aria-modal":"true","aria-labelledby":o?R:null},A),i&&w.a.createElement(On,{className:D()(s,m()({},yn.a["c-modal-close--notitle"],!o)),onClick:a,color:l}),o&&w.a.createElement(xn,{title:o,id:R}),r&&w.a.createElement(An,null,r),n,x&&_||j&&P?w.a.createElement(Sn,null,w.a.createElement(jn,{primaryText:x,primaryAction:_,primaryType:S,secondaryText:j,secondaryAction:P,secondaryType:C})):null))))))}}]),n}(b.Component);Dn.propTypes={title:P.a.node,description:P.a.node,secondaryType:P.a.string,secondaryText:P.a.string,secondaryAction:P.a.func,primaryType:P.a.string,primaryText:P.a.string,primaryAction:P.a.func,closable:P.a.bool,overflowHidden:P.a.bool,className:P.a.string,closeBtnClassName:P.a.string,closeBtnColor:P.a.string,into:P.a.string,size:P.a.oneOf(["xsmall","small","medium","large","xlarge","xxlarge"]),height:P.a.string,width:P.a.string,spacing:P.a.oneOf(["small","large"]),mobileFullscreen:P.a.bool,overlayClassName:P.a.string,wrapperClassName:P.a.string,containerClassName:P.a.string,dismissAction:P.a.func},Dn.defaultProps={primaryType:"regular",secondaryType:"secondary",closable:!0,overflowHidden:!1,size:"small",into:"body",mobileFullscreen:!1},_n.propTypes={bg:P.a.string.isRequired,logo:P.a.string.isRequired},xn.propTypes={appIcon:P.a.string,appEditor:P.a.string,appName:P.a.string},wn.propTypes={iconSrc:P.a.node,iconDest:P.a.node,fixed:P.a.bool};var Rn,In=(Rn=[{src:"withCross",dest:"closable"},{src:"crossClassName",dest:"closeBtnClassName"},{src:"crossColor",dest:"closeBtnColor"},{fn:function(e){var t;return e.secondaryAction&&!e.dismissAction?((t=o()({},e)).dismissAction=e.secondaryAction,[t,"In the future, `secondaryAction` will not be bound to closing actions (clicking on cross, clicking outside), please use `dismissAction` for that"]):[e,null]}}],function(e){var t=function(t){var n=function(e,t){var n,r,i,a=cn(t);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(u.src&&u.dest){var c=u.src,s=u.dest;if(void 0===e[c])continue;(n=n||o()({},e))[s]=e[c],delete n[c],r="`".concat(c,"` is deprecated and has been migrated automatically, you should use `").concat(s,"` now")}else if(u.fn){var l=u.fn(n||e);if(2!==l.length)throw new Error("migrateOption `fn` should return [newProps, msg].");var f=Ie()(l,2);n=f[0],r=f[1]}else console.warn("migrateProps option is not valid, valid properties are `src`, `dest`, `fn`. You passed",u);window.SHOW_DEPRECATION_WARNINGS&&r&&(console.warn("Deprecation: ".concat(r)),r=null)}}catch(e){a.e(e)}finally{a.f()}return n||e}(t,Rn);return w.a.createElement(e,n)};return t.displayName=e.displayName||e.name,t})(Dn);In.propTypes=Dn.propTypes,In.defaultProps=Dn.defaultProps,Object.assign(In,{ModalContent:wn,ModalSection:kn,ModalFooter:Sn,ModalHeader:xn,AnimatedContentHeader:mn,ModalBrandedHeader:_n,ModalDescription:An,ModalBackButton:Pn});var Nn=In,zn=n(134),Mn=n.n(zn),Fn=function(e){var t,n=e.t,r=e.loadingType,o=e.middle,i=e.noMargin,a=e.color,u=e.size,c=e.className,s={tiny:8,small:12,medium:16,large:24,xlarge:36,xxlarge:80}[u];return w.a.createElement("div",{className:D()(Mn.a["c-spinner"],(t={},m()(t,Mn.a["c-spinner--middle"],o),m()(t,Mn.a["c-spinner--nomargin"],i),t),c)},w.a.createElement(N,{icon:"spinner",color:a,spin:!0,size:s}),r&&w.a.createElement("p",null,n("loading.".concat(r))))};Fn.propTypes={loadingType:P.a.string,middle:P.a.bool,noMargin:P.a.bool,color:P.a.string,size:P.a.oneOf(["tiny","small","medium","large","xlarge","xxlarge"]),className:P.a.string},Fn.defaultProps={loadingType:"",middle:!1,noMargin:!1,color:Y.a.primaryColor,size:"medium",className:""};var Ln=Object(x.translate)()(Fn);function Un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}var Bn=function(e){p()(n,e);var t=Un(n);function n(e,r){var o;return a()(this,n),o=t.call(this,e),m()(l()(o),"toggle",(function(){o.setState({isLoading:!0}),o.intents.create("SUPPORT","io.cozy.settings").start(o.intentWrapperRef,(function(){o.setState({isLoading:!1})}))})),o.store=r.barStore,o.state={isLoading:!1},o.intents=Object(ae.c)(),o}return c()(n,[{key:"componentDidMount",value:function(){this.toggle()}},{key:"render",value:function(){var e=this,t=this.state.isLoading;return w.a.createElement("div",null,w.a.createElement(Nn,{secondaryAction:this.props.onClose,className:"coz-support-modal",into:"#cozy-bar-modal-dom-place",closeBtnClassName:"coz-support-modal-close"},w.a.createElement(wn,{className:"coz-support-modal-wrapper u-mt-1"},w.a.createElement("div",{className:"coz-support-modal-content"},t&&w.a.createElement(Ln,{size:"xxlarge",middle:!0}),w.a.createElement("div",{className:"coz-support-intent-wrapper".concat(t?" coz-hidden":""),ref:function(t){e.intentWrapperRef=t}})))))}}]),n}(b.Component),qn=new ce.a({id:"icon-apps",use:"icon-apps-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="icon-apps"><path d="M0 0h4v4H0V0zm0 6h4v4H0V6zm0 6h4v4H0v-4zM6 0h4v4H6V0zm0 6h4v4H6V6zm0 6h4v4H6v-4zm6-12h4v4h-4V0zm0 6h4v4h-4V6zm0 6h4v4h-4v-4z" fill-rule="evenodd" /></symbol>'}),Hn=(le.a.add(qn),qn);function Wn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var o=y()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h()(this,n)}}n.d(t,"Bar",(function(){return Qn})),n.d(t,"mapStateToProps",(function(){return $n})),n.d(t,"mapDispatchToProps",(function(){return Gn}));var Qn=function(e){p()(n,e);var t=Wn(n);function n(e){var r;return a()(this,n),r=t.call(this,e),m()(l()(r),"toggleDrawer",(function(){if(!r.state.claudyOpened&&!r.state.claudyFired){var e=!r.state.drawerVisible;e&&r.props.onDrawer(e),r.setState({drawerVisible:e})}})),m()(l()(r),"toggleClaudy",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(r.props.claudyEnabled){var t=r.state,n=t.usageTracker,o=t.claudyOpened;if(e&&!o)return r.setState({claudyFired:!0});r.state.claudyFired&&r.setState({claudyFired:!1}),n&&n.push(["trackEvent","Claudy",o?"close":"open","claudy"]),r.setState({claudyOpened:!o})}})),m()(l()(r),"toggleSupport",(function(){var e=r.state.supportDisplayed;r.setState({supportDisplayed:!e})})),m()(l()(r),"renderLeft",(function(){var e=r.props,t=e.t,n=e.isPublic,o=e.webviewContext;return o?w.a.createElement(ve,{webviewContext:o}):n?null:w.a.createElement("button",{type:"button",className:"coz-bar-btn coz-bar-burger",onClick:r.toggleDrawer,"data-tutorial":"apps-mobile"},w.a.createElement(N,{icon:Hn,width:16,height:16,color:"currentColor"}),w.a.createElement("span",{className:"coz-bar-hidden"},t("drawer")))})),m()(l()(r),"renderRight",(function(){return r.props.isPublic?null:w.a.createElement(Dt,{toggleSupport:r.toggleSupport,onLogOut:r.props.onLogOut})})),r.state={claudyFired:!1,claudyOpened:!1,drawerVisible:!1,usageTracker:null,supportDisplayed:!1,searchBarEnabled:e.isDrive&&!e.isPublic&&!Object(B.isMobileApp)()},r.fetchApps=r.fetchApps.bind(l()(r)),r.fetchInitialData=r.fetchInitialData.bind(l()(r)),r.handleTokenRefreshed=r.handleTokenRefreshed.bind(l()(r)),r}return c()(n,[{key:"componentDidMount",value:function(){F()&&this.initPiwikTracker(),this.fetchInitialData(),this.props.cozyClient.on("tokenRefreshed",this.handleTokenRefreshed)}},{key:"componentWillUnmount",value:function(){this.props.cozyClient.removeListener("tokenRefreshed",this.handleTokenRefreshed)}},{key:"componentDidUpdate",value:function(e,t){!this.props.hasFetchedApps&&this.state.drawerVisible&&t.drawerVisible!==this.state.drawerVisible&&this.fetchApps()}},{key:"handleTokenRefreshed",value:function(){this.fetchInitialData()}},{key:"initPiwikTracker",value:function(){var e=L("https://matomo.cozycloud.cc",8,!1,!1);U({appDimensionId:1,app:"Cozy Bar",heartbeat:0}),this.setState({usageTracker:e})}},{key:"fetchApps",value:function(){this.props.fetchApps()}},{key:"fetchInitialData",value:function(){this.props.isPublic||(this.props.fetchContext(),this.props.fetchSettingsData(!1),this.fetchApps())}},{key:"renderCenter",value:function(){var e=this.props,t=e.appName,n=e.appNamePrefix,r=e.appSlug,o=e.iconPath,i=e.replaceTitleOnMobile,a=e.isPublic;return w.a.createElement(Mt,{appName:t,appNamePrefix:n,appSlug:r,iconPath:o,replaceTitleOnMobile:i,isPublic:a})}},{key:"render",value:function(){var e=this,t=this.state,n=t.claudyFired,r=t.claudyOpened,i=t.drawerVisible,a=t.searchBarEnabled,u=t.supportDisplayed,c=t.usageTracker,s=this.props,l=s.theme,f=s.themeOverrides,p=s.barLeft,d=s.barRight,h=s.barCenter,v=s.barSearch,y=s.claudyEnabled,g=s.onDrawer,m=s.isPublic,b=s.onLogOut,k=s.userActionRequired,x=f.primaryColor,_=f.primaryContrastTextColor,O=x?{"--cozBarThemePrimaryColor":x}:{},S=_?{"--cozBarThemePrimaryContrastTextColor":_}:{},E=o()({},O,S);return w.a.createElement("div",{className:"coz-bar-wrapper coz-theme-".concat(l),style:E},w.a.createElement("div",{id:"cozy-bar-modal-dom-place"}),w.a.createElement("div",{className:"coz-bar-container"},p||this.renderLeft(),h||this.renderCenter(),w.a.createElement("div",{className:"u-flex-grow"},v||(a?w.a.createElement(Jt,null):null)),d||this.renderRight(),m?null:w.a.createElement(mt,{visible:i,onClose:this.toggleDrawer,onClaudy:y&&function(){return e.toggleClaudy(!0)}||!1,isClaudyLoading:n,drawerListener:function(){return g(i)},toggleSupport:this.toggleSupport,onLogOut:b}),y&&w.a.createElement(Kt,{usageTracker:c,claudyFired:n,onToggle:function(){return e.toggleClaudy(!1)},opened:r}),u&&w.a.createElement(Bn,{onClose:this.toggleSupport})),k&&w.a.createElement(Pe,k))}}]),n}(b.Component),$n=function(e){return{theme:Object(Be.j)(e).name,themeOverrides:Object(Be.j)(e).overrides,barLeft:Object(Be.e)(e,"left"),barRight:Object(Be.e)(e,"right"),barCenter:Object(Be.e)(e,"center"),barSearch:Object(Be.e)(e,"search"),isDrive:Object(Be.m)(e,{slug:"drive"}),claudyEnabled:Object(Be.z)(e),hasFetchedApps:Object(Be.l)(e),webviewContext:Object(Be.k)(e)}},Gn=function(e){return{fetchApps:function(){return e(Object(Be.a)())},fetchContext:function(){return e(Object(Be.b)())},fetchSettingsData:function(t){return e(Object(Be.c)(t))}}};t.default=Object(x.translate)()(Object(k.connect)($n,Gn)(Qn))},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=(n(1),o.a.createContext(null));var a=function(e){e()},u={notify:function(){}};function c(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var s=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=u,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=c())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=u)},e}();var l=function(e){var t=e.store,n=e.context,a=e.children,u=Object(r.useMemo)((function(){var e=new s(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),c=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=u.subscription;return e.trySubscribe(),c!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[u,c]);var l=n||i;return o.a.createElement(l.Provider,{value:u},a)},f=n(28),p=n(36),d=n(98),h=n.n(d),v=n(97),y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,g=[],m=[null,null];function b(e,t){var n=e[1];return[t.payload,n+1]}function w(e,t,n){y((function(){return e.apply(void 0,t)}),n)}function k(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function x(e,t,n,r,o,i,a,u,c,s){if(e){var l=!1,f=null,p=function(){if(!l){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,f=e}n||(f=null),e===i.current?a.current||c():(i.current=e,u.current=e,a.current=!0,s({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var _=function(){return[null,0]};function O(e,t){void 0===t&&(t={});var n=t,a=n.getDisplayName,u=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,c=n.methodName,l=void 0===c?"connectAdvanced":c,d=n.renderCountProp,y=void 0===d?void 0:d,O=n.shouldHandleStateChanges,S=void 0===O||O,E=n.storeKey,j=void 0===E?"store":E,P=(n.withRef,n.forwardRef),C=void 0!==P&&P,T=n.context,A=void 0===T?i:T,D=Object(p.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),R=A;return function(t){var n=t.displayName||t.name||"Component",i=u(n),a=Object(f.a)({},D,{getDisplayName:u,methodName:l,renderCountProp:y,shouldHandleStateChanges:S,storeKey:j,displayName:i,wrappedComponentName:n,WrappedComponent:t}),c=D.pure;var d=c?r.useMemo:function(e){return e()};function O(n){var i=Object(r.useMemo)((function(){var e=n.forwardedRef,t=Object(p.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),u=i[0],c=i[1],l=i[2],h=Object(r.useMemo)((function(){return u&&u.Consumer&&Object(v.isContextConsumer)(o.a.createElement(u.Consumer,null))?u:R}),[u,R]),y=Object(r.useContext)(h),O=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(y)&&Boolean(y.store);var E=O?n.store:y.store,j=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,a)}(E)}),[E]),P=Object(r.useMemo)((function(){if(!S)return m;var e=new s(E,O?null:y.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[E,O,y]),C=P[0],T=P[1],A=Object(r.useMemo)((function(){return O?y:Object(f.a)({},y,{subscription:C})}),[O,y,C]),D=Object(r.useReducer)(b,g,_),I=D[0][0],N=D[1];if(I&&I.error)throw I.error;var z=Object(r.useRef)(),M=Object(r.useRef)(l),F=Object(r.useRef)(),L=Object(r.useRef)(!1),U=d((function(){return F.current&&l===M.current?F.current:j(E.getState(),l)}),[E,I,l]);w(k,[M,z,L,l,U,F,T]),w(x,[S,E,C,j,M,z,L,F,T,N],[E,C,j]);var B=Object(r.useMemo)((function(){return o.a.createElement(t,Object(f.a)({},U,{ref:c}))}),[c,t,U]);return Object(r.useMemo)((function(){return S?o.a.createElement(h.Provider,{value:A},B):B}),[h,B,A])}var E=c?o.a.memo(O):O;if(E.WrappedComponent=t,E.displayName=i,C){var P=o.a.forwardRef((function(e,t){return o.a.createElement(E,Object(f.a)({},e,{forwardedRef:t}))}));return P.displayName=i,P.WrappedComponent=t,h()(P,t)}return h()(E,t)}}function S(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function E(e,t){if(S(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!S(e[n[o]],t[n[o]]))return!1;return!0}var j=n(192);function P(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function C(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function T(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=C(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=C(o),o=r(t,n)),o},r}}var A=[function(e){return"function"==typeof e?T(e):void 0},function(e){return e?void 0:P((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?P((function(t){return Object(j.bindActionCreators)(e,t)})):void 0}];var D=[function(e){return"function"==typeof e?T(e):void 0},function(e){return e?void 0:P((function(){return{}}))}];function R(e,t,n){return Object(f.a)({},n,{},e,{},t)}var I=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,u){var c=e(t,n,u);return a?o&&i(c,r)||(r=c):(a=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return R}}];function N(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function z(e,t,n,r,o){var i,a,u,c,s,l=o.areStatesEqual,f=o.areOwnPropsEqual,p=o.areStatePropsEqual,d=!1;function h(o,d){var h,v,y=!f(d,a),g=!l(o,i);return i=o,a=d,y&&g?(u=e(i,a),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):y?(e.dependsOnOwnProps&&(u=e(i,a)),t.dependsOnOwnProps&&(c=t(r,a)),s=n(u,c,a)):g?(h=e(i,a),v=!p(h,u),u=h,v&&(s=n(u,c,a)),s):s}return function(o,l){return d?h(o,l):(u=e(i=o,a=l),c=t(r,a),s=n(u,c,a),d=!0,s)}}function M(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=Object(p.a)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),a=n(e,i),u=r(e,i),c=o(e,i);return(i.pure?z:N)(a,u,c,e,i)}function F(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function L(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?O:n,o=t.mapStateToPropsFactories,i=void 0===o?D:o,a=t.mapDispatchToPropsFactories,u=void 0===a?A:a,c=t.mergePropsFactories,s=void 0===c?I:c,l=t.selectorFactory,d=void 0===l?M:l;return function(e,t,n,o){void 0===o&&(o={});var a=o,c=a.pure,l=void 0===c||c,h=a.areStatesEqual,v=void 0===h?L:h,y=a.areOwnPropsEqual,g=void 0===y?E:y,m=a.areStatePropsEqual,b=void 0===m?E:m,w=a.areMergedPropsEqual,k=void 0===w?E:w,x=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),_=F(e,i,"mapStateToProps"),O=F(t,u,"mapDispatchToProps"),S=F(n,s,"mergeProps");return r(d,Object(f.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:_,initMapDispatchToProps:O,initMergeProps:S,pure:l,areStatesEqual:v,areOwnPropsEqual:g,areStatePropsEqual:b,areMergedPropsEqual:k},x))}}var B=U();function q(){return Object(r.useContext)(i)}function H(e){void 0===e&&(e=i);var t=e===i?q:function(){return Object(r.useContext)(e)};return function(){return t().store}}var W=H();function Q(e){void 0===e&&(e=i);var t=e===i?W:H(e);return function(){return t().dispatch}}var $=Q(),G=function(e,t){return e===t};function V(e){void 0===e&&(e=i);var t=e===i?q:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=G);var o=t();return function(e,t,n,o){var i,a=Object(r.useReducer)((function(e){return e+1}),0)[1],u=Object(r.useMemo)((function(){return new s(n,o)}),[n,o]),c=Object(r.useRef)(),l=Object(r.useRef)(),f=Object(r.useRef)();try{i=e!==l.current||c.current?e(n.getState()):f.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return y((function(){l.current=e,f.current=i,c.current=void 0})),y((function(){function e(){try{var e=l.current(n.getState());if(t(e,f.current))return;f.current=e}catch(e){c.current=e}a({})}return u.onStateChange=e,u.trySubscribe(),e(),function(){return u.tryUnsubscribe()}}),[n,u]),i}(e,n,o.store,o.subscription)}}var J,Y=V(),K=n(117);n.d(t,"Provider",(function(){return l})),n.d(t,"connectAdvanced",(function(){return O})),n.d(t,"ReactReduxContext",(function(){return i})),n.d(t,"connect",(function(){return B})),n.d(t,"batch",(function(){return K.unstable_batchedUpdates})),n.d(t,"useDispatch",(function(){return $})),n.d(t,"createDispatchHook",(function(){return Q})),n.d(t,"useSelector",(function(){return Y})),n.d(t,"createSelectorHook",(function(){return V})),n.d(t,"useStore",(function(){return W})),n.d(t,"createStoreHook",(function(){return H})),n.d(t,"shallowEqual",(function(){return E})),J=K.unstable_batchedUpdates,a=J},function(e,t,n){"use strict";n.r(t);var r=n(13),o=n.n(r),i=n(33),a=n(2),u=n.n(a),c=n(95),s=n(75),l=function(e){return function(t){var n=t.langs,r=t.locales,o=n&&n.length;if(!o)return t;var i=o&&n.includes(e)?e:n[0],a=r&&Object.keys(r);return a&&a.length&&a.includes(i)?(Object(c.a)(u()({},t.slug,r[i])),t):t}},f=function(e){var t=e.getState;return function(e){return function(n){var r=t();switch(n.type){case s.a:!function(e,t){e&&e.forEach(l(t))}(r.apps&&r.apps.apps,n.lang);break;case"RECEIVE_APP_LIST":n.apps&&n.apps.length&&n.apps.forEach(l(r.locale));break;case"RECEIVE_APP":n.app&&l(r.locale&&r.locale.lang)(n.app)}return e(n)}}},p=n(191),d="persist/REHYDRATE",h="persist/REGISTER",v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function g(e,t,n,r){r.debug;var o=y({},n);return e&&"object"===(void 0===e?"undefined":v(e))&&Object.keys(e).forEach((function(r){"_persist"!==r&&t[r]===n[r]&&(o[r]=e[r])})),o}function m(e){var t=e.blacklist||null,n=e.whitelist||null,r=e.transforms||[],o=e.throttle||0,i=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key,a=e.storage,u=!1===e.serialize?function(e){return e}:b,c={},s={},l=[],f=null,p=null;function d(){if(0===l.length)return f&&clearInterval(f),void(f=null);var e=l.shift(),t=r.reduce((function(t,n){return n.in(t,e,c)}),c[e]);if(void 0!==t)try{s[e]=u(t)}catch(e){console.error("redux-persist/createPersistoid: error serializing state",e)}else delete s[e];0===l.length&&(Object.keys(s).forEach((function(e){void 0===c[e]&&delete s[e]})),p=a.setItem(i,u(s)).catch(h))}function h(e){0}return{update:function(e){Object.keys(e).forEach((function(r){(function(e){return(!n||-1!==n.indexOf(e)||"_persist"===e)&&(!t||-1===t.indexOf(e))})(r)&&c[r]!==e[r]&&-1===l.indexOf(r)&&l.push(r)})),Object.keys(c).forEach((function(t){void 0===e[t]&&l.push(t)})),null===f&&(f=setInterval(d,o)),c=e},flush:function(){for(;0!==l.length;)d();return p||Promise.resolve()}}}function b(e){return JSON.stringify(e)}function w(e){var t=e.transforms||[],n=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key,r=e.storage,o=(e.debug,!1===e.serialize?function(e){return e}:k);return r.getItem(n).then((function(e){if(e)try{var n={},r=o(e);return Object.keys(r).forEach((function(e){n[e]=t.reduceRight((function(t,n){return n.out(t,e,r)}),o(r[e]))})),n}catch(e){throw e}}))}function k(e){return JSON.parse(e)}function x(e){0}var _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function O(e,t){var n=void 0!==e.version?e.version:-1,r=(e.debug,void 0===e.stateReconciler?g:e.stateReconciler),o=e.getStoredState||w,i=void 0!==e.timeout?e.timeout:5e3,a=null,u=!1,c=!0,s=function(e){return e._persist.rehydrated&&a&&!c&&a.update(e),e};return function(l,f){var p=l||{},h=p._persist,v=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(p,["_persist"]);if("persist/PERSIST"===f.type){var y=!1,g=function(t,n){y||(f.rehydrate(e.key,t,n),y=!0)};if(i&&setTimeout((function(){!y&&g(void 0,new Error('redux-persist: persist timed out for persist key "'+e.key+'"'))}),i),c=!1,a||(a=m(e)),h)return l;if("function"!=typeof f.rehydrate||"function"!=typeof f.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(e.key),o(e).then((function(t){(e.migrate||function(e,t){return Promise.resolve(e)})(t,n).then((function(e){g(e)}),(function(e){g(void 0,e)}))}),(function(e){g(void 0,e)})),_({},t(v,f),{_persist:{version:n,rehydrated:!1}})}if("persist/PURGE"===f.type)return u=!0,f.result(function(e){var t=e.storage,n=""+(void 0!==e.keyPrefix?e.keyPrefix:"persist:")+e.key;return t.removeItem(n,x)}(e)),_({},t(v,f),{_persist:h});if("persist/FLUSH"===f.type)return f.result(a&&a.flush()),_({},t(v,f),{_persist:h});if("persist/PAUSE"===f.type)c=!0;else if(f.type===d){if(u)return _({},v,{_persist:_({},h,{rehydrated:!0})});if(f.key===e.key){var b=t(v,f),w=f.payload,k=!1!==r&&void 0!==w?r(w,l,b,e):b,O=_({},k,{_persist:_({},h,{rehydrated:!0})});return s(O)}}if(!h)return t(l,f);var S=t(v,f);return S===v?l:(S._persist=h,s(S))}}var S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function j(e,t,n,r){r.debug;var o=E({},n);return e&&"object"===(void 0===e?"undefined":S(e))&&Object.keys(e).forEach((function(r){var i;"_persist"!==r&&(t[r]===n[r]&&(null===(i=n[r])||Array.isArray(i)||"object"!==(void 0===i?"undefined":S(i))?o[r]=e[r]:o[r]=E({},o[r],e[r])))})),o}var P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function C(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var T={registry:[],bootstrapped:!1},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T,t=arguments[1];switch(t.type){case h:return P({},e,{registry:[].concat(C(e.registry),[t.key])});case d:var n=e.registry.indexOf(t.key),r=[].concat(C(e.registry));return r.splice(n,1),P({},e,{registry:r,bootstrapped:0===r.length});default:return e}};var D=n(12),R=n(339),I=n(340),N=n.n(I),z=n(341),M=n.n(z),F=n(129);n.d(t,"createStore",(function(){return Q}));var L={storage:N.a,key:"cozy-bar",whitelist:M.a};Object(R.createLogger)({titleFormatter:function(e,t){var n=["[COZY-BAR]"];return n.push("".concat(String(e.type))),t&&n.push("@ ".concat(t)),n.join(" ")},logger:F.a});var U,B,q=(U=L,B=o()({},D.t),U.stateReconciler=void 0===U.stateReconciler?j:U.stateReconciler,O(U,Object(i.c)(B))),H=[f,p.default];var W,Q=function(){var e,t,n,r,o,a,u,c;return W=Object(i.e)(q,i.a.apply(null,H)),e=W,r=n||!1,o=Object(i.e)(A,T,t?t.enhancer:void 0),a=function(e){o.dispatch({type:h,key:e})},u=function(t,n,i){var a={type:d,payload:n,err:i,key:t};e.dispatch(a),o.dispatch(a),r&&c.getState().bootstrapped&&(r(),r=!1)},(c=P({},o,{purge:function(){var t=[];return e.dispatch({type:"persist/PURGE",result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:"persist/FLUSH",result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:"persist/PAUSE"})},persist:function(){e.dispatch({type:"persist/PERSIST",register:a,rehydrate:u})}})).persist(),W};t.default=function(){return W||(W=Q()),W}},function(e,t,n){"use strict";n.r(t);var r=n(5),o=n.n(r),i=n(8),a=n.n(i),u=n(23),c=n(21),s=n(12),l=n(4),f=n.n(l),p=n(7),d=n.n(p),h=n(9),v=n.n(h),y=n(10),g=n.n(y),m=n(6),b=n.n(m),w=n(0),k=n.n(w),x=["left","center","right","search"],_=function(e){return e[0].toUpperCase()+e.slice(1)},O=function(e){return"setBar".concat(_(e))},S=function(e){return"Bar".concat(_(e))};function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var o=b()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g()(this,n)}}var j=0,P=function(e){var t={};return x.forEach((function(n){t[O(n)]=function(t){return e.dispatch(Object(s.u)(n,"string"==typeof(r=t)?k.a.createElement("span",{dangerouslySetInnerHTML:{__html:r}}):r,"js"));var r},t[S(n)]=function(e,t){return function(n){v()(o,n);var r=E(o);function o(){return f()(this,o),r.apply(this,arguments)}return d()(o,[{key:"componentDidMount",value:function(){this.componentId=j++,this.setContent(this.props.children)}},{key:"setContent",value:function(n){try{n=k.a.Children.only(n)}catch(e){}e.dispatch(Object(s.u)(t,n,this.componentId))}},{key:"unsetContent",value:function(){e.dispatch(Object(s.A)(t,this.componentId))}},{key:"componentWillUnmount",value:function(){this.unsetContent()}},{key:"componentDidUpdate",value:function(e){this.props.children!==e.children&&this.setContent(this.props.children)}},{key:"render",value:function(){return null}}]),o}(w.Component)}(e,n)})),t.setLocale=function(){e.dispatch(s.w.apply(void 0,arguments))},t.setTheme=function(){e.dispatch(s.x.apply(void 0,arguments))},t.setWebviewContext=function(){e.dispatch(s.y.apply(void 0,arguments))},t},C=function(e){console.error("You tried to use the CozyBar API (".concat(e,") but the CozyBar is not initialised yet via cozy.bar.init(...)."))},T=function(e,t){return function(){if(e[t])return e[t].apply(e,arguments);C(t)}},A=function(){var e=document.querySelector("[role=application]");return e&&e.dataset?e.dataset:{}},D=function(){var e=document.querySelector('link[rel="icon"][sizes^="32"]');return null!==e?e.getAttribute("href"):"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},R=function(){return A().cozyAppNamePrefix||null},I=function(){return A().cozyAppSlug||null},N=function(){var e=document.querySelector("meta[name=user-action-required]"),t=e&&e.dataset;if(t){var n=t.title,r=t.code,o=t.detail,i=t.links;if(r)return{title:n,code:r,detail:o,links:i}}};n(447),n(448);n.d(t,"init",(function(){return U})),n.d(t,"version",(function(){return Z})),n.d(t,"setBarCenter",(function(){return H})),n.d(t,"setBarLeft",(function(){return W})),n.d(t,"setBarRight",(function(){return Q})),n.d(t,"setBarSearch",(function(){return $})),n.d(t,"BarLeft",(function(){return J})),n.d(t,"BarRight",(function(){return V})),n.d(t,"BarCenter",(function(){return G})),n.d(t,"BarSearch",(function(){return Y})),n.d(t,"setTheme",(function(){return K})),n.d(t,"setWebviewContext",(function(){return X})),n.d(t,"updateAccessToken",(function(){return B})),n.d(t,"setLocale",(function(){return s.w}));var z=function(e){if(null===document.getElementById("coz-bar")){var t=function(){var e=Object(u.isMobileApp)()?"mobile":"browser",t=document.createElement("div");return t.setAttribute("id","coz-bar"),t.setAttribute("role","banner"),t.classList.add("coz-target--".concat(e)),t}(),n=document.querySelector("[role=application]");return n?(document.body.insertBefore(t,n),e.onDrawer=function(e){t.dataset.drawerVisible=e},e.userActionRequired&&document.body.classList.add("has-banner"),t):(console.warn('Cozy-bar is looking for a "'.concat("[role=application]","\" tag that contains your application and can't find it :'(… The BAR is now disabled")),null)}},M=function(e,t){var r=n(0),o=n(117).render,i=n(37),a=i.connect,u=i.Provider,c=n(20).default,l=n(678).default,f=n(29).CozyProvider,p=t.cozyClient,d=a((function(e){return{lang:Object(s.g)(e)}}))(c),h=r.createElement(u,{store:t.reduxStore},r.createElement(d,{dictRequire:function(e){return n(675)("./".concat(e))}},p?r.createElement(f,{client:p},r.createElement(l,t)):r.createElement(l,t)));return o(h,e),h},F=function(e){var t=e.cozyURL,r=e.token,o=e.isPublic,i={uri:t||function(e){var t=A();if(!t.cozyDomain)return e||console.warn("Cozy-bar can't discover the cozy's URL, and will probably fail to initialize the connection with the stack."),"";var n=window.location.protocol;return"".concat(n,"//").concat(t.cozyDomain)}(o),token:r||function(e){var t=A();return t.cozyToken?t.cozyToken:(e||console.warn("Cozy-bar can't discover the app's token, and will probably fail to initialize the connection with the stack."),"")}(o)},a=n(29).default;return console.warn("Automatically made cozyClient. Options: ",i),new a(i)},L={},U=function(){var e=a()(o.a.mark((function e(){var t,r,i,a,u,l,f,p,d,h,v,y,g,m,b,w,k,x,_,O,S,E,j=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=j.length>0&&void 0!==j[0]?j[0]:{},r=t.appName,i=t.appNamePrefix,a=void 0===i?R():i,u=t.appSlug,l=void 0===u?I():u,f=t.lang,p=t.iconPath,d=void 0===p?D():p,h=t.cozyClient,v=t.cozyURL,y=t.token,g=t.replaceTitleOnMobile,m=void 0!==g&&g,b=t.isPublic,w=void 0!==b&&b,k=t.onLogOut,!w&&/^\/public/.test(window.location.pathname)&&(w=!0),h||(h=F({cozyURL:v,token:y,isPublic:w})),x=n(680).default,(_=x()).dispatch(Object(s.v)(r,a,l)),c.b.init({cozyClient:h,onCreate:function(e){return _.dispatch(Object(s.r)(e))},onDelete:function(e){return _.dispatch(Object(s.s)(e))}}),f&&_.dispatch(Object(s.w)(f)),O=P(_),Object.assign(L,O),S={appName:r,appNamePrefix:a,appSlug:l,cozyClient:h,iconPath:d,replaceTitleOnMobile:m,isPublic:w,onLogOut:k,userActionRequired:N(),reduxStore:_},E=z(S),M(E,S);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(e){c.b.updateAccessToken(e)},q=function(e){var t={};x.forEach((function(n){var r=O(n),o=S(n);t[r]=T(e,r),t[o]=function(t){if(e[o])return k.a.createElement(e[o],t);C(o)}}));for(var n=0,r=["setLocale","setTheme","setWebviewContext"];n<r.length;n++){var o=r[n];t[o]=T(e,o)}return t}(L),H=q.setBarCenter,W=q.setBarLeft,Q=q.setBarRight,$=q.setBarSearch,G=q.BarCenter,V=q.BarRight,J=q.BarLeft,Y=q.BarSearch,K=q.setTheme,X=q.setWebviewContext,Z="7.17.3"}])}));
|
|
57
57
|
//# sourceMappingURL=cozy-bar.min.js.map
|