Build 576754stable
Module 422998
14,032 characters · in 68925.4de164704c201108.jsDependencies
Source Raw
function(e,t,r){"use strict";r.d(t,{mg:()=>J,vd:()=>$});var n=r(64700),i=r(655972),o=r.n(i),a=r(412700),s=r.n(a),l=r(284009),u=r.n(l),c=r(859141),f=r.n(c);function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,h(e,t)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var g={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},v={rel:["amphtml","canonical","alternate"]},y={type:["application/ld+json"]},b={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},w=Object.keys(g).map(function(e){return g[e]}),_={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},x=Object.keys(_).reduce(function(e,t){return e[_[t]]=t,e},{}),E=function(e,t){for(var r=e.length-1;r>=0;r-=1){var n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},S=function(e){var t=E(e,g.TITLE),r=E(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,function(){return t});var n=E(e,"defaultTitle");return t||n||void 0},k=function(e,t){return t.filter(function(t){return void 0!==t[e]}).map(function(t){return t[e]}).reduce(function(e,t){return d({},e,t)},{})},T=function(e,t,r){var n={};return r.filter(function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+e+' should be of type "Array". Instead found type "'+typeof t[e]+'"'),!1)}).map(function(t){return t[e]}).reverse().reduce(function(e,r){var i={};r.filter(function(e){for(var r,o=Object.keys(e),a=0;a<o.length;a+=1){var s=o[a],l=s.toLowerCase();-1===t.indexOf(l)||"rel"===r&&"canonical"===e[r].toLowerCase()||"rel"===l&&"stylesheet"===e[l].toLowerCase()||(r=l),-1===t.indexOf(s)||"innerHTML"!==s&&"cssText"!==s&&"itemprop"!==s||(r=s)}if(!r||!e[r])return!1;var u=e[r].toLowerCase();return n[r]||(n[r]={}),i[r]||(i[r]={}),!n[r][u]&&(i[r][u]=!0,!0)}).reverse().forEach(function(t){return e.push(t)});for(var o=Object.keys(i),a=0;a<o.length;a+=1){var s=o[a],l=d({},n[s],i[s]);n[s]=l}return e},[]).reverse()},C=function(e,t){if(Array.isArray(e)&&e.length){for(var r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},P=function(e){return Array.isArray(e)?e.join(""):e},A=function(e,t){return Array.isArray(e)?e.reduce(function(e,r){return!function(e,t){for(var r=Object.keys(e),n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1}(r,t)?e.default.push(r):e.priority.push(r),e},{priority:[],default:[]}):{default:e}},O=function(e,t){var r;return d({},e,((r={})[t]=void 0,r))},M=[g.NOSCRIPT,g.SCRIPT,g.STYLE],I=function(e,t){return void 0===t&&(t=!0),!1===t?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},R=function(e){return Object.keys(e).reduce(function(t,r){var n=void 0!==e[r]?r+'="'+e[r]+'"':""+r;return t?t+" "+n:n},"")},D=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce(function(t,r){return t[_[r]||r]=e[r],t},t)},L=function(e,t){return t.map(function(t,r){var i,o=((i={key:r})["data-rh"]=!0,i);return Object.keys(t).forEach(function(e){var r=_[e]||e;"innerHTML"===r||"cssText"===r?o.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:o[r]=t[e]}),n.createElement(e,o)})},F=function(e,t,r){switch(e){case g.TITLE:return{toComponent:function(){var e,r,i,o;return r=t.titleAttributes,(i={key:e=t.title})["data-rh"]=!0,o=D(r,i),[n.createElement(g.TITLE,o,e)]},toString:function(){var n,i,o,a;return n=t.title,i=t.titleAttributes,o=R(i),a=P(n),o?"<"+e+' data-rh="true" '+o+">"+I(a,r)+"</"+e+">":"<"+e+' data-rh="true">'+I(a,r)+"</"+e+">"}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return D(t)},toString:function(){return R(t)}};default:return{toComponent:function(){return L(e,t)},toString:function(){return t.reduce(function(t,n){var i=Object.keys(n).filter(function(e){return"innerHTML"!==e&&"cssText"!==e}).reduce(function(e,t){var i=void 0===n[t]?t:t+'="'+I(n[t],r)+'"';return e?e+" "+i:i},""),o=n.innerHTML||n.cssText||"",a=-1===M.indexOf(e);return t+"<"+e+' data-rh="true" '+i+(a?"/>":">"+o+"</"+e+">")},"")}}}},N=function(e){var t=e.baseTag,r=e.bodyAttributes,n=e.encode,i=e.htmlAttributes,o=e.noscriptTags,a=e.styleTags,s=e.title,l=e.titleAttributes,u=e.linkTags,c=e.metaTags,f=e.scriptTags,d={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var p,h,m,w,_,x,E=(p=e.linkTags,h=e.scriptTags,m=e.encode,w=A(e.metaTags,b),_=A(p,v),x=A(h,y),{priorityMethods:{toComponent:function(){return[].concat(L(g.META,w.priority),L(g.LINK,_.priority),L(g.SCRIPT,x.priority))},toString:function(){return F(g.META,w.priority,m)+" "+F(g.LINK,_.priority,m)+" "+F(g.SCRIPT,x.priority,m)}},metaTags:w.default,linkTags:_.default,scriptTags:x.default});d=E.priorityMethods,u=E.linkTags,c=E.metaTags,f=E.scriptTags}return{priority:d,base:F(g.BASE,t,n),bodyAttributes:F("bodyAttributes",r,n),htmlAttributes:F("htmlAttributes",i,n),link:F(g.LINK,u,n),meta:F(g.META,c,n),noscript:F(g.NOSCRIPT,o,n),script:F(g.SCRIPT,f,n),style:F(g.STYLE,a,n),title:F(g.TITLE,{title:void 0===s?"":s,titleAttributes:l},n)}},j=[],V=function(e,t){var r=this;void 0===t&&(t="u">typeof document),this.instances=[],this.value={setHelmet:function(e){r.context.helmet=e},helmetInstances:{get:function(){return r.canUseDOM?j:r.instances},add:function(e){(r.canUseDOM?j:r.instances).push(e)},remove:function(e){var t=(r.canUseDOM?j:r.instances).indexOf(e);(r.canUseDOM?j:r.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=N({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},B=n.createContext({}),U=o().shape({setHelmet:o().func,helmetInstances:o().shape({get:o().func,add:o().func,remove:o().func})}),K="u">typeof document,$=function(e){function t(r){var n;return(n=e.call(this,r)||this).helmetData=new V(n.props.context,t.canUseDOM),n}return p(t,e),t.prototype.render=function(){return n.createElement(B.Provider,{value:this.helmetData.value},this.props.children)},t}(n.Component);$.canUseDOM=K,$.propTypes={context:o().shape({helmet:o().shape()}),children:o().node.isRequired},$.defaultProps={context:{}},$.displayName="HelmetProvider";var z=function(e,t){var r,n=document.head||document.querySelector(g.HEAD),i=n.querySelectorAll(e+"[data-rh]"),o=[].slice.call(i),a=[];return t&&t.length&&t.forEach(function(t){var n=document.createElement(e);for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&("innerHTML"===i?n.innerHTML=t.innerHTML:"cssText"===i?n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText)):n.setAttribute(i,void 0===t[i]?"":t[i]));n.setAttribute("data-rh","true"),o.some(function(e,t){return r=t,n.isEqualNode(e)})?o.splice(r,1):a.push(n)}),o.forEach(function(e){return e.parentNode.removeChild(e)}),a.forEach(function(e){return n.appendChild(e)}),{oldTags:o,newTags:a}},W=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var n=r.getAttribute("data-rh"),i=n?n.split(","):[],o=[].concat(i),a=Object.keys(t),s=0;s<a.length;s+=1){var l=a[s],u=t[l]||"";r.getAttribute(l)!==u&&r.setAttribute(l,u),-1===i.indexOf(l)&&i.push(l);var c=o.indexOf(l);-1!==c&&o.splice(c,1)}for(var f=o.length-1;f>=0;f-=1)r.removeAttribute(o[f]);i.length===o.length?r.removeAttribute("data-rh"):r.getAttribute("data-rh")!==a.join(",")&&r.setAttribute("data-rh",a.join(","))}},H=function(e,t){var r=e.baseTag,n=e.htmlAttributes,i=e.linkTags,o=e.metaTags,a=e.noscriptTags,s=e.onChangeClientState,l=e.scriptTags,u=e.styleTags,c=e.title,f=e.titleAttributes;W(g.BODY,e.bodyAttributes),W(g.HTML,n),void 0!==c&&document.title!==c&&(document.title=P(c)),W(g.TITLE,f);var d={baseTag:z(g.BASE,r),linkTags:z(g.LINK,i),metaTags:z(g.META,o),noscriptTags:z(g.NOSCRIPT,a),scriptTags:z(g.SCRIPT,l),styleTags:z(g.STYLE,u)},p={},h={};Object.keys(d).forEach(function(e){var t=d[e],r=t.newTags,n=t.oldTags;r.length&&(p[e]=r),n.length&&(h[e]=d[e].oldTags)}),t&&t(),s(e,p,h)},G=null,q=function(e){function t(){for(var t,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).rendered=!1,t}p(t,e);var r=t.prototype;return r.shouldComponentUpdate=function(e){return!f()(e,this.props)},r.componentDidUpdate=function(){this.emitChange()},r.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},r.emitChange=function(){var e,t,r=this.props.context,n=r.setHelmet,i=null,o={baseTag:(e=["href"],(t=r.helmetInstances.get().map(function(e){var t=d({},e.props);return delete t.context,t})).filter(function(e){return void 0!==e[g.BASE]}).map(function(e){return e[g.BASE]}).reverse().reduce(function(t,r){if(!t.length)for(var n=Object.keys(r),i=0;i<n.length;i+=1){var o=n[i].toLowerCase();if(-1!==e.indexOf(o)&&r[o])return t.concat(r)}return t},[])),bodyAttributes:k("bodyAttributes",t),defer:E(t,"defer"),encode:E(t,"encodeSpecialCharacters"),htmlAttributes:k("htmlAttributes",t),linkTags:T(g.LINK,["rel","href"],t),metaTags:T(g.META,["name","charset","http-equiv","property","itemprop"],t),noscriptTags:T(g.NOSCRIPT,["innerHTML"],t),onChangeClientState:E(t,"onChangeClientState")||function(){},scriptTags:T(g.SCRIPT,["src","innerHTML"],t),styleTags:T(g.STYLE,["cssText"],t),title:S(t),titleAttributes:k("titleAttributes",t),prioritizeSeoTags:C(t,"prioritizeSeoTags")};$.canUseDOM?(G&&cancelAnimationFrame(G),o.defer?G=requestAnimationFrame(function(){H(o,function(){G=null})}):(H(o),G=null)):N&&(i=N(o)),n(i)},r.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},r.render=function(){return this.init(),null},t}(n.Component);q.propTypes={context:U.isRequired},q.displayName="HelmetDispatcher";var Y=["children"],X=["children"],J=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var r=t.prototype;return r.shouldComponentUpdate=function(e){return!s()(O(this.props,"helmetData"),O(e,"helmetData"))},r.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case g.SCRIPT:case g.NOSCRIPT:return{innerHTML:t};case g.STYLE:return{cssText:t};default:throw Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},r.flattenArrayTypeChildren=function(e){var t,r=e.child,n=e.arrayTypeChildren;return d({},n,((t={})[r.type]=[].concat(n[r.type]||[],[d({},e.newChildProps,this.mapNestedChildrenToProps(r,e.nestedChildren))]),t))},r.mapObjectTypeChildren=function(e){var t,r,n=e.child,i=e.newProps,o=e.newChildProps,a=e.nestedChildren;switch(n.type){case g.TITLE:return d({},i,((t={})[n.type]=a,t.titleAttributes=d({},o),t));case g.BODY:return d({},i,{bodyAttributes:d({},o)});case g.HTML:return d({},i,{htmlAttributes:d({},o)});default:return d({},i,((r={})[n.type]=d({},o),r))}},r.mapArrayTypeChildrenToProps=function(e,t){var r=d({},t);return Object.keys(e).forEach(function(t){var n;r=d({},r,((n={})[t]=e[t],n))}),r},r.warnOnInvalidChildren=function(e,t){return u()(w.some(function(t){return e.type===t}),"function"==typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+w.join(", ")+" are allowed. Helmet does not support rendering <"+e.type+"> elements. Refer to our API for more information."),u()(!t||"string"==typeof t||Array.isArray(t)&&!t.some(function(e){return"string"!=typeof e}),"Helmet expects a string as a child of <"+e.type+">. Did you forget to wrap your children in braces? ( <"+e.type+">{``}</"+e.type+"> ) Refer to our API for more information."),!0},r.mapChildrenToProps=function(e,t){var r=this,i={};return n.Children.forEach(e,function(e){if(e&&e.props){var n=e.props,o=n.children,a=m(n,Y),s=Object.keys(a).reduce(function(e,t){return e[x[t]||t]=a[t],e},{}),l=e.type;switch("symbol"==typeof l?l=l.toString():r.warnOnInvalidChildren(e,o),l){case g.FRAGMENT:t=r.mapChildrenToProps(o,t);break;case g.LINK:case g.META:case g.NOSCRIPT:case g.SCRIPT:case g.STYLE:i=r.flattenArrayTypeChildren({child:e,arrayTypeChildren:i,newChildProps:s,nestedChildren:o});break;default:t=r.mapObjectTypeChildren({child:e,newProps:t,newChildProps:s,nestedChildren:o})}}}),this.mapArrayTypeChildrenToProps(i,t)},r.render=function(){var e=this.props,t=e.children,r=m(e,X),i=d({},r),o=r.helmetData;return t&&(i=this.mapChildrenToProps(t,i)),!o||o instanceof V||(o=new V(o.context,o.instances)),o?n.createElement(q,d({},i,{context:o.value,helmetData:void 0})):n.createElement(B.Consumer,null,function(e){return n.createElement(q,d({},i,{context:e}))})},t}(n.Component);J.propTypes={base:o().object,bodyAttributes:o().object,children:o().oneOfType([o().arrayOf(o().node),o().node]),defaultTitle:o().string,defer:o().bool,encodeSpecialCharacters:o().bool,htmlAttributes:o().object,link:o().arrayOf(o().object),meta:o().arrayOf(o().object),noscript:o().arrayOf(o().object),onChangeClientState:o().func,script:o().arrayOf(o().object),style:o().arrayOf(o().object),title:o().string,titleAttributes:o().object,titleTemplate:o().string,prioritizeSeoTags:o().bool,helmetData:o().object},J.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},J.displayName="Helmet"}