mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-13 02:53:51 +01:00
7 lines
292 KiB
JavaScript
7 lines
292 KiB
JavaScript
|
/**
|
||
|
* easymde v2.4.2
|
||
|
* Copyright Jeroen Akkerman
|
||
|
* @link https://github.com/ionaru/easy-markdown-editor
|
||
|
* @license MIT
|
||
|
*/
|
||
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EasyMDE=e()}}(function(){return function o(a,l,s){function u(t,e){if(!l[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=l[t]={exports:{}};a[t][0].call(i.exports,function(e){return u(a[t][1][e]||e)},i,i.exports,o,a,l,s)}return l[t].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)u(s[e]);return u}({1:[function(e,t,n){"use strict";n.byteLength=function(e){var t=d(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){for(var t,n=d(e),r=n[0],i=n[1],o=new f((u=r,c=i,3*(u+c)/4-c)),a=0,l=0<i?r-4:r,s=0;s<l;s+=4)t=h[e.charCodeAt(s)]<<18|h[e.charCodeAt(s+1)]<<12|h[e.charCodeAt(s+2)]<<6|h[e.charCodeAt(s+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=255&t;var u,c;2===i&&(t=h[e.charCodeAt(s)]<<2|h[e.charCodeAt(s+1)]>>4,o[a++]=255&t);1===i&&(t=h[e.charCodeAt(s)]<<10|h[e.charCodeAt(s+1)]<<4|h[e.charCodeAt(s+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t);return o},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,a=n-r;o<a;o+=16383)i.push(s(e,o,a<o+16383?a:o+16383));1===r?(t=e[n-1],i.push(l[t>>2]+l[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(l[t>>10]+l[t>>4&63]+l[t<<2&63]+"="));return i.join("")};for(var l=[],h=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i<o;++i)l[i]=r[i],h[r.charCodeAt(i)]=i;function d(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function s(e,t,n){for(var r,i,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(l[(i=r)>>18&63]+l[i>>12&63]+l[i>>6&63]+l[63&i]);return o.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){"use strict";var r=e("base64-js"),o=e("ieee754");n.Buffer=h,n.SlowBuffer=function(e){+e!=e&&(e=0);return h.alloc(+e)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(i<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=h.prototype,t}function h(e,t,n){if("number"!=typeof e)return l(e,t,n);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}function l(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),r=a(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(R(e,ArrayBuffer)||e&&R(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n);return r.__proto__=h.prototype,r}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return h.from(r,t,n);var i=function(e){if(h.isBuffer(e)){var t=0|f(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||H(e.length)?a(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must b
|