@stlite/desktop 0.90.17 → 0.90.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/assets/{ErrorOutline.esm-CSbmRBTs.js → ErrorOutline.esm-Blj8Hhf6.js} +1 -1
- package/build/assets/{FileDownload.esm-Chli17S8.js → FileDownload.esm-1LbRaFsH.js} +1 -1
- package/build/assets/{FileHelper-BmOs-7p9.js → FileHelper-B2y-7Abl.js} +1 -1
- package/build/assets/{FormClearHelper-DzT4m6x-.js → FormClearHelper-D5uKQTmO.js} +1 -1
- package/build/assets/{Hooks-CWxcUAjO.js → Hooks-UOkK2jWB.js} +1 -1
- package/build/assets/{InputInstructions-DXkJDo-d.js → InputInstructions-CpX2tVr2.js} +1 -1
- package/build/assets/{Particles-DBUzeOij.js → Particles-oLvnrhlH.js} +1 -1
- package/build/assets/{ProgressBar-C3YNhB2j.js → ProgressBar-Cx2t8yOA.js} +1 -1
- package/build/assets/{Toolbar-B9tKdtfU.js → Toolbar-D8UqfEZK.js} +1 -1
- package/build/assets/{base-input-iLbK-zKR.js → base-input-EmJVkDar.js} +1 -1
- package/build/assets/{checkbox-DeJjjX3E.js → checkbox-B4vRKSUu.js} +1 -1
- package/build/assets/{createSuper-CwBHRG8y.js → createSuper-DnUl9ga4.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-DUraHWw3.js → data-grid-overlay-editor-De0vl78P.js} +1 -1
- package/build/assets/{downloader-BaaVgY1J.js → downloader-CnI1YwAT.js} +1 -1
- package/build/assets/{es6-nNn5dvCp.js → es6-D2SokxS6.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-CdPHQImI.js → iframeResizer.contentWindow-UJFMjmxg.js} +1 -1
- package/build/assets/{index-EPlPorpI.js → index-1gGu0WOL.js} +1 -1
- package/build/assets/{index-xw-9-jMZ.js → index-B-K_jUiT.js} +1 -1
- package/build/assets/{index-D8gnxsH2.js → index-B1yKODvA.js} +1 -1
- package/build/assets/{index-V3ySK6f2.js → index-B2BVRw-9.js} +1 -1
- package/build/assets/{index-CfKvjJq7.js → index-BBx1QmLR.js} +1 -1
- package/build/assets/{index-B44FC7jH.js → index-BKuMpiL0.js} +1 -1
- package/build/assets/{index-B6gNZ4bX.js → index-BUWaKVzr.js} +1 -1
- package/build/assets/{index-BesF0m-H.js → index-BWfcwmlx.js} +1 -1
- package/build/assets/{index-B3I5fK3b.js → index-B_OPOi9F.js} +1 -1
- package/build/assets/{index-DPfkKD9E.js → index-BcBxjWYX.js} +1 -1
- package/build/assets/{index-CKkdmaf5.js → index-BxJLmgSa.js} +1 -1
- package/build/assets/{index-DJKUgCVw.js → index-BxmBUM11.js} +1 -1
- package/build/assets/{index-BAHHLDfa.js → index-C1WbeJPS.js} +1 -1
- package/build/assets/{index-TcDrXcNe.js → index-CAfO5bZA.js} +5 -5
- package/build/assets/{index-qAmeZqQd.js → index-CGZZyIA-.js} +1 -1
- package/build/assets/{index-JmbIn5LC.js → index-COhUeoc4.js} +5 -5
- package/build/assets/{index-CtSzYaeu.js → index-CSLug6jY.js} +1 -1
- package/build/assets/{index-BQMFy65W.js → index-CT9nFYnK.js} +1 -1
- package/build/assets/{index-BMYYY1ow.js → index-CU5JgE6N.js} +1 -1
- package/build/assets/{index.BGUxDbb1.css → index-CjinZy_M.css} +1 -1
- package/build/assets/{index-DicWkuji.js → index-Co4iAmM5.js} +1 -1
- package/build/assets/{index-DmG-Yrnj.js → index-CsYlyQBB.js} +1 -1
- package/build/assets/{index-C73-Ejlm.js → index-CypdaOIu.js} +1 -1
- package/build/assets/{index-C55LbTPs.js → index-D4pjnSq5.js} +1 -1
- package/build/assets/{index-ZWSe7q8u.js → index-DIQ0Isoi.js} +1 -1
- package/build/assets/{index-BLv0ASbw.js → index-DMidF45Q.js} +1 -1
- package/build/assets/{index-fIgYGVDY.js → index-DOXm_ZnI.js} +1 -1
- package/build/assets/{index-Bkyb8y7c.js → index-DQjk_Vs3.js} +1 -1
- package/build/assets/{index-BJFM3-2Z.js → index-DfT5dDkl.js} +1 -1
- package/build/assets/{index-C4GjZT3v.js → index-DhmQbtya.js} +1 -1
- package/build/assets/{index-BzHXNIh0.js → index-Dn0Wqf5W.js} +1 -1
- package/build/assets/{index-C8YVD3tE.js → index-GaL-r5lx.js} +1 -1
- package/build/assets/{index-DZGDXXq2.js → index-Jcem7zyC.js} +1 -1
- package/build/assets/{index-BpdahSmb.js → index-MwgHs0Fx.js} +1 -1
- package/build/assets/{index-ChDnLbTu.js → index-OrQppZpd.js} +1 -1
- package/build/assets/{index-BpkmIL-b.js → index-S_uFdwCo.js} +1 -1
- package/build/assets/{index-B8qYwdp8.js → index-esUAlWJO.js} +1 -1
- package/build/assets/{index-CM9UKsWI.js → index-qyo1rL1Q.js} +1 -1
- package/build/assets/{inherits-CarKs31i.js → inherits-CTISURyg.js} +1 -1
- package/build/assets/{input-DcFtOzfb.js → input-ByEjrb2a.js} +1 -1
- package/build/assets/{memory-DdaoK7yz.js → memory-Dc5hwPZ7.js} +1 -1
- package/build/assets/{number-overlay-editor-DkLM--gB.js → number-overlay-editor-CSD-WlqD.js} +1 -1
- package/build/assets/{sandbox-CyGfUjJC.js → sandbox-Cjui0EAj.js} +1 -1
- package/build/assets/{slicedToArray-CgYaBkVH.js → slicedToArray-CBU6V2W3.js} +1 -1
- package/build/assets/{timepicker-B6A12HlE.js → timepicker-BKp8RcLf.js} +1 -1
- package/build/assets/{uniqueId-Ca7uQu7S.js → uniqueId-CVivDO_N.js} +1 -1
- package/build/assets/{useBasicWidgetState-DoAL3G-D.js → useBasicWidgetState-BRbplAp6.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-DuBV-baK.js → useTextInputAutoExpand-DbsgX0Ah.js} +1 -1
- package/build/assets/{useUpdateUiValue-6gLwFH0m.js → useUpdateUiValue-CBzv6Oy6.js} +1 -1
- package/build/assets/{withFullScreenWrapper-B0RGgIoE.js → withFullScreenWrapper-Ddi5ZFiT.js} +1 -1
- package/build/index.html +2 -2
- package/package.json +1 -1
- package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
- /package/build/assets/{KaTeX_AMS-Regular.BQhdFMY1.woff2 → KaTeX_AMS-Regular-BQhdFMY1.woff2} +0 -0
- /package/build/assets/{KaTeX_AMS-Regular.DMm9YOAa.woff → KaTeX_AMS-Regular-DMm9YOAa.woff} +0 -0
- /package/build/assets/{KaTeX_AMS-Regular.DRggAlZN.ttf → KaTeX_AMS-Regular-DRggAlZN.ttf} +0 -0
- /package/build/assets/{KaTeX_Caligraphic-Bold.ATXxdsX0.ttf → KaTeX_Caligraphic-Bold-ATXxdsX0.ttf} +0 -0
- /package/build/assets/{KaTeX_Caligraphic-Bold.BEiXGLvX.woff → KaTeX_Caligraphic-Bold-BEiXGLvX.woff} +0 -0
- /package/build/assets/{KaTeX_Caligraphic-Bold.Dq_IR9rO.woff2 → KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2} +0 -0
- /package/build/assets/{KaTeX_Caligraphic-Regular.CTRA-rTL.woff → KaTeX_Caligraphic-Regular-CTRA-rTL.woff} +0 -0
- /package/build/assets/{KaTeX_Caligraphic-Regular.Di6jR-x-.woff2 → KaTeX_Caligraphic-Regular-Di6jR-x-.woff2} +0 -0
- /package/build/assets/{KaTeX_Caligraphic-Regular.wX97UBjC.ttf → KaTeX_Caligraphic-Regular-wX97UBjC.ttf} +0 -0
- /package/build/assets/{KaTeX_Fraktur-Bold.BdnERNNW.ttf → KaTeX_Fraktur-Bold-BdnERNNW.ttf} +0 -0
- /package/build/assets/{KaTeX_Fraktur-Bold.BsDP51OF.woff → KaTeX_Fraktur-Bold-BsDP51OF.woff} +0 -0
- /package/build/assets/{KaTeX_Fraktur-Bold.CL6g_b3V.woff2 → KaTeX_Fraktur-Bold-CL6g_b3V.woff2} +0 -0
- /package/build/assets/{KaTeX_Fraktur-Regular.CB_wures.ttf → KaTeX_Fraktur-Regular-CB_wures.ttf} +0 -0
- /package/build/assets/{KaTeX_Fraktur-Regular.CTYiF6lA.woff2 → KaTeX_Fraktur-Regular-CTYiF6lA.woff2} +0 -0
- /package/build/assets/{KaTeX_Fraktur-Regular.Dxdc4cR9.woff → KaTeX_Fraktur-Regular-Dxdc4cR9.woff} +0 -0
- /package/build/assets/{KaTeX_Main-Bold.Cx986IdX.woff2 → KaTeX_Main-Bold-Cx986IdX.woff2} +0 -0
- /package/build/assets/{KaTeX_Main-Bold.Jm3AIy58.woff → KaTeX_Main-Bold-Jm3AIy58.woff} +0 -0
- /package/build/assets/{KaTeX_Main-Bold.waoOVXN0.ttf → KaTeX_Main-Bold-waoOVXN0.ttf} +0 -0
- /package/build/assets/{KaTeX_Main-BoldItalic.DxDJ3AOS.woff2 → KaTeX_Main-BoldItalic-DxDJ3AOS.woff2} +0 -0
- /package/build/assets/{KaTeX_Main-BoldItalic.DzxPMmG6.ttf → KaTeX_Main-BoldItalic-DzxPMmG6.ttf} +0 -0
- /package/build/assets/{KaTeX_Main-BoldItalic.SpSLRI95.woff → KaTeX_Main-BoldItalic-SpSLRI95.woff} +0 -0
- /package/build/assets/{KaTeX_Main-Italic.3WenGoN9.ttf → KaTeX_Main-Italic-3WenGoN9.ttf} +0 -0
- /package/build/assets/{KaTeX_Main-Italic.BMLOBm91.woff → KaTeX_Main-Italic-BMLOBm91.woff} +0 -0
- /package/build/assets/{KaTeX_Main-Italic.NWA7e6Wa.woff2 → KaTeX_Main-Italic-NWA7e6Wa.woff2} +0 -0
- /package/build/assets/{KaTeX_Main-Regular.B22Nviop.woff2 → KaTeX_Main-Regular-B22Nviop.woff2} +0 -0
- /package/build/assets/{KaTeX_Main-Regular.Dr94JaBh.woff → KaTeX_Main-Regular-Dr94JaBh.woff} +0 -0
- /package/build/assets/{KaTeX_Main-Regular.ypZvNtVU.ttf → KaTeX_Main-Regular-ypZvNtVU.ttf} +0 -0
- /package/build/assets/{KaTeX_Math-BoldItalic.B3XSjfu4.ttf → KaTeX_Math-BoldItalic-B3XSjfu4.ttf} +0 -0
- /package/build/assets/{KaTeX_Math-BoldItalic.CZnvNsCZ.woff2 → KaTeX_Math-BoldItalic-CZnvNsCZ.woff2} +0 -0
- /package/build/assets/{KaTeX_Math-BoldItalic.iY-2wyZ7.woff → KaTeX_Math-BoldItalic-iY-2wyZ7.woff} +0 -0
- /package/build/assets/{KaTeX_Math-Italic.DA0__PXp.woff → KaTeX_Math-Italic-DA0__PXp.woff} +0 -0
- /package/build/assets/{KaTeX_Math-Italic.flOr_0UB.ttf → KaTeX_Math-Italic-flOr_0UB.ttf} +0 -0
- /package/build/assets/{KaTeX_Math-Italic.t53AETM-.woff2 → KaTeX_Math-Italic-t53AETM-.woff2} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Bold.CFMepnvq.ttf → KaTeX_SansSerif-Bold-CFMepnvq.ttf} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Bold.D1sUS0GD.woff2 → KaTeX_SansSerif-Bold-D1sUS0GD.woff2} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Bold.DbIhKOiC.woff → KaTeX_SansSerif-Bold-DbIhKOiC.woff} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Italic.C3H0VqGB.woff2 → KaTeX_SansSerif-Italic-C3H0VqGB.woff2} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Italic.DN2j7dab.woff → KaTeX_SansSerif-Italic-DN2j7dab.woff} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Italic.YYjJ1zSn.ttf → KaTeX_SansSerif-Italic-YYjJ1zSn.ttf} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Regular.BNo7hRIc.ttf → KaTeX_SansSerif-Regular-BNo7hRIc.ttf} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Regular.CS6fqUqJ.woff → KaTeX_SansSerif-Regular-CS6fqUqJ.woff} +0 -0
- /package/build/assets/{KaTeX_SansSerif-Regular.DDBCnlJ7.woff2 → KaTeX_SansSerif-Regular-DDBCnlJ7.woff2} +0 -0
- /package/build/assets/{KaTeX_Script-Regular.C5JkGWo-.ttf → KaTeX_Script-Regular-C5JkGWo-.ttf} +0 -0
- /package/build/assets/{KaTeX_Script-Regular.D3wIWfF6.woff2 → KaTeX_Script-Regular-D3wIWfF6.woff2} +0 -0
- /package/build/assets/{KaTeX_Script-Regular.D5yQViql.woff → KaTeX_Script-Regular-D5yQViql.woff} +0 -0
- /package/build/assets/{KaTeX_Size1-Regular.C195tn64.woff → KaTeX_Size1-Regular-C195tn64.woff} +0 -0
- /package/build/assets/{KaTeX_Size1-Regular.Dbsnue_I.ttf → KaTeX_Size1-Regular-Dbsnue_I.ttf} +0 -0
- /package/build/assets/{KaTeX_Size1-Regular.mCD8mA8B.woff2 → KaTeX_Size1-Regular-mCD8mA8B.woff2} +0 -0
- /package/build/assets/{KaTeX_Size2-Regular.B7gKUWhC.ttf → KaTeX_Size2-Regular-B7gKUWhC.ttf} +0 -0
- /package/build/assets/{KaTeX_Size2-Regular.Dy4dx90m.woff2 → KaTeX_Size2-Regular-Dy4dx90m.woff2} +0 -0
- /package/build/assets/{KaTeX_Size2-Regular.oD1tc_U0.woff → KaTeX_Size2-Regular-oD1tc_U0.woff} +0 -0
- /package/build/assets/{KaTeX_Size3-Regular.CTq5MqoE.woff → KaTeX_Size3-Regular-CTq5MqoE.woff} +0 -0
- /package/build/assets/{KaTeX_Size3-Regular.DgpXs0kz.ttf → KaTeX_Size3-Regular-DgpXs0kz.ttf} +0 -0
- /package/build/assets/{KaTeX_Size4-Regular.BF-4gkZK.woff → KaTeX_Size4-Regular-BF-4gkZK.woff} +0 -0
- /package/build/assets/{KaTeX_Size4-Regular.DWFBv043.ttf → KaTeX_Size4-Regular-DWFBv043.ttf} +0 -0
- /package/build/assets/{KaTeX_Size4-Regular.Dl5lxZxV.woff2 → KaTeX_Size4-Regular-Dl5lxZxV.woff2} +0 -0
- /package/build/assets/{KaTeX_Typewriter-Regular.C0xS9mPB.woff → KaTeX_Typewriter-Regular-C0xS9mPB.woff} +0 -0
- /package/build/assets/{KaTeX_Typewriter-Regular.CO6r4hn1.woff2 → KaTeX_Typewriter-Regular-CO6r4hn1.woff2} +0 -0
- /package/build/assets/{KaTeX_Typewriter-Regular.D3Ib7_Hf.ttf → KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf} +0 -0
- /package/build/assets/{MaterialSymbols-Rounded.DeCZgS-4.woff2 → MaterialSymbols-Rounded-DeCZgS-4.woff2} +0 -0
- /package/build/assets/{SourceCodeVF-Italic.ttf.Ba1oaZG1.woff2 → SourceCodeVF-Italic.ttf-Ba1oaZG1.woff2} +0 -0
- /package/build/assets/{SourceCodeVF-Upright.ttf.BjWn63N-.woff2 → SourceCodeVF-Upright.ttf-BjWn63N-.woff2} +0 -0
- /package/build/assets/{SourceSansVF-Italic.ttf.Bt9VkdQ3.woff2 → SourceSansVF-Italic.ttf-Bt9VkdQ3.woff2} +0 -0
- /package/build/assets/{SourceSansVF-Upright.ttf.BsWL4Kly.woff2 → SourceSansVF-Upright.ttf-BsWL4Kly.woff2} +0 -0
- /package/build/assets/{SourceSerifVariable-Italic.ttf.CVdzAtxO.woff2 → SourceSerifVariable-Italic.ttf-CVdzAtxO.woff2} +0 -0
- /package/build/assets/{SourceSerifVariable-Roman.ttf.mdpVL9bi.woff2 → SourceSerifVariable-Roman.ttf-mdpVL9bi.woff2} +0 -0
- /package/build/assets/{balloon-0.Czj7AKwE.png → balloon-0-Czj7AKwE.png} +0 -0
- /package/build/assets/{balloon-1.CNvFFrND.png → balloon-1-CNvFFrND.png} +0 -0
- /package/build/assets/{balloon-2.DTvC6B1t.png → balloon-2-DTvC6B1t.png} +0 -0
- /package/build/assets/{balloon-3.CgSk4tbL.png → balloon-3-CgSk4tbL.png} +0 -0
- /package/build/assets/{balloon-4.mbtFrzxf.png → balloon-4-mbtFrzxf.png} +0 -0
- /package/build/assets/{balloon-5.CSwkUfRA.png → balloon-5-CSwkUfRA.png} +0 -0
- /package/build/assets/{fireworks.B4d-_KUe.gif → fireworks-B4d-_KUe.gif} +0 -0
- /package/build/assets/{flake-0.DgWaVvm5.png → flake-0-DgWaVvm5.png} +0 -0
- /package/build/assets/{flake-1.B2r5AHMK.png → flake-1-B2r5AHMK.png} +0 -0
- /package/build/assets/{flake-2.BnWSExPC.png → flake-2-BnWSExPC.png} +0 -0
- /package/build/assets/{index.BuwrT-ty.css → index-BuwrT-ty.css} +0 -0
- /package/build/assets/{index.CHEnSPGk.css → index-CHEnSPGk.css} +0 -0
- /package/build/assets/{parquet_wasm_bg.DrNke8Bl.wasm → parquet_wasm_bg-DrNke8Bl.wasm} +0 -0
- /package/build/assets/{snowflake.JU2jBHL8.svg → snowflake-JU2jBHL8.svg} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b1 as Ye,ac as J,r as x,bs as pt,ad as vt,o as Q,aL as mt,aM as bt,s as me,t as Ve,bi as yt,u as Tt,bt as kt,j as Z,W as Ot,l as wt,Q as Rt,T as St,P as Mt,bu as _t,bv as Ee}from"./index-TcDrXcNe.js";import{s as ze}from"./sprintf-DpPCfzXw.js";import{u as Et}from"./useBasicWidgetState-DoAL3G-D.js";import"./FormClearHelper-DzT4m6x-.js";var se={},H={},ue={},ce={},Ne;function Ie(){if(Ne)return ce;Ne=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Direction=void 0;var e;return(function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"})(e||(ce.Direction=e={})),ce}var Ue;function Ze(){return Ue||(Ue=1,(function(e){var r=ue&&ue.__spreadArray||function(i,s,u){if(u||arguments.length===2)for(var h=0,m=s.length,v;h<m;h++)(v||!(h in s))&&(v||(v=Array.prototype.slice.call(s,0,h)),v[h]=s[h]);return i.concat(v||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ye(),o=Ie(),p=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=p;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function l(i,s,u){var h=(s-i)/u,m=8,v=Number(h.toFixed(m));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function g(i,s,u,h,m,v,T){var _=1e11;if(i=Math.round(i*_)/_,!v){var P=T[s-1],C=T[s+1];if(P&&P>i)return P;if(C&&C<i)return C}if(i>h)return h;if(i<u)return u;var U=Math.floor(i*_-u*_)%Math.floor(m*_),z=Math.floor(i*_-Math.abs(U)),W=U===0?i:z/_,A=Math.abs(U/_)<m/2?W:W+m,L=(0,e.getStepDecimals)(m);return parseFloat(A.toFixed(L))}e.normalizeValue=g;function F(i,s,u){return(i-s)/(u-s)}e.relativeValue=F;function $(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=$;function V(i,s,u){if(s>=u)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(u,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=V;function E(i,s,u){return i<s?s:i>u?u:i}e.checkValuesAgainstBoundaries=E;function y(i){if(!(i.length<2)&&!i.slice(1).every(function(s,u){return i[u]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,u){var h=u?-1:1;i.forEach(function(m,v){return f(m,h*s[v].x,s[v].y)})}e.translateThumbs=a;function c(i,s,u,h){for(var m=0,v=D(i[0],s,u,h),T=1;T<i.length;T++){var _=D(i[T],s,u,h);_<v&&(v=_,m=T)}return m}e.getClosestThumbIndex=c;function f(i,s,u){i.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}e.translate=f;var b=function(i){var s=[],u=null,h=function(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];s=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,s)}))};return h};e.schd=b;function k(i,s,u){var h=i.slice(0);return h[s]=u,h}e.replaceAt=k;function I(i){var s=i.values,u=i.colors,h=i.min,m=i.max,v=i.direction,T=v===void 0?o.Direction.Right:v,_=i.rtl,P=_===void 0?!1:_;P&&T===o.Direction.Right?T=o.Direction.Left:P&&o.Direction.Left&&(T=o.Direction.Right);var C=s.slice(0).sort(function(z,W){return z-W}).map(function(z){return(z-h)/(m-h)*100}),U=C.reduce(function(z,W,A){return"".concat(z,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(T,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=I;function O(){}e.voidFn=O;function w(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=w;var M=function(i,s,u,h,m){m===void 0&&(m=function(T){return T});var v=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(T,_){var P=Math.ceil(_.getBoundingClientRect().width);if(_.innerText&&_.innerText.includes(u)&&_.childElementCount===0){var C=_.cloneNode(!0);C.innerHTML=m(s.toFixed(h)),C.style.visibility="hidden",document.body.appendChild(C),P=Math.ceil(C.getBoundingClientRect().width),document.body.removeChild(C)}return P>T?P:T},i.getBoundingClientRect().width));return v},B=function(i,s,u,h,m,v,T){T===void 0&&(T=function(C){return C});var _=[],P=function(C){var U=M(u[C],h[C],m,v,T),z=s[C].x;s.forEach(function(W,A){var L=W.x,G=M(u[A],h[A],m,v,T);C!==A&&(z>=L&&z<=L+G||z+U>=L&&z+U<=L+G)&&(_.includes(A)||(_.push(C),_.push(A),_=r(r([],_,!0),[C,A],!1),P(A)))})};return P(i),Array.from(new Set(_.sort()))},R=function(i,s,u,h,m,v){h===void 0&&(h=.1),m===void 0&&(m=" - "),v===void 0&&(v=function(A){return A});var T=(0,e.getStepDecimals)(h),_=(0,n.useState)({}),P=_[0],C=_[1],U=(0,n.useState)(v(s[u].toFixed(T))),z=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var L={},G=i.getOffsets(),ne=B(u,G,A,s,m,T,v),le=v(s[u].toFixed(T));if(ne.length){var ee=ne.reduce(function(te,oe,ge,pe){return te.length?r(r([],te,!0),[G[pe[ge]].x],!1):[G[pe[ge]].x]},[]);if(Math.min.apply(Math,ee)===G[u].x){var de=[];ne.forEach(function(te){de.push(s[te].toFixed(T))}),le=Array.from(new Set(de.sort(function(te,oe){return parseFloat(te)-parseFloat(oe)}))).map(v).join(m);var fe=Math.min.apply(Math,ee),he=Math.max.apply(Math,ee),_e=A[ne[ee.indexOf(he)]].getBoundingClientRect().width;L.left="".concat(Math.abs(fe-(he+_e))/2,"px"),L.transform="translate(-50%, 0)"}else L.visibility="hidden"}W(le),C(L)}},[i,s]),[z,P]};e.useThumbOverlap=R;function D(i,s,u,h){var m=i.getBoundingClientRect(),v=m.left,T=m.top,_=m.width,P=m.height;return $(h)?Math.abs(u-(T+P/2)):Math.abs(s-(v+_/2))}var j=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=j})(ue)),ue}var He;function xt(){if(He)return H;He=1;var e=H&&H.__extends||(function(){var E=function(y,d){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])},E(y,d)};return function(y,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");E(y,d);function t(){this.constructor=y}y.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}})(),r=H&&H.__createBinding||(Object.create?(function(E,y,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(y,d);(!a||("get"in a?!y.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return y[d]}}),Object.defineProperty(E,t,a)}):(function(E,y,d,t){t===void 0&&(t=d),E[t]=y[d]})),n=H&&H.__setModuleDefault||(Object.create?(function(E,y){Object.defineProperty(E,"default",{enumerable:!0,value:y})}):function(E,y){E.default=y}),o=H&&H.__importStar||function(E){if(E&&E.__esModule)return E;var y={};if(E!=null)for(var d in E)d!=="default"&&Object.prototype.hasOwnProperty.call(E,d)&&r(y,E,d);return n(y,E),y},p=H&&H.__spreadArray||function(E,y,d){if(d||arguments.length===2)for(var t=0,a=y.length,c;t<a;t++)(c||!(t in y))&&(c||(c=Array.prototype.slice.call(y,0,t)),c[t]=y[t]);return E.concat(c||Array.prototype.slice.call(y))};Object.defineProperty(H,"__esModule",{value:!0});var S=o(Ye()),l=Ze(),g=Ie(),F=["ArrowRight","ArrowUp","k","PageUp"],$=["ArrowLeft","ArrowDown","j","PageDown"],V=(function(E){e(y,E);function y(d){var t=E.call(this,d)||this;if(t.trackRef=S.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,c=a.direction,f=a.values,b=a.min,k=a.max,I=t.trackRef.current;if(!I)return console.warn("No track element found."),[];var O=I.getBoundingClientRect(),w=(0,l.getPaddingAndBorder)(I);return t.getThumbs().map(function(M,B){var R={x:0,y:0},D=M.getBoundingClientRect(),j=(0,l.getMargin)(M);switch(c){case g.Direction.Right:return R.x=(j.left+w.left)*-1,R.y=((D.height-O.height)/2+w.top)*-1,R.x+=O.width*(0,l.relativeValue)(f[B],b,k)-D.width/2,R;case g.Direction.Left:return R.x=(j.right+w.right)*-1,R.y=((D.height-O.height)/2+w.top)*-1,R.x+=O.width-O.width*(0,l.relativeValue)(f[B],b,k)-D.width/2,R;case g.Direction.Up:return R.x=((D.width-O.width)/2+j.left+w.left)*-1,R.y=-w.left,R.y+=O.height-O.height*(0,l.relativeValue)(f[B],b,k)-D.height/2,R;case g.Direction.Down:return R.x=((D.width-O.width)/2+j.left+w.left)*-1,R.y=-w.left,R.y+=O.height*(0,l.relativeValue)(f[B],b,k)-D.height/2,R;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(c){return c===a.target||c.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var c;if(!(a.button!==0||(0,l.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),a.clientX,a.clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var c;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var c=(0,l.isTouchEvent)(a);if(!(!c&&a.button!==0)){var f=t.getTargetIndex(a);f!==-1&&(c?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:f,thumbZIndexes:t.state.thumbZIndexes.map(function(b,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):b<=t.state.thumbZIndexes[f]?b:b-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var c=t.props,f=c.values,b=c.onChange,k=c.step,I=c.rtl,O=c.direction,w=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),B=I||O===g.Direction.Left||O===g.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+B*(a.key==="PageUp"?k*10:k),M)))):$.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((0,l.replaceAt)(f,M,t.normalizeValue(f[M]-B*(a.key==="PageDown"?k*10:k),M)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){w&&t.fireOnFinalChange()}):w&&t.fireOnFinalChange())},t.onKeyUp=function(a){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(a,c){var f=t.state,b=f.draggedThumbIndex,k=f.draggedTrackPos,I=t.props,O=I.direction,w=I.min,M=I.max,B=I.onChange,R=I.values,D=I.step,j=I.rtl;if(b===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),u=(0,l.isVertical)(O)?s.height:s.width;if(k[0]!==-1&&k[1]!==-1){var h=a-k[0],m=c-k[1],v=0;switch(O){case g.Direction.Right:case g.Direction.Left:v=h/u*(M-w);break;case g.Direction.Down:case g.Direction.Up:v=m/u*(M-w);break;default:(0,l.assertUnreachable)(O)}if(j&&(v*=-1),Math.abs(v)>=D/2){for(var T=0;T<t.thumbRefs.length;T++){if(R[T]===M&&Math.sign(v)===1||R[T]===w&&Math.sign(v)===-1)return;var _=R[T]+v;_>M?v=M-R[T]:_<w&&(v=w-R[T])}for(var P=R.slice(0),T=0;T<t.thumbRefs.length;T++)P=(0,l.replaceAt)(P,T,t.normalizeValue(R[T]+v,T));t.setState({draggedTrackPos:[a,c]}),B(P)}}else{var C=0;switch(O){case g.Direction.Right:C=(a-s.left)/u*(M-w)+w;break;case g.Direction.Left:C=(u-(a-s.left))/u*(M-w)+w;break;case g.Direction.Down:C=(c-s.top)/u*(M-w)+w;break;case g.Direction.Up:C=(u-(c-s.top))/u*(M-w)+w;break;default:(0,l.assertUnreachable)(O)}j&&(C=M+w-C),Math.abs(R[b]-C)>=D/2&&B((0,l.replaceAt)(R,b,t.normalizeValue(C,b)))}},t.normalizeValue=function(a,c){var f=t.props,b=f.min,k=f.max,I=f.step,O=f.allowOverlap,w=f.values;return(0,l.normalizeValue)(a,c,b,k,I,O,w)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,c=a.onFinalChange,f=a.values;c&&c(f)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=S.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),c=parseInt(a.width,10),f=parseInt(a.height,10),b=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),I=[],O=0;O<t.numOfMarks+1;O++){var w=9999,M=9999;if(t.markRefs[O].current){var B=t.markRefs[O].current.getBoundingClientRect();w=B.height,M=B.width}t.props.direction===g.Direction.Left||t.props.direction===g.Direction.Right?I.push([Math.round(c/t.numOfMarks*O+b-M/2),-Math.round((w-f)/2)]):I.push([Math.round(f/t.numOfMarks*O+k-w/2),-Math.round((M-c)/2)])}t.setState({markOffsets:I})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return S.createRef()}),t.updateMarkRefs(d),t}return y.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,c=t.min,f=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(b){return(0,l.checkBoundaries)(b,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(b){(0,l.isStepDivisible)(c,b,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},y.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,b=a.step,k=a.values,I=a.rtl;(d.max!==c||d.min!==f||d.step!==b)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),I),(d.max!==c||d.min!==f||d.step!==b||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(O){(0,l.isStepDivisible)(f,O,b)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},y.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},y.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,b=t.renderThumb,k=t.renderMark,I=k===void 0?function(){return null}:k,O=t.values,w=t.min,M=t.max,B=t.allowOverlap,R=t.disabled,D=this.state,j=D.draggedThumbIndex,i=D.thumbZIndexes,s=D.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:j>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":O.length===1&&!R?"pointer":"inherit"},onMouseDown:R?l.voidFn:this.onMouseDownTrack,onTouchStart:R?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:R,children:p(p([],s.map(function(u,h,m){return I({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(h),ref:d.markRefs[h]},index:h})}),!0),O.map(function(u,h){var m=d.state.draggedThumbIndex===h;return b({index:h,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[h],cursor:R?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:h,tabIndex:R?void 0:0,"aria-valuemax":B?M:O[h+1]||M,"aria-valuemin":B?w:O[h-1]||w,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[h],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:R?l.voidFn:d.onKeyDown,onKeyUp:R?l.voidFn:d.onKeyUp}})}),!0)})},y.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y})(S.Component);return H.default=V,H}var We;function It(){return We||(We=1,(function(e){var r=se&&se.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(xt());e.Range=n.default;var o=Ze();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var p=Ie();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return p.Direction}})})(se)),se}var Ge=It();function qe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function ve(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(n),!0).forEach(function(o){Ct(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ct(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var be=J("div",{position:"relative",width:"100%"});be.displayName="Root";be.displayName="Root";be.displayName="StyledRoot";var ye=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$disabled,S=e.$isDragged,l=r.sizing,g="inherit";return p?g="not-allowed":S?g="grabbing":o.length===1&&(g="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});ye.displayName="Track";ye.displayName="Track";ye.displayName="StyledTrack";var Te=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$min,S=e.$max,l=e.$disabled,g=r.colors,F=r.borders,$=r.direction,V=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,background:Ge.getTrackBackground({values:o,colors:o.length===1?[l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque]:[l?g.backgroundSecondary:g.borderOpaque,l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque],min:p||0,max:S||0,rtl:$==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});Te.displayName="InnerTrack";Te.displayName="InnerTrack";Te.displayName="StyledInnerTrack";var ke=J("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ke.displayName="Mark";ke.displayName="Mark";ke.displayName="StyledMark";var Oe=J("div",function(e){return ve(ve({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var we=J("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});we.displayName="TickBar";we.displayName="TickBar";we.displayName="StyledTickBar";var Re=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$thumbIndex,S=e.$disabled,l=o.length===2&&p===0,g=o.length===2&&p===1;return r.direction==="rtl"&&(g||l)&&(l=!l,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:S?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:S?"not-allowed":"inherit"}});Re.displayName="Thumb";Re.displayName="Thumb";Re.displayName="StyledThumb";var Se=J("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});Se.displayName="InnerThumb";Se.displayName="InnerThumb";Se.displayName="StyledInnerThumb";var Me=J("div",function(e){var r=e.$disabled,n=e.$theme;return ve(ve({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});Me.displayName="ThumbValue";Me.displayName="ThumbValue";Me.displayName="StyledThumbValue";function Ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function Dt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(n),!0).forEach(function(o){Pt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Pt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},X.apply(this,arguments)}function K(e,r){return jt(e)||Lt(e,r)||At(e,r)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
import{b1 as Ye,ac as J,r as x,bs as pt,ad as vt,o as Q,aL as mt,aM as bt,s as me,t as Ve,bi as yt,u as Tt,bt as kt,j as Z,W as Ot,l as wt,Q as Rt,T as St,P as Mt,bu as _t,bv as Ee}from"./index-CAfO5bZA.js";import{s as ze}from"./sprintf-DpPCfzXw.js";import{u as Et}from"./useBasicWidgetState-BRbplAp6.js";import"./FormClearHelper-D5uKQTmO.js";var se={},H={},ue={},ce={},Ne;function Ie(){if(Ne)return ce;Ne=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Direction=void 0;var e;return(function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"})(e||(ce.Direction=e={})),ce}var Ue;function Ze(){return Ue||(Ue=1,(function(e){var r=ue&&ue.__spreadArray||function(i,s,u){if(u||arguments.length===2)for(var h=0,m=s.length,v;h<m;h++)(v||!(h in s))&&(v||(v=Array.prototype.slice.call(s,0,h)),v[h]=s[h]);return i.concat(v||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ye(),o=Ie(),p=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=p;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function l(i,s,u){var h=(s-i)/u,m=8,v=Number(h.toFixed(m));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function g(i,s,u,h,m,v,T){var _=1e11;if(i=Math.round(i*_)/_,!v){var P=T[s-1],C=T[s+1];if(P&&P>i)return P;if(C&&C<i)return C}if(i>h)return h;if(i<u)return u;var U=Math.floor(i*_-u*_)%Math.floor(m*_),z=Math.floor(i*_-Math.abs(U)),W=U===0?i:z/_,A=Math.abs(U/_)<m/2?W:W+m,L=(0,e.getStepDecimals)(m);return parseFloat(A.toFixed(L))}e.normalizeValue=g;function F(i,s,u){return(i-s)/(u-s)}e.relativeValue=F;function $(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=$;function V(i,s,u){if(s>=u)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(u,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=V;function E(i,s,u){return i<s?s:i>u?u:i}e.checkValuesAgainstBoundaries=E;function y(i){if(!(i.length<2)&&!i.slice(1).every(function(s,u){return i[u]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,u){var h=u?-1:1;i.forEach(function(m,v){return f(m,h*s[v].x,s[v].y)})}e.translateThumbs=a;function c(i,s,u,h){for(var m=0,v=D(i[0],s,u,h),T=1;T<i.length;T++){var _=D(i[T],s,u,h);_<v&&(v=_,m=T)}return m}e.getClosestThumbIndex=c;function f(i,s,u){i.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}e.translate=f;var b=function(i){var s=[],u=null,h=function(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];s=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,s)}))};return h};e.schd=b;function k(i,s,u){var h=i.slice(0);return h[s]=u,h}e.replaceAt=k;function I(i){var s=i.values,u=i.colors,h=i.min,m=i.max,v=i.direction,T=v===void 0?o.Direction.Right:v,_=i.rtl,P=_===void 0?!1:_;P&&T===o.Direction.Right?T=o.Direction.Left:P&&o.Direction.Left&&(T=o.Direction.Right);var C=s.slice(0).sort(function(z,W){return z-W}).map(function(z){return(z-h)/(m-h)*100}),U=C.reduce(function(z,W,A){return"".concat(z,", ").concat(u[A]," ").concat(W,"%, ").concat(u[A+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(T,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=I;function O(){}e.voidFn=O;function w(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=w;var M=function(i,s,u,h,m){m===void 0&&(m=function(T){return T});var v=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(T,_){var P=Math.ceil(_.getBoundingClientRect().width);if(_.innerText&&_.innerText.includes(u)&&_.childElementCount===0){var C=_.cloneNode(!0);C.innerHTML=m(s.toFixed(h)),C.style.visibility="hidden",document.body.appendChild(C),P=Math.ceil(C.getBoundingClientRect().width),document.body.removeChild(C)}return P>T?P:T},i.getBoundingClientRect().width));return v},B=function(i,s,u,h,m,v,T){T===void 0&&(T=function(C){return C});var _=[],P=function(C){var U=M(u[C],h[C],m,v,T),z=s[C].x;s.forEach(function(W,A){var L=W.x,G=M(u[A],h[A],m,v,T);C!==A&&(z>=L&&z<=L+G||z+U>=L&&z+U<=L+G)&&(_.includes(A)||(_.push(C),_.push(A),_=r(r([],_,!0),[C,A],!1),P(A)))})};return P(i),Array.from(new Set(_.sort()))},R=function(i,s,u,h,m,v){h===void 0&&(h=.1),m===void 0&&(m=" - "),v===void 0&&(v=function(A){return A});var T=(0,e.getStepDecimals)(h),_=(0,n.useState)({}),P=_[0],C=_[1],U=(0,n.useState)(v(s[u].toFixed(T))),z=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var A=i.getThumbs();if(A.length<1)return;var L={},G=i.getOffsets(),ne=B(u,G,A,s,m,T,v),le=v(s[u].toFixed(T));if(ne.length){var ee=ne.reduce(function(te,oe,ge,pe){return te.length?r(r([],te,!0),[G[pe[ge]].x],!1):[G[pe[ge]].x]},[]);if(Math.min.apply(Math,ee)===G[u].x){var de=[];ne.forEach(function(te){de.push(s[te].toFixed(T))}),le=Array.from(new Set(de.sort(function(te,oe){return parseFloat(te)-parseFloat(oe)}))).map(v).join(m);var fe=Math.min.apply(Math,ee),he=Math.max.apply(Math,ee),_e=A[ne[ee.indexOf(he)]].getBoundingClientRect().width;L.left="".concat(Math.abs(fe-(he+_e))/2,"px"),L.transform="translate(-50%, 0)"}else L.visibility="hidden"}W(le),C(L)}},[i,s]),[z,P]};e.useThumbOverlap=R;function D(i,s,u,h){var m=i.getBoundingClientRect(),v=m.left,T=m.top,_=m.width,P=m.height;return $(h)?Math.abs(u-(T+P/2)):Math.abs(s-(v+_/2))}var j=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=j})(ue)),ue}var He;function xt(){if(He)return H;He=1;var e=H&&H.__extends||(function(){var E=function(y,d){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])},E(y,d)};return function(y,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");E(y,d);function t(){this.constructor=y}y.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}})(),r=H&&H.__createBinding||(Object.create?(function(E,y,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(y,d);(!a||("get"in a?!y.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return y[d]}}),Object.defineProperty(E,t,a)}):(function(E,y,d,t){t===void 0&&(t=d),E[t]=y[d]})),n=H&&H.__setModuleDefault||(Object.create?(function(E,y){Object.defineProperty(E,"default",{enumerable:!0,value:y})}):function(E,y){E.default=y}),o=H&&H.__importStar||function(E){if(E&&E.__esModule)return E;var y={};if(E!=null)for(var d in E)d!=="default"&&Object.prototype.hasOwnProperty.call(E,d)&&r(y,E,d);return n(y,E),y},p=H&&H.__spreadArray||function(E,y,d){if(d||arguments.length===2)for(var t=0,a=y.length,c;t<a;t++)(c||!(t in y))&&(c||(c=Array.prototype.slice.call(y,0,t)),c[t]=y[t]);return E.concat(c||Array.prototype.slice.call(y))};Object.defineProperty(H,"__esModule",{value:!0});var S=o(Ye()),l=Ze(),g=Ie(),F=["ArrowRight","ArrowUp","k","PageUp"],$=["ArrowLeft","ArrowDown","j","PageDown"],V=(function(E){e(y,E);function y(d){var t=E.call(this,d)||this;if(t.trackRef=S.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,c=a.direction,f=a.values,b=a.min,k=a.max,I=t.trackRef.current;if(!I)return console.warn("No track element found."),[];var O=I.getBoundingClientRect(),w=(0,l.getPaddingAndBorder)(I);return t.getThumbs().map(function(M,B){var R={x:0,y:0},D=M.getBoundingClientRect(),j=(0,l.getMargin)(M);switch(c){case g.Direction.Right:return R.x=(j.left+w.left)*-1,R.y=((D.height-O.height)/2+w.top)*-1,R.x+=O.width*(0,l.relativeValue)(f[B],b,k)-D.width/2,R;case g.Direction.Left:return R.x=(j.right+w.right)*-1,R.y=((D.height-O.height)/2+w.top)*-1,R.x+=O.width-O.width*(0,l.relativeValue)(f[B],b,k)-D.width/2,R;case g.Direction.Up:return R.x=((D.width-O.width)/2+j.left+w.left)*-1,R.y=-w.left,R.y+=O.height-O.height*(0,l.relativeValue)(f[B],b,k)-D.height/2,R;case g.Direction.Down:return R.x=((D.width-O.width)/2+j.left+w.left)*-1,R.y=-w.left,R.y+=O.height*(0,l.relativeValue)(f[B],b,k)-D.height/2,R;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(c){return c===a.target||c.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var c;if(!(a.button!==0||(0,l.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),a.clientX,a.clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var c;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var c=(0,l.isTouchEvent)(a);if(!(!c&&a.button!==0)){var f=t.getTargetIndex(a);f!==-1&&(c?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:f,thumbZIndexes:t.state.thumbZIndexes.map(function(b,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):b<=t.state.thumbZIndexes[f]?b:b-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var c=t.props,f=c.values,b=c.onChange,k=c.step,I=c.rtl,O=c.direction,w=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),B=I||O===g.Direction.Left||O===g.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+B*(a.key==="PageUp"?k*10:k),M)))):$.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((0,l.replaceAt)(f,M,t.normalizeValue(f[M]-B*(a.key==="PageDown"?k*10:k),M)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){w&&t.fireOnFinalChange()}):w&&t.fireOnFinalChange())},t.onKeyUp=function(a){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(a,c){var f=t.state,b=f.draggedThumbIndex,k=f.draggedTrackPos,I=t.props,O=I.direction,w=I.min,M=I.max,B=I.onChange,R=I.values,D=I.step,j=I.rtl;if(b===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),u=(0,l.isVertical)(O)?s.height:s.width;if(k[0]!==-1&&k[1]!==-1){var h=a-k[0],m=c-k[1],v=0;switch(O){case g.Direction.Right:case g.Direction.Left:v=h/u*(M-w);break;case g.Direction.Down:case g.Direction.Up:v=m/u*(M-w);break;default:(0,l.assertUnreachable)(O)}if(j&&(v*=-1),Math.abs(v)>=D/2){for(var T=0;T<t.thumbRefs.length;T++){if(R[T]===M&&Math.sign(v)===1||R[T]===w&&Math.sign(v)===-1)return;var _=R[T]+v;_>M?v=M-R[T]:_<w&&(v=w-R[T])}for(var P=R.slice(0),T=0;T<t.thumbRefs.length;T++)P=(0,l.replaceAt)(P,T,t.normalizeValue(R[T]+v,T));t.setState({draggedTrackPos:[a,c]}),B(P)}}else{var C=0;switch(O){case g.Direction.Right:C=(a-s.left)/u*(M-w)+w;break;case g.Direction.Left:C=(u-(a-s.left))/u*(M-w)+w;break;case g.Direction.Down:C=(c-s.top)/u*(M-w)+w;break;case g.Direction.Up:C=(u-(c-s.top))/u*(M-w)+w;break;default:(0,l.assertUnreachable)(O)}j&&(C=M+w-C),Math.abs(R[b]-C)>=D/2&&B((0,l.replaceAt)(R,b,t.normalizeValue(C,b)))}},t.normalizeValue=function(a,c){var f=t.props,b=f.min,k=f.max,I=f.step,O=f.allowOverlap,w=f.values;return(0,l.normalizeValue)(a,c,b,k,I,O,w)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,c=a.onFinalChange,f=a.values;c&&c(f)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=S.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),c=parseInt(a.width,10),f=parseInt(a.height,10),b=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),I=[],O=0;O<t.numOfMarks+1;O++){var w=9999,M=9999;if(t.markRefs[O].current){var B=t.markRefs[O].current.getBoundingClientRect();w=B.height,M=B.width}t.props.direction===g.Direction.Left||t.props.direction===g.Direction.Right?I.push([Math.round(c/t.numOfMarks*O+b-M/2),-Math.round((w-f)/2)]):I.push([Math.round(f/t.numOfMarks*O+k-w/2),-Math.round((M-c)/2)])}t.setState({markOffsets:I})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return S.createRef()}),t.updateMarkRefs(d),t}return y.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,c=t.min,f=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(b){return(0,l.checkBoundaries)(b,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(b){(0,l.isStepDivisible)(c,b,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},y.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,b=a.step,k=a.values,I=a.rtl;(d.max!==c||d.min!==f||d.step!==b)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),I),(d.max!==c||d.min!==f||d.step!==b||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(O){(0,l.isStepDivisible)(f,O,b)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},y.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},y.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,b=t.renderThumb,k=t.renderMark,I=k===void 0?function(){return null}:k,O=t.values,w=t.min,M=t.max,B=t.allowOverlap,R=t.disabled,D=this.state,j=D.draggedThumbIndex,i=D.thumbZIndexes,s=D.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:j>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":O.length===1&&!R?"pointer":"inherit"},onMouseDown:R?l.voidFn:this.onMouseDownTrack,onTouchStart:R?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:R,children:p(p([],s.map(function(u,h,m){return I({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(h),ref:d.markRefs[h]},index:h})}),!0),O.map(function(u,h){var m=d.state.draggedThumbIndex===h;return b({index:h,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[h],cursor:R?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:h,tabIndex:R?void 0:0,"aria-valuemax":B?M:O[h+1]||M,"aria-valuemin":B?w:O[h-1]||w,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[h],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:R?l.voidFn:d.onKeyDown,onKeyUp:R?l.voidFn:d.onKeyUp}})}),!0)})},y.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y})(S.Component);return H.default=V,H}var We;function It(){return We||(We=1,(function(e){var r=se&&se.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(xt());e.Range=n.default;var o=Ze();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var p=Ie();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return p.Direction}})})(se)),se}var Ge=It();function qe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function ve(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(n),!0).forEach(function(o){Ct(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ct(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var be=J("div",{position:"relative",width:"100%"});be.displayName="Root";be.displayName="Root";be.displayName="StyledRoot";var ye=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$disabled,S=e.$isDragged,l=r.sizing,g="inherit";return p?g="not-allowed":S?g="grabbing":o.length===1&&(g="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});ye.displayName="Track";ye.displayName="Track";ye.displayName="StyledTrack";var Te=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$min,S=e.$max,l=e.$disabled,g=r.colors,F=r.borders,$=r.direction,V=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,background:Ge.getTrackBackground({values:o,colors:o.length===1?[l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque]:[l?g.backgroundSecondary:g.borderOpaque,l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque],min:p||0,max:S||0,rtl:$==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});Te.displayName="InnerTrack";Te.displayName="InnerTrack";Te.displayName="StyledInnerTrack";var ke=J("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ke.displayName="Mark";ke.displayName="Mark";ke.displayName="StyledMark";var Oe=J("div",function(e){return ve(ve({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var we=J("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});we.displayName="TickBar";we.displayName="TickBar";we.displayName="StyledTickBar";var Re=J("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$thumbIndex,S=e.$disabled,l=o.length===2&&p===0,g=o.length===2&&p===1;return r.direction==="rtl"&&(g||l)&&(l=!l,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:S?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:S?"not-allowed":"inherit"}});Re.displayName="Thumb";Re.displayName="Thumb";Re.displayName="StyledThumb";var Se=J("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});Se.displayName="InnerThumb";Se.displayName="InnerThumb";Se.displayName="StyledInnerThumb";var Me=J("div",function(e){var r=e.$disabled,n=e.$theme;return ve(ve({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});Me.displayName="ThumbValue";Me.displayName="ThumbValue";Me.displayName="StyledThumbValue";function Ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function Dt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(n),!0).forEach(function(o){Pt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Pt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},X.apply(this,arguments)}function K(e,r){return jt(e)||Lt(e,r)||At(e,r)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(e,r){if(e){if(typeof e=="string")return Xe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xe(e,r)}}function Xe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Lt(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],p=!0,S=!1,l,g;try{for(n=n.call(e);!(p=(l=n.next()).done)&&(o.push(l.value),!(r&&o.length===r));p=!0);}catch(F){S=!0,g=F}finally{try{!p&&n.return!=null&&n.return()}finally{if(S)throw g}}return o}}function jt(e){if(Array.isArray(e))return e}var Ft=function(r){if(r.length>2||r.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return r};function $t(e){var r=e.overrides,n=r===void 0?{}:r,o=e.disabled,p=o===void 0?!1:o,S=e.marks,l=S===void 0?!1:S,g=e.onChange,F=g===void 0?function(){}:g,$=e.onFinalChange,V=$===void 0?function(){}:$,E=e.min,y=E===void 0?0:E,d=e.max,t=d===void 0?100:d,a=e.step,c=a===void 0?1:a,f=e.persistentThumb,b=f===void 0?!1:f,k=e.valueToLabel,I=k===void 0?function(Y){return Y}:k,O=e.value,w=x.useContext(pt),M=x.useState(!1),B=K(M,2),R=B[0],D=B[1],j=x.useState(!1),i=K(j,2),s=i[0],u=i[1],h=x.useState(!1),m=K(h,2),v=m[0],T=m[1],_=x.useState(-1),P=K(_,2),C=P[0],U=P[1],z=x.useCallback(function(Y){vt(Y)&&T(!0);var N=Y.target.parentNode.firstChild===Y.target?0:1;U(N)},[]),W=x.useCallback(function(Y){v!==!1&&T(!1),U(-1)},[]),A=Ft(O),L={$disabled:p,$step:c,$min:y,$max:t,$marks:l,$value:A,$isFocusVisible:v},G=Q(n.Root,be),ne=K(G,2),le=ne[0],ee=ne[1],de=Q(n.Track,ye),fe=K(de,2),he=fe[0],_e=fe[1],te=Q(n.InnerTrack,Te),oe=K(te,2),ge=oe[0],pe=oe[1],Qe=Q(n.Thumb,Re),Ce=K(Qe,2),Je=Ce[0],et=Ce[1],tt=Q(n.InnerThumb,Se),De=K(tt,2),rt=De[0],nt=De[1],at=Q(n.ThumbValue,Me),Pe=K(at,2),it=Pe[0],ot=Pe[1],st=Q(n.Tick,Oe),Be=K(st,2),Ae=Be[0],Le=Be[1],ut=Q(n.TickBar,we),je=K(ut,2),ct=je[0],lt=je[1],dt=Q(n.Mark,ke),Fe=K(dt,2),ft=Fe[0],ht=Fe[1];return x.createElement(le,X({"data-baseweb":"slider"},L,ee,{onFocus:bt(ee,z),onBlur:mt(ee,W)}),x.createElement(Ge.Range,X({step:c,min:y,max:t,values:A,disabled:p,onChange:function(N){return F({value:N})},onFinalChange:function(N){return V({value:N})},rtl:w.direction==="rtl",renderTrack:function(N){var re=N.props,q=N.children,ae=N.isDragged;return x.createElement(he,X({onMouseDown:re.onMouseDown,onTouchStart:re.onTouchStart,$isDragged:ae},L,_e),x.createElement(ge,X({$isDragged:ae,ref:re.ref},L,pe),q))},renderThumb:function(N){var re=N.props,q=N.index,ae=N.isDragged,$e=b||(!!q&&s||!q&&R||ae)&&!p;return x.createElement(Je,X({},re,{onMouseEnter:function(){q===0?D(!0):u(!0)},onMouseLeave:function(){q===0?D(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:Dt({},re.style)},L,et,{$isFocusVisible:v&&C===q}),$e&&x.createElement(it,X({$thumbIndex:q,$isDragged:ae},L,ot),I(A[q])),$e&&x.createElement(rt,X({$thumbIndex:q,$isDragged:ae},L,nt)))}},l?{renderMark:function(N){var re=N.props,q=N.index;return x.createElement(ft,X({$markIndex:q},re,L,ht))}}:{})),x.createElement(ct,X({},L,lt),x.createElement(Ae,X({},L,Le),I(y)),x.createElement(Ae,X({},L,Le),I(t))))}const Vt=me("div",{target:"ew7r33m3"})({name:"bjn8wh",styles:"position:relative"}),zt=me("div",{target:"ew7r33m2"})(({disabled:e,theme:r,isDragged:n})=>({alignItems:"center",backgroundColor:e?r.colors.gray60:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,boxShadow:n?`0 0 0 0.2rem ${Ve(r.colors.primary,.5)}`:"none",":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${Ve(r.colors.primary,.5)}`}}),""),Nt=me("div",{target:"ew7r33m1"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.bodyFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray60:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"}),""),Ut=me("div",{target:"ew7r33m0"})(({theme:e,isHovered:r,isDisabled:n})=>({position:"absolute",left:0,right:0,top:"100%",display:"flex",justifyContent:"space-between",pointerEvents:"none",marginTop:`-${e.spacing.md}`,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,fontWeight:e.fontWeights.normal,color:n?e.colors.fadedText40:e.colors.fadedText60,opacity:r?1:0,transition:"opacity 70ms ease-in-out"}),"");function Ht({minLabel:e,maxLabel:r,isHovered:n,isDisabled:o}){return Z.jsxs(Ut,{"data-testid":"stSliderTickBar",isHovered:n,isDisabled:o,children:[Z.jsx("span",{children:e}),Z.jsx("span",{children:r})]})}function Wt({disabled:e,element:r,widgetMgr:n,fragmentId:o}){const[p,S]=Et({getStateFromWidgetMgr:qt,getDefaultStateFromProto:Kt,getCurrStateFromProto:Xt,updateWidgetMgrState:Yt,element:r,widgetMgr:n,fragmentId:o}),[l,g]=x.useState(p),[F,$]=x.useState(!1),[V,E]=x.useState(!1),y=x.useCallback(()=>$(!0),[]),d=x.useCallback(()=>$(!1),[]),t=x.useRef(null),[a]=x.useState([]),[c]=x.useState([]),f=Tt(),b=l.map(D=>xe(D,r)),k=xe(r.min,r),I=xe(r.max,r),O=r.label;x.useEffect(()=>{g(p)},[p]);const w=x.useCallback(({value:D})=>{S({value:D,fromUi:!0}),E(!1)},[S]),M=x.useCallback(({value:D})=>{g(D),E(!0)},[]),B=x.useCallback(x.forwardRef(function(j,i){const{$thumbIndex:s}=j,u=s||0;a[u]=i,c[u]||=x.createRef();const h=kt(j,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),m=b[u];return Z.jsx(zt,{...h,disabled:j.$disabled===!0,isDragged:j.$isDragged===!0,ref:a[u],"aria-valuetext":m,"aria-label":O,children:Z.jsx(Nt,{"data-testid":"stSliderThumbValue",disabled:j.$disabled===!0,ref:c[u],children:m})})}),[]);x.useEffect(()=>{c.map((h,m)=>{h.current&&(h.current.innerText=b[m])}),a.map((h,m)=>{h.current&&h.current.setAttribute("aria-valuetext",b[m])});const D=t.current??null,j=a[0].current,i=a[1]?.current,s=c[0].current,u=c[1]?.current;Qt(D,j,i,s,u)});const R=x.useCallback(({$disabled:D})=>({height:f.spacing.twoXS,...D?{background:f.colors.darkenedBgMix25}:{}}),[f.colors.darkenedBgMix25,f.spacing.twoXS]);return Z.jsxs(Vt,{ref:t,className:"stSlider","data-testid":"stSlider",onMouseEnter:y,onMouseLeave:d,children:[Z.jsx(Ot,{label:r.label,disabled:e,labelVisibility:wt(r.labelVisibility?.value),children:r.help&&Z.jsx(Rt,{children:Z.jsx(St,{content:r.help,placement:Mt.TOP_RIGHT})})}),Z.jsx($t,{min:r.min,max:r.max,step:r.step,value:Gt(l,r),onChange:M,onFinalChange:w,disabled:e,overrides:{Thumb:B,Track:{style:{backgroundColor:"none !important",paddingLeft:f.spacing.none,paddingRight:f.spacing.none,paddingTop:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`,paddingBottom:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`}},InnerTrack:{style:R},TickBar:{component:Ht,props:{minLabel:k,maxLabel:I,isHovered:F||V,isDisabled:e}}}})]})}function qt(e,r){return e.getDoubleArrayValue(r)}function Kt(e){return e.default}function Xt(e){return e.value}function Yt(e,r,n,o){r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},o)}function Zt(e){const{dataType:r}=e;return r===Ee.DataType.DATETIME||r===Ee.DataType.DATE||r===Ee.DataType.TIME}function xe(e,r){const{format:n,options:o}=r;return Zt(r)?_t.utc(e/1e3).format(n):o.length>0?ze.sprintf(n,o[e]):ze.sprintf(n,e)}function Gt(e,r){const{min:n,max:o}=r;let p=e[0],S=e.length>1?e[1]:e[0];return p>S&&(p=S),p<n&&(p=n),p>o&&(p=o),S<n&&(S=n),S>o&&(S=o),e.length>1?[p,S]:[p]}function Qt(e,r,n,o,p){!e||!r||!o||(ie(e,r,o),n&&p&&(ie(e,n,p),Jt(e,r,n,o,p)))}function ie(e,r,n){const o=e.getBoundingClientRect(),p=r.getBoundingClientRect(),S=n.getBoundingClientRect(),l=p.left+p.width/2,g=l-S.width/2<o.left,F=l+S.width/2>o.right;n.style.left=g?"0":"",n.style.right=F?"0":""}function Jt(e,r,n,o,p){const l=e.getBoundingClientRect(),g=r.getBoundingClientRect(),F=n.getBoundingClientRect(),$=o.getBoundingClientRect(),V=p.getBoundingClientRect(),E=l.left+l.width/2,y=g.left+g.width/2,d=F.left+F.width/2,t=y-$.width/2>=l.left,a=d+V.width/2<=l.right,c=g.left-$.width>=l.left,f=F.right+V.width<=l.right,b=t?$.width/2:$.width,k=a?V.width/2:V.width,I=y+b;if(d-k-I>24){ie(e,r,o),ie(e,n,p);return}if(c&&f){o.style.left="",o.style.right=`${Math.round(g.width)}px`,p.style.left=`${Math.round(F.width)}px`,p.style.right="";return}y<E?(ie(e,r,o),p.style.left=`${Math.round(y+b+24-d)}px`,p.style.right=""):(ie(e,n,p),o.style.left="",o.style.right=`${-Math.round(d-k-24-y)}px`)}const ar=yt(x.memo(Wt));export{ar as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as L,r as i,v as N,I as U,w as O,V as R,j as p,x as w}from"./index-
|
|
1
|
+
import{s as L,r as i,v as N,I as U,w as O,V as R,j as p,x as w}from"./index-CAfO5bZA.js";const x=L("iframe",{target:"evvcert0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"}),""),A=w.getLogger("Video"),j={width:"100%"};function P({element:r,endpoints:o,elementMgr:f}){const n=i.useRef(null),{type:v,url:g,startTime:a,subtitles:y,endTime:s,loop:d,autoplay:m,muted:E}=r,c=N(g),l=U(y);let V=O(c);const b=i.useMemo(()=>{if(!r.id)return!0;const e=f.getElementState(r.id,"preventAutoplay");return e||f.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,f]),S=i.useMemo(()=>JSON.stringify(l?l.map(e=>o.buildMediaURL(`${e.url}`)):[]),[l,o]);i.useEffect(()=>{const e=JSON.parse(S);e.length!==0&&e.forEach(t=>{o.checkSourceUrlResponse(t,"Video Subtitle")})},[S,o]),i.useEffect(()=>{n.current&&(n.current.currentTime=a)},[a]),i.useEffect(()=>{const e=n.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),i.useEffect(()=>{const e=n.current;if(!e)return;let t=!1;const u=()=>{s>0&&e.currentTime>=s&&(d?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return s>0&&e.addEventListener("timeupdate",u),()=>{e&&s>0&&e.removeEventListener("timeupdate",u)}},[s,d,a]),i.useEffect(()=>{const e=n.current;if(!e)return;const t=()=>{d&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[d,a]);const h=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),s&&!isNaN(s)&&t.searchParams.append("end",s.toString()),d){t.searchParams.append("loop","1");const u=t.pathname.split("/").pop();u&&t.searchParams.append("playlist",u)}return m&&t.searchParams.append("autoplay","1"),E&&t.searchParams.append("mute","1"),t.toString()};if(v===R.Type.YOUTUBE_IFRAME)return p.jsx(x,{className:"stVideo","data-testid":"stVideo",title:c,src:h(c),allow:"autoplay; encrypted-media",allowFullScreen:!0});const T=e=>{const t=e.currentTarget.src;A.error(`Client Error: Video source error - ${t}`),o.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return p.jsx("video",{className:"stVideo","data-testid":"stVideo",ref:n,controls:!0,muted:E,autoPlay:m&&!b,src:o.buildMediaURL(c),style:j,crossOrigin:V,onError:T,children:l?.map((e,t)=>p.jsx("track",{kind:"captions",src:o.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const I=i.memo(P);export{I 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-TcDrXcNe.js";import{T as pe,a as xt}from"./Toolbar-B9tKdtfU.js";import{u as fe,F as me}from"./FormClearHelper-DzT4m6x-.js";import{c as ge}from"./createDownloadLinkElement-ZaXNnPK4.js";import{u as ve}from"./Hooks-CWxcUAjO.js";import{F as be,D as ye}from"./FileDownload.esm-Chli17S8.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-CAfO5bZA.js";import{T as pe,a as xt}from"./Toolbar-D8UqfEZK.js";import{u as fe,F as me}from"./FormClearHelper-D5uKQTmO.js";import{c as ge}from"./createDownloadLinkElement-ZaXNnPK4.js";import{u as ve}from"./Hooks-UOkK2jWB.js";import{F as be,D as ye}from"./FileDownload.esm-1LbRaFsH.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,E as q,_ as M,s as D,aD as x,k as h,n as Q,x as pe,u as fe,a4 as me,a5 as be,aE as _,j as i,W as ge,l as he,Q as ye,T as Ie,P as xe,y as Te,an as X}from"./index-
|
|
1
|
+
import{r,E as q,_ as M,s as D,aD as x,k as h,n as Q,x as pe,u as fe,a4 as me,a5 as be,aE as _,j as i,W as ge,l as he,Q as ye,T as Ie,P as xe,y as Te,an as X}from"./index-CAfO5bZA.js";import{u as Ce}from"./uniqueId-CVivDO_N.js";import{I as we}from"./InputInstructions-CpX2tVr2.js";import{u as Se}from"./FormClearHelper-D5uKQTmO.js";import{s as ve}from"./sprintf-DpPCfzXw.js";import{I as Ve}from"./input-ByEjrb2a.js";import"./base-input-EmJVkDar.js";var J=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,M({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M0 3v2h8V3H0z"}))});J.displayName="Minus";var Y=r.forwardRef(function(e,t){var a={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(q,M({iconAttrs:a,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),r.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const ke=D("div",{target:"e116k4er3"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor??e.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}),""),Ee=D("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),G=D("button",{target:"e116k4er1"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}),""),De=D("div",{target:"e116k4er0"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`}),""),Re=pe.getLogger("NumberInput");function Ne(e){return h(e)||e===""?void 0:e}const E=({value:e,format:t,step:a,dataType:m})=>{if(h(e))return null;let o=Ne(t);if(h(o)&&Q(a)){const l=a.toString();m===x.DataType.FLOAT&&a!==0&&l.includes(".")&&(o=`%0.${l.split(".")[1].length}f`)}if(h(o))return e.toString();try{return ve.sprintf(o,e)}catch(l){return Re.warn(`Error in sprintf(${o}, ${e}): ${l}`),String(e)}},ze=(e,t,a)=>h(e)?!1:e-t>=a,Fe=(e,t,a)=>h(e)?!1:e+t<=a,je=e=>(e.element.dataType===x.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,K=({step:e,dataType:t})=>e||(t===x.DataType.INT?1:.01),We=({disabled:e,element:t,widgetMgr:a,fragmentId:m})=>{const o=fe(),{dataType:l,id:S,formId:f,default:j,format:b,icon:R,min:y,max:I}=t,{width:W,elementRef:Z}=me(),[s,ee]=r.useState(()=>K(t)),L=je({element:t,widgetMgr:a}),[g,T]=r.useState(!1),[c,C]=r.useState(L),[B,P]=r.useState(!1),v=r.useRef(null),U=r.useRef(Ce("number_input_")),[H,w]=r.useState(()=>E({value:L,dataType:l,format:b,step:s})),V=ze(c,s,y),k=Fe(c,s,I),A=be({formId:f}),te=A?a.allowFormEnterToSubmit(f):g,oe=B&&W>o.breakpoints.hideWidgetDetails;r.useEffect(()=>{ee(K({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]),r.useEffect(()=>{g||w(E({value:c,dataType:l,format:b,step:s}))},[l,b,s]);const d=r.useCallback(({value:n,source:u})=>{if(Q(n)&&(y>n||n>I))v.current?.reportValidity();else{const p=n??j??null;switch(l){case x.DataType.INT:a.setIntValue({id:S,formId:f},p,u,m);break;case x.DataType.FLOAT:a.setDoubleValue({id:S,formId:f},p,u,m);break;default:throw new Error("Invalid data type")}T(!1),C(p),w(E({value:p,dataType:l,format:b,step:s}))}},[y,I,v,a,m,s,l,S,f,j,b]),re=r.useCallback(()=>{g&&d({value:c,source:{fromUi:!0}}),P(!1)},[g,c,d]),ne=r.useCallback(()=>{P(!0)},[]),O=r.useCallback(()=>{const{value:n}=t;t.setValue=!1,C(n??null),w(E({value:n??null,dataType:l,format:b,step:s})),d({value:n??null,source:{fromUi:!1}})},[t,s,d,l,b]);r.useEffect(()=>{t.setValue?O():d({value:c,source:{fromUi:!1}});const n=v.current;if(n){const u=p=>{p.preventDefault()};return n.addEventListener("wheel",u),()=>{n.removeEventListener("wheel",u)}}},[]),t.setValue&&O();const N=h(t.default)&&!e,ae=r.useCallback(()=>{const n=t.default??null;C(n),d({value:n,source:{fromUi:!0}})},[t]);Se({element:t,widgetMgr:a,onFormCleared:ae});const se=n=>{const{value:u}=n.target;if(u==="")T(!0),C(null),w(null);else{let p;t.dataType===x.DataType.INT?p=parseInt(u,10):p=parseFloat(u),T(!0),C(p),w(u)}},z=r.useCallback(()=>{k&&(T(!0),d({value:(c??y)+s,source:{fromUi:!0}}))},[c,y,s,k]),F=r.useCallback(()=>{V&&(T(!0),d({value:(c??I)-s,source:{fromUi:!0}}))},[c,I,s,V]),ie=r.useCallback(n=>{const{key:u}=n;switch(u){case"ArrowUp":n.preventDefault(),z();break;case"ArrowDown":n.preventDefault(),F();break}},[z,F]),le=r.useCallback(n=>{n.key==="Enter"&&(g&&d({value:c,source:{fromUi:!0}}),a.allowFormEnterToSubmit(f)&&a.submitForm(f,m))},[g,c,d,a,f,m]),$=R?.startsWith(":material"),ce=$?"lg":"base",ue=_(o.iconSizes.lg)+2*_(o.spacing.twoXS),de=R?o.breakpoints.hideNumberInputControls+ue:o.breakpoints.hideNumberInputControls;return i.jsxs("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[i.jsx(ge,{label:t.label,disabled:e,labelVisibility:he(t.labelVisibility?.value),htmlFor:U.current,children:t.help&&i.jsx(ye,{children:i.jsx(Ie,{content:t.help,placement:xe.TOP_RIGHT})})}),i.jsxs(ke,{className:B?"focused":"","data-testid":"stNumberInputContainer",children:[i.jsx(Ve,{type:"number",inputRef:v,value:H??"",placeholder:t.placeholder,onBlur:re,onFocus:ne,onChange:se,onKeyPress:le,onKeyDown:ie,clearable:N,clearOnEscape:N,disabled:e,"aria-label":t.label,startEnhancer:t.icon&&i.jsx(Te,{"data-testid":"stNumberInputIcon",iconValue:t.icon,size:ce}),id:U.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:o.colors.grayTextColor,padding:o.spacing.threeXS,height:o.sizes.clearIconSize,width:o.sizes.clearIconSize,":hover":{fill:o.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:y,max:I,type:"number",inputMode:""},style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,"::placeholder":{color:o.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:R?o.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:o.iconSizes.lg,color:$?o.colors.fadedText60:"inherit"}}}}),W>de&&i.jsxs(Ee,{children:[i.jsx(G,{"data-testid":"stNumberInputStepDown",onClick:F,disabled:!V||e,tabIndex:-1,children:i.jsx(X,{content:J,size:"xs",color:V?"inherit":o.colors.fadedText40})}),i.jsx(G,{"data-testid":"stNumberInputStepUp",onClick:z,disabled:!k||e,tabIndex:-1,children:i.jsx(X,{content:Y,size:"xs",color:k?"inherit":o.colors.fadedText40})})]})]}),oe&&i.jsx(De,{clearable:N,children:i.jsx(we,{dirty:g,value:H??"",inForm:A,allowEnterToSubmit:te})})]})},$e=r.memo(We);export{$e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ac as q,o as J,r as s,au as Q,u as Y,av as ee,aw as l,j as g,ax as te,W as re,l as ne,g as oe,T as ie,P as ae,ay as ue,c as le,B as P,d as U,D as se}from"./index-
|
|
1
|
+
import{ac as q,o as J,r as s,au as Q,u as Y,av as ee,aw as l,j as g,ax as te,W as re,l as ne,g as oe,T as ie,P as ae,ay as ue,c as le,B as P,d as U,D as se}from"./index-CAfO5bZA.js";import{u as ce}from"./useBasicWidgetState-BRbplAp6.js";import"./FormClearHelper-D5uKQTmO.js";var fe={secondary:"secondary"},N={default:"default"},pe={default:"default"},j=Object.freeze({radio:"radio",checkbox:"checkbox"}),x=q("div",function(e){var t=e.$shape,r=e.$length,n=e.$theme,o=r===1?void 0:t!==N.default?"-".concat(n.sizing.scale100):"-0.5px";return{display:"flex",marginLeft:o,marginRight:o}});x.displayName="StyledRoot";x.displayName="StyledRoot";function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},G.apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(n){z(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ye(e,t){return Se(e)||be(e,t)||me(e,t)||he()}function he(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function me(e,t){if(e){if(typeof e=="string")return K(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,t)}}function K(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function be(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,i=!1,a,d;try{for(r=r.call(e);!(o=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));o=!0);}catch(c){i=!0,d=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(i)throw d}}return n}}function Se(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Oe(e,t,r){return t&&ve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$(e,t)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(e,t)}function _e(e){var t=Le();return function(){var n=k(e),o;if(t){var i=k(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return we(this,o)}}function we(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(e)}function F(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Le(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},k(e)}function z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Re(e,t){return!Array.isArray(e)&&typeof e!="number"?!1:Array.isArray(e)?e.includes(t):e===t}var H=(function(e){Ee(r,e);var t=_e(r);function r(){var n;ge(this,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=t.call.apply(t,[this].concat(i)),z(F(n),"childRefs",{}),n}return Oe(r,[{key:"render",value:function(){var o=this,i=this.props,a=i.overrides,d=a===void 0?{}:a,c=i.mode,y=c===void 0?j.checkbox:c,v=i.children,h=i.selected,_=i.disabled,f=i.onClick,m=i.kind,O=i.shape,b=i.size,B=J(d.Root,x),w=ye(B,2),T=w[0],R=w[1],L=this.props["aria-label"]||this.props.ariaLabel,p=y===j.radio,V=s.Children.count(v);return s.createElement(Q.Consumer,null,function(Z){return s.createElement(T,G({"aria-label":L||Z.buttongroup.ariaLabel,"data-baseweb":"button-group",role:p?"radiogroup":"group",$shape:O,$length:v.length},R),s.Children.map(v,function(S,C){if(!s.isValidElement(S))return null;var I=S.props.isSelected?S.props.isSelected:Re(h,C);return p&&(o.childRefs[C]=s.createRef()),s.cloneElement(S,{disabled:_||S.props.disabled,isSelected:I,ref:p?o.childRefs[C]:void 0,tabIndex:!p||I||p&&(!h||h===-1)&&C===0?0:-1,onKeyDown:function(u){if(p){var E=Number(h)?Number(h):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var A=E-1<0?V-1:E-1;f&&f(u,A),o.childRefs[A].current&&o.childRefs[A].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var D=E+1>V-1?0:E+1;f&&f(u,D),o.childRefs[D].current&&o.childRefs[D].current.focus()}}},kind:m,onClick:function(u){_||(S.props.onClick&&S.props.onClick(u),f&&f(u,C))},shape:O,size:b,overrides:de({BaseButton:{style:function(u){var E=u.$theme;return v.length===1?{}:O!==N.default?{marginLeft:E.sizing.scale100,marginRight:E.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":I,role:p?"radio":"checkbox"}}},S.props.overrides)})}))})}}]),r})(s.Component);z(H,"defaultProps",{disabled:!1,onClick:function(){},shape:N.default,size:pe.default,kind:fe.secondary});function Ce(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Pe(e,t,r){return e==l.ClickMode.MULTI_SELECT?Ce(t,r??[]):r?.includes(t)?[]:[t]}function je(e){return e.length===0?-1:e[0]}function ke(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Be(e,t,r){const n=r===l.Style.PILLS?P.PILLS:r===l.Style.BORDERLESS?P.BORDERLESS_ICON:P.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?U.XSMALL:U.MEDIUM,i=n===P.PILLS||n===P.SEGMENTED_CONTROL,a=r===l.Style.BORDERLESS?"lg":"base";return{element:g.jsx(se,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Te(e,t,r,n){return r.indexOf(n)>-1?!0:t!==l.ClickMode.SINGLE_SELECT||e!==l.SelectionVisualization.ALL_UP_TO_SELECTED?!1:r.length>0&&n<r[0]}function Ie(e,t){return e&&(t=`${t}Active`),t}function Ae(e,t,r){const n={flexWrap:"wrap",maxWidth:"100%",margin:"0 0"},o=r?"100%":"auto",i=r?{}:{content:"''",flex:1e4};switch(e){case l.Style.BORDERLESS:return{...n,columnGap:t.threeXS,rowGap:t.threeXS};case l.Style.PILLS:return{...n,columnGap:t.twoXS,rowGap:t.twoXS,width:o};case l.Style.SEGMENTED_CONTROL:return{...n,columnGap:t.none,rowGap:t.twoXS,"::after":i,width:o};default:return n}}function De(e,t,r,n,o,i,a){const d=Te(r,n,o,t);let c=e.content,y=e.contentIcon;return d&&(c=e.selectedContent?e.selectedContent:c,y=e.selectedContentIcon?e.selectedContentIcon:y),s.forwardRef(function(h,_){const{element:f,kind:m,size:O}=Be(c??"",y??void 0,i),b=Ie(!!(d&&!e.selectedContent&&!e.selectedContentIcon),m);return g.jsx(le,{...h,size:O,kind:b,containerWidth:a,children:f})})}function Me(e,t){return e.getIntArrayValue(t)}function Ge(e){return e.default??null}function $e(e){return e.value??null}function Ne(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o,widthConfig:i}=e,{clickMode:a,options:d,selectionVisualization:c,style:y,label:v,labelVisibility:h,help:_}=r,f=Y(),[m,O]=ce({getStateFromWidgetMgr:Me,getDefaultStateFromProto:Ge,getCurrStateFromProto:$e,updateWidgetMgrState:ke,element:r,widgetMgr:o,fragmentId:n}),b=ee(i),B=(R,L)=>{const p=Pe(a,L,m);O({value:p,fromUi:!0})};let w;a===l.ClickMode.SINGLE_SELECT?w=j.radio:a===l.ClickMode.MULTI_SELECT&&(w=j.checkbox);const T=s.useMemo(()=>d.map((R,L)=>{const p=De(R,L,c,a,m,y,b);return g.jsx(p,{},`${R.content}-${L}`)}),[a,d,c,y,m,b]);return g.jsxs(te,{className:"stButtonGroup","data-testid":"stButtonGroup",containerWidth:b,children:[g.jsx(re,{label:v,disabled:t,labelVisibility:ne(h?.value??ue.LabelVisibilityOptions.COLLAPSED),children:_&&g.jsx(oe,{children:g.jsx(ie,{content:_,placement:ae.TOP})})}),g.jsx(H,{disabled:t,mode:w,onClick:B,selected:a===l.ClickMode.MULTI_SELECT?m:je(m),overrides:{Root:{style:s.useCallback(()=>Ae(y,f.spacing,b),[y,f.spacing,b])}},children:T})]})}const We=s.memo(Ne);export{We as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u,L as A,B as x,ab as R,j as d,b as y,c as C,d as _,D as T}from"./index-
|
|
1
|
+
import{r as u,L as A,B as x,ab as R,j as d,b as y,c as C,d as _,D as T}from"./index-CAfO5bZA.js";import{c as D}from"./createDownloadLinkElement-ZaXNnPK4.js";const B=/%([0-9A-Fa-f]{2})/g,L=/[^\x20-\x7e\xa0-\xff]/g,k=/\\([\u0000-\u007f])/g,E=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,v=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,I=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/,P=o=>String(o).replace(L,"?");class S{constructor(e,t){this.type=e,this.parameters=t}}const U=(o,e)=>String.fromCharCode(Number.parseInt(e,16));function z(o){const e=v.exec(o);if(!e)throw new TypeError("invalid extended field value");const t=e[1].toLowerCase(),a=e[2];let n;switch(t){case"iso-8859-1":n=P(a.replace(B,U));break;case"utf-8":try{n=decodeURIComponent(a)}catch{throw new TypeError("invalid encoded utf-8")}break;default:throw new TypeError("unsupported charset in extended field")}return n}function $(o){let e=I.exec(o);if(!e)throw new TypeError("invalid type format");let t=e[0].length;const a=e[1].toLowerCase();let n;const l=[],i={};let r;for(t=E.lastIndex=e[0].slice(-1)===";"?t-1:t;e=E.exec(o);){if(e.index!==t)throw new TypeError("invalid parameter format");if(t+=e[0].length,n=e[1].toLowerCase(),r=e[2],l.indexOf(n)!==-1)throw new TypeError("invalid duplicate parameter");if(l.push(n),n.indexOf("*")+1===n.length){n=n.slice(0,-1),r=z(r),i[n]=r;continue}typeof i[n]!="string"&&(r[0]==='"'&&(r=r.slice(1,r.length-1).replace(k,"$1")),i[n]=r)}if(t!==-1&&t!==o.length)throw new TypeError("invalid parameter format");return new S(a,i)}function j(o){const e=$(o);if(e.type!=="attachment")return;const t=e.parameters.filename;if(typeof t=="string")return t}function N(o,e){o.sendHttpRequest({method:"GET",path:`${e}?title=${encodeURIComponent(document.title)}`,headers:{},body:""}).then(({statusCode:t,headers:a,body:n})=>{if(t!==200)return;const l=a.get("Content-Disposition"),i=(l&&j(l))??"",r=a.get("Content-Type"),f=new Blob([n],r?{type:r}:void 0),c=URL.createObjectURL(f),s=document.createElement("a");s.setAttribute("href",c),s.setAttribute("target","_blank"),s.setAttribute("download",i),s.click(),URL.revokeObjectURL(c),s.remove()})}function O(o){const{disabled:e,element:t,widgetMgr:a,endpoints:n,fragmentId:l}=o,{help:i,label:r,icon:f,ignoreRerun:c,type:s,url:w}=t,{libConfig:{enforceDownloadInNewTab:h=!1}}=u.useContext(A);let p=x.SECONDARY;s==="primary"?p=x.PRIMARY:s==="tertiary"&&(p=x.TERTIARY);const m=u.useMemo(()=>n.buildDownloadUrl(w),[n,w]);u.useEffect(()=>{n.checkSourceUrlResponse(m,"Download Button")},[m,n]);const g=R(),b=()=>{if(c||a.setTriggerValue(t,{fromUi:!0},l),t.url.startsWith("/media")){N(g,t.url);return}D({filename:"",url:m,enforceDownloadInNewTab:h}).click()};return d.jsx("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:d.jsx(y,{help:i,containerWidth:!0,children:d.jsx(C,{kind:p,size:_.SMALL,disabled:e,onClick:b,containerWidth:!0,children:d.jsx(T,{icon:f,label:r})})})})}const G=u.memo(O);export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,E as O,_ as X,bo as y,bp as _,s as g,j as o,T as ct,P as Y,c as q,B as G,an as E,u as k,am as pt,ah as ut,bq as gt,h as ht,a4 as ft,as as xt,br as mt,k as R,bj as yt,bk as Ct}from"./index-TcDrXcNe.js";import{g as bt,C as It,I as wt,F as V,E as J,a as vt,s as jt,u as zt,b as St}from"./FileHelper-BmOs-7p9.js";import{I as Ft}from"./InputInstructions-DXkJDo-d.js";import{u as Ut,T as Et}from"./useTextInputAutoExpand-DuBV-baK.js";import{i as Dt}from"./inputUtils-CptNuJwn.js";import{E as Tt}from"./ErrorOutline.esm-CSbmRBTs.js";import{U as Q}from"./UploadFileInfo-C-jY39rj.js";import"./base-input-iLbK-zKR.js";var Z=c.forwardRef(function(t,e){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(O,X({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});Z.displayName="AttachFile";var tt=c.forwardRef(function(t,e){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(O,X({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),c.createElement("rect",{width:24,height:24,fill:"none"}),c.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});tt.displayName="Send";const et=(t,e)=>e===y.Directory?{...t,webkitdirectory:"",multiple:!0}:t,Bt=(t,e)=>{if(!e||e.length===0)return!0;const n=t.name.toLowerCase(),a=n.lastIndexOf(".");if(a===-1||a===n.length-1)return e.some(x=>x===""||x===".");const p=n.substring(a),i=n.substring(a+1);return e.some(x=>{const C=x.toLowerCase();return C.startsWith(".")?p===C:i===C})},Rt=(t,e)=>Bt(t,e)?{isValid:!0}:{isValid:!1,errorMessage:`${t.type||"This type of"} files are not allowed.`},ot=t=>{switch(t){case y.None:return"a file";case y.Single:return"a file";case y.Multiple:return"files";case y.Directory:return"a directory";default:return _(t),"a file"}},Lt=g("div",{target:"e3id6jz12"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority}),""),Ht=g("div",{target:"e3id6jz11"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold}),""),Vt=g("div",{target:"e3id6jz10"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"}),""),kt=g("div",{target:"e3id6jz9"})(({disabled:t})=>({pointerEvents:t?"none":"auto"}),""),Mt=g("div",{target:"e3id6jz8"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20}),""),Wt=g("div",{target:"e3id6jz7"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"}),""),$t=g("div",{target:"e3id6jz6"})({name:"zjik7",styles:"display:flex"}),Nt=g("div",{target:"e3id6jz5"})({name:"ou8xsw",styles:"flex:0 0 auto"}),At=g("div",{target:"e3id6jz4"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS}),""),Pt=g("div",{target:"e3id6jz3"})(({theme:t})=>({color:t.colors.fadedText60}),""),Kt=g("div",{target:"e3id6jz2"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60}),""),Ot=g("div",{target:"e3id6jz1"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60}),""),Xt=g("small",{target:"e3id6jz0"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}),""),_t=({getRootProps:t,getInputProps:e,acceptFile:n,disabled:a,theme:p})=>{const i=et(e(),n);return o.jsxs(Vt,{disabled:a,children:[o.jsxs(kt,{"data-testid":"stChatInputFileUploadButton",disabled:a,...t(),children:[o.jsx("input",{...i}),o.jsx(ct,{content:`Upload or drag and drop ${ot(n)}`,placement:Y.TOP,onMouseEnterDelay:500,children:o.jsx(q,{kind:G.MINIMAL,disabled:a,children:o.jsx(E,{content:Z,size:"lg",color:a?p.colors.fadedText40:p.colors.fadedText60})})})]}),o.jsx(Mt,{})]})},Yt=c.memo(_t),qt=({getRootProps:t,getInputProps:e,acceptFile:n,inputHeight:a})=>{const p=et(e(),n);return o.jsxs(o.Fragment,{children:[o.jsx(Lt,{height:a,...t(),children:o.jsx("input",{...p})}),o.jsx(Ht,{height:a,children:`Drag and drop ${ot(n)} here`})]})},Gt=c.memo(qt);function Jt({children:t,content:e}){const n=k();return o.jsx(pt,{content:e,placement:Y.TOP,overrides:{Body:{style:{top:`-${n.sizes.minElementHeight}`}}},children:t})}const Qt=({fileInfo:t})=>{const e=k(),{type:n}=t.status;switch(n){case"uploading":return o.jsx(ut,{"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return o.jsx(Jt,{content:t.status.errorMessage,children:o.jsx(E,{color:e.colors.redTextColor,content:Tt,size:"lg"})});case"uploaded":return o.jsx(E,{content:wt,size:"lg"});default:return _(n),null}},Zt=({fileInfo:t,onDelete:e})=>o.jsxs(At,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[o.jsx(Pt,{children:o.jsx(Qt,{fileInfo:t})}),o.jsx(Kt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),o.jsx(Ot,{children:bt(t.size,V.Byte)}),o.jsx(Xt,{"data-testid":"stChatInputDeleteBtn",children:o.jsx(q,{onClick:()=>e(t.id),kind:G.MINIMAL,children:o.jsx(E,{content:It,size:"lg"})})})]}),te=c.memo(Zt),ee=({items:t,onDelete:e})=>o.jsx(Wt,{"data-testid":"stChatUploadedFiles",children:o.jsx($t,{children:t.map(n=>o.jsx(Nt,{children:o.jsx(te,{fileInfo:n,onDelete:e})},n.id))})}),oe=c.memo(ee),ne=(t,e)=>{const n=[],a=[];return t.forEach(p=>{const i=Rt(p,e.fileType);i.isValid?n.push(p):a.push({file:p,errors:[{code:J.FileInvalidType,message:i.errorMessage||"File type not allowed."}]})}),{accepted:n,rejected:a}},re=({acceptMultipleFiles:t,acceptDirectoryFiles:e,maxFileSize:n,uploadClient:a,uploadFile:p,addFiles:i,getNextLocalFileId:x,deleteExistingFiles:C,onUploadComplete:w,element:b})=>(f,h)=>{if(e&&f.length>0){const{accepted:u,rejected:m}=ne(f,b);f=u,h=[...h,...m]}if(!t&&f.length===0&&h.length>1){const u=h.findIndex(m=>m.errors?.[0].code===J.TooManyFiles);u>=0&&(f.push(h[u].file),h.splice(u,1))}if(!t&&f.length>0&&C(),a.fetchFileURLs(f).then(u=>{gt(u,f).forEach(([m,v])=>{p(m,v)})}).catch(u=>{i(f.map(m=>new Q(m.name,m.size,x(),{type:"error",errorMessage:u})))}),h.length>0){const u=h.map(m=>vt(m,x(),n));i(u)}w()},se=({getNextLocalFileId:t,addFiles:e,updateFile:n,uploadClient:a,element:p,onUploadProgress:i,onUploadComplete:x})=>(C,w)=>{const b=w.webkitRelativePath||w.name,f=new AbortController,h=new Q(b,w.size,t(),{type:"uploading",abortController:f,progress:1});e([h]),a.uploadFile({formId:"",...p},C.uploadUrl,w,u=>i(u,h.id),f.signal).then(()=>x(h.id,C)).catch(u=>{u instanceof DOMException&&u.name==="AbortError"||n(h.id,h.setStatus({type:"error",errorMessage:u?u.toString():"Unknown error"}))})},ae=g("div",{target:"e1d2x3se4"})({name:"1nibcdy",styles:"border:none;position:relative;display:flex"}),ie=g("div",{target:"e1d2x3se3"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}}),""),le=g("button",{target:"e1d2x3se2"})(({theme:t,disabled:e,extended:n})=>{const a=ht(t),[p,i]=a?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?"0":t.radii.chatInput,borderTopLeftRadius:n?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?p:i,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:a?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray60,cursor:"not-allowed"}}},""),de=g("div",{target:"e1d2x3se1"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"}),""),ce=g("div",{target:"e1d2x3se0"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`}),""),L=(t,e,n)=>n.map(a=>a.id===t?e:a),H=(t,e)=>e.find(n=>n.id===t);function pe({disabled:t,element:e,widgetMgr:n,fragmentId:a,uploadClient:p}){const i=k(),{placeholder:x,maxChars:C}=e,w=c.useRef(0),b=c.useRef(null),{width:f,elementRef:h}=ft(),{innerWidth:u,innerHeight:m}=xt(),[v,D]=c.useState(e.default),[z,S]=c.useState([]),[F,T]=c.useState(!1),j=Ut({textareaRef:b,dependencies:[x]}),B=c.useMemo(()=>z.some(r=>r.status.type==="uploading")?!1:v!==""||z.length>0,[z,v]),I=mt(e.acceptFile),M=jt(e.maxUploadSizeMb,V.Megabyte,V.Byte),W=c.useCallback(r=>S(l=>[...l,...r]),[]),$=c.useCallback(r=>{S(l=>{const d=H(r,l);return R(d)?l:(d.status.type==="uploading"&&d.status.abortController.abort(),d.status.type==="uploaded"&&d.status.fileUrls.deleteUrl&&p.deleteFile(d.status.fileUrls.deleteUrl),l.filter(s=>s.id!==r))})},[p]),nt=()=>{const r=z.filter(l=>l.status.type==="uploaded").map(l=>{const{name:d,size:s,status:U}=l,{fileId:lt,fileUrls:dt}=U;return new yt({fileId:lt,fileUrls:dt,name:d,size:s})});return new Ct({uploadedFileInfo:r})},N=()=>w.current++,rt=re({acceptMultipleFiles:I===y.Multiple||I===y.Directory,acceptDirectoryFiles:I===y.Directory,maxFileSize:M,uploadClient:p,uploadFile:se({getNextLocalFileId:N,addFiles:W,updateFile:(r,l)=>{S(d=>L(r,l,d))},uploadClient:p,element:e,onUploadProgress:(r,l)=>{S(d=>{const s=H(l,d);if(R(s)||s.status.type!=="uploading")return d;const U=Math.round(r.loaded*100/r.total);return s.status.progress===U?d:L(l,s.setStatus({type:"uploading",abortController:s.status.abortController,progress:U}),d)})},onUploadComplete:(r,l)=>{S(d=>{const s=H(r,d);return R(s)||s.status.type!=="uploading"?d:L(s.id,s.setStatus({type:"uploaded",fileId:l.fileId,fileUrls:l}),d)})}}),addFiles:W,getNextLocalFileId:N,deleteExistingFiles:()=>z.forEach(r=>$(r.id)),onUploadComplete:()=>{b.current&&b.current.focus()},element:e}),{getRootProps:A,getInputProps:P}=zt({onDrop:rt,multiple:I===y.Multiple||I===y.Directory,accept:St(e.fileType),maxSize:M}),K=()=>{if(b.current&&b.current.focus(),!B||t)return;const r={data:v,fileUploaderState:nt()};n.setChatInputValue(e,r,{fromUi:!0},a),S([]),D(""),j.clearScrollHeight()},st=r=>{const{metaKey:l,ctrlKey:d,shiftKey:s}=r;Dt(r)&&!s&&!d&&!l&&(r.preventDefault(),K())},at=r=>{const{value:l}=r.target;C!==0&&l.length>C||(D(l),j.updateScrollHeight())};c.useEffect(()=>{if(e.setValue){e.setValue=!1;const r=e.value||"";D(r)}},[e]),c.useEffect(()=>{const r=s=>{s.preventDefault(),s.stopPropagation(),!F&&s.dataTransfer?.types.includes("Files")&&T(!0)},l=s=>{s.preventDefault(),s.stopPropagation(),F&&(s.clientX<=0&&s.clientY<=0||s.clientX>=u&&s.clientY>=m)&&T(!1)},d=s=>{s.preventDefault(),s.stopPropagation(),F&&T(!1)};return window.addEventListener("dragover",r),window.addEventListener("drop",d),window.addEventListener("dragleave",l),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",d),window.removeEventListener("dragleave",l)}},[F,u,m]);const it=I!==y.None&&F;return o.jsxs(o.Fragment,{children:[I===y.None?null:o.jsx(oe,{items:[...z],onDelete:$}),o.jsx(ae,{className:"stChatInput","data-testid":"stChatInput",ref:h,children:it?o.jsx(Gt,{getRootProps:A,getInputProps:P,acceptFile:I,inputHeight:j.height}):o.jsxs(ie,{extended:j.isExtended,children:[I===y.None?null:o.jsx(Yt,{getRootProps:A,getInputProps:P,acceptFile:I,disabled:t,theme:i}),o.jsx(Et,{inputRef:b,value:v,placeholder:x,onChange:at,onKeyDown:st,"aria-label":x,disabled:t,rows:1,overrides:{Root:{style:{minHeight:i.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:i.fontWeights.normal,lineHeight:i.lineHeights.inputWidget,"::placeholder":{color:i.colors.fadedText60},height:j.height,maxHeight:j.maxHeight,paddingLeft:i.spacing.none,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm,paddingRight:`calc(${i.iconSizes.xl} + 2 * ${i.spacing.sm} + ${i.spacing.sm})`}}}}),f>i.breakpoints.hideWidgetDetails&&o.jsx(ce,{children:o.jsx(Ft,{dirty:B,value:v,maxLength:C,type:"chat",inForm:!1})}),o.jsx(de,{children:o.jsx(le,{onClick:K,disabled:!B||t,extended:j.isExtended,"data-testid":"stChatInputSubmitButton",children:o.jsx(E,{content:tt,size:"xl",color:"inherit"})})})]})})]})}const be=c.memo(pe);export{be as default};
|
|
1
|
+
import{r as c,E as O,_ as X,bo as y,bp as _,s as g,j as o,T as ct,P as Y,c as q,B as G,an as E,u as k,am as pt,ah as ut,bq as gt,h as ht,a4 as ft,as as xt,br as mt,k as R,bj as yt,bk as Ct}from"./index-CAfO5bZA.js";import{g as bt,C as It,I as wt,F as V,E as J,a as vt,s as jt,u as zt,b as St}from"./FileHelper-B2y-7Abl.js";import{I as Ft}from"./InputInstructions-CpX2tVr2.js";import{u as Ut,T as Et}from"./useTextInputAutoExpand-DbsgX0Ah.js";import{i as Dt}from"./inputUtils-CptNuJwn.js";import{E as Tt}from"./ErrorOutline.esm-Blj8Hhf6.js";import{U as Q}from"./UploadFileInfo-C-jY39rj.js";import"./base-input-EmJVkDar.js";var Z=c.forwardRef(function(t,e){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(O,X({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),c.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),c.createElement("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5a2.5 2.5 0 015 0v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5a2.5 2.5 0 005 0V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"}))});Z.displayName="AttachFile";var tt=c.forwardRef(function(t,e){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return c.createElement(O,X({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:e}),c.createElement("rect",{width:24,height:24,fill:"none"}),c.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))});tt.displayName="Send";const et=(t,e)=>e===y.Directory?{...t,webkitdirectory:"",multiple:!0}:t,Bt=(t,e)=>{if(!e||e.length===0)return!0;const n=t.name.toLowerCase(),a=n.lastIndexOf(".");if(a===-1||a===n.length-1)return e.some(x=>x===""||x===".");const p=n.substring(a),i=n.substring(a+1);return e.some(x=>{const C=x.toLowerCase();return C.startsWith(".")?p===C:i===C})},Rt=(t,e)=>Bt(t,e)?{isValid:!0}:{isValid:!1,errorMessage:`${t.type||"This type of"} files are not allowed.`},ot=t=>{switch(t){case y.None:return"a file";case y.Single:return"a file";case y.Multiple:return"files";case y.Directory:return"a directory";default:return _(t),"a file"}},Lt=g("div",{target:"e3id6jz12"})(({theme:t,height:e})=>({backgroundColor:t.colors.transparent,position:"absolute",left:0,bottom:0,minHeight:`max(${t.sizes.emptyDropdownHeight}, ${e})`,width:"100%",zIndex:t.zIndices.priority}),""),Ht=g("div",{target:"e3id6jz11"})(({theme:t,height:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.primary,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,color:t.colors.primary,display:"flex",alignItems:"center",justifyContent:"center",height:e,width:"100%",fontWeight:t.fontWeights.bold}),""),Vt=g("div",{target:"e3id6jz10"})(({theme:t,disabled:e})=>({display:"flex",alignItems:"top",height:"100%",marginTop:`-${t.sizes.borderWidth}`,cursor:e?"not-allowed":"auto"}),""),kt=g("div",{target:"e3id6jz9"})(({disabled:t})=>({pointerEvents:t?"none":"auto"}),""),Mt=g("div",{target:"e3id6jz8"})(({theme:t})=>({marginTop:"0.625em",marginLeft:t.spacing.sm,height:t.spacing.xl,width:t.sizes.borderWidth,backgroundColor:t.colors.fadedText20}),""),Wt=g("div",{target:"e3id6jz7"})(({theme:t})=>({left:0,right:0,lineHeight:t.lineHeights.tight,paddingLeft:t.spacing.sm,paddingRight:t.spacing.sm,overflowX:"auto"}),""),$t=g("div",{target:"e3id6jz6"})({name:"zjik7",styles:"display:flex"}),Nt=g("div",{target:"e3id6jz5"})({name:"ou8xsw",styles:"flex:0 0 auto"}),At=g("div",{target:"e3id6jz4"})(({theme:t})=>({display:"flex",alignItems:"center",padding:t.spacing.sm,gap:t.spacing.twoXS}),""),Pt=g("div",{target:"e3id6jz3"})(({theme:t})=>({color:t.colors.fadedText60}),""),Kt=g("div",{target:"e3id6jz2"})(({theme:t,fileStatus:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:e.type==="uploaded"?t.colors.bodyText:t.colors.fadedText60}),""),Ot=g("div",{target:"e3id6jz1"})(({theme:t})=>({marginRight:t.spacing.md,color:t.colors.fadedText60}),""),Xt=g("small",{target:"e3id6jz0"})(({theme:t})=>({display:"flex",alignItems:"center",maxHeight:t.sizes.smallElementHeight,color:t.colors.fadedText60,"& :hover":{color:t.colors.bodyText}}),""),_t=({getRootProps:t,getInputProps:e,acceptFile:n,disabled:a,theme:p})=>{const i=et(e(),n);return o.jsxs(Vt,{disabled:a,children:[o.jsxs(kt,{"data-testid":"stChatInputFileUploadButton",disabled:a,...t(),children:[o.jsx("input",{...i}),o.jsx(ct,{content:`Upload or drag and drop ${ot(n)}`,placement:Y.TOP,onMouseEnterDelay:500,children:o.jsx(q,{kind:G.MINIMAL,disabled:a,children:o.jsx(E,{content:Z,size:"lg",color:a?p.colors.fadedText40:p.colors.fadedText60})})})]}),o.jsx(Mt,{})]})},Yt=c.memo(_t),qt=({getRootProps:t,getInputProps:e,acceptFile:n,inputHeight:a})=>{const p=et(e(),n);return o.jsxs(o.Fragment,{children:[o.jsx(Lt,{height:a,...t(),children:o.jsx("input",{...p})}),o.jsx(Ht,{height:a,children:`Drag and drop ${ot(n)} here`})]})},Gt=c.memo(qt);function Jt({children:t,content:e}){const n=k();return o.jsx(pt,{content:e,placement:Y.TOP,overrides:{Body:{style:{top:`-${n.sizes.minElementHeight}`}}},children:t})}const Qt=({fileInfo:t})=>{const e=k(),{type:n}=t.status;switch(n){case"uploading":return o.jsx(ut,{"data-testid":"stChatInputFileIconSpinner",size:"lg",margin:"0",padding:"0"});case"error":return o.jsx(Jt,{content:t.status.errorMessage,children:o.jsx(E,{color:e.colors.redTextColor,content:Tt,size:"lg"})});case"uploaded":return o.jsx(E,{content:wt,size:"lg"});default:return _(n),null}},Zt=({fileInfo:t,onDelete:e})=>o.jsxs(At,{className:"stChatInputFile","data-testid":"stChatInputFile",children:[o.jsx(Pt,{children:o.jsx(Qt,{fileInfo:t})}),o.jsx(Kt,{className:"stChatInputFileName","data-testid":"stChatInputFileName",title:t.name,fileStatus:t.status,children:t.name}),o.jsx(Ot,{children:bt(t.size,V.Byte)}),o.jsx(Xt,{"data-testid":"stChatInputDeleteBtn",children:o.jsx(q,{onClick:()=>e(t.id),kind:G.MINIMAL,children:o.jsx(E,{content:It,size:"lg"})})})]}),te=c.memo(Zt),ee=({items:t,onDelete:e})=>o.jsx(Wt,{"data-testid":"stChatUploadedFiles",children:o.jsx($t,{children:t.map(n=>o.jsx(Nt,{children:o.jsx(te,{fileInfo:n,onDelete:e})},n.id))})}),oe=c.memo(ee),ne=(t,e)=>{const n=[],a=[];return t.forEach(p=>{const i=Rt(p,e.fileType);i.isValid?n.push(p):a.push({file:p,errors:[{code:J.FileInvalidType,message:i.errorMessage||"File type not allowed."}]})}),{accepted:n,rejected:a}},re=({acceptMultipleFiles:t,acceptDirectoryFiles:e,maxFileSize:n,uploadClient:a,uploadFile:p,addFiles:i,getNextLocalFileId:x,deleteExistingFiles:C,onUploadComplete:w,element:b})=>(f,h)=>{if(e&&f.length>0){const{accepted:u,rejected:m}=ne(f,b);f=u,h=[...h,...m]}if(!t&&f.length===0&&h.length>1){const u=h.findIndex(m=>m.errors?.[0].code===J.TooManyFiles);u>=0&&(f.push(h[u].file),h.splice(u,1))}if(!t&&f.length>0&&C(),a.fetchFileURLs(f).then(u=>{gt(u,f).forEach(([m,v])=>{p(m,v)})}).catch(u=>{i(f.map(m=>new Q(m.name,m.size,x(),{type:"error",errorMessage:u})))}),h.length>0){const u=h.map(m=>vt(m,x(),n));i(u)}w()},se=({getNextLocalFileId:t,addFiles:e,updateFile:n,uploadClient:a,element:p,onUploadProgress:i,onUploadComplete:x})=>(C,w)=>{const b=w.webkitRelativePath||w.name,f=new AbortController,h=new Q(b,w.size,t(),{type:"uploading",abortController:f,progress:1});e([h]),a.uploadFile({formId:"",...p},C.uploadUrl,w,u=>i(u,h.id),f.signal).then(()=>x(h.id,C)).catch(u=>{u instanceof DOMException&&u.name==="AbortError"||n(h.id,h.setStatus({type:"error",errorMessage:u?u.toString():"Unknown error"}))})},ae=g("div",{target:"e1d2x3se4"})({name:"1nibcdy",styles:"border:none;position:relative;display:flex"}),ie=g("div",{target:"e1d2x3se3"})(({theme:t,extended:e})=>({border:`${t.sizes.borderWidth} solid`,borderColor:t.colors.widgetBorderColor??t.colors.transparent,borderRadius:t.radii.chatInput,backgroundColor:t.colors.secondaryBg,position:"relative",flexGrow:1,display:"flex",alignItems:"center",paddingLeft:t.spacing.lg,maxHeight:e?"none":t.sizes.minElementHeight,gap:t.spacing.sm,overflow:"hidden",":focus-within":{borderColor:t.colors.primary}}),""),le=g("button",{target:"e1d2x3se2"})(({theme:t,disabled:e,extended:n})=>{const a=ht(t),[p,i]=a?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?"0":t.radii.chatInput,borderTopLeftRadius:n?t.radii.default:"0",borderBottomRightRadius:t.radii.chatInput,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:t.lineHeights.none,margin:t.spacing.none,padding:t.spacing.sm,color:e?p:i,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:a?t.colors.gray10:t.colors.gray90},"&:hover":{color:t.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray60,cursor:"not-allowed"}}},""),de=g("div",{target:"e1d2x3se1"})(({theme:t})=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:0,marginBottom:`-${t.sizes.borderWidth}`,pointerEvents:"none"}),""),ce=g("div",{target:"e1d2x3se0"})(({theme:t})=>({position:"absolute",bottom:"0px",right:`calc(${t.iconSizes.xl} + 2 * ${t.spacing.sm} + ${t.spacing.sm})`}),""),L=(t,e,n)=>n.map(a=>a.id===t?e:a),H=(t,e)=>e.find(n=>n.id===t);function pe({disabled:t,element:e,widgetMgr:n,fragmentId:a,uploadClient:p}){const i=k(),{placeholder:x,maxChars:C}=e,w=c.useRef(0),b=c.useRef(null),{width:f,elementRef:h}=ft(),{innerWidth:u,innerHeight:m}=xt(),[v,D]=c.useState(e.default),[z,S]=c.useState([]),[F,T]=c.useState(!1),j=Ut({textareaRef:b,dependencies:[x]}),B=c.useMemo(()=>z.some(r=>r.status.type==="uploading")?!1:v!==""||z.length>0,[z,v]),I=mt(e.acceptFile),M=jt(e.maxUploadSizeMb,V.Megabyte,V.Byte),W=c.useCallback(r=>S(l=>[...l,...r]),[]),$=c.useCallback(r=>{S(l=>{const d=H(r,l);return R(d)?l:(d.status.type==="uploading"&&d.status.abortController.abort(),d.status.type==="uploaded"&&d.status.fileUrls.deleteUrl&&p.deleteFile(d.status.fileUrls.deleteUrl),l.filter(s=>s.id!==r))})},[p]),nt=()=>{const r=z.filter(l=>l.status.type==="uploaded").map(l=>{const{name:d,size:s,status:U}=l,{fileId:lt,fileUrls:dt}=U;return new yt({fileId:lt,fileUrls:dt,name:d,size:s})});return new Ct({uploadedFileInfo:r})},N=()=>w.current++,rt=re({acceptMultipleFiles:I===y.Multiple||I===y.Directory,acceptDirectoryFiles:I===y.Directory,maxFileSize:M,uploadClient:p,uploadFile:se({getNextLocalFileId:N,addFiles:W,updateFile:(r,l)=>{S(d=>L(r,l,d))},uploadClient:p,element:e,onUploadProgress:(r,l)=>{S(d=>{const s=H(l,d);if(R(s)||s.status.type!=="uploading")return d;const U=Math.round(r.loaded*100/r.total);return s.status.progress===U?d:L(l,s.setStatus({type:"uploading",abortController:s.status.abortController,progress:U}),d)})},onUploadComplete:(r,l)=>{S(d=>{const s=H(r,d);return R(s)||s.status.type!=="uploading"?d:L(s.id,s.setStatus({type:"uploaded",fileId:l.fileId,fileUrls:l}),d)})}}),addFiles:W,getNextLocalFileId:N,deleteExistingFiles:()=>z.forEach(r=>$(r.id)),onUploadComplete:()=>{b.current&&b.current.focus()},element:e}),{getRootProps:A,getInputProps:P}=zt({onDrop:rt,multiple:I===y.Multiple||I===y.Directory,accept:St(e.fileType),maxSize:M}),K=()=>{if(b.current&&b.current.focus(),!B||t)return;const r={data:v,fileUploaderState:nt()};n.setChatInputValue(e,r,{fromUi:!0},a),S([]),D(""),j.clearScrollHeight()},st=r=>{const{metaKey:l,ctrlKey:d,shiftKey:s}=r;Dt(r)&&!s&&!d&&!l&&(r.preventDefault(),K())},at=r=>{const{value:l}=r.target;C!==0&&l.length>C||(D(l),j.updateScrollHeight())};c.useEffect(()=>{if(e.setValue){e.setValue=!1;const r=e.value||"";D(r)}},[e]),c.useEffect(()=>{const r=s=>{s.preventDefault(),s.stopPropagation(),!F&&s.dataTransfer?.types.includes("Files")&&T(!0)},l=s=>{s.preventDefault(),s.stopPropagation(),F&&(s.clientX<=0&&s.clientY<=0||s.clientX>=u&&s.clientY>=m)&&T(!1)},d=s=>{s.preventDefault(),s.stopPropagation(),F&&T(!1)};return window.addEventListener("dragover",r),window.addEventListener("drop",d),window.addEventListener("dragleave",l),()=>{window.removeEventListener("dragover",r),window.removeEventListener("drop",d),window.removeEventListener("dragleave",l)}},[F,u,m]);const it=I!==y.None&&F;return o.jsxs(o.Fragment,{children:[I===y.None?null:o.jsx(oe,{items:[...z],onDelete:$}),o.jsx(ae,{className:"stChatInput","data-testid":"stChatInput",ref:h,children:it?o.jsx(Gt,{getRootProps:A,getInputProps:P,acceptFile:I,inputHeight:j.height}):o.jsxs(ie,{extended:j.isExtended,children:[I===y.None?null:o.jsx(Yt,{getRootProps:A,getInputProps:P,acceptFile:I,disabled:t,theme:i}),o.jsx(Et,{inputRef:b,value:v,placeholder:x,onChange:at,onKeyDown:st,"aria-label":x,disabled:t,rows:1,overrides:{Root:{style:{minHeight:i.sizes.minElementHeight,outline:"none",borderLeftWidth:"0",borderRightWidth:"0",borderTopWidth:"0",borderBottomWidth:"0",borderTopLeftRadius:"0",borderTopRightRadius:"0",borderBottomRightRadius:"0",borderBottomLeftRadius:"0"}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{fontWeight:i.fontWeights.normal,lineHeight:i.lineHeights.inputWidget,"::placeholder":{color:i.colors.fadedText60},height:j.height,maxHeight:j.maxHeight,paddingLeft:i.spacing.none,paddingBottom:i.spacing.sm,paddingTop:i.spacing.sm,paddingRight:`calc(${i.iconSizes.xl} + 2 * ${i.spacing.sm} + ${i.spacing.sm})`}}}}),f>i.breakpoints.hideWidgetDetails&&o.jsx(ce,{children:o.jsx(Ft,{dirty:B,value:v,maxLength:C,type:"chat",inForm:!1})}),o.jsx(de,{children:o.jsx(le,{onClick:K,disabled:!B||t,extended:j.isExtended,"data-testid":"stChatInputSubmitButton",children:o.jsx(E,{content:tt,size:"xl",color:"inherit"})})})]})})]})}const be=c.memo(pe);export{be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{az as i,aA as f,aB as s,aC as u}from"./index-
|
|
1
|
+
import{az as i,aA as f,aB as s,aC as u}from"./index-CAfO5bZA.js";function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,i(r.key),r)}}function l(t,e,o){return e&&n(t.prototype,e),o&&n(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,e){if(e&&(f(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(t)}function b(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}export{a as _,y as a,b,p as c,l as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as v,r as l,p as k,q as S,A as p}from"./index-
|
|
1
|
+
import{o as v,r as l,p as k,q as S,A as p}from"./index-CAfO5bZA.js";import{R as C,I as w,g as J,B as M}from"./base-input-EmJVkDar.js";function _(e){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(e)}var U=["Root","StartEnhancer","EndEnhancer"],Z=["startEnhancer","endEnhancer","overrides"];function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function O(e,t){return V(e)||Q(e,t)||K(e,t)||G()}function G(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(e,t){if(e){if(typeof e=="string")return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}}function j(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Q(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,u;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(b){a=!0,u=b}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw u}}return n}}function V(e){if(Array.isArray(e))return e}function I(e,t){if(e==null)return{};var r=X(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function X(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function te(e,t,r){return t&&ee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function re(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},m(e,t)}function ne(e){var t=ae();return function(){var n=h(e),o;if(t){var a=h(this).constructor;o=Reflect.construct(n,arguments,a)}else o=n.apply(this,arguments);return oe(this,o)}}function oe(e,t){if(t&&(_(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ae(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},h(e)}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ie=(function(e){re(r,e);var t=ne(r);function r(){var n;Y(this,r);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return n=t.call.apply(t,[this].concat(a)),d(y(n),"state",{isFocused:n.props.autoFocus||!1}),d(y(n),"onFocus",function(u){n.setState({isFocused:!0}),n.props.onFocus(u)}),d(y(n),"onBlur",function(u){n.setState({isFocused:!1}),n.props.onBlur(u)}),n}return te(r,[{key:"render",value:function(){var o=this.props,a=o.startEnhancer,i=o.endEnhancer,u=o.overrides,b=u.Root,A=u.StartEnhancer,B=u.EndEnhancer,F=I(u,U),T=I(o,Z),x=v(b,C),g=O(x,2),$=g[0],N=g[1],D=v(A,w),E=O(D,2),W=E[0],q=E[1],z=v(B,w),P=O(z,2),H=P[0],L=P[1],c=J(this.props,this.state);return l.createElement($,f({"data-baseweb":"input"},c,N,{$adjoined:R(a,i),$hasIconTrailing:this.props.clearable||this.props.type=="password"}),s(a)&&l.createElement(W,f({},c,q,{$position:S.start}),typeof a=="function"?a(c):a),l.createElement(M,f({},T,{overrides:F,adjoined:R(a,i),onFocus:this.onFocus,onBlur:this.onBlur})),s(i)&&l.createElement(H,f({},c,L,{$position:S.end}),typeof i=="function"?i(c):i))}}]),r})(l.Component);d(ie,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:k.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});function R(e,t){return s(e)&&s(t)?p.both:s(e)?p.left:s(t)?p.right:p.none}function s(e){return!!(e||e===0)}export{ie as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,e as c}from"./es6-
|
|
1
|
+
import{c as p,e as c}from"./es6-D2SokxS6.js";import"./index-CAfO5bZA.js";const{File:n,Blob:_,DOMException:s}=p,{INVALID:z,GONE:r,MISMATCH:w,MOD_ERR:b,SYNTAX:a,SECURITY:I,DISALLOWED:m}=c;class g{constructor(e,i){this.fileHandle=e,this.file=i,this.size=i.size,this.position=0}write(e){let i=this.file;if(typeof e=="object"){if(e.type==="write"){if(Number.isInteger(e.position)&&e.position>=0&&(this.position=e.position,this.size<e.position&&(this.file=new n([this.file,new ArrayBuffer(e.position-this.size)],this.file.name,this.file))),!("data"in e))throw new s(...a("write requires a data argument"));e=e.data}else if(e.type==="seek")if(Number.isInteger(e.position)&&e.position>=0){if(this.size<e.position)throw new s(...z);this.position=e.position;return}else throw new s(...a("seek requires a position argument"));else if(e.type==="truncate")if(Number.isInteger(e.size)&&e.size>=0){i=e.size<this.size?new n([i.slice(0,e.size)],i.name,i):new n([i,new Uint8Array(e.size-this.size)],i.name),this.size=i.size,this.position>i.size&&(this.position=i.size),this.file=i;return}else throw new s(...a("truncate requires a size argument"))}e=new _([e]);let t=this.file;const o=t.slice(0,this.position),y=t.slice(this.position+e.size);let l=this.position-o.size;l<0&&(l=0),t=new n([o,new Uint8Array(l),e,y],t.name),this.size=t.size,this.position+=e.size,this.file=t}close(){if(this.fileHandle._deleted)throw new s(...r);this.fileHandle._file=this.file,this.file=this.position=this.size=null,this.fileHandle.onclose&&this.fileHandle.onclose(this.fileHandle)}}class f{constructor(e="",i=new n([],e),t=!0){this._file=i,this.name=e,this.kind="file",this._deleted=!1,this.writable=t,this.readable=!0}async getFile(){if(this._deleted)throw new s(...r);return this._file}async createWritable(e){if(!this.writable)throw new s(...m);if(this._deleted)throw new s(...r);const i=e.keepExistingData?await this.getFile():new n([],this.name);return new g(this,i)}async isSameEntry(e){return this===e}async _destroy(){this._deleted=!0,this._file=null}}class h{constructor(e,i=!0){this.name=e,this.kind="directory",this._deleted=!1,this._entries={},this.writable=i,this.readable=!0}async*entries(){if(this._deleted)throw new s(...r);yield*Object.entries(this._entries)}async isSameEntry(e){return this===e}async getDirectoryHandle(e,i){if(this._deleted)throw new s(...r);const t=this._entries[e];if(t){if(t instanceof f)throw new s(...w);return t}else{if(i.create)return this._entries[e]=new h(e);throw new s(...r)}}async getFileHandle(e,i){const t=this._entries[e],o=t instanceof f;if(t&&o)return t;if(t&&!o)throw new s(...w);if(!t&&!i.create)throw new s(...r);if(!t&&i.create)return this._entries[e]=new f(e)}async removeEntry(e,i){const t=this._entries[e];if(!t)throw new s(...r);await t._destroy(i.recursive),delete this._entries[e]}async _destroy(e){for(let i of Object.values(this._entries)){if(!e)throw new s(...b);await i._destroy(e)}this._entries={},this._deleted=!0}}const u=new h(""),A=()=>u;export{f as FileHandle,h as FolderHandle,g as Sink,A as default};
|
package/build/assets/{number-overlay-editor-DkLM--gB.js → number-overlay-editor-CSD-WlqD.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{al as X,r as T}from"./index-TcDrXcNe.js";import{s as Te}from"./index-JmbIn5LC.js";import"./withFullScreenWrapper-B0RGgIoE.js";import"./Toolbar-B9tKdtfU.js";import"./FormClearHelper-DzT4m6x-.js";import"./sprintf-DpPCfzXw.js";import"./checkbox-DeJjjX3E.js";import"./createDownloadLinkElement-ZaXNnPK4.js";import"./slicedToArray-CgYaBkVH.js";import"./inherits-CarKs31i.js";import"./createSuper-CwBHRG8y.js";import"./FileDownload.esm-Chli17S8.js";const Be=Te("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function Se(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var re;(function(e){e.event="event",e.props="prop"})(re||(re={}));function q(){}function Fe(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(i,l){return i===t[l]})||(t=n,r=e.apply(void 0,n)),r}}function ae(e){return!!(e||"").match(/\d/)}function Y(e){return e==null}function _e(e){return typeof e=="number"&&isNaN(e)}function pe(e){return Y(e)||_e(e)||typeof e=="number"&&!isFinite(e)}function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function je(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Le(e,t,r){var n=je(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function Me(e){var t=T.useRef(e);t.current=e;var r=T.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function se(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),i=a[0],l=a[1]||"";return{beforeDecimal:i,afterDecimal:l,hasNegation:r,addNegation:n}}function ke(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function ye(e,t,r){for(var n="",a=r?"0":"",i=0;i<=t-1;i++)n+=e[i]||a;return n}function de(e,t){return Array(t+1).join(e)}function be(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],i=n[1];if(i=Number(i),!i)return r+a;a=a.replace(".","");var l=1+i,m=a.length;return l<0?a="0."+de("0",Math.abs(l))+a:l>=m?a=a+de("0",l-m):a=(a.substring(0,l)||"0")+"."+a.substring(l),r+a}function ge(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=se(e),i=a.beforeDecimal,l=a.afterDecimal,m=a.hasNegation,S=parseFloat("0."+(l||"0")),p=l.length<=t?"0."+l:S.toFixed(t),h=p.split("."),c=i;i&&Number(h[0])&&(c=i.split("").reverse().reduce(function(I,C,g){return I.length>g?(Number(I[0])+Number(C)).toString()+I.substring(1,I.length):C+I},h[0]));var x=ye(h[1]||"",t,r),y=m?"-":"",s=n?".":"";return""+y+c+s+x}function H(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Ve=Fe(function(e,t){for(var r=0,n=0,a=e.length,i=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[i-1-n]&&i-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:i-n}}}),Pe=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function Ke(e,t,r){return Math.min(Math.max(e,t),r)}function ce(e){return Math.max(e.selectionStart,e.selectionEnd)}function We(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ue(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function $e(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function Ge(e,t,r,n,a,i,l){l===void 0&&(l=$e);var m=a.findIndex(function(k){return k}),S=e.slice(0,m);!t&&!r.startsWith(S)&&(t=S,r=S+r,n=n+S.length);for(var p=r.length,h=e.length,c={},x=new Array(p),y=0;y<p;y++){x[y]=-1;for(var s=0,I=h;s<I;s++){var C=l({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:s});if(C&&c[s]!==!0){x[y]=s,c[s]=!0;break}}}for(var g=n;g<p&&(x[g]===-1||!i(r[g]));)g++;var B=g===p||x[g]===-1?h:x[g];for(g=n-1;g>0&&x[g]===-1;)g--;var F=g===-1||x[g]===-1?0:x[g]+1;return F>B?B:n-F<B-n?F:B}function me(e,t,r,n){var a=e.length;if(t=Ke(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Ze(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ae(e[r])||ae(e[r-1]));return t}function Ne(e,t,r,n,a,i){i===void 0&&(i=q);var l=Me(function(s,I){var C,g;return pe(s)?(g="",C=""):typeof s=="number"||I?(g=typeof s=="number"?be(s):s,C=n(g)):(g=a(s,void 0),C=n(g)),{formattedValue:C,numAsString:g}}),m=T.useState(function(){return l(Y(e)?t:e,r)}),S=m[0],p=m[1],h=function(s,I){s.formattedValue!==S.formattedValue&&p({formattedValue:s.formattedValue,numAsString:s.value}),i(s,I)},c=e,x=r;Y(e)&&(c=S.numAsString,x=!0);var y=l(c,x);return T.useMemo(function(){p(y)},[y.formattedValue]),[S,h]}function qe(e){return e.replace(/[^0-9]/g,"")}function ze(e){return e}function He(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,i=e.getInputRef,l=e.format;l===void 0&&(l=ze);var m=e.removeFormatting;m===void 0&&(m=qe);var S=e.defaultValue,p=e.valueIsNumericString,h=e.onValueChange,c=e.isAllowed,x=e.onChange;x===void 0&&(x=q);var y=e.onKeyDown;y===void 0&&(y=q);var s=e.onMouseUp;s===void 0&&(s=q);var I=e.onFocus;I===void 0&&(I=q);var C=e.onBlur;C===void 0&&(C=q);var g=e.value,B=e.getCaretBoundary;B===void 0&&(B=Ze);var F=e.isValidInputCharacter;F===void 0&&(F=ae);var k=e.isCharacterSame,j=Se(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),z=Ne(g,S,!!p,l,m,h),P=z[0],V=P.formattedValue,L=P.numAsString,W=z[1],M=T.useRef(),U=T.useRef({formattedValue:V,numAsString:L}),$=function(o,u){U.current={formattedValue:o.formattedValue,numAsString:o.value},W(o,u)},J=T.useState(!1),ee=J[0],d=J[1],f=T.useRef(null),N=T.useRef({setCaretTimeout:null,focusTimeout:null});T.useEffect(function(){return d(!0),function(){clearTimeout(N.current.setCaretTimeout),clearTimeout(N.current.focusTimeout)}},[]);var R=l,A=function(o,u){var v=parseFloat(u);return{formattedValue:o,value:u,floatValue:isNaN(v)?void 0:v}},E=function(o,u,v){o.selectionStart===0&&o.selectionEnd===o.value.length||(H(o,u),N.current.setCaretTimeout=setTimeout(function(){o.value===v&&o.selectionStart!==u&&H(o,u)},0))},O=function(o,u,v){return me(o,u,B(o),v)},Q=function(o,u,v){var w=B(u),_=Ge(u,V,o,v,w,F,k);return _=me(u,_,w),_},oe=function(o){var u=o.formattedValue;u===void 0&&(u="");var v=o.input,w=o.source,_=o.event,D=o.numAsString,b;if(v){var K=o.inputValue||v.value,G=ce(v);v.value=u,b=Q(K,u,G),b!==void 0&&E(v,b,u)}u!==V&&$(A(u,D),{event:_,source:w})};T.useEffect(function(){var o=U.current,u=o.formattedValue,v=o.numAsString;(V!==u||L!==v)&&$(A(V,L),{event:void 0,source:re.props})},[V,L]);var te=f.current?ce(f.current):void 0,ne=typeof window<"u"?T.useLayoutEffect:T.useEffect;ne(function(){var o=f.current;if(V!==U.current.formattedValue&&o){var u=Q(U.current.formattedValue,V,te);o.value=V,E(o,u,V)}},[V]);var ue=function(o,u,v){var w=u.target,_=M.current?Pe(M.current,w.selectionEnd):Ve(V,o),D=Object.assign(Object.assign({},_),{lastValue:V}),b=m(o,D),K=R(b);if(b=m(K,void 0),c&&!c(A(K,b))){var G=u.target,Z=ce(G),fe=Q(o,V,Z);return G.value=V,E(G,fe,V),!1}return oe({formattedValue:K,numAsString:b,inputValue:o,event:u,source:v,input:u.target}),!0},le=function(o,u){u===void 0&&(u=0);var v=o.selectionStart,w=o.selectionEnd;M.current={selectionStart:v,selectionEnd:w+u}},De=function(o){var u=o.target,v=u.value,w=ue(v,o,re.event);w&&x(o),M.current=void 0},Ie=function(o){var u=o.target,v=o.key,w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b;v==="ArrowLeft"||v==="Backspace"?b=Math.max(w-1,0):v==="ArrowRight"?b=Math.min(w+1,D.length):v==="Delete"&&(b=w);var K=0;v==="Delete"&&w===_&&(K=1);var G=v==="ArrowLeft"||v==="ArrowRight";if(b===void 0||w!==_&&!G){y(o),le(u,K);return}var Z=b;if(G){var fe=v==="ArrowLeft"?"left":"right";Z=O(D,b,fe),Z!==b&&o.preventDefault()}else v==="Delete"&&!F(D[b])?Z=O(D,b,"right"):v==="Backspace"&&!F(D[b])&&(Z=O(D,b,"left"));Z!==b&&E(u,Z,D),y(o),le(u,K)},Ce=function(o){var u=o.target,v=function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;if(D===void 0&&(D=""),w===_){var b=O(D,w);b!==w&&E(u,b,D)}};v(),requestAnimationFrame(function(){v()}),s(o),le(u)},Ee=function(o){o.persist&&o.persist();var u=o.target,v=o.currentTarget;f.current=u,N.current.focusTimeout=setTimeout(function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b=O(D,w);b!==w&&!(w===0&&_===D.length)&&E(u,b,D),I(Object.assign(Object.assign({},o),{currentTarget:v}))},0)},Re=function(o){f.current=null,clearTimeout(N.current.focusTimeout),clearTimeout(N.current.setCaretTimeout),C(o)},Ae=ee&&We()?"numeric":void 0,ve=Object.assign({inputMode:Ae},j,{type:t,value:V,onChange:De,onKeyDown:Ie,onMouseUp:Ce,onFocus:Ee,onBlur:Re});if(r==="text")return a?X.createElement(X.Fragment,null,a(V,j)||null):X.createElement("span",Object.assign({},j,{ref:i}),V);if(n){var Oe=n;return X.createElement(Oe,Object.assign({},ve,{ref:i}))}return X.createElement("input",Object.assign({},ve,{ref:i}))}function he(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var i=t.suffix;i===void 0&&(i="");var l=t.allowNegative,m=t.thousandsGroupStyle;if(m===void 0&&(m="thousand"),e===""||e==="-")return e;var S=ie(t),p=S.thousandSeparator,h=S.decimalSeparator,c=r!==0&&e.indexOf(".")!==-1||r&&n,x=se(e,l),y=x.beforeDecimal,s=x.afterDecimal,I=x.addNegation;return r!==void 0&&(s=ye(s,r,!!n)),p&&(y=Le(y,p,m)),a&&(y=a+y),i&&(s=s+i),I&&(y="-"+y),e=y+(c&&h||"")+s,e}function ie(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function Je(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),i=n.test(e);return e=e.replace(/-/g,""),a&&!i&&t&&(e="-"+e),e}function Qe(e,t){return new RegExp("(^-)|[0-9]|"+xe(e),"g")}function Xe(e,t,r){return e===""?!0:!t?.match(/\d/)&&!r?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function Ye(e,t,r){var n;t===void 0&&(t=Ue(e));var a=r.allowNegative,i=r.prefix;i===void 0&&(i="");var l=r.suffix;l===void 0&&(l="");var m=r.decimalScale,S=t.from,p=t.to,h=p.start,c=p.end,x=ie(r),y=x.allowedDecimalSeparators,s=x.decimalSeparator,I=e[c]===s;if(ae(e)&&(e===i||e===l)&&t.lastValue==="")return e;if(c-h===1&&y.indexOf(e[h])!==-1){var C=m===0?"":s;e=e.substring(0,h)+C+e.substring(h+1,e.length)}var g=function(f,N,R){var A=!1,E=!1;i.startsWith("-")?A=!1:f.startsWith("--")?(A=!1,E=!0):l.startsWith("-")&&f.length===l.length?A=!1:f[0]==="-"&&(A=!0);var O=A?1:0;return E&&(O=2),O&&(f=f.substring(O),N-=O,R-=O),{value:f,start:N,end:R,hasNegation:A}},B=g(e,h,c),F=B.hasNegation;n=B,e=n.value,h=n.start,c=n.end;var k=g(t.lastValue,S.start,S.end),j=k.start,z=k.end,P=k.value,V=e.substring(h,c);e.length&&P.length&&(j>P.length-l.length||z<i.length)&&!(V&&l.startsWith(V))&&(e=P);var L=0;e.startsWith(i)?L+=i.length:h<i.length&&(L=h),e=e.substring(L),c-=L;var W=e.length,M=e.length-l.length;e.endsWith(l)?W=M:(c>M||c>e.length-l.length)&&(W=c),e=e.substring(0,W),e=Je(F?"-"+e:e,a),e=(e.match(Qe(s))||[]).join("");var U=e.indexOf(s);e=e.replace(new RegExp(xe(s),"g"),function(f,N){return N===U?".":""});var $=se(e,a),J=$.beforeDecimal,ee=$.afterDecimal,d=$.addNegation;return p.end-p.start<S.end-S.start&&J===""&&I&&!parseFloat(ee)&&(e=d?"-":""),e}function et(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";a.fill(!1,0,r.length+(i?1:0));var l=e.length;return a.fill(!1,l-n.length+1,l+1),a}function tt(e){var t=ie(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var i=e.allowNegative;if(i===void 0&&(i=!0),r===n)throw new Error(`
|
|
1
|
+
import{al as X,r as T}from"./index-CAfO5bZA.js";import{s as Te}from"./index-COhUeoc4.js";import"./withFullScreenWrapper-Ddi5ZFiT.js";import"./Toolbar-D8UqfEZK.js";import"./FormClearHelper-D5uKQTmO.js";import"./sprintf-DpPCfzXw.js";import"./checkbox-B4vRKSUu.js";import"./createDownloadLinkElement-ZaXNnPK4.js";import"./slicedToArray-CBU6V2W3.js";import"./inherits-CTISURyg.js";import"./createSuper-DnUl9ga4.js";import"./FileDownload.esm-1LbRaFsH.js";const Be=Te("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function Se(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var re;(function(e){e.event="event",e.props="prop"})(re||(re={}));function q(){}function Fe(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(i,l){return i===t[l]})||(t=n,r=e.apply(void 0,n)),r}}function ae(e){return!!(e||"").match(/\d/)}function Y(e){return e==null}function _e(e){return typeof e=="number"&&isNaN(e)}function pe(e){return Y(e)||_e(e)||typeof e=="number"&&!isFinite(e)}function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function je(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Le(e,t,r){var n=je(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function Me(e){var t=T.useRef(e);t.current=e;var r=T.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function se(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),i=a[0],l=a[1]||"";return{beforeDecimal:i,afterDecimal:l,hasNegation:r,addNegation:n}}function ke(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function ye(e,t,r){for(var n="",a=r?"0":"",i=0;i<=t-1;i++)n+=e[i]||a;return n}function de(e,t){return Array(t+1).join(e)}function be(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],i=n[1];if(i=Number(i),!i)return r+a;a=a.replace(".","");var l=1+i,m=a.length;return l<0?a="0."+de("0",Math.abs(l))+a:l>=m?a=a+de("0",l-m):a=(a.substring(0,l)||"0")+"."+a.substring(l),r+a}function ge(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=se(e),i=a.beforeDecimal,l=a.afterDecimal,m=a.hasNegation,S=parseFloat("0."+(l||"0")),p=l.length<=t?"0."+l:S.toFixed(t),h=p.split("."),c=i;i&&Number(h[0])&&(c=i.split("").reverse().reduce(function(I,C,g){return I.length>g?(Number(I[0])+Number(C)).toString()+I.substring(1,I.length):C+I},h[0]));var x=ye(h[1]||"",t,r),y=m?"-":"",s=n?".":"";return""+y+c+s+x}function H(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Ve=Fe(function(e,t){for(var r=0,n=0,a=e.length,i=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[i-1-n]&&i-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:i-n}}}),Pe=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function Ke(e,t,r){return Math.min(Math.max(e,t),r)}function ce(e){return Math.max(e.selectionStart,e.selectionEnd)}function We(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ue(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function $e(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function Ge(e,t,r,n,a,i,l){l===void 0&&(l=$e);var m=a.findIndex(function(k){return k}),S=e.slice(0,m);!t&&!r.startsWith(S)&&(t=S,r=S+r,n=n+S.length);for(var p=r.length,h=e.length,c={},x=new Array(p),y=0;y<p;y++){x[y]=-1;for(var s=0,I=h;s<I;s++){var C=l({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:s});if(C&&c[s]!==!0){x[y]=s,c[s]=!0;break}}}for(var g=n;g<p&&(x[g]===-1||!i(r[g]));)g++;var B=g===p||x[g]===-1?h:x[g];for(g=n-1;g>0&&x[g]===-1;)g--;var F=g===-1||x[g]===-1?0:x[g]+1;return F>B?B:n-F<B-n?F:B}function me(e,t,r,n){var a=e.length;if(t=Ke(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Ze(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ae(e[r])||ae(e[r-1]));return t}function Ne(e,t,r,n,a,i){i===void 0&&(i=q);var l=Me(function(s,I){var C,g;return pe(s)?(g="",C=""):typeof s=="number"||I?(g=typeof s=="number"?be(s):s,C=n(g)):(g=a(s,void 0),C=n(g)),{formattedValue:C,numAsString:g}}),m=T.useState(function(){return l(Y(e)?t:e,r)}),S=m[0],p=m[1],h=function(s,I){s.formattedValue!==S.formattedValue&&p({formattedValue:s.formattedValue,numAsString:s.value}),i(s,I)},c=e,x=r;Y(e)&&(c=S.numAsString,x=!0);var y=l(c,x);return T.useMemo(function(){p(y)},[y.formattedValue]),[S,h]}function qe(e){return e.replace(/[^0-9]/g,"")}function ze(e){return e}function He(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,i=e.getInputRef,l=e.format;l===void 0&&(l=ze);var m=e.removeFormatting;m===void 0&&(m=qe);var S=e.defaultValue,p=e.valueIsNumericString,h=e.onValueChange,c=e.isAllowed,x=e.onChange;x===void 0&&(x=q);var y=e.onKeyDown;y===void 0&&(y=q);var s=e.onMouseUp;s===void 0&&(s=q);var I=e.onFocus;I===void 0&&(I=q);var C=e.onBlur;C===void 0&&(C=q);var g=e.value,B=e.getCaretBoundary;B===void 0&&(B=Ze);var F=e.isValidInputCharacter;F===void 0&&(F=ae);var k=e.isCharacterSame,j=Se(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),z=Ne(g,S,!!p,l,m,h),P=z[0],V=P.formattedValue,L=P.numAsString,W=z[1],M=T.useRef(),U=T.useRef({formattedValue:V,numAsString:L}),$=function(o,u){U.current={formattedValue:o.formattedValue,numAsString:o.value},W(o,u)},J=T.useState(!1),ee=J[0],d=J[1],f=T.useRef(null),N=T.useRef({setCaretTimeout:null,focusTimeout:null});T.useEffect(function(){return d(!0),function(){clearTimeout(N.current.setCaretTimeout),clearTimeout(N.current.focusTimeout)}},[]);var R=l,A=function(o,u){var v=parseFloat(u);return{formattedValue:o,value:u,floatValue:isNaN(v)?void 0:v}},E=function(o,u,v){o.selectionStart===0&&o.selectionEnd===o.value.length||(H(o,u),N.current.setCaretTimeout=setTimeout(function(){o.value===v&&o.selectionStart!==u&&H(o,u)},0))},O=function(o,u,v){return me(o,u,B(o),v)},Q=function(o,u,v){var w=B(u),_=Ge(u,V,o,v,w,F,k);return _=me(u,_,w),_},oe=function(o){var u=o.formattedValue;u===void 0&&(u="");var v=o.input,w=o.source,_=o.event,D=o.numAsString,b;if(v){var K=o.inputValue||v.value,G=ce(v);v.value=u,b=Q(K,u,G),b!==void 0&&E(v,b,u)}u!==V&&$(A(u,D),{event:_,source:w})};T.useEffect(function(){var o=U.current,u=o.formattedValue,v=o.numAsString;(V!==u||L!==v)&&$(A(V,L),{event:void 0,source:re.props})},[V,L]);var te=f.current?ce(f.current):void 0,ne=typeof window<"u"?T.useLayoutEffect:T.useEffect;ne(function(){var o=f.current;if(V!==U.current.formattedValue&&o){var u=Q(U.current.formattedValue,V,te);o.value=V,E(o,u,V)}},[V]);var ue=function(o,u,v){var w=u.target,_=M.current?Pe(M.current,w.selectionEnd):Ve(V,o),D=Object.assign(Object.assign({},_),{lastValue:V}),b=m(o,D),K=R(b);if(b=m(K,void 0),c&&!c(A(K,b))){var G=u.target,Z=ce(G),fe=Q(o,V,Z);return G.value=V,E(G,fe,V),!1}return oe({formattedValue:K,numAsString:b,inputValue:o,event:u,source:v,input:u.target}),!0},le=function(o,u){u===void 0&&(u=0);var v=o.selectionStart,w=o.selectionEnd;M.current={selectionStart:v,selectionEnd:w+u}},De=function(o){var u=o.target,v=u.value,w=ue(v,o,re.event);w&&x(o),M.current=void 0},Ie=function(o){var u=o.target,v=o.key,w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b;v==="ArrowLeft"||v==="Backspace"?b=Math.max(w-1,0):v==="ArrowRight"?b=Math.min(w+1,D.length):v==="Delete"&&(b=w);var K=0;v==="Delete"&&w===_&&(K=1);var G=v==="ArrowLeft"||v==="ArrowRight";if(b===void 0||w!==_&&!G){y(o),le(u,K);return}var Z=b;if(G){var fe=v==="ArrowLeft"?"left":"right";Z=O(D,b,fe),Z!==b&&o.preventDefault()}else v==="Delete"&&!F(D[b])?Z=O(D,b,"right"):v==="Backspace"&&!F(D[b])&&(Z=O(D,b,"left"));Z!==b&&E(u,Z,D),y(o),le(u,K)},Ce=function(o){var u=o.target,v=function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;if(D===void 0&&(D=""),w===_){var b=O(D,w);b!==w&&E(u,b,D)}};v(),requestAnimationFrame(function(){v()}),s(o),le(u)},Ee=function(o){o.persist&&o.persist();var u=o.target,v=o.currentTarget;f.current=u,N.current.focusTimeout=setTimeout(function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b=O(D,w);b!==w&&!(w===0&&_===D.length)&&E(u,b,D),I(Object.assign(Object.assign({},o),{currentTarget:v}))},0)},Re=function(o){f.current=null,clearTimeout(N.current.focusTimeout),clearTimeout(N.current.setCaretTimeout),C(o)},Ae=ee&&We()?"numeric":void 0,ve=Object.assign({inputMode:Ae},j,{type:t,value:V,onChange:De,onKeyDown:Ie,onMouseUp:Ce,onFocus:Ee,onBlur:Re});if(r==="text")return a?X.createElement(X.Fragment,null,a(V,j)||null):X.createElement("span",Object.assign({},j,{ref:i}),V);if(n){var Oe=n;return X.createElement(Oe,Object.assign({},ve,{ref:i}))}return X.createElement("input",Object.assign({},ve,{ref:i}))}function he(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var i=t.suffix;i===void 0&&(i="");var l=t.allowNegative,m=t.thousandsGroupStyle;if(m===void 0&&(m="thousand"),e===""||e==="-")return e;var S=ie(t),p=S.thousandSeparator,h=S.decimalSeparator,c=r!==0&&e.indexOf(".")!==-1||r&&n,x=se(e,l),y=x.beforeDecimal,s=x.afterDecimal,I=x.addNegation;return r!==void 0&&(s=ye(s,r,!!n)),p&&(y=Le(y,p,m)),a&&(y=a+y),i&&(s=s+i),I&&(y="-"+y),e=y+(c&&h||"")+s,e}function ie(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function Je(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),i=n.test(e);return e=e.replace(/-/g,""),a&&!i&&t&&(e="-"+e),e}function Qe(e,t){return new RegExp("(^-)|[0-9]|"+xe(e),"g")}function Xe(e,t,r){return e===""?!0:!t?.match(/\d/)&&!r?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function Ye(e,t,r){var n;t===void 0&&(t=Ue(e));var a=r.allowNegative,i=r.prefix;i===void 0&&(i="");var l=r.suffix;l===void 0&&(l="");var m=r.decimalScale,S=t.from,p=t.to,h=p.start,c=p.end,x=ie(r),y=x.allowedDecimalSeparators,s=x.decimalSeparator,I=e[c]===s;if(ae(e)&&(e===i||e===l)&&t.lastValue==="")return e;if(c-h===1&&y.indexOf(e[h])!==-1){var C=m===0?"":s;e=e.substring(0,h)+C+e.substring(h+1,e.length)}var g=function(f,N,R){var A=!1,E=!1;i.startsWith("-")?A=!1:f.startsWith("--")?(A=!1,E=!0):l.startsWith("-")&&f.length===l.length?A=!1:f[0]==="-"&&(A=!0);var O=A?1:0;return E&&(O=2),O&&(f=f.substring(O),N-=O,R-=O),{value:f,start:N,end:R,hasNegation:A}},B=g(e,h,c),F=B.hasNegation;n=B,e=n.value,h=n.start,c=n.end;var k=g(t.lastValue,S.start,S.end),j=k.start,z=k.end,P=k.value,V=e.substring(h,c);e.length&&P.length&&(j>P.length-l.length||z<i.length)&&!(V&&l.startsWith(V))&&(e=P);var L=0;e.startsWith(i)?L+=i.length:h<i.length&&(L=h),e=e.substring(L),c-=L;var W=e.length,M=e.length-l.length;e.endsWith(l)?W=M:(c>M||c>e.length-l.length)&&(W=c),e=e.substring(0,W),e=Je(F?"-"+e:e,a),e=(e.match(Qe(s))||[]).join("");var U=e.indexOf(s);e=e.replace(new RegExp(xe(s),"g"),function(f,N){return N===U?".":""});var $=se(e,a),J=$.beforeDecimal,ee=$.afterDecimal,d=$.addNegation;return p.end-p.start<S.end-S.start&&J===""&&I&&!parseFloat(ee)&&(e=d?"-":""),e}function et(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";a.fill(!1,0,r.length+(i?1:0));var l=e.length;return a.fill(!1,l-n.length+1,l+1),a}function tt(e){var t=ie(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var i=e.allowNegative;if(i===void 0&&(i=!0),r===n)throw new Error(`
|
|
2
2
|
Decimal separator can't be same as thousand separator.
|
|
3
3
|
thousandSeparator: `+r+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
4
4
|
decimalSeparator: `+n+` (default value for decimalSeparator is .)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l}from"./es6-
|
|
1
|
+
import{e as l}from"./es6-D2SokxS6.js";import"./index-CAfO5bZA.js";const{DISALLOWED:d}=l;class a{constructor(e,t){this.writer=e,this.fileEntry=t}async write(e){if(typeof e=="object"){if(e.type==="write"){if(Number.isInteger(e.position)&&e.position>=0&&(this.writer.seek(e.position),this.writer.position!==e.position&&(await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.truncate(e.position)}),this.writer.seek(e.position))),!("data"in e))throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. write requires a data argument","SyntaxError");e=e.data}else if(e.type==="seek")if(Number.isInteger(e.position)&&e.position>=0){if(this.writer.seek(e.position),this.writer.position!==e.position)throw new DOMException("seeking position failed","InvalidStateError");return}else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. seek requires a position argument","SyntaxError");else if(e.type==="truncate")return new Promise(t=>{if(Number.isInteger(e.size)&&e.size>=0)this.writer.onwriteend=i=>t(),this.writer.truncate(e.size);else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. truncate requires a size argument","SyntaxError")})}await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.write(new Blob([e]))})}close(){return new Promise(this.fileEntry.file.bind(this.fileEntry))}}class w{constructor(e,t=!0){this.file=e,this.kind="file",this.writable=t,this.readable=!0}get name(){return this.file.name}isSameEntry(e){return this.file.toURL()===e.file.toURL()}getFile(){return new Promise(this.file.file.bind(this.file))}createWritable(e){if(!this.writable)throw new DOMException(...d);return new Promise((t,i)=>this.file.createWriter(r=>{e.keepExistingData===!1?(r.onwriteend=s=>t(new a(r,this.file)),r.truncate(0)):t(new a(r,this.file))},i))}}class n{constructor(e,t=!0){this.dir=e,this.writable=t,this.readable=!0,this.kind="directory",this.name=e.name}isSameEntry(e){return this.dir.fullPath===e.dir.fullPath}async*entries(){const e=this.dir.createReader(),t=await new Promise(e.readEntries.bind(e));for(const i of t)yield[i.name,i.isFile?new w(i,this.writable):new n(i,this.writable)]}getDirectoryHandle(e,t){return new Promise((i,r)=>{this.dir.getDirectory(e,t,s=>{i(new n(s))},r)})}getFileHandle(e,t){return new Promise((i,r)=>this.dir.getFile(e,t,s=>i(new w(s)),r))}async removeEntry(e,t){const i=await this.getDirectoryHandle(e,{create:!1}).catch(r=>r.name==="TypeMismatchError"?this.getFileHandle(e,{create:!1}):r);if(i instanceof Error)throw i;return new Promise((r,s)=>{i instanceof n?t.recursive?i.dir.removeRecursively(()=>r(),s):i.dir.remove(()=>r(),s):i.file&&i.file.remove(()=>r(),s)})}}const p=(o={})=>new Promise((e,t)=>window.webkitRequestFileSystem(o._persistent,0,i=>e(new n(i.root)),t));export{w as FileHandle,n as FolderHandle,p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as a,E as y,_ as d,ar as m}from"./index-
|
|
1
|
+
import{r as a,E as y,_ as d,ar as m}from"./index-CAfO5bZA.js";var p=a.forwardRef(function(e,t){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(y,d({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});p.displayName="Close";function b(e){if(Array.isArray(e))return e}function h(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,s,u,o,l=[],n=!0,c=!1;try{if(u=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;n=!1}else for(;!(n=(i=u.call(r)).done)&&(l.push(i.value),l.length!==t);n=!0);}catch(f){c=!0,s=f}finally{try{if(!n&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw s}}return l}}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(e,t){return b(e)||h(e,t)||m(e,t)||v()}export{p as C,_};
|