123 |
- /*! For license information please see user-status-modal-8299.js.LICENSE.txt */
- "use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[8299],{31481:(t,e,s)=>{s.d(e,{Z:()=>o});var a=s(87537),n=s.n(a),r=s(23645),i=s.n(r)()(n());i.push([t.id,".clear-at-select[data-v-bfc4d14a]{display:flex;margin-bottom:10px;align-items:center}.clear-at-select__label[data-v-bfc4d14a]{margin-right:12px}.clear-at-select__select[data-v-bfc4d14a]{flex-grow:1}","",{version:3,sources:["webpack://./apps/user_status/src/components/ClearAtSelect.vue"],names:[],mappings:"AACA,kCACC,YAAA,CACA,kBAAA,CACA,kBAAA,CAEA,yCACC,iBAAA,CAGD,0CACC,WAAA",sourcesContent:["\n.clear-at-select {\n\tdisplay: flex;\n\tmargin-bottom: 10px;\n\talign-items: center;\n\n\t&__label {\n\t\tmargin-right: 12px;\n\t}\n\n\t&__select {\n\t\tflex-grow: 1;\n\t}\n}\n"],sourceRoot:""}]);const o=i},30871:(t,e,s)=>{s.d(e,{Z:()=>o});var a=s(87537),n=s.n(a),r=s(23645),i=s.n(r)()(n());i.push([t.id,".custom-input[data-v-ac7b15ee]{display:flex;width:100%}.custom-input__emoji-button[data-v-ac7b15ee]{min-height:36px;padding:0;border:2px solid var(--color-border-maxcontrast);border-right:none;border-radius:var(--border-radius) 0 0 var(--border-radius)}.custom-input__emoji-button[data-v-ac7b15ee]:hover{border-color:var(--color-primary-element)}.custom-input__container[data-v-ac7b15ee]{width:100%}.custom-input__container input[data-v-ac7b15ee]{width:100%;margin:0;border-radius:0 var(--border-radius) var(--border-radius) 0}","",{version:3,sources:["webpack://./apps/user_status/src/components/CustomMessageInput.vue"],names:[],mappings:"AACA,+BACC,YAAA,CACA,UAAA,CAEA,6CACC,eAAA,CACA,SAAA,CACA,gDAAA,CACA,iBAAA,CACA,2DAAA,CAEA,mDACC,yCAAA,CAIF,0CACC,UAAA,CAEA,gDACC,UAAA,CACA,QAAA,CACA,2DAAA",sourcesContent:["\n.custom-input {\n\tdisplay: flex;\n\twidth: 100%;\n\n\t&__emoji-button {\n\t\tmin-height: 36px;\n\t\tpadding: 0;\n\t\tborder: 2px solid var(--color-border-maxcontrast);\n\t\tborder-right: none;\n\t\tborder-radius: var(--border-radius) 0 0 var(--border-radius);\n\n\t\t&:hover {\n\t\t\tborder-color: var(--color-primary-element);\n\t\t}\n\t}\n\n\t&__container {\n\t\twidth: 100%;\n\n\t\tinput {\n\t\t\twidth: 100%;\n\t\t\tmargin: 0;\n\t\t\tborder-radius: 0 var(--border-radius) var(--border-radius) 0;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const o=i},72196:(t,e,s)=>{s.d(e,{Z:()=>o});var a=s(87537),n=s.n(a),r=s(23645),i=s.n(r)()(n());i.push([t.id,".user-status-online-select__label[data-v-342d77f0]{position:relative;display:block;margin:8px;padding:8px;padding-left:40px;border:2px solid var(--color-main-background);border-radius:var(--border-radius-large);background-color:var(--color-background-hover);background-position:8px center;background-size:24px}.user-status-online-select__label span[data-v-342d77f0],.user-status-online-select__label[data-v-342d77f0]{cursor:pointer}.user-status-online-select__label span[data-v-342d77f0]{position:absolute;top:calc(50% - 12px);left:8px;display:block;width:24px;height:24px}.user-status-online-select__input:checked+.user-status-online-select__label[data-v-342d77f0],.user-status-online-select__input:focus+.user-status-online-select__label[data-v-342d77f0],.user-status-online-select__label[data-v-342d77f0]:hover{border-color:var(--color-primary-element)}.user-status-online-select__label[data-v-342d77f0]:active{border-color:var(--color-border-dark)}.user-status-online-select__subline[data-v-342d77f0]{display:block;color:var(--color-text-lighter)}","",{version:3,sources:["webpack://./apps/user_status/src/components/OnlineStatusSelect.vue"],names:[],mappings:"AAMC,mDACC,iBAAA,CACA,aAAA,CACA,UANc,CAOd,WAPc,CAQd,iBAAA,CACA,6CAAA,CACA,wCAAA,CACA,8CAAA,CACA,8BAAA,CACA,oBAdU,CAgBV,2GAEC,cAAA,CAGD,wDACC,iBAAA,CACA,oBAAA,CACA,QAvBa,CAwBb,aAAA,CACA,UA1BS,CA2BT,WA3BS,CA+BX,iPAGC,yCAAA,CAGD,0DACC,qCAAA,CAGD,qDACC,aAAA,CACA,+BAAA",sourcesContent:["\n@use 'sass:math';\n$icon-size: 24px;\n$label-padding: 8px;\n\n.user-status-online-select {\n\t&__label {\n\t\tposition: relative;\n\t\tdisplay: block;\n\t\tmargin: $label-padding;\n\t\tpadding: $label-padding;\n\t\tpadding-left: $icon-size + $label-padding * 2;\n\t\tborder: 2px solid var(--color-main-background);\n\t\tborder-radius: var(--border-radius-large);\n\t\tbackground-color: var(--color-background-hover);\n\t\tbackground-position: $label-padding center;\n\t\tbackground-size: $icon-size;\n\n\t\tspan,\n\t\t& {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\tspan {\n\t\t\tposition: absolute;\n\t\t\ttop: calc(50% - math.div($icon-size, 2));\n\t\t\tleft: $label-padding;\n\t\t\tdisplay: block;\n\t\t\twidth: $icon-size;\n\t\t\theight: $icon-size;\n\t\t}\n\t}\n\n\t&__input:checked + &__label,\n\t&__input:focus + &__label,\n\t&__label:hover {\n\t\tborder-color: var(--color-primary-element);\n\t}\n\n\t&__label:active {\n\t\tborder-color: var(--color-border-dark);\n\t}\n\n\t&__subline {\n\t\tdisplay: block;\n\t\tcolor: var(--color-text-lighter);\n\t}\n}\n\n"],sourceRoot:""}]);const o=i},66625:(t,e,s)=>{s.d(e,{Z:()=>o});var a=s(87537),n=s.n(a),r=s(23645),i=s.n(r)()(n());i.push([t.id,'.predefined-status__label[data-v-4b860ca9]{display:flex;flex-wrap:nowrap;justify-content:flex-start;flex-basis:100%;border-radius:var(--border-radius);align-items:center;min-height:44px}.predefined-status__label--icon[data-v-4b860ca9]{flex-basis:40px;text-align:center}.predefined-status__label--message[data-v-4b860ca9]{font-weight:bold;padding:0 6px}.predefined-status__label--clear-at[data-v-4b860ca9]{color:var(--color-text-maxcontrast)}.predefined-status__label--clear-at[data-v-4b860ca9]::before{content:" – "}.predefined-status__input:checked+.predefined-status__label[data-v-4b860ca9],.predefined-status__input:focus+.predefined-status__label[data-v-4b860ca9],.predefined-status__label[data-v-4b860ca9]:hover{background-color:var(--color-background-hover)}.predefined-status__label[data-v-4b860ca9]:active{background-color:var(--color-background-dark)}',"",{version:3,sources:["webpack://./PredefinedStatus.vue","webpack://./apps/user_status/src/components/PredefinedStatus.vue"],names:[],mappings:"AAAA,2CCEC,YACC,CAAA,gBACA,CAAA,0BACA,CAAA,eACA,CAAA,kCACA,CAAA,kBACA,CAAA,eACA,CAAA,iDAEA,eACC,CAAA,iBACA,CAAA,oDAGD,gBACC,CAAA,aACA,CAAA,qDAGD,mCACC,CAAA,6DAEA,aACC,CAAA,yMAKH,8CAGC,CAAA,kDAGD,6CACC",sourcesContent:['.predefined-status__label{display:flex;flex-wrap:nowrap;justify-content:flex-start;flex-basis:100%;border-radius:var(--border-radius);align-items:center;min-height:44px}.predefined-status__label--icon{flex-basis:40px;text-align:center}.predefined-status__label--message{font-weight:bold;padding:0 6px}.predefined-status__label--clear-at{color:var(--color-text-maxcontrast)}.predefined-status__label--clear-at::before{content:" – "}.predefined-status__input:checked+.predefined-status__label,.predefined-status__input:focus+.predefined-status__label,.predefined-status__label:hover{background-color:var(--color-background-hover)}.predefined-status__label:active{background-color:var(--color-background-dark)}',"\n.predefined-status {\n\t&__label {\n\t\tdisplay: flex;\n\t\tflex-wrap: nowrap;\n\t\tjustify-content: flex-start;\n\t\tflex-basis: 100%;\n\t\tborder-radius: var(--border-radius);\n\t\talign-items: center;\n\t\tmin-height: 44px;\n\n\t\t&--icon {\n\t\t\tflex-basis: 40px;\n\t\t\ttext-align: center;\n\t\t}\n\n\t\t&--message {\n\t\t\tfont-weight: bold;\n\t\t\tpadding: 0 6px;\n\t\t}\n\n\t\t&--clear-at {\n\t\t\tcolor: var(--color-text-maxcontrast);\n\n\t\t\t&::before {\n\t\t\t\tcontent: ' – ';\n\t\t\t}\n\t\t}\n\t}\n\n\t&__input:checked + &__label,\n\t&__input:focus + &__label,\n\t&__label:hover {\n\t\tbackground-color: var(--color-background-hover);\n\t}\n\n\t&__label:active {\n\t\tbackground-color: var(--color-background-dark);\n\t}\n}\n"],sourceRoot:""}]);const o=i},54792:(t,e,s)=>{s.d(e,{Z:()=>o});var a=s(87537),n=s.n(a),r=s(23645),i=s.n(r)()(n());i.push([t.id,".predefined-statuses-list[data-v-0473fee1]{display:flex;flex-direction:column;margin-bottom:10px}","",{version:3,sources:["webpack://./apps/user_status/src/components/PredefinedStatusesList.vue"],names:[],mappings:"AACA,2CACC,YAAA,CACA,qBAAA,CACA,kBAAA",sourcesContent:["\n.predefined-statuses-list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin-bottom: 10px;\n}\n"],sourceRoot:""}]);const o=i},60699:(t,e,s)=>{s.d(e,{Z:()=>o});var a=s(87537),n=s.n(a),r=s(23645),i=s.n(r)()(n());i.push([t.id,'.predefined-status[data-v-ba802d4c]{display:flex;flex-wrap:nowrap;justify-content:flex-start;flex-basis:100%;border-radius:var(--border-radius);align-items:center;min-height:44px}.predefined-status[data-v-ba802d4c]:hover,.predefined-status[data-v-ba802d4c]:focus{background-color:var(--color-background-hover)}.predefined-status[data-v-ba802d4c]:active{background-color:var(--color-background-dark)}.predefined-status__icon[data-v-ba802d4c]{flex-basis:40px;text-align:center}.predefined-status__message[data-v-ba802d4c]{font-weight:bold;padding:0 6px}.predefined-status__clear-at[data-v-ba802d4c]{color:var(--color-text-maxcontrast)}.predefined-status__clear-at[data-v-ba802d4c]::before{content:" – "}.backup-status__reset-button[data-v-ba802d4c]{justify-content:flex-end;display:flex;flex-grow:1}',"",{version:3,sources:["webpack://./PreviousStatus.vue","webpack://./apps/user_status/src/components/PreviousStatus.vue"],names:[],mappings:"AAAA,oCCCA,YACC,CAAA,gBACA,CAAA,0BACA,CAAA,eACA,CAAA,kCACA,CAAA,kBACA,CAAA,eACA,CAAA,oFAEA,8CAEC,CAAA,2CAGD,6CACC,CAAA,0CAGD,eACC,CAAA,iBACA,CAAA,6CAGD,gBACC,CAAA,aACA,CAAA,8CAGD,mCACC,CAAA,sDAEA,aACC,CAAA,8CAKF,wBACC,CAAA,YACA,CAAA,WACA",sourcesContent:['.predefined-status{display:flex;flex-wrap:nowrap;justify-content:flex-start;flex-basis:100%;border-radius:var(--border-radius);align-items:center;min-height:44px}.predefined-status:hover,.predefined-status:focus{background-color:var(--color-background-hover)}.predefined-status:active{background-color:var(--color-background-dark)}.predefined-status__icon{flex-basis:40px;text-align:center}.predefined-status__message{font-weight:bold;padding:0 6px}.predefined-status__clear-at{color:var(--color-text-maxcontrast)}.predefined-status__clear-at::before{content:" – "}.backup-status__reset-button{justify-content:flex-end;display:flex;flex-grow:1}',"\n.predefined-status {\n\tdisplay: flex;\n\tflex-wrap: nowrap;\n\tjustify-content: flex-start;\n\tflex-basis: 100%;\n\tborder-radius: var(--border-radius);\n\talign-items: center;\n\tmin-height: 44px;\n\n\t&:hover,\n\t&:focus {\n\t\tbackground-color: var(--color-background-hover);\n\t}\n\n\t&:active{\n\t\tbackground-color: var(--color-background-dark);\n\t}\n\n\t&__icon {\n\t\tflex-basis: 40px;\n\t\ttext-align: center;\n\t}\n\n\t&__message {\n\t\tfont-weight: bold;\n\t\tpadding: 0 6px;\n\t}\n\n\t&__clear-at {\n\t\tcolor: var(--color-text-maxcontrast);\n\n\t\t&::before {\n\t\t\tcontent: ' – ';\n\t\t}\n\t}\n}\n.backup-status {\n\t&__reset-button {\n\t\tjustify-content: flex-end;\n\t\tdisplay: flex;\n\t\tflex-grow: 1;\n\t}\n}\n"],sourceRoot:""}]);const o=i},17982:(t,e,s)=>{s.d(e,{Z:()=>o});var a=s(87537),n=s.n(a),r=s(23645),i=s.n(r)()(n());i.push([t.id,".set-status-modal[data-v-45c621ba]{padding:8px 20px 20px 20px}.set-status-modal__header[data-v-45c621ba]{text-align:center;font-weight:bold;margin:15px 0}.set-status-modal__online-status[data-v-45c621ba]{display:grid;grid-template-columns:1fr 1fr}.set-status-modal__custom-input[data-v-45c621ba]{display:flex;width:100%;margin-bottom:10px}.set-status-modal__automation-hint[data-v-45c621ba]{display:flex;width:100%;margin-bottom:10px;color:var(--color-text-maxcontrast)}.set-status-modal .status-buttons[data-v-45c621ba]{display:flex;padding:3px;padding-left:0;gap:3px}@media only screen and (max-width: 500px){.set-status-modal__online-status[data-v-45c621ba]{grid-template-columns:none !important}}","",{version:3,sources:["webpack://./apps/user_status/src/components/SetStatusModal.vue"],names:[],mappings:"AAEA,mCACC,0BAAA,CAEA,2CACC,iBAAA,CACA,gBAAA,CACA,aAAA,CAGD,kDACC,YAAA,CACA,6BAAA,CAGD,iDACC,YAAA,CACA,UAAA,CACA,kBAAA,CAGD,oDACC,YAAA,CACA,UAAA,CACA,kBAAA,CACA,mCAAA,CAGD,mDACC,YAAA,CACA,WAAA,CACA,cAAA,CACA,OAAA,CAIF,0CACC,kDACC,qCAAA,CAAA",sourcesContent:["\n\n.set-status-modal {\n\tpadding: 8px 20px 20px 20px;\n\n\t&__header {\n\t\ttext-align: center;\n\t\tfont-weight: bold;\n\t\tmargin: 15px 0;\n\t}\n\n\t&__online-status {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: 1fr 1fr;\n\t}\n\n\t&__custom-input {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 10px;\n\t}\n\n\t&__automation-hint {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t\tmargin-bottom: 10px;\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t.status-buttons {\n\t\tdisplay: flex;\n\t\tpadding: 3px;\n\t\tpadding-left:0;\n\t\tgap: 3px;\n\t}\n}\n\n@media only screen and (max-width: 500px) {\n\t.set-status-modal__online-status {\n\t\tgrid-template-columns: none !important;\n\t}\n}\n\n"],sourceRoot:""}]);const o=i},31541:(t,e,s)=>{s.r(e),s.d(e,{default:()=>rt});var a=s(64024),n=s(70110),r=s.n(n),i=s(10861),o=s.n(i),l=s(31352),u=s(84387),c=s(80351),d=s.n(c),A=s(64039);const p=t=>{if(null===t)return(0,l.Iu)("user_status","Don't clear");if("end-of"===t.type)switch(t.time){case"day":return(0,l.Iu)("user_status","Today");case"week":return(0,l.Iu)("user_status","This week");default:return null}if("period"===t.type)return d().duration(1e3*t.time).humanize();if("_time"===t.type){const e=d()((0,A.n)()),s=d()(t.time,"X");return d().duration(e.diff(s)).humanize()}return null},_={name:"PredefinedStatus",filters:{clearAtFilter:p},props:{messageId:{type:String,required:!0},icon:{type:String,required:!0},message:{type:String,required:!0},clearAt:{type:Object,required:!1,default:null},selected:{type:Boolean,required:!1,default:!1}},computed:{id(){return"user-status-predefined-status-".concat(this.messageId)}},methods:{select(){this.$emit("select")}}};var C=s(93379),b=s.n(C),m=s(7795),g=s.n(m),v=s(90569),f=s.n(v),h=s(3565),x=s.n(h),y=s(19216),k=s.n(y),S=s(44589),w=s.n(S),B=s(66625),$={};$.styleTagTransform=w(),$.setAttributes=x(),$.insert=f().bind(null,"head"),$.domAPI=g(),$.insertStyleElement=k(),b()(B.Z,$),B.Z&&B.Z.locals&&B.Z.locals;var I=s(51900);const Z=(0,I.Z)(_,(function(){var t=this,e=t._self._c;return e("li",{staticClass:"predefined-status"},[e("input",{staticClass:"hidden-visually predefined-status__input",attrs:{id:t.id,type:"radio",name:"predefined-status"},domProps:{checked:t.selected},on:{change:t.select}}),t._v(" "),e("label",{staticClass:"predefined-status__label",attrs:{for:t.id}},[e("span",{staticClass:"predefined-status__label--icon",attrs:{"aria-hidden":"true"}},[t._v("\n\t\t\t"+t._s(t.icon)+"\n\t\t")]),t._v(" "),e("span",{staticClass:"predefined-status__label--message"},[t._v("\n\t\t\t"+t._s(t.message)+"\n\t\t")]),t._v(" "),e("span",{staticClass:"predefined-status__label--clear-at"},[t._v("\n\t\t\t"+t._s(t._f("clearAtFilter")(t.clearAt))+"\n\t\t")])])])}),[],!1,null,"4b860ca9",null).exports;var D=s(20629);const M={name:"PredefinedStatusesList",components:{PredefinedStatus:Z},props:{isCustomStatus:{type:Boolean,required:!0}},data:()=>({lastSelected:null}),computed:{...(0,D.rn)({predefinedStatuses:t=>t.predefinedStatuses.predefinedStatuses}),...(0,D.Se)(["statusesHaveLoaded"])},created(){this.$store.dispatch("loadAllPredefinedStatuses")},methods:{selectStatus(t){this.lastSelected=t.id,this.$emit("select-status",t)}}};var P=s(54792),T={};T.styleTagTransform=w(),T.setAttributes=x(),T.insert=f().bind(null,"head"),T.domAPI=g(),T.insertStyleElement=k(),b()(P.Z,T),P.Z&&P.Z.locals&&P.Z.locals;const E=(0,I.Z)(M,(function(){var t=this,e=t._self._c;return t.statusesHaveLoaded?e("ul",{staticClass:"predefined-statuses-list",attrs:{role:"radiogroup","aria-label":t.t("user_status","Predefined statuses")}},t._l(t.predefinedStatuses,(function(s){return e("PredefinedStatus",{key:s.id,attrs:{"message-id":s.id,icon:s.icon,message:s.message,"clear-at":s.clearAt,selected:!t.isCustomStatus&&t.lastSelected===s.id},on:{select:function(e){return t.selectStatus(s)}}})})),1):e("div",{staticClass:"predefined-statuses-list"},[e("div",{staticClass:"icon icon-loading-small"})])}),[],!1,null,"0473fee1",null).exports,j={name:"PreviousStatus",components:{NcButton:o()},props:{icon:{type:[String,null],required:!0},message:{type:String,required:!0}},methods:{select(){this.$emit("select")}}};var G=s(60699),q={};q.styleTagTransform=w(),q.setAttributes=x(),q.insert=f().bind(null,"head"),q.domAPI=g(),q.insertStyleElement=k(),b()(G.Z,q),G.Z&&G.Z.locals&&G.Z.locals;const N=(0,I.Z)(j,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"predefined-status backup-status",attrs:{tabindex:"0"},on:{keyup:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.select.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:t.select.apply(null,arguments)}],click:t.select}},[e("span",{staticClass:"predefined-status__icon"},[t._v("\n\t\t"+t._s(t.icon)+"\n\t")]),t._v(" "),e("span",{staticClass:"predefined-status__message"},[t._v("\n\t\t"+t._s(t.message)+"\n\t")]),t._v(" "),e("span",{staticClass:"predefined-status__clear-at"},[t._v("\n\t\t"+t._s(t.$t("user_status","Previously set"))+"\n\t")]),t._v(" "),e("div",{staticClass:"backup-status__reset-button"},[e("NcButton",{on:{click:t.select}},[t._v("\n\t\t\t"+t._s(t.$t("user_status","Reset status"))+"\n\t\t")])],1)])}),[],!1,null,"ba802d4c",null).exports;var O=s(21968),R=s.n(O);const z={name:"CustomMessageInput",components:{NcButton:o(),NcEmojiPicker:R()},props:{icon:{type:String,default:"😀"},message:{type:String,required:!0,default:()=>""},disabled:{type:Boolean,default:!1}},emits:["change","submit","icon-selected"],computed:{visibleIcon(){return this.icon||"😀"}},methods:{focus(){this.$refs.input.focus()},onChange(t){this.$emit("change",t.target.value)},setIcon(t){this.$emit("select-icon",t)}}};var Y=s(30871),F={};F.styleTagTransform=w(),F.setAttributes=x(),F.insert=f().bind(null,"head"),F.domAPI=g(),F.insertStyleElement=k(),b()(Y.Z,F),Y.Z&&Y.Z.locals&&Y.Z.locals;const U=(0,I.Z)(z,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"custom-input",attrs:{role:"group"}},[e("NcEmojiPicker",{attrs:{container:".custom-input"},on:{select:t.setIcon}},[e("NcButton",{staticClass:"custom-input__emoji-button",attrs:{type:"tertiary","aria-label":t.t("user_status","Emoji for your status message")}},[t._v("\n\t\t\t"+t._s(t.visibleIcon)+"\n\t\t")])],1),t._v(" "),e("div",{staticClass:"custom-input__container"},[e("label",{staticClass:"hidden-visually",attrs:{for:"user_status_message"}},[t._v("\n\t\t\t"+t._s(t.t("user_status","What is your status?"))+"\n\t\t")]),t._v(" "),e("input",{ref:"input",attrs:{id:"user_status_message",maxlength:"80",disabled:t.disabled,placeholder:t.$t("user_status","What is your status?"),type:"text"},domProps:{value:t.message},on:{input:t.onChange}})])],1)}),[],!1,null,"ac7b15ee",null).exports;var W=s(36456);const L={name:"ClearAtSelect",components:{NcSelect:s.n(W)()},props:{clearAt:{type:Object,default:null}},data:()=>({options:[{label:(0,l.Iu)("user_status","Don't clear"),clearAt:null},{label:(0,l.Iu)("user_status","30 minutes"),clearAt:{type:"period",time:1800}},{label:(0,l.Iu)("user_status","1 hour"),clearAt:{type:"period",time:3600}},{label:(0,l.Iu)("user_status","4 hours"),clearAt:{type:"period",time:14400}},{label:(0,l.Iu)("user_status","Today"),clearAt:{type:"end-of",time:"day"}},{label:(0,l.Iu)("user_status","This week"),clearAt:{type:"end-of",time:"week"}}]}),computed:{option(){return{clearAt:this.clearAt,label:p(this.clearAt)}}},methods:{select(t){t&&this.$emit("select-clear-at",t.clearAt)}}};var H=s(31481),Q={};Q.styleTagTransform=w(),Q.setAttributes=x(),Q.insert=f().bind(null,"head"),Q.domAPI=g(),Q.insertStyleElement=k(),b()(H.Z,Q),H.Z&&H.Z.locals&&H.Z.locals;const K=(0,I.Z)(L,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"clear-at-select"},[e("label",{staticClass:"clear-at-select__label",attrs:{for:"clearStatus"}},[t._v("\n\t\t"+t._s(t.$t("user_status","Clear status after"))+"\n\t")]),t._v(" "),e("NcSelect",{staticClass:"clear-at-select__select",attrs:{"input-id":"clearStatus",options:t.options,value:t.option,clearable:!1,placement:"top"},on:{"option:selected":t.select}})],1)}),[],!1,null,"bfc4d14a",null).exports,X={name:"OnlineStatusSelect",props:{checked:{type:Boolean,default:!1},icon:{type:String,required:!0},type:{type:String,required:!0},label:{type:String,required:!0},subline:{type:String,default:null}},computed:{id(){return"user-status-online-status-".concat(this.type)}},methods:{onChange(){this.$emit("select",this.type)}}};var V=s(72196),J={};J.styleTagTransform=w(),J.setAttributes=x(),J.insert=f().bind(null,"head"),J.domAPI=g(),J.insertStyleElement=k(),b()(V.Z,J),V.Z&&V.Z.locals&&V.Z.locals;const tt=(0,I.Z)(X,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"user-status-online-select"},[e("input",{staticClass:"hidden-visually user-status-online-select__input",attrs:{id:t.id,type:"radio",name:"user-status-online"},domProps:{checked:t.checked},on:{change:t.onChange}}),t._v(" "),e("label",{staticClass:"user-status-online-select__label",attrs:{for:t.id}},[t._v("\n\t\t"+t._s(t.label)+"\n\t\t"),e("span",{class:t.icon,attrs:{"aria-hidden":"true",role:"img"}}),t._v(" "),e("em",{staticClass:"user-status-online-select__subline"},[t._v(t._s(t.subline))])])])}),[],!1,null,"342d77f0",null).exports;var et=s(25108);const st={name:"SetStatusModal",components:{ClearAtSelect:K,CustomMessageInput:U,NcModal:r(),OnlineStatusSelect:tt,PredefinedStatusesList:E,PreviousStatus:N,NcButton:o()},mixins:[u.Z],data:()=>({clearAt:null,editedMessage:"",isCustomStatus:!0,isSavingStatus:!1,statuses:[{type:"online",label:(0,l.Iu)("user_status","Online"),icon:"icon-user-status-online"},{type:"away",label:(0,l.Iu)("user_status","Away"),icon:"icon-user-status-away"},{type:"dnd",label:(0,l.Iu)("user_status","Do not disturb"),subline:(0,l.Iu)("user_status","Mute all notifications"),icon:"icon-user-status-dnd"},{type:"invisible",label:(0,l.Iu)("user_status","Invisible"),subline:(0,l.Iu)("user_status","Appear offline"),icon:"icon-user-status-invisible"}]}),computed:{messageId(){return this.$store.state.userStatus.messageId},icon(){return this.$store.state.userStatus.icon},message(){return this.$store.state.userStatus.message||""},hasBackupStatus(){return this.messageId&&(this.backupIcon||this.backupMessage)},backupIcon(){return this.$store.state.userBackupStatus.icon||""},backupMessage(){return this.$store.state.userBackupStatus.message||""},resetButtonText(){return this.backupIcon&&this.backupMessage?this.$t("user_status",'Reset status to "{icon} {message}"',{icon:this.backupIcon,message:this.backupMessage}):this.backupMessage?this.$t("user_status",'Reset status to "{message}"',{message:this.backupMessage}):this.backupIcon?this.$t("user_status",'Reset status to "{icon}"',{icon:this.backupIcon}):this.$t("user_status","Reset status")}},watch:{message:{immediate:!0,handler(t){this.editedMessage=t}}},mounted(){this.$store.dispatch("fetchBackupFromServer"),null!==this.$store.state.userStatus.clearAt&&(this.clearAt={type:"_time",time:this.$store.state.userStatus.clearAt})},methods:{closeModal(){this.$emit("close")},setIcon(t){this.isCustomStatus=!0,this.$store.dispatch("setCustomMessage",{message:this.message,icon:t,clearAt:this.clearAt}),this.$nextTick((()=>{this.$refs.customMessageInput.focus()}))},setMessage(t){this.isCustomStatus=!0,this.editedMessage=t},setClearAt(t){this.clearAt=t},selectPredefinedMessage(t){this.isCustomStatus=!1,this.clearAt=t.clearAt,this.$store.dispatch("setPredefinedMessage",{messageId:t.id,clearAt:t.clearAt})},async saveStatus(){if(!this.isSavingStatus){try{this.isSavingStatus=!0,this.isCustomStatus&&await this.$store.dispatch("setCustomMessage",{message:this.editedMessage,icon:this.icon,clearAt:this.clearAt})}catch(t){return(0,a.x2)(this.$t("user_status","There was an error saving the status")),et.debug(t),void(this.isSavingStatus=!1)}this.isSavingStatus=!1,this.closeModal()}},async clearStatus(){try{this.isSavingStatus=!0,await this.$store.dispatch("clearMessage")}catch(t){return(0,a.x2)(this.$t("user_status","There was an error clearing the status")),et.debug(t),void(this.isSavingStatus=!1)}this.isSavingStatus=!1,this.closeModal()},async revertBackupFromServer(){try{this.isSavingStatus=!0,await this.$store.dispatch("revertBackupFromServer",{messageId:this.messageId})}catch(t){return(0,a.x2)(this.$t("user_status","There was an error reverting the status")),et.debug(t),void(this.isSavingStatus=!1)}this.isSavingStatus=!1}}};var at=s(17982),nt={};nt.styleTagTransform=w(),nt.setAttributes=x(),nt.insert=f().bind(null,"head"),nt.domAPI=g(),nt.insertStyleElement=k(),b()(at.Z,nt),at.Z&&at.Z.locals&&at.Z.locals;const rt=(0,I.Z)(st,(function(){var t=this,e=t._self._c;return e("NcModal",{attrs:{size:"normal",title:t.$t("user_status","Set status")},on:{close:t.closeModal}},[e("div",{staticClass:"set-status-modal"},[e("div",{staticClass:"set-status-modal__header"},[e("h2",[t._v(t._s(t.$t("user_status","Online status")))])]),t._v(" "),e("div",{staticClass:"set-status-modal__online-status",attrs:{role:"radiogroup","aria-label":t.$t("user_status","Online status")}},t._l(t.statuses,(function(s){return e("OnlineStatusSelect",t._b({key:s.type,attrs:{checked:s.type===t.statusType},on:{select:t.changeStatus}},"OnlineStatusSelect",s,!1))})),1),t._v(" "),e("form",{on:{submit:function(e){return e.preventDefault(),t.saveStatus.apply(null,arguments)},reset:t.clearStatus}},[e("div",{staticClass:"set-status-modal__header"},[e("h2",[t._v(t._s(t.$t("user_status","Status message")))])]),t._v(" "),e("div",{staticClass:"set-status-modal__custom-input"},[e("CustomMessageInput",{ref:"customMessageInput",attrs:{icon:t.icon,message:t.editedMessage},on:{change:t.setMessage,"select-icon":t.setIcon}})],1),t._v(" "),t.hasBackupStatus?e("div",{staticClass:"set-status-modal__automation-hint"},[t._v("\n\t\t\t\t"+t._s(t.$t("user_status","Your status was set automatically"))+"\n\t\t\t")]):t._e(),t._v(" "),t.hasBackupStatus?e("PreviousStatus",{attrs:{icon:t.backupIcon,message:t.backupMessage},on:{select:t.revertBackupFromServer}}):t._e(),t._v(" "),e("PredefinedStatusesList",{attrs:{"is-custom-status":t.isCustomStatus},on:{"select-status":t.selectPredefinedMessage}}),t._v(" "),e("ClearAtSelect",{attrs:{"clear-at":t.clearAt},on:{"select-clear-at":t.setClearAt}}),t._v(" "),e("div",{staticClass:"status-buttons"},[e("NcButton",{attrs:{wide:!0,type:"tertiary","native-type":"reset","aria-label":t.$t("user_status","Clear status message"),disabled:t.isSavingStatus}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("user_status","Clear status message"))+"\n\t\t\t\t")]),t._v(" "),e("NcButton",{attrs:{wide:!0,type:"primary","native-type":"submit","aria-label":t.$t("user_status","Set status message"),disabled:t.isSavingStatus}},[t._v("\n\t\t\t\t\t"+t._s(t.$t("user_status","Set status message"))+"\n\t\t\t\t")])],1)],1)])])}),[],!1,null,"45c621ba",null).exports}}]);
- //# sourceMappingURL=user-status-modal-8299.js.map?v=3d7c84a277b700b090a4
|