offsite 0.0.67 → 0.0.69
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/apps/client/dist/assets/ChevronsDownUpIcon-BNVFd2te.js +1 -0
- package/apps/client/dist/assets/{XIcon-DVUan90_.js → XIcon-DQMNLluU.js} +6 -6
- package/apps/client/dist/assets/{context-menu-DvX4lW00.js → context-menu-DKfHACvP.js} +6 -6
- package/apps/client/dist/assets/diff-panel-__AqAgY3.js +260 -0
- package/apps/client/dist/assets/dist-D5zkZMSx.js +1 -0
- package/apps/client/dist/assets/dist-DUf7iKTq.js +1 -0
- package/apps/client/dist/assets/dist-Jliw2AH0.js +168 -0
- package/apps/client/dist/assets/{editor-dialog-CqCQeA1i.js → editor-dialog-3JXNSbBz.js} +2 -2
- package/apps/client/dist/assets/{highlights-ClFpvuAt.js → highlights-B40Xqqot.js} +2 -2
- package/apps/client/dist/assets/{image-viewer-DOTYtAy5.js → image-viewer-RU1A0RN3.js} +1 -1
- package/apps/client/dist/assets/index-B-seWYA6.css +2 -0
- package/apps/client/dist/assets/index-Cb7dxBnJ.js +73 -0
- package/apps/client/dist/assets/libesm-Bfkx4A5Z.js +13 -0
- package/apps/client/dist/assets/{preview-dialog-Bq-8p3uq.js → preview-dialog-DLv_D_cw.js} +1 -1
- package/apps/client/dist/assets/resolveLanguages-CUb-sBYj.js +2 -0
- package/apps/client/dist/assets/shiki-1q83RgHy.js +2 -0
- package/apps/client/dist/assets/stream-tokenizer-BcBuusIz.js +1 -0
- package/apps/client/dist/assets/tokensToHtml-BxQY-Ba2.js +14 -0
- package/apps/client/dist/assets/{video-viewer-DsgT3Iz6.js → video-viewer-BR9BoG81.js} +1 -1
- package/apps/client/dist/index.html +7 -6
- package/apps/client/dist/sw.js +1 -1
- package/package.json +1 -1
- package/apps/client/dist/assets/appendItems-BzU1_nhw.js +0 -9
- package/apps/client/dist/assets/constants-CmGPilXJ.js +0 -1
- package/apps/client/dist/assets/diff-panel-BwlgTA7f.js +0 -408
- package/apps/client/dist/assets/dist-D58YXc_P.js +0 -2
- package/apps/client/dist/assets/dist-NHATWfcN.js +0 -1
- package/apps/client/dist/assets/getFiletypeFromFileName-DGoZTiUS.js +0 -1
- package/apps/client/dist/assets/index-DU4W_qgk.js +0 -21
- package/apps/client/dist/assets/index-dFajjlBv.css +0 -2
- package/apps/client/dist/assets/libesm-Dyf3eB1R.js +0 -13
- package/apps/client/dist/assets/renderTokenLines-CZITQnBN.js +0 -3
- package/apps/client/dist/assets/shiki-BoAJalUP.js +0 -2
- package/apps/client/dist/assets/stream-tokenizer-bYvWJIhm.js +0 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var e=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h)d[r]=void 0;else{if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},t=new class extends e{};function n(e,n,r){return t.diff(e,n,r)}function r(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function i(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function a(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function o(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function s(e,t){return a(e,t,``)}function c(e,t){return o(e,t,``)}function l(e,t){return t.slice(0,u(e,t))}function u(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function d(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function f(e,t){if(t)return m(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function p(e,t){if(t)return m(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function m(e,t){if(!t)return[p(e),f(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=d(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var h=`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}`,g=RegExp(`[${h}]+|\\s+|[^${h}]`,`ug`);new class extends e{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=d(e,r)}else n=e.match(g)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&_(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&_(n,i,r,null,t.intlSegmenter),e}};function _(e,t,n,u,d){if(t&&n){let[l,f]=m(t.value,d),[p,h]=m(n.value,d);if(e){let i=r(l,p);e.value=o(e.value,p,i),t.value=s(t.value,i),n.value=s(n.value,i)}if(u){let e=i(f,h);u.value=a(u.value,h,e),t.value=c(t.value,e),n.value=c(n.value,e)}}else if(n){if(e){let e=p(n.value,d);n.value=n.value.substring(e.length)}if(u){let e=p(u.value,d);u.value=u.value.substring(e.length)}}else if(e&&u){let n=p(u.value,d),[l,f]=m(t.value,d),h=r(n,l);t.value=s(t.value,h);let g=i(s(n,h),f);t.value=c(t.value,g),u.value=a(u.value,n,g),e.value=o(e.value,n,n.slice(0,n.length-g.length))}else if(u){let e=p(u.value,d),n=l(f(t.value,d),e);t.value=c(t.value,n)}else if(e){let n=l(f(e.value,d),p(t.value,d));t.value=s(t.value,n)}}var v=new class extends e{tokenize(e){let t=RegExp(`(\\r?\\n)|[${h}]+|[^\\S\\n\\r]+|[^${h}]`,`ug`);return e.match(t)||[]}};function y(e,t,n){return v.diff(e,t,n)}var b=new class extends e{constructor(){super(...arguments),this.tokenize=S}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes(`
|
|
2
|
+
`)||(e=e.trim()),n.newlineIsToken&&t.includes(`
|
|
3
|
+
`)||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
4
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
5
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function x(e,t,n){return b.diff(e,t,n)}function S(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
6
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function C(e){return e==`.`||e==`!`||e==`?`}new class extends e{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(C(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends e{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends e{constructor(){super(...arguments),this.tokenize=S}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(w(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function w(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=w(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=w(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends e{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function T(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function E(e){if(!T(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var D={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function O(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;x(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(x(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||j(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
7
|
+
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function k(e,t){if(t||=D,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw 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(e=>k(e,t)).join(`
|
|
8
|
+
`)}let n=[];if(e.isGit){if(t=D,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+E(r)+` `+E(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+E((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+E((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+E((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+E((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+E(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+E(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
9
|
+
`)+`
|
|
10
|
+
`}function A(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;O(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?k(e,o.headerOptions):void 0)}}))}else{let s=O(e,t,n,r,i,a,o);return s?k(s,o?.headerOptions):void 0}}function j(e){let t=e.endsWith(`
|
|
11
|
+
`),n=e.split(`
|
|
12
|
+
`).map(e=>e+`
|
|
13
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}export{n as i,x as n,y as r,A as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{c as t,l as n,t as r}from"./utils-U6QfaJBO.js";import{a as i,d as a,f as o,h as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./dist-C_Y10kCd.js";import{a as _,i as v,n as y,t as ee}from"./button-CWFREsRn.js";import{At as te,t as b}from"./XIcon-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{c as t,l as n,t as r}from"./utils-U6QfaJBO.js";import{a as i,d as a,f as o,h as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./dist-C_Y10kCd.js";import{a as _,i as v,n as y,t as ee}from"./button-CWFREsRn.js";import{At as te,t as b}from"./XIcon-DQMNLluU.js";var x=e(n(),1),S=Object.defineProperty,C=(e,t)=>S(e,`name`,{value:t,configurable:!0}),w=0,T=null;function ne(e){return E(),e.children}C(ne,`FocusGuards`);function E(){x.useEffect(()=>{T||={start:re(),end:re()};let{start:e,end:t}=T;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),w++,()=>{w===1&&(T?.start.remove(),T?.end.remove(),T=null),w=Math.max(0,w-1)}},[])}C(E,`useFocusGuards`);function re(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}C(re,`createFocusGuard`);var D=function(){return D=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},D.apply(this,arguments)};function ie(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ae(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var O=`right-scroll-bar-position`,k=`width-before-scroll-bar`,oe=`with-scroll-bars-hidden`,se=`--removed-body-scroll-bar-size`;function A(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ce(e,t){var n=(0,x.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var le=typeof window<`u`?x.useLayoutEffect:x.useEffect,ue=new WeakMap;function de(e,t){var n=ce(t||null,function(t){return e.forEach(function(e){return A(e,t)})});return le(function(){var t=ue.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||A(e,null)}),i.forEach(function(e){r.has(e)||A(e,a)})}ue.set(n,e)},[e]),n}function fe(e){return e}function pe(e,t){t===void 0&&(t=fe);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function me(e){e===void 0&&(e={});var t=pe(null);return t.options=D({async:!0,ssr:!1},e),t}var he=function(e){var t=e.sideCar,n=ie(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return x.createElement(r,D({},n))};he.isSideCarExport=!0;function ge(e,t){return e.useMedium(t),he}var _e=me(),j=function(){},M=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:j,onWheelCapture:j,onTouchMoveCapture:j}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,ee=ie(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),te=f,b=de([n,t]),S=D(D({},ee),i);return x.createElement(x.Fragment,null,u&&x.createElement(te,{sideCar:_e,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?x.cloneElement(x.Children.only(s),D(D({},S),{ref:b})):x.createElement(v,D({},S,{className:c,ref:b}),s))});M.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},M.classNames={fullWidth:k,zeroRight:O};var ve=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ye(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ve();return t&&e.setAttribute(`nonce`,t),e}function be(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Se=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ye())&&(be(t,n),xe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ce=function(){var e=Se();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},we=function(){var e=Ce();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Te={left:0,top:0,right:0,gap:0},N=function(e){return parseInt(e||``,10)||0},Ee=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[N(n),N(r),N(i)]},De=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Te;var t=Ee(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Oe=we(),P=`data-scroll-locked`,ke=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${oe} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/langs-DdlLhtBb.js","assets/langs-DssLtjmH.js","assets/preload-helper-BLdHbfdN.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-BLdHbfdN.js";import{_ as t}from"./tokensToHtml-BxQY-Ba2.js";var n=new Map,r=new Map,i=new Map,a=new Set;function o(e,t){for(let r of Array.isArray(e)?e:[e]){let e=n.get(r.name);e??(e=r,n.set(r.name,e)),t.attachLanguages([e]),a.add(e.name)}}async function s(a){if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:t())throw Error(`resolveLanguage("${a}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let o=r.get(a);if(o!=null)return o;let s=(async()=>{let t=i.get(a);if(t==null){let{bundledLanguages:n}=await e(async()=>{let{bundledLanguages:e}=await import(`./langs-DdlLhtBb.js`);return{bundledLanguages:e}},__vite__mapDeps([0,1,2]));Object.prototype.hasOwnProperty.call(n,a)&&(t=n[a])}if(t==null)throw Error(`resolveLanguage: "${a}" not found in bundled or custom languages`);let{default:r}=await t(),o={name:a,data:r};return n.has(a)||n.set(a,o),o})();r.set(a,s);try{return await s}finally{r.get(a)===s&&r.delete(a)}}function c(e){return n.get(e)??s(e)}async function l(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=c(r)??s(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}export{a,r as c,o as i,c as n,i as o,s as r,n as s,l as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/engine-oniguruma-Dl5gvpE_.js","assets/engine-oniguruma-BMl9YtsA.js","assets/rolldown-runtime-COiEfhsA.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,o as t,t as n}from"./resolveLanguages-CUb-sBYj.js";import{h as r,n as i}from"./tokensToHtml-BxQY-Ba2.js";import{n as a,t as o}from"./stream-tokenizer-BcBuusIz.js";import{G as s,U as c,c as l,s as u}from"./dist-TdUDcI9m.js";import{t as d}from"./preload-helper-BLdHbfdN.js";function f(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}var p=0,m=0,h=class{backend;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=[s];#d=[];#f=0;#p=[];#m=-1;#h=!0;#g=!1;#_=0;#v=++m;#y=-1;#b=-1;#x;#S=0;#C=[];#w=!1;#T=f(async e=>{if(this.#l)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#i.lineCount);if(this.#t==null&&!_(this.#i.languageId)){if(await this.backend?.loadLanguages([this.#i.languageId]),this.#l)return;this.#t=this.#e.getLanguage(this.#i.languageId)}this.#D(),this.#N(r)},500);#E=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,tokenizerId:n,jobId:r}=e;t===`tokenize`&&n===this.#v&&typeof r==`number`&&r===this.#_&&(this.#y>=0?this.#z(r):this.#B(r))};getStringCommentRegexpRangesInLine(e){if(!this.#s||e<0||e>=this.#i.lineCount||(this.#O(),this.#t==null))return null;if(this.#C[e]===void 0){this.#R(e);let t=this.#u[e]??s,n=this.#P(e,t);this.#u[e+1]=n.state}return this.#C[e]??null}constructor(e,t,n){this.backend=n,this.#e=e,this.#i=t.textDocument,this.#n=t.theme,this.#r=[],this.#a=t.tokenizeMaxLineLength??1e3,this.#o=t.onDeferTokenize,this.#s=t.matchBrackets!==!1,this.#c=t.__debug??!1,this.#O(),this.#D()}setTheme(e){this.#n!==e&&(this.#n=e,this.#D(),this.stopBackgroundTokenize(),this.#u=[s],this.#d=[],this.#f=0,this.#p=[],this.#t!=null&&this.#i.lineCount>0&&this.#M(0))}#D(){if(this.#n===``)return;this.backend?.getTheme(this.#n);let{colorMap:e}=this.#e.setTheme(this.#n);this.#r=e}dispose(){this.#l=!0,this.stopBackgroundTokenize(),this.#A()}tokenize(e,t,n=!1){if(this.#O(),this.#D(),this.#t==null&&!_(this.#i.languageId))throw Error(`Grammar for language "${this.#i.languageId}" not loaded`);let{lineCount:r}=this.#i,{startingLine:i=0,totalLines:a=1/0}=t??{},o=a===1/0?r:Math.min(i+a,r),c=e.startLine,l=Math.max(i,c),u=t!=null&&a!==1/0&&e.lineDelta>0&&c<o&&e.endLine>=o,d=e.lineDelta===0&&(e.changedLineChanges?.every(([,,e])=>e===0)??!0);this.#s&&!d&&(this.#C.length=Math.min(this.#C.length,e.startLine));let f=n&&e.lineDelta!==0&&c>=i,p=d||t==null||c>=l,m=e.changedLineRanges??[[c,e.endLine]];this.#d=[],this.#f=0,this.#p=[];let h=-1;if(c<l)for(let[e,t]of m)e<l&&(h=Math.max(h,Math.min(t,l-1)));let g=h>=c&&(d||e.lineDelta<0);d?this.#R(c):(this.#I(e),(t==null||c>=l)&&this.#R(l));let v=0,y=m[v][1],b,x=0,S=d?m[v][0]:l,C=!1,w=new Map,T=g?new Map:void 0;if(T!=null&&!d){let e=Math.min(h+1,l,o);if(e>c){this.#R(e);let t=c,n=this.#u[t]??s;for(;t<e;t++){let e=this.#P(t,n);n=e.state,T.set(t,e.resolvedTokens)}this.#u[e]=n}}let E=this.#u[S]??s;for(;S<o;){let e=d?this.#u[S+1]:f?this.#L(S+1):void 0;p&&(this.#u[S]=E);let{resolvedTokens:t,state:n}=this.#P(S,E);if(E=n,S>=l?w.set(S,t):T?.set(S,t),p&&(this.#u[S+1]=E),C=S>=y&&(d||f)&&e!=null&&E.equals(e),C){v++;let e=m[v];if(e==null)break;if(e[0]>=o){b=e[0],x=v;break}let t=this.#u[e[0]];if(f)for(let n=S+2;n<=e[0]&&(t=this.#L(n),t!=null);n++)this.#u[n]=t;t==null?(y=e[1],S++):(S=e[0],E=t,y=e[1]),C=!1}else S++}if(p&&(S<o?this.#u[S+1]=E:this.#u[S]=E),C&&f&&b==null){for(let e=S+2;e<=r;e++){let t=this.#L(e);if(t==null)break;this.#u[e]=t}this.#d=[],this.#f=0,this.#p=[]}if(T!=null&&T.size>0&&this.#o(T),b!=null)this.#s&&d&&(this.#C.length=Math.min(this.#C.length,b)),this.#M(b,m,x);else if(!C&&S<r){let e=u&&c>=l?o:c<l&&!d?c:S;this.#s&&d&&(this.#C.length=Math.min(this.#C.length,e)),this.#M(e,m,v)}return w}prebuildStateStack(e){this.#O(),this.#T(e)}stopBackgroundTokenize(){this.#b=-1,this.#h||(this.#h=!0,this.#g=!1,this.#m=-1,this.#y=-1,this.#x=void 0,this.#S=0,this.#d=[],this.#f=0,this.#p=[],this.#A())}pauseBackgroundTokenize(){this.#h||this.#g||(this.#c&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#_}),this.#g=!0)}resumeBackgroundTokenize(){this.#h||!this.#g||this.#t==null||this.#m<0||(this.#c&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#_}),this.#g=!1,this.#j(this.#_))}#O(){this.#t==null&&!_(this.#i.languageId)&&this.#e.getLoadedLanguages().includes(this.#i.languageId)&&(this.#t=this.#e.getLanguage(this.#i.languageId))}#k(){this.#w||=(globalThis.addEventListener(`message`,this.#E),!0)}#A(){this.#w&&=(globalThis.removeEventListener(`message`,this.#E),!1)}#j(e){globalThis.postMessage({type:`tokenize`,tokenizerId:this.#v,jobId:e})}#M(e,t,n=0){if(_(this.#i.languageId))return;let r=++this.#_;this.#c&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#h=!1,this.#g=!1,this.#m=e,this.#y>=0&&(this.#b=Math.max(this.#b,this.#y)),this.#y=-1,this.#x=t,this.#S=n,this.#k(),this.#j(r)}#N(e){if(this.#t==null||this.#u.length>e)return;if(!this.#h){this.#y>=0?this.#y=Math.max(this.#y,e):this.#b=Math.max(this.#b,e);return}let t=++this.#_;this.#h=!1,this.#g=!1,this.#m=this.#u.length-1,this.#y=e,this.#b=-1,this.#x=void 0,this.#S=0,this.#k(),this.#j(t)}#P(e,t){let n=this.#i.getLineText(e);if(n.length>=this.#a)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t==null||n===``||n.trim()===``)return this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=g(this.#t,this.#r,n,t,p,this.#s);return this.#F(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#F(e,t){this.#s&&(this.#C[e]=t)}#I(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=e.startLine+1;n<=this.#u.length-n?(this.#d=this.#u,this.#f=0,this.#u=this.#u.slice(0,n)):(this.#f=n,this.#d=this.#u.slice(n),this.#u.length=Math.min(this.#u.length,n)),this.#p=t}#L(e){let t=e;for(let n=this.#p.length-1;n>=0;n--){let[r,i,a]=this.#p[n];if(a!==0){if(t>i)t-=a;else if(t>r)return this.#u[e]}}return this.#d[t-this.#f]??this.#u[e]}#R(e,t){let n=Math.min(Math.max(0,e),this.#i.lineCount);if(this.#u.length>n||this.#t==null)return!0;let r=t==null?0:performance.now(),i=this.#u.length-1,a=this.#u[i]??s;for(;i<n;){this.#u[i]=a;let e=this.#i.getLineText(i);if(e.length<this.#a&&e!==``&&e.trim()!==``){let t=g(this.#t,this.#r,e,a,p,this.#s,!1);this.#F(i,t.bracketIgnoredRanges),a=t.ruleStack}else this.#F(i,null);if(i++,this.#u[i]=a,t!=null&&performance.now()-r>t)break}return i>=n}#z(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=this.#R(this.#y,1);this.#h||this.#g||e!==this.#_||(t?this.stopBackgroundTokenize():(this.#m=this.#u.length-1,this.#j(e)))}#B(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=performance.now(),n=new Map,r=this.#i.lineCount,i=this.#x,a=this.#m,o=this.#u[a]??s,c=!1,l=this.#S,u=i?.[l]?.[1];for(;a<r;){this.#u[a]=o;let e=u==null?void 0:this.#L(a+1),r=this.#P(a,o);if(n.set(a,r.resolvedTokens),o=r.state,this.#u[a+1]=o,c=u!=null&&a>=u&&e!=null&&o.equals(e),a++,c){l++;let e=i?.[l];if(e==null)break;if(u=e[1],this.#u[e[0]]==null)c=!1;else{a=e[0],o=this.#u[a]??o,c=!1;continue}}if(performance.now()-t>1)break}if(this.#o(n),!(this.#h||this.#g||e!==this.#_)){if(c||a>=r){let e=this.#b;this.stopBackgroundTokenize(),e>=0&&this.#N(e)}else this.#m=a,this.#S=l,this.#j(e)}}};function g(e,t,n,r,i,a=!0,o=!0){let s=e.tokenizeLine2(n,r,i);s.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);let l=s.tokens,u=l.length/2,d=[],f=[];if(!o&&!a)return{ruleStack:s.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f};for(let e=0;e<u;e++){let r=l[2*e],i=e+1<u?l[2*e+2]:n.length;if(r===i)continue;let s=l[2*e+1];if(o){let e=c.getForeground(s);d.push([r,t[e],n.slice(r,i)])}a&&c.getTokenType(s)>0&&f.push([r,i])}return{ruleStack:s.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f}}function _(e){return e===`text`||e===`ansi`}var v=class e extends o{highlighter;options;#e=``;#t;constructor(e,t){super(),this.highlighter=e,this.options=t}tokenizeChunk(e,t){let n=(this.#e+e).split(/(\r\n|\r|\n)/),r=[];for(let e=0;e<n.length;e+=2){let a=n[e],o=this.highlighter.codeToTokens(a,{...this.options,grammarState:this.#t}),s=o.tokens[0].map(e=>({...e,offset:e.offset+this.stableOffset}));e+1<n.length?(i(t,s),this.pushLineBreak(t,a.length,n[e+1]),this.#t=o.grammarState):(r=s,this.#e=a)}return{unstable:r,tailLength:this.#e.length}}clone(){this.assertActive();let t=new e(this.highlighter,this.options);return this.copyStateTo(t),t.#e=this.#e,t.#t=this.#t,t}resetSource(){this.#e=``,this.#t=void 0}releaseSource(){this.resetSource()}},y=class i extends a{raw;loadedThemes=new Map;attachedLanguages=new Set([`text`,`ansi`]);static async create(e){let t=e===`shiki-wasm`?(await d(async()=>{let{createOnigurumaEngine:e}=await import(`./engine-oniguruma-Dl5gvpE_.js`);return{createOnigurumaEngine:e}},__vite__mapDeps([0,1,2]))).createOnigurumaEngine(d(()=>import(`./wasm-BnjxR4X6.js`),[])):(await d(async()=>{let{createJavaScriptRegexEngine:e}=await import(`./engine-javascript-DKxkqixV.js`);return{createJavaScriptRegexEngine:e}},[])).createJavaScriptRegexEngine(),n=await l({themes:[],langs:[],engine:t});return new i(e,n)}constructor(e,t){super(e,r(e)),this.raw=t}getTheme(e){this.assertNotDisposed();let t=this.loadedThemes.get(e),n=this.themeResolver.getResolvedTheme(e)??t;if(n==null)throw Error(`Theme "${e}" has not been resolved`);if(t!==n){let t=n.textmate??(n.cssVariables==null?void 0:u(n.cssVariables));if(t==null)throw Error(`Theme "${e}" does not support Shiki`);this.raw.setTheme({...t,name:e}),this.loadedThemes.set(e,n)}return n}codeToTokens(e,t){return this.raw.codeToTokens(e,this.resolveOptions(t))}createEditorTokenizer(e){return new h(this.raw,e,this)}createStreamTokenizer(e){return new v(this.raw,this.resolveOptions(e))}async loadLanguages(t){this.assertNotDisposed();let r=t.filter(e=>!this.attachedLanguages.has(e));e(await n(r),this)}hasLoadedLanguages(e){if(this.disposed)return!1;let n;return e.every(e=>this.attachedLanguages.has(e)?!0:!t.has(e)&&(n??=this.raw.getLoadedLanguages(),n.includes(e)))}attachLanguages(e){this.assertNotDisposed();for(let t of e){if(this.attachedLanguages.has(t.name))continue;let e=t.data.find(e=>e.name===t.name||e.aliases?.includes(t.name)===!0);if(e==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${t.name}" as its name or an alias.`);this.raw.loadLanguageSync(t.data);try{this.raw.getLanguage(t.name)}catch{throw Error(`attachResolvedLanguages: "${e.name}" is already loaded without alias "${t.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(t.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:e,themes:t,...n}){if(this.assertNotDisposed(),e!=null)return this.getTheme(e),{...n,theme:e};if(t==null)throw Error(`A theme or themes option is required`);for(let e of Object.values(t))this.getTheme(e);return{...n,themes:t}}};export{y as ShikiHighlighter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,v as t,x as n,y as r}from"./tokensToHtml-BxQY-Ba2.js";var i=class{name;themeResolver;disposed=!1;constructor(e,t){this.name=e,this.themeResolver=t,r(e)}codeToHtml(t,n){return e(t,this.codeToTokens(t,n),n,this.name===`highlights`)}get isDisposed(){return this.disposed}dispose(){this.disposed||(this.disposed=!0,this.releaseResources(),n())}assertNotDisposed(){if(this.disposed)throw new t}},a=class{disposed=!1;stableOffset=0;unstable=[];pendingCarriageReturn=``;enqueue(e){this.assertActive(),e=this.pendingCarriageReturn+e,this.pendingCarriageReturn=e.endsWith(`\r`)?`\r`:``,this.pendingCarriageReturn!==``&&(e=e.slice(0,-1));let t=this.unstable.length,n=[],{unstable:r,tailLength:i}=this.tokenizeChunk(e,n);return this.pendingCarriageReturn!==``&&r.push({content:`\r`,offset:this.stableOffset+i}),this.unstable=r,{recall:t,stable:n,unstable:r}}pushLineBreak(e,t,n){for(let r=0;r<n.length;r++)e.push({content:n[r],offset:this.stableOffset+t+r});this.stableOffset+=t+n.length}close(){let e=this.unstable;return this.dispose(),{stable:e}}clear(){this.assertActive(),this.stableOffset=0,this.unstable=[],this.pendingCarriageReturn=``,this.resetSource()}dispose(){this.disposed||(this.disposed=!0,this.unstable=[],this.releaseSource())}copyStateTo(e){e.stableOffset=this.stableOffset,e.unstable=this.unstable.slice(),e.pendingCarriageReturn=this.pendingCarriageReturn}assertActive(){if(this.disposed)throw Error(`stream tokenizer is disposed`)}};export{i as n,a as t};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/loader-Dbltcnnq.js","assets/preload-helper-BLdHbfdN.js","assets/themes-P0s7avrn.js","assets/unwrapDefault-ByDmBtHB.js","assets/core-yhRGiujn.js","assets/dist-TdUDcI9m.js","assets/ccount-D7kz22QW.js","assets/rolldown-runtime-COiEfhsA.js","assets/lib-m_q9jTTN.js","assets/core-BvRk9kiK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-BLdHbfdN.js";import{a as t,c as n,f as r,n as i,o as a,r as o,s,t as c,u as l}from"./ccount-D7kz22QW.js";import{t as u}from"./unwrapDefault-ByDmBtHB.js";import{t as d}from"./lib-m_q9jTTN.js";var f,p=0,m=class extends Error{constructor(){super(`Highlighter is disposed`),this.name=`HighlighterDisposedError`}};function h(){return f}function g(e){return e??f??`shiki-js`}function _(e){if(f!=null&&f!==e)throw Error(`Cannot load the "${e}" highlighter while "${f}" is in use. Only one highlighter type can be active at a time; dispose every "${f}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function v(e){_(e),f=e,p++}function ee(){p--,p===0&&(f=void 0)}function y(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}function b(e){let t;return()=>t??=e().then(e=>(t=e,e),e=>{throw t=void 0,e})}var te=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},x=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},ne=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function re(e={}){let t=new Map,n=new Map,r=new Map,i=0;function a(e,n){if(t.has(e))throw new te(e);t.set(e,n)}function o(e,n){return!t.has(e)&&(t.set(e,n),!0)}function s(e){return t.has(e)}function c(a){let o=n.get(a);if(o!==void 0)return Promise.resolve(o);let s=r.get(a);if(s!==void 0)return s;let c=t.get(a);if(c===void 0&&e.fallbackLoader===void 0)return Promise.reject(new x(a));let l=i,d=Promise.resolve().then(()=>c===void 0?e.fallbackLoader?.(a):c()).then(async t=>{if(t===void 0)throw new x(a);let o=u(t),s=e.normalizeTheme===void 0?o:await e.normalizeTheme(o,a);return l===i&&n.set(a,s),r.get(a)===d&&r.delete(a),s}).catch(e=>{throw r.get(a)===d&&r.delete(a),e});return r.set(a,d),d}function l(e){return Promise.all(e.map(e=>c(e)))}function d(e,t){n.set(e,t)}function f(e){for(let[t,n]of e)d(t,n)}function p(e){return n.get(e)}function m(e){let t=[];for(let r of e){let e=n.get(r);if(e===void 0)throw new ne(r);t.push(e)}return t}function h(e){return n.has(e)}function g(e){for(let t of e)if(!n.has(t))return!1;return!0}function _(e){let t=n.get(e);return t===void 0?c(e):t}function v(){i++,n.clear(),r.clear()}return{clearResolvedThemes:v,getResolvedOrResolveTheme:_,getResolvedTheme:p,getResolvedThemes:m,hasRegisteredTheme:s,hasResolvedTheme:h,hasResolvedThemes:g,registerTheme:a,registerThemeIfAbsent:o,resolveTheme:c,resolveThemes:l,seedResolvedTheme:d,seedResolvedThemes:f}}var S=new Map,C=new Map,ie=b(()=>e(()=>import(`./loader-Dbltcnnq.js`),__vite__mapDeps([0,1]))),ae=b(()=>e(()=>import(`./themes-P0s7avrn.js`),__vite__mapDeps([2,3,1]))),oe=b(()=>e(()=>import(`./core-yhRGiujn.js`),__vite__mapDeps([4,5,6,7,8,9]))),se=[[`editor.lineHighlightBackground`,`editor.active_line.background`],[`editor.selectionBackground`,`element.selected`],[`editor.findMatchBackground`,`search.match_background`],[`editor.findMatchHighlightBackground`,`search.match_background`],[`editorBracketMatch.background`,`editor.document_highlight.bracket_background`],[`editorError.foreground`,`error`],[`editorWarning.foreground`,`warning`],[`editorInfo.foreground`,`info`],[`editorHint.foreground`,`hint`],[`gitDecoration.addedResourceForeground`,`created`,`terminal.ansi.green`],[`gitDecoration.deletedResourceForeground`,`deleted`,`terminal.ansi.red`],[`gitDecoration.modifiedResourceForeground`,`modified`,`terminal.ansi.blue`]];function w(e,t){let n=`themes`in t?t.themes[0]:t;if(n==null)throw Error(`Theme "${e}" is an empty Zed theme family.`);let r={...n,name:e},i={};for(let[e,t]of Object.entries(r.style))typeof t==`string`&&(i[e]=t);let a=r.style.players?.[0];a?.cursor!=null&&(i[`editorCursor.foreground`]??=a.cursor),a?.selection!=null&&(i[`editor.selectionBackground`]??=a.selection);for(let[e,...t]of se){if(i[e]!=null)continue;let n=t.find(e=>i[e]!=null);n!=null&&(i[e]=i[n])}if(r.cssVariables===!0)i[`editor.foreground`]=`var(--hls-foreground)`,i[`editor.background`]=`var(--hls-background)`;else if(typeof r.cssVariables==`object`){i[`editor.foreground`]??=i.text??i.foreground??`foreground`,i[`editor.background`]??=i.background??`background`;let{prefix:e=`--hls-`,defaults:t}=r.cssVariables;for(let[n,r]of Object.entries(i)){let a=t?.[r];i[n]=`var(${e}${r}${a?`, ${a}`:``})`}}let o=r.appearance===`light`?`light`:`dark`;return{name:e,type:o,colors:i,zed:r,fg:i[`editor.foreground`]??i.text??i.foreground??(o===`light`?`#333333`:`#bbbbbb`),bg:i[`editor.background`]??i.background??(o===`light`?`#ffffff`:`#1e1e1e`)}}function ce(e){let t=C.get(e);return t??(t=re({fallbackLoader:async t=>{if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:y())throw Error(`Theme "${t}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);let n=S.get(t);if(e===`highlights`){let e=n?.zed??n?.diffs;if(e!=null){let n=await e(),r=`default`in n?n.default:n;if(`zed`in r&&r.zed!=null)return r;if(`style`in r||`themes`in r)return w(t,r);throw Error(`Theme "${t}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}let r=ie(),{themes:i}=r instanceof Promise?await r:r,a=i[t];if(a!=null)return w(t,(await a()).default);if(n?.textmate!=null)throw Error(`Theme "${t}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{let e=n?.textmate??n?.diffs,r;if(e!=null){let t=await e();r=`default`in t?t.default:t}else{let e=ae(),{themes:i}=e instanceof Promise?await e:e,a=i.getTheme(t);if(a==null&&n?.zed!=null)throw Error(`Theme "${t}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(a==null)throw Error(`No valid theme loader registered for "${t}"`);let o=await a.load();r=`default`in o?o.default:o}if(`style`in r||`themes`in r)throw Error(`Theme "${t}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);let i=oe(),{normalizeTheme:a,createCssVariablesTheme:o}=i instanceof Promise?await i:i;if(`cssVariables`in r&&r.cssVariables!=null)return{...r,textmate:a(o(r.cssVariables))};if(`textmate`in r&&r.textmate!=null)return{...r,textmate:a(r.textmate)};let s=a(r);return{name:s.name,type:s.type,fg:s.fg,bg:s.bg,colors:s.colors,textmate:s}}throw Error(`No valid theme loader registered for "${t}"`)},normalizeTheme:(e,t)=>{if(e.name!==t)throw Error(`resolvedTheme: themeName: ${t} does not match theme.name: ${e.name}`);return e}}),C.set(e,t)),t}function T(e){return{type:`text`,value:e}}function E({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function le({name:e,width:t=16,height:n=16,properties:r}){return E({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[E({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function ue(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function de(e){return E({tagName:`div`,properties:{"data-gutter":``},children:e})}function fe(e,t,n,r={}){return E({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[E({tagName:`span`,properties:{"data-line-number-content":``},children:[T(`${t}`)]})]})}function pe(e,t,n){return E({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}var me=/^>|^->|<!--|-->|--!>|<!-$/g,he=[`>`],ge=[`<`,`>`];function _e(e,t,n,r){return r.settings.bogusComments?`<?`+d(e.value,Object.assign({},r.settings.characterReferences,{subset:he}))+`>`:`<!--`+e.value.replace(me,i)+`-->`;function i(e){return d(e,Object.assign({},r.settings.characterReferences,{subset:ge}))}}function ve(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var D=k(1),O=k(-1),ye=[];function k(e){return t;function t(t,n,r){let i=t?t.children:ye,a=(n||0)+e,o=i[a];if(!r)for(;o&&l(o);)a+=e,o=i[a];return o}}var be={}.hasOwnProperty;function A(e){return t;function t(t,n,r){return be.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var j=A({body:Se,caption:M,colgroup:M,dd:Ee,dt:Te,head:M,html:xe,li:we,optgroup:De,option:Oe,p:Ce,rp:N,rt:N,tbody:Ae,td:P,tfoot:je,th:P,thead:ke,tr:Me});function M(e,t,n){let r=D(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&l(r.value.charAt(0)))}function xe(e,t,n){let r=D(n,t);return!r||r.type!==`comment`}function Se(e,t,n){let r=D(n,t);return!r||r.type!==`comment`}function Ce(e,t,n){let r=D(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function we(e,t,n){let r=D(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Te(e,t,n){let r=D(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function Ee(e,t,n){let r=D(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function N(e,t,n){let r=D(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function De(e,t,n){let r=D(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Oe(e,t,n){let r=D(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function ke(e,t,n){let r=D(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function Ae(e,t,n){let r=D(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function je(e,t,n){return!D(n,t)}function Me(e,t,n){let r=D(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function P(e,t,n){let r=D(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Ne=A({body:Ie,colgroup:Le,head:Fe,html:Pe,tbody:Re});function Pe(e){let t=D(e,-1);return!t||t.type!==`comment`}function Fe(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Ie(e){let t=D(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&l(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Le(e,t,n){let r=O(n,t),i=D(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&j(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Re(e,t,n){let r=O(n,t),i=D(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&j(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var F={name:[[`
|
|
3
|
+
\f\r &/=>`.split(``),`
|
|
4
|
+
\f\r "&'/=>\``.split(``)],[`\0
|
|
5
|
+
\f\r "&'/<=>`.split(``),`\0
|
|
6
|
+
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
7
|
+
\f\r &>`.split(``),`\0
|
|
8
|
+
\f\r "&'<=>\``.split(``)],[`\0
|
|
9
|
+
\f\r "&'<=>\``.split(``),`\0
|
|
10
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function ze(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),c=[],l;i.space===`html`&&e.tagName===`svg`&&(r.schema=s);let u=Be(r,e.properties),d=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,d&&(o=!1),!u&&a&&Ne(e,t,n)||(c.push(`<`,e.tagName,u?` `+u:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l===`/`||l&&l!==`"`&&l!==`'`)&&c.push(` `),c.push(`/`)),c.push(`>`)),c.push(d),o||a&&j(e,t,n)||c.push(`</`+e.tagName+`>`),c.join(``)}function Be(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ve(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Ve(e,i,a){let o=n(e.schema,i),s=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,l=+!e.settings.allowDangerousCharacters,u=e.quote,f;if(o.overloadedBoolean&&(a===o.attribute||a===``)?a=!0:(o.boolean||o.overloadedBoolean)&&(typeof a!=`string`||a===o.attribute||a===``)&&(a=!!a),a==null||a===!1||typeof a==`number`&&Number.isNaN(a))return``;let p=d(o.attribute,Object.assign({},e.settings.characterReferences,{subset:F.name[s][l]}));return a===!0||(a=Array.isArray(a)?(o.commaSeparated?r:t)(a,{padLeft:!e.settings.tightCommaSeparatedLists}):String(a),e.settings.collapseEmptyAttributes&&!a)?p:(e.settings.preferUnquoted&&(f=d(a,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:F.unquoted[s][l]}))),f!==a&&(e.settings.quoteSmart&&c(a,u)>c(a,e.alternative)&&(u=e.alternative),f=u+d(a,Object.assign({},e.settings.characterReferences,{subset:(u===`'`?F.single:F.double)[s][l],attribute:!0}))+u),p+(f&&`=`+f))}var He=[`<`,`&`];function I(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:d(e.value,Object.assign({},r.settings.characterReferences,{subset:He}))}function Ue(e,t,n,r){return r.settings.allowDangerousHtml?e.value:I(e,t,n,r)}function We(e,t,n,r){return r.all(e)}var Ge=o(`type`,{invalid:Ke,unknown:qe,handlers:{comment:_e,doctype:ve,element:ze,raw:Ue,root:We,text:I}});function Ke(e){throw Error("Expected node, not `"+e+"`")}function qe(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Je={},Ye={},Xe=[];function L(e,t){let n=t||Je,r=n.quote||`"`,o=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Ze,all:Qe,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||i,characterReferences:n.characterReferences||Ye,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?s:a,quote:r,alternative:o}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Ze(e,t,n){return Ge(e,t,n,this)}function Qe(e){let t=[],n=e&&e.children||Xe,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var $e=new Set([`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),et=new Set([`svg`,`template`,`script`,`style`]),tt={class:`class`,className:`class`,id:`id`,role:`role`,style:`style`,tabIndex:`tabindex`,tabindex:`tabindex`,title:`title`},nt=/^data-[\w.:-]+$/,rt=/[<&]/g,it=/[\0"&'`]/g,at={"<":`<`,"&":`&`,'"':`"`,"'":`'`,"`":```,"\0":`�`},ot=256;function R(e){let t=new Map;return Array.isArray(e)?z(e,t):B(e,t)}function z(e,t){let n=``;for(let r of e)n+=B(r,t);return n}function B(e,t){switch(e.type){case`text`:return H(e.value);case`element`:return st(e,t);case`root`:return z(e.children,t);default:return L(e)}}function st(e,t){let{tagName:n}=e;if(n===`span`&&e.children.length===1&&e.children[0].type===`text`&&typeof e.properties?.style==`string`){let n=!0;for(let t in e.properties)if(t!==`style`&&e.properties[t]!=null){n=!1;break}if(n)return`<span ${V(e.properties.style,t)}>${H(e.children[0].value)}</span>`}if(et.has(n))return L(e);let r=ct(e.properties,t);if(r==null)return L(e);let i=r===``?`<${n}>`:`<${n} ${r}>`,a=z(e.children,t);return a===``&&$e.has(n.toLowerCase())?i:`${i}${a}</${n}>`}function V(e,t){let n=t.get(e);return n??(n=`style="${U(e)}"`,t.size<ot&&t.set(e,n)),n}function ct(e,t){let n=``;for(let r in e){let i=e[r];if(i==null)continue;let a=tt[r]??(nt.test(r)?r:void 0);if(a==null)return;if(i===!1||typeof i==`number`&&Number.isNaN(i))continue;let o=r===`style`&&typeof i==`string`?V(i,t):i===!0?a:`${a}="${U(Array.isArray(i)?i.join(` `).trim():String(i))}"`;n+=n===``?o:` ${o}`}return n}function H(e){return e.indexOf(`<`)<0&&e.indexOf(`&`)<0?e:e.replace(rt,W)}function U(e){return e.replace(it,W)}function W(e){return at[e]}function G(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(T(`
|
|
11
|
+
`)),e}var K=new WeakMap;function q(e,t=!1){let{htmlStyle:n}=e;if(n!=null){let e=t?K.get(n):void 0;if(e==null){e=``;for(let t in n)e+=`${e===``?``:`;`}${t}:${n[t]}`;t&&K.set(n,e)}return e}let r=e.color==null?``:`color:${e.color}`;if(e.bgColor!=null&&(r+=`;background-color:${e.bgColor}`),e.fontStyle!=null){e.fontStyle&1&&(r+=`;font-style:italic`),e.fontStyle&2&&(r+=`;font-weight:bold`);let t=!!(e.fontStyle&4),n=!!(e.fontStyle&8);(t||n)&&(r+=`;text-decoration:${t?`underline`:``}${t&&n?` `:``}${n?`line-through`:``}`)}return r.replace(/^;/,``)}function J(e,t,n,{retain:r=!0}={}){let i=!1,a;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){if(i)return a;let o=n();return r?(a=o,i=!0,Object.getOwnPropertyDescriptor(e,t)?.configurable===!0&&Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:a}),a):o},set(n){if(Object.getOwnPropertyDescriptor(e,t)?.configurable===!0)Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n});else if(Object.isFrozen(e))throw TypeError(`Cannot assign to read only array index '${t}'`);else a=n,i=!0}})}var Y=Symbol(`no-token`),X=Symbol(`multiple-tokens`);function Z(e){let t=lt(e);if(t!=null)return t;let n=Y,r=[],i=[],a,o=()=>{if(i.length===0||a==null)i=[],a=void 0;else if(i.length===1){let e=i[0];if(e?.type===`element`){ut(e,a);for(let t of e.children)Q(t)}else Q(e);r.push(e),i=[],a=void 0}else{for(let e of i)Q(e);r.push(E({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0}},s=e=>{e!==Y&&(e===X?n=X:n===Y?n=e:n!==e&&(n=X))};for(let t of e.children){let e=t.type===`element`?Z(t):Y;s(e),typeof e==`number`?(a!=null&&a!==e&&o(),a??=e,i.push(t)):(o(),r.push(t))}return o(),e.children=r,n}function lt(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Q(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Q(t)}}function ut(e,t){e.properties[`data-char`]=t}function dt(e,{state:t,lazyLineAST:n=!1,cacheHtmlStyles:r=!1,useTokenTransformer:i=!1,mergeWhitespaces:a=`always`,decorations:o=[],lineOffsets:s=[]}){let c;for(let t of o){let n=c??=new Map,r={...t,start:$(t.start,s),end:$(t.end,s)},i=Math.min(r.end.line,e.length-1);for(let e=r.start.line;e<=i;e++){let t=n.get(e);t??n.set(e,t=[]),t.push(r)}}let l=(e,n)=>{let o;if(i||a!==`never`){let t=``,n=0;for(let r=0;r<e.length;r++){let a=e[r];if(i){let t=a.content.trim();if(t!==``&&t!==a.content){o??=e.slice(0,r);let n=a.content.indexOf(t);n>0&&o.push({content:a.content.slice(0,n),offset:a.offset}),o.push({...a,content:t,offset:a.offset+n});let i=n+t.length;i<a.content.length&&o.push({content:a.content.slice(i),offset:a.offset+i});continue}}else{let i=!!((a.fontStyle??0)&12);if(!i&&/^\s+$/.test(a.content)&&r<e.length-1){o??=e.slice(0,r),t===``&&(n=a.offset),t+=a.content;continue}t!==``&&o!=null&&(i?o.push({content:t,offset:n}):a={...a,content:t+a.content,offset:n},t=``)}o?.push(a)}}o??=e;let s={type:`element`,tagName:t==null?`span`:`div`,properties:t==null?{class:`line`}:{},children:[]},l=c?.get(n),u=l==null?ft(s,o,i,r):pt(s,o,l,n,i,r);return i&&u===0&&s.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),i&&l!=null&&Z(s),t==null?s:G(s,n+1,t)};if(!n)return e.map(l);let u=Array(e.length);for(let t=0;t<e.length;t++){let n=e[t];J(u,t,()=>l(n,t))}return u}function ft(e,t,n,r){let i=0;for(let a of t)a.content!==``&&(e.children.push(mt(a,q(a,r),a.content,i,n)),i+=a.content.length);return i}function pt(e,t,n,r,i,a){n.length>1&&n.sort((e,t)=>e.start.line===t.start.line?e.start.character===t.start.character?e.end.line===t.end.line?t.end.character-e.end.character:t.end.line-e.end.line:e.start.character-t.start.character:e.start.line-t.start.line);let o=t.reduce((e,t)=>e+t.content.length,0),s=[];for(let e=0;e<n.length;e++){let t=n[e],i={decoration:t,order:e,from:t.start.line===r?t.start.character:0,to:t.end.line===r?t.end.character:o};s.push({position:Math.max(0,Math.min(i.from,o)),range:i,start:!0},{position:Math.max(0,Math.min(i.to,o)),range:i,start:!1})}s.sort((e,t)=>e.position-t.position);let c=[],l=[],u=0,d=(e,t)=>{let n=0,r=c.length;for(;n<r;){let t=n+r>>>1;c[t].order<e.order?n=t+1:r=t}t?c.splice(n,0,e):c[n]===e&&c.splice(n,1)},f=()=>{let t=e,n=0;for(let e of c){if(l[n]?.range!==e){l.length=n;let r={type:`element`,tagName:`span`,properties:{...e.decoration.properties},children:[]};t.children.push(r),l.push({range:e,node:r})}t=l[n++].node}return l.length=n,t},p=e,m=e=>{let t=u;for(;s[u]?.position===e;)u++;let n=!1;for(let n=t;n<u;n++){let{range:t,start:r}=s[n];!r&&t.from!==t.to&&e<o&&d(t,!1)}for(let r=t;r<u;r++){let{range:t,start:i}=s[r];i&&t.from<=e&&t.to>=e&&(t.to>e||t.from===e||e===o)&&(d(t,!0),t.from===t.to&&(n=!0))}if(n){f();for(let e=t;e<u;e++){let{range:t,start:n}=s[e];n&&t.from===t.to&&d(t,!1)}}e<o&&(p=f())},h=0;for(let e of t){if(e.content===``)continue;let t=h,n=t+e.content.length,r=q(e,a);for(;h<n;){s[u]?.position===h&&m(h);let a=Math.min(n,s[u]?.position??n);p.children.push(mt(e,r,h===t&&a===n?e.content:e.content.slice(h-t,a-t),t,i)),h=a}}return s[u]?.position===h&&m(h),h}function mt(e,t,n,r,i){let a=e.htmlAttrs==null?{}:{...e.htmlAttrs};return t!==``&&(a.style=t),i&&(a[`data-char`]=r),{type:`element`,tagName:`span`,properties:a,children:[{type:`text`,value:n}]}}function $(e,t){if(typeof e!=`number`)return e;let n=0,r=t.length;for(;n+1<r;){let i=n+r>>>1;t[i]<=e?n=i:r=i}return{line:n,character:e-(t[n]??0)}}function ht(e,t){for(let n of t)e.push(n)}function gt(e,t,n,r=!1){let i=[0];if(n.decorations?.some(e=>typeof e.start==`number`||typeof e.end==`number`)===!0)for(let t=e.indexOf(`
|
|
12
|
+
`);t!==-1;t=e.indexOf(`
|
|
13
|
+
`,t+1))i.push(t+1);let a={type:`element`,tagName:`code`,properties:{},children:[]},o=dt(t.tokens,{decorations:n.decorations,mergeWhitespaces:n.mergeWhitespaces,lineOffsets:i,cacheHtmlStyles:r});for(let e=0;e<o.length;e++)e>0&&a.children.push({type:`text`,value:`
|
|
14
|
+
`}),a.children.push(o[e]);return R({type:`root`,children:[{type:`element`,tagName:`pre`,properties:{class:`diffs`,style:t.rootStyle===!1?void 0:t.rootStyle??[t.fg==null?``:`color:${t.fg}`,t.bg==null?``:`background-color:${t.bg}`].filter(Boolean).join(`;`),tabIndex:0},children:[a]}]})}export{g as S,y as _,q as a,h as b,pe as c,E as d,le as f,S as g,ce as h,J as i,fe as l,ue as m,ht as n,G as o,T as p,dt as r,R as s,gt as t,de as u,m as v,ee as x,v as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-dialog-
|
|
1
|
+
import{n as e,t}from"./preview-dialog-DLv_D_cw.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./react-BgpkckXP.js";import{c as h}from"./utils-U6QfaJBO.js";var g=h();function _(e){return(0,g.jsxs)(c,{className:`size-full outline-none [--media-background-color:black] [--media-control-background:transparent] [--media-control-hover-background:rgb(255_255_255/12%)] [--media-font-family:inherit] [--media-range-track-border-radius:9999px]`,children:[(0,g.jsx)(`video`,{slot:`media`,src:e.src,"aria-label":e.label,autoPlay:!0,playsInline:!0,preload:`auto`,className:`size-full object-contain`}),(0,g.jsx)(o,{slot:`centered-chrome`,noAutohide:!0}),(0,g.jsxs)(p,{className:`w-full bg-linear-to-t from-black/70 to-transparent px-2 pt-6 pb-1 *:p-2.5 max-sm:flex-wrap max-sm:*:p-2`,children:[(0,g.jsx)(f,{}),(0,g.jsx)(s,{seekOffset:10}),(0,g.jsx)(m,{seekOffset:10}),(0,g.jsx)(a,{className:`grow max-sm:order-first max-sm:min-h-0 max-sm:basis-full`}),(0,g.jsx)(i,{showDuration:!0,className:`max-sm:mr-auto`}),(0,g.jsx)(n,{}),(0,g.jsx)(u,{className:`max-sm:hidden`}),(0,g.jsx)(r,{}),(0,g.jsx)(l,{className:`max-sm:hidden`}),(0,g.jsx)(d,{})]})]})}function v(n){return(0,g.jsxs)(t,{open:!0,onClose:n.onClose,children:[(0,g.jsx)(e,{title:n.name}),(0,g.jsx)(`div`,{className:`min-h-0 flex-1`,onClick:e=>{e.target instanceof HTMLVideoElement&&y(e.target,e.clientX,e.clientY)&&n.onClose()},children:(0,g.jsx)(_,{src:n.src,label:n.label})})]})}function y(e,t,n){if(e.videoWidth===0||e.videoHeight===0)return!1;let r=e.getBoundingClientRect(),i=Math.min(r.width/e.videoWidth,r.height/e.videoHeight);return Math.abs(t-r.left-r.width/2)>e.videoWidth*i/2||Math.abs(n-r.top-r.height/2)>e.videoHeight*i/2}export{v as VideoViewer};
|
|
@@ -10,22 +10,23 @@
|
|
|
10
10
|
name="viewport"
|
|
11
11
|
content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content"
|
|
12
12
|
/>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-Cb7dxBnJ.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-COiEfhsA.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/utils-U6QfaJBO.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/tags-DrTyXsO5.js">
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/XIcon-
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/XIcon-DQMNLluU.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/button-CWFREsRn.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/dist-C_Y10kCd.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/TextWrapIcon-BRhMbXe9.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/tooltip-CVlWgxCV.js">
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/preview-dialog-
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/preview-dialog-DLv_D_cw.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-BLdHbfdN.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/ccount-D7kz22QW.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/langs-DssLtjmH.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/context-menu-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
28
|
-
<link rel="
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/context-menu-DKfHACvP.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-D5zkZMSx.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/libesm-Bfkx4A5Z.js">
|
|
29
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B-seWYA6.css">
|
|
29
30
|
<link rel="manifest" href="/manifest.webmanifest"></head>
|
|
30
31
|
<body>
|
|
31
32
|
<div id="root"></div>
|