Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

api-smart-diff

Package Overview
Dependencies
Maintainers
0
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-smart-diff - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

6

dist/api-smart-diff.min.js
/*!
* api-smart-diff v1.0.3
* api-smart-diff v1.0.4
* Copyright (C) 2012-2024 Damir Yusipov
* Date: Sat, 03 Feb 2024 18:59:10 GMT
* Date: Thu, 04 Jul 2024 20:58:47 GMT
*/
var ApiSmartDiff=function(e){"use strict";function t(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const r=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},n=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const a of r.keys()){const r=e.filter((e=>a in e));if(1!==r.length){if("/"!==a.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${a}. Rules should not have same Rule key`);t[a]=(e,t)=>{const s=r.map((r=>"function"==typeof r[a]?r[a](e,t):r[a]));return n(s)}}else t[a]=r[0][a]}return t},a=e=>"object"==typeof e&&null!==e,s=e=>Array.isArray(e),o=(e,o,i={})=>{var l,c;o=s(o)?o:[o];const p=s(i.rules)?n(i.rules):i.rules,u=[{data:e,state:i.state,path:[],keys:[],keyIndex:-1,rules:p}];for(;u.length>0;){const e=u[u.length-1];if(e.keyIndex>=e.keys.length){for(;null===(l=e.hooks)||void 0===l?void 0:l.length;)e.hooks.pop()();u.pop();continue}const n=e.keys[e.keyIndex++],[i,f,d]=u.length>1?[e.data[n],[...e.path,n],r(e.rules,n,[...e.path,n],e.data[n])]:[e.data,e.path,p];let m={value:i,path:f,key:n,state:e.state,rules:d};const g=[];for(const e of o){if(!e||"function"!=typeof e)continue;const r=null!==(c=e(m))&&void 0!==c?c:{},{terminate:n,done:a,exitHook:s}=r,o=t(r,["terminate","done","exitHook"]);if(n)return;if(s&&g.push(s),m=Object.assign(Object.assign({},m),o),a){m=null;break}}if(m&&a(m.value)){const e=s(m.value)?[...m.value.keys()]:Object.keys(m.value);u.push({hooks:g,state:m.state,data:m.value,path:f,keys:e,keyIndex:0,rules:m.rules})}else for(;g.length;)g.pop()()}},i=(e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const s={"#":void 0},i=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:s,node:s})},r.rules?{rules:r.rules}:{}),[l,c]=(()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:s,state:o})=>{if(s=n.length?s:"#",a(t)){if(e.has(t))return o.node[s]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};o.node[s]=n,e.set(t,n)}else o.node[s]=r;return{value:r,state:Object.assign(Object.assign({},o),{node:o.node[s]})}}]})();return o(e,[l,...t,c],i),s["#"]},l=(e,t)=>t in e,c=e=>"object"==typeof e&&null!==e,p=e=>Array.isArray(e),u=e=>!(!Array.isArray(e)||!e.length),f=e=>void 0!==e,d=e=>"string"==typeof e,m=e=>"number"==typeof e||d(e)&&!Number.isNaN(+e),g=e=>"function"==typeof e,y=e=>Array.isArray(e)?"array":null==e?"null":typeof e,h=e=>Object.keys(e),b=(e,t,r)=>(e[t]=r,e),v=(e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r},O=(e,...t)=>{let r=e;for(const e of t){if(Array.isArray(r)&&"number"==typeof+e&&r.length<+e)r=r[+e];else{if(!c(r)||!(e in r))return;r=r[e]}if(void 0===r)return}return r},$=(e,...t)=>{const r=O(e,...t);return"string"==typeof r?r:void 0},j=(e,...t)=>{const r=O(e,...t);return c(r)?r:void 0},x=(e,...t)=>{const r=O(e,...t);return Array.isArray(r)?r:void 0},k=(e,...t)=>{const r=[...e];for(const e of t)for(const t of e)""===t?r.pop():r.push(t);return r},A="$diff",R={add:"add",remove:"remove",replace:"replace",rename:"rename"},S={breaking:"breaking",nonBreaking:"non-breaking",annotation:"annotation",unclassified:"unclassified",deprecated:"deprecated"},{breaking:C,nonBreaking:M,unclassified:P,annotation:I,deprecated:w}=S,q=[M,M,M],E=[C,C,C],T=[C,M,M],_=[M,C,C],N=[P,P,P],B=[I,I,I],D=[w,w,w],H=(e,t)=>{var r,n,a,s;const o=null!==(n=null===(r=t.rules)||void 0===r?void 0:r.$)&&void 0!==n?n:{},i=Object.assign(Object.assign({},e),{type:P});if(o){const r=(Array.isArray(o)?o:N)["rename"===e.action?2:["add","remove","replace"].indexOf(e.action)];try{i.type=g(r)?r(t):r}catch(e){const r=e instanceof Error?e.message:"";console.error(`Classification Rule error for node: ${t.before.path.join(".")}. ${r}`)}}const l=null===(s=(a=t.options).annotateHook)||void 0===s?void 0:s.call(a,i,t);return Object.assign(Object.assign({},i),l?{description:l}:{})},V={added:(e,t,r)=>H({path:e,after:t,action:R.add},r),removed:(e,t,r)=>H({path:e,before:t,action:R.remove},r),replaced:(e,t,r,n)=>H({path:e,before:t,after:r,action:R.replace},n),renamed:(e,t,r,n)=>H({path:e,before:t,after:r,action:R.rename},n)},K=e=>{var t;return Object.assign({action:e.action,type:null!==(t=e.type)&&void 0!==t?t:P},"replace"===e.action||"rename"===e.action?{replaced:e.before}:{})},L=e=>{const t={};for(const r of e){const e=K(r);t["rename"!==r.action?r.path[r.path.length-1]:r.after]=e}return t},F=(e,...t)=>{const r=k(e.path.slice(0,-1),t);if(!r.length)return{path:[],key:"",value:e.root,root:e.root};const n=[...r],a=n.pop(),s=O(e.root,...n),o=s[a];return void 0!==o?{path:r,key:a,value:o,parent:s,root:e.root}:void 0},U=e=>(t,r)=>[e(t,r),e(r,t)],J=(e,t)=>{const r=Math.abs(e.length-t.length),n=Array.from({length:Math.min(e.length,t.length)},((e,t)=>t));return{removed:e.length>t.length?Array.from({length:r},((e,r)=>t.length+r)):[],added:e.length<t.length?Array.from({length:r},((t,r)=>e.length+r)):[],mapped:n.reduce(((e,t)=>(e[t]=t,e)),{})}},W=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t));for(const t of Object.keys(e))n.has(t)?(r.mapped[t]=t,n.delete(t)):r.removed.push(t);return n.forEach((e=>r.added.push(e))),r},G=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t).map((e=>e.toLocaleLowerCase())));for(const t of Object.keys(e)){const e=t.toLocaleLowerCase();n.has(e)?(r.mapped[e]=e,n.delete(e)):r.removed.push(e)}return n.forEach((e=>r.added.push(e))),r},z=(e,t)=>{const{bNode:r,aNode:n,aPath:a,root:s,akey:o,bkey:i,bPath:l,before:c,after:p,rules:u}=e,f=l.length||"#"!==i?[...l,i]:[],d=a.length||"#"!==o?[...a,o]:[];return{before:{key:i,path:f,parent:r,value:c,root:s.before["#"]},after:{key:o,path:d,parent:n,value:p,root:s.after["#"]},rules:u,options:t}},Y=({before:e,after:t,rules:n,options:a},s,o)=>{var i;const l=O(e.value,s),c=O(t.value,o);return{before:{path:[...e.path,s],key:s,value:l,parent:e.value,root:e.root},after:{path:[...t.path,o],key:o,value:c,parent:t.value,root:t.root},rules:null!==(i=r(n,s||o,s?e.path:t.path,s?l:c))&&void 0!==i?i:{},options:a}},Q=(e,t,r)=>(e[t]=r,{done:!0}),X=(e,t,r)=>(e[t]=K(r),r),Z=(e,t,r={},n={})=>{var a,s;const{jsonPath:i=[],source:l=e}=null!==(a=n.before)&&void 0!==a?a:{},{jsonPath:u=[],source:f=t}=null!==(s=n.after)&&void 0!==s?s:{},d={before:{"#":l},after:{"#":f},merged:{}},g=i.slice(0,-1),b=u.slice(0,-1),v=g.length?O(l,...g):d.before,$=b.length?O(f,...b):d.after;if(!c(v)||!c($))throw new Error("");const j=g.length?i[g.length]:"#",x=b.length?u[b.length]:"#",k=v[j],R=$[x];v[j]=e,$[x]=t;const{diffs:S,hook:C}=((e={})=>{const t=[],{arrayMeta:r,metaKey:n=A}=e;return{diffs:t,hook:a=>{var s;const{rules:o={},state:i,value:l,key:u}=a,{transform:f,compare:d,mapping:g,skip:b}=o,{keyMap:v,parentMeta:O,bNode:$,aNode:j,mNode:x}=i,k=null!=u?u:p($)?+Object.keys(v).pop():Object.keys(v).pop(),A=v[k],R=p(x)&&m(k)?k:A;if(b||!(k in v))return Q(x,k,l);const S=i.bPath.length||"#"!==k?[...i.bPath,k]:[],C=i.aPath.length||"#"!==A?[...i.aPath,A]:[],M=[l,j[A]],[P,I]=!p(l)&&f?f.reduce(((e,t)=>t(...e)),M):M;$[k]=P,j[A]=I;const w=z(Object.assign(Object.assign({},i),{before:P,after:I,akey:A,bkey:k,rules:o}),e),q=null==d?void 0:d(w);if(q){const{diffs:e,merged:r,rootMergeMeta:n}=q;return t.push(...e),n&&(O[A]=n),Q(x,R,r)}if(y(P)!==y(I))return t.push(X(O,A,V.replaced(S,P,I,w))),Q(x,R,I);if(c(P)&&c(I)){const e=[],o=p(P)?[]:{};x[R]=o;const i=null!=g?g:p(P)?J:W,{added:l,removed:c,mapped:u}=i(P,I,w),f=p(P)?[]:h(u).filter((e=>e!==u[e]));e.push(...c.map((e=>V.removed([...S,e],P[e],Y(w,e,""))))),e.push(...f.map((e=>V.renamed(S,e,u[e],Y(w,e,u[e]))))),t.push(...e);const d=null!==(s=L(e))&&void 0!==s?s:{},m=()=>{l.forEach((e=>{const r=p(o)?o.length:e,n=V.added([...S,r],I[e],Y(w,"",e));d[r]=K(n),o[r]=I[e],t.push(n)})),Object.keys(d).length&&(p(o)&&!r?O[A]={array:d}:o[n]=d)},y=Object.assign(Object.assign({},a.state),{keyMap:u,aPath:C,bPath:S,bNode:P,aNode:I,parentMeta:d,mNode:o});return{value:P,state:y,exitHook:m}}return P!==I&&t.push(X(O,A,V.replaced(S,P,I,w))),Q(x,R,I)}}})(r),M={aPath:b,bPath:g,mNode:d.merged,bNode:v,aNode:$,keyMap:{[j]:x},parentMeta:{},root:d};return o(e,C,{state:M,rules:r.rules}),v[j]=k,$[x]=R,{diffs:S,merged:d.merged[x],rootMergeMeta:M.parentMeta[x]}},ee=(e,t)=>Object.assign({template:e},t?{params:t}:{}),te=(e,t={})=>{if(!e)return"";const{template:r,params:n}=e;return((e="",r={})=>{var n;let a=((e,r)=>{const n=h(t).filter((t=>t.startsWith(`${e}_`)));let a=e in t?t[e]:void 0,s=1;for(const e of n){const n=e.split("_").slice(1);!n.filter((e=>!f(r[e])||""===r[e])).length&&n.length>=s&&(a=t[e],s=n.length)}return a})(e,r);if(!a)return"";const s={};for(const e of h(r)){const n=r[e];s[e]=c(n)?te(n,t):n}for(const e of[...a.matchAll(/{{(\w+)}}/g)].reverse()){if(!(e[1]in s))continue;const t=null!==(n=e.index)&&void 0!==n?n:0;a=a.substring(0,t)+String(s[e[1]])+a.substring(t+e[0].length)}return a})(r,n)},re=(e,t)=>i(e,(({value:e,key:r})=>{if(!r||d(r)&&r.startsWith("/"))return"function"==typeof e?{value:(...r)=>re(e(...r),t)}:!Array.isArray(e)&&c(e)?{value:t(e)}:void 0})),ne=e=>"$"in e&&Array.isArray(e.$)?Object.assign(Object.assign({},e),{$:se(e.$)}):e,ae=e=>{if("function"==typeof e)return t=>ae(e(t));switch(e){case C:return M;case M:return C;default:return e}},se=([e,t,r,n,a,s])=>[null!=n?n:ae(e),null!=a?a:ae(t),null!=s?s:ae(r)],oe=([e,t,r],n)=>[t=>n(g(e)?e(t):e,t,"add"),e=>n(g(t)?t(e):t,e,"remove"),e=>n(g(r)?r(e):r,e,"replace")];function ie(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function le(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function ce(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const pe=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},ue=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const n of r.keys()){const r=e.filter((e=>n in e));if(1!==r.length){if("/"!==n.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${n}. Rules should not have same Rule key`);t[n]=(e,t)=>{const a=r.map((r=>"function"==typeof r[n]?r[n](e,t):r[n]));return ue(a)}}else t[n]=r[0][n]}return t},fe=e=>"object"==typeof e&&null!==e,de=e=>Array.isArray(e),me=(e,t,r={})=>{var n,a;t=de(t)?t:[t];const s=de(r.rules)?ue(r.rules):r.rules,o=[{data:e,state:r.state,path:[],keys:[],keyIndex:-1,rules:s}];for(;o.length>0;){const e=o[o.length-1];if(e.keyIndex>=e.keys.length){for(;null===(n=e.hooks)||void 0===n?void 0:n.length;)e.hooks.pop()();o.pop();continue}const r=e.keys[e.keyIndex++],[i,l,c]=o.length>1?[e.data[r],[...e.path,r],pe(e.rules,r,[...e.path,r],e.data[r])]:[e.data,e.path,s];let p={value:i,path:l,key:r,state:e.state,rules:c};const u=[];for(const e of t){if(!e||"function"!=typeof e)continue;const t=null!==(a=e(p))&&void 0!==a?a:{},{terminate:r,done:n,exitHook:s}=t,o=ce(t,["terminate","done","exitHook"]);if(r)return;if(s&&u.push(s),p=Object.assign(Object.assign({},p),o),n){p=null;break}}if(p&&fe(p.value)){const e=de(p.value)?[...p.value.keys()]:Object.keys(p.value);o.push({hooks:u,state:p.state,data:p.value,path:l,keys:e,keyIndex:0,rules:p.rules})}else for(;u.length;)u.pop()()}},ge=()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:a,state:s})=>{if(a=n.length?a:"#",fe(t)){if(e.has(t))return s.node[a]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};s.node[a]=n,e.set(t,n)}else s.node[a]=r;return{value:r,state:Object.assign(Object.assign({},s),{node:s.node[a]})}}]};class ye extends Map{add(e,t){const r=this.get(e);return r?r.push(t):this.set(e,[t]),this}}const he=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t))return[...e,...t];if(fe(e)&&fe(t)){const r=Object.assign({},e);for(const e of Object.keys(t))r[e]=he(r[e],t[e]);return r}return t},be=e=>e&&e.$ref&&"string"==typeof e.$ref,ve=e=>e&&e.anyOf&&Array.isArray(e.anyOf),Oe=e=>e&&e.oneOf&&Array.isArray(e.oneOf),$e=(e,t="")=>{const[r=t,n]=e.split("#"),a=n&&"/"!==n?n:"";return{filePath:r,pointer:a,normalized:je(r,a),jsonPath:Ce(a)}},je=(e,t)=>e?`${e}${t?"#"+t:""}`:t?`#${t}`:"#",xe=(e,t,r=[t])=>{if(!fe(e))return;let n=e;const a=Ce(t);for(const t of a)if(Array.isArray(n)&&n.length>+t)n=n[+t];else if(fe(n)&&t in n)n=n[t];else{if(!be(n))return;{const t=$e(n.$ref);n=t.filePath||r.includes(t.pointer)?void 0:xe(e,t.pointer,[...r,t.pointer])}}return n},ke=/\//g,Ae=/~/g,Re=/~1/g,Se=/~0/g,Ce=e=>e.split("/").map((e=>decodeURIComponent(e.replace(Re,"/").replace(Se,"~")))).slice(1),Me=e=>e.length?"/"+e.map((e=>encodeURIComponent(String(e).replace(Ae,"~0").replace(ke,"~1")))).join("/"):"";function Pe(e){const t=e.reduce(((e,t)=>Math.max(e,(e=>{let t=1;for(;e*t%1!=0;)t*=10;return t})(t))),0);return e.reduce(((e,r)=>Math.round(e*t*r*t/Ie(e*t,r*t))/t))}function Ie(e,t){return 0===t?e:Ie(t,e%t)}const we=e=>{if(0===e.length)return[[]];const t=e[0],r=e.slice(1),n=we(r),a=[];for(const e of t)for(const t of n)a.push([e,...t]);return a},qe=e=>{const t={},r=_e(e);for(const[e,n]of Object.entries(r))n.includes(!1)?t[e]=!1:t[e]=n.length>1?{allOf:n}:n[0];return t},Ee=(e,t)=>!!e.reduce(((e,t)=>e&&!0===t),!0)||Ne(e,t),Te=e=>`Merge rule not found for key: ${e}`,_e=e=>{const t={};for(const r of e)for(const e of Object.keys(r))Array.isArray(t[e])?t[e].push(r[e]):t[e]=[r[e]];return t},Ne=(e,t)=>{if(e.includes(!1))return!1;const r={},n=_e(e);"properties"in n&&(n.properties=(e=>{const t=[];for(const r of e){if(!("properties"in r))continue;const n=new Set(Object.keys(r.properties)),a=new ye;for(const t of n.values())for(const s of e)if(!(s==r||s.properties&&t in s.properties))if("patternProperties"in s&&s.patternProperties)for(const e of Object.keys(s.patternProperties))new RegExp(e).test(t)||n.delete(t);else"additionalProperties"in s&&(!1===s.additionalProperties?n.delete(t):"object"==typeof s.additionalProperties&&a.add(t,s.additionalProperties));if(!n.size)continue;const s={};for(const e of n.values())a.has(e)?s[e]={allOf:[r.properties[e],...a.get(e)]}:s[e]=r.properties[e];t.push(s)}return t})(e)),"patternProperties"in n&&(n.patternProperties=(e=>{const t=[];for(const r of e){if(!("patternProperties"in r))continue;const n=new Set(Object.keys(r.patternProperties));for(const t of e)if(t!=r&&"additionalProperties"in t&&!t.additionalProperties)for(const e of n.values())t.patternProperties&&e in t.patternProperties||n.delete(e);if(!n.size)continue;const a={};for(const e of n.values())a[e]=r.patternProperties[e];t.push(a)}return t})(e));for(let[a,s]of Object.entries(n)){if(!s.length)continue;const n=t.mergeRules;let o=`/${a}`in n?n[`/${a}`]:n["/?"];o=o&&!("$"in o)&&"/"in o?o["/"]:o,o="function"==typeof o?o():o;const i=o&&"$"in o?o.$:void 0;if(!i)throw new Error(Te(a));const l=s.length>1?i(s,Object.assign(Object.assign({},t),{allOfItems:e})):s[0];void 0===l?t.mergeError(s):r[a]=l}return Object.keys(r).length?r:void 0},Be=e=>e[e.length-1],De=e=>e.reduce(((e,t)=>e||t),!1),He=e=>Math.min(...e),Ve=e=>Math.max(...e),Ke=e=>e.length>1?e.reduce(((e,t)=>`${e}(?=${t})`),""):e[0],Le=([e,...t])=>t.reduce(((e,t)=>e.filter((e=>t.includes(e)))),e),Fe=([e,...t])=>t.find((t=>!((e,t)=>JSON.stringify(e)==JSON.stringify(t))(t,e)))?void 0:e,Ue=([e,...t])=>t.reduce(((e,t)=>he(e,t)),e),Je=e=>we(e).map((e=>({allOf:e}))),We=e=>({anyOf:e}),Ge=e=>Pe(e),ze=(e,t)=>{const r=e.map((e=>e.map((e=>JSON.stringify(e))))),n=Le(r).map((e=>JSON.parse(e))).sort();return n.length||t.mergeError(e),n},Ye=(e,t)=>{const r=e.map((e=>Array.isArray(e)?e:[e])),n=Le(r);return 1===n.length?n[0]:n.length?n:void 0},Qe=e=>{const t=new Set;for(const r of e)for(const e of r)t.add(e);return Array.from(t).sort()},Xe=(e,t)=>{const r={},n=_e(e);for(const[e,t]of Object.entries(n))if(t.reduce(((e,t)=>e&&Array.isArray(t)),!0))r[e]=Qe(t);else{const n=t.map((e=>Array.isArray(e)?{required:e}:e));r[e]=n.length>1?{allOf:n}:n[0]}return r},Ze=(e,t)=>{if(!e.reduce(((e,t)=>Array.isArray(t)||e),!1))return Ne(e,t);const r=[];let n=1/0,a=0;const s=new ye;for(const e of t.allOfItems)"additionalItems"in e&&e.additionalItems&&"items"in e&&Array.isArray(e.items)&&s.add(e.items.length,e.additionalItems),"items"in e&&(r.push(e.items),Array.isArray(e.items)&&(a=Math.max(a,e.items.length),"additionalItems"in e&&!1===e.additionalItems&&(n=Math.min(n,e.items.length))));const o=Math.min(a,n),i=[...Array(o)].map((()=>({allOf:[]})));for(const e of r)if(Array.isArray(e))for(let t=0;t<o;t++){const r=[];for(let e=0;e<=t;e++)s.has(e)&&r.push(...s.get(e));t<e.length?i[t].allOf.push(r.length?Object.assign(Object.assign({},e[t]),{allOf:r}):e[t]):i[t].allOf.push(!r.length||{allOf:r})}else i.forEach((({allOf:t})=>t.push(e)));return i},et=(e,t)=>{const r=[],n=[];for(const e of t.allOfItems)"items"in e&&!Array.isArray(e.items)&&n.push(e.items),"additionalItems"in e&&"items"in e&&Array.isArray(e.items)&&r.push(e.additionalItems);return n.length&&r.forEach((e=>e.allOf=n)),Ne(r,t)},tt=(e="draft-06",t={})=>Object.assign(Object.assign(Object.assign(Object.assign({"/maximum":{$:He},"/exclusiveMaximum":{$:De},"/minimum":{$:Ve},"/exclusiveMinimum":{$:De},"/maxLength":{$:He},"/minLength":{$:Ve},"/maxItems":{$:He},"/minItems":{$:Ve},"/uniqueItems":{$:De},"/maxProperties":{$:He},"/minProperties":{$:Ve},"/required":{$:Qe},"/multipleOf":{$:Ge},"/enum":{$:ze},"/type":{$:Ye},"/allOf":{"/*":()=>tt(e,t),$:Je},"/not":{$:We},"/oneOf":{"/*":()=>tt(e,t),$:Je,sibling:["definitions","$defs","$id","$schema"]},"/anyOf":{"/*":()=>tt(e,t),$:Je,sibling:["definitions","$defs","$id","$schema"]},"/properties":{"/*":()=>tt(e,t),$:qe},"/items":()=>Object.assign(Object.assign({},tt(e,t)),{$:Ze,"/*":({key:r})=>"number"==typeof r?tt(e,t):{}}),"/additionalProperties":()=>Object.assign(Object.assign({},tt(e,t)),{$:Ee}),"/additionalItems":()=>Object.assign(Object.assign({},tt(e,t)),{$:et}),"/patternProperties":{"/*":()=>tt(e,t),$:qe},"/pattern":{$:Ke},"/readOnly":{$:De},"/writeOnly":{$:De},"/example":{$:Ue},"/examples":{$:Ue},"/deprecated":{$:De}},"draft-04"!==e?{"/propertyNames":()=>tt(e,t),"/contains":()=>tt(e,t),"/dependencies":{"/*":()=>tt(e,t),$:Xe},"/const":{$:Fe},"/exclusiveMaximum":{$:He},"/exclusiveMinimum":{$:Ve},"/$defs":{"/*":()=>tt(e,t),$:Ue}}:{}),{"/definitions":{"/*":()=>tt(e,t),$:Ue},"/xml":{$:Ue},"/externalDocs":{$:Be},"/description":{$:Be},"/title":{$:Be},"/format":{$:Be},"/default":{$:Be},"/?":{$:Be}}),t),{$:Ne}),rt=e=>tt(e,{"/discriminator":{$:Ue},"/oneOf":{"/*":()=>rt(e),$:Je,sibling:["discriminator"]},"/anyOf":{"/*":()=>rt(e),$:Je,sibling:["discriminator"]}}),nt=e=>"3.0.x"===e?Object.assign(Object.assign({},rt("draft-04")),{"/items":({key:e})=>Object.assign(Object.assign({},rt("draft-04")),{$:Ze})}):rt("draft-06"),at=e=>({"/*":{"/schema":nt(e)}}),st=e=>({"/content":{"/*":{"/schema":nt(e),"/encoding":{"/headers":at(e)}}}}),ot=e=>({"/*":{"/headers":at(e),"/content":{"/*":{"/schema":nt(e),"/encoding":{"/headers":at(e)}}}}}),it=tt("draft-06",{"/args":()=>it,"/nullable":{$:De},"/specifiedByURL":{$:Be},"/values":{$:Ue,"/*":{$:Ue,"/description":{$:Be},"/deprecated":{$:Be,"/reason":{$:Be}}}},"/interfaces":{$:Ue,"/*":{$:Ue}},"/directives":{$:Ue,"/*":()=>Object.assign(Object.assign({},it),{"/meta":{$:Ue}})}}),lt={"/queries":{"/*":()=>it},"/mutations":{"/*":()=>it},"/subscriptions":{"/*":()=>it},"/components":{"/*":{"/*":it},"/directives":{"/*":{"/args":()=>it}}}},ct=(e,t,r)=>{const n=r.sibling||[],a=e,s=t,o=a[s],i=le(a,["symbol"==typeof s?s:s+""]),l=((e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r})(i,n);return Object.keys(i).length?Object.assign({[t]:o.map((e=>({allOf:[i,e]})))},l):e},pt=(e,t,r,n)=>{const a=[],s=Me(t),o=[],i={pointer:s,data:"",refs:[]};for(const t of e)if(be(t)&&!o.includes(t.$ref)){""===i.data&&(i.data=JSON.stringify(e));const{$ref:s}=t,l=le(t,["$ref"]),{filePath:c,normalized:p,pointer:u}=$e(s),f=n.find((e=>e.refs.includes(t.$ref)&&e.data===i.data&&u!==e.pointer));if(f)return{allOfItems:[{$ref:"#"+f.pointer}],brokenRefs:o};i.refs.push(p);const d=c?void 0:xe(r,u);void 0===d?(o.push(p),a.push(t)):a.push(d),Object.keys(l).length&&a.push(l)}else a.push(t);i.refs.length&&n.push(i);const l=ut(a);return l.find((e=>be(e)&&!o.includes(e.$ref)))?pt(l,t,r,n):{allOfItems:l,brokenRefs:o}},ut=e=>{const t=[];for(const r of e)if(fe(r))if(r.allOf&&Array.isArray(r.allOf)){const{allOf:e}=r,n=le(r,["allOf"]),a=Object.keys(n).length?[...e,n]:e;t.push(...ut(a))}else t.push(r);return t},ft=e=>{if("object"!=typeof e||!e)return tt();if("openapi"in e&&"string"==typeof e.openapi&&/3.+/.test(e.openapi)){return((e="3.0.x")=>({"/paths":{"/*":{"/*":{"/parameters":at(e),"/requestBody":st(e),"/responses":ot(e)},"/parameters":at(e)}},"/components":{"/schemas":{"/*":nt(e)},"/responses":ot(e),"/parameters":at(e),"/requestBodies":{"/*":st(e)},"/headers":at(e)}}))(e.openapi.startsWith("3.1")?"3.1.x":"3.0.x")}return"graphapi"in e&&"string"==typeof e.graphapi?lt:tt()},dt=(e,t)=>{var r;const n=null!==(r=null==t?void 0:t.rules)&&void 0!==r?r:ft(e);return((e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const a={"#":void 0},s=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:a,node:a})},r.rules?{rules:r.rules}:{}),[o,i]=ge();return me(e,[o,...t,i],s),a["#"]})(e,mt(t),{rules:n})},mt=e=>{const t=new Map;let r=null==e?void 0:e.source;const n=[];return({value:a,key:s,path:o,rules:i,state:l})=>{o.length||(null==e?void 0:e.source)||(r=a);const c=r=>{var n;const a=gt(o);a?t.set(...a):null===(n=null==e?void 0:e.onMergeError)||void 0===n||n.call(e,"Could not merge values, they are probably incompatible",o,r)},p=()=>{const{node:e}=l,r=Me(o);if(t.has(r)){const n=t.get(r),o=e[s];Array.isArray(o)&&(o.length<2&&c((null==a?void 0:a.allOf)||[]),o.splice(n,1))}};if(!fe(a)||Array.isArray(a))return{exitHook:p};if(!(e=>!!e&&e["/allOf"]&&"$"in e["/allOf"])(i))return{exitHook:p};const{allOf:u}=a,f=le(a,["allOf"]),d=[];if(Array.isArray(u)&&d.push(...u),d.length)Object.keys(f).length&&d.push(f);else{const{$ref:t}=f,r=le(f,["$ref"]);if((null==e?void 0:e.mergeRefSibling)&&t&&Object.keys(r).length>0)d.push({$ref:t},r);else if(null==e?void 0:e.mergeCombinarySibling){if(ve(f)&&i["/anyOf"])return{value:ct(f,"anyOf",i["/anyOf"]),exitHook:p};if(Oe(f)&&i["/oneOf"])return{value:ct(f,"oneOf",i["/oneOf"]),exitHook:p}}}if(!d.length)return{value:f,exitHook:p};const{allOfItems:m,brokenRefs:g}=pt(d,o,r,n);if(g.length)return g.forEach((t=>{var r;return null===(r=null==e?void 0:e.onRefResolveError)||void 0===r?void 0:r.call(e,"Cannot resolve $ref",o,t)})),{value:{allOf:m},exitHook:p};if(m.length<2)return{value:m.length?m[0]:{},exitHook:p};const y=Ne(m,{allOfItems:m,mergeRules:i,mergeError:c});return(null==e?void 0:e.mergeCombinarySibling)&&ve(y)?{value:ct(y,"anyOf",i["/anyOf"]),exitHook:p}:(null==e?void 0:e.mergeCombinarySibling)&&Oe(y)?{value:ct(y,"oneOf",i["/oneOf"]),exitHook:p}:{value:y,exitHook:p}}},gt=e=>{for(let t=e.length-2;t>=0;t--)if("anyOf"===e[t]||"oneOf"===e[t]){const r=e.slice(0,t+1);return[Me(r),e[t+1]]}},yt=["any","string","number","integer","boolean","null","array","object"],ht=["deprecated","readOnly","writeOnly","externalDocs"],bt=["type","description","title","enum","default","examples","format","const"],vt={any:[],boolean:[],null:[],string:["minLength","maxLength","pattern"],number:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],integer:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],object:["required","minProperties","maxProperties","propertyNames","properties","patternProperties","additionalProperties"],array:["minItems","maxItems","uniqueItems","items","additionalItems"]},Ot={any:[...vt.any,...bt,...ht],boolean:[...vt.boolean,...bt,...ht],null:[...vt.null,...bt,...ht],string:[...vt.string,...bt,...ht],number:[...vt.number,...bt,...ht],integer:[...vt.integer,...bt,...ht],object:[...vt.object,...bt,...ht],array:[...vt.array,...bt,...ht]},$t=["$defs","definitions","$schema","$id"];const jt=(e,t)=>{const{$ref:r}=t;ie(t,["$ref"]);const n=$e(r);return n.filePath?void 0:xe(e,n.pointer)};function xt(e){if("object"!=typeof e||!e)return[];const t=[];for(const r of Object.keys(Ot)){if("integer"===r)continue;const n=vt[r];for(const a of n)if(a in e){t.push(r);break}}return t}const kt=(e,t)=>{if(!c(t))return!1;for(const r of e)if(!t.type||Array.isArray(t.type)&&t.type.includes(r)||t.type===r||"any"===r)return!0;return!1};const At=e=>"/"+e.map((e=>String(e).replace(new RegExp("/","g"),"~1"))).join("/"),Rt=(e,t,r)=>{var n;return!!e&&(!!(null===(n=r[e])||void 0===n?void 0:n.find((e=>t.startsWith(e))))||!!t.startsWith(e))},St=(e,t)=>e===t?e:`${e}:${t}`,Ct=(e,t)=>be(e)?jt(t,e):e,Mt=e=>{var t;return e&&null!==(t=$e(e).normalized)&&void 0!==t?t:""},Pt=(e,t=[],r=[])=>e.map((e=>Object.assign(Object.assign({},e),{path:[...r,...e.path.slice(t.length)]}))),It=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r,t]),s=t,o=a[s],i=ie(a,["symbol"==typeof s?s:s+""]);return Object.keys(n).length?Object.assign(Object.assign({},Array.isArray(o)?{[t]:o.map((e=>({allOf:[e,n]})))}:n),i):e},wt=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"allOf"]),{allOf:a}=n,s=ie(n,["allOf"]);return Object.keys(r).length?Object.assign(Object.assign({},Array.isArray(a)?{allOf:[...a,r]}:r),s):e},qt=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"$ref"]),{$ref:a}=n,s=ie(n,["$ref"]);return Object.keys(r).length?Object.assign({allOf:[{$ref:a},r]},s):e},Et=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r]),s=t;a[s];const o=ie(a,["symbol"==typeof s?s:s+""]);return Object.assign(Object.assign({},o),{[t]:Object.keys(n).length?[n]:[]})},Tt=(e,t="")=>{for(let r=0;r<e.length;r++)"properties"===e[r]&&r<e.length-1?t+=t?"."+String(e[++r]):String(e[++r]):"additionalProperties"===e[r]?t+="{.*}":"patternProperties"===e[r]&&r<e.length-1?t+=`{${String(e[++r])}}`:"items"===e[r]&&(r<e.length-1&&m(e[r+1])?t+=`[${e[++r]}]`:t+="[]");return t||void 0},_t={add:"[Added] {{text}}",add_target:"[Added] {{text}} to `{{target}}`",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from `{{target}}`",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of `{{target}}`",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of `{{target}}`",status:"{{key}} status",validation:"{{key}} validator",annotation:"annotation ({{key}})",enum:"possible values",format:"value format",default:"default value",const:"possible value",type:"type definition",nullable:"possbile nullable value",property:"property `{{key}}`",arratItem:"array item with index `{{key}}`",patternProperty:"property with key pattern `{{key}}`",additionalProperties:"schema for additional properties",arrayItems:"schema for array items",additionalArrayItems:"schema for additional array items",oneOfItem:"oneOf schema",anyOfItem:"anyOf schema",allOfItem:"allOf schema"},Nt=(e,t)=>{var r;const n=null===(r=t.rules)||void 0===r?void 0:r.annotate;return n?te(n(e,t),_t):""},Bt=({action:e,path:t})=>({template:e,params:{text:{template:"annotation",params:{key:t[t.length-1]}},target:Tt(t)}}),Dt=({action:e,path:t})=>(t[t.length-1],ee(e,{text:ee("annotation",{key:"example"}),target:Tt(t)})),Ht=({action:e,path:t})=>{const r=t[t.length-1];return ee(e,{text:ee("validation",{key:r}),target:Tt(t)})},Vt=({path:e},t)=>{const r=e[e.length-1];return t.after.value?ee("add",{text:ee("status",{key:r}),target:Tt(e)}):t.before.value?ee("remove",{text:ee("status",{key:r}),target:Tt(e)}):void 0},Kt=({action:e,path:t})=>{const r=t[t.length-1];if(!m(r))return ee(e,{target:Tt(t),text:ee(r)})},Lt=({action:e,path:t},r)=>{const n=t[t.length-1],{value:a}="add"===e?r.after:r.before,s=t.length>1?t[t.length-2]:"",o=Tt(t.slice(0,-1)),i=Tt(t);switch(s){case"enum":return ee("replace",{text:ee("enum"),target:i});case"properties":return d(n)?ee(e,{text:ee("property",{key:n}),target:o}):void 0;case"items":return m(n)?ee(e,{text:ee("arratItem",{key:n}),target:o}):void 0;case"patternProperties":return d(n)?ee(e,{text:ee("patternProperty",{key:n}),target:o}):void 0;case"oneOf":case"anyOf":case"allOf":return ee(e,{text:ee(`${s}Item`),target:i});case"required":return d(a)?ee(e,{text:ee("status",{key:s}),target:i?`${i}.${a}`:a}):void 0}},Ft=e=>e?C:M,Ut=({after:e})=>Ft(!!e.value),Jt=(e,t)=>{const r=Array.isArray(e)?e:[e];return r.includes("number")&&r.push("integer"),oe(t,((e,{before:t,after:n},a)=>kt(r,"remove"===a?t.parent:n.parent)?e:P))},Wt=[C,M,({before:e,after:t})=>Ft(!m(e.value)||!m(t.value)||e.value>t.value)],Gt=[C,M,({before:e,after:t})=>Ft(!m(e.value)||!m(t.value)||e.value<t.value)],zt=[Ut,M,Ut],Yt=[Ut,M,Ut],Qt=[C,M,({before:e,after:t})=>Ft(!(m(e.value)&&m(t.value)&&!(e.value%t.value)))],Xt=[({after:e})=>{var t;return!d(e.value)||f(null===(t=F(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?M:C},M,({after:e})=>{var t;return!d(e.value)||f(null===(t=F(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?M:C}],Zt=[({after:e})=>{var t,r;return!f(O(e.value,"default"))&&(null===(r=x(null===(t=F(e,"","required"))||void 0===t?void 0:t.value))||void 0===r?void 0:r.includes(e.key))?C:M},M,P,M,({before:e})=>{var t,r;return(null===(r=x(null===(t=F(e,"","required"))||void 0===t?void 0:t.value))||void 0===r?void 0:r.includes(e.key))?C:M},P],er=(e,t)=>{e.before=t(e.before,e.after),e.after=t(e.after,e.before)},tr=(e=$t)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:t,after:r};er(n,(t=>"oneOf"in t?It(t,"oneOf",e):"anyOf"in t?It(t,"anyOf",e):"allOf"in t?wt(t,e):"$ref"in t?qt(t,e):t));for(const t of["oneOf","anyOf"]){if(t in n.before&&!("oneOf"in n.after)&&!("anyOf"in n.after))return[n.before,Et(n.after,t,e)];if(t in n.after&&!("oneOf"in n.before)&&!("anyOf"in n.before))return[Et(n.before,t,e),n.after]}return[n.before,n.after]},rr=(...e)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:Object.assign({},t),after:Object.assign({},r)};return er(n,((t,r)=>{for(const n of e)n in r&&c(r[n])&&!(n in t)&&(t[n]=Array.isArray(r[n])?[]:{});return t})),[n.before,n.after]},nr=(e="2020-12")=>(e,t)=>{if(!c(e)||!c(t))return[e,t];const r={before:Object.assign({},e),after:Object.assign({},t)};return er(r,((e,t)=>{for(const r of["enum","required","properties","patternProperties","definitions","examples"])r in t&&c(t[r])&&!(r in e)&&(e[r]=Array.isArray(t[r])?[]:{});return e})),er(r,((e,t)=>{if("const"in e&&"enum"in t){const{const:t}=e,r=ie(e,["const"]);return Object.assign(Object.assign({},r),{enum:[t]})}return e})),er(r,(e=>(Array.isArray(e.enum)&&(e.enum=e.enum.filter(((e,t,r)=>r.indexOf(e)===t))),e))),er(r,(e=>{if("required"in e&&Array.isArray(e.required)){const t=e.required.filter(((e,t,r)=>d(e)&&r.indexOf(e)===t));return Object.assign(Object.assign({},e),{required:t})}return e})),er(r,((e,t)=>"items"in t&&p(t.items)?"items"in e&&"object"==typeof e.items?p(e.items)?e:Object.assign(Object.assign({},e),{items:t.items.map((()=>e.items)),additionalItems:e.items}):Object.assign(Object.assign({},e),{items:[]}):e)),er(r,((e,t)=>{if(!("type"in e)&&"type"in t){const r=xt(e);r.length&&(e.type=d(t.type)&&r.includes(t.type)?t.type:r)}return e})),er(r,(e=>{if("exclusiveMinimum"in e&&"boolean"==typeof e.exclusiveMinimum&&"minimum"in e){const{minimum:t,exclusiveMinimum:r}=e,n=ie(e,["minimum","exclusiveMinimum"]);return Object.assign(Object.assign({},n),{exclusiveMinimum:t})}return e})),er(r,(e=>{if("exclusiveMaximum"in e&&"boolean"==typeof e.exclusiveMaximum&&"maximum"in e){const{maximum:t,exclusiveMaximum:r}=e,n=ie(e,["maximum","exclusiveMaximum"]);return Object.assign(Object.assign({},n),{exclusiveMaximum:t})}return e})),er(r,((e,t)=>{if("example"in e&&"examples"in t){const{example:t}=e,r=ie(e,["example"]),n="examples"in e&&Array.isArray(e.examples)?e.examples:[];return Object.assign(Object.assign({},r),{examples:[...n,t]})}return e})),[r.before,r.after]},ar=e=>U((t=>dt(t,{rules:tt("draft-04"===e?e:"draft-06"),mergeCombinarySibling:!0,mergeRefSibling:!0}))),sr=(e,t,r)=>{const{added:n,removed:a,mapped:s}=W(e,t),o=a.findIndex((e=>"oneOf"==e||"anyOf"===e)),i=n.findIndex((e=>"oneOf"==e||"anyOf"===e));if(o<0||i<0)return{added:n,removed:a,mapped:s};const[l]=a.splice(o,1),[c]=n.splice(i,1);return s[l]=c,{added:n,removed:a,mapped:s}},or=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys()),s=[];for(let t=0;t<e.length;t++){const o=n.indexOf(e[t]);o<0?s.push(t):(r.mapped[t]=o,a.delete(o))}let o=0;a.forEach((e=>{o<s.length?r.mapped[s[o++]]=e:r.added.push(e)}));for(let e=o;e<s.length;e++)r.removed.push(s[e]);return r},ir=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys());for(let t=0;t<e.length;t++){const s=n.indexOf(e[t]);s<0?r.removed.push(t):(r.mapped[t]=s,a.delete(s))}return a.forEach((e=>{r.added.push(e)})),r},lr=e=>{const{before:t,after:n,options:a}=e,{arrayMeta:s,metaKey:o=A}=a;if(!p(t.value)||!p(n.value)){const r=V.replaced(t.path,t.value,n.value,e);return{diffs:[r],merged:n.value,rootMergeMeta:K(r)}}const i=new Set(n.value.keys()),l=new Set(t.value.keys()),c=[],u=[],f=[],d=r(e.rules,"*",t.path,t.value);for(const e of t.value.keys()){const r=t.value[e];for(const s of n.value.keys()){if(!i.has(s))continue;const o=n.value[s],{diffs:p,merged:f}=Z(r,o,Object.assign(Object.assign({},a),{rules:d}),{before:{jsonPath:[...t.path,e],source:t.root},after:{jsonPath:[...n.path,s],source:n.root}});if(!p.length){i.delete(s),l.delete(e),u[s]=f;break}c.push({before:e,after:s,diffs:p,merged:f})}}c.sort(((e,t)=>e.diffs.length-t.diffs.length));for(const e of c)i.has(e.after)&&l.has(e.before)&&(i.delete(e.after),l.delete(e.before),u[e.before]=e.merged,f.push(...e.diffs));const m=[];for(const r of l.values()){u[r]=t.value[r];const n=V.removed([...t.path,r],t.value[r],Y(e,r,""));m.push(n),f.push(n)}for(const t of i.values()){const r=V.added([...n.path,u.length],n.value[t],Y(e,"",t));u.push(n.value[t]),m.push(r),f.push(r)}const g=L(m);return s&&(u[o]=g),Object.assign({diffs:f,merged:u},!s&&Object.keys(g).length?{rootMergeMeta:{array:g}}:{})},cr=(e={})=>{var t,r,n;e.results=null!==(t=e.results)&&void 0!==t?t:new Map,e.bRefs=null!==(r=e.bRefs)&&void 0!==r?r:{},e.aRefs=null!==(n=e.aRefs)&&void 0!==n?n:{};const{results:a,bRefs:s,aRefs:o}=e;return({before:e,after:t,rules:r,options:n})=>{var i,l;const c=At(e.path),p=At(t.path);let u=St(c,p);if(a.has(u))return a.get(u);const f=be(e.value)?Mt(e.value.$ref):"",d=be(t.value)?Mt(t.value.$ref):"";if(!f&&!d)return;if(Rt(f,`#${c}`,s)||Rt(d,`#${p}`,o))return;if(f&&(s[f]=[...null!==(i=s[f])&&void 0!==i?i:[],`#${c}`]),d&&(o[d]=[...null!==(l=o[d])&&void 0!==l?l:[],`#${p}`]),f&&d&&(u=St(f,d),a.has(u))){const t=a.get(u),{path:r,diffs:n}=t,s=ie(t,["path","diffs"]);return Object.assign(Object.assign({},s),{diffs:Pt(n,r,e.path)})}const m=Ct(e.value,e.root),g=Ct(t.value,t.root);if(void 0===m||void 0===g)return;const y=Z(m,g,Object.assign(Object.assign({},n),{rules:r}),{before:{jsonPath:e.path,source:e.root},after:{jsonPath:t.path,source:t.root}});return f&&d&&a.set(u,Object.assign(Object.assign({},y),{path:e.path})),y}},pr={$:B,annotate:Bt},ur=(e,t)=>({$:e,annotate:t}),fr=({baseRules:e={},notMergeAllOf:t,version:r="draft-04",cache:n={}}={})=>{var a;const s=Object.assign(Object.assign(Object.assign({compare:cr(n),transform:[tr(),nr(r)],mapping:sr,"/title":pr,"/multipleOf":ur(Jt("number",Qt),Ht),"/maximum":ur(Jt("number",Wt),Ht),"/minimum":ur(Jt("number",Gt),Ht)},"draft-04"===r?{"/exclusiveMaximum":ur(Jt("number",zt),Ht),"/exclusiveMinimum":ur(Jt("number",zt),Ht)}:{"/exclusiveMaximum":ur(Jt("number",Wt),Ht),"/exclusiveMinimum":ur(Jt("number",Gt),Ht)}),{"/maxLength":ur(Jt("string",Wt),Ht),"/minLength":ur(Jt("string",Gt),Ht),"/pattern":ur(Jt("string",[C,M,C]),Ht),"/maxItems":ur(Jt("array",Wt),Ht),"/minItems":ur(Jt("array",Gt),Ht),"/uniqueItems":ur(Jt("array",Yt),Ht),"/maxProperties":ur(Jt("object",Wt),Ht),"/minProperties":ur(Jt("object",Gt),Ht),"/required":{mapping:ir,"/*":ur(Xt,Lt)},"/enum":{mapping:or,annotate:Kt,"/*":{$:[M,C,C],annotate:Lt}},"/const":ur([C,M,C],Kt),"/type":{$:[C,M,C],annotate:Kt,"/*":{$:[M,C,C]}},"/not":()=>Object.assign(Object.assign({},re(s,ne)),{$:E}),"/allOf":{compare:lr,"/*":()=>Object.assign(Object.assign({},s),{$:E,annotate:Lt})},"/oneOf":{compare:lr,"/*":()=>Object.assign(Object.assign({},s),{$:[M,C,C],annotate:Lt})},"/anyOf":{compare:lr,"/*":()=>Object.assign(Object.assign({},s),{$:[M,C,C],annotate:Lt})},"/items":({value:e})=>((e,t)=>Array.isArray(e)?{"/*":()=>Object.assign(Object.assign({},t),{$:E,annotate:Lt})}:Object.assign(Object.assign({},t),{$:q,annotate:Kt}))(e,s),"/additionalItems":()=>Object.assign(Object.assign({},s),{$:[M,C,P],annotate:Kt}),"/properties":{"/*":()=>Object.assign(Object.assign({},s),{$:Zt,annotate:Lt})},"/additionalProperties":()=>Object.assign(Object.assign({},s),{$:q,annotate:Kt}),"/patternProperties":{"/*":()=>Object.assign(Object.assign({},s),{$:[C,M,P],annotate:Lt})},"/propertyNames":()=>Object.assign(Object.assign({},s),{$:T,annotate:Ht}),"/description":pr,"/format":{$:[C,M,C],annotate:Kt},"/default":{$:[M,C,C],annotate:Kt},"/definitions":{"/*":()=>Object.assign(Object.assign({},s),{$:q})},"/$defs":{"/*":()=>Object.assign(Object.assign({},s),{$:q})},"/readOnly":{$:Yt,annotate:Vt},"/writeOnly":{$:Yt,annotate:Vt},"/deprecated":{$:D,annotate:Vt},"/examples":{$:B,annotate:Bt,"/*":{$:B,annotate:Dt}},"/**":{annotate:Bt,$:N}}),e);return t?s:Object.assign(Object.assign({},s),{transform:[...null!==(a=s.transform)&&void 0!==a?a:[],ar(r)]})},dr=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:fr({notMergeAllOf:r.notMergeAllOf}),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:Nt});return Z(e,t,o,n)},mr=e=>{const t=e.indexOf("args");return 2===t||t>3&&"properties"===e[t-2]&&"properties"!==e[t-1]||t>2&&"directives"===e[t-2]&&"directives"!==e[t-1]},gr={add:"[Added] {{text}} to Argument `{{target}}`",add_target:"[Added] {{text}} to Argument `{{target}}`",add_target_schema:"[Added] {{text}} to Argument `{{target}}` of property `{{schema}}(...)`",add_target_directive:"[Added] {{text}} to Argument `{{target}}` of directive `@{{directive}}(...)`",remove:"[Removed] {{text}} from Argument {{target}}",remove_target:"[Removed] {{text}} from Argument `{{target}}`",remove_target_schema:"[Removed] {{text}} from Argument `{{target}}` of property `{{schema}}(...)`",remove_target_directive:"[Removed] {{text}} from Argument `{{target}}` of directive `@{{directive}}(...)`",replace:"[Replaced] {{text}} of Argument {{target}}",replace_target:"[Replaced] {{text}} of Argument `{{target}}`",replace_target_schema:"[Replaced] {{text}} of Argument `{{target}}` of property `{{schema}}(...)`",replace_target_directive:"[Replaced] {{text}} of Argument `{{target}}` of directive `@{{directive}}(...)`"},yr=Object.assign(Object.assign({},_t),{directive:"directive `@{{key}}`",directive_definition:"difinition for directive `@{{key}}`",directive_meta:"directive meta `@{{key}}({{meta}})`",values_annotation:"possible values annotation ({{key}})",values_status:"possible values {{key}} status"}),hr=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0]&&"directives"!==e.path[1])return"";if(mr(e.path)){const r=e.path.indexOf("args"),a=Object.assign(Object.assign({},e),{path:e.path.slice(r)}),s=Tt(e.path.slice(0,r)),o="directives"===e.path[1]?e.path[2]:void 0,i=n(a,t);if(!i)return"";const l=Object.assign(Object.assign({},i),{params:Object.assign(Object.assign({},i.params),{schema:s,directive:o})});return te(l,Object.assign(Object.assign({},yr),gr))}return te(n(e,t),yr)},br=({path:e,action:t},r)=>{const n=e[e.length-1],a=Tt(e.slice(0,-4));switch(n){case"description":return ee(t,{text:ee("values_annotation",{key:n}),target:a});case"deprecated":return ee(t,{text:ee("values_status",{key:n}),target:a});case"reason":return ee(t,{text:ee("values_annotation",{key:"deprecation reason"}),target:a})}},vr=({path:e,action:t},r)=>{const n=e[e.length-1],a=e[e.length-2],s=Tt(e);switch(a){case"directives":return ee(t,{text:ee("directive",{key:n,definition:"components"===e[0]?1:void 0}),target:s});case"deprecated":return ee(t,{text:ee("reason",{key:n}),target:s});case"meta":return ee(t,{text:ee("directive",{key:e[e.length-3],meta:n}),target:Tt(e.slice(0,-4))})}},Or={ScalarTypeDefinition:"scalars",ObjectTypeDefinition:"objects",InterfaceTypeDefinition:"interfaces",InputObjectTypeDefinition:"inputObjects",DirectiveDefinition:"directives",UnionTypeDefinition:"unions",EnumTypeDefinition:"enums"},$r={query:"query",mutation:"mutation",subscription:"subscription"},jr=["args","values","interfaces","directives"],xr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values(Or))!(n in e)&&n in t&&(r[n]={});return r})),kr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of jr)if(!(n in e)&&n in t&&(r[n]={}),"values"===n&&n in t){const e=t[n];for(const t of Object.keys(e))t in r[n]||(r[n][t]={})}return"nullable"in e&&!e.nullable&&delete r.nullable,r})),Ar=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;if("meta"in e){const{meta:t}=e;return ie(e,["meta"]),{meta:t}}return"meta"in t?{meta:{}}:{}})),Rr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values($r))!(n in e)&&n in t&&(r[n]={});return r})),Sr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);return!("args"in e)&&"args"in t&&(r.args={type:"object",properties:{}}),!("locations"in e)&&"locations"in t&&(r.locations=[]),r})),Cr=U((e=>dt(e,{rules:lt,mergeCombinarySibling:!0,mergeRefSibling:!0}))),Mr=(e=!1)=>{const t=fr({notMergeAllOf:!0,baseRules:{transform:[tr(),nr(),kr],"/nullable":{$:[M,C,M],annotate:Kt},"/specifiedByURL":{$:B},"/args":()=>Object.assign({},Mr()),"/values":{"/*":{"/description":{annotate:br,$:B},"/deprecated":{annotate:br,$:D,"/reason":{annotate:br,$:D}}}},"/deprecated":{$:D,annotate:Vt,"/reason":{annotate:vr,$:D}},"/interfaces":{"/*":{$:B}},"/directives":{"/*":{annotate:vr,transform:[Ar],"/meta":{"/*":{annotate:vr,$:B}}}}}});return e?re(t,ne):t},Pr=({notMergeAllOf:e=!1}={})=>{const t=Mr(),r=Mr(!0);return{transform:[...e?[]:[Cr],Rr],"/queries":{"/*":r},"/mutations":{"/*":r},"/subscriptions":{"/*":r},"/components":{transform:[xr],"/*":{"/*":r},"/directives":{"/*":{annotate:vr,transform:[Sr],$:_,"/title":{$:B},"/description":{$:B},"/locations":{mapping:or,$:B},"/repeatable":{$:B},"/args":t}}}}},Ir=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:Pr(),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:hr});return Z(e,t,o,n)},wr=(e,t)=>{if(!(c(e)&&c(t)&&"asyncapi"in e&&"asyncapi"in t))return;const r=String(e.asyncapi).charAt(0);return r===String(t.asyncapi).charAt(0)?`${r}.x`:""},qr=()=>{const e=re(fr(),ne),t=fr(),r=cr(),n={$:_,"/location":{$:_},"/description":{$:B}},a={$:N,"/*":{$:N,compare:r,"/*":{$:N},"/query":()=>e,"/headers":()=>t}},s={transform:[rr("tags","traits","bindings","examples")],"/summary":{$:B},"/tags":{$:B},"/externalDocs":{$:B},"/bindings":a},o=Object.assign({$:_,"/*":{$:_},"/operationId":{$:B},"/description":{$:B}},s),i=Object.assign({$:_,"/*":{$:_},"/headers":{$:N},"/correlationId":n,"/schemaFormat":{$:E},"/contentType":{$:_},"/name":{$:q},"/title":{$:q},"/examples":{$:B}},s),l=(r=!1)=>Object.assign({$:E,"/headers":{$:N},"/correlationId":n,"/schemaFormat":{$:E},"/contentType":{$:_},"/name":{$:q},"/title":{$:B},"/description":{$:B},"/examples":{$:B},"/traits":i,"/payload":()=>Object.assign(Object.assign({},r?e:t),{$:E})},s),c=(e=!1)=>Object.assign({$:_,"/operationId":{$:B},"/description":{$:B},"/traits":o,"/message":l(e)},s),p={$:B,"/version":{$:B},"/termsOfService":{$:B},"/license":{$:B,"/name":{$:B},"/url":{$:B}},"/title":{$:B},"/description":{$:B},"/contact":{$:B,"/name":{$:B},"/url":{$:B},"/email":{$:B}}},u={$:B,"/*":{compare:r,transform:[rr("variables","bindings","security")],$:B,"/url":{$:B},"/description":{$:B},"/protocol":{$:B},"/protocolVersion":{$:B},"/variables":{$:B,"/*":{compare:r,$:B,"/enum":{$:B,"/*":{$:B}},"/default":{$:B},"/description":{$:B},"/examples":{$:B}}},"/security":{$:B,"/*":{$:B}},"/bindings":a}},f={compare:r,transform:[rr("parameters","bindings")],$:_,"/description":{$:B},"/bindings":a,"/subscribe":c(!0),"/publish":c(!1),"/parameters":{$:E,"/*":{compare:r,$:_,"/description":{$:B},"/schema":()=>Object.assign(Object.assign({},t),{$:E}),"/location":{$:E}}}};return{transform:[rr("channels","components","tags","servers")],"/asyncapi":{$:B},"/id":{$:B},"/defaultContentType":{$:E},"/info":p,"/servers":u,"/channels":{$:_,"/*":f},"/components":{"/*":{$:B}},"/tags":{$:B},"/externalDocs":{$:B}}},Er=(e,t,r={},n={})=>{var a;const s=wr(e,t);if("2.x"!==s)throw new Error(`Unsupported version: ${s}`);const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:qr()});return Z(e,t,o,n)},Tr=e=>!!Array.isArray(e)&&(!!e&&(0===e.length||1===e.length&&0===Object.keys(e[0]).length)),_r=(e=[],t=[])=>{if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=new Set(e.map((e=>Object.keys(e)[0])));for(const e of t)if(!r.has(Object.keys(e)[0]))return!1;return!0},Nr=({before:e,after:t})=>{if("string"!=typeof e.path[1]||"string"!=typeof t.path[1])return{};const r=[...e.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),n=[...t.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),a={};for(let e=0;e<r.length&&e<n.length;e++)a[r[e]]=n[e];return a},Br=e=>{switch(e){case"query":case"cookie":return"form";case"path":case"header":return"simple"}},Dr=e=>"responses"===e[3]&&"schema"===e[7],Hr=e=>"requestBody"===e[3]&&"schema"===e[6],Vr=e=>"parameters"===e[2]&&"schema"===e[4]||"parameters"===e[3]&&"schema"===e[5],Kr=(e,t)=>{if(!(a(e)&&a(t)&&"openapi"in e&&"openapi"in t))return;return(e.openapi>t.openapi?e.openapi:t.openapi).startsWith("3.1")?"3.1.x":"3.0.x"},Lr=[({after:e})=>"form"===e.value?I:C,({before:e})=>"form"===e.value?I:C,C],Fr=[({after:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?I:C,({before:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?I:C,C],Ur=[M,C,({before:e})=>"path"===O(e.parent,"in")?M:C],Jr=[C,M,e=>O(e.after.parent,"schema","default")?M:Ut(e)],Wr=[C,M,({before:e,after:t})=>{var r;const n=F(e,""),a=null!==(r=O(null==n?void 0:n.value,"style"))&&void 0!==r?r:"form";return"query"===O(null==n?void 0:n.value,"in")&&"form"===a?"object"===e.value||"array"===e.value||"object"===t.value?C:M:C}],Gr=[({after:e})=>O(e.value,"required")&&!f(O(e.value,"schema","default"))?C:M,C,P],zr=[({after:e})=>Tr(e.value)?M:C,M,({after:e,before:t})=>_r(e.value,t.value)||Tr(e.value)?M:C],Yr=[({before:e})=>u(e.parent)?M:C,({after:e})=>u(e.parent)?M:C,({after:e,before:t})=>_r(e.parent,t.parent)||Tr(e.value)?M:C],Qr=[({before:e,after:t})=>Tr(t.value)||_r(t.value,O(e.root,"security"))?M:C,({before:e,after:t})=>_r(O(t.root,"security"),e.value)?M:C,({before:e,after:t})=>_r(t.value,e.value)||Tr(t.value)?M:C],Xr=[({before:e})=>u(e.parent)?M:C,({after:e})=>u(e.parent)?C:M,({before:e,after:t})=>_r(t.parent,e.parent)||Tr(t.value)?M:C],Zr={requestBodySchema:"{{schemaChange}} in Request Body content ({{contentType}})",responseSchema:"{{schemaChange}} in Response {{responseCode}} content ({{contentType}})",parameterSchema:"{{schemaChange}} in {{in}} parameter `{{name}}`",add:"[Added] {{text}}",add_target:"[Added] {{text}} to {{target}}",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from {{target}}",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of {{target}}",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of {{target}}",param:"{{in}} parameter `{{name}}`",param_required:"required {{in}} parameter `{{name}}`",status:"{{key}} status",method:"operation {{method}} {{path}}",annotation:"annotation ({{key}})",security:"some security details",document:"document metadata ({{key}})",requestBody:"Request Body",requestBody_contentType:"Request Body content ({{contentType}})",response:"Response {{responseCode}}",response_contentType:"Response {{responseCode}} content ({{contentType}})",contentType:"Content type",encoding:"Encoding details",encoding_key:"Encoding details ({{key}})"},en=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0])return"";if(Dr(e.path)){const r=te(n(e,t),_t);n=()=>ee("responseSchema",{schemaChange:r,responseCode:e.path[4],contentType:e.path[6]})}else if(Hr(e.path)){const r=te(n(e,t),_t);n=()=>ee("requestBodySchema",{schemaChange:r,contentType:e.path[5]})}else if(Vr(e.path)){const r=te(n(e,t),_t),{root:a}="add"===e.action?t.after:t.before,s=e.path.slice(0,"parameters"===e.path[2]?4:5),o=j(a,...s);n=()=>ee("parameterSchema",Object.assign(Object.assign({},Ct(o,a)),{schemaChange:r}))}return te(n(e,t),Zr)},tn=({action:e,path:t})=>ee(e,{text:ee("method",{path:t[1],method:String(t[2]).toUpperCase()})}),rn=({action:e,path:t})=>ee(e,{text:ee("document",{key:t.join(".")})}),nn=({action:e})=>ee(e,{text:ee("security")}),an=({path:e,action:t})=>{const r=e[e.length-1];return ee(t,"required"===r||"deprecated"===r?{text:ee("status",{key:r}),target:ee("requestBody")}:{text:ee("annotation",{key:r}),target:ee("requestBody")})},sn=({path:e,action:t})=>{const r=e[4],n=e[e.length-1];return ee(t,r===n?{text:ee("response",{responseCode:r})}:{text:ee("annotation",{key:n}),target:ee("response",{responseCode:r})})},on=({path:e,action:t},r)=>{const n=Dr(e)?e[6]:e[5],a=Dr(e)?e[4]:void 0,s=Dr(e)?ee("response",{contentType:n,responseCode:a}):ee("requestBody",{contentType:n}),o=e[e.length-1];return ee(t,n&&n!==o?{text:ee("annotation",{key:o}),target:s}:{text:ee("contentType"),target:s})},ln=({path:e,action:t},r)=>{const n=Dr(e)?e[6]:e[5],a=Dr(e)?e[4]:void 0,s=Dr(e)?ee("response",{contentType:n,responseCode:a}):ee("requestBody",{contentType:n}),o=(Dr(e)?e.slice(8):e.slice(7)).join(".");return ee(t,{text:ee("encoding",{key:o}),target:s})},cn=({path:e,action:t},r)=>{const{key:n}="add"===t?r.after:r.before;if("deprecated"===n)return r.after.value?ee("add",{text:ee("status",{key:n})}):r.before.value?ee("remove",{text:ee("status",{key:n})}):void 0;if("requestBody"===n)return ee(t,{text:ee(n)});if("number"==typeof n){const{value:n}="add"===t?r.after:r.before;return ee(t,{text:ee("annotation",{key:`${e[e.length-2]}: ${n}`})})}return ee(t,{text:ee("annotation",{key:n})})},pn=({action:e},t)=>{const{path:r,root:n,key:a}="add"===e?t.after:t.before,s=r.slice(0,"parameters"===r[2]?4:5),o=j(n,...s),i=Ct(o,n);return ee(e,"required"===a?{text:ee("status",{key:a}),target:ee("param",Object.assign(Object.assign({},i),{requred:!1}))}:"deprecated"===a?{text:ee("status",{key:a}),target:ee("param",i)}:{text:ee("param",i)})},un=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),s=h(t),o=s.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.indexOf(a[e]);t<0?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},fn=(e,t,r)=>{var n;const a={added:[],removed:[],mapped:{}},s=Nr(r),o=new Set(t.keys()),i=e.map((e=>Ct(e,r.before.root))),l=t.map((e=>Ct(e,r.after.root)));for(let e=0;e<i.length;e++){const t=$(i[e],"in"),r=null!==(n=$(i[e],"name"))&&void 0!==n?n:"",c=l.findIndex((e=>{var n;const a=$(e,"in"),o=null!==(n=$(e,"name"))&&void 0!==n?n:"";return t===a&&(r===o||"path"===t&&s[r]===o)}));c<0?a.removed.push(e):(a.mapped[e]=c,o.delete(c))}return o.forEach((e=>a.added.push(e))),a},dn=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),s=h(t),o=s.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.findIndex((t=>{const[r,n]=t.split("/"),[s,o]=a[e].split("/");return(r===s||"*"===r||"*"===s)&&(n===o||"*"===n||"*"===o)}));t<0||!i.has(t)?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},mn=U((e=>{if(!c(e))return e;const t=["get","put","post","delete","options","head","patch","trace"],r=h(e).reduce(((r,n)=>(t.includes(n)||(r[n]=e[n]),r)),{});if(!h(r).length)return e;const n={};for(const a of t){if(!l(e,a)||"object"!=typeof e[a]||!e[a])continue;const t=Object.assign({},e[a]),{parameters:s,servers:o}=r,i=ie(r,["parameters","servers"]);s&&Array.isArray(s)&&("parameters"in t&&Array.isArray(t.parameters)?t.parameters=[...t.parameters,...s]:t.parameters=s),o&&Array.isArray(o)&&("servers"in t&&Array.isArray(t.servers)?t.servers=[...t.servers,...o]:t.servers=o);for(const e of h(i))l(t,e)||(t[e]=i[e]);n[a]=t}return n})),gn=U(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);return!("tags"in e)&&"tags"in t&&(r.tags=[]),"deprecated"in r&&!r.deprecated&&delete r.deprecated,r})),yn=(e,t)=>{if(!c(e)||!c(t))return[e,t];const{added:r,removed:n}=un(e,t);return[r.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},e)),n.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},t))]},hn=U(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);if("in"in e&&!("style"in e)&&"style"in t){const t=Br(e.in);t&&(r.style=t)}return"style"in r&&"explode"in e&&"explode"in t&&"form"===r.style&&(r.explode=!0),"deprecated"in r&&!r.deprecated&&delete r.deprecated,"required"in r&&!r.required&&delete r.required,r})),bn=U(((e,t)=>(c(e)&&c(t),e))),vn=(e={})=>{const t="3.0.x"===e.version?"draft-04":"2020-12",r=fr({baseRules:{transform:[tr([...$t,"discriminator"]),nr(t),bn],"/nullable":{$:Yt,annotate:Kt},"/discriminator":{$:N,annotate:Bt},"/example":{$:B,annotate:Bt},"/externalDocs":{$:B,annotate:Bt,"/*":{$:B}},"/xml":{}},notMergeAllOf:e.notMergeAllOf,version:t});return e.response?re(r,ne):r},On=e=>({$:e,annotate:pn}),$n={$:B,annotate:rn},jn={$:B,annotate:cn},xn=(e={})=>{const t=vn(e),r=vn(Object.assign(Object.assign({},e),{response:!0})),n=cr(),a={$:B,"/**":{$:B},"/*":{"/variables":{"/*":{"/enum":{mapping:or}}}}},s={"/*":{annotate:pn,compare:n,transform:[hn],$:Gr,"/name":On(Ur),"/in":On([M,C,C]),"/schema":()=>Object.assign(Object.assign({},t),{$:E,"/type":Object.assign(Object.assign({},t["/type"]),{$:Wr})}),"/explode":On(Fr),"/style":On(Lr),"/description":On(B),"/required":On(Jr),"/deprecated":On(D)}},o={$:[M,C,C],"/*":{$:[M,C,C],compare:n,"/description":{$:B},"/required":{$:[C,M,Ut]},"/deprecated":{$:D}}},i={annotate:on,$:[M,C,C],mapping:dn,"/*":{annotate:on,"/*":{annotate:on},$:[M,C,M],"/schema":({path:e})=>Object.assign(Object.assign({},Dr(e)?r:t),{$:E}),"/example":{$:B},"/examples":{$:B,compare:n},"/encoding":{annotate:ln,$:[C,M,C],"/*":{"/contentType":{$:[M,C,C]},"/headers":o,"/style":{$:[M,C,C]},"/explode":{$:[M,C,C]},"/allowReserved":{$:[M,C,C]}},"/**":{annotate:ln}}}},l={"/*":{annotate:an},$:[M,C,C],compare:n,"/description":{$:B},"/content":i,"/required":{$:[C,M,Ut]}},c={$:[M,C,C],mapping:G,"/*":{annotate:sn,"/*":{annotate:sn},$:[M,C,C],compare:n,"/description":{$:B},"/headers":o,"/content":i}};return{"/openapi":$n,"/info":Object.assign(Object.assign({},$n),{"/**":$n}),"/servers":a,"/paths":{transform:[yn],mapping:un,"/*":{$:[P,P,M],transform:[mn],compare:n,"/summary":{$:B},"/description":{$:B},"/*":{annotate:tn,$:[M,C,P],transform:[gn],"/*":jn,"/tags":Object.assign(Object.assign({},jn),{mapping:or,"/*":jn}),"/parameters":Object.assign(Object.assign({},s),{$:[M,C,C],mapping:fn}),"/requestBody":l,"/callbacks":{"/*":{compare:n}},"/responses":c,"/deprecated":{$:D},"/security":{"/**":{annotate:nn},$:Qr,"/*":{$:Xr,"/*":{$:_,mapping:or,"/*":{$:_}}}},"/servers":a},"/servers":a,"/parameters":Object.assign(Object.assign({},s),{$:[M,C,C],mapping:fn})}},"/components":{$:q,"/schemas":{$:[M,C,C],"/*":()=>Object.assign(Object.assign({},t),{$:_})},"/responses":{$:[M,C,C],"/*":c},"/parameters":{$:[M,C,C],"/*":s},"/examples":{$:B},"/requestBodies":{$:[M,C,C],"/*":l},"/headers":o,"/securitySchemes":{$:[C,M,C],"/*":{$:[C,M,C],"/type":{$:[C,M,C]},"/description":{$:B},"/name":{$:[C,M,C]},"/in":{$:[C,M,C]},"/scheme":{$:[C,M,C]},"/bearerFormat":{$:B},"/flows":{$:[C,M,C]},"/openIdConnectUrl":{$:B}}}},"/security":{$:zr,"/*":{$:Yr}},"/tags":{$:B},"/externalDocs":{$:B}}},kn=(e,t,r={},n={})=>{var a,s;const{notMergeAllOf:o}=r,i=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:xn({notMergeAllOf:o}),version:Kr(e,t),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:en});return Z(e,t,i,n)},An=e=>c(e)?"openapi"in e&&d(e.openapi)&&/3.+/.test(e.openapi)?kn:"asyncapi"in e&&d(e.asyncapi)&&/2.+/.test(e.asyncapi)?Er:"graphapi"in e&&e.graphapi?Ir:dr:dr;return e.ClassifierType=S,e.DIFF_META_KEY=A,e.DiffAction=R,e.addNonBreaking=_,e.allAnnotation=B,e.allBreaking=E,e.allDeprecated=D,e.allNonBreaking=q,e.allUnclassified=N,e.annotation=I,e.annotationTemplate=ee,e.apiCompare=(e,t,r={})=>An(e)(e,t,r),e.apiDiff=(e,t,r={})=>{const n=An(e),{diffs:a}=n(e,t,r);return a},e.apiMerge=(e,t,r={})=>{const n=An(e),{merged:a}=n(e,t,r);return a},e.arrayMappingResolver=J,e.asyncApi2Rules=qr,e.booleanClassifier=Yt,e.breaking=C,e.breakingIf=Ft,e.breakingIfAfterTrue=Ut,e.buildPath=At,e.caseInsensitiveKeyMappingResolver=G,e.changeDiffsPath=Pt,e.combinaryCompareResolver=lr,e.compare=Z,e.compareAsyncApi=Er,e.compareGraphApi=Ir,e.compareJsonSchema=dr,e.compareOpenApi=kn,e.compareTransformationFactory=U,e.contentChangeAnnotation=on,e.contentMediaTypeMappingResolver=dn,e.convertDiffToMeta=K,e.createAnnotation=te,e.createChildContext=Y,e.createContext=z,e.createDiff=H,e.createEmptyCombiner=Et,e.createFields=rr,e.createMergeMeta=L,e.createRefsCompareResolver=cr,e.deprecated=w,e.diffFactory=V,e.discoverCompareEngine=An,e.documentChangeAnnotation=rn,e.emptySecurity=Tr,e.encodingChangeAnnotation=ln,e.enumMappingResolver=or,e.excludeKeys=v,e.exclusiveClassifier=zt,e.filterObj=(e,t)=>{const r={};for(const n of h(e))t(n,e)&&(r[n]=e[n]);return r},e.getArrayValue=x,e.getAsyncApiVersion=wr,e.getBooleanValue=(e,...t)=>{const r=O(e,...t);return"boolean"==typeof r?r:"string"!=typeof r||"true"!==r&&"false"!==r?void 0:Boolean(r)},e.getCompareId=St,e.getDefaultStyle=Br,e.getKeyValue=O,e.getMaxOpenApiVersion=Kr,e.getNumberValue=(e,...t)=>{const r=O(e,...t);return"number"==typeof r?r:"string"==typeof r&&+r?+r:void 0},e.getObjectValue=j,e.getParentContext=F,e.getRef=Mt,e.getStringValue=$,e.getTarget=Tt,e.globalSecurityClassifyRule=zr,e.globalSecurityItemClassifyRule=Yr,e.graphApiAnnotateHook=hr,e.graphApiComponents=Or,e.graphApiMergeAllOf=Cr,e.graphApiOperations=$r,e.graphApiRules=Pr,e.graphApiSchemaRules=Mr,e.graphSchemaCustomProps=jr,e.includeSecurity=_r,e.inferTypes=xt,e.isAllOfNode=function(e){return e&&e.allOf&&Array.isArray(e.allOf)},e.isArgSchema=mr,e.isArray=p,e.isCycleRef=Rt,e.isExist=f,e.isFunc=g,e.isKey=l,e.isNotEmptyArray=u,e.isNumber=m,e.isObject=c,e.isParameterSchema=Vr,e.isRequestBodySchema=Hr,e.isResponseSchema=Dr,e.isString=d,e.isValidSchemaTypes=kt,e.isValidType=e=>"string"==typeof e&&yt.includes(e),e.joinPath=k,e.jsonSchemaAllowedSibling=$t,e.jsonSchemaAnnotationHook=Nt,e.jsonSchemaAnnotations=_t,e.jsonSchemaCommonProps=bt,e.jsonSchemaDefinitionsPath=["$defs","definitions"],e.jsonSchemaKeyChange=Kt,e.jsonSchemaMappingResolver=sr,e.jsonSchemaMergeAllOf=ar,e.jsonSchemaNodeMetaProps=ht,e.jsonSchemaRules=fr,e.jsonSchemaTypeProps=Ot,e.jsonSchemaTypes=yt,e.jsonSchemaValidators=vt,e.mapPathParams=Nr,e.maxClassifier=Wt,e.mergeAllOfSibling=wt,e.mergeCombinarySibling=It,e.mergeRefSibling=qt,e.minClassifier=Gt,e.multipleOfClassifier=Qt,e.nonBreaking=M,e.objectKeys=h,e.objectMappingResolver=W,e.onlyAddBreaking=T,e.openApi3AnnotateHook=en,e.openApiSchemaRules=vn,e.openapi3Rules=xn,e.operationChangeAnnotation=cn,e.operationSecurityChangeAnnotation=nn,e.operationSecurityClassifyRule=Qr,e.operationSecurityItemClassifyRule=Xr,e.paramClassifyRule=Gr,e.paramMappingResolver=fn,e.paramSchemaTypeClassifyRule=Wr,e.parameterChangeAnnotation=pn,e.parameterExplodeClassifyRule=Fr,e.parameterNameClassifyRule=Ur,e.parameterRequiredClassifyRule=Jr,e.parameterStyleClassifyRule=Lr,e.parentKeyChangeAnnotation=vr,e.pathMappingResolver=un,e.pathMethodChangeAnnotation=tn,e.propertyClassifyRule=Zt,e.requestBodyChangeAnnotation=an,e.requiredItemClassifyRule=Xt,e.requiredMappingResolver=ir,e.resolveRef=Ct,e.resolveRefNode=jt,e.responseChangeAnnotation=sn,e.reverseClassifyRule=se,e.reverseClassifyRuleTransformer=ne,e.schemaAnnotationChange=Bt,e.schemaExampleChange=Dt,e.schemaKeyItemChange=Lt,e.schemaStatusChange=Vt,e.schemaValidationChange=Ht,e.setKeyValue=b,e.transformClassifyRule=oe,e.transformComapreRules=re,e.transformGraphApiComponents=xr,e.transformGraphApiDirective=Sr,e.transformGraphApiDocument=Rr,e.transformGraphSchema=kr,e.transformJsonSchema=nr,e.transformJsonSchemaCombiners=tr,e.transformOpenApiSchema=bn,e.transformOperation=gn,e.transformParameterItem=hn,e.transformPathItems=mn,e.transformPaths=yn,e.transfromGraphSchemaDirective=Ar,e.typeClassifier=Jt,e.typeOf=y,e.unclassified=P,e.unwrapArrayOrNull=function(e){return Array.isArray(e)?e:null},e.unwrapStringOrNull=function(e){return"string"==typeof e?e:null},e.valuesAnnotationChange=br,e.valuesTransformation=er,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var ApiSmartDiff=function(e){"use strict";function t(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const r=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},n=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const a of r.keys()){const r=e.filter((e=>a in e));if(1!==r.length){if("/"!==a.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${a}. Rules should not have same Rule key`);t[a]=(e,t)=>{const s=r.map((r=>"function"==typeof r[a]?r[a](e,t):r[a]));return n(s)}}else t[a]=r[0][a]}return t},a=e=>"object"==typeof e&&null!==e,s=e=>Array.isArray(e),o=(e,o,i={})=>{var l,c;o=s(o)?o:[o];const p=s(i.rules)?n(i.rules):i.rules,u=[{data:e,state:i.state,path:[],keys:[],keyIndex:-1,rules:p}];for(;u.length>0;){const e=u[u.length-1];if(e.keyIndex>=e.keys.length){for(;null===(l=e.hooks)||void 0===l?void 0:l.length;)e.hooks.pop()();u.pop();continue}const n=e.keys[e.keyIndex++],[i,f,d]=u.length>1?[e.data[n],[...e.path,n],r(e.rules,n,[...e.path,n],e.data[n])]:[e.data,e.path,p];let m={value:i,path:f,key:n,state:e.state,rules:d};const g=[];for(const e of o){if(!e||"function"!=typeof e)continue;const r=null!==(c=e(m))&&void 0!==c?c:{},{terminate:n,done:a,exitHook:s}=r,o=t(r,["terminate","done","exitHook"]);if(n)return;if(s&&g.push(s),m=Object.assign(Object.assign({},m),o),a){m=null;break}}if(m&&a(m.value)){const e=s(m.value)?[...m.value.keys()]:Object.keys(m.value);u.push({hooks:g,state:m.state,data:m.value,path:f,keys:e,keyIndex:0,rules:m.rules})}else for(;g.length;)g.pop()()}},i=(e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const s={"#":void 0},i=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:s,node:s})},r.rules?{rules:r.rules}:{}),[l,c]=(()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:s,state:o})=>{if(s=n.length?s:"#",a(t)){if(e.has(t))return o.node[s]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};o.node[s]=n,e.set(t,n)}else o.node[s]=r;return{value:r,state:Object.assign(Object.assign({},o),{node:o.node[s]})}}]})();return o(e,[l,...t,c],i),s["#"]},l=(e,t)=>t in e,c=e=>"object"==typeof e&&null!==e,p=e=>Array.isArray(e),u=e=>!(!Array.isArray(e)||!e.length),f=e=>void 0!==e,d=e=>"string"==typeof e,m=e=>"number"==typeof e||d(e)&&!Number.isNaN(+e),g=e=>"function"==typeof e,y=e=>Array.isArray(e)?"array":null==e?"null":typeof e,h=e=>Object.keys(e),b=(e,t,r)=>(e[t]=r,e),v=(e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r},O=(e,...t)=>{let r=e;for(const e of t){if(Array.isArray(r)&&"number"==typeof+e&&r.length<+e)r=r[+e];else{if(!c(r)||!(e in r))return;r=r[e]}if(void 0===r)return}return r},$=(e,...t)=>{const r=O(e,...t);return"string"==typeof r?r:void 0},j=(e,...t)=>{const r=O(e,...t);return c(r)?r:void 0},x=(e,...t)=>{const r=O(e,...t);return Array.isArray(r)?r:void 0},k=(e,...t)=>{const r=[...e];for(const e of t)for(const t of e)""===t?r.pop():r.push(t);return r},A="$diff",R={add:"add",remove:"remove",replace:"replace",rename:"rename"},S={breaking:"breaking",nonBreaking:"non-breaking",annotation:"annotation",unclassified:"unclassified",deprecated:"deprecated"},{breaking:C,nonBreaking:M,unclassified:P,annotation:I,deprecated:w}=S,q=[M,M,M],E=[C,C,C],T=[C,M,M],_=[M,C,C],N=[P,P,P],B=[I,I,I],D=[w,w,w],H=(e,t)=>{var r,n,a,s;const o=null!==(n=null===(r=t.rules)||void 0===r?void 0:r.$)&&void 0!==n?n:{},i=Object.assign(Object.assign({},e),{type:P});if(o){const r=(Array.isArray(o)?o:N)["rename"===e.action?2:["add","remove","replace"].indexOf(e.action)];try{i.type=g(r)?r(t):r}catch(e){const r=e instanceof Error?e.message:"";console.error(`Classification Rule error for node: ${t.before.path.join(".")}. ${r}`)}}const l=null===(s=(a=t.options).annotateHook)||void 0===s?void 0:s.call(a,i,t);return Object.assign(Object.assign({},i),l?{description:l}:{})},V={added:(e,t,r)=>H({path:e,after:t,action:R.add},r),removed:(e,t,r)=>H({path:e,before:t,action:R.remove},r),replaced:(e,t,r,n)=>H({path:e,before:t,after:r,action:R.replace},n),renamed:(e,t,r,n)=>H({path:e,before:t,after:r,action:R.rename},n)},K=e=>{var t;return Object.assign({action:e.action,type:null!==(t=e.type)&&void 0!==t?t:P},"replace"===e.action||"rename"===e.action?{replaced:e.before}:{})},L=e=>{const t={};for(const r of e){const e=K(r);t["rename"!==r.action?r.path[r.path.length-1]:r.after]=e}return t},F=(e,...t)=>{const r=k(e.path.slice(0,-1),t);if(!r.length)return{path:[],key:"",value:e.root,root:e.root};const n=[...r],a=n.pop(),s=O(e.root,...n),o=s[a];return void 0!==o?{path:r,key:a,value:o,parent:s,root:e.root}:void 0},U=e=>(t,r)=>[e(t,r),e(r,t)],J=(e,t)=>{const r=Math.abs(e.length-t.length),n=Array.from({length:Math.min(e.length,t.length)},((e,t)=>t));return{removed:e.length>t.length?Array.from({length:r},((e,r)=>t.length+r)):[],added:e.length<t.length?Array.from({length:r},((t,r)=>e.length+r)):[],mapped:n.reduce(((e,t)=>(e[t]=t,e)),{})}},W=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t));for(const t of Object.keys(e))n.has(t)?(r.mapped[t]=t,n.delete(t)):r.removed.push(t);return n.forEach((e=>r.added.push(e))),r},G=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=new Set(Object.keys(t).map((e=>e.toLocaleLowerCase())));for(const t of Object.keys(e)){const e=t.toLocaleLowerCase();n.has(e)?(r.mapped[e]=e,n.delete(e)):r.removed.push(e)}return n.forEach((e=>r.added.push(e))),r},z=(e,t)=>{const{bNode:r,aNode:n,aPath:a,root:s,akey:o,bkey:i,bPath:l,before:c,after:p,rules:u}=e,f=l.length||"#"!==i?[...l,i]:[],d=a.length||"#"!==o?[...a,o]:[];return{before:{key:i,path:f,parent:r,value:c,root:s.before["#"]},after:{key:o,path:d,parent:n,value:p,root:s.after["#"]},rules:u,options:t}},Y=({before:e,after:t,rules:n,options:a},s,o)=>{var i;const l=O(e.value,s),c=O(t.value,o);return{before:{path:[...e.path,s],key:s,value:l,parent:e.value,root:e.root},after:{path:[...t.path,o],key:o,value:c,parent:t.value,root:t.root},rules:null!==(i=r(n,s||o,s?e.path:t.path,s?l:c))&&void 0!==i?i:{},options:a}},Q=(e,t,r)=>(e[t]=r,{done:!0}),X=(e,t,r)=>(e[t]=K(r),r),Z=(e,t,r={},n={})=>{var a,s;const{jsonPath:i=[],source:l=e}=null!==(a=n.before)&&void 0!==a?a:{},{jsonPath:u=[],source:f=t}=null!==(s=n.after)&&void 0!==s?s:{},d={before:{"#":l},after:{"#":f},merged:{}},g=i.slice(0,-1),b=u.slice(0,-1),v=g.length?O(l,...g):d.before,$=b.length?O(f,...b):d.after;if(!c(v)||!c($))throw new Error("");const j=g.length?i[g.length]:"#",x=b.length?u[b.length]:"#",k=v[j],R=$[x];v[j]=e,$[x]=t;const{diffs:S,hook:C}=((e={})=>{const t=[],{arrayMeta:r,metaKey:n=A}=e;return{diffs:t,hook:a=>{var s;const{rules:o={},state:i,value:l,key:u}=a,{transform:f,compare:d,mapping:g,skip:b}=o,{keyMap:v,parentMeta:O,bNode:$,aNode:j,mNode:x}=i,k=null!=u?u:p($)?+Object.keys(v).pop():Object.keys(v).pop(),A=v[k],R=p(x)&&m(k)?k:A;if(b||!(k in v))return Q(x,k,l);const S=i.bPath.length||"#"!==k?[...i.bPath,k]:[],C=i.aPath.length||"#"!==A?[...i.aPath,A]:[],M=[l,j[A]],[P,I]=!p(l)&&f?f.reduce(((e,t)=>t(...e)),M):M;$[k]=P,j[A]=I;const w=z(Object.assign(Object.assign({},i),{before:P,after:I,akey:A,bkey:k,rules:o}),e),q=null==d?void 0:d(w);if(q){const{diffs:e,merged:r,rootMergeMeta:n}=q;return t.push(...e),n&&(O[A]=n),Q(x,R,r)}if(y(P)!==y(I))return t.push(X(O,A,V.replaced(S,P,I,w))),Q(x,R,I);if(c(P)&&c(I)){const e=[],o=p(P)?[]:{};x[R]=o;const i=null!=g?g:p(P)?J:W,{added:l,removed:c,mapped:u}=i(P,I,w),f=p(P)?[]:h(u).filter((e=>e!==u[e]));e.push(...c.map((e=>V.removed([...S,e],P[e],Y(w,e,""))))),e.push(...f.map((e=>V.renamed(S,e,u[e],Y(w,e,u[e]))))),t.push(...e);const d=null!==(s=L(e))&&void 0!==s?s:{},m=()=>{l.forEach((e=>{const r=p(o)?o.length:e,n=V.added([...S,r],I[e],Y(w,"",e));d[r]=K(n),o[r]=I[e],t.push(n)})),Object.keys(d).length&&(p(o)&&!r?O[A]={array:d}:o[n]=d)},y=Object.assign(Object.assign({},a.state),{keyMap:u,aPath:C,bPath:S,bNode:P,aNode:I,parentMeta:d,mNode:o});return{value:P,state:y,exitHook:m}}return P!==I&&t.push(X(O,A,V.replaced(S,P,I,w))),Q(x,R,I)}}})(r),M={aPath:b,bPath:g,mNode:d.merged,bNode:v,aNode:$,keyMap:{[j]:x},parentMeta:{},root:d};return o(e,C,{state:M,rules:r.rules}),v[j]=k,$[x]=R,{diffs:S,merged:d.merged[x],rootMergeMeta:M.parentMeta[x]}},ee=(e,t)=>Object.assign({template:e},t?{params:t}:{}),te=(e,t={})=>{if(!e)return"";const{template:r,params:n}=e;return((e="",r={})=>{var n;let a=((e,r)=>{const n=h(t).filter((t=>t.startsWith(`${e}_`)));let a=e in t?t[e]:void 0,s=1;for(const e of n){const n=e.split("_").slice(1);!n.filter((e=>!f(r[e])||""===r[e])).length&&n.length>=s&&(a=t[e],s=n.length)}return a})(e,r);if(!a)return"";const s={};for(const e of h(r)){const n=r[e];s[e]=c(n)?te(n,t):n}for(const e of[...a.matchAll(/{{(\w+)}}/g)].reverse()){if(!(e[1]in s))continue;const t=null!==(n=e.index)&&void 0!==n?n:0;a=a.substring(0,t)+String(s[e[1]])+a.substring(t+e[0].length)}return a})(r,n)},re=(e,t)=>i(e,(({value:e,key:r})=>{if(!r||d(r)&&r.startsWith("/"))return"function"==typeof e?{value:(...r)=>re(e(...r),t)}:!Array.isArray(e)&&c(e)?{value:t(e)}:void 0})),ne=e=>"$"in e&&Array.isArray(e.$)?Object.assign(Object.assign({},e),{$:se(e.$)}):e,ae=e=>{if("function"==typeof e)return t=>ae(e(t));switch(e){case C:return M;case M:return C;default:return e}},se=([e,t,r,n,a,s])=>[null!=n?n:ae(e),null!=a?a:ae(t),null!=s?s:ae(r)],oe=([e,t,r],n)=>[t=>n(g(e)?e(t):e,t,"add"),e=>n(g(t)?t(e):t,e,"remove"),e=>n(g(r)?r(e):r,e,"replace")];function ie(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function le(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function ce(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}const pe=(e={},t,r,n)=>{const a=`/${t}`,s="function"==typeof e["/**"]?e["/**"]({key:t,path:r,value:n}):e["/**"],o="function"==typeof e["/*"]?e["/*"]({key:t,path:r,value:n}):e["/*"];let i={};if(a in e)i=e[a];else if(!s&&!o)return;return i="function"==typeof i?i({key:t,path:r,value:n}):i,o&&(i=Object.assign(Object.assign({},o),i)),s?Object.assign(Object.assign({"/**":e["/**"]},s),i):i},ue=e=>{const t={},r=e.reduce(((e,t)=>(Object.keys(t).forEach((t=>e.add(t))),e)),new Set);for(const n of r.keys()){const r=e.filter((e=>n in e));if(1!==r.length){if("/"!==n.charAt(0))throw new Error(`Cannot merge rules. Duplicate key: ${n}. Rules should not have same Rule key`);t[n]=(e,t)=>{const a=r.map((r=>"function"==typeof r[n]?r[n](e,t):r[n]));return ue(a)}}else t[n]=r[0][n]}return t},fe=e=>"object"==typeof e&&null!==e,de=e=>Array.isArray(e),me=(e,t,r={})=>{var n,a;t=de(t)?t:[t];const s=de(r.rules)?ue(r.rules):r.rules,o=[{data:e,state:r.state,path:[],keys:[],keyIndex:-1,rules:s}];for(;o.length>0;){const e=o[o.length-1];if(e.keyIndex>=e.keys.length){for(;null===(n=e.hooks)||void 0===n?void 0:n.length;)e.hooks.pop()();o.pop();continue}const r=e.keys[e.keyIndex++],[i,l,c]=o.length>1?[e.data[r],[...e.path,r],pe(e.rules,r,[...e.path,r],e.data[r])]:[e.data,e.path,s];let p={value:i,path:l,key:r,state:e.state,rules:c};const u=[];for(const e of t){if(!e||"function"!=typeof e)continue;const t=null!==(a=e(p))&&void 0!==a?a:{},{terminate:r,done:n,exitHook:s}=t,o=ce(t,["terminate","done","exitHook"]);if(r)return;if(s&&u.push(s),p=Object.assign(Object.assign({},p),o),n){p=null;break}}if(p&&fe(p.value)){const e=de(p.value)?[...p.value.keys()]:Object.keys(p.value);o.push({hooks:u,state:p.state,data:p.value,path:l,keys:e,keyIndex:0,rules:p.rules})}else for(;u.length;)u.pop()()}},ge=()=>{const e=new WeakMap;let t;return[({value:e})=>{t=e},({value:r,path:n,key:a,state:s})=>{if(a=n.length?a:"#",fe(t)){if(e.has(t))return s.node[a]=e.get(t),{done:!0};const n=Array.isArray(r)?[]:{};s.node[a]=n,e.set(t,n)}else s.node[a]=r;return{value:r,state:Object.assign(Object.assign({},s),{node:s.node[a]})}}]};class ye extends Map{add(e,t){const r=this.get(e);return r?r.push(t):this.set(e,[t]),this}}const he=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t))return[...e,...t];if(fe(e)&&fe(t)){const r=Object.assign({},e);for(const e of Object.keys(t))r[e]=he(r[e],t[e]);return r}return t},be=e=>e&&e.$ref&&"string"==typeof e.$ref,ve=e=>e&&e.anyOf&&Array.isArray(e.anyOf),Oe=e=>e&&e.oneOf&&Array.isArray(e.oneOf),$e=(e,t="")=>{const[r=t,n]=e.split("#"),a=n&&"/"!==n?n:"";return{filePath:r,pointer:a,normalized:je(r,a),jsonPath:Ce(a)}},je=(e,t)=>e?`${e}${t?"#"+t:""}`:t?`#${t}`:"#",xe=(e,t,r=[t])=>{if(!fe(e))return;let n=e;const a=Ce(t);for(const t of a)if(Array.isArray(n)&&n.length>+t)n=n[+t];else if(fe(n)&&t in n)n=n[t];else{if(!be(n))return;{const t=$e(n.$ref);n=t.filePath||r.includes(t.pointer)?void 0:xe(e,t.pointer,[...r,t.pointer])}}return n},ke=/\//g,Ae=/~/g,Re=/~1/g,Se=/~0/g,Ce=e=>e.split("/").map((e=>decodeURIComponent(e.replace(Re,"/").replace(Se,"~")))).slice(1),Me=e=>e.length?"/"+e.map((e=>encodeURIComponent(String(e).replace(Ae,"~0").replace(ke,"~1")))).join("/"):"";function Pe(e){const t=e.reduce(((e,t)=>Math.max(e,(e=>{let t=1;for(;e*t%1!=0;)t*=10;return t})(t))),0);return e.reduce(((e,r)=>Math.round(e*t*r*t/Ie(e*t,r*t))/t))}function Ie(e,t){return 0===t?e:Ie(t,e%t)}const we=e=>{if(0===e.length)return[[]];const t=e[0],r=e.slice(1),n=we(r),a=[];for(const e of t)for(const t of n)a.push([e,...t]);return a},qe=e=>{const t={},r=_e(e);for(const[e,n]of Object.entries(r))n.includes(!1)?t[e]=!1:t[e]=n.length>1?{allOf:n}:n[0];return t},Ee=(e,t)=>!!e.reduce(((e,t)=>e&&!0===t),!0)||Ne(e,t),Te=e=>`Merge rule not found for key: ${e}`,_e=e=>{const t={};for(const r of e)for(const e of Object.keys(r))Array.isArray(t[e])?t[e].push(r[e]):t[e]=[r[e]];return t},Ne=(e,t)=>{if(e.includes(!1))return!1;const r={},n=_e(e);"properties"in n&&(n.properties=(e=>{const t=[];for(const r of e){if(!("properties"in r))continue;const n=new Set(Object.keys(r.properties)),a=new ye;for(const t of n.values())for(const s of e)if(!(s==r||s.properties&&t in s.properties))if("patternProperties"in s&&s.patternProperties)for(const e of Object.keys(s.patternProperties))new RegExp(e).test(t)||n.delete(t);else"additionalProperties"in s&&(!1===s.additionalProperties?n.delete(t):"object"==typeof s.additionalProperties&&a.add(t,s.additionalProperties));if(!n.size)continue;const s={};for(const e of n.values())a.has(e)?s[e]={allOf:[r.properties[e],...a.get(e)]}:s[e]=r.properties[e];t.push(s)}return t})(e)),"patternProperties"in n&&(n.patternProperties=(e=>{const t=[];for(const r of e){if(!("patternProperties"in r))continue;const n=new Set(Object.keys(r.patternProperties));for(const t of e)if(t!=r&&"additionalProperties"in t&&!t.additionalProperties)for(const e of n.values())t.patternProperties&&e in t.patternProperties||n.delete(e);if(!n.size)continue;const a={};for(const e of n.values())a[e]=r.patternProperties[e];t.push(a)}return t})(e));for(let[a,s]of Object.entries(n)){if(!s.length)continue;const n=t.mergeRules;let o=`/${a}`in n?n[`/${a}`]:n["/?"];o=o&&!("$"in o)&&"/"in o?o["/"]:o,o="function"==typeof o?o():o;const i=o&&"$"in o?o.$:void 0;if(!i)throw new Error(Te(a));const l=s.length>1?i(s,Object.assign(Object.assign({},t),{allOfItems:e})):s[0];void 0===l?t.mergeError(s):r[a]=l}return Object.keys(r).length?r:void 0},Be=e=>e[e.length-1],De=e=>e.reduce(((e,t)=>e||t),!1),He=e=>Math.min(...e),Ve=e=>Math.max(...e),Ke=e=>e.length>1?e.reduce(((e,t)=>`${e}(?=${t})`),""):e[0],Le=([e,...t])=>t.reduce(((e,t)=>e.filter((e=>t.includes(e)))),e),Fe=([e,...t])=>t.find((t=>!((e,t)=>JSON.stringify(e)==JSON.stringify(t))(t,e)))?void 0:e,Ue=([e,...t])=>t.reduce(((e,t)=>he(e,t)),e),Je=e=>we(e).map((e=>({allOf:e}))),We=e=>({anyOf:e}),Ge=e=>Pe(e),ze=(e,t)=>{const r=e.map((e=>e.map((e=>JSON.stringify(e))))),n=Le(r).map((e=>JSON.parse(e))).sort();return n.length||t.mergeError(e),n},Ye=(e,t)=>{const r=e.map((e=>Array.isArray(e)?e:[e])),n=Le(r);return 1===n.length?n[0]:n.length?n:void 0},Qe=e=>{const t=new Set;for(const r of e)for(const e of r)t.add(e);return Array.from(t).sort()},Xe=(e,t)=>{const r={},n=_e(e);for(const[e,t]of Object.entries(n))if(t.reduce(((e,t)=>e&&Array.isArray(t)),!0))r[e]=Qe(t);else{const n=t.map((e=>Array.isArray(e)?{required:e}:e));r[e]=n.length>1?{allOf:n}:n[0]}return r},Ze=(e,t)=>{if(!e.reduce(((e,t)=>Array.isArray(t)||e),!1))return Ne(e,t);const r=[];let n=1/0,a=0;const s=new ye;for(const e of t.allOfItems)"additionalItems"in e&&e.additionalItems&&"items"in e&&Array.isArray(e.items)&&s.add(e.items.length,e.additionalItems),"items"in e&&(r.push(e.items),Array.isArray(e.items)&&(a=Math.max(a,e.items.length),"additionalItems"in e&&!1===e.additionalItems&&(n=Math.min(n,e.items.length))));const o=Math.min(a,n),i=[...Array(o)].map((()=>({allOf:[]})));for(const e of r)if(Array.isArray(e))for(let t=0;t<o;t++){const r=[];for(let e=0;e<=t;e++)s.has(e)&&r.push(...s.get(e));t<e.length?i[t].allOf.push(r.length?Object.assign(Object.assign({},e[t]),{allOf:r}):e[t]):i[t].allOf.push(!r.length||{allOf:r})}else i.forEach((({allOf:t})=>t.push(e)));return i},et=(e,t)=>{const r=[],n=[];for(const e of t.allOfItems)"items"in e&&!Array.isArray(e.items)&&n.push(e.items),"additionalItems"in e&&"items"in e&&Array.isArray(e.items)&&r.push(e.additionalItems);return n.length&&r.forEach((e=>e.allOf=n)),Ne(r,t)},tt=(e="draft-06",t={})=>Object.assign(Object.assign(Object.assign(Object.assign({"/maximum":{$:He},"/exclusiveMaximum":{$:De},"/minimum":{$:Ve},"/exclusiveMinimum":{$:De},"/maxLength":{$:He},"/minLength":{$:Ve},"/maxItems":{$:He},"/minItems":{$:Ve},"/uniqueItems":{$:De},"/maxProperties":{$:He},"/minProperties":{$:Ve},"/required":{$:Qe},"/multipleOf":{$:Ge},"/enum":{$:ze},"/type":{$:Ye},"/allOf":{"/*":()=>tt(e,t),$:Je},"/not":{$:We},"/oneOf":{"/*":()=>tt(e,t),$:Je,sibling:["definitions","$defs","$id","$schema"]},"/anyOf":{"/*":()=>tt(e,t),$:Je,sibling:["definitions","$defs","$id","$schema"]},"/properties":{"/*":()=>tt(e,t),$:qe},"/items":()=>Object.assign(Object.assign({},tt(e,t)),{$:Ze,"/*":({key:r})=>"number"==typeof r?tt(e,t):{}}),"/additionalProperties":()=>Object.assign(Object.assign({},tt(e,t)),{$:Ee}),"/additionalItems":()=>Object.assign(Object.assign({},tt(e,t)),{$:et}),"/patternProperties":{"/*":()=>tt(e,t),$:qe},"/pattern":{$:Ke},"/readOnly":{$:De},"/writeOnly":{$:De},"/example":{$:Ue},"/examples":{$:Ue},"/deprecated":{$:De}},"draft-04"!==e?{"/propertyNames":()=>tt(e,t),"/contains":()=>tt(e,t),"/dependencies":{"/*":()=>tt(e,t),$:Xe},"/const":{$:Fe},"/exclusiveMaximum":{$:He},"/exclusiveMinimum":{$:Ve},"/$defs":{"/*":()=>tt(e,t),$:Ue}}:{}),{"/definitions":{"/*":()=>tt(e,t),$:Ue},"/xml":{$:Ue},"/externalDocs":{$:Be},"/description":{$:Be},"/title":{$:Be},"/format":{$:Be},"/default":{$:Be},"/?":{$:Be}}),t),{$:Ne}),rt=e=>tt(e,{"/discriminator":{$:Ue},"/oneOf":{"/*":()=>rt(e),$:Je,sibling:["discriminator"]},"/anyOf":{"/*":()=>rt(e),$:Je,sibling:["discriminator"]}}),nt=e=>"3.0.x"===e?Object.assign(Object.assign({},rt("draft-04")),{"/items":({key:e})=>Object.assign(Object.assign({},rt("draft-04")),{$:Ze})}):rt("draft-06"),at=e=>({"/*":{"/schema":nt(e)}}),st=e=>({"/content":{"/*":{"/schema":nt(e),"/encoding":{"/headers":at(e)}}}}),ot=e=>({"/*":{"/headers":at(e),"/content":{"/*":{"/schema":nt(e),"/encoding":{"/headers":at(e)}}}}}),it=tt("draft-06",{"/args":()=>it,"/nullable":{$:De},"/specifiedByURL":{$:Be},"/values":{$:Ue,"/*":{$:Ue,"/description":{$:Be},"/deprecated":{$:Be,"/reason":{$:Be}}}},"/interfaces":{$:Ue,"/*":{$:Ue}},"/directives":{$:Ue,"/*":()=>Object.assign(Object.assign({},it),{"/meta":{$:Ue}})}}),lt={"/queries":{"/*":()=>it},"/mutations":{"/*":()=>it},"/subscriptions":{"/*":()=>it},"/components":{"/*":{"/*":it},"/directives":{"/*":{"/args":()=>it}}}},ct=(e,t,r)=>{const n=r.sibling||[],a=e,s=t,o=a[s],i=le(a,["symbol"==typeof s?s:s+""]),l=((e,t)=>{const r={};for(const n of t)n in e&&(r[n]=e[n],delete e[n]);return r})(i,n);return Object.keys(i).length?Object.assign({[t]:o.map((e=>({allOf:[i,e]})))},l):e},pt=(e,t,r,n)=>{const a=[],s=Me(t),o=[],i={pointer:s,data:"",refs:[]};for(const t of e)if(be(t)&&!o.includes(t.$ref)){""===i.data&&(i.data=JSON.stringify(e));const{$ref:s}=t,l=le(t,["$ref"]),{filePath:c,normalized:p,pointer:u}=$e(s),f=n.find((e=>e.refs.includes(t.$ref)&&e.data===i.data&&u!==e.pointer));if(f)return{allOfItems:[{$ref:"#"+f.pointer}],brokenRefs:o};i.refs.push(p);const d=c?void 0:xe(r,u);void 0===d?(o.push(p),a.push(t)):a.push(d),Object.keys(l).length&&a.push(l)}else a.push(t);i.refs.length&&n.push(i);const l=ut(a);return l.find((e=>be(e)&&!o.includes(e.$ref)))?pt(l,t,r,n):{allOfItems:l,brokenRefs:o}},ut=e=>{const t=[];for(const r of e)if(fe(r))if(r.allOf&&Array.isArray(r.allOf)){const{allOf:e}=r,n=le(r,["allOf"]),a=Object.keys(n).length?[...e,n]:e;t.push(...ut(a))}else t.push(r);return t},ft=e=>{if("object"!=typeof e||!e)return tt();if("openapi"in e&&"string"==typeof e.openapi&&/3.+/.test(e.openapi)){return((e="3.0.x")=>({"/paths":{"/*":{"/*":{"/parameters":at(e),"/requestBody":st(e),"/responses":ot(e)},"/parameters":at(e)}},"/components":{"/schemas":{"/*":nt(e)},"/responses":ot(e),"/parameters":at(e),"/requestBodies":{"/*":st(e)},"/headers":at(e)}}))(e.openapi.startsWith("3.1")?"3.1.x":"3.0.x")}return"graphapi"in e&&"string"==typeof e.graphapi?lt:tt()},dt=(e,t)=>{var r;const n=null!==(r=null==t?void 0:t.rules)&&void 0!==r?r:ft(e);return((e,t=[],r={})=>{var n;t=Array.isArray(t)?t:[t];const a={"#":void 0},s=Object.assign({state:Object.assign(Object.assign({},null!==(n=r.state)&&void 0!==n?n:{}),{root:a,node:a})},r.rules?{rules:r.rules}:{}),[o,i]=ge();return me(e,[o,...t,i],s),a["#"]})(e,mt(t),{rules:n})},mt=e=>{const t=new Map;let r=null==e?void 0:e.source;const n=[];return({value:a,key:s,path:o,rules:i,state:l})=>{o.length||(null==e?void 0:e.source)||(r=a);const c=r=>{var n;const a=gt(o);a?t.set(...a):null===(n=null==e?void 0:e.onMergeError)||void 0===n||n.call(e,"Could not merge values, they are probably incompatible",o,r)},p=()=>{const{node:e}=l,r=Me(o);if(t.has(r)){const n=t.get(r),o=e[s];Array.isArray(o)&&(o.length<2&&c((null==a?void 0:a.allOf)||[]),o.splice(n,1))}};if(!fe(a)||Array.isArray(a))return{exitHook:p};if(!(e=>!!e&&e["/allOf"]&&"$"in e["/allOf"])(i))return{exitHook:p};const{allOf:u}=a,f=le(a,["allOf"]),d=[];if(Array.isArray(u)&&d.push(...u),d.length)Object.keys(f).length&&d.push(f);else{const{$ref:t}=f,r=le(f,["$ref"]);if((null==e?void 0:e.mergeRefSibling)&&t&&Object.keys(r).length>0)d.push({$ref:t},r);else if(null==e?void 0:e.mergeCombinarySibling){if(ve(f)&&i["/anyOf"])return{value:ct(f,"anyOf",i["/anyOf"]),exitHook:p};if(Oe(f)&&i["/oneOf"])return{value:ct(f,"oneOf",i["/oneOf"]),exitHook:p}}}if(!d.length)return{value:f,exitHook:p};const{allOfItems:m,brokenRefs:g}=pt(d,o,r,n);if(g.length)return g.forEach((t=>{var r;return null===(r=null==e?void 0:e.onRefResolveError)||void 0===r?void 0:r.call(e,"Cannot resolve $ref",o,t)})),{value:{allOf:m},exitHook:p};if(m.length<2)return{value:m.length?m[0]:{},exitHook:p};const y=Ne(m,{allOfItems:m,mergeRules:i,mergeError:c});return(null==e?void 0:e.mergeCombinarySibling)&&ve(y)?{value:ct(y,"anyOf",i["/anyOf"]),exitHook:p}:(null==e?void 0:e.mergeCombinarySibling)&&Oe(y)?{value:ct(y,"oneOf",i["/oneOf"]),exitHook:p}:{value:y,exitHook:p}}},gt=e=>{for(let t=e.length-2;t>=0;t--)if("anyOf"===e[t]||"oneOf"===e[t]){const r=e.slice(0,t+1);return[Me(r),e[t+1]]}},yt=["any","string","number","integer","boolean","null","array","object"],ht=["deprecated","readOnly","writeOnly","externalDocs"],bt=["type","description","title","enum","default","examples","format","const"],vt={any:[],boolean:[],null:[],string:["minLength","maxLength","pattern"],number:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],integer:["multipleOf","minimum","exclusiveMinimum","maximum","exclusiveMaximum"],object:["required","minProperties","maxProperties","propertyNames","properties","patternProperties","additionalProperties"],array:["minItems","maxItems","uniqueItems","items","additionalItems"]},Ot={any:[...vt.any,...bt,...ht],boolean:[...vt.boolean,...bt,...ht],null:[...vt.null,...bt,...ht],string:[...vt.string,...bt,...ht],number:[...vt.number,...bt,...ht],integer:[...vt.integer,...bt,...ht],object:[...vt.object,...bt,...ht],array:[...vt.array,...bt,...ht]},$t=["$defs","definitions","$schema","$id"];const jt=(e,t)=>{const{$ref:r}=t;ie(t,["$ref"]);const n=$e(r);return n.filePath?void 0:xe(e,n.pointer)};function xt(e){if("object"!=typeof e||!e)return[];const t=[];for(const r of Object.keys(Ot)){if("integer"===r)continue;const n=vt[r];for(const a of n)if(a in e){t.push(r);break}}return t}const kt=(e,t)=>{if(!c(t))return!1;for(const r of e)if(!t.type||Array.isArray(t.type)&&t.type.includes(r)||t.type===r||"any"===r)return!0;return!1};const At=e=>"/"+e.map((e=>String(e).replace(new RegExp("/","g"),"~1"))).join("/"),Rt=(e,t,r)=>{var n;return!!e&&(!!(null===(n=r[e])||void 0===n?void 0:n.find((e=>t.startsWith(e))))||!!t.startsWith(e))},St=(e,t)=>e===t?e:`${e}:${t}`,Ct=(e,t)=>be(e)?jt(t,e):e,Mt=e=>{var t;return e&&null!==(t=$e(e).normalized)&&void 0!==t?t:""},Pt=(e,t=[],r=[])=>e.map((e=>Object.assign(Object.assign({},e),{path:[...r,...e.path.slice(t.length)]}))),It=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r,t]),s=t,o=a[s],i=ie(a,["symbol"==typeof s?s:s+""]);return Object.keys(n).length?Object.assign(Object.assign({},Array.isArray(o)?{[t]:o.map((e=>({allOf:[e,n]})))}:n),i):e},wt=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"allOf"]),{allOf:a}=n,s=ie(n,["allOf"]);return Object.keys(r).length?Object.assign(Object.assign({},Array.isArray(a)?{allOf:[...a,r]}:r),s):e},qt=(e,t=[])=>{const r=Object.assign({},e),n=v(r,[...t,"$ref"]),{$ref:a}=n,s=ie(n,["$ref"]);return Object.keys(r).length?Object.assign({allOf:[{$ref:a},r]},s):e},Et=(e,t,r=[])=>{const n=Object.assign({},e),a=v(n,[...r]),s=t;a[s];const o=ie(a,["symbol"==typeof s?s:s+""]);return Object.assign(Object.assign({},o),{[t]:Object.keys(n).length?[n]:[]})},Tt=(e,t="")=>{for(let r=0;r<e.length;r++)"properties"===e[r]&&r<e.length-1?t+=t?"."+String(e[++r]):String(e[++r]):"additionalProperties"===e[r]?t+="{.*}":"patternProperties"===e[r]&&r<e.length-1?t+=`{${String(e[++r])}}`:"items"===e[r]&&(r<e.length-1&&m(e[r+1])?t+=`[${e[++r]}]`:t+="[]");return t||void 0},_t={add:"[Added] {{text}}",add_target:"[Added] {{text}} to `{{target}}`",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from `{{target}}`",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of `{{target}}`",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of `{{target}}`",status:"{{key}} status",validation:"{{key}} validator",annotation:"annotation ({{key}})",enum:"possible values",format:"value format",default:"default value",const:"possible value",type:"type definition",nullable:"possbile nullable value",property:"property `{{key}}`",arratItem:"array item with index `{{key}}`",patternProperty:"property with key pattern `{{key}}`",additionalProperties:"schema for additional properties",arrayItems:"schema for array items",additionalArrayItems:"schema for additional array items",oneOfItem:"oneOf schema",anyOfItem:"anyOf schema",allOfItem:"allOf schema"},Nt=(e,t)=>{var r;const n=null===(r=t.rules)||void 0===r?void 0:r.annotate;return n?te(n(e,t),_t):""},Bt=({action:e,path:t})=>({template:e,params:{text:{template:"annotation",params:{key:t[t.length-1]}},target:Tt(t)}}),Dt=({action:e,path:t})=>(t[t.length-1],ee(e,{text:ee("annotation",{key:"example"}),target:Tt(t)})),Ht=({action:e,path:t})=>{const r=t[t.length-1];return ee(e,{text:ee("validation",{key:r}),target:Tt(t)})},Vt=({path:e},t)=>{const r=e[e.length-1];return t.after.value?ee("add",{text:ee("status",{key:r}),target:Tt(e)}):t.before.value?ee("remove",{text:ee("status",{key:r}),target:Tt(e)}):void 0},Kt=({action:e,path:t})=>{const r=t[t.length-1];if(!m(r))return ee(e,{target:Tt(t),text:ee(r)})},Lt=({action:e,path:t},r)=>{const n=t[t.length-1],{value:a}="add"===e?r.after:r.before,s=t.length>1?t[t.length-2]:"",o=Tt(t.slice(0,-1)),i=Tt(t);switch(s){case"enum":return ee("replace",{text:ee("enum"),target:i});case"properties":return d(n)?ee(e,{text:ee("property",{key:n}),target:o}):void 0;case"items":return m(n)?ee(e,{text:ee("arratItem",{key:n}),target:o}):void 0;case"patternProperties":return d(n)?ee(e,{text:ee("patternProperty",{key:n}),target:o}):void 0;case"oneOf":case"anyOf":case"allOf":return ee(e,{text:ee(`${s}Item`),target:i});case"required":return d(a)?ee(e,{text:ee("status",{key:s}),target:i?`${i}.${a}`:a}):void 0}},Ft=e=>e?C:M,Ut=({after:e})=>Ft(!!e.value),Jt=(e,t)=>{const r=Array.isArray(e)?e:[e];return r.includes("number")&&r.push("integer"),oe(t,((e,{before:t,after:n},a)=>kt(r,"remove"===a?t.parent:n.parent)?e:P))},Wt=[C,M,({before:e,after:t})=>Ft(!m(e.value)||!m(t.value)||e.value>t.value)],Gt=[C,M,({before:e,after:t})=>Ft(!m(e.value)||!m(t.value)||e.value<t.value)],zt=[Ut,M,Ut],Yt=[Ut,M,Ut],Qt=[C,M,({before:e,after:t})=>Ft(!(m(e.value)&&m(t.value)&&!(e.value%t.value)))],Xt=[({after:e})=>{var t;return!d(e.value)||f(null===(t=F(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?M:C},M,({after:e})=>{var t;return!d(e.value)||f(null===(t=F(e,"","properties",e.value,"default"))||void 0===t?void 0:t.value)?M:C}],Zt=[({after:e})=>{var t,r;return!f(O(e.value,"default"))&&(null===(r=x(null===(t=F(e,"","required"))||void 0===t?void 0:t.value))||void 0===r?void 0:r.includes(e.key))?C:M},M,P,M,({before:e})=>{var t,r;return(null===(r=x(null===(t=F(e,"","required"))||void 0===t?void 0:t.value))||void 0===r?void 0:r.includes(e.key))?C:M},P],er=(e,t)=>{e.before=t(e.before,e.after),e.after=t(e.after,e.before)},tr=(e=$t)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:t,after:r};er(n,(t=>"oneOf"in t?It(t,"oneOf",e):"anyOf"in t?It(t,"anyOf",e):"allOf"in t?wt(t,e):"$ref"in t?qt(t,e):t));for(const t of["oneOf","anyOf"]){if(t in n.before&&!("oneOf"in n.after)&&!("anyOf"in n.after))return[n.before,Et(n.after,t,e)];if(t in n.after&&!("oneOf"in n.before)&&!("anyOf"in n.before))return[Et(n.before,t,e),n.after]}return[n.before,n.after]},rr=(...e)=>(t,r)=>{if(!c(t)||!c(r))return[t,r];const n={before:Object.assign({},t),after:Object.assign({},r)};return er(n,((t,r)=>{for(const n of e)n in r&&c(r[n])&&!(n in t)&&(t[n]=Array.isArray(r[n])?[]:{});return t})),[n.before,n.after]},nr=(e="2020-12")=>(e,t)=>{if(!c(e)||!c(t))return[e,t];const r={before:Object.assign({},e),after:Object.assign({},t)};return er(r,((e,t)=>{for(const r of["enum","required","properties","patternProperties","definitions","examples"])r in t&&c(t[r])&&!(r in e)&&(e[r]=Array.isArray(t[r])?[]:{});return e})),er(r,((e,t)=>{if("const"in e&&"enum"in t){const{const:t}=e,r=ie(e,["const"]);return Object.assign(Object.assign({},r),{enum:[t]})}return e})),er(r,(e=>(Array.isArray(e.enum)&&(e.enum=e.enum.filter(((e,t,r)=>r.indexOf(e)===t))),e))),er(r,(e=>{if("required"in e&&Array.isArray(e.required)){const t=e.required.filter(((e,t,r)=>d(e)&&r.indexOf(e)===t));return Object.assign(Object.assign({},e),{required:t})}return e})),er(r,((e,t)=>"items"in t&&p(t.items)?"items"in e&&"object"==typeof e.items?p(e.items)?e:Object.assign(Object.assign({},e),{items:t.items.map((()=>e.items)),additionalItems:e.items}):Object.assign(Object.assign({},e),{items:[]}):e)),er(r,((e,t)=>{if(!("type"in e)&&"type"in t){const r=xt(e);r.length&&(e.type=d(t.type)&&r.includes(t.type)?t.type:r)}return e})),er(r,(e=>{if("exclusiveMinimum"in e&&"boolean"==typeof e.exclusiveMinimum&&"minimum"in e){const{minimum:t,exclusiveMinimum:r}=e,n=ie(e,["minimum","exclusiveMinimum"]);return Object.assign(Object.assign({},n),{exclusiveMinimum:t})}return e})),er(r,(e=>{if("exclusiveMaximum"in e&&"boolean"==typeof e.exclusiveMaximum&&"maximum"in e){const{maximum:t,exclusiveMaximum:r}=e,n=ie(e,["maximum","exclusiveMaximum"]);return Object.assign(Object.assign({},n),{exclusiveMaximum:t})}return e})),er(r,((e,t)=>{if("example"in e&&"examples"in t){const{example:t}=e,r=ie(e,["example"]),n="examples"in e&&Array.isArray(e.examples)?e.examples:[];return Object.assign(Object.assign({},r),{examples:[...n,t]})}return e})),[r.before,r.after]},ar=e=>U((t=>dt(t,{rules:tt("draft-04"===e?e:"draft-06"),mergeCombinarySibling:!0,mergeRefSibling:!0}))),sr=(e,t,r)=>{const{added:n,removed:a,mapped:s}=W(e,t),o=a.findIndex((e=>"oneOf"==e||"anyOf"===e)),i=n.findIndex((e=>"oneOf"==e||"anyOf"===e));if(o<0||i<0)return{added:n,removed:a,mapped:s};const[l]=a.splice(o,1),[c]=n.splice(i,1);return s[l]=c,{added:n,removed:a,mapped:s}},or=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys()),s=[];for(let t=0;t<e.length;t++){const o=n.indexOf(e[t]);o<0?s.push(t):(r.mapped[t]=o,a.delete(o))}let o=0;a.forEach((e=>{o<s.length?r.mapped[s[o++]]=e:r.added.push(e)}));for(let e=o;e<s.length;e++)r.removed.push(s[e]);return r},ir=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=[...t],a=new Set(t.keys());for(let t=0;t<e.length;t++){const s=n.indexOf(e[t]);s<0?r.removed.push(t):(r.mapped[t]=s,a.delete(s))}return a.forEach((e=>{r.added.push(e)})),r},lr=e=>{const{before:t,after:n,options:a}=e,{arrayMeta:s,metaKey:o=A}=a;if(!p(t.value)||!p(n.value)){const r=V.replaced(t.path,t.value,n.value,e);return{diffs:[r],merged:n.value,rootMergeMeta:K(r)}}const i=new Set(n.value.keys()),l=new Set(t.value.keys()),c=[],u=[],f=[],d=r(e.rules,"*",t.path,t.value);for(const e of t.value.keys()){const r=t.value[e];for(const s of n.value.keys()){if(!i.has(s))continue;const o=n.value[s],{diffs:p,merged:f}=Z(r,o,Object.assign(Object.assign({},a),{rules:d}),{before:{jsonPath:[...t.path,e],source:t.root},after:{jsonPath:[...n.path,s],source:n.root}});if(!p.length){i.delete(s),l.delete(e),u[s]=o;break}c.push({before:e,after:s,diffs:p,merged:f})}}c.sort(((e,t)=>e.diffs.length-t.diffs.length));for(const e of c)i.has(e.after)&&l.has(e.before)&&(i.delete(e.after),l.delete(e.before),u[e.after]=e.merged,f.push(...e.diffs));const m=[];for(const r of l.values()){const n=V.removed([...t.path,u.length],t.value[r],Y(e,r,""));u.push(t.value[r]),m.push(n),f.push(n)}for(const t of i.values()){u[t]=n.value[t];const r=V.added([...n.path,t],n.value[t],Y(e,"",t));m.push(r),f.push(r)}const g=L(m);return s&&(u[o]=g),Object.assign({diffs:f,merged:u},!s&&Object.keys(g).length?{rootMergeMeta:{array:g}}:{})},cr=(e={})=>{var t,r,n;e.results=null!==(t=e.results)&&void 0!==t?t:new Map,e.bRefs=null!==(r=e.bRefs)&&void 0!==r?r:{},e.aRefs=null!==(n=e.aRefs)&&void 0!==n?n:{};const{results:a,bRefs:s,aRefs:o}=e;return({before:e,after:t,rules:r,options:n})=>{var i,l;const c=At(e.path),p=At(t.path);let u=St(c,p);if(a.has(u))return a.get(u);const f=be(e.value)?Mt(e.value.$ref):"",d=be(t.value)?Mt(t.value.$ref):"";if(!f&&!d)return;if(Rt(f,`#${c}`,s)||Rt(d,`#${p}`,o))return;if(f&&(s[f]=[...null!==(i=s[f])&&void 0!==i?i:[],`#${c}`]),d&&(o[d]=[...null!==(l=o[d])&&void 0!==l?l:[],`#${p}`]),f&&d&&(u=St(f,d),a.has(u))){const t=a.get(u),{path:r,diffs:n}=t,s=ie(t,["path","diffs"]);return Object.assign(Object.assign({},s),{diffs:Pt(n,r,e.path)})}const m=Ct(e.value,e.root),g=Ct(t.value,t.root);if(void 0===m||void 0===g)return;const y=Z(m,g,Object.assign(Object.assign({},n),{rules:r}),{before:{jsonPath:e.path,source:e.root},after:{jsonPath:t.path,source:t.root}});return f&&d&&a.set(u,Object.assign(Object.assign({},y),{path:e.path})),y}},pr={$:B,annotate:Bt},ur=(e,t)=>({$:e,annotate:t}),fr=({baseRules:e={},notMergeAllOf:t,version:r="draft-04",cache:n={}}={})=>{var a;const s=Object.assign(Object.assign(Object.assign({compare:cr(n),transform:[tr(),nr(r)],mapping:sr,"/title":pr,"/multipleOf":ur(Jt("number",Qt),Ht),"/maximum":ur(Jt("number",Wt),Ht),"/minimum":ur(Jt("number",Gt),Ht)},"draft-04"===r?{"/exclusiveMaximum":ur(Jt("number",zt),Ht),"/exclusiveMinimum":ur(Jt("number",zt),Ht)}:{"/exclusiveMaximum":ur(Jt("number",Wt),Ht),"/exclusiveMinimum":ur(Jt("number",Gt),Ht)}),{"/maxLength":ur(Jt("string",Wt),Ht),"/minLength":ur(Jt("string",Gt),Ht),"/pattern":ur(Jt("string",[C,M,C]),Ht),"/maxItems":ur(Jt("array",Wt),Ht),"/minItems":ur(Jt("array",Gt),Ht),"/uniqueItems":ur(Jt("array",Yt),Ht),"/maxProperties":ur(Jt("object",Wt),Ht),"/minProperties":ur(Jt("object",Gt),Ht),"/required":{mapping:ir,"/*":ur(Xt,Lt)},"/enum":{mapping:or,annotate:Kt,"/*":{$:[M,C,C],annotate:Lt}},"/const":ur([C,M,C],Kt),"/type":{$:[C,M,C],annotate:Kt,"/*":{$:[M,C,C]}},"/not":()=>Object.assign(Object.assign({},re(s,ne)),{$:E}),"/allOf":{compare:lr,"/*":()=>Object.assign(Object.assign({},s),{$:E,annotate:Lt})},"/oneOf":{compare:lr,"/*":()=>Object.assign(Object.assign({},s),{$:[M,C,C],annotate:Lt})},"/anyOf":{compare:lr,"/*":()=>Object.assign(Object.assign({},s),{$:[M,C,C],annotate:Lt})},"/items":({value:e})=>((e,t)=>Array.isArray(e)?{"/*":()=>Object.assign(Object.assign({},t),{$:E,annotate:Lt})}:Object.assign(Object.assign({},t),{$:q,annotate:Kt}))(e,s),"/additionalItems":()=>Object.assign(Object.assign({},s),{$:[M,C,P],annotate:Kt}),"/properties":{"/*":()=>Object.assign(Object.assign({},s),{$:Zt,annotate:Lt})},"/additionalProperties":()=>Object.assign(Object.assign({},s),{$:q,annotate:Kt}),"/patternProperties":{"/*":()=>Object.assign(Object.assign({},s),{$:[C,M,P],annotate:Lt})},"/propertyNames":()=>Object.assign(Object.assign({},s),{$:T,annotate:Ht}),"/description":pr,"/format":{$:[C,M,C],annotate:Kt},"/default":{$:[M,C,C],annotate:Kt},"/definitions":{"/*":()=>Object.assign(Object.assign({},s),{$:q})},"/$defs":{"/*":()=>Object.assign(Object.assign({},s),{$:q})},"/readOnly":{$:Yt,annotate:Vt},"/writeOnly":{$:Yt,annotate:Vt},"/deprecated":{$:D,annotate:Vt},"/examples":{$:B,annotate:Bt,"/*":{$:B,annotate:Dt}},"/**":{annotate:Bt,$:N}}),e);return t?s:Object.assign(Object.assign({},s),{transform:[...null!==(a=s.transform)&&void 0!==a?a:[],ar(r)]})},dr=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:fr({notMergeAllOf:r.notMergeAllOf}),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:Nt});return Z(e,t,o,n)},mr=e=>{const t=e.indexOf("args");return 2===t||t>3&&"properties"===e[t-2]&&"properties"!==e[t-1]||t>2&&"directives"===e[t-2]&&"directives"!==e[t-1]},gr={add:"[Added] {{text}} to Argument `{{target}}`",add_target:"[Added] {{text}} to Argument `{{target}}`",add_target_schema:"[Added] {{text}} to Argument `{{target}}` of property `{{schema}}(...)`",add_target_directive:"[Added] {{text}} to Argument `{{target}}` of directive `@{{directive}}(...)`",remove:"[Removed] {{text}} from Argument {{target}}",remove_target:"[Removed] {{text}} from Argument `{{target}}`",remove_target_schema:"[Removed] {{text}} from Argument `{{target}}` of property `{{schema}}(...)`",remove_target_directive:"[Removed] {{text}} from Argument `{{target}}` of directive `@{{directive}}(...)`",replace:"[Replaced] {{text}} of Argument {{target}}",replace_target:"[Replaced] {{text}} of Argument `{{target}}`",replace_target_schema:"[Replaced] {{text}} of Argument `{{target}}` of property `{{schema}}(...)`",replace_target_directive:"[Replaced] {{text}} of Argument `{{target}}` of directive `@{{directive}}(...)`"},yr=Object.assign(Object.assign({},_t),{directive:"directive `@{{key}}`",directive_definition:"difinition for directive `@{{key}}`",directive_meta:"directive meta `@{{key}}({{meta}})`",values_annotation:"possible values annotation ({{key}})",values_status:"possible values {{key}} status"}),hr=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0]&&"directives"!==e.path[1])return"";if(mr(e.path)){const r=e.path.indexOf("args"),a=Object.assign(Object.assign({},e),{path:e.path.slice(r)}),s=Tt(e.path.slice(0,r)),o="directives"===e.path[1]?e.path[2]:void 0,i=n(a,t);if(!i)return"";const l=Object.assign(Object.assign({},i),{params:Object.assign(Object.assign({},i.params),{schema:s,directive:o})});return te(l,Object.assign(Object.assign({},yr),gr))}return te(n(e,t),yr)},br=({path:e,action:t},r)=>{const n=e[e.length-1],a=Tt(e.slice(0,-4));switch(n){case"description":return ee(t,{text:ee("values_annotation",{key:n}),target:a});case"deprecated":return ee(t,{text:ee("values_status",{key:n}),target:a});case"reason":return ee(t,{text:ee("values_annotation",{key:"deprecation reason"}),target:a})}},vr=({path:e,action:t},r)=>{const n=e[e.length-1],a=e[e.length-2],s=Tt(e);switch(a){case"directives":return ee(t,{text:ee("directive",{key:n,definition:"components"===e[0]?1:void 0}),target:s});case"deprecated":return ee(t,{text:ee("reason",{key:n}),target:s});case"meta":return ee(t,{text:ee("directive",{key:e[e.length-3],meta:n}),target:Tt(e.slice(0,-4))})}},Or={ScalarTypeDefinition:"scalars",ObjectTypeDefinition:"objects",InterfaceTypeDefinition:"interfaces",InputObjectTypeDefinition:"inputObjects",DirectiveDefinition:"directives",UnionTypeDefinition:"unions",EnumTypeDefinition:"enums"},$r={query:"query",mutation:"mutation",subscription:"subscription"},jr=["args","values","interfaces","directives"],xr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values(Or))!(n in e)&&n in t&&(r[n]={});return r})),kr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of jr)if(!(n in e)&&n in t&&(r[n]={}),"values"===n&&n in t){const e=t[n];for(const t of Object.keys(e))t in r[n]||(r[n][t]={})}return"nullable"in e&&!e.nullable&&delete r.nullable,r})),Ar=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;if("meta"in e){const{meta:t}=e;return ie(e,["meta"]),{meta:t}}return"meta"in t?{meta:{}}:{}})),Rr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);for(const n of Object.values($r))!(n in e)&&n in t&&(r[n]={});return r})),Sr=U(((e,t)=>{if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;const r=Object.assign({},e);return!("args"in e)&&"args"in t&&(r.args={type:"object",properties:{}}),!("locations"in e)&&"locations"in t&&(r.locations=[]),r})),Cr=U((e=>dt(e,{rules:lt,mergeCombinarySibling:!0,mergeRefSibling:!0}))),Mr=(e=!1)=>{const t=fr({notMergeAllOf:!0,baseRules:{transform:[tr(),nr(),kr],"/nullable":{$:[M,C,M],annotate:Kt},"/specifiedByURL":{$:B},"/args":()=>Object.assign({},Mr()),"/values":{"/*":{"/description":{annotate:br,$:B},"/deprecated":{annotate:br,$:D,"/reason":{annotate:br,$:D}}}},"/deprecated":{$:D,annotate:Vt,"/reason":{annotate:vr,$:D}},"/interfaces":{"/*":{$:B}},"/directives":{"/*":{annotate:vr,transform:[Ar],"/meta":{"/*":{annotate:vr,$:B}}}}}});return e?re(t,ne):t},Pr=({notMergeAllOf:e=!1}={})=>{const t=Mr(),r=Mr(!0);return{transform:[...e?[]:[Cr],Rr],"/queries":{"/*":r},"/mutations":{"/*":r},"/subscriptions":{"/*":r},"/components":{transform:[xr],"/*":{"/*":r},"/directives":{"/*":{annotate:vr,transform:[Sr],$:_,"/title":{$:B},"/description":{$:B},"/locations":{mapping:or,$:B},"/repeatable":{$:B},"/args":t}}}}},Ir=(e,t,r={},n={})=>{var a,s;const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:Pr(),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:hr});return Z(e,t,o,n)},wr=(e,t)=>{if(!(c(e)&&c(t)&&"asyncapi"in e&&"asyncapi"in t))return;const r=String(e.asyncapi).charAt(0);return r===String(t.asyncapi).charAt(0)?`${r}.x`:""},qr=()=>{const e=re(fr(),ne),t=fr(),r=cr(),n={$:_,"/location":{$:_},"/description":{$:B}},a={$:N,"/*":{$:N,compare:r,"/*":{$:N},"/query":()=>e,"/headers":()=>t}},s={transform:[rr("tags","traits","bindings","examples")],"/summary":{$:B},"/tags":{$:B},"/externalDocs":{$:B},"/bindings":a},o=Object.assign({$:_,"/*":{$:_},"/operationId":{$:B},"/description":{$:B}},s),i=Object.assign({$:_,"/*":{$:_},"/headers":{$:N},"/correlationId":n,"/schemaFormat":{$:E},"/contentType":{$:_},"/name":{$:q},"/title":{$:q},"/examples":{$:B}},s),l=(r=!1)=>Object.assign({$:E,"/headers":{$:N},"/correlationId":n,"/schemaFormat":{$:E},"/contentType":{$:_},"/name":{$:q},"/title":{$:B},"/description":{$:B},"/examples":{$:B},"/traits":i,"/payload":()=>Object.assign(Object.assign({},r?e:t),{$:E})},s),c=(e=!1)=>Object.assign({$:_,"/operationId":{$:B},"/description":{$:B},"/traits":o,"/message":l(e)},s),p={$:B,"/version":{$:B},"/termsOfService":{$:B},"/license":{$:B,"/name":{$:B},"/url":{$:B}},"/title":{$:B},"/description":{$:B},"/contact":{$:B,"/name":{$:B},"/url":{$:B},"/email":{$:B}}},u={$:B,"/*":{compare:r,transform:[rr("variables","bindings","security")],$:B,"/url":{$:B},"/description":{$:B},"/protocol":{$:B},"/protocolVersion":{$:B},"/variables":{$:B,"/*":{compare:r,$:B,"/enum":{$:B,"/*":{$:B}},"/default":{$:B},"/description":{$:B},"/examples":{$:B}}},"/security":{$:B,"/*":{$:B}},"/bindings":a}},f={compare:r,transform:[rr("parameters","bindings")],$:_,"/description":{$:B},"/bindings":a,"/subscribe":c(!0),"/publish":c(!1),"/parameters":{$:E,"/*":{compare:r,$:_,"/description":{$:B},"/schema":()=>Object.assign(Object.assign({},t),{$:E}),"/location":{$:E}}}};return{transform:[rr("channels","components","tags","servers")],"/asyncapi":{$:B},"/id":{$:B},"/defaultContentType":{$:E},"/info":p,"/servers":u,"/channels":{$:_,"/*":f},"/components":{"/*":{$:B}},"/tags":{$:B},"/externalDocs":{$:B}}},Er=(e,t,r={},n={})=>{var a;const s=wr(e,t);if("2.x"!==s)throw new Error(`Unsupported version: ${s}`);const o=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:qr()});return Z(e,t,o,n)},Tr=e=>!!Array.isArray(e)&&(!!e&&(0===e.length||1===e.length&&0===Object.keys(e[0]).length)),_r=(e=[],t=[])=>{if(!Array.isArray(e)||!Array.isArray(t))return!1;const r=new Set(e.map((e=>Object.keys(e)[0])));for(const e of t)if(!r.has(Object.keys(e)[0]))return!1;return!0},Nr=({before:e,after:t})=>{if("string"!=typeof e.path[1]||"string"!=typeof t.path[1])return{};const r=[...e.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),n=[...t.path[1].matchAll(new RegExp("{(.*?)}","g"))].map((e=>e.pop())),a={};for(let e=0;e<r.length&&e<n.length;e++)a[r[e]]=n[e];return a},Br=e=>{switch(e){case"query":case"cookie":return"form";case"path":case"header":return"simple"}},Dr=e=>"responses"===e[3]&&"schema"===e[7],Hr=e=>"requestBody"===e[3]&&"schema"===e[6],Vr=e=>"parameters"===e[2]&&"schema"===e[4]||"parameters"===e[3]&&"schema"===e[5],Kr=(e,t)=>{if(!(a(e)&&a(t)&&"openapi"in e&&"openapi"in t))return;return(e.openapi>t.openapi?e.openapi:t.openapi).startsWith("3.1")?"3.1.x":"3.0.x"},Lr=[({after:e})=>"form"===e.value?I:C,({before:e})=>"form"===e.value?I:C,C],Fr=[({after:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?I:C,({before:e})=>e.value&&"form"===O(e.parent,"style")||!e.value&&"form"!==O(e.parent,"style")?I:C,C],Ur=[M,C,({before:e})=>"path"===O(e.parent,"in")?M:C],Jr=[C,M,e=>O(e.after.parent,"schema","default")?M:Ut(e)],Wr=[C,M,({before:e,after:t})=>{var r;const n=F(e,""),a=null!==(r=O(null==n?void 0:n.value,"style"))&&void 0!==r?r:"form";return"query"===O(null==n?void 0:n.value,"in")&&"form"===a?"object"===e.value||"array"===e.value||"object"===t.value?C:M:C}],Gr=[({after:e})=>O(e.value,"required")&&!f(O(e.value,"schema","default"))?C:M,C,P],zr=[({after:e})=>Tr(e.value)?M:C,M,({after:e,before:t})=>_r(e.value,t.value)||Tr(e.value)?M:C],Yr=[({before:e})=>u(e.parent)?M:C,({after:e})=>u(e.parent)?M:C,({after:e,before:t})=>_r(e.parent,t.parent)||Tr(e.value)?M:C],Qr=[({before:e,after:t})=>Tr(t.value)||_r(t.value,O(e.root,"security"))?M:C,({before:e,after:t})=>_r(O(t.root,"security"),e.value)?M:C,({before:e,after:t})=>_r(t.value,e.value)||Tr(t.value)?M:C],Xr=[({before:e})=>u(e.parent)?M:C,({after:e})=>u(e.parent)?C:M,({before:e,after:t})=>_r(t.parent,e.parent)||Tr(t.value)?M:C],Zr={requestBodySchema:"{{schemaChange}} in Request Body content ({{contentType}})",responseSchema:"{{schemaChange}} in Response {{responseCode}} content ({{contentType}})",parameterSchema:"{{schemaChange}} in {{in}} parameter `{{name}}`",add:"[Added] {{text}}",add_target:"[Added] {{text}} to {{target}}",remove:"[Removed] {{text}}",remove_target:"[Removed] {{text}} from {{target}}",replace:"[Replaced] {{text}}",replace_target:"[Replaced] {{text}} of {{target}}",rename:"[Renamed] {{text}}",rename_target:"[Renamed] {{text}} of {{target}}",param:"{{in}} parameter `{{name}}`",param_required:"required {{in}} parameter `{{name}}`",status:"{{key}} status",method:"operation {{method}} {{path}}",annotation:"annotation ({{key}})",security:"some security details",document:"document metadata ({{key}})",requestBody:"Request Body",requestBody_contentType:"Request Body content ({{contentType}})",response:"Response {{responseCode}}",response_contentType:"Response {{responseCode}} content ({{contentType}})",contentType:"Content type",encoding:"Encoding details",encoding_key:"Encoding details ({{key}})"},en=(e,t)=>{var r;let n=null===(r=t.rules)||void 0===r?void 0:r.annotate;if(!n||"components"===e.path[0])return"";if(Dr(e.path)){const r=te(n(e,t),_t);n=()=>ee("responseSchema",{schemaChange:r,responseCode:e.path[4],contentType:e.path[6]})}else if(Hr(e.path)){const r=te(n(e,t),_t);n=()=>ee("requestBodySchema",{schemaChange:r,contentType:e.path[5]})}else if(Vr(e.path)){const r=te(n(e,t),_t),{root:a}="add"===e.action?t.after:t.before,s=e.path.slice(0,"parameters"===e.path[2]?4:5),o=j(a,...s);n=()=>ee("parameterSchema",Object.assign(Object.assign({},Ct(o,a)),{schemaChange:r}))}return te(n(e,t),Zr)},tn=({action:e,path:t})=>ee(e,{text:ee("method",{path:t[1],method:String(t[2]).toUpperCase()})}),rn=({action:e,path:t})=>ee(e,{text:ee("document",{key:t.join(".")})}),nn=({action:e})=>ee(e,{text:ee("security")}),an=({path:e,action:t})=>{const r=e[e.length-1];return ee(t,"required"===r||"deprecated"===r?{text:ee("status",{key:r}),target:ee("requestBody")}:{text:ee("annotation",{key:r}),target:ee("requestBody")})},sn=({path:e,action:t})=>{const r=e[4],n=e[e.length-1];return ee(t,r===n?{text:ee("response",{responseCode:r})}:{text:ee("annotation",{key:n}),target:ee("response",{responseCode:r})})},on=({path:e,action:t},r)=>{const n=Dr(e)?e[6]:e[5],a=Dr(e)?e[4]:void 0,s=Dr(e)?ee("response",{contentType:n,responseCode:a}):ee("requestBody",{contentType:n}),o=e[e.length-1];return ee(t,n&&n!==o?{text:ee("annotation",{key:o}),target:s}:{text:ee("contentType"),target:s})},ln=({path:e,action:t},r)=>{const n=Dr(e)?e[6]:e[5],a=Dr(e)?e[4]:void 0,s=Dr(e)?ee("response",{contentType:n,responseCode:a}):ee("requestBody",{contentType:n}),o=(Dr(e)?e.slice(8):e.slice(7)).join(".");return ee(t,{text:ee("encoding",{key:o}),target:s})},cn=({path:e,action:t},r)=>{const{key:n}="add"===t?r.after:r.before;if("deprecated"===n)return r.after.value?ee("add",{text:ee("status",{key:n})}):r.before.value?ee("remove",{text:ee("status",{key:n})}):void 0;if("requestBody"===n)return ee(t,{text:ee(n)});if("number"==typeof n){const{value:n}="add"===t?r.after:r.before;return ee(t,{text:ee("annotation",{key:`${e[e.length-2]}: ${n}`})})}return ee(t,{text:ee("annotation",{key:n})})},pn=({action:e},t)=>{const{path:r,root:n,key:a}="add"===e?t.after:t.before,s=r.slice(0,"parameters"===r[2]?4:5),o=j(n,...s),i=Ct(o,n);return ee(e,"required"===a?{text:ee("status",{key:a}),target:ee("param",Object.assign(Object.assign({},i),{requred:!1}))}:"deprecated"===a?{text:ee("status",{key:a}),target:ee("param",i)}:{text:ee("param",i)})},un=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),s=h(t),o=s.map((e=>e.replace(new RegExp("{.*?}","g"),"*"))),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.indexOf(a[e]);t<0?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},fn=(e,t,r)=>{var n;const a={added:[],removed:[],mapped:{}},s=Nr(r),o=new Set(t.keys()),i=e.map((e=>Ct(e,r.before.root))),l=t.map((e=>Ct(e,r.after.root)));for(let e=0;e<i.length;e++){const t=$(i[e],"in"),r=null!==(n=$(i[e],"name"))&&void 0!==n?n:"",c=l.findIndex((e=>{var n;const a=$(e,"in"),o=null!==(n=$(e,"name"))&&void 0!==n?n:"";return t===a&&(r===o||"path"===t&&s[r]===o)}));c<0?a.removed.push(e):(a.mapped[e]=c,o.delete(c))}return o.forEach((e=>a.added.push(e))),a},dn=(e,t)=>{const r={added:[],removed:[],mapped:{}},n=h(e),a=n.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),s=h(t),o=s.map((e=>{var t;return null!==(t=e.split(";")[0])&&void 0!==t?t:""})),i=new Set(s.keys());for(let e=0;e<n.length;e++){const t=o.findIndex((t=>{const[r,n]=t.split("/"),[s,o]=a[e].split("/");return(r===s||"*"===r||"*"===s)&&(n===o||"*"===n||"*"===o)}));t<0||!i.has(t)?r.removed.push(n[e]):(r.mapped[n[e]]=s[t],i.delete(t))}return i.forEach((e=>r.added.push(s[e]))),r},mn=U((e=>{if(!c(e))return e;const t=["get","put","post","delete","options","head","patch","trace"],r=h(e).reduce(((r,n)=>(t.includes(n)||(r[n]=e[n]),r)),{});if(!h(r).length)return e;const n={};for(const a of t){if(!l(e,a)||"object"!=typeof e[a]||!e[a])continue;const t=Object.assign({},e[a]),{parameters:s,servers:o}=r,i=ie(r,["parameters","servers"]);s&&Array.isArray(s)&&("parameters"in t&&Array.isArray(t.parameters)?t.parameters=[...t.parameters,...s]:t.parameters=s),o&&Array.isArray(o)&&("servers"in t&&Array.isArray(t.servers)?t.servers=[...t.servers,...o]:t.servers=o);for(const e of h(i))l(t,e)||(t[e]=i[e]);n[a]=t}return n})),gn=U(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);return!("tags"in e)&&"tags"in t&&(r.tags=[]),"deprecated"in r&&!r.deprecated&&delete r.deprecated,r})),yn=(e,t)=>{if(!c(e)||!c(t))return[e,t];const{added:r,removed:n}=un(e,t);return[r.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},e)),n.reduce(((e,t)=>b(e,t,{[t]:{}})),Object.assign({},t))]},hn=U(((e,t)=>{if(!c(e)||!c(t))return e;const r=Object.assign({},e);if("in"in e&&!("style"in e)&&"style"in t){const t=Br(e.in);t&&(r.style=t)}return"style"in r&&"explode"in e&&"explode"in t&&"form"===r.style&&(r.explode=!0),"deprecated"in r&&!r.deprecated&&delete r.deprecated,"required"in r&&!r.required&&delete r.required,r})),bn=U(((e,t)=>(c(e)&&c(t),e))),vn=(e={})=>{const t="3.0.x"===e.version?"draft-04":"2020-12",r=fr({baseRules:{transform:[tr([...$t,"discriminator"]),nr(t),bn],"/nullable":{$:Yt,annotate:Kt},"/discriminator":{$:N,annotate:Bt},"/example":{$:B,annotate:Bt},"/externalDocs":{$:B,annotate:Bt,"/*":{$:B}},"/xml":{}},notMergeAllOf:e.notMergeAllOf,version:t});return e.response?re(r,ne):r},On=e=>({$:e,annotate:pn}),$n={$:B,annotate:rn},jn={$:B,annotate:cn},xn=(e={})=>{const t=vn(e),r=vn(Object.assign(Object.assign({},e),{response:!0})),n=cr(),a={$:B,"/**":{$:B},"/*":{"/variables":{"/*":{"/enum":{mapping:or}}}}},s={"/*":{annotate:pn,compare:n,transform:[hn],$:Gr,"/name":On(Ur),"/in":On([M,C,C]),"/schema":()=>Object.assign(Object.assign({},t),{$:E,"/type":Object.assign(Object.assign({},t["/type"]),{$:Wr})}),"/explode":On(Fr),"/style":On(Lr),"/description":On(B),"/required":On(Jr),"/deprecated":On(D)}},o={$:[M,C,C],"/*":{$:[M,C,C],compare:n,"/description":{$:B},"/required":{$:[C,M,Ut]},"/deprecated":{$:D}}},i={annotate:on,$:[M,C,C],mapping:dn,"/*":{annotate:on,"/*":{annotate:on},$:[M,C,M],"/schema":({path:e})=>Object.assign(Object.assign({},Dr(e)?r:t),{$:E}),"/example":{$:B},"/examples":{$:B,compare:n},"/encoding":{annotate:ln,$:[C,M,C],"/*":{"/contentType":{$:[M,C,C]},"/headers":o,"/style":{$:[M,C,C]},"/explode":{$:[M,C,C]},"/allowReserved":{$:[M,C,C]}},"/**":{annotate:ln}}}},l={"/*":{annotate:an},$:[M,C,C],compare:n,"/description":{$:B},"/content":i,"/required":{$:[C,M,Ut]}},c={$:[M,C,C],mapping:G,"/*":{annotate:sn,"/*":{annotate:sn},$:[M,C,C],compare:n,"/description":{$:B},"/headers":o,"/content":i}};return{"/openapi":$n,"/info":Object.assign(Object.assign({},$n),{"/**":$n}),"/servers":a,"/paths":{transform:[yn],mapping:un,"/*":{$:[P,P,M],transform:[mn],compare:n,"/summary":{$:B},"/description":{$:B},"/*":{annotate:tn,$:[M,C,P],transform:[gn],"/*":jn,"/tags":Object.assign(Object.assign({},jn),{mapping:or,"/*":jn}),"/parameters":Object.assign(Object.assign({},s),{$:[M,C,C],mapping:fn}),"/requestBody":l,"/callbacks":{"/*":{compare:n}},"/responses":c,"/deprecated":{$:D},"/security":{"/**":{annotate:nn},$:Qr,"/*":{$:Xr,"/*":{$:_,mapping:or,"/*":{$:_}}}},"/servers":a},"/servers":a,"/parameters":Object.assign(Object.assign({},s),{$:[M,C,C],mapping:fn})}},"/components":{$:q,"/schemas":{$:[M,C,C],"/*":()=>Object.assign(Object.assign({},t),{$:_})},"/responses":{$:[M,C,C],"/*":c},"/parameters":{$:[M,C,C],"/*":s},"/examples":{$:B},"/requestBodies":{$:[M,C,C],"/*":l},"/headers":o,"/securitySchemes":{$:[C,M,C],"/*":{$:[C,M,C],"/type":{$:[C,M,C]},"/description":{$:B},"/name":{$:[C,M,C]},"/in":{$:[C,M,C]},"/scheme":{$:[C,M,C]},"/bearerFormat":{$:B},"/flows":{$:[C,M,C]},"/openIdConnectUrl":{$:B}}}},"/security":{$:zr,"/*":{$:Yr}},"/tags":{$:B},"/externalDocs":{$:B}}},kn=(e,t,r={},n={})=>{var a,s;const{notMergeAllOf:o}=r,i=Object.assign(Object.assign({},r),{rules:null!==(a=r.rules)&&void 0!==a?a:xn({notMergeAllOf:o}),version:Kr(e,t),annotateHook:null!==(s=r.annotateHook)&&void 0!==s?s:en});return Z(e,t,i,n)},An=e=>c(e)?"openapi"in e&&d(e.openapi)&&/3.+/.test(e.openapi)?kn:"asyncapi"in e&&d(e.asyncapi)&&/2.+/.test(e.asyncapi)?Er:"graphapi"in e&&e.graphapi?Ir:dr:dr;return e.ClassifierType=S,e.DIFF_META_KEY=A,e.DiffAction=R,e.addNonBreaking=_,e.allAnnotation=B,e.allBreaking=E,e.allDeprecated=D,e.allNonBreaking=q,e.allUnclassified=N,e.annotation=I,e.annotationTemplate=ee,e.apiCompare=(e,t,r={})=>An(e)(e,t,r),e.apiDiff=(e,t,r={})=>{const n=An(e),{diffs:a}=n(e,t,r);return a},e.apiMerge=(e,t,r={})=>{const n=An(e),{merged:a}=n(e,t,r);return a},e.arrayMappingResolver=J,e.asyncApi2Rules=qr,e.booleanClassifier=Yt,e.breaking=C,e.breakingIf=Ft,e.breakingIfAfterTrue=Ut,e.buildPath=At,e.caseInsensitiveKeyMappingResolver=G,e.changeDiffsPath=Pt,e.combinaryCompareResolver=lr,e.compare=Z,e.compareAsyncApi=Er,e.compareGraphApi=Ir,e.compareJsonSchema=dr,e.compareOpenApi=kn,e.compareTransformationFactory=U,e.contentChangeAnnotation=on,e.contentMediaTypeMappingResolver=dn,e.convertDiffToMeta=K,e.createAnnotation=te,e.createChildContext=Y,e.createContext=z,e.createDiff=H,e.createEmptyCombiner=Et,e.createFields=rr,e.createMergeMeta=L,e.createRefsCompareResolver=cr,e.deprecated=w,e.diffFactory=V,e.discoverCompareEngine=An,e.documentChangeAnnotation=rn,e.emptySecurity=Tr,e.encodingChangeAnnotation=ln,e.enumMappingResolver=or,e.excludeKeys=v,e.exclusiveClassifier=zt,e.filterObj=(e,t)=>{const r={};for(const n of h(e))t(n,e)&&(r[n]=e[n]);return r},e.getArrayValue=x,e.getAsyncApiVersion=wr,e.getBooleanValue=(e,...t)=>{const r=O(e,...t);return"boolean"==typeof r?r:"string"!=typeof r||"true"!==r&&"false"!==r?void 0:Boolean(r)},e.getCompareId=St,e.getDefaultStyle=Br,e.getKeyValue=O,e.getMaxOpenApiVersion=Kr,e.getNumberValue=(e,...t)=>{const r=O(e,...t);return"number"==typeof r?r:"string"==typeof r&&+r?+r:void 0},e.getObjectValue=j,e.getParentContext=F,e.getRef=Mt,e.getStringValue=$,e.getTarget=Tt,e.globalSecurityClassifyRule=zr,e.globalSecurityItemClassifyRule=Yr,e.graphApiAnnotateHook=hr,e.graphApiComponents=Or,e.graphApiMergeAllOf=Cr,e.graphApiOperations=$r,e.graphApiRules=Pr,e.graphApiSchemaRules=Mr,e.graphSchemaCustomProps=jr,e.includeSecurity=_r,e.inferTypes=xt,e.isAllOfNode=function(e){return e&&e.allOf&&Array.isArray(e.allOf)},e.isArgSchema=mr,e.isArray=p,e.isCycleRef=Rt,e.isExist=f,e.isFunc=g,e.isKey=l,e.isNotEmptyArray=u,e.isNumber=m,e.isObject=c,e.isParameterSchema=Vr,e.isRequestBodySchema=Hr,e.isResponseSchema=Dr,e.isString=d,e.isValidSchemaTypes=kt,e.isValidType=e=>"string"==typeof e&&yt.includes(e),e.joinPath=k,e.jsonSchemaAllowedSibling=$t,e.jsonSchemaAnnotationHook=Nt,e.jsonSchemaAnnotations=_t,e.jsonSchemaCommonProps=bt,e.jsonSchemaDefinitionsPath=["$defs","definitions"],e.jsonSchemaKeyChange=Kt,e.jsonSchemaMappingResolver=sr,e.jsonSchemaMergeAllOf=ar,e.jsonSchemaNodeMetaProps=ht,e.jsonSchemaRules=fr,e.jsonSchemaTypeProps=Ot,e.jsonSchemaTypes=yt,e.jsonSchemaValidators=vt,e.mapPathParams=Nr,e.maxClassifier=Wt,e.mergeAllOfSibling=wt,e.mergeCombinarySibling=It,e.mergeRefSibling=qt,e.minClassifier=Gt,e.multipleOfClassifier=Qt,e.nonBreaking=M,e.objectKeys=h,e.objectMappingResolver=W,e.onlyAddBreaking=T,e.openApi3AnnotateHook=en,e.openApiSchemaRules=vn,e.openapi3Rules=xn,e.operationChangeAnnotation=cn,e.operationSecurityChangeAnnotation=nn,e.operationSecurityClassifyRule=Qr,e.operationSecurityItemClassifyRule=Xr,e.paramClassifyRule=Gr,e.paramMappingResolver=fn,e.paramSchemaTypeClassifyRule=Wr,e.parameterChangeAnnotation=pn,e.parameterExplodeClassifyRule=Fr,e.parameterNameClassifyRule=Ur,e.parameterRequiredClassifyRule=Jr,e.parameterStyleClassifyRule=Lr,e.parentKeyChangeAnnotation=vr,e.pathMappingResolver=un,e.pathMethodChangeAnnotation=tn,e.propertyClassifyRule=Zt,e.requestBodyChangeAnnotation=an,e.requiredItemClassifyRule=Xt,e.requiredMappingResolver=ir,e.resolveRef=Ct,e.resolveRefNode=jt,e.responseChangeAnnotation=sn,e.reverseClassifyRule=se,e.reverseClassifyRuleTransformer=ne,e.schemaAnnotationChange=Bt,e.schemaExampleChange=Dt,e.schemaKeyItemChange=Lt,e.schemaStatusChange=Vt,e.schemaValidationChange=Ht,e.setKeyValue=b,e.transformClassifyRule=oe,e.transformComapreRules=re,e.transformGraphApiComponents=xr,e.transformGraphApiDirective=Sr,e.transformGraphApiDocument=Rr,e.transformGraphSchema=kr,e.transformJsonSchema=nr,e.transformJsonSchemaCombiners=tr,e.transformOpenApiSchema=bn,e.transformOperation=gn,e.transformParameterItem=hn,e.transformPathItems=mn,e.transformPaths=yn,e.transfromGraphSchemaDirective=Ar,e.typeClassifier=Jt,e.typeOf=y,e.unclassified=P,e.unwrapArrayOrNull=function(e){return Array.isArray(e)?e:null},e.unwrapStringOrNull=function(e){return"string"==typeof e?e:null},e.valuesAnnotationChange=br,e.valuesTransformation=er,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=api-smart-diff.min.js.map
import { CrawlRules, CrawlRulesFunc, JsonPath } from "json-crawl";
import type { Diff, DiffType, ComapreOptions, CompareResult } from "./compare";
export type DiffTypeClassifier = (ctx: ComapreContext) => DiffType;
export type ClassifyRule = [AddDiffType, RemoveDiffType, ReplaceDiffType] | [AddDiffType, RemoveDiffType, ReplaceDiffType, AddDiffType, RemoveDiffType, ReplaceDiffType];
export type ClassifyRule = [
AddDiffType,
RemoveDiffType,
ReplaceDiffType
] | [
AddDiffType,
RemoveDiffType,
ReplaceDiffType,
ReversedAddDiffType,
ReversedRemoveDiffType,
ReversedReplaceDiffType
];
export type AddDiffType = RuleDiffType;
export type RemoveDiffType = RuleDiffType;
export type ReplaceDiffType = RuleDiffType;
export type ReversedAddDiffType = RuleDiffType;
export type ReversedRemoveDiffType = RuleDiffType;
export type ReversedReplaceDiffType = RuleDiffType;
export type RuleDiffType = DiffType | DiffTypeClassifier;

@@ -9,0 +23,0 @@ export type NodeContext = {

{
"name": "api-smart-diff",
"version": "1.0.3",
"version": "1.0.4",
"description": "Generate the diff between two API specifications (OpenAPI, AsyncAPI, GraphApi, JsonSchema)",

@@ -5,0 +5,0 @@ "module": "dist/index.mjs",

@@ -34,2 +34,5 @@ # api-smart-diff

## External $ref
If schema contains an external $ref, you should bundle it via [api-ref-bundler](https://github.com/udamir/api-ref-bundler) first.
## Installation

@@ -163,3 +166,6 @@ ```SH

DiffType | (ctx: ComapreContext) => DiffType, // remove
DiffType | (ctx: ComapreContext) => DiffType // replace (rename)
DiffType | (ctx: ComapreContext) => DiffType, // replace (rename)
DiffType | (ctx: ComapreContext) => DiffType, // (optional) reversed rule for add
DiffType | (ctx: ComapreContext) => DiffType, // (optional) reversed rule for remove
DiffType | (ctx: ComapreContext) => DiffType // (optional) reversed rule for replace (rename)
]

@@ -213,4 +219,2 @@

Please check predefined rules in `/src/rules` folder to get examples
## Contributing

@@ -217,0 +221,0 @@ When contributing, keep in mind that it is an objective of `api-smart-diff` to have no additional package dependencies. This may change in the future, but for now, no new dependencies.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc