-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprism-line-range-polyfilled.min.js
More file actions
1 lines (1 loc) · 10.8 KB
/
Copy pathprism-line-range-polyfilled.min.js
File metadata and controls
1 lines (1 loc) · 10.8 KB
1
!function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}return a}()({1:[function(a,b,c){(function(a){"use strict";function c(a){var b=this.constructor;return this.then(function(c){return b.resolve(a()).then(function(){return c})},function(c){return b.resolve(a()).then(function(){return b.reject(c)})})}function d(){}function e(a,b){return function(){a.apply(b,arguments)}}function f(a){if(!(this instanceof f))throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(a,this)}function g(a,b){for(;3===a._state;)a=a._value;return 0===a._state?void a._deferreds.push(b):(a._handled=!0,void f._immediateFn(function(){var c=1===a._state?b.onFulfilled:b.onRejected;if(null===c)return void(1===a._state?h:i)(b.promise,a._value);var d;try{d=c(a._value)}catch(e){return void i(b.promise,e)}h(b.promise,d)}))}function h(a,b){try{if(b===a)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){var c=b.then;if(b instanceof f)return a._state=3,a._value=b,void j(a);if("function"==typeof c)return void l(e(c,b),a)}a._state=1,a._value=b,j(a)}catch(d){i(a,d)}}function i(a,b){a._state=2,a._value=b,j(a)}function j(a){2===a._state&&0===a._deferreds.length&&f._immediateFn(function(){a._handled||f._unhandledRejectionFn(a._value)});for(var b=0,c=a._deferreds.length;c>b;b++)g(a,a._deferreds[b]);a._deferreds=null}function k(a,b,c){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.promise=c}function l(a,b){var c=!1;try{a(function(a){c||(c=!0,h(b,a))},function(a){c||(c=!0,i(b,a))})}catch(d){if(c)return;c=!0,i(b,d)}}var m=setTimeout;f.prototype["catch"]=function(a){return this.then(null,a)},f.prototype.then=function(a,b){var c=new this.constructor(d);return g(this,new k(a,b,c)),c},f.prototype["finally"]=c,f.all=function(a){return new f(function(b,c){function d(a,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(b){d(a,b)},c)}e[a]=g,0===--f&&b(e)}catch(i){c(i)}}if(!a||"undefined"==typeof a.length)throw new TypeError("Promise.all accepts an array");var e=Array.prototype.slice.call(a);if(0===e.length)return b([]);for(var f=e.length,g=0;g<e.length;g++)d(g,e[g])})},f.resolve=function(a){return a&&"object"==typeof a&&a.constructor===f?a:new f(function(b){b(a)})},f.reject=function(a){return new f(function(b,c){c(a)})},f.race=function(a){return new f(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})},f._immediateFn="function"==typeof a&&function(b){a(b)}||function(a){m(a,0)},f._unhandledRejectionFn=function(a){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",a)},b.exports=f}).call(this,a("timers").setImmediate)},{timers:7}],2:[function(a,b,c){(function(a,b){!function(b,c){"use strict";function d(a){"function"!=typeof a&&(a=new Function(""+a));for(var b=new Array(arguments.length-1),c=0;c<b.length;c++)b[c]=arguments[c+1];var d={callback:a,args:b};return p[o]=d,n(o),o++}function e(a){delete p[a]}function f(a){var b=a.callback,d=a.args;switch(d.length){case 0:b();break;case 1:b(d[0]);break;case 2:b(d[0],d[1]);break;case 3:b(d[0],d[1],d[2]);break;default:b.apply(c,d)}}function g(a){if(q)setTimeout(g,0,a);else{var b=p[a];if(b){q=!0;try{f(b)}finally{e(a),q=!1}}}}function h(){n=function(b){a.nextTick(function(){g(b)})}}function i(){if(b.postMessage&&!b.importScripts){var a=!0,c=b.onmessage;return b.onmessage=function(){a=!1},b.postMessage("","*"),b.onmessage=c,a}}function j(){var a="setImmediate$"+Math.random()+"$",c=function(c){c.source===b&&"string"==typeof c.data&&0===c.data.indexOf(a)&&g(+c.data.slice(a.length))};b.addEventListener?b.addEventListener("message",c,!1):b.attachEvent("onmessage",c),n=function(c){b.postMessage(a+c,"*")}}function k(){var a=new MessageChannel;a.port1.onmessage=function(a){var b=a.data;g(b)},n=function(b){a.port2.postMessage(b)}}function l(){var a=r.documentElement;n=function(b){var c=r.createElement("script");c.onreadystatechange=function(){g(b),c.onreadystatechange=null,a.removeChild(c),c=null},a.appendChild(c)}}function m(){n=function(a){setTimeout(g,0,a)}}if(!b.setImmediate){var n,o=1,p={},q=!1,r=b.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(b);s=s&&s.setTimeout?s:b,"[object process]"==={}.toString.call(b.process)?h():i()?j():b.MessageChannel?k():r&&"onreadystatechange"in r.createElement("script")?l():m(),s.setImmediate=d,s.clearImmediate=e}}("undefined"==typeof self?"undefined"==typeof b?this:b:self)}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:6}],3:[function(a,b,c){b.exports=function(a,b){return b=b||{},new Promise(function(c,d){var e=new XMLHttpRequest,f=[],g=[],h={},i=function(){return{ok:2==(e.status/100|0),statusText:e.statusText,status:e.status,url:e.responseURL,text:function(){return Promise.resolve(e.responseText)},json:function(){return Promise.resolve(JSON.parse(e.responseText))},blob:function(){return Promise.resolve(new Blob([e.response]))},clone:i,headers:{keys:function(){return f},entries:function(){return g},get:function(a){return h[a.toLowerCase()]},has:function(a){return a.toLowerCase()in h}}}};for(var j in e.open(b.method||"get",a,!0),e.onload=function(){e.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(a,b,c){f.push(b=b.toLowerCase()),g.push([b,c]),h[b]=h[b]?h[b]+","+c:c}),c(i())},e.onerror=d,e.withCredentials="include"==b.credentials,b.headers)e.setRequestHeader(j,b.headers[j]);e.send(b.body||null)})}},{}],4:[function(a,b,c){!function(){function b(c,d,e){function f(h,i){if(!d[h]){if(!c[h]){var j="function"==typeof a&&a;if(!i&&j)return j(h,!0);if(g)return g(h,!0);var k=new Error("Cannot find module '"+h+"'");throw k.code="MODULE_NOT_FOUND",k}var l=d[h]={exports:{}};c[h][0].call(l.exports,function(a){var b=c[h][1][a];return f(b||a)},l,l.exports,b,c,d,e)}return d[h].exports}for(var g="function"==typeof a&&a,h=0;h<e.length;h++)f(e[h]);return f}return b}()({1:[function(a,b,c){"use strict";!function(){function a(a){var b=fetch(a).then(function(a){return a.text()});return b}function b(b){return a(b).then(function(a){return[b,a.split("\n")]})}function c(a,b){var c=a.getAttribute("data-range"),d=c.split(","),e=d.filter(function(a){return isNaN(a)===!1}),f=parseInt(e[0],10),g=void 0===e[1]?-1:parseInt(e[1],10),h=b[1].slice(f-1,g).join("\n"),i='<code class="line-numbers lang-js">'+h.trim()+"</code>";a.setAttribute("data-start",f),a.innerHTML=i,Prism.highlightAllUnder(a)}function d(){var a=Array.prototype.slice.apply(document.querySelectorAll("pre[data-fetch]")),d=a.map(function(a){return a.getAttribute("data-fetch")}),e=d.filter(function(a,b){return d.indexOf(a)==b});e.map(function(d){return b(d).then(function(b){a.map(function(a){a.getAttribute("data-fetch")===b[0]?c(a,b):null})})})}"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(Prism.hooks.add("line-range",function(a){a.plugins=a.plugins||{},a.plugins.linerange=!0}),Prism.plugins.linerange={lineRange:d},d())}()},{}]},{},[1])},{}],5:[function(a,b,c){a("unfetch"),a("promise-polyfill")["default"];a("./prism-line-range.babel.js"),a("setimmediate"),Array.prototype.filter||(Array.prototype.filter=function(a,b){"use strict";if("Function"!=typeof a&&"function"!=typeof a||!this)throw new TypeError;var c=this.length>>>0,d=new Array(c),e=this,f=0,g=-1;if(void 0===b)for(;++g!==c;)g in this&&a(e[g],g,e)&&(d[f++]=e[g]);else for(;++g!==c;)g in this&&a.call(b,e[g],g,e)&&(d[f++]=e[g]);return d.length=f,d})},{"./prism-line-range.babel.js":4,"promise-polyfill":1,setimmediate:2,unfetch:3}],6:[function(a,b,c){function d(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function f(a){if(l===setTimeout)return setTimeout(a,0);if((l===d||!l)&&setTimeout)return l=setTimeout,setTimeout(a,0);try{return l(a,0)}catch(b){try{return l.call(null,a,0)}catch(b){return l.call(this,a,0)}}}function g(a){if(m===clearTimeout)return clearTimeout(a);if((m===e||!m)&&clearTimeout)return m=clearTimeout,clearTimeout(a);try{return m(a)}catch(b){try{return m.call(null,a)}catch(b){return m.call(this,a)}}}function h(){q&&o&&(q=!1,o.length?p=o.concat(p):r=-1,p.length&&i())}function i(){if(!q){var a=f(h);q=!0;for(var b=p.length;b;){for(o=p,p=[];++r<b;)o&&o[r].run();r=-1,b=p.length}o=null,q=!1,g(a)}}function j(a,b){this.fun=a,this.array=b}function k(){}var l,m,n=b.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:d}catch(a){l=d}try{m="function"==typeof clearTimeout?clearTimeout:e}catch(a){m=e}}();var o,p=[],q=!1,r=-1;n.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];p.push(new j(a,b)),1!==p.length||q||f(i)},j.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=k,n.addListener=k,n.once=k,n.off=k,n.removeListener=k,n.removeAllListeners=k,n.emit=k,n.prependListener=k,n.prependOnceListener=k,n.listeners=function(a){return[]},n.binding=function(a){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(a){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],7:[function(a,b,c){(function(b,d){function e(a,b){this._id=a,this._clearFn=b}var f=a("process/browser.js").nextTick,g=Function.prototype.apply,h=Array.prototype.slice,i={},j=0;c.setTimeout=function(){return new e(g.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new e(g.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(a){a.close()},e.prototype.unref=e.prototype.ref=function(){},e.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(a,b){clearTimeout(a._idleTimeoutId),a._idleTimeout=b},c.unenroll=function(a){clearTimeout(a._idleTimeoutId),a._idleTimeout=-1},c._unrefActive=c.active=function(a){clearTimeout(a._idleTimeoutId);var b=a._idleTimeout;b>=0&&(a._idleTimeoutId=setTimeout(function(){a._onTimeout&&a._onTimeout()},b))},c.setImmediate="function"==typeof b?b:function(a){var b=j++,d=arguments.length<2?!1:h.call(arguments,1);return i[b]=!0,f(function(){i[b]&&(d?a.apply(null,d):a.call(null),c.clearImmediate(b))}),b},c.clearImmediate="function"==typeof d?d:function(a){delete i[a]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":6,timers:7}]},{},[5]);