| Server IP : 193.86.120.172 / Your IP : 216.73.216.67 Web Server : Apache/2.4.63 (Unix) System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64 User : kubec ( 1026) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /volume1/@appstore/SynologyPhotos/ui/ |
Upload File : |
"use strict";(self.webpackChunkFotoReactLibrary=self.webpackChunkFotoReactLibrary||[]).push([["651"],{78167:function(e,t,a){a.r(t),a.d(t,{default:function(){return ee}});var i=a(76150),o=a(7409),r=a(28395),n=a(67294),s=a(15593),l=a(79905),u=function(){return n.createElement("section",{className:"synofoto-photo-request-dialog-section"},n.createElement("p",null,(0,l.n6)("photo_request","dialog_desc")))},d=a(37865),c=a(59435),p=a(45697),m=a.n(p),f=a(47407),b=a(46579);function h(e){var t=e.link,a=e.showFooterMessage,i=(0,n.useRef)(null);return n.createElement("section",{className:"synofoto-photo-request-dialog-section"},n.createElement("header",{className:"synofoto-photo-request-dialog-section__header"},(0,l.n6)("photo_request","request_link")),n.createElement("div",{className:"synofoto-photo-request-dialog-section__request-link"},n.createElement("input",{readOnly:!0,type:"text",value:t,ref:i,onClick:function(){i.current.select()}}),n.createElement(f.Z,{className:"synofoto-icon-button-grey",dataTestId:"copy-btn",handler:function(){(0,b.H)(i),a((0,l.n6)("shared","copy_to_clipboard"),!1)},iconCls:"copy-btn-icon"})))}h.propTypes={link:m().string,showFooterMessage:m().func},h.defaultProps={link:"",showFooterMessage:function(){}};var _=a(94184),g=a.n(_),E=a(12258),v=a(96904),I=a(10656),y=a(8323),S=a(75690),q=(0,n.forwardRef)(function(e,t){var a=e.storeDispatch,i=e.isFileSizeValid,o=e.enableFileSize,r=e.fileSize,s=e.enableExpiration,u=e.expiration,d=(0,n.useRef)(null);(0,n.useImperativeHandle)(t,function(){return{focusFileSizeInput:function(){d.current.focus()}}});var c=g()("synofoto-photo-request-dialog-section__file-size-input",{invalid:!i});return n.createElement("section",{className:"synofoto-photo-request-dialog-section"},n.createElement("header",{className:"synofoto-photo-request-dialog-section__header"},(0,l.n6)("shared","link_protection")),n.createElement("div",{className:"synofoto-photo-request-dialog-section__link-protection"},n.createElement(E.Z,{className:"synofoto-photo-request-dialog-section__file-size",checked:o,labelText:(0,l.n6)("photo_request","file_size_limit"),onChange:function(e){var t=e.target.checked;a({enableFileSize:t}),t&&void 0===r&&a({fileSize:25,isFileSizeValid:!0})}}),n.createElement("input",{className:c,ref:d,"data-testid":"file-size-input","data-tooltip-id":v.ZP.GLOBAL_WARNING_TOOLTIP_ID,"data-tooltip-place":"top-start","data-tooltip-content":i?"":(0,y.Z)((0,l.n6)("common","input_value_between"),"1","3000"),disabled:!o,type:"text",value:void 0===r?"":r,onChange:function(e){if(!e.target.value.trim()){a({fileSize:void 0,isFileSizeValid:!1});return}var t=parseInt(e.target.value,10);isNaN(t)||a({fileSize:t,isFileSizeValid:t<=3e3&&t>0})}}),n.createElement("div",{className:"synofoto-photo-request-dialog-section__file-size-unit"},"MB"),n.createElement(E.Z,{className:"synofoto-photo-request-dialog-section__expiration",checked:s,labelText:(0,l.n6)("shared","enable_expire_date"),onChange:function(e){var t=e.target.checked,i=t?S.yx.getNowTimestampEndOf()+604800:0;a({enableExpiration:t,expiration:i})}}),n.createElement(I._,{className:"synofoto-photo-request-dialog-section__date-picker",showCalendarIcon:!0,disabled:!s,value:u,minTimestamp:S.yx.getNowTimestamp(),onChange:function(e,t){if(!t){a({expiration:0});return}a({expiration:t})},popperPlacement:"top",unit:"day"})))});q.propTypes={storeDispatch:m().func.isRequired,isFileSizeValid:m().bool.isRequired,enableFileSize:m().bool,fileSize:m().number,enableExpiration:m().bool,expiration:m().number},q.defaultProps={enableFileSize:!1,fileSize:void 0,enableExpiration:!1,expiration:0};var N={isSubjectValid:m().bool.isRequired,isSubjectDestinationInterlock:m().bool.isRequired,description:m().string.isRequired,subject:m().string.isRequired,storeDispatch:m().func.isRequired},P=(0,n.forwardRef)(function(e,t){var a=e.description,i=e.isSubjectValid,r=e.isSubjectDestinationInterlock,s=e.subject,u=e.storeDispatch,d=(0,n.useRef)(null);(0,n.useImperativeHandle)(t,function(){return{focusSubjectInput:function(){var e;null===(e=d.current)||void 0===e||e.focus()}}});var c=g()("synofoto-photo-request-dialog-section__subject",{invalid:!i});return n.createElement("section",{className:"synofoto-photo-request-dialog-section"},n.createElement("header",{className:"synofoto-photo-request-dialog-section__header"},(0,l.n6)("photo_request","subject")),n.createElement("input",{className:c,ref:d,"data-testid":"photo-request-subject-input","data-tooltip-id":v.ZP.GLOBAL_WARNING_TOOLTIP_ID,"data-tooltip-content":i?"":(0,l.n6)("photo_request","hint_empty_subject"),"data-tooltip-place":"top-start",type:"text",value:s,onChange:function(e){var t=e.target.value;if(!(t.length>50)){var a=(0,o._)({subject:t},!i&&{isSubjectValid:!0});r&&(a.path=t?"/PhotoRequest/".concat(t.trim().replace(v.wP,"_")):"/PhotoRequest"),u(a)}}}),n.createElement("textarea",{className:"synofoto-photo-request-dialog-section__description","data-testid":"photo-request-description-input",placeholder:(0,l.n6)("photo_request","description_placeholder").replace("\\n","\n"),onChange:function(e){e.target.value.length>100||u({description:e.target.value})},value:a}))});P.propTypes=N;var T=a(35104),M=a(64963);function R(e){var t=e.albumName,a=e.storeDispatch,i=e.hasTargetAlbum,o=e.disabled,r=(0,s.I0)(),u=function(){r((0,M.SJ)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.name,i=e.albumId,o=void 0===i?v.vN.EMPTY_ID:i,r=e.albumPassphrase;a({albumName:t,albumId:o,albumPassphrase:void 0===r?v.vN.EMPTY_ALBUM_PASSPHRASE:r,hasTargetAlbum:!0})}))},d=g()("synofoto-photo-request-dialog-section__add-to-album",{disabled:o}),c=g()("synofoto-photo-request-dialog-section__choose-album",{disabled:!i});return n.createElement("section",{className:"synofoto-photo-request-dialog-section"},n.createElement("header",{className:"synofoto-photo-request-dialog-section__header"},(0,l.n6)("action","add_to_album")),n.createElement("div",{className:d,role:"form"},n.createElement(E.Z,{disabled:o,checked:i,labelText:(0,l.n6)("photo_request","add_to_album_info"),onChange:function(e){e.target.checked?u():a({albumName:v.vN.EMPTY_ALBUM_NAME,albumId:v.vN.EMPTY_ID,albumPassphrase:v.vN.EMPTY_ALBUM_PASSPHRASE,hasTargetAlbum:!1})}}),n.createElement("div",{className:c},n.createElement("input",{readOnly:!0,disabled:o||!i,type:"text",className:"synofoto-photo-request-dialog-section__album-name",value:t}),n.createElement(f.Z,{className:"synofoto-icon-button-grey",disabled:o||!i,iconCls:"menu-album-btn-icon",dataTestId:"select-album-btn",handler:u}),!o&&n.createElement(T.Z,{text:(0,l.n6)("photo_request","add_to_album_note")}))))}R.propTypes={albumName:m().string,storeDispatch:m().func.isRequired,hasTargetAlbum:m().bool.isRequired,disabled:m().bool},R.defaultProps={albumName:"",disabled:!1};var x=a(8768),A=a(9459),z=a(88528),F=(0,n.forwardRef)(function(e,t){var a=e.storeDispatch,i=e.isFolderValid,o=e.errorMessage,r=e.library,u=e.path,d=e.disabled,c=(0,s.I0)(),p=(0,n.useRef)();(0,n.useImperativeHandle)(t,function(){return{focusFolderInput:function(){p.current.focus()}}});var m=g()("synofoto-photo-request-dialog-section__folder",{disabled:d}),b=g()("synofoto-photo-request-dialog-section__folder-input",{invalid:!i}),h=(0,z.h)(r)+u;return n.createElement("section",{className:"synofoto-photo-request-dialog-section"},n.createElement("header",{className:"synofoto-photo-request-dialog-section__header"},(0,l.n6)("photo_request","destination_folder")),n.createElement("p",null,(0,l.n6)("photo_request","destination_folder_info")),n.createElement(A.Z,{height:12}),n.createElement("div",{className:m,role:"form"},n.createElement("input",{ref:p,type:"text",value:h,className:b,"data-tooltip-id":v.ZP.GLOBAL_WARNING_TOOLTIP_ID,"data-tooltip-content":i?"":o,"data-tooltip-place":"top-start",placeholder:(0,l.n6)("photo_request","hint_empty_destination_folder_placeholder"),disabled:d,readOnly:!0}),n.createElement(f.Z,{className:"synofoto-icon-button-grey",handler:function(){c((0,M.mP)(r,function(e,t,i){a({library:e,path:t,folderId:i,isSubjectDestinationInterlock:!1,folderErrorMessage:""})}))},disabled:d,iconCls:"navigate-folder-btn-icon",dataTestId:"select-folder-btn"})))});F.propTypes={storeDispatch:m().func.isRequired,library:m().string,path:m().string,disabled:m().bool,errorMessage:m().string,isFolderValid:m().bool},F.defaultProps={library:x.Z.PERSONAL,path:"",disabled:!1,errorMessage:"",isFolderValid:!0};var j=a(11617),k={library:m().string.isRequired,path:m().string.isRequired,id:m().number.isRequired},D={id:m().number,name:m().string.isRequired,passphrase:m().string},L={passphrase:m().string.isRequired,subject:m().string.isRequired,description:m().string.isRequired,sharingLink:m().string.isRequired,folderId:m().number,library:m().string.isRequired,folderHomePath:m().string.isRequired,isFolderValid:m().bool.isRequired,albumName:m().string.isRequired,albumId:m().number,albumPassphrase:m().string.isRequired,filesizeLimit:m().number.isRequired,expiration:m().number.isRequired},V={dispatch:m().func,confirmText:m().string,dialogTitle:m().string,handleApply:m().func.isRequired,handleCancel:m().func.isRequired,folderInfo:m().shape(k),albumInfo:m().shape(D),editInfo:m().shape(L)},C=a(48134),Z=a(76408),O=a(99282),w=a(24460),H=a(67479),B=a(14324),Y=function(e){var t=(0,B.Z)(e,["passphrase","subject","description","sharingLink","albumName","albumId","albumPassphrase","isFolderValid","library","folderId","expiration"]),a=!!e.filesizeLimit,i={path:e.folderHomePath,hasTargetAlbum:!!e.albumName,enableFileSize:a,fileSize:a?e.filesizeLimit/1048576:25,enableExpiration:!!e.expiration};return(0,o._)({},t,i)},G=function(){return(0,y.Z)((0,l.n6)("photo_request","default_subject"),(0,H.aV)())},U=function(){return{subject:G()}},W=function(e,t){var a;return e||t===v.El.MANAGE?{library:e?x.Z.PERSONAL_SPACE:x.Z.TEAM_SPACE,path:""===(a=G())?"/PhotoRequest":"/PhotoRequest/".concat(a.trim().replace(v.wP,"_"))}:{library:x.Z.TEAM_SPACE,path:""}},J={albumId:v.vN.EMPTY_ID,albumName:v.vN.EMPTY_ALBUM_NAME,albumPassphrase:v.vN.EMPTY_ALBUM_PASSPHRASE,description:"",expiration:0,fileSize:25,folderId:v.vN.EMPTY_ID,isFolderValid:!0,library:"",sharingLink:"",passphrase:"",path:"",subject:"",enableExpiration:!1,enableFileSize:!1,folderErrorMessage:(0,l.n6)("photo_request","hint_folder_path_not_found"),footerMessage:"",isFooterErrorMessage:!1,footerMsgTimeoutId:0,hasTargetAlbum:!1,isSubjectDestinationInterlock:!0,isSubjectValid:!0,isFileSizeValid:!0},K=["folderErrorMessage","footerMessage","isFooterErrorMessage","footerMsgTimeoutId"],Q=function(e,t){return(0,o._)({},e,t)},X=function(e){return 1048576*e},$=function(e){var t,a,p,m,f,b,_,g,E,I,y,S,N,T,x,A,z=e.dispatch,k=e.confirmText,D=e.dialogTitle,L=e.handleApply,V=e.handleCancel,H=e.folderInfo,B=e.albumInfo,G=e.editInfo,$=(0,s.v9)(Z.Z.getEnableHomeService),ee=(0,s.v9)(Z.Z.getTeamSpacePermission),et=(0,n.useRef)(null),ea=(0,n.useRef)(null),ei=(0,n.useRef)(null),eo=(a=(t={editInfo:G,folderInfo:H,albumInfo:B,enableHomeService:$,teamSpacePermission:ee}).editInfo,p=t.folderInfo,m=t.albumInfo,f=t.enableHomeService,b=t.teamSpacePermission,T=(N=(0,w._)((0,n.useReducer)(Q,J,(g=(_={editInfo:a,folderInfo:p,albumInfo:m,enableHomeService:f,teamSpacePermission:b}).albumInfo,E=_.editInfo,I=_.enableHomeService,y=_.folderInfo,S=_.teamSpacePermission,function(e){return E?(0,o._)((0,O._)((0,o._)({},e),{isSubjectDestinationInterlock:!1}),Y(E)):y?(0,o._)((0,O._)((0,o._)({},e),{isSubjectDestinationInterlock:!1}),U(),{library:y.library,path:y.path,folderId:y.id}):g?(0,o._)((0,O._)((0,o._)({},e),{isSubjectDestinationInterlock:!0}),U(),W(I,S),{albumId:g.id,albumName:g.name,albumPassphrase:g.passphrase,hasTargetAlbum:!0}):(0,o._)((0,O._)((0,o._)({},e),{isSubjectDestinationInterlock:!0}),U(),W(I,S))})),2))[0],x=N[1],A=(0,n.useRef)(T),{store:T,storeDispatch:x,isDirty:function(){return -1!==Object.keys(T).findIndex(function(e){return!K.includes(e)&&T[e]!==A.current[e]})}}),er=eo.store,en=eo.storeDispatch,es=eo.isDirty,el=function(e,t){clearTimeout(er.footerMsgTimeoutId),en({footerMessage:e,isFooterErrorMessage:t});var a=setTimeout(function(){en({footerMessage:"",isFooterErrorMessage:!1})},5e3);en({footerMsgTimeoutId:a})},eu=function(){var e=er.subject.trim(),t=er.path.trim();if(!(0,j.mI)(e,[j.TM]).isValid){en({subject:e,isSubjectValid:!1}),el((0,l.n6)("app","partial_invalid_settings"),!0),et.current.focusSubjectInput();return}if(!(0,j.mI)(t,[j.TM]).isValid){en({path:t,isFolderValid:!1,folderErrorMessage:(0,l.n6)("photo_request","hint_empty_destination_folder")}),el((0,l.n6)("app","partial_invalid_settings"),!0),ea.current.focusFolderInput();return}if(!er.isFolderValid){en({folderErrorMessage:(0,l.n6)("photo_request","hint_folder_path_not_found")}),el((0,l.n6)("app","partial_invalid_settings"),!0),ea.current.focusFolderInput();return}if(er.enableFileSize&&!er.isFileSizeValid){el((0,l.n6)("app","partial_invalid_settings"),!0),ei.current.focusFileSizeInput();return}if(L(),G){if(!es())return;var a,i,r={passphrase:er.passphrase};e!==G.subject&&(r.subject=e),er.description!==G.description&&(r.description=er.description),(er.library!==G.library||er.path!==G.folderHomePath)&&(r.library=er.library,r.folderHomePath=t),er.albumPassphrase!==G.albumPassphrase&&(r.albumPassphrase=er.albumPassphrase),er.fileSize!==G.filesizeLimit&&(r.filesizeLimit=er.enableFileSize?X(er.fileSize):0),er.expiration!==G.expiration&&(r.expiration=er.enableExpiration?er.expiration:0);var n=(0,o._)({},r);er.albumId!==G.albumId&&(n.albumId=null!==(a=er.albumId)&&void 0!==a?a:-1),void 0!==n.albumId&&void 0!==n.albumPassphrase&&delete n[""!==n.albumPassphrase?"albumId":"albumPassphrase"];var s=(0,o._)({},r);er.albumId!==G.albumId&&(s.albumId=null!==(i=er.albumId)&&void 0!==i?i:null),er.albumName!==G.albumName&&(s.albumName=er.albumName),(er.library!==G.library||t!==G.folderHomePath)&&er.folderId&&(s.folderId=er.folderId),z((0,M.tC)({apiParam:n,storeParam:s}))}else{var u={passphrase:er.passphrase,subject:e,description:er.description,library:er.library,folderHomePath:t,filesizeLimit:er.enableFileSize?X(er.fileSize):0,expiration:er.enableExpiration?er.expiration:0};er.hasTargetAlbum&&(""!==er.albumPassphrase?u.albumPassphrase=er.albumPassphrase:u.albumId=er.albumId);var d=H||B;z((0,M.qo)({param:u,shouldUpdatePhotoRequestList:!d}))}};return n.createElement(c.Z,{isOpen:!0,showCancel:!0,className:"synofoto-photo-request-dialog",title:D,confirmText:k,handleCancel:function(){return(0,i._)(function(){var e;return(0,r.Jh)(this,function(t){switch(t.label){case 0:if(!es())return V(),[2];return[4,(0,C.Z)()];case 1:return(e=t.sent().type)===v.uE.SAVE_AND_CLOSE?eu():e===v.uE.LEAVE&&V(),[2]}})})()},handleConfirm:eu,footerMessage:er.footerMessage?n.createElement(d.Z,{message:er.footerMessage,isError:er.isFooterErrorMessage,iconType:er.isFooterErrorMessage?"none":"success"}):null,contentPadding:v.k3.TOP_AND_BOTTOM,content:n.createElement("div",{className:"synofoto-photo-request-dialog-content"},n.createElement(u,null),n.createElement(P,{ref:et,storeDispatch:en,isSubjectDestinationInterlock:er.isSubjectDestinationInterlock,isSubjectValid:er.isSubjectValid,description:er.description,subject:er.subject}),er.sharingLink&&n.createElement(h,{link:er.sharingLink,showFooterMessage:el}),n.createElement(F,{ref:ea,storeDispatch:en,errorMessage:er.folderErrorMessage,disabled:void 0!==H,isFolderValid:er.isFolderValid,library:er.library,path:er.path}),n.createElement(R,{storeDispatch:en,disabled:void 0!==B,hasTargetAlbum:er.hasTargetAlbum,albumName:er.albumName}),n.createElement(q,{ref:ei,storeDispatch:en,enableFileSize:er.enableFileSize,fileSize:er.fileSize,enableExpiration:er.enableExpiration,expiration:er.expiration,isFileSizeValid:er.isFileSizeValid}))})};$.propTypes=V,$.defaultProps={dispatch:function(){},confirmText:"",dialogTitle:"",folderInfo:void 0,albumInfo:void 0,editInfo:void 0};var ee=$},48134:function(e,t,a){a.d(t,{Z:function(){return c}});var i=a(67294),o=a(73935),r=a(15593),n=a(42376),s=a(47524),l=a(96904),u=a(79905),d=a(94057);function c(){var e=s.Z.getStore(),t=document.body.appendChild(document.createElement("div"));return new Promise(function(a){var s={showClose:!0,showCancel:!0,showConfirm:!0,isOpen:!0,role:"alertdialog",message:(0,u.n6)("app","confirm_not_saved_leave"),closeText:(0,u.n6)("action","leave"),cancelText:(0,u.n6)("action","cancel"),confirmText:(0,u.n6)("action","save_and_close"),closeHandler:function(){a({type:l.uE.LEAVE})},cancelHandler:function(){a({type:l.uE.CANCEL})},confirmHandler:function(){a({type:l.uE.SAVE_AND_CLOSE})}};o.render(i.createElement(r.zt,{store:e},i.createElement(n.Z,s)),t)}).finally(function(){(0,d.P)(t)})}}}]);