botframework-webchat-component
Version:
React component of botframework-webchat
4 lines • 275 kB
JavaScript
import{a as Ip,b as Lc,c as Nc}from"./chunk-X37JABN5.mjs";import{hooks as f2,concatMiddleware as zH,localize as UH}from"botframework-webchat-api";import gp from"prop-types";import wp from"react";import{SendBoxMiddlewareProxy as cy,hooks as ly}from"botframework-webchat-api";import dy from"classnames";import nd from"prop-types";import co from"react";import{hooks as Sf}from"botframework-webchat-api";import Ut from"react";import{hooks as Wp}from"botframework-webchat-api";import Kp from"react";import Nn from"prop-types";import Bp,{forwardRef as Rp,memo as Fp}from"react";import{useContext as Pp}from"react";import{createContext as Op}from"react";var Mp=Op(void 0),qt=Mp;function L(){let e=Pp(qt);if(!e)throw new Error("This hook can only be used on a component that is a descendant of <Composer>");return e}function x(){return L().styleToEmotionObject}var Dp={color:"transparent",height:1,overflow:"hidden",position:"absolute",top:0,whiteSpace:"nowrap",width:1},Ko=Rp(({"aria-hidden":e,id:t,text:o},r)=>{let n=x()(Dp)+"";return e&&!t&&console.warn('botframework-webchat assertion: when "aria-hidden" is set, the screen reader text should be read by "aria-labelledby". Thus, "id" must be set.'),Bp.createElement("div",{"aria-hidden":e,className:n,id:t,ref:r},o)});Ko.defaultProps={"aria-hidden":void 0,id:void 0};Ko.propTypes={"aria-hidden":Nn.bool,id:Nn.string,text:Nn.string.isRequired};Ko.displayName="ScreenReaderText";var B=Fp(Ko);var{useLocalizer:qp}=Wp,jp=()=>{let e=qp();return Kp.createElement(B,{text:e("CONNECTIVITY_STATUS_ALT",e("CONNECTIVITY_STATUS_ALT_CONNECTED"))})},Ic=jp;import{hooks as rf}from"botframework-webchat-api";import Dc from"classnames";import nf from"prop-types";import Se,{useState as af}from"react";import{hooks as Hp}from"botframework-webchat-api";import zp from"classnames";import Up from"react";function _(){return Object.freeze([L().styleSet])}var{useDirection:Yp}=Hp,Vp=()=>{let[{spinnerAnimation:e}]=_(),[t]=Yp();return Up.createElement("div",{className:zp(e+"",t==="rtl"&&"webchat__spinner--rtl")})},Oc=Vp;import{useCallback as Gp,useState as Jp}from"react";function Zp(){let[,e]=Jp();return Gp(()=>e({}),[e])}var Mc=Zp;import{hooks as Qp}from"botframework-webchat-api";import{useEffect as Xp}from"react";var{usePonyfill:$p}=Qp;function jt(e,t){let[{clearTimeout:o,Date:r,setTimeout:n}]=$p();Xp(()=>{if(typeof e=="number"){let i=Math.max(0,e-r.now());if(i){let a=n(t,i);return()=>o(a)}t()}},[e,o,r,t,n])}import{hooks as ef}from"botframework-webchat-api";import tf from"classnames";import Pc from"prop-types";import Bc from"react";var{useDirection:of}=ef,Rc=16,In=({className:e,size:t})=>{let[o]=of();return Bc.createElement("svg",{alt:"",className:tf(e+"",o==="rtl"&&"webchat_warning--rtl"),height:Rc*t,viewBox:"0 0 13.1 13.1",width:Rc*t},Bc.createElement("path",{d:"M13.1,13.1H0L6.6,0L13.1,13.1z M7,10.5H6.1v0.9H7V10.5z M7,9.7V5.2H6.1v4.4L7,9.7z",fillRule:"evenodd"}))};In.defaultProps={className:"",size:1};In.propTypes={className:Pc.string,size:Pc.number};var Fc=In;var{useDirection:sf,useLocalizer:cf,usePonyfill:lf,useStyleOptions:df}=rf,On=({reconnect:e})=>{let[{Date:t}]=lf(),[{slowConnectionAfter:o}]=df(),[{connectivityNotification:r,warningNotification:n}]=_(),[i]=sf(),[a]=af(()=>t.now()),s=Mc(),c=cf(),l=c("CONNECTIVITY_STATUS_ALT_CONNECTING"),d=c("CONNECTIVITY_STATUS_ALT_RECONNECTING"),p=c("CONNECTIVITY_STATUS_ALT_SLOW_CONNECTION");return jt(a+o,s),t.now()>=a+o?Se.createElement(Se.Fragment,null,Se.createElement(B,{text:c("CONNECTIVITY_STATUS_ALT",p)}),Se.createElement("div",{"aria-hidden":!0,className:Dc("webchat__connectivityStatus",n+""),dir:i},Se.createElement(Fc,null),p)):Se.createElement(Se.Fragment,null,Se.createElement(B,{text:c("CONNECTIVITY_STATUS_ALT",e?d:l)}),Se.createElement("div",{"aria-hidden":!0,className:Dc("webchat__connectivityStatus",r+""),dir:i},Se.createElement(Oc,null),e?d:l))};On.defaultProps={reconnect:!1};On.propTypes={reconnect:nf.bool};var Mn=On;import{hooks as ff}from"botframework-webchat-api";import hf from"classnames";import Ht from"react";import{hooks as mf}from"botframework-webchat-api";import uf from"classnames";import Wc from"prop-types";import Kc from"react";var{useDirection:pf}=mf,qc=16,Pn=({className:e,size:t})=>{let[o]=pf();return Kc.createElement("svg",{alt:"",className:uf(e+"",o==="rtl"&&"webchat__error--rtl"),height:qc*t,viewBox:"0 0 13.1 13.1",width:qc*t},Kc.createElement("path",{d:"M6.5,13C2.9,13,0,10.1,0,6.5S2.9,0,6.5,0S13,2.9,13,6.5S10.1,13,6.5,13z M6.1,3.5v4.3h0.9V3.5H6.1z M6.1,8.7v0.9h0.9V8.7H6.1z",fillRule:"evenodd"}))};Pn.defaultProps={className:"",size:1};Pn.propTypes={className:Wc.string,size:Wc.number};var qo=Pn;var{useDirection:bf,useLocalizer:yf}=ff,_f=()=>{let[{errorNotification:e}]=_(),[t]=bf(),o=yf(),r=o("CONNECTIVITY_STATUS_ALT_FATAL");return Ht.createElement(Ht.Fragment,null,Ht.createElement(B,{text:o("CONNECTIVITY_STATUS_ALT",r)}),Ht.createElement("div",{"aria-hidden":!0,className:hf("webchat__connectivityStatus",e+""),dir:t},Ht.createElement(qo,null),r))},jc=_f;import{hooks as gf}from"botframework-webchat-api";import wf from"classnames";import zt from"react";var{useDirection:Af,useLocalizer:Tf}=gf,vf=()=>{let[{errorNotification:e}]=_(),[t]=Af(),o=Tf(),r=o("CONNECTIVITY_STATUS_ALT_RENDER_ERROR");return zt.createElement(zt.Fragment,null,zt.createElement(B,{text:o("CONNECTIVITY_STATUS_ALT",r)}),zt.createElement("div",{"aria-hidden":!0,className:wf("webchat__connectivityStatus",e+""),dir:t},zt.createElement(qo,null),r))},Hc=vf;var{useDebouncedNotifications:Cf}=Sf,xf=()=>{let[{connectivitystatus:e}]=Cf();if(!e)return!1;switch(e.message){case"connecting":return Ut.createElement(Mn,null);case"javascripterror":return Ut.createElement(Hc,null);case"failedtoconnect":return Ut.createElement(jc,null);case"reconnecting":return Ut.createElement(Mn,{reconnect:!0});case"connected":default:return Ut.createElement(Ic,null)}},jo=xf;import{hooks as Mf}from"botframework-webchat-api";import Pf from"classnames";import _e,{useCallback as Bf,useEffect as Rf,useMemo as Yt,useState as Ff}from"react";import kf from"prop-types";import zc from"react";var Bn=({className:e})=>zc.createElement("svg",{className:(e||"")+"",focusable:!1,height:"9",role:"presentation",viewBox:"0 0 16 9",width:"16",xmlns:"http://www.w3.org/2000/svg"},zc.createElement("path",{d:"M15.2734 8.97656L8 1.71094L0.726563 8.97656L0.0234375 8.27344L8 0.289062L15.9766 8.27344L15.2734 8.97656Z"}));Bn.defaultProps={className:void 0};Bn.propTypes={className:kf.string};var Uc=Bn;import Ef from"prop-types";import Yc from"react";var Rn=({className:e})=>Yc.createElement("svg",{className:(e||"")+"",focusable:!1,height:"10",role:"presentation",viewBox:"0 0 16 10",width:"16",xmlns:"http://www.w3.org/2000/svg"},Yc.createElement("path",{d:"M15.1484 0.648437L15.8516 1.35156L8 9.20312L0.148438 1.35156L0.851563 0.648438L8 7.79687L15.1484 0.648437Z"}));Rn.defaultProps={className:void 0};Rn.propTypes={className:Ef.string};var Vc=Rn;import{hooks as Lf}from"botframework-webchat-api";import{isForbiddenPropertyName as Nf}from"botframework-webchat-core";import el from"prop-types";import Ho from"react";import Gc from"prop-types";import Jc from"react";var Fn=({"aria-label":e,className:t})=>Jc.createElement("svg",{"aria-label":e,className:(t||"")+"",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Jc.createElement("path",{d:"M14.5605 5.81055L15.4395 6.68945L8.125 14.0039L4.56055 10.4395L5.43945 9.56055L8.125 12.2461L14.5605 5.81055ZM10 0C10.918 0 11.8034 0.120443 12.6562 0.361328C13.5091 0.595703 14.3066 0.93099 15.0488 1.36719C15.791 1.79688 16.4648 2.31771 17.0703 2.92969C17.6823 3.53516 18.2031 4.20898 18.6328 4.95117C19.069 5.69336 19.4043 6.49089 19.6387 7.34375C19.8796 8.19661 20 9.08203 20 10C20 10.918 19.8796 11.8034 19.6387 12.6562C19.4043 13.5091 19.069 14.3066 18.6328 15.0488C18.2031 15.791 17.6823 16.4681 17.0703 17.0801C16.4648 17.6855 15.791 18.2064 15.0488 18.6426C14.3066 19.0723 13.5091 19.4076 12.6562 19.6484C11.8034 19.8828 10.918 20 10 20C9.08203 20 8.19661 19.8828 7.34375 19.6484C6.49089 19.4076 5.69336 19.0723 4.95117 18.6426C4.20898 18.2064 3.5319 17.6855 2.91992 17.0801C2.31445 16.4681 1.79362 15.791 1.35742 15.0488C0.927734 14.3066 0.592448 13.5124 0.351562 12.666C0.117188 11.8132 0 10.9245 0 10C0 9.08203 0.117188 8.19661 0.351562 7.34375C0.592448 6.49089 0.927734 5.69336 1.35742 4.95117C1.79362 4.20898 2.31445 3.53516 2.91992 2.92969C3.5319 2.31771 4.20898 1.79688 4.95117 1.36719C5.69336 0.93099 6.48763 0.595703 7.33398 0.361328C8.18685 0.120443 9.07552 0 10 0ZM10 18.75C10.8008 18.75 11.5723 18.6458 12.3145 18.4375C13.0632 18.2292 13.7598 17.9362 14.4043 17.5586C15.0553 17.1745 15.6478 16.7155 16.1816 16.1816C16.7155 15.6478 17.1712 15.0586 17.5488 14.4141C17.9329 13.763 18.2292 13.0664 18.4375 12.3242C18.6458 11.582 18.75 10.8073 18.75 10C18.75 9.19922 18.6458 8.42773 18.4375 7.68555C18.2292 6.93685 17.9329 6.24023 17.5488 5.5957C17.1712 4.94466 16.7155 4.35221 16.1816 3.81836C15.6478 3.28451 15.0553 2.82878 14.4043 2.45117C13.7598 2.06706 13.0632 1.77083 12.3145 1.5625C11.5723 1.35417 10.8008 1.25 10 1.25C9.19922 1.25 8.42448 1.35417 7.67578 1.5625C6.93359 1.77083 6.23698 2.06706 5.58594 2.45117C4.94141 2.82878 4.35221 3.28451 3.81836 3.81836C3.28451 4.35221 2.82552 4.94466 2.44141 5.5957C2.0638 6.24023 1.77083 6.93685 1.5625 7.68555C1.35417 8.42773 1.25 9.19922 1.25 10C1.25 10.8008 1.35417 11.5755 1.5625 12.3242C1.77083 13.0664 2.0638 13.763 2.44141 14.4141C2.82552 15.0586 3.28451 15.6478 3.81836 16.1816C4.35221 16.7155 4.94141 17.1745 5.58594 17.5586C6.23698 17.9362 6.93359 18.2292 7.67578 18.4375C8.41797 18.6458 9.19271 18.75 10 18.75Z",fill:"#107C10"}));Fn.defaultProps={"aria-label":void 0,className:void 0};Fn.propTypes={"aria-label":Gc.string,className:Gc.string};var Zc=Fn;import Qc from"prop-types";import Xc from"react";var Dn=({"aria-label":e,className:t})=>Xc.createElement("svg",{"aria-label":e,className:(t||"")+"",height:"19",viewBox:"0 0 19 19",width:"19",xmlns:"http://www.w3.org/2000/svg"},Xc.createElement("path",{d:"M9.375 0C10.2409 0 11.071 0.110677 11.8652 0.332031C12.666 0.553385 13.4147 0.869141 14.1113 1.2793C14.8079 1.68294 15.4395 2.17122 16.0059 2.74414C16.5788 3.31055 17.0671 3.94206 17.4707 4.63867C17.8809 5.33529 18.1966 6.08398 18.418 6.88477C18.6393 7.67904 18.75 8.50911 18.75 9.375C18.75 10.2409 18.6393 11.0742 18.418 11.875C18.1966 12.6693 17.8809 13.4147 17.4707 14.1113C17.0671 14.8079 16.5788 15.4427 16.0059 16.0156C15.4395 16.582 14.8079 17.0703 14.1113 17.4805C13.4147 17.8841 12.666 18.1966 11.8652 18.418C11.071 18.6393 10.2409 18.75 9.375 18.75C8.50911 18.75 7.67578 18.6393 6.875 18.418C6.08073 18.1966 5.33529 17.8841 4.63867 17.4805C3.94206 17.0703 3.30729 16.582 2.73438 16.0156C2.16797 15.4427 1.67969 14.8079 1.26953 14.1113C0.865885 13.4147 0.553385 12.6693 0.332031 11.875C0.110677 11.0742 0 10.2409 0 9.375C0 8.50911 0.110677 7.67904 0.332031 6.88477C0.553385 6.08398 0.865885 5.33529 1.26953 4.63867C1.67969 3.94206 2.16797 3.31055 2.73438 2.74414C3.30729 2.17122 3.94206 1.68294 4.63867 1.2793C5.33529 0.869141 6.08073 0.553385 6.875 0.332031C7.67578 0.110677 8.50911 0 9.375 0ZM9.375 17.5C10.1172 17.5 10.8333 17.4023 11.5234 17.207C12.2201 17.0117 12.8678 16.7383 13.4668 16.3867C14.0723 16.0352 14.6224 15.612 15.1172 15.1172C15.612 14.6224 16.0352 14.0755 16.3867 13.4766C16.7383 12.8711 17.0117 12.2233 17.207 11.5332C17.4023 10.8431 17.5 10.1237 17.5 9.375C17.5 8.63281 17.4023 7.91667 17.207 7.22656C17.0117 6.52995 16.7383 5.88216 16.3867 5.2832C16.0352 4.67773 15.612 4.1276 15.1172 3.63281C14.6224 3.13802 14.0723 2.71484 13.4668 2.36328C12.8678 2.01172 12.2201 1.73828 11.5234 1.54297C10.8333 1.34766 10.1172 1.25 9.375 1.25C8.6263 1.25 7.9069 1.34766 7.2168 1.54297C6.52669 1.73828 5.87891 2.01172 5.27344 2.36328C4.67448 2.71484 4.1276 3.13802 3.63281 3.63281C3.13802 4.1276 2.71484 4.67773 2.36328 5.2832C2.01172 5.88216 1.73828 6.52995 1.54297 7.22656C1.34766 7.91667 1.25 8.63281 1.25 9.375C1.25 10.1172 1.34766 10.8366 1.54297 11.5332C1.73828 12.2233 2.01172 12.8711 2.36328 13.4766C2.71484 14.0755 3.13802 14.6224 3.63281 15.1172C4.1276 15.612 4.67448 16.0352 5.27344 16.3867C5.87891 16.7383 6.52669 17.0117 7.2168 17.207C7.9069 17.4023 8.6263 17.5 9.375 17.5ZM8.75 5H10V11.25H8.75V5ZM8.75 12.5H10V13.75H8.75V12.5Z"}));Dn.defaultProps={"aria-label":void 0,className:void 0};Dn.propTypes={"aria-label":Qc.string,className:Qc.string};var $c=Dn;var{useLocalizer:If}=Lf,Wn=({className:e,level:t})=>{let o=If(),r={error:o("TOAST_ALT_ERROR"),info:o("TOAST_ALT_INFO"),success:o("TOAST_ALT_SUCCESS"),warn:o("TOAST_ALT_WARN")},n=!Nf(t)&&r[t]||"";return Ho.createElement(Ho.Fragment,null,t==="success"?Ho.createElement(Zc,{"aria-label":n,className:e}):Ho.createElement($c,{"aria-label":n,className:e}))};Wn.defaultProps={className:void 0};Wn.propTypes={className:el.string,level:el.oneOf(["error","info","success","warn"]).isRequired};var zo=Wn;import Of from"math-random";function et(e=5){return Of().toString(36).substr(2,e)}var{useDebouncedNotifications:Df,useLocalizer:Wf,useRenderToast:Kf}=Mf,qf={display:"flex",flexDirection:"column","& .webchat__toaster__header":{display:"flex",flexShrink:0},"& .webchat__toaster__expandText":{flex:1},"& .webchat__toaster__list":{display:"block",listStyleType:"none"}},ol={error:1,warn:2,info:3,success:4},jf=Object.keys(ol);function tl(e){return jf.includes(e)?ol[e]:5}function Hf(e,t){return tl(e)-tl(t)}function zf(e){return Object.values(e).sort(({timestamp:t},{timestamp:o})=>o-t)}var Uf=e=>e,Yf={two:"TOAST_ACCORDION_TWO",few:"TOAST_ACCORDION_FEW",many:"TOAST_ACCORDION_MANY",other:"TOAST_ACCORDION_OTHER"},Vf=()=>{let e=Yt(et,[]),[{toaster:t}]=_(),[o]=Df(),[r,n]=Ff(!1),i=Wf({plural:!0}),a=Kf(),s=x()(qf)+"",c=Bf(()=>n(!r),[r,n]),l=Yt(()=>zf(o),[o]),d=Yt(()=>l.map(b=>{let y=a({notification:b});return y&&{children:y,notification:b}}).filter(Uf),[a,l]),p=d.length>1,[f]=d.map(({notification:{level:b}})=>b).sort(Hf),m=Yt(()=>!p||r?`webchat__toaster__list__${e}`:void 0,[p,r,e]),u=Yt(()=>p?`webchat__toaster__header__${e}`:void 0,[p,e]);return Rf(()=>{!p&&n(!1)},[p]),_e.createElement("div",{"aria-labelledby":u,"aria-live":"polite","aria-relevant":"all",className:Pf("webchat__toaster",{"webchat__toaster--expandable":p,"webchat__toaster--expanded":r,"webchat__toaster--error":f==="error","webchat__toaster--info":f==="info","webchat__toaster--success":f==="success","webchat__toaster--warn":f==="warn"},s,t+""),role:"log"},p&&_e.createElement("button",{"aria-controls":m,"aria-expanded":r,className:"webchat__toaster__header",id:u,onClick:c,type:"button"},_e.createElement("div",{"aria-hidden":!0,className:"webchat__toaster__expandLevelIconBox"},_e.createElement(zo,{className:"webchat__toaster__expandLevelIcon",level:f})),_e.createElement("div",{className:"webchat__toaster__expandText"},i(Yf,d.length)),_e.createElement("div",{"aria-hidden":!0,className:"webchat__toaster__expandIcon"},_e.createElement("div",{className:"webchat__toaster__expandIconFocus"},r?_e.createElement(Uc,null):_e.createElement(Vc,null)))),(!p||r)&&_e.createElement("div",{"aria-labelledby":u,className:"webchat__toaster__list",id:m},d.map(({children:b,notification:{id:y}})=>_e.createElement("div",{"aria-atomic":!0,className:"webchat__toaster__listItem",key:y},b))))},Uo=Vf;import{hooks as I1}from"botframework-webchat-api";import{Composer as O1,Panel as M1,useAnimatingToEnd as P1,useAtEnd as B1,useObserveScrollPosition as R1,useScrollTo as F1,useScrollToEnd as Vl,useSticky as D1}from"react-scroll-to-bottom";import Gl from"classnames";import lt from"prop-types";import F,{forwardRef as W1,Fragment as K1,memo as q1,useCallback as de,useMemo as xt,useRef as dr}from"react";var{userAgent:tt}=navigator,Yo=/Linux; Android/u.test(tt),dx=!/Edge\//u.test(tt)&&/Chrome\//u.test(tt),mx=/Edg\//u.test(tt),ux=/Edge\//u.test(tt),px=/Firefox\//u.test(tt),Vo=/Trident\/7.0/u.test(tt);import{hooks as Gf}from"botframework-webchat-api";import Jf,{Fragment as Zf,useMemo as Qf}from"react";var{useActiveTyping:Kn,useRenderTypingIndicator:Xf}=Gf;function qn(){let[e]=Kn();return Qf(()=>Object.freeze([!!Object.values(e).some(({role:t,type:o})=>t!=="user"&&o!=="livestream")]),[e])}var $f=()=>{let[e]=Kn(),[t]=qn(),[o]=Kn(1/0),r=Xf();return Jf.createElement(Zf,null,r({activeTyping:e,typing:o,visible:t}))},rl=$f;import Go from"prop-types";import eh,{useCallback as th}from"react";var jn=({className:e,onFocus:t,redirectRef:o})=>{let r=th(()=>{o?.current?.focus(),t&&t()},[t,o]);return eh.createElement("div",{className:e,onFocus:r,tabIndex:0})};jn.defaultProps={className:void 0,onFocus:void 0,redirectRef:void 0};jn.propTypes={className:Go.string,onFocus:Go.func,redirectRef:Go.shape({current:Go.instanceOf(HTMLElement)})};var wt=jn;var nl={Add:"+",Decimal:".",Divide:"/",Multiply:"*",Subtract:"-"},oh=Object.keys(nl);function Hn(e){return e.length===1?e:oh.includes(e)?nl[e]:void 0}function ge(e){return 1/e>=0}import{hooks as sh}from"botframework-webchat-api";import ch from"classnames";import al from"prop-types";import v,{useCallback as Qo,useState as lh}from"react";import{useMemo as rh}from"react";import nh from"math-random";function Le(e){let t=rh(()=>nh().toString(36).substr(2,5),[]);return e=e?`${e}--`:"",`${e}${t}`}import{useCallback as ah}from"react";function Jo(e){let t=[];return Object.freeze([{...e,waitUntil(o){t.push(o)}},async()=>{for(let o=0;await Promise.all(t).then(()=>{}),o!==t.length;o=t.length);}])}import{createPropagation as ih}from"use-propagate";var{useListen:Zo,usePropagate:il}=ih();function J(){let e=il(),{focusTranscriptCallbacksRef:t}=L();return ah(async o=>{if(o==="sendBox"||o==="sendBoxWithoutKeyboard"){let[r,n]=Jo({noKeyboard:o==="sendBoxWithoutKeyboard"});e(r),await n()}else{let[,r]=Jo({});t.current.forEach(n=>n()),await r()}},[e,t])}var{useLocalizer:dh}=sh,ot=({header:e,text:t})=>v.createElement("dl",{className:"webchat__keyboard-help__notes"},v.createElement("dt",{className:"webchat__keyboard-help__notes-header"},e),t.split(`
`).map((o,r)=>v.createElement("dd",{className:"webchat__keyboard-help__notes-text",key:r},o)));ot.propTypes={header:al.string.isRequired,text:al.string.isRequired};var mh=()=>{let[{keyboardHelp:e}]=_(),[t,o]=lh(!1),r=J(),n=Le("webchat__keyboard-help__header"),i=dh(),a=i("KEYBOARD_HELP_CHAT_HISTORY_ACCESS_ITEMS_IN_MESSAGE_BODY"),s=i("KEYBOARD_HELP_CHAT_HISTORY_ACCESS_ITEMS_IN_MESSAGE_HEADER"),c=i("KEYBOARD_HELP_CHAT_HISTORY_HEADER"),l=i("KEYBOARD_HELP_CHAT_HISTORY_LEAVE_MESSAGE_BODY"),d=i("KEYBOARD_HELP_CHAT_HISTORY_LEAVE_MESSAGE_HEADER"),p=i("KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_ITEMS_BODY"),f=i("KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_ITEMS_HEADER"),m=i("KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_MESSAGES_BODY"),u=i("KEYBOARD_HELP_CHAT_HISTORY_MOVE_BETWEEN_MESSAGES_HEADER"),b=i("KEYBOARD_HELP_CHAT_WINDOW_BODY_DO_ACTION_BODY"),y=i("KEYBOARD_HELP_CHAT_WINDOW_BODY_DO_ACTION_HEADER"),A=i("KEYBOARD_HELP_CHAT_WINDOW_BODY_MOVE_BETWEEN_ITEMS_BODY"),T=i("KEYBOARD_HELP_CHAT_WINDOW_BODY_MOVE_BETWEEN_ITEMS_HEADER"),g=i("KEYBOARD_HELP_CHAT_WINDOW_HEADER"),C=i("KEYBOARD_HELP_CLOSE_BUTTON_ALT"),h=i("KEYBOARD_HELP_HEADER"),w=Qo(N=>document.activeElement!==N.target&&o(!1),[o]),S=Qo(()=>r("main"),[r]),k=Qo(()=>o(!0),[o]),E=Qo(N=>{let{key:M}=N;(M==="Enter"||M==="Escape"||M===" ")&&(N.preventDefault(),N.stopPropagation(),r("main"))},[r]);return v.createElement("div",{"aria-labelledby":n,className:ch("webchat__keyboard-help",e+"",{"webchat__keyboard-help--shown":t}),onBlur:w,role:"dialog"},v.createElement("div",{className:"webchat__keyboard-help__border"},v.createElement("div",{className:"webchat__keyboard-help__box"},v.createElement("div",{className:"webchat__keyboard-help__scrollable"},v.createElement("button",{"aria-label":C,className:"webchat__keyboard-help__close-button",onClick:S,onFocus:k,onKeyDown:E,type:"button"},v.createElement("div",{className:"webchat__keyboard-help__close-button-border"},v.createElement("svg",{className:"webchat__keyboard-help__close-button-image",focusable:!1,role:"presentation",viewBox:"0 0 2048 2048",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M2048 136l-888 888 888 888-136 136-888-888-888 888L0 1912l888-888L0 136 136 0l888 888L1912 0l136 136z"})))),v.createElement("h2",{className:"webchat__keyboard-help__header",id:n},h),v.createElement("article",{className:"webchat__keyboard-help__section"},v.createElement("header",null,v.createElement("h3",{className:"webchat__keyboard-help__sub-header"},g)),v.createElement("div",{className:"webchat__keyboard-help__two-panes"},v.createElement("svg",{className:"webchat__keyboard-help__image webchat__keyboard-help__image--light",fill:"none",focusable:!1,height:"200",role:"presentation",viewBox:"0 0 121 200",width:"121",xmlns:"http://www.w3.org/2000/svg"},v.createElement("rect",{height:"199",stroke:"#C8C6C4",width:"109",x:"0.5",y:"0.5"}),v.createElement("rect",{height:"156",stroke:"#323130",width:"102",x:"3.5",y:"4.5"}),v.createElement("rect",{height:"42",stroke:"#C8C6C4",width:"93",x:"7.5",y:"8.5"}),v.createElement("rect",{height:"99",stroke:"#C8C6C4",width:"93",x:"7.5",y:"55.5"}),v.createElement("rect",{height:"13",stroke:"#323130",width:"102",x:"3.5",y:"182.5"}),v.createElement("rect",{height:"13",stroke:"#323130",width:"32",x:"3.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#323130",width:"32",x:"38.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#323130",width:"32",x:"73.5",y:"165.5"}),v.createElement("path",{clipRule:"evenodd",d:"M116.328 5.64645C116.524 5.45118 116.84 5.45118 117.036 5.64645L120.218 8.82843C120.413 9.02369 120.413 9.34027 120.218 9.53553C120.022 9.7308 119.706 9.7308 119.51 9.53553L117.182 7.20711V192.793L119.51 190.464C119.706 190.269 120.022 190.269 120.218 190.464C120.413 190.66 120.413 190.976 120.218 191.172L117.036 194.354C116.84 194.549 116.524 194.549 116.328 194.354L113.146 191.172C112.951 190.976 112.951 190.66 113.146 190.464C113.342 190.269 113.658 190.269 113.854 190.464L116.182 192.793V7.20711L113.854 9.53553C113.658 9.7308 113.342 9.7308 113.146 9.53553C112.951 9.34027 112.951 9.02369 113.146 8.82843L116.328 5.64645Z",fill:"#323130",fillRule:"evenodd"})),v.createElement("svg",{className:"webchat__keyboard-help__image webchat__keyboard-help__image--dark",fill:"none",focusable:!1,height:"200",role:"presentation",viewBox:"0 0 121 200",width:"121",xmlns:"http://www.w3.org/2000/svg"},v.createElement("rect",{height:"199",stroke:"#484644",width:"109",x:"0.5",y:"0.5"}),v.createElement("rect",{height:"156",stroke:"#F3F2F1",width:"102",x:"3.5",y:"4.5"}),v.createElement("rect",{height:"42",stroke:"#484644",width:"93",x:"7.5",y:"8.5"}),v.createElement("rect",{height:"99",stroke:"#484644",width:"93",x:"7.5",y:"55.5"}),v.createElement("rect",{height:"13",stroke:"#F3F2F1",width:"102",x:"3.5",y:"182.5"}),v.createElement("rect",{height:"13",stroke:"#F3F2F1",width:"32",x:"3.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#F3F2F1",width:"32",x:"38.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#F3F2F1",width:"32",x:"73.5",y:"165.5"}),v.createElement("path",{clipRule:"evenodd",d:"M116.328 5.64645C116.524 5.45118 116.84 5.45118 117.036 5.64645L120.218 8.82843C120.413 9.02369 120.413 9.34027 120.218 9.53553C120.022 9.7308 119.706 9.7308 119.51 9.53553L117.182 7.20711V192.793L119.51 190.464C119.706 190.269 120.022 190.269 120.218 190.464C120.413 190.66 120.413 190.976 120.218 191.172L117.036 194.354C116.84 194.549 116.524 194.549 116.328 194.354L113.146 191.172C112.951 190.976 112.951 190.66 113.146 190.464C113.342 190.269 113.658 190.269 113.854 190.464L116.182 192.793V7.20711L113.854 9.53553C113.658 9.7308 113.342 9.7308 113.146 9.53553C112.951 9.34027 112.951 9.02369 113.146 8.82843L116.328 5.64645Z",fill:"#F3F2F1",fillRule:"evenodd"})),v.createElement("svg",{className:"webchat__keyboard-help__image webchat__keyboard-help__image--high-contrast",fill:"none",focusable:!1,height:"200",role:"presentation",viewBox:"0 0 121 200",width:"121",xmlns:"http://www.w3.org/2000/svg"},v.createElement("rect",{height:"199",stroke:"white",width:"109",x:"0.5",y:"0.5"}),v.createElement("rect",{height:"156",stroke:"white",width:"102",x:"3.5",y:"4.5"}),v.createElement("rect",{height:"42",stroke:"white",width:"93",x:"7.5",y:"8.5"}),v.createElement("rect",{height:"99",stroke:"white",width:"93",x:"7.5",y:"55.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"102",x:"3.5",y:"182.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"32",x:"3.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"32",x:"38.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"32",x:"73.5",y:"165.5"}),v.createElement("path",{clipRule:"evenodd",d:"M116.328 5.64645C116.524 5.45118 116.84 5.45118 117.036 5.64645L120.218 8.82843C120.413 9.02369 120.413 9.34027 120.218 9.53553C120.022 9.7308 119.706 9.7308 119.51 9.53553L117.182 7.20711V192.793L119.51 190.464C119.706 190.269 120.022 190.269 120.218 190.464C120.413 190.66 120.413 190.976 120.218 191.172L117.036 194.354C116.84 194.549 116.524 194.549 116.328 194.354L113.146 191.172C112.951 190.976 112.951 190.66 113.146 190.464C113.342 190.269 113.658 190.269 113.854 190.464L116.182 192.793V7.20711L113.854 9.53553C113.658 9.7308 113.342 9.7308 113.146 9.53553C112.951 9.34027 112.951 9.02369 113.146 8.82843L116.328 5.64645Z",fill:"white",fillRule:"evenodd"})),v.createElement("div",{className:"webchat__keyboard-help__notes-pane"},v.createElement(ot,{header:T,text:A}),v.createElement(ot,{header:y,text:b})))),v.createElement("article",{className:"webchat__keyboard-help__section"},v.createElement("header",null,v.createElement("h3",{className:"webchat__keyboard-help__header"},c)),v.createElement("div",{className:"webchat__keyboard-help__two-panes"},v.createElement("svg",{className:"webchat__keyboard-help__image webchat__keyboard-help__image--light",fill:"none",focusable:!1,height:"200",role:"presentation",viewBox:"0 0 121 200",width:"121",xmlns:"http://www.w3.org/2000/svg"},v.createElement("rect",{height:"199",stroke:"#C8C6C4",width:"109",x:"0.5",y:"0.5"}),v.createElement("rect",{height:"156",stroke:"#323130",width:"102",x:"3.5",y:"4.5"}),v.createElement("rect",{height:"42",stroke:"#323130",strokeDasharray:"2 2",width:"93",x:"7.5",y:"8.5"}),v.createElement("rect",{height:"99",stroke:"#323130",strokeDasharray:"2 2",width:"93",x:"7.5",y:"55.5"}),v.createElement("rect",{height:"13",stroke:"#C8C6C4",width:"102",x:"3.5",y:"182.5"}),v.createElement("rect",{height:"13",stroke:"#C8C6C4",width:"32",x:"3.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#C8C6C4",width:"32",x:"38.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#C8C6C4",width:"32",x:"73.5",y:"165.5"}),v.createElement("path",{clipRule:"evenodd",d:"M116.328 7.64645C116.524 7.45118 116.84 7.45118 117.036 7.64645L120.218 10.8284C120.413 11.0237 120.413 11.3403 120.218 11.5355C120.022 11.7308 119.706 11.7308 119.51 11.5355L117.182 9.20711V156.793L119.51 154.464C119.706 154.269 120.022 154.269 120.218 154.464C120.413 154.66 120.413 154.976 120.218 155.172L117.036 158.354C116.84 158.549 116.524 158.549 116.328 158.354L113.146 155.172C112.951 154.976 112.951 154.66 113.146 154.464C113.342 154.269 113.658 154.269 113.854 154.464L116.182 156.793V9.20711L113.854 11.5355C113.658 11.7308 113.342 11.7308 113.146 11.5355C112.951 11.3403 112.951 11.0237 113.146 10.8284L116.328 7.64645Z",fill:"#323130",fillRule:"evenodd"})),v.createElement("svg",{className:"webchat__keyboard-help__image webchat__keyboard-help__image--dark",fill:"none",focusable:!1,height:"200",role:"presentation",viewBox:"0 0 121 200",width:"121",xmlns:"http://www.w3.org/2000/svg"},v.createElement("rect",{height:"199",stroke:"#484644",width:"109",x:"0.5",y:"0.5"}),v.createElement("rect",{height:"156",stroke:"#F3F2F1",width:"102",x:"3.5",y:"4.5"}),v.createElement("rect",{height:"42",stroke:"#F3F2F1",strokeDasharray:"2 2",width:"93",x:"7.5",y:"8.5"}),v.createElement("rect",{height:"99",stroke:"#F3F2F1",strokeDasharray:"2 2",width:"93",x:"7.5",y:"55.5"}),v.createElement("rect",{height:"13",stroke:"#484644",width:"102",x:"3.5",y:"182.5"}),v.createElement("rect",{height:"13",stroke:"#484644",width:"32",x:"3.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#484644",width:"32",x:"38.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"#484644",width:"32",x:"73.5",y:"165.5"}),v.createElement("path",{clipRule:"evenodd",d:"M116.328 7.64645C116.524 7.45118 116.84 7.45118 117.036 7.64645L120.218 10.8284C120.413 11.0237 120.413 11.3403 120.218 11.5355C120.022 11.7308 119.706 11.7308 119.51 11.5355L117.182 9.20711V156.793L119.51 154.464C119.706 154.269 120.022 154.269 120.218 154.464C120.413 154.66 120.413 154.976 120.218 155.172L117.036 158.354C116.84 158.549 116.524 158.549 116.328 158.354L113.146 155.172C112.951 154.976 112.951 154.66 113.146 154.464C113.342 154.269 113.658 154.269 113.854 154.464L116.182 156.793V9.20711L113.854 11.5355C113.658 11.7308 113.342 11.7308 113.146 11.5355C112.951 11.3403 112.951 11.0237 113.146 10.8284L116.328 7.64645Z",fill:"#F3F2F1",fillRule:"evenodd"})),v.createElement("svg",{className:"webchat__keyboard-help__image webchat__keyboard-help__image--high-contrast",fill:"none",focusable:!1,height:"200",role:"presentation",viewBox:"0 0 121 200",width:"121",xmlns:"http://www.w3.org/2000/svg"},v.createElement("rect",{height:"199",stroke:"white",width:"109",x:"0.5",y:"0.5"}),v.createElement("rect",{height:"156",stroke:"white",width:"102",x:"3.5",y:"4.5"}),v.createElement("rect",{height:"42",stroke:"white",strokeDasharray:"2 2",width:"93",x:"7.5",y:"8.5"}),v.createElement("rect",{height:"99",stroke:"white",strokeDasharray:"2 2",width:"93",x:"7.5",y:"55.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"102",x:"3.5",y:"182.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"32",x:"3.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"32",x:"38.5",y:"165.5"}),v.createElement("rect",{height:"13",stroke:"white",width:"32",x:"73.5",y:"165.5"}),v.createElement("path",{clipRule:"evenodd",d:"M116.328 7.64645C116.524 7.45118 116.84 7.45118 117.036 7.64645L120.218 10.8284C120.413 11.0237 120.413 11.3403 120.218 11.5355C120.022 11.7308 119.706 11.7308 119.51 11.5355L117.182 9.20711V156.793L119.51 154.464C119.706 154.269 120.022 154.269 120.218 154.464C120.413 154.66 120.413 154.976 120.218 155.172L117.036 158.354C116.84 158.549 116.524 158.549 116.328 158.354L113.146 155.172C112.951 154.976 112.951 154.66 113.146 154.464C113.342 154.269 113.658 154.269 113.854 154.464L116.182 156.793V9.20711L113.854 11.5355C113.658 11.7308 113.342 11.7308 113.146 11.5355C112.951 11.3403 112.951 11.0237 113.146 10.8284L116.328 7.64645Z",fill:"white",fillRule:"evenodd"})),v.createElement("div",{className:"webchat__keyboard-help__notes-pane"},v.createElement(ot,{header:u,text:m}),v.createElement(ot,{header:s,text:a}),v.createElement(ot,{header:f,text:p}),v.createElement(ot,{header:d,text:l}))))))))},sl=mh;import{hooks as db}from"botframework-webchat-api";import mb from"classnames";import El from"prop-types";import Tt,{useEffect as Ll,useMemo as ub,useRef as pb}from"react";function Vt(e){if(e.type!=="message")return!0;let{channelData:t}=e,o=t?.["webchat:fallback-text"];return typeof o=="string"?!o:!(t?.messageBack?.displayText||e.text||e.attachments?.length||e.suggestedActions?.actions?.length)}import{hooks as Ch}from"botframework-webchat-api";import xh from"classnames";import kh from"prop-types";import Ue,{Fragment as fl,useMemo as Eh}from"react";function rt(e){switch(e){case"plain":return"text/plain";case"xml":return"text/xml";default:return"text/markdown"}}function uh(e,t){let o=[].slice.call(e.childNodes),r=[];for(;o.length;){let n=o.shift(),{childNodes:i}=n;r.push(...t(n)||[]),o.unshift(...[].slice.call(i))}return r}var ph=["A","ABBR","ACRONYM","AUDIO","B","BDI","BDO","BIG","BR","BUTTON","CANVAS","CITE","CODE","DATA","DATALIST","DEL","DFN","EM","EMBED","I","IFRAME","IMG","INPUT","INS","KBD","LABEL","MAP","MARK","METER","NOSCRIPT","OBJECT","OUTPUT","PICTURE","PROGRESS","Q","RUBY","S","SAMP","SCRIPT","SELECT","SLOT","SMALL","SPAN","STRONG","SUB","SUP","SVG","TEMPLATE","TEXTAREA","TIME","U","TT","VAR","VIDEO","WBR"];function fh(e){return uh(e,t=>{let{nodeType:o,tagName:r,textContent:n}=t;if(o===Node.TEXT_NODE)return[n];if(r==="IMG")return[t.getAttribute("alt")];if(!ph.includes(r))return[`
`]})}function Gt(e,t){if(e.type!=="message")return!1;let o=e?.channelData?.["webchat:fallback-text"];if(typeof o=="string")return o||!1;let r=e?.channelData?.messageBack?.displayText||e.text;return r?t&&rt(e.textFormat)==="text/markdown"?fh(new DOMParser().parseFromString(t(r),"text/html")).join("").replace(/\n{2,}/gu,`
`).trim():r:""}import{hooks as hh}from"botframework-webchat-api";import zn,{Fragment as bh}from"react";var{useCreateAttachmentForScreenReaderRenderer:yh,useLocalizer:_h}=hh,gh={few:"ACTIVITY_NUM_ATTACHMENTS_FEW_ALT",many:"ACTIVITY_NUM_ATTACHMENTS_MANY_ALT",one:"ACTIVITY_NUM_ATTACHMENTS_ONE_ALT",other:"ACTIVITY_NUM_ATTACHMENTS_OTHER_ALT",two:"ACTIVITY_NUM_ATTACHMENTS_TWO_ALT"},wh=({activity:e})=>{let{attachments:t=[]}=e,o=yh(),r=_h({plural:!0}),n=t.map(s=>o({activity:e,attachment:s})).filter(Boolean),i=t.length-n.length,a=!!i&&r(gh,i);return zn.createElement(bh,null,n.map((s,c)=>zn.createElement("div",{key:c},typeof s=="function"&&s())),a&&zn.createElement("p",null,a))},cl=wh;import ll from"prop-types";import dl from"react";function Jt(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 ml=({suggestedActions:e})=>e.actions?.length&&dl.createElement("p",{className:"webchat__live-region-activity__suggested-actions"},e.actions.map((t,o)=>dl.createElement("button",{className:"webchat__live-region-activity__suggested-action",key:o,tabIndex:-1,type:"button"},Jt(t))));ml.propTypes={suggestedActions:ll.shape({actions:ll.array}).isRequired};var ul=ml;import{cx as Ah}from"@emotion/css";import{hooks as Th}from"botframework-webchat-api";import{useMemo as pl}from"react";var{useLocalizer:vh,useStyleOptions:Sh}=Th;function ce(e="message activity"){let{renderMarkdown:t}=L(),[o]=Sh(),[{renderMarkdown:r}]=_(),i=vh()("MARKDOWN_EXTERNAL_LINK_ALT"),a=pl(()=>Ah("webchat__render-markdown",{"webchat__render-markdown--adaptive-cards":e==="adaptive cards","webchat__render-markdown--citation":e==="citation modal","webchat__render-markdown--message-activity":e!=="accessible name"&&e!=="adaptive cards"&&e!=="citation modal"},r+""),[e,r]);return pl(()=>t&&(s=>{let c=t(s,o,{containerClassName:a,externalLinkAlt:i}),l=Lc(c),d=l.createElement("div");return a&&d.classList.add(...a.split(" ").filter(Boolean)),d.append(...l.body.children),l.body.append(d),Nc(l)}),[a,i,t,o])}var{useAvatarForBot:Lh,useLocalizer:Nh}=Ch,Ih={"&.webchat__live-region-activity":{color:"transparent",height:1,opacity:0,overflow:"hidden",position:"absolute",top:0,whiteSpace:"nowrap",width:1}},hl=({activity:e})=>{let[{initials:t}]=Lh(),{from:{role:o},type:r}=e,n=r==="message"?e.channelData["webchat:fallback-text"]:void 0,i=Nh(),a=ce(),s=x()(Ih)+"",c=Eh(()=>Gt(e,a),[e,a]),l=(o==="user"?i("ACTIVITY_YOU_SAID_ALT"):i("ACTIVITY_BOT_SAID_ALT",t||"")).replace(/\s{2,}/gu," "),d=n&&typeof n=="string";return Ue.createElement("article",{"aria-atomic":!0,className:xh("webchat__live-region-activity",s)},Ue.createElement("div",null,l),d?Ue.createElement("div",null,n):Ue.createElement(fl,null,Ue.createElement("div",null,c),r==="message"&&Ue.createElement(fl,null,!!e.suggestedActions&&Ue.createElement(ul,{suggestedActions:e.suggestedActions}),Ue.createElement(cl,{activity:e}))))};hl.propTypes={activity:kh.any.isRequired};var bl=hl;import{hooks as Fh}from"botframework-webchat-api";import{useEffect as Dh,useMemo as _l}from"react";var Zt="sending",Ne="send failed",yl="sent";import{useEffect as Oh,useRef as Mh}from"react";function nt(e){let t=Mh();return Oh(()=>{t.current=e}),t.current}import{useContext as Rh}from"react";import{createContext as Ph}from"react";var Bh=Ph(void 0),Xo=Bh;function it(e=!0){let t=Rh(Xo);if(e&&!t)throw new Error("botframework-webchat internal: This hook can only be used under <LiveRegionComposer>.");return t}function Qt(){return it().queueStaticElement}var{useGetActivityByKey:Wh,useLocalizer:Kh,useSendStatusByActivityKey:qh}=Fh,jh=()=>{let[e]=qh(),t=Wh(),o=Kh(),r=Qt(),n=_l(()=>Array.from(e).reduce((c,[l,d])=>d===Ne&&!Vt(t(l))?c.add(l):c,new Set),[t,e]),i=o("TRANSCRIPT_LIVE_REGION_SEND_FAILED_ALT"),a=nt(n),s=_l(()=>{if(n===a)return!1;for(let c of n.keys())if(!a.has(c))return!0;return!1},[n,a]);return Dh(()=>{s&&r(i)},[s,i,r]),null},gl=jh;import{hooks as Vh}from"botframework-webchat-api";import Ye from"prop-types";import Al,{useCallback as Tl,useEffect as Gh,useMemo as vl,useRef as Sl,useState as Jh}from"react";import At from"prop-types";import Vn,{Fragment as zh}from"react";import{useEffect as Hh}from"react";function Un(){let{markAllAsRendered:e}=it();Hh(e)}function Yn(){return it().staticElementEntriesState}var Gn=({"aria-label":e,"aria-live":t,"aria-roledescription":o,className:r,role:n,textElementClassName:i})=>{let[a]=Yn();return Un(),Vn.createElement("div",{"aria-label":e,"aria-live":t,"aria-roledescription":o,className:r,role:n},a.map(({element:s,key:c})=>typeof s=="string"?Vn.createElement("div",{"aria-atomic":!0,className:i,key:c},s):Vn.createElement(zh,{key:c},s)))};Gn.defaultProps={"aria-label":void 0,"aria-roledescription":void 0,className:void 0,role:void 0,textElementClassName:void 0};Gn.propTypes={"aria-label":At.string,"aria-live":At.oneOf(["assertive","polite"]).isRequired,"aria-roledescription":At.string,className:At.string,role:At.string,textElementClassName:At.string};var wl=Gn;import{useMemo as Uh,useRef as Yh}from"react";function z(e){let t=Yh(),o=Uh(()=>Object.create({},{current:{get:()=>t.current}}),[]);return t.current=e,o}var{usePonyfill:Zh}=Vh,Cl="polite",xl=1e3,Jn=({"aria-label":e,"aria-live":t=Cl,"aria-roledescription":o,children:r,className:n,fadeAfter:i=xl,role:a,textElementClassName:s})=>{let[{clearTimeout:c,setTimeout:l}]=Zh(),[d,p]=Jh([]),f=z(i),m=Sl(),u=Sl(1),b=z(d),y=Tl(()=>{b.current.length&&(m.current&&c(m.current),m.current=l(()=>{b.current.length&&p([])},f.current))},[c,f,m,p,l,b]);Gh(()=>()=>m.current&&c(m.current),[c,m]);let A=Tl(C=>{let h=u.current;u.current=u.current+1,p(w=>[...w,{element:C,key:h}])},[u,p]),T=vl(()=>Object.freeze([Object.freeze(d)]),[d]),g=vl(()=>({markAllAsRendered:y,queueStaticElement:A,staticElementEntriesState:T}),[y,A,T]);return Al.createElement(Xo.Provider,{value:g},Al.createElement(wl,{"aria-label":e,"aria-live":t,"aria-roledescription":o,className:n,role:a,textElementClassName:s}),r)};Jn.defaultProps={"aria-label":void 0,"aria-live":Cl,"aria-roledescription":void 0,children:void 0,className:void 0,fadeAfter:xl,role:void 0,textElementClassName:void 0};Jn.propTypes={"aria-label":Ye.string,"aria-live":Ye.oneOf(["assertive","polite"]),"aria-roledescription":Ye.string,children:Ye.any,className:Ye.string,fadeAfter:Ye.number,role:Ye.string,textElementClassName:Ye.string};var kl=Jn;function Ie(e){let t=e?.querySelectorAll("a[href], area[href], audio[controls], button:not(:disabled), iframe, input:not(:disabled), keygen, select:not(:disabled), summary, textarea:not(:disabled), video[controls], [contenteditable], [tabindex]")||[];return[].filter.call(t,o=>{let r=o.attributes.getNamedItem("tabindex");if(r&&r.specified){let n=parseInt(r.value,10);return n>=0||isNaN(n)&&o.nodeName.toLowerCase()==="input"}return!0})}import{hooks as ob}from"botframework-webchat-api";import{useCallback as rb}from"react";import{useMemo as Qh}from"react";var Xh=/^(android|linux armv7l)/giu,$h=/^(mac|ipad|iphone|ipod)/giu,eb=/^linux/giu,tb=/^win/giu;function Xt(){let{navigator:{platform:e}}=window;return Qh(()=>{let t=Xh.test(e),o=$h.test(e),r=tb.test(e),n=!t&&eb.test(e);return[{android:t,apple:o,linux:n,windows:r}]},[e])}var{useLocalizer:nb}=ob;function $t(e){let[{apple:t}]=Xt(),o=nb();return rb(r=>{if(!r||typeof r!="string"||!r.length)throw new Error('useLocalizeAccessKey: "accessKey" must be a non-empty string');return e==="accessible name"?o(t?"ACCESS_KEY_FOR_MAC_ALT":"ACCESS_KEY_ALT",r[0]):(t?"Control+AltGraph+":"Alt+Shift+")+r[0]},[t,o,e])}function eo(){let{suggestedActionsAccessKey:e}=L();return[e]}import{hooks as ib}from"botframework-webchat-api";import{useEffect as ab,useRef as sb}from"react";var{useActiveTyping:cb}=ib;function lb(e,t){return e.length===t.length&&e.every((o,r)=>t[+r]===o)}function Zn(){let[e]=cb(),t=sb(Object.freeze([Object.freeze([])])),r=Object.values(e).filter(({role:s})=>s!=="user").sort(({at:s},{at:c})=>s-c),n=Object.freeze([Object.freeze(r.map(({name:s})=>s))]),{current:i}=t,a=lb(n[0],i[0])?i:n;return ab(()=>{t.current=a},[t,a]),a}var{useActivities:fb,useGetKeyByActivity:hb,useLocalizer:Nl,useStyleOptions:bb}=db,yb={"&.webchat__live-region-transcript":{"& .webchat__live-region-transcript__note, & .webchat__live-region-transcript__note, & .webchat__live-region-transcript__text-element":{color:"transparent",height:1,overflow:"hidden",position:"absolute",top:0,whiteSpace:"nowrap",width:1}}},_b=({activityElementMapRef:e})=>{let[t]=eo(),[o]=fb(),[r]=Zn(),n=hb(),i=Nl(),a=$t("accessible name"),s=Qt(),c=i("TRANSCRIPT_LIVE_REGION_INTERACTIVE_LABEL_ALT"),l=i("TRANSCRIPT_LIVE_REGION_INTERACTIVE_WITH_LINKS_LABEL_ALT"),d=!!r.length&&i(r.length>1?"TYPING_INDICATOR_MULTIPLE_TEXT":"TYPING_INDICATOR_SINGLE_TEXT",r[0]),p=t?i("TRANSCRIPT_LIVE_REGION_SUGGESTED_ACTIONS_WITH_ACCESS_KEY_LABEL_ALT",a(t)):i("TRANSCRIPT_LIVE_REGION_SUGGESTED_ACTIONS_LABEL_ALT"),f=ub(()=>Object.freeze(o.reduce((u,b)=>b.type==="message"?u.set(n(b),b):u,new Map)),[o,n]),m=pb();return Ll(()=>{let{current:u}=m,b=[];for(let[g,C]of Array.from(f.entries()).reverse()){if(u?.has(g))break;b.unshift({activity:C,key:g}),Vt(C)||s(Tt.createElement(bl,{activity:C}))}let y=b.some(({key:g})=>e.current.get(g)?.querySelector("a")),A=b.some(({key:g})=>!!Ie(e.current.get(g)?.querySelector(".webchat__basic-transcript__activity-body")).length),T=b.some(({activity:g})=>g.type==="message"&&g.suggestedActions?.actions?.length);(y||A)&&s(Tt.createElement("div",{className:"webchat__live-region-transcript__note",role:"note"},y?l:c)),T&&s(Tt.createElement("div",{className:"webchat__live-region-transcript__note",role:"note"},p)),m.current=f},[e,c,l,p,m,s,f]),Ll(()=>{d&&s(d)},[s,d]),Tt.createElement(gl,null)},Il=({activityElementMapRef:e})=>{let[{internalLiveRegionFadeAfter:t}]=bb(),o=Nl(),r=x()(yb)+"",n=o("TRANSCRIPT_ARIA_ROLE_ALT");return Tt.createElement(kl,{"aria-roledescription":n,className:mb("webchat__live-region-transcript",r),fadeAfter:t,role:"log",textElementClassName:"webchat__live-region-transcript__text-element"},Tt.createElement(_b,{activityElementMapRef:e}))};Il.propTypes={activityElementMapRef:El.shape({current:El.instanceOf(Map)}).isRequired};var Ol=Il;import{hooks as kb}from"botframework-webchat-api";import Ml from"prop-types";import Eb from"math-random";import Lb,{useCallback as $n,useMemo as oo}from"react";import gb from"compute-scroll-into-view";function Qn(e){if("scrollBehavior"in document.documentElement.style)return e.scrollIntoView({block:"nearest"});let[t]=gb(e,{block:"nearest"});t.el.scrollTop=t.top}import{createContext as wb}from"react";var Ab=wb(void 0),$o=Ab;import{useContext as vb}from"react";import{createContext as Tb}from"react";var er=Tb(void 0);function to(e=!0){let t=vb(er);if(e&&!t)throw new Error("botframework-webchat internal: This hook can only be used under <ActivityTreeComposer>.");return t}function vt(e={}){let t=to();return e?.flat===!0?t.flattenedActivityTreeWithRendererState:t.activityTreeWithRendererState}import{useCallback as Sb,useRef as Cb,useState as xb}from"react";function Xn(e){let[t,o]=xb(),r=Cb(e),n=Sb(i=>{let{current:a}=r;i=i instanceof Function?i(a):i,a!==i&&(r.current=i,o({}))},[o,r]);return Object.freeze([r.current,n,r])}var{useGetKeyByActivity:Nb}=kb;function Pl(e){return e[e.length-1]}function Ib(e=1/0){return Eb().toString(36).substring(2,2+e)}var Bl=({children:e,containerRef:t})=>{let[o]=vt({flat:!0}),[r,n,i]=Xn(),a=Nb(),s=oo(()=>Ib(3),[]),c=$n(g=>g&&`webchat__transcript-focus-${s}__activity-${g}`,[s]),l=oo(()=>Object.freeze(o.map(({activity:g})=>a(g))),[o,a]),d=z(l),p=nt(l);l!==p&&!t.current?.contains(document.activeElement)&&(i.current=void 0);let{current:f}=i,m=oo(()=>l.includes(f)?f:Pl(l),[l,f]),u=z(m),b=oo(()=>c(m),[c,m]),y=$n((g,C=!0)=>{if(g===!1?n(void 0):g===!0?n(h=>h||u.current):g&&n(g),C){t.current?.focus();let h=c(g===!1?Pl(d.current):g&&g!==!0?g:i.current),w=h&&document.getElementById(h);w&&!w.contains(document.activeElement)&&Qn(w)}},[c,t,u,d,i,n]),A=$n(g=>{let{current:C}=d;if(isNaN(g)||!C.length)return y(!1,!0);let{current:h}=u,w=C.indexOf(h),S=~w?Math.max(0,Math.min(C.length-1,w+g)):C.length-1;y(C[+S],!0)},[u,d,y]),T=oo(()=>({activeDescendantIdState:Object.freeze([b]),getDescendantIdByActivityKey:c,focusByActivityKey:y,focusedActivityKeyState:Object.freeze([m]),focusedExplicitlyState:Object.freeze([!!f]),focusRelativeActivity:A}),[b,c,y,m,A,f]);return Lb.createElement($o.Provider,{value:T},e)};Bl.propTypes={containerRef:Ml.shape({current:Ml.instanceOf(HTMLElement)}).isRequired};var Rl=Bl;import{useContext as Ob}from"react";function le(e=!0){let t=Ob($o);if(e&&!t)throw new Error("botframework-webchat internal: This hook can only be used under <TranscriptFocusComposer>.");return t}function ro(){return le().activeDescendantIdState}function ei(){return L().dispatchScrollPosition}function ti(){return L().dispatchTranscriptFocusByActivityKey}function St(){return le().focusByActivityKey}function oi(){return le().focusedActivityKeyState}function ri(){return le().focusedExplicitlyState}function ni(){return le().focusRelativeActivity}import{hooks as Mb}from"botframework-webchat-api";import{useCallback as st,useEffect as tr,useMemo as Fl,useRef as or}from"react";function ii(e,t){let o=document.createElement("style");t&&o.setAttribute("nonce",t),document.head.appendChild(o);try{return o.sheet.insertRule("html"+e+"{}",0),!0}catch{return!1}finally{document.head.removeChild(o)}}function at(){let{nonce:e}=L();return[e]}var{usePonyfill:Pb}=Mb,Bb=["date","datetime-local","datetime","email","month","number","password","search","tel","text","time","url","week"];function Rb(e){let{isContentEditable:t,readOnly:o,tagName:r,type:n}=e;return r==="INPUT"&&Bb.includes(n)&&!o||r==="TEXTAREA"&&!o||t}function Fb(e,t,o){let r;return{pause:()=>{r&&(t.forEach(a=>e.removeEventListener(a,o)),r=void 0)},resume:()=>{r||(t.forEach(a=>e.addEventListener(a,o)),r=!0)}}}function Db(e,t){let[{Date:o}]=Pb(),r=or(0),n=or(!0),i=or(!1),a=Fl(()=>Fb(document,["mousemove","mousedown","mouseup","pointermove","pointerdown","pointerup","touchmove","touchstart","touchend"],m=>{m.target.nodeName?.toLowerCase()!=="html"&&(n.current=!1,a.pause())}),[n]),s=st(m=>{i.current!==m&&(i.current=m,m&&t?.current())},[i,t]),c=st(m=>{m.altKey||m.ctrlKey||m.metaKey||(m.target===e.current&&s(!0),n.current=!0)},[n,s,e]),l=st(()=>{n.current=!1},[n]),d=st(({target:m})=>{m===e.current&&(n.current||Rb(m))&&s(!0)},[n,s,e]),p=st(m=>{m.target===e.current&&i.current&&(r.current=o.now(),s(!1))},[r,o,i,s,e]),f=st(()=>{document.visibilityState==="hidden"&&(o.now()-r.current<100&&(n.current=!0),a.resume())},[r,o,a,n]);tr(()=>(document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",l,!0),document.addEventListener("pointerdown",l,!0),document.addEventListener("touchstart",l,!0),document.addEventListener("visibilitychange",f,!0),()=>{document.removeEventListener("keydown",c),document.removeEventListener("mousedown",l),document.removeEventListener("pointerdown",l),document.removeEventListener("touchstart",l),document.removeEventListener("visibilitychange",f)}),[c,l,f]),tr(()=>{let{current:m}=e;return m.addEventListener("blur",p,!0),m.addEventListener("focus",d,!0),()=>{m.removeEventListener("blur",p),m.removeEventListener("focus",d)}},[p,d,e]),tr(()=>(a.resume(),()=>a.pause()),[a])}function Wb(e,t){let o=st(()=>{let{current:r}=e;(r.matches||r.msMatchesSelector).call(r,":focus-visible")&&t?.current()},[t,e]);tr(()=>{let{current:r}=e;return r.addEventListener("focus",o),()=>r.removeEventListener("focus",o)},[o,e,e.current])}function no(e,t){let[o]=at(),r=z(t),n=or(o);Fl(()=>ii(":focus-visible",n.current),[n])?Wb(e,r):Db(e,r)}import{useEffect as Kb}from"react";function Oe(e,...t){t.forEach(o=>{let r;for(;~(r=e.indexOf(o));)e.splice(r,1)})}function ai(e){let{focusTranscriptCallbacksRef:t}=L();Kb(()=>{if(e){let{current:o}=t;return o.push(e),()=>Oe(o,e)}},[e,t])}import{useEffect as qb}from"react";function si(e){let{scrollToCallbacksRef:t}=L();qb(()=>{if(e){let{current:o}=t;return o.push(e),()=>Oe(o,e)}},[e,t])}import{useEffect as jb}from"react";function ci(e){let{scrollToEndCallbacksRef:t}=L();jb(()=>{let{current:o}=t;return o.push(e),()=>Oe(o,e)},[e,t])}import A1,{memo as T1,useCallback as v1,useMemo as Hl}from"react";import{hooks as S1}from"botframework-webchat-api";import{hooks as u1}from"botframework-webchat-api";import ql from"classnames";import ao from"prop-types";import ct,{forwardRef as p1,memo as f1,useCallback as sr,useMemo as h1,useRef as b1}from"react";import li from"prop-types";import rr,{Fragment as Hb,memo as zb,useCallback as nr,useRef as Ub}from"react";import{useRefFrom as Yb}from"use-ref-from";var ir=({children:e,onFocus:t,onLeave:o})=>{let r=Ub(),n=Yb(o),i=nr(()=>Ie(r.current).filter(l=>l.getAttribute("aria-disabled")!=="true"),[r]),a=nr(l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),n.current?.())},[n]),s=nr(()=>{let l=i(),d=l[l.length-1];d?d.focus():n.current?.()},[i,n]),c=nr(()=>{let[l]=i();l?l.focus():n.current?.()},[i,n]);return rr.createElement(Hb,null,rr.createElement(wt,{onFocus:s}),rr.createElement("div",{onFocus:t,onKeyDown:a,ref:r},e),rr.createElement(wt,{onFocus:c}))};ir.defaultProps={children:void 0,onFocus:void 0};ir.propTypes={children:li.any,onFocus:li.func,onLeave:li.func.isRequired};ir.displayN