botframework-webchat-fluent-theme 4.17.0 → 4.17.1-main.20240509.b00b5c9

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.
@@ -1,3 +1,3 @@
1
- import{injectMetaTag as Ur}from"inject-meta-tag";import{Components as Dr}from"botframework-webchat-component";import be,{memo as Pr}from"react";import dt,{memo as it,useMemo as ct,useState as ut}from"react";import{createContext as lt}from"react";var he=lt(new Proxy({},{get(){throw new Error("botframework-webchat: This hook can only used under its corresponding <Provider>.")}}));he.displayName="TelephoneKeypad.Context";var D=he;var mt=it(({children:e})=>{let[t,o]=ut(!1),r=ct(()=>Object.freeze({setShown:o,shown:t}),[o,t]);return dt.createElement(D.Provider,{value:r},e)}),j=mt;import zt,{memo as Ot}from"react";import{Components as It}from"botframework-webchat-component";import Dt from"classnames";import f,{memo as Be,useCallback as v,useEffect as Pt,useRef as Rt}from"react";import{useRefFrom as _e}from"use-ref-from";import W,{forwardRef as gt,memo as xt,useCallback as yt}from"react";import{useRefFrom as vt}from"use-ref-from";var ge={"telephone-keypad__button":"r","telephone-keypad__button__ruby":"e","telephone-keypad__button__text":"o","telephone-keypad--horizontal":"l"};var bt=".webchat-fluent .r{-webkit-user-select:none;align-items:center;-webkit-appearance:none;appearance:none;background-color:#fff;border-radius:100%;border:solid 1px var(--webchat-colorNeutralStroke1);color:var(--webchat-colorGray200);font-weight:var(--webchat-fontWeightSemibold);cursor:pointer;display:flex;flex-direction:column;height:60px;opacity:.7;padding:0;position:relative;touch-action:none;user-select:none;width:60px}.webchat-fluent .r:hover{background-color:var(--webchat-colorGray30)}.webchat-fluent .e{color:var(--webchat-colorGray190);font-size:10px}.webchat-fluent .o{font-size:24px;margin-top:8px}.webchat-fluent .l .r{height:32px;justify-content:center;margin:8px 4px;width:32px}.webchat-fluent .l .e{display:none}.webchat-fluent .l .o{font-size:20px;margin-top:0}.webchat-fluent .c{align-items:center;background:var(--webchat-colorNeutralBackground1);border:none;border-radius:var(--webchat-borderRadiusXLarge);display:flex;flex-direction:column;font-family:var(--webchat-fontFamilyBase);justify-content:center}.webchat-fluent .n{box-sizing:border-box;display:grid;gap:16px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);justify-items:center;padding:16px;width:100%}.webchat-fluent .d{align-items:center;color:var(--webchat-colorNeutralForeground4);display:flex;font-size:12px;gap:6px;margin-block-end:6px}.webchat-fluent .i{color:var(--webchat-colorBrandForegroundLink);text-decoration-color:transparent}.webchat-fluent .i:target{color:var(--webchat-colorBrandForegroundLinkSelected)}.webchat-fluent .i:hover{color:var(--webchat-colorBrandForegroundLinkHover);text-decoration:underline 1px currentColor}.webchat-fluent .i:active{color:var(--webchat-colorBrandForegroundLinkPressed)}.webchat-fluent .i:focus-visible{outline:none;text-decoration:underline 1px double var(--webchat-colorStrokeFocus2)}.webchat-fluent.a{display:contents;--webchat-colorNeutralForeground1: var(--colorNeutralForeground1, #242424);--webchat-colorNeutralForeground2: var(--colorNeutralForeground2, #424242);--webchat-colorNeutralForeground4: var(--colorNeutralForeground4, #707070);--webchat-colorNeutralForeground2BrandHover: var(--colorNeutralForeground2BrandHover, #02729c);--webchat-colorNeutralForeground2BrandPressed: var(--colorNeutralForeground2BrandPressed, #01678c);--webchat-colorNeutralForeground2BrandSelected: var(--colorNeutralForeground2BrandSelected, #067191);--webchat-colorNeutralForegroundDisabled: var(--colorNeutralForegroundDisabled, #bdbdbd);--webchat-colorNeutralBackground1: var(--colorNeutralBackground1, #ffffff);--webchat-colorNeutralBackground4: var(--colorNeutralBackground4, #f0f0f0);--webchat-colorNeutralBackground5: var(--colorNeutralBackground5, #ebebeb);--webchat-colorNeutralStroke1: var(--colorNeutralStroke1, #d1d1d1);--webchat-colorNeutralStroke2: var(--colorNeutralStroke2, #e0e0e0);--webchat-colorNeutralStroke1Selected: var(--colorNeutralStroke1Selected, #bdbdbd);--webchat-colorStrokeFocus2: var(--colorStrokeFocus2, #000000);--webchat-colorBrandStroke2: var(--colorBrandStroke2, #9edcf7);--webchat-colorBrandForeground2Hover: var(--colorBrandForeground2Hover, #015a7a);--webchat-colorBrandForeground2Pressed: var(--colorBrandForeground2Pressed, #01384d);--webchat-colorBrandForegroundLink: var(--colorBrandForegroundLink, #01678c);--webchat-colorBrandForegroundLinkHover: var(--colorBrandForegroundLinkHover, #015a7a);--webchat-colorBrandForegroundLinkPressed: var(--colorBrandForegroundLinkPressed, #014259);--webchat-colorBrandForegroundLinkSelected: var(--colorBrandForegroundLinkSelected, #01678c);--webchat-colorBrandBackground2Hover: var(--colorBrandBackground2Hover, #bee7fa);--webchat-colorBrandBackground2Pressed: var(--colorBrandBackground2Pressed, #7fd2f5);--webchat-colorCompoundBrandForeground1Hover: var(--colorCompoundBrandForeground1Hover, #02729c);--webchat-colorStatusDangerForeground1: var(--colorStatusDangerForeground1, #b10e1c);--webchat-colorGray30: var(--colorGray30, #edebe9);--webchat-colorGray160: var(--colorGray160, #323130);--webchat-colorGray190: var(--colorGray190, #201f1e);--webchat-colorGray200: var(--colorGray200, #1b1a19);--webchat-borderRadiusSmall: var(--borderRadiusSmall, 2px);--webchat-borderRadiusLarge: var(--borderRadiusLarge, 6px);--webchat-borderRadiusXLarge: var(--borderRadiusXLarge, 8px);--webchat-shadow16: var(--shadow16, 0 6.4px 14.4px 0 rgba(0, 0, 0, .132), 0 1.2px 3.6px 0 rgba(0, 0, 0, .108));--webchat-spacingHorizontalMNudge: var(--spacingHorizontalMNudge, 10px);--webchat-fontFamilyBase: var(--fontFamilyBase, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontFamilyNumeric: var(--fontFamilyNumeric, Bahnschrift, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontWeightSemibold: var(--fontWeightSemibold, 600);--webchat-strokeWidthThicker: var(--strokeWidthThicker, 3px);--webchat-durationUltraFast: var(--durationUltraFast, 0);--webchat-durationNormal: var(--durationNormal, .2s);--webchat-curveAccelerateMid: var(--curveAccelerateMid, cubic-bezier(1,0,1,1));--webchat-curveDecelerateMid: var(--curveDecelerateMid, cubic-bezier(0,0,0,1))}@media (prefers-reduced-motion){.webchat-fluent.a{--webchat-durationUltraFast: .01ms;--webchat-durationNormal: .01ms}}.webchat-fluent .b{background-color:var(--webchat-colorNeutralBackground4);border-radius:inherit;cursor:copy;display:grid;gap:8px;inset:0;place-content:center;place-items:center;position:absolute}.webchat-fluent .u{background-color:#e00;color:#fff}.webchat-fluent .h{height:36px;pointer-events:none;width:36px}.webchat-fluent .s{align-items:center;background:transparent;border-radius:8px;border:1px solid var(--webchat-colorBrandStroke2);color:currentColor;cursor:pointer;display:flex;font-size:12px;gap:4px;padding:4px 8px;text-align:start;transition:all .15s ease-out}@media (hover: hover){.webchat-fluent .s:not([aria-disabled=true]):hover{background-color:var(--webchat-colorBrandBackground2Hover);color:var(--webchat-colorBrandForeground2Hover)}}.webchat-fluent .s:not([aria-disabled=true]):active{background-color:var(--webchat-colorBrandBackground2Pressed);color:var(--webchat-colorBrandForeground2Pressed)}.webchat-fluent .s[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .g{font-size:12px;height:1em;width:1em}.webchat-fluent .p{align-items:flex-end;align-self:flex-end;display:flex;flex-direction:column;gap:8px}.webchat-fluent .p:not(:empty){padding-block-end:8px;padding-inline-start:4px}.webchat-fluent .p.w{flex-direction:row;flex-wrap:wrap;justify-content:flex-end}.webchat-fluent .p.v{flex-direction:column}.webchat-fluent .f{display:flex;gap:4px;margin-inline-start:auto}.webchat-fluent .x{align-items:center;-webkit-appearance:none;appearance:none;aspect-ratio:1;background:transparent;border-radius:var(--webchat-borderRadiusSmall);border:none;color:currentColor;cursor:pointer;display:flex;justify-content:center;padding:3px;width:32px}.webchat-fluent .x>svg{font-size:20px;pointer-events:none}.webchat-fluent .x.k{color:var(--webchat-colorNeutralForeground2BrandSelected)}@media (hover: hover){.webchat-fluent .x:not([aria-disabled=true]):hover{color:var(--webchat-colorNeutralForeground2BrandHover)}}.webchat-fluent .x:not([aria-disabled=true]):active{color:var(--webchat-colorNeutralForeground2BrandPressed)}.webchat-fluent .x[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .m{align-self:center;border-inline-end:1px solid var(--webchat-colorNeutralStroke2);height:28px}.webchat-fluent .m:is(:first-child,:last-child,:only-child){display:none}.webchat-fluent .B{display:grid}.webchat-fluent .F{font-size:0;height:0;opacity:0;width:1px}.webchat-fluent .y{border-radius:var(--webchat-borderRadiusLarge);border:1px solid var(--webchat-colorNeutralStroke1);cursor:default;padding:6px 8px;width:fit-content}.webchat-fluent .N{color:transparent;font-size:0;height:0;left:0;position:absolute;top:0;width:0}.webchat-fluent .S{display:grid;grid-template-areas:\"main\";max-height:200px;overflow:hidden}.webchat-fluent .z{height:0;visibility:collapse}.webchat-fluent .L{border:none;font:inherit;grid-area:main;outline:inherit;overflow-wrap:anywhere;resize:inherit;scrollbar-gutter:stable}.webchat-fluent .H{overflow:hidden;visibility:hidden;white-space:pre-wrap}.webchat-fluent .W{background-color:inherit;color:currentColor;height:100%;padding:0}.webchat-fluent .P{scrollbar-color:unset;scrollbar-width:unset;-moz-scrollbar-color:var(--webchat-colorNeutralBackground5) var(--webchat-colorNeutralForeground2);-moz-scrollbar-width:thin}.webchat-fluent .P::-webkit-scrollbar{width:8px}.webchat-fluent .P::-webkit-scrollbar-track{background-color:var(--webchat-colorNeutralBackground5);border-radius:16px}.webchat-fluent .P::-webkit-scrollbar-thumb{background-color:var(--webchat-colorNeutralForeground2);border-radius:16px}.webchat-fluent .P::-webkit-scrollbar-corner{background-color:var(--webchat-colorNeutralBackground5)}.webchat-fluent .R{color:var(--webchat-colorNeutralForeground1);font-family:var(--webchat-fontFamilyBase);padding:0 10px 10px;text-rendering:optimizeLegibility;--webchat-sendbox-attachment-area-active: ;--webchat-sendbox-border-radius: var(--webchat-borderRadiusLarge)}.webchat-fluent .G{background-color:var(--webchat-colorNeutralBackground1);border-radius:var(--webchat-sendbox-border-radius);border:1px solid var(--webchat-colorNeutralStroke1);display:grid;font-family:var(--webchat-fontFamilyBase);font-size:14px;gap:6px;grid-template:[telephone-keypad-start] \"text-area\" [telephone-keypad-end] var(--webchat-sendbox-attachment-area-active) \"controls\" / [telephone-keypad] 1fr;line-height:20px;padding:8px;position:relative}.webchat-fluent .G:has(.t){--webchat-sendbox-attachment-area-active: \"attachment\" }.webchat-fluent .G:focus-within{border-color:var(--webchat-colorNeutralStroke1Selected)}.webchat-fluent .G:after{border-bottom-left-radius:var(--webchat-sendbox-border-radius);border-bottom-right-radius:var(--webchat-sendbox-border-radius);border-bottom:var(--webchat-strokeWidthThicker) solid var(--webchat-colorCompoundBrandForeground1Hover);bottom:-1px;clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 50% 0 50%);content:\"\";height:var(--webchat-sendbox-border-radius);left:-1px;position:absolute;right:-1px;transition:clip-path var(--webchat-durationUltraFast) var(--webchat-curveAccelerateMid)}.webchat-fluent .G:focus-within:after{clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 0 0 0);transition:clip-path var(--webchat-durationNormal) var(--webchat-curveDecelerateMid)}.webchat-fluent .G>.D{grid-area:text-area}.webchat-fluent .G>.t{grid-area:attachment}.webchat-fluent .G>.M{grid-area:controls}.webchat-fluent .G>.U{grid-area:telephone-keypad}.webchat-fluent .C{background-color:transparent;border:none;flex:auto;font-family:var(--webchat-fontFamilyBase);font-size:14px;line-height:20px;outline:none;padding:4px 4px 0;resize:none}.webchat-fluent .j{align-items:center;display:flex;padding-inline-start:4px}.webchat-fluent .T{color:var(--webchat-colorNeutralForeground4);cursor:default;font-family:var(--webchat-fontFamilyNumeric);font-size:10px;line-height:14px;margin-inline-end:4px}.webchat-fluent .I{color:var(--webchat-colorStatusDangerForeground1)}\n/*! For license information please see botframework-webchat-fluent-theme.css.LEGAL.txt */\n";function P(){if(globalThis.document){let e=document.createElement("style");e.append(document.createTextNode(bt)),document.head.appendChild(e)}}import{useMemo as ft}from"react";function ht(e){return ft(()=>Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,`${t} ${o}`]))),[e])}var i=ht;var xe=xt(gt(({button:e,"data-testid":t,onClick:o,ruby:r},a)=>{let d=i(ge),c=vt(o),n=yt(()=>c.current?.(),[c]);return W.createElement("button",{className:d["telephone-keypad__button"],"data-testid":t,onClick:n,ref:a,type:"button"},W.createElement("span",{className:d["telephone-keypad__button__text"]},e==="star"?"\u2217":e==="pound"?"#":e),!!r&&W.createElement("ruby",{className:d["telephone-keypad__button__ruby"]},r))}));xe.displayName="TelephoneKeypad.Button";var y=xe;var wt={sendBoxDropZone:"send box drop zone",sendBoxSendButton:"send box send button",sendBoxTextBox:"send box text area",sendBoxTelephoneKeypadButton1:"send box telephone keypad button 1",sendBoxTelephoneKeypadButton2:"send box telephone keypad button 2",sendBoxTelephoneKeypadButton3:"send box telephone keypad button 3",sendBoxTelephoneKeypadButton4:"send box telephone keypad button 4",sendBoxTelephoneKeypadButton5:"send box telephone keypad button 5",sendBoxTelephoneKeypadButton6:"send box telephone keypad button 6",sendBoxTelephoneKeypadButton7:"send box telephone keypad button 7",sendBoxTelephoneKeypadButton8:"send box telephone keypad button 8",sendBoxTelephoneKeypadButton9:"send box telephone keypad button 9",sendBoxTelephoneKeypadButton0:"send box telephone keypad button 0",sendBoxTelephoneKeypadButtonStar:"send box telephone keypad button star",sendBoxTelephoneKeypadButtonPound:"send box telephone keypad button pound",sendBoxTelephoneKeypadToolbarButton:"send box telephone keypad toolbar button",sendBoxUploadButton:"send box upload button"},m=wt;import{useContext as Tt,useMemo as kt}from"react";function k(){let{setShown:e,shown:t}=Tt(D);return kt(()=>Object.freeze([t,e]),[t,e])}var X={"telephone-keypad":"c","telephone-keypad__box":"n","telephone-keypad__info-message":"d","telephone-keypad__info-message-link":"i"};import ye,{memo as Bt}from"react";function Nt(e){return ye.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},ye.createElement("path",{d:"M6 2a2 2 0 0 0-2 2v5.2c.32-.08.66-.15 1-.18V4a1 1 0 0 1 1-1h4v3.5c0 .83.67 1.5 1.5 1.5H15v8a1 1 0 0 1-1 1h-3.6c-.18.36-.4.7-.66 1H14a2 2 0 0 0 2-2V7.41c0-.4-.16-.78-.44-1.06l-3.91-3.91A1.5 1.5 0 0 0 10.59 2H6Zm8.8 5h-3.3a.5.5 0 0 1-.5-.5V3.2L14.8 7ZM10 14.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-4-2a.5.5 0 0 0-1 0V14H3.5a.5.5 0 0 0 0 1H5v1.5a.5.5 0 0 0 1 0V15h1.5a.5.5 0 0 0 0-1H6v-1.5Z",fill:"currentColor"}))}var G=Bt(Nt);import ve,{memo as St}from"react";function Et(e){return ve.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("path",{d:"m4.83 10.48 5.65-5.65a3 3 0 0 1 4.25 4.24L8 15.8a1.5 1.5 0 0 1-2.12-2.12l6-6.01a.5.5 0 1 0-.7-.71l-6 6.01a2.5 2.5 0 0 0 3.53 3.54l6.71-6.72a4 4 0 1 0-5.65-5.66L4.12 9.78a.5.5 0 0 0 .7.7Z",fill:"currentColor"}))}var $=St(Et);import we,{memo as Ct}from"react";function Ft(e){return we.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 16 16",width:"1em",xmlns:"http://www.w3.org/2000/svg"},we.createElement("path",{d:"M8.5 7.5a.5.5 0 1 0-1 0v3a.5.5 0 0 0 1 0v-3Zm.25-2a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1ZM2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8Z",fill:"currentColor"}))}var V=Ct(Ft);import Te,{memo as At}from"react";function Mt(e){return Te.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Te.createElement("path",{d:"M2.18 2.11a.5.5 0 0 1 .54-.06l15 7.5a.5.5 0 0 1 0 .9l-15 7.5a.5.5 0 0 1-.7-.58L3.98 10 2.02 2.63a.5.5 0 0 1 .16-.52Zm2.7 8.39-1.61 6.06L16.38 10 3.27 3.44 4.88 9.5h6.62a.5.5 0 1 1 0 1H4.88Z",fill:"currentColor"}))}var Y=At(Mt);import ke,{memo as Ht}from"react";function Lt(e){return ke.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},ke.createElement("path",{d:"M6 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm0 4a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM7.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 16a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM15.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z",fill:"currentColor"}))}var q=Ht(Lt);var{LocalizedString:Kt}=It,Ne=Be(({children:e,isHorizontal:t})=>{let o=i(X);return t?null:f.createElement("div",{className:o["telephone-keypad__box"]},e)});Ne.displayName="TelephoneKeypad:Orientation";var Se=Be(({autoFocus:e,className:t,onButtonClick:o,isHorizontal:r})=>{let a=_e(e),d=i(X),c=Rt(null),n=_e(o),[,u]=k(),b=v(()=>n.current?.("1"),[n]),s=v(()=>n.current?.("2"),[n]),l=v(()=>n.current?.("3"),[n]),p=v(()=>n.current?.("4"),[n]),g=v(()=>n.current?.("5"),[n]),N=v(()=>n.current?.("6"),[n]),_=v(()=>n.current?.("7"),[n]),B=v(()=>n.current?.("8"),[n]),w=v(()=>n.current?.("9"),[n]),T=v(()=>n.current?.("0"),[n]),S=v(()=>n.current?.("star"),[n]),C=v(()=>n.current?.("pound"),[n]),O=v(U=>{U.key==="Escape"&&u(!1)},[u]);return Pt(()=>{a.current&&c.current?.focus()},[a,c]),f.createElement("div",{className:Dt(d["telephone-keypad"],t),onKeyDown:O},f.createElement(Ne,{isHorizontal:r},f.createElement(y,{button:"1","data-testid":m.sendBoxTelephoneKeypadButton1,onClick:b,ref:c}),f.createElement(y,{button:"2","data-testid":m.sendBoxTelephoneKeypadButton2,onClick:s,ruby:"ABC"}),f.createElement(y,{button:"3","data-testid":m.sendBoxTelephoneKeypadButton3,onClick:l,ruby:"DEF"}),f.createElement(y,{button:"4","data-testid":m.sendBoxTelephoneKeypadButton4,onClick:p,ruby:"GHI"}),f.createElement(y,{button:"5","data-testid":m.sendBoxTelephoneKeypadButton5,onClick:g,ruby:"JKL"}),f.createElement(y,{button:"6","data-testid":m.sendBoxTelephoneKeypadButton6,onClick:N,ruby:"MNO"}),f.createElement(y,{button:"7","data-testid":m.sendBoxTelephoneKeypadButton7,onClick:_,ruby:"PQRS"}),f.createElement(y,{button:"8","data-testid":m.sendBoxTelephoneKeypadButton8,onClick:B,ruby:"TUV"}),f.createElement(y,{button:"9","data-testid":m.sendBoxTelephoneKeypadButton9,onClick:w,ruby:"WXYZ"}),f.createElement(y,{button:"star","data-testid":m.sendBoxTelephoneKeypadButtonStar,onClick:S}),f.createElement(y,{button:"0","data-testid":m.sendBoxTelephoneKeypadButton0,onClick:T,ruby:"+"}),f.createElement(y,{button:"pound","data-testid":m.sendBoxTelephoneKeypadButtonPound,onClick:C})),f.createElement("div",{className:d["telephone-keypad__info-message"]},f.createElement(V,null),f.createElement(Kt,{linkClassName:d["telephone-keypad__info-message-link"],stringIds:"TELEPHONE_KEYPAD_INPUT_MESSAGE"})))});Se.displayName="TelephoneKeypad";var Ee=Se;var Ce=Ot(e=>k()[0]?zt.createElement(Ee,{...e}):null);Ce.displayName="TelephoneKeypad.Surrogate";var J=Ce;import Zt from"react";import jt from"classnames";var Fe={theme:"a"};var Wt="webchat-fluent";function R(e){let t=i(Fe);return Zt.createElement("div",{className:jt(Wt,t.theme)},e.children)}import{hooks as _r}from"botframework-webchat-component";import L from"classnames";import h,{memo as Br,useCallback as A,useRef as Nr,useState as Sr}from"react";import{useRefFrom as rt}from"use-ref-from";import{hooks as Gt}from"botframework-webchat-component";import $t from"classnames";import Me,{memo as Vt,useCallback as Yt,useEffect as qt,useRef as Jt,useState as Qt}from"react";import{useRefFrom as eo}from"use-ref-from";var Ae={"sendbox__attachment-drop-zone":"b","sendbox__attachment-drop-zone--droppable":"u","sendbox__attachment-drop-zone-icon":"h"};var{useLocalizer:to}=Gt,oo=e=>{e.preventDefault()},He=e=>!!e.dataTransfer?.types?.some(t=>t.toLowerCase()==="files");function ro(e,t){let o=e.parentNode;for(;o;){if(o===t)return!0;o=o.parentNode}return!1}var Le=e=>{let[t,o]=Qt(!1),r=i(Ae),a=Jt(null),d=to(),c=eo(e.onFilesAdded);qt(()=>{let u=0,b=l=>{u++,He(l)&&o(a.current&&(l.target===a.current||l.target instanceof HTMLElement&&ro(l.target,a.current))?"droppable":"visible")},s=()=>--u<=0&&o(!1);return document.addEventListener("dragenter",b,!1),document.addEventListener("dragleave",s,!1),()=>{document.removeEventListener("dragenter",b),document.removeEventListener("dragleave",s)}},[o]);let n=Yt(u=>{u.preventDefault(),o(!1),He(u.nativeEvent)&&c.current([...u.dataTransfer.files])},[c,o]);return t?Me.createElement("div",{className:$t(r["sendbox__attachment-drop-zone"],{[r["sendbox__attachment-drop-zone--droppable"]]:t==="droppable"}),"data-testid":m.sendBoxDropZone,onDragOver:oo,onDrop:n,ref:a},Me.createElement(G,{className:r["sendbox__attachment-drop-zone-icon"]}),d("TEXT_INPUT_DROP_ZONE")):null};Le.displayName="DropZone";var Q=Vt(Le);import{hooks as Ao}from"botframework-webchat-component";import Mo from"classnames";import H,{memo as Ho,useCallback as Lo}from"react";import{hooks as yo}from"botframework-webchat-component";import vo from"classnames";import te,{memo as wo,useCallback as To}from"react";var Ie={"suggested-action":"s","suggested-action__image":"g"};import ao,{forwardRef as so,memo as lo,useRef as io}from"react";var co=e=>e.preventDefault(),uo=so(({"aria-hidden":e,children:t,disabled:o,onClick:r,tabIndex:a,...d},c)=>{let n=io(null);return ao.createElement("button",{"aria-disabled":o?"true":"false","aria-hidden":e,onClick:o?co:r,ref:c||n,tabIndex:a,...o&&{"aria-disabled":"true",tabIndex:-1},...d,type:"button"},t)}),De=lo(uo);import mo,{createContext as po,memo as bo,useCallback as F,useContext as fo,useEffect as ho,useMemo as go,useRef as ee}from"react";var Pe=po({itemEffector:()=>{throw new Error("botframework-webchat-fluent-theme rovingFocus: no provider for RovingFocusContext.")}});function xo(e){let t=ee(0),o=ee([]),r=F(({current:s},l)=>s&&(s.tabIndex=t.current===l?0:-1),[t]),a=F(s=>{let l;typeof s=="number"?l=s:l=s(t.current),l&&!o.current.at(l)?.current&&(l=0),t.current!==l&&(t.current=l,o.current.forEach((p,g)=>r(p,g)),o.current.at(l)?.current?.focus())},[r,o,t]),d=F(s=>{let{target:l}=s,p=o.current.findIndex(({current:g})=>g===l);p!==-1&&a(p)},[o,a]),c=F(s=>l=>{let p=!e.direction,g=/up|down/iu.test(s)&&e.direction==="vertical",N=/left|right/iu.test(s)&&e.direction==="horizontal",_=/right|down/iu.test(s),B=p||g||N?_?1:-1:0,w=o.current.map((S,C)=>C),T=w.indexOf(l)+B;return w.at(T)??0},[e.direction]),n=F(s=>{let{key:l}=s;switch(l){case"Up":case"ArrowUp":case"Left":case"ArrowLeft":case"Down":case"ArrowDown":case"Right":case"ArrowRight":a(c(l));break;case"Home":a(0);break;case"End":a(-1);break;case"Escape":e.onEscapeKey?.();break;default:return}s.preventDefault(),s.stopPropagation()},[a,c,e]),u=F((s,l)=>{let{current:p}=s;return o.current[Number(l)]=s,p.addEventListener("focus",d),p.addEventListener("keydown",n),r(s,l),()=>{p.removeEventListener("focus",d),p.removeEventListener("keydown",n),delete o.current[Number(l)]}},[d,n,r,o]),b=go(()=>({itemEffector:u}),[u]);return mo.createElement(Pe.Provider,{value:b},e.children)}function Re(e){let t=ee(null),{itemEffector:o}=fo(Pe);return ho(()=>o(t,e)),t}var Ke=bo(xo);var{useDisabled:ko,useFocus:_o,usePerformCardAction:Bo,useScrollToEnd:No,useStyleSet:So,useSuggestedActions:Eo}=yo;function Co({buttonText:e,className:t,displayText:o,image:r,imageAlt:a,itemIndex:d,text:c,type:n,value:u}){let[b,s]=Eo(),[{suggestedAction:l}]=So(),[p]=ko(),g=_o(),N=Re(d),_=Bo(),B=i(Ie),w=No(),T=To(({target:S})=>{(async function(){await g("sendBoxWithoutKeyboard"),_({displayText:o,text:c,type:n,value:u},{target:S}),n==="openUrl"&&s([]),w()})()},[o,g,_,w,s,c,n,u]);return te.createElement(De,{className:vo(B["suggested-action"],l+"",(t||"")+""),disabled:p,onClick:T,ref:N,type:"button"},r&&te.createElement("img",{alt:a,className:B["suggested-action__image"],src:r}),te.createElement("span",null,e))}var ze=wo(Co);function oe(e){let{title:t}=e,{type:o,value:r}=e;return o==="messageBack"?t||e.displayText:t||(typeof r=="string"?r:JSON.stringify(r))}var re={"suggested-actions":"p","suggested-actions--flow":"w","suggested-actions--stacked":"v"};var{useFocus:Io,useLocalizer:Do,useStyleOptions:Po,useStyleSet:Ro,useSuggestedActions:Ko}=Ao;function zo(e){let[{suggestedActionLayout:t}]=Po(),[{suggestedActions:o}]=Ro(),r=i(re);return H.createElement("div",{"aria-label":e["aria-label"],"aria-live":"polite","aria-orientation":"vertical",className:Mo(r["suggested-actions"],o+"",{[r["suggested-actions--flow"]]:t==="flow",[r["suggested-actions--stacked"]]:t!=="flow"},e.className),role:"toolbar"},!!e.children&&!!H.Children.count(e.children)&&e.children)}function Oo(){let e=i(re),t=Do(),[o]=Ko(),r=Io(),a=Lo(()=>{r("sendBox")},[r]),d=o.map((c,n)=>{let{displayText:u,image:b,imageAltText:s,text:l,type:p,value:g}=c;return o?.length?H.createElement(ze,{buttonText:oe(c),displayText:u,image:b,imageAlt:b&&(s||l),itemIndex:n,key:n,text:l,type:p,value:g}):null});return H.createElement(Ke,{onEscapeKey:a},H.createElement(zo,{"aria-label":t("SUGGESTED_ACTIONS_LABEL_ALT"),className:e["suggested-actions"]},d))}var ne=Ho(Oo);import{hooks as Wo}from"botframework-webchat-component";import z,{useCallback as Ue,useRef as Xo,memo as Go}from"react";import{useRefFrom as $o}from"use-ref-from";import ae from"classnames";import se,{memo as le}from"react";var K={sendbox__toolbar:"f","sendbox__toolbar-button":"x","sendbox__toolbar-button--selected":"k","sendbox__toolbar-separator":"m"};var Zo=e=>e.preventDefault(),E=le(e=>{let t=i(K);return se.createElement("button",{"aria-label":e["aria-label"],className:ae(t["sendbox__toolbar-button"],e.className,{[t["sendbox__toolbar-button--selected"]]:e.selected}),"data-testid":e["data-testid"],onClick:e.disabled?Zo:e.onClick,type:e.type==="submit"?"submit":"button",...e.disabled&&{"aria-disabled":"true",tabIndex:-1}},e.children)});E.displayName="ToolbarButton";var de=le(e=>{let t=i(K);return se.createElement("div",{className:ae(t.sendbox__toolbar,e.className)},e.children)});de.displayName="Toolbar";var ie=le(e=>{let t=i(K);return se.createElement("div",{"aria-orientation":"vertical",className:ae(t["sendbox__toolbar-separator"],e.className),role:"separator"})});ie.displayName="ToolbarSeparator";var Oe={"sendbox__add-attachment":"B","sendbox__add-attachment-input":"F"};var{useLocalizer:Vo,useStyleOptions:Yo}=Wo;function qo(e){let t=Xo(null),o=i(Oe),r=Vo(),[{uploadAccept:a,uploadMultiple:d}]=Yo(),c=$o(e.onFilesAdded),n=Ue(()=>t.current?.click(),[t]),u=Ue(({target:{files:b}})=>{b&&(c.current?.([...b]),t.current&&(t.current.value=""))},[t,c]);return z.createElement("div",{className:o["sendbox__add-attachment"]},z.createElement("input",{accept:a,"aria-disabled":e.disabled,"aria-hidden":"true",className:o["sendbox__add-attachment-input"],multiple:d,onInput:e.disabled?void 0:u,readOnly:e.disabled,ref:t,role:"button",tabIndex:-1,type:"file"}),z.createElement(E,{"aria-label":r("TEXT_INPUT_UPLOAD_BUTTON_ALT"),"data-testid":m.sendBoxUploadButton,onClick:n},z.createElement($,null)))}var Ze=Go(qo);import{hooks as Qo}from"botframework-webchat-component";import er,{memo as tr}from"react";import or from"classnames";var je={sendbox__attachment:"y"};var{useLocalizer:rr}=Qo,nr={one:"TEXT_INPUT_ATTACHMENTS_ONE",two:"TEXT_INPUT_ATTACHMENTS_TWO",few:"TEXT_INPUT_ATTACHMENTS_FEW",many:"TEXT_INPUT_ATTACHMENTS_MANY",other:"TEXT_INPUT_ATTACHMENTS_OTHER"};function ar({attachments:e,className:t}){let o=i(je),r=rr({plural:!0});return e.length?er.createElement("div",{className:or(o.sendbox__attachment,t)},r(nr,e.length)):null}var We=tr(ar);import lr,{memo as dr}from"react";var Xe={"sendbox__error-message":"N"};function ir(e){let t=i(Xe);return lr.createElement("span",{className:t["sendbox__error-message"],id:e.id,role:"alert"},e.error)}var Ge=dr(ir);import $e,{memo as cr,useCallback as ur}from"react";import{hooks as mr}from"botframework-webchat-component";var{useLocalizer:pr}=mr,Ve=cr(()=>{let[e,t]=k(),o=pr(),r=ur(()=>t(a=>!a),[t]);return $e.createElement(E,{"aria-label":o("TEXT_INPUT_TELEPHONE_KEYPAD_BUTTON_ALT"),"data-testid":m.sendBoxTelephoneKeypadToolbarButton,onClick:r,selected:e},$e.createElement(q,null))});Ve.displayName="SendBox.TelephoneKeypadToolbarButton";var Ye=Ve;import ce from"classnames";import ue,{forwardRef as fr,useCallback as hr}from"react";var qe={"sendbox__text-area":"S","sendbox__text-area--hidden":"z","sendbox__text-area-shared":"L","sendbox__text-area-doppelganger":"H","sendbox__text-area-input":"W","sendbox__text-area-input--scroll":"P"};var Je=fr((e,t)=>{let o=i(qe),r=hr(a=>{!a.shiftKey&&a.key==="Enter"&&(a.preventDefault(),"form"in a.target&&a.target.form instanceof HTMLFormElement&&a.target?.form?.requestSubmit())},[]);return ue.createElement("div",{className:ce(o["sendbox__text-area"],{[o["sendbox__text-area--hidden"]]:e.hidden},e.className),role:e.hidden?"hidden":void 0},ue.createElement("div",{className:ce(o["sendbox__text-area-doppelganger"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"])},e.value||e.placeholder," "),ue.createElement("textarea",{"aria-label":e["aria-label"],className:ce(o["sendbox__text-area-input"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"]),"data-testid":e["data-testid"],onInput:e.onInput,onKeyDown:r,placeholder:e.placeholder,ref:t,rows:e.startRows??1,tabIndex:e.hidden?-1:void 0,value:e.value}))});Je.displayName="TextArea";var Qe=Je;import{hooks as gr}from"botframework-webchat-component";import{useMemo as et}from"react";import{useRefFrom as xr}from"use-ref-from";var{useConnectivityStatus:yr,useLocalizer:vr}=gr,wr=({attachments:e,message:t})=>{let[o]=yr(),r=vr(),a=xr(o!=="connected"&&o!=="reconnected"?"offline":!t&&!e.length?"empty":void 0),d=et(()=>Object.freeze(new Map().set("empty",r("SEND_BOX_IS_EMPTY_TOOLTIP_ALT")).set("offline",r("CONNECTIVITY_STATUS_ALT_FATAL"))),[r]);return et(()=>Object.freeze([a,a.current&&d.get(a.current)]),[d,a])},tt=wr;import{useMemo as Tr}from"react";function me(e){let t=Tr(()=>Math.random().toString(36).substr(2,5),[]);return e=e?`${e}--`:"",`${e}${t}`}var ot={sendbox:"R",sendbox__sendbox:"G","sendbox__attachment--in-grid":"t","sendbox__text-area--in-grid":"D","sendbox__sendbox-controls--in-grid":"M","sendbox__telephone-keypad--in-grid":"U","sendbox__sendbox-text":"C","sendbox__sendbox-controls":"j","sendbox__text-counter":"T","sendbox__text-counter--error":"I"};var{useFocus:Er,useLocalizer:Cr,useMakeThumbnail:Fr,useRegisterFocusSendBox:Ar,useSendBoxAttachments:Mr,useSendMessage:Hr,useStyleOptions:Lr}=_r;function Ir(e){let t=Nr(null),[o,r]=Sr(""),[a,d]=Mr(),[{hideTelephoneKeypadButton:c,hideUploadButton:n,maxMessageLength:u}]=Lr(),b=!!u&&o.length>u,s=i(ot),l=Cr(),p=Hr(),g=Fr(),N=me("sendbox__error-message-id"),[_,B]=tt({message:o,attachments:a}),[w]=k(),T=Er();Ar(A(({noKeyboard:x,waitUntil:Z})=>{t.current&&(x?Z((async()=>{let M=t.current?.getAttribute("readonly");t.current?.setAttribute("readonly","true"),await new Promise(I=>setTimeout(I,0)),t.current?.focus(),typeof M!="string"?t.current?.removeAttribute("readonly"):t.current?.setAttribute("readonly",M)})()):t.current?.focus())},[t]));let S=rt(a),C=rt(o),O=A(x=>{"tabIndex"in x.target&&typeof x.target.tabIndex=="number"&&x.target.tabIndex>=0||T("sendBox")},[T]),U=A(x=>r(x.currentTarget.value),[r]),fe=A(async x=>{let Z=Object.freeze(await Promise.all(x.map(M=>g(M).then(I=>Object.freeze({blob:M,...I&&{thumbnailURL:I}})))));d(Z)},[g,d]),nt=A(x=>{x.preventDefault(),_.current!=="empty"&&!b&&(p(C.current,void 0,{attachments:S.current}),r(""),d([])),T("sendBox")},[S,C,p,d,r,b,_,T]),at=A(x=>p(`/DTMF ${x}`),[p]),st={"aria-invalid":"false",...B&&{"aria-invalid":"true","aria-errormessage":N}};return h.createElement("form",{...st,className:L(s.sendbox,e.className),onSubmit:nt},h.createElement(ne,null),h.createElement("div",{className:L(s.sendbox__sendbox),onClickCapture:O},h.createElement(Qe,{"aria-label":l(b?"TEXT_INPUT_LENGTH_EXCEEDED_ALT":"TEXT_INPUT_ALT"),className:L(s["sendbox__sendbox-text"],s["sendbox__text-area--in-grid"]),"data-testid":m.sendBoxTextBox,hidden:w,onInput:U,placeholder:e.placeholder??l("TEXT_INPUT_PLACEHOLDER"),ref:t,value:o}),h.createElement(J,{autoFocus:!0,className:s["sendbox__telephone-keypad--in-grid"],isHorizontal:!1,onButtonClick:at}),h.createElement(We,{attachments:a,className:s["sendbox__attachment--in-grid"]}),h.createElement("div",{className:L(s["sendbox__sendbox-controls"],s["sendbox__sendbox-controls--in-grid"])},!w&&u&&h.createElement("div",{className:L(s["sendbox__text-counter"],{[s["sendbox__text-counter--error"]]:b})},`${o.length}/${u}`),h.createElement(de,null,!c&&h.createElement(Ye,null),!n&&h.createElement(Ze,{onFilesAdded:fe}),h.createElement(ie,null),h.createElement(E,{"aria-label":l("TEXT_INPUT_SEND_BUTTON_ALT"),"data-testid":m.sendBoxSendButton,disabled:b||w,type:"submit"},h.createElement(Y,null)))),h.createElement(Q,{onFilesAdded:fe}),h.createElement(Ge,{error:B,id:N})))}var pe=Br(Ir);var{ThemeProvider:Rr}=Dr,Kr=[()=>()=>()=>pe],zr=({children:e})=>be.createElement(R,null,be.createElement(j,null,be.createElement(Rr,{sendBoxMiddleware:Kr},e))),Or=Pr(zr);var Zr="tsup",jr="esmodules",Wr="4.17.0",xl={buildTool:Zr,moduleFormat:jr,version:Wr};Ur("botframework-webchat:fluent-theme","version=4.17.0; build-tool=tsup; module-format=esmodules");P();export{Or as FluentThemeProvider,xl as buildInfo,m as testIds};
1
+ import{injectMetaTag as Ur}from"inject-meta-tag";import{Components as Dr}from"botframework-webchat-component";import be,{memo as Pr}from"react";import dt,{memo as it,useMemo as ct,useState as ut}from"react";import{createContext as lt}from"react";var he=lt(new Proxy({},{get(){throw new Error("botframework-webchat: This hook can only used under its corresponding <Provider>.")}}));he.displayName="TelephoneKeypad.Context";var D=he;var mt=it(({children:e})=>{let[t,o]=ut(!1),r=ct(()=>Object.freeze({setShown:o,shown:t}),[o,t]);return dt.createElement(D.Provider,{value:r},e)}),j=mt;import zt,{memo as Ot}from"react";import{Components as It}from"botframework-webchat-component";import Dt from"classnames";import f,{memo as Be,useCallback as v,useEffect as Pt,useRef as Rt}from"react";import{useRefFrom as _e}from"use-ref-from";import W,{forwardRef as gt,memo as xt,useCallback as yt}from"react";import{useRefFrom as vt}from"use-ref-from";var ge={"telephone-keypad__button":"r","telephone-keypad__button__ruby":"e","telephone-keypad__button__text":"o","telephone-keypad--horizontal":"l"};var bt=".webchat-fluent .r{-webkit-user-select:none;align-items:center;-webkit-appearance:none;appearance:none;background-color:#fff;border-radius:100%;border:solid 1px var(--webchat-colorNeutralStroke1);color:var(--webchat-colorGray200);font-weight:var(--webchat-fontWeightSemibold);cursor:pointer;display:flex;flex-direction:column;height:60px;opacity:.7;padding:0;position:relative;touch-action:none;user-select:none;width:60px}.webchat-fluent .r:hover{background-color:var(--webchat-colorGray30)}.webchat-fluent .e{color:var(--webchat-colorGray190);font-size:10px}.webchat-fluent .o{font-size:24px;margin-top:8px}.webchat-fluent .l .r{height:32px;justify-content:center;margin:8px 4px;width:32px}.webchat-fluent .l .e{display:none}.webchat-fluent .l .o{font-size:20px;margin-top:0}.webchat-fluent .c{align-items:center;background:var(--webchat-colorNeutralBackground1);border:none;border-radius:var(--webchat-borderRadiusXLarge);display:flex;flex-direction:column;font-family:var(--webchat-fontFamilyBase);justify-content:center}.webchat-fluent .n{box-sizing:border-box;display:grid;gap:16px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);justify-items:center;padding:16px;width:100%}.webchat-fluent .d{align-items:center;color:var(--webchat-colorNeutralForeground4);display:flex;font-size:12px;gap:6px;margin-block-end:6px}.webchat-fluent .i{color:var(--webchat-colorBrandForegroundLink);text-decoration-color:transparent}.webchat-fluent .i:target{color:var(--webchat-colorBrandForegroundLinkSelected)}.webchat-fluent .i:hover{color:var(--webchat-colorBrandForegroundLinkHover);text-decoration:underline 1px currentColor}.webchat-fluent .i:active{color:var(--webchat-colorBrandForegroundLinkPressed)}.webchat-fluent .i:focus-visible{outline:none;text-decoration:underline 1px double var(--webchat-colorStrokeFocus2)}.webchat-fluent.a{display:contents;--webchat-colorNeutralForeground1: var(--colorNeutralForeground1, #242424);--webchat-colorNeutralForeground2: var(--colorNeutralForeground2, #424242);--webchat-colorNeutralForeground4: var(--colorNeutralForeground4, #707070);--webchat-colorNeutralForeground2BrandHover: var(--colorNeutralForeground2BrandHover, #02729c);--webchat-colorNeutralForeground2BrandPressed: var(--colorNeutralForeground2BrandPressed, #01678c);--webchat-colorNeutralForeground2BrandSelected: var(--colorNeutralForeground2BrandSelected, #067191);--webchat-colorNeutralForegroundDisabled: var(--colorNeutralForegroundDisabled, #bdbdbd);--webchat-colorNeutralBackground1: var(--colorNeutralBackground1, #ffffff);--webchat-colorNeutralBackground4: var(--colorNeutralBackground4, #f0f0f0);--webchat-colorNeutralBackground5: var(--colorNeutralBackground5, #ebebeb);--webchat-colorNeutralStroke1: var(--colorNeutralStroke1, #d1d1d1);--webchat-colorNeutralStroke2: var(--colorNeutralStroke2, #e0e0e0);--webchat-colorNeutralStroke1Selected: var(--colorNeutralStroke1Selected, #bdbdbd);--webchat-colorStrokeFocus2: var(--colorStrokeFocus2, #000000);--webchat-colorBrandStroke2: var(--colorBrandStroke2, #9edcf7);--webchat-colorBrandForeground2Hover: var(--colorBrandForeground2Hover, #015a7a);--webchat-colorBrandForeground2Pressed: var(--colorBrandForeground2Pressed, #01384d);--webchat-colorBrandForegroundLink: var(--colorBrandForegroundLink, #01678c);--webchat-colorBrandForegroundLinkHover: var(--colorBrandForegroundLinkHover, #015a7a);--webchat-colorBrandForegroundLinkPressed: var(--colorBrandForegroundLinkPressed, #014259);--webchat-colorBrandForegroundLinkSelected: var(--colorBrandForegroundLinkSelected, #01678c);--webchat-colorBrandBackground2Hover: var(--colorBrandBackground2Hover, #bee7fa);--webchat-colorBrandBackground2Pressed: var(--colorBrandBackground2Pressed, #7fd2f5);--webchat-colorCompoundBrandForeground1Hover: var(--colorCompoundBrandForeground1Hover, #02729c);--webchat-colorStatusDangerForeground1: var(--colorStatusDangerForeground1, #b10e1c);--webchat-colorGray30: var(--colorGray30, #edebe9);--webchat-colorGray160: var(--colorGray160, #323130);--webchat-colorGray190: var(--colorGray190, #201f1e);--webchat-colorGray200: var(--colorGray200, #1b1a19);--webchat-borderRadiusSmall: var(--borderRadiusSmall, 2px);--webchat-borderRadiusLarge: var(--borderRadiusLarge, 6px);--webchat-borderRadiusXLarge: var(--borderRadiusXLarge, 8px);--webchat-shadow16: var(--shadow16, 0 6.4px 14.4px 0 rgba(0, 0, 0, .132), 0 1.2px 3.6px 0 rgba(0, 0, 0, .108));--webchat-spacingHorizontalMNudge: var(--spacingHorizontalMNudge, 10px);--webchat-fontFamilyBase: var(--fontFamilyBase, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontFamilyNumeric: var(--fontFamilyNumeric, Bahnschrift, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontWeightSemibold: var(--fontWeightSemibold, 600);--webchat-strokeWidthThicker: var(--strokeWidthThicker, 3px);--webchat-durationUltraFast: var(--durationUltraFast, 0);--webchat-durationNormal: var(--durationNormal, .2s);--webchat-curveAccelerateMid: var(--curveAccelerateMid, cubic-bezier(1,0,1,1));--webchat-curveDecelerateMid: var(--curveDecelerateMid, cubic-bezier(0,0,0,1))}@media (prefers-reduced-motion){.webchat-fluent.a{--webchat-durationUltraFast: .01ms;--webchat-durationNormal: .01ms}}.webchat-fluent .b{background-color:var(--webchat-colorNeutralBackground4);border-radius:inherit;cursor:copy;display:grid;gap:8px;inset:0;place-content:center;place-items:center;position:absolute}.webchat-fluent .u{background-color:#e00;color:#fff}.webchat-fluent .h{height:36px;pointer-events:none;width:36px}.webchat-fluent .s{align-items:center;background:transparent;border-radius:8px;border:1px solid var(--webchat-colorBrandStroke2);color:currentColor;cursor:pointer;display:flex;font-size:12px;gap:4px;padding:4px 8px;text-align:start;transition:all .15s ease-out}@media (hover: hover){.webchat-fluent .s:not([aria-disabled=true]):hover{background-color:var(--webchat-colorBrandBackground2Hover);color:var(--webchat-colorBrandForeground2Hover)}}.webchat-fluent .s:not([aria-disabled=true]):active{background-color:var(--webchat-colorBrandBackground2Pressed);color:var(--webchat-colorBrandForeground2Pressed)}.webchat-fluent .s[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .g{font-size:12px;height:1em;width:1em}.webchat-fluent .p{align-items:flex-end;align-self:flex-end;display:flex;flex-direction:column;gap:8px}.webchat-fluent .p:not(:empty){padding-block-end:8px;padding-inline-start:4px}.webchat-fluent .p.w{flex-direction:row;flex-wrap:wrap;justify-content:flex-end}.webchat-fluent .p.v{flex-direction:column}.webchat-fluent .f{display:flex;gap:4px;margin-inline-start:auto}.webchat-fluent .x{align-items:center;-webkit-appearance:none;appearance:none;aspect-ratio:1;background:transparent;border-radius:var(--webchat-borderRadiusSmall);border:none;color:currentColor;cursor:pointer;display:flex;justify-content:center;padding:3px;width:32px}.webchat-fluent .x>svg{font-size:20px;pointer-events:none}.webchat-fluent .x.k{color:var(--webchat-colorNeutralForeground2BrandSelected)}@media (hover: hover){.webchat-fluent .x:not([aria-disabled=true]):hover{color:var(--webchat-colorNeutralForeground2BrandHover)}}.webchat-fluent .x:not([aria-disabled=true]):active{color:var(--webchat-colorNeutralForeground2BrandPressed)}.webchat-fluent .x[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .m{align-self:center;border-inline-end:1px solid var(--webchat-colorNeutralStroke2);height:28px}.webchat-fluent .m:is(:first-child,:last-child,:only-child){display:none}.webchat-fluent .B{display:grid}.webchat-fluent .F{font-size:0;height:0;opacity:0;width:1px}.webchat-fluent .y{border-radius:var(--webchat-borderRadiusLarge);border:1px solid var(--webchat-colorNeutralStroke1);cursor:default;padding:6px 8px;width:fit-content}.webchat-fluent .N{color:transparent;font-size:0;height:0;left:0;position:absolute;top:0;width:0}.webchat-fluent .S{display:grid;grid-template-areas:\"main\";max-height:200px;overflow:hidden}.webchat-fluent .z{height:0;visibility:collapse}.webchat-fluent .L{border:none;font:inherit;grid-area:main;outline:inherit;overflow-wrap:anywhere;resize:inherit;scrollbar-gutter:stable}.webchat-fluent .H{overflow:hidden;visibility:hidden;white-space:pre-wrap}.webchat-fluent .W{background-color:inherit;color:currentColor;height:100%;padding:0}.webchat-fluent .P{scrollbar-color:unset;scrollbar-width:unset;-moz-scrollbar-color:var(--webchat-colorNeutralBackground5) var(--webchat-colorNeutralForeground2);-moz-scrollbar-width:thin}.webchat-fluent .P::-webkit-scrollbar{width:8px}.webchat-fluent .P::-webkit-scrollbar-track{background-color:var(--webchat-colorNeutralBackground5);border-radius:16px}.webchat-fluent .P::-webkit-scrollbar-thumb{background-color:var(--webchat-colorNeutralForeground2);border-radius:16px}.webchat-fluent .P::-webkit-scrollbar-corner{background-color:var(--webchat-colorNeutralBackground5)}.webchat-fluent .R{color:var(--webchat-colorNeutralForeground1);font-family:var(--webchat-fontFamilyBase);padding:0 10px 10px;text-rendering:optimizeLegibility;--webchat-sendbox-attachment-area-active: ;--webchat-sendbox-border-radius: var(--webchat-borderRadiusLarge)}.webchat-fluent .G{background-color:var(--webchat-colorNeutralBackground1);border-radius:var(--webchat-sendbox-border-radius);border:1px solid var(--webchat-colorNeutralStroke1);display:grid;font-family:var(--webchat-fontFamilyBase);font-size:14px;gap:6px;grid-template:[telephone-keypad-start] \"text-area\" [telephone-keypad-end] var(--webchat-sendbox-attachment-area-active) \"controls\" / [telephone-keypad] 1fr;line-height:20px;padding:8px;position:relative}.webchat-fluent .G:has(.t){--webchat-sendbox-attachment-area-active: \"attachment\" }.webchat-fluent .G:focus-within{border-color:var(--webchat-colorNeutralStroke1Selected)}.webchat-fluent .G:after{border-bottom-left-radius:var(--webchat-sendbox-border-radius);border-bottom-right-radius:var(--webchat-sendbox-border-radius);border-bottom:var(--webchat-strokeWidthThicker) solid var(--webchat-colorCompoundBrandForeground1Hover);bottom:-1px;clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 50% 0 50%);content:\"\";height:var(--webchat-sendbox-border-radius);left:-1px;position:absolute;right:-1px;transition:clip-path var(--webchat-durationUltraFast) var(--webchat-curveAccelerateMid)}.webchat-fluent .G:focus-within:after{clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 0 0 0);transition:clip-path var(--webchat-durationNormal) var(--webchat-curveDecelerateMid)}.webchat-fluent .G>.D{grid-area:text-area}.webchat-fluent .G>.t{grid-area:attachment}.webchat-fluent .G>.M{grid-area:controls}.webchat-fluent .G>.U{grid-area:telephone-keypad}.webchat-fluent .C{background-color:transparent;border:none;flex:auto;font-family:var(--webchat-fontFamilyBase);font-size:14px;line-height:20px;outline:none;padding:4px 4px 0;resize:none}.webchat-fluent .j{align-items:center;display:flex;padding-inline-start:4px}.webchat-fluent .T{color:var(--webchat-colorNeutralForeground4);cursor:default;font-family:var(--webchat-fontFamilyNumeric);font-size:10px;line-height:14px;margin-inline-end:4px}.webchat-fluent .I{color:var(--webchat-colorStatusDangerForeground1)}\n/*! For license information please see botframework-webchat-fluent-theme.css.LEGAL.txt */\n";function P(){if(globalThis.document){let e=document.createElement("style");e.append(document.createTextNode(bt)),document.head.appendChild(e)}}import{useMemo as ft}from"react";function ht(e){return ft(()=>Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,`${t} ${o}`]))),[e])}var i=ht;var xe=xt(gt(({button:e,"data-testid":t,onClick:o,ruby:r},a)=>{let d=i(ge),c=vt(o),n=yt(()=>c.current?.(),[c]);return W.createElement("button",{className:d["telephone-keypad__button"],"data-testid":t,onClick:n,ref:a,type:"button"},W.createElement("span",{className:d["telephone-keypad__button__text"]},e==="star"?"\u2217":e==="pound"?"#":e),!!r&&W.createElement("ruby",{className:d["telephone-keypad__button__ruby"]},r))}));xe.displayName="TelephoneKeypad.Button";var y=xe;var wt={sendBoxDropZone:"send box drop zone",sendBoxSendButton:"send box send button",sendBoxTextBox:"send box text area",sendBoxTelephoneKeypadButton1:"send box telephone keypad button 1",sendBoxTelephoneKeypadButton2:"send box telephone keypad button 2",sendBoxTelephoneKeypadButton3:"send box telephone keypad button 3",sendBoxTelephoneKeypadButton4:"send box telephone keypad button 4",sendBoxTelephoneKeypadButton5:"send box telephone keypad button 5",sendBoxTelephoneKeypadButton6:"send box telephone keypad button 6",sendBoxTelephoneKeypadButton7:"send box telephone keypad button 7",sendBoxTelephoneKeypadButton8:"send box telephone keypad button 8",sendBoxTelephoneKeypadButton9:"send box telephone keypad button 9",sendBoxTelephoneKeypadButton0:"send box telephone keypad button 0",sendBoxTelephoneKeypadButtonStar:"send box telephone keypad button star",sendBoxTelephoneKeypadButtonPound:"send box telephone keypad button pound",sendBoxTelephoneKeypadToolbarButton:"send box telephone keypad toolbar button",sendBoxUploadButton:"send box upload button"},m=wt;import{useContext as Tt,useMemo as kt}from"react";function k(){let{setShown:e,shown:t}=Tt(D);return kt(()=>Object.freeze([t,e]),[t,e])}var X={"telephone-keypad":"c","telephone-keypad__box":"n","telephone-keypad__info-message":"d","telephone-keypad__info-message-link":"i"};import ye,{memo as Bt}from"react";function Nt(e){return ye.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},ye.createElement("path",{d:"M6 2a2 2 0 0 0-2 2v5.2c.32-.08.66-.15 1-.18V4a1 1 0 0 1 1-1h4v3.5c0 .83.67 1.5 1.5 1.5H15v8a1 1 0 0 1-1 1h-3.6c-.18.36-.4.7-.66 1H14a2 2 0 0 0 2-2V7.41c0-.4-.16-.78-.44-1.06l-3.91-3.91A1.5 1.5 0 0 0 10.59 2H6Zm8.8 5h-3.3a.5.5 0 0 1-.5-.5V3.2L14.8 7ZM10 14.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-4-2a.5.5 0 0 0-1 0V14H3.5a.5.5 0 0 0 0 1H5v1.5a.5.5 0 0 0 1 0V15h1.5a.5.5 0 0 0 0-1H6v-1.5Z",fill:"currentColor"}))}var G=Bt(Nt);import ve,{memo as St}from"react";function Et(e){return ve.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},ve.createElement("path",{d:"m4.83 10.48 5.65-5.65a3 3 0 0 1 4.25 4.24L8 15.8a1.5 1.5 0 0 1-2.12-2.12l6-6.01a.5.5 0 1 0-.7-.71l-6 6.01a2.5 2.5 0 0 0 3.53 3.54l6.71-6.72a4 4 0 1 0-5.65-5.66L4.12 9.78a.5.5 0 0 0 .7.7Z",fill:"currentColor"}))}var $=St(Et);import we,{memo as Ct}from"react";function Ft(e){return we.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 16 16",width:"1em",xmlns:"http://www.w3.org/2000/svg"},we.createElement("path",{d:"M8.5 7.5a.5.5 0 1 0-1 0v3a.5.5 0 0 0 1 0v-3Zm.25-2a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1ZM2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8Z",fill:"currentColor"}))}var V=Ct(Ft);import Te,{memo as At}from"react";function Mt(e){return Te.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Te.createElement("path",{d:"M2.18 2.11a.5.5 0 0 1 .54-.06l15 7.5a.5.5 0 0 1 0 .9l-15 7.5a.5.5 0 0 1-.7-.58L3.98 10 2.02 2.63a.5.5 0 0 1 .16-.52Zm2.7 8.39-1.61 6.06L16.38 10 3.27 3.44 4.88 9.5h6.62a.5.5 0 1 1 0 1H4.88Z",fill:"currentColor"}))}var Y=At(Mt);import ke,{memo as Ht}from"react";function Lt(e){return ke.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},ke.createElement("path",{d:"M6 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm0 4a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM7.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 16a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM15.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z",fill:"currentColor"}))}var q=Ht(Lt);var{LocalizedString:Kt}=It,Ne=Be(({children:e,isHorizontal:t})=>{let o=i(X);return t?null:f.createElement("div",{className:o["telephone-keypad__box"]},e)});Ne.displayName="TelephoneKeypad:Orientation";var Se=Be(({autoFocus:e,className:t,onButtonClick:o,isHorizontal:r})=>{let a=_e(e),d=i(X),c=Rt(null),n=_e(o),[,u]=k(),b=v(()=>n.current?.("1"),[n]),s=v(()=>n.current?.("2"),[n]),l=v(()=>n.current?.("3"),[n]),p=v(()=>n.current?.("4"),[n]),g=v(()=>n.current?.("5"),[n]),N=v(()=>n.current?.("6"),[n]),_=v(()=>n.current?.("7"),[n]),B=v(()=>n.current?.("8"),[n]),w=v(()=>n.current?.("9"),[n]),T=v(()=>n.current?.("0"),[n]),S=v(()=>n.current?.("star"),[n]),C=v(()=>n.current?.("pound"),[n]),O=v(U=>{U.key==="Escape"&&u(!1)},[u]);return Pt(()=>{a.current&&c.current?.focus()},[a,c]),f.createElement("div",{className:Dt(d["telephone-keypad"],t),onKeyDown:O},f.createElement(Ne,{isHorizontal:r},f.createElement(y,{button:"1","data-testid":m.sendBoxTelephoneKeypadButton1,onClick:b,ref:c}),f.createElement(y,{button:"2","data-testid":m.sendBoxTelephoneKeypadButton2,onClick:s,ruby:"ABC"}),f.createElement(y,{button:"3","data-testid":m.sendBoxTelephoneKeypadButton3,onClick:l,ruby:"DEF"}),f.createElement(y,{button:"4","data-testid":m.sendBoxTelephoneKeypadButton4,onClick:p,ruby:"GHI"}),f.createElement(y,{button:"5","data-testid":m.sendBoxTelephoneKeypadButton5,onClick:g,ruby:"JKL"}),f.createElement(y,{button:"6","data-testid":m.sendBoxTelephoneKeypadButton6,onClick:N,ruby:"MNO"}),f.createElement(y,{button:"7","data-testid":m.sendBoxTelephoneKeypadButton7,onClick:_,ruby:"PQRS"}),f.createElement(y,{button:"8","data-testid":m.sendBoxTelephoneKeypadButton8,onClick:B,ruby:"TUV"}),f.createElement(y,{button:"9","data-testid":m.sendBoxTelephoneKeypadButton9,onClick:w,ruby:"WXYZ"}),f.createElement(y,{button:"star","data-testid":m.sendBoxTelephoneKeypadButtonStar,onClick:S}),f.createElement(y,{button:"0","data-testid":m.sendBoxTelephoneKeypadButton0,onClick:T,ruby:"+"}),f.createElement(y,{button:"pound","data-testid":m.sendBoxTelephoneKeypadButtonPound,onClick:C})),f.createElement("div",{className:d["telephone-keypad__info-message"]},f.createElement(V,null),f.createElement(Kt,{linkClassName:d["telephone-keypad__info-message-link"],stringIds:"TELEPHONE_KEYPAD_INPUT_MESSAGE"})))});Se.displayName="TelephoneKeypad";var Ee=Se;var Ce=Ot(e=>k()[0]?zt.createElement(Ee,{...e}):null);Ce.displayName="TelephoneKeypad.Surrogate";var J=Ce;import Zt from"react";import jt from"classnames";var Fe={theme:"a"};var Wt="webchat-fluent";function R(e){let t=i(Fe);return Zt.createElement("div",{className:jt(Wt,t.theme)},e.children)}import{hooks as _r}from"botframework-webchat-component";import L from"classnames";import h,{memo as Br,useCallback as A,useRef as Nr,useState as Sr}from"react";import{useRefFrom as rt}from"use-ref-from";import{hooks as Gt}from"botframework-webchat-component";import $t from"classnames";import Me,{memo as Vt,useCallback as Yt,useEffect as qt,useRef as Jt,useState as Qt}from"react";import{useRefFrom as eo}from"use-ref-from";var Ae={"sendbox__attachment-drop-zone":"b","sendbox__attachment-drop-zone--droppable":"u","sendbox__attachment-drop-zone-icon":"h"};var{useLocalizer:to}=Gt,oo=e=>{e.preventDefault()},He=e=>!!e.dataTransfer?.types?.some(t=>t.toLowerCase()==="files");function ro(e,t){let o=e.parentNode;for(;o;){if(o===t)return!0;o=o.parentNode}return!1}var Le=e=>{let[t,o]=Qt(!1),r=i(Ae),a=Jt(null),d=to(),c=eo(e.onFilesAdded);qt(()=>{let u=0,b=l=>{u++,He(l)&&o(a.current&&(l.target===a.current||l.target instanceof HTMLElement&&ro(l.target,a.current))?"droppable":"visible")},s=()=>--u<=0&&o(!1);return document.addEventListener("dragenter",b,!1),document.addEventListener("dragleave",s,!1),()=>{document.removeEventListener("dragenter",b),document.removeEventListener("dragleave",s)}},[o]);let n=Yt(u=>{u.preventDefault(),o(!1),He(u.nativeEvent)&&c.current([...u.dataTransfer.files])},[c,o]);return t?Me.createElement("div",{className:$t(r["sendbox__attachment-drop-zone"],{[r["sendbox__attachment-drop-zone--droppable"]]:t==="droppable"}),"data-testid":m.sendBoxDropZone,onDragOver:oo,onDrop:n,ref:a},Me.createElement(G,{className:r["sendbox__attachment-drop-zone-icon"]}),d("TEXT_INPUT_DROP_ZONE")):null};Le.displayName="DropZone";var Q=Vt(Le);import{hooks as Ao}from"botframework-webchat-component";import Mo from"classnames";import H,{memo as Ho,useCallback as Lo}from"react";import{hooks as yo}from"botframework-webchat-component";import vo from"classnames";import te,{memo as wo,useCallback as To}from"react";var Ie={"suggested-action":"s","suggested-action__image":"g"};import ao,{forwardRef as so,memo as lo,useRef as io}from"react";var co=e=>e.preventDefault(),uo=so(({"aria-hidden":e,children:t,disabled:o,onClick:r,tabIndex:a,...d},c)=>{let n=io(null);return ao.createElement("button",{"aria-disabled":o?"true":"false","aria-hidden":e,onClick:o?co:r,ref:c||n,tabIndex:a,...o&&{"aria-disabled":"true",tabIndex:-1},...d,type:"button"},t)}),De=lo(uo);import mo,{createContext as po,memo as bo,useCallback as F,useContext as fo,useEffect as ho,useMemo as go,useRef as ee}from"react";var Pe=po({itemEffector:()=>{throw new Error("botframework-webchat-fluent-theme rovingFocus: no provider for RovingFocusContext.")}});function xo(e){let t=ee(0),o=ee([]),r=F(({current:s},l)=>s&&(s.tabIndex=t.current===l?0:-1),[t]),a=F(s=>{let l;typeof s=="number"?l=s:l=s(t.current),l&&!o.current.at(l)?.current&&(l=0),t.current!==l&&(t.current=l,o.current.forEach((p,g)=>r(p,g)),o.current.at(l)?.current?.focus())},[r,o,t]),d=F(s=>{let{target:l}=s,p=o.current.findIndex(({current:g})=>g===l);p!==-1&&a(p)},[o,a]),c=F(s=>l=>{let p=!e.direction,g=/up|down/iu.test(s)&&e.direction==="vertical",N=/left|right/iu.test(s)&&e.direction==="horizontal",_=/right|down/iu.test(s),B=p||g||N?_?1:-1:0,w=o.current.map((S,C)=>C),T=w.indexOf(l)+B;return w.at(T)??0},[e.direction]),n=F(s=>{let{key:l}=s;switch(l){case"Up":case"ArrowUp":case"Left":case"ArrowLeft":case"Down":case"ArrowDown":case"Right":case"ArrowRight":a(c(l));break;case"Home":a(0);break;case"End":a(-1);break;case"Escape":e.onEscapeKey?.();break;default:return}s.preventDefault(),s.stopPropagation()},[a,c,e]),u=F((s,l)=>{let{current:p}=s;return o.current[Number(l)]=s,p.addEventListener("focus",d),p.addEventListener("keydown",n),r(s,l),()=>{p.removeEventListener("focus",d),p.removeEventListener("keydown",n),delete o.current[Number(l)]}},[d,n,r,o]),b=go(()=>({itemEffector:u}),[u]);return mo.createElement(Pe.Provider,{value:b},e.children)}function Re(e){let t=ee(null),{itemEffector:o}=fo(Pe);return ho(()=>o(t,e)),t}var Ke=bo(xo);var{useDisabled:ko,useFocus:_o,usePerformCardAction:Bo,useScrollToEnd:No,useStyleSet:So,useSuggestedActions:Eo}=yo;function Co({buttonText:e,className:t,displayText:o,image:r,imageAlt:a,itemIndex:d,text:c,type:n,value:u}){let[b,s]=Eo(),[{suggestedAction:l}]=So(),[p]=ko(),g=_o(),N=Re(d),_=Bo(),B=i(Ie),w=No(),T=To(({target:S})=>{(async function(){await g("sendBoxWithoutKeyboard"),_({displayText:o,text:c,type:n,value:u},{target:S}),n==="openUrl"&&s([]),w()})()},[o,g,_,w,s,c,n,u]);return te.createElement(De,{className:vo(B["suggested-action"],l+"",(t||"")+""),disabled:p,onClick:T,ref:N,type:"button"},r&&te.createElement("img",{alt:a,className:B["suggested-action__image"],src:r}),te.createElement("span",null,e))}var ze=wo(Co);function oe(e){let{title:t}=e,{type:o,value:r}=e;return o==="messageBack"?t||e.displayText:t||(typeof r=="string"?r:JSON.stringify(r))}var re={"suggested-actions":"p","suggested-actions--flow":"w","suggested-actions--stacked":"v"};var{useFocus:Io,useLocalizer:Do,useStyleOptions:Po,useStyleSet:Ro,useSuggestedActions:Ko}=Ao;function zo(e){let[{suggestedActionLayout:t}]=Po(),[{suggestedActions:o}]=Ro(),r=i(re);return H.createElement("div",{"aria-label":e["aria-label"],"aria-live":"polite","aria-orientation":"vertical",className:Mo(r["suggested-actions"],o+"",{[r["suggested-actions--flow"]]:t==="flow",[r["suggested-actions--stacked"]]:t!=="flow"},e.className),role:"toolbar"},!!e.children&&!!H.Children.count(e.children)&&e.children)}function Oo(){let e=i(re),t=Do(),[o]=Ko(),r=Io(),a=Lo(()=>{r("sendBox")},[r]),d=o.map((c,n)=>{let{displayText:u,image:b,imageAltText:s,text:l,type:p,value:g}=c;return o?.length?H.createElement(ze,{buttonText:oe(c),displayText:u,image:b,imageAlt:b&&(s||l),itemIndex:n,key:n,text:l,type:p,value:g}):null});return H.createElement(Ke,{onEscapeKey:a},H.createElement(zo,{"aria-label":t("SUGGESTED_ACTIONS_LABEL_ALT"),className:e["suggested-actions"]},d))}var ne=Ho(Oo);import{hooks as Wo}from"botframework-webchat-component";import z,{useCallback as Ue,useRef as Xo,memo as Go}from"react";import{useRefFrom as $o}from"use-ref-from";import ae from"classnames";import se,{memo as le}from"react";var K={sendbox__toolbar:"f","sendbox__toolbar-button":"x","sendbox__toolbar-button--selected":"k","sendbox__toolbar-separator":"m"};var Zo=e=>e.preventDefault(),E=le(e=>{let t=i(K);return se.createElement("button",{"aria-label":e["aria-label"],className:ae(t["sendbox__toolbar-button"],e.className,{[t["sendbox__toolbar-button--selected"]]:e.selected}),"data-testid":e["data-testid"],onClick:e.disabled?Zo:e.onClick,type:e.type==="submit"?"submit":"button",...e.disabled&&{"aria-disabled":"true",tabIndex:-1}},e.children)});E.displayName="ToolbarButton";var de=le(e=>{let t=i(K);return se.createElement("div",{className:ae(t.sendbox__toolbar,e.className)},e.children)});de.displayName="Toolbar";var ie=le(e=>{let t=i(K);return se.createElement("div",{"aria-orientation":"vertical",className:ae(t["sendbox__toolbar-separator"],e.className),role:"separator"})});ie.displayName="ToolbarSeparator";var Oe={"sendbox__add-attachment":"B","sendbox__add-attachment-input":"F"};var{useLocalizer:Vo,useStyleOptions:Yo}=Wo;function qo(e){let t=Xo(null),o=i(Oe),r=Vo(),[{uploadAccept:a,uploadMultiple:d}]=Yo(),c=$o(e.onFilesAdded),n=Ue(()=>t.current?.click(),[t]),u=Ue(({target:{files:b}})=>{b&&(c.current?.([...b]),t.current&&(t.current.value=""))},[t,c]);return z.createElement("div",{className:o["sendbox__add-attachment"]},z.createElement("input",{accept:a,"aria-disabled":e.disabled,"aria-hidden":"true",className:o["sendbox__add-attachment-input"],multiple:d,onInput:e.disabled?void 0:u,readOnly:e.disabled,ref:t,role:"button",tabIndex:-1,type:"file"}),z.createElement(E,{"aria-label":r("TEXT_INPUT_UPLOAD_BUTTON_ALT"),"data-testid":m.sendBoxUploadButton,onClick:n},z.createElement($,null)))}var Ze=Go(qo);import{hooks as Qo}from"botframework-webchat-component";import er,{memo as tr}from"react";import or from"classnames";var je={sendbox__attachment:"y"};var{useLocalizer:rr}=Qo,nr={one:"TEXT_INPUT_ATTACHMENTS_ONE",two:"TEXT_INPUT_ATTACHMENTS_TWO",few:"TEXT_INPUT_ATTACHMENTS_FEW",many:"TEXT_INPUT_ATTACHMENTS_MANY",other:"TEXT_INPUT_ATTACHMENTS_OTHER"};function ar({attachments:e,className:t}){let o=i(je),r=rr({plural:!0});return e.length?er.createElement("div",{className:or(o.sendbox__attachment,t)},r(nr,e.length)):null}var We=tr(ar);import lr,{memo as dr}from"react";var Xe={"sendbox__error-message":"N"};function ir(e){let t=i(Xe);return lr.createElement("span",{className:t["sendbox__error-message"],id:e.id,role:"alert"},e.error)}var Ge=dr(ir);import $e,{memo as cr,useCallback as ur}from"react";import{hooks as mr}from"botframework-webchat-component";var{useLocalizer:pr}=mr,Ve=cr(()=>{let[e,t]=k(),o=pr(),r=ur(()=>t(a=>!a),[t]);return $e.createElement(E,{"aria-label":o("TEXT_INPUT_TELEPHONE_KEYPAD_BUTTON_ALT"),"data-testid":m.sendBoxTelephoneKeypadToolbarButton,onClick:r,selected:e},$e.createElement(q,null))});Ve.displayName="SendBox.TelephoneKeypadToolbarButton";var Ye=Ve;import ce from"classnames";import ue,{forwardRef as fr,useCallback as hr}from"react";var qe={"sendbox__text-area":"S","sendbox__text-area--hidden":"z","sendbox__text-area-shared":"L","sendbox__text-area-doppelganger":"H","sendbox__text-area-input":"W","sendbox__text-area-input--scroll":"P"};var Je=fr((e,t)=>{let o=i(qe),r=hr(a=>{!a.shiftKey&&a.key==="Enter"&&(a.preventDefault(),"form"in a.target&&a.target.form instanceof HTMLFormElement&&a.target?.form?.requestSubmit())},[]);return ue.createElement("div",{className:ce(o["sendbox__text-area"],{[o["sendbox__text-area--hidden"]]:e.hidden},e.className),role:e.hidden?"hidden":void 0},ue.createElement("div",{className:ce(o["sendbox__text-area-doppelganger"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"])},e.value||e.placeholder," "),ue.createElement("textarea",{"aria-label":e["aria-label"],className:ce(o["sendbox__text-area-input"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"]),"data-testid":e["data-testid"],onInput:e.onInput,onKeyDown:r,placeholder:e.placeholder,ref:t,rows:e.startRows??1,tabIndex:e.hidden?-1:void 0,value:e.value}))});Je.displayName="TextArea";var Qe=Je;import{hooks as gr}from"botframework-webchat-component";import{useMemo as et}from"react";import{useRefFrom as xr}from"use-ref-from";var{useConnectivityStatus:yr,useLocalizer:vr}=gr,wr=({attachments:e,message:t})=>{let[o]=yr(),r=vr(),a=xr(o!=="connected"&&o!=="reconnected"?"offline":!t&&!e.length?"empty":void 0),d=et(()=>Object.freeze(new Map().set("empty",r("SEND_BOX_IS_EMPTY_TOOLTIP_ALT")).set("offline",r("CONNECTIVITY_STATUS_ALT_FATAL"))),[r]);return et(()=>Object.freeze([a,a.current&&d.get(a.current)]),[d,a])},tt=wr;import{useMemo as Tr}from"react";function me(e){let t=Tr(()=>Math.random().toString(36).substr(2,5),[]);return e=e?`${e}--`:"",`${e}${t}`}var ot={sendbox:"R",sendbox__sendbox:"G","sendbox__attachment--in-grid":"t","sendbox__text-area--in-grid":"D","sendbox__sendbox-controls--in-grid":"M","sendbox__telephone-keypad--in-grid":"U","sendbox__sendbox-text":"C","sendbox__sendbox-controls":"j","sendbox__text-counter":"T","sendbox__text-counter--error":"I"};var{useFocus:Er,useLocalizer:Cr,useMakeThumbnail:Fr,useRegisterFocusSendBox:Ar,useSendBoxAttachments:Mr,useSendMessage:Hr,useStyleOptions:Lr}=_r;function Ir(e){let t=Nr(null),[o,r]=Sr(""),[a,d]=Mr(),[{hideTelephoneKeypadButton:c,hideUploadButton:n,maxMessageLength:u}]=Lr(),b=!!u&&o.length>u,s=i(ot),l=Cr(),p=Hr(),g=Fr(),N=me("sendbox__error-message-id"),[_,B]=tt({message:o,attachments:a}),[w]=k(),T=Er();Ar(A(({noKeyboard:x,waitUntil:Z})=>{t.current&&(x?Z((async()=>{let M=t.current?.getAttribute("readonly");t.current?.setAttribute("readonly","true"),await new Promise(I=>setTimeout(I,0)),t.current?.focus(),typeof M!="string"?t.current?.removeAttribute("readonly"):t.current?.setAttribute("readonly",M)})()):t.current?.focus())},[t]));let S=rt(a),C=rt(o),O=A(x=>{"tabIndex"in x.target&&typeof x.target.tabIndex=="number"&&x.target.tabIndex>=0||T("sendBox")},[T]),U=A(x=>r(x.currentTarget.value),[r]),fe=A(async x=>{let Z=Object.freeze(await Promise.all(x.map(M=>g(M).then(I=>Object.freeze({blob:M,...I&&{thumbnailURL:I}})))));d(Z)},[g,d]),nt=A(x=>{x.preventDefault(),_.current!=="empty"&&!b&&(p(C.current,void 0,{attachments:S.current}),r(""),d([])),T("sendBox")},[S,C,p,d,r,b,_,T]),at=A(x=>p(`/DTMF ${x}`),[p]),st={"aria-invalid":"false",...B&&{"aria-invalid":"true","aria-errormessage":N}};return h.createElement("form",{...st,className:L(s.sendbox,e.className),onSubmit:nt},h.createElement(ne,null),h.createElement("div",{className:L(s.sendbox__sendbox),onClickCapture:O},h.createElement(Qe,{"aria-label":l(b?"TEXT_INPUT_LENGTH_EXCEEDED_ALT":"TEXT_INPUT_ALT"),className:L(s["sendbox__sendbox-text"],s["sendbox__text-area--in-grid"]),"data-testid":m.sendBoxTextBox,hidden:w,onInput:U,placeholder:e.placeholder??l("TEXT_INPUT_PLACEHOLDER"),ref:t,value:o}),h.createElement(J,{autoFocus:!0,className:s["sendbox__telephone-keypad--in-grid"],isHorizontal:!1,onButtonClick:at}),h.createElement(We,{attachments:a,className:s["sendbox__attachment--in-grid"]}),h.createElement("div",{className:L(s["sendbox__sendbox-controls"],s["sendbox__sendbox-controls--in-grid"])},!w&&u&&h.createElement("div",{className:L(s["sendbox__text-counter"],{[s["sendbox__text-counter--error"]]:b})},`${o.length}/${u}`),h.createElement(de,null,!c&&h.createElement(Ye,null),!n&&h.createElement(Ze,{onFilesAdded:fe}),h.createElement(ie,null),h.createElement(E,{"aria-label":l("TEXT_INPUT_SEND_BUTTON_ALT"),"data-testid":m.sendBoxSendButton,disabled:b||w,type:"submit"},h.createElement(Y,null)))),h.createElement(Q,{onFilesAdded:fe}),h.createElement(Ge,{error:B,id:N})))}var pe=Br(Ir);var{ThemeProvider:Rr}=Dr,Kr=[()=>()=>()=>pe],zr=({children:e})=>be.createElement(R,null,be.createElement(j,null,be.createElement(Rr,{sendBoxMiddleware:Kr},e))),Or=Pr(zr);var Zr="tsup",jr="esmodules",Wr="4.17.1-main.20240509.b00b5c9",xl={buildTool:Zr,moduleFormat:jr,version:Wr};Ur("botframework-webchat:fluent-theme","version=4.17.1-main.20240509.b00b5c9; build-tool=tsup; module-format=esmodules");P();export{Or as FluentThemeProvider,xl as buildInfo,m as testIds};
2
2
  /*! For license information please see botframework-webchat-fluent-theme.mjs.LEGAL.txt */
3
3
  //# sourceMappingURL=botframework-webchat-fluent-theme.mjs.map