@a9n-shoji/rvw 0.4.2 → 0.4.3

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.
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,i as n,l as r,t as i}from"./FileIcon-wDKKQgGv.js";import{a,c as o,d as s,f as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"./index-DUZmOKYW.js";var y=e(r(),1),b=210,x=64,S=11,C=2;function w(e,t){return e.localeCompare(t,`en`)}function T(e){let t=[...new Set(e)],n=new Map(t.map(e=>[e,e.split(`/`)]));return new Map(t.map(e=>{let r=n.get(e);for(let i=1;i<=r.length;i+=1){let a=r.slice(-i).join(`/`);if(t.every(t=>t===e||n.get(t).slice(-i).join(`/`)!==a))return[e,a]}return[e,e]}))}function E(e,t){let n=e.anchors.flatMap(e=>{let n=t.get(e.path);return n?[n]:[]}),r=[...new Set(n)].sort(w);return{anchorCount:e.anchors.length,changeKind:r.length>1?`mixed`:r.length===1?r[0]:null}}function D(e,t,n=0,r=!1){let i=t[e.from],a=t[e.to];if(!i||!a)return null;let o=i.x+114,s=i.y+56,c=a.x+114,l=a.y+56;if(e.from===e.to){let e=i.x+228,t=i.y,r=n*.3,a=88+Math.abs(n)*.35;return{path:`M ${e+8} ${t+34+r} C ${e+a} ${t-84+r}, ${e+a} ${t+112+84+r}, ${e+8} ${t+112-34+r}`,startX:e+8,startY:t+34+r,control1X:e+a,control1Y:t-84+r,control2X:e+a,control2Y:t+112+84+r,endX:e+8,endY:t+112-34+r,bounds:{left:e+8,top:t-84+r,right:e+a,bottom:t+112+84+r}}}let u=c-o,d=l-s,f=Math.max(1,Math.hypot(u,d)),p=u/f,m=d/f,h=-m,g=p,_=Math.min(114/Math.max(1e-4,Math.abs(p)),56/Math.max(1e-4,Math.abs(m)))+8,v=o+p*_+h*n,y=s+m*_+g*n,b=c-p*_+h*n,x=l-m*_+g*n,S=Math.min(r?168:96,Math.max(r?132:n===0?28:52,f*(r?.18:.1)))+n*.35,C=v+(b-v)*.36+h*S,w=y+(x-y)*.36+g*S,T=v+(b-v)*.64+h*S,E=y+(x-y)*.64+g*S;return{path:`M ${v} ${y} C ${C} ${w}, ${T} ${E}, ${b} ${x}`,startX:v,startY:y,control1X:C,control1Y:w,control2X:T,control2Y:E,endX:b,endY:x,bounds:{left:Math.min(v,C,T,b),top:Math.min(y,w,E,x),right:Math.max(v,C,T,b),bottom:Math.max(y,w,E,x)}}}function O(e){let t=new Set(e.filter(e=>e.directed&&e.from!==e.to).map(e=>JSON.stringify([e.from,e.to])));return new Set(e.filter(e=>e.directed&&e.from!==e.to&&t.has(JSON.stringify([e.to,e.from]))).map(e=>e.id))}function k(e,t,n){let r=1-t,i=r**3*e.startX+3*r**2*t*e.control1X+3*r*t**2*e.control2X+t**3*e.endX,a=r**3*e.startY+3*r**2*t*e.control1Y+3*r*t**2*e.control2Y+t**3*e.endY,o=3*r**2*(e.control1X-e.startX)+6*r*t*(e.control2X-e.control1X)+3*t**2*(e.endX-e.control2X),s=3*r**2*(e.control1Y-e.startY)+6*r*t*(e.control2Y-e.control1Y)+3*t**2*(e.endY-e.control2Y),c=Math.max(1,Math.hypot(o,s));return{x:i+-s/c*n,y:a+o/c*n}}function A(e,t){return!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function j(e,t,n,r,i=0){return{left:e-n/2-i,top:t-r/2-i,right:e+n/2+i,bottom:t+r/2+i}}function ee(e){return e.length===0?null:{left:Math.min(...e.map(e=>e.left)),top:Math.min(...e.map(e=>e.top)),right:Math.max(...e.map(e=>e.right)),bottom:Math.max(...e.map(e=>e.bottom))}}function M(e){return[...e].reduce((e,t)=>e+(/\p{Script=Han}|\p{Script=Hiragana}|\p{Script=Katakana}/u.test(t)?1:.56),0)}function N(e,t){return/\s/u.test(e)||/[./_-]/u.test(e)||e===`:`&&t===`:`}function P(e,t){let n=[...e.trimEnd()];for(;n.length>0&&M(n.join(``)+`…`)>t;)n.pop();return`${n.join(``).trimEnd()}…`}function te(e,t){let n=e.trim();if(!n)return[``];let r=[];for(;M(n)>t;){let e=[...n],i=0,a=0,o=0;for(let n=0;n<e.length;n+=1){let r=e[n],s=i+M(r);if(s>t&&a>0)break;if(i=s,a=n+1,N(r,e[n+1])){if(r===`:`&&e[n+1]===`:`){if(s+M(e[n+1])<=t)o=n+2;else if(n>0){o=n;break}}else o=n+1}if(i>t)break}let s=Math.min(e.length,o>0?o:Math.max(1,a));if(r.push(e.slice(0,s).join(``).trimEnd()),n=e.slice(s).join(``).trimStart(),!n)break}return n&&r.push(n),r}function F(e){let t=Math.max(.56,e.maxUnits),n=e.text.replaceAll(`\r
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,i as n,l as r,t as i}from"./FileIcon-wDKKQgGv.js";import{a,c as o,d as s,f as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"./index-DC6BgBp4.js";var y=e(r(),1),b=210,x=64,S=11,C=2;function w(e,t){return e.localeCompare(t,`en`)}function T(e){let t=[...new Set(e)],n=new Map(t.map(e=>[e,e.split(`/`)]));return new Map(t.map(e=>{let r=n.get(e);for(let i=1;i<=r.length;i+=1){let a=r.slice(-i).join(`/`);if(t.every(t=>t===e||n.get(t).slice(-i).join(`/`)!==a))return[e,a]}return[e,e]}))}function E(e,t){let n=e.anchors.flatMap(e=>{let n=t.get(e.path);return n?[n]:[]}),r=[...new Set(n)].sort(w);return{anchorCount:e.anchors.length,changeKind:r.length>1?`mixed`:r.length===1?r[0]:null}}function D(e,t,n=0,r=!1){let i=t[e.from],a=t[e.to];if(!i||!a)return null;let o=i.x+114,s=i.y+56,c=a.x+114,l=a.y+56;if(e.from===e.to){let e=i.x+228,t=i.y,r=n*.3,a=88+Math.abs(n)*.35;return{path:`M ${e+8} ${t+34+r} C ${e+a} ${t-84+r}, ${e+a} ${t+112+84+r}, ${e+8} ${t+112-34+r}`,startX:e+8,startY:t+34+r,control1X:e+a,control1Y:t-84+r,control2X:e+a,control2Y:t+112+84+r,endX:e+8,endY:t+112-34+r,bounds:{left:e+8,top:t-84+r,right:e+a,bottom:t+112+84+r}}}let u=c-o,d=l-s,f=Math.max(1,Math.hypot(u,d)),p=u/f,m=d/f,h=-m,g=p,_=Math.min(114/Math.max(1e-4,Math.abs(p)),56/Math.max(1e-4,Math.abs(m)))+8,v=o+p*_+h*n,y=s+m*_+g*n,b=c-p*_+h*n,x=l-m*_+g*n,S=Math.min(r?168:96,Math.max(r?132:n===0?28:52,f*(r?.18:.1)))+n*.35,C=v+(b-v)*.36+h*S,w=y+(x-y)*.36+g*S,T=v+(b-v)*.64+h*S,E=y+(x-y)*.64+g*S;return{path:`M ${v} ${y} C ${C} ${w}, ${T} ${E}, ${b} ${x}`,startX:v,startY:y,control1X:C,control1Y:w,control2X:T,control2Y:E,endX:b,endY:x,bounds:{left:Math.min(v,C,T,b),top:Math.min(y,w,E,x),right:Math.max(v,C,T,b),bottom:Math.max(y,w,E,x)}}}function O(e){let t=new Set(e.filter(e=>e.directed&&e.from!==e.to).map(e=>JSON.stringify([e.from,e.to])));return new Set(e.filter(e=>e.directed&&e.from!==e.to&&t.has(JSON.stringify([e.to,e.from]))).map(e=>e.id))}function k(e,t,n){let r=1-t,i=r**3*e.startX+3*r**2*t*e.control1X+3*r*t**2*e.control2X+t**3*e.endX,a=r**3*e.startY+3*r**2*t*e.control1Y+3*r*t**2*e.control2Y+t**3*e.endY,o=3*r**2*(e.control1X-e.startX)+6*r*t*(e.control2X-e.control1X)+3*t**2*(e.endX-e.control2X),s=3*r**2*(e.control1Y-e.startY)+6*r*t*(e.control2Y-e.control1Y)+3*t**2*(e.endY-e.control2Y),c=Math.max(1,Math.hypot(o,s));return{x:i+-s/c*n,y:a+o/c*n}}function A(e,t){return!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function j(e,t,n,r,i=0){return{left:e-n/2-i,top:t-r/2-i,right:e+n/2+i,bottom:t+r/2+i}}function ee(e){return e.length===0?null:{left:Math.min(...e.map(e=>e.left)),top:Math.min(...e.map(e=>e.top)),right:Math.max(...e.map(e=>e.right)),bottom:Math.max(...e.map(e=>e.bottom))}}function M(e){return[...e].reduce((e,t)=>e+(/\p{Script=Han}|\p{Script=Hiragana}|\p{Script=Katakana}/u.test(t)?1:.56),0)}function N(e,t){return/\s/u.test(e)||/[./_-]/u.test(e)||e===`:`&&t===`:`}function P(e,t){let n=[...e.trimEnd()];for(;n.length>0&&M(n.join(``)+`…`)>t;)n.pop();return`${n.join(``).trimEnd()}…`}function te(e,t){let n=e.trim();if(!n)return[``];let r=[];for(;M(n)>t;){let e=[...n],i=0,a=0,o=0;for(let n=0;n<e.length;n+=1){let r=e[n],s=i+M(r);if(s>t&&a>0)break;if(i=s,a=n+1,N(r,e[n+1])){if(r===`:`&&e[n+1]===`:`){if(s+M(e[n+1])<=t)o=n+2;else if(n>0){o=n;break}}else o=n+1}if(i>t)break}let s=Math.min(e.length,o>0?o:Math.max(1,a));if(r.push(e.slice(0,s).join(``).trimEnd()),n=e.slice(s).join(``).trimStart(),!n)break}return n&&r.push(n),r}function F(e){let t=Math.max(.56,e.maxUnits),n=e.text.replaceAll(`\r
2
2
  `,`
3
3
  `).replaceAll(`\r`,`
4
4
  `).split(`