psc2.cf2.poecdn.net
Open in
urlscan Pro
2606:4700:7::a29f:99f7
Public Scan
Submitted URL: http://psc2.cf2.poecdn.net/84aa38e95256235c35518666b20839df36727a09/_next/static/chunks/3869.9a6e4c1ea737e11a.js
Effective URL: https://psc2.cf2.poecdn.net/84aa38e95256235c35518666b20839df36727a09/_next/static/chunks/3869.9a6e4c1ea737e11a.js
Submission: On November 28 via manual from US — Scanned from DE
Effective URL: https://psc2.cf2.poecdn.net/84aa38e95256235c35518666b20839df36727a09/_next/static/chunks/3869.9a6e4c1ea737e11a.js
Submission: On November 28 via manual from US — Scanned from DE
Form analysis
0 forms found in the DOMText Content
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3869],{48824:function(e,a,s){"use strict";var n,t,l=s(67294);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e}).apply(this,arguments)}a.Z=function(e){return l.createElement("svg",_extends({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=l.createElement("path",{d:"M16.5 21H4c-.55 0-1-.45-1-1V7.5c0-.55.45-1 1-1h6.5c.55 0 1 .45 1 1s-.45 1-1 1H5V19h10.5v-5.5c0-.55.45-1 1-1s1 .45 1 1V20c0 .55-.45 1-1 1Z"})),t||(t=l.createElement("path",{d:"M12 13c-.26 0-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.79-6.79H14.5c-.55 0-1-.45-1-1s.45-1 1-1h6c.13 0 .26.03.38.08.12.03.23.11.33.2.1.09.17.21.21.33.05.12.08.24.08.38v6c0 .55-.45 1-1 1s-1-.45-1-1V5.91l-6.79 6.79c-.2.2-.45.3-.71.3Z"})))}},65868:function(e,a,s){"use strict";s.r(a);let n={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ChatMessageDropdownMenu_bot",selections:[{alias:null,args:null,kind:"ScalarField",name:"isPrivateBot",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"botId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"allowsImageAttachments",storageKey:null}],type:"Bot",abstractKey:null};n.hash="9c948c5c9286554681ea31f6446f9aef",a.default=n},8293:function(e,a,s){"use strict";var n,t;s.r(a);let l=(t=[n={alias:null,args:null,kind:"ScalarField",name:"author",storageKey:null}],{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ChatMessageDropdownMenu_message",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"messageId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"vote",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},n,{kind:"InlineDataFragmentSpread",name:"messageHelpers_isBotMessage",selections:[{kind:"InlineDataFragmentSpread",name:"messageHelpers_isHumanMessage",selections:t,args:null,argumentDefinitions:[]},{kind:"InlineDataFragmentSpread",name:"messageHelpers_isChatBreak",selections:t,args:null,argumentDefinitions:[]}],args:null,argumentDefinitions:[]},{kind:"ClientExtension",selections:[{alias:null,args:null,kind:"ScalarField",name:"isOptimistic",storageKey:null}]}],type:"Message",abstractKey:null});l.hash="684b0cdd6c2f74f920db86908aca925e",a.default=l},80858:function(e,a,s){"use strict";var n,t,l,i;s.r(a);let r={fragment:{argumentDefinitions:n=[{defaultValue:null,kind:"LocalArgument",name:"messageId"},{defaultValue:null,kind:"LocalArgument",name:"vote"}],kind:"Fragment",metadata:null,name:"ChatMessageDropdownMenu_messageVoteMutation_Mutation",selections:[{alias:null,args:t=[{kind:"Variable",name:"messageId",variableName:"messageId"},{kind:"Variable",name:"voteType",variableName:"vote"}],concreteType:"MessageSetVote",kind:"LinkedField",name:"messageSetVote",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"message",plural:!1,selections:[l={alias:null,args:null,kind:"ScalarField",name:"vote",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"voteReason",storageKey:null}],storageKey:null}],storageKey:null}],type:"MutationRoot",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ChatMessageDropdownMenu_messageVoteMutation_Mutation",selections:[{alias:null,args:t,concreteType:"MessageSetVote",kind:"LinkedField",name:"messageSetVote",plural:!1,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"message",plural:!1,selections:[l,i,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:"7436a931715c98519ded80dc4fa7ac7dcf224a04dab05c1e67b266a67b9099e1",metadata:{},name:"ChatMessageDropdownMenu_messageVoteMutation_Mutation",operationKind:"mutation",text:null}};r.hash="8400a9d1518f9bc79082a8f338b7857f",a.default=r},24892:function(e,a,s){"use strict";s.r(a);let n={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ChatMessageDropdownMenu_pairedMessage",selections:[{alias:null,args:null,kind:"ScalarField",name:"messageId",storageKey:null}],type:"Message",abstractKey:null};n.hash="841d1d64901c8c088d7225d8d2988156",a.default=n},17083:function(e,a,s){"use strict";s.r(a);let n={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ChatMessageDropdownMenu_viewer",selections:[{alias:"poeMessageDropdownImageOptions",args:[{kind:"Literal",name:"gateName",value:"poe_message_dropdown_image_options"}],kind:"ScalarField",name:"booleanGate",storageKey:'booleanGate(gateName:"poe_message_dropdown_image_options")'}],type:"Viewer",abstractKey:null};n.hash="6c84e0fe1b9446fc1afead80f7d535bf",a.default=n},83869:function(e,a,s){"use strict";s.r(a),s.d(a,{default:function(){return message_ChatMessageDropdownMenu}});var n,t,l,i=s(85893),r=s(41143),o=s.n(r),c=s(67294),d=s(22120),u=s(22578),g=s(35409),m=s(70138),p=s(69865),h=s(58334),k=s(70690),y=s(45338),v=s(2197),f=s(41677);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e}).apply(this,arguments)}var icons_copyImage=function(e){return c.createElement("svg",_extends({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),n||(n=c.createElement("path",{d:"M12.75 9.25c-1.103 0-2 .897-2 2s.897 2 2 2 2-.897 2-2-.897-2-2-2Z"})),t||(t=c.createElement("path",{d:"M14.5 6h-9C3.57 6 2 7.57 2 9.5v9C2 20.43 3.57 22 5.5 22h9c1.93 0 3.5-1.57 3.5-3.5v-9C18 7.57 16.43 6 14.5 6ZM16 18.5c0 .827-.673 1.5-1.5 1.5h-9c-.827 0-1.5-.673-1.5-1.5v-1.586c1.194-.906 2.265-1.491 2.492-1.491.191.028.895.591 1.135.782.783.625 1.523 1.217 2.373 1.217.693 0 1.419-.291 2.128-.574.475-.189 1.066-.426 1.372-.426.333 0 1.428.479 2.5 1.078v1ZM5.5 8h9c.827 0 1.5.673 1.5 1.5v5.742c-.851-.418-1.835-.82-2.5-.82-.693 0-1.419.291-2.128.574-.475.189-1.066.426-1.364.426-.191-.028-.895-.591-1.135-.782-.783-.626-1.523-1.218-2.373-1.218-.688 0-1.645.497-2.5 1.047V9.5C4 8.673 4.673 8 5.5 8Z"})),l||(l=c.createElement("path",{d:"M9.5 2h9C20.43 2 22 3.57 22 5.5v9a3.474 3.474 0 0 1-2 3.145V5.5c0-.827-.673-1.5-1.5-1.5H6.349A3.489 3.489 0 0 1 9.5 2Z"})))},x=s(99240),_=s(48824),b=s(19644),C=s(1656),w=s(61918),M=s(61670),j=s(15390),Z=s(95353),I=s(52667),F=s(6997),S=s(7700),N=s(19029),D=s(50141),K=s(503),V=s.n(K),O=s(6488),E=s(39885),W=s(88176);let useClickedImage=()=>{let{clickTarget:e}=(0,h.Z)();return e&&"IMG"===e.tagName?e:null};var message_ChatMessageDropdownMenu=e=>{let{message:a,bot:n,pairedMessage:t,viewer:l,fileHandlerRef:r}=e,{t:h}=(0,d.$G)(),[K]=(0,S.y)(),P=(0,u.useFragment)(s(8293),a),{isPrivateBot:R,botId:H,allowsImageAttachments:L}=(0,u.useFragment)(s(65868),n),T=(0,u.useFragment)(s(24892),t),{poeMessageDropdownImageOptions:A}=(0,u.useFragment)(s(17083),l),B=(0,c.useContext)(p.n),[G]=(0,u.useMutation)(s(80858)),z=(0,c.useCallback)(()=>{G({variables:{messageId:P.messageId,vote:W.Z.upvote},optimisticResponse:{messageSetVote:{message:{id:P.id,vote:W.Z.upvote,voteReason:null}}}}),B()},[G,P,B]),q=(0,c.useCallback)(()=>{G({variables:{messageId:P.messageId,vote:W.Z.downvote},optimisticResponse:{messageSetVote:{message:{id:P.id,vote:W.Z.downvote,voteReason:null}}}}),B()},[G,P,B]),Q=useClickedImage(),Y=(0,c.useCallback)(e=>{(0,N.Z)("poe/action_log",{action_type:(0,E.E)(e),bot_id:H,message_id:P.messageId,action_metadata:{image_src:Q&&Q.src}})},[P.messageId,H,Q]),$=(0,c.useCallback)(()=>{o()(Q&&Q.src,"clickedImage should exist"),K(Q.src,Q.alt),B()},[K,Q,B]),J=(0,v.ZP)(),U=(0,c.useContext)(m.Z),X=(0,c.useCallback)(()=>{let e=window.getSelection();if(!e||!(null==U?void 0:U.messageRef.current))return!1;let a=e.containsNode(U.messageRef.current,!0);if(!a)return!1;let s=e.toString();return s.length>0},[U]),ee=(0,c.useCallback)(()=>{let e=P.text.trim(),a=window.getSelection();return X()&&a?a.toString():e},[P.text,X]),ea=(0,c.useCallback)(async()=>{B(),await (0,F.v)(ee())?(J({content:(0,i.jsx)("p",{children:h("Message copied!")}),type:v.pC.success}),(0,N.Z)("poe/action_log",{action_type:(0,E.E)(O.Z.copy_message),bot_id:H,message_id:P.messageId})):J({content:(0,i.jsx)("p",{children:h("There was an error copying the message to your clipboard. Please try again later.")}),type:v.pC.error})},[ee,P.messageId,B,J,H,h]),es=(0,c.useCallback)(async()=>{o()(Q&&Q.src,"Image does not exist"),B(),await (0,F.v)(Q.src)?(J({content:(0,i.jsx)("p",{children:h("Image link copied!")}),type:v.pC.success}),Y(O.Z.copy_image_link)):J({content:(0,i.jsx)("p",{children:h("There was an error copying the image link to your clipboard. Please try again later.")}),type:v.pC.error})},[Q,B,J,h,Y]),en=(0,c.useCallback)(()=>{o()(Q&&Q.src,"Image does not exist"),window.open(Q.src,"_blank"),Y(O.Z.open_image_in_new_tab)},[Q,Y]),et=(0,c.useCallback)(async()=>{if(o()(Q&&Q.src,"Image does not exist"),!(null==r?void 0:r.current))return;let e=await fetch(Q.src),a=await e.blob(),s=Q.alt||"image.jpg",n=new File([a],s,{type:a.type});r.current.handleFiles([n])},[Q,r]),el=(0,c.useCallback)(async()=>{try{o()(Q&&Q.src,"Image does not exist");let e=await fetch(Q.src),a=await e.blob();await navigator.clipboard.write([new ClipboardItem({[a.type]:a})]),J({content:(0,i.jsx)("p",{children:h("Image copied!")}),type:v.pC.success}),Y(O.Z.copy_image)}catch(e){J({content:(0,i.jsx)("p",{children:h("There was an error copying the image. Please try again later.")}),type:v.pC.error})}},[Q,J,h,Y]),{setSelectionMode:ei,addSelection:er}=(0,D.ZP)(),{shouldShowSignupWall:eo,openSignupWall:ec}=(0,g.zl)(),ed=(0,c.useCallback)(()=>{T&&er(T.messageId),er(P.messageId),ei(D.oW.share),B()},[ei,B,er,P,T]),eu=(0,c.useCallback)(()=>{er(P.messageId),ei(D.oW.delete),B()},[ei,B,er,P]),eg=(0,c.useCallback)(e=>{e.stopPropagation(),ec(g.dh.voteAction)},[ec]);return(0,i.jsxs)(y.Z,{children:[!P.vote&&!P.isOptimistic&&(0,I.OE)(P)&&(0,i.jsxs)(k.Z,{onClick:eo?eg:z,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(j.Z,{className:V().icon})}),h("Like")]}),!P.vote&&!P.isOptimistic&&(0,I.OE)(P)&&(0,i.jsxs)(k.Z,{onClick:eo?eg:q,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(M.Z,{className:V().icon})}),h("Dislike")]}),(0,i.jsxs)(k.Z,{onClick:ea,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(f.Z,{className:V().icon})}),X()?h("Copy selected text"):h("Copy message")]}),Q&&Q.src&&A&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(k.Z,{onClick:en,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(_.Z,{className:V().icon})}),h("Open image in new tab")]}),(0,i.jsxs)(k.Z,{onClick:$,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(x.Z,{className:V().icon})}),h("Save image")]}),(0,i.jsxs)(k.Z,{onClick:el,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(icons_copyImage,{className:V().icon})}),h("Copy image")]}),(0,i.jsxs)(k.Z,{onClick:es,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(b.Z,{className:V().icon})}),h("Copy image link")]}),L&&(0,i.jsxs)(k.Z,{onClick:et,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(C.Z,{className:V().icon})}),h("Attach image")]})]}),!R&&!P.isOptimistic&&(0,i.jsxs)(k.Z,{onClick:ed,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(w.Z,{className:V().icon})}),h("Share...")]}),!P.isOptimistic&&(0,i.jsxs)(k.Z,{onClick:eu,type:k.l.destructive,children:[(0,i.jsx)("div",{className:V().iconWrapper,children:(0,i.jsx)(Z.Z,{className:V().deleteIcon})}),h("Delete...")]})]})}},69865:function(e,a,s){"use strict";s.d(a,{n:function(){return t}});var n=s(67294);let t=(0,n.createContext)(()=>{})},503:function(e){e.exports={icon:"ChatMessageDropdownMenu_icon__zPQO6",iconWrapper:"ChatMessageDropdownMenu_iconWrapper__NegmY",deleteIcon:"ChatMessageDropdownMenu_deleteIcon__S5pfm"}}}]);