"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[2109],{81494:(e,t,i)=>{i.r(t),i.d(t,{default:()=>w});var a=i(86332),n=i.n(a),l=i(84390),r=i.n(l),c=(i(52077),i(911),i(72060)),o=i(70314),s=i(83198),u=i.n(s),f=i(83905);const d=i.p+"files/c01e2180eeaf3ec6fc96.png",m=i.p+"files/91a3a29ed2f93ba44792.png";function g(e){const t=(0,o.useSelector)(f.gh),{formatMessage:i}=(0,c.useIntl)(),a=(0,l.useCallback)((t=>{var i,a,n;t.preventDefault();const l=null!==(i=null===(a=t.target)||void 0===a||null===(n=a.value)||void 0===n?void 0:n.replace(/^:|:$/g,""))&&void 0!==i?i:"";e.onChange(l)}),[e.onChange]),n=(0,l.useMemo)((()=>!!u().mostReadable(t.centerChannelBg,["#FFFFFF","#000000"],{includeFallbackColors:!1}).isLight()),[t.centerChannelBg]);return r().createElement("div",{className:"emoji-picker__search-container"},r().createElement("div",{className:"emoji-picker__text-container"},r().createElement("span",{className:"icon-magnify icon emoji-picker__search-icon"}),r().createElement("input",{id:"emojiPickerSearch",className:"emoji-picker__search","aria-label":i({id:"gif_picker.input.label",defaultMessage:"Search for GIFs"}),placeholder:i({id:"gif_picker.input.placeholder",defaultMessage:"Search GIPHY"}),type:"text",autoFocus:!0,autoComplete:"off",onChange:a,value:e.value})),r().createElement("div",{className:"gif-attribution"},r().createElement("img",{src:n?d:m,alt:i({id:"gif_picker.attribution.alt",defaultMessage:"Powered by GIPHY"})})))}g.propTypes={value:n().string.isRequired,onChange:n().func.isRequired};const p=(0,l.memo)(g);i(61418),i(83526);var h=i(43458),k=i(19601),v=i(15308),C=i(69317);function _(e){const t=(0,o.useSelector)(k.D_),i=(0,l.useCallback)((async i=>t?e.filter.length>0?await t.search(e.filter,{offset:i,limit:10}):await t.trending({offset:i,limit:10}):{}),[e.filter,t]);return r().createElement("div",{className:"emoji-picker__items gif-picker__items"},r().createElement(h.rj,{key:0===e.filter.length?"trending":e.filter,columns:2,gutter:8,hideAttribution:!0,width:e.width,noResultsMessage:r().createElement(v.Z,{variant:C.U.ChannelSearch,titleValues:{channelName:'"'.concat(e.filter,'"')}}),fetchGifs:i,onGifClick:e.onClick}))}_.propTypes={width:n().number.isRequired,filter:n().string.isRequired};const b=(0,l.memo)(_),R=e=>{const t=(0,l.useCallback)(((t,i)=>{if(e.onGifClick){i.preventDefault();const a="![".concat(t.title,"](").concat(t.images.fixed_height.url,")");e.onGifClick(a)}}),[e.onGifClick]),i=(0,l.useMemo)((()=>{var t,i,a,n;return(null!==(t=null===(i=e.getRootPickerNode)||void 0===i||null===(a=i.call(e))||void 0===a||null===(n=a.getBoundingClientRect())||void 0===n?void 0:n.width)&&void 0!==t?t:350)-24}),[e.getRootPickerNode]);return r().createElement("div",null,r().createElement(p,{value:e.filter,onChange:e.handleFilterChange}),r().createElement(b,{width:i,filter:e.filter,onClick:t}))};R.propTypes={filter:n().string.isRequired,onGifClick:n().func,handleFilterChange:n().func.isRequired,getRootPickerNode:n().func.isRequired};const w=R}}]);
//# sourceMappingURL=2109.adbf6a20ab738d62c319.js.map