streamlit-nightly 1.53.1.dev20260116__py3-none-any.whl → 1.53.1.dev20260117__py3-none-any.whl
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.
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +300 -300
- streamlit/static/static/js/{ErrorOutline.esm.CiSfK8ht.js → ErrorOutline.esm.CqVEQ-uJ.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.ItNjcEfs.js → FileDownload.esm.G-HJG6nt.js} +1 -1
- streamlit/static/static/js/{FileHelper.xS7f19FE.js → FileHelper.Bd4bPp0Y.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.N8_BCinn.js → FormClearHelper.B74VElyu.js} +1 -1
- streamlit/static/static/js/{InputInstructions.CrsdK7CQ.js → InputInstructions.ClBLOwfm.js} +1 -1
- streamlit/static/static/js/{Particles.BDlTHC3I.js → Particles.CyYskark.js} +1 -1
- streamlit/static/static/js/{ProgressBar.Bk2qeHfS.js → ProgressBar.vWX1Igzt.js} +1 -1
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.BcuPrPcw.js → StreamlitSyntaxHighlighter.BNhyeEtl.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.CP7XPz8I.js → TableChart.esm.Mk-Hvy1t.js} +1 -1
- streamlit/static/static/js/{Toolbar.DCJcLwve.js → Toolbar.NhlhlTzK.js} +1 -1
- streamlit/static/static/js/{WidgetLabelHelpIconInline.BPqxu1b-.js → WidgetLabelHelpIconInline.Ch9VDnrM.js} +1 -1
- streamlit/static/static/js/{base-input.x4muJJ13.js → base-input.DSh9H2uv.js} +1 -1
- streamlit/static/static/js/{checkbox.C5r4AIaH.js → checkbox.DCFAQrRB.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.C83kkEeT.js → createDownloadLinkElement.D5zpcd24.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.0sOWm4IB.js → data-grid-overlay-editor.GAqbIurd.js} +1 -1
- streamlit/static/static/js/{downloader.C_6FfoEv.js → downloader.C1MBZFo2.js} +1 -1
- streamlit/static/static/js/{embed.BnJ6-SK4.js → embed.CZG6oOsc.js} +1 -1
- streamlit/static/static/js/{es6.44_BWfFd.js → es6.toHnBzIb.js} +2 -2
- streamlit/static/static/js/{formatNumber.DhHZAosz.js → formatNumber.BsU-5o3V.js} +1 -1
- streamlit/static/static/js/{iconPosition.shOoQuRR.js → iconPosition.OKOYrH6A.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.savEE5Vs.js → iframeResizer.contentWindow.D6yxU4DL.js} +1 -1
- streamlit/static/static/js/{index.SjKkVSL7.js → index.-pgbbiGJ.js} +1 -1
- streamlit/static/static/js/{index.Dblsdn8d.js → index.0iCXW13-.js} +1 -1
- streamlit/static/static/js/{index.DfHm3P22.js → index.1sBZt_1I.js} +5 -5
- streamlit/static/static/js/{index.BCaCSVj6.js → index.5CwvMIZq.js} +1 -1
- streamlit/static/static/js/{index.CySNwKoN.js → index.AkleAg_w.js} +1 -1
- streamlit/static/static/js/{index.hX8_3tMP.js → index.B8mzpc1l.js} +1 -1
- streamlit/static/static/js/{index.Ch1TdQMG.js → index.BHWCIpbw.js} +1 -1
- streamlit/static/static/js/{index.BNzuyXeN.js → index.BU8aUWlo.js} +1 -1
- streamlit/static/static/js/{index.C6uOmY9O.js → index.BVbT0yWJ.js} +1 -1
- streamlit/static/static/js/{index.CQgiNpC7.js → index.BW0F_Pbs.js} +1 -1
- streamlit/static/static/js/{index.BYY3iuVE.js → index.BXqtIpgi.js} +1 -1
- streamlit/static/static/js/{index.SVJGpnpy.js → index.Bh0_7PvD.js} +1 -1
- streamlit/static/static/js/{index.BHpLZ7X6.js → index.Bhr3IHkD.js} +1 -1
- streamlit/static/static/js/{index.B6ewTTej.js → index.BkYhb--A.js} +1 -1
- streamlit/static/static/js/{index.DIsNrJpC.js → index.Blo8DAcU.js} +1 -1
- streamlit/static/static/js/{index.DcdD0ROn.js → index.Bs4E_0D7.js} +1 -1
- streamlit/static/static/js/{index.AdijUi9Z.js → index.C6LOxzFC.js} +1 -1
- streamlit/static/static/js/{index.B8Of3XXR.js → index.CGt5hnLi.js} +1 -1
- streamlit/static/static/js/{index.jZin0w6_.js → index.CJCEiqv2.js} +1 -1
- streamlit/static/static/js/{index.B5HlOnvq.js → index.COcj-WpN.js} +1 -1
- streamlit/static/static/js/{index.BNvP8E5Q.js → index.CV4niwLB.js} +1 -1
- streamlit/static/static/js/{index.C1coXTgf.js → index.CXLtvxrQ.js} +1 -1
- streamlit/static/static/js/{index.pzQTLx9j.js → index.C_w1nWis.js} +1 -1
- streamlit/static/static/js/{index.BZXk3Qxq.js → index.Ch4X_YdF.js} +1 -1
- streamlit/static/static/js/{index.DBtWixG1.js → index.CqywI2eW.js} +1 -1
- streamlit/static/static/js/{index.D_ziFad8.js → index.D0h2EJ_T.js} +1 -1
- streamlit/static/static/js/{index.D8BQH06Z.js → index.D7Hgmilz.js} +1 -1
- streamlit/static/static/js/{index.HjydQ4bj.js → index.D94k70Hg.js} +1 -1
- streamlit/static/static/js/{index.CF88nImM.js → index.DGrQJk9x.js} +1 -1
- streamlit/static/static/js/{index.CFlGfFvq.js → index.DJ8OTQbk.js} +1 -1
- streamlit/static/static/js/{index.BqtgAGnG.js → index.DR8Ty3j4.js} +1 -1
- streamlit/static/static/js/{index.BT7o4A9V.js → index.DRGDE5oo.js} +1 -1
- streamlit/static/static/js/{index.BhQvq6YD.js → index.DbCS2N3T.js} +1 -1
- streamlit/static/static/js/{index.BZI7jTDf.js → index.DhGqPx_f.js} +1 -1
- streamlit/static/static/js/{index.BkIReLGJ.js → index.Dl2MB5Tx.js} +1 -1
- streamlit/static/static/js/{index.BwnLQnAk.js → index.Dq0ZbGYZ.js} +1 -1
- streamlit/static/static/js/{index.DvZDNiBV.js → index.DwgEkDLk.js} +1 -1
- streamlit/static/static/js/{index.CrD2lwZG.js → index.E4x2UBkh.js} +1 -1
- streamlit/static/static/js/{index.D3LEkXqN.js → index.EOvPT8N-.js} +1 -1
- streamlit/static/static/js/{index.DO3HICut.js → index.MZ7ugsN-.js} +1 -1
- streamlit/static/static/js/{index.Bl7SMZUw.js → index.P0_E3iNi.js} +1 -1
- streamlit/static/static/js/{index.s44_OVd6.js → index.SBwNLdli.js} +1 -1
- streamlit/static/static/js/{index.BE7Rhig1.js → index.XgBfXgN1.js} +1 -1
- streamlit/static/static/js/{index.Ck2mQvBi.js → index.YRiVxrFw.js} +1 -1
- streamlit/static/static/js/{index.CZJkiRFm.js → index._t3w-7R0.js} +1 -1
- streamlit/static/static/js/{index.HsxzYHNf.js → index.dGk9EWLh.js} +1 -1
- streamlit/static/static/js/{index.pQvPlPcA.js → index.ia5Ub9p7.js} +1 -1
- streamlit/static/static/js/{index.DiwhD0Ic.js → index.qjO5OK90.js} +5 -5
- streamlit/static/static/js/{input.jAD-v9D6.js → input.Bavj6HHJ.js} +1 -1
- streamlit/static/static/js/{main.Cas0fuOs.js → main.dnUTEH_j.js} +1 -1
- streamlit/static/static/js/{memory.ENruL8Qk.js → memory.Czf1Sxzc.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DAOTdulh.js → number-overlay-editor.CRQIke3a.js} +1 -1
- streamlit/static/static/js/{pandasStylerUtils.DChYgcPq.js → pandasStylerUtils.agmr-LQ2.js} +1 -1
- streamlit/static/static/js/{sandbox.DWZYRCm0.js → sandbox.BlCiIomw.js} +1 -1
- streamlit/static/static/js/{styled-components.3lwVqgRW.js → styled-components.Bz3KSbhj.js} +1 -1
- streamlit/static/static/js/{throttle.DfOW1Cns.js → throttle.B1o314FW.js} +1 -1
- streamlit/static/static/js/{timepicker.CXHgL5f9.js → timepicker.3x4ndo9E.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DiW0GSDV.js → toConsumableArray.BeHbBK8g.js} +1 -1
- streamlit/static/static/js/uniqueId.Zn1vZBLX.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.DnPEt_f3.js → useBasicWidgetState.CFP4_PTk.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.BZEGSOVD.js → useIntlLocale.BJubkaPQ.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.MGVZMqyt.js → useTextInputAutoExpand.DBGwhM4R.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.CPl6CEx3.js → useUpdateUiValue.CyufNQfR.js} +1 -1
- streamlit/static/static/js/{useWaveformController.DOpzDyZu.js → useWaveformController.Dj5h0D8Y.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.DgKFTeif.js → withCalculatedWidth.D0IRb-7w.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.K1jkwhPu.js → withFullScreenWrapper.CHBnw0Co.js} +1 -1
- {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/RECORD +95 -95
- streamlit/static/static/js/uniqueId.Dfi3SGKZ.js +0 -1
- {streamlit_nightly-1.53.1.dev20260116.data → streamlit_nightly-1.53.1.dev20260117.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/top_level.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as D,r as a,k as P,l as U,a9 as S,aa as j,o as H,j as l,p as q,ab as K,ac as O,ad as _,ae as $,Y as w,af as A}from"./index.
|
|
1
|
+
import{z as D,r as a,k as P,l as U,a9 as S,aa as j,o as H,j as l,p as q,ab as K,ac as O,ad as _,ae as $,Y as w,af as A}from"./index.qjO5OK90.js";import{I as N}from"./InputInstructions.ClBLOwfm.js";import{u as Y}from"./useBasicWidgetState.CFP4_PTk.js";import{u as G,a as J,b as M}from"./useUpdateUiValue.CyufNQfR.js";import{u as Q}from"./uniqueId.Zn1vZBLX.js";import{I as X}from"./input.Bavj6HHJ.js";import"./FormClearHelper.B74VElyu.js";import"./inputUtils.CptNuJwn.js";import"./base-input.DSh9H2uv.js";const Z=D("div",{target:"eiqkja70"})("position:relative;");function tt({disabled:o,element:t,widgetMgr:s,fragmentId:u}){const[r,p]=a.useState(()=>W(s,t)??null),{width:T,elementRef:x}=P(),[i,m]=a.useState(!1),y=a.useCallback(()=>{p(t.default??null),m(!0)},[t.default]),[C,h]=Y({getStateFromWidgetMgr:W,getDefaultStateFromProto:et,getCurrStateFromProto:ot,updateWidgetMgrState:at,element:t,widgetMgr:s,fragmentId:u,onFormCleared:y});G(C,r,p,i);const[V,f]=a.useState(!1),e=U(),[b]=a.useState(()=>Q("text_input_")),{placeholder:F,formId:n,icon:d,maxChars:I}=t,g=a.useCallback(()=>{m(!1),h({value:r,fromUi:!0})},[r,h]),v=S({formId:n})?s.allowFormEnterToSubmit(n):i,E=V&&T>j(e.breakpoints.hideWidgetDetails),R=a.useCallback(()=>{i&&g(),f(!1)},[i,g]),z=a.useCallback(()=>{f(!0)},[]),L=J({formId:n,maxChars:I,setDirty:m,setUiValue:p,setValueWithSource:h}),k=M(n,g,i,s,u);return H(Z,{className:"stTextInput","data-testid":"stTextInput",ref:x,children:[l(O,{label:t.label,disabled:o,labelVisibility:q(t.labelVisibility?.value),htmlFor:b,children:t.help&&l(K,{content:t.help,label:t.label})}),l(X,{value:r??"",placeholder:F,onBlur:R,onFocus:z,onChange:L,onKeyPress:k,"aria-label":t.label,disabled:o,id:b,type:st(t),autoComplete:t.autocomplete,startEnhancer:d&&l(w,{"data-testid":"stTextInputIcon",iconValue:d,size:"lg"}),overrides:{Input:{style:{fontWeight:e.fontWeights.normal,minWidth:0,lineHeight:e.lineHeights.inputWidget,paddingRight:e.spacing.sm,paddingLeft:e.spacing.md,paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,"::placeholder":{color:e.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:({$isFocused:B})=>{const c=$(e.colors,B);return{height:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth,borderTopColor:c,borderRightColor:c,borderBottomColor:c,borderLeftColor:c,paddingLeft:d?e.spacing.sm:0}}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:e.iconSizes.lg,color:_(d)?e.colors.fadedText60:"inherit"}}}}),E&&l(N,{dirty:i,value:r??"",maxLength:I,inForm:S({formId:n}),allowEnterToSubmit:v})]})}function W(o,t){return o.getStringValue(t)??null}function et(o){return o.default??null}function ot(o){return o.value??null}function at(o,t,s,u){t.setStringValue(o,s.value,{fromUi:s.fromUi},u)}function st(o){return o.type===A.Type.PASSWORD?"password":"text"}const ht=a.memo(tt);export{ht as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as a,r as t,n as i,j as d,e}from"./index.
|
|
1
|
+
import{z as a,r as t,n as i,j as d,e}from"./index.qjO5OK90.js";import{D as c,a as l}from"./IFrameUtil.DefezniK.js";const m=a("iframe",{target:"eu9re3w0"})(({theme:o,disableScrolling:r})=>({width:"100%",height:"100%",colorScheme:"normal",border:"none",padding:o.spacing.none,margin:o.spacing.none,overflow:r?"hidden":void 0}));function n(o){return e(o)||o===""?void 0:o}function g({element:o}){const r=n(o.src),s=i(r)?void 0:n(o.srcdoc);return d(m,{className:"stIFrame","data-testid":"stIFrame",allow:l,disableScrolling:!o.scrolling,src:r,srcDoc:s,scrolling:o.scrolling?"auto":"no",sandbox:c,title:"st.iframe",tabIndex:o.tabIndex??void 0})}const F=t.memo(g);export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,E as S,_ as A,a_ as o,m as D,a$ as j,z as c,b0 as H,aA as v,l as P,k as G,o as f,j as a,p as q,q as x,P as F,ax as U,b1 as X,aa as Y}from"./index.
|
|
1
|
+
import{r as l,E as S,_ as A,a_ as o,m as D,a$ as j,z as c,b0 as H,aA as v,l as P,k as G,o as f,j as a,p as q,q as x,P as F,ax as U,b1 as X,aa as Y}from"./index.qjO5OK90.js";import{e as J,S as K,a as Q,b as Z}from"./embed.CZG6oOsc.js";import{W as ee}from"./WidgetLabelHelpIconInline.Ch9VDnrM.js";import{i as L,f as re}from"./formatNumber.BsU-5o3V.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";import"./numbro.B9_PXfzp.js";import"./sprintf.DpPCfzXw.js";var z=l.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))});z.displayName="ArrowDownward";var b=l.forwardRef(function(e,r){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return l.createElement(S,A({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:r}),l.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),l.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}))});b.displayName="ArrowUpward";function k(e,r){switch(r){case o.MetricColor.RED:return e.colors.redColor;case o.MetricColor.GREEN:return e.colors.greenColor;case o.MetricColor.ORANGE:return e.colors.orangeColor;case o.MetricColor.YELLOW:return e.colors.yellowColor;case o.MetricColor.BLUE:return e.colors.blueColor;case o.MetricColor.VIOLET:return e.colors.violetColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayColor}}function V(e,r){const t=D(e);switch(r){case o.MetricColor.RED:return e.colors.redBackgroundColor;case o.MetricColor.GREEN:return e.colors.greenBackgroundColor;case o.MetricColor.ORANGE:return e.colors.orangeBackgroundColor;case o.MetricColor.YELLOW:return e.colors.yellowBackgroundColor;case o.MetricColor.BLUE:return e.colors.blueBackgroundColor;case o.MetricColor.VIOLET:return e.colors.violetBackgroundColor;case o.MetricColor.PRIMARY:return j(e.colors.primary,t?.9:.7);default:return e.colors.grayBackgroundColor}}function oe(e,r){switch(r){case o.MetricColor.RED:return e.colors.redTextColor;case o.MetricColor.GREEN:return e.colors.greenTextColor;case o.MetricColor.ORANGE:return e.colors.orangeTextColor;case o.MetricColor.YELLOW:return e.colors.yellowTextColor;case o.MetricColor.BLUE:return e.colors.blueTextColor;case o.MetricColor.VIOLET:return e.colors.violetTextColor;case o.MetricColor.PRIMARY:return e.colors.primary;default:return e.colors.grayTextColor}}const te=c("div",{target:"e132k71j0"})(({theme:e,showBorder:r})=>({height:"100%",...r&&{border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:e.radii.default,overflow:"hidden"}})),ie=c("div",{target:"e132k71j1"})(({theme:e,showBorder:r})=>({...r&&{padding:`calc(${e.spacing.lg} - ${e.sizes.borderWidth})`}})),ae=c("div",{target:"e132k71j2"})(({theme:e,showBorder:r})=>({marginTop:r?void 0:e.spacing.lg,marginBottom:r?e.spacing.twoXL:void 0})),h=c("div",{target:"e132k71j3"})(({theme:e})=>({overflowWrap:"normal",textOverflow:"ellipsis",width:"100%",overflow:"hidden",whiteSpace:"nowrap",fontFamily:e.genericFonts.bodyFont,lineHeight:"normal",verticalAlign:"middle","& > div":{overflow:"hidden","& > p":{textOverflow:"ellipsis",overflow:"hidden"}}})),le=c(H,{target:"e132k71j4"})(({visibility:e})=>({marginBottom:0,display:e===v.Collapsed?"none":"grid",gridTemplateColumns:e===v.Collapsed?"initial":"auto 1fr",visibility:e===v.Hidden?"hidden":"visible"})),ne=c("div",{target:"e132k71j5"})(({theme:e})=>({fontSize:e.fontSizes.threeXL,color:e.colors.bodyText,paddingBottom:e.spacing.twoXS})),se=c("div",{target:"e132k71j6"})(({theme:e,metricColor:r,showArrow:t})=>({color:oe(e,r),backgroundColor:V(e,r),fontSize:e.fontSizes.sm,display:"inline-flex",flexDirection:"row",alignItems:"center",fontWeight:e.fontWeights.normal,borderRadius:e.radii.full,maxWidth:"100%",padding:`${e.spacing.threeXS} ${e.spacing.xs} ${e.spacing.threeXS} ${e.spacing.xs}`,...t&&{paddingLeft:e.spacing.twoXS}})),ce=1e3;function R(e,r){try{return re(Number(e),r)}catch{return e}}function de(e,r,t,i,p){const n=`metric_chart_${Math.random().toString(36).slice(2,10)}`,C=e.length===1?[e[0],e[0]]:e,s={$schema:"https://vega.github.io/schema/vega-lite/v5.json",width:Math.round(t),height:Math.round(Y("3.5rem")),data:{values:C.map((M,g)=>({x:g,y:M}))},layer:[{name:`${n}_mark`,mark:{type:"line",...r===o.ChartType.LINE&&{type:"line",strokeCap:"round",strokeWidth:i.sizes.metricStrokeWidth},...r===o.ChartType.BAR&&{type:"bar",cornerRadius:parseFloat(i.radii.full)},...r===o.ChartType.AREA&&{type:"area",color:V(i,p),opacity:1,line:{color:k(i,p),opacity:1,strokeWidth:i.sizes.metricStrokeWidth,strokeCap:"round"}}},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}},{name:`${n}_points`,mark:{type:"point",opacity:0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}},params:[{name:`${n}_hover_selection`,select:{type:"point",encodings:["x"],nearest:!0,on:e.length>ce?"mousemove{16}":"mousemove",clear:"mouseleave"}}]},{name:`${n}_highlighted_points`,transform:[{filter:{param:`${n}_hover_selection`,empty:!1}}],mark:{type:"point",filled:!0,size:65,tooltip:!0},encoding:{x:{field:"x",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}},y:{field:"y",type:"quantitative",axis:null,scale:{zero:!1,nice:!1}}}}],config:{view:{stroke:null},padding:{left:-3,right:-3,top:2,bottom:2},...r===o.ChartType.BAR&&{padding:{left:0,right:0,top:2,bottom:2}},mark:{tooltip:{content:"encoding"},color:k(i,p)}}};return s.config=Q(s.config,i),s}function ue({element:e}){const r=P(),t=l.useRef(null),{width:i,elementRef:p}=G(),{MetricDirection:m}=o,{body:n,label:C,delta:s,direction:M,color:g,labelVisibility:B,help:E,showBorder:w,chartData:d,chartType:T,format:y}=e,N=y&&L(n)?R(n,y):n,$=y&&s&&L(s)?R(s,y):s;let u=null;switch(M){case m.DOWN:u=z;break;case m.UP:u=b;break;case m.NONE:break}const I="0 threeXS 0 0",W=s!=="";return l.useEffect(()=>{if(d&&d.length>0&&t.current&&i>0){const O=de(d,T,i,r,g);J(t.current,O,{actions:!1,renderer:"svg",ast:!0,expr:Z,tooltip:{theme:"custom",formatTooltip:_=>`${_.y}`}})}},[d,g,r,i,T,t]),f(te,{className:"stMetric","data-testid":"stMetric",showBorder:w,children:[f(ie,{showBorder:w,children:[f(le,{"data-testid":"stMetricLabel",visibility:q(B?.value),children:[a(h,{children:a(x,{source:C,allowHTML:!1,isLabel:!0})}),E&&a(ee,{content:E,placement:F.TOP_RIGHT,label:C})]}),a(ne,{"data-testid":"stMetricValue",children:a(h,{children:a(x,{source:N,allowHTML:!1,isLabel:!0,inheritFont:!0})})}),W&&f(se,{"data-testid":"stMetricDelta",metricColor:g,showArrow:u!==null,children:[u&&a(U,{testid:u===b?"stMetricDeltaIcon-Up":"stMetricDeltaIcon-Down",content:u,size:"md",margin:I}),a(h,{children:a(x,{source:$,allowHTML:!1,isLabel:!0,inheritFont:!0})})]})]}),d&&d.length>0&&f("div",{ref:p,children:[a(X,{styles:[K]}),a(ae,{ref:t,"data-testid":"stMetricChart",showBorder:w})]})]})}const xe=l.memo(ue);export{xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as f,r as o,R as g,j as l,V as v}from"./index.
|
|
1
|
+
import{z as f,r as o,R as g,j as l,V as v}from"./index.qjO5OK90.js";const T=f("div",{target:"e1z085g90"})(()=>({lineHeight:0})),y=f("audio",{target:"e1z085g91"})(({theme:t})=>({width:"100%",height:t.sizes.minElementHeight,margin:0,padding:0})),h=v.getLogger("Audio");function L({element:t,endpoints:a,elementMgr:s}){const i=o.useRef(null),{startTime:n,endTime:d,loop:u,autoplay:p}=t,E=o.useMemo(()=>{if(!t.id)return!0;const e=s.getElementState(t.id,"preventAutoplay");return e||s.setElementState(t.id,"preventAutoplay",!0),e??!1},[t.id,s]);o.useEffect(()=>{i.current&&(i.current.currentTime=n)},[n]),o.useEffect(()=>{const e=i.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}},[t]),o.useEffect(()=>{const e=i.current;if(!e)return;let r=!1;const c=()=>{d>0&&e.currentTime>=d&&(u?(e.currentTime=n||0,e.play()):r||(r=!0,e.pause()))};return d>0&&e.addEventListener("timeupdate",c),()=>{e&&d>0&&e.removeEventListener("timeupdate",c)}},[d,u,n]),o.useEffect(()=>{const e=i.current;if(!e)return;const r=()=>{u&&(e.currentTime=n||0,e.play())};return e.addEventListener("ended",r),()=>{e&&e.removeEventListener("ended",r)}},[u,n]);const m=g(t.url),A=a.buildMediaURL(t.url);return l(T,{children:l(y,{className:"stAudio","data-testid":"stAudio",ref:i,controls:!0,autoPlay:p&&!E,src:A,onError:e=>{const r=e.currentTarget.src;h.error(`Client Error: Audio source error - ${r}`),a.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",r)},crossOrigin:m})})}const z=o.memo(L);export{z as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{J as P,r as u,V as ao,cq as L,cr as co,aL as io,l as lo,j as m,W as U,R as fo,cs as go,z as _,aM as V}from"./index.
|
|
1
|
+
import{J as P,r as u,V as ao,cq as L,cr as co,aL as io,l as lo,j as m,W as U,R as fo,cs as go,z as _,aM as V}from"./index.qjO5OK90.js";function Co(o,e,r,n){for(var t=-1,s=o==null?0:o.length;++t<s;)r=e(r,o[t],t,o);return r}function xo(o){return function(e){return o?.[e]}}var po={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ho=xo(po),mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo="\\u0300-\\u036f",So="\\ufe20-\\ufe2f",Ro="\\u20d0-\\u20ff",yo=bo+So+Ro,Eo="["+yo+"]",Fo=RegExp(Eo,"g");function wo(o){return o=P(o),o&&o.replace(mo,ho).replace(Fo,"")}var vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ko(o){return o.match(vo)||[]}var Bo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function To(o){return Bo.test(o)}var H="\\ud800-\\udfff",zo="\\u0300-\\u036f",Ao="\\ufe20-\\ufe2f",Uo="\\u20d0-\\u20ff",Io=zo+Ao+Uo,J="\\u2700-\\u27bf",Z="a-z\\xdf-\\xf6\\xf8-\\xff",Wo="\\xac\\xb1\\xd7\\xf7",Lo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Oo="\\u2000-\\u206f",Mo=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",G="A-Z\\xc0-\\xd6\\xd8-\\xde",jo="\\ufe0e\\ufe0f",q=Wo+Lo+Oo+Mo,Y="['’]",O="["+q+"]",$o="["+Io+"]",K="\\d+",No="["+J+"]",X="["+Z+"]",Q="[^"+H+q+K+J+Z+G+"]",Do="\\ud83c[\\udffb-\\udfff]",Po="(?:"+$o+"|"+Do+")",_o="[^"+H+"]",oo="(?:\\ud83c[\\udde6-\\uddff]){2}",eo="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+G+"]",Vo="\\u200d",M="(?:"+X+"|"+Q+")",Ho="(?:"+w+"|"+Q+")",j="(?:"+Y+"(?:d|ll|m|re|s|t|ve))?",$="(?:"+Y+"(?:D|LL|M|RE|S|T|VE))?",ro=Po+"?",to="["+jo+"]?",Jo="(?:"+Vo+"(?:"+[_o,oo,eo].join("|")+")"+to+ro+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qo=to+ro+Jo,Yo="(?:"+[No,oo,eo].join("|")+")"+qo,Ko=RegExp([w+"?"+X+"+"+j+"(?="+[O,w,"$"].join("|")+")",Ho+"+"+$+"(?="+[O,w+M,"$"].join("|")+")",w+"?"+M+"+"+j,w+"+"+$,Go,Zo,K,Yo].join("|"),"g");function Xo(o){return o.match(Ko)||[]}function Qo(o,e,r){return o=P(o),e=e,e===void 0?To(o)?Xo(o):ko(o):o.match(e)||[]}var oe="['’]",ee=RegExp(oe,"g");function re(o){return function(e){return Co(Qo(wo(e).replace(ee,"")),o,"")}}var te=re(function(o,e,r){return o+(r?"-":"")+e.toLowerCase()});const k=u.createContext(null);k.displayName="BidiComponentContext";const v=ao.getLogger("BidiComponent"),N="__",z="__streamlit_arrow_ref__",ne="$$STREAMLIT_INTERNAL_KEY",se=(o,e)=>{if(o&&typeof o=="object"&&!Array.isArray(o)){if(typeof o[z]=="string"){const n=o[z],t=e[n];if(t)try{return L(t)}catch{return null}return null}const r={};for(const[n,t]of Object.entries(o))if(t&&typeof t=="object"&&!Array.isArray(t)&&typeof t[z]=="string"){const s=t[z],a=e[s];if(a)try{r[n]=L(a)}catch{r[n]=null}else r[n]=null}else r[n]=t;return r}return o},ue=({arrowBlobs:o,arrowData:e,bytes:r,data:n,json:t,mixedJson:s})=>{switch(n){case"json":return t?JSON.parse(t):null;case"arrowData":return e??null;case"bytes":return r??null;case"mixed":{if(s&&o){const a=JSON.parse(s),i={};return Object.entries(o).forEach(([l,d])=>{d?.data&&(i[l]=d.data)}),se(a,i)}return null}case"any":case void 0:return null;default:co(n)}},ae=(o,e="--st")=>{const r={};return Object.entries(o).forEach(([n,t])=>{const s=te(n),a=`${e}-${s}`;if(typeof t=="boolean"){r[a]=t?"1":"0";return}if(t==null){r[a]="unset";return}if(Array.isArray(t)){r[a]=t.join(",");return}if(typeof t=="number"||typeof t=="string"){r[a]=String(t);return}r[a]="unset"}),r},ce=o=>{const e=[o.fontSizes.h1FontSize,o.fontSizes.h2FontSize,o.fontSizes.h3FontSize,o.fontSizes.h4FontSize,o.fontSizes.h5FontSize,o.fontSizes.h6FontSize],r=[o.fontWeights.h1FontWeight,o.fontWeights.h2FontWeight,o.fontWeights.h3FontWeight,o.fontWeights.h4FontWeight,o.fontWeights.h5FontWeight,o.fontWeights.h6FontWeight];return{primaryColor:o.colors.primary,backgroundColor:o.colors.bgColor,secondaryBackgroundColor:o.colors.secondaryBg,textColor:o.colors.bodyText,linkColor:o.colors.link,linkUnderline:o.linkUnderline,headingFont:o.genericFonts.headingFont,codeFont:o.genericFonts.codeFont,baseRadius:o.radii.default,buttonRadius:o.radii.button,baseFontSize:typeof o.fontSizes.baseFontSize=="number"?`${o.fontSizes.baseFontSize}px`:String(o.fontSizes.baseFontSize),baseFontWeight:o.fontWeights.normal,codeFontWeight:o.fontWeights.code,codeFontSize:o.fontSizes.codeFontSize,headingFontSizes:e,headingFontSize1:e[0],headingFontSize2:e[1],headingFontSize3:e[2],headingFontSize4:e[3],headingFontSize5:e[4],headingFontSize6:e[5],headingFontWeights:r,headingFontWeight1:r[0],headingFontWeight2:r[1],headingFontWeight3:r[2],headingFontWeight4:r[3],headingFontWeight5:r[4],headingFontWeight6:r[5],borderColor:o.colors.borderColor,dataframeBorderColor:o.colors.dataframeBorderColor,dataframeHeaderBackgroundColor:o.colors.dataframeHeaderBackgroundColor,codeBackgroundColor:o.colors.codeBackgroundColor,font:o.genericFonts.bodyFont,chartCategoricalColors:o.colors.chartCategoricalColors,chartSequentialColors:o.colors.chartSequentialColors,chartDivergingColors:o.colors.chartDivergingColors,headingColor:o.colors.headingColor,borderColorLight:o.colors.borderColorLight,codeTextColor:o.colors.codeTextColor,widgetBorderColor:o.colors.widgetBorderColor||"transparent",redColor:o.colors.redColor,orangeColor:o.colors.orangeColor,yellowColor:o.colors.yellowColor,blueColor:o.colors.blueColor,greenColor:o.colors.greenColor,violetColor:o.colors.violetColor,grayColor:o.colors.grayColor,redBackgroundColor:o.colors.redBackgroundColor,orangeBackgroundColor:o.colors.orangeBackgroundColor,yellowBackgroundColor:o.colors.yellowBackgroundColor,blueBackgroundColor:o.colors.blueBackgroundColor,greenBackgroundColor:o.colors.greenBackgroundColor,violetBackgroundColor:o.colors.violetBackgroundColor,grayBackgroundColor:o.colors.grayBackgroundColor,redTextColor:o.colors.redTextColor,orangeTextColor:o.colors.orangeTextColor,yellowTextColor:o.colors.yellowTextColor,blueTextColor:o.colors.blueTextColor,greenTextColor:o.colors.greenTextColor,violetTextColor:o.colors.violetTextColor,grayTextColor:o.colors.grayTextColor}},ie=u.memo(({element:o,children:e,widgetMgr:r,fragmentId:n,componentRegistry:t})=>{const{arrowData:s,bytes:a,componentName:i,cssContent:l,cssSourcePath:d,data:f,htmlContent:g,id:c,jsContent:b,json:p,jsSourcePath:h,mixed:C}=o,y=u.useMemo(()=>({id:o.id,formId:o.formId}),[o.id,o.formId]),B=u.useCallback(()=>{const F=r.getJsonValue(y);if(!F)return{};try{return JSON.parse(F)}catch(I){const R=io(I);return v.warn("Failed to parse widget JSON value; returning empty object.",{widgetId:y.id,formId:y.formId,error:R.message}),{}}},[y,r]),T=u.useMemo(()=>ue({arrowBlobs:C?.arrowBlobs||void 0,arrowData:s?.data||void 0,bytes:a,data:f,json:p,mixedJson:C?.json||void 0}),[f,p,s?.data,a,C?.json,C?.arrowBlobs]),S=lo(),E=u.useMemo(()=>ce(S),[S]),x=u.useMemo(()=>({componentName:i,componentRegistry:t,cssContent:l?.trim(),cssSourcePath:d||void 0,data:T,fragmentId:n,getWidgetValue:B,htmlContent:g?.trim(),id:c,formId:o.formId||void 0,jsContent:b||void 0,jsSourcePath:h||void 0,theme:E,widgetMgr:r}),[i,t,l,d,n,B,g,c,o.formId,b,h,T,E,r]);return m(k.Provider,{value:x,children:e})}),no=(o,e)=>{if(o instanceof Error)return o;const r=e?`${e}: ${String(o)}`:String(o);return new Error(r)},A=(o,e,r)=>{const n=no(o,r);v.error(`BidiComponent Error: ${n.message}`,o),e(n)},de=(o,e)=>{try{const n=document.createRange().createContextualFragment(o);e.appendChild(n)}catch(r){v.warn("createContextualFragment failed, falling back to innerHTML",r),e.innerHTML=o}},so=({containerRef:o,setError:e,skip:r=!1})=>{const n=u.useRef(null),{htmlContent:t,cssContent:s,cssSourcePath:a,componentName:i,componentRegistry:{getBidiComponentURL:l}}=U(k),d=u.useMemo(()=>{if(a)return l(i,a)},[i,a,l]),f=fo(d);return u.useEffect(()=>{if(r)return;const g=o.current;if(g)try{if(n.current?.parentNode===g&&g.removeChild(n.current),n.current=document.createElement("div"),t){const c=document.createElement("div");de(t,c),n.current.appendChild(c)}if(s){const c=document.createElement("style");c.textContent=s,n.current.appendChild(c)}else if(d){const c=document.createElement("link");c.href=d,c.rel="stylesheet",f&&(c.crossOrigin=f),c.onerror=()=>{A(new Error(`Failed to load CSS from ${d}`),e)},n.current.appendChild(c)}g.appendChild(n.current)}catch(c){A(c,e,"Failed to process HTML/CSS content")}},[t,s,o,f,d,e,r]),n};class le{constructor(){this.hashSeed=2166136261,this.hashPrime=16777619,this.cache=new Map}computeHash(e){let r=this.hashSeed;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r>>>0,this.hashPrime)>>>0;return(r>>>0).toString(16)}getOrCreateUrlForJs(e,r){const n=this.computeHash(e),t=this.cache.get(n);if(t)return{url:t,hash:n};const s=`${e}
|
|
2
2
|
//# sourceURL=${r}-${n}.js`,a=new Blob([s],{type:"text/javascript"}),i=URL.createObjectURL(a);return this.cache.set(n,i),{url:i,hash:n}}}const fe=new le,ge="events";function Ce(o){if(o.includes(N))throw new Error("Base component id must not contain the delimiter sequence");return`${ne}_${o}${N}${ge}`}const D=async({componentId:o,componentIdForWidgetMgr:e,componentName:r,data:n,formId:t,fragmentId:s,getWidgetValue:a,moduleUrl:i,parentElement:l,widgetMgr:d})=>{const f=await import(i);if(!f)throw new Error("JS module does not exist.");if(!f.default||typeof f.default!="function")throw new Error("JS module does not have a default export function.");const g=(b,p)=>{let h={};try{h={...a(),[b]:p}}catch(C){v.error(`Failed to get existing value for ${b}`,C),h={[b]:p}}d.setJsonValue({id:e,formId:t},h,{fromUi:!0},s)},c=(b,p)=>{if(t){v.warn("BidiComponent: setTriggerValue ignored inside st.form. Triggers are not allowed in forms; use setStateValue and form submit instead.");return}const h=Ce(e);d.setTriggerValue({id:h,formId:t},{fromUi:!0},s,{event:b,value:p})};return f.default({name:r,data:n,key:o,parentElement:l,setStateValue:g,setTriggerValue:c})},uo=({containerRef:o,setError:e,skip:r=!1})=>{const t=`st-bidi-component-${u.useMemo(()=>go(),[])}`,{componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,id:f,jsContent:g,jsSourcePath:c,theme:b,widgetMgr:p,componentRegistry:{getBidiComponentURL:h}}=U(k),C=u.useMemo(()=>{if(c)return h(s,c)},[s,c,h]),y=u.useRef(),B=u.useRef(),T=u.useRef(!1);u.useEffect(()=>{const{current:S}=o;if(r||!g&&!C||!S)return;(async()=>{try{if(g){const{url:x}=fe.getOrCreateUrlForJs(g,`st-bidi-${s}`);y.current=await D({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}else if(C){const x=C;try{await new Promise((F,I)=>{const R=document.createElement("script");R.type="module",R.src=x,R.async=!0,R.onload=()=>F(),R.onerror=()=>I(new Error(`Failed to load script from ${C}`)),document.head.appendChild(R),B.current=R}),y.current=await D({componentId:t,componentIdForWidgetMgr:f,componentName:s,data:a,formId:i,fragmentId:l,getWidgetValue:d,moduleUrl:x,parentElement:S,widgetMgr:p})}catch(F){throw no(F,`Failed to load or execute script from ${C}`)}}}catch(x){T.current||A(x,e)}})()},[t,s,o,a,i,l,d,f,g,C,e,r,p,b]),u.useEffect(()=>()=>{T.current=!0;const S=y.current;S&&Promise.resolve(S).then(x=>{x?.()}).catch(x=>{v.error("Failed to run custom component cleanup",x)});const E=B.current;E?.parentNode&&E.parentNode.removeChild(E)},[])},xe=_("div",{target:"epzkg1s0"})(({cssCustomProperties:o})=>({...o,display:"contents"})),W=_("div",{target:"epzkg1s1"})({width:"100%",height:"100%"}),pe=u.memo(()=>{const o=u.useRef(null),e=u.useRef(null),[r,n]=u.useState(!1),[t,s]=u.useState(null),{id:a}=U(k);u.useEffect(()=>{if(o.current)try{if(o.current.shadowRoot){e.current=o.current.shadowRoot,n(!0);return}e.current=o.current.attachShadow({mode:"open"}),n(!0)}catch(l){A(l,s,"Failed to create shadow DOM")}},[a]);const i=!r||!!t;return so({containerRef:e,setError:s,skip:i}),uo({containerRef:e,setError:s,skip:i}),t?m(V,{name:"BidiComponent Error",message:t.message,stack:t.stack}):m(W,{ref:o,"data-testid":"stBidiComponentIsolated"})}),he=u.memo(()=>{const o=u.useRef(null),[e,r]=u.useState(null),n=!!e;return so({containerRef:o,setError:r,skip:n}),uo({containerRef:o,setError:r,skip:n}),e?m(V,{name:"BidiComponent Error",message:e.message,stack:e.stack}):m(W,{ref:o,"data-testid":"stBidiComponentRegular"})}),me=({children:o})=>{const{theme:e}=U(k),r=u.useMemo(()=>ae(e),[e]);return m(xe,{cssCustomProperties:r,children:o})},be=({element:o,widgetMgr:e,fragmentId:r,componentRegistry:n})=>{const{isolateStyles:t}=o;return m(ie,{element:o,widgetMgr:e,fragmentId:r,componentRegistry:n,children:m(W,{className:"stBidiComponent",children:m(me,{children:t?m(pe,{}):m(he,{})})})})},Re=u.memo(be);export{k as BidiComponentContext,Re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{get as O}from"./index.
|
|
1
|
+
import{get as O}from"./index.D0h2EJ_T.js";import{K as P}from"./index.qjO5OK90.js";const s=[{description:"angry face",emoji:"😠",emoticons:[">:(",">:[",">:-(",">:-[",">=(",">=[",">=-(",">=-["],name:"angry",tags:["mad","annoyed"]},{description:"smiling face with smiling eyes",emoji:"😊",emoticons:[':")',':"]',':"D',':-")',':-"]',':-"D','=")','="]','="D','=-")','=-"]','=-"D'],name:"blush",tags:["proud"]},{description:"broken heart",emoji:"💔",emoticons:["<\\3","</3"],name:"broken_heart",tags:[]},{description:"confused face",emoji:"😕",emoticons:[":/",":\\",":-/",":-\\","=/","=\\","=-/","=-\\"],name:"confused",tags:[]},{description:"crying face",emoji:"😢",emoticons:[":,(",":,[",":,|",":,-(",":,-[",":,-|",":'(",":'[",":'|",":'-(",":'-[",":'-|","=,(","=,[","=,|","=,-(","=,-[","=,-|","='(","='[","='|","='-(","='-[","='-|","T-T"],name:"cry",tags:["sad","tear"]},{description:"frowning face with open mouth",emoji:"😦",emoticons:[":(",":[",":-(",":-[","=(","=[","=-(","=-["],name:"frowning",tags:[]},{description:"red heart",emoji:"❤️",emoticons:["<3"],name:"heart",tags:["love"]},{description:"angry face with horns",emoji:"👿",emoticons:["]:(","]:[","]:-(","]:-[","]=(","]=[","]=-(","]=-["],name:"imp",tags:["angry","devil","evil","horns"]},{description:"smiling face with halo",emoji:"😇",emoticons:["o:)","o:]","o:D","o:-)","o:-]","o:-D","o=)","o=]","o=D","o=-)","o=-]","o=-D","O:)","O:]","O:D","O:-)","O:-]","O:-D","O=)","O=]","O=D","O=-)","O=-]","O=-D","0:)","0:]","0:D","0:-)","0:-]","0:-D","0=)","0=]","0=D","0=-)","0=-]","0=-D"],name:"innocent",tags:["angel"]},{description:"face with tears of joy",emoji:"😂",emoticons:[":,)",":,]",":,D",":,-)",":,-]",":,-D",":')",":']",":'D",":'-)",":'-]",":'-D","=,)","=,]","=,D","=,-)","=,-]","=,-D","=')","=']","='D","='-)","='-]","='-D"],name:"joy",tags:["tears"]},{description:"kissing face",emoji:"😗",emoticons:[":*",":-*","=*","=-*"],name:"kissing",tags:[]},{description:"grinning squinting face",emoji:"😆",emoticons:["x)","x]","xD","x-)","x-]","x-D","X)","X]","X-)","X-]","X-D"],name:"laughing",tags:["happy","haha"]},{description:"man",emoji:"👨",emoticons:[":3",":-3","=3","=-3",";3",";-3","x3","x-3","X3","X-3"],name:"man",tags:["mustache","father","dad"]},{description:"neutral face",emoji:"😐",emoticons:[":|",":-|","=|","=-|"],name:"neutral_face",tags:["meh"]},{description:"face without mouth",emoji:"😶",emoticons:[":-"],name:"no_mouth",tags:["mute","silence"]},{description:"face with open mouth",emoji:"😮",emoticons:[":o",":O",":0",":-o",":-O",":-0","=o","=O","=0","=-o","=-O","=-0"],name:"open_mouth",tags:["surprise","impressed","wow"]},{description:"enraged face",emoji:"😡",emoticons:[":@",":-@","=@","=-@"],name:"rage",tags:["angry"]},{description:"grinning face with smiling eyes",emoji:"😄",emoticons:[":D",":-D","=D","=-D"],name:"smile",tags:["happy","joy","laugh","pleased"]},{description:"grinning face with big eyes",emoji:"😃",emoticons:[":)",":]",":-)",":-]","=)","=]","=-)","=-]"],name:"smiley",tags:["happy","joy","haha"]},{description:"smiling face with horns",emoji:"😈",emoticons:["]:)","]:]","]:D","]:-)","]:-]","]:-D","]=)","]=]","]=D","]=-)","]=-]","]=-D"],name:"smiling_imp",tags:["devil","evil","horns"]},{description:"loudly crying face",emoji:"😭",emoticons:[":,'(",":,'[",":,'-(",":,'-[",":',(",":',[",":',-(",":',-[","=,'(","=,'[","=,'-(","=,'-[","=',(","=',[","=',-(","=',-["],name:"sob",tags:["sad","cry","bawling"]},{description:"face with tongue",emoji:"😛",emoticons:[":p",":P",":d",":-p",":-P",":-d","=p","=P","=d","=-p","=-P","=-d"],name:"stuck_out_tongue",tags:[]},{description:"squinting face with tongue",emoji:"😝",emoticons:["xP","x-p","x-P","x-d","Xp","Xd","X-p","X-P","X-d"],name:"stuck_out_tongue_closed_eyes",tags:["prank"]},{description:"winking face with tongue",emoji:"😜",emoticons:[";p",";P",";d",";-p",";-P",";-d"],name:"stuck_out_tongue_winking_eye",tags:["prank","silly"]},{description:"smiling face with sunglasses",emoji:"😎",emoticons:["8)","8]","8D","8-)","8-]","8-D","B)","B]","B-)","B-]","B-D"],name:"sunglasses",tags:["cool"]},{description:"downcast face with sweat",emoji:"😓",emoticons:[",:(",",:[",",:-(",",:-[",",=(",",=[",",=-(",",=-[","':(","':[","':-(","':-[","'=(","'=[","'=-(","'=-["],name:"sweat",tags:[]},{description:"grinning face with sweat",emoji:"😅",emoticons:[",:)",",:]",",:D",",:-)",",:-]",",:-D",",=)",",=]",",=D",",=-)",",=-]",",=-D","':)","':]","':D","':-)","':-]","':-D","'=)","'=]","'=D","'=-)","'=-]","'=-D"],name:"sweat_smile",tags:["hot"]},{description:"unamused face",emoji:"😒",emoticons:[":$",":s",":z",":S",":Z",":-$",":-s",":-z",":-S",":-Z","=$","=s","=z","=S","=Z","=-$","=-s","=-z","=-S","=-Z"],name:"unamused",tags:["meh"]},{description:"winking face",emoji:"😉",emoticons:[";)",";]",";D",";-)",";-]",";-D"],name:"wink",tags:["flirt"]}],x=/:\+1:|:-1:|:[\w-]+:/g,b=/(^|\s)[@$|*'",;.=:\-)([\]\\/<>038BOopPsSdDxXzZ]{2,5}/g,k=/(?:_|-(?!1))/g,X={padSpaceAfter:!1,emoticon:!1,accessible:!1},T=f=>{const t=Object.assign({},X,f),r=!!t.padSpaceAfter,u=!!t.emoticon,g=!!t.accessible;function d(e,i){return{type:"text",value:e,data:{hName:"span",hProperties:{role:"img",ariaLabel:i},hChildren:[{type:"text",value:e}]}}}function D(e){const i=s.find(o=>o.emoticons.includes(e)),n=s.find(o=>o.emoticons.includes(e.slice(0,-1))),a=s.find(o=>o.emoticons.includes(e.slice(1))),c=s.find(o=>o.emoticons.includes(e.slice(1,-1))),m=i||n||a||c;if(!m)return!1;const w=!(i||a)&&(c||n)?e.slice(-1):"",y=!(i||n)&&(c||a)?e.slice(0,1):"",_=r?" ":"",l=y+m.emoji+_+w;return g?d(l,m.name+" emoticon"):l}function h(e){let i=O(e);if(typeof i>"u")return!1;if(r&&(i=i+" "),g){const n=e.slice(1,-1).replace(k," ")+" emoji";return d(i,n)}return i}const p=[[x,h]];u&&p.push([b,D]);function j(e){P(e,p)}return j};export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{av as j,j as m,aw as U,ae as z,P as $,ax as _,q as X,ay as q,m as G,e as Z,r as s,l as J,az as K,L as Q,o as oo,p as to,ab as ro,ac as eo}from"./index.
|
|
1
|
+
import{av as j,j as m,aw as U,ae as z,P as $,ax as _,q as X,ay as q,m as G,e as Z,r as s,l as J,az as K,L as Q,o as oo,p as to,ab as ro,ac as eo}from"./index.qjO5OK90.js";import{h as x}from"./moment.C7qA8nIE.js";import{u as no,D as ao,a as so}from"./useIntlLocale.BJubkaPQ.js";import{u as io}from"./useBasicWidgetState.CFP4_PTk.js";import{S as lo}from"./styled-components.Bz3KSbhj.js";import{E as co}from"./ErrorOutline.esm.CqVEQ-uJ.js";import"./timepicker.3x4ndo9E.js";import"./input.Bavj6HHJ.js";import"./base-input.DSh9H2uv.js";import"./FormClearHelper.B74VElyu.js";const po=({theme:o,isInSidebar:t,step:r,minTime:c,maxTime:u,disabled:p,clearable:g,error:e})=>({Popover:{props:{ignoreBoundary:t,placement:U.bottomLeft,overrides:{Body:{style:{marginTop:o.spacing.px}}}}},CalendarContainer:{style:{fontSize:o.fontSizes.sm,paddingRight:o.spacing.sm,paddingLeft:o.spacing.sm,paddingBottom:o.spacing.none,paddingTop:o.spacing.sm}},Week:{style:{fontSize:o.fontSizes.sm}},Day:{style:({$pseudoHighlighted:i,$pseudoSelected:a,$selected:T,$isHovered:y})=>({fontSize:o.fontSizes.sm,lineHeight:o.lineHeights.base,"::before":{backgroundColor:T||a||i||y?`${o.colors.darkenedBgMix15} !important`:o.colors.transparent},"::after":{borderColor:o.colors.transparent},...G(o)&&y&&a&&!T?{color:o.colors.secondaryBg}:{}})},PrevButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},NextButton:{style:()=>({display:"flex",alignItems:"center",justifyContent:"center",":active":{backgroundColor:o.colors.transparent},":focus":{backgroundColor:o.colors.transparent,outline:0}})},Input:{props:{maskChar:null,endEnhancer:e&&m(q,{content:m(X,{source:e,allowHTML:!1}),placement:$.TOP_RIGHT,error:!0,children:m(_,{content:co,size:"lg"})}),overrides:{EndEnhancer:{style:{color:e?o.colors.redTextColor:o.colors.grayTextColor,backgroundColor:o.colors.transparent}},Root:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,paddingRight:o.spacing.twoXS,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a,...e&&{backgroundColor:o.colors.redBackgroundColor}}}},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}}}}}},InputContainer:{style:{backgroundColor:"transparent"}},Input:{style:{fontWeight:o.fontWeights.normal,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm,lineHeight:o.lineHeights.inputWidget,"::placeholder":{color:o.colors.fadedText60},...e&&{color:o.colors.redTextColor}},props:{"data-testid":"stDateTimeInputField"}}}}},TimeSelectContainer:{style:{paddingTop:o.spacing.none,paddingBottom:o.spacing.none}},TimeSelectFormControl:{style:{marginBottom:o.spacing.none},props:{overrides:{Label:{component:()=>null}}}},TimeSelect:{props:{step:r,format:"24",disabled:p,nullable:g,minTime:c,maxTime:u,overrides:{Select:{props:{disabled:p,overrides:{ControlContainer:{style:({$isFocused:i})=>{const a=z(o.colors,i);return{height:o.sizes.minElementHeight,borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:a,borderRightColor:a,borderBottomColor:a,borderLeftColor:a}}},IconsContainer:{style:()=>({paddingRight:o.spacing.sm})},ValueContainer:{style:()=>({lineHeight:o.lineHeights.inputWidget,paddingRight:o.spacing.sm,paddingLeft:o.spacing.md,paddingBottom:o.spacing.sm,paddingTop:o.spacing.sm})},SingleValue:{style:{fontWeight:o.fontWeights.normal},props:{"data-testid":"stDateTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:o.spacing.none,paddingBottom:o.spacing.none,boxShadow:"none",maxHeight:o.sizes.maxDropdownHeight})},DropdownListItem:{component:lo},Popover:{props:{ignoreBoundary:t,overrides:{Body:{style:()=>({marginTop:o.spacing.px})}}}},Placeholder:{style:()=>({color:o.colors.fadedText60})},SelectArrow:{component:j,props:{overrides:{Svg:{style:()=>({width:o.iconSizes.xl,height:o.iconSizes.xl})}}}}}}}}}}}),h="YYYY/MM/DD, HH:mm",go=(o,t)=>{const r=o.getStringArrayValue(t);return r&&r.length>0?r[0]:null},uo=o=>o.default?.length?o.default[0]:null,fo=o=>o.value?.length?o.value[0]:null,k=o=>{let t;if(Array.isArray(o)?t=o.find(c=>c instanceof Date):t=o,!t||Number.isNaN(t.getTime()))return null;const r=new Date(t.getTime());return r.setSeconds(0,0),r},b=o=>{if(Z(o)||o==="")return null;const t=x(o,h,!0);return t.isValid()?k(t.toDate()):null},B=(o,t)=>o.getFullYear()===t.getFullYear()&&o.getMonth()===t.getMonth()&&o.getDate()===t.getDate(),I=(o,t)=>{const r=new Date(o.getTime());return r.setHours(t.getHours(),t.getMinutes(),0,0),r},mo=(o,t,r,c)=>{const u=b(o.min),p=b(o.max),g=e=>{t.setStringArrayValue(o,e?[e]:[],{fromUi:r.fromUi},c)};if(r.value){const e=b(r.value);if(e){u&&e<u||p&&e>p||g(r.value);return}}g(r.value)};function bo({disabled:o,element:t,widgetMgr:r,fragmentId:c}){const u=J(),p=s.useContext(K),g=s.useRef(null),[e,i]=io({getStateFromWidgetMgr:go,getDefaultStateFromProto:uo,getCurrStateFromProto:fo,updateWidgetMgrState:mo,element:t,widgetMgr:r,fragmentId:c}),{locale:a}=s.useContext(Q),T=no(a),y=t.step?Number(t.step):900,l=s.useMemo(()=>b(t.min),[t.min]),d=s.useMemo(()=>b(t.max),[t.max]),C=s.useMemo(()=>b(e),[e]),[n,v]=s.useState(C),[M,L]=s.useState(C);C!==M&&(v(C),L(C));const H=l??void 0,V=d??void 0,E=s.useMemo(()=>{if(!(!n||!l))return B(n,l)?I(n,l):void 0},[n,l]),P=s.useMemo(()=>{if(!(!n||!d))return B(n,d)?I(n,d):void 0},[n,d]),w=t.format.replaceAll(/[a-zA-Z]/g,"9"),D=`${t.format.replaceAll("Y","y").replaceAll("D","d")}, HH:mm`,A=`${w}, 99:99`,R=`${t.format}, HH:MM`,W=(t.default&&t.default.length>0?t.default[0]:"").length===0&&!o,F=s.useMemo(()=>{if(!n)return null;if(l&&n<l||d&&n>d){const f=x(l).format(D),S=x(d).format(D);return`**Error**: Date and time set outside allowed range. Please select a date and time between ${f} and ${S}.`}return null},[n,l,d,D]),O=s.useCallback(({date:f})=>{const S=k(f);v(S),g.current?.open?.()},[]),N=s.useCallback(()=>{const f=n?x(n).format(h):null;f!==e&&i({value:f,fromUi:!0})},[n,e,i]),Y=po({theme:u,isInSidebar:p,step:y,minTime:E,maxTime:P,disabled:o,clearable:W,error:F});return oo("div",{className:"stDateTimeInput","data-testid":"stDateTimeInput",children:[m(eo,{label:t.label,disabled:o,labelVisibility:to(t.labelVisibility?.value),children:t.help&&m(ro,{content:t.help,label:t.label})}),m(so,{ref:g,locale:T,density:ao.high,value:n,onChange:O,onClose:N,minDate:H,maxDate:V,disabled:o,timeSelectStart:!0,formatString:D,mask:A,placeholder:R,clearable:W,overrides:Y,"aria-label":t.label})]})}const ko=s.memo(bo);export{ko as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{am as q,w as J,r as c,b7 as Q,l as Y,b8 as ee,b9 as l,j as L,o as te,p as re,P as ne,ba as oe,ac as ie,bb as ae,b as ue,B as C,c as x,D as le}from"./index.
|
|
1
|
+
import{am as q,w as J,r as c,b7 as Q,l as Y,b8 as ee,b9 as l,j as L,o as te,p as re,P as ne,ba as oe,ac as ie,bb as ae,b as ue,B as C,c as x,D as le}from"./index.qjO5OK90.js";import{W as ce}from"./WidgetLabelHelpIconInline.Ch9VDnrM.js";import{u as se}from"./useBasicWidgetState.CFP4_PTk.js";import"./FormClearHelper.B74VElyu.js";var fe={secondary:"secondary"},N={default:"default"},pe={default:"default"},k=Object.freeze({radio:"radio",checkbox:"checkbox"}),z=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}});z.displayName="StyledRoot";z.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 $(){return $=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},$.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){V(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)||he(e,t)||me(e,t)||be()}function be(){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 he(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(s){i=!0,d=s}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&&G(e,t)}function G(e,t){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},G(e,t)}function _e(e){var t=Le();return function(){var n=B(e),o;if(t){var i=B(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 B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B(e)}function V(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)),V(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,s=i.mode,y=s===void 0?k.checkbox:s,S=i.children,b=i.selected,E=i.disabled,f=i.onClick,m=i.kind,v=i.shape,h=i.size,I=J(d.Root,z),_=ye(I,2),A=_[0],R=_[1],w=this.props["aria-label"]||this.props.ariaLabel,p=y===k.radio,W=c.Children.count(S);return c.createElement(Q.Consumer,null,function(Z){return c.createElement(A,$({"aria-label":w||Z.buttongroup.ariaLabel,"data-baseweb":"button-group",role:p?"radiogroup":"group",$shape:v,$length:S.length},R),c.Children.map(S,function(g,P){if(!c.isValidElement(g))return null;var D=g.props.isSelected?g.props.isSelected:Re(b,P);return p&&(o.childRefs[P]=c.createRef()),c.cloneElement(g,{disabled:E||g.props.disabled,isSelected:D,ref:p?o.childRefs[P]:void 0,tabIndex:!p||D||p&&(!b||b===-1)&&P===0?0:-1,onKeyDown:function(u){if(p){var O=Number(b)?Number(b):0;if(u.key==="ArrowUp"||u.key==="ArrowLeft"){u.preventDefault&&u.preventDefault();var T=O-1<0?W-1:O-1;f&&f(u,T),o.childRefs[T].current&&o.childRefs[T].current.focus()}if(u.key==="ArrowDown"||u.key==="ArrowRight"){u.preventDefault&&u.preventDefault();var j=O+1>W-1?0:O+1;f&&f(u,j),o.childRefs[j].current&&o.childRefs[j].current.focus()}}},kind:m,onClick:function(u){E||(g.props.onClick&&g.props.onClick(u),f&&f(u,P))},shape:v,size:h,overrides:de({BaseButton:{style:function(u){var O=u.$theme;return S.length===1?{}:v!==N.default?{marginLeft:O.sizing.scale100,marginRight:O.sizing.scale100}:{marginLeft:"0.5px",marginRight:"0.5px"}},props:{"aria-checked":D,role:p?"radio":"checkbox"}}},g.props.overrides)})}))})}}]),r})(c.Component);V(H,"defaultProps",{disabled:!1,onClick:function(){},shape:N.default,size:pe.default,kind:fe.secondary});function Pe(e,t){return t.includes(e)?t.filter(r=>r!==e):[...t,e]}function Ce(e,t,r){return e===l.ClickMode.MULTI_SELECT?Pe(t,r??[]):r?.includes(t)?[]:[t]}function ke(e){return e.length===0?-1:e[0]}function Be(e,t,r,n){t.setIntArrayValue(e,r.value,{fromUi:r.fromUi},n)}function Ie(e,t,r){const n=r===l.Style.PILLS?C.PILLS:r===l.Style.BORDERLESS?C.BORDERLESS_ICON:C.SEGMENTED_CONTROL,o=r===l.Style.BORDERLESS?x.XSMALL:x.MEDIUM,i=n===C.PILLS||n===C.SEGMENTED_CONTROL,a=r===l.Style.BORDERLESS?"lg":"base";return{element:L(le,{icon:t,label:e,iconSize:a,useSmallerFont:i}),kind:n,size:o}}function Ae(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 De(e,t){return e&&(t=`${t}Active`),t}function Te(e,t,r){const n={flexWrap:"wrap",maxWidth:r?"100%":"fit-content",margin:"0 0"},o=r?"100%":"auto";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,width:o};default:return n}}function je(e,t,r,n,o,i,a){const d=Ae(r,n,o,t);let s=e.content,y=e.contentIcon;return d&&(s=e.selectedContent?e.selectedContent:s,y=e.selectedContentIcon?e.selectedContentIcon:y),c.forwardRef(function(b,E){const{element:f,kind:m,size:v}=Ie(s??"",y??void 0,i),h=De(!!(d&&!e.selectedContent&&!e.selectedContentIcon),m);return L(ue,{...b,size:v,kind:h,containerWidth:a,children:f})})}function Me(e,t){return e.getIntArrayValue(t)}function $e(e){return e.default??[]}function Ge(e){return e.value??[]}function Ne(e){const{disabled:t,element:r,fragmentId:n,widgetMgr:o,widthConfig:i}=e,{clickMode:a,options:d,selectionVisualization:s,style:y,label:S,labelVisibility:b,help:E}=r,f=Y(),[m,v]=se({getStateFromWidgetMgr:Me,getDefaultStateFromProto:$e,getCurrStateFromProto:Ge,updateWidgetMgrState:Be,element:r,widgetMgr:o,fragmentId:n}),h=ee(i),I=(R,w)=>{const p=Ce(a,w,m);v({value:p,fromUi:!0})};let _;a===l.ClickMode.SINGLE_SELECT?_=k.radio:a===l.ClickMode.MULTI_SELECT&&(_=k.checkbox);const A=c.useMemo(()=>d.map((R,w)=>{const p=je(R,w,s,a,m,y,h);return L(p,{},`${R.content}-${w}`)}),[a,d,s,y,m,h]);return te(ae,{className:"stButtonGroup","data-testid":"stButtonGroup",containerWidth:h,children:[L(ie,{label:S,disabled:t,labelVisibility:re(b?.value??oe.LabelVisibilityOptions.COLLAPSED),children:E&&L(ce,{content:E,placement:ne.TOP,label:S})}),L(H,{disabled:t,mode:_,onClick:I,selected:a===l.ClickMode.MULTI_SELECT?m:ke(m),overrides:{Root:{style:c.useCallback(()=>Te(y,f.spacing,h),[y,f.spacing,h])}},children:A})]})}const xe=c.memo(Ne);export{xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as W,aA as O,z as _,r as i,k as $,l as q,a9 as S,aa as G,o as M,j as c,ab as N,ac as J,ae as Q}from"./index.
|
|
1
|
+
import{p as W,aA as O,z as _,r as i,k as $,l as q,a9 as S,aa as G,o as M,j as c,ab as N,ac as J,ae as Q}from"./index.qjO5OK90.js";import{I as X}from"./InputInstructions.ClBLOwfm.js";import{u as Y}from"./useBasicWidgetState.CFP4_PTk.js";import{u as Z,a as tt,b as et}from"./useUpdateUiValue.CyufNQfR.js";import{u as ot,T as at}from"./useTextInputAutoExpand.DBGwhM4R.js";import{u as it}from"./uniqueId.Zn1vZBLX.js";import"./FormClearHelper.B74VElyu.js";import"./inputUtils.CptNuJwn.js";import"./base-input.DSh9H2uv.js";const st=(e,t)=>{let a="auto";if(e.heightConfig?.useStretch)a="100%";else if(e.heightConfig?.pixelHeight&&e.heightConfig.pixelHeight>0){const s=W(t.labelVisibility?.value)===O.Collapsed?2:30,l=e.heightConfig.pixelHeight-s;a=`${Math.max(0,l)}px`}return a},rt=_("div",{target:"e1tmb1p40"})({height:"100%",display:"flex",flexDirection:"column"}),T=(e,t)=>e.getStringValue(t)??t.default??null,lt=e=>e.default??null,nt=e=>e.value??null,ut=(e,t,a,s)=>{t.setStringValue(e,a.value,{fromUi:a.fromUi},s)},dt=({disabled:e,element:t,widgetMgr:a,fragmentId:s,outerElement:l})=>{const h=i.useRef(it("text_area_")).current,{width:y,elementRef:V}=$(),[r,g]=i.useState(!1),[I,x]=i.useState(!1),n=l.heightConfig?.useContent??!1,v=l.heightConfig?.useStretch??!1,A=st(l,t),C=i.useRef(null),[u,p]=i.useState(()=>T(a,t)??null),F=i.useCallback(()=>{p(t.default??null),g(!0)},[t]),[R,f]=Y({getStateFromWidgetMgr:T,getDefaultStateFromProto:lt,getCurrStateFromProto:nt,updateWidgetMgrState:ut,element:t,widgetMgr:a,fragmentId:s,onFormCleared:F});Z(R,u,p,r);const o=q(),{height:k,maxHeight:z,updateScrollHeight:H}=ot({textareaRef:C,dependencies:[t.placeholder]}),m=i.useCallback(()=>{g(!1),f({value:u,fromUi:!0})},[u,f]),L=i.useCallback(()=>{r&&m(),x(!1)},[r,m]),B=i.useCallback(()=>{x(!0)},[]),D=i.useCallback(()=>{n&&H()},[n,H]),E=tt({formId:t.formId,maxChars:t.maxChars,setDirty:g,setUiValue:p,setValueWithSource:f,additionalAction:D}),U=et(t.formId,m,r,a,s,!0),{placeholder:P,formId:b}=t,j=S({formId:b})?a.allowFormEnterToSubmit(b):r,w=I&&y>G(o.breakpoints.hideWidgetDetails);return M(rt,{className:"stTextArea","data-testid":"stTextArea",ref:V,children:[c(J,{label:t.label,disabled:e,labelVisibility:W(t.labelVisibility?.value),htmlFor:h,children:t.help&&c(N,{content:t.help,label:t.label})}),c(at,{inputRef:n?C:void 0,value:u??"",placeholder:P,onBlur:L,onFocus:B,onChange:E,onKeyDown:U,"aria-label":t.label,disabled:e,id:h,overrides:{Input:{style:{fontWeight:o.fontWeights.normal,lineHeight:o.lineHeights.inputWidget,height:n?k:A,maxHeight:n?z:"",minHeight:o.sizes.largestElementHeight,resize:v?"none":"vertical",paddingRight:o.spacing.md,paddingLeft:o.spacing.md,paddingBottom:o.spacing.md,paddingTop:o.spacing.md,"::placeholder":{color:o.colors.fadedText60}}},Root:{props:{"data-testid":"stTextAreaRootElement"},style:({$isFocused:K})=>{const d=Q(o.colors,K);return{borderLeftWidth:o.sizes.borderWidth,borderRightWidth:o.sizes.borderWidth,borderTopWidth:o.sizes.borderWidth,borderBottomWidth:o.sizes.borderWidth,borderTopColor:d,borderRightColor:d,borderBottomColor:d,borderLeftColor:d,flexGrow:1}}}}}),w&&c(X,{dirty:r,value:u??"",maxLength:t.maxChars,type:"multiline",inForm:S({formId:b}),allowEnterToSubmit:j})]})},Ht=i.memo(dt);export{Ht as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{z as Kt,r as P,j as ne}from"./index.DiwhD0Ic.js";const{entries:St,setPrototypeOf:pt,isFrozen:Zt,getPrototypeOf:Jt,getOwnPropertyDescriptor:Qt}=Object;let{freeze:R,seal:b,create:Fe}=Object,{apply:ze,construct:Ge}=typeof Reflect<"u"&&Reflect;R||(R=function(n){return n});b||(b=function(n){return n});ze||(ze=function(n,s){for(var a=arguments.length,c=new Array(a>2?a-2:0),m=2;m<a;m++)c[m-2]=arguments[m];return n.apply(s,c)});Ge||(Ge=function(n){for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return new n(...a)});const pe=O(Array.prototype.forEach),en=O(Array.prototype.lastIndexOf),Tt=O(Array.prototype.pop),Z=O(Array.prototype.push),tn=O(Array.prototype.splice),de=O(String.prototype.toLowerCase),xe=O(String.prototype.toString),Pe=O(String.prototype.match),J=O(String.prototype.replace),nn=O(String.prototype.indexOf),on=O(String.prototype.trim),y=O(Object.prototype.hasOwnProperty),S=O(RegExp.prototype.test),Q=rn(TypeError);function O(o){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return ze(o,n,a)}}function rn(o){return function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return Ge(o,s)}}function l(o,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de;pt&&pt(o,null);let a=n.length;for(;a--;){let c=n[a];if(typeof c=="string"){const m=s(c);m!==c&&(Zt(n)||(n[a]=m),c=m)}o[c]=!0}return o}function an(o){for(let n=0;n<o.length;n++)y(o,n)||(o[n]=null);return o}function C(o){const n=Fe(null);for(const[s,a]of St(o))y(o,s)&&(Array.isArray(a)?n[s]=an(a):a&&typeof a=="object"&&a.constructor===Object?n[s]=C(a):n[s]=a);return n}function ee(o,n){for(;o!==null;){const a=Qt(o,n);if(a){if(a.get)return O(a.get);if(typeof a.value=="function")return O(a.value)}o=Jt(o)}function s(){return null}return s}const dt=R(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ke=R(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ve=R(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sn=R(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ue=R(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ln=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Et=R(["#text"]),_t=R(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),He=R(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),At=R(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Te=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fn=b(/<%[\w\W]*|[\w\W]*%>/gm),un=b(/\$\{[\w\W]*/gm),mn=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),pn=b(/^aria-[\-\w]+$/),Rt=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Tn=b(/^(?:\w+script|data):/i),dn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ot=b(/^html$/i),En=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var gt=Object.freeze({__proto__:null,ARIA_ATTR:pn,ATTR_WHITESPACE:dn,CUSTOM_ELEMENT:En,DATA_ATTR:mn,DOCTYPE_NAME:Ot,ERB_EXPR:fn,IS_ALLOWED_URI:Rt,IS_SCRIPT_OR_DATA:Tn,MUSTACHE_EXPR:cn,TMPLIT_EXPR:un});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},_n=function(){return typeof window>"u"?null:window},An=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const c="data-tt-policy-suffix";s&&s.hasAttribute(c)&&(a=s.getAttribute(c));const m="dompurify"+(a?"#"+a:"");try{return n.createPolicy(m,{createHTML(D){return D},createScriptURL(D){return D}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},ht=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Lt(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_n();const n=r=>Lt(r);if(n.version="3.3.1",n.removed=[],!o||!o.document||o.document.nodeType!==te.document||!o.Element)return n.isSupported=!1,n;let{document:s}=o;const a=s,c=a.currentScript,{DocumentFragment:m,HTMLTemplateElement:D,Node:Y,Element:oe,NodeFilter:X,NamedNodeMap:Dt=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:Nt,DOMParser:It,trustedTypes:ie}=o,j=oe.prototype,Ct=ee(j,"cloneNode"),Mt=ee(j,"remove"),wt=ee(j,"nextSibling"),xt=ee(j,"childNodes"),re=ee(j,"parentNode");if(typeof D=="function"){const r=s.createElement("template");r.content&&r.content.ownerDocument&&(s=r.content.ownerDocument)}let g,V="";const{implementation:_e,createNodeIterator:Pt,createDocumentFragment:kt,getElementsByTagName:vt}=s,{importNode:Ut}=a;let h=ht();n.isSupported=typeof St=="function"&&typeof re=="function"&&_e&&_e.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ae,ERB_EXPR:ge,TMPLIT_EXPR:he,DATA_ATTR:Ht,ARIA_ATTR:Ft,IS_SCRIPT_OR_DATA:zt,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:Gt}=gt;let{IS_ALLOWED_URI:Ye}=gt,d=null;const Xe=l({},[...dt,...ke,...ve,...Ue,...Et]);let E=null;const je=l({},[..._t,...He,...At,...Te]);let u=Object.seal(Fe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,Se=null;const U=Object.seal(Fe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ve=!0,Re=!0,$e=!1,qe=!0,H=!1,ae=!0,k=!1,Oe=!1,Le=!1,F=!1,se=!1,le=!1,Ke=!0,Ze=!1;const Wt="user-content-";let be=!0,q=!1,z={},N=null;const ye=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Je=null;const Qe=l({},["audio","video","img","source","image","track"]);let De=null;const et=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let G=M,Ne=!1,Ie=null;const Bt=l({},[ce,fe,M],xe);let ue=l({},["mi","mo","mn","ms","mtext"]),me=l({},["annotation-xml"]);const Yt=l({},["title","style","font","a","script"]);let K=null;const Xt=["application/xhtml+xml","text/html"],jt="text/html";let T=null,W=null;const Vt=s.createElement("form"),tt=function(e){return e instanceof RegExp||e instanceof Function},Ce=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(W&&W===e)){if((!e||typeof e!="object")&&(e={}),e=C(e),K=Xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?jt:e.PARSER_MEDIA_TYPE,T=K==="application/xhtml+xml"?xe:de,d=y(e,"ALLOWED_TAGS")?l({},e.ALLOWED_TAGS,T):Xe,E=y(e,"ALLOWED_ATTR")?l({},e.ALLOWED_ATTR,T):je,Ie=y(e,"ALLOWED_NAMESPACES")?l({},e.ALLOWED_NAMESPACES,xe):Bt,De=y(e,"ADD_URI_SAFE_ATTR")?l(C(et),e.ADD_URI_SAFE_ATTR,T):et,Je=y(e,"ADD_DATA_URI_TAGS")?l(C(Qe),e.ADD_DATA_URI_TAGS,T):Qe,N=y(e,"FORBID_CONTENTS")?l({},e.FORBID_CONTENTS,T):ye,$=y(e,"FORBID_TAGS")?l({},e.FORBID_TAGS,T):C({}),Se=y(e,"FORBID_ATTR")?l({},e.FORBID_ATTR,T):C({}),z=y(e,"USE_PROFILES")?e.USE_PROFILES:!1,Ve=e.ALLOW_ARIA_ATTR!==!1,Re=e.ALLOW_DATA_ATTR!==!1,$e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,ae=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,F=e.RETURN_DOM||!1,se=e.RETURN_DOM_FRAGMENT||!1,le=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Ke=e.SANITIZE_DOM!==!1,Ze=e.SANITIZE_NAMED_PROPS||!1,be=e.KEEP_CONTENT!==!1,q=e.IN_PLACE||!1,Ye=e.ALLOWED_URI_REGEXP||Rt,G=e.NAMESPACE||M,ue=e.MATHML_TEXT_INTEGRATION_POINTS||ue,me=e.HTML_INTEGRATION_POINTS||me,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(Re=!1),se&&(F=!0),z&&(d=l({},Et),E=[],z.html===!0&&(l(d,dt),l(E,_t)),z.svg===!0&&(l(d,ke),l(E,He),l(E,Te)),z.svgFilters===!0&&(l(d,ve),l(E,He),l(E,Te)),z.mathMl===!0&&(l(d,Ue),l(E,At),l(E,Te))),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?U.tagCheck=e.ADD_TAGS:(d===Xe&&(d=C(d)),l(d,e.ADD_TAGS,T))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?U.attributeCheck=e.ADD_ATTR:(E===je&&(E=C(E)),l(E,e.ADD_ATTR,T))),e.ADD_URI_SAFE_ATTR&&l(De,e.ADD_URI_SAFE_ATTR,T),e.FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.FORBID_CONTENTS,T)),e.ADD_FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.ADD_FORBID_CONTENTS,T)),be&&(d["#text"]=!0),k&&l(d,["html","head","body"]),d.table&&(l(d,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,V=g.createHTML("")}else g===void 0&&(g=An(ie,c)),g!==null&&typeof V=="string"&&(V=g.createHTML(""));R&&R(e),W=e}},nt=l({},[...ke,...ve,...sn]),ot=l({},[...Ue,...ln]),$t=function(e){let t=re(e);(!t||!t.tagName)&&(t={namespaceURI:G,tagName:"template"});const i=de(e.tagName),f=de(t.tagName);return Ie[e.namespaceURI]?e.namespaceURI===fe?t.namespaceURI===M?i==="svg":t.namespaceURI===ce?i==="svg"&&(f==="annotation-xml"||ue[f]):!!nt[i]:e.namespaceURI===ce?t.namespaceURI===M?i==="math":t.namespaceURI===fe?i==="math"&&me[f]:!!ot[i]:e.namespaceURI===M?t.namespaceURI===fe&&!me[f]||t.namespaceURI===ce&&!ue[f]?!1:!ot[i]&&(Yt[i]||!nt[i]):!!(K==="application/xhtml+xml"&&Ie[e.namespaceURI]):!1},I=function(e){Z(n.removed,{element:e});try{re(e).removeChild(e)}catch{Mt(e)}},v=function(e,t){try{Z(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{Z(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(F||se)try{I(t)}catch{}else try{t.setAttribute(e,"")}catch{}},it=function(e){let t=null,i=null;if(Le)e="<remove></remove>"+e;else{const p=Pe(e,/^[\r\n\t ]+/);i=p&&p[0]}K==="application/xhtml+xml"&&G===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const f=g?g.createHTML(e):e;if(G===M)try{t=new It().parseFromString(f,K)}catch{}if(!t||!t.documentElement){t=_e.createDocument(G,"template",null);try{t.documentElement.innerHTML=Ne?V:f}catch{}}const A=t.body||t.documentElement;return e&&i&&A.insertBefore(s.createTextNode(i),A.childNodes[0]||null),G===M?vt.call(t,k?"html":"body")[0]:k?t.documentElement:A},rt=function(e){return Pt.call(e.ownerDocument||e,e,X.SHOW_ELEMENT|X.SHOW_COMMENT|X.SHOW_TEXT|X.SHOW_PROCESSING_INSTRUCTION|X.SHOW_CDATA_SECTION,null)},Me=function(e){return e instanceof Nt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Dt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},at=function(e){return typeof Y=="function"&&e instanceof Y};function w(r,e,t){pe(r,i=>{i.call(n,e,t,W)})}const st=function(e){let t=null;if(w(h.beforeSanitizeElements,e,null),Me(e))return I(e),!0;const i=T(e.nodeName);if(w(h.uponSanitizeElement,e,{tagName:i,allowedTags:d}),ae&&e.hasChildNodes()&&!at(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||ae&&e.nodeType===te.comment&&S(/<[/\w]/g,e.data))return I(e),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(i))&&(!d[i]||$[i])){if(!$[i]&&ct(i)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i)))return!1;if(be&&!N[i]){const f=re(e)||e.parentNode,A=xt(e)||e.childNodes;if(A&&f){const p=A.length;for(let L=p-1;L>=0;--L){const x=Ct(A[L],!0);x.__removalCount=(e.__removalCount||0)+1,f.insertBefore(x,wt(e))}}}return I(e),!0}return e instanceof oe&&!$t(e)||(i==="noscript"||i==="noembed"||i==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(I(e),!0):(H&&e.nodeType===te.text&&(t=e.textContent,pe([Ae,ge,he],f=>{t=J(t,f," ")}),e.textContent!==t&&(Z(n.removed,{element:e.cloneNode()}),e.textContent=t)),w(h.afterSanitizeElements,e,null),!1)},lt=function(e,t,i){if(Ke&&(t==="id"||t==="name")&&(i in s||i in Vt))return!1;if(!(Re&&!Se[t]&&S(Ht,t))){if(!(Ve&&S(Ft,t))){if(!(U.attributeCheck instanceof Function&&U.attributeCheck(t,e))){if(!E[t]||Se[t]){if(!(ct(e)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&S(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t,e))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i))))return!1}else if(!De[t]){if(!S(Ye,J(i,Be,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&nn(i,"data:")===0&&Je[e])){if(!($e&&!S(zt,J(i,Be,"")))){if(i)return!1}}}}}}}return!0},ct=function(e){return e!=="annotation-xml"&&Pe(e,Gt)},ft=function(e){w(h.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Me(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let f=t.length;for(;f--;){const A=t[f],{name:p,namespaceURI:L,value:x}=A,B=T(p),we=x;let _=p==="value"?we:on(we);if(i.attrName=B,i.attrValue=_,i.keepAttr=!0,i.forceKeepAttr=void 0,w(h.uponSanitizeAttribute,e,i),_=i.attrValue,Ze&&(B==="id"||B==="name")&&(v(p,e),_=Wt+_),ae&&S(/((--!?|])>)|<\/(style|title|textarea)/i,_)){v(p,e);continue}if(B==="attributename"&&Pe(_,"href")){v(p,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){v(p,e);continue}if(!qe&&S(/\/>/i,_)){v(p,e);continue}H&&pe([Ae,ge,he],mt=>{_=J(_,mt," ")});const ut=T(e.nodeName);if(!lt(ut,B,_)){v(p,e);continue}if(g&&typeof ie=="object"&&typeof ie.getAttributeType=="function"&&!L)switch(ie.getAttributeType(ut,B)){case"TrustedHTML":{_=g.createHTML(_);break}case"TrustedScriptURL":{_=g.createScriptURL(_);break}}if(_!==we)try{L?e.setAttributeNS(L,p,_):e.setAttribute(p,_),Me(e)?I(e):Tt(n.removed)}catch{v(p,e)}}w(h.afterSanitizeAttributes,e,null)},qt=function r(e){let t=null;const i=rt(e);for(w(h.beforeSanitizeShadowDOM,e,null);t=i.nextNode();)w(h.uponSanitizeShadowNode,t,null),st(t),ft(t),t.content instanceof m&&r(t.content);w(h.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,i=null,f=null,A=null;if(Ne=!r,Ne&&(r="<!-->"),typeof r!="string"&&!at(r))if(typeof r.toString=="function"){if(r=r.toString(),typeof r!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!n.isSupported)return r;if(Oe||Ce(e),n.removed=[],typeof r=="string"&&(q=!1),q){if(r.nodeName){const x=T(r.nodeName);if(!d[x]||$[x])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof Y)t=it("<!---->"),i=t.ownerDocument.importNode(r,!0),i.nodeType===te.element&&i.nodeName==="BODY"||i.nodeName==="HTML"?t=i:t.appendChild(i);else{if(!F&&!H&&!k&&r.indexOf("<")===-1)return g&&le?g.createHTML(r):r;if(t=it(r),!t)return F?null:le?V:""}t&&Le&&I(t.firstChild);const p=rt(q?r:t);for(;f=p.nextNode();)st(f),ft(f),f.content instanceof m&&qt(f.content);if(q)return r;if(F){if(se)for(A=kt.call(t.ownerDocument);t.firstChild;)A.appendChild(t.firstChild);else A=t;return(E.shadowroot||E.shadowrootmode)&&(A=Ut.call(a,A,!0)),A}let L=k?t.outerHTML:t.innerHTML;return k&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&S(Ot,t.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
1
|
+
import{z as Kt,r as P,j as ne}from"./index.qjO5OK90.js";const{entries:St,setPrototypeOf:pt,isFrozen:Zt,getPrototypeOf:Jt,getOwnPropertyDescriptor:Qt}=Object;let{freeze:R,seal:b,create:Fe}=Object,{apply:ze,construct:Ge}=typeof Reflect<"u"&&Reflect;R||(R=function(n){return n});b||(b=function(n){return n});ze||(ze=function(n,s){for(var a=arguments.length,c=new Array(a>2?a-2:0),m=2;m<a;m++)c[m-2]=arguments[m];return n.apply(s,c)});Ge||(Ge=function(n){for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return new n(...a)});const pe=O(Array.prototype.forEach),en=O(Array.prototype.lastIndexOf),Tt=O(Array.prototype.pop),Z=O(Array.prototype.push),tn=O(Array.prototype.splice),de=O(String.prototype.toLowerCase),xe=O(String.prototype.toString),Pe=O(String.prototype.match),J=O(String.prototype.replace),nn=O(String.prototype.indexOf),on=O(String.prototype.trim),y=O(Object.prototype.hasOwnProperty),S=O(RegExp.prototype.test),Q=rn(TypeError);function O(o){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return ze(o,n,a)}}function rn(o){return function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return Ge(o,s)}}function l(o,n){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de;pt&&pt(o,null);let a=n.length;for(;a--;){let c=n[a];if(typeof c=="string"){const m=s(c);m!==c&&(Zt(n)||(n[a]=m),c=m)}o[c]=!0}return o}function an(o){for(let n=0;n<o.length;n++)y(o,n)||(o[n]=null);return o}function C(o){const n=Fe(null);for(const[s,a]of St(o))y(o,s)&&(Array.isArray(a)?n[s]=an(a):a&&typeof a=="object"&&a.constructor===Object?n[s]=C(a):n[s]=a);return n}function ee(o,n){for(;o!==null;){const a=Qt(o,n);if(a){if(a.get)return O(a.get);if(typeof a.value=="function")return O(a.value)}o=Jt(o)}function s(){return null}return s}const dt=R(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ke=R(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ve=R(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sn=R(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ue=R(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ln=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Et=R(["#text"]),_t=R(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),He=R(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),At=R(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Te=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cn=b(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fn=b(/<%[\w\W]*|[\w\W]*%>/gm),un=b(/\$\{[\w\W]*/gm),mn=b(/^data-[\-\w.\u00B7-\uFFFF]+$/),pn=b(/^aria-[\-\w]+$/),Rt=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Tn=b(/^(?:\w+script|data):/i),dn=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ot=b(/^html$/i),En=b(/^[a-z][.\w]*(-[.\w]+)+$/i);var gt=Object.freeze({__proto__:null,ARIA_ATTR:pn,ATTR_WHITESPACE:dn,CUSTOM_ELEMENT:En,DATA_ATTR:mn,DOCTYPE_NAME:Ot,ERB_EXPR:fn,IS_ALLOWED_URI:Rt,IS_SCRIPT_OR_DATA:Tn,MUSTACHE_EXPR:cn,TMPLIT_EXPR:un});const te={element:1,text:3,progressingInstruction:7,comment:8,document:9},_n=function(){return typeof window>"u"?null:window},An=function(n,s){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const c="data-tt-policy-suffix";s&&s.hasAttribute(c)&&(a=s.getAttribute(c));const m="dompurify"+(a?"#"+a:"");try{return n.createPolicy(m,{createHTML(D){return D},createScriptURL(D){return D}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},ht=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Lt(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_n();const n=r=>Lt(r);if(n.version="3.3.1",n.removed=[],!o||!o.document||o.document.nodeType!==te.document||!o.Element)return n.isSupported=!1,n;let{document:s}=o;const a=s,c=a.currentScript,{DocumentFragment:m,HTMLTemplateElement:D,Node:Y,Element:oe,NodeFilter:X,NamedNodeMap:Dt=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:Nt,DOMParser:It,trustedTypes:ie}=o,j=oe.prototype,Ct=ee(j,"cloneNode"),Mt=ee(j,"remove"),wt=ee(j,"nextSibling"),xt=ee(j,"childNodes"),re=ee(j,"parentNode");if(typeof D=="function"){const r=s.createElement("template");r.content&&r.content.ownerDocument&&(s=r.content.ownerDocument)}let g,V="";const{implementation:_e,createNodeIterator:Pt,createDocumentFragment:kt,getElementsByTagName:vt}=s,{importNode:Ut}=a;let h=ht();n.isSupported=typeof St=="function"&&typeof re=="function"&&_e&&_e.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ae,ERB_EXPR:ge,TMPLIT_EXPR:he,DATA_ATTR:Ht,ARIA_ATTR:Ft,IS_SCRIPT_OR_DATA:zt,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:Gt}=gt;let{IS_ALLOWED_URI:Ye}=gt,d=null;const Xe=l({},[...dt,...ke,...ve,...Ue,...Et]);let E=null;const je=l({},[..._t,...He,...At,...Te]);let u=Object.seal(Fe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,Se=null;const U=Object.seal(Fe(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ve=!0,Re=!0,$e=!1,qe=!0,H=!1,ae=!0,k=!1,Oe=!1,Le=!1,F=!1,se=!1,le=!1,Ke=!0,Ze=!1;const Wt="user-content-";let be=!0,q=!1,z={},N=null;const ye=l({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Je=null;const Qe=l({},["audio","video","img","source","image","track"]);let De=null;const et=l({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",M="http://www.w3.org/1999/xhtml";let G=M,Ne=!1,Ie=null;const Bt=l({},[ce,fe,M],xe);let ue=l({},["mi","mo","mn","ms","mtext"]),me=l({},["annotation-xml"]);const Yt=l({},["title","style","font","a","script"]);let K=null;const Xt=["application/xhtml+xml","text/html"],jt="text/html";let T=null,W=null;const Vt=s.createElement("form"),tt=function(e){return e instanceof RegExp||e instanceof Function},Ce=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(W&&W===e)){if((!e||typeof e!="object")&&(e={}),e=C(e),K=Xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?jt:e.PARSER_MEDIA_TYPE,T=K==="application/xhtml+xml"?xe:de,d=y(e,"ALLOWED_TAGS")?l({},e.ALLOWED_TAGS,T):Xe,E=y(e,"ALLOWED_ATTR")?l({},e.ALLOWED_ATTR,T):je,Ie=y(e,"ALLOWED_NAMESPACES")?l({},e.ALLOWED_NAMESPACES,xe):Bt,De=y(e,"ADD_URI_SAFE_ATTR")?l(C(et),e.ADD_URI_SAFE_ATTR,T):et,Je=y(e,"ADD_DATA_URI_TAGS")?l(C(Qe),e.ADD_DATA_URI_TAGS,T):Qe,N=y(e,"FORBID_CONTENTS")?l({},e.FORBID_CONTENTS,T):ye,$=y(e,"FORBID_TAGS")?l({},e.FORBID_TAGS,T):C({}),Se=y(e,"FORBID_ATTR")?l({},e.FORBID_ATTR,T):C({}),z=y(e,"USE_PROFILES")?e.USE_PROFILES:!1,Ve=e.ALLOW_ARIA_ATTR!==!1,Re=e.ALLOW_DATA_ATTR!==!1,$e=e.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,H=e.SAFE_FOR_TEMPLATES||!1,ae=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,F=e.RETURN_DOM||!1,se=e.RETURN_DOM_FRAGMENT||!1,le=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Ke=e.SANITIZE_DOM!==!1,Ze=e.SANITIZE_NAMED_PROPS||!1,be=e.KEEP_CONTENT!==!1,q=e.IN_PLACE||!1,Ye=e.ALLOWED_URI_REGEXP||Rt,G=e.NAMESPACE||M,ue=e.MATHML_TEXT_INTEGRATION_POINTS||ue,me=e.HTML_INTEGRATION_POINTS||me,u=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(u.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(u.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(u.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),H&&(Re=!1),se&&(F=!0),z&&(d=l({},Et),E=[],z.html===!0&&(l(d,dt),l(E,_t)),z.svg===!0&&(l(d,ke),l(E,He),l(E,Te)),z.svgFilters===!0&&(l(d,ve),l(E,He),l(E,Te)),z.mathMl===!0&&(l(d,Ue),l(E,At),l(E,Te))),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?U.tagCheck=e.ADD_TAGS:(d===Xe&&(d=C(d)),l(d,e.ADD_TAGS,T))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?U.attributeCheck=e.ADD_ATTR:(E===je&&(E=C(E)),l(E,e.ADD_ATTR,T))),e.ADD_URI_SAFE_ATTR&&l(De,e.ADD_URI_SAFE_ATTR,T),e.FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.FORBID_CONTENTS,T)),e.ADD_FORBID_CONTENTS&&(N===ye&&(N=C(N)),l(N,e.ADD_FORBID_CONTENTS,T)),be&&(d["#text"]=!0),k&&l(d,["html","head","body"]),d.table&&(l(d,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=e.TRUSTED_TYPES_POLICY,V=g.createHTML("")}else g===void 0&&(g=An(ie,c)),g!==null&&typeof V=="string"&&(V=g.createHTML(""));R&&R(e),W=e}},nt=l({},[...ke,...ve,...sn]),ot=l({},[...Ue,...ln]),$t=function(e){let t=re(e);(!t||!t.tagName)&&(t={namespaceURI:G,tagName:"template"});const i=de(e.tagName),f=de(t.tagName);return Ie[e.namespaceURI]?e.namespaceURI===fe?t.namespaceURI===M?i==="svg":t.namespaceURI===ce?i==="svg"&&(f==="annotation-xml"||ue[f]):!!nt[i]:e.namespaceURI===ce?t.namespaceURI===M?i==="math":t.namespaceURI===fe?i==="math"&&me[f]:!!ot[i]:e.namespaceURI===M?t.namespaceURI===fe&&!me[f]||t.namespaceURI===ce&&!ue[f]?!1:!ot[i]&&(Yt[i]||!nt[i]):!!(K==="application/xhtml+xml"&&Ie[e.namespaceURI]):!1},I=function(e){Z(n.removed,{element:e});try{re(e).removeChild(e)}catch{Mt(e)}},v=function(e,t){try{Z(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{Z(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(F||se)try{I(t)}catch{}else try{t.setAttribute(e,"")}catch{}},it=function(e){let t=null,i=null;if(Le)e="<remove></remove>"+e;else{const p=Pe(e,/^[\r\n\t ]+/);i=p&&p[0]}K==="application/xhtml+xml"&&G===M&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const f=g?g.createHTML(e):e;if(G===M)try{t=new It().parseFromString(f,K)}catch{}if(!t||!t.documentElement){t=_e.createDocument(G,"template",null);try{t.documentElement.innerHTML=Ne?V:f}catch{}}const A=t.body||t.documentElement;return e&&i&&A.insertBefore(s.createTextNode(i),A.childNodes[0]||null),G===M?vt.call(t,k?"html":"body")[0]:k?t.documentElement:A},rt=function(e){return Pt.call(e.ownerDocument||e,e,X.SHOW_ELEMENT|X.SHOW_COMMENT|X.SHOW_TEXT|X.SHOW_PROCESSING_INSTRUCTION|X.SHOW_CDATA_SECTION,null)},Me=function(e){return e instanceof Nt&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof Dt)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},at=function(e){return typeof Y=="function"&&e instanceof Y};function w(r,e,t){pe(r,i=>{i.call(n,e,t,W)})}const st=function(e){let t=null;if(w(h.beforeSanitizeElements,e,null),Me(e))return I(e),!0;const i=T(e.nodeName);if(w(h.uponSanitizeElement,e,{tagName:i,allowedTags:d}),ae&&e.hasChildNodes()&&!at(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||e.nodeType===te.progressingInstruction||ae&&e.nodeType===te.comment&&S(/<[/\w]/g,e.data))return I(e),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(i))&&(!d[i]||$[i])){if(!$[i]&&ct(i)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i)))return!1;if(be&&!N[i]){const f=re(e)||e.parentNode,A=xt(e)||e.childNodes;if(A&&f){const p=A.length;for(let L=p-1;L>=0;--L){const x=Ct(A[L],!0);x.__removalCount=(e.__removalCount||0)+1,f.insertBefore(x,wt(e))}}}return I(e),!0}return e instanceof oe&&!$t(e)||(i==="noscript"||i==="noembed"||i==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(I(e),!0):(H&&e.nodeType===te.text&&(t=e.textContent,pe([Ae,ge,he],f=>{t=J(t,f," ")}),e.textContent!==t&&(Z(n.removed,{element:e.cloneNode()}),e.textContent=t)),w(h.afterSanitizeElements,e,null),!1)},lt=function(e,t,i){if(Ke&&(t==="id"||t==="name")&&(i in s||i in Vt))return!1;if(!(Re&&!Se[t]&&S(Ht,t))){if(!(Ve&&S(Ft,t))){if(!(U.attributeCheck instanceof Function&&U.attributeCheck(t,e))){if(!E[t]||Se[t]){if(!(ct(e)&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,e)||u.tagNameCheck instanceof Function&&u.tagNameCheck(e))&&(u.attributeNameCheck instanceof RegExp&&S(u.attributeNameCheck,t)||u.attributeNameCheck instanceof Function&&u.attributeNameCheck(t,e))||t==="is"&&u.allowCustomizedBuiltInElements&&(u.tagNameCheck instanceof RegExp&&S(u.tagNameCheck,i)||u.tagNameCheck instanceof Function&&u.tagNameCheck(i))))return!1}else if(!De[t]){if(!S(Ye,J(i,Be,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&nn(i,"data:")===0&&Je[e])){if(!($e&&!S(zt,J(i,Be,"")))){if(i)return!1}}}}}}}return!0},ct=function(e){return e!=="annotation-xml"&&Pe(e,Gt)},ft=function(e){w(h.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Me(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0};let f=t.length;for(;f--;){const A=t[f],{name:p,namespaceURI:L,value:x}=A,B=T(p),we=x;let _=p==="value"?we:on(we);if(i.attrName=B,i.attrValue=_,i.keepAttr=!0,i.forceKeepAttr=void 0,w(h.uponSanitizeAttribute,e,i),_=i.attrValue,Ze&&(B==="id"||B==="name")&&(v(p,e),_=Wt+_),ae&&S(/((--!?|])>)|<\/(style|title|textarea)/i,_)){v(p,e);continue}if(B==="attributename"&&Pe(_,"href")){v(p,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){v(p,e);continue}if(!qe&&S(/\/>/i,_)){v(p,e);continue}H&&pe([Ae,ge,he],mt=>{_=J(_,mt," ")});const ut=T(e.nodeName);if(!lt(ut,B,_)){v(p,e);continue}if(g&&typeof ie=="object"&&typeof ie.getAttributeType=="function"&&!L)switch(ie.getAttributeType(ut,B)){case"TrustedHTML":{_=g.createHTML(_);break}case"TrustedScriptURL":{_=g.createScriptURL(_);break}}if(_!==we)try{L?e.setAttributeNS(L,p,_):e.setAttribute(p,_),Me(e)?I(e):Tt(n.removed)}catch{v(p,e)}}w(h.afterSanitizeAttributes,e,null)},qt=function r(e){let t=null;const i=rt(e);for(w(h.beforeSanitizeShadowDOM,e,null);t=i.nextNode();)w(h.uponSanitizeShadowNode,t,null),st(t),ft(t),t.content instanceof m&&r(t.content);w(h.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,i=null,f=null,A=null;if(Ne=!r,Ne&&(r="<!-->"),typeof r!="string"&&!at(r))if(typeof r.toString=="function"){if(r=r.toString(),typeof r!="string")throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function");if(!n.isSupported)return r;if(Oe||Ce(e),n.removed=[],typeof r=="string"&&(q=!1),q){if(r.nodeName){const x=T(r.nodeName);if(!d[x]||$[x])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof Y)t=it("<!---->"),i=t.ownerDocument.importNode(r,!0),i.nodeType===te.element&&i.nodeName==="BODY"||i.nodeName==="HTML"?t=i:t.appendChild(i);else{if(!F&&!H&&!k&&r.indexOf("<")===-1)return g&&le?g.createHTML(r):r;if(t=it(r),!t)return F?null:le?V:""}t&&Le&&I(t.firstChild);const p=rt(q?r:t);for(;f=p.nextNode();)st(f),ft(f),f.content instanceof m&&qt(f.content);if(q)return r;if(F){if(se)for(A=kt.call(t.ownerDocument);t.firstChild;)A.appendChild(t.firstChild);else A=t;return(E.shadowroot||E.shadowrootmode)&&(A=Ut.call(a,A,!0)),A}let L=k?t.outerHTML:t.innerHTML;return k&&d["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&S(Ot,t.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
2
2
|
`+L),H&&pe([Ae,ge,he],x=>{L=J(L,x," ")}),g&&le?g.createHTML(L):L},n.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ce(r),Oe=!0},n.clearConfig=function(){W=null,Oe=!1},n.isValidAttribute=function(r,e,t){W||Ce({});const i=T(r),f=T(e);return lt(i,f,t)},n.addHook=function(r,e){typeof e=="function"&&Z(h[r],e)},n.removeHook=function(r,e){if(e!==void 0){const t=en(h[r],e);return t===-1?void 0:tn(h[r],t,1)[0]}return Tt(h[r])},n.removeHooks=function(r){h[r]=[]},n.removeAllHooks=function(){h=ht()},n}var Ee=Lt();const We="data-temp-href-target";Ee.addHook("beforeSanitizeAttributes",function(o){o instanceof HTMLElement&&o.hasAttribute("target")&&o.getAttribute("target")==="_blank"&&o.setAttribute(We,"_blank")});Ee.addHook("afterSanitizeAttributes",function(o){o instanceof HTMLElement&&o.hasAttribute(We)&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.removeAttribute(We))});const bt={USE_PROFILES:{html:!0},FORCE_BODY:!0},gn=Kt("div",{target:"e1o5kn6k0"})(({theme:o})=>({width:"100%","ul, ol, dl":{paddingLeft:o.spacing.threeXL}})),yt=P.forwardRef(function(n,s){return ne(gn,{className:"stHtml","data-testid":"stHtml",ref:s,...n})}),hn={...bt,ADD_TAGS:["script","style"],ADD_ATTR:["src","type","async","defer","nonce","crossorigin","referrerpolicy","integrity"]};function Sn(o){return Ee.sanitize(o,hn)}const Rn=({body:o})=>{const n=P.useRef(null),s=P.useMemo(()=>Sn(o),[o]);return P.useEffect(()=>{const a=n.current;return a?(a.innerHTML=s,Array.from(a.querySelectorAll("script")).forEach(m=>{const D=document.createElement("script");for(const{name:Y,value:oe}of Array.from(m.attributes))try{D.setAttribute(Y,oe)}catch{}m.src||(D.textContent=m.textContent),m.parentNode?.replaceChild(D,m)}),()=>{a.innerHTML=""}):void 0},[s]),ne(yt,{ref:n})},On=P.memo(Rn);function Ln(o){return Ee.sanitize(o,bt)}function bn({body:o}){const n=P.useMemo(()=>Ln(o),[o]);return n?ne(yt,{dangerouslySetInnerHTML:{__html:n}}):null}const yn=P.memo(bn);function Dn({element:o}){const{body:n,unsafeAllowJavascript:s}=o;return s?ne(On,{body:n}):ne(yn,{body:n})}const In=P.memo(Dn);export{In as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,E as G,_ as Y,z as k,bc as C,e as h,n as J,V as dt,l as pt,k as ft,a9 as mt,aa as V,o as B,j as d,p as bt,ab as ht,ac as gt,ad as yt,Y as It,ax as j}from"./index.
|
|
1
|
+
import{r as a,E as G,_ as Y,z as k,bc as C,e as h,n as J,V as dt,l as pt,k as ft,a9 as mt,aa as V,o as B,j as d,p as bt,ab as ht,ac as gt,ad as yt,Y as It,ax as j}from"./index.qjO5OK90.js";import{I as Ct}from"./InputInstructions.ClBLOwfm.js";import{u as Tt}from"./useBasicWidgetState.CFP4_PTk.js";import{s as St}from"./sprintf.DpPCfzXw.js";import{u as wt}from"./uniqueId.Zn1vZBLX.js";import{I as vt}from"./input.Bavj6HHJ.js";import"./FormClearHelper.B74VElyu.js";import"./base-input.DSh9H2uv.js";var Q=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(G,Y({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),a.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Z=a.forwardRef(function(t,e){var r={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(G,Y({iconAttrs:r,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},t,{ref:e}),a.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Z.displayName="Plus";const xt=k("div",{target:"eaeic2i0"})(({theme:t})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:t.sizes.minElementHeight,borderWidth:t.sizes.borderWidth,borderStyle:"solid",borderColor:t.colors.widgetBorderColor??t.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:t.radii.default,overflow:"hidden","&.focused":{borderColor:t.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:t.spacing.none}}})),Dt=k("div",{target:"eaeic2i1"})({display:"flex",flexDirection:"row",alignSelf:"stretch"}),K=k("button",{target:"eaeic2i2"})(({theme:t})=>({margin:t.spacing.none,border:"none",height:t.sizes.full,display:"flex",alignItems:"center",width:t.sizes.numberInputControlsWidth,justifyContent:"center",color:t.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:t.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:t.colors.white,backgroundColor:t.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:t.colors.fadedText40}})),Vt=k("div",{target:"eaeic2i3"})(({theme:t,clearable:e})=>({position:"absolute",marginRight:t.spacing.twoXS,left:0,right:`calc(${t.sizes.numberInputControlsWidth} * 2 + ${e?"1em":"0em"})`})),kt=dt.getLogger("NumberInput");function Nt(t){return h(t)||t===""?void 0:t}const tt=t=>{const e=t.toString();if(e.includes("e-")){const r=e.match(/(\d+(?:\.\d+)?)e-(\d+)/);if(r){const s=(r[1]?.split(".")[1]||"").length,n=parseInt(r[2],10);return s+n}return 0}return(e.split(".")[1]||"").length},_=({value:t,format:e,step:r,dataType:s})=>{if(h(t))return null;let n=Nt(e);if(h(n)&&J(r)&&s===C.DataType.FLOAT&&r!==0){const l=tt(r);l>0&&(n=`%0.${l}f`)}if(h(n))return t.toString();try{return St.sprintf(n,t)}catch(l){return kt.warn(`Error in sprintf(${n}, ${t}): ${l}`),String(t)}},Et=(t,e,r)=>h(t)?!1:t-e>=r,Rt=(t,e,r)=>h(t)?!1:t+e<=r,X=(t,e,r)=>{const s=tt(e);if(s===0)switch(r){case"add":return t+e;case"subtract":return t-e}const n=Math.pow(10,s),l=Math.round(t*n),p=Math.round(e*n);switch(r){case"add":return(l+p)/n;case"subtract":return(l-p)/n}},Ft=({step:t,dataType:e})=>t||(e===C.DataType.INT?1:.01);function q(t,e){return e.dataType===C.DataType.INT?t.getIntValue(e):t.getDoubleValue(e)}function Wt(t){return t.default??null}function zt(t){return t.value??t.default??null}function Bt(t,e,r,s){switch(t.dataType){case C.DataType.INT:e.setIntValue(t,r.value,{fromUi:r.fromUi},s);break;case C.DataType.FLOAT:e.setDoubleValue(t,r.value,{fromUi:r.fromUi},s);break;default:throw new Error("Invalid data type")}}const Lt=({disabled:t,element:e,widgetMgr:r,fragmentId:s})=>{const n=pt(),{dataType:l,formId:p,default:T,format:N,icon:E,min:g,max:y}=e,{width:L,elementRef:et}=ft(),c=a.useMemo(()=>Ft({step:e.step,dataType:e.dataType}),[e.step,e.dataType]),I=a.useCallback(o=>_({value:o,dataType:l,format:N,step:c}),[l,N,c]),[f,w]=a.useState(!1),[b,S]=a.useState(()=>{const o=q(r,e)??T??null;return _({value:o,dataType:l,format:N,step:c})}),[P,U]=Tt({getStateFromWidgetMgr:q,getDefaultStateFromProto:Wt,getCurrStateFromProto:zt,updateWidgetMgrState:Bt,element:e,widgetMgr:r,fragmentId:s,onFormCleared:a.useCallback(()=>{const o=T??null;w(!1),S(I(o))},[T,I])}),[A,H]=a.useState(!1),R=a.useRef(null),[$]=a.useState(()=>wt("number_input_")),M=mt({formId:p}),nt=M?r.allowFormEnterToSubmit(p):f,rt=A&&L>V(n.breakpoints.hideWidgetDetails);a.useEffect(()=>{f||S(I(P))},[P,f,I]);const m=a.useCallback(({value:o,fromUi:i})=>{if(J(o)&&(g>o||o>y)){R.current?.reportValidity();return}const D=o??T??null;U({value:D,fromUi:i}),w(!1),S(I(D))},[g,y,T,I,U]),ot=a.useCallback(()=>{H(!0)},[]);a.useEffect(()=>{const o=R.current;if(o){const i=D=>{D.preventDefault()};return o.addEventListener("wheel",i),()=>{o.removeEventListener("wheel",i)}}},[]);const F=h(e.default)&&!t,at=a.useCallback(o=>{const{value:i}=o.target;i===""?(w(!0),S(null)):(w(!0),S(i))},[]),u=a.useMemo(()=>{if(b===null||b==="")return null;if(e.dataType===C.DataType.INT){const i=parseInt(b,10);return isNaN(i)?null:i}const o=parseFloat(b);return isNaN(o)?null:o},[b,e.dataType]),v=Et(u,c,g),x=Rt(u,c,y),st=a.useCallback(()=>{f&&m({value:u,fromUi:!0}),H(!1)},[f,u,m]),W=a.useCallback(()=>{if(x){const o=X(u??g,c,"add");m({value:o,fromUi:!0})}},[u,g,c,x,m]),z=a.useCallback(()=>{if(v){const o=X(u??y,c,"subtract");m({value:o,fromUi:!0})}},[u,y,c,v,m]),it=a.useCallback(o=>{const{key:i}=o;switch(i){case"ArrowUp":o.preventDefault(),W();break;case"ArrowDown":o.preventDefault(),z();break}},[W,z]),lt=a.useCallback(o=>{o.key==="Enter"&&(f&&m({value:u,fromUi:!0}),r.allowFormEnterToSubmit(p)&&r.submitForm(p,s))},[f,u,m,r,p,s]),ct=V(n.iconSizes.lg)+2*V(n.spacing.twoXS),O=V(n.breakpoints.hideNumberInputControls),ut=E?O+ct:O;return B("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:et,children:[d(gt,{label:e.label,disabled:t,labelVisibility:bt(e.labelVisibility?.value),htmlFor:$,children:e.help&&d(ht,{content:e.help,label:e.label})}),B(xt,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[d(vt,{type:"number",inputRef:R,value:b??"",placeholder:e.placeholder,onBlur:st,onFocus:ot,onChange:at,onKeyPress:lt,onKeyDown:it,clearable:F,clearOnEscape:F,disabled:t,"aria-label":e.label,startEnhancer:e.icon&&d(It,{"data-testid":"stNumberInputIcon",iconValue:e.icon,size:"lg"}),id:$,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:n.colors.grayTextColor,padding:n.spacing.threeXS,height:n.sizes.clearIconSize,width:n.sizes.clearIconSize,":hover":{fill:n.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:c,min:g,max:y,type:"number",inputMode:""},style:{fontWeight:n.fontWeights.normal,lineHeight:n.lineHeights.inputWidget,paddingRight:n.spacing.sm,paddingLeft:n.spacing.md,paddingBottom:n.spacing.sm,paddingTop:n.spacing.sm,"::placeholder":{color:n.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:E?n.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:n.iconSizes.lg,color:yt(E)?n.colors.fadedText60:"inherit"}}}}),L>ut&&B(Dt,{children:[d(K,{"data-testid":"stNumberInputStepDown",onClick:z,disabled:!v||t,tabIndex:-1,children:d(j,{content:Q,size:"xs",color:v?"inherit":n.colors.fadedText40})}),d(K,{"data-testid":"stNumberInputStepUp",onClick:W,disabled:!x||t,tabIndex:-1,children:d(j,{content:Z,size:"xs",color:x?"inherit":n.colors.fadedText40})})]})]}),rt&&d(Vt,{clearable:F,children:d(Ct,{dirty:f,value:b??"",inForm:M,allowEnterToSubmit:nt})})]})},Kt=a.memo(Lt);export{Kt as default};
|