svgedit/dist/editor/system/s.min.js

3 lines
6.4 KiB
JavaScript

!function(){function e(e,n){return(n||"")+" (SystemJS https://git.io/JvFET#"+e+")"}function n(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){var t,r=n.slice(0,n.indexOf(":")+1);if(t="/"===n[r.length+1]?"file:"!==r?(t=n.slice(r.length+2)).slice(t.indexOf("/")+1):n.slice(8):n.slice(r.length+("/"===n[r.length])),"/"===e[0])return n.slice(0,n.length-t.length-1)+e;for(var i=t.slice(0,t.lastIndexOf("/")+1)+e,o=[],c=-1,u=0;i.length>u;u++)-1!==c?"/"===i[u]&&(o.push(i.slice(c,u+1)),c=-1):"."===i[u]?"."!==i[u+1]||"/"!==i[u+2]&&u+2!==i.length?"/"===i[u+1]||u+1===i.length?u+=1:c=u:(o.pop(),u+=2):c=u;return-1!==c&&o.push(i.slice(c)),n.slice(0,n.length-t.length)+o.join("")}}function t(e,t){return n(e,t)||(-1!==e.indexOf(":")?e:n("./"+e,t))}function r(e,t,r,i,o){for(var s in e){var f=n(s,r)||s,l=e[s];if("string"==typeof l){var a=u(i,n(l,r)||l,o);a?t[f]=a:c("W1",s,l)}}}function i(e,n){if(n[e])return e;var t=e.length;do{var r=e.slice(0,t+1);if(r in n)return r}while(-1!==(t=e.lastIndexOf("/",t-1)))}function o(e,n){var t=i(e,n);if(t){var r=n[t];if(null===r)return;if(t.length>=e.length||"/"===r[r.length-1])return r+e.slice(t.length);c("W2",t,r)}}function c(n,t,r){console.warn(e(n,[r,t].join(", ")))}function u(e,n,t){for(var r=e.scopes,c=t&&i(t,r);c;){var u=o(n,r[c]);if(u)return u;c=i(c.slice(0,c.lastIndexOf("/")),r)}return o(n,e.imports)||-1!==n.indexOf(":")&&n}function s(){this[O]={}}function f(n,t,r){var i=n[O][t];if(i)return i;var o=[],c=Object.create(null);E&&Object.defineProperty(c,E,{value:"Module"});var u=Promise.resolve().then((function(){return n.instantiate(t,r)})).then((function(r){if(!r)throw Error(e(2,t));var u=r[1]((function(e,n){i.h=!0;var t=!1;if("object"!=typeof e)e in c&&c[e]===n||(c[e]=n,t=!0);else{for(var r in e)n=e[r],r in c&&c[r]===n||(c[r]=n,t=!0);e.__esModule&&(c.__esModule=e.__esModule)}if(t)for(var u=0;o.length>u;u++){var s=o[u];s&&s(c)}return n}),2===r[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return i.e=u.execute||function(){},[r[0],u.setters||[]]})),s=u.then((function(e){return Promise.all(e[0].map((function(r,i){var o=e[1][i];return Promise.resolve(n.resolve(r,t)).then((function(e){var r=f(n,e,t);return Promise.resolve(r.I).then((function(){return o&&(r.i.push(o),!r.h&&r.I||o(r.n)),r}))}))}))).then((function(e){i.d=e}),!1)}));return s.catch((function(e){i.e=null,i.er=e})),i=n[O][t]={id:t,i:o,n:c,I:u,L:s,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}function l(){[].forEach.call(document.querySelectorAll("script"),(function(n){if(!n.sp)if("systemjs-module"===n.type){if(n.sp=!0,!n.src)return;System.import("import:"===n.src.slice(0,7)?n.src.slice(7):t(n.src,a))}else if("systemjs-importmap"===n.type){n.sp=!0;var i=n.src?fetch(n.src).then((function(e){return e.text()})):n.innerHTML;j=j.then((function(){return i})).then((function(i){!function(n,i,o){try{var c=JSON.parse(i)}catch(u){throw Error(e(1))}!function(e,n,i){var o;for(o in e.imports&&r(e.imports,i.imports,n,i,null),e.scopes||{}){var c=t(o,n);r(e.scopes[o],i.scopes[c]||(i.scopes[c]={}),n,i,c)}for(o in e.depcache||{})i.depcache[t(o,n)]=e.depcache[o];for(o in e.integrity||{})i.integrity[t(o,n)]=e.integrity[o]}(c,o,n)}(b,i,n.src||a)}))}}))}var a,h="undefined"!=typeof Symbol,v="undefined"!=typeof self,d="undefined"!=typeof document,p=v?self:global;if(d){var m=document.querySelector("base[href]");m&&(a=m.href)}if(!a&&"undefined"!=typeof location){var g=(a=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==g&&(a=a.slice(0,g+1))}var y,E=h&&Symbol.toStringTag,O=h?Symbol():"@",w=s.prototype;w.import=function(e,n){var t=this;return Promise.resolve(t.prepareImport()).then((function(){return t.resolve(e,n)})).then((function(e){var n=f(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then((function(){return Promise.all(t.d.map((function(t){return e(n,t,r)})))}))}(e,n,{}).then((function(){return function e(n,t,r){function i(){try{var e=t.e.call(S);if(e)return e=e.then((function(){t.C=t.n,t.E=null}),(function(e){throw t.er=e,t.E=null,e})),t.E=t.E||e;t.C=t.n}catch(n){throw t.er=n,n}finally{t.L=t.I=void 0,t.e=null}}if(!r[t.id]){if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}var o;return t.d.forEach((function(i){try{var c=e(n,i,r);c&&(o=o||[]).push(c)}catch(u){throw t.e=null,t.er=u,u}})),o?Promise.all(o).then(i,(function(e){throw t.e=null,t.er=e,e})):i()}}(e,n,{})})).then((function(){return n.n}))}(t,n)}))},w.createContext=function(e){var n=this;return{url:e,resolve:function(t,r){return Promise.resolve(n.resolve(t,r||e))}}},w.register=function(e,n){y=[e,n]},w.getRegister=function(){var e=y;return y=void 0,e};var S=Object.freeze(Object.create(null));p.System=new s;var x,P,j=Promise.resolve(),b={imports:{},scopes:{},depcache:{},integrity:{}},C=d;if(w.prepareImport=function(e){return(C||e)&&(l(),C=!1),j},d&&(l(),window.addEventListener("DOMContentLoaded",l)),d){window.addEventListener("error",(function(e){L=e.filename,M=e.error}));var I=location.origin}w.createScript=function(e){var n=document.createElement("script");n.async=!0,e.indexOf(I+"/")&&(n.crossOrigin="anonymous");var t=b.integrity[e];return t&&(n.integrity=t),n.src=e,n};var L,M,T={},_=w.register;w.register=function(e,n){if(d&&"loading"===document.readyState&&"string"!=typeof e){var t=document.getElementsByTagName("script"),r=t[t.length-1],i=r&&r.src;if(i){x=e;var o=this;P=setTimeout((function(){T[i]=[e,n],o.import(i)}))}}else x=void 0;return _.call(this,e,n)},w.instantiate=function(n,t){var r=T[n];if(r)return delete T[n],r;var i=this;return new Promise((function(r,o){var c=w.createScript(n);c.addEventListener("error",(function(){o(Error(e(3,[n,t].join(", "))))})),c.addEventListener("load",(function(){if(document.head.removeChild(c),L===n)o(M);else{var e=i.getRegister();e&&e[0]===x&&clearTimeout(P),r(e)}})),document.head.appendChild(c)}))},w.resolve=function(t,r){return u(b,n(t,r=r||a)||t,r)||function(n,t){throw Error(e(8,[n,t].join(", ")))}(t,r)};var J=w.instantiate;w.instantiate=function(e,n){var t=b.depcache[e];if(t)for(var r=0;t.length>r;r++)f(this,this.resolve(t[r],e),e);return J.call(this,e,n)},v&&"function"==typeof importScripts&&(w.instantiate=function(e){var n=this;return Promise.resolve().then((function(){return importScripts(e),n.getRegister()}))})}();
//# sourceMappingURL=s.min.js.map