5 lines
2.3 KiB
JavaScript
Executable File
5 lines
2.3 KiB
JavaScript
Executable File
(function(d){var g=window.AmazonUIPageJS||window.P,q=g._namespace||g.attributeErrors,f=q?q("AmazonRushAssetLoader","AmazonRush"):g;f.guardFatal?f.guardFatal(d)(f,window):f.execute(function(){d(f,window)})})(function(d,g,q){function f(a){l&&l.count&&l.count(a,(l.count(a)||0)+1)}function m(a){return[].concat(null!==a&&void 0!==a?a:[])}function r(a,c,b){a.addEventListener?a.addEventListener("error",c,!1):a.attachEvent&&a.attachEvent("onerror",c);a.addEventListener?a.addEventListener("load",b,!1):a.attachEvent&&
|
|
a.attachEvent("onload",b)}function x(a,c,b,h,e,d){if(a){a=document.createElement("script");r(a,e,d);if(c)a.textContent=b;else{a.async=!0;if(e=h)e=-1!==b.indexOf("images/I")||/AUIClients/.test(b);e&&a.setAttribute("crossorigin","anonymous");a.src=b}b=a}else c?(c=document.createElement("style"),r(c,e,d),c.textContent=b,b=c):(c=document.createElement("link"),r(c,e,d),c.rel="stylesheet",c.href=b,b=c);(e=document.getElementsByTagName("head")[0])&&e.appendChild(b)}function k(a,c,b){return function(d,e){function h(){x(c,
|
|
b,d,t,function(a){t?(t=!1,f("rush:resource_retry"),h()):f("rush:resource_error");a&&a.stopPropagation?a.stopPropagation():g.event&&(g.event.cancelBubble=!0)},e)}var t=!0;if(v[d])return e.call(a),!1;v[d]=!0;f("rush:resource_count");h();return!0}}function y(a,c){var b=a.name||"",h=a.fingerprint,e=n[b];b&&h||d.error("Invalid manifest (asset\x3d".concat(b,", fingerprint\x3d").concat(h,")"),"rush-asset-loader","addManifest");e&&e.fingerprint!==h&&(f(u.FINGERPRINT_MISMATCH),d.when("A").execute(function(a){a.trigger(u.FINGERPRINT_MISMATCH,
|
|
b,h,c)}));e||(a.css=m(a.css),a.inlineCss=m(a.inlineCss),a.js=m(a.js),a.inlineJs=m(a.inlineJs),n[b]=a,w.push(b+":"+h))}function p(a,c,b){function d(){++f===e&&b&&b()}var e=a.length,f=0,g=0;if(e)for(;g<e;g++)c(a[g],d);else b&&b()}function z(a,c){(a=n[a])&&c([].concat(a.css,a.js))}function A(a,c,b){if(a=n[a])p(a.css,B,c),p(a.inlineCss,C,c),p(a.js,D,b),p(a.inlineJs,E,b),a.css=a.inlineCss=a.js=a.inlineJs=[]}function F(){return w.join("|")}var l=g.ue,v={},n={},w=[],B=k(d,!1,!1),C=k(d,!1,!0),D=k(d,!0,!1),
|
|
E=k(d,!0,!0),u={FINGERPRINT_MISMATCH:"rush-asset-loader:fingerprint-mismatch"};d.register("rush-asset-loader-builder",function(){return k});d.register("rush-asset-loader",function(){return{addManifest:y,loadAsset:A,preloadAsset:z,fingerprints:F,EVENTS:u}})}); |