"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../node_modules/@fortawesome/react-fontawesome/index.es.js");require("../node_modules/react-redux/es/index.js");var r=require("../store/index.js"),s=require("./Button.js"),n=require("../utils/genericFunctions/eventDispatch.js");require("../node_modules/tslib/tslib.es6.js");var i=require("../lib/user/default_device.js"),o=require("../lib/webrtc/messages.js"),a=require("../services/astproxy.js"),l=require("../static/outgoing_ringtone.js"),u=require("../node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js"),c=require("../node_modules/i18next/dist/esm/i18next.js"),d=require("../node_modules/react-tooltip/dist/react-tooltip.min.mjs.js"),p=require("../lib/phone/call.js"),f=require("../node_modules/react-redux/es/hooks/useSelector.js"),m=require("../node_modules/react-redux/es/hooks/useDispatch.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=h(e),j=function(e){var h=e.tooltipPlace,j=void 0===h?"bottom":h,q=f.useSelector((function(e){return e.island})),w=q.view,g=q.sideViewIsVisible,x=q.transcriptionViewIsVisible,b=m.useDispatch(),_=f.useSelector((function(e){return e.currentCall.transferring})),y=f.useSelector((function(e){return e.listen}));return v.default.createElement(v.default.Fragment,null,!(y.isIntrude||y.isListen)&&v.default.createElement(v.default.Fragment,null,v.default.createElement(s.Button,{active:_,onClick:_?function(){p.forceHangupConversation(),r.store.getState().player.audioPlayerPlaying||b.player.updateStartAudioPlayer({src:l.default,loop:!0}),setTimeout((function(){i.isWebRTC()?o.sendDTMF("1"):a.sendPhysicalDTMF("1"),b.player.stopAudioPlayer(),_&&setTimeout((function(){b.currentCall.updateTransferring(!1)}),500),n.eventDispatch("phone-island-call-transfer-canceled",{})}),500)}:function(){b.island.setIslandView("transfer"!==w?"transfer":"call"),g&&n.eventDispatch("phone-island-sideview-close",{}),x&&n.eventDispatch("phone-island-transcription-close",{}),n.eventDispatch("phone-island-call-hold",{}),n.eventDispatch("phone-island-call-transfer-opened",{})},variant:"default","data-tooltip-id":"tooltip-transfer","data-tooltip-content":"".concat(_?c.t("Tooltip.Cancel transfer"):c.t("Tooltip.Transfer"))},_?v.default.createElement(t.FontAwesomeIcon,{className:"pi-h-6 pi-w-6",icon:u.faArrowDownUpAcrossLine}):v.default.createElement(t.FontAwesomeIcon,{className:"pi-rotate-90 pi-h-6 pi-w-6",icon:u.faArrowRightArrowLeft})),v.default.createElement(d.Tooltip,{className:"pi-z-20",id:"tooltip-transfer",place:j})))};exports.TransferButton=j,exports.default=j;
//# sourceMappingURL=TransferButton.js.map
