From c67fd376ad4a7e510c867fdfa9142db74936a9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20L=C3=BCth?= Date: Fri, 29 May 2020 22:33:16 +0200 Subject: [PATCH] fix bug where legacy handler did not resolve with true when probe was missing --- addon/handler/legacy.js | 6 +++++- dist/cache/dispose.js | 2 +- dist/cache/states.js | 2 +- dist/demand.js | 4 ++-- dist/handler/css.js | 2 +- dist/handler/html.js | 2 +- dist/handler/json.js | 2 +- dist/handler/legacy.js | 4 ++-- dist/handler/legacy.js.map | 2 +- dist/handler/text.js | 2 +- dist/plugin/cookie.js | 2 +- dist/plugin/lzstring.js | 2 +- dist/plugin/sri.js | 2 +- package.json | 2 +- 14 files changed, 20 insertions(+), 16 deletions(-) diff --git a/addon/handler/legacy.js b/addon/handler/legacy.js index 6ff5f2c..233e711 100644 --- a/addon/handler/legacy.js +++ b/addon/handler/legacy.js @@ -22,7 +22,11 @@ if(probe && (result = probe())) { provide(function() { return result; }); } else { - dfd.reject(new Failure('error probing', self.path)); + if(probe) { + dfd.reject(new Failure('error probing', self.path)); + } else { + provide(function() { return true; }); + } } } diff --git a/dist/cache/dispose.js b/dist/cache/dispose.js index 8f2c4c5..ac1809d 100644 --- a/dist/cache/dispose.js +++ b/dist/cache/dispose.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["/demand/function/iterate","./states"],(function(e,c){function t(e,c){return e.accessedc.accessed?1:0}return function(e){var n,s=c();for(s.sort(t);e>0&&s.length;)e-=(n=s.shift()).size,demand.cache.clear(n.id)}}))}(); //# sourceMappingURL=dispose.js.map diff --git a/dist/cache/states.js b/dist/cache/states.js index 1e18b10..356d27e 100644 --- a/dist/cache/states.js +++ b/dist/cache/states.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(e){"use strict";provide(["/demand/function/iterate"],(function(t){var n=new RegExp("^\\[demand\\]\\[(.+?)\\]\\[state\\]$"),a=/^(.+?),(\d+),(\d*),(.+?),(\d+)$/;function r(t){var r,i=t.match(n);i&&(r=function(t){var n,r=e.getItem(t);if(r&&(n=r.match(a)))return Array.prototype.slice.call(n,1)}("[demand]["+i[1]+"][state]"),this.push({id:i[1],version:r[0],size:parseInt(r[1],10),expires:r[2]?new Date(parseInt(r[2],10)):null,demand:r[3],accessed:new Date(parseInt(r[4],10))}))}return function(){return t(e,r,[])}}))}(localStorage); //# sourceMappingURL=states.js.map diff --git a/dist/demand.js b/dist/demand.js index bb915d3..616b8d2 100644 --- a/dist/demand.js +++ b/dist/demand.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ -!function(e,t,n){"use strict";var r,i,o,a,u=e.document,s="demand"in e&&e.demand,c={version:"1.0.0",cache:{},timeout:8e3,pattern:{},modules:{},handler:"module"},d=Array.prototype,f=d.slice,l=d.concat,h=Object,p=h.create,v=h.defineProperty,m=h.getOwnPropertyNames,g=h.getOwnPropertyDescriptor,y=u.createElement("a");function w(e,t,n,r){return{__proto__:null,value:e,enumerable:!!r,configurable:!!n,writable:!!t}}function x(e,t){return typeof e===t}function b(e){return e&&x(e,"object")}function j(e){return x(e,"number")&&isFinite(e)&&Math.floor(e)===e&&e>=0}function q(e,t){return e instanceof t}!function(t){function n(e,t,n,r,i){v(this,e,new w(t,n,r,i))}function r(e){for(var t,n=this.prototype,r=m(n),i={constructor:new w(this,!0,!0)},o=0;(t=r[o])&&!i[t];o++)i[t]=g(n,t);try{this.prototype=p(e.prototype||e,i)}catch(e){}if(this.prototype===n)throw new TypeError("Unable to extend, prototype is not writable");return this}n.call(Object.prototype,"defineProperty",n),n.call(e.Object.prototype,"defineProperty",n),Function.prototype.defineProperty("extends",r),e.Function.prototype.defineProperty("extends",r)}();var k,R=(k=/^\bv?(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b$/i,function(e){return x(e,"string")&&k.test(e)});function P(e,t,n){for(var r,i=h.keys(e),o=0;void 0!==(r=i[o])&&!1!==t.call(n,r,e[r]);o++);return n}var E,M,C=function(){function e(e,t){var n,r=this[e];void 0!==t&&(b(t)?(n=b(r),r=void 0!==t.length?n&&void 0!==r.length?r:[]:n&&void 0===r.length?r:{},this[e]=C(r,t)):this[e]=t)}return function(){for(var t,n=arguments[0],r=1;void 0!==(t=arguments[r]);r++)P(t,e,n);return n}}(),S=function(){var e=new RegExp("[xy]","g");function t(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(e,t)}}(),T="setImmediate"in e&&"function"==typeof e.setImmediate?e.setImmediate:"MutationObserver"in e&&"function"==typeof e.MutationObserver?(E={},M=u.createElement("div"),new MutationObserver((function(e){e.forEach((function(e){var t=e.attributeName.substr(1);E[t]&&E[t](),delete E[t]}))})).observe(M,{attributes:!0}),function(e){var t=S();E[t]=e,M.setAttribute("i"+t,1)}):t;function A(e,t,n){return f.call(e,t,n)}var O=function(){var e=/^cache(Miss|Hit|Clear|Exceed)|queue(En|De)queue|(pre|post)(Resolve|Configure|Request|Process|Cache)|provide|reject$/,t={};function n(n,r,i){var o,a;if(x(r,"string")&&x(i,"function"))for(r=r.split(" ");o=r.shift();)o=o.split(":"),e.test(o[0])&&((t[o[0]]||(t[o[0]]={on:[],after:[]}))[n].push({callback:i,filter:o[1]}),"on"===n&&"postConfigure"===o[0]&&(a=c.modules[o[1]])&&i(a))}function r(){}return r.prototype={emit:function(e,n){var r,i,o,a=t[e];if(a){for(r=A(arguments,2),i=0;o=a.on[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r);for(i=0;o=a.after[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r)}return this},on:function(e,t){return n("on",e,t),this},after:function(e,t){return n("after",e,t),this}},new r}(),$="WeakMap"in e&&!("ActiveXObject"in e)?e.WeakMap:function(){function e(e,t){var n;if((n=t[e.id])&&n[0]===t)return n}function t(){this.defineProperty("id","weakmap-"+S())}return t.prototype={set:function(t,n){var r=e(this,t);return r?r[1]=n:t.defineProperty(this.id,[t,n]),this},get:function(t){var n=e(this,t);if(n)return n[1]},delete:function(t){var n=e(this,t);n&&(n.length=0,delete t[this.id])},has:function(t){return!!e(this,t)}},t}();function I(){return x(this.uuid,"undefined")&&this.defineProperty("uuid",S()),this}var H=function(){var e=new $;function t(){var t=I.call(this);return e.set(t,[]),t}return t.prototype={enqueue:function(){var t=A(arguments);e.set(this,e.get(this).concat(t)),O.emit("queueEnqueue",this.uuid,t)},dequeue:function(){var t=e.get(this).shift();return O.emit("queueDequeue",this.uuid,t),t},get current(){return e.get(this)[0]},get length(){return e.get(this).length}},t.extends(I)}(),N=function(){var r,i="object"==typeof e.safari&&e.safari.pushNotification?"beforeunload":"visibilitychange",o=e.requestIdleCallback||function(e,n){var r=+new Date;return t((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(+new Date-r))}})}),n&&n.timeout)},a=e.cancelIdleCallback||function(e){n(e)},s=new H;function c(){s.dequeue()(),r=s.length&&o(c)}return e.addEventListener(i,(function(e){var t;if(s.length&&("visibilitychange"!==e.type||"hidden"===u.visibilityState)){r=a(r);do{t&&t()}while(t=s.dequeue())}}),!0),function(e,t){s.enqueue(e),!r&&s.length&&(r=o(c,{timeout:t}))}}();function D(){return+new Date}function L(e){return y.href=e,y.href}var B=/^(http(s?):)?\/\//i,U=/^\.?\.\//,z=/((?:\/\/|\/\*)#)\s*(sourceMappingURL)\s*=\s*(?!(?:http[s]?:)?\/\/)(.+?)\.map(?:\s+)?(\*\/)?/g,_=/^\//,F=/\.\w+$/,W=new RegExp("^"+L("/")),X=new RegExp("^demand|provide|path|exports$"),G=/^(mock:)?([+-])?((?:[-\w]+\/?)+)?(?:@(.+?))?(?:#(\d+))?!/;function J(e,t){var n=e.replace(G,"");return U.test(n)&&(n="/"+L((t&&L(t+"/../")||"/")+n).replace(W,"")),n}function K(e,t){var n=e.match(G);return(n&&n[1]?"mock:":"")+(n&&n[3]||c.handler)+"!"+J(e,t)}var Q=function(){function e(e,t){return et?1:0}function t(e){if(!R(e))throw new TypeError('"version" must be a valid semver version string');e=function(e){var t,n=e.split("-"),r=0;for(n=n[1]?Array.prototype.concat(n[0].split("."),n[1].split(".")):n[0].split(".");t=n[r];r++)n[r]=parseInt(t,10).toString()===t?parseInt(t,10):t;return n}(e),this.major=e.shift(),this.minor=e.shift(),this.patch=e.shift(),this.identifier=e}return t.prototype={toString:function(){return this.major+"."+this.minor+"."+this.patch+(this.identifier.length?"-"+this.identifier.join("."):"")},compare:function(t){return e(this.major,t.major)||e(this.minor,t.minor)||e(this.patch,t.patch)||function(e,t){var n,r,i,o,a=0;if(e.length&&!t.length)return-1;if(!e.length&&t.length)return 1;if(!e.length&&!t.length)return 0;do{if(n=e[a],o=typeof(r=t[a]),"undefined"==(i=typeof n)&&"undefined"===o)return 0;if("undefined"===o)return 1;if("undefined"===i)return-1;if(n===r);else{if("string"===i&&"string"!==o)return 1;if("string"!==i&&"string"===o)return-1;if(n>r)return 1;if(nt.weight)&&(t=r)})),!!t&&t.state)}function f(e){return a.getItem(e)}function l(e,t){a[t?"setItem":"removeItem"](e,t)}function h(e){var t,n=f(e);if(n&&(t=n.match(i)))return A(t,1)}function p(e,t){t[4]=D(),l(e,t.join(","))}function v(e,t,n){O.emit(e,t.id,t,n)}function m(){N(this.clear.expired.bind(this.clear),c.delay)}return O.on("cacheMiss",(function(e){N((function(){t.clear(e.id)}))})).on("cacheExceed",(function(e){r("-!/demand/cache/dispose").then((function(n){N((function(){n(e.source.length),t.set(e)}),c.delay)}))})).on("postRequest",(function(e){e.source&&d(e)&&(s[e.id]=!0)})).after("postProcess",(function(e){s[e.id]&&N((function(){t.set(e)}),c.delay)})),m.prototype={get:o?function(e){var t,n;if(d(e)){if(t="[demand]["+e.id+"]",!(n=h(t+"[state]")))return;return 1===e.version.compare(new Q(n[0]))||n[2]&&e.lifetime&&n[2]<=D()?void(e.invalid=!0):(e.source=f(t+"[value]"),N((function(){p(t+"[state]",n)}),c.delay),!0)}}:function(){},resolve:o?function(e){this.get(e)?v("cacheHit",e):v("cacheMiss",e)}:function(e){v("cacheMiss",e)},set:o?function(e){var t,n,i;if(d(e)){t=[e.version,e.source.length,e.lifetime?D()+e.lifetime:null,r.version],n="[demand]["+e.id+"]",v("preCache",e,t);try{if(i=u?a.remainingSpace:null,l(n+"[value]",e.source),p(n+"[state]",t),null!==i&&a.remainingSpace===i)throw new Error;v("postCache",e,t)}catch(t){v("cacheExceed",e)}}}:function(){},clear:o?function(e){var t=K(e),n="[demand]["+t+"]";f(n+"[state]")&&(l(n+"[state]"),l(n+"[value]"),v("cacheClear",re.get(t)||new re(t,null,!1)))}:function(){}},m.prototype.clear.all=o?function(){var e;P(a,(function(t){(e=t.match(n))&&this(e[1])}),this)}:function(){},m.prototype.clear.expired=o?function(){var e,t;P(a,(function(r){(e=r.match(n))&&(t=h("[demand]["+e[1]+"][state]"))&&t[2]>0&&t[2]<=D()&&this(e[1])}),this)}:function(){},t=new m}();function Y(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=A(n)),this}Y.prototype={toString:function(){var e=this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=Y.traverse(this.stack,e,1)),e}},Y.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=Y.traverse(r.stack,t,n+1));return t};var Z,ee,te=function(){var e=new $;function t(){var t=this,n=arguments;T((function(){e.get(t).handle("resolved",n)}))}function n(){var t=this,n=arguments;T((function(){e.get(t).handle("rejected",n)}))}function r(t,n){var r,i,o=e.get(this);for("pending"===o.state&&(o.state=t,o.value=n,"rejected"!==t||o[t].length||function(e){var t,n=0;for(console.warn("unhandled pledge rejection");void 0!==(t=e[n]);n++)if(q(t,Error)||q(t,Y))throw t}(n));r=o[o.state].shift();)try{if(q(i=r.handler.apply(null,o.value),a)){i.then(r.dfd.resolve,r.dfd.reject);continue}if("resolved"===o.state&&x(i,"undefined")){r.dfd.resolve.apply(null,o.value);continue}r.dfd.resolve(i)}catch(e){r.dfd.reject(e)}o.resolved.length=0,o.rejected.length=0}function i(e,t,n){e.then((function(){n.resolved[t]=A(arguments),n.count++,o(n)}),(function(){n.rejected.push(A(arguments)),o(n)}))}function o(e){e.count===e.total?e.dfd.resolve.apply(null,l.apply([],e.resolved)):e.rejected.length+e.count===e.total&&e.dfd.reject.apply(null,l.apply([],e.rejected))}function a(i){return e.set(this,{state:"pending",handle:r.bind(this),value:null,resolved:[],rejected:[],count:0}),i(t.bind(this),n.bind(this)),this}return a.prototype={isPending:function(){return"pending"===e.get(this).state},isResolved:function(){return"resolved"===e.get(this).state},isRejected:function(){return"rejected"===e.get(this).state},then:function(t,n){var r=e.get(this),i=a.defer();return r.resolved.push({handler:t||a.resolve,dfd:i}),r.rejected.push({handler:n||a.reject,dfd:i}),"pending"!==r.state&&T(r.handle),i.pledge},catch:function(e){return this.then(void 0,e)},always:function(e){return this.then(e,e)}},a.prototype.finally=a.prototype.always,a.defer=function(){var e={};return e.pledge=new a((function(t,n){e.resolve=t,e.reject=n})),e},a.all=function(e){var t,n,r=a.defer(),o=0;if(e.length)for(t={dfd:r,resolved:[],rejected:[],total:e.length,count:0};n=e[o];o++)i(n,o,t);else r.resolve();return r.pledge},a.race=function(e){for(var t,n=a.defer(),r=0;t=e[r];r++)t.then(n.resolve,n.reject);return e.length||n.resolve(),n.pledge},a.resolve=function(){var e=a.defer();return e.resolve.apply(null,arguments),e.pledge},a.reject=function(){var e=a.defer();return e.reject.apply(null,arguments),e.pledge},a}(),ne=function(){var e=new $;function t(){e.set(this,{})}return t.prototype={get:function(t){return t?e.get(this)[t]:e.get(this)},set:function(t,n){e.get(this)[t]=n},remove:function(t){delete e.get(this)[t]}},t}(),re=function(){var e=new ne,t=/^(?:mock:|internal!)/i,n=[];function o(e,t){this[e]=t}function a(e){t.test(e)||this.push(e)}function s(e,n){!t.test(e)&&n.pledge.isPending()&&this.push(e)}function d(e,n){!t.test(e)&&n.pledge.isResolved()&&this.push(e)}function f(e,n){!t.test(e)&&n.pledge.isRejected()&&this.push(e)}function l(){return P(e.get(),a,[])}function h(t,r,i){var o=this,a=t.match(G)||n;return o.path=J(t,r),o.mock=!!a[1],o.cache=a[2]?"+"===a[1]:null,o.type=a[3]||c.handler,o.version=new Q(a[4]||c.version),o.lifetime=a[5]&&1e3*a[5]||c.lifetime,o.id=(o.mock?"mock:":"")+o.type+"!"+o.path,o.uri=(o.mock?"mock:":"")+o.type+"@"+o.version+(j(o.lifetime)&&o.lifetime>0?"#"+o.lifetime:"")+"!"+o.path,o.dfd=te.defer(),o.pledge=o.dfd.pledge,o.invalid=!1,o.pledge.then((function(){o.value=A(arguments)})),!1!==i&&e.set(o.id,o),o}return l.pending=function(){return P(e.get(),s,[])},l.resolved=function(){return P(e.get(),d,[])},l.rejected=function(){return P(e.get(),f,[])},h.prototype={enqueue:!0},h.get=function(t,n){return e.get(K(t,n))},h.resolve=function(e,t){var n,a=t&&X.test(e),u=a?this.get("internal!"+t+"/"+e):this.get(e,t);if(!u)if(a){switch(u=new h("internal!"+t+"/"+e),e){case"demand":n=P(r,o,r.bind(t));break;case"provide":n=i.bind(t);break;case"path":n=t;break;case"exports":n={},u.dfd.pledge.then(this.get(t).dfd.resolve)}u.dfd.resolve(n)}else u=new h(e,t),r("/demand/handler/"+u.type).then((function(e){u.handler=e,u.mock?u.dfd.resolve(e):V.resolve(u)}),(function(){u.dfd.reject(new Y("error loading (handler)",self.id))}));return u},h.remove=function(t,n,r){var i=K(t,n),o=u.querySelector('[demand-id="'+i+'"]');e.remove(i),e.remove("mock:"+i),o&&o.parentNode.removeChild(o),!1!==r&&V.clear(i)},h.list=l,h}(),ie=function(){var e=/(.+)\/$/;function t(t,n){this[t]={url:L(n).replace(e,"$1"),match:new RegExp("^"+n)}}function n(e,n){this.weight=e.length,this.match=new RegExp("^"+e),this.location=[].concat(n),P(this.location,t,this.location)}return n.prototype={matches:function(e){return this.match.test(e)},process:function(e,t){var n=this.location[t];if(n)return e.replace(this.match,n.url)}},n}(),oe=function(){var e={};function t(e){return e instanceof ArrayBuffer||e instanceof MessagePort||"ImageBitmap"in self&&e instanceof ImageBitmap}return function(n){var r,i;return r="$task = "+n+"; $isTransferable = "+t+"; onmessage = "+function(e){var t,n=Array.prototype.slice,r=e.data;function i(e){t||(t=!0,postMessage([r[0],0,e.toString()]))}try{$task.apply($task,[function(){var e;t||(t=!0,e=n.call(arguments),postMessage([r[0],1,e],e.filter($isTransferable)))},i].concat(r[1]))}catch(e){i(e)}},(i=new Worker(URL.createObjectURL(new Blob([r],{type:"application/javascript"})))).onmessage=function(t){var n=t.data[0],r=n?e[n]:null;n&&r&&(t.data[1]?r.resolve.apply(null,t.data[2]):r.reject(t.data[2]),delete e[n])},function(){var n=te.defer(),r=S(),o=A(arguments);return e[r]=n,i.postMessage([r,o],o.filter(t)),n.pledge}}}(),ae=(Z=/^(?:\?|)$/,ee=new oe((function(e,t,n){var r,i,o=new XMLHttpRequest;r=function(){this.readyState<4&&this.abort()}.bind(o),o.ontimeout=o.onerror=o.onabort=function(){t(o.statusText)},o.onprogress=o.onreadystatechange=function(){self.clearTimeout(i),i=self.setTimeout(r,1e4)},o.onload=function(){i=self.clearTimeout(i),"status"in o&&200!==o.status?t(o.statusText):e(o.responseText,o.getResponseHeader&&o.getResponseHeader("content-type"))},o.open("GET",n,!0),o.send(),i=self.setTimeout(r,1e4)})),function(e){var t;function n(t,n){n&&e.handler.validate&&!e.handler.validate(n)?e.dfd.reject(new Y("error loading (content-type)",e.id)):(e.source=t,O.emit("postRequest",e.type,e))}B.test(e.path)||P(c.pattern,(function(n,r){r.matches(e.path)&&(!t||t.weight>>0}r=function(){function t(e,t){this[e]={weight:e.length,state:t}}function n(e,t){"base"!==e&&(this[e]=new ie(e,t))}function r(e,t){var n=this[e]=this[e]||{};O.emit("preConfigure",e,n),C(n,t),O.emit("postConfigure",e,n)}function i(){var t,n,r=A(arguments),i=this!==e?this:null,o=0;for(O.emit("preResolve",null,r,i);t=r[o];o++)x(t,"string")?r[o]=re.resolve(t,i).pledge:(r[o]=(n=te.defer()).pledge,n.resolve(t));return(r.length>1?te.all(r):r[0]).always((function(){O.emit("postResolve",null,r,i)}))}return i.configure=function(e){var o=e.cache,a=e.version,u=e.delay,s=e.timeout,d=e.lifetime,f=e.base,l=e.pattern,h=e.modules,p=c.modules;return x(o,"boolean")?c.cache[""]={weight:0,state:o}:b(o)&&P(o,t,c.cache),R(a)&&(c.version=a),j(u)&&(c.delay=1e3*u),j(s)&&(c.timeout=1e3*Math.min(Math.max(s,2),20)),j(d)&&d>0&&(c.lifetime=1e3*d),x(f,"string")&&""!==f&&(c.pattern.base=new ie("",f)),b(l)&&P(l,n,c.pattern),b(h)&&P(h,r,p),i},i.version="7.0.0",i.on=O.on.bind(i),i.get=function(e,t){var n=re.get(e,t);return n&&n.value},i.list=re.list,i.remove=re.remove,i.cache={clear:V.clear},O.after("cacheMiss",(function(e){new ae(e)})).after("postRequest",(function(e){var t=e.handler.onPostRequest;t&&t(e)})).after("cacheHit postRequest",(function(e){O.emit("preProcess",e.id,e)})).after("preRequest",(function(e){var t=e.handler.onPreRequest;t&&t(e)})).after("preProcess",(function(e){var t=e.handler.onPreProcess;t&&t(e),e.pledge.then((function(){O.emit("postProcess",e.id,e)})),!0===e.enqueue?o.enqueue(e):q(e.enqueue,te)&&e.enqueue.then((function(){o.enqueue(e)}))})),i}(),e.defineProperty("demand",r),(i=function(){var t,n,i,o=x(arguments[0],"string")?arguments[0]:null,u=this!==e?this:null,s=ue(arguments[o?1:0])?arguments[o?1:0]:null,c=s?arguments[o?2:1]:arguments[o?1:0];if(!o&&a.current&&(o=(t=a.current).uri,a.process()),o)return t=t||new re(o,u),n=q(c,te),i=x(c,"function"),s?r.apply(t.path,s).then((function(){t.dfd.resolve(i?c.apply(null,arguments):c)}),(function(){t.dfd.reject(new Y("error providing",t.id,arguments))})):n?c.then(t.dfd.resolve,t.dfd.reject):t.dfd.resolve(i?c():c),t.dfd.pledge.then((function(){O.emit("provide",t.path,t)}),(function(){O.emit("reject",t.path,t)})),t.dfd.pledge;throw new Error("unspecified anonymous provide")}).amd=!0,e.defineProperty("provide",i),r.configure({cache:!0,base:"/",pattern:{"/demand":L((s&&s.url||location.href)+"/../").slice(0,-1)}}),s&&s.settings&&r.configure(s.settings);var ce=function(){var e=new $;function t(t){var n=this,i={queue:t,current:null};e.set(n,i),r.on("queueEnqueue:"+t.uuid,(function(){!i.current&&n.process()}))}return t.prototype={process:function(){var t,n=e.get(this);!n.queue.length||(t=n.current=n.queue.dequeue()).pledge.isRejected()?n.current=null:t.handler.process&&t.handler.process(t)},get current(){return e.get(this).current}},t}();function de(e,t){for(var n,r;n=z.exec(t);)B.test(n[3])?r=e.protocol+"//"+e.host+n[3]:(e.pathname+=(F.test(e.pathname)?"/../":"/")+n[3].replace(_,""),r=e.protocol+"//"+e.host+e.pathname),t=t.replace(n[0],n[1]+" "+n[2]+"="+r+".map"+(n[4]?" "+n[4]:""));return t}function fe(){}fe.prototype={validate:null,onPreRequest:null,onPostRequest:null,onPreProcess:null,process:null};var le=function(){var e=u.getElementsByTagName("head")[0],t=/^(application|text)\/(x-)?javascript/,n={suffix:".js"};function i(){}return r.on("postConfigure:/demand/handler/module",(function(e){b(e)&&C(n,e)})),i.prototype={validate:function(e){return t.test(e)},onPreRequest:function(e,t){var r;(t="undefined"!=typeof t?t:n.suffix)&&0!==e.path.indexOf("@")&&(r=e.url.pathname,e.url.pathname=r.slice(-t.length)!==t?r+t:r)},onPostRequest:function(e){e.source=de(e.url,e.source)},process:function(t){var n;t.source&&((n=u.createElement("script")).async=!0,n.text=t.source,n.setAttribute("demand-id",t.id),e.appendChild(n))}},new(i.extends(fe))}();function Y(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=A(n)),this}Y.prototype={toString:function(){var e=this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=Y.traverse(this.stack,e,1)),e}},Y.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=Y.traverse(r.stack,t,n+1));return t};var he=function(){var e={};function t(e,t){var n,r;for(n=0;r=t[n];n++)x(r,"string")&&(t[n]=K(r))}function n(){}return r.on("postConfigure:/demand/handler/bundle",(function(n){b(n)&&P(e=n,t)})),n.prototype={validate:le.validate,onPreProcess:function(t){var n,r,i,a,u,s=t.source,c=t.dfd,d=e[t.path];function f(){c.reject(new Y("error resolving",t.id,arguments))}if(t.enqueue=!1,d&&(n=function(t){for(var n,r,i=0;r=t[i];i++)if(r=(r=r.match(G))&&r[3]||e.handler,n){if(r!==n)return!1}else n=r;return n}(d))){for(;r=z.exec(s);)s=s.replace(r[0],"");for(t.source=s,i=[],u=0;a=d[u];u++)i.push(re.resolve("mock:"+a).pledge);te.all(i).then((function(){for(i.length=0,u=0;a=d[u];u++)(a=d[u]=re.get(a)||new re(a)).handler=arguments[u],i.push(a.pledge);"module"===n?(o.enqueue.apply(o,d),le.process(t)):(le.process(t),o.enqueue.apply(o,d)),te.all(i).then(c.resolve,f)}),f)}else f()}},new(n.extends(fe))}(),pe=function(){var e=/^text\/.+$/,t={suffix:".html"};function n(){}return r.on("postConfigure:/demand/handler/component",(function(e){b(e)&&C(t,e)})),n.prototype={validate:function(t){return e.test(t)},onPreRequest:function(e,n){var r;(n="undefined"!=typeof n?n:t.suffix)&&(r=e.url.pathname,e.url.pathname=r.slice(-n.length)!==n?r+n:r)},onPostRequest:function(e){e.source=de(e.url,e.source)},onPreProcess:function(e){var t,n,r,i,a=e.path,s=e.dfd,c=u.createElement("body"),d=[],f=[];function l(){s.reject(new Y("error resolving",e.id,arguments))}for(e.enqueue=!1,c.innerHTML=e.source;t=c.firstElementChild;)(n=t.getAttribute("type"))&&(i=n+"!"+a+((r=t.getAttribute("path"))?"/"+r:""),t.parentNode.removeChild(t),d.push({source:t.textContent,uri:i}),f.push(re.resolve("mock:"+i).pledge));te.all(f).then((function(){var t,n,r,i=[];for(f.length=0,t=0;n=d[t];t++)(r=re.get(n.uri)||new re(n.uri)).source=de(r.url,n.source),r.handler=arguments[t],i.push(r),f.push(r.pledge),o.enqueue(r);te.all(f).then((function(){var r=e.path.length+1,o={};for(t=0;n=arguments[t];t++)o[i[t].path.substr(r)||"main"]=n;s.resolve(o)}),l)}),l)}},new(n.extends(fe))}(),ve=function(){var e="/demand/plugin/genie",t=[];function n(e){for(var n,r,i=0;n=t[i];i++)n.prefix.test(e)&&(!r||n.weight>r.weight)&&(r=n);return r}function i(){for(var e,t=0;e=this[t];t++)e.dfd.resolve(arguments[t])}function o(){for(var e,t=0;e=this[t];t++)e.dfd.reject(new Y("error resolving",e.id))}function a(e,n){t.push({prefix:new RegExp("^"+e),weight:e.length,fn:n})}function u(t,n){var a,u=n.matches,s=0;if(u.length>1){for(n.id=e+"/"+se(JSON.stringify(n.matches));a=u[s];s++)u[s]=new re(a.uri);r.configure(function(e){var t,n,r=e.matches,i={pattern:{},modules:{"/demand/handler/bundle":{}}},o=0;for(i.pattern[e.id]=e.fn(r),i.modules["/demand/handler/bundle"][e.id]=t=[];n=r[o];o++)t.push(n.path);return i}(n)),r("bundle!"+n.id).then(i.bind(u),o.bind(u))}}return r.on("postConfigure:"+e,(function(e){b(e)&&(t.length=0,P(e,a))})).on("preResolve",(function(e,t){for(var r,i,o={},a=0;r=e[a];a++)!x(r,"string")||X.test(r)||re.get(r,t)||"module"===(r=new re(r,t,!1)).type&&(i=n(r.path))&&!V.get(r)&&(o[i.prefix]||(o[i.prefix]={fn:i.fn,matches:[]})).matches.push(r);P(o,u)})),!0}();function me(e,t){i(e,(function(){return t}))}if(o=new H,a=new ce(o),me("/demand/abstract/uuid",I),me("/demand/abstract/handler",fe),me("/demand/handler/module",le),me("/demand/handler/bundle",he),me("/demand/handler/component",pe),me("/demand/plugin/genie",ve),me("/demand/validator/isTypeOf",x),me("/demand/validator/isArray",ue),me("/demand/validator/isObject",b),me("/demand/validator/isInstanceOf",q),me("/demand/validator/isSemver",R),me("/demand/function/resolveUrl",L),me("/demand/function/resolveSourcemaps",de),me("/demand/function/merge",C),me("/demand/function/iterate",P),me("/demand/function/hash",se),me("/demand/function/defer",T),me("/demand/function/idle",N),me("/demand/function/uuid",S),me("/demand/function/toArray",A),me("/demand/task",oe),me("/demand/weakmap",$),me("/demand/descriptor",w),me("/demand/pledge",te),me("/demand/queue",H),me("/demand/failure",Y),me("/demand/semver",Q),s&&s.main)switch(typeof s.main){case"string":r(s.main);break;case"function":i("main",s.main())}}("demand-loader"===this.name?parent:this,setTimeout,clearTimeout); +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +!function(e,t,n){"use strict";var r,i,o,a,u=e.document,s="demand"in e&&e.demand,c={version:"1.0.0",cache:{},timeout:8e3,pattern:{},modules:{},handler:"module"},d=Array.prototype,f=d.slice,l=d.concat,h=Object,p=h.create,v=h.defineProperty,m=h.getOwnPropertyNames,g=h.getOwnPropertyDescriptor,y=u.createElement("a");function w(e,t,n,r){return{__proto__:null,value:e,enumerable:!!r,configurable:!!n,writable:!!t}}function x(e,t){return typeof e===t}function b(e){return e&&x(e,"object")}function j(e){return x(e,"number")&&isFinite(e)&&Math.floor(e)===e&&e>=0}function q(e,t){return e instanceof t}!function(t){function n(e,t,n,r,i){v(this,e,new w(t,n,r,i))}function r(e){for(var t,n=this.prototype,r=m(n),i={constructor:new w(this,!0,!0)},o=0;(t=r[o])&&!i[t];o++)i[t]=g(n,t);try{this.prototype=p(e.prototype||e,i)}catch(e){}if(this.prototype===n)throw new TypeError("Unable to extend, prototype is not writable");return this}n.call(Object.prototype,"defineProperty",n),n.call(e.Object.prototype,"defineProperty",n),Function.prototype.defineProperty("extends",r),e.Function.prototype.defineProperty("extends",r)}();var k,R=(k=/^\bv?(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b$/i,function(e){return x(e,"string")&&k.test(e)});function P(e,t,n){for(var r,i=h.keys(e),o=0;void 0!==(r=i[o])&&!1!==t.call(n,r,e[r]);o++);return n}var E,M,C=function(){function e(e,t){var n,r=this[e];void 0!==t&&(b(t)?(n=b(r),r=void 0!==t.length?n&&void 0!==r.length?r:[]:n&&void 0===r.length?r:{},this[e]=C(r,t)):this[e]=t)}return function(){for(var t,n=arguments[0],r=1;void 0!==(t=arguments[r]);r++)P(t,e,n);return n}}(),S=function(){var e=new RegExp("[xy]","g");function t(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(e,t)}}(),T="setImmediate"in e&&"function"==typeof e.setImmediate?e.setImmediate:"MutationObserver"in e&&"function"==typeof e.MutationObserver?(E={},M=u.createElement("div"),new MutationObserver((function(e){e.forEach((function(e){var t=e.attributeName.substr(1);E[t]&&E[t](),delete E[t]}))})).observe(M,{attributes:!0}),function(e){var t=S();E[t]=e,M.setAttribute("i"+t,1)}):t;function A(e,t,n){return f.call(e,t,n)}var O=function(){var e=/^cache(Miss|Hit|Clear|Exceed)|queue(En|De)queue|(pre|post)(Resolve|Configure|Request|Process|Cache)|provide|reject$/,t={};function n(n,r,i){var o,a;if(x(r,"string")&&x(i,"function"))for(r=r.split(" ");o=r.shift();)o=o.split(":"),e.test(o[0])&&((t[o[0]]||(t[o[0]]={on:[],after:[]}))[n].push({callback:i,filter:o[1]}),"on"===n&&"postConfigure"===o[0]&&(a=c.modules[o[1]])&&i(a))}function r(){}return r.prototype={emit:function(e,n){var r,i,o,a=t[e];if(a){for(r=A(arguments,2),i=0;o=a.on[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r);for(i=0;o=a.after[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r)}return this},on:function(e,t){return n("on",e,t),this},after:function(e,t){return n("after",e,t),this}},new r}(),$="WeakMap"in e&&!("ActiveXObject"in e)?e.WeakMap:function(){function e(e,t){var n;if((n=t[e.id])&&n[0]===t)return n}function t(){this.defineProperty("id","weakmap-"+S())}return t.prototype={set:function(t,n){var r=e(this,t);return r?r[1]=n:t.defineProperty(this.id,[t,n]),this},get:function(t){var n=e(this,t);if(n)return n[1]},delete:function(t){var n=e(this,t);n&&(n.length=0,delete t[this.id])},has:function(t){return!!e(this,t)}},t}();function I(){return x(this.uuid,"undefined")&&this.defineProperty("uuid",S()),this}var H=function(){var e=new $;function t(){var t=I.call(this);return e.set(t,[]),t}return t.prototype={enqueue:function(){var t=A(arguments);e.set(this,e.get(this).concat(t)),O.emit("queueEnqueue",this.uuid,t)},dequeue:function(){var t=e.get(this).shift();return O.emit("queueDequeue",this.uuid,t),t},get current(){return e.get(this)[0]},get length(){return e.get(this).length}},t.extends(I)}(),N=function(){var r,i="object"==typeof e.safari&&e.safari.pushNotification?"beforeunload":"visibilitychange",o=e.requestIdleCallback||function(e,n){var r=+new Date;return t((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(+new Date-r))}})}),n&&n.timeout)},a=e.cancelIdleCallback||function(e){n(e)},s=new H;function c(){s.dequeue()(),r=s.length&&o(c)}return e.addEventListener(i,(function(e){var t;if(s.length&&("visibilitychange"!==e.type||"hidden"===u.visibilityState)){r=a(r);do{t&&t()}while(t=s.dequeue())}}),!0),function(e,t){s.enqueue(e),!r&&s.length&&(r=o(c,{timeout:t}))}}();function D(){return+new Date}function L(e){return y.href=e,y.href}var B=/^(http(s?):)?\/\//i,U=/^\.?\.\//,z=/((?:\/\/|\/\*)#)\s*(sourceMappingURL)\s*=\s*(?!(?:http[s]?:)?\/\/)(.+?)\.map(?:\s+)?(\*\/)?/g,_=/^\//,F=/\.\w+$/,W=new RegExp("^"+L("/")),X=new RegExp("^demand|provide|path|exports$"),G=/^(mock:)?([+-])?((?:[-\w]+\/?)+)?(?:@(.+?))?(?:#(\d+))?!/;function J(e,t){var n=e.replace(G,"");return U.test(n)&&(n="/"+L((t&&L(t+"/../")||"/")+n).replace(W,"")),n}function K(e,t){var n=e.match(G);return(n&&n[1]?"mock:":"")+(n&&n[3]||c.handler)+"!"+J(e,t)}var Q=function(){function e(e,t){return et?1:0}function t(e){if(!R(e))throw new TypeError('"version" must be a valid semver version string');e=function(e){var t,n=e.split("-"),r=0;for(n=n[1]?Array.prototype.concat(n[0].split("."),n[1].split(".")):n[0].split(".");t=n[r];r++)n[r]=parseInt(t,10).toString()===t?parseInt(t,10):t;return n}(e),this.major=e.shift(),this.minor=e.shift(),this.patch=e.shift(),this.identifier=e}return t.prototype={toString:function(){return this.major+"."+this.minor+"."+this.patch+(this.identifier.length?"-"+this.identifier.join("."):"")},compare:function(t){return e(this.major,t.major)||e(this.minor,t.minor)||e(this.patch,t.patch)||function(e,t){var n,r,i,o,a=0;if(e.length&&!t.length)return-1;if(!e.length&&t.length)return 1;if(!e.length&&!t.length)return 0;do{if(n=e[a],o=typeof(r=t[a]),"undefined"==(i=typeof n)&&"undefined"===o)return 0;if("undefined"===o)return 1;if("undefined"===i)return-1;if(n===r);else{if("string"===i&&"string"!==o)return 1;if("string"!==i&&"string"===o)return-1;if(n>r)return 1;if(nt.weight)&&(t=r)})),!!t&&t.state)}function f(e){return a.getItem(e)}function l(e,t){a[t?"setItem":"removeItem"](e,t)}function h(e){var t,n=f(e);if(n&&(t=n.match(i)))return A(t,1)}function p(e,t){t[4]=D(),l(e,t.join(","))}function v(e,t,n){O.emit(e,t.id,t,n)}function m(){N(this.clear.expired.bind(this.clear),c.delay)}return O.on("cacheMiss",(function(e){N((function(){t.clear(e.id)}))})).on("cacheExceed",(function(e){r("-!/demand/cache/dispose").then((function(n){N((function(){n(e.source.length),t.set(e)}),c.delay)}))})).on("postRequest",(function(e){e.source&&d(e)&&(s[e.id]=!0)})).after("postProcess",(function(e){s[e.id]&&N((function(){t.set(e)}),c.delay)})),m.prototype={get:o?function(e){var t,n;if(d(e)){if(t="[demand]["+e.id+"]",!(n=h(t+"[state]")))return;return 1===e.version.compare(new Q(n[0]))||n[2]&&e.lifetime&&n[2]<=D()?void(e.invalid=!0):(e.source=f(t+"[value]"),N((function(){p(t+"[state]",n)}),c.delay),!0)}}:function(){},resolve:o?function(e){this.get(e)?v("cacheHit",e):v("cacheMiss",e)}:function(e){v("cacheMiss",e)},set:o?function(e){var t,n,i;if(d(e)){t=[e.version,e.source.length,e.lifetime?D()+e.lifetime:null,r.version],n="[demand]["+e.id+"]",v("preCache",e,t);try{if(i=u?a.remainingSpace:null,l(n+"[value]",e.source),p(n+"[state]",t),null!==i&&a.remainingSpace===i)throw new Error;v("postCache",e,t)}catch(t){v("cacheExceed",e)}}}:function(){},clear:o?function(e){var t=K(e),n="[demand]["+t+"]";f(n+"[state]")&&(l(n+"[state]"),l(n+"[value]"),v("cacheClear",re.get(t)||new re(t,null,!1)))}:function(){}},m.prototype.clear.all=o?function(){var e;P(a,(function(t){(e=t.match(n))&&this(e[1])}),this)}:function(){},m.prototype.clear.expired=o?function(){var e,t;P(a,(function(r){(e=r.match(n))&&(t=h("[demand]["+e[1]+"][state]"))&&t[2]>0&&t[2]<=D()&&this(e[1])}),this)}:function(){},t=new m}();function Y(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=A(n)),this}Y.prototype={toString:function(){var e=this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=Y.traverse(this.stack,e,1)),e}},Y.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=Y.traverse(r.stack,t,n+1));return t};var Z,ee,te=function(){var e=new $;function t(){var t=this,n=arguments;T((function(){e.get(t).handle("resolved",n)}))}function n(){var t=this,n=arguments;T((function(){e.get(t).handle("rejected",n)}))}function r(t,n){var r,i,o=e.get(this);for("pending"===o.state&&(o.state=t,o.value=n,"rejected"!==t||o[t].length||function(e){var t,n=0;for(console.warn("unhandled pledge rejection");void 0!==(t=e[n]);n++)if(q(t,Error)||q(t,Y))throw t}(n));r=o[o.state].shift();)try{if(q(i=r.handler.apply(null,o.value),a)){i.then(r.dfd.resolve,r.dfd.reject);continue}if("resolved"===o.state&&x(i,"undefined")){r.dfd.resolve.apply(null,o.value);continue}r.dfd.resolve(i)}catch(e){r.dfd.reject(e)}o.resolved.length=0,o.rejected.length=0}function i(e,t,n){e.then((function(){n.resolved[t]=A(arguments),n.count++,o(n)}),(function(){n.rejected.push(A(arguments)),o(n)}))}function o(e){e.count===e.total?e.dfd.resolve.apply(null,l.apply([],e.resolved)):e.rejected.length+e.count===e.total&&e.dfd.reject.apply(null,l.apply([],e.rejected))}function a(i){return e.set(this,{state:"pending",handle:r.bind(this),value:null,resolved:[],rejected:[],count:0}),i(t.bind(this),n.bind(this)),this}return a.prototype={isPending:function(){return"pending"===e.get(this).state},isResolved:function(){return"resolved"===e.get(this).state},isRejected:function(){return"rejected"===e.get(this).state},then:function(t,n){var r=e.get(this),i=a.defer();return r.resolved.push({handler:t||a.resolve,dfd:i}),r.rejected.push({handler:n||a.reject,dfd:i}),"pending"!==r.state&&T(r.handle),i.pledge},catch:function(e){return this.then(void 0,e)},always:function(e){return this.then(e,e)}},a.prototype.finally=a.prototype.always,a.defer=function(){var e={};return e.pledge=new a((function(t,n){e.resolve=t,e.reject=n})),e},a.all=function(e){var t,n,r=a.defer(),o=0;if(e.length)for(t={dfd:r,resolved:[],rejected:[],total:e.length,count:0};n=e[o];o++)i(n,o,t);else r.resolve();return r.pledge},a.race=function(e){for(var t,n=a.defer(),r=0;t=e[r];r++)t.then(n.resolve,n.reject);return e.length||n.resolve(),n.pledge},a.resolve=function(){var e=a.defer();return e.resolve.apply(null,arguments),e.pledge},a.reject=function(){var e=a.defer();return e.reject.apply(null,arguments),e.pledge},a}(),ne=function(){var e=new $;function t(){e.set(this,{})}return t.prototype={get:function(t){return t?e.get(this)[t]:e.get(this)},set:function(t,n){e.get(this)[t]=n},remove:function(t){delete e.get(this)[t]}},t}(),re=function(){var e=new ne,t=/^(?:mock:|internal!)/i,n=[];function o(e,t){this[e]=t}function a(e){t.test(e)||this.push(e)}function s(e,n){!t.test(e)&&n.pledge.isPending()&&this.push(e)}function d(e,n){!t.test(e)&&n.pledge.isResolved()&&this.push(e)}function f(e,n){!t.test(e)&&n.pledge.isRejected()&&this.push(e)}function l(){return P(e.get(),a,[])}function h(t,r,i){var o=this,a=t.match(G)||n;return o.path=J(t,r),o.mock=!!a[1],o.cache=a[2]?"+"===a[1]:null,o.type=a[3]||c.handler,o.version=new Q(a[4]||c.version),o.lifetime=a[5]&&1e3*a[5]||c.lifetime,o.id=(o.mock?"mock:":"")+o.type+"!"+o.path,o.uri=(o.mock?"mock:":"")+o.type+"@"+o.version+(j(o.lifetime)&&o.lifetime>0?"#"+o.lifetime:"")+"!"+o.path,o.dfd=te.defer(),o.pledge=o.dfd.pledge,o.invalid=!1,o.pledge.then((function(){o.value=A(arguments)})),!1!==i&&e.set(o.id,o),o}return l.pending=function(){return P(e.get(),s,[])},l.resolved=function(){return P(e.get(),d,[])},l.rejected=function(){return P(e.get(),f,[])},h.prototype={enqueue:!0},h.get=function(t,n){return e.get(K(t,n))},h.resolve=function(e,t){var n,a=t&&X.test(e),u=a?this.get("internal!"+t+"/"+e):this.get(e,t);if(!u)if(a){switch(u=new h("internal!"+t+"/"+e),e){case"demand":n=P(r,o,r.bind(t));break;case"provide":n=i.bind(t);break;case"path":n=t;break;case"exports":n={},u.dfd.pledge.then(this.get(t).dfd.resolve)}u.dfd.resolve(n)}else u=new h(e,t),r("/demand/handler/"+u.type).then((function(e){u.handler=e,u.mock?u.dfd.resolve(e):V.resolve(u)}),(function(){u.dfd.reject(new Y("error loading (handler)",self.id))}));return u},h.remove=function(t,n,r){var i=K(t,n),o=u.querySelector('[demand-id="'+i+'"]');e.remove(i),e.remove("mock:"+i),o&&o.parentNode.removeChild(o),!1!==r&&V.clear(i)},h.list=l,h}(),ie=function(){var e=/(.+)\/$/;function t(t,n){this[t]={url:L(n).replace(e,"$1"),match:new RegExp("^"+n)}}function n(e,n){this.weight=e.length,this.match=new RegExp("^"+e),this.location=[].concat(n),P(this.location,t,this.location)}return n.prototype={matches:function(e){return this.match.test(e)},process:function(e,t){var n=this.location[t];if(n)return e.replace(this.match,n.url)}},n}(),oe=function(){var e={};function t(e){return e instanceof ArrayBuffer||e instanceof MessagePort||"ImageBitmap"in self&&e instanceof ImageBitmap}return function(n){var r,i;return r="$task = "+n+"; $isTransferable = "+t+"; onmessage = "+function(e){var t,n=Array.prototype.slice,r=e.data;function i(e){t||(t=!0,postMessage([r[0],0,e.toString()]))}try{$task.apply($task,[function(){var e;t||(t=!0,e=n.call(arguments),postMessage([r[0],1,e],e.filter($isTransferable)))},i].concat(r[1]))}catch(e){i(e)}},(i=new Worker(URL.createObjectURL(new Blob([r],{type:"application/javascript"})))).onmessage=function(t){var n=t.data[0],r=n?e[n]:null;n&&r&&(t.data[1]?r.resolve.apply(null,t.data[2]):r.reject(t.data[2]),delete e[n])},function(){var n=te.defer(),r=S(),o=A(arguments);return e[r]=n,i.postMessage([r,o],o.filter(t)),n.pledge}}}(),ae=(Z=/^(?:\?|)$/,ee=new oe((function(e,t,n){var r,i,o=new XMLHttpRequest;r=function(){this.readyState<4&&this.abort()}.bind(o),o.ontimeout=o.onerror=o.onabort=function(){t(o.statusText)},o.onprogress=o.onreadystatechange=function(){self.clearTimeout(i),i=self.setTimeout(r,1e4)},o.onload=function(){i=self.clearTimeout(i),"status"in o&&200!==o.status?t(o.statusText):e(o.responseText,o.getResponseHeader&&o.getResponseHeader("content-type"))},o.open("GET",n,!0),o.send(),i=self.setTimeout(r,1e4)})),function(e){var t;function n(t,n){n&&e.handler.validate&&!e.handler.validate(n)?e.dfd.reject(new Y("error loading (content-type)",e.id)):(e.source=t,O.emit("postRequest",e.type,e))}B.test(e.path)||P(c.pattern,(function(n,r){r.matches(e.path)&&(!t||t.weight>>0}r=function(){function t(e,t){this[e]={weight:e.length,state:t}}function n(e,t){"base"!==e&&(this[e]=new ie(e,t))}function r(e,t){var n=this[e]=this[e]||{};O.emit("preConfigure",e,n),C(n,t),O.emit("postConfigure",e,n)}function i(){var t,n,r=A(arguments),i=this!==e?this:null,o=0;for(O.emit("preResolve",null,r,i);t=r[o];o++)x(t,"string")?r[o]=re.resolve(t,i).pledge:(r[o]=(n=te.defer()).pledge,n.resolve(t));return(r.length>1?te.all(r):r[0]).always((function(){O.emit("postResolve",null,r,i)}))}return i.configure=function(e){var o=e.cache,a=e.version,u=e.delay,s=e.timeout,d=e.lifetime,f=e.base,l=e.pattern,h=e.modules,p=c.modules;return x(o,"boolean")?c.cache[""]={weight:0,state:o}:b(o)&&P(o,t,c.cache),R(a)&&(c.version=a),j(u)&&(c.delay=1e3*u),j(s)&&(c.timeout=1e3*Math.min(Math.max(s,2),20)),j(d)&&d>0&&(c.lifetime=1e3*d),x(f,"string")&&""!==f&&(c.pattern.base=new ie("",f)),b(l)&&P(l,n,c.pattern),b(h)&&P(h,r,p),i},i.version="7.0.1",i.on=O.on.bind(i),i.get=function(e,t){var n=re.get(e,t);return n&&n.value},i.list=re.list,i.remove=re.remove,i.cache={clear:V.clear},O.after("cacheMiss",(function(e){new ae(e)})).after("postRequest",(function(e){var t=e.handler.onPostRequest;t&&t(e)})).after("cacheHit postRequest",(function(e){O.emit("preProcess",e.id,e)})).after("preRequest",(function(e){var t=e.handler.onPreRequest;t&&t(e)})).after("preProcess",(function(e){var t=e.handler.onPreProcess;t&&t(e),e.pledge.then((function(){O.emit("postProcess",e.id,e)})),!0===e.enqueue?o.enqueue(e):q(e.enqueue,te)&&e.enqueue.then((function(){o.enqueue(e)}))})),i}(),e.defineProperty("demand",r),(i=function(){var t,n,i,o=x(arguments[0],"string")?arguments[0]:null,u=this!==e?this:null,s=ue(arguments[o?1:0])?arguments[o?1:0]:null,c=s?arguments[o?2:1]:arguments[o?1:0];if(!o&&a.current&&(o=(t=a.current).uri,a.process()),o)return t=t||new re(o,u),n=q(c,te),i=x(c,"function"),s?r.apply(t.path,s).then((function(){t.dfd.resolve(i?c.apply(null,arguments):c)}),(function(){t.dfd.reject(new Y("error providing",t.id,arguments))})):n?c.then(t.dfd.resolve,t.dfd.reject):t.dfd.resolve(i?c():c),t.dfd.pledge.then((function(){O.emit("provide",t.path,t)}),(function(){O.emit("reject",t.path,t)})),t.dfd.pledge;throw new Error("unspecified anonymous provide")}).amd=!0,e.defineProperty("provide",i),r.configure({cache:!0,base:"/",pattern:{"/demand":L((s&&s.url||location.href)+"/../").slice(0,-1)}}),s&&s.settings&&r.configure(s.settings);var ce=function(){var e=new $;function t(t){var n=this,i={queue:t,current:null};e.set(n,i),r.on("queueEnqueue:"+t.uuid,(function(){!i.current&&n.process()}))}return t.prototype={process:function(){var t,n=e.get(this);!n.queue.length||(t=n.current=n.queue.dequeue()).pledge.isRejected()?n.current=null:t.handler.process&&t.handler.process(t)},get current(){return e.get(this).current}},t}();function de(e,t){for(var n,r;n=z.exec(t);)B.test(n[3])?r=e.protocol+"//"+e.host+n[3]:(e.pathname+=(F.test(e.pathname)?"/../":"/")+n[3].replace(_,""),r=e.protocol+"//"+e.host+e.pathname),t=t.replace(n[0],n[1]+" "+n[2]+"="+r+".map"+(n[4]?" "+n[4]:""));return t}function fe(){}fe.prototype={validate:null,onPreRequest:null,onPostRequest:null,onPreProcess:null,process:null};var le=function(){var e=u.getElementsByTagName("head")[0],t=/^(application|text)\/(x-)?javascript/,n={suffix:".js"};function i(){}return r.on("postConfigure:/demand/handler/module",(function(e){b(e)&&C(n,e)})),i.prototype={validate:function(e){return t.test(e)},onPreRequest:function(e,t){var r;(t="undefined"!=typeof t?t:n.suffix)&&0!==e.path.indexOf("@")&&(r=e.url.pathname,e.url.pathname=r.slice(-t.length)!==t?r+t:r)},onPostRequest:function(e){e.source=de(e.url,e.source)},process:function(t){var n;t.source&&((n=u.createElement("script")).async=!0,n.text=t.source,n.setAttribute("demand-id",t.id),e.appendChild(n))}},new(i.extends(fe))}();function Y(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=A(n)),this}Y.prototype={toString:function(){var e=this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=Y.traverse(this.stack,e,1)),e}},Y.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=Y.traverse(r.stack,t,n+1));return t};var he=function(){var e={};function t(e,t){var n,r;for(n=0;r=t[n];n++)x(r,"string")&&(t[n]=K(r))}function n(){}return r.on("postConfigure:/demand/handler/bundle",(function(n){b(n)&&P(e=n,t)})),n.prototype={validate:le.validate,onPreProcess:function(t){var n,r,i,a,u,s=t.source,c=t.dfd,d=e[t.path];function f(){c.reject(new Y("error resolving",t.id,arguments))}if(t.enqueue=!1,d&&(n=function(t){for(var n,r,i=0;r=t[i];i++)if(r=(r=r.match(G))&&r[3]||e.handler,n){if(r!==n)return!1}else n=r;return n}(d))){for(;r=z.exec(s);)s=s.replace(r[0],"");for(t.source=s,i=[],u=0;a=d[u];u++)i.push(re.resolve("mock:"+a).pledge);te.all(i).then((function(){for(i.length=0,u=0;a=d[u];u++)(a=d[u]=re.get(a)||new re(a)).handler=arguments[u],i.push(a.pledge);"module"===n?(o.enqueue.apply(o,d),le.process(t)):(le.process(t),o.enqueue.apply(o,d)),te.all(i).then(c.resolve,f)}),f)}else f()}},new(n.extends(fe))}(),pe=function(){var e=/^text\/.+$/,t={suffix:".html"};function n(){}return r.on("postConfigure:/demand/handler/component",(function(e){b(e)&&C(t,e)})),n.prototype={validate:function(t){return e.test(t)},onPreRequest:function(e,n){var r;(n="undefined"!=typeof n?n:t.suffix)&&(r=e.url.pathname,e.url.pathname=r.slice(-n.length)!==n?r+n:r)},onPostRequest:function(e){e.source=de(e.url,e.source)},onPreProcess:function(e){var t,n,r,i,a=e.path,s=e.dfd,c=u.createElement("body"),d=[],f=[];function l(){s.reject(new Y("error resolving",e.id,arguments))}for(e.enqueue=!1,c.innerHTML=e.source;t=c.firstElementChild;)(n=t.getAttribute("type"))&&(i=n+"!"+a+((r=t.getAttribute("path"))?"/"+r:""),t.parentNode.removeChild(t),d.push({source:t.textContent,uri:i}),f.push(re.resolve("mock:"+i).pledge));te.all(f).then((function(){var t,n,r,i=[];for(f.length=0,t=0;n=d[t];t++)(r=re.get(n.uri)||new re(n.uri)).source=de(r.url,n.source),r.handler=arguments[t],i.push(r),f.push(r.pledge),o.enqueue(r);te.all(f).then((function(){var r=e.path.length+1,o={};for(t=0;n=arguments[t];t++)o[i[t].path.substr(r)||"main"]=n;s.resolve(o)}),l)}),l)}},new(n.extends(fe))}(),ve=function(){var e="/demand/plugin/genie",t=[];function n(e){for(var n,r,i=0;n=t[i];i++)n.prefix.test(e)&&(!r||n.weight>r.weight)&&(r=n);return r}function i(){for(var e,t=0;e=this[t];t++)e.dfd.resolve(arguments[t])}function o(){for(var e,t=0;e=this[t];t++)e.dfd.reject(new Y("error resolving",e.id))}function a(e,n){t.push({prefix:new RegExp("^"+e),weight:e.length,fn:n})}function u(t,n){var a,u=n.matches,s=0;if(u.length>1){for(n.id=e+"/"+se(JSON.stringify(n.matches));a=u[s];s++)u[s]=new re(a.uri);r.configure(function(e){var t,n,r=e.matches,i={pattern:{},modules:{"/demand/handler/bundle":{}}},o=0;for(i.pattern[e.id]=e.fn(r),i.modules["/demand/handler/bundle"][e.id]=t=[];n=r[o];o++)t.push(n.path);return i}(n)),r("bundle!"+n.id).then(i.bind(u),o.bind(u))}}return r.on("postConfigure:"+e,(function(e){b(e)&&(t.length=0,P(e,a))})).on("preResolve",(function(e,t){for(var r,i,o={},a=0;r=e[a];a++)!x(r,"string")||X.test(r)||re.get(r,t)||"module"===(r=new re(r,t,!1)).type&&(i=n(r.path))&&!V.get(r)&&(o[i.prefix]||(o[i.prefix]={fn:i.fn,matches:[]})).matches.push(r);P(o,u)})),!0}();function me(e,t){i(e,(function(){return t}))}if(o=new H,a=new ce(o),me("/demand/abstract/uuid",I),me("/demand/abstract/handler",fe),me("/demand/handler/module",le),me("/demand/handler/bundle",he),me("/demand/handler/component",pe),me("/demand/plugin/genie",ve),me("/demand/validator/isTypeOf",x),me("/demand/validator/isArray",ue),me("/demand/validator/isObject",b),me("/demand/validator/isInstanceOf",q),me("/demand/validator/isSemver",R),me("/demand/function/resolveUrl",L),me("/demand/function/resolveSourcemaps",de),me("/demand/function/merge",C),me("/demand/function/iterate",P),me("/demand/function/hash",se),me("/demand/function/defer",T),me("/demand/function/idle",N),me("/demand/function/uuid",S),me("/demand/function/toArray",A),me("/demand/task",oe),me("/demand/weakmap",$),me("/demand/descriptor",w),me("/demand/pledge",te),me("/demand/queue",H),me("/demand/failure",Y),me("/demand/semver",Q),s&&s.main)switch(typeof s.main){case"string":r(s.main);break;case"function":i("main",s.main())}}("demand-loader"===this.name?parent:this,setTimeout,clearTimeout); //# sourceMappingURL=demand.js.map diff --git a/dist/handler/css.js b/dist/handler/css.js index 2db3f1a..687960a 100644 --- a/dist/handler/css.js +++ b/dist/handler/css.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(e){"use strict";provide(["path","/demand/abstract/handler","/demand/function/resolveSourcemaps","/demand/validator/isObject","/demand/function/merge"],(function(t,n,r,s,o){var u=e.getElementsByTagName("head")[0],a=e.createElement("a"),i=/url\s*\(\s*["']?(.+?)["']?\s*\)/gi,c=/@import\s+["'](.+?)["']/gi,d=/^\//i,f=/^data:|http(s?):|\/\//i,l=/^text\/css/,m={suffix:".css"};function p(e){return a.href=e,a}function h(e,t,n){return f.test(t[1])||(e=e.replace(t[0],n)),e}function v(){}return demand.on("postConfigure:"+t,(function(e){s(e)&&o(m,e)})),v.prototype={validate:function(e){return l.test(e)},onPreRequest:function(e,t){var n;(t="undefined"!=typeof t?t:m.suffix)&&(n=e.url.pathname,e.url.pathname=n.slice(-t.length)!==t?n+t:n)},onPostRequest:function(e){for(var t,n=p(e.url+"/.."),s=n.href,o="//"+n.host,u=e.source;t=i.exec(u);)u=h(u,t,'url("'+p(d.test(t[1])?o+t[1]:s+t[1]).href+'")');for(;t=c.exec(u);)u=h(u,t,'@import "'+p(d.test(t[1])?o+t[1]:s+t[1]).href+'"');e.source=r(e.url,u)},process:function(t){var n=e.querySelector('[demand-id="'+t.id+'"]');n||((n=e.createElement("style")).type="text/css",n.setAttribute("demand-id",t.id),u.appendChild(n)),"STYLE"===n.tagName&&(n.styleSheet?n.styleSheet.cssText=t.source:n.textContent=t.source),provide((function(){return n}))}},new(v.extends(n))}))}(document); //# sourceMappingURL=css.js.map diff --git a/dist/handler/html.js b/dist/handler/html.js index 30b7008..358c54d 100644 --- a/dist/handler/html.js +++ b/dist/handler/html.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["path","/demand/abstract/handler","/demand/validator/isObject","/demand/function/merge"],(function(e,n,t,r){var o=/^text\/html/,u=document.createElement("body"),i={suffix:".html"};function a(){}return demand.on("postConfigure:"+e,(function(e){t(e)&&r(i,e)})),a.prototype={validate:function(e){return o.test(e)},onPreRequest:function(e,n){var t;(n="undefined"!=typeof n?n:i.suffix)&&(t=e.url.pathname,e.url.pathname=t.slice(-n.length)!==n?t+n:t)},process:function(e){provide((function(){return function(e){var n,t=document.createDocumentFragment();for(u.innerHTML=e;n=u.firstElementChild;)t.appendChild(n);return t}(e.source)}))}},new(a.extends(n))}))}(); //# sourceMappingURL=html.js.map diff --git a/dist/handler/json.js b/dist/handler/json.js index 363fbe2..cf00ed3 100644 --- a/dist/handler/json.js +++ b/dist/handler/json.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["path","/demand/abstract/handler","/demand/task","/demand/pledge","/demand/failure","/demand/validator/isObject","/demand/function/merge"],(function(n,e,t,a,o,d,i){var r=/^application\/json/,u={suffix:".json"},c=new t((function(n,e,t){try{n(JSON.parse(t))}catch(n){e(n)}}));function s(){}return demand.on("postConfigure:"+n,(function(n){d(n)&&i(u,n)})),s.prototype={validate:function(n){return r.test(n)},onPreRequest:function(n,e){var t;(e="undefined"!=typeof e?e:u.suffix)&&(t=n.url.pathname,n.url.pathname=t.slice(-e.length)!==e?t+e:t)},process:function(n){provide(c(n.source))}},new(s.extends(e))}))}(); //# sourceMappingURL=json.js.map diff --git a/dist/handler/legacy.js b/dist/handler/legacy.js index 4fa09f6..80042c0 100644 --- a/dist/handler/legacy.js +++ b/dist/handler/legacy.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ -!function(){"use strict";provide(["path","/demand/failure","/demand/handler/module","/demand/validator/isObject","/demand/function/merge"],(function(e,n,t,o,r){var u={suffix:".js"};function d(){var e,o=this.dfd,r=u[this.path]&&u[this.path].probe;t.process(this),r&&(e=r())?provide((function(){return e})):o.reject(new n("error probing",this.path))}function i(){}return demand.on("postConfigure:"+e,(function(e){o(e)&&r(u,e)})),i.prototype={onPreRequest:function(e,n){var o=u[e.path]&&u[e.path].dependencies;n="undefined"!=typeof n?n:u.suffix,t.onPreRequest(e,n||!1),o&&(e.enqueue=demand.apply(null,o))},onPreProcess:function(e){var n=u[e.path]&&u[e.path].dependencies;n&&"boolean"==typeof e.enqueue&&(e.enqueue=demand.apply(null,n))},process:function(e){var t=d.bind(e);!0===e.enqueue?t():e.enqueue.then(t,(function(){e.dfd.reject(new n("error resolving",e.path,arguments))}))}},new(i.extends(t))}))}(); +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +!function(){"use strict";provide(["path","/demand/failure","/demand/handler/module","/demand/validator/isObject","/demand/function/merge"],(function(e,n,t,r,o){var u={suffix:".js"};function i(){var e,r=this.dfd,o=u[this.path]&&u[this.path].probe;t.process(this),o&&(e=o())?provide((function(){return e})):o?r.reject(new n("error probing",this.path)):provide((function(){return!0}))}function d(){}return demand.on("postConfigure:"+e,(function(e){r(e)&&o(u,e)})),d.prototype={onPreRequest:function(e,n){var r=u[e.path]&&u[e.path].dependencies;n="undefined"!=typeof n?n:u.suffix,t.onPreRequest(e,n||!1),r&&(e.enqueue=demand.apply(null,r))},onPreProcess:function(e){var n=u[e.path]&&u[e.path].dependencies;n&&"boolean"==typeof e.enqueue&&(e.enqueue=demand.apply(null,n))},process:function(e){var t=i.bind(e);!0===e.enqueue?t():e.enqueue.then(t,(function(){e.dfd.reject(new n("error resolving",e.path,arguments))}))}},new(d.extends(t))}))}(); //# sourceMappingURL=legacy.js.map diff --git a/dist/handler/legacy.js.map b/dist/handler/legacy.js.map index d594e78..880a20e 100644 --- a/dist/handler/legacy.js.map +++ b/dist/handler/legacy.js.map @@ -1 +1 @@ -{"version":3,"sources":["handler/legacy.js"],"names":["provide","path","Failure","handlerModule","isObject","merge","settings","suffix","resolve","result","dfd","this","probe","process","reject","HandlerLegacy","demand","on","options","prototype","onPreRequest","dependency","dependencies","enqueue","apply","onPreProcess","boundResolve","bind","then","arguments","extends"],"mappings":";CAAC,WACA,aAoEAA,QAAQ,CAAE,OAAQ,kBAAmB,yBAA0B,6BAA8B,2BAlE7F,SAAoBC,EAAMC,EAASC,EAAeC,EAAUC,GAC3D,IAAIC,EAAW,CAAEC,OAAQ,OASzB,SAASC,IACR,IAGCC,EAFAC,EADWC,KACED,IACbE,EAAQN,EAFGK,KAEWV,OAASK,EAFpBK,KAEkCV,MAAMW,MAGpDT,EAAcU,QALFF,MAOTC,IAAUH,EAASG,KACrBZ,SAAQ,WAAa,OAAOS,KAE5BC,EAAII,OAAO,IAAIZ,EAAQ,gBAVZS,KAUkCV,OAI/C,SAASc,KAsCT,OA5DAC,OACEC,GAAG,iBAAmBhB,GAAM,SAASiB,GAClCd,EAASc,IACXb,EAAMC,EAAUY,MAqBnBH,EAAcI,UAAY,CACzBC,aAAc,SAASC,EAAYd,GAClC,IAAIe,EAAehB,EAASe,EAAWpB,OAASK,EAASe,EAAWpB,MAAMqB,aAE1Ef,EAA4B,oBAAXA,EAA0BA,EAASD,EAASC,OAE7DJ,EAAciB,aAAaC,EAAYd,IAAU,GAE9Ce,IACFD,EAAWE,QAAUP,OAAOQ,MAAM,KAAMF,KAG1CG,aAAc,SAASJ,GACtB,IAAIC,EAAehB,EAASe,EAAWpB,OAASK,EAASe,EAAWpB,MAAMqB,aAEvEA,GAA8C,kBAAvBD,EAAWE,UACpCF,EAAWE,QAAUP,OAAOQ,MAAM,KAAMF,KAG1CT,QAAS,SAASQ,GACjB,IAAIK,EAAelB,EAAQmB,KAAKN,IAEN,IAAvBA,EAAWE,QACbG,IAEAL,EAAWE,QACTK,KACAF,GACA,WACCL,EAAWX,IAAII,OAAO,IAAIZ,EAAQ,kBAAmBmB,EAAWpB,KAAM4B,iBAOrE,IAAKd,EAAce,QAAQ3B,OAlEpC","file":"legacy.js","sourcesContent":["(function() {\n\t'use strict';\n\n\tfunction definition(path, Failure, handlerModule, isObject, merge) {\n\t\tvar settings = { suffix: '.js' };\n\n\t\tdemand\n\t\t\t.on('postConfigure:' + path, function(options) {\n\t\t\t\tif(isObject(options)) {\n\t\t\t\t\tmerge(settings, options);\n\t\t\t\t}\n\t\t\t});\n\n\t\tfunction resolve() {\n\t\t\tvar self = this,\n\t\t\t\tdfd = self.dfd,\n\t\t\t\tprobe = settings[self.path] && settings[self.path].probe,\n\t\t\t\tresult;\n\n\t\t\thandlerModule.process(self);\n\n\t\t\tif(probe && (result = probe())) {\n\t\t\t\tprovide(function() { return result; });\n\t\t\t} else {\n\t\t\t\tdfd.reject(new Failure('error probing', self.path));\n\t\t\t}\n\t\t}\n\n\t\tfunction HandlerLegacy() {}\n\n\t\tHandlerLegacy.prototype = {\n\t\t\tonPreRequest: function(dependency, suffix) {\n\t\t\t\tvar dependencies = settings[dependency.path] && settings[dependency.path].dependencies;\n\n\t\t\t\tsuffix = (typeof suffix !== 'undefined') ? suffix : settings.suffix;\n\n\t\t\t\thandlerModule.onPreRequest(dependency, suffix || false);\n\n\t\t\t\tif(dependencies) {\n\t\t\t\t\tdependency.enqueue = demand.apply(null, dependencies);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonPreProcess: function(dependency) {\n\t\t\t\tvar dependencies = settings[dependency.path] && settings[dependency.path].dependencies;\n\n\t\t\t\tif(dependencies && typeof dependency.enqueue === 'boolean') {\n\t\t\t\t\tdependency.enqueue = demand.apply(null, dependencies);\n\t\t\t\t}\n\t\t\t},\n\t\t\tprocess: function(dependency) {\n\t\t\t\tvar boundResolve = resolve.bind(dependency);\n\n\t\t\t\tif(dependency.enqueue === true) {\n\t\t\t\t\tboundResolve();\n\t\t\t\t} else {\n\t\t\t\t\tdependency.enqueue\n\t\t\t\t\t\t.then(\n\t\t\t\t\t\t\tboundResolve,\n\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\tdependency.dfd.reject(new Failure('error resolving', dependency.path, arguments));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn new (HandlerLegacy.extends(handlerModule));\n\t}\n\n\tprovide([ 'path', '/demand/failure', '/demand/handler/module', '/demand/validator/isObject', '/demand/function/merge' ], definition);\n}());\n"]} \ No newline at end of file +{"version":3,"sources":["handler/legacy.js"],"names":["provide","path","Failure","handlerModule","isObject","merge","settings","suffix","resolve","result","dfd","this","probe","process","reject","HandlerLegacy","demand","on","options","prototype","onPreRequest","dependency","dependencies","enqueue","apply","onPreProcess","boundResolve","bind","then","arguments","extends"],"mappings":";CAAC,WACA,aAwEAA,QAAQ,CAAE,OAAQ,kBAAmB,yBAA0B,6BAA8B,2BAtE7F,SAAoBC,EAAMC,EAASC,EAAeC,EAAUC,GAC3D,IAAIC,EAAW,CAAEC,OAAQ,OASzB,SAASC,IACR,IAGCC,EAFAC,EADWC,KACED,IACbE,EAAQN,EAFGK,KAEWV,OAASK,EAFpBK,KAEkCV,MAAMW,MAGpDT,EAAcU,QALFF,MAOTC,IAAUH,EAASG,KACrBZ,SAAQ,WAAa,OAAOS,KAEzBG,EACFF,EAAII,OAAO,IAAIZ,EAAQ,gBAXbS,KAWmCV,OAE7CD,SAAQ,WAAa,OAAO,KAK/B,SAASe,KAsCT,OAhEAC,OACEC,GAAG,iBAAmBhB,GAAM,SAASiB,GAClCd,EAASc,IACXb,EAAMC,EAAUY,MAyBnBH,EAAcI,UAAY,CACzBC,aAAc,SAASC,EAAYd,GAClC,IAAIe,EAAehB,EAASe,EAAWpB,OAASK,EAASe,EAAWpB,MAAMqB,aAE1Ef,EAA4B,oBAAXA,EAA0BA,EAASD,EAASC,OAE7DJ,EAAciB,aAAaC,EAAYd,IAAU,GAE9Ce,IACFD,EAAWE,QAAUP,OAAOQ,MAAM,KAAMF,KAG1CG,aAAc,SAASJ,GACtB,IAAIC,EAAehB,EAASe,EAAWpB,OAASK,EAASe,EAAWpB,MAAMqB,aAEvEA,GAA8C,kBAAvBD,EAAWE,UACpCF,EAAWE,QAAUP,OAAOQ,MAAM,KAAMF,KAG1CT,QAAS,SAASQ,GACjB,IAAIK,EAAelB,EAAQmB,KAAKN,IAEN,IAAvBA,EAAWE,QACbG,IAEAL,EAAWE,QACTK,KACAF,GACA,WACCL,EAAWX,IAAII,OAAO,IAAIZ,EAAQ,kBAAmBmB,EAAWpB,KAAM4B,iBAOrE,IAAKd,EAAce,QAAQ3B,OAtEpC","file":"legacy.js","sourcesContent":["(function() {\n\t'use strict';\n\n\tfunction definition(path, Failure, handlerModule, isObject, merge) {\n\t\tvar settings = { suffix: '.js' };\n\n\t\tdemand\n\t\t\t.on('postConfigure:' + path, function(options) {\n\t\t\t\tif(isObject(options)) {\n\t\t\t\t\tmerge(settings, options);\n\t\t\t\t}\n\t\t\t});\n\n\t\tfunction resolve() {\n\t\t\tvar self = this,\n\t\t\t\tdfd = self.dfd,\n\t\t\t\tprobe = settings[self.path] && settings[self.path].probe,\n\t\t\t\tresult;\n\n\t\t\thandlerModule.process(self);\n\n\t\t\tif(probe && (result = probe())) {\n\t\t\t\tprovide(function() { return result; });\n\t\t\t} else {\n\t\t\t\tif(probe) {\n\t\t\t\t\tdfd.reject(new Failure('error probing', self.path));\n\t\t\t\t} else {\n\t\t\t\t\tprovide(function() { return true; });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction HandlerLegacy() {}\n\n\t\tHandlerLegacy.prototype = {\n\t\t\tonPreRequest: function(dependency, suffix) {\n\t\t\t\tvar dependencies = settings[dependency.path] && settings[dependency.path].dependencies;\n\n\t\t\t\tsuffix = (typeof suffix !== 'undefined') ? suffix : settings.suffix;\n\n\t\t\t\thandlerModule.onPreRequest(dependency, suffix || false);\n\n\t\t\t\tif(dependencies) {\n\t\t\t\t\tdependency.enqueue = demand.apply(null, dependencies);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonPreProcess: function(dependency) {\n\t\t\t\tvar dependencies = settings[dependency.path] && settings[dependency.path].dependencies;\n\n\t\t\t\tif(dependencies && typeof dependency.enqueue === 'boolean') {\n\t\t\t\t\tdependency.enqueue = demand.apply(null, dependencies);\n\t\t\t\t}\n\t\t\t},\n\t\t\tprocess: function(dependency) {\n\t\t\t\tvar boundResolve = resolve.bind(dependency);\n\n\t\t\t\tif(dependency.enqueue === true) {\n\t\t\t\t\tboundResolve();\n\t\t\t\t} else {\n\t\t\t\t\tdependency.enqueue\n\t\t\t\t\t\t.then(\n\t\t\t\t\t\t\tboundResolve,\n\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\tdependency.dfd.reject(new Failure('error resolving', dependency.path, arguments));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn new (HandlerLegacy.extends(handlerModule));\n\t}\n\n\tprovide([ 'path', '/demand/failure', '/demand/handler/module', '/demand/validator/isObject', '/demand/function/merge' ], definition);\n}());\n"]} \ No newline at end of file diff --git a/dist/handler/text.js b/dist/handler/text.js index bc9d2ab..22aab62 100644 --- a/dist/handler/text.js +++ b/dist/handler/text.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["path","/demand/abstract/handler","/demand/validator/isObject","/demand/function/merge"],(function(n,e,t,r){var o=/^text\/.+/,u={};function i(){}return demand.on("postConfigure:"+n,(function(n){t(n)&&r(u,n)})),i.prototype={validate:function(n){return o.test(n)},onPreRequest:function(n,e){var t;(e="undefined"!=typeof e?e:u.suffix)&&(t=n.url.pathname,n.url.pathname=t.slice(-e.length)!==e?t+e:t)},process:function(n){provide((function(){return n.source}))}},new(i.extends(e))}))}(); //# sourceMappingURL=text.js.map diff --git a/dist/plugin/cookie.js b/dist/plugin/cookie.js index c7ca502..cbc0ac3 100644 --- a/dist/plugin/cookie.js +++ b/dist/plugin/cookie.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(n){"use strict";provide(["path","/demand/function/iterate","/demand/validator/isObject","/demand/validator/isTypeOf"],(function(t,e,o,i){var a,c="Thu, 01 Jan 1970 00:00:00 GMT",r=[];function u(t,e,o){(a||function(n){for(var t,e,o=0;t=r[o];o++)0===n.indexOf(t.pattern)&&(!e||t.weight>e.weight)&&(e=t);return!!e&&e.state}(t.path))&&(n.cookie="demand["+t.type+"]["+t.path+"]="+encodeURIComponent(e)+"; expires="+o+"; path=/")}return demand.on("postConfigure:"+t,(function(n){o(n)?(r.length=0,e(n,(function(n,t){r.push({pattern:n,weight:n.length,state:t})}))):i(n,"boolean")&&(a=n)})).on("cacheMiss",(function(n){u(n,"",c)})).on("cacheClear",(function(n){u(n,"",c)})).on("postCache",(function(n,t){u(n,JSON.stringify(t),"Fri, 31 Dec 9999 23:59:59 GMT")})),!0}))}(document); //# sourceMappingURL=cookie.js.map diff --git a/dist/plugin/lzstring.js b/dist/plugin/lzstring.js index 9e889bf..3861725 100644 --- a/dist/plugin/lzstring.js +++ b/dist/plugin/lzstring.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ var LZString=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(n,r){if(!e[n]){e[n]={};for(var o=0;o>>8,o[2*e+1]=s%256}return o},decompressFromUint8Array:function(r){if(null==r)return i.decompress(r);for(var o=new Array(r.length/2),e=0,t=o.length;e>=1}else{for(t=1,e=0;e>=1}0==--f&&(f=Math.pow(2,h),h++),delete a[p]}else for(t=s[p],e=0;e>=1;0==--f&&(f=Math.pow(2,h),h++),s[c]=l++,p=String(u)}if(""!==p){if(Object.prototype.hasOwnProperty.call(a,p)){if(p.charCodeAt(0)<256){for(e=0;e>=1}else{for(t=1,e=0;e>=1}0==--f&&(f=Math.pow(2,h),h++),delete a[p]}else for(t=s[p],e=0;e>=1;0==--f&&(f=Math.pow(2,h),h++)}for(t=2,e=0;e>=1;for(;;){if(m<<=1,g==r-1){d.push(o(m));break}g++}return d.join("")},decompress:function(n){return null==n?"":""==n?null:i._decompress(n.length,32768,(function(r){return n.charCodeAt(r)}))},_decompress:function(r,o,e){var t,i,s,a,u,c,p,f=[],l=4,h=4,d=3,m="",g=[],v={val:e(0),position:o,index:1};for(t=0;t<3;t+=1)f[t]=t;for(s=0,u=Math.pow(2,2),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;p=n(s);break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;p=n(s);break;case 2:return""}for(f[3]=p,i=p,g.push(p);;){if(v.index>r)return"";for(s=0,u=Math.pow(2,d),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(p=s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[h++]=n(s),p=h-1,l--;break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[h++]=n(s),p=h-1,l--;break;case 2:return g.join("")}if(0==l&&(l=Math.pow(2,d),d++),f[p])m=f[p];else{if(p!==h)return null;m=i+i.charAt(0)}g.push(m),f[h++]=i+m.charAt(0),i=m,0==--l&&(l=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define((function(){return LZString})):"undefined"!=typeof module&&null!=module?module.exports=LZString:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",(function(){return LZString})),function(n){"use strict";provide(["path","/demand/function/iterate","/demand/validator/isObject","/demand/validator/isTypeOf"],(function(r,o,e,t){var i=[{pattern:r,weight:r.length,state:!1}],s={};function a(n){for(var r,o,e=0;r=i[e];e++)0===n.indexOf(r.pattern)&&(!o||r.weight>o.weight)&&(o=r);return!!o&&o.state}return demand.on("postConfigure:"+r,(function(n){e(n)?(i.length=0,o(n,(function(n,r){i.push({pattern:n,weight:n.length,state:r})}))):t(n,"boolean")&&i.push({pattern:"",weight:0,state:n})})).on("cacheHit",(function(n){a(n.path)&&(s[n.id]=!0)})).on("preCache",(function(r){a(r.path)&&(r.source=n.LZString.compressToUTF16(r.source))})).on("preProcess",(function(r){s[r.id]&&(r.source=n.LZString.decompressFromUTF16(r.source))})),!0}))}(this); //# sourceMappingURL=lzstring.js.map diff --git a/dist/plugin/sri.js b/dist/plugin/sri.js index 28b903c..8a1d922 100644 --- a/dist/plugin/sri.js +++ b/dist/plugin/sri.js @@ -1,4 +1,4 @@ -/**! Qoopido.demand 7.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 7.0.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ /** * @preserve A JavaScript implementation of the SHA family of hashes, as * defined in FIPS PUB 180-4 and FIPS PUB 202, as well as the corresponding diff --git a/package.json b/package.json index 2203c3b..035f7d4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "qoopido.demand", "title": "Qoopido.demand", "description": "Promise like module loader using XHR requests and localStorage caching to dynamically load JavaScript and CSS + dynamic dependency resolution + support for custom handlers", - "version": "7.0.0", + "version": "7.0.1", "homepage": "https://github.com/dlueth/qoopido.demand", "author": { "name": "Dirk Lueth",