react-diff-viewer-continued 4.1.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +8 -1
- package/.github/workflows/release.yml +3 -0
- package/CHANGELOG.md +13 -0
- package/lib/cjs/src/compute-lines.d.ts +0 -12
- package/lib/cjs/src/compute-lines.js +58 -9
- package/lib/cjs/src/index.d.ts +44 -0
- package/lib/cjs/src/index.js +270 -24
- package/lib/cjs/src/styles.d.ts +1 -0
- package/lib/cjs/src/styles.js +15 -0
- package/lib/cjs/src/workerBundle.d.ts +5 -0
- package/lib/cjs/src/workerBundle.js +7 -0
- package/lib/esm/src/compute-lines.js +58 -9
- package/lib/esm/src/index.js +265 -23
- package/lib/esm/src/styles.js +15 -0
- package/lib/esm/src/workerBundle.js +7 -0
- package/package.json +4 -2
- package/scripts/build-worker.js +50 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// AUTO-GENERATED FILE - DO NOT EDIT
|
|
2
|
+
// Generated by scripts/build-worker.js
|
|
3
|
+
/**
|
|
4
|
+
* Bundled worker code as a string.
|
|
5
|
+
* This allows us to create a Blob URL at runtime without needing a separate file.
|
|
6
|
+
*/
|
|
7
|
+
export const WORKER_CODE = "(()=>{var Si=Object.defineProperty;var bi=(e=>typeof require<\"u\"?require:typeof Proxy<\"u\"?new Proxy(e,{get:(n,i)=>(typeof require<\"u\"?require:n)[i]}):e)(function(e){if(typeof require<\"u\")return require.apply(this,arguments);throw Error('Dynamic require of \"'+e+'\" is not supported')});var _i=(e,n)=>{for(var i in n)Si(e,i,{get:n[i],enumerable:!0})};var $e={};_i($e,{Diff:()=>b,FILE_HEADERS_ONLY:()=>_n,INCLUDE_HEADERS:()=>Ue,OMIT_HEADERS:()=>Ln,applyPatch:()=>je,applyPatches:()=>bn,arrayDiff:()=>Pe,canonicalize:()=>V,characterDiff:()=>ye,convertChangesToDMP:()=>On,convertChangesToXML:()=>In,createPatch:()=>Fn,createTwoFilesPatch:()=>Ye,cssDiff:()=>Ne,diffArrays:()=>wn,diffChars:()=>sn,diffCss:()=>yn,diffJson:()=>An,diffLines:()=>N,diffSentences:()=>vn,diffTrimmedLines:()=>xn,diffWords:()=>mn,diffWordsWithSpace:()=>Le,formatPatch:()=>ee,jsonDiff:()=>Re,lineDiff:()=>ce,parsePatch:()=>Z,reversePatch:()=>Be,sentenceDiff:()=>ke,structuredPatch:()=>ae,wordDiff:()=>be,wordsWithSpaceDiff:()=>_e});var b=class{diff(n,i,r={}){let l;typeof r==\"function\"?(l=r,r={}):\"callback\"in r&&(l=r.callback);let t=this.castInput(n,r),o=this.castInput(i,r),u=this.removeEmpty(this.tokenize(t,r)),f=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(u,f,r,l)}diffWithOptionsObj(n,i,r,l){var t;let o=m=>{if(m=this.postProcess(m,r),l){setTimeout(function(){l(m)},0);return}else return m},u=i.length,f=n.length,c=1,s=u+f;r.maxEditLength!=null&&(s=Math.min(s,r.maxEditLength));let a=(t=r.timeout)!==null&&t!==void 0?t:1/0,p=Date.now()+a,d=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(d[0],i,n,0,r);if(d[0].oldPos+1>=f&&h+1>=u)return o(this.buildValues(d[0].lastComponent,i,n));let g=-1/0,y=1/0,w=()=>{for(let m=Math.max(g,-c);m<=Math.min(y,c);m+=2){let x,A=d[m-1],C=d[m+1];A&&(d[m-1]=void 0);let F=!1;if(C){let S=C.oldPos-m;F=C&&0<=S&&S<u}let E=A&&A.oldPos+1<f;if(!F&&!E){d[m]=void 0;continue}if(!E||F&&A.oldPos<C.oldPos?x=this.addToPath(C,!0,!1,0,r):x=this.addToPath(A,!1,!0,1,r),h=this.extractCommon(x,i,n,m,r),x.oldPos+1>=f&&h+1>=u)return o(this.buildValues(x.lastComponent,i,n))||!0;d[m]=x,x.oldPos+1>=f&&(y=Math.min(y,m-1)),h+1>=u&&(g=Math.max(g,m+1))}c++};if(l)(function m(){setTimeout(function(){if(c>s||Date.now()>p)return l(void 0);w()||m()},0)})();else for(;c<=s&&Date.now()<=p;){let m=w();if(m)return m}}addToPath(n,i,r,l,t){let o=n.lastComponent;return o&&!t.oneChangePerToken&&o.added===i&&o.removed===r?{oldPos:n.oldPos+l,lastComponent:{count:o.count+1,added:i,removed:r,previousComponent:o.previousComponent}}:{oldPos:n.oldPos+l,lastComponent:{count:1,added:i,removed:r,previousComponent:o}}}extractCommon(n,i,r,l,t){let o=i.length,u=r.length,f=n.oldPos,c=f-l,s=0;for(;c+1<o&&f+1<u&&this.equals(r[f+1],i[c+1],t);)c++,f++,s++,t.oneChangePerToken&&(n.lastComponent={count:1,previousComponent:n.lastComponent,added:!1,removed:!1});return s&&!t.oneChangePerToken&&(n.lastComponent={count:s,previousComponent:n.lastComponent,added:!1,removed:!1}),n.oldPos=f,c}equals(n,i,r){return r.comparator?r.comparator(n,i):n===i||!!r.ignoreCase&&n.toLowerCase()===i.toLowerCase()}removeEmpty(n){let i=[];for(let r=0;r<n.length;r++)n[r]&&i.push(n[r]);return i}castInput(n,i){return n}tokenize(n,i){return Array.from(n)}join(n){return n.join(\"\")}postProcess(n,i){return n}get useLongestToken(){return!1}buildValues(n,i,r){let l=[],t;for(;n;)l.push(n),t=n.previousComponent,delete n.previousComponent,n=t;l.reverse();let o=l.length,u=0,f=0,c=0;for(;u<o;u++){let s=l[u];if(s.removed)s.value=this.join(r.slice(c,c+s.count)),c+=s.count;else{if(!s.added&&this.useLongestToken){let a=i.slice(f,f+s.count);a=a.map(function(p,d){let h=r[c+d];return h.length>p.length?h:p}),s.value=this.join(a)}else s.value=this.join(i.slice(f,f+s.count));f+=s.count,s.added||(c+=s.count)}}return l}};var ve=class extends b{},ye=new ve;function sn(e,n,i){return ye.diff(e,n,i)}function Ae(e,n){let i;for(i=0;i<e.length&&i<n.length;i++)if(e[i]!=n[i])return e.slice(0,i);return e.slice(0,i)}function we(e,n){let i;if(!e||!n||e[e.length-1]!=n[n.length-1])return\"\";for(i=0;i<e.length&&i<n.length;i++)if(e[e.length-(i+1)]!=n[n.length-(i+1)])return e.slice(-i);return e.slice(-i)}function te(e,n,i){if(e.slice(0,n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(n)}; this is a bug`);return i+e.slice(n.length)}function ue(e,n,i){if(!n)return e+i;if(e.slice(-n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(n)}; this is a bug`);return e.slice(0,-n.length)+i}function q(e,n){return te(e,n,\"\")}function X(e,n){return ue(e,n,\"\")}function Ce(e,n){return n.slice(0,Li(e,n))}function Li(e,n){let i=0;e.length>n.length&&(i=e.length-n.length);let r=n.length;e.length<n.length&&(r=e.length);let l=Array(r),t=0;l[0]=0;for(let o=1;o<r;o++){for(n[o]==n[t]?l[o]=l[t]:l[o]=t;t>0&&n[o]!=n[t];)t=l[t];n[o]==n[t]&&t++}t=0;for(let o=i;o<e.length;o++){for(;t>0&&e[o]!=n[t];)t=l[t];e[o]==n[t]&&t++}return t}function pn(e){return e.includes(`\\r\n`)&&!e.startsWith(`\n`)&&!e.match(/[^\\r]\\n/)}function dn(e){return!e.includes(`\\r\n`)&&e.includes(`\n`)}function z(e){let n;for(n=e.length-1;n>=0&&e[n].match(/\\s/);n--);return e.substring(n+1)}function M(e){let n=e.match(/^\\s*/);return n?n[0]:\"\"}var fe=\"a-zA-Z0-9_\\\\u{AD}\\\\u{C0}-\\\\u{D6}\\\\u{D8}-\\\\u{F6}\\\\u{F8}-\\\\u{2C6}\\\\u{2C8}-\\\\u{2D7}\\\\u{2DE}-\\\\u{2FF}\\\\u{1E00}-\\\\u{1EFF}\",Fi=new RegExp(`[${fe}]+|\\\\s+|[^${fe}]`,\"ug\"),Ee=class extends b{equals(n,i,r){return r.ignoreCase&&(n=n.toLowerCase(),i=i.toLowerCase()),n.trim()===i.trim()}tokenize(n,i={}){let r;if(i.intlSegmenter){let o=i.intlSegmenter;if(o.resolvedOptions().granularity!=\"word\")throw new Error('The segmenter passed must have a granularity of \"word\"');r=[];for(let u of Array.from(o.segment(n))){let f=u.segment;r.length&&/\\s/.test(r[r.length-1])&&/\\s/.test(f)?r[r.length-1]+=f:r.push(f)}}else r=n.match(Fi)||[];let l=[],t=null;return r.forEach(o=>{/\\s/.test(o)?t==null?l.push(o):l.push(l.pop()+o):t!=null&&/\\s/.test(t)?l[l.length-1]==t?l.push(l.pop()+o):l.push(t+o):l.push(o),t=o}),l}join(n){return n.map((i,r)=>r==0?i:i.replace(/^\\s+/,\"\")).join(\"\")}postProcess(n,i){if(!n||i.oneChangePerToken)return n;let r=null,l=null,t=null;return n.forEach(o=>{o.added?l=o:o.removed?t=o:((l||t)&&hn(r,t,l,o),r=o,l=null,t=null)}),(l||t)&&hn(r,t,l,null),n}},be=new Ee;function mn(e,n,i){return i?.ignoreWhitespace!=null&&!i.ignoreWhitespace?Le(e,n,i):be.diff(e,n,i)}function hn(e,n,i,r){if(n&&i){let l=M(n.value),t=z(n.value),o=M(i.value),u=z(i.value);if(e){let f=Ae(l,o);e.value=ue(e.value,o,f),n.value=q(n.value,f),i.value=q(i.value,f)}if(r){let f=we(t,u);r.value=te(r.value,u,f),n.value=X(n.value,f),i.value=X(i.value,f)}}else if(i){if(e){let l=M(i.value);i.value=i.value.substring(l.length)}if(r){let l=M(r.value);r.value=r.value.substring(l.length)}}else if(e&&r){let l=M(r.value),t=M(n.value),o=z(n.value),u=Ae(l,t);n.value=q(n.value,u);let f=we(q(l,u),o);n.value=X(n.value,f),r.value=te(r.value,l,f),e.value=ue(e.value,l,l.slice(0,l.length-f.length))}else if(r){let l=M(r.value),t=z(n.value),o=Ce(t,l);n.value=X(n.value,o)}else if(e){let l=z(e.value),t=M(n.value),o=Ce(l,t);n.value=q(n.value,o)}}var Se=class extends b{tokenize(n){let i=new RegExp(`(\\\\r?\\\\n)|[${fe}]+|[^\\\\S\\\\n\\\\r]+|[^${fe}]`,\"ug\");return n.match(i)||[]}},_e=new Se;function Le(e,n,i){return _e.diff(e,n,i)}function gn(e,n){if(typeof e==\"function\")n.callback=e;else if(e)for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}var Fe=class extends b{constructor(){super(...arguments),this.tokenize=Oe}equals(n,i,r){return r.ignoreWhitespace?((!r.newlineIsToken||!n.includes(`\n`))&&(n=n.trim()),(!r.newlineIsToken||!i.includes(`\n`))&&(i=i.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(n.endsWith(`\n`)&&(n=n.slice(0,-1)),i.endsWith(`\n`)&&(i=i.slice(0,-1))),super.equals(n,i,r)}},ce=new Fe;function N(e,n,i){return ce.diff(e,n,i)}function xn(e,n,i){return i=gn(i,{ignoreWhitespace:!0}),ce.diff(e,n,i)}function Oe(e,n){n.stripTrailingCr&&(e=e.replace(/\\r\\n/g,`\n`));let i=[],r=e.split(/(\\n|\\r\\n)/);r[r.length-1]||r.pop();for(let l=0;l<r.length;l++){let t=r[l];l%2&&!n.newlineIsToken?i[i.length-1]+=t:i.push(t)}return i}function Oi(e){return e==\".\"||e==\"!\"||e==\"?\"}var Ie=class extends b{tokenize(n){var i;let r=[],l=0;for(let t=0;t<n.length;t++){if(t==n.length-1){r.push(n.slice(l));break}if(Oi(n[t])&&n[t+1].match(/\\s/)){for(r.push(n.slice(l,t+1)),t=l=t+1;!((i=n[t+1])===null||i===void 0)&&i.match(/\\s/);)t++;r.push(n.slice(l,t+1)),l=t+1}}return r}},ke=new Ie;function vn(e,n,i){return ke.diff(e,n,i)}var Te=class extends b{tokenize(n){return n.split(/([{}:;,]|\\s+)/)}},Ne=new Te;function yn(e,n,i){return Ne.diff(e,n,i)}var De=class extends b{constructor(){super(...arguments),this.tokenize=Oe}get useLongestToken(){return!0}castInput(n,i){let{undefinedReplacement:r,stringifyReplacer:l=(t,o)=>typeof o>\"u\"?r:o}=i;return typeof n==\"string\"?n:JSON.stringify(V(n,null,null,l),null,\" \")}equals(n,i,r){return super.equals(n.replace(/,([\\r\\n])/g,\"$1\"),i.replace(/,([\\r\\n])/g,\"$1\"),r)}},Re=new De;function An(e,n,i){return Re.diff(e,n,i)}function V(e,n,i,r,l){n=n||[],i=i||[],r&&(e=r(l===void 0?\"\":l,e));let t;for(t=0;t<n.length;t+=1)if(n[t]===e)return i[t];let o;if(Object.prototype.toString.call(e)===\"[object Array]\"){for(n.push(e),o=new Array(e.length),i.push(o),t=0;t<e.length;t+=1)o[t]=V(e[t],n,i,r,String(t));return n.pop(),i.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==\"object\"&&e!==null){n.push(e),o={},i.push(o);let u=[],f;for(f in e)Object.prototype.hasOwnProperty.call(e,f)&&u.push(f);for(u.sort(),t=0;t<u.length;t+=1)f=u[t],o[f]=V(e[f],n,i,r,f);n.pop(),i.pop()}else o=e;return o}var Me=class extends b{tokenize(n){return n.slice()}join(n){return n}removeEmpty(n){return n}},Pe=new Me;function wn(e,n,i){return Pe.diff(e,n,i)}function We(e){return Array.isArray(e)?e.map(n=>We(n)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(n=>Object.assign(Object.assign({},n),{lines:n.lines.map((i,r)=>{var l;return i.startsWith(\"\\\\\")||i.endsWith(\"\\r\")||!((l=n.lines[r+1])===null||l===void 0)&&l.startsWith(\"\\\\\")?i:i+\"\\r\"})}))})}function He(e){return Array.isArray(e)?e.map(n=>He(n)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(n=>Object.assign(Object.assign({},n),{lines:n.lines.map(i=>i.endsWith(\"\\r\")?i.substring(0,i.length-1):i)}))})}function Cn(e){return Array.isArray(e)||(e=[e]),!e.some(n=>n.hunks.some(i=>i.lines.some(r=>!r.startsWith(\"\\\\\")&&r.endsWith(\"\\r\"))))}function En(e){return Array.isArray(e)||(e=[e]),e.some(n=>n.hunks.some(i=>i.lines.some(r=>r.endsWith(\"\\r\"))))&&e.every(n=>n.hunks.every(i=>i.lines.every((r,l)=>{var t;return r.startsWith(\"\\\\\")||r.endsWith(\"\\r\")||((t=i.lines[l+1])===null||t===void 0?void 0:t.startsWith(\"\\\\\"))})))}function Z(e){let n=e.split(/\\n/),i=[],r=0;function l(){let u={};for(i.push(u);r<n.length;){let f=n[r];if(/^(---|\\+\\+\\+|@@)\\s/.test(f))break;let c=/^(?:Index:|diff(?: -r \\w+)+)\\s+/.exec(f);c&&(u.index=f.substring(c[0].length).trim()),r++}for(t(u),t(u),u.hunks=[];r<n.length;){let f=n[r];if(/^(Index:\\s|diff\\s|---\\s|\\+\\+\\+\\s|===================================================================)/.test(f))break;if(/^@@/.test(f))u.hunks.push(o());else{if(f)throw new Error(\"Unknown line \"+(r+1)+\" \"+JSON.stringify(f));r++}}}function t(u){let f=/^(---|\\+\\+\\+)\\s+/.exec(n[r]);if(f){let c=f[1],s=n[r].substring(3).trim().split(\"\t\",2),a=(s[1]||\"\").trim(),p=s[0].replace(/\\\\\\\\/g,\"\\\\\");p.startsWith('\"')&&p.endsWith('\"')&&(p=p.substr(1,p.length-2)),c===\"---\"?(u.oldFileName=p,u.oldHeader=a):(u.newFileName=p,u.newHeader=a),r++}}function o(){var u;let f=r,c=n[r++],s=c.split(/@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/),a={oldStart:+s[1],oldLines:typeof s[2]>\"u\"?1:+s[2],newStart:+s[3],newLines:typeof s[4]>\"u\"?1:+s[4],lines:[]};a.oldLines===0&&(a.oldStart+=1),a.newLines===0&&(a.newStart+=1);let p=0,d=0;for(;r<n.length&&(d<a.oldLines||p<a.newLines||!((u=n[r])===null||u===void 0)&&u.startsWith(\"\\\\\"));r++){let h=n[r].length==0&&r!=n.length-1?\" \":n[r][0];if(h===\"+\"||h===\"-\"||h===\" \"||h===\"\\\\\")a.lines.push(n[r]),h===\"+\"?p++:h===\"-\"?d++:h===\" \"&&(p++,d++);else throw new Error(`Hunk at line ${f+1} contained invalid line ${n[r]}`)}if(!p&&a.newLines===1&&(a.newLines=0),!d&&a.oldLines===1&&(a.oldLines=0),p!==a.newLines)throw new Error(\"Added line count did not match for hunk at line \"+(f+1));if(d!==a.oldLines)throw new Error(\"Removed line count did not match for hunk at line \"+(f+1));return a}for(;r<n.length;)l();return i}function Sn(e,n,i){let r=!0,l=!1,t=!1,o=1;return function u(){if(r&&!t){if(l?o++:r=!1,e+o<=i)return e+o;t=!0}if(!l)return t||(r=!0),n<=e-o?e-o++:(l=!0,u())}}function je(e,n,i={}){let r;if(typeof n==\"string\"?r=Z(n):Array.isArray(n)?r=n:r=[n],r.length>1)throw new Error(\"applyPatch only works with a single input.\");return Ii(e,r[0],i)}function Ii(e,n,i={}){(i.autoConvertLineEndings||i.autoConvertLineEndings==null)&&(pn(e)&&Cn(n)?n=We(n):dn(e)&&En(n)&&(n=He(n)));let r=e.split(`\n`),l=n.hunks,t=i.compareLine||((h,g,y,w)=>g===w),o=i.fuzzFactor||0,u=0;if(o<0||!Number.isInteger(o))throw new Error(\"fuzzFactor must be a non-negative integer\");if(!l.length)return e;let f=\"\",c=!1,s=!1;for(let h=0;h<l[l.length-1].lines.length;h++){let g=l[l.length-1].lines[h];g[0]==\"\\\\\"&&(f[0]==\"+\"?c=!0:f[0]==\"-\"&&(s=!0)),f=g}if(c){if(s){if(!o&&r[r.length-1]==\"\")return!1}else if(r[r.length-1]==\"\")r.pop();else if(!o)return!1}else if(s){if(r[r.length-1]!=\"\")r.push(\"\");else if(!o)return!1}function a(h,g,y,w=0,m=!0,x=[],A=0){let C=0,F=!1;for(;w<h.length;w++){let E=h[w],S=E.length>0?E[0]:\" \",$=E.length>0?E.substr(1):E;if(S===\"-\")if(t(g+1,r[g],S,$))g++,C=0;else return!y||r[g]==null?null:(x[A]=r[g],a(h,g+1,y-1,w,!1,x,A+1));if(S===\"+\"){if(!m)return null;x[A]=$,A++,C=0,F=!0}if(S===\" \")if(C++,x[A]=r[g],t(g+1,r[g],S,$))A++,m=!0,F=!1,g++;else return F||!y?null:r[g]&&(a(h,g+1,y-1,w+1,!1,x,A+1)||a(h,g+1,y-1,w,!1,x,A+1))||a(h,g,y-1,w+1,!1,x,A)}return A-=C,g-=C,x.length=A,{patchedLines:x,oldLineLastI:g-1}}let p=[],d=0;for(let h=0;h<l.length;h++){let g=l[h],y,w=r.length-g.oldLines+o,m;for(let x=0;x<=o;x++){m=g.oldStart+d-1;let A=Sn(m,u,w);for(;m!==void 0&&(y=a(g.lines,m,x),!y);m=A());if(y)break}if(!y)return!1;for(let x=u;x<m;x++)p.push(r[x]);for(let x=0;x<y.patchedLines.length;x++){let A=y.patchedLines[x];p.push(A)}u=y.oldLineLastI+1,d=m+1-g.oldStart}for(let h=u;h<r.length;h++)p.push(r[h]);return p.join(`\n`)}function bn(e,n){let i=typeof e==\"string\"?Z(e):e,r=0;function l(){let t=i[r++];if(!t)return n.complete();n.loadFile(t,function(o,u){if(o)return n.complete(o);let f=je(u,t,n);n.patched(t,f,function(c){if(c)return n.complete(c);l()})})}l()}function Be(e){return Array.isArray(e)?e.map(n=>Be(n)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(n=>({oldLines:n.newLines,oldStart:n.newStart,newLines:n.oldLines,newStart:n.oldStart,lines:n.lines.map(i=>i.startsWith(\"-\")?`+${i.slice(1)}`:i.startsWith(\"+\")?`-${i.slice(1)}`:i)}))})}var Ue={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0},_n={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0},Ln={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function ae(e,n,i,r,l,t,o){let u;o?typeof o==\"function\"?u={callback:o}:u=o:u={},typeof u.context>\"u\"&&(u.context=4);let f=u.context;if(u.newlineIsToken)throw new Error(\"newlineIsToken may not be used with patch-generation functions, only with diffing functions\");if(u.callback){let{callback:s}=u;N(i,r,Object.assign(Object.assign({},u),{callback:a=>{let p=c(a);s(p)}}))}else return c(N(i,r,u));function c(s){if(!s)return;s.push({value:\"\",lines:[]});function a(m){return m.map(function(x){return\" \"+x})}let p=[],d=0,h=0,g=[],y=1,w=1;for(let m=0;m<s.length;m++){let x=s[m],A=x.lines||ki(x.value);if(x.lines=A,x.added||x.removed){if(!d){let C=s[m-1];d=y,h=w,C&&(g=f>0?a(C.lines.slice(-f)):[],d-=g.length,h-=g.length)}for(let C of A)g.push((x.added?\"+\":\"-\")+C);x.added?w+=A.length:y+=A.length}else{if(d)if(A.length<=f*2&&m<s.length-2)for(let C of a(A))g.push(C);else{let C=Math.min(A.length,f);for(let E of a(A.slice(0,C)))g.push(E);let F={oldStart:d,oldLines:y-d+C,newStart:h,newLines:w-h+C,lines:g};p.push(F),d=0,h=0,g=[]}y+=A.length,w+=A.length}}for(let m of p)for(let x=0;x<m.lines.length;x++)m.lines[x].endsWith(`\n`)?m.lines[x]=m.lines[x].slice(0,-1):(m.lines.splice(x+1,0,\"\\\\"),x++);return{oldFileName:e,newFileName:n,oldHeader:l,newHeader:t,hunks:p}}}function ee(e,n){if(n||(n=Ue),Array.isArray(e)){if(e.length>1&&!n.includeFileHeaders)throw new Error(\"Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)\");return e.map(r=>ee(r,n)).join(`\n`)}let i=[];n.includeIndex&&e.oldFileName==e.newFileName&&i.push(\"Index: \"+e.oldFileName),n.includeUnderline&&i.push(\"===================================================================\"),n.includeFileHeaders&&(i.push(\"--- \"+e.oldFileName+(typeof e.oldHeader>\"u\"?\"\":\"\t\"+e.oldHeader)),i.push(\"+++ \"+e.newFileName+(typeof e.newHeader>\"u\"?\"\":\"\t\"+e.newHeader)));for(let r=0;r<e.hunks.length;r++){let l=e.hunks[r];l.oldLines===0&&(l.oldStart-=1),l.newLines===0&&(l.newStart-=1),i.push(\"@@ -\"+l.oldStart+\",\"+l.oldLines+\" +\"+l.newStart+\",\"+l.newLines+\" @@\");for(let t of l.lines)i.push(t)}return i.join(`\n`)+`\n`}function Ye(e,n,i,r,l,t,o){if(typeof o==\"function\"&&(o={callback:o}),o?.callback){let{callback:u}=o;ae(e,n,i,r,l,t,Object.assign(Object.assign({},o),{callback:f=>{u(f?ee(f,o.headerOptions):void 0)}}))}else{let u=ae(e,n,i,r,l,t,o);return u?ee(u,o?.headerOptions):void 0}}function Fn(e,n,i,r,l,t){return Ye(e,e,n,i,r,l,t)}function ki(e){let n=e.endsWith(`\n`),i=e.split(`\n`).map(r=>r+`\n`);return n?i.pop():i.push(i.pop().slice(0,-1)),i}function On(e){let n=[],i,r;for(let l=0;l<e.length;l++)i=e[l],i.added?r=1:i.removed?r=-1:r=0,n.push([r,i.value]);return n}function In(e){let n=[];for(let i=0;i<e.length;i++){let r=e[i];r.added?n.push(\"<ins>\"):r.removed&&n.push(\"<del>\"),n.push(Ti(r.value)),r.added?n.push(\"</ins>\"):r.removed&&n.push(\"</del>\")}return n.join(\"\")}function Ti(e){let n=e;return n=n.replace(/&/g,\"&\"),n=n.replace(/</g,\"<\"),n=n.replace(/>/g,\">\"),n=n.replace(/\"/g,\""\"),n}function zn(e){return typeof e>\"u\"||e===null}function Ni(e){return typeof e==\"object\"&&e!==null}function Di(e){return Array.isArray(e)?e:zn(e)?[]:[e]}function Ri(e,n){var i,r,l,t;if(n)for(t=Object.keys(n),i=0,r=t.length;i<r;i+=1)l=t[i],e[l]=n[l];return e}function Mi(e,n){var i=\"\",r;for(r=0;r<n;r+=1)i+=e;return i}function Pi(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Wi=zn,Hi=Ni,ji=Di,Bi=Mi,Ui=Pi,Yi=Ri,L={isNothing:Wi,isObject:Hi,toArray:ji,repeat:Bi,isNegativeZero:Ui,extend:Yi};function Gn(e,n){var i=\"\",r=e.reason||\"(unknown reason)\";return e.mark?(e.mark.name&&(i+='in \"'+e.mark.name+'\" '),i+=\"(\"+(e.mark.line+1)+\":\"+(e.mark.column+1)+\")\",!n&&e.mark.snippet&&(i+=`\n\n`+e.mark.snippet),r+\" \"+i):r}function ie(e,n){Error.call(this),this.name=\"YAMLException\",this.reason=e,this.mark=n,this.message=Gn(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||\"\"}ie.prototype=Object.create(Error.prototype);ie.prototype.constructor=ie;ie.prototype.toString=function(n){return this.name+\": \"+Gn(this,n)};var k=ie;function qe(e,n,i,r,l){var t=\"\",o=\"\",u=Math.floor(l/2)-1;return r-n>u&&(t=\" ... \",n=r-u+t.length),i-r>u&&(o=\" ...\",i=r+u-o.length),{str:t+e.slice(n,i).replace(/\\t/g,\"\\u2192\")+o,pos:r-n+t.length}}function ze(e,n){return L.repeat(\" \",n-e.length)+e}function $i(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!=\"number\"&&(n.indent=1),typeof n.linesBefore!=\"number\"&&(n.linesBefore=3),typeof n.linesAfter!=\"number\"&&(n.linesAfter=2);for(var i=/\\r?\\n|\\r|\\0/g,r=[0],l=[],t,o=-1;t=i.exec(e.buffer);)l.push(t.index),r.push(t.index+t[0].length),e.position<=t.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var u=\"\",f,c,s=Math.min(e.line+n.linesAfter,l.length).toString().length,a=n.maxLength-(n.indent+s+3);for(f=1;f<=n.linesBefore&&!(o-f<0);f++)c=qe(e.buffer,r[o-f],l[o-f],e.position-(r[o]-r[o-f]),a),u=L.repeat(\" \",n.indent)+ze((e.line-f+1).toString(),s)+\" | \"+c.str+`\n`+u;for(c=qe(e.buffer,r[o],l[o],e.position,a),u+=L.repeat(\" \",n.indent)+ze((e.line+1).toString(),s)+\" | \"+c.str+`\n`,u+=L.repeat(\"-\",n.indent+s+3+c.pos)+`^\n`,f=1;f<=n.linesAfter&&!(o+f>=l.length);f++)c=qe(e.buffer,r[o+f],l[o+f],e.position-(r[o]-r[o+f]),a),u+=L.repeat(\" \",n.indent)+ze((e.line+f+1).toString(),s)+\" | \"+c.str+`\n`;return u.replace(/\\n$/,\"\")}var qi=$i,zi=[\"kind\",\"multi\",\"resolve\",\"construct\",\"instanceOf\",\"predicate\",\"represent\",\"representName\",\"defaultStyle\",\"styleAliases\"],Gi=[\"scalar\",\"sequence\",\"mapping\"];function Ji(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(r){n[String(r)]=i})}),n}function Ki(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(zi.indexOf(i)===-1)throw new k('Unknown option \"'+i+'\" is met in definition of \"'+e+'\" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Ji(n.styleAliases||null),Gi.indexOf(this.kind)===-1)throw new k('Unknown kind \"'+this.kind+'\" is specified for \"'+e+'\" YAML type.')}var O=Ki;function kn(e,n){var i=[];return e[n].forEach(function(r){var l=i.length;i.forEach(function(t,o){t.tag===r.tag&&t.kind===r.kind&&t.multi===r.multi&&(l=o)}),i[l]=r}),i}function Qi(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function r(l){l.multi?(e.multi[l.kind].push(l),e.multi.fallback.push(l)):e[l.kind][l.tag]=e.fallback[l.tag]=l}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(r);return e}function Je(e){return this.extend(e)}Je.prototype.extend=function(n){var i=[],r=[];if(n instanceof O)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new k(\"Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })\");i.forEach(function(t){if(!(t instanceof O))throw new k(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\");if(t.loadKind&&t.loadKind!==\"scalar\")throw new k(\"There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.\");if(t.multi)throw new k(\"There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.\")}),r.forEach(function(t){if(!(t instanceof O))throw new k(\"Specified list of YAML types (or a single Type object) contains a non-Type object.\")});var l=Object.create(Je.prototype);return l.implicit=(this.implicit||[]).concat(i),l.explicit=(this.explicit||[]).concat(r),l.compiledImplicit=kn(l,\"implicit\"),l.compiledExplicit=kn(l,\"explicit\"),l.compiledTypeMap=Qi(l.compiledImplicit,l.compiledExplicit),l};var Xi=Je,Vi=new O(\"tag:yaml.org,2002:str\",{kind:\"scalar\",construct:function(e){return e!==null?e:\"\"}}),Zi=new O(\"tag:yaml.org,2002:seq\",{kind:\"sequence\",construct:function(e){return e!==null?e:[]}}),er=new O(\"tag:yaml.org,2002:map\",{kind:\"mapping\",construct:function(e){return e!==null?e:{}}}),nr=new Xi({explicit:[Vi,Zi,er]});function ir(e){if(e===null)return!0;var n=e.length;return n===1&&e===\"~\"||n===4&&(e===\"null\"||e===\"Null\"||e===\"NULL\")}function rr(){return null}function lr(e){return e===null}var or=new O(\"tag:yaml.org,2002:null\",{kind:\"scalar\",resolve:ir,construct:rr,predicate:lr,represent:{canonical:function(){return\"~\"},lowercase:function(){return\"null\"},uppercase:function(){return\"NULL\"},camelcase:function(){return\"Null\"},empty:function(){return\"\"}},defaultStyle:\"lowercase\"});function tr(e){if(e===null)return!1;var n=e.length;return n===4&&(e===\"true\"||e===\"True\"||e===\"TRUE\")||n===5&&(e===\"false\"||e===\"False\"||e===\"FALSE\")}function ur(e){return e===\"true\"||e===\"True\"||e===\"TRUE\"}function fr(e){return Object.prototype.toString.call(e)===\"[object Boolean]\"}var cr=new O(\"tag:yaml.org,2002:bool\",{kind:\"scalar\",resolve:tr,construct:ur,predicate:fr,represent:{lowercase:function(e){return e?\"true\":\"false\"},uppercase:function(e){return e?\"TRUE\":\"FALSE\"},camelcase:function(e){return e?\"True\":\"False\"}},defaultStyle:\"lowercase\"});function ar(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function sr(e){return 48<=e&&e<=55}function pr(e){return 48<=e&&e<=57}function dr(e){if(e===null)return!1;var n=e.length,i=0,r=!1,l;if(!n)return!1;if(l=e[i],(l===\"-\"||l===\"+\")&&(l=e[++i]),l===\"0\"){if(i+1===n)return!0;if(l=e[++i],l===\"b\"){for(i++;i<n;i++)if(l=e[i],l!==\"_\"){if(l!==\"0\"&&l!==\"1\")return!1;r=!0}return r&&l!==\"_\"}if(l===\"x\"){for(i++;i<n;i++)if(l=e[i],l!==\"_\"){if(!ar(e.charCodeAt(i)))return!1;r=!0}return r&&l!==\"_\"}if(l===\"o\"){for(i++;i<n;i++)if(l=e[i],l!==\"_\"){if(!sr(e.charCodeAt(i)))return!1;r=!0}return r&&l!==\"_\"}}if(l===\"_\")return!1;for(;i<n;i++)if(l=e[i],l!==\"_\"){if(!pr(e.charCodeAt(i)))return!1;r=!0}return!(!r||l===\"_\")}function hr(e){var n=e,i=1,r;if(n.indexOf(\"_\")!==-1&&(n=n.replace(/_/g,\"\")),r=n[0],(r===\"-\"||r===\"+\")&&(r===\"-\"&&(i=-1),n=n.slice(1),r=n[0]),n===\"0\")return 0;if(r===\"0\"){if(n[1]===\"b\")return i*parseInt(n.slice(2),2);if(n[1]===\"x\")return i*parseInt(n.slice(2),16);if(n[1]===\"o\")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function mr(e){return Object.prototype.toString.call(e)===\"[object Number]\"&&e%1===0&&!L.isNegativeZero(e)}var gr=new O(\"tag:yaml.org,2002:int\",{kind:\"scalar\",resolve:dr,construct:hr,predicate:mr,represent:{binary:function(e){return e>=0?\"0b\"+e.toString(2):\"-0b\"+e.toString(2).slice(1)},octal:function(e){return e>=0?\"0o\"+e.toString(8):\"-0o\"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?\"0x\"+e.toString(16).toUpperCase():\"-0x\"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:\"decimal\",styleAliases:{binary:[2,\"bin\"],octal:[8,\"oct\"],decimal:[10,\"dec\"],hexadecimal:[16,\"hex\"]}}),xr=new RegExp(\"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$\");function vr(e){return!(e===null||!xr.test(e)||e[e.length-1]===\"_\")}function yr(e){var n,i;return n=e.replace(/_/g,\"\").toLowerCase(),i=n[0]===\"-\"?-1:1,\"+-\".indexOf(n[0])>=0&&(n=n.slice(1)),n===\".inf\"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===\".nan\"?NaN:i*parseFloat(n,10)}var Ar=/^[-+]?[0-9]+e/;function wr(e,n){var i;if(isNaN(e))switch(n){case\"lowercase\":return\".nan\";case\"uppercase\":return\".NAN\";case\"camelcase\":return\".NaN\"}else if(Number.POSITIVE_INFINITY===e)switch(n){case\"lowercase\":return\".inf\";case\"uppercase\":return\".INF\";case\"camelcase\":return\".Inf\"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case\"lowercase\":return\"-.inf\";case\"uppercase\":return\"-.INF\";case\"camelcase\":return\"-.Inf\"}else if(L.isNegativeZero(e))return\"-0.0\";return i=e.toString(10),Ar.test(i)?i.replace(\"e\",\".e\"):i}function Cr(e){return Object.prototype.toString.call(e)===\"[object Number]\"&&(e%1!==0||L.isNegativeZero(e))}var Er=new O(\"tag:yaml.org,2002:float\",{kind:\"scalar\",resolve:vr,construct:yr,predicate:Cr,represent:wr,defaultStyle:\"lowercase\"}),Sr=nr.extend({implicit:[or,cr,gr,Er]}),br=Sr,Jn=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$\"),Kn=new RegExp(\"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\\\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\\\.([0-9]*))?(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$\");function _r(e){return e===null?!1:Jn.exec(e)!==null||Kn.exec(e)!==null}function Lr(e){var n,i,r,l,t,o,u,f=0,c=null,s,a,p;if(n=Jn.exec(e),n===null&&(n=Kn.exec(e)),n===null)throw new Error(\"Date resolve error\");if(i=+n[1],r=+n[2]-1,l=+n[3],!n[4])return new Date(Date.UTC(i,r,l));if(t=+n[4],o=+n[5],u=+n[6],n[7]){for(f=n[7].slice(0,3);f.length<3;)f+=\"0\";f=+f}return n[9]&&(s=+n[10],a=+(n[11]||0),c=(s*60+a)*6e4,n[9]===\"-\"&&(c=-c)),p=new Date(Date.UTC(i,r,l,t,o,u,f)),c&&p.setTime(p.getTime()-c),p}function Fr(e){return e.toISOString()}var Or=new O(\"tag:yaml.org,2002:timestamp\",{kind:\"scalar\",resolve:_r,construct:Lr,instanceOf:Date,represent:Fr});function Ir(e){return e===\"<<\"||e===null}var kr=new O(\"tag:yaml.org,2002:merge\",{kind:\"scalar\",resolve:Ir}),Ze=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\\r`;function Tr(e){if(e===null)return!1;var n,i,r=0,l=e.length,t=Ze;for(i=0;i<l;i++)if(n=t.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function Nr(e){var n,i,r=e.replace(/[\\r\\n=]/g,\"\"),l=r.length,t=Ze,o=0,u=[];for(n=0;n<l;n++)n%4===0&&n&&(u.push(o>>16&255),u.push(o>>8&255),u.push(o&255)),o=o<<6|t.indexOf(r.charAt(n));return i=l%4*6,i===0?(u.push(o>>16&255),u.push(o>>8&255),u.push(o&255)):i===18?(u.push(o>>10&255),u.push(o>>2&255)):i===12&&u.push(o>>4&255),new Uint8Array(u)}function Dr(e){var n=\"\",i=0,r,l,t=e.length,o=Ze;for(r=0;r<t;r++)r%3===0&&r&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]),i=(i<<8)+e[r];return l=t%3,l===0?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]):l===2?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):l===1&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}function Rr(e){return Object.prototype.toString.call(e)===\"[object Uint8Array]\"}var Mr=new O(\"tag:yaml.org,2002:binary\",{kind:\"scalar\",resolve:Tr,construct:Nr,predicate:Rr,represent:Dr}),Pr=Object.prototype.hasOwnProperty,Wr=Object.prototype.toString;function Hr(e){if(e===null)return!0;var n=[],i,r,l,t,o,u=e;for(i=0,r=u.length;i<r;i+=1){if(l=u[i],o=!1,Wr.call(l)!==\"[object Object]\")return!1;for(t in l)if(Pr.call(l,t))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(t)===-1)n.push(t);else return!1}return!0}function jr(e){return e!==null?e:[]}var Br=new O(\"tag:yaml.org,2002:omap\",{kind:\"sequence\",resolve:Hr,construct:jr}),Ur=Object.prototype.toString;function Yr(e){if(e===null)return!0;var n,i,r,l,t,o=e;for(t=new Array(o.length),n=0,i=o.length;n<i;n+=1){if(r=o[n],Ur.call(r)!==\"[object Object]\"||(l=Object.keys(r),l.length!==1))return!1;t[n]=[l[0],r[l[0]]]}return!0}function $r(e){if(e===null)return[];var n,i,r,l,t,o=e;for(t=new Array(o.length),n=0,i=o.length;n<i;n+=1)r=o[n],l=Object.keys(r),t[n]=[l[0],r[l[0]]];return t}var qr=new O(\"tag:yaml.org,2002:pairs\",{kind:\"sequence\",resolve:Yr,construct:$r}),zr=Object.prototype.hasOwnProperty;function Gr(e){if(e===null)return!0;var n,i=e;for(n in i)if(zr.call(i,n)&&i[n]!==null)return!1;return!0}function Jr(e){return e!==null?e:{}}var Kr=new O(\"tag:yaml.org,2002:set\",{kind:\"mapping\",resolve:Gr,construct:Jr}),Qn=br.extend({implicit:[Or,kr],explicit:[Mr,Br,qr,Kr]}),j=Object.prototype.hasOwnProperty,se=1,Xn=2,Vn=3,pe=4,Ge=1,Qr=2,Tn=3,Xr=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,Vr=/[\\x85\\u2028\\u2029]/,Zr=/[,\\[\\]\\{\\}]/,Zn=/^(?:!|!!|![a-z\\-]+!)$/i,ei=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;function Nn(e){return Object.prototype.toString.call(e)}function R(e){return e===10||e===13}function Y(e){return e===9||e===32}function T(e){return e===9||e===32||e===10||e===13}function J(e){return e===44||e===91||e===93||e===123||e===125}function el(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function nl(e){return e===120?2:e===117?4:e===85?8:0}function il(e){return 48<=e&&e<=57?e-48:-1}function Dn(e){return e===48?\"\\0\":e===97?\"\\x07\":e===98?\"\\b\":e===116||e===9?\"\t\":e===110?`\n`:e===118?\"\\v\":e===102?\"\\f\":e===114?\"\\r\":e===101?\"\\x1B\":e===32?\" \":e===34?'\"':e===47?\"/\":e===92?\"\\\\\":e===78?\"\\x85\":e===95?\"\\xA0\":e===76?\"\\u2028\":e===80?\"\\u2029\":\"\"}function rl(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function ni(e,n,i){n===\"__proto__\"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var ii=new Array(256),ri=new Array(256);for(U=0;U<256;U++)ii[U]=Dn(U)?1:0,ri[U]=Dn(U);var U;function ll(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Qn,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function li(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=qi(i),new k(n,i)}function v(e,n){throw li(e,n)}function de(e,n){e.onWarning&&e.onWarning.call(null,li(e,n))}var Rn={YAML:function(n,i,r){var l,t,o;n.version!==null&&v(n,\"duplication of %YAML directive\"),r.length!==1&&v(n,\"YAML directive accepts exactly one argument\"),l=/^([0-9]+)\\.([0-9]+)$/.exec(r[0]),l===null&&v(n,\"ill-formed argument of the YAML directive\"),t=parseInt(l[1],10),o=parseInt(l[2],10),t!==1&&v(n,\"unacceptable YAML version of the document\"),n.version=r[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&de(n,\"unsupported YAML version of the document\")},TAG:function(n,i,r){var l,t;r.length!==2&&v(n,\"TAG directive accepts exactly two arguments\"),l=r[0],t=r[1],Zn.test(l)||v(n,\"ill-formed tag handle (first argument) of the TAG directive\"),j.call(n.tagMap,l)&&v(n,'there is a previously declared suffix for \"'+l+'\" tag handle'),ei.test(t)||v(n,\"ill-formed tag prefix (second argument) of the TAG directive\");try{t=decodeURIComponent(t)}catch{v(n,\"tag prefix is malformed: \"+t)}n.tagMap[l]=t}};function H(e,n,i,r){var l,t,o,u;if(n<i){if(u=e.input.slice(n,i),r)for(l=0,t=u.length;l<t;l+=1)o=u.charCodeAt(l),o===9||32<=o&&o<=1114111||v(e,\"expected valid JSON character\");else Xr.test(u)&&v(e,\"the stream contains non-printable characters\");e.result+=u}}function Mn(e,n,i,r){var l,t,o,u;for(L.isObject(i)||v(e,\"cannot merge mappings; the provided source object is unacceptable\"),l=Object.keys(i),o=0,u=l.length;o<u;o+=1)t=l[o],j.call(n,t)||(ni(n,t,i[t]),r[t]=!0)}function K(e,n,i,r,l,t,o,u,f){var c,s;if(Array.isArray(l))for(l=Array.prototype.slice.call(l),c=0,s=l.length;c<s;c+=1)Array.isArray(l[c])&&v(e,\"nested arrays are not supported inside keys\"),typeof l==\"object\"&&Nn(l[c])===\"[object Object]\"&&(l[c]=\"[object Object]\");if(typeof l==\"object\"&&Nn(l)===\"[object Object]\"&&(l=\"[object Object]\"),l=String(l),n===null&&(n={}),r===\"tag:yaml.org,2002:merge\")if(Array.isArray(t))for(c=0,s=t.length;c<s;c+=1)Mn(e,n,t[c],i);else Mn(e,n,t,i);else!e.json&&!j.call(i,l)&&j.call(n,l)&&(e.line=o||e.line,e.lineStart=u||e.lineStart,e.position=f||e.position,v(e,\"duplicated mapping key\")),ni(n,l,t),delete i[l];return n}function en(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):v(e,\"a line break is expected\"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function _(e,n,i){for(var r=0,l=e.input.charCodeAt(e.position);l!==0;){for(;Y(l);)l===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),l=e.input.charCodeAt(++e.position);if(n&&l===35)do l=e.input.charCodeAt(++e.position);while(l!==10&&l!==13&&l!==0);if(R(l))for(en(e),l=e.input.charCodeAt(e.position),r++,e.lineIndent=0;l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);else break}return i!==-1&&r!==0&&e.lineIndent<i&&de(e,\"deficient indentation\"),r}function ge(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||T(i)))}function nn(e,n){n===1?e.result+=\" \":n>1&&(e.result+=L.repeat(`\n`,n-1))}function ol(e,n,i){var r,l,t,o,u,f,c,s,a=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),T(d)||J(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(l=e.input.charCodeAt(e.position+1),T(l)||i&&J(l)))return!1;for(e.kind=\"scalar\",e.result=\"\",t=o=e.position,u=!1;d!==0;){if(d===58){if(l=e.input.charCodeAt(e.position+1),T(l)||i&&J(l))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),T(r))break}else{if(e.position===e.lineStart&&ge(e)||i&&J(d))break;if(R(d))if(f=e.line,c=e.lineStart,s=e.lineIndent,_(e,!1,-1),e.lineIndent>=n){u=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=f,e.lineStart=c,e.lineIndent=s;break}}u&&(H(e,t,o,!1),nn(e,e.line-f),t=o=e.position,u=!1),Y(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return H(e,t,o,!1),e.result?!0:(e.kind=a,e.result=p,!1)}function tl(e,n){var i,r,l;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind=\"scalar\",e.result=\"\",e.position++,r=l=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(H(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)r=e.position,e.position++,l=e.position;else return!0;else R(i)?(H(e,r,l,!0),nn(e,_(e,!1,n)),r=l=e.position):e.position===e.lineStart&&ge(e)?v(e,\"unexpected end of the document within a single quoted scalar\"):(e.position++,l=e.position);v(e,\"unexpected end of the stream within a single quoted scalar\")}function ul(e,n){var i,r,l,t,o,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind=\"scalar\",e.result=\"\",e.position++,i=r=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return H(e,i,e.position,!0),e.position++,!0;if(u===92){if(H(e,i,e.position,!0),u=e.input.charCodeAt(++e.position),R(u))_(e,!1,n);else if(u<256&&ii[u])e.result+=ri[u],e.position++;else if((o=nl(u))>0){for(l=o,t=0;l>0;l--)u=e.input.charCodeAt(++e.position),(o=el(u))>=0?t=(t<<4)+o:v(e,\"expected hexadecimal character\");e.result+=rl(t),e.position++}else v(e,\"unknown escape sequence\");i=r=e.position}else R(u)?(H(e,i,r,!0),nn(e,_(e,!1,n)),i=r=e.position):e.position===e.lineStart&&ge(e)?v(e,\"unexpected end of the document within a double quoted scalar\"):(e.position++,r=e.position)}v(e,\"unexpected end of the stream within a double quoted scalar\")}function fl(e,n){var i=!0,r,l,t,o=e.tag,u,f=e.anchor,c,s,a,p,d,h=Object.create(null),g,y,w,m;if(m=e.input.charCodeAt(e.position),m===91)s=93,d=!1,u=[];else if(m===123)s=125,d=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),m=e.input.charCodeAt(++e.position);m!==0;){if(_(e,!0,n),m=e.input.charCodeAt(e.position),m===s)return e.position++,e.tag=o,e.anchor=f,e.kind=d?\"mapping\":\"sequence\",e.result=u,!0;i?m===44&&v(e,\"expected the node content, but found ','\"):v(e,\"missed comma between flow collection entries\"),y=g=w=null,a=p=!1,m===63&&(c=e.input.charCodeAt(e.position+1),T(c)&&(a=p=!0,e.position++,_(e,!0,n))),r=e.line,l=e.lineStart,t=e.position,Q(e,n,se,!1,!0),y=e.tag,g=e.result,_(e,!0,n),m=e.input.charCodeAt(e.position),(p||e.line===r)&&m===58&&(a=!0,m=e.input.charCodeAt(++e.position),_(e,!0,n),Q(e,n,se,!1,!0),w=e.result),d?K(e,u,h,y,g,w,r,l,t):a?u.push(K(e,null,h,y,g,w,r,l,t)):u.push(g),_(e,!0,n),m=e.input.charCodeAt(e.position),m===44?(i=!0,m=e.input.charCodeAt(++e.position)):i=!1}v(e,\"unexpected end of the stream within a flow collection\")}function cl(e,n){var i,r,l=Ge,t=!1,o=!1,u=n,f=0,c=!1,s,a;if(a=e.input.charCodeAt(e.position),a===124)r=!1;else if(a===62)r=!0;else return!1;for(e.kind=\"scalar\",e.result=\"\";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)Ge===l?l=a===43?Tn:Qr:v(e,\"repeat of a chomping mode identifier\");else if((s=il(a))>=0)s===0?v(e,\"bad explicit indentation width of a block scalar; it cannot be less than one\"):o?v(e,\"repeat of an indentation width identifier\"):(u=n+s-1,o=!0);else break;if(Y(a)){do a=e.input.charCodeAt(++e.position);while(Y(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!R(a)&&a!==0)}for(;a!==0;){for(en(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!o||e.lineIndent<u)&&a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>u&&(u=e.lineIndent),R(a)){f++;continue}if(e.lineIndent<u){l===Tn?e.result+=L.repeat(`\n`,t?1+f:f):l===Ge&&t&&(e.result+=`\n`);break}for(r?Y(a)?(c=!0,e.result+=L.repeat(`\n`,t?1+f:f)):c?(c=!1,e.result+=L.repeat(`\n`,f+1)):f===0?t&&(e.result+=\" \"):e.result+=L.repeat(`\n`,f):e.result+=L.repeat(`\n`,t?1+f:f),t=!0,o=!0,f=0,i=e.position;!R(a)&&a!==0;)a=e.input.charCodeAt(++e.position);H(e,i,e.position,!1)}return!0}function Pn(e,n){var i,r=e.tag,l=e.anchor,t=[],o,u=!1,f;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=t),f=e.input.charCodeAt(e.position);f!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,\"tab characters must not be used in indentation\")),!(f!==45||(o=e.input.charCodeAt(e.position+1),!T(o))));){if(u=!0,e.position++,_(e,!0,-1)&&e.lineIndent<=n){t.push(null),f=e.input.charCodeAt(e.position);continue}if(i=e.line,Q(e,n,Vn,!1,!0),t.push(e.result),_(e,!0,-1),f=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&f!==0)v(e,\"bad indentation of a sequence entry\");else if(e.lineIndent<n)break}return u?(e.tag=r,e.anchor=l,e.kind=\"sequence\",e.result=t,!0):!1}function al(e,n,i){var r,l,t,o,u,f,c=e.tag,s=e.anchor,a={},p=Object.create(null),d=null,h=null,g=null,y=!1,w=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),m=e.input.charCodeAt(e.position);m!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,\"tab characters must not be used in indentation\")),r=e.input.charCodeAt(e.position+1),t=e.line,(m===63||m===58)&&T(r))m===63?(y&&(K(e,a,p,d,h,null,o,u,f),d=h=g=null),w=!0,y=!0,l=!0):y?(y=!1,l=!0):v(e,\"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line\"),e.position+=1,m=r;else{if(o=e.line,u=e.lineStart,f=e.position,!Q(e,i,Xn,!1,!0))break;if(e.line===t){for(m=e.input.charCodeAt(e.position);Y(m);)m=e.input.charCodeAt(++e.position);if(m===58)m=e.input.charCodeAt(++e.position),T(m)||v(e,\"a whitespace character is expected after the key-value separator within a block mapping\"),y&&(K(e,a,p,d,h,null,o,u,f),d=h=g=null),w=!0,y=!1,l=!1,d=e.tag,h=e.result;else if(w)v(e,\"can not read an implicit mapping pair; a colon is missed\");else return e.tag=c,e.anchor=s,!0}else if(w)v(e,\"can not read a block mapping entry; a multiline key may not be an implicit key\");else return e.tag=c,e.anchor=s,!0}if((e.line===t||e.lineIndent>n)&&(y&&(o=e.line,u=e.lineStart,f=e.position),Q(e,n,pe,!0,l)&&(y?h=e.result:g=e.result),y||(K(e,a,p,d,h,g,o,u,f),d=h=g=null),_(e,!0,-1),m=e.input.charCodeAt(e.position)),(e.line===t||e.lineIndent>n)&&m!==0)v(e,\"bad indentation of a mapping entry\");else if(e.lineIndent<n)break}return y&&K(e,a,p,d,h,null,o,u,f),w&&(e.tag=c,e.anchor=s,e.kind=\"mapping\",e.result=a),w}function sl(e){var n,i=!1,r=!1,l,t,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&v(e,\"duplication of a tag property\"),o=e.input.charCodeAt(++e.position),o===60?(i=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,l=\"!!\",o=e.input.charCodeAt(++e.position)):l=\"!\",n=e.position,i){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(t=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):v(e,\"unexpected end of the stream within a verbatim tag\")}else{for(;o!==0&&!T(o);)o===33&&(r?v(e,\"tag suffix cannot contain exclamation marks\"):(l=e.input.slice(n-1,e.position+1),Zn.test(l)||v(e,\"named tag handle cannot contain such characters\"),r=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);t=e.input.slice(n,e.position),Zr.test(t)&&v(e,\"tag suffix cannot contain flow indicator characters\")}t&&!ei.test(t)&&v(e,\"tag name cannot contain such characters: \"+t);try{t=decodeURIComponent(t)}catch{v(e,\"tag name is malformed: \"+t)}return i?e.tag=t:j.call(e.tagMap,l)?e.tag=e.tagMap[l]+t:l===\"!\"?e.tag=\"!\"+t:l===\"!!\"?e.tag=\"tag:yaml.org,2002:\"+t:v(e,'undeclared tag handle \"'+l+'\"'),!0}function pl(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&v(e,\"duplication of an anchor property\"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!T(i)&&!J(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&v(e,\"name of an anchor node must contain at least one character\"),e.anchor=e.input.slice(n,e.position),!0}function dl(e){var n,i,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!T(r)&&!J(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&v(e,\"name of an alias node must contain at least one character\"),i=e.input.slice(n,e.position),j.call(e.anchorMap,i)||v(e,'unidentified alias \"'+i+'\"'),e.result=e.anchorMap[i],_(e,!0,-1),!0}function Q(e,n,i,r,l){var t,o,u,f=1,c=!1,s=!1,a,p,d,h,g,y;if(e.listener!==null&&e.listener(\"open\",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,t=o=u=pe===i||Vn===i,r&&_(e,!0,-1)&&(c=!0,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)),f===1)for(;sl(e)||pl(e);)_(e,!0,-1)?(c=!0,u=t,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)):u=!1;if(u&&(u=c||l),(f===1||pe===i)&&(se===i||Xn===i?g=n:g=n+1,y=e.position-e.lineStart,f===1?u&&(Pn(e,y)||al(e,y,g))||fl(e,g)?s=!0:(o&&cl(e,g)||tl(e,g)||ul(e,g)?s=!0:dl(e)?(s=!0,(e.tag!==null||e.anchor!==null)&&v(e,\"alias node should not have any properties\")):ol(e,g,se===i)&&(s=!0,e.tag===null&&(e.tag=\"?\")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):f===0&&(s=u&&Pn(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===\"?\"){for(e.result!==null&&e.kind!==\"scalar\"&&v(e,'unacceptable node kind for !<?> tag; it should be \"scalar\", not \"'+e.kind+'\"'),a=0,p=e.implicitTypes.length;a<p;a+=1)if(h=e.implicitTypes[a],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==\"!\"){if(j.call(e.typeMap[e.kind||\"fallback\"],e.tag))h=e.typeMap[e.kind||\"fallback\"][e.tag];else for(h=null,d=e.typeMap.multi[e.kind||\"fallback\"],a=0,p=d.length;a<p;a+=1)if(e.tag.slice(0,d[a].tag.length)===d[a].tag){h=d[a];break}h||v(e,\"unknown tag !<\"+e.tag+\">\"),e.result!==null&&h.kind!==e.kind&&v(e,\"unacceptable node kind for !<\"+e.tag+'> tag; it should be \"'+h.kind+'\", not \"'+e.kind+'\"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):v(e,\"cannot resolve a node with !<\"+e.tag+\"> explicit tag\")}return e.listener!==null&&e.listener(\"close\",e),e.tag!==null||e.anchor!==null||s}function hl(e){var n=e.position,i,r,l,t=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(_(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(t=!0,o=e.input.charCodeAt(++e.position),i=e.position;o!==0&&!T(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(i,e.position),l=[],r.length<1&&v(e,\"directive name must not be less than one character in length\");o!==0;){for(;Y(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!R(o));break}if(R(o))break;for(i=e.position;o!==0&&!T(o);)o=e.input.charCodeAt(++e.position);l.push(e.input.slice(i,e.position))}o!==0&&en(e),j.call(Rn,r)?Rn[r](e,r,l):de(e,'unknown document directive \"'+r+'\"')}if(_(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_(e,!0,-1)):t&&v(e,\"directives end mark is expected\"),Q(e,e.lineIndent-1,pe,!1,!0),_(e,!0,-1),e.checkLineBreaks&&Vr.test(e.input.slice(n,e.position))&&de(e,\"non-ASCII line breaks are interpreted as content\"),e.documents.push(e.result),e.position===e.lineStart&&ge(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_(e,!0,-1));return}if(e.position<e.length-1)v(e,\"end of the stream or a document separator is expected\");else return}function oi(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`\n`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new ll(e,n),r=e.indexOf(\"\\0\");for(r!==-1&&(i.position=r,v(i,\"null byte is not allowed in input\")),i.input+=\"\\0\";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)hl(i);return i.documents}function ml(e,n,i){n!==null&&typeof n==\"object\"&&typeof i>\"u\"&&(i=n,n=null);var r=oi(e,i);if(typeof n!=\"function\")return r;for(var l=0,t=r.length;l<t;l+=1)n(r[l])}function gl(e,n){var i=oi(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new k(\"expected a single document in the stream, but found more\")}}var xl=ml,vl=gl,ti={loadAll:xl,load:vl},ui=Object.prototype.toString,fi=Object.prototype.hasOwnProperty,rn=65279,yl=9,re=10,Al=13,wl=32,Cl=33,El=34,Ke=35,Sl=37,bl=38,_l=39,Ll=42,ci=44,Fl=45,he=58,Ol=61,Il=62,kl=63,Tl=64,ai=91,si=93,Nl=96,pi=123,Dl=124,di=125,I={};I[0]=\"\\\\0\";I[7]=\"\\\\a\";I[8]=\"\\\\b\";I[9]=\"\\\\t\";I[10]=\"\\\\n\";I[11]=\"\\\\v\";I[12]=\"\\\\f\";I[13]=\"\\\\r\";I[27]=\"\\\\e\";I[34]='\\\\\"';I[92]=\"\\\\\\\\\";I[133]=\"\\\\N\";I[160]=\"\\\\_\";I[8232]=\"\\\\L\";I[8233]=\"\\\\P\";var Rl=[\"y\",\"Y\",\"yes\",\"Yes\",\"YES\",\"on\",\"On\",\"ON\",\"n\",\"N\",\"no\",\"No\",\"NO\",\"off\",\"Off\",\"OFF\"],Ml=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;function Pl(e,n){var i,r,l,t,o,u,f;if(n===null)return{};for(i={},r=Object.keys(n),l=0,t=r.length;l<t;l+=1)o=r[l],u=String(n[o]),o.slice(0,2)===\"!!\"&&(o=\"tag:yaml.org,2002:\"+o.slice(2)),f=e.compiledTypeMap.fallback[o],f&&fi.call(f.styleAliases,u)&&(u=f.styleAliases[u]),i[o]=u;return i}function Wl(e){var n,i,r;if(n=e.toString(16).toUpperCase(),e<=255)i=\"x\",r=2;else if(e<=65535)i=\"u\",r=4;else if(e<=4294967295)i=\"U\",r=8;else throw new k(\"code point within a string may not be greater than 0xFFFFFFFF\");return\"\\\\\"+i+L.repeat(\"0\",r-n.length)+n}var Hl=1,le=2;function jl(e){this.schema=e.schema||Qn,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=L.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Pl(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='\"'?le:Hl,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==\"function\"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=\"\",this.duplicates=[],this.usedDuplicates=null}function Wn(e,n){for(var i=L.repeat(\" \",n),r=0,l=-1,t=\"\",o,u=e.length;r<u;)l=e.indexOf(`\n`,r),l===-1?(o=e.slice(r),r=u):(o=e.slice(r,l+1),r=l+1),o.length&&o!==`\n`&&(t+=i),t+=o;return t}function Qe(e,n){return`\n`+L.repeat(\" \",e.indent*n)}function Bl(e,n){var i,r,l;for(i=0,r=e.implicitTypes.length;i<r;i+=1)if(l=e.implicitTypes[i],l.resolve(n))return!0;return!1}function me(e){return e===wl||e===yl}function oe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==rn||65536<=e&&e<=1114111}function Hn(e){return oe(e)&&e!==rn&&e!==Al&&e!==re}function jn(e,n,i){var r=Hn(e),l=r&&!me(e);return(i?r:r&&e!==ci&&e!==ai&&e!==si&&e!==pi&&e!==di)&&e!==Ke&&!(n===he&&!l)||Hn(n)&&!me(n)&&e===Ke||n===he&&l}function Ul(e){return oe(e)&&e!==rn&&!me(e)&&e!==Fl&&e!==kl&&e!==he&&e!==ci&&e!==ai&&e!==si&&e!==pi&&e!==di&&e!==Ke&&e!==bl&&e!==Ll&&e!==Cl&&e!==Dl&&e!==Ol&&e!==Il&&e!==_l&&e!==El&&e!==Sl&&e!==Tl&&e!==Nl}function Yl(e){return!me(e)&&e!==he}function ne(e,n){var i=e.charCodeAt(n),r;return i>=55296&&i<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(i-55296)*1024+r-56320+65536:i}function hi(e){var n=/^\\n* /;return n.test(e)}var mi=1,Xe=2,gi=3,xi=4,G=5;function $l(e,n,i,r,l,t,o,u){var f,c=0,s=null,a=!1,p=!1,d=r!==-1,h=-1,g=Ul(ne(e,0))&&Yl(ne(e,e.length-1));if(n||o)for(f=0;f<e.length;c>=65536?f+=2:f++){if(c=ne(e,f),!oe(c))return G;g=g&&jn(c,s,u),s=c}else{for(f=0;f<e.length;c>=65536?f+=2:f++){if(c=ne(e,f),c===re)a=!0,d&&(p=p||f-h-1>r&&e[h+1]!==\" \",h=f);else if(!oe(c))return G;g=g&&jn(c,s,u),s=c}p=p||d&&f-h-1>r&&e[h+1]!==\" \"}return!a&&!p?g&&!o&&!l(e)?mi:t===le?G:Xe:i>9&&hi(e)?G:o?t===le?G:Xe:p?xi:gi}function ql(e,n,i,r,l){e.dump=(function(){if(n.length===0)return e.quotingType===le?'\"\"':\"''\";if(!e.noCompatMode&&(Rl.indexOf(n)!==-1||Ml.test(n)))return e.quotingType===le?'\"'+n+'\"':\"'\"+n+\"'\";var t=e.indent*Math.max(1,i),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-t),u=r||e.flowLevel>-1&&i>=e.flowLevel;function f(c){return Bl(e,c)}switch($l(n,u,e.indent,o,f,e.quotingType,e.forceQuotes&&!r,l)){case mi:return n;case Xe:return\"'\"+n.replace(/'/g,\"''\")+\"'\";case gi:return\"|\"+Bn(n,e.indent)+Un(Wn(n,t));case xi:return\">\"+Bn(n,e.indent)+Un(Wn(zl(n,o),t));case G:return'\"'+Gl(n)+'\"';default:throw new k(\"impossible error: invalid scalar style\")}})()}function Bn(e,n){var i=hi(e)?String(n):\"\",r=e[e.length-1]===`\n`,l=r&&(e[e.length-2]===`\n`||e===`\n`),t=l?\"+\":r?\"\":\"-\";return i+t+`\n`}function Un(e){return e[e.length-1]===`\n`?e.slice(0,-1):e}function zl(e,n){for(var i=/(\\n+)([^\\n]*)/g,r=(function(){var c=e.indexOf(`\n`);return c=c!==-1?c:e.length,i.lastIndex=c,Yn(e.slice(0,c),n)})(),l=e[0]===`\n`||e[0]===\" \",t,o;o=i.exec(e);){var u=o[1],f=o[2];t=f[0]===\" \",r+=u+(!l&&!t&&f!==\"\"?`\n`:\"\")+Yn(f,n),l=t}return r}function Yn(e,n){if(e===\"\"||e[0]===\" \")return e;for(var i=/ [^ ]/g,r,l=0,t,o=0,u=0,f=\"\";r=i.exec(e);)u=r.index,u-l>n&&(t=o>l?o:u,f+=`\n`+e.slice(l,t),l=t+1),o=u;return f+=`\n`,e.length-l>n&&o>l?f+=e.slice(l,o)+`\n`+e.slice(o+1):f+=e.slice(l),f.slice(1)}function Gl(e){for(var n=\"\",i=0,r,l=0;l<e.length;i>=65536?l+=2:l++)i=ne(e,l),r=I[i],!r&&oe(i)?(n+=e[l],i>=65536&&(n+=e[l+1])):n+=r||Wl(i);return n}function Jl(e,n,i){var r=\"\",l=e.tag,t,o,u;for(t=0,o=i.length;t<o;t+=1)u=i[t],e.replacer&&(u=e.replacer.call(i,String(t),u)),(P(e,n,u,!1,!1)||typeof u>\"u\"&&P(e,n,null,!1,!1))&&(r!==\"\"&&(r+=\",\"+(e.condenseFlow?\"\":\" \")),r+=e.dump);e.tag=l,e.dump=\"[\"+r+\"]\"}function $n(e,n,i,r){var l=\"\",t=e.tag,o,u,f;for(o=0,u=i.length;o<u;o+=1)f=i[o],e.replacer&&(f=e.replacer.call(i,String(o),f)),(P(e,n+1,f,!0,!0,!1,!0)||typeof f>\"u\"&&P(e,n+1,null,!0,!0,!1,!0))&&((!r||l!==\"\")&&(l+=Qe(e,n)),e.dump&&re===e.dump.charCodeAt(0)?l+=\"-\":l+=\"- \",l+=e.dump);e.tag=t,e.dump=l||\"[]\"}function Kl(e,n,i){var r=\"\",l=e.tag,t=Object.keys(i),o,u,f,c,s;for(o=0,u=t.length;o<u;o+=1)s=\"\",r!==\"\"&&(s+=\", \"),e.condenseFlow&&(s+='\"'),f=t[o],c=i[f],e.replacer&&(c=e.replacer.call(i,f,c)),P(e,n,f,!1,!1)&&(e.dump.length>1024&&(s+=\"? \"),s+=e.dump+(e.condenseFlow?'\"':\"\")+\":\"+(e.condenseFlow?\"\":\" \"),P(e,n,c,!1,!1)&&(s+=e.dump,r+=s));e.tag=l,e.dump=\"{\"+r+\"}\"}function Ql(e,n,i,r){var l=\"\",t=e.tag,o=Object.keys(i),u,f,c,s,a,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==\"function\")o.sort(e.sortKeys);else if(e.sortKeys)throw new k(\"sortKeys must be a boolean or a function\");for(u=0,f=o.length;u<f;u+=1)p=\"\",(!r||l!==\"\")&&(p+=Qe(e,n)),c=o[u],s=i[c],e.replacer&&(s=e.replacer.call(i,c,s)),P(e,n+1,c,!0,!0,!0)&&(a=e.tag!==null&&e.tag!==\"?\"||e.dump&&e.dump.length>1024,a&&(e.dump&&re===e.dump.charCodeAt(0)?p+=\"?\":p+=\"? \"),p+=e.dump,a&&(p+=Qe(e,n)),P(e,n+1,s,!0,a)&&(e.dump&&re===e.dump.charCodeAt(0)?p+=\":\":p+=\": \",p+=e.dump,l+=p));e.tag=t,e.dump=l||\"{}\"}function qn(e,n,i){var r,l,t,o,u,f;for(l=i?e.explicitTypes:e.implicitTypes,t=0,o=l.length;t<o;t+=1)if(u=l[t],(u.instanceOf||u.predicate)&&(!u.instanceOf||typeof n==\"object\"&&n instanceof u.instanceOf)&&(!u.predicate||u.predicate(n))){if(i?u.multi&&u.representName?e.tag=u.representName(n):e.tag=u.tag:e.tag=\"?\",u.represent){if(f=e.styleMap[u.tag]||u.defaultStyle,ui.call(u.represent)===\"[object Function]\")r=u.represent(n,f);else if(fi.call(u.represent,f))r=u.represent[f](n,f);else throw new k(\"!<\"+u.tag+'> tag resolver accepts not \"'+f+'\" style');e.dump=r}return!0}return!1}function P(e,n,i,r,l,t,o){e.tag=null,e.dump=i,qn(e,i,!1)||qn(e,i,!0);var u=ui.call(e.dump),f=r,c;r&&(r=e.flowLevel<0||e.flowLevel>n);var s=u===\"[object Object]\"||u===\"[object Array]\",a,p;if(s&&(a=e.duplicates.indexOf(i),p=a!==-1),(e.tag!==null&&e.tag!==\"?\"||p||e.indent!==2&&n>0)&&(l=!1),p&&e.usedDuplicates[a])e.dump=\"*ref_\"+a;else{if(s&&p&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),u===\"[object Object]\")r&&Object.keys(e.dump).length!==0?(Ql(e,n,e.dump,l),p&&(e.dump=\"&ref_\"+a+e.dump)):(Kl(e,n,e.dump),p&&(e.dump=\"&ref_\"+a+\" \"+e.dump));else if(u===\"[object Array]\")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?$n(e,n-1,e.dump,l):$n(e,n,e.dump,l),p&&(e.dump=\"&ref_\"+a+e.dump)):(Jl(e,n,e.dump),p&&(e.dump=\"&ref_\"+a+\" \"+e.dump));else if(u===\"[object String]\")e.tag!==\"?\"&&ql(e,e.dump,n,t,f);else{if(u===\"[object Undefined]\")return!1;if(e.skipInvalid)return!1;throw new k(\"unacceptable kind of an object to dump \"+u)}e.tag!==null&&e.tag!==\"?\"&&(c=encodeURI(e.tag[0]===\"!\"?e.tag.slice(1):e.tag).replace(/!/g,\"%21\"),e.tag[0]===\"!\"?c=\"!\"+c:c.slice(0,18)===\"tag:yaml.org,2002:\"?c=\"!!\"+c.slice(18):c=\"!<\"+c+\">\",e.dump=c+\" \"+e.dump)}return!0}function Xl(e,n){var i=[],r=[],l,t;for(Ve(e,i,r),l=0,t=r.length;l<t;l+=1)n.duplicates.push(i[r[l]]);n.usedDuplicates=new Array(t)}function Ve(e,n,i){var r,l,t;if(e!==null&&typeof e==\"object\")if(l=n.indexOf(e),l!==-1)i.indexOf(l)===-1&&i.push(l);else if(n.push(e),Array.isArray(e))for(l=0,t=e.length;l<t;l+=1)Ve(e[l],n,i);else for(r=Object.keys(e),l=0,t=r.length;l<t;l+=1)Ve(e[r[l]],n,i)}function Vl(e,n){n=n||{};var i=new jl(n);i.noRefs||Xl(e,i);var r=e;return i.replacer&&(r=i.replacer.call({\"\":r},\"\",r)),P(i,0,r,!0,!0)?i.dump+`\n`:\"\"}var Zl=Vl,eo={dump:Zl};function ln(e,n){return function(){throw new Error(\"Function yaml.\"+e+\" is removed in js-yaml 4. Use yaml.\"+n+\" instead, which is now safe by default.\")}}var on=ti.load,ut=ti.loadAll,xe=eo.dump;var ft=ln(\"safeLoad\",\"load\"),ct=ln(\"safeLoadAll\",\"loadAll\"),at=ln(\"safeDump\",\"dump\");var so=bi(\"./workerBundle\"),io=$e;function D(e,n){return n===\"yaml\"?xe(e,{indent:2,lineWidth:-1,noRefs:!0}).trimEnd():JSON.stringify(e,null,2)}function ro(e,n,i=\"json\"){let r=D(e,i),l=D(n,i);return r===l?[{value:r}]:tn(e,n,0,i)}function lo(e,n){return ro(e,n,\"json\")}function oo(e,n){try{let i=JSON.parse(e),r=JSON.parse(n),l=JSON.stringify(i),t=JSON.stringify(r);return l===t?[{value:e}]:N(e,n,{newlineIsToken:!1})}catch{return N(e,n,{newlineIsToken:!1})}}function to(e,n){let i=on(e),r=on(n),l=xe(i,{indent:2,lineWidth:-1,noRefs:!0}),t=xe(r,{indent:2,lineWidth:-1,noRefs:!0});return l===t?[{value:e}]:N(e,n,{newlineIsToken:!1})}function tn(e,n,i,r=\"json\"){let l=D(e,r),t=D(n,r);return l===t?[{value:W(l,i,r)}]:typeof e==\"object\"&&e!==null&&typeof n==\"object\"&&n!==null&&!Array.isArray(e)&&!Array.isArray(n)?uo(e,n,i,r):Array.isArray(e)&&Array.isArray(n)?fo(e,n,i,r):co(l,t,i,r)}function uo(e,n,i,r=\"json\"){let l=[],t=\" \".repeat(i),o=\" \".repeat(i+1),u=new Set(Object.keys(e)),f=Object.keys(n),c=[...u].filter(a=>!(a in n)),s=[...f,...c];l.push({value:`{\n`});for(let a=0;a<s.length;a++){let p=s[a],h=a===s.length-1?\"\":\",\",g=p in e,y=p in n;if(g&&y){let w=D(e[p],r),m=D(n[p],r);if(w===m){let x=W(w,i+1);l.push({value:o+JSON.stringify(p)+\": \"+x+h+`\n`})}else{let x=o+JSON.stringify(p)+\": \",A=tn(e[p],n[p],i+1,r);if(A.length>0)if(!A[0].removed&&!A[0].added)A[0].value=x+A[0].value;else{let C=A.find(E=>E.removed),F=A.find(E=>E.added);C&&(C.value=x+C.value),F&&(F.value=x+F.value)}if(h&&A.length>0){let C=A[A.length-1];C.value=C.value.replace(/\\n$/,h+`\n`)}l.push(...A)}}else if(g){let w=W(D(e[p],r),i+1);l.push({removed:!0,value:o+JSON.stringify(p)+\": \"+w+h+`\n`})}else{let w=W(D(n[p],r),i+1);l.push({added:!0,value:o+JSON.stringify(p)+\": \"+w+h+`\n`})}}return l.push({value:t+`}\n`}),l}function fo(e,n,i,r=\"json\"){let l=[],t=\" \".repeat(i),o=\" \".repeat(i+1);l.push({value:`[\n`});let u=Math.max(e.length,n.length);for(let f=0;f<u;f++){let s=f===u-1?\"\":\",\";if(f>=e.length){let a=W(D(n[f],r),i+1);l.push({added:!0,value:o+a+s+`\n`})}else if(f>=n.length){let a=W(D(e[f],r),i+1);l.push({removed:!0,value:o+a+s+`\n`})}else{let a=D(e[f],r),p=D(n[f],r);if(a===p){let d=W(a,i+1);l.push({value:o+d+s+`\n`})}else{let d=tn(e[f],n[f],i+1,r);if(d.length>0&&(d[0].value=o+d[0].value),s&&d.length>0){let h=d[d.length-1];h.value=h.value.replace(/\\n$/,s+`\n`)}l.push(...d)}}}return l.push({value:t+`]\n`}),l}function co(e,n,i,r=\"json\"){let l=W(e,i),t=W(n,i);return N(l,t).map(u=>({value:u.value,added:u.added,removed:u.removed}))}function W(e,n,i=\"json\"){if(n===0)return e;let r=\" \".repeat(n);return e.split(`\n`).map((l,t)=>t===0?l:r+l).join(`\n`)}var vi=e=>e===\"\"?[]:e.replace(/\\n$/,\"\").split(`\n`),ao=(e,n,i=\"diffChars\")=>{let l=(typeof i==\"string\"?io[i]:i)(e,n),t={left:[],right:[]};return l.forEach(({added:o,removed:u,value:f})=>{let c={};return o&&(c.type=1,c.value=f,t.right.push(c)),u&&(c.type=2,c.value=f,t.left.push(c)),!u&&!o&&(c.type=0,c.value=f,t.right.push(c),t.left.push(c)),c}),t},yi=(e,n,i=!1,r=\"diffChars\",l=0,t=[],o=!1)=>{let u=[];if(typeof e==\"string\"&&typeof n==\"string\")if(r===\"diffJson\")u=oo(e,n);else if(r===\"diffYaml\")try{u=to(e,n)}catch{u=N(e,n,{newlineIsToken:!1})}else u=N(e,n,{newlineIsToken:!1});else u=lo(e,n);let f=l,c=l,s=[],a=0,p=[],d=[],h=(g,y,w,m,x)=>vi(g).map((C,F)=>{let E={},S={};if(!(d.includes(`${y}-${F}`)||x&&F!==0)){if(w||m){let $=!0;if(m){c+=1,E.lineNumber=c,E.type=2,E.value=C||\" \";let un=u[y+1];if(un?.added){let fn=vi(un.value)[F];if(fn){let Ai=h(fn,y,!0,!1,!0),{value:B,lineNumber:wi,type:Ci}=Ai[0].right;if(d.push(`${y+1}-${F}`),S.lineNumber=wi,E.value===B)$=!1,S.type=0,E.type=0,S.value=B;else{S.type=Ci;let cn=500,Ei=C.length>cn||B.length>cn;if(i||Ei)S.value=B;else if(o)E.rawValue=C,E.value=C,S.rawValue=B,S.value=B;else{let an=ao(C,B,r);S.value=an.right,E.value=an.left}}}}}else f+=1,S.lineNumber=f,S.type=1,S.value=C;$&&!x&&(p.includes(a)||p.push(a))}else c+=1,f+=1,E.lineNumber=c,E.type=0,E.value=C,S.lineNumber=f,S.type=0,S.value=C;return(t?.includes(`L-${E.lineNumber}`)||t?.includes(`R-${S.lineNumber}`)&&!p.includes(a))&&p.push(a),x||(a+=1),{right:S,left:E}}}).filter(Boolean);return u.forEach(({added:g,removed:y,value:w},m)=>{s=[...s,...h(w,m,g,y)]}),{lineInformation:s,diffLines:p}};self.onmessage=e=>{let{oldString:n,newString:i,disableWordDiff:r,lineCompareMethod:l,linesOffset:t,showLines:o,deferWordDiff:u}=e.data,f=yi(n,i,r,l,t,o,u);self.postMessage(f)};})();\n/*! Bundled license information:\n\njs-yaml/dist/js-yaml.mjs:\n (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)\n*/\n";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-diff-viewer-continued",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Continuation of a simple and beautiful text diff viewer component made with diff and React",
|
|
6
6
|
"keywords": [
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@types/node": "^25.2.0",
|
|
47
47
|
"@types/react": "^19.2.11",
|
|
48
48
|
"@types/react-dom": "^19.2.3",
|
|
49
|
+
"esbuild": "^0.27.3",
|
|
49
50
|
"gh-pages": "^6.3.0",
|
|
50
51
|
"happy-dom": "^20.5.0",
|
|
51
52
|
"just-release": "^0.7.0",
|
|
@@ -65,7 +66,8 @@
|
|
|
65
66
|
"node": ">= 16"
|
|
66
67
|
},
|
|
67
68
|
"scripts": {
|
|
68
|
-
"build": "
|
|
69
|
+
"build:worker": "node scripts/build-worker.js",
|
|
70
|
+
"build": "pnpm run build:worker && tsc --project tsconfig.json && tsc --project tsconfig.esm.json",
|
|
69
71
|
"build:examples": "vite build examples",
|
|
70
72
|
"publish:examples": "NODE_ENV=production pnpm run build:examples && gh-pages -d examples/dist -r $GITHUB_REPO_URL",
|
|
71
73
|
"publish:examples:local": "NODE_ENV=production pnpm run build:examples && gh-pages -d examples/dist",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This script bundles the compute worker with all its dependencies
|
|
5
|
+
* into a single string that can be used to create a Blob URL at runtime.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as esbuild from 'esbuild';
|
|
9
|
+
import * as fs from 'fs';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const srcDir = path.join(__dirname, '..', 'src');
|
|
15
|
+
|
|
16
|
+
async function buildWorker() {
|
|
17
|
+
// Bundle the worker with all dependencies
|
|
18
|
+
// Mark workerBundle as external to avoid circular dependency -
|
|
19
|
+
// compute-lines.ts imports workerBundle.ts, but the worker doesn't need it
|
|
20
|
+
const result = await esbuild.build({
|
|
21
|
+
entryPoints: [path.join(srcDir, 'computeWorker.ts')],
|
|
22
|
+
bundle: true,
|
|
23
|
+
format: 'iife',
|
|
24
|
+
minify: true,
|
|
25
|
+
write: false,
|
|
26
|
+
target: 'es2020',
|
|
27
|
+
external: ['./workerBundle'],
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const workerCode = result.outputFiles[0].text;
|
|
31
|
+
|
|
32
|
+
// Generate a TypeScript file that exports the bundled code
|
|
33
|
+
const output = `// AUTO-GENERATED FILE - DO NOT EDIT
|
|
34
|
+
// Generated by scripts/build-worker.js
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Bundled worker code as a string.
|
|
38
|
+
* This allows us to create a Blob URL at runtime without needing a separate file.
|
|
39
|
+
*/
|
|
40
|
+
export const WORKER_CODE = ${JSON.stringify(workerCode)};
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
fs.writeFileSync(path.join(srcDir, 'workerBundle.ts'), output);
|
|
44
|
+
console.log('Worker bundle generated successfully');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
buildWorker().catch((err) => {
|
|
48
|
+
console.error('Failed to build worker:', err);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
});
|