You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/dist/files_reminders-init.js

3 lines
36 KiB
JavaScript

/*! For license information please see files_reminders-init.js.LICENSE.txt */
(()=>{"use strict";var t,e,n,r={24539:(t,e,n)=>{var r=n(35810),i=n(53334);const o="set-reminder-menu",s=new r.hY({id:o,displayName:()=>(0,i.Tl)("files","Set reminder"),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alarm" viewBox="0 0 24 24"><path d="M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22A9,9 0 0,0 21,13A9,9 0 0,0 12,4M12.5,8H11V14L15.75,16.85L16.5,15.62L12.5,13.25V8M7.88,3.39L6.6,1.86L2,5.71L3.29,7.24L7.88,3.39M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72Z" /></svg>',enabled:()=>!0,exec:async()=>null,order:20});var a=n(85471),d=n(61338),l=n(26287),c=n(99498);const u=async(t,e)=>{const n=(0,c.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:t});return(await l.A.put(n,{dueDate:e.toISOString()})).data.ocs.data};var p,m=n(51651);!function(t){t.LaterToday="later-today",t.Tomorrow="tomorrow",t.ThisWeekend="this-weekend",t.NextWeek="next-week"}(p||(p={}));const h=t=>({[p.LaterToday]:()=>{const t=(0,m.A)(),e=(0,m.A)().startOf("day").add(18,"hour"),n=e.clone().subtract(1,"hour");return t.isSameOrAfter(n)?null:e.toDate()},[p.Tomorrow]:()=>(0,m.A)().add(1,"day").startOf("day").add(8,"hour").toDate(),[p.ThisWeekend]:()=>{const t=(0,m.A)();return[5,6,7].includes(t.isoWeekday())?null:(0,m.A)().startOf("isoWeek").add(5,"day").add(8,"hour").toDate()},[p.NextWeek]:()=>7===(0,m.A)().isoWeekday()?null:(0,m.A)().startOf("isoWeek").add(1,"week").add(8,"hour").toDate()}[t]()),f=()=>{const t=(0,m.A)().get("hour");return(0,m.A)().startOf("day").add(t+2,"hour").toDate()},g=t=>{let e={hour:"numeric",minute:"2-digit"};const n=(0,m.A)(t),r=(0,m.A)();return n.isSame(r,"date")||(e={...e,weekday:"short"}),n.isSame(r,"week")||(e={...e,month:"short",day:"numeric"}),t.toLocaleString((0,i.lO)(),e)},w=t=>t.toLocaleString((0,i.lO)(),{weekday:"long",hour:"numeric",minute:"2-digit",month:"long",day:"numeric"}),A=new r.hY({id:"clear-reminder",displayName:()=>(0,i.Tl)("files","Clear reminder"),title:t=>{const e=t.at(0),n=new Date(e.attributes["reminder-due-date"]);return"".concat((0,i.Tl)("files","Clear reminder")," ").concat(w(n))},iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alarm-off" viewBox="0 0 24 24"><path d="M8,3.28L6.6,1.86L5.74,2.57L7.16,4M16.47,18.39C15.26,19.39 13.7,20 12,20A7,7 0 0,1 5,13C5,11.3 5.61,9.74 6.61,8.53M2.92,2.29L1.65,3.57L3,4.9L1.87,5.83L3.29,7.25L4.4,6.31L5.2,7.11C3.83,8.69 3,10.75 3,13A9,9 0 0,0 12,22C14.25,22 16.31,21.17 17.89,19.8L20.09,22L21.36,20.73L3.89,3.27L2.92,2.29M22,5.72L17.4,1.86L16.11,3.39L20.71,7.25L22,5.72M12,6A7,7 0 0,1 19,13C19,13.84 18.84,14.65 18.57,15.4L20.09,16.92C20.67,15.73 21,14.41 21,13A9,9 0 0,0 12,4C10.59,4 9.27,4.33 8.08,4.91L9.6,6.43C10.35,6.16 11.16,6 12,6Z" /></svg>',enabled:t=>{if(1!==t.length)return!1;const e=t.at(0).attributes["reminder-due-date"];return Boolean(e)},async exec(t){if(t.fileid)try{return await(async t=>{const e=(0,c.KT)("/apps/files_reminders/api/v1/{fileId}",{fileId:t});return(await l.A.delete(e)).data.ocs.data})(t.fileid),a.Ay.set(t.attributes,"reminder-due-date",""),(0,d.Ic)("files:node:updated",t),!0}catch(t){return!1}return null},order:19});var v=n(85168);const b=(0,n(53529).YK)().setApp("files_reminders").detectUser().build();var y=n(85072),N=n.n(y),x=n(97825),_=n.n(x),E=n(77659),C=n.n(E),T=n(55056),D=n.n(T),S=n(10540),L=n.n(S),O=n(41113),P=n.n(O),I=n(19672),k={};k.styleTagTransform=P(),k.setAttributes=D(),k.insert=C().bind(null,"head"),k.domAPI=_(),k.insertStyleElement=L(),N()(I.A,k),I.A&&I.A.locals&&I.A.locals;const R={dateTimePreset:p.LaterToday,label:(0,i.Tl)("files_reminders","Later today"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for later today"),dateString:"",verboseDateString:""},$={dateTimePreset:p.Tomorrow,label:(0,i.Tl)("files_reminders","Tomorrow"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for tomorrow"),dateString:"",verboseDateString:""},F={dateTimePreset:p.ThisWeekend,label:(0,i.Tl)("files_reminders","This weekend"),ariaLabel:(0,i.Tl)("files_reminders","Set reminder for this weekend"),dateString:"",verboseDateString:""},j={dateT
//# sourceMappingURL=files_reminders-init.js.map?v=72563e836c2854875acc