@kern0x1b/penstock-cli 26.10.3 → 26.10.4

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 (76) hide show
  1. package/dist/licensing.json +1 -1
  2. package/dist/penstock.js +458 -197
  3. package/dist/web/assets/{AgentSettings-C-1YBic4.js → AgentSettings-BvzT4Itb.js} +1 -1
  4. package/dist/web/assets/{AgentsDialog-CSu8pyh7.js → AgentsDialog-BqY3wKcV.js} +1 -1
  5. package/dist/web/assets/BpmnCanvas-BTdM1l9l.js +1905 -0
  6. package/dist/web/assets/BpmnDocument-uifU3NGG.js +24 -0
  7. package/dist/web/assets/{ConflictDialog-nygfF7Dn.js → ConflictDialog-C4A9-Psr.js} +1 -1
  8. package/dist/web/assets/{DiffDocument-DUrje9io.js → DiffDocument-BMTSevd7.js} +1 -1
  9. package/dist/web/assets/{DmnDocument-fn7AH7P1.js → DmnDocument-B8wWuhfX.js} +9 -9
  10. package/dist/web/assets/{FormDocument-BbyRqjib.js → FormDocument-bQ5VRsrh.js} +1 -1
  11. package/dist/web/assets/{FormStepView-BYRMBW0U.js → FormStepView-DbMCFSO1.js} +1 -1
  12. package/dist/web/assets/{GraphAwareLayoutService-BiLVDmB7.js → GraphAwareLayoutService-CePcz6pL.js} +1 -1
  13. package/dist/web/assets/NewFileDialog-DsoFURD9.js +47 -0
  14. package/dist/web/assets/{QuickOpen-D-u9hdSt.js → QuickOpen-mzlfRqvG.js} +1 -1
  15. package/dist/web/assets/{ScriptPane-BQorfmyv.js → ScriptPane-C9q5wLfO.js} +2 -2
  16. package/dist/web/assets/{ScriptRunDialog-DjBW0LRD.js → ScriptRunDialog-Dm-_0H1Z.js} +1 -1
  17. package/dist/web/assets/{SettingsDialog-DvYUAKpH.js → SettingsDialog-Bhwwtyg7.js} +1 -1
  18. package/dist/web/assets/{ShortcutsDialog-BQ5BYHj3.js → ShortcutsDialog-BXP0h7Tp.js} +1 -1
  19. package/dist/web/assets/{SourceDocument-BfHVXxuk.js → SourceDocument-DgrNCprS.js} +1 -1
  20. package/dist/web/assets/{TextDocument-BPepqeGu.js → TextDocument-D8N0uaQa.js} +1 -1
  21. package/dist/web/assets/{UnreadableFileLayer-D5B6nixz.js → UnreadableFileLayer-D2Rcxnt7.js} +1 -1
  22. package/dist/web/assets/{UploadDialog-BzIvQ1YS.js → UploadDialog-Dinga4TP.js} +1 -1
  23. package/dist/web/assets/apply-CzXxiRWK.js +1 -0
  24. package/dist/web/assets/{bpmnTheme-Divwrkjy.js → bpmnTheme-db4tYvop.js} +1 -1
  25. package/dist/web/assets/bridgeInstance-BPwbITOf.js +850 -0
  26. package/dist/web/assets/{commands-N2yKHjf_.js → commands-BAnBjEk3.js} +1 -1
  27. package/dist/web/assets/de-Cd75cvcZ.js +1 -0
  28. package/dist/web/assets/{dialog-DSf66Ory.js → dialog-KVjfqSrB.js} +1 -1
  29. package/dist/web/assets/{diff-DkfgVbKD.js → diff-Cw0ENHJR.js} +1 -1
  30. package/dist/web/assets/{documentBridge-DSWBQZRP.js → documentBridge-D5SaBThP.js} +8 -8
  31. package/dist/web/assets/{documents-C4vr2KnQ.js → documents-Dkor36oS.js} +1 -1
  32. package/dist/web/assets/{duplicate-C-AiqE1T.js → duplicate-ud-StKuO.js} +1 -1
  33. package/dist/web/assets/{engines-DG8KgTeX.js → engines-BQRXHtW8.js} +1 -1
  34. package/dist/web/assets/es-D2PUEg_Z.js +1 -0
  35. package/dist/web/assets/{formChecks-B_ZFz9DR.js → formChecks-DFrCuO4I.js} +1 -1
  36. package/dist/web/assets/fr-DkGYGarc.js +1 -0
  37. package/dist/web/assets/{frontend-BLfXy4OQ.js → frontend-B05iyhCp.js} +1 -1
  38. package/dist/web/assets/{httpHost-Cll6HteE.js → httpHost-DX-P_FDg.js} +1 -1
  39. package/dist/web/assets/{index.es-DQAdm_u9.js → index.es-DR-czZl7.js} +1 -1
  40. package/dist/web/assets/{index.es-B0wi5_fv.js → index.es-dFUgH_-g.js} +1 -1
  41. package/dist/web/assets/{intelligence-glU4hcHy.js → intelligence-BkxcJMU_.js} +1 -1
  42. package/dist/web/assets/ja-De4NAvK-.js +1 -0
  43. package/dist/web/assets/{jspdf.es.min-xdeBAA_m.js → jspdf.es.min-BMfOi0te.js} +3 -3
  44. package/dist/web/assets/ko-Ci27KQ5n.js +1 -0
  45. package/dist/web/assets/{lib-DJ1i09sd.js → lib-C3uYnGWx.js} +1 -1
  46. package/dist/web/assets/{engine-BPUfS3r2.js → moddle-CGpeSs3G.js} +1 -1
  47. package/dist/web/assets/{platform-BS7bgwr3.js → platform-zEAtGnYc.js} +1 -1
  48. package/dist/web/assets/preferences-K6VRM9Ah.js +1 -0
  49. package/dist/web/assets/pt-BR-CNmIseZJ.js +1 -0
  50. package/dist/web/assets/ru-BtK7W4xW.js +1 -0
  51. package/dist/web/assets/{run-Df8AD_as.js → run-fV7AmV4q.js} +1 -1
  52. package/dist/web/assets/{samples-chRLnLcq.js → samples-D-3Bquy_.js} +1 -1
  53. package/dist/web/assets/testCaseRuns-C-0blM3d.js +1 -0
  54. package/dist/web/assets/translator-Dvvasoz-.js +1 -0
  55. package/dist/web/assets/{ui-AICOEtWR.js → ui-TBzvKaKQ.js} +1 -1
  56. package/dist/web/assets/{useTrace-B3gDUL0X.js → useTrace-BgpeAcQR.js} +1 -1
  57. package/dist/web/assets/{web-BtxFF0jJ.js → web-qJCedJJw.js} +8 -8
  58. package/dist/web/assets/zh-DxI_A5kC.js +1 -0
  59. package/dist/web/index.html +20 -20
  60. package/package.json +4 -1
  61. package/dist/web/assets/BpmnCanvas-DnBLxMNQ.js +0 -1905
  62. package/dist/web/assets/BpmnDocument-BPpyqTzJ.js +0 -24
  63. package/dist/web/assets/NewFileDialog-Ce_cTeOv.js +0 -34
  64. package/dist/web/assets/apply-B0vauBJn.js +0 -1
  65. package/dist/web/assets/bridgeInstance-D0bzpNGz.js +0 -600
  66. package/dist/web/assets/de-izeWpfua.js +0 -1
  67. package/dist/web/assets/es-CRMYEYWD.js +0 -1
  68. package/dist/web/assets/fr-8pTyPyAI.js +0 -1
  69. package/dist/web/assets/ja-I1fjeFMy.js +0 -1
  70. package/dist/web/assets/ko-CFd9C-RA.js +0 -1
  71. package/dist/web/assets/preferences-C_EXTz45.js +0 -1
  72. package/dist/web/assets/pt-BR-Dl_APu95.js +0 -1
  73. package/dist/web/assets/ru-_vhcOTod.js +0 -1
  74. package/dist/web/assets/testCaseRuns-DLEqANBi.js +0 -1
  75. package/dist/web/assets/translator-CS9eR0My.js +0 -1
  76. package/dist/web/assets/zh-Do_q1RZ2.js +0 -1
@@ -1 +1 @@
1
- import"./rolldown-runtime-B8BYMn-z.js";import{_ as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,o as c,p as l,r as u,s as d,u as f}from"./vendor-NJP34MHU.js";import{i as p,t as m}from"./translator-CS9eR0My.js";import{G as h,W as g,t as _}from"./bridgeInstance-D0bzpNGz.js";import{a as v,c as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./dialog-DSf66Ory.js";var E=x(null);function buttonOrder(){return E}async function loadButtonOrder(){try{let e=await _().getDialogButtonOrder();e&&(E=e)}catch(e){console.error(e)}}var D=i({locale:`en`,t:m(`en`)});function useI18n(){return r(D)}function useTranslate(){return useI18n().t}function I18nProvider({locale:e,children:t}){let n=c(()=>({locale:e,t:m(e)}),[e]);return u(D.Provider,{value:n,children:t})}var O=`data-modal-open`,k=i(`top`);function useLabelLayout(){return r(k)}var A=`a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])`;function focusables(e){return Array.from(e.querySelectorAll(A)).filter(e=>!e.closest(`[hidden]`))}function focusInside(e,t,n){n===`title`?t?.focus():((n===`safe`?e.querySelector(`[data-safe]`):focusables(e.querySelector(`.ui-dialog__body`)??e)[0])??focusables(e)[0]??e).focus()}function Dialog({title:e,subtitle:n,size:r,onClose:i,onSubmit:a,destructive:c,initialFocus:l,backdrop:d=`keep`,body:p=`form`,labels:m,footer:h,class:g,children:_}){let v=useTranslate(),y=s(),b=o(null),x=o(null),S=o(i);S.current=i;let w=m??(r===`small`?`top`:`left`),[E,D]=t(!1);f(()=>{let t=b.current?.closest(`.ui-dialog-overlay`);if(t){if(document.querySelector(`.ui-dialog-overlay[${O}]`))console.error(`A modal never opens another modal:`,e),D(!0),S.current();else return t.setAttribute(O,``),()=>t.removeAttribute(O)}},[]),f(()=>{let e=b.current;if(E||!e)return;let t=document.activeElement;focusInside(e,x.current,l??(c?`safe`:`first`));let onKeyDown=t=>{if(t.key===`Escape`){if(document.querySelector(`.ui-popover, .cm-tooltip-autocomplete`))return;t.stopPropagation(),t.preventDefault(),S.current();return}if(t.key!==`Tab`)return;let n=focusables(e),r=C(n.length,n.indexOf(document.activeElement),t.shiftKey);r!==null&&(t.preventDefault(),n[r].focus())};return document.addEventListener(`keydown`,onKeyDown,!0),()=>{document.removeEventListener(`keydown`,onKeyDown,!0);try{t?.focus?.()}catch{}}},[E]);let onEnter=e=>{if(e.defaultPrevented||!a||!(e.target instanceof HTMLElement))return;let t=e.target;if(T({key:e.key,tag:t.tagName,type:t.type,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,destructive:c})){e.preventDefault();try{a()}catch(e){console.error(`Dialog onSubmit error:`,e)}}};return E?null:u(`div`,{class:`ui-dialog-overlay`,onMouseDown:e=>d===`close`&&e.target===e.currentTarget&&S.current(),children:u(`div`,{ref:b,class:`ui-dialog ui-dialog--${r}${g?` ${g}`:``}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":y,tabIndex:-1,onKeyDown:onEnter,children:[u(`header`,{class:`ui-dialog__header`,children:[u(`div`,{class:`ui-dialog__heading`,children:[u(`h2`,{id:y,ref:x,class:`ui-dialog__title type-dialog-title`,tabIndex:-1,children:e}),n&&u(`p`,{class:`ui-dialog__subtitle`,children:n})]}),u(`button`,{type:`button`,class:`ui-dialog__close`,"aria-label":v(`app.common.close`),title:v(`app.common.close`),onClick:()=>S.current(),children:u(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:u(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]}),u(k.Provider,{value:w,children:u(`div`,{class:`ui-dialog__body ui-dialog__body--${p}`,children:_})}),h]})})}function ActionButtons({actions:e}){return u(a,{children:v(e,buttonOrder()).map(e=>u(`button`,{type:`button`,class:`ui-button type-button${e.role===`primary`?` ui-button--primary`:``}`,disabled:e.disabled||e.busy||w(e),title:e.title,"aria-busy":e.busy||void 0,"data-safe":e.role===`cancel`?``:void 0,onClick:()=>{try{e.onClick()}catch(e){console.error(e)}},children:e.label},e.id))})}function DialogFooter({actions:e,help:t}){return u(`footer`,{class:`ui-dialog__footer`,children:[t&&u(`div`,{class:`ui-dialog__help type-help`,children:t}),u(ActionButtons,{actions:e})]})}function FieldError({id:e,children:t}){return u(`p`,{id:e,class:`ui-field__error`,children:[u(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:[u(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),u(`path`,{d:`M8 4.5v4M8 11v.5`})]}),u(`span`,{children:t})]})}function Field({label:t,hint:n,error:r,optional:i,required:a,layout:o,group:c,class:l,children:d}){let f=s(),p=useTranslate(),m=useLabelLayout(),h=o??m,g=[n?`${f}-hint`:null,r?`${f}-error`:null].filter(Boolean).join(` `);return u(`div`,{class:`ui-field ui-field--${h}${r?` has-error`:``}${l?` ${l}`:``}`,children:[e(c?`span`:`label`,{class:`ui-field__label`,id:c?`${f}-label`:void 0,for:c?void 0:f},a&&u(`span`,{class:`ui-field__required`,"aria-hidden":`true`,children:`* `}),t,i&&u(`span`,{class:`ui-field__optional`,children:p(`app.common.optional`)})),u(`div`,{class:`ui-field__control`,children:[d({id:f,class:`ui-input`,"aria-describedby":g||void 0,"aria-invalid":r?!0:void 0,...c?{role:c,"aria-labelledby":`${f}-label`}:{}}),n&&u(`p`,{id:`${f}-hint`,class:`ui-field__hint type-help`,children:n}),r&&u(FieldError,{id:`${f}-error`,children:r})]})]})}var j=`a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])`,M=i(!1);function Popover({anchor:e,label:n,onClose:i,onEscape:a,width:s=320,class:c,children:l}){let p=o(null),m=o(i);m.current=i;let h=o(a);h.current=a;let[g,_]=t(null),v=r(M);d(()=>{let place=()=>{let t=p.current;if(e&&t)try{let n=e.getBoundingClientRect(),r={width:s,height:t.offsetHeight},i=typeof window<`u`&&Number.isFinite(window.innerWidth)&&window.innerWidth>0?window.innerWidth:1024,a=typeof window<`u`&&Number.isFinite(window.innerHeight)&&window.innerHeight>0?window.innerHeight:768,o=S({left:n.left,top:n.top,width:n.width,height:n.height},r,{width:i,height:a});_({top:o.top,left:o.left})}catch{}};place(),window.addEventListener(`resize`,place);let t=typeof ResizeObserver>`u`||!p.current?null:new ResizeObserver(place);return t&&p.current&&t.observe(p.current),()=>{window.removeEventListener(`resize`,place),t?.disconnect()}},[e,s]);let y=g!==null;return f(()=>{if(y)try{p.current?.querySelector(j)?.focus()}catch{}},[y]),f(()=>{let t=p.current;if(!t)return;let n=document.activeElement,away=n=>{n instanceof Node&&!t.contains(n)&&!e?.contains(n)&&m.current()},press=e=>away(e.target),keys=e=>{e.key===`Escape`&&(e.stopPropagation(),!h.current?.()&&m.current())};return document.addEventListener(`pointerdown`,press,!0),document.addEventListener(`mousedown`,press),document.addEventListener(`keydown`,keys,!0),()=>{if(document.removeEventListener(`pointerdown`,press,!0),document.removeEventListener(`mousedown`,press),document.removeEventListener(`keydown`,keys,!0),t.contains(document.activeElement)||document.activeElement===document.body)try{(e??n)?.focus?.()}catch{}}},[e]),v?(console.error(`A popover never nests:`,n),null):u(M.Provider,{value:!0,children:u(`div`,{ref:p,class:`ui-popover${c?` ${c}`:``}`,role:`dialog`,"aria-label":n,style:{width:`${s}px`,top:`${g?.top??0}px`,left:`${g?.left??0}px`,visibility:g?`visible`:`hidden`},children:l})})}function EmptyState({title:e,hint:t,actions:n=[],guide:r}){return u(`div`,{class:`ui-empty`,children:[u(`p`,{class:`ui-empty__title`,children:e}),t&&u(`p`,{class:`ui-empty__hint`,children:[t,r&&u(a,{children:[` `,u(`a`,{class:`ui-empty__link`,href:h(r),target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{e.preventDefault(),g(r)},children:p(`app.common.learnMore`)})]})]}),n.length>0&&u(`div`,{class:`ui-empty__actions`,children:n.slice(0,2).map(e=>u(`button`,{type:`button`,class:`ui-button`,onClick:e.run,children:e.label},e.label))})]})}function useTouched(){let[e,r]=t(new Set),[i,a]=t(new Set),[o,s]=t(!1);return{submitted:o,touch:n(e=>{r(t=>t.has(e)?t:new Set(t).add(e)),a(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),reveal:n(e=>a(t=>{let n=new Set(t);return Array.isArray(e)&&e.forEach(e=>n.add(e)),n}),[]),submit:n(()=>{a(new Set),s(!0)},[]),errorOf:n((t,n)=>y({error:n,revealed:i.has(t),shown:b({error:n,touched:e.has(t),submitted:o})}),[i,e,o])}}var ErrorBoundary=class extends l{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(e,t)}handleReload=()=>{try{this.props.onReload?this.props.onReload():typeof window<`u`&&typeof window.location?.reload==`function`&&window.location.reload()}catch{}};render(){if(this.state.hasError){let e=``;try{e=this.state.error?.message||(this.state.error?String(this.state.error):``)}catch{e=``}return u(`div`,{class:`startup-failure`,role:`alert`,children:u(`div`,{class:`startup-failure__inner`,children:[u(EmptyState,{title:p(`app.startup.theEditorCouldNotStart`),hint:p(`app.startup.retryingReloadsTheEditorAnd`),actions:[{label:p(`app.common.reload`),run:this.handleReload}]}),e&&u(`pre`,{class:`startup-failure__message`,children:e})]})})}return this.props.children}},N=8;function nextEnabled(e,t,n){for(let r=1;r<=e.length;r+=1){let i=(t+n*r+e.length*r)%e.length;if(!e[i].disabled)return i}return t}function ContextMenu({label:e,at:n,items:r,onClose:i,returnFocusTo:a}){let s=o(null),[c,l]=t(null),[p,m]=t(()=>r.findIndex(e=>!e.disabled)),h=o(i);h.current=i,d(()=>{let e=s.current;if(!e)return;let t=e.offsetWidth,r=e.offsetHeight,i=Math.max(N,Math.min(n.x,window.innerWidth-t-N)),a=Math.max(N,Math.min(n.y,window.innerHeight-r-N));l({left:i,top:a})},[n.x,n.y]),f(()=>{let e=s.current,t=document.activeElement,n=a?.isConnected?a:t,away=t=>{t.target instanceof Node&&e&&!e.contains(t.target)&&h.current()},leave=()=>h.current();return document.addEventListener(`pointerdown`,away,!0),window.addEventListener(`blur`,leave),window.addEventListener(`resize`,leave),()=>{document.removeEventListener(`pointerdown`,away,!0),window.removeEventListener(`blur`,leave),window.removeEventListener(`resize`,leave);try{n?.focus?.({preventScroll:!0})}catch{}}},[]),f(()=>{c&&s.current?.focus({preventScroll:!0})},[c!==null]);let choose=e=>{e.disabled||(h.current(),e.run())},onKeyDown=e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),h.current();else if(e.key===`ArrowDown`)e.preventDefault(),m(e=>nextEnabled(r,e,1));else if(e.key===`ArrowUp`)e.preventDefault(),m(e=>nextEnabled(r,e,-1));else if(e.key===`Home`)e.preventDefault(),m(nextEnabled(r,r.length-1,1));else if(e.key===`End`)e.preventDefault(),m(nextEnabled(r,0,-1));else if(e.key===`Enter`||e.key===` `){e.preventDefault(),e.stopPropagation();let t=r[p];t&&choose(t)}else e.key===`Tab`&&(e.preventDefault(),h.current())};return u(`div`,{ref:s,class:`web-menu`,role:`menu`,"aria-label":e,tabIndex:-1,"aria-activedescendant":p>=0?`web-menu-${r[p]?.id}`:void 0,style:{left:`${c?.left??n.x}px`,top:`${c?.top??n.y}px`,visibility:c?`visible`:`hidden`},onKeyDown,onContextMenu:e=>e.preventDefault(),children:r.map((e,t)=>u(`div`,{id:`web-menu-${e.id}`,role:e.checked===void 0?`menuitem`:`menuitemcheckbox`,"aria-checked":e.checked===void 0?void 0:e.checked,"aria-disabled":e.disabled||void 0,class:`web-menu__item type-body${t===p?` is-cursor`:``}${e.danger?` is-danger`:``}${e.disabled?` is-disabled`:``}${e.separated?` is-separated`:``}`,onPointerEnter:()=>!e.disabled&&m(t),onClick:()=>choose(e),children:[u(`span`,{class:`web-menu__label`,children:e.label}),e.shortcut&&u(`span`,{class:`web-menu__shortcut type-help`,children:e.shortcut})]},e.id))})}var P={chat:`<path d="M2.5 2.5h11a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H8.5L5 13.5v-3H2.5a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1z"/><path d="M5 6.5h.01M8 6.5h.01M11 6.5h.01"/>`,expand:`<path d="M9.5 2.5h4v4M13.5 2.5 9 7M6.5 13.5h-4v-4M2.5 13.5 7 9"/>`,collapse:`<path d="M13.5 6.5h-4v-4M9.5 6.5 14 2M2.5 9.5h4v4M6.5 9.5 2 14"/>`,chevronDown:`<path d="M4 6l4 4 4-4"/>`,chevronLeft:`<path d="M10 4 6 8l4 4"/>`,chevronUp:`<path d="M4 10l4-4 4 4"/>`,close:`<path d="M4 4l8 8M12 4l-8 8"/>`,plus:`<path d="M8 3v10M3 8h10"/>`,check:`<path d="M3 8.5 6.5 12 13 4.5"/>`,send:`<path d="M8 13V3.5M4 7.5l4-4 4 4"/>`,stop:`<rect x="4.5" y="4.5" width="7" height="7" rx="1"/>`,alert:`<path d="M8 2l6.5 11.5h-13z"/><path d="M8 6.5v3M8 11.5v.01"/>`,failed:`<circle cx="8" cy="8" r="6"/><path d="M5.5 5.5l5 5M10.5 5.5l-5 5"/>`,hand:`<path d="M5.5 8V3.5a1 1 0 0 1 2 0V7M7.5 7V2.5a1 1 0 0 1 2 0V7M9.5 7V3.5a1 1 0 0 1 2 0V9.5c0 2.5-1.5 4-3.5 4-1.5 0-2.5-.7-3.5-2L2.7 9a1 1 0 0 1 1.6-1.2z"/>`,copy:`<rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"/>`,queue:`<path d="M2 4h9M2 8h9M2 12h5M12.5 10.5 14.5 12.5 12.5 14.5"/>`,file:`<path d="M4 1.5h5.5l3 3v10H4z"/><path d="M9.5 1.5v3h3"/>`,element:`<rect x="1.5" y="4" width="13" height="8" rx="2"/>`,pending:`<circle cx="8" cy="8" r="2.5"/>`,settings:`<path d="M6.62 3.19 6.94 1.33h2.12l.32 1.86 1.04.44 1.55-1.09 1.49 1.49-1.09 1.55.44 1.04 1.86.32v2.12l-1.86.32-.44 1.04 1.09 1.55-1.49 1.49-1.55-1.09-1.04.44-.32 1.86H6.94l-.32-1.86-1.04-.44-1.55 1.09-1.49-1.49 1.09-1.55-.44-1.04-1.86-.32V6.94l1.86-.32.44-1.04-1.09-1.55 1.49-1.49 1.55 1.09z"/><circle cx="8" cy="8" r="2"/>`};function AssistantIcon({name:e,class:t}){return u(`svg`,{class:t,viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:P[e]}})}function Spinner(){return u(`span`,{class:`assistant-spinner`,"aria-hidden":`true`})}function InstallCommand({command:e}){let[n,r]=t(!1),copy=()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return u(`div`,{class:`ui-install-command type-code`,children:[u(`span`,{class:`ui-install-command__prompt`,"aria-hidden":`true`,children:`$`}),u(`code`,{class:`ui-install-command__code`,children:e}),u(`button`,{type:`button`,class:`ui-install-command__copy`,"aria-label":p(`app.common.copyCommand`),title:p(n?`app.common.commandCopied`:`app.common.copyCommand`),onClick:copy,children:u(AssistantIcon,{name:n?`check`:`copy`})})]})}export{ErrorBoundary as a,Popover as c,ActionButtons as d,Dialog as f,loadButtonOrder as g,useTranslate as h,ContextMenu as i,Field as l,I18nProvider as m,AssistantIcon as n,useTouched as o,DialogFooter as p,Spinner as r,EmptyState as s,InstallCommand as t,FieldError as u};
1
+ import"./rolldown-runtime-B8BYMn-z.js";import{_ as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,o as c,p as l,r as u,s as d,u as f}from"./vendor-NJP34MHU.js";import{i as p,t as m}from"./translator-Dvvasoz-.js";import{G as h,W as g,t as _}from"./bridgeInstance-BPwbITOf.js";import{a as v,c as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./dialog-KVjfqSrB.js";var E=x(null);function buttonOrder(){return E}async function loadButtonOrder(){try{let e=await _().getDialogButtonOrder();e&&(E=e)}catch(e){console.error(e)}}var D=i({locale:`en`,t:m(`en`)});function useI18n(){return r(D)}function useTranslate(){return useI18n().t}function I18nProvider({locale:e,children:t}){let n=c(()=>({locale:e,t:m(e)}),[e]);return u(D.Provider,{value:n,children:t})}var O=`data-modal-open`,k=i(`top`);function useLabelLayout(){return r(k)}var A=`a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [contenteditable="true"], [tabindex]:not([tabindex="-1"])`;function focusables(e){return Array.from(e.querySelectorAll(A)).filter(e=>!e.closest(`[hidden]`))}function focusInside(e,t,n){n===`title`?t?.focus():((n===`safe`?e.querySelector(`[data-safe]`):focusables(e.querySelector(`.ui-dialog__body`)??e)[0])??focusables(e)[0]??e).focus()}function Dialog({title:e,subtitle:n,size:r,onClose:i,onSubmit:a,destructive:c,initialFocus:l,backdrop:d=`keep`,body:p=`form`,labels:m,footer:h,class:g,children:_}){let v=useTranslate(),y=s(),b=o(null),x=o(null),S=o(i);S.current=i;let w=m??(r===`small`?`top`:`left`),[E,D]=t(!1);f(()=>{let t=b.current?.closest(`.ui-dialog-overlay`);if(t){if(document.querySelector(`.ui-dialog-overlay[${O}]`))console.error(`A modal never opens another modal:`,e),D(!0),S.current();else return t.setAttribute(O,``),()=>t.removeAttribute(O)}},[]),f(()=>{let e=b.current;if(E||!e)return;let t=document.activeElement;focusInside(e,x.current,l??(c?`safe`:`first`));let onKeyDown=t=>{if(t.key===`Escape`){if(document.querySelector(`.ui-popover, .cm-tooltip-autocomplete`))return;t.stopPropagation(),t.preventDefault(),S.current();return}if(t.key!==`Tab`)return;let n=focusables(e),r=C(n.length,n.indexOf(document.activeElement),t.shiftKey);r!==null&&(t.preventDefault(),n[r].focus())};return document.addEventListener(`keydown`,onKeyDown,!0),()=>{document.removeEventListener(`keydown`,onKeyDown,!0);try{t?.focus?.()}catch{}}},[E]);let onEnter=e=>{if(e.defaultPrevented||!a||!(e.target instanceof HTMLElement))return;let t=e.target;if(T({key:e.key,tag:t.tagName,type:t.type,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,destructive:c})){e.preventDefault();try{a()}catch(e){console.error(`Dialog onSubmit error:`,e)}}};return E?null:u(`div`,{class:`ui-dialog-overlay`,onMouseDown:e=>d===`close`&&e.target===e.currentTarget&&S.current(),children:u(`div`,{ref:b,class:`ui-dialog ui-dialog--${r}${g?` ${g}`:``}`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":y,tabIndex:-1,onKeyDown:onEnter,children:[u(`header`,{class:`ui-dialog__header`,children:[u(`div`,{class:`ui-dialog__heading`,children:[u(`h2`,{id:y,ref:x,class:`ui-dialog__title type-dialog-title`,tabIndex:-1,children:e}),n&&u(`p`,{class:`ui-dialog__subtitle`,children:n})]}),u(`button`,{type:`button`,class:`ui-dialog__close`,"aria-label":v(`app.common.close`),title:v(`app.common.close`),onClick:()=>S.current(),children:u(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:u(`path`,{d:`M4 4l8 8M12 4l-8 8`})})})]}),u(k.Provider,{value:w,children:u(`div`,{class:`ui-dialog__body ui-dialog__body--${p}`,children:_})}),h]})})}function ActionButtons({actions:e}){return u(a,{children:v(e,buttonOrder()).map(e=>u(`button`,{type:`button`,class:`ui-button type-button${e.role===`primary`?` ui-button--primary`:``}`,disabled:e.disabled||e.busy||w(e),title:e.title,"aria-busy":e.busy||void 0,"data-safe":e.role===`cancel`?``:void 0,onClick:()=>{try{e.onClick()}catch(e){console.error(e)}},children:e.label},e.id))})}function DialogFooter({actions:e,help:t}){return u(`footer`,{class:`ui-dialog__footer`,children:[t&&u(`div`,{class:`ui-dialog__help type-help`,children:t}),u(ActionButtons,{actions:e})]})}function FieldError({id:e,children:t}){return u(`p`,{id:e,class:`ui-field__error`,children:[u(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:[u(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),u(`path`,{d:`M8 4.5v4M8 11v.5`})]}),u(`span`,{children:t})]})}function Field({label:t,hint:n,error:r,optional:i,required:a,layout:o,group:c,class:l,children:d}){let f=s(),p=useTranslate(),m=useLabelLayout(),h=o??m,g=[n?`${f}-hint`:null,r?`${f}-error`:null].filter(Boolean).join(` `);return u(`div`,{class:`ui-field ui-field--${h}${r?` has-error`:``}${l?` ${l}`:``}`,children:[e(c?`span`:`label`,{class:`ui-field__label`,id:c?`${f}-label`:void 0,for:c?void 0:f},a&&u(`span`,{class:`ui-field__required`,"aria-hidden":`true`,children:`* `}),t,i&&u(`span`,{class:`ui-field__optional`,children:p(`app.common.optional`)})),u(`div`,{class:`ui-field__control`,children:[d({id:f,class:`ui-input`,"aria-describedby":g||void 0,"aria-invalid":r?!0:void 0,...c?{role:c,"aria-labelledby":`${f}-label`}:{}}),n&&u(`p`,{id:`${f}-hint`,class:`ui-field__hint type-help`,children:n}),r&&u(FieldError,{id:`${f}-error`,children:r})]})]})}var j=`a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])`,M=i(!1);function Popover({anchor:e,label:n,onClose:i,onEscape:a,width:s=320,class:c,children:l}){let p=o(null),m=o(i);m.current=i;let h=o(a);h.current=a;let[g,_]=t(null),v=r(M);d(()=>{let place=()=>{let t=p.current;if(e&&t)try{let n=e.getBoundingClientRect(),r={width:s,height:t.offsetHeight},i=typeof window<`u`&&Number.isFinite(window.innerWidth)&&window.innerWidth>0?window.innerWidth:1024,a=typeof window<`u`&&Number.isFinite(window.innerHeight)&&window.innerHeight>0?window.innerHeight:768,o=S({left:n.left,top:n.top,width:n.width,height:n.height},r,{width:i,height:a});_({top:o.top,left:o.left})}catch{}};place(),window.addEventListener(`resize`,place);let t=typeof ResizeObserver>`u`||!p.current?null:new ResizeObserver(place);return t&&p.current&&t.observe(p.current),()=>{window.removeEventListener(`resize`,place),t?.disconnect()}},[e,s]);let y=g!==null;return f(()=>{if(y)try{p.current?.querySelector(j)?.focus()}catch{}},[y]),f(()=>{let t=p.current;if(!t)return;let n=document.activeElement,away=n=>{n instanceof Node&&!t.contains(n)&&!e?.contains(n)&&m.current()},press=e=>away(e.target),keys=e=>{e.key===`Escape`&&(e.stopPropagation(),!h.current?.()&&m.current())};return document.addEventListener(`pointerdown`,press,!0),document.addEventListener(`mousedown`,press),document.addEventListener(`keydown`,keys,!0),()=>{if(document.removeEventListener(`pointerdown`,press,!0),document.removeEventListener(`mousedown`,press),document.removeEventListener(`keydown`,keys,!0),t.contains(document.activeElement)||document.activeElement===document.body)try{(e??n)?.focus?.()}catch{}}},[e]),v?(console.error(`A popover never nests:`,n),null):u(M.Provider,{value:!0,children:u(`div`,{ref:p,class:`ui-popover${c?` ${c}`:``}`,role:`dialog`,"aria-label":n,style:{width:`${s}px`,top:`${g?.top??0}px`,left:`${g?.left??0}px`,visibility:g?`visible`:`hidden`},children:l})})}function EmptyState({title:e,hint:t,actions:n=[],guide:r}){return u(`div`,{class:`ui-empty`,children:[u(`p`,{class:`ui-empty__title`,children:e}),t&&u(`p`,{class:`ui-empty__hint`,children:[t,r&&u(a,{children:[` `,u(`a`,{class:`ui-empty__link`,href:h(r),target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{e.preventDefault(),g(r)},children:p(`app.common.learnMore`)})]})]}),n.length>0&&u(`div`,{class:`ui-empty__actions`,children:n.slice(0,2).map(e=>u(`button`,{type:`button`,class:`ui-button`,onClick:e.run,children:e.label},e.label))})]})}function useTouched(){let[e,r]=t(new Set),[i,a]=t(new Set),[o,s]=t(!1);return{submitted:o,touch:n(e=>{r(t=>t.has(e)?t:new Set(t).add(e)),a(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),reveal:n(e=>a(t=>{let n=new Set(t);return Array.isArray(e)&&e.forEach(e=>n.add(e)),n}),[]),submit:n(()=>{a(new Set),s(!0)},[]),errorOf:n((t,n)=>y({error:n,revealed:i.has(t),shown:b({error:n,touched:e.has(t),submitted:o})}),[i,e,o])}}var ErrorBoundary=class extends l{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(e,t)}handleReload=()=>{try{this.props.onReload?this.props.onReload():typeof window<`u`&&typeof window.location?.reload==`function`&&window.location.reload()}catch{}};render(){if(this.state.hasError){let e=``;try{e=this.state.error?.message||(this.state.error?String(this.state.error):``)}catch{e=``}return u(`div`,{class:`startup-failure`,role:`alert`,children:u(`div`,{class:`startup-failure__inner`,children:[u(EmptyState,{title:p(`app.startup.theEditorCouldNotStart`),hint:p(`app.startup.retryingReloadsTheEditorAnd`),actions:[{label:p(`app.common.reload`),run:this.handleReload}]}),e&&u(`pre`,{class:`startup-failure__message`,children:e})]})})}return this.props.children}},N=8;function nextEnabled(e,t,n){for(let r=1;r<=e.length;r+=1){let i=(t+n*r+e.length*r)%e.length;if(!e[i].disabled)return i}return t}function ContextMenu({label:e,at:n,items:r,onClose:i,returnFocusTo:a}){let s=o(null),[c,l]=t(null),[p,m]=t(()=>r.findIndex(e=>!e.disabled)),h=o(i);h.current=i,d(()=>{let e=s.current;if(!e)return;let t=e.offsetWidth,r=e.offsetHeight,i=Math.max(N,Math.min(n.x,window.innerWidth-t-N)),a=Math.max(N,Math.min(n.y,window.innerHeight-r-N));l({left:i,top:a})},[n.x,n.y]),f(()=>{let e=s.current,t=document.activeElement,n=a?.isConnected?a:t,away=t=>{t.target instanceof Node&&e&&!e.contains(t.target)&&h.current()},leave=()=>h.current();return document.addEventListener(`pointerdown`,away,!0),window.addEventListener(`blur`,leave),window.addEventListener(`resize`,leave),()=>{document.removeEventListener(`pointerdown`,away,!0),window.removeEventListener(`blur`,leave),window.removeEventListener(`resize`,leave);try{n?.focus?.({preventScroll:!0})}catch{}}},[]),f(()=>{c&&s.current?.focus({preventScroll:!0})},[c!==null]);let choose=e=>{e.disabled||(h.current(),e.run())},onKeyDown=e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),h.current();else if(e.key===`ArrowDown`)e.preventDefault(),m(e=>nextEnabled(r,e,1));else if(e.key===`ArrowUp`)e.preventDefault(),m(e=>nextEnabled(r,e,-1));else if(e.key===`Home`)e.preventDefault(),m(nextEnabled(r,r.length-1,1));else if(e.key===`End`)e.preventDefault(),m(nextEnabled(r,0,-1));else if(e.key===`Enter`||e.key===` `){e.preventDefault(),e.stopPropagation();let t=r[p];t&&choose(t)}else e.key===`Tab`&&(e.preventDefault(),h.current())};return u(`div`,{ref:s,class:`web-menu`,role:`menu`,"aria-label":e,tabIndex:-1,"aria-activedescendant":p>=0?`web-menu-${r[p]?.id}`:void 0,style:{left:`${c?.left??n.x}px`,top:`${c?.top??n.y}px`,visibility:c?`visible`:`hidden`},onKeyDown,onContextMenu:e=>e.preventDefault(),children:r.map((e,t)=>u(`div`,{id:`web-menu-${e.id}`,role:e.checked===void 0?`menuitem`:`menuitemcheckbox`,"aria-checked":e.checked===void 0?void 0:e.checked,"aria-disabled":e.disabled||void 0,class:`web-menu__item type-body${t===p?` is-cursor`:``}${e.danger?` is-danger`:``}${e.disabled?` is-disabled`:``}${e.separated?` is-separated`:``}`,onPointerEnter:()=>!e.disabled&&m(t),onClick:()=>choose(e),children:[u(`span`,{class:`web-menu__label`,children:e.label}),e.shortcut&&u(`span`,{class:`web-menu__shortcut type-help`,children:e.shortcut})]},e.id))})}var P={chat:`<path d="M2.5 2.5h11a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H8.5L5 13.5v-3H2.5a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1z"/><path d="M5 6.5h.01M8 6.5h.01M11 6.5h.01"/>`,expand:`<path d="M9.5 2.5h4v4M13.5 2.5 9 7M6.5 13.5h-4v-4M2.5 13.5 7 9"/>`,collapse:`<path d="M13.5 6.5h-4v-4M9.5 6.5 14 2M2.5 9.5h4v4M6.5 9.5 2 14"/>`,chevronDown:`<path d="M4 6l4 4 4-4"/>`,chevronLeft:`<path d="M10 4 6 8l4 4"/>`,chevronUp:`<path d="M4 10l4-4 4 4"/>`,close:`<path d="M4 4l8 8M12 4l-8 8"/>`,plus:`<path d="M8 3v10M3 8h10"/>`,check:`<path d="M3 8.5 6.5 12 13 4.5"/>`,send:`<path d="M8 13V3.5M4 7.5l4-4 4 4"/>`,stop:`<rect x="4.5" y="4.5" width="7" height="7" rx="1"/>`,alert:`<path d="M8 2l6.5 11.5h-13z"/><path d="M8 6.5v3M8 11.5v.01"/>`,failed:`<circle cx="8" cy="8" r="6"/><path d="M5.5 5.5l5 5M10.5 5.5l-5 5"/>`,hand:`<path d="M5.5 8V3.5a1 1 0 0 1 2 0V7M7.5 7V2.5a1 1 0 0 1 2 0V7M9.5 7V3.5a1 1 0 0 1 2 0V9.5c0 2.5-1.5 4-3.5 4-1.5 0-2.5-.7-3.5-2L2.7 9a1 1 0 0 1 1.6-1.2z"/>`,copy:`<rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"/>`,queue:`<path d="M2 4h9M2 8h9M2 12h5M12.5 10.5 14.5 12.5 12.5 14.5"/>`,file:`<path d="M4 1.5h5.5l3 3v10H4z"/><path d="M9.5 1.5v3h3"/>`,element:`<rect x="1.5" y="4" width="13" height="8" rx="2"/>`,pending:`<circle cx="8" cy="8" r="2.5"/>`,settings:`<path d="M6.62 3.19 6.94 1.33h2.12l.32 1.86 1.04.44 1.55-1.09 1.49 1.49-1.09 1.55.44 1.04 1.86.32v2.12l-1.86.32-.44 1.04 1.09 1.55-1.49 1.49-1.55-1.09-1.04.44-.32 1.86H6.94l-.32-1.86-1.04-.44-1.55 1.09-1.49-1.49 1.09-1.55-.44-1.04-1.86-.32V6.94l1.86-.32.44-1.04-1.09-1.55 1.49-1.49 1.55 1.09z"/><circle cx="8" cy="8" r="2"/>`};function AssistantIcon({name:e,class:t}){return u(`svg`,{class:t,viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:P[e]}})}function Spinner(){return u(`span`,{class:`assistant-spinner`,"aria-hidden":`true`})}function InstallCommand({command:e}){let[n,r]=t(!1),copy=()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return u(`div`,{class:`ui-install-command type-code`,children:[u(`span`,{class:`ui-install-command__prompt`,"aria-hidden":`true`,children:`$`}),u(`code`,{class:`ui-install-command__code`,children:e}),u(`button`,{type:`button`,class:`ui-install-command__copy`,"aria-label":p(`app.common.copyCommand`),title:p(n?`app.common.commandCopied`:`app.common.copyCommand`),onClick:copy,children:u(AssistantIcon,{name:n?`check`:`copy`})})]})}export{ErrorBoundary as a,Popover as c,ActionButtons as d,Dialog as f,loadButtonOrder as g,useTranslate as h,ContextMenu as i,Field as l,I18nProvider as m,AssistantIcon as n,useTouched as o,DialogFooter as p,Spinner as r,EmptyState as s,InstallCommand as t,FieldError as u};
@@ -1 +1 @@
1
- import"./rolldown-runtime-B8BYMn-z.js";import{c as e,d as t,i as n,o as r,u as i}from"./vendor-NJP34MHU.js";import{X as a}from"./bridgeInstance-D0bzpNGz.js";import{f as o}from"./documentBridge-DSWBQZRP.js";import{a as s}from"./bpmnTheme-Divwrkjy.js";import{R as c,ht as l}from"./web-BtxFF0jJ.js";var u=Uint8Array,d=Uint16Array,f=Int32Array,p=new u([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),m=new u([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),h=new u([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(e,t){for(var n=new d(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new f(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},g=freb(p,2),_=g.b,v=g.r;_[28]=258,v[258]=28;for(var y=freb(m,0),b=y.b,x=y.r,S=new d(32768),C=0;C<32768;++C){var T=(C&43690)>>1|(C&21845)<<1;T=(T&52428)>>2|(T&13107)<<2,T=(T&61680)>>4|(T&3855)<<4,S[C]=((T&65280)>>8|(T&255)<<8)>>1}for(var hMap=(function(e,t,n){for(var r=e.length,i=0,a=new d(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new d(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new d(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],f=o[e[i]-1]++<<u,p=f|(1<<u)-1;f<=p;++f)s[S[f]>>c]=l}else for(s=new d(r),i=0;i<r;++i)e[i]&&(s[i]=S[o[e[i]-1]++]>>15-e[i]);return s}),E=new u(288),C=0;C<144;++C)E[C]=8;for(var C=144;C<256;++C)E[C]=9;for(var C=256;C<280;++C)E[C]=7;for(var C=280;C<288;++C)E[C]=8;for(var D=new u(32),C=0;C<32;++C)D[C]=5;var O=hMap(E,9,0),k=hMap(E,9,1),A=hMap(D,5,0),j=hMap(D,5,1),max=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},bits=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},bits16=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},shft=function(e){return(e+7)/8|0},slc=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new u(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],err=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,err),!n)throw r;return r},inflt=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new u(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new u(i*3));var cbuf=function(e){var t=n.length;if(e>t){var r=new u(Math.max(t*2,e));r.set(n),n=r}},l=t.f||0,d=t.p||0,f=t.b||0,g=t.l,v=t.d,y=t.m,x=t.n,S=i*8;do{if(!g){l=bits(e,d,1);var C=bits(e,d+1,3);if(d+=3,!C){var T=shft(d)+4,E=e[T-4]|e[T-3]<<8,D=T+E;if(D>i){c&&err(0);break}s&&cbuf(f+E),n.set(e.subarray(T,D),f),t.b=f+=E,t.p=d=D*8,t.f=l;continue}if(C==1)g=k,v=j,y=9,x=5;else if(C==2){var O=bits(e,d,31)+257,A=bits(e,d+10,15)+4,M=O+bits(e,d+5,31)+1;d+=14;for(var N=new u(M),P=new u(19),F=0;F<A;++F)P[h[F]]=bits(e,d+F*3,7);d+=A*3;for(var I=max(P),L=(1<<I)-1,R=hMap(P,I,1),F=0;F<M;){var z=R[bits(e,d,L)];d+=z&15;var T=z>>4;if(T<16)N[F++]=T;else{var B=0,V=0;for(T==16?(V=3+bits(e,d,3),d+=2,B=N[F-1]):T==17?(V=3+bits(e,d,7),d+=3):T==18&&(V=11+bits(e,d,127),d+=7);V--;)N[F++]=B}}var H=N.subarray(0,O),U=N.subarray(O);y=max(H),x=max(U),g=hMap(H,y,1),v=hMap(U,x,1)}else err(1);if(d>S){c&&err(0);break}}s&&cbuf(f+131072);for(var W=(1<<y)-1,G=(1<<x)-1,K=d;;K=d){var B=g[bits16(e,d)&W],q=B>>4;if(d+=B&15,d>S){c&&err(0);break}if(B||err(2),q<256)n[f++]=q;else if(q==256){K=d,g=null;break}else{var J=q-254;if(q>264){var F=q-257,Y=p[F];J=bits(e,d,(1<<Y)-1)+_[F],d+=Y}var X=v[bits16(e,d)&G],Z=X>>4;X||err(3),d+=X&15;var U=b[Z];if(Z>3){var Y=m[Z];U+=bits16(e,d)&(1<<Y)-1,d+=Y}if(d>S){c&&err(0);break}s&&cbuf(f+131072);var Q=f+J;if(f<U){var $=a-U,ee=Math.min(U,Q);for($+f<0&&err(3);f<ee;++f)n[f]=r[$+f]}for(;f<Q;++f)n[f]=n[f-U]}}t.l=g,t.p=K,t.b=f,t.f=l,g&&(l=1,t.m=y,t.d=v,t.n=x)}while(!l);return f!=n.length&&o?slc(n,0,f):n.subarray(0,f)},wbits=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},wbits16=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},hTree=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return{t:P,l:0};if(i==1){var o=new u(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,f=1,p=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};f!=i-1;)s=n[n[l].f<n[p].f?l++:p++],c=n[l!=f&&n[l].f<n[p].f?l++:p++],n[f++]={s:-1,f:s.f+c.f,l:s,r:c};for(var m=a[0].s,r=1;r<i;++r)a[r].s>m&&(m=a[r].s);var h=new d(m+1),g=ln(n[f-1],h,0);if(g>t){var r=0,_=0,v=g-t,y=1<<v;for(a.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<i;++r){var b=a[r].s;if(h[b]>t)_+=y-(1<<g-h[b]),h[b]=t;else break}for(_>>=v;_>0;){var x=a[r].s;h[x]<t?_-=1<<t-h[x]++-1:++r}for(;r>=0&&_;--r){var S=a[r].s;h[S]==t&&(--h[S],++_)}g=t}return{t:new u(h),l:g}},ln=function(e,t,n){return e.s==-1?Math.max(ln(e.l,t,n+1),ln(e.r,t,n+1)):t[e.s]=n},lc=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new d(++t),r=0,i=e[0],a=1,w=function(e){n[r++]=e},o=1;o<=t;++o)if(e[o]==i&&o!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)w(32754);a>2&&(w(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(w(i),--a;a>6;a-=6)w(8304);a>2&&(w(a-3<<5|8208),a=0)}for(;a--;)w(i);a=1,i=e[o]}return{c:n.subarray(0,r),n:t}},clen=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},wfblk=function(e,t,n){var r=n.length,i=shft(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},wblk=function(e,t,n,r,i,a,o,s,c,l,u){wbits(t,u++,n),++i[256];for(var f=hTree(i,15),g=f.t,_=f.l,v=hTree(a,15),y=v.t,b=v.l,x=lc(g),S=x.c,C=x.n,T=lc(y),k=T.c,j=T.n,M=new d(19),N=0;N<S.length;++N)++M[S[N]&31];for(var N=0;N<k.length;++N)++M[k[N]&31];for(var P=hTree(M,7),F=P.t,I=P.l,L=19;L>4&&!F[h[L-1]];--L);var R=l+5<<3,z=clen(i,E)+clen(a,D)+o,B=clen(i,g)+clen(a,y)+o+14+3*L+clen(M,F)+2*M[16]+3*M[17]+7*M[18];if(c>=0&&R<=z&&R<=B)return wfblk(t,u,e.subarray(c,c+l));var V,H,U,W;if(wbits(t,u,1+(B<z)),u+=2,B<z){V=hMap(g,_,0),H=g,U=hMap(y,b,0),W=y;var G=hMap(F,I,0);wbits(t,u,C-257),wbits(t,u+5,j-1),wbits(t,u+10,L-4),u+=14;for(var N=0;N<L;++N)wbits(t,u+3*N,F[h[N]]);u+=3*L;for(var K=[S,k],q=0;q<2;++q)for(var J=K[q],N=0;N<J.length;++N){var Y=J[N]&31;wbits(t,u,G[Y]),u+=F[Y],Y>15&&(wbits(t,u,J[N]>>5&127),u+=J[N]>>12)}}else V=O,H=E,U=A,W=D;for(var N=0;N<s;++N){var X=r[N];if(X>255){var Y=X>>18&31;wbits16(t,u,V[Y+257]),u+=H[Y+257],Y>7&&(wbits(t,u,X>>23&31),u+=p[Y]);var Z=X&31;wbits16(t,u,U[Z]),u+=W[Z],Z>3&&(wbits16(t,u,X>>5&8191),u+=m[Z])}else wbits16(t,u,V[X]),u+=H[X]}return wbits16(t,u,V[256]),u+H[256]},N=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),P=new u(0),dflt=function(e,t,n,r,i,a){var o=a.z||e.length,s=new u(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=a.l,h=(a.r||0)&7;if(t){h&&(c[0]=a.r>>3);for(var g=N[t-1],_=g>>13,y=g&8191,b=(1<<n)-1,S=a.p||new d(32768),C=a.h||new d(b+1),T=Math.ceil(n/3),E=2*T,hsh=function(t){return(e[t]^e[t+1]<<T^e[t+2]<<E)&b},D=new f(25e3),O=new d(288),k=new d(32),A=0,j=0,M=a.i||0,P=0,F=a.w||0,I=0;M+2<o;++M){var L=hsh(M),R=M&32767,z=C[L];if(S[R]=z,C[L]=R,F<=M){var B=o-M;if((A>7e3||P>24576)&&(B>423||!l)){h=wblk(e,c,0,D,O,k,j,P,I,M-I,h),P=A=j=0,I=M;for(var V=0;V<286;++V)O[V]=0;for(var V=0;V<30;++V)k[V]=0}var H=2,U=0,W=y,G=R-z&32767;if(B>2&&L==hsh(M-G))for(var K=Math.min(_,B)-1,q=Math.min(32767,M),J=Math.min(258,B);G<=q&&--W&&R!=z;){if(e[M+H]==e[M+H-G]){for(var Y=0;Y<J&&e[M+Y]==e[M+Y-G];++Y);if(Y>H){if(H=Y,U=G,Y>K)break;for(var X=Math.min(G,Y-2),Z=0,V=0;V<X;++V){var Q=M-G+V&32767,$=Q-S[Q]&32767;$>Z&&(Z=$,z=Q)}}}R=z,z=S[R],G+=R-z&32767}if(U){D[P++]=268435456|v[H]<<18|x[U];var ee=v[H]&31,te=x[U]&31;j+=p[ee]+m[te],++O[257+ee],++k[te],F=M+H,++A}else D[P++]=e[M],++O[e[M]]}}for(M=Math.max(M,F);M<o;++M)D[P++]=e[M],++O[e[M]];h=wblk(e,c,l,D,O,k,j,P,I,M-I,h),l||(a.r=h&7|c[h/8|0]<<3,h-=7,a.h=C,a.p=S,a.i=M,a.w=F)}else{for(var M=a.w||0;M<o+l;M+=65535){var ne=M+65535;ne>=o&&(c[h/8|0]=l,ne=o),h=wfblk(c,h+1,e.subarray(M,ne))}a.i=o}return slc(s,0,r+shft(h)+i)},F=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),crc=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=F[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},adler=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=n.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},dopt=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new u(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return dflt(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},mrg=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},b2=function(e,t){return e[t]|e[t+1]<<8},b4=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},b8=function(e,t){return b4(e,t)+b4(e,t+4)*4294967296},wbytes=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},zlh=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=adler();i.p(t.dictionary),wbytes(e,2,i.d())}};function deflateSync(e,t){return dopt(e,t||{},0,0)}var I=function(){function Inflate(e,t){typeof e==`function`&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new u(32768),this.p=new u(0),n&&this.o.set(n)}return Inflate.prototype.e=function(e){if(this.ondata||err(5),this.d&&err(4),!this.p.length)this.p=e;else if(e.length){var t=new u(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},Inflate.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=inflt(this.p,this.s,this.o);this.ondata(slc(n,t,this.s.b),this.d),this.o=slc(n,this.s.b-32768),this.s.b=this.o.length,this.p=slc(this.p,this.s.p/8|0),this.s.p&=7},Inflate.prototype.push=function(e,t){this.e(e),this.c(t)},Inflate}();function inflateSync(e,t){return inflt(e,{i:2},t&&t.out,t&&t.dictionary)}function zlibSync(e,t){t||={};var n=adler();n.p(e);var r=dopt(e,t,t.dictionary?6:2,4);return zlh(r,t),wbytes(r,r.length-4,n.d()),r}var fltn=function(e,t,n,r){for(var i in e){var a=e[i],o=t+i,s=r;Array.isArray(a)&&(s=mrg(r,a[1]),a=a[0]),ArrayBuffer.isView(a)?n[o]=[a,s]:(n[o+=`/`]=[new u(0),s],fltn(a,o,n,r))}},L=typeof TextEncoder<`u`&&new TextEncoder,R=typeof TextDecoder<`u`&&new TextDecoder;try{R.decode(P,{stream:!0})}catch{}var dutf8=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:slc(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function strToU8(e,t){if(t){for(var n=new u(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(L)return L.encode(e);for(var i=e.length,a=new u(e.length+(e.length>>1)),o=0,w=function(e){a[o++]=e},r=0;r<i;++r){if(o+5>a.length){var s=new u(o+8+(i-r<<1));s.set(a),a=s}var c=e.charCodeAt(r);c<128||t?w(c):c<2048?(w(192|c>>6),w(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++r)&1023,w(240|c>>18),w(128|c>>12&63),w(128|c>>6&63),w(128|c&63)):(w(224|c>>12),w(128|c>>6&63),w(128|c&63))}return slc(a,0,o)}function strFromU8(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(R)return R.decode(e);var i=dutf8(e),a=i.s,n=i.r;return n.length&&err(8),a}var slzh=function(e,t){return t+30+b2(e,t+26)+b2(e,t+28)},zh=function(e,t,n){var r=b2(e,t+28),i=b2(e,t+30),a=strFromU8(e.subarray(t+46,t+46+r),!(b2(e,t+8)&2048)),o=t+46+r,s=z64hs(e,o,i,n,b4(e,t+20),b4(e,t+24),b4(e,t+42)),c=s[0],l=s[1],u=s[2];return[b2(e,t+10),c,l,a,o+i+b2(e,t+32),u]},z64hs=function(e,t,n,r,i,a,o){var s=i==4294967295,c=a==4294967295,l=o==4294967295,u=t+n,d=s+c+l;if(r&&d){for(;t+4<u;t+=4+b2(e,t+2))if(b2(e,t)==1)return[s?b8(e,t+4+8*c):i,c?b8(e,t+4):a,l?b8(e,t+4+8*(c+s)):o,1];r<2&&err(13)}return[i,a,o,0]},exfl=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&err(9),t+=r+4}return t},wzh=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=exfl(l);wbytes(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&err(10),wbytes(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(wbytes(e,t,n.crc),wbytes(e,t+4,a<0?-a-2:a),wbytes(e,t+8,n.size)),wbytes(e,t+12,c),wbytes(e,t+14,d),t+=16,o!=null&&(wbytes(e,t,u),wbytes(e,t+6,n.attrs),wbytes(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;wbytes(e,t,+m),wbytes(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},wzf=function(e,t,n,r,i){wbytes(e,t,101010256),wbytes(e,t+8,n),wbytes(e,t+10,n),wbytes(e,t+12,r),wbytes(e,t+16,i)};function zipSync(e,t){t||={};var n={},r=[];fltn(e,``,n,t);var i=0,a=0;for(var o in n){var s=n[o],c=s[0],l=s[1],d=l.level==0?0:8,f=strToU8(o),p=f.length,m=l.comment,h=m&&strToU8(m),g=h&&h.length,_=exfl(l.extra);p>65535&&err(11);var v=d?deflateSync(c,l):c,y=v.length,b=crc();b.p(c),r.push(mrg(l,{size:c.length,crc:b.d(),c:v,f,m:h,u:p!=o.length||h&&m.length!=g,o:i,compression:d})),i+=30+p+_+y,a+=76+2*(p+_)+(g||0)+y}for(var x=new u(a+22),S=i,C=a-i,T=0;T<r.length;++T){var f=r[T];wzh(x,f.o,f,f.f,f.u,f.c.length);var E=30+f.f.length+exfl(f.extra);x.set(f.c,f.o+E),wzh(x,i,f,f.f,f.u,f.c.length,f.o,f.m),i+=16+E+(f.m?f.m.length:0)}return wzf(x,i,r.length,C,S),x}function unzipSync(e,t){for(var n={},r=e.length-22;b4(e,r)!=101010256;--r)(!r||e.length-r>65558)&&err(13);var i=b2(e,r+8);if(!i)return{};var a=b4(e,r+16),o=b4(e,r-20)==117853008;if(o){var s=b4(e,r-12);o=b4(e,s)==101075792,o&&(i=b4(e,s+32),a=b4(e,s+48))}for(var c=t&&t.filter,l=0;l<i;++l){var d=zh(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=slzh(e,_);a=g,(!c||c({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=inflateSync(e.subarray(v,v+p),{out:new u(m)}):err(14,`unknown compression type `+f):n[h]=slc(e,v,v+p))}return n}function editorActionsOf(e){return e?.get?.(`editorActions`,!1)??void 0}function cutSelection(e){editorActionsOf(e)?.trigger(`cut`)}function selectAllElements(e){editorActionsOf(e)?.trigger(`selectElements`)}function useTracePaths({viewer:u,origin:d,traceable:f,read:p,paint:m,supportsMessages:h=!1}){let[g,_]=e(null),[v,y]=e(0),b=n(null),x=c(),S=t(()=>_(null),[]),C=t(()=>{let e=Date.now();l(b.current,e)||(b.current=e,_(e=>e?null:f(u,d)&&d?{origin:d,followMessages:!1}:e))},[u,d,f]),T=t(e=>{_(t=>t&&{...t,followMessages:e})},[]),E=t(e=>{_(t=>f(u,e)?{origin:e,followMessages:t?.followMessages??!1}:null)},[u,f]);i(()=>{g&&d!==g.origin&&(f(u,d)&&d?_(e=>e&&{...e,origin:d}):_(null))},[g,d,u,f]),i(()=>{if(!x)return;let onKey=e=>{g&&e.key===`Escape`?(e.preventDefault(),_(null)):f(u,d)&&d&&a(e,`Mod+Shift+;`,o())&&(e.preventDefault(),C())};return window.addEventListener(`keydown`,onKey),()=>window.removeEventListener(`keydown`,onKey)},[g,u,d,f,C,x]),i(()=>{let e=u?.get?.(`eventBus`,!1);if(!e)return;let changed=()=>y(e=>e+1),imported=()=>_(null);return e.on(`commandStack.changed`,changed),e.on(`import.done`,imported),()=>{e.off(`commandStack.changed`,changed),e.off(`import.done`,imported)}},[u]),i(()=>{if(u)return m(u,g?.origin??null,g?.followMessages??!1),()=>s(u)},[u,g,v,m]);let D=r(()=>g&&u?p(u,g.origin,g.followMessages):null,[g,u,p]);return{tracing:g!==null&&D!==null,traceable:f(u,d),reading:D,followMessages:g?.followMessages??!1,supportsMessages:h,toggle:C,traceFrom:E,close:S,setFollowMessages:T}}export{strFromU8 as a,zipSync as c,I as i,zlibSync as l,cutSelection as n,strToU8 as o,selectAllElements as r,unzipSync as s,useTracePaths as t};
1
+ import"./rolldown-runtime-B8BYMn-z.js";import{c as e,d as t,i as n,o as r,u as i}from"./vendor-NJP34MHU.js";import{X as a}from"./bridgeInstance-BPwbITOf.js";import{f as o}from"./documentBridge-D5SaBThP.js";import{a as s}from"./bpmnTheme-db4tYvop.js";import{R as c,ht as l}from"./web-qJCedJJw.js";var u=Uint8Array,d=Uint16Array,f=Int32Array,p=new u([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),m=new u([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),h=new u([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(e,t){for(var n=new d(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new f(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},g=freb(p,2),_=g.b,v=g.r;_[28]=258,v[258]=28;for(var y=freb(m,0),b=y.b,x=y.r,S=new d(32768),C=0;C<32768;++C){var T=(C&43690)>>1|(C&21845)<<1;T=(T&52428)>>2|(T&13107)<<2,T=(T&61680)>>4|(T&3855)<<4,S[C]=((T&65280)>>8|(T&255)<<8)>>1}for(var hMap=(function(e,t,n){for(var r=e.length,i=0,a=new d(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new d(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new d(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],f=o[e[i]-1]++<<u,p=f|(1<<u)-1;f<=p;++f)s[S[f]>>c]=l}else for(s=new d(r),i=0;i<r;++i)e[i]&&(s[i]=S[o[e[i]-1]++]>>15-e[i]);return s}),E=new u(288),C=0;C<144;++C)E[C]=8;for(var C=144;C<256;++C)E[C]=9;for(var C=256;C<280;++C)E[C]=7;for(var C=280;C<288;++C)E[C]=8;for(var D=new u(32),C=0;C<32;++C)D[C]=5;var O=hMap(E,9,0),k=hMap(E,9,1),A=hMap(D,5,0),j=hMap(D,5,1),max=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},bits=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},bits16=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},shft=function(e){return(e+7)/8|0},slc=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new u(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],err=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,err),!n)throw r;return r},inflt=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new u(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new u(i*3));var cbuf=function(e){var t=n.length;if(e>t){var r=new u(Math.max(t*2,e));r.set(n),n=r}},l=t.f||0,d=t.p||0,f=t.b||0,g=t.l,v=t.d,y=t.m,x=t.n,S=i*8;do{if(!g){l=bits(e,d,1);var C=bits(e,d+1,3);if(d+=3,!C){var T=shft(d)+4,E=e[T-4]|e[T-3]<<8,D=T+E;if(D>i){c&&err(0);break}s&&cbuf(f+E),n.set(e.subarray(T,D),f),t.b=f+=E,t.p=d=D*8,t.f=l;continue}if(C==1)g=k,v=j,y=9,x=5;else if(C==2){var O=bits(e,d,31)+257,A=bits(e,d+10,15)+4,M=O+bits(e,d+5,31)+1;d+=14;for(var N=new u(M),P=new u(19),F=0;F<A;++F)P[h[F]]=bits(e,d+F*3,7);d+=A*3;for(var I=max(P),L=(1<<I)-1,R=hMap(P,I,1),F=0;F<M;){var z=R[bits(e,d,L)];d+=z&15;var T=z>>4;if(T<16)N[F++]=T;else{var B=0,V=0;for(T==16?(V=3+bits(e,d,3),d+=2,B=N[F-1]):T==17?(V=3+bits(e,d,7),d+=3):T==18&&(V=11+bits(e,d,127),d+=7);V--;)N[F++]=B}}var H=N.subarray(0,O),U=N.subarray(O);y=max(H),x=max(U),g=hMap(H,y,1),v=hMap(U,x,1)}else err(1);if(d>S){c&&err(0);break}}s&&cbuf(f+131072);for(var W=(1<<y)-1,G=(1<<x)-1,K=d;;K=d){var B=g[bits16(e,d)&W],q=B>>4;if(d+=B&15,d>S){c&&err(0);break}if(B||err(2),q<256)n[f++]=q;else if(q==256){K=d,g=null;break}else{var J=q-254;if(q>264){var F=q-257,Y=p[F];J=bits(e,d,(1<<Y)-1)+_[F],d+=Y}var X=v[bits16(e,d)&G],Z=X>>4;X||err(3),d+=X&15;var U=b[Z];if(Z>3){var Y=m[Z];U+=bits16(e,d)&(1<<Y)-1,d+=Y}if(d>S){c&&err(0);break}s&&cbuf(f+131072);var Q=f+J;if(f<U){var $=a-U,ee=Math.min(U,Q);for($+f<0&&err(3);f<ee;++f)n[f]=r[$+f]}for(;f<Q;++f)n[f]=n[f-U]}}t.l=g,t.p=K,t.b=f,t.f=l,g&&(l=1,t.m=y,t.d=v,t.n=x)}while(!l);return f!=n.length&&o?slc(n,0,f):n.subarray(0,f)},wbits=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},wbits16=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},hTree=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return{t:P,l:0};if(i==1){var o=new u(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,f=1,p=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};f!=i-1;)s=n[n[l].f<n[p].f?l++:p++],c=n[l!=f&&n[l].f<n[p].f?l++:p++],n[f++]={s:-1,f:s.f+c.f,l:s,r:c};for(var m=a[0].s,r=1;r<i;++r)a[r].s>m&&(m=a[r].s);var h=new d(m+1),g=ln(n[f-1],h,0);if(g>t){var r=0,_=0,v=g-t,y=1<<v;for(a.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<i;++r){var b=a[r].s;if(h[b]>t)_+=y-(1<<g-h[b]),h[b]=t;else break}for(_>>=v;_>0;){var x=a[r].s;h[x]<t?_-=1<<t-h[x]++-1:++r}for(;r>=0&&_;--r){var S=a[r].s;h[S]==t&&(--h[S],++_)}g=t}return{t:new u(h),l:g}},ln=function(e,t,n){return e.s==-1?Math.max(ln(e.l,t,n+1),ln(e.r,t,n+1)):t[e.s]=n},lc=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new d(++t),r=0,i=e[0],a=1,w=function(e){n[r++]=e},o=1;o<=t;++o)if(e[o]==i&&o!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)w(32754);a>2&&(w(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(w(i),--a;a>6;a-=6)w(8304);a>2&&(w(a-3<<5|8208),a=0)}for(;a--;)w(i);a=1,i=e[o]}return{c:n.subarray(0,r),n:t}},clen=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},wfblk=function(e,t,n){var r=n.length,i=shft(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},wblk=function(e,t,n,r,i,a,o,s,c,l,u){wbits(t,u++,n),++i[256];for(var f=hTree(i,15),g=f.t,_=f.l,v=hTree(a,15),y=v.t,b=v.l,x=lc(g),S=x.c,C=x.n,T=lc(y),k=T.c,j=T.n,M=new d(19),N=0;N<S.length;++N)++M[S[N]&31];for(var N=0;N<k.length;++N)++M[k[N]&31];for(var P=hTree(M,7),F=P.t,I=P.l,L=19;L>4&&!F[h[L-1]];--L);var R=l+5<<3,z=clen(i,E)+clen(a,D)+o,B=clen(i,g)+clen(a,y)+o+14+3*L+clen(M,F)+2*M[16]+3*M[17]+7*M[18];if(c>=0&&R<=z&&R<=B)return wfblk(t,u,e.subarray(c,c+l));var V,H,U,W;if(wbits(t,u,1+(B<z)),u+=2,B<z){V=hMap(g,_,0),H=g,U=hMap(y,b,0),W=y;var G=hMap(F,I,0);wbits(t,u,C-257),wbits(t,u+5,j-1),wbits(t,u+10,L-4),u+=14;for(var N=0;N<L;++N)wbits(t,u+3*N,F[h[N]]);u+=3*L;for(var K=[S,k],q=0;q<2;++q)for(var J=K[q],N=0;N<J.length;++N){var Y=J[N]&31;wbits(t,u,G[Y]),u+=F[Y],Y>15&&(wbits(t,u,J[N]>>5&127),u+=J[N]>>12)}}else V=O,H=E,U=A,W=D;for(var N=0;N<s;++N){var X=r[N];if(X>255){var Y=X>>18&31;wbits16(t,u,V[Y+257]),u+=H[Y+257],Y>7&&(wbits(t,u,X>>23&31),u+=p[Y]);var Z=X&31;wbits16(t,u,U[Z]),u+=W[Z],Z>3&&(wbits16(t,u,X>>5&8191),u+=m[Z])}else wbits16(t,u,V[X]),u+=H[X]}return wbits16(t,u,V[256]),u+H[256]},N=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),P=new u(0),dflt=function(e,t,n,r,i,a){var o=a.z||e.length,s=new u(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=a.l,h=(a.r||0)&7;if(t){h&&(c[0]=a.r>>3);for(var g=N[t-1],_=g>>13,y=g&8191,b=(1<<n)-1,S=a.p||new d(32768),C=a.h||new d(b+1),T=Math.ceil(n/3),E=2*T,hsh=function(t){return(e[t]^e[t+1]<<T^e[t+2]<<E)&b},D=new f(25e3),O=new d(288),k=new d(32),A=0,j=0,M=a.i||0,P=0,F=a.w||0,I=0;M+2<o;++M){var L=hsh(M),R=M&32767,z=C[L];if(S[R]=z,C[L]=R,F<=M){var B=o-M;if((A>7e3||P>24576)&&(B>423||!l)){h=wblk(e,c,0,D,O,k,j,P,I,M-I,h),P=A=j=0,I=M;for(var V=0;V<286;++V)O[V]=0;for(var V=0;V<30;++V)k[V]=0}var H=2,U=0,W=y,G=R-z&32767;if(B>2&&L==hsh(M-G))for(var K=Math.min(_,B)-1,q=Math.min(32767,M),J=Math.min(258,B);G<=q&&--W&&R!=z;){if(e[M+H]==e[M+H-G]){for(var Y=0;Y<J&&e[M+Y]==e[M+Y-G];++Y);if(Y>H){if(H=Y,U=G,Y>K)break;for(var X=Math.min(G,Y-2),Z=0,V=0;V<X;++V){var Q=M-G+V&32767,$=Q-S[Q]&32767;$>Z&&(Z=$,z=Q)}}}R=z,z=S[R],G+=R-z&32767}if(U){D[P++]=268435456|v[H]<<18|x[U];var ee=v[H]&31,te=x[U]&31;j+=p[ee]+m[te],++O[257+ee],++k[te],F=M+H,++A}else D[P++]=e[M],++O[e[M]]}}for(M=Math.max(M,F);M<o;++M)D[P++]=e[M],++O[e[M]];h=wblk(e,c,l,D,O,k,j,P,I,M-I,h),l||(a.r=h&7|c[h/8|0]<<3,h-=7,a.h=C,a.p=S,a.i=M,a.w=F)}else{for(var M=a.w||0;M<o+l;M+=65535){var ne=M+65535;ne>=o&&(c[h/8|0]=l,ne=o),h=wfblk(c,h+1,e.subarray(M,ne))}a.i=o}return slc(s,0,r+shft(h)+i)},F=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),crc=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=F[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},adler=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=n.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},dopt=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new u(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return dflt(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},mrg=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},b2=function(e,t){return e[t]|e[t+1]<<8},b4=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},b8=function(e,t){return b4(e,t)+b4(e,t+4)*4294967296},wbytes=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},zlh=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=adler();i.p(t.dictionary),wbytes(e,2,i.d())}};function deflateSync(e,t){return dopt(e,t||{},0,0)}var I=function(){function Inflate(e,t){typeof e==`function`&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new u(32768),this.p=new u(0),n&&this.o.set(n)}return Inflate.prototype.e=function(e){if(this.ondata||err(5),this.d&&err(4),!this.p.length)this.p=e;else if(e.length){var t=new u(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},Inflate.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=inflt(this.p,this.s,this.o);this.ondata(slc(n,t,this.s.b),this.d),this.o=slc(n,this.s.b-32768),this.s.b=this.o.length,this.p=slc(this.p,this.s.p/8|0),this.s.p&=7},Inflate.prototype.push=function(e,t){this.e(e),this.c(t)},Inflate}();function inflateSync(e,t){return inflt(e,{i:2},t&&t.out,t&&t.dictionary)}function zlibSync(e,t){t||={};var n=adler();n.p(e);var r=dopt(e,t,t.dictionary?6:2,4);return zlh(r,t),wbytes(r,r.length-4,n.d()),r}var fltn=function(e,t,n,r){for(var i in e){var a=e[i],o=t+i,s=r;Array.isArray(a)&&(s=mrg(r,a[1]),a=a[0]),ArrayBuffer.isView(a)?n[o]=[a,s]:(n[o+=`/`]=[new u(0),s],fltn(a,o,n,r))}},L=typeof TextEncoder<`u`&&new TextEncoder,R=typeof TextDecoder<`u`&&new TextDecoder;try{R.decode(P,{stream:!0})}catch{}var dutf8=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:slc(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function strToU8(e,t){if(t){for(var n=new u(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(L)return L.encode(e);for(var i=e.length,a=new u(e.length+(e.length>>1)),o=0,w=function(e){a[o++]=e},r=0;r<i;++r){if(o+5>a.length){var s=new u(o+8+(i-r<<1));s.set(a),a=s}var c=e.charCodeAt(r);c<128||t?w(c):c<2048?(w(192|c>>6),w(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++r)&1023,w(240|c>>18),w(128|c>>12&63),w(128|c>>6&63),w(128|c&63)):(w(224|c>>12),w(128|c>>6&63),w(128|c&63))}return slc(a,0,o)}function strFromU8(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(R)return R.decode(e);var i=dutf8(e),a=i.s,n=i.r;return n.length&&err(8),a}var slzh=function(e,t){return t+30+b2(e,t+26)+b2(e,t+28)},zh=function(e,t,n){var r=b2(e,t+28),i=b2(e,t+30),a=strFromU8(e.subarray(t+46,t+46+r),!(b2(e,t+8)&2048)),o=t+46+r,s=z64hs(e,o,i,n,b4(e,t+20),b4(e,t+24),b4(e,t+42)),c=s[0],l=s[1],u=s[2];return[b2(e,t+10),c,l,a,o+i+b2(e,t+32),u]},z64hs=function(e,t,n,r,i,a,o){var s=i==4294967295,c=a==4294967295,l=o==4294967295,u=t+n,d=s+c+l;if(r&&d){for(;t+4<u;t+=4+b2(e,t+2))if(b2(e,t)==1)return[s?b8(e,t+4+8*c):i,c?b8(e,t+4):a,l?b8(e,t+4+8*(c+s)):o,1];r<2&&err(13)}return[i,a,o,0]},exfl=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&err(9),t+=r+4}return t},wzh=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=exfl(l);wbytes(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&err(10),wbytes(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(wbytes(e,t,n.crc),wbytes(e,t+4,a<0?-a-2:a),wbytes(e,t+8,n.size)),wbytes(e,t+12,c),wbytes(e,t+14,d),t+=16,o!=null&&(wbytes(e,t,u),wbytes(e,t+6,n.attrs),wbytes(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;wbytes(e,t,+m),wbytes(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},wzf=function(e,t,n,r,i){wbytes(e,t,101010256),wbytes(e,t+8,n),wbytes(e,t+10,n),wbytes(e,t+12,r),wbytes(e,t+16,i)};function zipSync(e,t){t||={};var n={},r=[];fltn(e,``,n,t);var i=0,a=0;for(var o in n){var s=n[o],c=s[0],l=s[1],d=l.level==0?0:8,f=strToU8(o),p=f.length,m=l.comment,h=m&&strToU8(m),g=h&&h.length,_=exfl(l.extra);p>65535&&err(11);var v=d?deflateSync(c,l):c,y=v.length,b=crc();b.p(c),r.push(mrg(l,{size:c.length,crc:b.d(),c:v,f,m:h,u:p!=o.length||h&&m.length!=g,o:i,compression:d})),i+=30+p+_+y,a+=76+2*(p+_)+(g||0)+y}for(var x=new u(a+22),S=i,C=a-i,T=0;T<r.length;++T){var f=r[T];wzh(x,f.o,f,f.f,f.u,f.c.length);var E=30+f.f.length+exfl(f.extra);x.set(f.c,f.o+E),wzh(x,i,f,f.f,f.u,f.c.length,f.o,f.m),i+=16+E+(f.m?f.m.length:0)}return wzf(x,i,r.length,C,S),x}function unzipSync(e,t){for(var n={},r=e.length-22;b4(e,r)!=101010256;--r)(!r||e.length-r>65558)&&err(13);var i=b2(e,r+8);if(!i)return{};var a=b4(e,r+16),o=b4(e,r-20)==117853008;if(o){var s=b4(e,r-12);o=b4(e,s)==101075792,o&&(i=b4(e,s+32),a=b4(e,s+48))}for(var c=t&&t.filter,l=0;l<i;++l){var d=zh(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=slzh(e,_);a=g,(!c||c({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=inflateSync(e.subarray(v,v+p),{out:new u(m)}):err(14,`unknown compression type `+f):n[h]=slc(e,v,v+p))}return n}function editorActionsOf(e){return e?.get?.(`editorActions`,!1)??void 0}function cutSelection(e){editorActionsOf(e)?.trigger(`cut`)}function selectAllElements(e){editorActionsOf(e)?.trigger(`selectElements`)}function useTracePaths({viewer:u,origin:d,traceable:f,read:p,paint:m,supportsMessages:h=!1}){let[g,_]=e(null),[v,y]=e(0),b=n(null),x=c(),S=t(()=>_(null),[]),C=t(()=>{let e=Date.now();l(b.current,e)||(b.current=e,_(e=>e?null:f(u,d)&&d?{origin:d,followMessages:!1}:e))},[u,d,f]),T=t(e=>{_(t=>t&&{...t,followMessages:e})},[]),E=t(e=>{_(t=>f(u,e)?{origin:e,followMessages:t?.followMessages??!1}:null)},[u,f]);i(()=>{g&&d!==g.origin&&(f(u,d)&&d?_(e=>e&&{...e,origin:d}):_(null))},[g,d,u,f]),i(()=>{if(!x)return;let onKey=e=>{g&&e.key===`Escape`?(e.preventDefault(),_(null)):f(u,d)&&d&&a(e,`Mod+Shift+;`,o())&&(e.preventDefault(),C())};return window.addEventListener(`keydown`,onKey),()=>window.removeEventListener(`keydown`,onKey)},[g,u,d,f,C,x]),i(()=>{let e=u?.get?.(`eventBus`,!1);if(!e)return;let changed=()=>y(e=>e+1),imported=()=>_(null);return e.on(`commandStack.changed`,changed),e.on(`import.done`,imported),()=>{e.off(`commandStack.changed`,changed),e.off(`import.done`,imported)}},[u]),i(()=>{if(u)return m(u,g?.origin??null,g?.followMessages??!1),()=>s(u)},[u,g,v,m]);let D=r(()=>g&&u?p(u,g.origin,g.followMessages):null,[g,u,p]);return{tracing:g!==null&&D!==null,traceable:f(u,d),reading:D,followMessages:g?.followMessages??!1,supportsMessages:h,toggle:C,traceFrom:E,close:S,setFollowMessages:T}}export{strFromU8 as a,zipSync as c,I as i,zlibSync as l,cutSelection as n,strToU8 as o,selectAllElements as r,unzipSync as s,useTracePaths as t};