mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 11:53:40 +08:00
1 line
27 KiB
JavaScript
1 line
27 KiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=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),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){return c(e)||d(e)||l(e)||f()}function c(e){if(Array.isArray(e))return u(e)}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function l(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}function u(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 f(){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 h(e,t){var r=String(e);switch(t){case"boolean":return"false"!==r;case"string":return r;case"number":return ie(r,10);case"array":return r.split(",");case"object":return se(r)}}function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:typeof t,n=arguments.length>3?arguments[3]:void 0;if(n&&e in n)return n[e];var a="DIFF_".concat(e.replace(/[^a-zA-Z0-9]/,"")).toLowerCase();if(fe){var o=new de(ce.search);if(o.has(a))return h(decodeURIComponent(String(o.get(a))),r)}return he&&a in ae.env?h(ae.env[a],r):t}function v(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++)e&&n.push(e[i]);a=v(ke,null,n)}if(a)return a;var c="object"==typeof e,d=e;if(e&&c&&"ownerDocument"in d){if(d.nodeType===G.TEXT){var l=v(Re,d.nodeValue);return K.set(l,d),l}t={},n=[];var u=d.attributes;if(d.nodeType===G.ELEMENT&&u&&u.length)for(var f=0;f<u.length;f++){var h=u[f],p=h.name,m=h.value;m===X.STR&&p in d?t[p]=e[p]:t[p]=m}if(d.nodeType===G.ELEMENT||d.nodeType===G.FRAGMENT){n=[];for(var g=0;g<d.childNodes.length;g++){var N=d.childNodes[g];n.push(v(N))}}return K.forEach(function(t,r){t===e&&(a=r)}),a=a||v(d.nodeName,t,n),a.attributes=r(r({},a.attributes),t),a.childNodes=n,K.set(a,d),a}if(c){var b=e.rawNodeName,y=e.nodeName,T=e.nodeValue,E=e.attributes,w=e.childNodes,S=e.children,k=b||y,R=v(k,E||null,S||w);return T&&(R.nodeValue=T),R}for(var O=arguments.length,M=new Array(O>3?O-3:0),x=3;x<O;x++)M[x-3]=arguments[x];M.length&&(n=[n].concat(M)),a=Ee.get();var A=e===Re;"string"==typeof e?(a.rawNodeName=e,a.nodeName=a.rawNodeName.toLowerCase()):(a.rawNodeName=e,a.nodeName=ke),a.nodeValue=X.STR,a.key=X.STR,a.childNodes.length=0,a.attributes={};var C=we(t)||"object"!=typeof t,_=C?t:n,L=we(_)?_:[_];if(A){var I=L.join(X.STR);return a.nodeType=G.TEXT,a.nodeValue=String(I),a}if(a.nodeName===ke?a.nodeType=G.FRAGMENT:a.nodeType="#comment"===e?G.COMMENT:G.ELEMENT,_&&L.length&&(!t||!t.childNodes))for(var D=0;D<L.length;D++){var j=L[D];if(we(j)){var V;(V=a.childNodes).push.apply(V,s(j))}else{if(!j)continue;if(j.nodeType===G.FRAGMENT&&"string"=
|