@computesdk/loops 0.1.9 → 0.1.10

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.
Files changed (67) hide show
  1. package/README.md +26 -2
  2. package/dist/assets/{abnfDiagram-VCTEODGH-DdEKagjG.js → abnfDiagram-VCTEODGH-DCBDcsG9.js} +1 -1
  3. package/dist/assets/{arc-CBrypTBE.js → arc-XHL_gOXE.js} +1 -1
  4. package/dist/assets/{architectureDiagram-5GKGNRK7-DZ_brcx7.js → architectureDiagram-5GKGNRK7-D2AZUwQa.js} +1 -1
  5. package/dist/assets/{blockDiagram-I7D4REHJ-Cz2ERHQY.js → blockDiagram-I7D4REHJ-B4gIbwtQ.js} +1 -1
  6. package/dist/assets/{c4Diagram-7LVT6UL2-C6EJYPYB.js → c4Diagram-7LVT6UL2-BVQsOVAp.js} +1 -1
  7. package/dist/assets/channel-BflrI4kn.js +1 -0
  8. package/dist/assets/{chunk-2Q5K7J3B-CG7fAgGK.js → chunk-2Q5K7J3B-JT4Vadns.js} +1 -1
  9. package/dist/assets/{chunk-5VM5RSS4-1d5Juq9g.js → chunk-5VM5RSS4-CDeArlJ5.js} +1 -1
  10. package/dist/assets/{chunk-F27PBJKO-BLhdtado.js → chunk-F27PBJKO-CCc4sEwP.js} +1 -1
  11. package/dist/assets/{chunk-IMKFNOWR-DGMwnpoO.js → chunk-IMKFNOWR-CXd4ZLrB.js} +1 -1
  12. package/dist/assets/{chunk-JWPE2WC7-Z3FJy7jQ.js → chunk-JWPE2WC7-DtGxXURA.js} +1 -1
  13. package/dist/assets/{chunk-POPQ4Y6H-H3kLw708.js → chunk-POPQ4Y6H-TYAe-WXZ.js} +1 -1
  14. package/dist/assets/{chunk-SVP7TREG-DE1-aaSq.js → chunk-SVP7TREG-DmyN3wGH.js} +1 -1
  15. package/dist/assets/{chunk-TICWLB2K-BZ6DWCyL.js → chunk-TICWLB2K-CoQRzD2R.js} +1 -1
  16. package/dist/assets/{chunk-XXDRQBXY-B0wzl075.js → chunk-XXDRQBXY-Cdv4d7MB.js} +1 -1
  17. package/dist/assets/classDiagram-ZZMXUADV-hGKBk6GI.js +1 -0
  18. package/dist/assets/classDiagram-v2-VYDZK3BY-hGKBk6GI.js +1 -0
  19. package/dist/assets/{cose-bilkent-JH36ORCC-Ch1VTcLM.js → cose-bilkent-JH36ORCC-B_tFtaAU.js} +1 -1
  20. package/dist/assets/{cynefin-OW5HDTMX-CZXtBHB9.js → cynefin-OW5HDTMX-Cwqvcd49.js} +1 -1
  21. package/dist/assets/{cynefinDiagram-5FMLGOSQ-CUnTwdfR.js → cynefinDiagram-5FMLGOSQ-DABTV6Vb.js} +1 -1
  22. package/dist/assets/{dagre-GXQ25YYZ-B_Ttt5bQ.js → dagre-GXQ25YYZ-TYrmYsuz.js} +1 -1
  23. package/dist/assets/{diagram-S7CK7UJ4-B5dbIi3W.js → diagram-S7CK7UJ4-DHSEu2H3.js} +1 -1
  24. package/dist/assets/{diagram-UQ7AKVKN-CXqSDNYw.js → diagram-UQ7AKVKN-C019YqL0.js} +1 -1
  25. package/dist/assets/{diagram-VSXAHHWV-D1bxrNKq.js → diagram-VSXAHHWV-D4MEzffI.js} +1 -1
  26. package/dist/assets/{diagram-VX7I27RA-CruFrG5p.js → diagram-VX7I27RA-kFJ0JvUv.js} +1 -1
  27. package/dist/assets/{diagram-Z3DM3KII-BRPunBma.js → diagram-Z3DM3KII-BcO31l9N.js} +1 -1
  28. package/dist/assets/{ebnfDiagram-PWID7BFC-Bj57oII-.js → ebnfDiagram-PWID7BFC-DZj4QQh4.js} +1 -1
  29. package/dist/assets/{erDiagram-RLTQ6QDP-CDv7flCN.js → erDiagram-RLTQ6QDP-CmJHu3yl.js} +1 -1
  30. package/dist/assets/{flowDiagram-HODETNUW-B6g-MRgn.js → flowDiagram-HODETNUW-Cs2i9PHj.js} +1 -1
  31. package/dist/assets/{ganttDiagram-EL5Y4UJY-BMxDQ5GW.js → ganttDiagram-EL5Y4UJY-DeROwj00.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-WWUBYQGX-D0AGhPhc.js → gitGraphDiagram-WWUBYQGX--qyeTDhG.js} +1 -1
  33. package/dist/assets/{highlighted-body-JLMTFACH-CKWVqtZJ.js → highlighted-body-JLMTFACH-ChXoKzQk.js} +1 -1
  34. package/dist/assets/index-C1H-VPU1.css +1 -0
  35. package/dist/assets/index-D-f-6Xq7.js +902 -0
  36. package/dist/assets/{infoDiagram-27XIBGKW-Y8WvdJTY.js → infoDiagram-27XIBGKW-CL4TN3Oz.js} +1 -1
  37. package/dist/assets/{ishikawaDiagram-5VMMS53U-DvwGVY_t.js → ishikawaDiagram-5VMMS53U-BOpnwC1K.js} +1 -1
  38. package/dist/assets/{journeyDiagram-3NMN7TZE-BgiQ1SZH.js → journeyDiagram-3NMN7TZE-B9WrcTg4.js} +1 -1
  39. package/dist/assets/{kanban-definition-UXKFOSKX-CYHv1Q-j.js → kanban-definition-UXKFOSKX-k-zPWS3C.js} +1 -1
  40. package/dist/assets/{layout-DDEx8snc.js → layout-3kvHth78.js} +1 -1
  41. package/dist/assets/{linear-Yy___T_L.js → linear-BWj_7-Qu.js} +1 -1
  42. package/dist/assets/{mindmap-definition-YA3MSWOX-0NL31y0F.js → mindmap-definition-YA3MSWOX-CHQiqXfo.js} +1 -1
  43. package/dist/assets/{pegDiagram-XKGWAZYB-DvZDGnQm.js → pegDiagram-XKGWAZYB-CbU0Toll.js} +1 -1
  44. package/dist/assets/{pieDiagram-E7YTZNPT-BW9LA7eU.js → pieDiagram-E7YTZNPT-DMet_oui.js} +1 -1
  45. package/dist/assets/{quadrantDiagram-AXDQQJYC-TVHWsAYs.js → quadrantDiagram-AXDQQJYC-BebzO8sd.js} +1 -1
  46. package/dist/assets/{railroadDiagram-O6MQD6OU-BCbDFKKB.js → railroadDiagram-O6MQD6OU-Bh8-vPzn.js} +1 -1
  47. package/dist/assets/{requirementDiagram-BXWQKSXE-blerqPMI.js → requirementDiagram-BXWQKSXE-BPUXWj9N.js} +1 -1
  48. package/dist/assets/{sankeyDiagram-P5KCCOFB-sj1di0Zb.js → sankeyDiagram-P5KCCOFB-py5UjYxE.js} +1 -1
  49. package/dist/assets/{sequenceDiagram-WJ2MYXX4-K41SK9p7.js → sequenceDiagram-WJ2MYXX4-7dG5yYB3.js} +1 -1
  50. package/dist/assets/{sizeCapture-INFHLROL-DrUx6LOV.js → sizeCapture-INFHLROL-84MVWGh6.js} +1 -1
  51. package/dist/assets/{stateDiagram-D77RDMKH-CjUNT9OC.js → stateDiagram-D77RDMKH-BI7nUn04.js} +1 -1
  52. package/dist/assets/stateDiagram-v2-MP3YSRHH-C1raQMUd.js +1 -0
  53. package/dist/assets/{swimlanes-42K2YHIH-CuY-VJSs.js → swimlanes-42K2YHIH-kmjOxJ3M.js} +1 -1
  54. package/dist/assets/swimlanesDiagram-VR7AAH4N-Du4mhJod.js +8 -0
  55. package/dist/assets/{timeline-definition-24CTP7MA-CNZF8Fxm.js → timeline-definition-24CTP7MA-x-0bw4L3.js} +1 -1
  56. package/dist/assets/{vennDiagram-4TSXK5OY-Dg_Ym6Si.js → vennDiagram-4TSXK5OY-CPpgLcl3.js} +1 -1
  57. package/dist/assets/{wardleyDiagram-VM6X3IG4-DxMdS5qv.js → wardleyDiagram-VM6X3IG4-B32JnOAm.js} +1 -1
  58. package/dist/assets/{xychartDiagram-S5SC5T6Z-BdXcE79M.js → xychartDiagram-S5SC5T6Z-HnFQQ24s.js} +1 -1
  59. package/dist/index.html +2 -2
  60. package/package.json +3 -3
  61. package/dist/assets/channel-B0rZ0iC3.js +0 -1
  62. package/dist/assets/classDiagram-ZZMXUADV-CVR-qi7G.js +0 -1
  63. package/dist/assets/classDiagram-v2-VYDZK3BY-CVR-qi7G.js +0 -1
  64. package/dist/assets/index-DbE5Rq8K.css +0 -1
  65. package/dist/assets/index-pVnDDZ5G.js +0 -902
  66. package/dist/assets/stateDiagram-v2-MP3YSRHH-BlkYl1y8.js +0 -1
  67. package/dist/assets/swimlanesDiagram-VR7AAH4N-9dXcUy7L.js +0 -8
package/README.md CHANGED
@@ -98,8 +98,8 @@ It prints the address and opens it:
98
98
  ```
99
99
 
100
100
  `--no-open` (or `LOOPS_UI_OPEN=0`) prints the address without launching a browser. When the URL carries a token — off
101
- loopback — the opened address is the attach form, `/?server=…&token=…`, which the app adopts once and strips from the
102
- address bar.
101
+ loopback — the opened address is the attach form, `/?server=…&token=…`. The app adopts it once and removes the token
102
+ from the address bar and current history entry. A non-secret external server address stays in navigation links.
103
103
 
104
104
  A loop needs the engine, so the boot says when it is missing rather than leaving you to find out on the first prompt:
105
105
  if the selected Pi executable or an `--extensions` path does not exist, it prints what is wrong and the fix under `!! a loop
@@ -108,6 +108,30 @@ repos and read what already ran.
108
108
 
109
109
  A **workspace is a directory on the connected VM**, with its chats, runs, and `.pi/loops.json`.
110
110
  `+` opens the launcher: choose a recent workspace, browse the VM's directories, or paste an absolute path (`~/` works).
111
+
112
+ ### Navigation links
113
+
114
+ Workspaces, chats, and loop views have bookmarkable URLs:
115
+
116
+ ```text
117
+ /workspaces
118
+ /workspaces/<workspace-id>
119
+ /workspaces/<workspace-id>/chats/<chat-id>
120
+ /workspaces/<workspace-id>/chats/<chat-id>/loops/<run-id>
121
+ /workspaces/<workspace-id>/chats/<chat-id>/loops/<run-id>?round=2&attempt=R2-safe
122
+ ```
123
+
124
+ IDs and attempt names are URL-encoded, durable identifiers, not display titles. Links support copy-link,
125
+ new tabs, reload, and browser Back/Forward. Explicit links take precedence over remembered selections;
126
+ only the legacy bare `/` entry restores the last selection and replaces itself with its concrete URL.
127
+ Opening a link never creates a chat or rebinds its directory. A known closed workspace reopens with the
128
+ same ID. Unknown, unavailable, or mismatched targets show an error and recovery links, not another
129
+ chat's content or actions. Round/attempt focus is validated against that chat's actual loop history.
130
+
131
+ When attached to another backend, links include `?server=…` (alongside any round/attempt parameters),
132
+ but never its bearer token. Recipients need their own access to that server. A server-only link cannot
133
+ forward another backend's saved credential; same-origin authenticated links retain their token on reload.
134
+ An explicit link without a server parameter refers to the origin serving the UI, not a stale attached-server preference.
111
135
  Home, Up, breadcrumbs, and Show hidden navigate the server's filesystem, not the browser's computer.
112
136
  The picker shows whether Git has a commit; opening a directory never initializes Git or edits the project.
113
137
 
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-SVP7TREG-DE1-aaSq.js";import{p as f}from"./chunk-JWPE2WC7-Z3FJy7jQ.js";import{_ as n,l as o}from"./index-pVnDDZ5G.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-CZXtBHB9.js";var v=d().RailroadAbnf.parser.LangiumParser,l=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),i=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:i,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return l(e.element);case"AbnfOptionalGroup":return{type:"optional",element:l(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:l(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},w={parser:R,db:a,renderer:u,styles:p};export{w as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-SVP7TREG-DmyN3wGH.js";import{p as f}from"./chunk-JWPE2WC7-DtGxXURA.js";import{_ as n,l as o}from"./index-D-f-6Xq7.js";import{M as c,b as d}from"./cynefin-OW5HDTMX-Cwqvcd49.js";var v=d().RailroadAbnf.parser.LangiumParser,l=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),i=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:i,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return l(e.element);case"AbnfOptionalGroup":return{type:"optional",element:l(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:l(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},w={parser:R,db:a,renderer:u,styles:p};export{w as diagram};
@@ -1 +1 @@
1
- import{K as ln,L as an,M as y,N as tn,O as X,P as O,Q as _,S as un,T as rn,V as $,X as o,Y as M,Z as sn,$ as on,a0 as fn}from"./index-pVnDDZ5G.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,D,S,v,A,N,a){var E=D-l,i=S-h,n=N-v,d=a-A,u=d*E-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*E,h+u*i]}function G(l,h,D,S,v,A,N){var a=l-D,E=h-S,i=(N?A:-A)/$(a*a+E*E),n=i*E,d=-i*a,u=l+n,s=h+d,f=D+n,c=S+d,Q=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,I=(g<0?-1:1)*$(fn(0,T*T*R-P*P)),K=(P*g-m*I)/R,L=(-P*m-g*I)/R,w=(P*g+m*I)/R,p=(-P*m+g*I)/R,x=K-Q,e=L-t,r=w-Q,V=p-t;return x*x+e*e>r*r+V*V&&(K=w,L=p),{cx:K,cy:L,x01:-n,y01:-d,x11:K*(v/T-1),y11:L*(v/T-1)}}function hn(){var l=cn,h=yn,D=M(0),S=null,v=gn,A=dn,N=mn,a=null,E=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,Q=un(c-f),t=c>f;if(a||(a=n=E()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(Q>tn-y)a.moveTo(s*X(f),s*O(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*X(c),u*O(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=Q,I=Q,K=N.apply(this,arguments)/2,L=K>y&&(S?+S.apply(this,arguments):$(u*u+s*s)),w=_(un(s-u)/2,+D.apply(this,arguments)),p=w,x=w,e,r;if(L>y){var V=sn(L/u*O(K)),j=sn(L/s*O(K));(P-=V*2)>y?(V*=t?1:-1,R+=V,T-=V):(P=0,R=T=(f+c)/2),(I-=j*2)>y?(j*=t?1:-1,m+=j,g-=j):(I=0,m=g=(f+c)/2)}var Y=s*X(m),Z=s*O(m),z=u*X(T),B=u*O(T);if(w>y){var C=s*X(g),F=s*O(g),H=u*X(R),J=u*O(R),q;if(Q<rn)if(q=pn(Y,Z,H,J,C,F,z,B)){var U=Y-q[0],W=Z-q[1],k=C-q[0],b=F-q[1],nn=1/O(on((U*k+W*b)/($(U*U+W*W)*$(k*k+b*b)))/2),en=$(q[0]*q[0]+q[1]*q[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}I>y?x>y?(e=G(H,J,Y,Z,s,x,t),r=G(C,F,z,B,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(Y,Z),a.arc(0,0,s,m,g,!t)):a.moveTo(Y,Z),!(u>y)||!(P>y)?a.lineTo(z,B):p>y?(e=G(z,B,C,F,u,-p,t),r=G(Y,Z,H,J,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[X(d)*n,O(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:M(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:M(+n),i):h},i.cornerRadius=function(n){return arguments.length?(D=typeof n=="function"?n:M(+n),i):D},i.padRadius=function(n){return arguments.length?(S=n==null?null:typeof n=="function"?n:M(+n),i):S},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:M(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:M(+n),i):A},i.padAngle=function(n){return arguments.length?(N=typeof n=="function"?n:M(+n),i):N},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{K as ln,L as an,M as y,N as tn,O as X,P as O,Q as _,S as un,T as rn,V as $,X as o,Y as M,Z as sn,$ as on,a0 as fn}from"./index-D-f-6Xq7.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,D,S,v,A,N,a){var E=D-l,i=S-h,n=N-v,d=a-A,u=d*E-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*E,h+u*i]}function G(l,h,D,S,v,A,N){var a=l-D,E=h-S,i=(N?A:-A)/$(a*a+E*E),n=i*E,d=-i*a,u=l+n,s=h+d,f=D+n,c=S+d,Q=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,I=(g<0?-1:1)*$(fn(0,T*T*R-P*P)),K=(P*g-m*I)/R,L=(-P*m-g*I)/R,w=(P*g+m*I)/R,p=(-P*m+g*I)/R,x=K-Q,e=L-t,r=w-Q,V=p-t;return x*x+e*e>r*r+V*V&&(K=w,L=p),{cx:K,cy:L,x01:-n,y01:-d,x11:K*(v/T-1),y11:L*(v/T-1)}}function hn(){var l=cn,h=yn,D=M(0),S=null,v=gn,A=dn,N=mn,a=null,E=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,Q=un(c-f),t=c>f;if(a||(a=n=E()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(Q>tn-y)a.moveTo(s*X(f),s*O(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*X(c),u*O(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=Q,I=Q,K=N.apply(this,arguments)/2,L=K>y&&(S?+S.apply(this,arguments):$(u*u+s*s)),w=_(un(s-u)/2,+D.apply(this,arguments)),p=w,x=w,e,r;if(L>y){var V=sn(L/u*O(K)),j=sn(L/s*O(K));(P-=V*2)>y?(V*=t?1:-1,R+=V,T-=V):(P=0,R=T=(f+c)/2),(I-=j*2)>y?(j*=t?1:-1,m+=j,g-=j):(I=0,m=g=(f+c)/2)}var Y=s*X(m),Z=s*O(m),z=u*X(T),B=u*O(T);if(w>y){var C=s*X(g),F=s*O(g),H=u*X(R),J=u*O(R),q;if(Q<rn)if(q=pn(Y,Z,H,J,C,F,z,B)){var U=Y-q[0],W=Z-q[1],k=C-q[0],b=F-q[1],nn=1/O(on((U*k+W*b)/($(U*U+W*W)*$(k*k+b*b)))/2),en=$(q[0]*q[0]+q[1]*q[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}I>y?x>y?(e=G(H,J,Y,Z,s,x,t),r=G(C,F,z,B,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(Y,Z),a.arc(0,0,s,m,g,!t)):a.moveTo(Y,Z),!(u>y)||!(P>y)?a.lineTo(z,B):p>y?(e=G(z,B,C,F,u,-p,t),r=G(Y,Z,H,J,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[X(d)*n,O(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:M(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:M(+n),i):h},i.cornerRadius=function(n){return arguments.length?(D=typeof n=="function"?n:M(+n),i):D},i.padRadius=function(n){return arguments.length?(S=n==null?null:typeof n=="function"?n:M(+n),i):S},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:M(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:M(+n),i):A},i.padAngle=function(n){return arguments.length?(N=typeof n=="function"?n:M(+n),i):N},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};