airdcpp-webui 2.13.1-beta.8 → 2.13.1
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.
- package/dist/index.html +1 -1
- package/dist/js/{223.6dbbf66031781a4daa16.chunk.js → 223.3c648d224ecdf7df15cb.chunk.js} +2 -2
- package/dist/js/223.3c648d224ecdf7df15cb.chunk.js.gz +0 -0
- package/dist/js/223.3c648d224ecdf7df15cb.chunk.js.map +1 -0
- package/dist/js/{544.6fcb6173c1ecdce59463.chunk.js → 544.b7ce1b6435a30e618cb3.chunk.js} +2 -2
- package/dist/js/544.b7ce1b6435a30e618cb3.chunk.js.gz +0 -0
- package/dist/js/{544.6fcb6173c1ecdce59463.chunk.js.map → 544.b7ce1b6435a30e618cb3.chunk.js.map} +1 -1
- package/dist/js/{616.56d33a82efa78946c57a.chunk.js → 616.6b0a3d6d2a908a41169a.chunk.js} +2 -2
- package/dist/js/616.6b0a3d6d2a908a41169a.chunk.js.gz +0 -0
- package/dist/js/{616.56d33a82efa78946c57a.chunk.js.map → 616.6b0a3d6d2a908a41169a.chunk.js.map} +1 -1
- package/dist/js/{794.76369cca0052b9816dce.chunk.js → 794.290592904e2672ba2992.chunk.js} +2 -2
- package/dist/js/{794.76369cca0052b9816dce.chunk.js.gz → 794.290592904e2672ba2992.chunk.js.gz} +0 -0
- package/dist/js/{794.76369cca0052b9816dce.chunk.js.map → 794.290592904e2672ba2992.chunk.js.map} +1 -1
- package/dist/js/{865.c7542b0bcc37a6936a89.chunk.js → 865.054628990bc0885af414.chunk.js} +1 -1
- package/dist/js/865.054628990bc0885af414.chunk.js.gz +0 -0
- package/dist/js/{865.c7542b0bcc37a6936a89.chunk.js.map → 865.054628990bc0885af414.chunk.js.map} +1 -1
- package/dist/js/{favorite-hubs.6425452a7f964dff8ff7.chunk.js → favorite-hubs.d0c1452419e4f6e34765.chunk.js} +2 -2
- package/dist/js/favorite-hubs.d0c1452419e4f6e34765.chunk.js.gz +0 -0
- package/dist/js/{favorite-hubs.6425452a7f964dff8ff7.chunk.js.map → favorite-hubs.d0c1452419e4f6e34765.chunk.js.map} +1 -1
- package/dist/js/{filelists.2c58467089eca7c30a41.chunk.js → filelists.005c956eabdbb3869c6f.chunk.js} +2 -2
- package/dist/js/filelists.005c956eabdbb3869c6f.chunk.js.gz +0 -0
- package/dist/js/filelists.005c956eabdbb3869c6f.chunk.js.map +1 -0
- package/dist/js/{files.550bfdf4f123930edd9f.chunk.js → files.d39359992a53f54ac313.chunk.js} +2 -2
- package/dist/js/files.d39359992a53f54ac313.chunk.js.gz +0 -0
- package/dist/js/{files.550bfdf4f123930edd9f.chunk.js.map → files.d39359992a53f54ac313.chunk.js.map} +1 -1
- package/dist/js/{home.cb32552573c36d11c060.chunk.js → home.18b2d4cefea087208045.chunk.js} +3 -3
- package/dist/js/home.18b2d4cefea087208045.chunk.js.gz +0 -0
- package/dist/js/{home.cb32552573c36d11c060.chunk.js.map → home.18b2d4cefea087208045.chunk.js.map} +1 -1
- package/dist/js/hubs.29f2e7fde513aa2aa81a.chunk.js +2 -0
- package/dist/js/hubs.29f2e7fde513aa2aa81a.chunk.js.gz +0 -0
- package/dist/js/hubs.29f2e7fde513aa2aa81a.chunk.js.map +1 -0
- package/dist/js/{main.3b934baf70d337403d14.entry.js → main.e2f715744e80ce3a09aa.entry.js} +3 -3
- package/dist/js/main.e2f715744e80ce3a09aa.entry.js.gz +0 -0
- package/dist/js/{main.3b934baf70d337403d14.entry.js.map → main.e2f715744e80ce3a09aa.entry.js.map} +1 -1
- package/dist/js/{queue.4095b1ea967e164737e6.chunk.js → queue.493c6d72a2e6d66362a3.chunk.js} +2 -2
- package/dist/js/queue.493c6d72a2e6d66362a3.chunk.js.gz +0 -0
- package/dist/js/queue.493c6d72a2e6d66362a3.chunk.js.map +1 -0
- package/dist/js/{search.09603a9268a2e311c83a.chunk.js → search.0eeea3bce388b8c304fb.chunk.js} +2 -2
- package/dist/js/search.0eeea3bce388b8c304fb.chunk.js.gz +0 -0
- package/dist/js/{search.09603a9268a2e311c83a.chunk.js.map → search.0eeea3bce388b8c304fb.chunk.js.map} +1 -1
- package/dist/js/settings.ae1be9e0a1c99eed7597.chunk.js +2 -0
- package/dist/js/settings.ae1be9e0a1c99eed7597.chunk.js.gz +0 -0
- package/dist/js/settings.ae1be9e0a1c99eed7597.chunk.js.map +1 -0
- package/dist/sw.js +1 -1
- package/dist/sw.js.gz +0 -0
- package/package.json +2 -2
- package/dist/js/223.6dbbf66031781a4daa16.chunk.js.gz +0 -0
- package/dist/js/223.6dbbf66031781a4daa16.chunk.js.map +0 -1
- package/dist/js/544.6fcb6173c1ecdce59463.chunk.js.gz +0 -0
- package/dist/js/616.56d33a82efa78946c57a.chunk.js.gz +0 -0
- package/dist/js/865.c7542b0bcc37a6936a89.chunk.js.gz +0 -0
- package/dist/js/favorite-hubs.6425452a7f964dff8ff7.chunk.js.gz +0 -0
- package/dist/js/filelists.2c58467089eca7c30a41.chunk.js.gz +0 -0
- package/dist/js/filelists.2c58467089eca7c30a41.chunk.js.map +0 -1
- package/dist/js/files.550bfdf4f123930edd9f.chunk.js.gz +0 -0
- package/dist/js/home.cb32552573c36d11c060.chunk.js.gz +0 -0
- package/dist/js/hubs.b3c262deaeaad16141dc.chunk.js +0 -2
- package/dist/js/hubs.b3c262deaeaad16141dc.chunk.js.gz +0 -0
- package/dist/js/hubs.b3c262deaeaad16141dc.chunk.js.map +0 -1
- package/dist/js/main.3b934baf70d337403d14.entry.js.gz +0 -0
- package/dist/js/queue.4095b1ea967e164737e6.chunk.js.gz +0 -0
- package/dist/js/queue.4095b1ea967e164737e6.chunk.js.map +0 -1
- package/dist/js/search.09603a9268a2e311c83a.chunk.js.gz +0 -0
- package/dist/js/settings.c1841f5755803ffad470.chunk.js +0 -2
- package/dist/js/settings.c1841f5755803ffad470.chunk.js.gz +0 -0
- package/dist/js/settings.c1841f5755803ffad470.chunk.js.map +0 -1
- /package/dist/js/{home.cb32552573c36d11c060.chunk.js.LICENSE.txt → home.18b2d4cefea087208045.chunk.js.LICENSE.txt} +0 -0
- /package/dist/js/{main.3b934baf70d337403d14.entry.js.LICENSE.txt → main.e2f715744e80ce3a09aa.entry.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[865],{59089:(e,t,s)=>{s.d(t,{A:()=>a});var n=s(71354),o=s.n(n),i=s(76314),r=s.n(i)()(o());r.push([e.id,".message-section {\n flex: 1;\n overflow-y: auto;\n}\n\n.message-list .date.divider i {\n margin-right: 5px;\n}\n\n.message-list .item .text .highlight.link {\n color: #4183c4;\n}\n\n.message-list .item .text .highlight.bold {\n font-weight: bold;\n}\n\n.message-list .item .text .table.dropdown,\n.message-list .item .text .table.dropdown .popup.trigger {\n max-width: 100%;\n}\n\n.message-list .item .text .table.dropdown .caption {\n overflow: hidden;\n}\n","",{version:3,sources:["webpack://./src/components/messages/messages.css"],names:[],mappings:"AAAA;EACE,OAAO;EACP,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;EAEE,eAAe;AACjB;;AAEA;EACE,gBAAgB;AAClB",sourcesContent:[".message-section {\n flex: 1;\n overflow-y: auto;\n}\n\n.message-list .date.divider i {\n margin-right: 5px;\n}\n\n.message-list .item .text .highlight.link {\n color: #4183c4;\n}\n\n.message-list .item .text .highlight.bold {\n font-weight: bold;\n}\n\n.message-list .item .text .table.dropdown,\n.message-list .item .text .table.dropdown .popup.trigger {\n max-width: 100%;\n}\n\n.message-list .item .text .table.dropdown .caption {\n overflow: hidden;\n}\n"],sourceRoot:""}]);const a=r},85865:(e,t,s)=>{s.d(t,{A:()=>X});var n=s(74848),o=s(96540),i=s(46942),r=s.n(i),a=s(99347),l=s(68443),d=s(71987),h=Object.defineProperty,c=(e,t,s)=>((e,t,s)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),g=new Map,p=new WeakMap,m=0;function u(e,t,s={},n=undefined){if(void 0===window.IntersectionObserver&&void 0!==n){const o=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof s.threshold?s.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),()=>{}}const{id:o,observer:i,elements:r}=function(e){const t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(s=e.root,s?(p.has(s)||(m+=1,p.set(s,m.toString())),p.get(s)):"0"):e[t]}`;var s})).toString()}(e);let s=g.get(t);if(!s){const n=new Map;let o;const i=new IntersectionObserver((t=>{t.forEach((t=>{var s;const i=t.isIntersecting&&o.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(s=n.get(t.target))||s.forEach((e=>{e(i,t)}))}))}),e);o=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),s={id:t,observer:i,elements:n},g.set(t,s)}return s}(s),a=r.get(e)||[];return r.has(e)||r.set(e,a),a.push(t),i.observe(e),function(){a.splice(a.indexOf(t),1),0===a.length&&(r.delete(e),i.unobserve(e)),0===r.size&&(i.disconnect(),g.delete(o))}}var b=class extends o.Component{constructor(e){super(e),c(this,"node",null),c(this,"_unobserveCb",null),c(this,"handleNode",(e=>{this.node&&(this.unobserve(),e||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()})),c(this,"handleChange",((e,t)=>{e&&this.props.triggerOnce&&this.unobserve(),function(e){return"function"!=typeof e.children}(this.props)||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t)})),this.state={inView:!!e.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:s,trackVisibility:n,delay:o,fallbackInView:i}=this.props;this._unobserveCb=u(this.node,this.handleChange,{threshold:e,root:t,rootMargin:s,trackVisibility:n,delay:o},i)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:e}=this.props;if("function"==typeof e){const{inView:t,entry:s}=this.state;return e({inView:t,entry:s,ref:this.handleNode})}const{as:t,triggerOnce:s,threshold:n,root:i,rootMargin:r,onChange:a,skip:l,trackVisibility:d,delay:h,initialInView:c,fallbackInView:g,...p}=this.props;return o.createElement(t||"div",{ref:this.handleNode,...p},e)}},f=s(71352),y=s(39115),v=s(74416);const A=({time:e})=>{const{formatTimestamp:t}=(0,v.k)();return(0,n.jsx)("div",{className:"time",children:t(e)})};var w=s(28122);const O=e=>{var{emojify:t,message:s,user:o,label:i,highlightMenuProps:r}=e,a=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]])}return s}(e,["emojify","message","user","label","highlightMenuProps"]);return(0,n.jsxs)("div",{className:"text",children:[!!i&&(0,n.jsx)("span",{className:"label",children:`${i}: `}),(0,n.jsx)(w.z,Object.assign({emojify:t,text:s.text,highlights:s.highlights,user:o,menuProps:r},a))]})};const x=({message:e,dropdownContext:t})=>(0,n.jsxs)("div",{className:"header author",children:[e.third_person&&(0,n.jsx)("span",{children:"*"}),(0,n.jsx)(f.Bg,{contextElement:t,triggerIcon:null,user:e.from,remoteMenuId:y.Ay.HUB_USER,entity:e.from.hub_session_id})]});class j extends o.Component{shouldComponentUpdate(){return!1}render(){const e=this.props,{message:t,dropdownContext:s,highlightMenuProps:o}=e,i=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]])}return s}(e,["message","dropdownContext","highlightMenuProps"]);return(0,n.jsxs)(b,Object.assign({className:r()("ui item chat",t.from.flags.join(" "))},i,{children:[(0,n.jsx)(A,{time:t.time}),(0,n.jsxs)("div",{className:r()("left",t.third_person?"third-person":"normal"),children:[(0,n.jsx)(x,{message:t,dropdownContext:s}),(0,n.jsx)(O,{message:t,emojify:!0,user:t.from,highlightMenuProps:o})]})]}))}}var C=s(83994),E=s(4425),M=s(86038);const P=e=>{switch(e){case M.F$.VERBOSE:return E.A.VERBOSE;case M.F$.INFO:return E.A.INFO+" circle";case M.F$.WARNING:return E.A.WARNING;case M.F$.ERROR:return E.A.ERROR;default:return""}};class I extends o.Component{shouldComponentUpdate(){return!1}render(){const e=this.props,{message:t,highlightMenuProps:s}=e,o=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]])}return s}(e,["message","highlightMenuProps"]);return(0,n.jsxs)(b,Object.assign({className:r()("ui item status",t.severity,t.type)},o,{children:[(0,n.jsx)(C.A,{icon:P(t.severity)}),t.time>0&&(0,n.jsx)(A,{time:t.time}),(0,n.jsx)(O,{label:t.label,message:t,emojify:!1,highlightMenuProps:s})]}))}}const N=e=>{var{message:t}=e,s=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]])}return s}(e,["message"]);return t.chat_message?(0,n.jsx)(j,Object.assign({message:t.chat_message,dropdownContext:s.highlightMenuProps.boundary},s)):t.log_message?(0,n.jsx)(I,Object.assign({message:t.log_message},s)):null},_=e=>{const t=e.chat_message?e.chat_message:e.log_message;return t&&new Date(1e3*t.time).getDate()},k=e=>!!e.log_message&&e.log_message.type===M.Lu.HISTORY,V=({time:e})=>{const{formatCalendarTime:t}=(0,v.k)();return(0,n.jsxs)("div",{className:"ui horizontal date divider",children:[(0,n.jsx)(C.A,{icon:E.A.DATE}),t(e)]},`divider${e}`)},R=({entity:e,onMessageVisibilityChanged:t,addDownload:s,highlightRemoteMenuId:o},i,r,a,l)=>{if(((e,t)=>{const s=t[e];return 0===e||1===e&&k(t[e-1])?_(s)!==(new Date).getDate()&&!k(s):_(t[e-1])!==_(s)})(a,l)){const e=r.chat_message?r.chat_message:r.log_message;e&&i.push((0,n.jsx)(V,{time:e.time},`divider${e.id}`))}const h=(0,d.Lw)(r);return i.push((0,n.jsx)(N,{id:(0,d.AS)(h),onChange:e=>{t(h,e)},threshold:.4,message:r,highlightMenuProps:{addDownload:s,entity:e,remoteMenuId:o,boundary:".message-section"}},h)),i};var S=s(42695),B=s(88544),D=s(67749),$=s(85072),F=s.n($),T=s(97825),G=s.n(T),U=s(77659),H=s.n(U),W=s(55056),z=s.n(W),L=s(10540),K=s.n(L),Y=s(41113),q=s.n(Y),J=s(59089),Q={};Q.styleTagTransform=q(),Q.setAttributes=z(),Q.insert=H().bind(null,"head"),Q.domAPI=G(),Q.insertStyleElement=K(),F()(J.A,Q),J.A&&J.A.locals&&J.A.locals;const X=o.memo((function(e){var{className:t,t:s}=e,i=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]])}return s}(e,["className","t"]);const d=(h=i.session,(0,o.useMemo)((()=>{const e={},t=t=>{const s=e[t];if(!s)throw new Error("Download was not found");return s};return{downloadDialogProps:{downloadHandler:(e,s,n,o)=>t(e.id).downloadHandler(e,s,n,o),userGetter:(e,s)=>{const n=t(e).userGetter;return n?n(e,s):void 0},itemDataGetter:(e,s)=>t(e).itemDataGetter(e,s),session:h},addDownloadItem:(t,s)=>{e[t]=s}}}),[]));var h;const{messageNodes:c,visibleItems:g}=(({highlightRemoteMenuId:e,messages:t,session:s},n)=>{const i=(0,o.useMemo)((()=>new Set),[s]),r=(e,t)=>{t?i.add(e):i.delete(e)};return{messageNodes:(0,o.useMemo)((()=>t?t.reduce(R.bind(null,{highlightRemoteMenuId:e,entity:s,onMessageVisibilityChanged:r,addDownload:n.addDownloadItem}),[]):null),[t]),visibleItems:i}})(i,d),p=(0,l.sg)(i,g);return(0,n.jsx)("div",{ref:p,className:r()("message-section",t),children:c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"ui list message-list",children:c}),(0,n.jsx)(B.A,Object.assign({},d.downloadDialogProps))]}):(0,n.jsx)(a.A,{text:(0,S.Tl)("Loading messages",s,D.KV.COMMON)})})}),((e,t)=>e.messages===t.messages))}}]);
|
|
2
|
-
//# sourceMappingURL=865.
|
|
2
|
+
//# sourceMappingURL=865.054628990bc0885af414.chunk.js.map
|
|
Binary file
|
package/dist/js/{865.c7542b0bcc37a6936a89.chunk.js.map → 865.054628990bc0885af414.chunk.js.map}
R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mB,IAAAjB,UAAQ,IACtBmB,EAIEA,EAASG,OACdzC,EAAsB0C,KAAK,KAAM,CAC/BvC,wBACAlC,OAAQiD,EACRjB,6BACAC,YAAae,EAAgBiB,kBAE/B,IAVO,MAYR,CAACI,IAIFD,eACD,EEtFwCM,CAAgBxF,EAAO8D,GAExD2B,GAAgB,QAA2BzF,EAAOkF,GAExD,OACE,gBAAK9F,IAAKqG,EAAehG,UAAW,IAAW,kBAAmBA,GAAU,SACvEwF,GACD,iCACE,gBAAKxF,UAAU,uBAAsB,SAAEwF,KACvC,SAACS,EAAA,EAAc,iBAAK5B,EAAgBQ,0BAGtC,SAACqB,EAAA,EAAM,CAACzF,MAAM,QAAU,mBAAoB2D,EAAG,KAAW+B,WAIlE,IACA,CAAC/G,EAAWgH,IACHhH,EAAUsG,WAAaU,EAAUV,U","sources":["webpack://airdcpp-webui/./src/components/messages/messages.css","webpack://airdcpp-webui/./node_modules/react-intersection-observer/dist/index.mjs","webpack://airdcpp-webui/./src/components/messages/message/Timestamp.tsx","webpack://airdcpp-webui/./src/components/messages/message/MessageText.tsx","webpack://airdcpp-webui/./src/components/messages/message/ChatMessage.tsx","webpack://airdcpp-webui/./src/components/messages/message/StatusMessage.tsx","webpack://airdcpp-webui/./src/components/messages/list/MessageListItem.tsx","webpack://airdcpp-webui/./src/components/messages/list/MessageListDateDivider.tsx","webpack://airdcpp-webui/./src/components/messages/effects/MessageNodeManager.tsx","webpack://airdcpp-webui/./src/components/messages/messages.css?1e0d","webpack://airdcpp-webui/./src/components/messages/MessageView.tsx","webpack://airdcpp-webui/./src/effects/ItemDownloadManager.tsx"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.message-section {\n flex: 1;\n overflow-y: auto;\n}\n\n.message-list .date.divider i {\n margin-right: 5px;\n}\n\n.message-list .item .text .highlight.link {\n color: #4183c4;\n}\n\n.message-list .item .text .highlight.bold {\n font-weight: bold;\n}\n\n.message-list .item .text .table.dropdown,\n.message-list .item .text .table.dropdown .popup.trigger {\n max-width: 100%;\n}\n\n.message-list .item .text .table.dropdown .caption {\n overflow: hidden;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/messages/messages.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,OAAO;EACP,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;EAEE,eAAe;AACjB;;AAEA;EACE,gBAAgB;AAClB\",\"sourcesContent\":[\".message-section {\\n flex: 1;\\n overflow-y: auto;\\n}\\n\\n.message-list .date.divider i {\\n margin-right: 5px;\\n}\\n\\n.message-list .item .text .highlight.link {\\n color: #4183c4;\\n}\\n\\n.message-list .item .text .highlight.bold {\\n font-weight: bold;\\n}\\n\\n.message-list .item .text .table.dropdown,\\n.message-list .item .text .table.dropdown .popup.trigger {\\n max-width: 100%;\\n}\\n\\n.message-list .item .text .table.dropdown .caption {\\n overflow: hidden;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = void 0;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a = elements.get(entry.target)) == null ? void 0 : _a.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a = state.entry) == null ? void 0 : _a.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView\n};\n//# sourceMappingURL=index.mjs.map","import * as React from 'react';\n\nimport { useFormatter } from 'context/FormatterContext';\n\ninterface TimeStampProps {\n time: number;\n}\n\nexport const TimeStamp: React.FC<TimeStampProps> = ({ time }) => {\n const { formatTimestamp } = useFormatter();\n return <div className=\"time\">{formatTimestamp(time)}</div>;\n};\n","import * as React from 'react';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport { HighlightedText } from '../../text/HighlightedText';\n\ninterface MessageTextProps {\n message: API.Message;\n emojify: boolean;\n user?: API.HubUser;\n label?: string;\n highlightMenuProps: UI.MessageActionMenuData;\n}\n\nexport const MessageText: React.FC<MessageTextProps> = ({\n emojify,\n message,\n user,\n label,\n highlightMenuProps,\n ...other\n}) => (\n <div className=\"text\">\n {!!label && <span className=\"label\">{`${label}: `}</span>}\n <HighlightedText\n emojify={emojify}\n text={message.text}\n highlights={message.highlights}\n user={user}\n menuProps={highlightMenuProps}\n {...other}\n />\n </div>\n);\n","import * as React from 'react';\nimport { InView } from 'react-intersection-observer';\n\nimport { UserMenu } from 'components/action-menu';\n\nimport * as API from 'types/api';\n\nimport MenuConstants from 'constants/MenuConstants';\nimport { CommonMessageProps } from '../types';\nimport { TimeStamp } from './Timestamp';\nimport { MessageText } from './MessageText';\nimport classNames from 'classnames';\n\ninterface AuthorProps {\n message: API.ChatMessage;\n dropdownContext: string;\n}\n\n// Message sections\nconst Author: React.FC<AuthorProps> = ({ message, dropdownContext }) => (\n <div className=\"header author\">\n {message.third_person && <span>*</span>}\n <UserMenu\n contextElement={dropdownContext}\n triggerIcon={null}\n user={message.from}\n remoteMenuId={MenuConstants.HUB_USER}\n entity={message.from.hub_session_id}\n />\n </div>\n);\n\ninterface ChatMessageProps extends CommonMessageProps {\n message: API.ChatMessage;\n dropdownContext: string;\n}\n\n// Main message types\nclass ChatMessage extends React.Component<ChatMessageProps> {\n shouldComponentUpdate() {\n return false;\n }\n\n render() {\n const { message, dropdownContext, highlightMenuProps, ...other } = this.props;\n\n return (\n <InView\n className={classNames('ui item chat', message.from.flags.join(' '))}\n {...other}\n >\n <TimeStamp time={message.time} />\n <div\n className={classNames('left', message.third_person ? 'third-person' : 'normal')}\n >\n <Author message={message} dropdownContext={dropdownContext} />\n <MessageText\n message={message}\n emojify={true}\n user={message.from}\n highlightMenuProps={highlightMenuProps}\n />\n </div>\n </InView>\n );\n }\n}\n\nexport { ChatMessage };\n","import classNames from 'classnames';\nimport { Component } from 'react';\nimport { InView } from 'react-intersection-observer';\n\nimport Icon from 'components/semantic/Icon';\nimport IconConstants from 'constants/IconConstants';\n\nimport * as API from 'types/api';\n\nimport { CommonMessageProps } from '../types';\nimport { MessageText } from './MessageText';\nimport { TimeStamp } from './Timestamp';\n\nconst getSeverityIcon = (severity: API.SeverityEnum) => {\n switch (severity) {\n case API.SeverityEnum.VERBOSE:\n return IconConstants.VERBOSE;\n case API.SeverityEnum.INFO:\n return IconConstants.INFO + ' circle';\n case API.SeverityEnum.WARNING:\n return IconConstants.WARNING;\n case API.SeverityEnum.ERROR:\n return IconConstants.ERROR;\n default:\n return '';\n }\n};\n\ninterface StatusMessageProps extends CommonMessageProps {\n message: API.StatusMessage;\n}\n\nclass StatusMessage extends Component<StatusMessageProps> {\n shouldComponentUpdate() {\n return false;\n }\n\n render() {\n const { message, highlightMenuProps, ...other } = this.props;\n return (\n <InView\n className={classNames('ui item status', message.severity, message.type)}\n {...other}\n >\n <Icon icon={getSeverityIcon(message.severity)} />\n {message.time > 0 && <TimeStamp time={message.time} />}\n <MessageText\n label={message.label}\n message={message}\n emojify={false}\n highlightMenuProps={highlightMenuProps}\n />\n </InView>\n );\n }\n}\n\nexport { StatusMessage };\n","import * as React from 'react';\n\nimport { ChatMessage, StatusMessage } from '../message';\n\nimport * as UI from 'types/ui';\nimport { CommonMessageProps } from '../types';\n\ninterface MessageListItemProps extends CommonMessageProps {\n id: string;\n message: UI.MessageListItem;\n}\n\nexport const MessageListItem: React.FC<MessageListItemProps> = ({\n message,\n ...other\n}) => {\n if (message.chat_message) {\n return (\n <ChatMessage\n message={message.chat_message}\n dropdownContext={other.highlightMenuProps.boundary}\n {...other}\n />\n );\n } else if (message.log_message) {\n return <StatusMessage message={message.log_message} {...other} />;\n }\n\n return null;\n};\n","import * as React from 'react';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport Icon from 'components/semantic/Icon';\nimport IconConstants from 'constants/IconConstants';\nimport { useFormatter } from 'context/FormatterContext';\n\nconst getMessageDay = (listItem: UI.MessageListItem) => {\n const message = !!listItem.chat_message ? listItem.chat_message : listItem.log_message;\n return message && new Date(message.time * 1000).getDate();\n};\n\nconst isToday = (message: UI.MessageListItem) => {\n return getMessageDay(message) === new Date().getDate();\n};\n\nconst isHistoryItem = (listItem: UI.MessageListItem) => {\n if (listItem.log_message) {\n return listItem.log_message.type === API.StatusMessageTypeEnum.HISTORY;\n }\n\n return false;\n};\n\nexport const showDateDivider = (index: number, messageList: UI.MessageListItem[]) => {\n const currentMessage = messageList[index];\n\n // First message? History log won't count\n if (index === 0 || (index === 1 && isHistoryItem(messageList[index - 1]))) {\n // Don't show for message that were received today\n if (!isToday(currentMessage) && !isHistoryItem(currentMessage)) {\n return true;\n }\n\n return false;\n }\n\n return getMessageDay(messageList[index - 1]) !== getMessageDay(currentMessage);\n};\n\ninterface MessageListDateDividerProps {\n time: number;\n}\n\nexport const MessageListDateDivider: React.FC<MessageListDateDividerProps> = ({\n time,\n}) => {\n const { formatCalendarTime } = useFormatter();\n return (\n <div key={`divider${time}`} className=\"ui horizontal date divider\">\n <Icon icon={IconConstants.DATE} />\n {formatCalendarTime(time)}\n </div>\n );\n};\n","import { useMemo } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport { getListMessageId, getListMessageIdString } from 'utils/MessageUtils';\r\n\r\nimport { MessageListItem } from '../list/MessageListItem';\r\nimport { MessageListDateDivider, showDateDivider } from '../list/MessageListDateDivider';\r\n\r\nimport { ItemDownloadManager } from '../../../effects/ItemDownloadManager';\r\n\r\ninterface MessageItemData {\r\n entity: UI.SessionItemBase | undefined;\r\n onMessageVisibilityChanged: (id: number, inView: boolean) => void;\r\n addDownload: UI.AddItemDownload;\r\n highlightRemoteMenuId: string | undefined;\r\n}\r\n\r\nconst reduceMessageListItem = (\r\n {\r\n entity,\r\n onMessageVisibilityChanged,\r\n addDownload,\r\n highlightRemoteMenuId,\r\n }: MessageItemData,\r\n reduced: React.ReactNode[],\r\n message: UI.MessageListItem,\r\n index: number,\r\n messageList: UI.MessageListItem[],\r\n) => {\r\n // Push a divider when the date was changed\r\n if (showDateDivider(index, messageList)) {\r\n const messageObj = !!message.chat_message\r\n ? message.chat_message\r\n : message.log_message;\r\n if (!!messageObj) {\r\n reduced.push(\r\n <MessageListDateDivider key={`divider${messageObj.id}`} time={messageObj.time} />,\r\n );\r\n }\r\n }\r\n\r\n // Push message\r\n const id = getListMessageId(message)!;\r\n reduced.push(\r\n <MessageListItem\r\n key={id}\r\n id={getListMessageIdString(id)}\r\n onChange={(inView) => {\r\n onMessageVisibilityChanged(id, inView);\r\n }}\r\n threshold={0.4}\r\n message={message}\r\n // Highlight menus must use table action menu because the text element has overflow: hidden\r\n // to allow long words to be cut (author action menu can still use the regular dropdown)\r\n highlightMenuProps={{\r\n addDownload,\r\n entity,\r\n remoteMenuId: highlightRemoteMenuId,\r\n boundary: '.message-section',\r\n // Determining the position is somewhat complex since the number of remote menu items isn't known at this point\r\n // Only use the boundary for now, could be improved later...\r\n // position: index < 4 ? 'bottom left' : 'top left',\r\n }}\r\n />,\r\n );\r\n\r\n return reduced;\r\n};\r\n\r\ninterface Props {\r\n messages: UI.MessageListItem[] | null;\r\n session?: UI.SessionItemBase;\r\n highlightRemoteMenuId?: string;\r\n}\r\n\r\nexport const useMessagesNode = (\r\n { highlightRemoteMenuId, messages, session }: Props,\r\n downloadManager: ItemDownloadManager<UI.DownloadableItemInfo, Props>,\r\n) => {\r\n const visibleItems = useMemo(() => new Set<number>(), [session]);\r\n\r\n const onMessageVisibilityChanged = (id: number, inView: boolean) => {\r\n if (!inView) {\r\n // console.log(`Remove view item ${id}`);\r\n visibleItems.delete(id);\r\n } else {\r\n // console.log(`Add view item ${id}`);\r\n visibleItems.add(id);\r\n }\r\n\r\n // console.log(`Visible items ${Array.from(visibleItems)}`);\r\n };\r\n\r\n const messageNodes = useMemo(() => {\r\n if (!messages) {\r\n return null;\r\n }\r\n\r\n return messages.reduce(\r\n reduceMessageListItem.bind(null, {\r\n highlightRemoteMenuId,\r\n entity: session,\r\n onMessageVisibilityChanged,\r\n addDownload: downloadManager.addDownloadItem,\r\n }),\r\n [],\r\n );\r\n }, [messages]);\r\n\r\n return {\r\n messageNodes,\r\n visibleItems,\r\n };\r\n};\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./messages.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./messages.css\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nimport Loader from 'components/semantic/Loader';\r\n\r\nimport { useMessageViewScrollEffect } from 'effects';\r\nimport { useMessagesNode } from './effects/MessageNodeManager';\r\nimport { useItemDownloadManager } from '../../effects/ItemDownloadManager';\r\nimport { translate } from 'utils/TranslationUtils';\r\n\r\nimport DownloadDialog from 'components/download/DownloadDialog';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport './messages.css';\r\n\r\ninterface MessageViewProps {\r\n messages: UI.MessageListItem[] | null;\r\n session?: UI.SessionItemBase;\r\n className?: string;\r\n scrollPositionHandler: UI.ScrollPositionHandler;\r\n highlightRemoteMenuId?: string;\r\n t: UI.TranslateF;\r\n}\r\n\r\nconst MessageView: React.FC<MessageViewProps> = React.memo(\r\n function MessageView({ className, t, ...other }) {\r\n const downloadManager = useItemDownloadManager(other.session);\r\n const { messageNodes, visibleItems } = useMessagesNode(other, downloadManager);\r\n\r\n const scrollableRef = useMessageViewScrollEffect(other, visibleItems);\r\n\r\n return (\r\n <div ref={scrollableRef} className={classNames('message-section', className)}>\r\n {!!messageNodes ? (\r\n <>\r\n <div className=\"ui list message-list\">{messageNodes}</div>\r\n <DownloadDialog {...downloadManager.downloadDialogProps} />\r\n </>\r\n ) : (\r\n <Loader text={translate('Loading messages', t, UI.Modules.COMMON)} />\r\n )}\r\n </div>\r\n );\r\n },\r\n (prevProps, nextProps) => {\r\n return prevProps.messages === nextProps.messages;\r\n },\r\n);\r\n\r\nexport default MessageView;\r\n","import { useMemo } from 'react';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nexport interface ItemDownloadManager<\r\n ItemT extends UI.DownloadableItemInfo,\r\n PropsT extends object,\r\n> {\r\n addDownloadItem: UI.AddItemDownload<ItemT, PropsT>;\r\n downloadDialogProps: UI.ItemDownloadHandler<ItemT, PropsT>;\r\n}\r\n\r\nexport const useItemDownloadManager = <\r\n ItemT extends UI.DownloadableItemInfo,\r\n PropsT extends object,\r\n>(\r\n session: UI.SessionItemBase | undefined,\r\n) => {\r\n const downloadManager = useMemo<ItemDownloadManager<ItemT, PropsT>>(() => {\r\n const downloads: { [key in string]: UI.ItemDownloadHandler<ItemT, PropsT> } = {};\r\n\r\n const getDownloadItem = (itemId: API.IdType) => {\r\n const item = downloads[itemId];\r\n if (!item) {\r\n throw new Error('Download was not found');\r\n }\r\n\r\n return item;\r\n };\r\n\r\n const ret: ItemDownloadManager<ItemT, PropsT> = {\r\n downloadDialogProps: {\r\n downloadHandler: (itemInfo, user, downloadData, downloadSession) => {\r\n return getDownloadItem(itemInfo.id).downloadHandler(\r\n itemInfo,\r\n user,\r\n downloadData,\r\n downloadSession,\r\n );\r\n },\r\n userGetter: (itemId, props) => {\r\n const userGetter = getDownloadItem(itemId).userGetter;\r\n return !!userGetter ? userGetter(itemId, props) : undefined;\r\n },\r\n itemDataGetter: (itemId, socket) => {\r\n return getDownloadItem(itemId).itemDataGetter(itemId, socket);\r\n },\r\n session,\r\n },\r\n addDownloadItem: (itemId, itemDownloadHandler) => {\r\n downloads[itemId] = itemDownloadHandler;\r\n },\r\n };\r\n\r\n return ret;\r\n }, []);\r\n\r\n return downloadManager;\r\n};\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","__defProp","Object","defineProperty","__publicField","obj","key","value","enumerable","configurable","writable","__defNormalProp","observerMap","Map","RootIds","WeakMap","rootId","observe","element","callback","options","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","target","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","observer","elements","keys","sort","filter","map","root","has","set","toString","get","optionsToId","instance","thresholds","entries","forEach","entry","_a","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","splice","indexOf","length","delete","unobserve","size","disconnect","InView","constructor","props","super","this","node","triggerOnce","skip","setState","initialInView","observeNode","children","isPlainChildren","onChange","state","componentDidMount","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_unobserveCb","handleChange","render","ref","handleNode","as","TimeStamp","formatTimestamp","className","MessageText","emojify","message","user","label","highlightMenuProps","other","HighlightedText","text","highlights","menuProps","Author","dropdownContext","third_person","contextElement","triggerIcon","from","remoteMenuId","MenuConstants","HUB_USER","entity","hub_session_id","ChatMessage","shouldComponentUpdate","flags","join","getSeverityIcon","severity","VERBOSE","IconConstants","INFO","WARNING","ERROR","StatusMessage","Component","type","Icon","icon","MessageListItem","chat_message","boundary","log_message","getMessageDay","listItem","Date","getDate","isHistoryItem","HISTORY","MessageListDateDivider","formatCalendarTime","DATE","reduceMessageListItem","onMessageVisibilityChanged","addDownload","highlightRemoteMenuId","reduced","index","messageList","currentMessage","showDateDivider","messageObj","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","t","downloadManager","session","useMemo","downloads","getDownloadItem","itemId","item","Error","downloadDialogProps","downloadHandler","itemInfo","downloadData","downloadSession","userGetter","undefined","itemDataGetter","socket","addDownloadItem","itemDownloadHandler","messageNodes","visibleItems","messages","Set","add","reduce","bind","useMessagesNode","scrollableRef","DownloadDialog","Loader","COMMON","nextProps"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/865.054628990bc0885af414.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,qdAyBtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,oDAAoD,MAAQ,GAAG,SAAW,wJAAwJ,eAAiB,CAAC,sdAAsd,WAAa,MAErvB,S,kHC/BIC,EAAYC,OAAOC,eAEnBC,EAAgB,CAACC,EAAKC,EAAKC,IADT,EAACF,EAAKC,EAAKC,IAAUD,KAAOD,EAAMJ,EAAUI,EAAKC,EAAK,CAAEE,YAAY,EAAMC,cAAc,EAAMC,UAAU,EAAMH,UAAWF,EAAIC,GAAOC,EACjHI,CAAgBN,EAAoB,iBAARC,EAAmBA,EAAM,GAAKA,EAAKC,GAMpGK,EAA8B,IAAIC,IAClCC,EAA0B,IAAIC,QAC9BC,EAAS,EA+Cb,SAASC,EAAQC,EAASC,EAAUC,EAAU,CAAC,EAAGC,EA9C3B,WA+CrB,QAA2C,IAAhCC,OAAOC,2BAA2D,IAAnBF,EAA2B,CACnF,MAAMG,EAASN,EAAQO,wBAUvB,OATAN,EAASE,EAAgB,CACvBK,eAAgBL,EAChBM,OAAQT,EACRU,kBAAgD,iBAAtBR,EAAQS,UAAyBT,EAAQS,UA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,EAAgBC,GAAQU,eAAeV,EAAQW,GAExDf,WAEFgB,gBAAiB,CAACZ,EAAQa,KACxBf,EAAUE,GAAUa,CAAmB,EAIjC,GACT,KA3CiC,IAIpCjB,EDWE,MAAM,aAAEkB,EAAY,aAAEC,GFiDK,GAC3BlC,wBAAuBmC,WAAUpB,WACnCD,KAEA,MAAMoB,GAAe,IAAAlB,UAAQ,IAAM,IAAIoB,KAAe,CAACrB,IAEjDjB,EAA6B,CAACrJ,EAAYoD,KACzCA,EAKHqI,EAAaG,IAAI5L,GAHjByL,EAAa1H,OAAO/D,EAItB,EAqBF,MAAO,CACLwL,cAjBmB,IAAAjB,UAAQ,IACtBmB,EAIEA,EAASG,OACdzC,EAAsB0C,KAAK,KAAM,CAC/BvC,wBACAlC,OAAQiD,EACRjB,6BACAC,YAAae,EAAgBiB,kBAE/B,IAVO,MAYR,CAACI,IAIFD,eACD,EEtFwCM,CAAgBxF,EAAO8D,GAExD2B,GAAgB,QAA2BzF,EAAOkF,GAExD,OACE,gBAAK9F,IAAKqG,EAAehG,UAAW,IAAW,kBAAmBA,GAAU,SACvEwF,GACD,iCACE,gBAAKxF,UAAU,uBAAsB,SAAEwF,KACvC,SAACS,EAAA,EAAc,iBAAK5B,EAAgBQ,0BAGtC,SAACqB,EAAA,EAAM,CAACzF,MAAM,QAAU,mBAAoB2D,EAAG,KAAW+B,WAIlE,IACA,CAAC/G,EAAWgH,IACHhH,EAAUsG,WAAaU,EAAUV,U","sources":["webpack://airdcpp-webui/./src/components/messages/messages.css","webpack://airdcpp-webui/./node_modules/react-intersection-observer/dist/index.mjs","webpack://airdcpp-webui/./src/components/messages/message/Timestamp.tsx","webpack://airdcpp-webui/./src/components/messages/message/MessageText.tsx","webpack://airdcpp-webui/./src/components/messages/message/ChatMessage.tsx","webpack://airdcpp-webui/./src/components/messages/message/StatusMessage.tsx","webpack://airdcpp-webui/./src/components/messages/list/MessageListItem.tsx","webpack://airdcpp-webui/./src/components/messages/list/MessageListDateDivider.tsx","webpack://airdcpp-webui/./src/components/messages/effects/MessageNodeManager.tsx","webpack://airdcpp-webui/./src/components/messages/messages.css?1e0d","webpack://airdcpp-webui/./src/components/messages/MessageView.tsx","webpack://airdcpp-webui/./src/effects/ItemDownloadManager.tsx"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.message-section {\n flex: 1;\n overflow-y: auto;\n}\n\n.message-list .date.divider i {\n margin-right: 5px;\n}\n\n.message-list .item .text .highlight.link {\n color: #4183c4;\n}\n\n.message-list .item .text .highlight.bold {\n font-weight: bold;\n}\n\n.message-list .item .text .table.dropdown,\n.message-list .item .text .table.dropdown .popup.trigger {\n max-width: 100%;\n}\n\n.message-list .item .text .table.dropdown .caption {\n overflow: hidden;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/messages/messages.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,OAAO;EACP,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;;EAEE,eAAe;AACjB;;AAEA;EACE,gBAAgB;AAClB\",\"sourcesContent\":[\".message-section {\\n flex: 1;\\n overflow-y: auto;\\n}\\n\\n.message-list .date.divider i {\\n margin-right: 5px;\\n}\\n\\n.message-list .item .text .highlight.link {\\n color: #4183c4;\\n}\\n\\n.message-list .item .text .highlight.bold {\\n font-weight: bold;\\n}\\n\\n.message-list .item .text .table.dropdown,\\n.message-list .item .text .table.dropdown .popup.trigger {\\n max-width: 100%;\\n}\\n\\n.message-list .item .text .table.dropdown .caption {\\n overflow: hidden;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = void 0;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a = elements.get(entry.target)) == null ? void 0 : _a.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a = state.entry) == null ? void 0 : _a.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView\n};\n//# sourceMappingURL=index.mjs.map","import * as React from 'react';\n\nimport { useFormatter } from 'context/FormatterContext';\n\ninterface TimeStampProps {\n time: number;\n}\n\nexport const TimeStamp: React.FC<TimeStampProps> = ({ time }) => {\n const { formatTimestamp } = useFormatter();\n return <div className=\"time\">{formatTimestamp(time)}</div>;\n};\n","import * as React from 'react';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport { HighlightedText } from '../../text/HighlightedText';\n\ninterface MessageTextProps {\n message: API.Message;\n emojify: boolean;\n user?: API.HubUser;\n label?: string;\n highlightMenuProps: UI.MessageActionMenuData;\n}\n\nexport const MessageText: React.FC<MessageTextProps> = ({\n emojify,\n message,\n user,\n label,\n highlightMenuProps,\n ...other\n}) => (\n <div className=\"text\">\n {!!label && <span className=\"label\">{`${label}: `}</span>}\n <HighlightedText\n emojify={emojify}\n text={message.text}\n highlights={message.highlights}\n user={user}\n menuProps={highlightMenuProps}\n {...other}\n />\n </div>\n);\n","import * as React from 'react';\nimport { InView } from 'react-intersection-observer';\n\nimport { UserMenu } from 'components/action-menu';\n\nimport * as API from 'types/api';\n\nimport MenuConstants from 'constants/MenuConstants';\nimport { CommonMessageProps } from '../types';\nimport { TimeStamp } from './Timestamp';\nimport { MessageText } from './MessageText';\nimport classNames from 'classnames';\n\ninterface AuthorProps {\n message: API.ChatMessage;\n dropdownContext: string;\n}\n\n// Message sections\nconst Author: React.FC<AuthorProps> = ({ message, dropdownContext }) => (\n <div className=\"header author\">\n {message.third_person && <span>*</span>}\n <UserMenu\n contextElement={dropdownContext}\n triggerIcon={null}\n user={message.from}\n remoteMenuId={MenuConstants.HUB_USER}\n entity={message.from.hub_session_id}\n />\n </div>\n);\n\ninterface ChatMessageProps extends CommonMessageProps {\n message: API.ChatMessage;\n dropdownContext: string;\n}\n\n// Main message types\nclass ChatMessage extends React.Component<ChatMessageProps> {\n shouldComponentUpdate() {\n return false;\n }\n\n render() {\n const { message, dropdownContext, highlightMenuProps, ...other } = this.props;\n\n return (\n <InView\n className={classNames('ui item chat', message.from.flags.join(' '))}\n {...other}\n >\n <TimeStamp time={message.time} />\n <div\n className={classNames('left', message.third_person ? 'third-person' : 'normal')}\n >\n <Author message={message} dropdownContext={dropdownContext} />\n <MessageText\n message={message}\n emojify={true}\n user={message.from}\n highlightMenuProps={highlightMenuProps}\n />\n </div>\n </InView>\n );\n }\n}\n\nexport { ChatMessage };\n","import classNames from 'classnames';\nimport { Component } from 'react';\nimport { InView } from 'react-intersection-observer';\n\nimport Icon from 'components/semantic/Icon';\nimport IconConstants from 'constants/IconConstants';\n\nimport * as API from 'types/api';\n\nimport { CommonMessageProps } from '../types';\nimport { MessageText } from './MessageText';\nimport { TimeStamp } from './Timestamp';\n\nconst getSeverityIcon = (severity: API.SeverityEnum) => {\n switch (severity) {\n case API.SeverityEnum.VERBOSE:\n return IconConstants.VERBOSE;\n case API.SeverityEnum.INFO:\n return IconConstants.INFO + ' circle';\n case API.SeverityEnum.WARNING:\n return IconConstants.WARNING;\n case API.SeverityEnum.ERROR:\n return IconConstants.ERROR;\n default:\n return '';\n }\n};\n\ninterface StatusMessageProps extends CommonMessageProps {\n message: API.StatusMessage;\n}\n\nclass StatusMessage extends Component<StatusMessageProps> {\n shouldComponentUpdate() {\n return false;\n }\n\n render() {\n const { message, highlightMenuProps, ...other } = this.props;\n return (\n <InView\n className={classNames('ui item status', message.severity, message.type)}\n {...other}\n >\n <Icon icon={getSeverityIcon(message.severity)} />\n {message.time > 0 && <TimeStamp time={message.time} />}\n <MessageText\n label={message.label}\n message={message}\n emojify={false}\n highlightMenuProps={highlightMenuProps}\n />\n </InView>\n );\n }\n}\n\nexport { StatusMessage };\n","import * as React from 'react';\n\nimport { ChatMessage, StatusMessage } from '../message';\n\nimport * as UI from 'types/ui';\nimport { CommonMessageProps } from '../types';\n\ninterface MessageListItemProps extends CommonMessageProps {\n id: string;\n message: UI.MessageListItem;\n}\n\nexport const MessageListItem: React.FC<MessageListItemProps> = ({\n message,\n ...other\n}) => {\n if (message.chat_message) {\n return (\n <ChatMessage\n message={message.chat_message}\n dropdownContext={other.highlightMenuProps.boundary}\n {...other}\n />\n );\n } else if (message.log_message) {\n return <StatusMessage message={message.log_message} {...other} />;\n }\n\n return null;\n};\n","import * as React from 'react';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport Icon from 'components/semantic/Icon';\nimport IconConstants from 'constants/IconConstants';\nimport { useFormatter } from 'context/FormatterContext';\n\nconst getMessageDay = (listItem: UI.MessageListItem) => {\n const message = !!listItem.chat_message ? listItem.chat_message : listItem.log_message;\n return message && new Date(message.time * 1000).getDate();\n};\n\nconst isToday = (message: UI.MessageListItem) => {\n return getMessageDay(message) === new Date().getDate();\n};\n\nconst isHistoryItem = (listItem: UI.MessageListItem) => {\n if (listItem.log_message) {\n return listItem.log_message.type === API.StatusMessageTypeEnum.HISTORY;\n }\n\n return false;\n};\n\nexport const showDateDivider = (index: number, messageList: UI.MessageListItem[]) => {\n const currentMessage = messageList[index];\n\n // First message? History log won't count\n if (index === 0 || (index === 1 && isHistoryItem(messageList[index - 1]))) {\n // Don't show for message that were received today\n if (!isToday(currentMessage) && !isHistoryItem(currentMessage)) {\n return true;\n }\n\n return false;\n }\n\n return getMessageDay(messageList[index - 1]) !== getMessageDay(currentMessage);\n};\n\ninterface MessageListDateDividerProps {\n time: number;\n}\n\nexport const MessageListDateDivider: React.FC<MessageListDateDividerProps> = ({\n time,\n}) => {\n const { formatCalendarTime } = useFormatter();\n return (\n <div key={`divider${time}`} className=\"ui horizontal date divider\">\n <Icon icon={IconConstants.DATE} />\n {formatCalendarTime(time)}\n </div>\n );\n};\n","import { useMemo } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport { getListMessageId, getListMessageIdString } from 'utils/MessageUtils';\r\n\r\nimport { MessageListItem } from '../list/MessageListItem';\r\nimport { MessageListDateDivider, showDateDivider } from '../list/MessageListDateDivider';\r\n\r\nimport { ItemDownloadManager } from '../../../effects/ItemDownloadManager';\r\n\r\ninterface MessageItemData {\r\n entity: UI.SessionItemBase | undefined;\r\n onMessageVisibilityChanged: (id: number, inView: boolean) => void;\r\n addDownload: UI.AddItemDownload;\r\n highlightRemoteMenuId: string | undefined;\r\n}\r\n\r\nconst reduceMessageListItem = (\r\n {\r\n entity,\r\n onMessageVisibilityChanged,\r\n addDownload,\r\n highlightRemoteMenuId,\r\n }: MessageItemData,\r\n reduced: React.ReactNode[],\r\n message: UI.MessageListItem,\r\n index: number,\r\n messageList: UI.MessageListItem[],\r\n) => {\r\n // Push a divider when the date was changed\r\n if (showDateDivider(index, messageList)) {\r\n const messageObj = !!message.chat_message\r\n ? message.chat_message\r\n : message.log_message;\r\n if (!!messageObj) {\r\n reduced.push(\r\n <MessageListDateDivider key={`divider${messageObj.id}`} time={messageObj.time} />,\r\n );\r\n }\r\n }\r\n\r\n // Push message\r\n const id = getListMessageId(message)!;\r\n reduced.push(\r\n <MessageListItem\r\n key={id}\r\n id={getListMessageIdString(id)}\r\n onChange={(inView) => {\r\n onMessageVisibilityChanged(id, inView);\r\n }}\r\n threshold={0.4}\r\n message={message}\r\n // Highlight menus must use table action menu because the text element has overflow: hidden\r\n // to allow long words to be cut (author action menu can still use the regular dropdown)\r\n highlightMenuProps={{\r\n addDownload,\r\n entity,\r\n remoteMenuId: highlightRemoteMenuId,\r\n boundary: '.message-section',\r\n // Determining the position is somewhat complex since the number of remote menu items isn't known at this point\r\n // Only use the boundary for now, could be improved later...\r\n // position: index < 4 ? 'bottom left' : 'top left',\r\n }}\r\n />,\r\n );\r\n\r\n return reduced;\r\n};\r\n\r\ninterface Props {\r\n messages: UI.MessageListItem[] | null;\r\n session?: UI.SessionItemBase;\r\n highlightRemoteMenuId?: string;\r\n}\r\n\r\nexport const useMessagesNode = (\r\n { highlightRemoteMenuId, messages, session }: Props,\r\n downloadManager: ItemDownloadManager<UI.DownloadableItemInfo, Props>,\r\n) => {\r\n const visibleItems = useMemo(() => new Set<number>(), [session]);\r\n\r\n const onMessageVisibilityChanged = (id: number, inView: boolean) => {\r\n if (!inView) {\r\n // console.log(`Remove view item ${id}`);\r\n visibleItems.delete(id);\r\n } else {\r\n // console.log(`Add view item ${id}`);\r\n visibleItems.add(id);\r\n }\r\n\r\n // console.log(`Visible items ${Array.from(visibleItems)}`);\r\n };\r\n\r\n const messageNodes = useMemo(() => {\r\n if (!messages) {\r\n return null;\r\n }\r\n\r\n return messages.reduce(\r\n reduceMessageListItem.bind(null, {\r\n highlightRemoteMenuId,\r\n entity: session,\r\n onMessageVisibilityChanged,\r\n addDownload: downloadManager.addDownloadItem,\r\n }),\r\n [],\r\n );\r\n }, [messages]);\r\n\r\n return {\r\n messageNodes,\r\n visibleItems,\r\n };\r\n};\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./messages.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./messages.css\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nimport Loader from 'components/semantic/Loader';\r\n\r\nimport { useMessageViewScrollEffect } from 'effects';\r\nimport { useMessagesNode } from './effects/MessageNodeManager';\r\nimport { useItemDownloadManager } from '../../effects/ItemDownloadManager';\r\nimport { translate } from 'utils/TranslationUtils';\r\n\r\nimport DownloadDialog from 'components/download/DownloadDialog';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport './messages.css';\r\n\r\ninterface MessageViewProps {\r\n messages: UI.MessageListItem[] | null;\r\n session?: UI.SessionItemBase;\r\n className?: string;\r\n scrollPositionHandler: UI.ScrollPositionHandler;\r\n highlightRemoteMenuId?: string;\r\n t: UI.TranslateF;\r\n}\r\n\r\nconst MessageView: React.FC<MessageViewProps> = React.memo(\r\n function MessageView({ className, t, ...other }) {\r\n const downloadManager = useItemDownloadManager(other.session);\r\n const { messageNodes, visibleItems } = useMessagesNode(other, downloadManager);\r\n\r\n const scrollableRef = useMessageViewScrollEffect(other, visibleItems);\r\n\r\n return (\r\n <div ref={scrollableRef} className={classNames('message-section', className)}>\r\n {!!messageNodes ? (\r\n <>\r\n <div className=\"ui list message-list\">{messageNodes}</div>\r\n <DownloadDialog {...downloadManager.downloadDialogProps} />\r\n </>\r\n ) : (\r\n <Loader text={translate('Loading messages', t, UI.Modules.COMMON)} />\r\n )}\r\n </div>\r\n );\r\n },\r\n (prevProps, nextProps) => {\r\n return prevProps.messages === nextProps.messages;\r\n },\r\n);\r\n\r\nexport default MessageView;\r\n","import { useMemo } from 'react';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nexport interface ItemDownloadManager<\r\n ItemT extends UI.DownloadableItemInfo,\r\n PropsT extends object,\r\n> {\r\n addDownloadItem: UI.AddItemDownload<ItemT, PropsT>;\r\n downloadDialogProps: UI.ItemDownloadHandler<ItemT, PropsT>;\r\n}\r\n\r\nexport const useItemDownloadManager = <\r\n ItemT extends UI.DownloadableItemInfo,\r\n PropsT extends object,\r\n>(\r\n session: UI.SessionItemBase | undefined,\r\n) => {\r\n const downloadManager = useMemo<ItemDownloadManager<ItemT, PropsT>>(() => {\r\n const downloads: { [key in string]: UI.ItemDownloadHandler<ItemT, PropsT> } = {};\r\n\r\n const getDownloadItem = (itemId: API.IdType) => {\r\n const item = downloads[itemId];\r\n if (!item) {\r\n throw new Error('Download was not found');\r\n }\r\n\r\n return item;\r\n };\r\n\r\n const ret: ItemDownloadManager<ItemT, PropsT> = {\r\n downloadDialogProps: {\r\n downloadHandler: (itemInfo, user, downloadData, downloadSession) => {\r\n return getDownloadItem(itemInfo.id).downloadHandler(\r\n itemInfo,\r\n user,\r\n downloadData,\r\n downloadSession,\r\n );\r\n },\r\n userGetter: (itemId, props) => {\r\n const userGetter = getDownloadItem(itemId).userGetter;\r\n return !!userGetter ? userGetter(itemId, props) : undefined;\r\n },\r\n itemDataGetter: (itemId, socket) => {\r\n return getDownloadItem(itemId).itemDataGetter(itemId, socket);\r\n },\r\n session,\r\n },\r\n addDownloadItem: (itemId, itemDownloadHandler) => {\r\n downloads[itemId] = itemDownloadHandler;\r\n },\r\n };\r\n\r\n return ret;\r\n }, []);\r\n\r\n return downloadManager;\r\n};\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","__defProp","Object","defineProperty","__publicField","obj","key","value","enumerable","configurable","writable","__defNormalProp","observerMap","Map","RootIds","WeakMap","rootId","observe","element","callback","options","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","target","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","observer","elements","keys","sort","filter","map","root","has","set","toString","get","optionsToId","instance","thresholds","entries","forEach","entry","_a","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","splice","indexOf","length","delete","unobserve","size","disconnect","InView","constructor","props","super","this","node","triggerOnce","skip","setState","initialInView","observeNode","children","isPlainChildren","onChange","state","componentDidMount","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_unobserveCb","handleChange","render","ref","handleNode","as","TimeStamp","formatTimestamp","className","MessageText","emojify","message","user","label","highlightMenuProps","other","HighlightedText","text","highlights","menuProps","Author","dropdownContext","third_person","contextElement","triggerIcon","from","remoteMenuId","MenuConstants","HUB_USER","entity","hub_session_id","ChatMessage","shouldComponentUpdate","flags","join","getSeverityIcon","severity","VERBOSE","IconConstants","INFO","WARNING","ERROR","StatusMessage","Component","type","Icon","icon","MessageListItem","chat_message","boundary","log_message","getMessageDay","listItem","Date","getDate","isHistoryItem","HISTORY","MessageListDateDivider","formatCalendarTime","DATE","reduceMessageListItem","onMessageVisibilityChanged","addDownload","highlightRemoteMenuId","reduced","index","messageList","currentMessage","showDateDivider","messageObj","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","t","downloadManager","session","useMemo","downloads","getDownloadItem","itemId","item","Error","downloadDialogProps","downloadHandler","itemInfo","downloadData","downloadSession","userGetter","undefined","itemDataGetter","socket","addDownloadItem","itemDownloadHandler","messageNodes","visibleItems","messages","Set","add","reduce","bind","useMessagesNode","scrollableRef","DownloadDialog","Loader","COMMON","nextProps"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[580],{23896:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(71354),r=n.n(a),o=n(76314),i=n.n(o)()(r());i.push([e.id,".virtual-table .cell-wrapper.connected,\n.virtual-table .cell-wrapper.connected span,\n.virtual-table .cell-wrapper.connected strong {\n color: green;\n}\n\n.virtual-table .cell-wrapper.connecting,\n.virtual-table .cell-wrapper.connecting span,\n.virtual-table .cell-wrapper.connecting strong {\n color: orange;\n}\n\n.virtual-table .cell-wrapper.disconnected,\n.virtual-table .cell-wrapper.disconnected span,\n.virtual-table .cell-wrapper.disconnected strong {\n color: dimslategray;\n}\n","",{version:3,sources:["webpack://./src/routes/FavoriteHubs/style.css"],names:[],mappings:"AAAA;;;EAGE,YAAY;AACd;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;;EAGE,mBAAmB;AACrB",sourcesContent:[".virtual-table .cell-wrapper.connected,\n.virtual-table .cell-wrapper.connected span,\n.virtual-table .cell-wrapper.connected strong {\n color: green;\n}\n\n.virtual-table .cell-wrapper.connecting,\n.virtual-table .cell-wrapper.connecting span,\n.virtual-table .cell-wrapper.connecting strong {\n color: orange;\n}\n\n.virtual-table .cell-wrapper.disconnected,\n.virtual-table .cell-wrapper.disconnected span,\n.virtual-table .cell-wrapper.disconnected strong {\n color: dimslategray;\n}\n"],sourceRoot:""}]);const s=i},86818:(e,t,n)=>{n.d(t,{A:()=>r});const a="share_profiles",r={MODULE_URL:a,PROFILES_URL:a,PROFILE_ADDED:"share_profile_added",PROFILE_UPDATED:"share_profile_updated",PROFILE_REMOVED:"share_profile_removed",HIDDEN_PROFILE_ID:1}},71299:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(2543),r=n(86818),o=n(56484);const i=function(e,t,n){return(0,o.A)(e,(0,a.merge)(n,{urls:{profiles:r.A.PROFILES_URL},dataConverters:{profiles:(e,{t:n})=>e.filter((e=>t||e.id!==r.A.HIDDEN_PROFILE_ID))},onSocketConnected:(e,{refetchData:t})=>{e(r.A.MODULE_URL,r.A.PROFILE_ADDED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_UPDATED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_REMOVED,(()=>t()))}}))}},54248:(e,t,n)=>{n.r(t),n.d(t,{default:()=>fe});var a=n(74848),r=n(96540),o=n(22005),i=n.n(o);const s="favorite_hubs",c=s,l=s;var d=n(52267);const p=i().createStore({_viewName:"favorite_hub_view",_apiUrl:c,mixins:[(0,d.A)("name")]});var u=n(99671),v=n(65385),m=n(86818),h=n(71299),A=n(4425),E=n(51766),_=n(94413),y=n(47456),O=n(86038);const f=({locals:e})=>{const t=(0,r.useRef)(null);return(0,r.useEffect)((()=>{t.current&&("boolean"==typeof e.value?t.current.indeterminate=!1:t.current.indeterminate=!0)}),[e.value]),(0,a.jsx)("input",Object.assign({ref:t,type:"checkbox"},e.attrs,{onChange:t=>{!1===e.value?e.onChange(null):e.onChange(t.target.checked)}}))},I={renderCheckbox:e=>(0,a.jsx)(f,{locals:e})},w=E.Ay.form.Form.templates.checkbox.clone(I);var b=n(19430),D=n(74416);const g=[{id:O.uu.DISABLED,name:"Disabled"},{id:O.uu.ACTIVE_MODE,name:"Active mode"},{id:O.uu.PASSIVE_MODE,name:"Passive mode"}],T=[{key:"generic",title:"Hub properties",type:O.OP.STRUCT,definitions:[{key:"name",title:"Name",type:O.OP.STRING},{key:"hub_url",title:"Hub URL",type:O.OP.STRING},{key:"hub_description",title:"Hub description",type:O.OP.STRING,optional:!0},{key:"share_profile",title:"Share profile",type:O.OP.NUMBER,help:"Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)",optional:!0},{key:"auto_connect",title:"Auto connect",type:O.OP.BOOLEAN}]},{key:"user",title:"User setting overrides",type:O.OP.STRUCT,definitions:[{key:"nick",title:"Nick",type:O.OP.STRING,optional:!0},{key:"user_description",title:"User description",type:O.OP.STRING,optional:!0}]},{key:"connectivityV4",title:"Connectivity setting overrides (IPv4)",type:O.OP.STRUCT,definitions:[{key:"connection_mode_v4",title:"Connectivity mode",type:O.OP.NUMBER,optional:!0,options:g},{key:"connection_ip_v4",title:"IP address",type:O.OP.STRING,optional:!0}]},{key:"connectivityV6",title:"Connectivity setting overrides (IPv6)",type:O.OP.STRUCT,definitions:[{key:"connection_mode_v6",title:"Connectivity mode",type:O.OP.NUMBER,optional:!0,options:g},{key:"connection_ip_v6",title:"IP address",type:O.OP.STRING,optional:!0}]},{key:"misc",title:"Miscellaneous overrides",type:O.OP.STRUCT,definitions:[{key:"use_main_chat_notify",title:"Use chat notification",type:O.OP.BOOLEAN,optional:!0},{key:"show_joins",title:"Show joins/parts",type:O.OP.BOOLEAN,optional:!0},{key:"away_message",title:"Away message",type:O.OP.TEXT,optional:!0}]}],R=e=>!!e&&(e.startsWith("adc://")||e.startsWith("adcs://")),S=(e,t,n)=>e.filter((e=>R(t)||e.id===m.A.HIDDEN_PROFILE_ID)).map((e=>(0,b.T)(e,n))).map(y.UM),N=(0,v.A)((0,h.A)((({hubEntry:e,favT:t,profiles:n,socket:o})=>{const i=(0,D.k)(),s=(0,r.useMemo)((()=>(e=>{if(e)return{generic:e,user:e,connectivityV4:e,connectivityV6:e,misc:e}})(e)),[]),c=(0,r.useMemo)((()=>(0,y.Nn)(T,t)),[]),d=(0,r.useMemo)((()=>({value:"null",text:t.translate("Global default")})),[]),p=!e,v=(0,r.useRef)(null),{translate:h}=t,O=h(p?"Add favorite hub":"Edit favorite hub");return(0,a.jsx)(u.A,{className:"fav-hub",title:O,onApprove:()=>v.current.save(),closable:!1,icon:A.A.FAVORITE,children:(0,a.jsx)(_.A,{ref:v,onFieldChanged:(e,t,n)=>e.includes("hub_url")&&!R(t.generic.hub_url)&&t.share_profile!==m.A.HIDDEN_PROFILE_ID?Promise.resolve({share_profile:null}):null,onFieldSetting:(e,t,a)=>{if("share_profile"===e){const e=a.generic?a.generic.hub_url:void 0;Object.assign(t,{nullOption:d,factory:E.Ay.form.Select,options:S(n,e,i),transformer:y.xs})}else"connection_mode_v4"===e||"connection_mode_v6"===e?Object.assign(t,{nullOption:d,transformer:y.xs}):"use_main_chat_notify"!==e&&"show_joins"!==e||Object.assign(t,{template:w,transformer:{format:e=>void 0===e?null:e,parse:e=>e}})},onSave:t=>{const n=(a=t,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a.generic),a.user),a.connectivityV4),a.connectivityV6),a.misc));var a;return p?o.post(l,n):o.patch(`${l}/${e.id}`,n)},fieldDefinitions:c,sourceValue:s})})}),!0,{urls:{hubEntry:({params:e},t)=>e.entryId?t.get(`${l}/${e.entryId}`):Promise.resolve(void 0)}}),"entries/:entryId?");var C=n(22373),P=n(68465),U=n(44247),k=n(46942),V=n.n(k),j=n(90680),x=n(36453),F=n(83994),L=n(67553);const B=e=>{switch(e.id){case O.uv.CONNECTING:return"yellow remove";case O.uv.CONNECTED:return"grey remove";case O.uv.DISCONNECTED:return"green video play"}return""},H=({width:e,cellData:t,rowDataGetter:n})=>{const r=(0,L.zy)(),o=(0,L.Zp)(),i=()=>{j.A.createSession(n().hub_url,{location:r,navigate:o,sessionStore:x.A})},s=()=>{j.A.removeSession({id:t.current_hub_id})};return(0,a.jsxs)("div",{className:"connect-state",children:[(0,a.jsx)(F.A,{icon:V()("icon large link",B(t)),onClick:(()=>{switch(t.id){case O.uv.CONNECTING:case O.uv.CONNECTED:return s;case O.uv.DISCONNECTED:default:return i}})()}),e>120&&t.str]})};var G=n(71352),M=n(85072),K=n.n(M),$=n(97825),W=n.n($),z=n(77659),Y=n.n(z),J=n(55056),X=n.n(J),Z=n(10540),q=n.n(Z),Q=n(41113),ee=n.n(Q),te=n(23896),ne={};ne.styleTagTransform=ee(),ne.setAttributes=X(),ne.insert=Y().bind(null,"head"),ne.domAPI=W(),ne.insertStyleElement=q(),K()(te.A,ne),te.A&&te.A.locals&&te.A.locals;var ae=n(67749),re=n(42695),oe=n(32389),ie=n(32811),se=n(36076),ce=n(39115);const le={create:{id:"create",displayName:"Add new",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.CREATE,handler:({navigate:e})=>{e("/favorite-hubs/entries")}}},de={edit:{id:"edit",displayName:"Edit",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.EDIT,handler:({itemData:e,navigate:t})=>{t(`/favorite-hubs/entries/${e.id}`)}},remove:{id:"remove",displayName:"Remove",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the favorite hub {{item.name}}?",approveCaption:"Remove favorite hub",rejectCaption:"Don't remove"},handler:({itemData:e,socket:t})=>t.delete(l+"/"+e.id)}},pe={moduleId:ae.KV.FAVORITE_HUBS},ue={moduleData:pe,actions:de},ve={moduleData:pe,actions:le},me=(e,t,n)=>e.patch(l+"/"+t.id,{password:n}),he=({itemData:e,socket:t},n)=>me(t,e,n),Ae=({itemData:e})=>e.has_password,Ee={create:{id:"create",displayName:"Set password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.LOCK,filter:e=>!Ae(e),input:{content:"Set password for the hub {{item.name}}",approveCaption:"Set password",inputProps:{placeholder:"Enter password",type:"password"}},handler:he},change:{id:"change",displayName:"Change password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.EDIT,filter:Ae,input:{content:"Enter new password for the hub {{item.name}}",approveCaption:"Update password",inputProps:{placeholder:"Enter password",type:"password"}},handler:he},remove:{id:"remove",displayName:"Remove password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.REMOVE,filter:Ae,confirmation:{content:"Are you sure that you want to reset the password of the hub {{item.name}}?",approveCaption:"Remove password",rejectCaption:"Don't remove"},handler:({itemData:e,socket:t})=>me(t,e,null)}},_e={moduleData:{moduleId:ae.KV.FAVORITE_HUBS,subId:"password"},actions:Ee};var ye=n(28286);const Oe=({cellData:e,rowDataGetter:t,t:n})=>(0,a.jsx)(G.yj,{caption:e?(0,a.jsx)("strong",{children:(0,re.Tl)("Set",n,ae.KV.FAVORITE_HUBS)}):(0,re.Tl)("Not set",n,ae.KV.FAVORITE_HUBS),actions:_e,itemData:t}),fe=()=>{const{t:e}=(0,oe.Bd)(),t=(0,re.lw)(e,ae.KV.FAVORITE_HUBS),{hasAccess:n}=(0,ye.w)(),{translate:r}=t,o=n(O.US.HUBS_EDIT);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(C.A,{rowClassNameGetter:e=>{switch(e.connect_state.id){case O.uv.CONNECTING:return"connecting";case O.uv.CONNECTED:return"connected";case O.uv.DISCONNECTED:return"disconnected"}return""},footerData:(0,a.jsx)(G.Wy,{className:"top left pointing",caption:r("Actions..."),actions:ve,header:r("Favorite hub actions"),triggerIcon:"chevron up",button:!0,remoteMenuId:"favorite_hubs",direction:"upward"}),store:p,moduleId:ae.KV.FAVORITE_HUBS,children:[(0,a.jsx)(P.VP,{name:"State",width:45,columnKey:"connect_state",cell:o?(0,a.jsx)(H,{}):void 0,flexGrow:3}),(0,a.jsx)(P.VP,{name:"Name",width:150,columnKey:"name",flexGrow:6,cell:(0,a.jsx)(U.K,{actions:ue,remoteMenuId:ce.Ay.FAVORITE_HUB})}),(0,a.jsx)(P.VP,{name:"Address",width:270,columnKey:"hub_url",flexGrow:3,hideWidth:700}),(0,a.jsx)(P.VP,{name:"Auto connect",width:65,columnKey:"auto_connect",cell:o?(0,a.jsx)(U.AJ,{onChange:(t,n)=>(0,se.bd)((()=>{return e=n,a={auto_connect:t},ie.A.patch(l+"/"+e.id,a);var e,a}),e),type:"toggle"}):void 0}),(0,a.jsx)(P.VP,{name:"Share profile",width:100,columnKey:"share_profile",flexGrow:1}),(0,a.jsx)(P.VP,{name:"Nick",width:100,columnKey:"nick",flexGrow:1}),(0,a.jsx)(P.VP,{name:"Password",width:100,columnKey:"has_password",cell:(0,a.jsx)(Oe,{})})]}),(0,a.jsx)(N,{favT:t})]})}},19430:(e,t,n)=>{n.d(t,{T:()=>o,v:()=>r});var a=n(86818);const r=(e,{formatSize:t})=>{let n=e.str;return e.id!==a.A.HIDDEN_PROFILE_ID&&(n+=` (${t(e.size)})`),n},o=(e,t)=>({id:e.id,name:r(e,t)})}}]);
|
|
2
|
-
//# sourceMappingURL=favorite-hubs.
|
|
1
|
+
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[580],{23896:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(71354),r=n.n(a),o=n(76314),i=n.n(o)()(r());i.push([e.id,".virtual-table .cell-wrapper.connected,\n.virtual-table .cell-wrapper.connected span,\n.virtual-table .cell-wrapper.connected strong {\n color: green;\n}\n\n.virtual-table .cell-wrapper.connecting,\n.virtual-table .cell-wrapper.connecting span,\n.virtual-table .cell-wrapper.connecting strong {\n color: orange;\n}\n\n.virtual-table .cell-wrapper.disconnected,\n.virtual-table .cell-wrapper.disconnected span,\n.virtual-table .cell-wrapper.disconnected strong {\n color: dimslategray;\n}\n","",{version:3,sources:["webpack://./src/routes/FavoriteHubs/style.css"],names:[],mappings:"AAAA;;;EAGE,YAAY;AACd;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;;EAGE,mBAAmB;AACrB",sourcesContent:[".virtual-table .cell-wrapper.connected,\n.virtual-table .cell-wrapper.connected span,\n.virtual-table .cell-wrapper.connected strong {\n color: green;\n}\n\n.virtual-table .cell-wrapper.connecting,\n.virtual-table .cell-wrapper.connecting span,\n.virtual-table .cell-wrapper.connecting strong {\n color: orange;\n}\n\n.virtual-table .cell-wrapper.disconnected,\n.virtual-table .cell-wrapper.disconnected span,\n.virtual-table .cell-wrapper.disconnected strong {\n color: dimslategray;\n}\n"],sourceRoot:""}]);const s=i},86818:(e,t,n)=>{n.d(t,{A:()=>r});const a="share_profiles",r={MODULE_URL:a,PROFILES_URL:a,PROFILE_ADDED:"share_profile_added",PROFILE_UPDATED:"share_profile_updated",PROFILE_REMOVED:"share_profile_removed",HIDDEN_PROFILE_ID:1}},71299:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(2543),r=n(86818),o=n(56484);const i=function(e,t,n){return(0,o.A)(e,(0,a.merge)(n,{urls:{profiles:r.A.PROFILES_URL},dataConverters:{profiles:(e,{t:n})=>e.filter((e=>t||e.id!==r.A.HIDDEN_PROFILE_ID))},onSocketConnected:(e,{refetchData:t})=>{e(r.A.MODULE_URL,r.A.PROFILE_ADDED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_UPDATED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_REMOVED,(()=>t()))}}))}},54248:(e,t,n)=>{n.r(t),n.d(t,{default:()=>fe});var a=n(74848),r=n(96540),o=n(22005),i=n.n(o);const s="favorite_hubs",c=s,l=s;var d=n(52267);const p=i().createStore({_viewName:"favorite_hub_view",_apiUrl:c,mixins:[(0,d.A)("name")]});var u=n(99671),v=n(65385),m=n(86818),h=n(71299),A=n(4425),E=n(51766),_=n(94413),y=n(47456),O=n(86038);const f=({locals:e})=>{const t=(0,r.useRef)(null);return(0,r.useEffect)((()=>{t.current&&("boolean"==typeof e.value?t.current.indeterminate=!1:t.current.indeterminate=!0)}),[e.value]),(0,a.jsx)("input",Object.assign({ref:t,type:"checkbox"},e.attrs,{onChange:t=>{!1===e.value?e.onChange(null):e.onChange(t.target.checked)}}))},I={renderCheckbox:e=>(0,a.jsx)(f,{locals:e})},w=E.Ay.form.Form.templates.checkbox.clone(I);var b=n(19430),D=n(74416);const g=[{id:O.uu.DISABLED,name:"Disabled"},{id:O.uu.ACTIVE_MODE,name:"Active mode"},{id:O.uu.PASSIVE_MODE,name:"Passive mode"}],T=[{key:"generic",title:"Hub properties",type:O.OP.STRUCT,definitions:[{key:"name",title:"Name",type:O.OP.STRING},{key:"hub_url",title:"Hub URL",type:O.OP.STRING},{key:"hub_description",title:"Hub description",type:O.OP.STRING,optional:!0},{key:"share_profile",title:"Share profile",type:O.OP.NUMBER,help:"Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)",optional:!0},{key:"auto_connect",title:"Auto connect",type:O.OP.BOOLEAN}]},{key:"user",title:"User setting overrides",type:O.OP.STRUCT,definitions:[{key:"nick",title:"Nick",type:O.OP.STRING,optional:!0},{key:"user_description",title:"User description",type:O.OP.STRING,optional:!0}]},{key:"connectivityV4",title:"Connectivity setting overrides (IPv4)",type:O.OP.STRUCT,definitions:[{key:"connection_mode_v4",title:"Connectivity mode",type:O.OP.NUMBER,optional:!0,options:g},{key:"connection_ip_v4",title:"IP address",type:O.OP.STRING,optional:!0}]},{key:"connectivityV6",title:"Connectivity setting overrides (IPv6)",type:O.OP.STRUCT,definitions:[{key:"connection_mode_v6",title:"Connectivity mode",type:O.OP.NUMBER,optional:!0,options:g},{key:"connection_ip_v6",title:"IP address",type:O.OP.STRING,optional:!0}]},{key:"misc",title:"Miscellaneous overrides",type:O.OP.STRUCT,definitions:[{key:"use_main_chat_notify",title:"Use chat notification",type:O.OP.BOOLEAN,optional:!0},{key:"show_joins",title:"Show joins/parts",type:O.OP.BOOLEAN,optional:!0},{key:"away_message",title:"Away message",type:O.OP.TEXT,optional:!0}]}],R=e=>!!e&&(e.startsWith("adc://")||e.startsWith("adcs://")),S=(e,t,n)=>e.filter((e=>R(t)||e.id===m.A.HIDDEN_PROFILE_ID)).map((e=>(0,b.T)(e,n))).map(y.UM),N=(0,v.A)((0,h.A)((({hubEntry:e,favT:t,profiles:n,socket:o})=>{const i=(0,D.k)(),s=(0,r.useMemo)((()=>(e=>{if(e)return{generic:e,user:e,connectivityV4:e,connectivityV6:e,misc:e}})(e)),[]),c=(0,r.useMemo)((()=>(0,y.Nn)(T,t)),[]),d=(0,r.useMemo)((()=>({value:"null",text:t.translate("Global default")})),[]),p=!e,v=(0,r.useRef)(null),{translate:h}=t,O=h(p?"Add favorite hub":"Edit favorite hub");return(0,a.jsx)(u.A,{className:"fav-hub",title:O,onApprove:()=>v.current.save(),closable:!1,icon:A.A.FAVORITE,children:(0,a.jsx)(_.A,{ref:v,onFieldChanged:(e,t,n)=>e.includes("hub_url")&&!R(t.generic.hub_url)&&t.share_profile!==m.A.HIDDEN_PROFILE_ID?Promise.resolve({share_profile:null}):null,onFieldSetting:(e,t,a)=>{if("share_profile"===e){const e=a.generic?a.generic.hub_url:void 0;Object.assign(t,{nullOption:d,factory:E.Ay.form.Select,options:S(n,e,i),transformer:y.xs})}else"connection_mode_v4"===e||"connection_mode_v6"===e?Object.assign(t,{nullOption:d,transformer:y.xs}):"use_main_chat_notify"!==e&&"show_joins"!==e||Object.assign(t,{template:w,transformer:{format:e=>void 0===e?null:e,parse:e=>e}})},onSave:t=>{const n=(a=t,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a.generic),a.user),a.connectivityV4),a.connectivityV6),a.misc));var a;return p?o.post(l,n):o.patch(`${l}/${e.id}`,n)},fieldDefinitions:c,sourceValue:s})})}),!0,{urls:{hubEntry:({params:e},t)=>e.entryId?t.get(`${l}/${e.entryId}`):Promise.resolve(void 0)}}),"entries/:entryId?");var C=n(22373),P=n(68465),U=n(44247),k=n(46942),V=n.n(k),j=n(90680),x=n(36453),F=n(83994),L=n(14753);const B=e=>{switch(e.id){case O.uv.CONNECTING:return"yellow remove";case O.uv.CONNECTED:return"grey remove";case O.uv.DISCONNECTED:return"green video play"}return""},H=({width:e,cellData:t,rowDataGetter:n})=>{const r=(0,L.zy)(),o=(0,L.Zp)(),i=()=>{j.A.createSession(n().hub_url,{location:r,navigate:o,sessionStore:x.A})},s=()=>{j.A.removeSession({id:t.current_hub_id})};return(0,a.jsxs)("div",{className:"connect-state",children:[(0,a.jsx)(F.A,{icon:V()("icon large link",B(t)),onClick:(()=>{switch(t.id){case O.uv.CONNECTING:case O.uv.CONNECTED:return s;case O.uv.DISCONNECTED:default:return i}})()}),e>120&&t.str]})};var G=n(71352),M=n(85072),K=n.n(M),$=n(97825),W=n.n($),z=n(77659),Y=n.n(z),J=n(55056),X=n.n(J),Z=n(10540),q=n.n(Z),Q=n(41113),ee=n.n(Q),te=n(23896),ne={};ne.styleTagTransform=ee(),ne.setAttributes=X(),ne.insert=Y().bind(null,"head"),ne.domAPI=W(),ne.insertStyleElement=q(),K()(te.A,ne),te.A&&te.A.locals&&te.A.locals;var ae=n(67749),re=n(42695),oe=n(32389),ie=n(32811),se=n(36076),ce=n(39115);const le={create:{id:"create",displayName:"Add new",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.CREATE,handler:({navigate:e})=>{e("/favorite-hubs/entries")}}},de={edit:{id:"edit",displayName:"Edit",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.EDIT,handler:({itemData:e,navigate:t})=>{t(`/favorite-hubs/entries/${e.id}`)}},remove:{id:"remove",displayName:"Remove",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the favorite hub {{item.name}}?",approveCaption:"Remove favorite hub",rejectCaption:"Don't remove"},handler:({itemData:e,socket:t})=>t.delete(l+"/"+e.id)}},pe={moduleId:ae.KV.FAVORITE_HUBS},ue={moduleData:pe,actions:de},ve={moduleData:pe,actions:le},me=(e,t,n)=>e.patch(l+"/"+t.id,{password:n}),he=({itemData:e,socket:t},n)=>me(t,e,n),Ae=({itemData:e})=>e.has_password,Ee={create:{id:"create",displayName:"Set password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.LOCK,filter:e=>!Ae(e),input:{content:"Set password for the hub {{item.name}}",approveCaption:"Set password",inputProps:{placeholder:"Enter password",type:"password"}},handler:he},change:{id:"change",displayName:"Change password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.EDIT,filter:Ae,input:{content:"Enter new password for the hub {{item.name}}",approveCaption:"Update password",inputProps:{placeholder:"Enter password",type:"password"}},handler:he},remove:{id:"remove",displayName:"Remove password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.REMOVE,filter:Ae,confirmation:{content:"Are you sure that you want to reset the password of the hub {{item.name}}?",approveCaption:"Remove password",rejectCaption:"Don't remove"},handler:({itemData:e,socket:t})=>me(t,e,null)}},_e={moduleData:{moduleId:ae.KV.FAVORITE_HUBS,subId:"password"},actions:Ee};var ye=n(28286);const Oe=({cellData:e,rowDataGetter:t,t:n})=>(0,a.jsx)(G.yj,{caption:e?(0,a.jsx)("strong",{children:(0,re.Tl)("Set",n,ae.KV.FAVORITE_HUBS)}):(0,re.Tl)("Not set",n,ae.KV.FAVORITE_HUBS),actions:_e,itemData:t}),fe=()=>{const{t:e}=(0,oe.Bd)(),t=(0,re.lw)(e,ae.KV.FAVORITE_HUBS),{hasAccess:n}=(0,ye.w)(),{translate:r}=t,o=n(O.US.HUBS_EDIT);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(C.A,{rowClassNameGetter:e=>{switch(e.connect_state.id){case O.uv.CONNECTING:return"connecting";case O.uv.CONNECTED:return"connected";case O.uv.DISCONNECTED:return"disconnected"}return""},footerData:(0,a.jsx)(G.Wy,{className:"top left pointing",caption:r("Actions..."),actions:ve,header:r("Favorite hub actions"),triggerIcon:"chevron up",button:!0,remoteMenuId:"favorite_hubs",direction:"upward"}),store:p,moduleId:ae.KV.FAVORITE_HUBS,children:[(0,a.jsx)(P.VP,{name:"State",width:45,columnKey:"connect_state",cell:o?(0,a.jsx)(H,{}):void 0,flexGrow:3}),(0,a.jsx)(P.VP,{name:"Name",width:150,columnKey:"name",flexGrow:6,cell:(0,a.jsx)(U.K,{actions:ue,remoteMenuId:ce.Ay.FAVORITE_HUB})}),(0,a.jsx)(P.VP,{name:"Address",width:270,columnKey:"hub_url",flexGrow:3,hideWidth:700}),(0,a.jsx)(P.VP,{name:"Auto connect",width:65,columnKey:"auto_connect",cell:o?(0,a.jsx)(U.AJ,{onChange:(t,n)=>(0,se.bd)((()=>{return e=n,a={auto_connect:t},ie.A.patch(l+"/"+e.id,a);var e,a}),e),type:"toggle"}):void 0}),(0,a.jsx)(P.VP,{name:"Share profile",width:100,columnKey:"share_profile",flexGrow:1}),(0,a.jsx)(P.VP,{name:"Nick",width:100,columnKey:"nick",flexGrow:1}),(0,a.jsx)(P.VP,{name:"Password",width:100,columnKey:"has_password",cell:(0,a.jsx)(Oe,{})})]}),(0,a.jsx)(N,{favT:t})]})}},19430:(e,t,n)=>{n.d(t,{T:()=>o,v:()=>r});var a=n(86818);const r=(e,{formatSize:t})=>{let n=e.str;return e.id!==a.A.HIDDEN_PROFILE_ID&&(n+=` (${t(e.size)})`),n},o=(e,t)=>({id:e.id,name:r(e,t)})}}]);
|
|
2
|
+
//# sourceMappingURL=favorite-hubs.d0c1452419e4f6e34765.chunk.js.map
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js/favorite-hubs.6425452a7f964dff8ff7.chunk.js","mappings":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ACVG,UAAW,OAEb,SAAC,KAAM,CACLvK,KAAK,eACLoF,MAAO,GACP8E,UAAU,eACVC,KACEf,GACE,SAAC,KAAY,CAAClK,SAlEE,CAACG,EAAkBmK,KACtC,UACL,KACEgB,OC9DNnD,ED8DwBmC,EC7DxB7L,ED6DiC,CACzB8M,aAAcpL,GC5DfqL,GAAA,EAAcjG,MAAMrG,EAAgC,IAAMiJ,EAAIxK,GAAIc,GAJ1C,IAC/B0J,EACA1J,CD+DQ,GACJC,GA4DqDoB,KAAK,gBAChD4E,KAGR,SAAC,KAAM,CAAC5D,KAAK,gBAAgBoF,MAAO,IAAK8E,UAAU,gBAAgBE,SAAU,KAC7E,SAAC,KAAM,CAACpK,KAAK,OAAOoF,MAAO,IAAK8E,UAAU,OAAOE,SAAU,KAC3D,SAAC,KAAM,CACLpK,KAAK,WACLoF,MAAO,IACP8E,UAAU,eACVC,MAAM,SAAClB,GAAY,UAGvB,SAAC,EAAiB,CAACvH,KAAMA,MAE5B,C,0DE5II,MAAMiJ,EAA4B,CACvCC,GACEC,iBAEF,IAAIzE,EAAMwE,EAAQxE,IAKlB,OAJIwE,EAAQ/N,KAAO,IAAsBM,oBACvCiJ,GAAO,KAAKyE,EAAWD,EAAQE,UAG1B1E,CAAG,EAGC2E,EAAqB,CAACH,EAA2BxJ,KACrD,CACLvE,GAAI+N,EAAQ/N,GACZmD,KAAM2K,EAA0BC,EAASxJ,I","sources":["webpack://airdcpp-webui/./src/routes/FavoriteHubs/style.css","webpack://airdcpp-webui/./src/constants/ShareProfileConstants.ts","webpack://airdcpp-webui/./src/decorators/ShareProfileDecorator.tsx","webpack://airdcpp-webui/./src/constants/FavoriteHubConstants.ts","webpack://airdcpp-webui/./src/stores/views/FavoriteHubStore.js","webpack://airdcpp-webui/./src/components/form/fields/IndeterminateCheckboxField.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubDialog.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/ConnectStateCell.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/style.css?f7f3","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubActions.ts","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubPasswordActions.ts","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubs.tsx","webpack://airdcpp-webui/./src/services/api/FavoriteHubApi.ts","webpack://airdcpp-webui/./src/utils/ShareProfileUtils.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.virtual-table .cell-wrapper.connected,\n.virtual-table .cell-wrapper.connected span,\n.virtual-table .cell-wrapper.connected strong {\n color: green;\n}\n\n.virtual-table .cell-wrapper.connecting,\n.virtual-table .cell-wrapper.connecting span,\n.virtual-table .cell-wrapper.connecting strong {\n color: orange;\n}\n\n.virtual-table .cell-wrapper.disconnected,\n.virtual-table .cell-wrapper.disconnected span,\n.virtual-table .cell-wrapper.disconnected strong {\n color: dimslategray;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/FavoriteHubs/style.css\"],\"names\":[],\"mappings\":\"AAAA;;;EAGE,YAAY;AACd;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;;EAGE,mBAAmB;AACrB\",\"sourcesContent\":[\".virtual-table .cell-wrapper.connected,\\n.virtual-table .cell-wrapper.connected span,\\n.virtual-table .cell-wrapper.connected strong {\\n color: green;\\n}\\n\\n.virtual-table .cell-wrapper.connecting,\\n.virtual-table .cell-wrapper.connecting span,\\n.virtual-table .cell-wrapper.connecting strong {\\n color: orange;\\n}\\n\\n.virtual-table .cell-wrapper.disconnected,\\n.virtual-table .cell-wrapper.disconnected span,\\n.virtual-table .cell-wrapper.disconnected strong {\\n color: dimslategray;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","const MODULE_URL = 'share_profiles';\nexport default {\n MODULE_URL: MODULE_URL,\n PROFILES_URL: MODULE_URL,\n\n PROFILE_ADDED: 'share_profile_added',\n PROFILE_UPDATED: 'share_profile_updated',\n PROFILE_REMOVED: 'share_profile_removed',\n\n HIDDEN_PROFILE_ID: 1,\n};\n","import * as React from 'react';\r\nimport { merge } from 'lodash';\r\n\r\nimport ShareProfileConstants from 'constants/ShareProfileConstants';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n DataProviderDecoratorSettings,\r\n DataConverter,\r\n} from 'decorators/DataProviderDecorator';\r\n\r\nimport * as API from 'types/api';\r\n\r\ninterface ShareProfileDecoratorDataProps {\r\n profiles: API.ShareProfile[];\r\n}\r\n\r\nexport type ShareProfileDecoratorChildProps = DataProviderDecoratorChildProps &\r\n ShareProfileDecoratorDataProps;\r\n\r\nconst ShareProfileDecorator = function <PropsT extends object>(\r\n Component: React.ComponentType<PropsT & ShareProfileDecoratorChildProps>,\r\n listHidden: boolean,\r\n dataProviderDecoratorSettings?: DataProviderDecoratorSettings<\r\n PropsT,\r\n ShareProfileDecoratorDataProps\r\n >,\r\n) {\r\n const convertProfiles: DataConverter<PropsT> = (data: API.ShareProfile[], { t }) => {\r\n const profiles = data.filter(\r\n (p) => listHidden || p.id !== ShareProfileConstants.HIDDEN_PROFILE_ID,\r\n );\r\n\r\n return profiles;\r\n };\r\n\r\n return DataProviderDecorator<PropsT, ShareProfileDecoratorDataProps>(\r\n Component,\r\n merge(dataProviderDecoratorSettings, {\r\n urls: {\r\n profiles: ShareProfileConstants.PROFILES_URL,\r\n },\r\n dataConverters: {\r\n profiles: convertProfiles,\r\n },\r\n onSocketConnected: (addSocketListener, { refetchData }) => {\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_ADDED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_UPDATED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_REMOVED,\r\n () => refetchData(),\r\n );\r\n },\r\n } as DataProviderDecoratorSettings<PropsT, ShareProfileDecoratorDataProps>),\r\n );\r\n};\r\n\r\nexport default ShareProfileDecorator;\r\n","const MODULE_URL = 'favorite_hubs';\n\nexport default {\n MODULE_URL: MODULE_URL,\n HUBS_URL: MODULE_URL,\n};\n","import Reflux from 'reflux';\n\nimport FavoriteHubConstants from 'constants/FavoriteHubConstants';\nimport ViewStoreMixin from 'mixins/ViewStoreMixin';\n\nexport default Reflux.createStore({\n _viewName: 'favorite_hub_view',\n _apiUrl: FavoriteHubConstants.MODULE_URL,\n mixins: [ViewStoreMixin('name')],\n});\n","import { useEffect, useRef } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport * as UI from 'types/ui';\r\nimport t from 'utils/tcomb-form';\r\n\r\ninterface IndeterminateCheckboxProps {\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>;\r\n}\r\n\r\nconst IndeterminateCheckbox: React.FC<IndeterminateCheckboxProps> = ({ locals }) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (!inputRef.current) {\r\n return;\r\n }\r\n\r\n if (typeof locals.value === 'boolean') {\r\n inputRef.current.indeterminate = false;\r\n } else {\r\n inputRef.current.indeterminate = true;\r\n }\r\n }, [locals.value]);\r\n\r\n return (\r\n <input\r\n ref={inputRef}\r\n type=\"checkbox\"\r\n {...locals.attrs}\r\n onChange={(evt) => {\r\n // Toggle between true/false/indeterminate\r\n if (locals.value === false) {\r\n locals.onChange(null);\r\n } else {\r\n locals.onChange(evt.target.checked);\r\n }\r\n }}\r\n />\r\n );\r\n};\r\n\r\ntype TCombTemplate = {\r\n renderCheckbox: (\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>,\r\n ) => React.ReactNode;\r\n};\r\n\r\nconst IndeterminateCheckboxTemplate: TCombTemplate = {\r\n renderCheckbox(locals) {\r\n return <IndeterminateCheckbox locals={locals} />;\r\n },\r\n};\r\n\r\nexport const IndeterminateCheckboxField = t.form.Form.templates.checkbox.clone(\r\n IndeterminateCheckboxTemplate,\r\n);\r\n","import { useMemo, useRef } from 'react';\r\nimport RouteModal from 'components/semantic/RouteModal';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from 'decorators/ModalRouteDecorator';\r\n\r\nimport ShareProfileConstants from 'constants/ShareProfileConstants';\r\nimport FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\n\r\nimport ShareProfileDecorator, {\r\n ShareProfileDecoratorChildProps,\r\n} from 'decorators/ShareProfileDecorator';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport Form, {\r\n FormFieldChangeHandler,\r\n FormFieldSettingHandler,\r\n FormSaveHandler,\r\n} from 'components/form/Form';\r\nimport { normalizeEnumValue, intTransformer, translateForm } from 'utils/FormUtils';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { FavoriteHubEntry } from 'types/api';\r\nimport { IndeterminateCheckboxField } from 'components/form/fields/IndeterminateCheckboxField';\r\nimport { profileToEnumValue } from 'utils/ShareProfileUtils';\r\nimport { Formatter, useFormatter } from 'context/FormatterContext';\r\n\r\nconst ConnectivityModeOptions: API.SettingEnumOption[] = [\r\n {\r\n id: API.ConnectivityModeEnum.DISABLED,\r\n name: 'Disabled',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.ACTIVE_MODE,\r\n name: 'Active mode',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.PASSIVE_MODE,\r\n name: 'Passive mode',\r\n },\r\n];\r\n\r\nconst Fields: UI.FormFieldDefinition[] = [\r\n {\r\n key: 'generic',\r\n title: 'Hub properties',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'name',\r\n title: 'Name',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_url',\r\n title: 'Hub URL',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_description',\r\n title: 'Hub description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'share_profile',\r\n title: 'Share profile',\r\n type: API.SettingTypeEnum.NUMBER,\r\n // eslint-disable-next-line max-len\r\n help: 'Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)',\r\n optional: true,\r\n },\r\n {\r\n key: 'auto_connect',\r\n title: 'Auto connect',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'user',\r\n title: 'User setting overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'nick',\r\n title: 'Nick',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'user_description',\r\n title: 'User description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV4',\r\n title: 'Connectivity setting overrides (IPv4)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v4',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v4',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV6',\r\n title: 'Connectivity setting overrides (IPv6)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v6',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v6',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'misc',\r\n title: 'Miscellaneous overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'use_main_chat_notify',\r\n title: 'Use chat notification',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'show_joins',\r\n title: 'Show joins/parts',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'away_message',\r\n title: 'Away message',\r\n type: API.SettingTypeEnum.TEXT,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n];\r\n\r\ninterface Entry extends UI.FormValueMap {\r\n generic: Pick<\r\n FavoriteHubEntry,\r\n 'name' | 'hub_url' | 'hub_description' | 'auto_connect' | 'share_profile'\r\n >;\r\n user: Pick<FavoriteHubEntry, 'nick' | 'user_description'>;\r\n connectivityV4: Pick<FavoriteHubEntry, 'connection_mode_v4' | 'connection_ip_v4'>;\r\n connectivityV6: Pick<FavoriteHubEntry, 'connection_mode_v6' | 'connection_ip_v6'>;\r\n misc: Pick<FavoriteHubEntry, 'use_main_chat_notify' | 'show_joins' | 'away_message'>;\r\n}\r\n\r\nconst toFormEntry = (entry?: API.FavoriteHubEntry): Entry | undefined => {\r\n if (!entry) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n generic: entry,\r\n user: entry,\r\n connectivityV4: entry,\r\n connectivityV6: entry,\r\n misc: entry,\r\n };\r\n};\r\n\r\nconst toFavoriteHub = (\r\n entry: RecursivePartial<Entry>,\r\n): RecursivePartial<API.FavoriteHubEntry> => {\r\n return {\r\n ...entry.generic,\r\n ...entry.user,\r\n ...entry.connectivityV4,\r\n ...entry.connectivityV6,\r\n ...entry.misc,\r\n };\r\n};\r\n\r\nconst isAdcHub = (hubUrl?: string) =>\r\n !!hubUrl && (hubUrl.startsWith('adc://') || hubUrl.startsWith('adcs://'));\r\n\r\n// Get selection values for the profiles field\r\nconst getFieldProfiles = (\r\n profiles: API.ShareProfile[],\r\n url: string | undefined,\r\n formatter: Formatter,\r\n): UI.FormOption[] => {\r\n return profiles\r\n .filter((p) => isAdcHub(url) || p.id === ShareProfileConstants.HIDDEN_PROFILE_ID)\r\n .map((p) => profileToEnumValue(p, formatter))\r\n .map(normalizeEnumValue);\r\n};\r\n\r\ninterface FavoriteHubDialogProps {\r\n favT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface DataProps {\r\n hubEntry?: API.FavoriteHubEntry;\r\n}\r\n\r\ntype Props = FavoriteHubDialogProps &\r\n DataProps &\r\n ShareProfileDecoratorChildProps &\r\n ModalRouteDecoratorChildProps;\r\n\r\nconst FavoriteHubDialog: React.FC<Props> = ({ hubEntry, favT, profiles, socket }) => {\r\n const formatter = useFormatter();\r\n\r\n const formValue = useMemo<Entry | undefined>(() => toFormEntry(hubEntry), []);\r\n const formDefinitions = useMemo<UI.FormFieldDefinition[]>(\r\n () => translateForm(Fields, favT),\r\n [],\r\n );\r\n const nullOption = useMemo<UI.FormOption<string>>(\r\n () => ({\r\n value: 'null',\r\n text: favT.translate('Global default'),\r\n }),\r\n [],\r\n );\r\n\r\n const isNew = !hubEntry;\r\n\r\n const formRef = useRef<Form<Entry>>(null);\r\n\r\n const onFieldChanged: FormFieldChangeHandler<Entry> = (id, value, hasChanges) => {\r\n if (id.includes('hub_url')) {\r\n if (\r\n !isAdcHub(value.generic!.hub_url) &&\r\n value.share_profile !== ShareProfileConstants.HIDDEN_PROFILE_ID\r\n ) {\r\n // Reset share profile\r\n return Promise.resolve({\r\n share_profile: null,\r\n });\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const handleSave = () => {\r\n return formRef.current!.save();\r\n };\r\n\r\n const onSave: FormSaveHandler<Entry> = (changedFields) => {\r\n const updatedEntryFields = toFavoriteHub(changedFields);\r\n if (isNew) {\r\n return socket.post(FavoriteHubConstants.HUBS_URL, updatedEntryFields);\r\n }\r\n\r\n return socket.patch(\r\n `${FavoriteHubConstants.HUBS_URL}/${hubEntry.id}`,\r\n updatedEntryFields,\r\n );\r\n };\r\n\r\n const onFieldSetting: FormFieldSettingHandler<Entry> = (\r\n id,\r\n fieldOptions,\r\n formValue,\r\n ) => {\r\n if (id === 'share_profile') {\r\n const hubUrl = formValue.generic ? formValue.generic.hub_url : undefined;\r\n\r\n // Since the options are added dynamically based on the URL protocol, they must be\r\n // normalized to use the tcomb format\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n factory: t.form.Select,\r\n options: getFieldProfiles(profiles, hubUrl, formatter),\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'connection_mode_v4' || id === 'connection_mode_v6') {\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'use_main_chat_notify' || id === 'show_joins') {\r\n Object.assign(fieldOptions, {\r\n template: IndeterminateCheckboxField,\r\n transformer: {\r\n format: (value: boolean | null) => (value === undefined ? null : value),\r\n parse: (value: boolean | null) => value,\r\n },\r\n });\r\n }\r\n };\r\n\r\n const { translate } = favT;\r\n const title = translate(isNew ? 'Add favorite hub' : 'Edit favorite hub');\r\n return (\r\n <RouteModal\r\n className=\"fav-hub\"\r\n title={title}\r\n onApprove={handleSave}\r\n closable={false}\r\n icon={IconConstants.FAVORITE}\r\n >\r\n <Form<Entry>\r\n ref={formRef}\r\n onFieldChanged={onFieldChanged}\r\n onFieldSetting={onFieldSetting}\r\n onSave={onSave}\r\n fieldDefinitions={formDefinitions}\r\n sourceValue={formValue}\r\n />\r\n </RouteModal>\r\n );\r\n};\r\n\r\nexport default ModalRouteDecorator<FavoriteHubDialogProps>(\r\n ShareProfileDecorator(FavoriteHubDialog, true, {\r\n urls: {\r\n hubEntry: ({ params }, socket) => {\r\n if (!params.entryId) {\r\n return Promise.resolve(undefined);\r\n }\r\n\r\n return socket.get(`${FavoriteHubConstants.HUBS_URL}/${params.entryId}`);\r\n },\r\n },\r\n }),\r\n 'entries/:entryId?',\r\n);\r\n","import classNames from 'classnames';\r\n\r\nimport HubActions from 'actions/reflux/HubActions';\r\nimport HubSessionStore from 'stores/reflux/HubSessionStore';\r\n\r\nimport Icon from 'components/semantic/Icon';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport * as API from 'types/api';\r\nimport { useLocation, useNavigate } from 'react-router';\r\n\r\nexport type ConnectStateCellProps = RowWrapperCellChildProps<\r\n API.FavoriteHubConnectState,\r\n API.FavoriteHubEntry\r\n>;\r\n\r\nconst getIcon = (state: API.FavoriteHubConnectState) => {\r\n switch (state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'yellow remove';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'grey remove';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'green video play';\r\n default:\r\n }\r\n\r\n return '';\r\n};\r\n\r\nconst ConnectStateCell: React.FC<ConnectStateCellProps> = ({\r\n width,\r\n cellData,\r\n rowDataGetter,\r\n}) => {\r\n const location = useLocation();\r\n const navigate = useNavigate();\r\n\r\n const handleCreateSession = () => {\r\n HubActions.createSession(rowDataGetter!().hub_url, {\r\n location,\r\n navigate,\r\n sessionStore: HubSessionStore,\r\n });\r\n };\r\n\r\n const handleRemoveSession = () => {\r\n HubActions.removeSession({ id: cellData!.current_hub_id });\r\n };\r\n\r\n const getClickAction = () => {\r\n switch (cellData!.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return handleRemoveSession;\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n default:\r\n return handleCreateSession;\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"connect-state\">\r\n <Icon\r\n icon={classNames('icon large link', getIcon(cellData!))}\r\n onClick={getClickAction()}\r\n />\r\n {width! > 120 && cellData!.str}\r\n </div>\r\n );\r\n};\r\n\r\nexport default ConnectStateCell;\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nconst handleCreate: UI.ActionHandler<undefined> = ({ navigate }) => {\r\n navigate('/favorite-hubs/entries');\r\n};\r\n\r\nconst handleEdit: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n navigate,\r\n}) => {\r\n navigate(`/favorite-hubs/entries/${hub.id}`);\r\n};\r\n\r\nconst handleRemove: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return socket.delete(FavoriteHubConstants.HUBS_URL + '/' + hub.id);\r\n};\r\n\r\nexport const FavoriteHubCreateAction = {\r\n id: 'create',\r\n displayName: 'Add new',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleCreate,\r\n};\r\n\r\nexport const FavoriteHubEditAction = {\r\n id: 'edit',\r\n displayName: 'Edit',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n handler: handleEdit,\r\n};\r\n\r\nexport const FavoriteHubRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the favorite hub {{item.name}}?',\r\n approveCaption: 'Remove favorite hub',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst FavoriteHubCreateActions: UI.ActionListType<undefined> = {\r\n create: FavoriteHubCreateAction,\r\n};\r\n\r\nconst FavoriteHubEditActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n edit: FavoriteHubEditAction,\r\n remove: FavoriteHubRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n};\r\n\r\nexport const FavoriteHubEditActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubEditActions,\r\n};\r\n\r\nexport const FavoriteHubActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubCreateActions,\r\n};\r\n","import FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\nimport { APISocket } from 'services/SocketService';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nconst sendPassword = (\r\n socket: APISocket,\r\n hub: API.FavoriteHubEntry,\r\n password: string | null,\r\n) => {\r\n return socket.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, {\r\n password,\r\n });\r\n};\r\n\r\nconst handleSetPassword: UI.ActionHandler<API.FavoriteHubEntry> = (\r\n { itemData: hub, socket },\r\n password: string,\r\n) => {\r\n return sendPassword(socket, hub, password);\r\n};\r\n\r\nconst handleRemovePassword: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return sendPassword(socket, hub, null);\r\n};\r\n\r\ntype Filter = UI.ActionFilter<API.FavoriteHubEntry>;\r\nconst hasPassword: Filter = ({ itemData: data }) => data.has_password;\r\nconst noPassword: Filter = (data) => !hasPassword(data);\r\n\r\nconst FavoriteHubPasswordCreateAction = {\r\n id: 'create',\r\n displayName: 'Set password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.LOCK,\r\n filter: noPassword,\r\n input: {\r\n content: 'Set password for the hub {{item.name}}',\r\n approveCaption: 'Set password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordChangeAction = {\r\n id: 'change',\r\n displayName: 'Change password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n filter: hasPassword,\r\n input: {\r\n content: 'Enter new password for the hub {{item.name}}',\r\n approveCaption: 'Update password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n filter: hasPassword,\r\n confirmation: {\r\n content: 'Are you sure that you want to reset the password of the hub {{item.name}}?',\r\n approveCaption: 'Remove password',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemovePassword,\r\n};\r\n\r\nconst FavoriteHubPasswordActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n create: FavoriteHubPasswordCreateAction,\r\n change: FavoriteHubPasswordChangeAction,\r\n remove: FavoriteHubPasswordRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubPasswordActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n subId: 'password',\r\n};\r\n\r\nexport const FavoriteHubPasswordActionMenu = {\r\n moduleData: FavoriteHubPasswordActionModule,\r\n actions: FavoriteHubPasswordActions,\r\n};\r\n","import * as React from 'react';\r\n\r\nimport FavoriteHubStore from 'stores/views/FavoriteHubStore';\r\nimport FavoriteHubDialog from './FavoriteHubDialog';\r\n\r\nimport VirtualTable from 'components/table/VirtualTable';\r\nimport { Column } from 'fixed-data-table-2';\r\nimport { CheckboxCell, ActionMenuCell } from 'components/table/Cell';\r\nimport ConnectStateCell from './ConnectStateCell';\r\n\r\nimport { ActionMenu, TableActionMenu } from 'components/action-menu';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport '../style.css';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { translate, getModuleT } from 'utils/TranslationUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { updateFavoriteHub } from 'services/api/FavoriteHubApi';\r\nimport { runBackgroundSocketAction } from 'utils/ActionUtils';\r\nimport MenuConstants from 'constants/MenuConstants';\r\nimport {\r\n FavoriteHubActionMenu,\r\n FavoriteHubEditActionMenu,\r\n FavoriteHubPasswordActionMenu,\r\n} from 'actions/ui/favorite-hub';\r\nimport { useSession } from 'context/SessionContext';\r\n\r\nconst PasswordCell: React.FC<RowWrapperCellChildProps<string, API.FavoriteHubEntry>> = ({\r\n cellData,\r\n rowDataGetter,\r\n t,\r\n}) => (\r\n <TableActionMenu\r\n caption={\r\n cellData ? (\r\n <strong>{translate('Set', t!, UI.Modules.FAVORITE_HUBS)}</strong>\r\n ) : (\r\n translate('Not set', t!, UI.Modules.FAVORITE_HUBS)\r\n )\r\n }\r\n actions={FavoriteHubPasswordActionMenu}\r\n itemData={rowDataGetter!}\r\n />\r\n);\r\n\r\nconst FavoriteHubs: React.FC = () => {\r\n const { t } = useTranslation();\r\n\r\n const rowClassNameGetter = (rowData: API.FavoriteHubEntry) => {\r\n switch (rowData.connect_state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'connecting';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'connected';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'disconnected';\r\n default:\r\n }\r\n\r\n return '';\r\n };\r\n\r\n const onChangeAutoConnect = (checked: boolean, rowData: API.FavoriteHubEntry) => {\r\n return runBackgroundSocketAction(\r\n () =>\r\n updateFavoriteHub(rowData, {\r\n auto_connect: checked,\r\n }),\r\n t,\r\n );\r\n };\r\n\r\n const favT = getModuleT(t, UI.Modules.FAVORITE_HUBS);\r\n\r\n const { hasAccess } = useSession();\r\n const { translate } = favT;\r\n const editAccess = hasAccess(API.AccessEnum.HUBS_EDIT);\r\n return (\r\n <>\r\n <VirtualTable\r\n rowClassNameGetter={rowClassNameGetter}\r\n footerData={\r\n <ActionMenu\r\n className=\"top left pointing\"\r\n caption={translate('Actions...')}\r\n actions={FavoriteHubActionMenu}\r\n header={translate('Favorite hub actions')}\r\n triggerIcon=\"chevron up\"\r\n button={true}\r\n remoteMenuId=\"favorite_hubs\"\r\n direction=\"upward\"\r\n />\r\n }\r\n store={FavoriteHubStore}\r\n moduleId={UI.Modules.FAVORITE_HUBS}\r\n >\r\n <Column\r\n name=\"State\"\r\n width={45}\r\n columnKey=\"connect_state\"\r\n cell={editAccess ? <ConnectStateCell /> : undefined}\r\n flexGrow={3}\r\n />\r\n <Column\r\n name=\"Name\"\r\n width={150}\r\n columnKey=\"name\"\r\n flexGrow={6}\r\n cell={\r\n <ActionMenuCell\r\n actions={FavoriteHubEditActionMenu}\r\n remoteMenuId={MenuConstants.FAVORITE_HUB}\r\n />\r\n }\r\n />\r\n <Column\r\n name=\"Address\"\r\n width={270}\r\n columnKey=\"hub_url\"\r\n flexGrow={3}\r\n hideWidth={700}\r\n />\r\n <Column\r\n name=\"Auto connect\"\r\n width={65}\r\n columnKey=\"auto_connect\"\r\n cell={\r\n editAccess ? (\r\n <CheckboxCell onChange={onChangeAutoConnect} type=\"toggle\" />\r\n ) : undefined\r\n }\r\n />\r\n <Column name=\"Share profile\" width={100} columnKey=\"share_profile\" flexGrow={1} />\r\n <Column name=\"Nick\" width={100} columnKey=\"nick\" flexGrow={1} />\r\n <Column\r\n name=\"Password\"\r\n width={100}\r\n columnKey=\"has_password\"\r\n cell={<PasswordCell />}\r\n />\r\n </VirtualTable>\r\n <FavoriteHubDialog favT={favT} />\r\n </>\r\n );\r\n};\r\n\r\nexport default FavoriteHubs;\r\n","import * as API from 'types/api';\r\n\r\nimport SocketService from 'services/SocketService';\r\nimport FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\n\r\nexport const updateFavoriteHub = (\r\n hub: API.FavoriteHubEntry,\r\n data: Partial<API.FavoriteHubEntryBase>,\r\n) => {\r\n return SocketService.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, data);\r\n};\r\n","import ShareProfileConstants from 'constants/ShareProfileConstants';\r\n\r\nimport { Formatter } from 'context/FormatterContext';\r\n\r\nimport * as API from 'types/api';\r\n\r\nexport const formatProfileNameWithSize = (\r\n profile: API.ShareProfile,\r\n { formatSize }: Formatter,\r\n) => {\r\n let str = profile.str;\r\n if (profile.id !== ShareProfileConstants.HIDDEN_PROFILE_ID) {\r\n str += ` (${formatSize(profile.size)})`;\r\n }\r\n\r\n return str;\r\n};\r\n\r\nexport const profileToEnumValue = (profile: API.ShareProfile, formatter: Formatter) => {\r\n return {\r\n id: profile.id,\r\n name: formatProfileNameWithSize(profile, formatter),\r\n };\r\n};\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","MODULE_URL","PROFILES_URL","PROFILE_ADDED","PROFILE_UPDATED","PROFILE_REMOVED","HIDDEN_PROFILE_ID","Component","listHidden","dataProviderDecoratorSettings","merge","urls","profiles","dataConverters","data","t","filter","p","onSocketConnected","addSocketListener","refetchData","_viewName","_apiUrl","FavoriteHubConstants","mixins","ViewStoreMixin","IndeterminateCheckbox","locals","inputRef","useRef","useEffect","current","value","indeterminate","ref","type","attrs","onChange","evt","target","checked","IndeterminateCheckboxTemplate","renderCheckbox","IndeterminateCheckboxField","form","Form","templates","checkbox","clone","ConnectivityModeOptions","DISABLED","name","ACTIVE_MODE","PASSIVE_MODE","Fields","key","title","STRUCT","definitions","STRING","optional","NUMBER","help","BOOLEAN","options","TEXT","isAdcHub","hubUrl","startsWith","getFieldProfiles","url","formatter","ShareProfileConstants","map","ModalRouteDecorator","ShareProfileDecorator","hubEntry","favT","socket","formValue","useMemo","entry","generic","user","connectivityV4","connectivityV6","misc","toFormEntry","formDefinitions","nullOption","text","translate","isNew","formRef","RouteModal","className","onApprove","save","closable","icon","IconConstants","FAVORITE","onFieldChanged","hasChanges","includes","hub_url","share_profile","Promise","resolve","onFieldSetting","fieldOptions","undefined","Object","assign","factory","Select","transformer","template","format","parse","onSave","changedFields","updatedEntryFields","post","patch","fieldDefinitions","sourceValue","params","entryId","get","getIcon","state","CONNECTING","CONNECTED","DISCONNECTED","width","cellData","rowDataGetter","location","navigate","handleCreateSession","HubActions","createSession","sessionStore","HubSessionStore","handleRemoveSession","removeSession","current_hub_id","Icon","onClick","getClickAction","str","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","FavoriteHubCreateActions","create","displayName","access","FAVORITE_HUBS_EDIT","CREATE","handler","FavoriteHubEditActions","edit","EDIT","itemData","hub","remove","REMOVE","confirmation","content","approveCaption","rejectCaption","delete","FavoriteHubActionModule","moduleId","FAVORITE_HUBS","FavoriteHubEditActionMenu","moduleData","actions","FavoriteHubActionMenu","sendPassword","password","handleSetPassword","hasPassword","has_password","FavoriteHubPasswordActions","LOCK","input","inputProps","placeholder","change","FavoriteHubPasswordActionMenu","subId","PasswordCell","caption","hasAccess","editAccess","HUBS_EDIT","VirtualTable","rowClassNameGetter","rowData","connect_state","footerData","header","triggerIcon","button","remoteMenuId","direction","store","FavoriteHubStore","columnKey","cell","flexGrow","MenuConstants","FAVORITE_HUB","hideWidth","updateFavoriteHub","auto_connect","SocketService","formatProfileNameWithSize","profile","formatSize","size","profileToEnumValue"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/favorite-hubs.d0c1452419e4f6e34765.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,+eAiBtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iDAAiD,MAAQ,GAAG,SAAW,yEAAyE,eAAiB,CAAC,gfAAgf,WAAa,MAE7rB,S,mCCxBA,MAAMC,EAAa,iBACnB,GACEA,WAAYA,EACZC,aAAcD,EAEdE,cAAe,sBACfC,gBAAiB,wBACjBC,gBAAiB,wBAEjBC,kBAAmB,E,uECWrB,MA8CA,EA9C8B,SAC5BC,EACAC,EACAC,GAaA,OAAO,OACLF,GACA,IAAAG,OAAMD,EAA+B,CACnCE,KAAM,CACJC,SAAU,IAAsBV,cAElCW,eAAgB,CACdD,SAfyC,CAACE,GAA4BC,OACzDD,EAAKE,QACnBC,GAAMT,GAAcS,EAAEjB,KAAO,IAAsBM,qBAepDY,kBAAmB,CAACC,GAAqBC,kBACvCD,EACE,IAAsBlB,WACtB,IAAsBE,eACtB,IAAMiB,MAERD,EACE,IAAsBlB,WACtB,IAAsBG,iBACtB,IAAMgB,MAERD,EACE,IAAsBlB,WACtB,IAAsBI,iBACtB,IAAMe,KACP,IAIT,C,+FChEA,MAAMnB,EAAa,gBAEnB,EACcA,EADd,EAEYA,E,eCCZ,QAAe,gBAAmB,CAChCoB,UAAW,oBACXC,QAASC,EACTC,OAAQ,EAAC,EAAAC,EAAA,GAAe,W,sGCE1B,MAAMC,EAA8D,EAAGC,aACrE,MAAMC,GAAW,IAAAC,QAAyB,MAc1C,OAZ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/ShareProfileConstants.ts","webpack://airdcpp-webui/./src/decorators/ShareProfileDecorator.tsx","webpack://airdcpp-webui/./src/constants/FavoriteHubConstants.ts","webpack://airdcpp-webui/./src/stores/views/FavoriteHubStore.js","webpack://airdcpp-webui/./src/components/form/fields/IndeterminateCheckboxField.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubDialog.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/ConnectStateCell.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/style.css?f7f3","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubActions.ts","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubPasswordActions.ts","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubs.tsx","webpack://airdcpp-webui/./src/services/api/FavoriteHubApi.ts","webpack://airdcpp-webui/./src/utils/ShareProfileUtils.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.virtual-table .cell-wrapper.connected,\n.virtual-table .cell-wrapper.connected span,\n.virtual-table .cell-wrapper.connected strong {\n color: green;\n}\n\n.virtual-table .cell-wrapper.connecting,\n.virtual-table .cell-wrapper.connecting span,\n.virtual-table .cell-wrapper.connecting strong {\n color: orange;\n}\n\n.virtual-table .cell-wrapper.disconnected,\n.virtual-table .cell-wrapper.disconnected span,\n.virtual-table .cell-wrapper.disconnected strong {\n color: dimslategray;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/FavoriteHubs/style.css\"],\"names\":[],\"mappings\":\"AAAA;;;EAGE,YAAY;AACd;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;;EAGE,mBAAmB;AACrB\",\"sourcesContent\":[\".virtual-table .cell-wrapper.connected,\\n.virtual-table .cell-wrapper.connected span,\\n.virtual-table .cell-wrapper.connected strong {\\n color: green;\\n}\\n\\n.virtual-table .cell-wrapper.connecting,\\n.virtual-table .cell-wrapper.connecting span,\\n.virtual-table .cell-wrapper.connecting strong {\\n color: orange;\\n}\\n\\n.virtual-table .cell-wrapper.disconnected,\\n.virtual-table .cell-wrapper.disconnected span,\\n.virtual-table .cell-wrapper.disconnected strong {\\n color: dimslategray;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","const MODULE_URL = 'share_profiles';\nexport default {\n MODULE_URL: MODULE_URL,\n PROFILES_URL: MODULE_URL,\n\n PROFILE_ADDED: 'share_profile_added',\n PROFILE_UPDATED: 'share_profile_updated',\n PROFILE_REMOVED: 'share_profile_removed',\n\n HIDDEN_PROFILE_ID: 1,\n};\n","import * as React from 'react';\r\nimport { merge } from 'lodash';\r\n\r\nimport ShareProfileConstants from 'constants/ShareProfileConstants';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n DataProviderDecoratorSettings,\r\n DataConverter,\r\n} from 'decorators/DataProviderDecorator';\r\n\r\nimport * as API from 'types/api';\r\n\r\ninterface ShareProfileDecoratorDataProps {\r\n profiles: API.ShareProfile[];\r\n}\r\n\r\nexport type ShareProfileDecoratorChildProps = DataProviderDecoratorChildProps &\r\n ShareProfileDecoratorDataProps;\r\n\r\nconst ShareProfileDecorator = function <PropsT extends object>(\r\n Component: React.ComponentType<PropsT & ShareProfileDecoratorChildProps>,\r\n listHidden: boolean,\r\n dataProviderDecoratorSettings?: DataProviderDecoratorSettings<\r\n PropsT,\r\n ShareProfileDecoratorDataProps\r\n >,\r\n) {\r\n const convertProfiles: DataConverter<PropsT> = (data: API.ShareProfile[], { t }) => {\r\n const profiles = data.filter(\r\n (p) => listHidden || p.id !== ShareProfileConstants.HIDDEN_PROFILE_ID,\r\n );\r\n\r\n return profiles;\r\n };\r\n\r\n return DataProviderDecorator<PropsT, ShareProfileDecoratorDataProps>(\r\n Component,\r\n merge(dataProviderDecoratorSettings, {\r\n urls: {\r\n profiles: ShareProfileConstants.PROFILES_URL,\r\n },\r\n dataConverters: {\r\n profiles: convertProfiles,\r\n },\r\n onSocketConnected: (addSocketListener, { refetchData }) => {\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_ADDED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_UPDATED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_REMOVED,\r\n () => refetchData(),\r\n );\r\n },\r\n } as DataProviderDecoratorSettings<PropsT, ShareProfileDecoratorDataProps>),\r\n );\r\n};\r\n\r\nexport default ShareProfileDecorator;\r\n","const MODULE_URL = 'favorite_hubs';\n\nexport default {\n MODULE_URL: MODULE_URL,\n HUBS_URL: MODULE_URL,\n};\n","import Reflux from 'reflux';\n\nimport FavoriteHubConstants from 'constants/FavoriteHubConstants';\nimport ViewStoreMixin from 'mixins/ViewStoreMixin';\n\nexport default Reflux.createStore({\n _viewName: 'favorite_hub_view',\n _apiUrl: FavoriteHubConstants.MODULE_URL,\n mixins: [ViewStoreMixin('name')],\n});\n","import { useEffect, useRef } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport * as UI from 'types/ui';\r\nimport t from 'utils/tcomb-form';\r\n\r\ninterface IndeterminateCheckboxProps {\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>;\r\n}\r\n\r\nconst IndeterminateCheckbox: React.FC<IndeterminateCheckboxProps> = ({ locals }) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (!inputRef.current) {\r\n return;\r\n }\r\n\r\n if (typeof locals.value === 'boolean') {\r\n inputRef.current.indeterminate = false;\r\n } else {\r\n inputRef.current.indeterminate = true;\r\n }\r\n }, [locals.value]);\r\n\r\n return (\r\n <input\r\n ref={inputRef}\r\n type=\"checkbox\"\r\n {...locals.attrs}\r\n onChange={(evt) => {\r\n // Toggle between true/false/indeterminate\r\n if (locals.value === false) {\r\n locals.onChange(null);\r\n } else {\r\n locals.onChange(evt.target.checked);\r\n }\r\n }}\r\n />\r\n );\r\n};\r\n\r\ntype TCombTemplate = {\r\n renderCheckbox: (\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>,\r\n ) => React.ReactNode;\r\n};\r\n\r\nconst IndeterminateCheckboxTemplate: TCombTemplate = {\r\n renderCheckbox(locals) {\r\n return <IndeterminateCheckbox locals={locals} />;\r\n },\r\n};\r\n\r\nexport const IndeterminateCheckboxField = t.form.Form.templates.checkbox.clone(\r\n IndeterminateCheckboxTemplate,\r\n);\r\n","import { useMemo, useRef } from 'react';\r\nimport RouteModal from 'components/semantic/RouteModal';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from 'decorators/ModalRouteDecorator';\r\n\r\nimport ShareProfileConstants from 'constants/ShareProfileConstants';\r\nimport FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\n\r\nimport ShareProfileDecorator, {\r\n ShareProfileDecoratorChildProps,\r\n} from 'decorators/ShareProfileDecorator';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport Form, {\r\n FormFieldChangeHandler,\r\n FormFieldSettingHandler,\r\n FormSaveHandler,\r\n} from 'components/form/Form';\r\nimport { normalizeEnumValue, intTransformer, translateForm } from 'utils/FormUtils';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { FavoriteHubEntry } from 'types/api';\r\nimport { IndeterminateCheckboxField } from 'components/form/fields/IndeterminateCheckboxField';\r\nimport { profileToEnumValue } from 'utils/ShareProfileUtils';\r\nimport { Formatter, useFormatter } from 'context/FormatterContext';\r\n\r\nconst ConnectivityModeOptions: API.SettingEnumOption[] = [\r\n {\r\n id: API.ConnectivityModeEnum.DISABLED,\r\n name: 'Disabled',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.ACTIVE_MODE,\r\n name: 'Active mode',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.PASSIVE_MODE,\r\n name: 'Passive mode',\r\n },\r\n];\r\n\r\nconst Fields: UI.FormFieldDefinition[] = [\r\n {\r\n key: 'generic',\r\n title: 'Hub properties',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'name',\r\n title: 'Name',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_url',\r\n title: 'Hub URL',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_description',\r\n title: 'Hub description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'share_profile',\r\n title: 'Share profile',\r\n type: API.SettingTypeEnum.NUMBER,\r\n // eslint-disable-next-line max-len\r\n help: 'Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)',\r\n optional: true,\r\n },\r\n {\r\n key: 'auto_connect',\r\n title: 'Auto connect',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'user',\r\n title: 'User setting overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'nick',\r\n title: 'Nick',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'user_description',\r\n title: 'User description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV4',\r\n title: 'Connectivity setting overrides (IPv4)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v4',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v4',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV6',\r\n title: 'Connectivity setting overrides (IPv6)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v6',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v6',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'misc',\r\n title: 'Miscellaneous overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'use_main_chat_notify',\r\n title: 'Use chat notification',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'show_joins',\r\n title: 'Show joins/parts',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'away_message',\r\n title: 'Away message',\r\n type: API.SettingTypeEnum.TEXT,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n];\r\n\r\ninterface Entry extends UI.FormValueMap {\r\n generic: Pick<\r\n FavoriteHubEntry,\r\n 'name' | 'hub_url' | 'hub_description' | 'auto_connect' | 'share_profile'\r\n >;\r\n user: Pick<FavoriteHubEntry, 'nick' | 'user_description'>;\r\n connectivityV4: Pick<FavoriteHubEntry, 'connection_mode_v4' | 'connection_ip_v4'>;\r\n connectivityV6: Pick<FavoriteHubEntry, 'connection_mode_v6' | 'connection_ip_v6'>;\r\n misc: Pick<FavoriteHubEntry, 'use_main_chat_notify' | 'show_joins' | 'away_message'>;\r\n}\r\n\r\nconst toFormEntry = (entry?: API.FavoriteHubEntry): Entry | undefined => {\r\n if (!entry) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n generic: entry,\r\n user: entry,\r\n connectivityV4: entry,\r\n connectivityV6: entry,\r\n misc: entry,\r\n };\r\n};\r\n\r\nconst toFavoriteHub = (\r\n entry: RecursivePartial<Entry>,\r\n): RecursivePartial<API.FavoriteHubEntry> => {\r\n return {\r\n ...entry.generic,\r\n ...entry.user,\r\n ...entry.connectivityV4,\r\n ...entry.connectivityV6,\r\n ...entry.misc,\r\n };\r\n};\r\n\r\nconst isAdcHub = (hubUrl?: string) =>\r\n !!hubUrl && (hubUrl.startsWith('adc://') || hubUrl.startsWith('adcs://'));\r\n\r\n// Get selection values for the profiles field\r\nconst getFieldProfiles = (\r\n profiles: API.ShareProfile[],\r\n url: string | undefined,\r\n formatter: Formatter,\r\n): UI.FormOption[] => {\r\n return profiles\r\n .filter((p) => isAdcHub(url) || p.id === ShareProfileConstants.HIDDEN_PROFILE_ID)\r\n .map((p) => profileToEnumValue(p, formatter))\r\n .map(normalizeEnumValue);\r\n};\r\n\r\ninterface FavoriteHubDialogProps {\r\n favT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface DataProps {\r\n hubEntry?: API.FavoriteHubEntry;\r\n}\r\n\r\ntype Props = FavoriteHubDialogProps &\r\n DataProps &\r\n ShareProfileDecoratorChildProps &\r\n ModalRouteDecoratorChildProps;\r\n\r\nconst FavoriteHubDialog: React.FC<Props> = ({ hubEntry, favT, profiles, socket }) => {\r\n const formatter = useFormatter();\r\n\r\n const formValue = useMemo<Entry | undefined>(() => toFormEntry(hubEntry), []);\r\n const formDefinitions = useMemo<UI.FormFieldDefinition[]>(\r\n () => translateForm(Fields, favT),\r\n [],\r\n );\r\n const nullOption = useMemo<UI.FormOption<string>>(\r\n () => ({\r\n value: 'null',\r\n text: favT.translate('Global default'),\r\n }),\r\n [],\r\n );\r\n\r\n const isNew = !hubEntry;\r\n\r\n const formRef = useRef<Form<Entry>>(null);\r\n\r\n const onFieldChanged: FormFieldChangeHandler<Entry> = (id, value, hasChanges) => {\r\n if (id.includes('hub_url')) {\r\n if (\r\n !isAdcHub(value.generic!.hub_url) &&\r\n value.share_profile !== ShareProfileConstants.HIDDEN_PROFILE_ID\r\n ) {\r\n // Reset share profile\r\n return Promise.resolve({\r\n share_profile: null,\r\n });\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const handleSave = () => {\r\n return formRef.current!.save();\r\n };\r\n\r\n const onSave: FormSaveHandler<Entry> = (changedFields) => {\r\n const updatedEntryFields = toFavoriteHub(changedFields);\r\n if (isNew) {\r\n return socket.post(FavoriteHubConstants.HUBS_URL, updatedEntryFields);\r\n }\r\n\r\n return socket.patch(\r\n `${FavoriteHubConstants.HUBS_URL}/${hubEntry.id}`,\r\n updatedEntryFields,\r\n );\r\n };\r\n\r\n const onFieldSetting: FormFieldSettingHandler<Entry> = (\r\n id,\r\n fieldOptions,\r\n formValue,\r\n ) => {\r\n if (id === 'share_profile') {\r\n const hubUrl = formValue.generic ? formValue.generic.hub_url : undefined;\r\n\r\n // Since the options are added dynamically based on the URL protocol, they must be\r\n // normalized to use the tcomb format\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n factory: t.form.Select,\r\n options: getFieldProfiles(profiles, hubUrl, formatter),\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'connection_mode_v4' || id === 'connection_mode_v6') {\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'use_main_chat_notify' || id === 'show_joins') {\r\n Object.assign(fieldOptions, {\r\n template: IndeterminateCheckboxField,\r\n transformer: {\r\n format: (value: boolean | null) => (value === undefined ? null : value),\r\n parse: (value: boolean | null) => value,\r\n },\r\n });\r\n }\r\n };\r\n\r\n const { translate } = favT;\r\n const title = translate(isNew ? 'Add favorite hub' : 'Edit favorite hub');\r\n return (\r\n <RouteModal\r\n className=\"fav-hub\"\r\n title={title}\r\n onApprove={handleSave}\r\n closable={false}\r\n icon={IconConstants.FAVORITE}\r\n >\r\n <Form<Entry>\r\n ref={formRef}\r\n onFieldChanged={onFieldChanged}\r\n onFieldSetting={onFieldSetting}\r\n onSave={onSave}\r\n fieldDefinitions={formDefinitions}\r\n sourceValue={formValue}\r\n />\r\n </RouteModal>\r\n );\r\n};\r\n\r\nexport default ModalRouteDecorator<FavoriteHubDialogProps>(\r\n ShareProfileDecorator(FavoriteHubDialog, true, {\r\n urls: {\r\n hubEntry: ({ params }, socket) => {\r\n if (!params.entryId) {\r\n return Promise.resolve(undefined);\r\n }\r\n\r\n return socket.get(`${FavoriteHubConstants.HUBS_URL}/${params.entryId}`);\r\n },\r\n },\r\n }),\r\n 'entries/:entryId?',\r\n);\r\n","import classNames from 'classnames';\r\n\r\nimport HubActions from 'actions/reflux/HubActions';\r\nimport HubSessionStore from 'stores/reflux/HubSessionStore';\r\n\r\nimport Icon from 'components/semantic/Icon';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport * as API from 'types/api';\r\nimport { useLocation, useNavigate } from 'react-router';\r\n\r\nexport type ConnectStateCellProps = RowWrapperCellChildProps<\r\n API.FavoriteHubConnectState,\r\n API.FavoriteHubEntry\r\n>;\r\n\r\nconst getIcon = (state: API.FavoriteHubConnectState) => {\r\n switch (state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'yellow remove';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'grey remove';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'green video play';\r\n default:\r\n }\r\n\r\n return '';\r\n};\r\n\r\nconst ConnectStateCell: React.FC<ConnectStateCellProps> = ({\r\n width,\r\n cellData,\r\n rowDataGetter,\r\n}) => {\r\n const location = useLocation();\r\n const navigate = useNavigate();\r\n\r\n const handleCreateSession = () => {\r\n HubActions.createSession(rowDataGetter!().hub_url, {\r\n location,\r\n navigate,\r\n sessionStore: HubSessionStore,\r\n });\r\n };\r\n\r\n const handleRemoveSession = () => {\r\n HubActions.removeSession({ id: cellData!.current_hub_id });\r\n };\r\n\r\n const getClickAction = () => {\r\n switch (cellData!.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return handleRemoveSession;\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n default:\r\n return handleCreateSession;\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"connect-state\">\r\n <Icon\r\n icon={classNames('icon large link', getIcon(cellData!))}\r\n onClick={getClickAction()}\r\n />\r\n {width! > 120 && cellData!.str}\r\n </div>\r\n );\r\n};\r\n\r\nexport default ConnectStateCell;\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nconst handleCreate: UI.ActionHandler<undefined> = ({ navigate }) => {\r\n navigate('/favorite-hubs/entries');\r\n};\r\n\r\nconst handleEdit: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n navigate,\r\n}) => {\r\n navigate(`/favorite-hubs/entries/${hub.id}`);\r\n};\r\n\r\nconst handleRemove: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return socket.delete(FavoriteHubConstants.HUBS_URL + '/' + hub.id);\r\n};\r\n\r\nexport const FavoriteHubCreateAction = {\r\n id: 'create',\r\n displayName: 'Add new',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleCreate,\r\n};\r\n\r\nexport const FavoriteHubEditAction = {\r\n id: 'edit',\r\n displayName: 'Edit',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n handler: handleEdit,\r\n};\r\n\r\nexport const FavoriteHubRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the favorite hub {{item.name}}?',\r\n approveCaption: 'Remove favorite hub',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst FavoriteHubCreateActions: UI.ActionListType<undefined> = {\r\n create: FavoriteHubCreateAction,\r\n};\r\n\r\nconst FavoriteHubEditActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n edit: FavoriteHubEditAction,\r\n remove: FavoriteHubRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n};\r\n\r\nexport const FavoriteHubEditActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubEditActions,\r\n};\r\n\r\nexport const FavoriteHubActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubCreateActions,\r\n};\r\n","import FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\nimport { APISocket } from 'services/SocketService';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nconst sendPassword = (\r\n socket: APISocket,\r\n hub: API.FavoriteHubEntry,\r\n password: string | null,\r\n) => {\r\n return socket.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, {\r\n password,\r\n });\r\n};\r\n\r\nconst handleSetPassword: UI.ActionHandler<API.FavoriteHubEntry> = (\r\n { itemData: hub, socket },\r\n password: string,\r\n) => {\r\n return sendPassword(socket, hub, password);\r\n};\r\n\r\nconst handleRemovePassword: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return sendPassword(socket, hub, null);\r\n};\r\n\r\ntype Filter = UI.ActionFilter<API.FavoriteHubEntry>;\r\nconst hasPassword: Filter = ({ itemData: data }) => data.has_password;\r\nconst noPassword: Filter = (data) => !hasPassword(data);\r\n\r\nconst FavoriteHubPasswordCreateAction = {\r\n id: 'create',\r\n displayName: 'Set password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.LOCK,\r\n filter: noPassword,\r\n input: {\r\n content: 'Set password for the hub {{item.name}}',\r\n approveCaption: 'Set password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordChangeAction = {\r\n id: 'change',\r\n displayName: 'Change password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n filter: hasPassword,\r\n input: {\r\n content: 'Enter new password for the hub {{item.name}}',\r\n approveCaption: 'Update password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n filter: hasPassword,\r\n confirmation: {\r\n content: 'Are you sure that you want to reset the password of the hub {{item.name}}?',\r\n approveCaption: 'Remove password',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemovePassword,\r\n};\r\n\r\nconst FavoriteHubPasswordActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n create: FavoriteHubPasswordCreateAction,\r\n change: FavoriteHubPasswordChangeAction,\r\n remove: FavoriteHubPasswordRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubPasswordActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n subId: 'password',\r\n};\r\n\r\nexport const FavoriteHubPasswordActionMenu = {\r\n moduleData: FavoriteHubPasswordActionModule,\r\n actions: FavoriteHubPasswordActions,\r\n};\r\n","import * as React from 'react';\r\n\r\nimport FavoriteHubStore from 'stores/views/FavoriteHubStore';\r\nimport FavoriteHubDialog from './FavoriteHubDialog';\r\n\r\nimport VirtualTable from 'components/table/VirtualTable';\r\nimport { Column } from 'fixed-data-table-2';\r\nimport { CheckboxCell, ActionMenuCell } from 'components/table/Cell';\r\nimport ConnectStateCell from './ConnectStateCell';\r\n\r\nimport { ActionMenu, TableActionMenu } from 'components/action-menu';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport '../style.css';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { translate, getModuleT } from 'utils/TranslationUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { updateFavoriteHub } from 'services/api/FavoriteHubApi';\r\nimport { runBackgroundSocketAction } from 'utils/ActionUtils';\r\nimport MenuConstants from 'constants/MenuConstants';\r\nimport {\r\n FavoriteHubActionMenu,\r\n FavoriteHubEditActionMenu,\r\n FavoriteHubPasswordActionMenu,\r\n} from 'actions/ui/favorite-hub';\r\nimport { useSession } from 'context/SessionContext';\r\n\r\nconst PasswordCell: React.FC<RowWrapperCellChildProps<string, API.FavoriteHubEntry>> = ({\r\n cellData,\r\n rowDataGetter,\r\n t,\r\n}) => (\r\n <TableActionMenu\r\n caption={\r\n cellData ? (\r\n <strong>{translate('Set', t!, UI.Modules.FAVORITE_HUBS)}</strong>\r\n ) : (\r\n translate('Not set', t!, UI.Modules.FAVORITE_HUBS)\r\n )\r\n }\r\n actions={FavoriteHubPasswordActionMenu}\r\n itemData={rowDataGetter!}\r\n />\r\n);\r\n\r\nconst FavoriteHubs: React.FC = () => {\r\n const { t } = useTranslation();\r\n\r\n const rowClassNameGetter = (rowData: API.FavoriteHubEntry) => {\r\n switch (rowData.connect_state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'connecting';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'connected';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'disconnected';\r\n default:\r\n }\r\n\r\n return '';\r\n };\r\n\r\n const onChangeAutoConnect = (checked: boolean, rowData: API.FavoriteHubEntry) => {\r\n return runBackgroundSocketAction(\r\n () =>\r\n updateFavoriteHub(rowData, {\r\n auto_connect: checked,\r\n }),\r\n t,\r\n );\r\n };\r\n\r\n const favT = getModuleT(t, UI.Modules.FAVORITE_HUBS);\r\n\r\n const { hasAccess } = useSession();\r\n const { translate } = favT;\r\n const editAccess = hasAccess(API.AccessEnum.HUBS_EDIT);\r\n return (\r\n <>\r\n <VirtualTable\r\n rowClassNameGetter={rowClassNameGetter}\r\n footerData={\r\n <ActionMenu\r\n className=\"top left pointing\"\r\n caption={translate('Actions...')}\r\n actions={FavoriteHubActionMenu}\r\n header={translate('Favorite hub actions')}\r\n triggerIcon=\"chevron up\"\r\n button={true}\r\n remoteMenuId=\"favorite_hubs\"\r\n direction=\"upward\"\r\n />\r\n }\r\n store={FavoriteHubStore}\r\n moduleId={UI.Modules.FAVORITE_HUBS}\r\n >\r\n <Column\r\n name=\"State\"\r\n width={45}\r\n columnKey=\"connect_state\"\r\n cell={editAccess ? <ConnectStateCell /> : undefined}\r\n flexGrow={3}\r\n />\r\n <Column\r\n name=\"Name\"\r\n width={150}\r\n columnKey=\"name\"\r\n flexGrow={6}\r\n cell={\r\n <ActionMenuCell\r\n actions={FavoriteHubEditActionMenu}\r\n remoteMenuId={MenuConstants.FAVORITE_HUB}\r\n />\r\n }\r\n />\r\n <Column\r\n name=\"Address\"\r\n width={270}\r\n columnKey=\"hub_url\"\r\n flexGrow={3}\r\n hideWidth={700}\r\n />\r\n <Column\r\n name=\"Auto connect\"\r\n width={65}\r\n columnKey=\"auto_connect\"\r\n cell={\r\n editAccess ? (\r\n <CheckboxCell onChange={onChangeAutoConnect} type=\"toggle\" />\r\n ) : undefined\r\n }\r\n />\r\n <Column name=\"Share profile\" width={100} columnKey=\"share_profile\" flexGrow={1} />\r\n <Column name=\"Nick\" width={100} columnKey=\"nick\" flexGrow={1} />\r\n <Column\r\n name=\"Password\"\r\n width={100}\r\n columnKey=\"has_password\"\r\n cell={<PasswordCell />}\r\n />\r\n </VirtualTable>\r\n <FavoriteHubDialog favT={favT} />\r\n </>\r\n );\r\n};\r\n\r\nexport default FavoriteHubs;\r\n","import * as API from 'types/api';\r\n\r\nimport SocketService from 'services/SocketService';\r\nimport FavoriteHubConstants from 'constants/FavoriteHubConstants';\r\n\r\nexport const updateFavoriteHub = (\r\n hub: API.FavoriteHubEntry,\r\n data: Partial<API.FavoriteHubEntryBase>,\r\n) => {\r\n return SocketService.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, data);\r\n};\r\n","import ShareProfileConstants from 'constants/ShareProfileConstants';\r\n\r\nimport { Formatter } from 'context/FormatterContext';\r\n\r\nimport * as API from 'types/api';\r\n\r\nexport const formatProfileNameWithSize = (\r\n profile: API.ShareProfile,\r\n { formatSize }: Formatter,\r\n) => {\r\n let str = profile.str;\r\n if (profile.id !== ShareProfileConstants.HIDDEN_PROFILE_ID) {\r\n str += ` (${formatSize(profile.size)})`;\r\n }\r\n\r\n return str;\r\n};\r\n\r\nexport const profileToEnumValue = (profile: API.ShareProfile, formatter: Formatter) => {\r\n return {\r\n id: profile.id,\r\n name: formatProfileNameWithSize(profile, formatter),\r\n };\r\n};\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","MODULE_URL","PROFILES_URL","PROFILE_ADDED","PROFILE_UPDATED","PROFILE_REMOVED","HIDDEN_PROFILE_ID","Component","listHidden","dataProviderDecoratorSettings","merge","urls","profiles","dataConverters","data","t","filter","p","onSocketConnected","addSocketListener","refetchData","_viewName","_apiUrl","FavoriteHubConstants","mixins","ViewStoreMixin","IndeterminateCheckbox","locals","inputRef","useRef","useEffect","current","value","indeterminate","ref","type","attrs","onChange","evt","target","checked","IndeterminateCheckboxTemplate","renderCheckbox","IndeterminateCheckboxField","form","Form","templates","checkbox","clone","ConnectivityModeOptions","DISABLED","name","ACTIVE_MODE","PASSIVE_MODE","Fields","key","title","STRUCT","definitions","STRING","optional","NUMBER","help","BOOLEAN","options","TEXT","isAdcHub","hubUrl","startsWith","getFieldProfiles","url","formatter","ShareProfileConstants","map","ModalRouteDecorator","ShareProfileDecorator","hubEntry","favT","socket","formValue","useMemo","entry","generic","user","connectivityV4","connectivityV6","misc","toFormEntry","formDefinitions","nullOption","text","translate","isNew","formRef","RouteModal","className","onApprove","save","closable","icon","IconConstants","FAVORITE","onFieldChanged","hasChanges","includes","hub_url","share_profile","Promise","resolve","onFieldSetting","fieldOptions","undefined","Object","assign","factory","Select","transformer","template","format","parse","onSave","changedFields","updatedEntryFields","post","patch","fieldDefinitions","sourceValue","params","entryId","get","getIcon","state","CONNECTING","CONNECTED","DISCONNECTED","width","cellData","rowDataGetter","location","navigate","handleCreateSession","HubActions","createSession","sessionStore","HubSessionStore","handleRemoveSession","removeSession","current_hub_id","Icon","onClick","getClickAction","str","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","FavoriteHubCreateActions","create","displayName","access","FAVORITE_HUBS_EDIT","CREATE","handler","FavoriteHubEditActions","edit","EDIT","itemData","hub","remove","REMOVE","confirmation","content","approveCaption","rejectCaption","delete","FavoriteHubActionModule","moduleId","FAVORITE_HUBS","FavoriteHubEditActionMenu","moduleData","actions","FavoriteHubActionMenu","sendPassword","password","handleSetPassword","hasPassword","has_password","FavoriteHubPasswordActions","LOCK","input","inputProps","placeholder","change","FavoriteHubPasswordActionMenu","subId","PasswordCell","caption","hasAccess","editAccess","HUBS_EDIT","VirtualTable","rowClassNameGetter","rowData","connect_state","footerData","header","triggerIcon","button","remoteMenuId","direction","store","FavoriteHubStore","columnKey","cell","flexGrow","MenuConstants","FAVORITE_HUB","hideWidth","updateFavoriteHub","auto_connect","SocketService","formatProfileNameWithSize","profile","formatSize","size","profileToEnumValue"],"sourceRoot":""}
|