Files
baiducom/ssl/static/js/5658-b3c86550e8c297e6.js
T
2024-09-24 17:45:24 +08:00

5 lines
11 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5658],{40725:function(e,t){"use strict";/*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/ var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function o(e){this.parameters=Object.create(null),this.type=e}t.Q=function(e){if(!e)throw TypeError("argument string is required");var t,a,s,c="object"==typeof e?function(e){var t;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"string"!=typeof t)throw TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof c)throw TypeError("argument string is required to be a string");var l=c.indexOf(";"),u=-1!==l?c.slice(0,l).trim():c.trim();if(!i.test(u))throw TypeError("invalid media type");var p=new o(u.toLowerCase());if(-1!==l){for(r.lastIndex=l;a=r.exec(c);){if(a.index!==l)throw TypeError("invalid parameter format");l+=a[0].length,t=a[1].toLowerCase(),34===(s=a[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(n,"$1")),p.parameters[t]=s}if(l!==c.length)throw TypeError("invalid parameter format")}return p}},74049:function(e,t,r){"use strict";var n=r(60444);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},40507:function(e,t,r){e.exports=r(74049)()},60444:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},25658:function(e,t,r){"use strict";r.d(t,{Q:function(){return T}});var n=r(40574),i=r(51163),o=r(25542),a=r(96583),s=r(40725),c=new Map,l=function(e){return e.cloneNode(!0)},u=function(){return"file:"===window.location.protocol},p=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===n.readyState){var t=n.getResponseHeader("Content-Type");if(!t)throw Error("Content type not found");var i=(0,s.Q)(t).type;if(!("image/svg+xml"===i||"text/plain"===i))throw Error("Invalid content type: ".concat(i))}if(4===n.readyState){if(404===n.status||null===n.responseXML)throw Error(u()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(200===n.status||u()&&0===n.status)r(null,n);else throw Error("There was a problem injecting the SVG: "+n.status+" "+n.statusText)}}catch(o){if(n.abort(),o instanceof Error)r(o,n);else throw o}},n.open("GET",e),n.withCredentials=t,n.overrideMimeType&&n.overrideMimeType("text/xml"),n.send()},f={},d=function(e,t){f[e]=f[e]||[],f[e].push(t)},h=function(e){for(var t=function(t,r){setTimeout(function(){if(Array.isArray(f[e])){var r=c.get(e),n=f[e][t];r instanceof SVGSVGElement&&n(null,l(r)),r instanceof Error&&n(r),t===f[e].length-1&&delete f[e]}},0)},r=0,n=f[e].length;r<n;r++)t(r)},v=function(e,t,r){if(c.has(e)){var n=c.get(e);if(void 0===n){d(e,r);return}if(n instanceof SVGSVGElement){r(null,l(n));return}}c.set(e,void 0),d(e,r),p(e,t,function(t,r){var n;t?c.set(e,t):(null===(n=r.responseXML)||void 0===n?void 0:n.documentElement)instanceof SVGSVGElement&&c.set(e,r.responseXML.documentElement),h(e)})},m=function(e,t,r){p(e,t,function(e,t){var n;e?r(e):(null===(n=t.responseXML)||void 0===n?void 0:n.documentElement)instanceof SVGSVGElement&&r(null,t.responseXML.documentElement)})},g=0,y=[],b={},w="http://www.w3.org/1999/xlink",E=function(e,t,r,n,i,o,s){var c=e.getAttribute("data-src")||e.getAttribute("src");if(!c){s(Error("Invalid data-src or src attribute"));return}if(-1!==y.indexOf(e)){y.splice(y.indexOf(e),1),e=null;return}y.push(e),e.setAttribute("src",""),(n?v:m)(c,i,function(n,i){if(!i){y.splice(y.indexOf(e),1),e=null,s(n);return}var l,u,p=e.getAttribute("id");p&&i.setAttribute("id",p);var f=e.getAttribute("title");f&&i.setAttribute("title",f);var d=e.getAttribute("width");d&&i.setAttribute("width",d);var h=e.getAttribute("height");h&&i.setAttribute("height",h);var v=Array.from(new Set((0,a.__spreadArray)((0,a.__spreadArray)((0,a.__spreadArray)([],(i.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();i.setAttribute("class",v);var m=e.getAttribute("style");m&&i.setAttribute("style",m),i.setAttribute("data-src",c);var E=[].filter.call(e.attributes,function(e){return/^data-\w[\w-]*$/.test(e.name)});if(Array.prototype.forEach.call(E,function(e){e.name&&e.value&&i.setAttribute(e.name,e.value)}),r){var A,S,x,C,R,k={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(k).forEach(function(e){A=e,x=k[e],S=i.querySelectorAll(A+"[id]");for(var t=0,r=S.length;t<r;t++)!function(e,t){R=(C=S[e].id)+"-"+ ++g,Array.prototype.forEach.call(x,function(e){r=i.querySelectorAll("["+e+'*="'+C+'"]');for(var t=0,n=r.length;t<n;t++){var o=r[t].getAttribute(e);(!o||o.match(RegExp('url\\("?#'+C+'"?\\)')))&&r[t].setAttribute(e,"url(#"+R+")")}});for(var r,n=i.querySelectorAll("[*|href]"),o=[],a=0,s=n.length;a<s;a++){var c=n[a].getAttributeNS(w,"href");c&&c.toString()==="#"+S[e].id&&o.push(n[a])}for(var l=0,u=o.length;l<u;l++)o[l].setAttributeNS(w,"href","#"+R);S[e].id=R}(t)})}i.removeAttribute("xmlns:a");for(var I=i.querySelectorAll("script"),T=[],j=0,_=I.length;j<_;j++)(u=I[j].getAttribute("type"))&&"application/ecmascript"!==u&&"application/javascript"!==u&&"text/javascript"!==u||((l=I[j].innerText||I[j].textContent)&&T.push(l),i.removeChild(I[j]));if(T.length>0&&("always"===t||"once"===t&&!b[c])){for(var q=0,O=T.length;q<O;q++)Function(T[q])(window);b[c]=!0}var W=i.querySelectorAll("style");if(Array.prototype.forEach.call(W,function(e){e.textContent+=""}),i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink",w),o(i),!e.parentNode){y.splice(y.indexOf(e),1),e=null,s(Error("Parent node is null"));return}e.parentNode.replaceChild(i,e),y.splice(y.indexOf(e),1),e=null,s(null,i)})},A=function(e,t){var r=void 0===t?{}:t,n=r.afterAll,i=void 0===n?function(){}:n,o=r.afterEach,a=void 0===o?function(){}:o,s=r.beforeEach,c=void 0===s?function(){}:s,l=r.cacheRequests,u=void 0===l||l,p=r.evalScripts,f=void 0===p?"never":p,d=r.httpRequestWithCredentials,h=void 0!==d&&d,v=r.renumerateIRIElements,m=void 0===v||v;if(e&&"length"in e)for(var g=0,y=0,b=e.length;y<b;y++)E(e[y],f,m,u,h,c,function(t,r){a(t,r),e&&"length"in e&&e.length===++g&&i(g)});else e?E(e,f,m,u,h,c,function(t,r){a(t,r),i(1),e=null}):i(0)},S=r(40507),x=r(59496),C=function(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1},R=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],k="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xlink",T=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).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}r=t,a=e,r.prototype=Object.create(a.prototype),r.prototype.constructor=r,(0,o.Z)(r,a);var r,a,s=t.prototype;return s.renderSVG=function(){var e,t=this;if(this.reactWrapper instanceof(e=this.reactWrapper,((null==e?void 0:e.ownerDocument)||document).defaultView||window).Node){var r,n,i=this.props,o=i.desc,a=i.evalScripts,s=i.httpRequestWithCredentials,c=i.renumerateIRIElements,l=i.src,u=i.title,p=i.useRequestCache,f=this.props.onError,d=this.props.beforeInjection,h=this.props.afterInjection,v=this.props.wrapper;"svg"===v?((r=document.createElementNS(k,v)).setAttribute("xmlns",k),r.setAttribute("xmlns:xlink",I),n=document.createElementNS(k,v)):(r=document.createElement(v),n=document.createElement(v)),r.appendChild(n),n.dataset.src=l,this.nonReactWrapper=this.reactWrapper.appendChild(r);var m=function(e){if(t.removeSVG(),!t._isMounted){f(e);return}t.setState(function(){return{hasError:!0,isLoading:!1}},function(){f(e)})};A(n,{afterEach:function(e,r){if(e){m(e);return}t._isMounted&&t.setState(function(){return{isLoading:!1}},function(){try{h(r)}catch(e){m(e)}})},beforeEach:function(e){if(e.setAttribute("role","img"),o){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var r=document.createElement("desc");r.innerHTML=o,e.prepend(r)}if(u){var n=e.querySelector(":scope > title");n&&e.removeChild(n);var i=document.createElement("title");i.innerHTML=u,e.prepend(i)}try{d(e)}catch(a){m(a)}},cacheRequests:p,evalScripts:a,httpRequestWithCredentials:s,renumerateIRIElements:c})}},s.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},s.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},s.componentDidUpdate=function(e){var t=this;C((0,i.Z)({},e),this.props)&&this.setState(function(){return t.initialState},function(){t.removeSVG(),t.renderSVG()})},s.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},s.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var r=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var o=e.wrapper,a=(0,n.Z)(e,R);return x.createElement(o,(0,i.Z)({},a,{ref:this.refCallback},"svg"===o?{xmlns:k,xmlnsXlink:I}:{}),this.state.isLoading&&r&&x.createElement(r,null),this.state.hasError&&t&&x.createElement(t,null))},t}(x.Component);T.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},T.propTypes={afterInjection:S.func,beforeInjection:S.func,desc:S.string,evalScripts:S.oneOf(["always","once","never"]),fallback:S.oneOfType([S.func,S.object,S.string]),httpRequestWithCredentials:S.bool,loading:S.oneOfType([S.func,S.object,S.string]),onError:S.func,renumerateIRIElements:S.bool,src:S.string.isRequired,title:S.string,useRequestCache:S.bool,wrapper:S.oneOf(["div","span","svg"])}}}]);