@stlite/desktop 0.90.13 → 0.90.14

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 (71) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/assets/{ErrorOutline.esm-CJGMKtXr.js → ErrorOutline.esm-BnBxotPi.js} +1 -1
  3. package/build/assets/{FileDownload.esm-DVbGfwz7.js → FileDownload.esm-RGPPDhk8.js} +1 -1
  4. package/build/assets/{FileHelper-BAjDG49X.js → FileHelper-tNTMbDMm.js} +1 -1
  5. package/build/assets/{FormClearHelper-CaLJK07N.js → FormClearHelper-DGQP9oxJ.js} +1 -1
  6. package/build/assets/{Hooks-D54IehuR.js → Hooks-Bo61ucn1.js} +1 -1
  7. package/build/assets/{InputInstructions-BLplNLW9.js → InputInstructions-Ck_istEY.js} +1 -1
  8. package/build/assets/{Particles-VYhfVp_p.js → Particles-BlxXqWnI.js} +1 -1
  9. package/build/assets/{ProgressBar-DX8k7XSZ.js → ProgressBar-C-iICo4w.js} +1 -1
  10. package/build/assets/{Toolbar-BbbydoLD.js → Toolbar-ByIPpsVy.js} +1 -1
  11. package/build/assets/{base-input-d4WKPeU6.js → base-input-DRJDHdAL.js} +1 -1
  12. package/build/assets/{checkbox-DUA9ewQT.js → checkbox-2-JpNSRW.js} +1 -1
  13. package/build/assets/{createSuper-CoIMxZYP.js → createSuper-vJD5mbw5.js} +1 -1
  14. package/build/assets/{data-grid-overlay-editor-cvHWuOOd.js → data-grid-overlay-editor-BIgAXG8E.js} +1 -1
  15. package/build/assets/{downloader-CR6bzPv-.js → downloader-JpXWtQ-P.js} +1 -1
  16. package/build/assets/{es6-BCBcAdQS.js → es6-Lsq1Gov6.js} +2 -2
  17. package/build/assets/{iframeResizer.contentWindow-CEqjsNrn.js → iframeResizer.contentWindow-Guiwg0xE.js} +1 -1
  18. package/build/assets/{index-CJWk1YT9.js → index-0HifpjrJ.js} +1 -1
  19. package/build/assets/{index-gb2ePejP.js → index-B-7gUeK8.js} +1 -1
  20. package/build/assets/{index-D9P3ZYiC.js → index-B5XMuJqP.js} +1 -1
  21. package/build/assets/{index-BRiK5gVx.js → index-B7T6_RXn.js} +1 -1
  22. package/build/assets/{index-VVwti7cA.js → index-B9RImrnB.js} +1 -1
  23. package/build/assets/{index-NigQ67t-.js → index-BYmSaStp.js} +1 -1
  24. package/build/assets/{index-BMSSeqlt.js → index-BZmLxv-D.js} +1 -1
  25. package/build/assets/{index-BD2ZweM9.js → index-Bb6UZSFO.js} +1 -1
  26. package/build/assets/{index-B3GOsGpL.js → index-BhFJX5Vn.js} +1 -1
  27. package/build/assets/{index-CHBxMYoz.js → index-BhoSXjxz.js} +1 -1
  28. package/build/assets/{index-wnKDraWU.js → index-BwsrXI9O.js} +87 -87
  29. package/build/assets/{index-BGUuVZft.js → index-C0jxm_PH.js} +1 -1
  30. package/build/assets/{index-BJK2Ym_S.js → index-C636A-W7.js} +1 -1
  31. package/build/assets/{index-CD0SY35r.js → index-C9n8vq5U.js} +1 -1
  32. package/build/assets/{index-PHqcnj3c.js → index-CE3r0KWL.js} +1 -1
  33. package/build/assets/{index-j6pFDYKO.js → index-CFCb7WWw.js} +1 -1
  34. package/build/assets/{index-CdAXvPf5.js → index-CO2Aw19y.js} +1 -1
  35. package/build/assets/{index-CIRTE79j.js → index-CRhYEwNP.js} +1 -1
  36. package/build/assets/{index-Dynm-1sH.js → index-CRiFLKI5.js} +1 -1
  37. package/build/assets/{index-B7yzG-4X.js → index-CRtbPdb-.js} +5 -5
  38. package/build/assets/{index-C91sP-jG.js → index-CoAdDGfF.js} +1 -1
  39. package/build/assets/{index-wUVGuFfU.js → index-D4BdQDBD.js} +1 -1
  40. package/build/assets/{index-DOiS7VE9.js → index-D94FJ5GB.js} +1 -1
  41. package/build/assets/{index-B58bWjQH.js → index-DIjJwKUC.js} +1 -1
  42. package/build/assets/{index-DoQHaClc.js → index-DImx2D5B.js} +1 -1
  43. package/build/assets/{index-CTZrIDfL.js → index-DV5icRRG.js} +1 -1
  44. package/build/assets/{index-CwPp5UqK.js → index-DgEYnWf9.js} +1 -1
  45. package/build/assets/{index-mHvUvPYI.js → index-DkqUDAbB.js} +1 -1
  46. package/build/assets/{index-Bhgfj5y5.js → index-DqH3HG1G.js} +1 -1
  47. package/build/assets/{index-vLb3c1eZ.js → index-Dtvm0G3c.js} +1 -1
  48. package/build/assets/{index-Bwfh73dd.js → index-Q623jih7.js} +1 -1
  49. package/build/assets/{index-DCv3Ovf7.js → index-Zd5xxmFR.js} +1 -1
  50. package/build/assets/{index-CeNNLDtJ.js → index-a4tM28AE.js} +1 -1
  51. package/build/assets/{index-HqlJZ3Ag.js → index-lw_DueTS.js} +1 -1
  52. package/build/assets/{index-BdVfRySM.js → index-m7vCKamN.js} +1 -1
  53. package/build/assets/{index-D_4iXBI5.js → index-mytcrsu7.js} +1 -1
  54. package/build/assets/{index-XsxWL5x-.js → index-pOokbnGQ.js} +1 -1
  55. package/build/assets/{inherits-xHSaJdUZ.js → inherits-DgEBZpYa.js} +1 -1
  56. package/build/assets/{input-PliHooUw.js → input-BRw1nRj1.js} +1 -1
  57. package/build/assets/{memory-BJMhKXeY.js → memory-Do9YV2fF.js} +1 -1
  58. package/build/assets/{number-overlay-editor-DRf5xgI3.js → number-overlay-editor-CBg6iMqb.js} +1 -1
  59. package/build/assets/{sandbox-DBdCCxaG.js → sandbox-DO_nuL9g.js} +1 -1
  60. package/build/assets/{slicedToArray-Cuk3tbTR.js → slicedToArray-CCKNURYu.js} +1 -1
  61. package/build/assets/{timepicker-DjzHzJAt.js → timepicker-CBaJIVEG.js} +1 -1
  62. package/build/assets/{uniqueId-ikSpJ9AP.js → uniqueId-7HN9pV-Z.js} +1 -1
  63. package/build/assets/{useBasicWidgetState-raTjAqZP.js → useBasicWidgetState-CQoPeUHV.js} +1 -1
  64. package/build/assets/{useTextInputAutoExpand-Uac3U0I_.js → useTextInputAutoExpand-CJ0SgjFi.js} +1 -1
  65. package/build/assets/{useUpdateUiValue-BbEmiOZQ.js → useUpdateUiValue-CakBWvqR.js} +1 -1
  66. package/build/assets/{withFullScreenWrapper-C7u7nPsK.js → withFullScreenWrapper-6omMDHWT.js} +1 -1
  67. package/build/assets/{worker-CiNU4sgs.js → worker-CO569BKa.js} +4 -4
  68. package/build/electron/worker.js +5 -5
  69. package/build/index.html +1 -1
  70. package/package.json +4 -4
  71. package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
@@ -1 +1 @@
1
- import{s as c,r as a,j as r,ag as p,ah as x,f as g}from"./index-wnKDraWU.js";const f=c("div",{target:"e1se5lgy3"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null}),""),S=c("div",{target:"e1se5lgy2"})({name:"1x17g94",styles:"display:flex;align-items:center;width:100%"}),T=c("div",{target:"e1se5lgy1"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"}),""),$=c("div",{target:"e1se5lgy0"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm}),""),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const d=`${t} minute${t===1?"":"s"}`,m=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${d}${m})`}const l=`${n} hour${n===1?"":"s"}`,i=t===0?"":`, ${t} minute${t===1?"":"s"}`,o=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${i}${o})`};function h({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),i=a.useRef(null);return a.useEffect(()=>{if(!t)return;i.current=Date.now();const o=()=>{if(i.current!==null){const u=(Date.now()-i.current)/1e3;l(u)}};o();const d=setInterval(o,100);return()=>clearInterval(d)},[t]),r.jsx(f,{className:p({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:r.jsxs(S,{children:[r.jsx(x,{size:"base",margin:"0 md 0 0",padding:"0"}),r.jsxs(T,{children:[r.jsx(g,{source:e.text,allowHTML:!1}),t&&r.jsx($,{children:y(s)})]})]})})}const b=a.memo(h);export{b as default};
1
+ import{s as c,r as a,j as r,ag as p,ah as x,f as g}from"./index-BwsrXI9O.js";const f=c("div",{target:"e1se5lgy3"})(({theme:e,cache:n})=>({...n?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null}),""),S=c("div",{target:"e1se5lgy2"})({name:"1x17g94",styles:"display:flex;align-items:center;width:100%"}),T=c("div",{target:"e1se5lgy1"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"}),""),$=c("div",{target:"e1se5lgy0"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm}),""),y=e=>{const n=Math.floor(e/3600),t=Math.floor(e%3600/60),s=e%60;if(n===0&&t===0)return`(${s.toFixed(1)} seconds)`;if(n===0){const d=`${t} minute${t===1?"":"s"}`,m=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${d}${m})`}const l=`${n} hour${n===1?"":"s"}`,i=t===0?"":`, ${t} minute${t===1?"":"s"}`,o=s===0?"":`, ${s.toFixed(1)} seconds`;return`(${l}${i}${o})`};function h({element:e}){const{cache:n,showTime:t}=e,[s,l]=a.useState(0),i=a.useRef(null);return a.useEffect(()=>{if(!t)return;i.current=Date.now();const o=()=>{if(i.current!==null){const u=(Date.now()-i.current)/1e3;l(u)}};o();const d=setInterval(o,100);return()=>clearInterval(d)},[t]),r.jsx(f,{className:p({stSpinner:!0,stCacheSpinner:n}),"data-testid":"stSpinner",cache:n,children:r.jsxs(S,{children:[r.jsx(x,{size:"base",margin:"0 md 0 0",padding:"0"}),r.jsxs(T,{children:[r.jsx(g,{source:e.text,allowHTML:!1}),t&&r.jsx($,{children:y(s)})]})]})})}const b=a.memo(h);export{b as default};
@@ -1 +1 @@
1
- import{l as H,ak as _,s as w,r as s,a4 as O,u as G,a5 as S,j as l,W as K,Q as q,T as N,P as Q}from"./index-wnKDraWU.js";import{u as $}from"./uniqueId-ikSpJ9AP.js";import{I as J}from"./InputInstructions-BLplNLW9.js";import{u as M}from"./useBasicWidgetState-raTjAqZP.js";import{u as X,a as Y,b as Z}from"./useUpdateUiValue-BbEmiOZQ.js";import{u as tt,T as et}from"./useTextInputAutoExpand-Uac3U0I_.js";import"./FormClearHelper-CaLJK07N.js";import"./inputUtils-CptNuJwn.js";import"./base-input-d4WKPeU6.js";const it=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const o=H(t.labelVisibility?.value)===_.Collapsed?2:30;a=`${e.heightConfig.pixelHeight-o}px`}return a},at=w("div",{target:"ezh4s2r0"})({name:"kdbhus",styles:"height:100%;display:flex;flex-direction:column"}),T=(e,t)=>e.getStringValue(t)??t.default??null,st=e=>e.default??null,ot=e=>e.value??null,rt=(e,t,a,o)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},o)},lt=({disabled:e,element:t,widgetMgr:a,fragmentId:o,outerElement:d})=>{const m=s.useRef($("text_area_")).current,{width:W,elementRef:y}=O(),[r,h]=s.useState(!1),[I,x]=s.useState(!1),n=d.heightConfig?.useContent??!1,V=d.heightConfig?.useStretch??!1,v=it(d,t),b=s.useRef(null),[u,c]=s.useState(()=>T(a,t)??null),A=s.useCallback(()=>{c(t.default??null),h(!0)},[t]),[F,g]=M({getStateFromWidgetMgr:T,getDefaultStateFromProto:st,getCurrStateFromProto:ot,updateWidgetMgrState:rt,element:t,widgetMgr:a,fragmentId:o,onFormCleared:A});X(F,u,c,r);const i=G(),{height:R,maxHeight:j,updateScrollHeight:C}=tt({textareaRef:b,dependencies:[t.placeholder]}),p=s.useCallback(()=>{h(!1),g({value:u,fromUi:!0})},[u,g]),k=s.useCallback(()=>{r&&p(),x(!1)},[r,p]),z=s.useCallback(()=>{x(!0)},[]),E=s.useCallback(()=>{n&&C()},[n,C]),P=Y({formId:t.formId,maxChars:t.maxChars,setDirty:h,setUiValue:c,setValueWithSource:g,additionalAction:E}),L=Z(t.formId,p,r,a,o,!0),{placeholder:U,formId:f}=t,D=S({formId:f})?a.allowFormEnterToSubmit(f):r,B=I&&W>i.breakpoints.hideWidgetDetails;return l.jsxs(at,{className:"stTextArea","data-testid":"stTextArea",ref:y,children:[l.jsx(K,{label:t.label,disabled:e,labelVisibility:H(t.labelVisibility?.value),htmlFor:m,children:t.help&&l.jsx(q,{children:l.jsx(N,{content:t.help,placement:Q.TOP_RIGHT})})}),l.jsx(et,{inputRef:n?b:void 0,value:u??"",placeholder:U,onBlur:k,onFocus:z,onChange:P,onKeyDown:L,"aria-label":t.label,disabled:e,id:m,overrides:{Input:{style:{fontWeight:i.fontWeights.normal,lineHeight:i.lineHeights.inputWidget,height:n?R:v,maxHeight:n?j:"",minHeight:i.sizes.largestElementHeight,resize:V?"none":"vertical",paddingRight:i.spacing.md,paddingLeft:i.spacing.md,paddingBottom:i.spacing.md,paddingTop:i.spacing.md,"::placeholder":{color:i.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,flexGrow:1}}}}),B&&l.jsx(J,{dirty:r,value:u??"",maxLength:t.maxChars,type:"multiline",inForm:S({formId:f}),allowEnterToSubmit:D})]})},xt=s.memo(lt);export{xt as default};
1
+ import{l as H,ak as _,s as w,r as s,a4 as O,u as G,a5 as S,j as l,W as K,Q as q,T as N,P as Q}from"./index-BwsrXI9O.js";import{u as $}from"./uniqueId-7HN9pV-Z.js";import{I as J}from"./InputInstructions-Ck_istEY.js";import{u as M}from"./useBasicWidgetState-CQoPeUHV.js";import{u as X,a as Y,b as Z}from"./useUpdateUiValue-CakBWvqR.js";import{u as tt,T as et}from"./useTextInputAutoExpand-CJ0SgjFi.js";import"./FormClearHelper-DGQP9oxJ.js";import"./inputUtils-CptNuJwn.js";import"./base-input-DRJDHdAL.js";const it=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const o=H(t.labelVisibility?.value)===_.Collapsed?2:30;a=`${e.heightConfig.pixelHeight-o}px`}return a},at=w("div",{target:"ezh4s2r0"})({name:"kdbhus",styles:"height:100%;display:flex;flex-direction:column"}),T=(e,t)=>e.getStringValue(t)??t.default??null,st=e=>e.default??null,ot=e=>e.value??null,rt=(e,t,a,o)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},o)},lt=({disabled:e,element:t,widgetMgr:a,fragmentId:o,outerElement:d})=>{const m=s.useRef($("text_area_")).current,{width:W,elementRef:y}=O(),[r,h]=s.useState(!1),[I,x]=s.useState(!1),n=d.heightConfig?.useContent??!1,V=d.heightConfig?.useStretch??!1,v=it(d,t),b=s.useRef(null),[u,c]=s.useState(()=>T(a,t)??null),A=s.useCallback(()=>{c(t.default??null),h(!0)},[t]),[F,g]=M({getStateFromWidgetMgr:T,getDefaultStateFromProto:st,getCurrStateFromProto:ot,updateWidgetMgrState:rt,element:t,widgetMgr:a,fragmentId:o,onFormCleared:A});X(F,u,c,r);const i=G(),{height:R,maxHeight:j,updateScrollHeight:C}=tt({textareaRef:b,dependencies:[t.placeholder]}),p=s.useCallback(()=>{h(!1),g({value:u,fromUi:!0})},[u,g]),k=s.useCallback(()=>{r&&p(),x(!1)},[r,p]),z=s.useCallback(()=>{x(!0)},[]),E=s.useCallback(()=>{n&&C()},[n,C]),P=Y({formId:t.formId,maxChars:t.maxChars,setDirty:h,setUiValue:c,setValueWithSource:g,additionalAction:E}),L=Z(t.formId,p,r,a,o,!0),{placeholder:U,formId:f}=t,D=S({formId:f})?a.allowFormEnterToSubmit(f):r,B=I&&W>i.breakpoints.hideWidgetDetails;return l.jsxs(at,{className:"stTextArea","data-testid":"stTextArea",ref:y,children:[l.jsx(K,{label:t.label,disabled:e,labelVisibility:H(t.labelVisibility?.value),htmlFor:m,children:t.help&&l.jsx(q,{children:l.jsx(N,{content:t.help,placement:Q.TOP_RIGHT})})}),l.jsx(et,{inputRef:n?b:void 0,value:u??"",placeholder:U,onBlur:k,onFocus:z,onChange:P,onKeyDown:L,"aria-label":t.label,disabled:e,id:m,overrides:{Input:{style:{fontWeight:i.fontWeights.normal,lineHeight:i.lineHeights.inputWidget,height:n?R:v,maxHeight:n?j:"",minHeight:i.sizes.largestElementHeight,resize:V?"none":"vertical",paddingRight:i.spacing.md,paddingLeft:i.spacing.md,paddingBottom:i.spacing.md,paddingTop:i.spacing.md,"::placeholder":{color:i.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:{borderLeftWidth:i.sizes.borderWidth,borderRightWidth:i.sizes.borderWidth,borderTopWidth:i.sizes.borderWidth,borderBottomWidth:i.sizes.borderWidth,flexGrow:1}}}}),B&&l.jsx(J,{dirty:r,value:u??"",maxLength:t.maxChars,type:"multiline",inForm:S({formId:f}),allowEnterToSubmit:D})]})},xt=s.memo(lt);export{xt as default};
@@ -1,4 +1,4 @@
1
- import{r as h,E as Y,_ as Z,L as Zt,k as ut,n as $,b3 as Rt,bq as Kt,bk as Jt,bj as Qt,s as M,j as v,ah as te,c as ee,B as ie,an as re,x as ne,bw as se,u as oe,bx as Q,aE as ae,aV as le,W as ce,l as de,T as he,P as ue}from"./index-wnKDraWU.js";import{T as pe,a as xt}from"./Toolbar-BbbydoLD.js";import{u as fe,F as me}from"./FormClearHelper-CaLJK07N.js";import{c as ge}from"./createDownloadLinkElement-ZaXNnPK4.js";import{u as ve}from"./Hooks-D54IehuR.js";import{F as be,D as ye}from"./FileDownload.esm-DVbGfwz7.js";var At=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});At.displayName="Mic";var Mt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Mt.displayName="Pause";var It=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});It.displayName="PlayArrow";var Ot=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Ot.displayName="Refresh";var Lt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Lt.displayName="StopCircle";function A(r,t,e,i){return new(e||(e=Promise))((function(n,s){function a(l){try{d(i.next(l))}catch(o){s(o)}}function c(l){try{d(i.throw(l))}catch(o){s(o)}}function d(l){var o;l.done?n(l.value):(o=l.value,o instanceof e?o:new e((function(u){u(o)}))).then(a,c)}d((i=i.apply(r,t||[])).next())}))}let K=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),i?.once){const n=(...s)=>{this.un(t,n),e(...s)};return this.listeners[t].add(n),()=>this.un(t,n)}return this.listeners[t].add(e),()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach((i=>i(...e)))}};const tt={decode:function(r,t){return A(this,void 0,void 0,(function*(){const e=new AudioContext({sampleRate:t});try{return yield e.decodeAudioData(r)}finally{e.close()}}))},createBuffer:function(r,t){if(!r||r.length===0)throw new Error("channelData must be a non-empty array");if(t<=0)throw new Error("duration must be greater than 0");if(typeof r[0]=="number"&&(r=[r]),!r[0]||r[0].length===0)throw new Error("channelData must contain non-empty channel arrays");(function(i){const n=i[0];if(n.some((s=>s>1||s<-1))){const s=n.length;let a=0;for(let c=0;c<s;c++){const d=Math.abs(n[c]);d>a&&(a=d)}for(const c of i)for(let d=0;d<s;d++)c[d]/=a}})(r);const e=r.map((i=>i instanceof Float32Array?i:Float32Array.from(i)));return{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:i=>{const n=e[i];if(!n)throw new Error(`Channel ${i} not found`);return n},copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ut(r,t){const e=t.xmlns?document.createElementNS(t.xmlns,r):document.createElement(r);for(const[i,n]of Object.entries(t))if(i==="children"&&n)for(const[s,a]of Object.entries(n))a instanceof Node?e.appendChild(a):typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Ut(s,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function Et(r,t,e){const i=Ut(r,t||{});return e?.appendChild(i),i}var we=Object.freeze({__proto__:null,createElement:Et,default:Et});const Ce={fetchBlob:function(r,t,e){return A(this,void 0,void 0,(function*(){const i=yield fetch(r,e);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return(function(n,s){A(this,void 0,void 0,(function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),c=Number(n.headers.get("Content-Length"))||0;let d=0;const l=o=>{d+=o?.length||0;const u=Math.round(d/c*100);s(u)};try{for(;;){const o=yield a.read();if(o.done)break;l(o.value)}}catch(o){console.warn("Progress tracking error:",o)}}))})(i.clone(),t),i.blob()}))}};class Se extends K{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",(()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)}),{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(i&&this.media.removeAttribute("src"),n||t)try{this.media.src=n}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load(),this.media.remove())}setMediaElement(t){this.media=t}play(){return A(this,void 0,void 0,(function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}}))}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}function ot(r){return r<0?0:r>1?1:r}function Re({maxTop:r,maxBottom:t,halfHeight:e,vScale:i}){const n=Math.round(r*e*i);return{topHeight:n,totalHeight:n+Math.round(t*e*i)||1}}function xe({barAlign:r,halfHeight:t,topHeight:e,totalHeight:i,canvasHeight:n}){return r==="top"?0:r==="bottom"?n-i:t-e}function Pt(r,t,e){const i=t-r.left,n=e-r.top;return[i/r.width,n/r.height]}function Bt(r){return!!(r.barWidth||r.barGap||r.barAlign)}function Wt(r,t){if(!Bt(t))return r;const e=t.barWidth||.5,i=e+(t.barGap||e/2);return i===0?r:Math.floor(r/i)*i}function Dt({scrollLeft:r,totalWidth:t,numCanvases:e}){if(t===0)return[0];const i=r/t,n=Math.floor(i*e);return[n-1,n,n+1]}function Tt({scrollLeft:r,clientWidth:t,scrollWidth:e}){return e===0?{startX:0,endX:0}:{startX:r/e,endX:(r+t)/e}}class Ee extends K{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.dragUnsubscribe=null,this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,s]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=s.querySelector(".scroll"),this.wrapper=s.querySelector(".wrapper"),this.canvasWrapper=s.querySelector(".canvases"),this.progressWrapper=s.querySelector(".progress"),this.cursor=s.querySelector(".cursor"),e&&s.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){if(this.wrapper.addEventListener("click",(t=>{const e=this.wrapper.getBoundingClientRect(),[i,n]=Pt(e,t.clientX,t.clientY);this.emit("click",i,n)})),this.wrapper.addEventListener("dblclick",(t=>{const e=this.wrapper.getBoundingClientRect(),[i,n]=Pt(e,t.clientX,t.clientY);this.emit("dblclick",i,n)})),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",(()=>{const{scrollLeft:t,scrollWidth:e,clientWidth:i}=this.scrollContainer,{startX:n,endX:s}=Tt({scrollLeft:t,scrollWidth:e,clientWidth:i});this.emit("scroll",n,s,t,t+i)})),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver((()=>{t().then((()=>this.onContainerResize())).catch((()=>{}))})),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender(),this.emit("resize"))}initDrag(){this.dragUnsubscribe||(this.dragUnsubscribe=(function(t,e,i,n,s=3,a=0,c=100){if(!t)return()=>{};const d=new Map,l=matchMedia("(pointer: coarse)").matches;let o=()=>{};const u=m=>{if(m.button!==a||(d.set(m.pointerId,m),d.size>1))return;let p=m.clientX,f=m.clientY,b=!1;const g=Date.now(),T=w=>{if(w.defaultPrevented||d.size>1||l&&Date.now()-g<c)return;const C=w.clientX,E=w.clientY,I=C-p,U=E-f;if(b||Math.abs(I)>s||Math.abs(U)>s){w.preventDefault(),w.stopPropagation();const F=t.getBoundingClientRect(),{left:O,top:N}=F;b||(i?.(p-O,f-N),b=!0),e(I,U,C-O,E-N),p=C,f=E}},W=w=>{if(d.delete(w.pointerId),b){const C=w.clientX,E=w.clientY,I=t.getBoundingClientRect(),{left:U,top:F}=I;n?.(C-U,E-F)}o()},D=w=>{d.delete(w.pointerId),w.relatedTarget&&w.relatedTarget!==document.documentElement||W(w)},R=w=>{b&&(w.stopPropagation(),w.preventDefault())},x=w=>{w.defaultPrevented||d.size>1||b&&w.preventDefault()};document.addEventListener("pointermove",T),document.addEventListener("pointerup",W),document.addEventListener("pointerout",D),document.addEventListener("pointercancel",D),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("click",R,{capture:!0}),o=()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",W),document.removeEventListener("pointerout",D),document.removeEventListener("pointercancel",D),document.removeEventListener("touchmove",x),setTimeout((()=>{document.removeEventListener("click",R,{capture:!0})}),10)}};return t.addEventListener("pointerdown",u),()=>{o(),t.removeEventListener("pointerdown",u),d.clear()}})(this.wrapper,((t,e,i)=>{const n=this.wrapper.getBoundingClientRect().width;this.emit("drag",ot(i/n))}),(t=>{this.isDragging=!0;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragstart",ot(t/e))}),(t=>{this.isDragging=!1;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragend",ot(t/e))})),this.subscriptions.push(this.dragUnsubscribe))}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
1
+ import{r as h,E as Y,_ as Z,L as Zt,k as ut,n as $,b3 as Rt,bq as Kt,bk as Jt,bj as Qt,s as M,j as v,ah as te,c as ee,B as ie,an as re,x as ne,bw as se,u as oe,bx as Q,aE as ae,aV as le,W as ce,l as de,T as he,P as ue}from"./index-BwsrXI9O.js";import{T as pe,a as xt}from"./Toolbar-ByIPpsVy.js";import{u as fe,F as me}from"./FormClearHelper-DGQP9oxJ.js";import{c as ge}from"./createDownloadLinkElement-ZaXNnPK4.js";import{u as ve}from"./Hooks-Bo61ucn1.js";import{F as be,D as ye}from"./FileDownload.esm-RGPPDhk8.js";var At=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});At.displayName="Mic";var Mt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Mt.displayName="Pause";var It=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});It.displayName="PlayArrow";var Ot=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Ot.displayName="Refresh";var Lt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Lt.displayName="StopCircle";function A(r,t,e,i){return new(e||(e=Promise))((function(n,s){function a(l){try{d(i.next(l))}catch(o){s(o)}}function c(l){try{d(i.throw(l))}catch(o){s(o)}}function d(l){var o;l.done?n(l.value):(o=l.value,o instanceof e?o:new e((function(u){u(o)}))).then(a,c)}d((i=i.apply(r,t||[])).next())}))}let K=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),i?.once){const n=(...s)=>{this.un(t,n),e(...s)};return this.listeners[t].add(n),()=>this.un(t,n)}return this.listeners[t].add(e),()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach((i=>i(...e)))}};const tt={decode:function(r,t){return A(this,void 0,void 0,(function*(){const e=new AudioContext({sampleRate:t});try{return yield e.decodeAudioData(r)}finally{e.close()}}))},createBuffer:function(r,t){if(!r||r.length===0)throw new Error("channelData must be a non-empty array");if(t<=0)throw new Error("duration must be greater than 0");if(typeof r[0]=="number"&&(r=[r]),!r[0]||r[0].length===0)throw new Error("channelData must contain non-empty channel arrays");(function(i){const n=i[0];if(n.some((s=>s>1||s<-1))){const s=n.length;let a=0;for(let c=0;c<s;c++){const d=Math.abs(n[c]);d>a&&(a=d)}for(const c of i)for(let d=0;d<s;d++)c[d]/=a}})(r);const e=r.map((i=>i instanceof Float32Array?i:Float32Array.from(i)));return{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:i=>{const n=e[i];if(!n)throw new Error(`Channel ${i} not found`);return n},copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ut(r,t){const e=t.xmlns?document.createElementNS(t.xmlns,r):document.createElement(r);for(const[i,n]of Object.entries(t))if(i==="children"&&n)for(const[s,a]of Object.entries(n))a instanceof Node?e.appendChild(a):typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(Ut(s,a));else i==="style"?Object.assign(e.style,n):i==="textContent"?e.textContent=n:e.setAttribute(i,n.toString());return e}function Et(r,t,e){const i=Ut(r,t||{});return e?.appendChild(i),i}var we=Object.freeze({__proto__:null,createElement:Et,default:Et});const Ce={fetchBlob:function(r,t,e){return A(this,void 0,void 0,(function*(){const i=yield fetch(r,e);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return(function(n,s){A(this,void 0,void 0,(function*(){if(!n.body||!n.headers)return;const a=n.body.getReader(),c=Number(n.headers.get("Content-Length"))||0;let d=0;const l=o=>{d+=o?.length||0;const u=Math.round(d/c*100);s(u)};try{for(;;){const o=yield a.read();if(o.done)break;l(o.value)}}catch(o){console.warn("Progress tracking error:",o)}}))})(i.clone(),t),i.blob()}))}};class Se extends K{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",(()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)}),{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const n=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(i&&this.media.removeAttribute("src"),n||t)try{this.media.src=n}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load(),this.media.remove())}setMediaElement(t){this.media=t}play(){return A(this,void 0,void 0,(function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}}))}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}function ot(r){return r<0?0:r>1?1:r}function Re({maxTop:r,maxBottom:t,halfHeight:e,vScale:i}){const n=Math.round(r*e*i);return{topHeight:n,totalHeight:n+Math.round(t*e*i)||1}}function xe({barAlign:r,halfHeight:t,topHeight:e,totalHeight:i,canvasHeight:n}){return r==="top"?0:r==="bottom"?n-i:t-e}function Pt(r,t,e){const i=t-r.left,n=e-r.top;return[i/r.width,n/r.height]}function Bt(r){return!!(r.barWidth||r.barGap||r.barAlign)}function Wt(r,t){if(!Bt(t))return r;const e=t.barWidth||.5,i=e+(t.barGap||e/2);return i===0?r:Math.floor(r/i)*i}function Dt({scrollLeft:r,totalWidth:t,numCanvases:e}){if(t===0)return[0];const i=r/t,n=Math.floor(i*e);return[n-1,n,n+1]}function Tt({scrollLeft:r,clientWidth:t,scrollWidth:e}){return e===0?{startX:0,endX:0}:{startX:r/e,endX:(r+t)/e}}class Ee extends K{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.dragUnsubscribe=null,this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[n,s]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=s.querySelector(".scroll"),this.wrapper=s.querySelector(".wrapper"),this.canvasWrapper=s.querySelector(".canvases"),this.progressWrapper=s.querySelector(".progress"),this.cursor=s.querySelector(".cursor"),e&&s.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){if(this.wrapper.addEventListener("click",(t=>{const e=this.wrapper.getBoundingClientRect(),[i,n]=Pt(e,t.clientX,t.clientY);this.emit("click",i,n)})),this.wrapper.addEventListener("dblclick",(t=>{const e=this.wrapper.getBoundingClientRect(),[i,n]=Pt(e,t.clientX,t.clientY);this.emit("dblclick",i,n)})),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",(()=>{const{scrollLeft:t,scrollWidth:e,clientWidth:i}=this.scrollContainer,{startX:n,endX:s}=Tt({scrollLeft:t,scrollWidth:e,clientWidth:i});this.emit("scroll",n,s,t,t+i)})),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver((()=>{t().then((()=>this.onContainerResize())).catch((()=>{}))})),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender(),this.emit("resize"))}initDrag(){this.dragUnsubscribe||(this.dragUnsubscribe=(function(t,e,i,n,s=3,a=0,c=100){if(!t)return()=>{};const d=new Map,l=matchMedia("(pointer: coarse)").matches;let o=()=>{};const u=m=>{if(m.button!==a||(d.set(m.pointerId,m),d.size>1))return;let p=m.clientX,f=m.clientY,b=!1;const g=Date.now(),T=w=>{if(w.defaultPrevented||d.size>1||l&&Date.now()-g<c)return;const C=w.clientX,E=w.clientY,I=C-p,U=E-f;if(b||Math.abs(I)>s||Math.abs(U)>s){w.preventDefault(),w.stopPropagation();const F=t.getBoundingClientRect(),{left:O,top:N}=F;b||(i?.(p-O,f-N),b=!0),e(I,U,C-O,E-N),p=C,f=E}},W=w=>{if(d.delete(w.pointerId),b){const C=w.clientX,E=w.clientY,I=t.getBoundingClientRect(),{left:U,top:F}=I;n?.(C-U,E-F)}o()},D=w=>{d.delete(w.pointerId),w.relatedTarget&&w.relatedTarget!==document.documentElement||W(w)},R=w=>{b&&(w.stopPropagation(),w.preventDefault())},x=w=>{w.defaultPrevented||d.size>1||b&&w.preventDefault()};document.addEventListener("pointermove",T),document.addEventListener("pointerup",W),document.addEventListener("pointerout",D),document.addEventListener("pointercancel",D),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("click",R,{capture:!0}),o=()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",W),document.removeEventListener("pointerout",D),document.removeEventListener("pointercancel",D),document.removeEventListener("touchmove",x),setTimeout((()=>{document.removeEventListener("click",R,{capture:!0})}),10)}};return t.addEventListener("pointerdown",u),()=>{o(),t.removeEventListener("pointerdown",u),d.clear()}})(this.wrapper,((t,e,i)=>{const n=this.wrapper.getBoundingClientRect().width;this.emit("drag",ot(i/n))}),(t=>{this.isDragging=!0;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragstart",ot(t/e))}),(t=>{this.isDragging=!1;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragend",ot(t/e))})),this.subscriptions.push(this.dragUnsubscribe))}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
2
2
  <style${i?` nonce="${i}"`:""}>
3
3
  :host {
4
4
  user-select: none;
@@ -1 +1 @@
1
- import{r as p,u as T,h as k,j as c,S as C,e as y,l as S,f as L,g as W,T as B,P as R,t as w,C as E}from"./index-wnKDraWU.js";import{u as P}from"./useBasicWidgetState-raTjAqZP.js";import{S as j,L as $,a as m}from"./checkbox-DUA9ewQT.js";import"./FormClearHelper-CaLJK07N.js";function v({element:t,disabled:a,widgetMgr:n,fragmentId:d}){const[f,g]=P({getStateFromWidgetMgr:X,getDefaultStateFromProto:H,getCurrStateFromProto:M,updateWidgetMgrState:V,element:t,widgetMgr:n,fragmentId:d}),x=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),e=T(),{colors:o,spacing:h,sizes:r}=e,u=k(e),b=a?o.fadedText40:o.bodyText;return c.jsx(C,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:c.jsx(j,{checked:f,disabled:a,onChange:x,"aria-label":t.label,checkmarkType:t.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:$.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let s=u?o.bgColor:o.bodyText;return a&&(s=u?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${e.spacing.twoXS})`,height:`calc(${r.checkbox} - ${e.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:s,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:s})=>{let l=o.fadedText40;return s&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:e.spacing.twoXS,paddingLeft:e.spacing.threeXS,paddingRight:e.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:e.radii.full,borderTopLeftRadius:e.radii.full,borderBottomRightRadius:e.radii.full,borderTopRightRadius:e.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:s})=>{const l=s&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:e.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&s?`0 0 0 0.2rem ${w(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:e.lineHeights.small,paddingLeft:e.spacing.sm,position:"relative",color:b}}},children:c.jsxs(y,{visibility:S(t.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[c.jsx(L,{source:t.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),t.help&&c.jsx(W,{color:b,children:c.jsx(B,{content:t.help,placement:R.TOP_RIGHT})})]})})})}function X(t,a){return t.getBoolValue(a)}function H(t){return t.default??null}function M(t){return t.value??null}function V(t,a,n,d){a.setBoolValue(t,n.value,{fromUi:n.fromUi},d)}const U=p.memo(v);export{U as default};
1
+ import{r as p,u as T,h as k,j as c,S as C,e as y,l as S,f as L,g as W,T as B,P as R,t as w,C as E}from"./index-BwsrXI9O.js";import{u as P}from"./useBasicWidgetState-CQoPeUHV.js";import{S as j,L as $,a as m}from"./checkbox-2-JpNSRW.js";import"./FormClearHelper-DGQP9oxJ.js";function v({element:t,disabled:a,widgetMgr:n,fragmentId:d}){const[f,g]=P({getStateFromWidgetMgr:X,getDefaultStateFromProto:H,getCurrStateFromProto:M,updateWidgetMgrState:V,element:t,widgetMgr:n,fragmentId:d}),x=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),e=T(),{colors:o,spacing:h,sizes:r}=e,u=k(e),b=a?o.fadedText40:o.bodyText;return c.jsx(C,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:c.jsx(j,{checked:f,disabled:a,onChange:x,"aria-label":t.label,checkmarkType:t.type===E.StyleType.TOGGLE?m.toggle:m.default,labelPlacement:$.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let s=u?o.bgColor:o.bodyText;return a&&(s=u?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${e.spacing.twoXS})`,height:`calc(${r.checkbox} - ${e.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:s,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:s})=>{let l=o.fadedText40;return s&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:e.spacing.twoXS,paddingLeft:e.spacing.threeXS,paddingRight:e.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:e.radii.full,borderTopLeftRadius:e.radii.full,borderBottomRightRadius:e.radii.full,borderTopRightRadius:e.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:s})=>{const l=s&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:e.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&s?`0 0 0 0.2rem ${w(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:e.lineHeights.small,paddingLeft:e.spacing.sm,position:"relative",color:b}}},children:c.jsxs(y,{visibility:S(t.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[c.jsx(L,{source:t.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),t.help&&c.jsx(W,{color:b,children:c.jsx(B,{content:t.help,placement:R.TOP_RIGHT})})]})})})}function X(t,a){return t.getBoolValue(a)}function H(t){return t.default??null}function M(t){return t.value??null}function V(t,a,n,d){a.setBoolValue(t,n.value,{fromUi:n.fromUi},d)}const U=p.memo(v);export{U as default};