virtual-react-json-diff 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{createElement as r,PureComponent as o,useRef as i,useMemo as s,useCallback as l,useEffect as a,useState as c}from"react";const u=e=>{if(null==e||"bigint"==typeof e||Number.isNaN(e)||e===1/0||e===-1/0)return;if(["string","number","boolean"].includes(typeof e))return e;if(Array.isArray(e))return e.map(u).filter((e=>void 0!==e));const t={};for(const[n,r]of Object.entries(e)){const e=u(r);void 0!==e&&(t[n]=e)}return t},f=(e,t,n=!1)=>{if(!Array.isArray(e)||!Array.isArray(t))throw new Error("Both arguments should be arrays.");const r=e.length,o=t.length,i=new Array(r+o);if(n){for(let e=0;e<o;e++)i[e]=t[o-e-1];for(let t=0;t<r;t++)i[t+o]=e[t];return i}for(let t=0;t<r;t++)i[t]=e[t];for(let e=0;e<o;e++)i[e+r]=t[e];return i},h=(e,t=new Map)=>{if("object"!=typeof e||null===e)return!1;if(t.has(e))return!0;if(t.set(e,!0),Array.isArray(e)){for(let n=0;n<e.length;n++)if(h(e[n],t))return!0;return!1}for(const n in e)if(h(e[n],t))return!0;return!1},d=(e,t,n,r=1/0,o)=>{if(!e||"object"!=typeof e){let r;if(Number.isNaN(e)||e===1/0||e===-1/0||"bigint"==typeof e||(r=JSON.stringify(e,t,n)),void 0===r)switch(o){case zr.throw:throw new Error(`Value is not valid in JSON, got ${String(e)}`);case zr.stringify:return p(e);default:throw new Error("Should not reach here, please report this bug.")}return r}const i=r<1?'"..."':Array.isArray(e)?`[${e.map((e=>d(e,t,n,r-1,o))).join(",")}]`:`{${Object.keys(e).map((i=>`"${i}": ${d(e[i],t,n,r-1,o)}`)).join(", ")}}`;return JSON.stringify(JSON.parse(i),t,n)},p=e=>void 0===e?"undefined":e===1/0?"Infinity":e===-1/0?"-Infinity":Number.isNaN(e)?"NaN":"bigint"==typeof e?`${e}n`:String(e),v=(e,t=1/0,n=!1,r=zr.stringify)=>null===e?"null":Array.isArray(e)||"object"==typeof e?d(e,void 0,n?1:void 0,t,r):d(e,void 0,void 0,void 0,r),y=e=>"boolean"==typeof e?0:"number"==typeof e?1:"string"==typeof e?2:null===e?3:Array.isArray(e)?4:"object"==typeof e?5:"symbol"==typeof e?6:"function"==typeof e?7:"bigint"==typeof e?8:-1,g=(e,t,n)=>{const r=n.keyOrdersMap?.get(e),o=n.keyOrdersMap?.get(t);if(void 0!==r&&void 0!==o)return r-o;const i=y(e),s=y(t);if(i!==s)return i-s;if(null===e&&null===t||Array.isArray(e)&&Array.isArray(t)||5===i&&5===s)return 0;switch(typeof e){case"number":return Number.isNaN(e)&&Number.isNaN(t)||e===1/0&&t===1/0||e===-1/0&&t===-1/0?0:e-t;case"string":return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e<t?-1:e>t?1:0;case"boolean":return+e-+t;case"symbol":case"function":return String(e).localeCompare(String(t))}if("bigint"==typeof e&&"bigint"==typeof t){const n=BigInt(e)-BigInt(t);return n<0?-1:n>0?1:0}return String(e).localeCompare(String(t))},m=e=>Array.isArray(e)?"array":null===e?"null":typeof e,b=(e,t,n,r,o,i,s,l)=>{const a={ignoreCase:l.ignoreCase},c=v(o,l.maxDepth,!0,l.undefinedBehavior).split("\n"),u=v(i,l.maxDepth,!0,l.undefinedBehavior).split("\n");if(0!==g(o,i,a))if(l.showModifications){const o=Math.max(c.length,u.length);for(let e=c.length;e<o;e++)c.push("");for(let e=u.length;e<o;e++)u.push("");e.push({level:s,type:"modify",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:s+(c[t].match(/^\s+/)?.[0]?.length||0),type:"modify",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});for(let t=c.length;t<o;t++)e.push({level:s,type:"equal",text:""});t.push({level:s,type:"modify",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:s+(u[e].match(/^\s+/)?.[0]?.length||0),type:"modify",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")});for(let e=u.length;e<o;e++)t.push({level:s,type:"equal",text:""})}else{e.push({level:s,type:"remove",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:s+(c[t].match(/^\s+/)?.[0]?.length||0),type:"remove",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});for(let t=0;t<u.length;t++)e.push({level:s,type:"equal",text:""});for(let e=0;e<c.length;e++)t.push({level:s,type:"equal",text:""});t.push({level:s,type:"add",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:s+(u[e].match(/^\s+/)?.[0]?.length||0),type:"add",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")})}else{const o=Math.max(c.length,u.length);for(let e=c.length;e<o;e++)c.push("");for(let e=u.length;e<o;e++)u.push("");e.push({level:s,type:"equal",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:s+(c[t].match(/^\s+/)?.[0]?.length||0),type:"equal",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});t.push({level:s,type:"equal",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:s+(u[e].match(/^\s+/)?.[0]?.length||0),type:"equal",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")})}},x=(e,t)=>e.sort(((e,n)=>g(e,n,{ignoreCase:t.ignoreCaseForKey}))),w=(e,t,n=1,r,o)=>{if(n>(r.maxDepth||1/0))return[[{level:n,type:"equal",text:"..."}],[{level:n,type:"equal",text:"..."}]];let i=[],s=[];if(null===e&&null===t||void 0===e&&void 0===t)return[i,s];if(null==e){const e=d(t,void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++)i.push({level:n,type:"equal",text:""}),s.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});return[i,s]}if(null==t){const t=d(e,void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++)i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),s.push({level:n,type:"equal",text:""});return[i,s]}const l=Object.keys(e),a=Object.keys(t),c=new Map;if(r.preserveKeyOrder){if("before"===r.preserveKeyOrder){for(let e=0;e<l.length;e++)c.set(l[e],e);for(let e=0;e<a.length;e++)c.has(a[e])||c.set(a[e],l.length+e);a.sort(((e,t)=>c.get(e)-c.get(t)))}else if("after"===r.preserveKeyOrder){for(let e=0;e<a.length;e++)c.set(a[e],e);for(let e=0;e<l.length;e++)c.has(l[e])||c.set(l[e],a.length+e);l.sort(((e,t)=>c.get(e)-c.get(t)))}}else x(l,r),x(a,r);const u={ignoreCase:r.ignoreCaseForKey,keyOrdersMap:c};for(;l.length||a.length;){const c=l[0],h=a[0],p=g(c,h,u);if(0===p)if(m(e[c])!==m(t[h]))b(i,s,c,h,e[c],t[h],n,r);else if(Array.isArray(e[c])){const l=[...e[c]],a=[...t[h]],[u,d]=o(l,a,c,h,n,r,[],[]);i=f(i,u),s=f(s,d)}else if(null===e[c])i.push({level:n,type:"equal",text:`"${c}": null`}),s.push({level:n,type:"equal",text:`"${h}": null`});else if("object"==typeof e[c]){const l=w(e[c],t[h],n+1,r,o);i.push({level:n,type:"equal",text:`"${c}": {`}),i=f(i,l[0]),i.push({level:n,type:"equal",text:"}"}),s.push({level:n,type:"equal",text:`"${h}": {`}),s=f(s,l[1]),s.push({level:n,type:"equal",text:"}"})}else b(i,s,c,h,e[c],t[h],n,r);else if(l.length&&a.length)if(p<0){const t=d(e[c],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++){const r=t[e].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:e?r:`"${c}": ${r}`}),s.push({level:n,type:"equal",text:""})}}else{const e=d(t[h],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++){const r=e[t].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n,type:"equal",text:""}),s.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:t?r:`"${h}": ${r}`})}}else if(l.length){const t=d(e[c],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++){const r=t[e].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:e?r:`"${c}": ${r}`}),s.push({level:n,type:"equal",text:""})}}else if(a.length){const e=d(t[h],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++){const r=e[t].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n,type:"equal",text:""}),s.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:t?r:`"${h}": ${r}`})}}c?h?0===p?(l.shift(),a.shift()):p<0?l.shift():a.shift():l.shift():a.shift()}if(i.length!==s.length)throw new Error("Diff error: length not match for left & right, please report a bug with your data.");return[i,s]};var j=function(){this.__data__=[],this.size=0};var _=function(e,t){return e===t||e!=e&&t!=t},S=_;var E=function(e,t){for(var n=e.length;n--;)if(S(e[n][0],t))return n;return-1},k=E,A=Array.prototype.splice;var M=E;var O=E;var q=E;var N=j,C=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():A.call(t,n,1),--this.size,!0)},I=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},$=function(e){return O(this.__data__,e)>-1},B=function(e,t){var n=this.__data__,r=q(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function D(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}D.prototype.clear=N,D.prototype.delete=C,D.prototype.get=I,D.prototype.has=$,D.prototype.set=B;var z=D,L=z;var T=function(){this.__data__=new L,this.size=0};var R=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var P=function(e){return this.__data__.get(e)};var F=function(e){return this.__data__.has(e)},W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},U="object"==typeof W&&W&&W.Object===Object&&W,K=U,V="object"==typeof self&&self&&self.Object===Object&&self,H=K||V||Function("return this")(),J=H.Symbol,Z=J,Y=Object.prototype,G=Y.hasOwnProperty,Q=Y.toString,X=Z?Z.toStringTag:void 0;var ee=function(e){var t=G.call(e,X),n=e[X];try{e[X]=void 0;var r=!0}catch(e){}var o=Q.call(e);return r&&(t?e[X]=n:delete e[X]),o},te=Object.prototype.toString;var ne=ee,re=function(e){return te.call(e)},oe=J?J.toStringTag:void 0;var ie=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":oe&&oe in Object(e)?ne(e):re(e)};var se=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},le=ie,ae=se;var ce,ue=function(e){if(!ae(e))return!1;var t=le(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},fe=H["__core-js_shared__"],he=(ce=/[^.]+$/.exec(fe&&fe.keys&&fe.keys.IE_PROTO||""))?"Symbol(src)_1."+ce:"";var de=function(e){return!!he&&he in e},pe=Function.prototype.toString;var ve=function(e){if(null!=e){try{return pe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ye=ue,ge=de,me=se,be=ve,xe=/^\[object .+?Constructor\]$/,we=Function.prototype,je=Object.prototype,_e=we.toString,Se=je.hasOwnProperty,Ee=RegExp("^"+_e.call(Se).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ke=function(e){return!(!me(e)||ge(e))&&(ye(e)?Ee:xe).test(be(e))},Ae=function(e,t){return null==e?void 0:e[t]};var Me=function(e,t){var n=Ae(e,t);return ke(n)?n:void 0},Oe=Me(H,"Map"),qe=Me(Object,"create"),Ne=qe;var Ce=function(){this.__data__=Ne?Ne(null):{},this.size=0};var Ie=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$e=qe,Be=Object.prototype.hasOwnProperty;var De=function(e){var t=this.__data__;if($e){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Be.call(t,e)?t[e]:void 0},ze=qe,Le=Object.prototype.hasOwnProperty;var Te=qe;var Re=Ce,Pe=Ie,Fe=De,We=function(e){var t=this.__data__;return ze?void 0!==t[e]:Le.call(t,e)},Ue=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Te&&void 0===t?"__lodash_hash_undefined__":t,this};function Ke(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ke.prototype.clear=Re,Ke.prototype.delete=Pe,Ke.prototype.get=Fe,Ke.prototype.has=We,Ke.prototype.set=Ue;var Ve=Ke,He=z,Je=Oe;var Ze=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ye=function(e,t){var n=e.__data__;return Ze(t)?n["string"==typeof t?"string":"hash"]:n.map},Ge=Ye;var Qe=Ye;var Xe=Ye;var et=Ye;var tt=function(e,t){var n=et(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},nt=function(){this.size=0,this.__data__={hash:new Ve,map:new(Je||He),string:new Ve}},rt=function(e){var t=Ge(this,e).delete(e);return this.size-=t?1:0,t},ot=function(e){return Qe(this,e).get(e)},it=function(e){return Xe(this,e).has(e)},st=tt;function lt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}lt.prototype.clear=nt,lt.prototype.delete=rt,lt.prototype.get=ot,lt.prototype.has=it,lt.prototype.set=st;var at=lt,ct=z,ut=Oe,ft=at;var ht=z,dt=T,pt=R,vt=P,yt=F,gt=function(e,t){var n=this.__data__;if(n instanceof ct){var r=n.__data__;if(!ut||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ft(r)}return n.set(e,t),this.size=n.size,this};function mt(e){var t=this.__data__=new ht(e);this.size=t.size}mt.prototype.clear=dt,mt.prototype.delete=pt,mt.prototype.get=vt,mt.prototype.has=yt,mt.prototype.set=gt;var bt=mt;var xt=at,wt=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},jt=function(e){return this.__data__.has(e)};function _t(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xt;++t<n;)this.add(e[t])}_t.prototype.add=_t.prototype.push=wt,_t.prototype.has=jt;var St=_t,Et=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},kt=function(e,t){return e.has(t)};var At=function(e,t,n,r,o,i){var s=1&n,l=e.length,a=t.length;if(l!=a&&!(s&&a>l))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var f=-1,h=!0,d=2&n?new St:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var p=e[f],v=t[f];if(r)var y=s?r(v,p,f,t,e,i):r(p,v,f,e,t,i);if(void 0!==y){if(y)continue;h=!1;break}if(d){if(!Et(t,(function(e,t){if(!kt(d,t)&&(p===e||o(p,e,n,r,i)))return d.push(t)}))){h=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h};var Mt=H.Uint8Array,Ot=_,qt=At,Nt=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Ct=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},It=J?J.prototype:void 0,$t=It?It.valueOf:void 0;var Bt=function(e,t,n,r,o,i,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Mt(e),new Mt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ot(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=Nt;case"[object Set]":var a=1&r;if(l||(l=Ct),e.size!=t.size&&!a)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=qt(l(e),l(t),r,o,i,s);return s.delete(e),u;case"[object Symbol]":if($t)return $t.call(e)==$t.call(t)}return!1};var Dt=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},zt=Array.isArray,Lt=Dt,Tt=zt;var Rt=function(e,t,n){var r=t(e);return Tt(e)?r:Lt(r,n(e))};var Pt=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i},Ft=function(){return[]},Wt=Object.prototype.propertyIsEnumerable,Ut=Object.getOwnPropertySymbols,Kt=Ut?function(e){return null==e?[]:(e=Object(e),Pt(Ut(e),(function(t){return Wt.call(e,t)})))}:Ft;var Vt=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var Ht=function(e){return null!=e&&"object"==typeof e},Jt=ie,Zt=Ht;var Yt=function(e){return Zt(e)&&"[object Arguments]"==Jt(e)},Gt=Ht,Qt=Object.prototype,Xt=Qt.hasOwnProperty,en=Qt.propertyIsEnumerable,tn=Yt(function(){return arguments}())?Yt:function(e){return Gt(e)&&Xt.call(e,"callee")&&!en.call(e,"callee")},nn={exports:{}};var rn=function(){return!1};!function(e,t){var n=H,r=rn,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||r;e.exports=l}(nn,nn.exports);var on=/^(?:0|[1-9]\d*)$/;var sn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&on.test(e))&&e>-1&&e%1==0&&e<t};var ln=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},an=ie,cn=ln,un=Ht,fn={};fn["[object Float32Array]"]=fn["[object Float64Array]"]=fn["[object Int8Array]"]=fn["[object Int16Array]"]=fn["[object Int32Array]"]=fn["[object Uint8Array]"]=fn["[object Uint8ClampedArray]"]=fn["[object Uint16Array]"]=fn["[object Uint32Array]"]=!0,fn["[object Arguments]"]=fn["[object Array]"]=fn["[object ArrayBuffer]"]=fn["[object Boolean]"]=fn["[object DataView]"]=fn["[object Date]"]=fn["[object Error]"]=fn["[object Function]"]=fn["[object Map]"]=fn["[object Number]"]=fn["[object Object]"]=fn["[object RegExp]"]=fn["[object Set]"]=fn["[object String]"]=fn["[object WeakMap]"]=!1;var hn=function(e){return un(e)&&cn(e.length)&&!!fn[an(e)]};var dn=function(e){return function(t){return e(t)}},pn={exports:{}};!function(e,t){var n=U,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s}(pn,pn.exports);var vn=hn,yn=dn,gn=pn.exports,mn=gn&&gn.isTypedArray,bn=mn?yn(mn):vn,xn=Vt,wn=tn,jn=zt,_n=nn.exports,Sn=sn,En=bn,kn=Object.prototype.hasOwnProperty;var An=function(e,t){var n=jn(e),r=!n&&wn(e),o=!n&&!r&&_n(e),i=!n&&!r&&!o&&En(e),s=n||r||o||i,l=s?xn(e.length,String):[],a=l.length;for(var c in e)!t&&!kn.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Sn(c,a))||l.push(c);return l},Mn=Object.prototype;var On=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Mn)};var qn=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Nn=On,Cn=qn,In=Object.prototype.hasOwnProperty;var $n=ue,Bn=ln;var Dn=An,zn=function(e){if(!Nn(e))return Cn(e);var t=[];for(var n in Object(e))In.call(e,n)&&"constructor"!=n&&t.push(n);return t},Ln=function(e){return null!=e&&Bn(e.length)&&!$n(e)};var Tn=Rt,Rn=Kt,Pn=function(e){return Ln(e)?Dn(e):zn(e)};var Fn=function(e){return Tn(e,Pn,Rn)},Wn=Object.prototype.hasOwnProperty;var Un=function(e,t,n,r,o,i){var s=1&n,l=Fn(e),a=l.length;if(a!=Fn(t).length&&!s)return!1;for(var c=a;c--;){var u=l[c];if(!(s?u in t:Wn.call(t,u)))return!1}var f=i.get(e),h=i.get(t);if(f&&h)return f==t&&h==e;var d=!0;i.set(e,t),i.set(t,e);for(var p=s;++c<a;){var v=e[u=l[c]],y=t[u];if(r)var g=s?r(y,v,u,t,e,i):r(v,y,u,e,t,i);if(!(void 0===g?v===y||o(v,y,n,r,i):g)){d=!1;break}p||(p="constructor"==u)}if(d&&!p){var m=e.constructor,b=t.constructor;m==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return i.delete(e),i.delete(t),d},Kn=Me(H,"DataView"),Vn=Oe,Hn=Me(H,"Promise"),Jn=Me(H,"Set"),Zn=Me(H,"WeakMap"),Yn=ie,Gn=ve,Qn="[object Map]",Xn="[object Promise]",er="[object Set]",tr="[object WeakMap]",nr="[object DataView]",rr=Gn(Kn),or=Gn(Vn),ir=Gn(Hn),sr=Gn(Jn),lr=Gn(Zn),ar=Yn;(Kn&&ar(new Kn(new ArrayBuffer(1)))!=nr||Vn&&ar(new Vn)!=Qn||Hn&&ar(Hn.resolve())!=Xn||Jn&&ar(new Jn)!=er||Zn&&ar(new Zn)!=tr)&&(ar=function(e){var t=Yn(e),n="[object Object]"==t?e.constructor:void 0,r=n?Gn(n):"";if(r)switch(r){case rr:return nr;case or:return Qn;case ir:return Xn;case sr:return er;case lr:return tr}return t});var cr=bt,ur=At,fr=Bt,hr=Un,dr=ar,pr=zt,vr=nn.exports,yr=bn,gr="[object Arguments]",mr="[object Array]",br="[object Object]",xr=Object.prototype.hasOwnProperty;var wr=function(e,t,n,r,o,i){var s=pr(e),l=pr(t),a=s?mr:dr(e),c=l?mr:dr(t),u=(a=a==gr?br:a)==br,f=(c=c==gr?br:c)==br,h=a==c;if(h&&vr(e)){if(!vr(t))return!1;s=!0,u=!1}if(h&&!u)return i||(i=new cr),s||yr(e)?ur(e,t,n,r,o,i):fr(e,t,a,n,r,o,i);if(!(1&n)){var d=u&&xr.call(e,"__wrapped__"),p=f&&xr.call(t,"__wrapped__");if(d||p){var v=d?e.value():e,y=p?t.value():t;return i||(i=new cr),o(v,y,n,r,i)}}return!!h&&(i||(i=new cr),hr(e,t,n,r,o,i))},jr=Ht;var _r=function e(t,n,r,o,i){return t===n||(null==t||null==n||!jr(t)&&!jr(n)?t!=t&&n!=n:wr(t,n,r,o,e,i))},Sr=_r;var Er=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?Sr(e,t,void 0,n):!!r};const kr=(e,t,n)=>n.ignoreCase?"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase():"symbol"==typeof e&&"symbol"==typeof t?e.toString()===t.toString():n.recursiveEqual?Er(e,t,((e,t)=>n.ignoreCase&&"string"==typeof e&&"string"==typeof t?e.toLowerCase()===t.toLowerCase():void 0)):e===t,Ar=(e,t)=>{if(e===t)return 1;if(null===e||null===t)return 0;if("object"!=typeof e||"object"!=typeof t)return 0;let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&Object.prototype.hasOwnProperty.call(t,r)&&e[r]===t[r]&&n++;return Math.max(n/Object.keys(e).length,n/Object.keys(t).length)},Mr=(e,t,n,r,o)=>{n&&r?(e.push({level:o,type:"equal",text:`"${n}": [`}),t.push({level:o,type:"equal",text:`"${r}": [`})):(e.push({level:o,type:"equal",text:"["}),t.push({level:o,type:"equal",text:"["}))},Or=(e,t,n)=>{e.push({level:n,type:"equal",text:"]"}),t.push({level:n,type:"equal",text:"]"})},qr=(e,t,n)=>{e.push({level:n+1,type:"equal",text:"..."}),t.push({level:n+1,type:"equal",text:"..."})},Nr=(e,t,n,r,o,i,s=[],l=[])=>{if(Mr(s,l,n,r,o),o>=(i.maxDepth||1/0))qr(s,l,o);else{const[a,c]=((e,t,n,r,o,i)=>{const s=Array(e.length+1).fill(0).map((()=>Array(t.length+1).fill(0))),l=Array(e.length+1).fill(0).map((()=>Array(t.length+1).fill(0)));for(let t=1;t<=e.length;t++)l[t][0]="up";for(let e=1;e<=t.length;e++)l[0][e]="left";for(let n=1;n<=e.length;n++)for(let r=1;r<=t.length;r++){const o=m(e[n-1]);o!==m(t[r-1])||"array"!==o&&"object"!==o?kr(e[n-1],t[r-1],i)?(s[n][r]=s[n-1][r-1]+1,l[n][r]="diag"):s[n-1][r]>=s[n][r-1]?(s[n][r]=s[n-1][r],l[n][r]="up"):(s[n][r]=s[n][r-1],l[n][r]="left"):i.recursiveEqual?kr(e[n-1],t[r-1],i)||Ar(e[n-1],t[r-1])>.5?(s[n][r]=s[n-1][r-1]+1,l[n][r]="diag"):s[n-1][r]>=s[n][r-1]?(s[n][r]=s[n-1][r],l[n][r]="up"):(s[n][r]=s[n][r-1],l[n][r]="left"):(s[n][r]=s[n-1][r-1]+1,l[n][r]="diag")}let a=e.length,c=t.length,u=[],h=[];for(;a>0||c>0;)if("diag"===l[a][c]){const s=m(e[a-1]);if(i.recursiveEqual&&("array"===s||"object"===s)&&kr(e[a-1],t[c-1],i)){const n=[],r=[];b(n,r,"","",e[a-1],t[c-1],o+1,i),u=f(u,n.reverse(),!0),h=f(h,r.reverse(),!0)}else if("array"===s){const[s,l]=Nr(e[a-1],t[c-1],n,r,o+1,i);u=f(u,s.reverse(),!0),h=f(h,l.reverse(),!0)}else if("object"===s){const[n,r]=w(e[a-1],t[c-1],o+2,i,Nr);u.unshift({level:o+1,type:"equal",text:"}"}),h.unshift({level:o+1,type:"equal",text:"}"}),u=f(u,n.reverse(),!0),h=f(h,r.reverse(),!0),u.unshift({level:o+1,type:"equal",text:"{"}),h.unshift({level:o+1,type:"equal",text:"{"})}else{const n=[],r=[];b(n,r,"","",e[a-1],t[c-1],o+1,i),u=f(u,n.reverse(),!0),h=f(h,r.reverse(),!0)}a--,c--}else if("up"===l[a][c])if(i.showModifications&&a>1&&"left"===l[a-1][c]){const s=m(e[a-1]);if(s===m(t[c-1]))if("array"===s){const[s,l]=Nr(e[a-1],t[c-1],n,r,o+1,i);u=f(u,s.reverse(),!0),h=f(h,l.reverse(),!0)}else if("object"===s){const[n,r]=w(e[a-1],t[c-1],o+2,i,Nr);u.unshift({level:o+1,type:"equal",text:"}"}),h.unshift({level:o+1,type:"equal",text:"}"}),u=f(u,n.reverse(),!0),h=f(h,r.reverse(),!0),u.unshift({level:o+1,type:"equal",text:"{"}),h.unshift({level:o+1,type:"equal",text:"{"})}else u.unshift({level:o+1,type:"modify",text:v(e[a-1],void 0,void 0,i.undefinedBehavior)}),h.unshift({level:o+1,type:"modify",text:v(t[c-1],void 0,void 0,i.undefinedBehavior)});else{const n=[],r=[];b(n,r,"","",e[a-1],t[c-1],o+1,i),u=f(u,n.reverse(),!0),h=f(h,r.reverse(),!0)}a--,c--}else{const t=d(e[a-1],void 0,1,void 0,i.undefinedBehavior).split("\n");for(let e=t.length-1;e>=0;e--)u.unshift({level:o+1+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),h.unshift({level:o+1,type:"equal",text:""});a--}else{const e=d(t[c-1],void 0,1,void 0,i.undefinedBehavior).split("\n");for(let t=e.length-1;t>=0;t--)u.unshift({level:o+1,type:"equal",text:""}),h.unshift({level:o+1+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});c--}return[u,h]})(e,t,n,r,o,i);s=f(s,a),l=f(l,c)}return Or(s,l,o),[s,l]};function Cr(e,t){for(const n of e){if("object"===m(n)){if(!(t in n))return!1;for(const e of Object.values(n))if(Array.isArray(e)&&!Cr(e,t))return!1}else if(Array.isArray(n)&&!Cr(n,t))return!1}return!0}const Ir=function e(t,n,r,o,i,s,l=[],a=[]){if(!s.compareKey)return Br(t,n,r,o,i,s,l,a);const c=e=>e.every((e=>"object"===m(e)));if(!(c(t)&&c(n)&&Cr(t,s.compareKey)&&Cr(n,s.compareKey)))return Br(t,n,r,o,i,s,l,a);if(Mr(l,a,r,o,i),i>=(s.maxDepth||1/0))qr(l,a,i);else{const r=new Set,o=new Set;for(let c=0;c<t.length;c++){const u=t[c];if(r.has(c))continue;if("object"!==m(u)||!(s.compareKey in u))continue;const h=u[s.compareKey];let d=-1;for(let e=0;e<n.length;e++){if(o.has(e))continue;const t=n[e];if("object"!==m(t)||!(s.compareKey in t))continue;const r=t[s.compareKey];if(kr(h,r,s)){d=e;break}}if(-1!==d){const t=n[d],h=m(u);if(h!==m(t))b(l,a,"","",u,t,i+1,s);else if("object"===h){l.push({level:i+1,type:"equal",text:"{"}),a.push({level:i+1,type:"equal",text:"{"});const n=Array.from(new Set([...Object.keys(u),...Object.keys(t)]));for(const r of n){const n=u[r],o=t[r];if(Array.isArray(n)&&Array.isArray(o)){const[t,r]=e(n,o,"","",i+2,s,[],[]);l=f(l,t),a=f(a,r)}else if(Array.isArray(n)||Array.isArray(o))b(l,a,r,r,n,o,i+2,s);else{const[t,c]=w({[r]:n},{[r]:o},i+2,s,e);l=f(l,t),a=f(a,c)}}l.push({level:i+1,type:"equal",text:"}"}),a.push({level:i+1,type:"equal",text:"}"})}else if("array"===h){const[n,r]=e(u,t,"","",i+1,s,[],[]);l=f(l,n),a=f(a,r)}else kr(u,t,s)?(l.push({level:i+1,type:"equal",text:v(u,void 0,void 0,s.undefinedBehavior)}),a.push({level:i+1,type:"equal",text:v(t,void 0,void 0,s.undefinedBehavior)})):s.showModifications?(l.push({level:i+1,type:"modify",text:v(u,void 0,void 0,s.undefinedBehavior)}),a.push({level:i+1,type:"modify",text:v(t,void 0,void 0,s.undefinedBehavior)})):(l.push({level:i+1,type:"remove",text:v(u,void 0,void 0,s.undefinedBehavior)}),l.push({level:i+1,type:"equal",text:""}),a.push({level:i+1,type:"equal",text:""}),a.push({level:i+1,type:"add",text:v(t,void 0,void 0,s.undefinedBehavior)}));r.add(c),o.add(d)}}for(let e=0;e<t.length;e++){if(r.has(e))continue;const n=t[e],o=d(n,void 0,1,void 0,s.undefinedBehavior).split("\n");for(let e=0;e<o.length;e++)l.push({level:i+1+(o[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:o[e].replace(/^\s+/,"").replace(/,$/g,"")}),a.push({level:i+1,type:"equal",text:""})}for(let e=0;e<n.length;e++){if(o.has(e))continue;const t=n[e],r=d(t,void 0,1,void 0,s.undefinedBehavior).split("\n");for(let e=0;e<r.length;e++)l.push({level:i+1,type:"equal",text:""}),a.push({level:i+1+(r[e].match(/^\s+/)?.[0]?.length||0),type:"add",text:r[e].replace(/^\s+/,"").replace(/,$/g,"")})}}return Or(l,a,i),[l,a]};function $r(e,t,n,r,o,i,s){let l=[],a=[];const c=Array.from(new Set([...Object.keys(e||{}),...Object.keys(t||{})]));for(const u of c){const c=e?e[u]:void 0,h=t?t[u]:void 0;if(Array.isArray(c)&&Array.isArray(h)&&r.compareKey&&s(c,r.compareKey)&&s(h,r.compareKey)){const[e,t]=i(c,h,"","",n+2,r,[],[]);l=f(l,e),a=f(a,t)}else if(Array.isArray(c)&&Array.isArray(h)){const[e,t]=o(c,h,"","",n+2,r,[],[]);l=f(l,e),a=f(a,t)}else if(Array.isArray(c)||Array.isArray(h))b(l,a,u,u,c,h,n+2,r);else{const[e,t]=w({[u]:c},{[u]:h},n+2,r,o);l=f(l,e),a=f(a,t)}}return[l,a]}const Br=(e,t,n,r,o,i,s=[],l=[])=>{if(e=[...e],t=[...t],Mr(s,l,n,r,o),o>=(i.maxDepth||1/0))qr(s,l,o);else for(;e.length||t.length;){const n=e[0],r=t[0],a=m(n),c=m(r);if(e.length&&t.length){if(a!==c)b(s,l,"","",n,r,o+1,i);else if(i.recursiveEqual&&["object","array"].includes(a)&&kr(n,r,i))b(s,l,"","",n,r,o+1,i);else if("object"===a){let e,t;s.push({level:o+1,type:"equal",text:"{"}),l.push({level:o+1,type:"equal",text:"{"}),"compare-key"===i.arrayDiffMethod?[e,t]=$r(n,r,o,i,Br,Ir,Cr):[e,t]=w(n,r,o+2,i,Br),s=f(s,e),l=f(l,t),s.push({level:o+1,type:"equal",text:"}"}),l.push({level:o+1,type:"equal",text:"}"})}else if("array"===a)if(i.compareKey&&Cr(n,i.compareKey)&&Cr(r,i.compareKey)){const[e,t]=Ir(n,r,"","",o+1,i,[],[]);s=f(s,e),l=f(l,t)}else{const[e,t]=Br(n,r,"","",o+1,i,[],[]);s=f(s,e),l=f(l,t)}else 0===g(n,r,{ignoreCase:i.ignoreCase})?(s.push({level:o+1,type:"equal",text:v(n,void 0,void 0,i.undefinedBehavior)}),l.push({level:o+1,type:"equal",text:v(r,void 0,void 0,i.undefinedBehavior)})):i.showModifications?(s.push({level:o+1,type:"modify",text:v(n,void 0,void 0,i.undefinedBehavior)}),l.push({level:o+1,type:"modify",text:v(r,void 0,void 0,i.undefinedBehavior)})):(s.push({level:o+1,type:"remove",text:v(n,void 0,void 0,i.undefinedBehavior)}),s.push({level:o+1,type:"equal",text:""}),l.push({level:o+1,type:"equal",text:""}),l.push({level:o+1,type:"add",text:v(r,void 0,void 0,i.undefinedBehavior)}));e.shift(),t.shift()}else if(e.length){const t=v(n,void 0,!0,i.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++)s.push({level:o+1+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),l.push({level:o+1,type:"equal",text:""});e.shift()}else if(t.length){const e=v(r,void 0,!0,i.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++)s.push({level:o+1,type:"equal",text:""}),l.push({level:o+1+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});t.shift()}}return Or(s,l,o),[s,l]},Dr=(e,t)=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){const n=[...e];return n.sort(((e,n)=>g(e,n,{ignoreCase:t?.ignoreCase}))),n.map((e=>Dr(e,t)))}const n={...e};for(const e in n)n[e]=Dr(n[e],t);return n};var zr=function(e){return e.stringify="stringify",e.ignore="ignore",e.throw="throw",e}({});const Lr={level:0,type:"equal",text:""},Tr={level:0,type:"equal",text:"{"},Rr={level:0,type:"equal",text:"}"};let Pr=class{detectCircular(e){if(this.options.detectCircular&&h(e))throw new Error(`Circular reference detected in object (with keys ${Object.keys(e).map((e=>`"${e}"`)).join(", ")})`)}sortResultLines(e,t){for(let n=0;n<e.length;n++){let n=!1;for(let r=1;r<e.length;r++)if("remove"===e[r].type&&"equal"===e[r-1].type&&"equal"===t[r].type&&"add"===t[r-1].type){const o=e[r-1];e[r-1]=e[r],e[r]=o;const i=t[r-1];t[r-1]=t[r],t[r]=i,n=!0}if(!n)break}}calculateLineNumbers(e){let t=0;for(const n of e)n.text&&(n.lineNumber=++t)}calculateCommas(e){const t=Array(e.length).fill(0);for(let n=e.length-1;n>0;n--)e[n].text?t[n-1]=n:t[n-1]=t[n];for(let n=0;n<e.length;n++)!e[n].text.endsWith("{")&&!e[n].text.endsWith("[")&&e[n].text&&t[n]&&e[n].level<=e[t[n]].level&&(e[n].comma=!0)}diff(e,t){this.detectCircular(e),this.detectCircular(t),"unorder-normal"!==this.options.arrayDiffMethod&&"unorder-lcs"!==this.options.arrayDiffMethod||(e=Dr(e,this.options),t=Dr(t,this.options)),"ignore"===this.options.undefinedBehavior&&(e=u(e)??null,t=u(t)??null);let n=[],r=[];const o=m(e);if(o!==m(t)){n=d(e,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split("\n").map((e=>({level:e.match(/^\s+/)?.[0]?.length||0,type:"remove",text:e.replace(/^\s+/,"").replace(/,$/g,""),comma:e.endsWith(",")})));r=d(t,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split("\n").map((e=>({level:e.match(/^\s+/)?.[0]?.length||0,type:"add",text:e.replace(/^\s+/,"").replace(/,$/g,""),comma:e.endsWith(",")})));const o=n.length,i=r.length;n=f(n,Array(i).fill(0).map((()=>({...Lr})))),r=f(r,Array(o).fill(0).map((()=>({...Lr}))),!0)}else"object"===o?([n,r]=w(e,t,1,this.options,this.arrayDiffFunc),n.unshift({...Tr}),n.push({...Rr}),r.unshift({...Tr}),r.push({...Rr})):"array"===o?[n,r]=this.arrayDiffFunc(e,t,"","",0,this.options):e!==t?this.options.ignoreCase?"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase()&&(n=[{level:0,type:"equal",text:e}],r=[{level:0,type:"equal",text:t}]):this.options.showModifications?(n=[{level:0,type:"modify",text:d(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],r=[{level:0,type:"modify",text:d(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(n=[{level:0,type:"remove",text:d(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)},{...Lr}],r=[{...Lr},{level:0,type:"add",text:d(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(n=[{level:0,type:"equal",text:d(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],r=[{level:0,type:"equal",text:d(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]);return this.sortResultLines(n,r),this.calculateLineNumbers(n),this.calculateLineNumbers(r),this.calculateCommas(n),this.calculateCommas(r),[n,r]}constructor({detectCircular:e=!0,maxDepth:t=1/0,showModifications:n=!0,arrayDiffMethod:r="normal",ignoreCase:o=!1,ignoreCaseForKey:i=!1,recursiveEqual:s=!1,preserveKeyOrder:l,compareKey:a,undefinedBehavior:c="stringify"}={}){this.options={detectCircular:e,maxDepth:t,showModifications:n,arrayDiffMethod:r,ignoreCase:o,ignoreCaseForKey:i,recursiveEqual:s,preserveKeyOrder:l,compareKey:a,undefinedBehavior:c},this.arrayDiffFunc="compare-key"===r?Ir:"lcs"===r||"unorder-lcs"===r?Nr:Br}};const Fr=e=>"hasLinesBefore"in e||"hasLinesAfter"in e,Wr=(e,t,n)=>Fr(e)?n:t*(e.end-e.start+1),Ur=(e,t)=>{const n=[];let r,o;if(e.length&&t.length)for(e=[...e],t=[...t],r={...e.shift()},o={...t.shift()};;){if(r.start===o.start){const e=Math.min(r.end,o.end);n.push({...r,...o,end:e}),r.start=o.start=e}else if(r.start<o.start){const e=Math.min(r.end,o.start);n.push({...o,...r,end:e}),r.start=e}else{const e=Math.min(r.start,o.end);n.push({...r,...o,end:e}),o.start=e}if(!e.length||!t.length)break;r.start===r.end&&(r={...e.shift()}),o.start===o.end&&(o={...t.shift()})}return e.length||n.push(...t.map((e=>({...e,token:r.token||"plain"})))),t.length||n.push(...e),n};var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.applyPatch=Kr.calcPatch=Yr=Kr.lcs=Kr.diff=Kr.diff_core=void 0;let Vr=class{[Symbol.iterator](){return this}next(){const{state:e,result:t}=this;if(this.c>1)return t.done=!0,t.value=void 0,t;const n=function(e,t){const{b:n,eq:r,stack_base:o}=e;let{i:i,N:s,j:l,M:a,Z:c,stack_top:u}=e;for(;;)switch(t){case 0:e:for(;s>0&&a>0;){n.fill(0,0,2*c);const e=s-a,t=s+a,f=1&t,h=i+s-1,d=l+a-1,p=(t+f)/2;let v;t:for(let t=0;t<=p;t++){const p=2*Math.max(0,t-a)-t,y=t-2*Math.max(0,t-s);for(let h=p;h<=y;h+=2){const d=n[h-1-c*Math.floor((h-1)/c)],p=n[h+1-c*Math.floor((h+1)/c)],y=h===-t||h!==t&&d<p?p:d+1,g=y-h;let m=y,b=g;for(;m<s&&b<a&&r(i+m,l+b);)m++,b++;if(n[h-c*Math.floor(h/c)]=m,1===f&&(v=e-h)>=1-t&&v<t&&m+n[c+v-c*Math.floor(v/c)]>=s){if(t>1||m!==y){o[u++]=i+m,o[u++]=s-m,o[u++]=l+b,o[u++]=a-b,s=y,a=g,c=2*(Math.min(s,a)+1);continue e}break t}}for(let g=p;g<=y;g+=2){const p=n[c+g-1-c*Math.floor((g-1)/c)],y=n[c+g+1-c*Math.floor((g+1)/c)],m=g===-t||g!==t&&p<y?y:p+1,b=m-g;let x=m,w=b;for(;x<s&&w<a&&r(h-x,d-w);)x++,w++;if(n[c+g-c*Math.floor(g/c)]=x,0===f&&(v=e-g)>=-t&&v<=t&&x+n[v-c*Math.floor(v/c)]>=s){if(t>0||x!==m){o[u++]=i+s-m,o[u++]=m,o[u++]=l+a-b,o[u++]=b,s-=x,a-=w,c=2*(Math.min(s,a)+1);continue e}break t}}}if(s!==a){a>s?(i+=s,l+=s,a-=s,s=0):(i+=a,l+=a,s-=a,a=0);break}}if(s+a!==0)if(e.pxe===i||e.pye===l)e.pxe=i+s,e.pye=l+a;else{const t=e.pxs;if(e.oxs=e.pxs,e.oxe=e.pxe,e.oys=e.pys,e.oye=e.pye,e.pxs=i,e.pxe=i+s,e.pys=l,e.pye=l+a,t>=0)return e.i=i,e.N=s,e.j=l,e.M=a,e.Z=c,e.stack_top=u,1}case 1:if(0===u)return 2;a=o[--u],l=o[--u],s=o[--u],i=o[--u],c=2*(Math.min(s,a)+1),t=0}}(e,this.c);return this.c=n,1===n?(t.value=[e.oxs,e.oxe,e.oys,e.oye],t):e.pxs>=0?(t.value=[e.pxs,e.pxe,e.pys,e.pye],t):(t.done=!0,t.value=void 0,t)}constructor(e){this.state=e,this.c=0,this.result={value:null,done:!1}}};function Hr(e,t,n,r,o){const i=2*(Math.min(t,r)+1),s=t+r,l=new(s<256?Uint8Array:s<65536?Uint16Array:Uint32Array)(2*i);return new Vr({i:e,N:t,j:n,M:r,Z:i,b:l,eq:o,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}function Jr(e,t){let[n,r,o]=[0,e.length,t.length];for(;n<r&&n<o&&e[n]===t[n];)n++;if(n===r&&n===o)return[][Symbol.iterator]();for(;e[--r]===t[--o]&&r>n&&o>n;);return Hr(n,r+1-n,n,o+1-n,((n,r)=>e[n]===t[r]))}Kr.diff_core=Hr,Kr.diff=Jr;let Zr=class{[Symbol.iterator](){return this}next(){const e=this.diff.next();if(e.done){const{i:t,j:n,N:r}=this;return t<r&&(e.done=!1,e.value=[t,n,r-t],this.i=r),e}const t=e.value,n=t[0],r=t[1],o=t[3],{i:i,j:s}=this;return i!==n&&(t.length--,t[0]=i,t[1]=s,t[2]=n-i),this.i=r,this.j=o,e}constructor(e,t){this.diff=e,this.N=t,this.i=0,this.j=0}};var Yr=Kr.lcs=function(e,t){return new Zr(Jr(e,t),e.length)};Kr.calcPatch=function*(e,t){const n=ArrayBuffer.isView(e)?Uint8Array.prototype.subarray:e.slice;for(const r of Jr(e,t))r[2]=n.call(t,r[2],r[3]),yield r},Kr.applyPatch=function*(e,t){let n=0;const r=ArrayBuffer.isView(e)?Uint8Array.prototype.subarray:e.slice;for(const[o,i,s]of t)n<o&&(yield r.call(e,n,o)),s.length>0&&(yield s),n=i;n<e.length&&(yield r.call(e,n))};const Gr=(e,t)=>{const n=[];let r=0;for(const o of e)n.push(r),r+=o.length+t;return n.push(r-t),n},Qr=e=>e.filter((e=>e.end>e.start)),Xr=(e,t,n)=>{if(!e)return[{token:"plain",start:n,end:t.length+n}];if("undefined"===t||"Infinity"===t||"-Infinity"===t||"NaN"===t||/^\d+n$/i.test(t)||t.startsWith("Symbol(")||t.startsWith("function")||t.startsWith("("))return[{token:"invalid",start:n,end:t.length+n}];if(!Number.isNaN(Number(t)))return[{token:"number",start:n,end:t.length+n}];if("true"===t||"false"===t)return[{token:"boolean",start:n,end:t.length+n}];if("null"===t)return[{token:"null",start:n,end:t.length+n}];if(t.startsWith('"')){if(t.endsWith(": [")||t.endsWith(": {"))return[{token:"key",start:n,end:t.length-3+n},{token:"punctuation",start:t.length-3,end:t.length-2+n},{token:"plain",start:t.length-2,end:t.length-1+n},{token:"punctuation",start:t.length-1,end:t.length+n}];let r=1;for(;r<t.length&&'"'!==t[r];)"\\"===t[r]&&++r,++r;return r===t.length-1?[{token:"string",start:n,end:t.length+n}]:[{token:"key",start:n,end:r+1+n},{token:"punctuation",start:r+1,end:r+2+n},{token:"plain",start:r+2,end:r+3+n},...Xr(e,t.substring(r+3),n+r+3)]}return"{"===t||"}"===t||"["===t||"]"===t?[{token:"punctuation",start:n,end:t.length+n}]:[{token:"plain",start:n,end:t.length+n}]},eo={threshold:8,margin:3},to=(e,t,n,r)=>{if(!n||r)return[{start:0,end:e.length,isEqual:!1}];const o=[];for(let n=0;n<e.length;n++)"equal"===e[n].type&&"equal"===t[n].type?o.length&&o[o.length-1].isEqual?o[o.length-1].end++:o.push({start:n,end:n+1,isEqual:!0}):o.length&&!o[o.length-1].isEqual?o[o.length-1].end++:o.push({start:n,end:n+1,isEqual:!1});const i=!0===n?eo:{...eo,...n},{threshold:s,margin:l}=i;s<2*l+1&&console.warn(`Threshold (${s}) is no more than 2 margins + 1 "expand" line (${l} * 2 + 1), it's not necessary to hide unchanged areas which have less than ${2*l+1} lines.`);const a=[];for(let t=0;t<o.length;t++){const n=o[t];!n.isEqual||n.end-n.start<s||n.end-n.start<=2*l+1?a.push(n):t?t===o.length-1?(a.push({start:n.start,end:n.start+l,isEqual:!0}),a.push({hasLinesBefore:!1,hasLinesAfter:!0,start:n.start+l,end:e.length,isEqual:!0})):(a.push({start:n.start,end:n.start+l,isEqual:!0}),a.push({hasLinesBefore:!0,hasLinesAfter:!0,start:n.start+l,end:n.end-l,isEqual:!0}),a.push({start:n.end-l,end:n.end,isEqual:!0})):(a.push({hasLinesBefore:!0,hasLinesAfter:!1,start:0,end:n.end-l,isEqual:!0}),a.push({start:n.end-l,end:n.end,isEqual:!0}))}return a},no={noChangeDetected:"No change detected",showLinesBefore:"⭡ Show %d lines before",showLinesAfter:"⭣ Show %d lines after",showAll:"⭥ Show all unchanged lines"},ro=e=>{const[t,r]=e.diff,o=n.useMemo((()=>t.length===r.length&&t.every((e=>"equal"===e.type))&&r.every((e=>"equal"===e.type))),[t,r]),i={...no,...e.texts},s=e.lineNumbers?`calc(${String(t.length).length}ch + 16px)`:0,l=e.indent??2,a="tab"===l?"\t":" ",c="tab"===l?1:l,u={mode:e.inlineDiffOptions?.mode||"char",wordSeparator:e.inlineDiffOptions?.wordSeparator||""},f=e.hideUnchangedLines??!1,{scrollContainer:h="body",itemHeight:d=18,expandLineHeight:p=26}=e.virtual&&!0!==e.virtual?e.virtual:{},v="body"===h?document.body:document.querySelector(h),y=n.useRef(t),g=n.useRef(r),m=n.useRef(to(t,r,f,o)),b=n.useRef([]),x=n.useRef(0),w=n.useRef(null),[,j]=n.useState({}),_=()=>{if(b.current=[],e.virtual){let e=0;for(const t of m.current)Fr(t)?(b.current.push(e),e+=p):(b.current.push(e),e+=d*(t.end-t.start));x.current=m.current.reduce(((e,t)=>Fr(t)?e+p:e+(t.end-t.start)*d),0)}j({})};n.useEffect((()=>{y.current=t,g.current=r,m.current=to(t,r,f,o),_()}),[f,t,r]),n.useEffect((()=>{if(!e.virtual||!v)return;const t=()=>j({});return v.addEventListener("scroll",t),()=>{v.removeEventListener("scroll",t)}}),[e.virtual,v]);const S=e=>t=>{const n=[...m.current],r=n[e];n[e]={...r,end:Math.max(r.end-t,r.start)},e+1<m.current.length-1&&(n[e+1]={...n[e+1],start:Math.max(r.end-t,r.start)}),m.current=n,_()},E=e=>t=>{const n=[...m.current],r=n[e];n[e]={...r,start:Math.min(r.start+t,r.end)},e>1&&(n[e-1]={...n[e-1],end:Math.min(r.start+t,r.end)}),m.current=n,_()},k=e=>()=>{const t=[...m.current],n=t[e];t[e]={...n,start:n.start,end:n.start},e+1<m.current.length-1?t[e+1]={...t[e+1],start:n.start}:t[e-1]={...t[e-1],end:n.end},m.current=t,_()},A=(e,t=[],r=!1,o=!1)=>n.createElement(n.Fragment,null,t.map(((t,r)=>{const o=e.slice(t.start,t.end);if(!t.type&&!t.token)return o;const i=[t.type?`inline-diff-${t.type}`:"",t.token?`token ${t.token}`:""].filter(Boolean).join(" ");return n.createElement("span",{key:`${r}-${t.type}-${o}`,className:i},o)})),r&&(o?n.createElement("span",{className:"token punctuation"},","):",")),M=(t,r)=>{const o=y.current[t],i=g.current[t],[s,l]=e.highlightInlineDiff&&"modify"===o.type&&"modify"===i.type?((e,t,n)=>{let r=[],o=[],i=0,s=0;if("word"===n.mode){const l=n.wordSeparator||" ",a=e.split(l),c=t.split(l),u=[...Yr(a,c)],f=l.length,h=Gr(a,f),d=Gr(c,f);for(const[e,t,n]of u)e>i&&r.push({type:"remove",start:h[i],end:h[e]}),t>s&&o.push({type:"add",start:d[s],end:d[t]}),i=e+n,s=t+n,r.push({start:h[e],end:h[i]}),o.push({start:d[t],end:d[s]});return e.length>i&&r.push({type:"remove",start:h[i],end:e.length}),t.length>s&&o.push({type:"add",start:d[s],end:t.length}),r=Qr(r),o=Qr(o),[r,o]}const l=Yr(e,t);for(const[e,t,n]of l)e>i&&r.push({type:"remove",start:i,end:e}),t>s&&o.push({type:"add",start:s,end:t}),i=e+n,s=t+n,r.push({start:e,end:i}),o.push({start:t,end:s});return e.length>i&&r.push({type:"remove",start:i,end:e.length}),t.length>s&&o.push({type:"add",start:s,end:t.length}),r=Qr(r),o=Qr(o),[r,o]})(o.text,i.text,u):[[],[]],f=Xr(r,o.text,0),h=Xr(r,i.text,0),d=Ur(f,s),p=Ur(h,l),v="equal"!==o.type?e.bgColour?.[o.type]??"":"",m="equal"!==i.type?e.bgColour?.[i.type]??"":"";return n.createElement("tr",{key:t},e.lineNumbers&&n.createElement("td",{className:`line-${o.type} line-number`,style:{backgroundColor:v}},o.lineNumber),n.createElement("td",{className:`line-${o.type}`,style:{backgroundColor:v}},n.createElement("pre",null,o.text&&a.repeat(o.level*c),A(o.text,d,o.comma,r))),e.lineNumbers&&n.createElement("td",{className:`line-${i.type} line-number`,style:{backgroundColor:m}},i.lineNumber),n.createElement("td",{className:`line-${i.type}`,style:{backgroundColor:m}},n.createElement("pre",null,i.text&&a.repeat(i.level*c),A(i.text,p,i.comma,r))))},O=(e,t,r,o)=>n.createElement(n.Fragment,null,e&&n.createElement("button",{onClick:()=>S(o)(r)},i.showLinesBefore.replaceAll("%d",String(r))),n.createElement("button",{onClick:()=>k(o)()},i.showAll),t&&n.createElement("button",{onClick:()=>E(o)(r)},i.showLinesAfter.replaceAll("%d",String(r)))),q=(e,t,r,o,i)=>{let{start:s,end:l}=e;if(s=Math.max(s,r),l=Math.min(l,o),s===l)return null;if(!Fr(e))return Array(l-s).fill(0).map(((e,t)=>M(s+t,i)));const{hasLinesBefore:a,hasLinesAfter:c}=e,u="boolean"==typeof f?20:f.expandMoreLinesLimit||20;return[n.createElement("tr",{key:`expand-line-${t}`,className:"expand-line"},n.createElement("td",{colSpan:4,className:`${a?"has-lines-before":""} ${c?"has-lines-after":""}`},"boolean"!=typeof f&&f.expandLineRenderer?f.expandLineRenderer({hasLinesBefore:a,hasLinesAfter:c,onExpandBefore:S(t),onExpandAfter:E(t),onExpandAll:k(t)}):O(a,c,u,t)))]},N=["json-diff-viewer",e.virtual&&"json-diff-viewer-virtual",e.syntaxHighlight&&`json-diff-viewer-theme-${e.syntaxHighlight.theme||"monokai"}`,e.className].filter(Boolean).join(" "),C=!!e.syntaxHighlight;return n.createElement("table",{className:N,style:e.style},n.createElement("colgroup",{className:"measure-line"},e.lineNumbers&&n.createElement("col",{style:{width:s}}),n.createElement("col",null),e.lineNumbers&&n.createElement("col",{style:{width:s}}),n.createElement("col",null)),n.createElement("tbody",{ref:w},(t=>{if(o&&f)return n.createElement("tr",{key:"message-line",className:"message-line"},n.createElement("td",{colSpan:4},i.noChangeDetected));if(!e.virtual)return m.current.map(((e,n)=>q(e,n,0,y.current.length,t)));const r=v?.clientHeight??0,s=v?.scrollTop??0,l=s+r;let a=w.current,c=a?.offsetTop??0;for(;a?.offsetParent&&a?.offsetParent!==v;)a=a.offsetParent,c+=a.offsetTop;if(c>l||c+x.current<s)return n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:`${x.current}px`}}));const u=s-c,h=l-c,[g,j,_,S]=((e,t,n,r,o,i)=>{if(!t.length)return[0,0,0,0];let s=0,l=0,a=0,c=0,u=0,f=e.length-1;for(;;){const r=Math.floor((u+f)/2);if(t[r]+Wr(e[r],o,i)<=n?u=r+1:f=r,u===f){s=u;break}}const h=e[s];for(a=Fr(h)?h.start:h.start+Math.floor((n-t[s])/o),u=0,f=e.length-1;;){const e=Math.floor((u+f+1)/2);if(t[e]>=r?f=e-1:u=e,u===f){l=u;break}}const d=e[l];return c=Fr(d)?d.end:d.start+Math.ceil((r-t[l])/o),[s,a,l,c]})(m.current,b.current,u,h,d,p),[E,k]=((e,t,n,r,o,i,s,l,a)=>{if(!t.length)return[0,0];let c=0,u=0;const f=e[n];c=Fr(f)?t[n]:t[n]+(r-f.start)*s;const h=e[o];return u=Fr(h)?a-t[o]-l:a-t[o]-(i-h.start)*s,[c,u]})(m.current,b.current,g,j,_,S,d,p,x.current),A=m.current.slice(g,_+1);return A.length?n.createElement(n.Fragment,null,n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:E,padding:0}})),A.map(((e,n)=>q(e,n,j,S,t))),n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:k,padding:0}}))):n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:`${x.current}px`}}))})(C)))};function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oo.apply(null,arguments)}function io(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function so(e,t){return so=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},so(e,t)}ro.displayName="Viewer";var lo=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function ao(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],o=t[n],!(r===o||lo(r)&&lo(o)))return!1;var r,o;return!0}function co(e,t){var n;void 0===t&&(t=ao);var r,o=[],i=!1;return function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}var uo="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function fo(e){cancelAnimationFrame(e.id)}var ho=-1;function po(e){if(void 0===e&&(e=!1),-1===ho||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),ho=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ho}var vo=null;function yo(e){if(void 0===e&&(e=!1),null===vo||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?vo="positive-descending":(t.scrollLeft=1,vo=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),vo}return vo}process.env.NODE_ENV;var go=function(e,t){return e},mo=null,bo=null;function xo(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,s=e.getItemSize,l=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,c=e.getStopIndexForStartIndex,u=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,h=e.validateProps;return t=function(e){var t,o;function d(t){var r;return(r=e.call(this,t)||this)._instanceProps=u(r.props,io(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:io(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=co((function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})})),r._callOnScroll=void 0,r._callOnScroll=co((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,i=o.direction,l=o.itemSize,a=o.layout,c=r._getItemStyleCache(f&&l,f&&a,f&&i);if(c.hasOwnProperty(e))t=c[e];else{var u=n(r.props,e,r._instanceProps),h=s(r.props,e,r._instanceProps),d="horizontal"===i||"horizontal"===a,p="rtl"===i,v=d?u:0;c[e]=t={position:"absolute",left:p?void 0:v,right:p?v:void 0,top:d?0:u,height:d?"100%":h,width:d?h:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=co((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,s=o;if("rtl"===t)switch(yo()){case"negative":s=-o;break;case"positive-descending":s=i-n-o}return s=Math.max(0,Math.min(s,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState((function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,o;null!==r._resetIsScrollingTimeoutId&&fo(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=uo(),o={id:requestAnimationFrame((function r(){uo()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}))})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}o=e,(t=d).prototype=Object.create(o.prototype),t.prototype.constructor=t,so(t,o),d.getDerivedStateFromProps=function(e,t){return wo(e,t),h(e),null};var p=d.prototype;return p.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},p.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,o=n.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var a=this._outerRef;s="vertical"===o?a.scrollWidth>a.clientWidth?po():0:a.scrollHeight>a.clientHeight?po():0}this.scrollTo(l(this.props,e,t,i,this._instanceProps,s))},p.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},p.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(yo()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var s=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-s-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},p.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&fo(this._resetIsScrollingTimeoutId)},p.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,s=e.height,l=e.innerRef,a=e.innerElementType,c=e.innerTagName,u=e.itemCount,f=e.itemData,h=e.itemKey,d=void 0===h?go:h,p=e.layout,v=e.outerElementType,y=e.outerTagName,g=e.style,m=e.useIsScrolling,b=e.width,x=this.state.isScrolling,w="horizontal"===o||"horizontal"===p,j=w?this._onScrollHorizontal:this._onScrollVertical,_=this._getRangeToRender(),S=_[0],E=_[1],k=[];if(u>0)for(var A=S;A<=E;A++)k.push(r(t,{data:f,key:d(A,f),index:A,isScrolling:m?x:void 0,style:this._getItemStyle(A)}));var M=i(this.props,this._instanceProps);return r(v||y||"div",{className:n,onScroll:j,ref:this._outerRefSetter,style:oo({position:"relative",height:s,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},g)},r(a||c||"div",{children:k,ref:l,style:{height:w?"100%":M,pointerEvents:x?"none":void 0,width:w?M:"100%"}}))},p._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"==typeof this.props.onScroll){var i=this.state,s=i.scrollDirection,l=i.scrollOffset,a=i.scrollUpdateWasRequested;this._callOnScroll(s,l,a)}},p._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,s=r.scrollOffset;if(0===t)return[0,0,0,0];var l=a(this.props,s,this._instanceProps),u=c(this.props,l,s,this._instanceProps),f=o&&"backward"!==i?1:Math.max(1,n),h=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,l-f),Math.max(0,Math.min(t-1,u+h)),l,u]},d}(o),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&void 0!==window.WeakSet&&(mo=new WeakSet,bo=new WeakSet);var wo=function(e,t){var n=e.children,r=e.direction,o=e.height,i=e.layout,s=e.innerTagName,l=e.outerTagName,a=e.width,c=t.instance;if("production"!==process.env.NODE_ENV){null==s&&null==l||bo&&!bo.has(c)&&(bo.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var u="horizontal"===r||"horizontal"===i;switch(r){case"horizontal":case"vertical":mo&&!mo.has(c)&&(mo.add(c),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+r+'" was specified.')}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". "'+i+'" was specified.')}if(null==n)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===n?"null":typeof n)+'" was specified.');if(u&&"number"!=typeof a)throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. "'+(null===a?"null":typeof a)+'" was specified.');if(!u&&"number"!=typeof o)throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. "'+(null===o?"null":typeof o)+'" was specified.')}},jo=function(e,t,n){var r=e.itemSize,o=n.itemMetadataMap,i=n.lastMeasuredIndex;if(t>i){var s=0;if(i>=0){var l=o[i];s=l.offset+l.size}for(var a=i+1;a<=t;a++){var c=r(a);o[a]={offset:s,size:c},s+=c}n.lastMeasuredIndex=t}return o[t]},_o=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),s=jo(e,i,t).offset;if(s===o)return i;s<o?r=i+1:s>o&&(n=i-1)}return r>0?r-1:0},So=function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&jo(e,n,t).offset<r;)n+=i,i*=2;return _o(e,t,Math.min(n,o-1),Math.floor(n/2),r)},Eo=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,s=0;if(i>=n&&(i=n-1),i>=0){var l=r[i];s=l.offset+l.size}return s+(n-i-1)*o},ko=xo({getItemOffset:function(e,t,n){return jo(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:Eo,getOffsetForIndexAndAlignment:function(e,t,n,r,o,i){var s=e.direction,l=e.height,a=e.layout,c=e.width,u="horizontal"===s||"horizontal"===a?c:l,f=jo(e,t,o),h=Eo(e,o),d=Math.max(0,Math.min(h-u,f.offset)),p=Math.max(0,f.offset-u+f.size+i);switch("smart"===n&&(n=r>=p-u&&r<=d+u?"auto":"center"),n){case"start":return d;case"end":return p;case"center":return Math.round(p+(d-p)/2);default:return r>=p&&r<=d?r:r<p?p:d}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?r[o].offset:0)>=n?_o(e,t,o,0,n):So(e,t,Math.max(0,o),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var o=e.direction,i=e.height,s=e.itemCount,l=e.layout,a=e.width,c="horizontal"===o||"horizontal"===l?a:i,u=jo(e,t,r),f=n+c,h=u.offset+u.size,d=t;d<s-1&&h<f;)d++,h+=jo(e,d,r).size;return d},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var t=e.itemSize;if("production"!==process.env.NODE_ENV&&"function"!=typeof t)throw Error('An invalid "itemSize" prop has been specified. Value should be a function. "'+(null===t?"null":typeof t)+'" was specified.')}});function Ao(){return e("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.7955 15.8111L21 21M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mo(e,t="json-diff-viewer-theme-custom"){if(!e){return void document.querySelectorAll(`.${t} span.token.search-match`).forEach((e=>e.classList.remove("search-match")))}const n=e.replaceAll("(","").replaceAll(")",""),r=new RegExp(n,"gi");document.querySelectorAll(`.${t} span.token`).forEach((e=>{const t=e.textContent||"";r.test(t)?e.classList.add("search-match"):e.classList.remove("search-match")}))}function Oo(e){return"equal"===e.type&&""!==e.text}function qo(e,t,n=3){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Both segments and diff must be arrays");const r=[];return e.forEach(((o,i)=>{if(o.isEqual){if(o.end-o.start<=2*n||o.isExpanded)for(let e=o.start;e<o.end;e++)r.push({...t[e],originalIndex:e});else{if(function(e,t,n){return 0===e||t[e-1].end<n.start&&t[e-1].isEqual}(i,e,o))for(let e=o.start;e<Math.min(o.start+n,o.end);e++)r.push({...t[e],originalIndex:e});o.end-(o.start+n)>n&&r.push({type:"collapsed",segmentIndex:i,originalIndex:r.length,level:0,text:""});for(let e=Math.max(o.end-n,o.start+n);e<o.end;e++)r.push({...t[e],originalIndex:e})}}else for(let e=o.start;e<o.end;e++)r.push({...t[e],originalIndex:e})})),r}const No=20,Co="#363743",Io="#7B7B7Bcc",$o=({leftDiff:t,rightDiff:n,height:r,onScroll:o,miniMapWidth:c=20,currentScrollTop:u,searchResults:f=[],currentMatchIndex:h=-1})=>{const d=i(null),p=i(null),v=i(!1),{totalLines:y,viewportHeight:g}=s((()=>{const e=r/No,o=Math.max(t.length,n.length)||e;return{totalLines:o,viewportHeight:r*(1/(o/e))}}),[r,t.length,n.length,t]),m=l(((e,t,n,r,o)=>{if("collapsed"===t.type)e.fillStyle=Co;else switch(t.type){case"equal":e.fillStyle=Co;break;case"add":e.fillStyle="#4CAF50";break;case"remove":e.fillStyle="#F44336";break;case"modify":e.fillStyle="#FFC107"}e.fillRect(r,n,o,No)}),[]),b=(e,o)=>{const i=u/(y*No)*r;(e=>{const o=r/y;if(h>=0&&void 0!==f[h]){const t=f[h]*o,n=Math.max(1,o);e.fillStyle="#ff4500",e.fillRect(0,t,c,n)}t.forEach(((t,n)=>{m(e,t,n*o,0,c/2)})),n.forEach(((t,n)=>{m(e,t,n*o,c/2,c/2)})),f.forEach((t=>{const n=t*o,r=Math.max(1,o);e.fillStyle="#ffd700",e.fillRect(0,n,c,r)}))})(e),e.fillStyle=o,e.fillRect(0,i,c,g)},x=l((()=>{const e=d.current;if(!e)return;const t=e.getContext("2d");t&&(t.clearRect(0,0,e.width,e.height),v.current?b(t,Io):b(t,"#7B7B7B80"))}),[t,n,r,u,f,h,m,g]);a((()=>{x()}),[x]);const w=l((e=>{if(v.current=!0,!p.current)return;const t=p.current.getBoundingClientRect(),n=e.clientY-t.top;if(r<=0||y<=0)return;const i=d.current;if(!i)return;const s=i.getContext("2d");if(!s)return;b(s,"rgba(33, 150, 243, 0.8)");const l=(n-g/2)/r*y*No;!Number.isNaN(l)&&Number.isFinite(l)&&o(Math.max(0,l))}),[r,y,g,o]),j=l((e=>{if(!p.current)return;const t=p.current.getBoundingClientRect(),n=e.clientY-t.top,i=(n-g/2)/r*y*No,s=u/(y*No)*r,l=n>s&&n<s+g,a=d.current;if(x(),a){const e=a.getContext("2d");if(!e)return;l&&b(e,Io)}if(!v.current)return;if(r<=0||y<=0)return;if(Number.isNaN(i)||!Number.isFinite(i))return;if(e.clientY+g/2>t.bottom){const e=(t.bottom-g/2-t.top)/r*y*No;!Number.isNaN(e)&&Number.isFinite(e)&&o(Math.max(0,e-250))}else o(Math.max(0,i))}),[r,y,g,o]),_=l((()=>{v.current=!1}),[]);return a((()=>(window.addEventListener("mouseup",_),()=>window.removeEventListener("mouseup",_))),[_]),e("div",{ref:p,style:{width:c,height:r,position:"relative",cursor:"pointer"},onMouseDown:w,onMouseMove:j,onMouseLeave:()=>{const e=d.current;if(!e)return;e.getContext("2d")&&(v.current&&(v.current=!1),x())},children:e("canvas",{ref:d,width:c,height:r,style:{width:"100%",height:"100%"}})})};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.diff-viewer-container {\n background-color: #282a36;\n font-size: 12px;\n text-align: left;\n padding-bottom: 12px;\n}\n\n.virtual-json-diff-list-container {\n --sb-track-color: #232e33;\n --sb-thumb-color: #4560f8;\n --sb-size: 6px;\n}\n\n.virtual-json-diff-list-container::-webkit-scrollbar {\n width: var(--sb-size);\n}\n\n.virtual-json-diff-list-container::-webkit-scrollbar-track {\n background: var(--sb-track-color);\n border-radius: 3px;\n}\n\n.virtual-json-diff-list-container::-webkit-scrollbar-thumb {\n background: var(--sb-thumb-color);\n border-radius: 3px;\n}\n\n@supports not selector(::-webkit-scrollbar) {\n .virtual-json-diff-list-container {\n scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);\n }\n}\n\n.diff-viewer-container {\n button {\n border-radius: 4px;\n border: 1px solid transparent;\n font-size: 1em;\n font-weight: 500;\n font-family: inherit;\n color: white;\n background-color: #1a1a1a;\n cursor: pointer;\n transition: border-color 0.25s;\n }\n button:hover {\n border-color: #649dffab;\n }\n button:focus,\n button:focus-visible {\n outline: 4px auto -webkit-focus-ring-color;\n }\n}\n\n.json-diff-header {\n background: #2f323e;\n padding: 10px;\n border-bottom: 1px solid #353846;\n color: #ffffffe5;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,\n "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-header .search-container {\n margin-bottom: 8px;\n width: 100%;\n}\n\n.json-diff-header .json-diff-title-container {\n width: 100%;\n display: flex;\n flex-direction: row;\n}\n\n.json-diff-header .json-diff-title-container div {\n flex: 0.47;\n}\n\n.json-diff-header .search-input-container {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.json-diff-header .search-input-container svg {\n width: 1em;\n height: 1em;\n}\n\n.json-diff-header .search-input-container input {\n border: 1px solid #434343;\n border-radius: 4px;\n padding: 6px;\n width: 100%;\n background: #2f323e;\n color: white;\n}\n\n.json-diff-header .search-results {\n margin-top: 3px;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.json-diff-header .search-results button {\n height: 20px;\n padding: 0 8px;\n line-height: 20px;\n background: #26262600;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n color: white;\n}\n\n.json-diff-viewer-virtual pre {\n overflow-x: auto;\n white-space: pre;\n}\n\n.json-diff-viewer-virtual pre::-webkit-scrollbar {\n display: none;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom {\n background: #282a36;\n color: #f8f8f2;\n width: 100%;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,\n "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom.has-search tr td pre span.token.search-match {\n background-color: #ffeb3b;\n color: #000;\n padding: 0 2px;\n border-radius: 2px;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .line-number {\n color: #999;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr td {\n max-width: 260px;\n width: 300px !important;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr td pre {\n margin-top: 0;\n margin-bottom: 0;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,\n "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr:hover {\n background: #53535f54;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-add {\n border-left: 1px solid #a5ff99;\n background: rgba(100, 182, 67, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-remove {\n border-left: 1px solid #ffaa99;\n background: rgba(160, 128, 100, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-modify {\n border-left: 1px solid #ecff99;\n background: rgba(182, 180, 67, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-number {\n background: unset;\n padding: 0 4px;\n border-left: 0;\n border-bottom: none;\n max-width: 30px;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr.expand-line td {\n text-align: center;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr.expand-line button {\n color: #1e616d;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .string {\n color: #e6db74;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .number,\n.json-diff-viewer.json-diff-viewer-theme-custom .boolean,\n.json-diff-viewer.json-diff-viewer-theme-custom .null {\n color: #ae81ff;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .key {\n color: #66d9ef;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .invalid {\n background: #960050;\n color: #fff;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .search-highlight {\n background-color: #ffeb3b;\n padding: 0 2px;\n border-radius: 2px;\n color: #000;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .token .search-highlight {\n background-color: #ffeb3b !important;\n color: #000 !important;\n}\n\n.collapsed-button {\n display: flex;\n background-color: #262626;\n justify-content: center;\n align-items: center;\n}\n\n.collapsed-button button {\n height: 20px;\n color: rgba(255, 255, 255, 0.7);\n padding: 0px 8px;\n line-height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #26262600;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n}\n\n.hide-all-button {\n text-align: right;\n margin-top: 10px;\n}\n\n.hide-all-button button {\n height: 28px;\n padding: 0 8px;\n line-height: 20px;\n background: #26262600;\n color: white;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n}\n');const Bo="json-diff-viewer-theme-custom";function Do(e){return e&&"object"==typeof e&&"type"in e&&"collapsed"===e.type}function zo({index:t,style:n,data:r}){const{onExpand:o,searchTerm:i}=r,s=r.leftDiff[t],l=r.rightDiff[t];if(Do(s))return e("div",{className:"collapsed-button",style:n,children:e("button",{onClick:()=>o(s.segmentIndex),className:"text-blue-500 underline",children:"Show Hidden Lines"})});const a={...s},c={...l};return e("div",{style:n,children:e(ro,{indent:1,className:`${Bo} ${i?"has-search":""}`,lineNumbers:!0,diff:[[a],[c]],highlightInlineDiff:!0,inlineDiffOptions:{mode:"word"},syntaxHighlight:{theme:"monokai"}})})}const Lo=({oldValue:n,newValue:r,height:o,searchTerm:u,leftTitle:f,rightTitle:h,hideSearch:d,onSearchMatch:p,differOptions:v,className:y,miniMapWidth:g})=>{const m=i(null),b=i(void 0),[x,w]=c(0),[j,_]=c([]),[S,E]=c({term:"",results:[],currentIndex:0}),k=s((()=>new Pr({detectCircular:!0,maxDepth:20,showModifications:!0,arrayDiffMethod:"lcs",preserveKeyOrder:"before",...v})),[v]),A=s((()=>n&&r?k.diff(n,r):[[],[]]),[n,r,k]),[M,O]=A,[q,N]=c([]),[C,I]=c([]);a((()=>{const e=function(e,t=3){if(!Array.isArray(e))throw new TypeError("Diff input must be an array");const n=[];let r=0;if(r<e.length&&Oo(e[r])){let o=Math.min(r+t,e.length);for(;o<e.length&&Oo(e[o]);)o++;n.push({start:r,end:o,isEqual:!0}),r=o}for(;r<e.length;)if(Oo(e[r])){let t=r;for(;t<e.length&&Oo(e[t]);)t++;n.push({start:r,end:t,isEqual:!0}),r=t}else{const o=Math.max(0,r-t),i=Math.min(e.length,r+1+t);o<r&&(0===n.length||n[n.length-1].end<=o)&&n.push({start:o,end:r,isEqual:!0}),n.push({start:r,end:r+1,isEqual:!1}),r+1<i&&n.push({start:r+1,end:i,isEqual:!0}),r=i}return n}(M);_(e)}),[M]),a((()=>{const e=qo(j,M),t=qo(j,O);N(e),I(t)}),[j,M,O]),a((()=>{m.current?.resetAfterIndex(0)}),[q]);const $=l((e=>{E((t=>({...t,term:e}))),b.current&&clearTimeout(b.current),b.current=setTimeout((()=>{const t=function(e,t){if(!e)return[];const n=[],r=new RegExp(e,"gi");return t.forEach(((e,t)=>{"object"==typeof e&&"text"in e&&r.test(e.text)&&n.push(t)})),n}(e,q);E((e=>({...e,results:t,currentIndex:0})))}),300)}),[q]),B=l((e=>{if(0===S.results.length)return;const t="next"===e?(S.currentIndex+1)%S.results.length:(S.currentIndex-1+S.results.length)%S.results.length;E((e=>({...e,currentIndex:t})));const n=S.results[t];m.current?.scrollToItem(n,"center"),p&&p(n)}),[S.results,S.currentIndex,p]);a((()=>{void 0!==u&&$(u)}),[u,$]),a((()=>{Mo(S.term,Bo);const e=new MutationObserver((()=>Mo(S.term,Bo))),t={childList:!0,subtree:!0},n=document.querySelector(`.${Bo}`);n&&e.observe(n,t);const r=document.querySelector(".virtual-json-diff-list-container");if(r){const t=()=>{setTimeout((()=>Mo(S.term,Bo)),100)};return r.addEventListener("scroll",t),()=>{e.disconnect(),r.removeEventListener("scroll",t)}}return()=>{e.disconnect()}}),[S.term]);const D=l((e=>{_((t=>{const n=[...t],r=n[e];if(!r||!r.isEqual)return t;const o={...r,isExpanded:!0,originalStart:r.start,originalEnd:r.end,start:r.start,end:r.end};return n[e]=o,n}))}),[]),z=l((()=>{_((e=>e.map((e=>e.isEqual&&e.isExpanded?{...e,isExpanded:!1,start:e.originalStart??e.start,end:e.originalEnd??e.end}:e))))}),[]),L=l((e=>(Do(q[e]),20)),[q]),T=s((()=>j.some((e=>e.isEqual&&e.isExpanded))),[j]),R=s((()=>({leftDiff:q,rightDiff:C,onExpand:D,searchTerm:S.term})),[q,C,D,S.term]);return t("div",{className:"diff-viewer-container"+(y?` ${y}`:""),children:[t("div",{className:"json-diff-header",children:[!d&&t("div",{className:"search-container",children:[t("div",{className:"search-input-container",children:[e("span",{role:"img","aria-label":"search",children:e(Ao,{})}),e("input",{type:"text",placeholder:"Search in JSON...",value:S.term,onChange:e=>$(e.target.value)})]}),S.results.length>0&&t("div",{className:"search-results",children:[t("span",{children:[S.currentIndex+1," ","of",S.results.length," ","matches"]}),e("button",{onClick:()=>B("prev"),children:"Previous"}),e("button",{onClick:()=>B("next"),children:"Next"})]})]}),t("div",{className:"json-diff-title-container",children:[e("div",{children:e("span",{children:f})}),e("div",{children:e("span",{children:h})})]})]}),t("div",{style:{display:"flex",gap:"8px"},children:[e(ko,{ref:m,className:"virtual-json-diff-list-container",height:o,itemCount:Math.max(q.length,C.length),itemSize:L,overscanCount:28,width:"100%",itemData:R,onScroll:({scrollOffset:e})=>{w(e)},children:zo}),e("div",{children:e($o,{leftDiff:q,rightDiff:C,height:o,onScroll:e=>{m.current?.scrollTo(e)},currentScrollTop:x,miniMapWidth:g,searchResults:S.results,currentMatchIndex:S.currentIndex})})]}),T&&e("div",{className:"hide-all-button",children:e("button",{onClick:z,children:"Hide All Expanded Lines"})})]})};export{Lo as VirtualDiffViewer};
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{createElement as r,PureComponent as o,useRef as i,useMemo as s,useCallback as l,useEffect as a,useState as c,useLayoutEffect as u}from"react";const f=e=>{if(null==e||"bigint"==typeof e||Number.isNaN(e)||e===1/0||e===-1/0)return;if(["string","number","boolean"].includes(typeof e))return e;if(Array.isArray(e))return e.map(f).filter((e=>void 0!==e));const t={};for(const[n,r]of Object.entries(e)){const e=f(r);void 0!==e&&(t[n]=e)}return t},h=(e,t,n=!1)=>{if(!Array.isArray(e)||!Array.isArray(t))throw new Error("Both arguments should be arrays.");const r=e.length,o=t.length,i=new Array(r+o);if(n){for(let e=0;e<o;e++)i[e]=t[o-e-1];for(let t=0;t<r;t++)i[t+o]=e[t];return i}for(let t=0;t<r;t++)i[t]=e[t];for(let e=0;e<o;e++)i[e+r]=t[e];return i},d=(e,t=new Map)=>{if("object"!=typeof e||null===e)return!1;if(t.has(e))return!0;if(t.set(e,!0),Array.isArray(e)){for(let n=0;n<e.length;n++)if(d(e[n],t))return!0;return!1}for(const n in e)if(d(e[n],t))return!0;return!1},p=(e,t,n,r=1/0,o)=>{if(!e||"object"!=typeof e){let r;if(Number.isNaN(e)||e===1/0||e===-1/0||"bigint"==typeof e||(r=JSON.stringify(e,t,n)),void 0===r)switch(o){case Lr.throw:throw new Error(`Value is not valid in JSON, got ${String(e)}`);case Lr.stringify:return v(e);default:throw new Error("Should not reach here, please report this bug.")}return r}const i=r<1?'"..."':Array.isArray(e)?`[${e.map((e=>p(e,t,n,r-1,o))).join(",")}]`:`{${Object.keys(e).map((i=>`"${i}": ${p(e[i],t,n,r-1,o)}`)).join(", ")}}`;return JSON.stringify(JSON.parse(i),t,n)},v=e=>void 0===e?"undefined":e===1/0?"Infinity":e===-1/0?"-Infinity":Number.isNaN(e)?"NaN":"bigint"==typeof e?`${e}n`:String(e),y=(e,t=1/0,n=!1,r=Lr.stringify)=>null===e?"null":Array.isArray(e)||"object"==typeof e?p(e,void 0,n?1:void 0,t,r):p(e,void 0,void 0,void 0,r),g=e=>"boolean"==typeof e?0:"number"==typeof e?1:"string"==typeof e?2:null===e?3:Array.isArray(e)?4:"object"==typeof e?5:"symbol"==typeof e?6:"function"==typeof e?7:"bigint"==typeof e?8:-1,m=(e,t,n)=>{const r=n.keyOrdersMap?.get(e),o=n.keyOrdersMap?.get(t);if(void 0!==r&&void 0!==o)return r-o;const i=g(e),s=g(t);if(i!==s)return i-s;if(null===e&&null===t||Array.isArray(e)&&Array.isArray(t)||5===i&&5===s)return 0;switch(typeof e){case"number":return Number.isNaN(e)&&Number.isNaN(t)||e===1/0&&t===1/0||e===-1/0&&t===-1/0?0:e-t;case"string":return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e<t?-1:e>t?1:0;case"boolean":return+e-+t;case"symbol":case"function":return String(e).localeCompare(String(t))}if("bigint"==typeof e&&"bigint"==typeof t){const n=BigInt(e)-BigInt(t);return n<0?-1:n>0?1:0}return String(e).localeCompare(String(t))},b=e=>Array.isArray(e)?"array":null===e?"null":typeof e,x=(e,t,n,r,o,i,s,l)=>{const a={ignoreCase:l.ignoreCase},c=y(o,l.maxDepth,!0,l.undefinedBehavior).split("\n"),u=y(i,l.maxDepth,!0,l.undefinedBehavior).split("\n");if(0!==m(o,i,a))if(l.showModifications){const o=Math.max(c.length,u.length);for(let e=c.length;e<o;e++)c.push("");for(let e=u.length;e<o;e++)u.push("");e.push({level:s,type:"modify",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:s+(c[t].match(/^\s+/)?.[0]?.length||0),type:"modify",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});for(let t=c.length;t<o;t++)e.push({level:s,type:"equal",text:""});t.push({level:s,type:"modify",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:s+(u[e].match(/^\s+/)?.[0]?.length||0),type:"modify",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")});for(let e=u.length;e<o;e++)t.push({level:s,type:"equal",text:""})}else{e.push({level:s,type:"remove",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:s+(c[t].match(/^\s+/)?.[0]?.length||0),type:"remove",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});for(let t=0;t<u.length;t++)e.push({level:s,type:"equal",text:""});for(let e=0;e<c.length;e++)t.push({level:s,type:"equal",text:""});t.push({level:s,type:"add",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:s+(u[e].match(/^\s+/)?.[0]?.length||0),type:"add",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")})}else{const o=Math.max(c.length,u.length);for(let e=c.length;e<o;e++)c.push("");for(let e=u.length;e<o;e++)u.push("");e.push({level:s,type:"equal",text:n?`"${n}": ${c[0]}`:c[0]});for(let t=1;t<c.length;t++)e.push({level:s+(c[t].match(/^\s+/)?.[0]?.length||0),type:"equal",text:c[t].replace(/^\s+/,"").replace(/,$/g,"")});t.push({level:s,type:"equal",text:r?`"${r}": ${u[0]}`:u[0]});for(let e=1;e<u.length;e++)t.push({level:s+(u[e].match(/^\s+/)?.[0]?.length||0),type:"equal",text:u[e].replace(/^\s+/,"").replace(/,$/g,"")})}},w=(e,t)=>e.sort(((e,n)=>m(e,n,{ignoreCase:t.ignoreCaseForKey}))),j=(e,t,n=1,r,o)=>{if(n>(r.maxDepth||1/0))return[[{level:n,type:"equal",text:"..."}],[{level:n,type:"equal",text:"..."}]];let i=[],s=[];if(null===e&&null===t||void 0===e&&void 0===t)return[i,s];if(null==e){const e=p(t,void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++)i.push({level:n,type:"equal",text:""}),s.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});return[i,s]}if(null==t){const t=p(e,void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++)i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),s.push({level:n,type:"equal",text:""});return[i,s]}const l=Object.keys(e),a=Object.keys(t),c=new Map;if(r.preserveKeyOrder){if("before"===r.preserveKeyOrder){for(let e=0;e<l.length;e++)c.set(l[e],e);for(let e=0;e<a.length;e++)c.has(a[e])||c.set(a[e],l.length+e);a.sort(((e,t)=>c.get(e)-c.get(t)))}else if("after"===r.preserveKeyOrder){for(let e=0;e<a.length;e++)c.set(a[e],e);for(let e=0;e<l.length;e++)c.has(l[e])||c.set(l[e],a.length+e);l.sort(((e,t)=>c.get(e)-c.get(t)))}}else w(l,r),w(a,r);const u={ignoreCase:r.ignoreCaseForKey,keyOrdersMap:c};for(;l.length||a.length;){const c=l[0],f=a[0],d=m(c,f,u);if(0===d)if(b(e[c])!==b(t[f]))x(i,s,c,f,e[c],t[f],n,r);else if(Array.isArray(e[c])){const l=[...e[c]],a=[...t[f]],[u,d]=o(l,a,c,f,n,r,[],[]);i=h(i,u),s=h(s,d)}else if(null===e[c])i.push({level:n,type:"equal",text:`"${c}": null`}),s.push({level:n,type:"equal",text:`"${f}": null`});else if("object"==typeof e[c]){const l=j(e[c],t[f],n+1,r,o);i.push({level:n,type:"equal",text:`"${c}": {`}),i=h(i,l[0]),i.push({level:n,type:"equal",text:"}"}),s.push({level:n,type:"equal",text:`"${f}": {`}),s=h(s,l[1]),s.push({level:n,type:"equal",text:"}"})}else x(i,s,c,f,e[c],t[f],n,r);else if(l.length&&a.length)if(d<0){const t=p(e[c],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++){const r=t[e].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:e?r:`"${c}": ${r}`}),s.push({level:n,type:"equal",text:""})}}else{const e=p(t[f],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++){const r=e[t].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n,type:"equal",text:""}),s.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:t?r:`"${f}": ${r}`})}}else if(l.length){const t=p(e[c],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++){const r=t[e].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:e?r:`"${c}": ${r}`}),s.push({level:n,type:"equal",text:""})}}else if(a.length){const e=p(t[f],void 0,1,void 0,r.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++){const r=e[t].replace(/^\s+/,"").replace(/,$/g,"");i.push({level:n,type:"equal",text:""}),s.push({level:n+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:t?r:`"${f}": ${r}`})}}c?f?0===d?(l.shift(),a.shift()):d<0?l.shift():a.shift():l.shift():a.shift()}if(i.length!==s.length)throw new Error("Diff error: length not match for left & right, please report a bug with your data.");return[i,s]};var _=function(){this.__data__=[],this.size=0};var S=function(e,t){return e===t||e!=e&&t!=t},E=S;var k=function(e,t){for(var n=e.length;n--;)if(E(e[n][0],t))return n;return-1},A=k,M=Array.prototype.splice;var O=k;var q=k;var N=k;var C=_,I=function(e){var t=this.__data__,n=A(t,e);return!(n<0)&&(n==t.length-1?t.pop():M.call(t,n,1),--this.size,!0)},$=function(e){var t=this.__data__,n=O(t,e);return n<0?void 0:t[n][1]},B=function(e){return q(this.__data__,e)>-1},z=function(e,t){var n=this.__data__,r=N(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function D(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}D.prototype.clear=C,D.prototype.delete=I,D.prototype.get=$,D.prototype.has=B,D.prototype.set=z;var L=D,T=L;var R=function(){this.__data__=new T,this.size=0};var P=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var F=function(e){return this.__data__.get(e)};var W=function(e){return this.__data__.has(e)},U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},K="object"==typeof U&&U&&U.Object===Object&&U,H=K,V="object"==typeof self&&self&&self.Object===Object&&self,J=H||V||Function("return this")(),Z=J.Symbol,Y=Z,G=Object.prototype,Q=G.hasOwnProperty,X=G.toString,ee=Y?Y.toStringTag:void 0;var te=function(e){var t=Q.call(e,ee),n=e[ee];try{e[ee]=void 0;var r=!0}catch(e){}var o=X.call(e);return r&&(t?e[ee]=n:delete e[ee]),o},ne=Object.prototype.toString;var re=te,oe=function(e){return ne.call(e)},ie=Z?Z.toStringTag:void 0;var se=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ie&&ie in Object(e)?re(e):oe(e)};var le=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ae=se,ce=le;var ue,fe=function(e){if(!ce(e))return!1;var t=ae(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},he=J["__core-js_shared__"],de=(ue=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+ue:"";var pe=function(e){return!!de&&de in e},ve=Function.prototype.toString;var ye=function(e){if(null!=e){try{return ve.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ge=fe,me=pe,be=le,xe=ye,we=/^\[object .+?Constructor\]$/,je=Function.prototype,_e=Object.prototype,Se=je.toString,Ee=_e.hasOwnProperty,ke=RegExp("^"+Se.call(Ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ae=function(e){return!(!be(e)||me(e))&&(ge(e)?ke:we).test(xe(e))},Me=function(e,t){return null==e?void 0:e[t]};var Oe=function(e,t){var n=Me(e,t);return Ae(n)?n:void 0},qe=Oe(J,"Map"),Ne=Oe(Object,"create"),Ce=Ne;var Ie=function(){this.__data__=Ce?Ce(null):{},this.size=0};var $e=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Be=Ne,ze=Object.prototype.hasOwnProperty;var De=function(e){var t=this.__data__;if(Be){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ze.call(t,e)?t[e]:void 0},Le=Ne,Te=Object.prototype.hasOwnProperty;var Re=Ne;var Pe=Ie,Fe=$e,We=De,Ue=function(e){var t=this.__data__;return Le?void 0!==t[e]:Te.call(t,e)},Ke=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Re&&void 0===t?"__lodash_hash_undefined__":t,this};function He(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}He.prototype.clear=Pe,He.prototype.delete=Fe,He.prototype.get=We,He.prototype.has=Ue,He.prototype.set=Ke;var Ve=He,Je=L,Ze=qe;var Ye=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ge=function(e,t){var n=e.__data__;return Ye(t)?n["string"==typeof t?"string":"hash"]:n.map},Qe=Ge;var Xe=Ge;var et=Ge;var tt=Ge;var nt=function(e,t){var n=tt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},rt=function(){this.size=0,this.__data__={hash:new Ve,map:new(Ze||Je),string:new Ve}},ot=function(e){var t=Qe(this,e).delete(e);return this.size-=t?1:0,t},it=function(e){return Xe(this,e).get(e)},st=function(e){return et(this,e).has(e)},lt=nt;function at(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}at.prototype.clear=rt,at.prototype.delete=ot,at.prototype.get=it,at.prototype.has=st,at.prototype.set=lt;var ct=at,ut=L,ft=qe,ht=ct;var dt=L,pt=R,vt=P,yt=F,gt=W,mt=function(e,t){var n=this.__data__;if(n instanceof ut){var r=n.__data__;if(!ft||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ht(r)}return n.set(e,t),this.size=n.size,this};function bt(e){var t=this.__data__=new dt(e);this.size=t.size}bt.prototype.clear=pt,bt.prototype.delete=vt,bt.prototype.get=yt,bt.prototype.has=gt,bt.prototype.set=mt;var xt=bt;var wt=ct,jt=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},_t=function(e){return this.__data__.has(e)};function St(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new wt;++t<n;)this.add(e[t])}St.prototype.add=St.prototype.push=jt,St.prototype.has=_t;var Et=St,kt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},At=function(e,t){return e.has(t)};var Mt=function(e,t,n,r,o,i){var s=1&n,l=e.length,a=t.length;if(l!=a&&!(s&&a>l))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var f=-1,h=!0,d=2&n?new Et:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var p=e[f],v=t[f];if(r)var y=s?r(v,p,f,t,e,i):r(p,v,f,e,t,i);if(void 0!==y){if(y)continue;h=!1;break}if(d){if(!kt(t,(function(e,t){if(!At(d,t)&&(p===e||o(p,e,n,r,i)))return d.push(t)}))){h=!1;break}}else if(p!==v&&!o(p,v,n,r,i)){h=!1;break}}return i.delete(e),i.delete(t),h};var Ot=J.Uint8Array,qt=S,Nt=Mt,Ct=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},It=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},$t=Z?Z.prototype:void 0,Bt=$t?$t.valueOf:void 0;var zt=function(e,t,n,r,o,i,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Ot(e),new Ot(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return qt(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=Ct;case"[object Set]":var a=1&r;if(l||(l=It),e.size!=t.size&&!a)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Nt(l(e),l(t),r,o,i,s);return s.delete(e),u;case"[object Symbol]":if(Bt)return Bt.call(e)==Bt.call(t)}return!1};var Dt=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},Lt=Array.isArray,Tt=Dt,Rt=Lt;var Pt=function(e,t,n){var r=t(e);return Rt(e)?r:Tt(r,n(e))};var Ft=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i},Wt=function(){return[]},Ut=Object.prototype.propertyIsEnumerable,Kt=Object.getOwnPropertySymbols,Ht=Kt?function(e){return null==e?[]:(e=Object(e),Ft(Kt(e),(function(t){return Ut.call(e,t)})))}:Wt;var Vt=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var Jt=function(e){return null!=e&&"object"==typeof e},Zt=se,Yt=Jt;var Gt=function(e){return Yt(e)&&"[object Arguments]"==Zt(e)},Qt=Jt,Xt=Object.prototype,en=Xt.hasOwnProperty,tn=Xt.propertyIsEnumerable,nn=Gt(function(){return arguments}())?Gt:function(e){return Qt(e)&&en.call(e,"callee")&&!tn.call(e,"callee")},rn={exports:{}};var on=function(){return!1};!function(e,t){var n=J,r=on,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||r;e.exports=l}(rn,rn.exports);var sn=/^(?:0|[1-9]\d*)$/;var ln=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&sn.test(e))&&e>-1&&e%1==0&&e<t};var an=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},cn=se,un=an,fn=Jt,hn={};hn["[object Float32Array]"]=hn["[object Float64Array]"]=hn["[object Int8Array]"]=hn["[object Int16Array]"]=hn["[object Int32Array]"]=hn["[object Uint8Array]"]=hn["[object Uint8ClampedArray]"]=hn["[object Uint16Array]"]=hn["[object Uint32Array]"]=!0,hn["[object Arguments]"]=hn["[object Array]"]=hn["[object ArrayBuffer]"]=hn["[object Boolean]"]=hn["[object DataView]"]=hn["[object Date]"]=hn["[object Error]"]=hn["[object Function]"]=hn["[object Map]"]=hn["[object Number]"]=hn["[object Object]"]=hn["[object RegExp]"]=hn["[object Set]"]=hn["[object String]"]=hn["[object WeakMap]"]=!1;var dn=function(e){return fn(e)&&un(e.length)&&!!hn[cn(e)]};var pn=function(e){return function(t){return e(t)}},vn={exports:{}};!function(e,t){var n=K,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s}(vn,vn.exports);var yn=dn,gn=pn,mn=vn.exports,bn=mn&&mn.isTypedArray,xn=bn?gn(bn):yn,wn=Vt,jn=nn,_n=Lt,Sn=rn.exports,En=ln,kn=xn,An=Object.prototype.hasOwnProperty;var Mn=function(e,t){var n=_n(e),r=!n&&jn(e),o=!n&&!r&&Sn(e),i=!n&&!r&&!o&&kn(e),s=n||r||o||i,l=s?wn(e.length,String):[],a=l.length;for(var c in e)!t&&!An.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||En(c,a))||l.push(c);return l},On=Object.prototype;var qn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||On)};var Nn=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Cn=qn,In=Nn,$n=Object.prototype.hasOwnProperty;var Bn=fe,zn=an;var Dn=Mn,Ln=function(e){if(!Cn(e))return In(e);var t=[];for(var n in Object(e))$n.call(e,n)&&"constructor"!=n&&t.push(n);return t},Tn=function(e){return null!=e&&zn(e.length)&&!Bn(e)};var Rn=Pt,Pn=Ht,Fn=function(e){return Tn(e)?Dn(e):Ln(e)};var Wn=function(e){return Rn(e,Fn,Pn)},Un=Object.prototype.hasOwnProperty;var Kn=function(e,t,n,r,o,i){var s=1&n,l=Wn(e),a=l.length;if(a!=Wn(t).length&&!s)return!1;for(var c=a;c--;){var u=l[c];if(!(s?u in t:Un.call(t,u)))return!1}var f=i.get(e),h=i.get(t);if(f&&h)return f==t&&h==e;var d=!0;i.set(e,t),i.set(t,e);for(var p=s;++c<a;){var v=e[u=l[c]],y=t[u];if(r)var g=s?r(y,v,u,t,e,i):r(v,y,u,e,t,i);if(!(void 0===g?v===y||o(v,y,n,r,i):g)){d=!1;break}p||(p="constructor"==u)}if(d&&!p){var m=e.constructor,b=t.constructor;m==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(d=!1)}return i.delete(e),i.delete(t),d},Hn=Oe(J,"DataView"),Vn=qe,Jn=Oe(J,"Promise"),Zn=Oe(J,"Set"),Yn=Oe(J,"WeakMap"),Gn=se,Qn=ye,Xn="[object Map]",er="[object Promise]",tr="[object Set]",nr="[object WeakMap]",rr="[object DataView]",or=Qn(Hn),ir=Qn(Vn),sr=Qn(Jn),lr=Qn(Zn),ar=Qn(Yn),cr=Gn;(Hn&&cr(new Hn(new ArrayBuffer(1)))!=rr||Vn&&cr(new Vn)!=Xn||Jn&&cr(Jn.resolve())!=er||Zn&&cr(new Zn)!=tr||Yn&&cr(new Yn)!=nr)&&(cr=function(e){var t=Gn(e),n="[object Object]"==t?e.constructor:void 0,r=n?Qn(n):"";if(r)switch(r){case or:return rr;case ir:return Xn;case sr:return er;case lr:return tr;case ar:return nr}return t});var ur=xt,fr=Mt,hr=zt,dr=Kn,pr=cr,vr=Lt,yr=rn.exports,gr=xn,mr="[object Arguments]",br="[object Array]",xr="[object Object]",wr=Object.prototype.hasOwnProperty;var jr=function(e,t,n,r,o,i){var s=vr(e),l=vr(t),a=s?br:pr(e),c=l?br:pr(t),u=(a=a==mr?xr:a)==xr,f=(c=c==mr?xr:c)==xr,h=a==c;if(h&&yr(e)){if(!yr(t))return!1;s=!0,u=!1}if(h&&!u)return i||(i=new ur),s||gr(e)?fr(e,t,n,r,o,i):hr(e,t,a,n,r,o,i);if(!(1&n)){var d=u&&wr.call(e,"__wrapped__"),p=f&&wr.call(t,"__wrapped__");if(d||p){var v=d?e.value():e,y=p?t.value():t;return i||(i=new ur),o(v,y,n,r,i)}}return!!h&&(i||(i=new ur),dr(e,t,n,r,o,i))},_r=Jt;var Sr=function e(t,n,r,o,i){return t===n||(null==t||null==n||!_r(t)&&!_r(n)?t!=t&&n!=n:jr(t,n,r,o,e,i))},Er=Sr;var kr=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?Er(e,t,void 0,n):!!r};const Ar=(e,t,n)=>n.ignoreCase?"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase():"symbol"==typeof e&&"symbol"==typeof t?e.toString()===t.toString():n.recursiveEqual?kr(e,t,((e,t)=>n.ignoreCase&&"string"==typeof e&&"string"==typeof t?e.toLowerCase()===t.toLowerCase():void 0)):e===t,Mr=(e,t)=>{if(e===t)return 1;if(null===e||null===t)return 0;if("object"!=typeof e||"object"!=typeof t)return 0;let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&Object.prototype.hasOwnProperty.call(t,r)&&e[r]===t[r]&&n++;return Math.max(n/Object.keys(e).length,n/Object.keys(t).length)},Or=(e,t,n,r,o)=>{n&&r?(e.push({level:o,type:"equal",text:`"${n}": [`}),t.push({level:o,type:"equal",text:`"${r}": [`})):(e.push({level:o,type:"equal",text:"["}),t.push({level:o,type:"equal",text:"["}))},qr=(e,t,n)=>{e.push({level:n,type:"equal",text:"]"}),t.push({level:n,type:"equal",text:"]"})},Nr=(e,t,n)=>{e.push({level:n+1,type:"equal",text:"..."}),t.push({level:n+1,type:"equal",text:"..."})},Cr=(e,t,n,r,o,i,s=[],l=[])=>{if(Or(s,l,n,r,o),o>=(i.maxDepth||1/0))Nr(s,l,o);else{const[a,c]=((e,t,n,r,o,i)=>{const s=Array(e.length+1).fill(0).map((()=>Array(t.length+1).fill(0))),l=Array(e.length+1).fill(0).map((()=>Array(t.length+1).fill(0)));for(let t=1;t<=e.length;t++)l[t][0]="up";for(let e=1;e<=t.length;e++)l[0][e]="left";for(let n=1;n<=e.length;n++)for(let r=1;r<=t.length;r++){const o=b(e[n-1]);o!==b(t[r-1])||"array"!==o&&"object"!==o?Ar(e[n-1],t[r-1],i)?(s[n][r]=s[n-1][r-1]+1,l[n][r]="diag"):s[n-1][r]>=s[n][r-1]?(s[n][r]=s[n-1][r],l[n][r]="up"):(s[n][r]=s[n][r-1],l[n][r]="left"):i.recursiveEqual?Ar(e[n-1],t[r-1],i)||Mr(e[n-1],t[r-1])>.5?(s[n][r]=s[n-1][r-1]+1,l[n][r]="diag"):s[n-1][r]>=s[n][r-1]?(s[n][r]=s[n-1][r],l[n][r]="up"):(s[n][r]=s[n][r-1],l[n][r]="left"):(s[n][r]=s[n-1][r-1]+1,l[n][r]="diag")}let a=e.length,c=t.length,u=[],f=[];for(;a>0||c>0;)if("diag"===l[a][c]){const s=b(e[a-1]);if(i.recursiveEqual&&("array"===s||"object"===s)&&Ar(e[a-1],t[c-1],i)){const n=[],r=[];x(n,r,"","",e[a-1],t[c-1],o+1,i),u=h(u,n.reverse(),!0),f=h(f,r.reverse(),!0)}else if("array"===s){const[s,l]=Cr(e[a-1],t[c-1],n,r,o+1,i);u=h(u,s.reverse(),!0),f=h(f,l.reverse(),!0)}else if("object"===s){const[n,r]=j(e[a-1],t[c-1],o+2,i,Cr);u.unshift({level:o+1,type:"equal",text:"}"}),f.unshift({level:o+1,type:"equal",text:"}"}),u=h(u,n.reverse(),!0),f=h(f,r.reverse(),!0),u.unshift({level:o+1,type:"equal",text:"{"}),f.unshift({level:o+1,type:"equal",text:"{"})}else{const n=[],r=[];x(n,r,"","",e[a-1],t[c-1],o+1,i),u=h(u,n.reverse(),!0),f=h(f,r.reverse(),!0)}a--,c--}else if("up"===l[a][c])if(i.showModifications&&a>1&&"left"===l[a-1][c]){const s=b(e[a-1]);if(s===b(t[c-1]))if("array"===s){const[s,l]=Cr(e[a-1],t[c-1],n,r,o+1,i);u=h(u,s.reverse(),!0),f=h(f,l.reverse(),!0)}else if("object"===s){const[n,r]=j(e[a-1],t[c-1],o+2,i,Cr);u.unshift({level:o+1,type:"equal",text:"}"}),f.unshift({level:o+1,type:"equal",text:"}"}),u=h(u,n.reverse(),!0),f=h(f,r.reverse(),!0),u.unshift({level:o+1,type:"equal",text:"{"}),f.unshift({level:o+1,type:"equal",text:"{"})}else u.unshift({level:o+1,type:"modify",text:y(e[a-1],void 0,void 0,i.undefinedBehavior)}),f.unshift({level:o+1,type:"modify",text:y(t[c-1],void 0,void 0,i.undefinedBehavior)});else{const n=[],r=[];x(n,r,"","",e[a-1],t[c-1],o+1,i),u=h(u,n.reverse(),!0),f=h(f,r.reverse(),!0)}a--,c--}else{const t=p(e[a-1],void 0,1,void 0,i.undefinedBehavior).split("\n");for(let e=t.length-1;e>=0;e--)u.unshift({level:o+1+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),f.unshift({level:o+1,type:"equal",text:""});a--}else{const e=p(t[c-1],void 0,1,void 0,i.undefinedBehavior).split("\n");for(let t=e.length-1;t>=0;t--)u.unshift({level:o+1,type:"equal",text:""}),f.unshift({level:o+1+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});c--}return[u,f]})(e,t,n,r,o,i);s=h(s,a),l=h(l,c)}return qr(s,l,o),[s,l]};function Ir(e,t){for(const n of e){if("object"===b(n)){if(!(t in n))return!1;for(const e of Object.values(n))if(Array.isArray(e)&&!Ir(e,t))return!1}else if(Array.isArray(n)&&!Ir(n,t))return!1}return!0}const $r=function e(t,n,r,o,i,s,l=[],a=[]){if(!s.compareKey)return zr(t,n,r,o,i,s,l,a);const c=e=>e.every((e=>"object"===b(e)));if(!(c(t)&&c(n)&&Ir(t,s.compareKey)&&Ir(n,s.compareKey)))return zr(t,n,r,o,i,s,l,a);if(Or(l,a,r,o,i),i>=(s.maxDepth||1/0))Nr(l,a,i);else{const r=new Set,o=new Set;for(let c=0;c<t.length;c++){const u=t[c];if(r.has(c))continue;if("object"!==b(u)||!(s.compareKey in u))continue;const f=u[s.compareKey];let d=-1;for(let e=0;e<n.length;e++){if(o.has(e))continue;const t=n[e];if("object"!==b(t)||!(s.compareKey in t))continue;const r=t[s.compareKey];if(Ar(f,r,s)){d=e;break}}if(-1!==d){const t=n[d],f=b(u);if(f!==b(t))x(l,a,"","",u,t,i+1,s);else if("object"===f){l.push({level:i+1,type:"equal",text:"{"}),a.push({level:i+1,type:"equal",text:"{"});const n=Array.from(new Set([...Object.keys(u),...Object.keys(t)]));for(const r of n){const n=u[r],o=t[r];if(Array.isArray(n)&&Array.isArray(o)){const[t,r]=e(n,o,"","",i+2,s,[],[]);l=h(l,t),a=h(a,r)}else if(Array.isArray(n)||Array.isArray(o))x(l,a,r,r,n,o,i+2,s);else{const[t,c]=j({[r]:n},{[r]:o},i+2,s,e);l=h(l,t),a=h(a,c)}}l.push({level:i+1,type:"equal",text:"}"}),a.push({level:i+1,type:"equal",text:"}"})}else if("array"===f){const[n,r]=e(u,t,"","",i+1,s,[],[]);l=h(l,n),a=h(a,r)}else Ar(u,t,s)?(l.push({level:i+1,type:"equal",text:y(u,void 0,void 0,s.undefinedBehavior)}),a.push({level:i+1,type:"equal",text:y(t,void 0,void 0,s.undefinedBehavior)})):s.showModifications?(l.push({level:i+1,type:"modify",text:y(u,void 0,void 0,s.undefinedBehavior)}),a.push({level:i+1,type:"modify",text:y(t,void 0,void 0,s.undefinedBehavior)})):(l.push({level:i+1,type:"remove",text:y(u,void 0,void 0,s.undefinedBehavior)}),l.push({level:i+1,type:"equal",text:""}),a.push({level:i+1,type:"equal",text:""}),a.push({level:i+1,type:"add",text:y(t,void 0,void 0,s.undefinedBehavior)}));r.add(c),o.add(d)}}for(let e=0;e<t.length;e++){if(r.has(e))continue;const n=t[e],o=p(n,void 0,1,void 0,s.undefinedBehavior).split("\n");for(let e=0;e<o.length;e++)l.push({level:i+1+(o[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:o[e].replace(/^\s+/,"").replace(/,$/g,"")}),a.push({level:i+1,type:"equal",text:""})}for(let e=0;e<n.length;e++){if(o.has(e))continue;const t=n[e],r=p(t,void 0,1,void 0,s.undefinedBehavior).split("\n");for(let e=0;e<r.length;e++)l.push({level:i+1,type:"equal",text:""}),a.push({level:i+1+(r[e].match(/^\s+/)?.[0]?.length||0),type:"add",text:r[e].replace(/^\s+/,"").replace(/,$/g,"")})}}return qr(l,a,i),[l,a]};function Br(e,t,n,r,o,i,s){let l=[],a=[];const c=Array.from(new Set([...Object.keys(e||{}),...Object.keys(t||{})]));for(const u of c){const c=e?e[u]:void 0,f=t?t[u]:void 0;if(Array.isArray(c)&&Array.isArray(f)&&r.compareKey&&s(c,r.compareKey)&&s(f,r.compareKey)){const[e,t]=i(c,f,"","",n+2,r,[],[]);l=h(l,e),a=h(a,t)}else if(Array.isArray(c)&&Array.isArray(f)){const[e,t]=o(c,f,"","",n+2,r,[],[]);l=h(l,e),a=h(a,t)}else if(Array.isArray(c)||Array.isArray(f))x(l,a,u,u,c,f,n+2,r);else{const[e,t]=j({[u]:c},{[u]:f},n+2,r,o);l=h(l,e),a=h(a,t)}}return[l,a]}const zr=(e,t,n,r,o,i,s=[],l=[])=>{if(e=[...e],t=[...t],Or(s,l,n,r,o),o>=(i.maxDepth||1/0))Nr(s,l,o);else for(;e.length||t.length;){const n=e[0],r=t[0],a=b(n),c=b(r);if(e.length&&t.length){if(a!==c)x(s,l,"","",n,r,o+1,i);else if(i.recursiveEqual&&["object","array"].includes(a)&&Ar(n,r,i))x(s,l,"","",n,r,o+1,i);else if("object"===a){let e,t;s.push({level:o+1,type:"equal",text:"{"}),l.push({level:o+1,type:"equal",text:"{"}),"compare-key"===i.arrayDiffMethod?[e,t]=Br(n,r,o,i,zr,$r,Ir):[e,t]=j(n,r,o+2,i,zr),s=h(s,e),l=h(l,t),s.push({level:o+1,type:"equal",text:"}"}),l.push({level:o+1,type:"equal",text:"}"})}else if("array"===a)if(i.compareKey&&Ir(n,i.compareKey)&&Ir(r,i.compareKey)){const[e,t]=$r(n,r,"","",o+1,i,[],[]);s=h(s,e),l=h(l,t)}else{const[e,t]=zr(n,r,"","",o+1,i,[],[]);s=h(s,e),l=h(l,t)}else 0===m(n,r,{ignoreCase:i.ignoreCase})?(s.push({level:o+1,type:"equal",text:y(n,void 0,void 0,i.undefinedBehavior)}),l.push({level:o+1,type:"equal",text:y(r,void 0,void 0,i.undefinedBehavior)})):i.showModifications?(s.push({level:o+1,type:"modify",text:y(n,void 0,void 0,i.undefinedBehavior)}),l.push({level:o+1,type:"modify",text:y(r,void 0,void 0,i.undefinedBehavior)})):(s.push({level:o+1,type:"remove",text:y(n,void 0,void 0,i.undefinedBehavior)}),s.push({level:o+1,type:"equal",text:""}),l.push({level:o+1,type:"equal",text:""}),l.push({level:o+1,type:"add",text:y(r,void 0,void 0,i.undefinedBehavior)}));e.shift(),t.shift()}else if(e.length){const t=y(n,void 0,!0,i.undefinedBehavior).split("\n");for(let e=0;e<t.length;e++)s.push({level:o+1+(t[e].match(/^\s+/)?.[0]?.length||0),type:"remove",text:t[e].replace(/^\s+/,"").replace(/,$/g,"")}),l.push({level:o+1,type:"equal",text:""});e.shift()}else if(t.length){const e=y(r,void 0,!0,i.undefinedBehavior).split("\n");for(let t=0;t<e.length;t++)s.push({level:o+1,type:"equal",text:""}),l.push({level:o+1+(e[t].match(/^\s+/)?.[0]?.length||0),type:"add",text:e[t].replace(/^\s+/,"").replace(/,$/g,"")});t.shift()}}return qr(s,l,o),[s,l]},Dr=(e,t)=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){const n=[...e];return n.sort(((e,n)=>m(e,n,{ignoreCase:t?.ignoreCase}))),n.map((e=>Dr(e,t)))}const n={...e};for(const e in n)n[e]=Dr(n[e],t);return n};var Lr=function(e){return e.stringify="stringify",e.ignore="ignore",e.throw="throw",e}({});const Tr={level:0,type:"equal",text:""},Rr={level:0,type:"equal",text:"{"},Pr={level:0,type:"equal",text:"}"};let Fr=class{detectCircular(e){if(this.options.detectCircular&&d(e))throw new Error(`Circular reference detected in object (with keys ${Object.keys(e).map((e=>`"${e}"`)).join(", ")})`)}sortResultLines(e,t){for(let n=0;n<e.length;n++){let n=!1;for(let r=1;r<e.length;r++)if("remove"===e[r].type&&"equal"===e[r-1].type&&"equal"===t[r].type&&"add"===t[r-1].type){const o=e[r-1];e[r-1]=e[r],e[r]=o;const i=t[r-1];t[r-1]=t[r],t[r]=i,n=!0}if(!n)break}}calculateLineNumbers(e){let t=0;for(const n of e)n.text&&(n.lineNumber=++t)}calculateCommas(e){const t=Array(e.length).fill(0);for(let n=e.length-1;n>0;n--)e[n].text?t[n-1]=n:t[n-1]=t[n];for(let n=0;n<e.length;n++)!e[n].text.endsWith("{")&&!e[n].text.endsWith("[")&&e[n].text&&t[n]&&e[n].level<=e[t[n]].level&&(e[n].comma=!0)}diff(e,t){this.detectCircular(e),this.detectCircular(t),"unorder-normal"!==this.options.arrayDiffMethod&&"unorder-lcs"!==this.options.arrayDiffMethod||(e=Dr(e,this.options),t=Dr(t,this.options)),"ignore"===this.options.undefinedBehavior&&(e=f(e)??null,t=f(t)??null);let n=[],r=[];const o=b(e);if(o!==b(t)){n=p(e,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split("\n").map((e=>({level:e.match(/^\s+/)?.[0]?.length||0,type:"remove",text:e.replace(/^\s+/,"").replace(/,$/g,""),comma:e.endsWith(",")})));r=p(t,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split("\n").map((e=>({level:e.match(/^\s+/)?.[0]?.length||0,type:"add",text:e.replace(/^\s+/,"").replace(/,$/g,""),comma:e.endsWith(",")})));const o=n.length,i=r.length;n=h(n,Array(i).fill(0).map((()=>({...Tr})))),r=h(r,Array(o).fill(0).map((()=>({...Tr}))),!0)}else"object"===o?([n,r]=j(e,t,1,this.options,this.arrayDiffFunc),n.unshift({...Rr}),n.push({...Pr}),r.unshift({...Rr}),r.push({...Pr})):"array"===o?[n,r]=this.arrayDiffFunc(e,t,"","",0,this.options):e!==t?this.options.ignoreCase?"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase()&&(n=[{level:0,type:"equal",text:e}],r=[{level:0,type:"equal",text:t}]):this.options.showModifications?(n=[{level:0,type:"modify",text:p(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],r=[{level:0,type:"modify",text:p(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(n=[{level:0,type:"remove",text:p(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)},{...Tr}],r=[{...Tr},{level:0,type:"add",text:p(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(n=[{level:0,type:"equal",text:p(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],r=[{level:0,type:"equal",text:p(t,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]);return this.sortResultLines(n,r),this.calculateLineNumbers(n),this.calculateLineNumbers(r),this.calculateCommas(n),this.calculateCommas(r),[n,r]}constructor({detectCircular:e=!0,maxDepth:t=1/0,showModifications:n=!0,arrayDiffMethod:r="normal",ignoreCase:o=!1,ignoreCaseForKey:i=!1,recursiveEqual:s=!1,preserveKeyOrder:l,compareKey:a,undefinedBehavior:c="stringify"}={}){this.options={detectCircular:e,maxDepth:t,showModifications:n,arrayDiffMethod:r,ignoreCase:o,ignoreCaseForKey:i,recursiveEqual:s,preserveKeyOrder:l,compareKey:a,undefinedBehavior:c},this.arrayDiffFunc="compare-key"===r?$r:"lcs"===r||"unorder-lcs"===r?Cr:zr}};const Wr=e=>"hasLinesBefore"in e||"hasLinesAfter"in e,Ur=(e,t,n)=>Wr(e)?n:t*(e.end-e.start+1),Kr=(e,t)=>{const n=[];let r,o;if(e.length&&t.length)for(e=[...e],t=[...t],r={...e.shift()},o={...t.shift()};;){if(r.start===o.start){const e=Math.min(r.end,o.end);n.push({...r,...o,end:e}),r.start=o.start=e}else if(r.start<o.start){const e=Math.min(r.end,o.start);n.push({...o,...r,end:e}),r.start=e}else{const e=Math.min(r.start,o.end);n.push({...r,...o,end:e}),o.start=e}if(!e.length||!t.length)break;r.start===r.end&&(r={...e.shift()}),o.start===o.end&&(o={...t.shift()})}return e.length||n.push(...t.map((e=>({...e,token:r.token||"plain"})))),t.length||n.push(...e),n};var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.applyPatch=Hr.calcPatch=Gr=Hr.lcs=Hr.diff=Hr.diff_core=void 0;let Vr=class{[Symbol.iterator](){return this}next(){const{state:e,result:t}=this;if(this.c>1)return t.done=!0,t.value=void 0,t;const n=function(e,t){const{b:n,eq:r,stack_base:o}=e;let{i:i,N:s,j:l,M:a,Z:c,stack_top:u}=e;for(;;)switch(t){case 0:e:for(;s>0&&a>0;){n.fill(0,0,2*c);const e=s-a,t=s+a,f=1&t,h=i+s-1,d=l+a-1,p=(t+f)/2;let v;t:for(let t=0;t<=p;t++){const p=2*Math.max(0,t-a)-t,y=t-2*Math.max(0,t-s);for(let h=p;h<=y;h+=2){const d=n[h-1-c*Math.floor((h-1)/c)],p=n[h+1-c*Math.floor((h+1)/c)],y=h===-t||h!==t&&d<p?p:d+1,g=y-h;let m=y,b=g;for(;m<s&&b<a&&r(i+m,l+b);)m++,b++;if(n[h-c*Math.floor(h/c)]=m,1===f&&(v=e-h)>=1-t&&v<t&&m+n[c+v-c*Math.floor(v/c)]>=s){if(t>1||m!==y){o[u++]=i+m,o[u++]=s-m,o[u++]=l+b,o[u++]=a-b,s=y,a=g,c=2*(Math.min(s,a)+1);continue e}break t}}for(let g=p;g<=y;g+=2){const p=n[c+g-1-c*Math.floor((g-1)/c)],y=n[c+g+1-c*Math.floor((g+1)/c)],m=g===-t||g!==t&&p<y?y:p+1,b=m-g;let x=m,w=b;for(;x<s&&w<a&&r(h-x,d-w);)x++,w++;if(n[c+g-c*Math.floor(g/c)]=x,0===f&&(v=e-g)>=-t&&v<=t&&x+n[v-c*Math.floor(v/c)]>=s){if(t>0||x!==m){o[u++]=i+s-m,o[u++]=m,o[u++]=l+a-b,o[u++]=b,s-=x,a-=w,c=2*(Math.min(s,a)+1);continue e}break t}}}if(s!==a){a>s?(i+=s,l+=s,a-=s,s=0):(i+=a,l+=a,s-=a,a=0);break}}if(s+a!==0)if(e.pxe===i||e.pye===l)e.pxe=i+s,e.pye=l+a;else{const t=e.pxs;if(e.oxs=e.pxs,e.oxe=e.pxe,e.oys=e.pys,e.oye=e.pye,e.pxs=i,e.pxe=i+s,e.pys=l,e.pye=l+a,t>=0)return e.i=i,e.N=s,e.j=l,e.M=a,e.Z=c,e.stack_top=u,1}case 1:if(0===u)return 2;a=o[--u],l=o[--u],s=o[--u],i=o[--u],c=2*(Math.min(s,a)+1),t=0}}(e,this.c);return this.c=n,1===n?(t.value=[e.oxs,e.oxe,e.oys,e.oye],t):e.pxs>=0?(t.value=[e.pxs,e.pxe,e.pys,e.pye],t):(t.done=!0,t.value=void 0,t)}constructor(e){this.state=e,this.c=0,this.result={value:null,done:!1}}};function Jr(e,t,n,r,o){const i=2*(Math.min(t,r)+1),s=t+r,l=new(s<256?Uint8Array:s<65536?Uint16Array:Uint32Array)(2*i);return new Vr({i:e,N:t,j:n,M:r,Z:i,b:l,eq:o,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}function Zr(e,t){let[n,r,o]=[0,e.length,t.length];for(;n<r&&n<o&&e[n]===t[n];)n++;if(n===r&&n===o)return[][Symbol.iterator]();for(;e[--r]===t[--o]&&r>n&&o>n;);return Jr(n,r+1-n,n,o+1-n,((n,r)=>e[n]===t[r]))}Hr.diff_core=Jr,Hr.diff=Zr;let Yr=class{[Symbol.iterator](){return this}next(){const e=this.diff.next();if(e.done){const{i:t,j:n,N:r}=this;return t<r&&(e.done=!1,e.value=[t,n,r-t],this.i=r),e}const t=e.value,n=t[0],r=t[1],o=t[3],{i:i,j:s}=this;return i!==n&&(t.length--,t[0]=i,t[1]=s,t[2]=n-i),this.i=r,this.j=o,e}constructor(e,t){this.diff=e,this.N=t,this.i=0,this.j=0}};var Gr=Hr.lcs=function(e,t){return new Yr(Zr(e,t),e.length)};Hr.calcPatch=function*(e,t){const n=ArrayBuffer.isView(e)?Uint8Array.prototype.subarray:e.slice;for(const r of Zr(e,t))r[2]=n.call(t,r[2],r[3]),yield r},Hr.applyPatch=function*(e,t){let n=0;const r=ArrayBuffer.isView(e)?Uint8Array.prototype.subarray:e.slice;for(const[o,i,s]of t)n<o&&(yield r.call(e,n,o)),s.length>0&&(yield s),n=i;n<e.length&&(yield r.call(e,n))};const Qr=(e,t)=>{const n=[];let r=0;for(const o of e)n.push(r),r+=o.length+t;return n.push(r-t),n},Xr=e=>e.filter((e=>e.end>e.start)),eo=(e,t,n)=>{if(!e)return[{token:"plain",start:n,end:t.length+n}];if("undefined"===t||"Infinity"===t||"-Infinity"===t||"NaN"===t||/^\d+n$/i.test(t)||t.startsWith("Symbol(")||t.startsWith("function")||t.startsWith("("))return[{token:"invalid",start:n,end:t.length+n}];if(!Number.isNaN(Number(t)))return[{token:"number",start:n,end:t.length+n}];if("true"===t||"false"===t)return[{token:"boolean",start:n,end:t.length+n}];if("null"===t)return[{token:"null",start:n,end:t.length+n}];if(t.startsWith('"')){if(t.endsWith(": [")||t.endsWith(": {"))return[{token:"key",start:n,end:t.length-3+n},{token:"punctuation",start:t.length-3,end:t.length-2+n},{token:"plain",start:t.length-2,end:t.length-1+n},{token:"punctuation",start:t.length-1,end:t.length+n}];let r=1;for(;r<t.length&&'"'!==t[r];)"\\"===t[r]&&++r,++r;return r===t.length-1?[{token:"string",start:n,end:t.length+n}]:[{token:"key",start:n,end:r+1+n},{token:"punctuation",start:r+1,end:r+2+n},{token:"plain",start:r+2,end:r+3+n},...eo(e,t.substring(r+3),n+r+3)]}return"{"===t||"}"===t||"["===t||"]"===t?[{token:"punctuation",start:n,end:t.length+n}]:[{token:"plain",start:n,end:t.length+n}]},to={threshold:8,margin:3},no=(e,t,n,r)=>{if(!n||r)return[{start:0,end:e.length,isEqual:!1}];const o=[];for(let n=0;n<e.length;n++)"equal"===e[n].type&&"equal"===t[n].type?o.length&&o[o.length-1].isEqual?o[o.length-1].end++:o.push({start:n,end:n+1,isEqual:!0}):o.length&&!o[o.length-1].isEqual?o[o.length-1].end++:o.push({start:n,end:n+1,isEqual:!1});const i=!0===n?to:{...to,...n},{threshold:s,margin:l}=i;s<2*l+1&&console.warn(`Threshold (${s}) is no more than 2 margins + 1 "expand" line (${l} * 2 + 1), it's not necessary to hide unchanged areas which have less than ${2*l+1} lines.`);const a=[];for(let t=0;t<o.length;t++){const n=o[t];!n.isEqual||n.end-n.start<s||n.end-n.start<=2*l+1?a.push(n):t?t===o.length-1?(a.push({start:n.start,end:n.start+l,isEqual:!0}),a.push({hasLinesBefore:!1,hasLinesAfter:!0,start:n.start+l,end:e.length,isEqual:!0})):(a.push({start:n.start,end:n.start+l,isEqual:!0}),a.push({hasLinesBefore:!0,hasLinesAfter:!0,start:n.start+l,end:n.end-l,isEqual:!0}),a.push({start:n.end-l,end:n.end,isEqual:!0})):(a.push({hasLinesBefore:!0,hasLinesAfter:!1,start:0,end:n.end-l,isEqual:!0}),a.push({start:n.end-l,end:n.end,isEqual:!0}))}return a},ro={noChangeDetected:"No change detected",showLinesBefore:"⭡ Show %d lines before",showLinesAfter:"⭣ Show %d lines after",showAll:"⭥ Show all unchanged lines"},oo=e=>{const[t,r]=e.diff,o=n.useMemo((()=>t.length===r.length&&t.every((e=>"equal"===e.type))&&r.every((e=>"equal"===e.type))),[t,r]),i={...ro,...e.texts},s=e.lineNumbers?`calc(${String(t.length).length}ch + 16px)`:0,l=e.indent??2,a="tab"===l?"\t":" ",c="tab"===l?1:l,u={mode:e.inlineDiffOptions?.mode||"char",wordSeparator:e.inlineDiffOptions?.wordSeparator||""},f=e.hideUnchangedLines??!1,{scrollContainer:h="body",itemHeight:d=18,expandLineHeight:p=26}=e.virtual&&!0!==e.virtual?e.virtual:{},v="body"===h?document.body:document.querySelector(h),y=n.useRef(t),g=n.useRef(r),m=n.useRef(no(t,r,f,o)),b=n.useRef([]),x=n.useRef(0),w=n.useRef(null),[,j]=n.useState({}),_=()=>{if(b.current=[],e.virtual){let e=0;for(const t of m.current)Wr(t)?(b.current.push(e),e+=p):(b.current.push(e),e+=d*(t.end-t.start));x.current=m.current.reduce(((e,t)=>Wr(t)?e+p:e+(t.end-t.start)*d),0)}j({})};n.useEffect((()=>{y.current=t,g.current=r,m.current=no(t,r,f,o),_()}),[f,t,r]),n.useEffect((()=>{if(!e.virtual||!v)return;const t=()=>j({});return v.addEventListener("scroll",t),()=>{v.removeEventListener("scroll",t)}}),[e.virtual,v]);const S=e=>t=>{const n=[...m.current],r=n[e];n[e]={...r,end:Math.max(r.end-t,r.start)},e+1<m.current.length-1&&(n[e+1]={...n[e+1],start:Math.max(r.end-t,r.start)}),m.current=n,_()},E=e=>t=>{const n=[...m.current],r=n[e];n[e]={...r,start:Math.min(r.start+t,r.end)},e>1&&(n[e-1]={...n[e-1],end:Math.min(r.start+t,r.end)}),m.current=n,_()},k=e=>()=>{const t=[...m.current],n=t[e];t[e]={...n,start:n.start,end:n.start},e+1<m.current.length-1?t[e+1]={...t[e+1],start:n.start}:t[e-1]={...t[e-1],end:n.end},m.current=t,_()},A=(e,t=[],r=!1,o=!1)=>n.createElement(n.Fragment,null,t.map(((t,r)=>{const o=e.slice(t.start,t.end);if(!t.type&&!t.token)return o;const i=[t.type?`inline-diff-${t.type}`:"",t.token?`token ${t.token}`:""].filter(Boolean).join(" ");return n.createElement("span",{key:`${r}-${t.type}-${o}`,className:i},o)})),r&&(o?n.createElement("span",{className:"token punctuation"},","):",")),M=(t,r)=>{const o=y.current[t],i=g.current[t],[s,l]=e.highlightInlineDiff&&"modify"===o.type&&"modify"===i.type?((e,t,n)=>{let r=[],o=[],i=0,s=0;if("word"===n.mode){const l=n.wordSeparator||" ",a=e.split(l),c=t.split(l),u=[...Gr(a,c)],f=l.length,h=Qr(a,f),d=Qr(c,f);for(const[e,t,n]of u)e>i&&r.push({type:"remove",start:h[i],end:h[e]}),t>s&&o.push({type:"add",start:d[s],end:d[t]}),i=e+n,s=t+n,r.push({start:h[e],end:h[i]}),o.push({start:d[t],end:d[s]});return e.length>i&&r.push({type:"remove",start:h[i],end:e.length}),t.length>s&&o.push({type:"add",start:d[s],end:t.length}),r=Xr(r),o=Xr(o),[r,o]}const l=Gr(e,t);for(const[e,t,n]of l)e>i&&r.push({type:"remove",start:i,end:e}),t>s&&o.push({type:"add",start:s,end:t}),i=e+n,s=t+n,r.push({start:e,end:i}),o.push({start:t,end:s});return e.length>i&&r.push({type:"remove",start:i,end:e.length}),t.length>s&&o.push({type:"add",start:s,end:t.length}),r=Xr(r),o=Xr(o),[r,o]})(o.text,i.text,u):[[],[]],f=eo(r,o.text,0),h=eo(r,i.text,0),d=Kr(f,s),p=Kr(h,l),v="equal"!==o.type?e.bgColour?.[o.type]??"":"",m="equal"!==i.type?e.bgColour?.[i.type]??"":"";return n.createElement("tr",{key:t},e.lineNumbers&&n.createElement("td",{className:`line-${o.type} line-number`,style:{backgroundColor:v}},o.lineNumber),n.createElement("td",{className:`line-${o.type}`,style:{backgroundColor:v}},n.createElement("pre",null,o.text&&a.repeat(o.level*c),A(o.text,d,o.comma,r))),e.lineNumbers&&n.createElement("td",{className:`line-${i.type} line-number`,style:{backgroundColor:m}},i.lineNumber),n.createElement("td",{className:`line-${i.type}`,style:{backgroundColor:m}},n.createElement("pre",null,i.text&&a.repeat(i.level*c),A(i.text,p,i.comma,r))))},O=(e,t,r,o)=>n.createElement(n.Fragment,null,e&&n.createElement("button",{onClick:()=>S(o)(r)},i.showLinesBefore.replaceAll("%d",String(r))),n.createElement("button",{onClick:()=>k(o)()},i.showAll),t&&n.createElement("button",{onClick:()=>E(o)(r)},i.showLinesAfter.replaceAll("%d",String(r)))),q=(e,t,r,o,i)=>{let{start:s,end:l}=e;if(s=Math.max(s,r),l=Math.min(l,o),s===l)return null;if(!Wr(e))return Array(l-s).fill(0).map(((e,t)=>M(s+t,i)));const{hasLinesBefore:a,hasLinesAfter:c}=e,u="boolean"==typeof f?20:f.expandMoreLinesLimit||20;return[n.createElement("tr",{key:`expand-line-${t}`,className:"expand-line"},n.createElement("td",{colSpan:4,className:`${a?"has-lines-before":""} ${c?"has-lines-after":""}`},"boolean"!=typeof f&&f.expandLineRenderer?f.expandLineRenderer({hasLinesBefore:a,hasLinesAfter:c,onExpandBefore:S(t),onExpandAfter:E(t),onExpandAll:k(t)}):O(a,c,u,t)))]},N=["json-diff-viewer",e.virtual&&"json-diff-viewer-virtual",e.syntaxHighlight&&`json-diff-viewer-theme-${e.syntaxHighlight.theme||"monokai"}`,e.className].filter(Boolean).join(" "),C=!!e.syntaxHighlight;return n.createElement("table",{className:N,style:e.style},n.createElement("colgroup",{className:"measure-line"},e.lineNumbers&&n.createElement("col",{style:{width:s}}),n.createElement("col",null),e.lineNumbers&&n.createElement("col",{style:{width:s}}),n.createElement("col",null)),n.createElement("tbody",{ref:w},(t=>{if(o&&f)return n.createElement("tr",{key:"message-line",className:"message-line"},n.createElement("td",{colSpan:4},i.noChangeDetected));if(!e.virtual)return m.current.map(((e,n)=>q(e,n,0,y.current.length,t)));const r=v?.clientHeight??0,s=v?.scrollTop??0,l=s+r;let a=w.current,c=a?.offsetTop??0;for(;a?.offsetParent&&a?.offsetParent!==v;)a=a.offsetParent,c+=a.offsetTop;if(c>l||c+x.current<s)return n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:`${x.current}px`}}));const u=s-c,h=l-c,[g,j,_,S]=((e,t,n,r,o,i)=>{if(!t.length)return[0,0,0,0];let s=0,l=0,a=0,c=0,u=0,f=e.length-1;for(;;){const r=Math.floor((u+f)/2);if(t[r]+Ur(e[r],o,i)<=n?u=r+1:f=r,u===f){s=u;break}}const h=e[s];for(a=Wr(h)?h.start:h.start+Math.floor((n-t[s])/o),u=0,f=e.length-1;;){const e=Math.floor((u+f+1)/2);if(t[e]>=r?f=e-1:u=e,u===f){l=u;break}}const d=e[l];return c=Wr(d)?d.end:d.start+Math.ceil((r-t[l])/o),[s,a,l,c]})(m.current,b.current,u,h,d,p),[E,k]=((e,t,n,r,o,i,s,l,a)=>{if(!t.length)return[0,0];let c=0,u=0;const f=e[n];c=Wr(f)?t[n]:t[n]+(r-f.start)*s;const h=e[o];return u=Wr(h)?a-t[o]-l:a-t[o]-(i-h.start)*s,[c,u]})(m.current,b.current,g,j,_,S,d,p,x.current),A=m.current.slice(g,_+1);return A.length?n.createElement(n.Fragment,null,n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:E,padding:0}})),A.map(((e,n)=>q(e,n,j,S,t))),n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:k,padding:0}}))):n.createElement("tr",null,n.createElement("td",{colSpan:4,style:{height:`${x.current}px`}}))})(C)))};function io(){return io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},io.apply(null,arguments)}function so(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lo(e,t){return lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lo(e,t)}oo.displayName="Viewer";var ao=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function co(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],o=t[n],!(r===o||ao(r)&&ao(o)))return!1;var r,o;return!0}function uo(e,t){var n;void 0===t&&(t=co);var r,o=[],i=!1;return function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}}var fo="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function ho(e){cancelAnimationFrame(e.id)}var po=-1;function vo(e){if(void 0===e&&(e=!1),-1===po||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),po=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return po}var yo=null;function go(e){if(void 0===e&&(e=!1),null===yo||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?yo="positive-descending":(t.scrollLeft=1,yo=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),yo}return yo}process.env.NODE_ENV;var mo=function(e,t){return e},bo=null,xo=null;function wo(e){var t,n=e.getItemOffset,i=e.getEstimatedTotalSize,s=e.getItemSize,l=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,c=e.getStopIndexForStartIndex,u=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,h=e.validateProps;return t=function(e){var t,o;function d(t){var r;return(r=e.call(this,t)||this)._instanceProps=u(r.props,so(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:so(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=uo((function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})})),r._callOnScroll=void 0,r._callOnScroll=uo((function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})})),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,i=o.direction,l=o.itemSize,a=o.layout,c=r._getItemStyleCache(f&&l,f&&a,f&&i);if(c.hasOwnProperty(e))t=c[e];else{var u=n(r.props,e,r._instanceProps),h=s(r.props,e,r._instanceProps),d="horizontal"===i||"horizontal"===a,p="rtl"===i,v=d?u:0;c[e]=t={position:"absolute",left:p?void 0:v,right:p?v:void 0,top:d?0:u,height:d?"100%":h,width:d?h:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=uo((function(e,t,n){return{}})),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState((function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,s=o;if("rtl"===t)switch(go()){case"negative":s=-o;break;case"positive-descending":s=i-n-o}return s=Math.max(0,Math.min(s,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState((function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,o;null!==r._resetIsScrollingTimeoutId&&ho(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=fo(),o={id:requestAnimationFrame((function r(){fo()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}))})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},(function(){r._getItemStyleCache(-1,null)}))},r}o=e,(t=d).prototype=Object.create(o.prototype),t.prototype.constructor=t,lo(t,o),d.getDerivedStateFromProps=function(e,t){return jo(e,t),h(e),null};var p=d.prototype;return p.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},p.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,o=n.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var a=this._outerRef;s="vertical"===o?a.scrollWidth>a.clientWidth?vo():0:a.scrollHeight>a.clientHeight?vo():0}this.scrollTo(l(this.props,e,t,i,this._instanceProps,s))},p.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},p.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(go()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var s=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-s-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},p.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&ho(this._resetIsScrollingTimeoutId)},p.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,s=e.height,l=e.innerRef,a=e.innerElementType,c=e.innerTagName,u=e.itemCount,f=e.itemData,h=e.itemKey,d=void 0===h?mo:h,p=e.layout,v=e.outerElementType,y=e.outerTagName,g=e.style,m=e.useIsScrolling,b=e.width,x=this.state.isScrolling,w="horizontal"===o||"horizontal"===p,j=w?this._onScrollHorizontal:this._onScrollVertical,_=this._getRangeToRender(),S=_[0],E=_[1],k=[];if(u>0)for(var A=S;A<=E;A++)k.push(r(t,{data:f,key:d(A,f),index:A,isScrolling:m?x:void 0,style:this._getItemStyle(A)}));var M=i(this.props,this._instanceProps);return r(v||y||"div",{className:n,onScroll:j,ref:this._outerRefSetter,style:io({position:"relative",height:s,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},g)},r(a||c||"div",{children:k,ref:l,style:{height:w?"100%":M,pointerEvents:x?"none":void 0,width:w?M:"100%"}}))},p._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"==typeof this.props.onScroll){var i=this.state,s=i.scrollDirection,l=i.scrollOffset,a=i.scrollUpdateWasRequested;this._callOnScroll(s,l,a)}},p._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,s=r.scrollOffset;if(0===t)return[0,0,0,0];var l=a(this.props,s,this._instanceProps),u=c(this.props,l,s,this._instanceProps),f=o&&"backward"!==i?1:Math.max(1,n),h=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,l-f),Math.max(0,Math.min(t-1,u+h)),l,u]},d}(o),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&void 0!==window.WeakSet&&(bo=new WeakSet,xo=new WeakSet);var jo=function(e,t){var n=e.children,r=e.direction,o=e.height,i=e.layout,s=e.innerTagName,l=e.outerTagName,a=e.width,c=t.instance;if("production"!==process.env.NODE_ENV){null==s&&null==l||xo&&!xo.has(c)&&(xo.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var u="horizontal"===r||"horizontal"===i;switch(r){case"horizontal":case"vertical":bo&&!bo.has(c)&&(bo.add(c),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+r+'" was specified.')}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". "'+i+'" was specified.')}if(null==n)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===n?"null":typeof n)+'" was specified.');if(u&&"number"!=typeof a)throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. "'+(null===a?"null":typeof a)+'" was specified.');if(!u&&"number"!=typeof o)throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. "'+(null===o?"null":typeof o)+'" was specified.')}},_o=function(e,t,n){var r=e.itemSize,o=n.itemMetadataMap,i=n.lastMeasuredIndex;if(t>i){var s=0;if(i>=0){var l=o[i];s=l.offset+l.size}for(var a=i+1;a<=t;a++){var c=r(a);o[a]={offset:s,size:c},s+=c}n.lastMeasuredIndex=t}return o[t]},So=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),s=_o(e,i,t).offset;if(s===o)return i;s<o?r=i+1:s>o&&(n=i-1)}return r>0?r-1:0},Eo=function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&_o(e,n,t).offset<r;)n+=i,i*=2;return So(e,t,Math.min(n,o-1),Math.floor(n/2),r)},ko=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,s=0;if(i>=n&&(i=n-1),i>=0){var l=r[i];s=l.offset+l.size}return s+(n-i-1)*o},Ao=wo({getItemOffset:function(e,t,n){return _o(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:ko,getOffsetForIndexAndAlignment:function(e,t,n,r,o,i){var s=e.direction,l=e.height,a=e.layout,c=e.width,u="horizontal"===s||"horizontal"===a?c:l,f=_o(e,t,o),h=ko(e,o),d=Math.max(0,Math.min(h-u,f.offset)),p=Math.max(0,f.offset-u+f.size+i);switch("smart"===n&&(n=r>=p-u&&r<=d+u?"auto":"center"),n){case"start":return d;case"end":return p;case"center":return Math.round(p+(d-p)/2);default:return r>=p&&r<=d?r:r<p?p:d}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?r[o].offset:0)>=n?So(e,t,o,0,n):Eo(e,t,Math.max(0,o),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var o=e.direction,i=e.height,s=e.itemCount,l=e.layout,a=e.width,c="horizontal"===o||"horizontal"===l?a:i,u=_o(e,t,r),f=n+c,h=u.offset+u.size,d=t;d<s-1&&h<f;)d++,h+=_o(e,d,r).size;return d},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){var t=e.itemSize;if("production"!==process.env.NODE_ENV&&"function"!=typeof t)throw Error('An invalid "itemSize" prop has been specified. Value should be a function. "'+(null===t?"null":typeof t)+'" was specified.')}});function Mo(){return e("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.7955 15.8111L21 21M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Oo(e,t="json-diff-viewer-theme-custom"){if(!e){return void document.querySelectorAll(`.${t} span.token.search-match`).forEach((e=>e.classList.remove("search-match")))}const n=e.replaceAll("(","").replaceAll(")",""),r=new RegExp(n,"gi");document.querySelectorAll(`.${t} span.token`).forEach((e=>{const t=e.textContent||"";r.test(t)?e.classList.add("search-match"):e.classList.remove("search-match")}))}function qo(e){return"equal"===e.type&&""!==e.text}function No(e,t,n=3){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Both segments and diff must be arrays");const r=[];return e.forEach(((o,i)=>{if(o.isEqual){if(o.end-o.start<=2*n||o.isExpanded)for(let e=o.start;e<o.end;e++)r.push({...t[e],originalIndex:e});else{if(function(e,t,n){return 0===e||t[e-1].end<n.start&&t[e-1].isEqual}(i,e,o))for(let e=o.start;e<Math.min(o.start+n,o.end);e++)r.push({...t[e],originalIndex:e});o.end-(o.start+n)>n&&r.push({type:"collapsed",segmentIndex:i,originalIndex:r.length,level:0,text:""});for(let e=Math.max(o.end-n,o.start+n);e<o.end;e++)r.push({...t[e],originalIndex:e})}}else for(let e=o.start;e<o.end;e++)r.push({...t[e],originalIndex:e})})),r}const Co=20,Io="#363743",$o="#7B7B7Bcc",Bo=({leftDiff:t,rightDiff:n,height:r,onScroll:o,miniMapWidth:c=20,currentScrollTop:u,searchResults:f=[],currentMatchIndex:h=-1})=>{const d=i(null),p=i(null),v=i(!1),{totalLines:y,viewportHeight:g}=s((()=>{const e=r/Co,o=Math.max(t.length,n.length)||e;return{totalLines:o,viewportHeight:r*(1/(o/e))}}),[r,t.length,n.length,t]),m=l(((e,t,n,r,o)=>{if("collapsed"===t.type)e.fillStyle=Io;else switch(t.type){case"equal":e.fillStyle=Io;break;case"add":e.fillStyle="#4CAF50";break;case"remove":e.fillStyle="#F44336";break;case"modify":e.fillStyle="#FFC107"}e.fillRect(r,n,o,Co)}),[]),b=(e,o)=>{const i=u/(y*Co)*r;(e=>{const o=r/y;if(h>=0&&void 0!==f[h]){const t=f[h]*o,n=Math.max(1,o);e.fillStyle="#ff4500",e.fillRect(0,t,c,n)}t.forEach(((t,n)=>{m(e,t,n*o,0,c/2)})),n.forEach(((t,n)=>{m(e,t,n*o,c/2,c/2)})),f.forEach((t=>{const n=t*o,r=Math.max(1,o);e.fillStyle="#ffd700",e.fillRect(0,n,c,r)}))})(e),e.fillStyle=o,e.fillRect(0,i,c,g)},x=l((()=>{const e=d.current;if(!e)return;const t=e.getContext("2d");t&&(t.clearRect(0,0,e.width,e.height),v.current?b(t,$o):b(t,"#7B7B7B80"))}),[t,n,r,u,f,h,m,g]);a((()=>{x()}),[x]);const w=l((e=>{if(v.current=!0,!p.current)return;const t=p.current.getBoundingClientRect(),n=e.clientY-t.top;if(r<=0||y<=0)return;const i=d.current;if(!i)return;const s=i.getContext("2d");if(!s)return;b(s,"rgba(33, 150, 243, 0.8)");const l=(n-g/2)/r*y*Co;!Number.isNaN(l)&&Number.isFinite(l)&&o(Math.max(0,l))}),[r,y,g,o]),j=l((e=>{if(!p.current)return;const t=p.current.getBoundingClientRect(),n=e.clientY-t.top,i=(n-g/2)/r*y*Co,s=u/(y*Co)*r,l=n>s&&n<s+g,a=d.current;if(x(),a){const e=a.getContext("2d");if(!e)return;l&&b(e,$o)}if(!v.current)return;if(r<=0||y<=0)return;if(Number.isNaN(i)||!Number.isFinite(i))return;if(e.clientY+g/2>t.bottom){const e=(t.bottom-g/2-t.top)/r*y*Co;!Number.isNaN(e)&&Number.isFinite(e)&&o(Math.max(0,e-250))}else o(Math.max(0,i))}),[r,y,g,o]),_=l((()=>{v.current=!1}),[]);return a((()=>(window.addEventListener("mouseup",_),()=>window.removeEventListener("mouseup",_))),[_]),e("div",{ref:p,style:{width:c,height:r,position:"relative",cursor:"pointer"},onMouseDown:w,onMouseMove:j,onMouseLeave:()=>{const e=d.current;if(!e)return;e.getContext("2d")&&(v.current&&(v.current=!1),x())},children:e("canvas",{ref:d,width:c,height:r,style:{width:"100%",height:"100%"}})})};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.diff-viewer-container {\n background-color: #282a36;\n font-size: 12px;\n text-align: left;\n padding-bottom: 12px;\n}\n\n.virtual-json-diff-list-container {\n --sb-track-color: #232e33;\n --sb-thumb-color: #4560f8;\n --sb-size: 6px;\n}\n\n.virtual-json-diff-list-container::-webkit-scrollbar {\n width: var(--sb-size);\n}\n\n.virtual-json-diff-list-container::-webkit-scrollbar-track {\n background: var(--sb-track-color);\n border-radius: 3px;\n}\n\n.virtual-json-diff-list-container::-webkit-scrollbar-thumb {\n background: var(--sb-thumb-color);\n border-radius: 3px;\n}\n\n@supports not selector(::-webkit-scrollbar) {\n .virtual-json-diff-list-container {\n scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);\n }\n}\n\n.diff-viewer-container {\n button {\n border-radius: 4px;\n border: 1px solid transparent;\n font-size: 1em;\n font-weight: 500;\n font-family: inherit;\n color: white;\n background-color: #1a1a1a;\n cursor: pointer;\n transition: border-color 0.25s;\n }\n button:hover {\n border-color: #649dffab;\n }\n button:focus,\n button:focus-visible {\n outline: 4px auto -webkit-focus-ring-color;\n }\n}\n\n.json-diff-header {\n background: #2f323e;\n padding: 10px;\n border-bottom: 1px solid #353846;\n color: #ffffffe5;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,\n "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-header .search-container {\n margin-bottom: 8px;\n width: 100%;\n}\n\n.json-diff-header .json-diff-title-container {\n width: 100%;\n display: flex;\n flex-direction: row;\n}\n\n.json-diff-header .json-diff-title-container div {\n flex: 0.47;\n}\n\n.json-diff-header .search-input-container {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.json-diff-header .search-input-container svg {\n width: 1em;\n height: 1em;\n}\n\n.json-diff-header .search-input-container input {\n border: 1px solid #434343;\n border-radius: 4px;\n padding: 6px;\n width: 100%;\n background: #2f323e;\n color: white;\n}\n\n.json-diff-header .search-results {\n margin-top: 3px;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.json-diff-header .search-results button {\n height: 20px;\n padding: 0 8px;\n line-height: 20px;\n background: #26262600;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n color: white;\n}\n\n.json-diff-viewer-virtual pre {\n overflow-x: auto;\n white-space: pre;\n}\n\n.json-diff-viewer-virtual pre::-webkit-scrollbar {\n display: none;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom {\n background: #282a36;\n color: #f8f8f2;\n width: 100%;\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,\n "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom.has-search tr td pre span.token.search-match {\n background-color: #ffeb3b;\n color: #000;\n padding: 0 2px;\n border-radius: 2px;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .line-number {\n color: #999;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr td {\n max-width: 260px;\n width: 300px !important;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr td pre {\n font-family:\n -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,\n "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n overflow: hidden;\n margin: 0;\n font-size: 12px;\n line-height: 20px;\n white-space: pre-wrap;\n word-break: break-all;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr:hover {\n background: #53535f54;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-add {\n border-left: 1px solid #a5ff99;\n background: rgba(100, 182, 67, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-remove {\n border-left: 1px solid #ffaa99;\n background: rgba(160, 128, 100, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-modify {\n border-left: 1px solid #ecff99;\n background: rgba(182, 180, 67, 0.08);\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr .line-number {\n background: unset;\n padding: 0 4px;\n border-left: 0;\n border-bottom: none;\n vertical-align: unset;\n max-width: 30px;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr.expand-line td {\n text-align: center;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom tr.expand-line button {\n color: #1e616d;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .string {\n color: #e6db74;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .number,\n.json-diff-viewer.json-diff-viewer-theme-custom .boolean,\n.json-diff-viewer.json-diff-viewer-theme-custom .null {\n color: #ae81ff;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .key {\n color: #66d9ef;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .invalid {\n background: #960050;\n color: #fff;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .search-highlight {\n background-color: #ffeb3b;\n padding: 0 2px;\n border-radius: 2px;\n color: #000;\n}\n\n.json-diff-viewer.json-diff-viewer-theme-custom .token .search-highlight {\n background-color: #ffeb3b !important;\n color: #000 !important;\n}\n\n.collapsed-button {\n display: flex;\n background-color: #262626;\n justify-content: center;\n align-items: center;\n}\n\n.collapsed-button button {\n height: 20px;\n color: rgba(255, 255, 255, 0.7);\n padding: 0px 8px;\n line-height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n background: #26262600;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n}\n\n.hide-all-button {\n text-align: right;\n margin-top: 10px;\n}\n\n.hide-all-button button {\n height: 28px;\n padding: 0 8px;\n line-height: 20px;\n background: #26262600;\n color: white;\n border-width: 1px;\n border-color: #434343;\n cursor: pointer;\n}\n');const zo="json-diff-viewer-theme-custom";function Do(e){return e&&"object"==typeof e&&"type"in e&&"collapsed"===e.type}function Lo({index:t,style:n,data:r}){const{onExpand:o,searchTerm:i}=r,s=r.leftDiff[t],l=r.rightDiff[t];if(Do(s))return e("div",{className:"collapsed-button",style:n,children:e("button",{onClick:()=>o(s.segmentIndex),className:"text-blue-500 underline",children:"Show Hidden Lines"})});const a={...s},c={...l};return e("div",{style:n,children:e(oo,{indent:1,className:`${zo} ${i?"has-search":""}`,lineNumbers:!0,diff:[[a],[c]],highlightInlineDiff:!0,inlineDiffOptions:{mode:"word"},syntaxHighlight:{theme:"monokai"}})})}const To=({oldValue:n,newValue:r,height:o,searchTerm:f,leftTitle:h,rightTitle:d,hideSearch:p,onSearchMatch:v,differOptions:y,className:g,miniMapWidth:m})=>{const b=i(null),x=i(void 0),[w,j]=c(0),[_,S]=c([]),[E,k]=c([]),[A,M]=c({term:"",results:[],currentIndex:0}),O=s((()=>new Fr({detectCircular:!0,maxDepth:20,showModifications:!0,arrayDiffMethod:"lcs",preserveKeyOrder:"before",...y})),[y]),q=s((()=>n&&r?O.diff(n,r):[[],[]]),[n,r,O]),[N,C]=q,[I,$]=c([]),[B,z]=c([]);a((()=>{const e=function(e,t=3){if(!Array.isArray(e))throw new TypeError("Diff input must be an array");const n=[];let r=0;if(r<e.length&&qo(e[r])){let o=Math.min(r+t,e.length);for(;o<e.length&&qo(e[o]);)o++;n.push({start:r,end:o,isEqual:!0}),r=o}for(;r<e.length;)if(qo(e[r])){let t=r;for(;t<e.length&&qo(e[t]);)t++;n.push({start:r,end:t,isEqual:!0}),r=t}else{const o=Math.max(0,r-t),i=Math.min(e.length,r+1+t);o<r&&(0===n.length||n[n.length-1].end<=o)&&n.push({start:o,end:r,isEqual:!0}),n.push({start:r,end:r+1,isEqual:!1}),r+1<i&&n.push({start:r+1,end:i,isEqual:!0}),r=i}return n}(N);k(e)}),[N]),a((()=>{const e=No(E,N),t=No(E,C);$(e),z(t)}),[E,N,C]),a((()=>{b.current?.resetAfterIndex(0)}),[I]);const D=l((e=>{M((t=>({...t,term:e}))),x.current&&clearTimeout(x.current),x.current=setTimeout((()=>{const t=function(e,t){if(!e)return[];const n=[],r=new RegExp(e,"gi");return t.forEach(((e,t)=>{"object"==typeof e&&"text"in e&&r.test(e.text)&&n.push(t)})),n}(e,I);M((e=>({...e,results:t,currentIndex:0})))}),300)}),[I]),L=l((e=>{if(0===A.results.length)return;const t="next"===e?(A.currentIndex+1)%A.results.length:(A.currentIndex-1+A.results.length)%A.results.length;M((e=>({...e,currentIndex:t})));const n=A.results[t];b.current?.scrollToItem(n,"center"),v&&v(n)}),[A.results,A.currentIndex,v]);a((()=>{void 0!==f&&D(f)}),[f,D]),a((()=>{Oo(A.term,zo);const e=new MutationObserver((()=>Oo(A.term,zo))),t={childList:!0,subtree:!0},n=document.querySelector(`.${zo}`);n&&e.observe(n,t);const r=document.querySelector(".virtual-json-diff-list-container");if(r){const t=()=>{setTimeout((()=>Oo(A.term,zo)),100)};return r.addEventListener("scroll",t),()=>{e.disconnect(),r.removeEventListener("scroll",t)}}return()=>{e.disconnect()}}),[A.term]);const T=l((e=>{k((t=>{const n=[...t],r=n[e];if(!r||!r.isEqual)return t;const o={...r,isExpanded:!0,originalStart:r.start,originalEnd:r.end,start:r.start,end:r.end};return n[e]=o,n}))}),[]),R=l((()=>{k((e=>e.map((e=>e.isEqual&&e.isExpanded?{...e,isExpanded:!1,start:e.originalStart??e.start,end:e.originalEnd??e.end}:e))))}),[]),P=l((()=>{const e=document.querySelectorAll(".json-diff-viewer pre"),t=[];for(let n=0;n<e.length;n+=2){const r=K(e[n]),o=K(e[n+1]);t.push(Math.max(r,o))}S(t)}),[]);u((()=>(P(),window.addEventListener("resize",P),()=>window.removeEventListener("resize",P))),[P,I]),a((()=>{b.current?.resetAfterIndex(0,!0)}),[_]);const F=l((e=>{if(Do(I[e]))return 20;return 20*(_[e]??1)}),[I,_]),W=s((()=>E.some((e=>e.isEqual&&e.isExpanded))),[E]),U=s((()=>({leftDiff:I,rightDiff:B,onExpand:T,searchTerm:A.term})),[I,B,T,A.term]);function K(e){const t=window.getComputedStyle(e),n=Number.parseFloat(t.lineHeight);let r=n;return Number.isNaN(n)&&(r=1.2*Number.parseFloat(t.fontSize)),Math.round(e.scrollHeight/r)}return t("div",{className:"diff-viewer-container"+(g?` ${g}`:""),children:[t("div",{className:"json-diff-header",children:[!p&&t("div",{className:"search-container",children:[t("div",{className:"search-input-container",children:[e("span",{role:"img","aria-label":"search",children:e(Mo,{})}),e("input",{type:"text",placeholder:"Search in JSON...",value:A.term,onChange:e=>D(e.target.value)})]}),A.results.length>0&&t("div",{className:"search-results",children:[t("span",{children:[A.currentIndex+1," ","of",A.results.length," ","matches"]}),e("button",{onClick:()=>L("prev"),children:"Previous"}),e("button",{onClick:()=>L("next"),children:"Next"})]})]}),t("div",{className:"json-diff-title-container",children:[e("div",{children:e("span",{children:h})}),e("div",{children:e("span",{children:d})})]})]}),t("div",{style:{display:"flex",gap:"8px"},children:[e(Ao,{ref:b,className:"virtual-json-diff-list-container",height:o,itemCount:Math.max(I.length,B.length),itemSize:F,overscanCount:28,width:"100%",itemData:U,onScroll:({scrollOffset:e})=>{j(e)},children:Lo}),e("div",{children:e(Bo,{leftDiff:I,rightDiff:B,height:o,onScroll:e=>{b.current?.scrollTo(e)},currentScrollTop:w,miniMapWidth:m,searchResults:A.results,currentMatchIndex:A.currentIndex})})]}),W&&e("div",{className:"hide-all-button",children:e("button",{onClick:R,children:"Hide All Expanded Lines"})})]})};export{To as VirtualDiffViewer};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|