This repository was archived by the owner on Feb 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmin.js
More file actions
2 lines (2 loc) · 2.1 KB
/
min.js
File metadata and controls
2 lines (2 loc) · 2.1 KB
1
2
/*! (C) Andrea Giammarchi, ISC License */
!function e(t,n){var r=self.__import__||(self.__import__=t),s=[],c=/([`"'])(?:(?=(\\?))\2.)*?\1/g,i=function(e,t){return s.push(e),t+"$"+t},o=function(){return s.shift()},u=function(e){if(/^(?:[a-z]+:)\/\//.test(e))return e;for(var t,n=m.slice(0,m.lastIndexOf("/")),r=e.length,s=0,c=0;s<r;c=s+1)if((s=e.indexOf("/",c))<0)s=r,n+="/"+e.slice(c);else if(0===s)n="";else{for(t=c,c=s;c&&"."===e.charAt(c-1);)--c;switch(s-c){case 0:n+="/"+e.slice(t,s);break;case 1:break;case 2:n=n.slice(0,n.lastIndexOf("/"))}}return n.replace(/\/\.\//g,"/")},a=function(n){return r.m[n]||(r.m[n]=new Promise(function(r,s){var u=new XMLHttpRequest;u.open("GET",n),u.onerror=s,u.onload=function(){var s,a,p=u.responseText.replace(c,i),m=/^(?:export|import)\s/m.test(p),_="__import__",d=_+"r"+t.i++,h=0;p=p.replace(/(^|[^._a-zA-Z0-9$])import\(/g,"$1__import__(").replace(c,o),self[d]=function(e){delete self[d],r(e)},n=JSON.stringify(n),m?(s=[],f(l("module"),"const __import__="+e+"(self."+_+","+n+");let "+_+"default;\n"+p.replace(/^export\s+(default\s+)?([^=({;]+)/gm,function(e,t,n){return a=n.replace(/^[a-z]+\s(\S+)[\s\S]*$/,"$1")||n,t?(/^(?:class|function)\s*$/.test(a)?(a=_+h++,e=e.replace(n,n+" "+a)):/^new\s/.test(n)&&(a=_+"default",e=e.replace(n,a+"="+n)),s.push("default:"+a)):s.push(a),e}).replace(/export\s+\{([^}]+?)\}/g,function(e,t){return s.push(t.replace(/(\S+)\s+as\s+(\S+)/g,"$2:$1")),e})+";\n"+d+"({"+s.join(",")+"})")):f(l(""),d+"(function(exports,"+_+'){"use strict";return function(){'+p+";\n}(),exports}({},"+e+"("+_+","+n+")))")},u.send(null)}))},l=function(e){return n=document.createElement("script"),e&&(n.type=e),n},f=function(e,t){r.n&&e.setAttribute("nonce",r.n),e.textContent=t,setTimeout(function(){_.removeChild(e)},1),_.appendChild(e)},p=location.pathname,m="string"==typeof n?n:function(e){return"/"===e.charAt(0)?e:p.slice(0,p.lastIndexOf("/")+1)+e.replace(/^[a-zA-Z_-]/,"./$&")}(n.getAttribute("data-main")),_=document.documentElement;return r.m||(t.m=Object.create(null),t.i=0,t.n=n.getAttribute("nonce"),a(u(m))),function(e){return a(u(e))}}({},document.querySelector("script[data-main]"));