discourse/public/javascripts/diffhtml/1.0.0-beta.29/diffhtml.min.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

1 line
28 KiB
JavaScript
Raw Normal View History

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"!=typeof globalThis?globalThis:e||self,t(e.diff={}))}(this,function(e){"use strict";function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){return d(e)||f(e,t)||h(e,t)||m()}function c(e){return l(e)||u(e)||h(e)||v()}function l(e){if(Array.isArray(e))return p(e)}function d(e){if(Array.isArray(e))return e}function u(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function f(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw a}}return o}}function h(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){var r=String(e);switch(t){case"boolean":return"false"!==r;case"string":return r;case"number":return fe(r,10);case"object":return he(r)}}function b(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:typeof t,n=arguments.length>3?arguments[3]:void 0,a=ue.location,o=ue.URLSearchParams,i=void 0!==o,s=void 0!==a,c=i&&s,l=de.env;if(n&&e in n)return n[e];var d="DIFF_".concat(e.replace(/[^a-zA-Z0-9]/,""));if(c){var u=new o(a.search),f=d.toLowerCase();if(u.has(f))return g(decodeURIComponent(String(u.get(f))),r)}var h=d.toUpperCase();return l&&h in de.env?g(de.env[h.toUpperCase()],r):t}function N(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0;r<e.length;r++){var n=e[r];n&&n.rawNodeName===Oe?N(n.childNodes,t):n&&t.push(n)}return t}function y(e,t,n){var a=null;if(Se.protected.has(e)||Se.allocated.has(e))a=e;else if(!e||we(e)){var o=e?e.length:0;n=[];for(var i=0;i<o;i++){var s=e&&!e[i];s||e&&n.push(e[i])}a=y(Oe,null,n)}if(a)return a;var l="object"==typeof e,d=e;if(e&&l&&"ownerDocument"in d){if(d.nodeType===K.TEXT){var u=y(ke,d.nodeValue);return ne.set(u,d),u}t={},n=[];var f=d.attributes;if(d.nodeType===K.ELEMENT&&f&&f.length)for(var h=0;h<f.length;h++){var p=f[h],v=p.name,m=p.value;m===Q.STR&&v in d?t[v]=e[v]:t[v]=m}if(d.nodeType===K.ELEMENT||d.nodeType===K.FRAGMENT){n=[];for(var g=0;g<d.childNodes.length;g++){var b=d.childNodes[g];n.push(y(b))}}return ne.forEach(function(t,r){t===e&&(a=r)}