diff --git a/osis_notification/static/osis_notification/osis-notification.umd.min.js b/osis_notification/static/osis_notification/osis-notification.umd.min.js index f5de08d..22c99d1 100644 --- a/osis_notification/static/osis_notification/osis-notification.umd.min.js +++ b/osis_notification/static/osis_notification/osis-notification.umd.min.js @@ -1,2 +1,2 @@ -(function(p,n){typeof exports=="object"&&typeof module<"u"?n(require("@vue/runtime-dom"),require("vue"),require("vue-i18n")):typeof define=="function"&&define.amd?define(["@vue/runtime-dom","vue","vue-i18n"],n):(p=typeof globalThis<"u"?globalThis:p||self,n(p.Vue,p.Vue,p.VueI18n))})(this,function(p,n,A){"use strict";function R(e,t,o){var i={},h="",w="...",_=10>t?t:10,l=["img","br"],T=[],g=0,d=h,C='([\\w|-]+\\s*(=\\s*"[^"]*")?\\s*)*',S="\\s*\\/?\\s*",le="\\s*\\/\\s*",ce=new RegExp("<\\/?\\w+\\s*"+C+le+">"),de=new RegExp("<\\/?\\w+\\s*"+C+S+">"),z=/(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w\-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g,ue=new RegExp(""),me=new RegExp("\\W+","g"),c=!0,m,f,$,k;function fe(s){var a=ue.exec(s),r,u;return a?(r=a.index,u=a[0].length,s.substring(0,r)+s.substring(r+u)):s}function pe(s){var a="";return s.reverse().forEach(function(r,u){l.indexOf(r)===-1&&(a+="")}),a}function he(s){var a=s.indexOf(" ");if(a===-1&&(a=s.indexOf(">"),a===-1))throw new Error("HTML tag is not well-formed : "+s);return s.substring(1,a)}function B(s,a){var r=t-g,u=r,V=r=t)break;if(c=z.exec(e),!c||c.index>=t){d+=e.substring(0,B(e));break}for(;c;)m=c[0],f=c.index,d+=e.substring(0,f+m.length-g),e=e.substring(f+m.length),c=z.exec(e);break}if(m=c[0],f=c.index,g+f>t){d+=e.substring(0,B(e,f));break}else g+=f,d+=e.substring(0,f);m[1]==="/"?(T.pop(),k=null):(k=ce.exec(m),k||($=he(m),T.push($))),k?d+=k[0]:d+=m,e=e.substring(f+m.length)}return e.length>t-g&&o.ellipsis&&(d+=o.ellipsis),d+=pe(T),o.keepImageTag||(d=fe(d)),d}var L=R;const M=n.defineComponent({name:"TruncateHtml",props:{htmlText:{type:String,default:""},length:{type:Number,default:100},lessButtonText:{type:String,default:"Show less"},contentCssClass:{type:String,default:""},containerCssClass:{type:String,default:""},buttonCssClass:{type:String,default:""},moreButtonText:{type:String,default:"Show more"}},data(){return{isTruncated:!0,truncatedHtml:L(this.htmlText,this.length)}}}),b=(e,t)=>{const o=e.__vccOpts||e;for(const[i,h]of t)o[i]=h;return o},q=["innerHTML"];function G(e,t,o,i,h,w){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(e.containerCssClass)},[n.createElementVNode("div",{class:n.normalizeClass([e.isTruncated?"truncated":"",e.contentCssClass]),innerHTML:e.isTruncated?e.truncatedHtml:e.htmlText},null,10,q),e.truncatedHtml.lengthe.isTruncated=!e.isTruncated,["prevent"]))},n.toDisplayString(e.isTruncated?e.moreButtonText:e.lessButtonText),3)):n.createCommentVNode("",!0)],2)}const I=b(M,[["render",G]]),U=n.defineComponent({name:"NotificationEntry",components:{TruncateHtml:I},props:{uuid:{type:String,required:!0},state:{type:String,required:!0},sentAt:{type:String,required:!0},payload:{type:String,required:!0},truncateLength:{type:Number,default:60}},emits:["toggle"],computed:{isSent:function(){return this.state==="SENT_STATE"}},mounted(){window.jQuery('[data-toggle="tooltip"]').tooltip({trigger:"hover",placement:"top",container:"body",template:''})},updated(){window.jQuery(`#notification-${this.uuid}`).tooltip("hide")},beforeUnmount(){window.jQuery(`#notification-${this.uuid}`).tooltip("destroy")}}),Ee="",D={class:"notification-dropdown-item"},H=["id","checked","data-original-title"],P={class:"label label-primary"};function O(e,t,o,i,h,w){const _=n.resolveComponent("TruncateHtml");return n.openBlock(),n.createElementBlock("li",D,[n.createElementVNode("input",{id:`notification-${e.uuid}`,checked:e.isSent,type:"radio","data-toggle":"tooltip","data-original-title":e.isSent?e.$t("notification.mark_as_read"):e.$t("notification.mark_as_unread"),onClick:t[0]||(t[0]=n.withModifiers(l=>e.$emit("toggle",e.uuid),["prevent"]))},null,8,H),n.createElementVNode("span",P,n.toDisplayString(e.sentAt),1),n.createVNode(_,{"button-css-class":"btn btn-link","container-css-class":"notification-text","content-css-class":e.isSent?"font-bold":"","html-text":e.payload,length:e.truncateLength,"less-button-text":e.$t("notification.show_less"),"more-button-text":e.$t("notification.show_more")},null,8,["content-css-class","html-text","length","less-button-text","more-button-text"])])}const X=b(U,[["render",O]]);function F(e){if(document.cookie){const t=document.cookie.split(";");for(let o=0;oe.stopPropagation())},methods:{fetchNotifications:async function(){const e=await this.doRequest(`?limit=${this.pageSize}`,{},!0);e&&(e.unread_count&&(this.animationEnabled=!0),this.notifications=e.results,this.hasNextPage=!!e.next,this.unreadNotificationsCount=e.unread_count,this.timer=window.setTimeout(()=>void this.fetchNotifications(),this.interval*1e3))},toggleState:async function(e){const t=await this.doRequest(e,{method:"PATCH"});if(!t)return;const o=this.notifications.findIndex(i=>i.uuid===e);this.notifications[o]=t,t.state==="SENT_STATE"?this.unreadNotificationsCount++:this.unreadNotificationsCount--,this.notifications.filter(i=>i.state==="SENT_STATE").length!==this.unreadNotificationsCount&&await this.fetchNotifications()},markAllAsRead:async function(){const e=await this.doRequest("mark_all_as_read",{method:"PUT"});e&&e.length>0&&(this.notifications.forEach(t=>t.state="READ_STATE"),this.unreadNotificationsCount=0)},loadMore:async function(e){e.stopPropagation(),this.loading=!0,this.pageSize+=this.limit,await this.fetchNotifications()},doRequest:async function(e,t,o=!1){o&&(this.loading=!0);try{const i=await fetch(`${this.baseUrl}${e}`,{mode:"same-origin",headers:{"Content-Type":"application/json;charset=utf-8","X-CSRFToken":this.csrfToken},...t});if(i.status>=200&&i.status<300)return o&&(this.loading=!1),i.json();this.error=`${this.$t("notification_viewer.error")} (${i.statusText})`}catch(i){this.error=`${this.$t("notification_viewer.error")} (${i.message})`}o&&(this.loading=!1)}}}),ke="",W=["data-count"],Q=[n.createElementVNode("span",{class:"fas fa-bell"},null,-1)],Y={class:"dropdown-menu notification-dropdown"},x={key:0,class:"progress"},K={class:"progress-bar progress-bar-striped active",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100",style:{width:"100%"}},J={class:"sr-only"},Z=n.createElementVNode("li",{role:"separator",class:"divider"},null,-1),v={class:"alert alert-warning",role:"alert"},ee={key:2},te=n.createElementVNode("li",{role:"separator",class:"divider"},null,-1),ne={key:0,class:"text-center"};function oe(e,t,o,i,h,w){const _=n.resolveComponent("NotificationEntry");return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("a",{class:"dropdown-toggle","data-toggle":"dropdown",role:"button","aria-haspopup":"true","aria-expanded":"false",onClick:t[0]||(t[0]=l=>e.animationEnabled=!1)},[n.createElementVNode("div",{class:n.normalizeClass(["bell",{"show-count":e.unreadNotificationsCount,notify:e.unreadNotificationsCount&&e.animationEnabled}]),"data-count":e.unreadNotificationsCount},Q,10,W)]),n.createElementVNode("ul",Y,[e.loading?(n.openBlock(),n.createElementBlock("li",x,[n.createElementVNode("div",K,[n.createElementVNode("span",J,n.toDisplayString(e.$t("notification_viewer.loading")),1)])])):e.error?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[Z,n.createElementVNode("li",null,[n.createElementVNode("div",v,n.toDisplayString(e.error),1)])],64)):n.createCommentVNode("",!0),e.notifications.length?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("li",null,[n.createElementVNode("a",{class:n.normalizeClass(["btn",{disabled:!e.unreadNotificationsCount}]),onClick:t[1]||(t[1]=(...l)=>e.markAllAsRead&&e.markAllAsRead(...l))},n.toDisplayString(e.$t("notification_viewer.mark_all_as_read")),3)]),te,(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.notifications,l=>(n.openBlock(),n.createBlock(_,{key:l.uuid,uuid:l.uuid,state:l.state,"sent-at":l.sent_at,payload:l.payload,"truncate-length":e.truncateLength,onToggle:e.toggleState},null,8,["uuid","state","sent-at","payload","truncate-length","onToggle"]))),128)),e.hasNextPage?(n.openBlock(),n.createElementBlock("li",ne,[n.createElementVNode("button",{type:"button",class:"btn btn-link",onClick:t[2]||(t[2]=(...l)=>e.loadMore&&e.loadMore(...l))},n.toDisplayString(e.$t("notification_viewer.load_more")),1)])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock("li",ee,n.toDisplayString(e.$t("notification_viewer.no_notifications")),1))])],64)}const ie=b(j,[["render",oe]]),re={notification_viewer:{mark_all_as_read:e=>{const{normalize:t}=e;return t(["Tout marquer comme lu"])},error:e=>{const{normalize:t}=e;return t(["Une erreur s'est produite, veuillez réessayer plus tard."])},load_more:e=>{const{normalize:t}=e;return t(["Afficher plus"])},loading:e=>{const{normalize:t}=e;return t(["Chargement..."])},no_notifications:e=>{const{normalize:t}=e;return t(["Pas de notifications."])}},notification:{mark_as_read:e=>{const{normalize:t}=e;return t(["Marquer comme lu"])},mark_as_unread:e=>{const{normalize:t}=e;return t(["Marquer comme non-lu"])},show_less:e=>{const{normalize:t}=e;return t(["Voir moins"])},show_more:e=>{const{normalize:t}=e;return t(["Voir plus"])}}},ae={notification_viewer:{mark_all_as_read:e=>{const{normalize:t}=e;return t(["Mark all as read"])},error:e=>{const{normalize:t}=e;return t(["An error occurred, please try again later."])},load_more:e=>{const{normalize:t}=e;return t(["Load more"])},loading:e=>{const{normalize:t}=e;return t(["Loading..."])},no_notifications:e=>{const{normalize:t}=e;return t(["No notifications."])}},notification:{mark_as_read:e=>{const{normalize:t}=e;return t(["Mark as read"])},mark_as_unread:e=>{const{normalize:t}=e;return t(["Mark as unread"])},show_less:e=>{const{normalize:t}=e;return t(["Show less"])},show_more:e=>{const{normalize:t}=e;return t(["Show more"])}}},se=A.createI18n({locale:document.documentElement.lang||"en",messages:{en:ae,fr:re}});document.querySelectorAll("#notification-viewer").forEach(e=>{const t={baseUrl:"",...e.dataset};e.dataset.interval&&(t.interval=Number.parseInt(e.dataset.interval)),e.dataset.limit&&(t.limit=Number.parseInt(e.dataset.limit)),e.dataset.truncateLength&&(t.truncateLength=Number.parseInt(e.dataset.truncateLength)),p.createApp(ie,t).use(se).mount(e)})}); +(function(p,n){typeof exports=="object"&&typeof module<"u"?n(require("@vue/runtime-dom"),require("vue"),require("vue-i18n")):typeof define=="function"&&define.amd?define(["@vue/runtime-dom","vue","vue-i18n"],n):(p=typeof globalThis<"u"?globalThis:p||self,n(p.Vue,p.Vue,p.VueI18n))})(this,function(p,n,A){"use strict";function R(e,t,o){var i={},h="",k="...",_=10>t?t:10,l=["img","br"],T=[],g=0,c=h,C='([\\w|-]+\\s*(=\\s*"[^"]*")?\\s*)*',S="\\s*\\/?\\s*",le="\\s*\\/\\s*",de=new RegExp("<\\/?\\w+\\s*"+C+le+">"),ce=new RegExp("<\\/?\\w+\\s*"+C+S+">"),z=/(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w\-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g,ue=new RegExp(""),me=new RegExp("\\W+","g"),d=!0,m,f,$,w;function fe(s){var r=ue.exec(s),a,u;return r?(a=r.index,u=r[0].length,s.substring(0,a)+s.substring(a+u)):s}function pe(s){var r="";return s.reverse().forEach(function(a,u){l.indexOf(a)===-1&&(r+="")}),r}function he(s){var r=s.indexOf(" ");if(r===-1&&(r=s.indexOf(">"),r===-1))throw new Error("HTML tag is not well-formed : "+s);return s.substring(1,r)}function B(s,r){var a=t-g,u=a,V=a=t)break;if(d=z.exec(e),!d||d.index>=t){c+=e.substring(0,B(e));break}for(;d;)m=d[0],f=d.index,c+=e.substring(0,f+m.length-g),e=e.substring(f+m.length),d=z.exec(e);break}if(m=d[0],f=d.index,g+f>t){c+=e.substring(0,B(e,f));break}else g+=f,c+=e.substring(0,f);m[1]==="/"?(T.pop(),w=null):(w=de.exec(m),w||($=he(m),T.push($))),w?c+=w[0]:c+=m,e=e.substring(f+m.length)}return e.length>t-g&&o.ellipsis&&(c+=o.ellipsis),c+=pe(T),o.keepImageTag||(c=fe(c)),c}var L=R;const M=n.defineComponent({name:"TruncateHtml",props:{htmlText:{type:String,default:""},length:{type:Number,default:100},lessButtonText:{type:String,default:"Show less"},contentCssClass:{type:String,default:""},containerCssClass:{type:String,default:""},buttonCssClass:{type:String,default:""},moreButtonText:{type:String,default:"Show more"}},data(){return{isTruncated:!0,truncatedHtml:L(this.htmlText,this.length)}}}),N=(e,t)=>{const o=e.__vccOpts||e;for(const[i,h]of t)o[i]=h;return o},q=["innerHTML"];function G(e,t,o,i,h,k){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(e.containerCssClass)},[n.createElementVNode("div",{class:n.normalizeClass([e.isTruncated?"truncated":"",e.contentCssClass]),innerHTML:e.isTruncated?e.truncatedHtml:e.htmlText},null,10,q),e.truncatedHtml.lengthe.isTruncated=!e.isTruncated,["prevent"]))},n.toDisplayString(e.isTruncated?e.moreButtonText:e.lessButtonText),3)):n.createCommentVNode("",!0)],2)}const I=N(M,[["render",G]]),U=n.defineComponent({name:"NotificationEntry",components:{TruncateHtml:I},props:{uuid:{type:String,required:!0},state:{type:String,required:!0},sentAt:{type:String,required:!0},payload:{type:String,required:!0},truncateLength:{type:Number,default:60}},emits:["toggle"],computed:{isSent:function(){return this.state==="SENT_STATE"}},mounted(){window.jQuery('[data-toggle="tooltip"]').tooltip({trigger:"hover",placement:"top",container:"body",template:''})},updated(){window.jQuery(`#notification-${this.uuid}`).tooltip("hide")},beforeUnmount(){window.jQuery(`#notification-${this.uuid}`).tooltip("destroy")}}),Ee="",D={class:"notification-dropdown-item"},H=["id","checked","data-original-title"],P={class:"label label-primary"};function O(e,t,o,i,h,k){const _=n.resolveComponent("TruncateHtml");return n.openBlock(),n.createElementBlock("li",D,[n.createElementVNode("input",{id:`notification-${e.uuid}`,checked:e.isSent,type:"radio","data-toggle":"tooltip","data-bs-toggle":"tooltip","data-original-title":e.isSent?e.$t("notification.mark_as_read"):e.$t("notification.mark_as_unread"),onClick:t[0]||(t[0]=n.withModifiers(l=>e.$emit("toggle",e.uuid),["prevent"]))},null,8,H),n.createElementVNode("span",P,n.toDisplayString(e.sentAt),1),n.createVNode(_,{"button-css-class":"btn btn-link","container-css-class":"notification-text","content-css-class":e.isSent?"font-bold":"","html-text":e.payload,length:e.truncateLength,"less-button-text":e.$t("notification.show_less"),"more-button-text":e.$t("notification.show_more")},null,8,["content-css-class","html-text","length","less-button-text","more-button-text"])])}const X=N(U,[["render",O]]);function F(e){if(document.cookie){const t=document.cookie.split(";");for(let o=0;oe.stopPropagation())},methods:{fetchNotifications:async function(){const e=await this.doRequest(`?limit=${this.pageSize}`,{},!0);e&&(e.unread_count&&(this.animationEnabled=!0),this.notifications=e.results,this.hasNextPage=!!e.next,this.unreadNotificationsCount=e.unread_count,this.timer=window.setTimeout(()=>void this.fetchNotifications(),this.interval*1e3))},toggleState:async function(e){const t=await this.doRequest(e,{method:"PATCH"});if(!t)return;const o=this.notifications.findIndex(i=>i.uuid===e);this.notifications[o]=t,t.state==="SENT_STATE"?this.unreadNotificationsCount++:this.unreadNotificationsCount--,this.notifications.filter(i=>i.state==="SENT_STATE").length!==this.unreadNotificationsCount&&await this.fetchNotifications()},markAllAsRead:async function(){const e=await this.doRequest("mark_all_as_read",{method:"PUT"});e&&e.length>0&&(this.notifications.forEach(t=>t.state="READ_STATE"),this.unreadNotificationsCount=0)},loadMore:async function(e){e.stopPropagation(),this.loading=!0,this.pageSize+=this.limit,await this.fetchNotifications()},doRequest:async function(e,t,o=!1){o&&(this.loading=!0);try{const i=await fetch(`${this.baseUrl}${e}`,{mode:"same-origin",headers:{"Content-Type":"application/json;charset=utf-8","X-CSRFToken":this.csrfToken},...t});if(i.status>=200&&i.status<300)return o&&(this.loading=!1),i.json();this.error=`${this.$t("notification_viewer.error")} (${i.statusText})`}catch(i){this.error=`${this.$t("notification_viewer.error")} (${i.message})`}o&&(this.loading=!1)}}}),we="",W=["data-count"],Q=[n.createElementVNode("span",{class:"fas fa-bell"},null,-1)],Y={class:"dropdown-menu notification-dropdown dropdown-menu-end"},x={key:0,class:"progress"},K={class:"progress-bar progress-bar-striped active",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100",style:{width:"100%"}},J={class:"sr-only visually-hidden-focusable"},Z=n.createElementVNode("li",{role:"separator",class:"divider"},null,-1),v={class:"alert alert-warning",role:"alert"},ee={key:2},te=n.createElementVNode("li",{role:"separator",class:"divider dropdown-divider"},null,-1),ne={key:0,class:"text-center"};function oe(e,t,o,i,h,k){const _=n.resolveComponent("NotificationEntry");return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("a",{class:"dropdown-toggle nav-link","data-toggle":"dropdown","data-bs-toggle":"dropdown","data-bs-auto-close":"outside",role:"button","aria-haspopup":"true","aria-expanded":"false",onClick:t[0]||(t[0]=l=>e.animationEnabled=!1)},[n.createElementVNode("div",{class:n.normalizeClass(["bell",{"show-count":e.unreadNotificationsCount,notify:e.unreadNotificationsCount&&e.animationEnabled}]),"data-count":e.unreadNotificationsCount},Q,10,W)]),n.createElementVNode("ul",Y,[e.loading?(n.openBlock(),n.createElementBlock("li",x,[n.createElementVNode("div",K,[n.createElementVNode("span",J,n.toDisplayString(e.$t("notification_viewer.loading")),1)])])):e.error?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[Z,n.createElementVNode("li",null,[n.createElementVNode("div",v,n.toDisplayString(e.error),1)])],64)):n.createCommentVNode("",!0),e.notifications.length?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("li",null,[n.createElementVNode("a",{class:n.normalizeClass(["btn",{disabled:!e.unreadNotificationsCount}]),onClick:t[1]||(t[1]=(...l)=>e.markAllAsRead&&e.markAllAsRead(...l))},n.toDisplayString(e.$t("notification_viewer.mark_all_as_read")),3)]),te,(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.notifications,l=>(n.openBlock(),n.createBlock(_,{key:l.uuid,uuid:l.uuid,state:l.state,"sent-at":l.sent_at,payload:l.payload,"truncate-length":e.truncateLength,onToggle:e.toggleState},null,8,["uuid","state","sent-at","payload","truncate-length","onToggle"]))),128)),e.hasNextPage?(n.openBlock(),n.createElementBlock("li",ne,[n.createElementVNode("button",{type:"button",class:"btn btn-link",onClick:t[2]||(t[2]=(...l)=>e.loadMore&&e.loadMore(...l))},n.toDisplayString(e.$t("notification_viewer.load_more")),1)])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock("li",ee,n.toDisplayString(e.$t("notification_viewer.no_notifications")),1))])],64)}const ie=N(j,[["render",oe]]),ae={notification_viewer:{mark_all_as_read:e=>{const{normalize:t}=e;return t(["Tout marquer comme lu"])},error:e=>{const{normalize:t}=e;return t(["Une erreur s'est produite, veuillez réessayer plus tard."])},load_more:e=>{const{normalize:t}=e;return t(["Afficher plus"])},loading:e=>{const{normalize:t}=e;return t(["Chargement..."])},no_notifications:e=>{const{normalize:t}=e;return t(["Pas de notifications."])}},notification:{mark_as_read:e=>{const{normalize:t}=e;return t(["Marquer comme lu"])},mark_as_unread:e=>{const{normalize:t}=e;return t(["Marquer comme non-lu"])},show_less:e=>{const{normalize:t}=e;return t(["Voir moins"])},show_more:e=>{const{normalize:t}=e;return t(["Voir plus"])}}},re={notification_viewer:{mark_all_as_read:e=>{const{normalize:t}=e;return t(["Mark all as read"])},error:e=>{const{normalize:t}=e;return t(["An error occurred, please try again later."])},load_more:e=>{const{normalize:t}=e;return t(["Load more"])},loading:e=>{const{normalize:t}=e;return t(["Loading..."])},no_notifications:e=>{const{normalize:t}=e;return t(["No notifications."])}},notification:{mark_as_read:e=>{const{normalize:t}=e;return t(["Mark as read"])},mark_as_unread:e=>{const{normalize:t}=e;return t(["Mark as unread"])},show_less:e=>{const{normalize:t}=e;return t(["Show less"])},show_more:e=>{const{normalize:t}=e;return t(["Show more"])}}},se=A.createI18n({locale:document.documentElement.lang||"en",messages:{en:re,fr:ae}});document.querySelectorAll("#notification-viewer").forEach(e=>{const t={baseUrl:"",...e.dataset};e.dataset.interval&&(t.interval=Number.parseInt(e.dataset.interval)),e.dataset.limit&&(t.limit=Number.parseInt(e.dataset.limit)),e.dataset.truncateLength&&(t.truncateLength=Number.parseInt(e.dataset.truncateLength)),p.createApp(ie,t).use(se).mount(e)})}); //# sourceMappingURL=osis-notification.umd.min.js.map diff --git a/osis_notification/static/osis_notification/osis-notification.umd.min.js.map b/osis_notification/static/osis_notification/osis-notification.umd.min.js.map index ca1f488..f697909 100644 --- a/osis_notification/static/osis_notification/osis-notification.umd.min.js.map +++ b/osis_notification/static/osis_notification/osis-notification.umd.min.js.map @@ -1 +1 @@ -{"version":3,"file":"osis-notification.umd.min.js","sources":["../../../node_modules/html-truncate/lib/truncate.js","../../../frontend/components/TruncateHtml.vue","../../../frontend/components/NotificationEntry.vue","../../../frontend/utils.ts","../../../frontend/NotificationViewer.vue","../../../frontend/i18n.ts","../../../frontend/main.ts"],"sourcesContent":["/**\n * Truncate HTML string and keep tag safe.\n *\n * @method truncate\n * @param {String} string string needs to be truncated\n * @param {Number} maxLength length of truncated string\n * @param {Object} options (optional)\n * @param {Boolean} [options.keepImageTag] flag to specify if keep image tag, false by default\n * @param {Boolean} [options.truncateLastWord] truncates last word, true by default\n * @param {Number} [options.slop] tolerance when options.truncateLastWord is false before we give up and just truncate at the maxLength position, 10 by default (but not greater than maxLength)\n * @param {Boolean|String} [options.ellipsis] omission symbol for truncated string, '...' by default\n * @return {String} truncated string\n */\nfunction truncate(string, maxLength, options) {\n var EMPTY_OBJECT = {},\n EMPTY_STRING = '',\n DEFAULT_TRUNCATE_SYMBOL = '...',\n DEFAULT_SLOP = 10 > maxLength ? maxLength : 10,\n EXCLUDE_TAGS = ['img', 'br'], // non-closed tags\n items = [], // stack for saving tags\n total = 0, // record how many characters we traced so far\n content = EMPTY_STRING, // truncated text storage\n KEY_VALUE_REGEX = '([\\\\w|-]+\\\\s*(=\\\\s*\"[^\"]*\")?\\\\s*)*',\n IS_CLOSE_REGEX = '\\\\s*\\\\/?\\\\s*',\n CLOSE_REGEX = '\\\\s*\\\\/\\\\s*',\n SELF_CLOSE_REGEX = new RegExp('<\\\\/?\\\\w+\\\\s*' + KEY_VALUE_REGEX + CLOSE_REGEX + '>'),\n HTML_TAG_REGEX = new RegExp('<\\\\/?\\\\w+\\\\s*' + KEY_VALUE_REGEX + IS_CLOSE_REGEX + '>'),\n URL_REGEX = /(((ftp|https?):\\/\\/)[\\-\\w@:%_\\+.~#?,&\\/\\/=]+)|((mailto:)?[_.\\w\\-]+@([\\w][\\w\\-]+\\.)+[a-zA-Z]{2,3})/g, // Simple regexp\n IMAGE_TAG_REGEX = new RegExp(''),\n WORD_BREAK_REGEX = new RegExp('\\\\W+', 'g'),\n matches = true,\n result,\n index,\n tail,\n tag,\n selfClose;\n\n /**\n * Remove image tag\n *\n * @private\n * @method _removeImageTag\n * @param {String} string not-yet-processed string\n * @return {String} string without image tags\n */\n function _removeImageTag(string) {\n var match = IMAGE_TAG_REGEX.exec(string),\n index,\n len;\n\n if (!match) {\n return string;\n }\n\n index = match.index;\n len = match[0].length;\n\n return string.substring(0, index) + string.substring(index + len);\n }\n\n /**\n * Dump all close tags and append to truncated content while reaching upperbound\n *\n * @private\n * @method _dumpCloseTag\n * @param {String[]} tags a list of tags which should be closed\n * @return {String} well-formatted html\n */\n function _dumpCloseTag(tags) {\n var html = '';\n\n tags.reverse().forEach(function (tag, index) {\n // dump non-excluded tags only\n if (-1 === EXCLUDE_TAGS.indexOf(tag)) {\n html += '';\n }\n });\n\n return html;\n }\n\n /**\n * Process tag string to get pure tag name\n *\n * @private\n * @method _getTag\n * @param {String} string original html\n * @return {String} tag name\n */\n function _getTag(string) {\n var tail = string.indexOf(' ');\n\n // TODO:\n // we have to figure out how to handle non-well-formatted HTML case\n if (-1 === tail) {\n tail = string.indexOf('>');\n if (-1 === tail) {\n throw new Error('HTML tag is not well-formed : ' + string);\n }\n }\n\n return string.substring(1, tail);\n }\n\n\n /**\n * Get the end position for String#substring()\n *\n * If options.truncateLastWord is FALSE, we try to the end position up to\n * options.slop characters to avoid breaking in the middle of a word.\n *\n * @private\n * @method _getEndPosition\n * @param {String} string original html\n * @param {Number} tailPos (optional) provided to avoid extending the slop into trailing HTML tag\n * @return {Number} maxLength\n */\n function _getEndPosition (string, tailPos) {\n var defaultPos = maxLength - total,\n position = defaultPos,\n isShort = defaultPos < options.slop,\n slopPos = isShort ? defaultPos : options.slop - 1,\n substr,\n startSlice = isShort ? 0 : defaultPos - options.slop,\n endSlice = tailPos || (defaultPos + options.slop),\n result;\n\n if (!options.truncateLastWord) {\n\n substr = string.slice(startSlice, endSlice);\n\n if (tailPos && substr.length <= tailPos) {\n position = substr.length;\n }\n else {\n while ((result = WORD_BREAK_REGEX.exec(substr)) !== null) {\n // a natural break position before the hard break position\n if (result.index < slopPos) {\n position = defaultPos - (slopPos - result.index);\n // keep seeking closer to the hard break position\n // unless a natural break is at position 0\n if (result.index === 0 && defaultPos <= 1) break;\n }\n // a natural break position exactly at the hard break position\n else if (result.index === slopPos) {\n position = defaultPos;\n break; // seek no more\n }\n // a natural break position after the hard break position\n else {\n position = defaultPos + (result.index - slopPos);\n break; // seek no more\n }\n }\n }\n if (string.charAt(position - 1).match(/\\s$/)) position--;\n }\n return position;\n }\n\n options = options || EMPTY_OBJECT;\n options.ellipsis = (undefined !== options.ellipsis) ? options.ellipsis : DEFAULT_TRUNCATE_SYMBOL;\n options.truncateLastWord = (undefined !== options.truncateLastWord) ? options.truncateLastWord : true;\n options.slop = (undefined !== options.slop) ? options.slop : DEFAULT_SLOP;\n\n while (matches) {\n matches = HTML_TAG_REGEX.exec(string);\n\n if (!matches) {\n if (total >= maxLength) { break; }\n\n matches = URL_REGEX.exec(string);\n if (!matches || matches.index >= maxLength) {\n content += string.substring(0, _getEndPosition(string));\n break;\n }\n\n while (matches) {\n result = matches[0];\n index = matches.index;\n content += string.substring(0, (index + result.length) - total);\n string = string.substring(index + result.length);\n matches = URL_REGEX.exec(string);\n }\n break;\n }\n\n result = matches[0];\n index = matches.index;\n\n if (total + index > maxLength) {\n // exceed given `maxLength`, dump everything to clear stack\n content += string.substring(0, _getEndPosition(string, index));\n break;\n } else {\n total += index;\n content += string.substring(0, index);\n }\n\n if ('/' === result[1]) {\n // move out open tag\n items.pop();\n selfClose=null;\n } else {\n selfClose = SELF_CLOSE_REGEX.exec(result);\n if (!selfClose) {\n tag = _getTag(result);\n\n items.push(tag);\n }\n }\n\n if (selfClose) {\n content += selfClose[0];\n } else {\n content += result;\n }\n string = string.substring(index + result.length);\n }\n\n if (string.length > maxLength - total && options.ellipsis) {\n content += options.ellipsis;\n }\n content += _dumpCloseTag(items);\n\n if (!options.keepImageTag) {\n content = _removeImageTag(content);\n }\n\n return content;\n}\n\nmodule.exports = truncate;\n","\n\n\n\n\n","\n\n\n\n\n\n","/*\n *\n * OSIS stands for Open Student Information System. It's an application\n * designed to manage the core business of higher education institutions,\n * such as universities, faculties, institutes and professional schools.\n * The core business involves the administration of students, teachers,\n * courses, programs and so on.\n *\n * Copyright (C) 2015-2021 Université catholique de Louvain (http://www.uclouvain.be)\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * A copy of this license - GNU General Public License - is available\n * at the root of the source code of this program. If not,\n * see http://www.gnu.org/licenses/.\n *\n */\n\n\n/**\n * Get the given cookie from its name. We use it to get the csrftoken.\n * See code from https://docs.djangoproject.com/en/3.2/ref/csrf/#acquiring-the-token-if-csrf-use-sessions-and-csrf-cookie-httponly-are-false\n */\nexport function getCookie(name: string): string {\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim();\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n return decodeURIComponent(cookie.substring(name.length + 1));\n }\n }\n }\n throw new Error(`No such cookie ${name}`);\n}\n","\n\n\n\n\n\n","/*\n *\n * OSIS stands for Open Student Information System. It's an application\n * designed to manage the core business of higher education institutions,\n * such as universities, faculties, institutes and professional schools.\n * The core business involves the administration of students, teachers,\n * courses, programs and so on.\n *\n * Copyright (C) 2015-2021 Université catholique de Louvain (http://www.uclouvain.be)\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * A copy of this license - GNU General Public License - is available\n * at the root of the source code of this program. If not,\n * see http://www.gnu.org/licenses/.\n *\n */\n\nimport {createI18n} from 'vue-i18n';\nimport fr from \"./locales/fr\";\nimport en from \"./locales/en\";\n\nexport const i18n = createI18n({\n locale: document.documentElement.lang || 'en',\n messages: {\n en,\n fr,\n },\n});\n","/*\n *\n * OSIS stands for Open Student Information System. It's an application\n * designed to manage the core business of higher education institutions,\n * such as universities, faculties, institutes and professional schools.\n * The core business involves the administration of students, teachers,\n * courses, programs and so on.\n *\n * Copyright (C) 2015-2021 Université catholique de Louvain (http://www.uclouvain.be)\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * A copy of this license - GNU General Public License - is available\n * at the root of the source code of this program. If not,\n * see http://www.gnu.org/licenses/.\n *\n */\n/* eslint-disable vue/prefer-import-from-vue */\nimport {createApp} from '@vue/runtime-dom'; // to allow to be spied on\nimport NotificationViewer from './NotificationViewer.vue';\nimport {i18n} from './i18n';\n\ninterface Props extends Record {\n baseUrl: string,\n interval?: number,\n limit?: number,\n truncateLength?: number,\n}\n\ndocument.querySelectorAll('#notification-viewer').forEach((elem) => {\n const props: Props = {baseUrl: \"\", ...elem.dataset};\n if (elem.dataset.interval) {\n props.interval = Number.parseInt(elem.dataset.interval);\n }\n if (elem.dataset.limit) {\n props.limit = Number.parseInt(elem.dataset.limit);\n }\n if (elem.dataset.truncateLength) {\n props.truncateLength = Number.parseInt(elem.dataset.truncateLength);\n }\n createApp(NotificationViewer, props).use(i18n).mount(elem);\n});\n"],"names":["truncate","string","maxLength","options","EMPTY_OBJECT","EMPTY_STRING","DEFAULT_TRUNCATE_SYMBOL","DEFAULT_SLOP","EXCLUDE_TAGS","items","total","content","KEY_VALUE_REGEX","IS_CLOSE_REGEX","CLOSE_REGEX","SELF_CLOSE_REGEX","HTML_TAG_REGEX","URL_REGEX","IMAGE_TAG_REGEX","WORD_BREAK_REGEX","matches","result","index","tag","selfClose","_removeImageTag","match","len","_dumpCloseTag","tags","html","_getTag","tail","_getEndPosition","tailPos","defaultPos","position","isShort","slopPos","substr","startSlice","endSlice","truncate_1","_sfc_main$2","defineComponent","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_normalizeClass","_createElementVNode","_hoisted_1","_openBlock","_withModifiers","$event","_sfc_main$1","TruncateHtml","_resolveComponent","_createElementBlock","_hoisted_2","_hoisted_3","_toDisplayString","_createVNode","_component_TruncateHtml","getCookie","name","cookies","i","cookie","_sfc_main","NotificationEntry","newNotifications","uuid","newNotification","notificationIndex","notification","n","notifications","url","params","loadingAnimation","response","e","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_Fragment","_hoisted_4","_createCommentVNode","args","_renderList","_createBlock","_component_NotificationEntry","i18n","createI18n","en","fr","elem","props","createApp","NotificationViewer"],"mappings":"6TAaA,SAASA,EAASC,EAAQC,EAAWC,EAAS,CAC1C,IAAIC,EAAe,CAAA,EACfC,EAAe,GACfC,EAA0B,MAC1BC,EAAe,GAAKL,EAAYA,EAAY,GAC5CM,EAAe,CAAC,MAAO,IAAI,EAC3BC,EAAQ,CAAA,EACRC,EAAQ,EACRC,EAAUN,EACVO,EAAkB,qCAClBC,EAAiB,eACjBC,GAAc,cACdC,GAAmB,IAAI,OAAO,gBAAkBH,EAAkBE,GAAc,GAAG,EACnFE,GAAiB,IAAI,OAAO,gBAAkBJ,EAAkBC,EAAiB,GAAG,EACpFI,EAAY,qGACZC,GAAkB,IAAI,OAAO,WAAaN,EAAkBC,EAAiB,GAAG,EAChFM,GAAmB,IAAI,OAAO,OAAQ,GAAG,EACzCC,EAAU,GACVC,EACAC,EAEAC,EACAC,EAUJ,SAASC,GAAgBxB,EAAQ,CAC7B,IAAIyB,EAAQR,GAAgB,KAAKjB,CAAM,EACnCqB,EACAK,EAEJ,OAAKD,GAILJ,EAAQI,EAAM,MACdC,EAAMD,EAAM,CAAC,EAAE,OAERzB,EAAO,UAAU,EAAGqB,CAAK,EAAIrB,EAAO,UAAUqB,EAAQK,CAAG,GANrD1B,CAOd,CAUD,SAAS2B,GAAcC,EAAM,CACzB,IAAIC,EAAO,GAEX,OAAAD,EAAK,QAAS,EAAC,QAAQ,SAAUN,EAAKD,EAAO,CAE9Bd,EAAa,QAAQe,CAAG,IAA/B,KACAO,GAAQ,KAAOP,EAAM,IAErC,CAAS,EAEMO,CACV,CAUD,SAASC,GAAQ9B,EAAQ,CACrB,IAAI+B,EAAO/B,EAAO,QAAQ,GAAG,EAI7B,GAAW+B,IAAP,KACAA,EAAO/B,EAAO,QAAQ,GAAG,EACd+B,IAAP,IACA,MAAM,IAAI,MAAM,iCAAmC/B,CAAM,EAIjE,OAAOA,EAAO,UAAU,EAAG+B,CAAI,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GnBA,EAAA,aAAAS,EAAA,UAAA,EACiBM,EAAAA,mBAAA,KAAAgC,GAAA,CAAAxC,EAAAA,mBACP,SAAc,CACnB,KAAA,SAAA,MAAA,4KA/BTE,EAAA,UAAA,EASOM,EAAAA,mBAAA,KAAA8B,GAAA3B,EAAAA,gBAAAlB,EAAA,GAAA,sCAAA,CAAA,EAAA,CAAA,+2CCxDEuD,GAAOC,EAAAA,WAAW,CAC7B,OAAQ,SAAS,gBAAgB,MAAQ,KACzC,SAAU,CACR,GAAAC,GACA,GAAAC,EACF,CACF,CAAC,ECCD,SAAS,iBAA8B,sBAAsB,EAAE,QAASC,GAAS,CAC/E,MAAMC,EAAe,CAAC,QAAS,GAAI,GAAGD,EAAK,SACvCA,EAAK,QAAQ,WACfC,EAAM,SAAW,OAAO,SAASD,EAAK,QAAQ,QAAQ,GAEpDA,EAAK,QAAQ,QACfC,EAAM,MAAQ,OAAO,SAASD,EAAK,QAAQ,KAAK,GAE9CA,EAAK,QAAQ,iBACfC,EAAM,eAAiB,OAAO,SAASD,EAAK,QAAQ,cAAc,GAEpEE,YAAUC,GAAoBF,CAAK,EAAE,IAAIL,EAAI,EAAE,MAAMI,CAAI,CAC3D,CAAC","x_google_ignoreList":[0]} \ No newline at end of file +{"version":3,"file":"osis-notification.umd.min.js","sources":["../../../node_modules/html-truncate/lib/truncate.js","../../../frontend/components/TruncateHtml.vue","../../../frontend/components/NotificationEntry.vue","../../../frontend/utils.ts","../../../frontend/NotificationViewer.vue","../../../frontend/i18n.ts","../../../frontend/main.ts"],"sourcesContent":["/**\n * Truncate HTML string and keep tag safe.\n *\n * @method truncate\n * @param {String} string string needs to be truncated\n * @param {Number} maxLength length of truncated string\n * @param {Object} options (optional)\n * @param {Boolean} [options.keepImageTag] flag to specify if keep image tag, false by default\n * @param {Boolean} [options.truncateLastWord] truncates last word, true by default\n * @param {Number} [options.slop] tolerance when options.truncateLastWord is false before we give up and just truncate at the maxLength position, 10 by default (but not greater than maxLength)\n * @param {Boolean|String} [options.ellipsis] omission symbol for truncated string, '...' by default\n * @return {String} truncated string\n */\nfunction truncate(string, maxLength, options) {\n var EMPTY_OBJECT = {},\n EMPTY_STRING = '',\n DEFAULT_TRUNCATE_SYMBOL = '...',\n DEFAULT_SLOP = 10 > maxLength ? maxLength : 10,\n EXCLUDE_TAGS = ['img', 'br'], // non-closed tags\n items = [], // stack for saving tags\n total = 0, // record how many characters we traced so far\n content = EMPTY_STRING, // truncated text storage\n KEY_VALUE_REGEX = '([\\\\w|-]+\\\\s*(=\\\\s*\"[^\"]*\")?\\\\s*)*',\n IS_CLOSE_REGEX = '\\\\s*\\\\/?\\\\s*',\n CLOSE_REGEX = '\\\\s*\\\\/\\\\s*',\n SELF_CLOSE_REGEX = new RegExp('<\\\\/?\\\\w+\\\\s*' + KEY_VALUE_REGEX + CLOSE_REGEX + '>'),\n HTML_TAG_REGEX = new RegExp('<\\\\/?\\\\w+\\\\s*' + KEY_VALUE_REGEX + IS_CLOSE_REGEX + '>'),\n URL_REGEX = /(((ftp|https?):\\/\\/)[\\-\\w@:%_\\+.~#?,&\\/\\/=]+)|((mailto:)?[_.\\w\\-]+@([\\w][\\w\\-]+\\.)+[a-zA-Z]{2,3})/g, // Simple regexp\n IMAGE_TAG_REGEX = new RegExp(''),\n WORD_BREAK_REGEX = new RegExp('\\\\W+', 'g'),\n matches = true,\n result,\n index,\n tail,\n tag,\n selfClose;\n\n /**\n * Remove image tag\n *\n * @private\n * @method _removeImageTag\n * @param {String} string not-yet-processed string\n * @return {String} string without image tags\n */\n function _removeImageTag(string) {\n var match = IMAGE_TAG_REGEX.exec(string),\n index,\n len;\n\n if (!match) {\n return string;\n }\n\n index = match.index;\n len = match[0].length;\n\n return string.substring(0, index) + string.substring(index + len);\n }\n\n /**\n * Dump all close tags and append to truncated content while reaching upperbound\n *\n * @private\n * @method _dumpCloseTag\n * @param {String[]} tags a list of tags which should be closed\n * @return {String} well-formatted html\n */\n function _dumpCloseTag(tags) {\n var html = '';\n\n tags.reverse().forEach(function (tag, index) {\n // dump non-excluded tags only\n if (-1 === EXCLUDE_TAGS.indexOf(tag)) {\n html += '';\n }\n });\n\n return html;\n }\n\n /**\n * Process tag string to get pure tag name\n *\n * @private\n * @method _getTag\n * @param {String} string original html\n * @return {String} tag name\n */\n function _getTag(string) {\n var tail = string.indexOf(' ');\n\n // TODO:\n // we have to figure out how to handle non-well-formatted HTML case\n if (-1 === tail) {\n tail = string.indexOf('>');\n if (-1 === tail) {\n throw new Error('HTML tag is not well-formed : ' + string);\n }\n }\n\n return string.substring(1, tail);\n }\n\n\n /**\n * Get the end position for String#substring()\n *\n * If options.truncateLastWord is FALSE, we try to the end position up to\n * options.slop characters to avoid breaking in the middle of a word.\n *\n * @private\n * @method _getEndPosition\n * @param {String} string original html\n * @param {Number} tailPos (optional) provided to avoid extending the slop into trailing HTML tag\n * @return {Number} maxLength\n */\n function _getEndPosition (string, tailPos) {\n var defaultPos = maxLength - total,\n position = defaultPos,\n isShort = defaultPos < options.slop,\n slopPos = isShort ? defaultPos : options.slop - 1,\n substr,\n startSlice = isShort ? 0 : defaultPos - options.slop,\n endSlice = tailPos || (defaultPos + options.slop),\n result;\n\n if (!options.truncateLastWord) {\n\n substr = string.slice(startSlice, endSlice);\n\n if (tailPos && substr.length <= tailPos) {\n position = substr.length;\n }\n else {\n while ((result = WORD_BREAK_REGEX.exec(substr)) !== null) {\n // a natural break position before the hard break position\n if (result.index < slopPos) {\n position = defaultPos - (slopPos - result.index);\n // keep seeking closer to the hard break position\n // unless a natural break is at position 0\n if (result.index === 0 && defaultPos <= 1) break;\n }\n // a natural break position exactly at the hard break position\n else if (result.index === slopPos) {\n position = defaultPos;\n break; // seek no more\n }\n // a natural break position after the hard break position\n else {\n position = defaultPos + (result.index - slopPos);\n break; // seek no more\n }\n }\n }\n if (string.charAt(position - 1).match(/\\s$/)) position--;\n }\n return position;\n }\n\n options = options || EMPTY_OBJECT;\n options.ellipsis = (undefined !== options.ellipsis) ? options.ellipsis : DEFAULT_TRUNCATE_SYMBOL;\n options.truncateLastWord = (undefined !== options.truncateLastWord) ? options.truncateLastWord : true;\n options.slop = (undefined !== options.slop) ? options.slop : DEFAULT_SLOP;\n\n while (matches) {\n matches = HTML_TAG_REGEX.exec(string);\n\n if (!matches) {\n if (total >= maxLength) { break; }\n\n matches = URL_REGEX.exec(string);\n if (!matches || matches.index >= maxLength) {\n content += string.substring(0, _getEndPosition(string));\n break;\n }\n\n while (matches) {\n result = matches[0];\n index = matches.index;\n content += string.substring(0, (index + result.length) - total);\n string = string.substring(index + result.length);\n matches = URL_REGEX.exec(string);\n }\n break;\n }\n\n result = matches[0];\n index = matches.index;\n\n if (total + index > maxLength) {\n // exceed given `maxLength`, dump everything to clear stack\n content += string.substring(0, _getEndPosition(string, index));\n break;\n } else {\n total += index;\n content += string.substring(0, index);\n }\n\n if ('/' === result[1]) {\n // move out open tag\n items.pop();\n selfClose=null;\n } else {\n selfClose = SELF_CLOSE_REGEX.exec(result);\n if (!selfClose) {\n tag = _getTag(result);\n\n items.push(tag);\n }\n }\n\n if (selfClose) {\n content += selfClose[0];\n } else {\n content += result;\n }\n string = string.substring(index + result.length);\n }\n\n if (string.length > maxLength - total && options.ellipsis) {\n content += options.ellipsis;\n }\n content += _dumpCloseTag(items);\n\n if (!options.keepImageTag) {\n content = _removeImageTag(content);\n }\n\n return content;\n}\n\nmodule.exports = truncate;\n","\n\n\n\n\n","\n\n\n\n\n\n","/*\n *\n * OSIS stands for Open Student Information System. It's an application\n * designed to manage the core business of higher education institutions,\n * such as universities, faculties, institutes and professional schools.\n * The core business involves the administration of students, teachers,\n * courses, programs and so on.\n *\n * Copyright (C) 2015-2021 Université catholique de Louvain (http://www.uclouvain.be)\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * A copy of this license - GNU General Public License - is available\n * at the root of the source code of this program. If not,\n * see http://www.gnu.org/licenses/.\n *\n */\n\n\n/**\n * Get the given cookie from its name. We use it to get the csrftoken.\n * See code from https://docs.djangoproject.com/en/3.2/ref/csrf/#acquiring-the-token-if-csrf-use-sessions-and-csrf-cookie-httponly-are-false\n */\nexport function getCookie(name: string): string {\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim();\n // Does this cookie string begin with the name we want?\n if (cookie.substring(0, name.length + 1) === (name + '=')) {\n return decodeURIComponent(cookie.substring(name.length + 1));\n }\n }\n }\n throw new Error(`No such cookie ${name}`);\n}\n","\n\n\n\n\n\n","/*\n *\n * OSIS stands for Open Student Information System. It's an application\n * designed to manage the core business of higher education institutions,\n * such as universities, faculties, institutes and professional schools.\n * The core business involves the administration of students, teachers,\n * courses, programs and so on.\n *\n * Copyright (C) 2015-2021 Université catholique de Louvain (http://www.uclouvain.be)\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * A copy of this license - GNU General Public License - is available\n * at the root of the source code of this program. If not,\n * see http://www.gnu.org/licenses/.\n *\n */\n\nimport {createI18n} from 'vue-i18n';\nimport fr from \"./locales/fr\";\nimport en from \"./locales/en\";\n\nexport const i18n = createI18n({\n locale: document.documentElement.lang || 'en',\n messages: {\n en,\n fr,\n },\n});\n","/*\n *\n * OSIS stands for Open Student Information System. It's an application\n * designed to manage the core business of higher education institutions,\n * such as universities, faculties, institutes and professional schools.\n * The core business involves the administration of students, teachers,\n * courses, programs and so on.\n *\n * Copyright (C) 2015-2021 Université catholique de Louvain (http://www.uclouvain.be)\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * A copy of this license - GNU General Public License - is available\n * at the root of the source code of this program. If not,\n * see http://www.gnu.org/licenses/.\n *\n */\n/* eslint-disable vue/prefer-import-from-vue */\nimport {createApp} from '@vue/runtime-dom'; // to allow to be spied on\nimport NotificationViewer from './NotificationViewer.vue';\nimport {i18n} from './i18n';\n\ninterface Props extends Record {\n baseUrl: string,\n interval?: number,\n limit?: number,\n truncateLength?: number,\n}\n\ndocument.querySelectorAll('#notification-viewer').forEach((elem) => {\n const props: Props = {baseUrl: \"\", ...elem.dataset};\n if (elem.dataset.interval) {\n props.interval = Number.parseInt(elem.dataset.interval);\n }\n if (elem.dataset.limit) {\n props.limit = Number.parseInt(elem.dataset.limit);\n }\n if (elem.dataset.truncateLength) {\n props.truncateLength = Number.parseInt(elem.dataset.truncateLength);\n }\n createApp(NotificationViewer, props).use(i18n).mount(elem);\n});\n"],"names":["truncate","string","maxLength","options","EMPTY_OBJECT","EMPTY_STRING","DEFAULT_TRUNCATE_SYMBOL","DEFAULT_SLOP","EXCLUDE_TAGS","items","total","content","KEY_VALUE_REGEX","IS_CLOSE_REGEX","CLOSE_REGEX","SELF_CLOSE_REGEX","HTML_TAG_REGEX","URL_REGEX","IMAGE_TAG_REGEX","WORD_BREAK_REGEX","matches","result","index","tag","selfClose","_removeImageTag","match","len","_dumpCloseTag","tags","html","_getTag","tail","_getEndPosition","tailPos","defaultPos","position","isShort","slopPos","substr","startSlice","endSlice","truncate_1","_sfc_main$2","defineComponent","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_normalizeClass","_createElementVNode","_hoisted_1","_openBlock","_withModifiers","$event","_sfc_main$1","TruncateHtml","_resolveComponent","_createElementBlock","_hoisted_2","_hoisted_3","_toDisplayString","_createVNode","_component_TruncateHtml","getCookie","name","cookies","i","cookie","_sfc_main","NotificationEntry","newNotifications","uuid","newNotification","notificationIndex","notification","n","notifications","url","params","loadingAnimation","response","e","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_Fragment","_hoisted_4","_createCommentVNode","args","_renderList","_createBlock","_component_NotificationEntry","i18n","createI18n","en","fr","elem","props","createApp","NotificationViewer"],"mappings":"6TAaA,SAASA,EAASC,EAAQC,EAAWC,EAAS,CAC1C,IAAIC,EAAe,CAAA,EACfC,EAAe,GACfC,EAA0B,MAC1BC,EAAe,GAAKL,EAAYA,EAAY,GAC5CM,EAAe,CAAC,MAAO,IAAI,EAC3BC,EAAQ,CAAA,EACRC,EAAQ,EACRC,EAAUN,EACVO,EAAkB,qCAClBC,EAAiB,eACjBC,GAAc,cACdC,GAAmB,IAAI,OAAO,gBAAkBH,EAAkBE,GAAc,GAAG,EACnFE,GAAiB,IAAI,OAAO,gBAAkBJ,EAAkBC,EAAiB,GAAG,EACpFI,EAAY,qGACZC,GAAkB,IAAI,OAAO,WAAaN,EAAkBC,EAAiB,GAAG,EAChFM,GAAmB,IAAI,OAAO,OAAQ,GAAG,EACzCC,EAAU,GACVC,EACAC,EAEAC,EACAC,EAUJ,SAASC,GAAgBxB,EAAQ,CAC7B,IAAIyB,EAAQR,GAAgB,KAAKjB,CAAM,EACnCqB,EACAK,EAEJ,OAAKD,GAILJ,EAAQI,EAAM,MACdC,EAAMD,EAAM,CAAC,EAAE,OAERzB,EAAO,UAAU,EAAGqB,CAAK,EAAIrB,EAAO,UAAUqB,EAAQK,CAAG,GANrD1B,CAOd,CAUD,SAAS2B,GAAcC,EAAM,CACzB,IAAIC,EAAO,GAEX,OAAAD,EAAK,QAAS,EAAC,QAAQ,SAA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