1(window.webpackJsonp=window.webpackJsonp||[]).push([[15],[,,,,,,,,,function(e,t,n){"use strict";n.d(t,"v",(function(){return r})),n.d(t,"q",(function(){return o})),n.d(t,"j",(function(){return l})),n.d(t,"t",(function(){return c})),n.d(t,"k",(function(){return d})),n.d(t,"u",(function(){return h})),n.d(t,"o",(function(){return f})),n.d(t,"s",(function(){return m})),n.d(t,"l",(function(){return y})),n.d(t,"m",(function(){return v})),n.d(t,"n",(function(){return _})),n.d(t,"h",(function(){return O})),n.d(t,"w",(function(){return E})),n.d(t,"i",(function(){return k})),n.d(t,"r",(function(){return S})),n.d(t,"f",(function(){return A})),n.d(t,"b",(function(){return T})),n.d(t,"e",(function(){return P})),n.d(t,"c",(function(){return C})),n.d(t,"d",(function(){return x})),n.d(t,"g",(function(){return D})),n.d(t,"a",(function(){return I})),n.d(t,"p",(function(){return w}));var r={fallbackLocale:"en"},o=[{code:"en",iso:"en-US",file:"index-en-US.js"},{code:"fr",iso:"fr-FR",file:"index-fr-FR.js"}],l="en",c="___",d="default",h="prefix_and_default",f=!0,m=null,y={useCookie:!0,cookieDomain:null,cookieKey:"i18n_madmagz",alwaysRedirect:!0,fallbackLocale:null,cookieAge:365,cookieCrossOrigin:!1,cookieSecure:!1,redirectOn:"root"},v=!1,_=!1,O="",E={moduleName:"i18n",syncLocale:!0,syncMessages:!1,syncRouteParams:!0},k=function(){return null},S=function(){return null},A="nuxt-i18n",T="code",P="iso",C="domain",x="file",D={PREFIX:"prefix",PREFIX_EXCEPT_DEFAULT:"prefix_except_default",PREFIX_AND_DEFAULT:"prefix_and_default",NO_PREFIX:"no_prefix"},I="nuxtI18n",w=["en","fr"]},function(e,t,n){"use strict";n.d(t,"i",(function(){return m})),n.d(t,"j",(function(){return y})),n.d(t,"a",(function(){return v})),n.d(t,"n",(function(){return _})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return E})),n.d(t,"c",(function(){return k})),n.d(t,"h",(function(){return A})),n.d(t,"o",(function(){return P})),n.d(t,"k",(function(){return x})),n.d(t,"m",(function(){return D})),n.d(t,"d",(function(){return I})),n.d(t,"b",(function(){return w})),n.d(t,"g",(function(){return R})),n.d(t,"l",(function(){return z}));n(19),n(13);var r=n(39),o=(n(36),n(528),n(254),n(40)),l=(n(101),n(102),n(134),n(564),n(52),n(28),n(3)),c=(n(82),n(11),n(7),n(16),n(26),n(4)),d=n(1);function h(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?h(Object(source),!0).forEach((function(t){Object(c.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):h(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}function m(e){d.default.config.errorHandler&&d.default.config.errorHandler(e)}function y(e){return e.then((function(e){return e.default||e}))}function v(e,t){if(t||!e.options.__hasNuxtData){var n=e.options._originDataFn||e.options.data||function(){return{}};e.options._originDataFn=n,e.options.data=function(){var data=n.call(this,this);return this.$ssrContext&&(t=this.$ssrContext.asyncData[e.cid]),f({},data,{},t)},e.options.__hasNuxtData=!0,e._Ctor&&e._Ctor.options&&(e._Ctor.options.data=e.options.data)}}function _(e){return e.options&&e._Ctor===e||(e.options?(e._Ctor=e,e.extendOptions=e.options):(e=d.default.extend(e))._Ctor=e,!e.options.name&&e.options.__file&&(e.options.name=e.options.__file)),e}function O(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"components";return Array.prototype.concat.apply([],e.matched.map((function(e,r){return Object.keys(e[n]).map((function(o){return t&&t.push(r),e[n][o]}))})))}function E(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return O(e,t,"instances")}function k(e,t){return Array.prototype.concat.apply([],e.matched.map((function(e,n){return Object.keys(e.components).reduce((function(r,o){return e.components[o]?r.push(t(e.components[o],e.instances[o],e,o,n)):delete e.components[o],r}),[])})))}function S(e,t){return Promise.all(k(e,function(){var e=Object(l.a)(regeneratorRuntime.mark((function e(n,r,o,l){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof n||n.options){e.next=4;break}return e.next=3,n();case 3:n=e.sent;case 4:return o.components[l]=n=_(n),e.abrupt("return","function"==typeof t?t(n,r,o,l):n);case 6:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}()))}function A(e){return T.apply(this,arguments)}function T(){return(T=Object(l.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,S(t);case 4:return e.abrupt("return",f({},t,{meta:O(t).map((function(e,n){return f({},e.options.meta,{},(t.matched[n]||{}).meta)}))}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e,t){return C.apply(this,arguments)}function C(){return(C=Object(l.a)(regeneratorRuntime.mark((function e(t,n){var l,c,d,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.context||(t.context={isStatic:!0,isDev:!1,isHMR:!1,app:t,store:t.store,payload:n.payload,error:n.error,base:"/",env:{baseUrl:"https://madmagz.app",websocketUrl:"wss://5ekt47tv7c.execute-api.eu-west-1.amazonaws.com/dev"}},n.req&&(t.context.req=n.req),n.res&&(t.context.res=n.res),n.ssrContext&&(t.context.ssrContext=n.ssrContext),t.context.redirect=function(e,path,n){if(e){t.context._redirected=!0;var r=Object(o.a)(path);if("number"==typeof e||"undefined"!==r&&"object"!==r||(n=path||{},path=e,r=Object(o.a)(path),e=302),"object"===r&&(path=t.router.resolve(path).route.fullPath),!/(^[.]{1,2}\/)|(^\/(?!\/))/.test(path))throw path=N(path,n),window.location.replace(path),new Error("ERR_REDIRECT");t.context.next({path:path,query:n,status:e})}},t.context.nuxtState=window.__NUXT__),e.next=3,Promise.all([A(n.route),A(n.from)]);case 3:l=e.sent,c=Object(r.a)(l,2),d=c[0],h=c[1],n.route&&(t.context.route=d),n.from&&(t.context.from=h),t.context.next=n.next,t.context._redirected=!1,t.context._errored=!1,t.context.
1isHMR=!1,t.context.params=t.context.route.params||{},t.context.query=t.context.route.query||{};case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e,t){return!e.length||t._redirected||t._errored?Promise.resolve():D(e[0],t).then((function(){return x(e.slice(1),t)}))}function D(e,t){var n;return(n=2===e.length?new Promise((function(n){e(t,(function(e,data){e&&t.error(e),n(data=data||{})}))})):e(t))&&n instanceof Promise&&"function"==typeof n.then?n:Promise.resolve(n)}function I(base,e){var path=decodeURI(window.location.pathname);return"hash"===e?window.location.hash.replace(/^#\//,""):(base&&0===path.indexOf(base)&&(path=path.slice(base.length)),(path||"/")+window.location.search+window.location.hash)}function w(e,t){return function(e,t){for(var n=new Array(e.length),i=0;i<e.length;i++)"object"===Object(o.a)(e[i])&&(n[i]=new RegExp("^(?:"+e[i].pattern+")$",F(t)));return function(t,r){for(var path="",data=t||{},o=(r||{}).pretty?j:encodeURIComponent,l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var d=data[c.name||"pathMatch"],h=void 0;if(null==d){if(c.optional){c.partial&&(path+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(Array.isArray(d)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(d)+"`");if(0===d.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var f=0;f<d.length;f++){if(h=o(d[f]),!n[l].test(h))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(h)+"`");path+=(0===f?c.prefix:c.delimiter)+h}}else{if(h=c.asterisk?j(d,!0):o(d),!n[l].test(h))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+h+'"');path+=c.prefix+h}}else path+=c}return path}}(function(e,t){var n,r=[],o=0,l=0,path="",c=t&&t.delimiter||"/";for(;null!=(n=L.exec(e));){var d=n[0],h=n[1],f=n.index;if(path+=e.slice(l,f),l=f+d.length,h)path+=h[1];else{var m=e[l],y=n[2],v=n[3],_=n[4],O=n[5],E=n[6],k=n[7];path&&(r.push(path),path="");var S=null!=y&&null!=m&&m!==y,A="+"===E||"*"===E,T="?"===E||"*"===E,P=n[2]||c,pattern=_||O;r.push({name:v||o++,prefix:y||"",delimiter:P,optional:T,repeat:A,partial:S,asterisk:Boolean(k),pattern:pattern?U(pattern):k?".*":"[^"+M(P)+"]+?"})}}l<e.length&&(path+=e.substr(l));path&&r.push(path);return r}(e,t),t)}function R(e,t){var n={},r=f({},e,{},t);for(var o in r)String(e[o])!==String(t[o])&&(n[o]=!0);return n}function z(e){var t;if(e.message||"string"==typeof e)t=e.message||e;else try{t=JSON.stringify(e,null,2)}catch(n){t="[".concat(e.constructor.name,"]")}return f({},e,{message:t,statusCode:e.statusCode||e.status||e.response&&e.response.status||500})}window.onNuxtReadyCbs=[],window.onNuxtReady=function(e){window.onNuxtReadyCbs.push(e)};var L=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function j(e,t){var n=t?/[?#]/g:/[/?#]/g;return encodeURI(e).replace(n,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function M(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function U(e){return e.replace(/([=!:$/()])/g,"\\$1")}function F(e){return e&&e.sensitive?"":"i"}function N(e,t){var n,o=e.indexOf("://");-1!==o?(n=e.substring(0,o),e=e.substring(o+3)):e.startsWith("//")&&(e=e.substring(2));var l,c=e.split("/"),d=(n?n+"://":"//")+c.shift(),path=c.filter(Boolean).join("/");if(2===(c=path.split("#")).length){var h=c,f=Object(r.a)(h,2);path=f[0],l=f[1]}return d+=path?"/"+path:"",t&&"{}"!==JSON.stringify(t)&&(d+=(2===e.split("?").length?"&":"?")+function(e){return Object.keys(e).sort().map((function(t){var n=e[t];return null==n?"":Array.isArray(n)?n.slice().map((function(e){return[t,"=",e].join("")})).join("&"):t+"="+n})).filter(Boolean).join("&")}(t)),d+=l?"#"+l:""}},,function(e,t,n){"use strict";n(36);t.a={normalizePayloadURI:function(e,t){if("string"==typeof e||e instanceof String)return e;var n=e[t];return void 0!==e.query&&(n+=e.query),n},getProperty:function(e,object){for(var t=object||this,n=e.split("."),i=0;i<n.length&&null!=(t=t[n[i]]);i++);return t},setProperty:function(e,object,t){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=object||this,o=e.split(".");if(1!==o.length){for(var i=0;i<o.length-1;i++)r=r[o[i]];n?r[o[o.length-2]].set(o[o.length-1],t):r[o[o.length-1]]=t}else n?r.set(e,t):r[e]=t}}},,function(e,t,n){"use strict";n(83),n(103),n(52),n(254),n(16),n(159);var r=n(39),o=(n(597),n(36),n(11),n(82),n(135),n(101),n(102),n(7),n(27)),l=n(500),c=n.n(l),d={debounce:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this,slot=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"_debounceSlot";return n[slot]||(n[slot]={}),n[slot].timeoutID&&clearTimeout(n[slot].timeoutID),function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];n[slot].action=function(){e.apply(n,o),delete n[slot]},n[slot].timeoutID=setTimeout(n[slot].action,t)}},cancelDebounce:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,slot=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_debounceSlot";e[slot]&&e[slot].timeoutID&&(clearTimeout(e[slot].timeoutID),delete e[slot])},executeDebounceNow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,slot=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_debounceSlot";e[slot]&&e[slot].timeoutID&&(clearTimeout(e[slot].timeoutID),e[slot].action&&e[slot].action())},convertPixelToMilimeters:function(e,t){return Math.round(25.4*e/t)},convertMilimetersToPixels:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n?Math.round(e*t/25.4):e*t/25.4},parseToPixel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:96,n=/\D{0,2}$/.exec(e),r=parseFloat(e);switch(n[0]){case"mm":return r*t/25.4;case"cm":return r*t/2.54;case"in":return r*t;case"pt":return r*t/72;default:return r}},convertFromPixel:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:96;switch(t){case"mm":return e/n*25.4;case"cm":return e/n*2.54;case"in":return e/n;case"pt":return e/n*72;default:return e}}
1,roundToPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Math.round(e*Math.pow(10,t))*Math.pow(10,-t)},bound:function(e,t,n){return n>e?Math.min(n,Math.max(e,t)):Math.max(e,Math.min(n,t))},between:function(e,a,b){var t=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t?e>=Math.min(a,b)&&e<=Math.max(a,b):e>Math.min(a,b)&&e<Math.max(a,b)},unicodeLength:function(e){return e&&0!==e.length?Object(o.a)(e).length:0},isWithinRange:function(a,b,e){return Math.abs(a-b)<=e},randomHSVColor:function(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,t=.618033988749895,n=Math.random();return n+=t,n%=1,{h:n*=360,s:s,v:e}},uniqidplus:function(){var e=c.a.time(),t=Math.random(),i=Math.floor(t*(e.length-1)),n=t.toString(36).substring(2,5);return e.substring(0,i).concat(n,e.substring(i))},uniqName:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length,r=d.uniqidplus();r.length<e;)r+=t.charAt(Math.floor(Math.random()*n));return r.substring(0,e)},randomName:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length,r="";r.length<e;)r+=t.charAt(Math.floor(Math.random()*n));return r.substring(0,e)},fontWeightIsBold:function(e){if("bold"===e)return!0;if("normal"===e)return!1;var t=parseInt(e,10);return!isNaN(t)&&t>400},parseFontStyle:function(style){var e=new Map([["n","normal"],["i","italic"],["o","oblique"]]),t=new Map([["1","100"],["2","200"],["3","300"],["4","400"],["5","500"],["6","600"],["7","700"],["8","800"],["9","900"],["4","normal"],["7","bold"]]),n={fontStyle:"normal",fontWeight:"normal"};if("italic"===style||"i"===style)return n.fontStyle="italic",n;if("bold"===style||"b"===style)return n.fontWeight="bold",n;if("bolditalic"===style||"bi"===style)return n.fontStyle="italic",n.fontWeight="bold",n;if(2==style.length){var r=style.split("");return n.fontStyle=e.get(r[0]),n.fontWeight=t.get(r[1]),n}return style.endsWith("i")?(n.fontWeight=style.substring(0,style.length-1),n.fontStyle="italic"):n.fontWeight=style,n},normalizeCroppieRect:function(e){var t=e.map(Number),n=Object(r.a)(t,4),o=n[0],l=n[1];return{left:o,top:l,width:n[2]-o,height:n[3]-l}},retrieveCroppiePoints:function(e){return[e.left,e.top,e.width+e.left,e.height+e.top]},normalizeCroppieOrientation:function(e){var t={flip:!1,flop:!1,rotate:0};if(e<=1)return t;switch(2!==e&&5!==e||(t.flop=!0),4!==e&&7!==e||(t.flip=!0),e){case 3:t.rotate=180;break;case 5:case 8:t.rotate=-90;break;case 6:case 7:t.rotate=90}return t},retrieveCroppieOrientation:function(e){if(!e||0===Object.keys(e).length)return 1;if(e.flop){if(0===e.rotate)return 2;if(-90===e.rotate)return 5}if(e.flip){if(0===e.rotate)return 4;if(90===e.rotate)return 7}switch(e.rotate){case 180:return 3;case-90:return 8;case 90:return 6;default:return 1}},convertToRoman:function(e){for(var t={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},n="",r=0,o=Object.keys(t);r<o.length;r++){var i=o[r],q=Math.floor(e/t[i]);e-=q*t[i],n+=i.repeat(q)}return n},isSearchInText:function(e,t){if(!e||!t)return!1;var n=function(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()};return n(t).includes(n(e))}};t.a=d},,,,,,,,,,,,,,,function(e,t,n){"use strict";n(55),n(159);var r={name:"MzAppIcon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:24},fill:{type:Number,default:0},weight:{type:Number,default:200},grad:{type:Number,default:200},inline:{type:Boolean,default:!1}},computed:{iconStyle:function(){var style={fontSize:"".concat(this.size,"px"),fontVariationSettings:"'FILL' ".concat(this.fill,", 'wght' ").concat(this.weight,", 'GRAD' ").concat(this.grad,", 'opsz' ").concat(this.size)};return this.inline&&(style.lineHeight="1px",style.verticalAlign="middle"),style}}},o=n(6),component=Object(o.a)(r,(function(){var e=this.$createElement;return(this._self._c||e)("span",{staticClass:"material-symbols-outlined app-icon",style:this.iconStyle,attrs:{"aria-hidden":"true"}},[this._v("\n "+this._s(this.name)+"\n")])}),[],!1,null,null,null);t.a=component.exports},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";(function(e){n(134),n(118),n(101),n(102),n(7),n(36);var r="https://d1eb9pt0imhdgw.cloudfront.net/",o="https://mz-media-data-production.s3.eu-west-1.amazonaws.com/";t.a={getFabricImageResizedData:function(object,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,n=object.width*object.scaleX*e,r=object.height*object.scaleY*e,o=this.getImageBaseKey(object.src);if(!o)return null;if(t&&t>0){if(n>t){var l=r/n;n=t,r=t*l}if(r>t){var c=n/r;n=t*c,r=t}}return(n>object.width||r>object.height)&&(n=object.width,r=object.height),{src:this.getImageResizedSrc({ke
1y:o},n,r),width:n,height:r,scaleX:object.width*object.scaleX/n,scaleY:object.height*object.scaleY/r}},getImageResizedSrc:function(img,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cover",l={bucket:"mz-media-data-production",key:img.key};if(img.updatedAt&&(l.updatedAt=img.updatedAt),"image/svg+xml"===img.type){var c=img.key.split("/"),d=c.pop(),h=d.split("."),f=(h.pop(),h.join(".")+".png");c.push("svg2png"),c.push(f);var m=c.join("/");l.key=m}l.edits={resize:{width:Math.round(t),height:Math.round(n),fit:o}};var y=JSON.stringify(l);return r+e.from(y).toString("base64")},getImageBaseKey:function(e){var t=e.match(new RegExp("https://(.*).s3.(.*).amazonaws.com/(.*)"));return t&&t.length>=4?t[3]:null},getImageBaseSrc:function(img){return o+img.key},computePageKey:function(e,t){return"pages/"+(t?e+"_"+t:e)+"-page-preview.jpg"},getPageSrc:function(e,t){return o+this.computePageKey(e,t)},computePdfKey:function(e,t){return"pdfs/"+e+"/"+t.version+"/"+t.files.magazine},computePdfCoverKey:function(e,t){return"pdfs/"+e+"/"+t.version+"/"+t.files.cover},getPdfSrc:function(e,t,n){return o+"pdfs/"+e+"/"+t+"/"+n},getViewerCodeSrc:function(e,t){return o+"zips/"+e+"/"+t},getWorkspaceMagazinesZipSrc:function(e,t,n){return o+"zips/"+e+"/"+t+"/"+n}}}).call(this,n(173).Buffer)},,,,,,,,,,,,,,,function(e,t,n){"use strict";t.a={isUrl:function(e){if(!e||e.length<1)return!1;return/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/.test(e)},isEmail:function(e){if(!e||e.length<1)return!1;return/^\w+([\.\-\\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,99})+$/.test(e)},isVideoUrl:function(e){return/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$/i.test(e)||/^.*vimeo.com\/(\d+)($|\/|\b)/i.test(e)||/^.*(?:\/video|dai.ly)\/([A-Za-z0-9]+)([^#\&\?]*).*/i.test(e)},isValidPassword:function(e){if(!e||e.length<8)return!1;return/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/.test(e)}}},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(28),n(19),n(13),n(11),n(7),n(16);var r=n(3),o=n(4),l=(n(26),n(1)),c=n(151),d=n(305),h=n.n(d),f=n(128),m=n.n(f),y=n(154),v=n(10);"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",window.addEventListener("beforeunload",(function(){window.history.scrollRestoration="auto"})),window.addEventListener("load",(function(){window.history.scrollRestoration="manual"})));var _=function(){return Object(v.j)(n.e(24).then(n.bind(null,953)))},O=function(){return Object(v.j)(n.e(52).then(n.bind(null,944)))},E=function(){return Object(v.j)(n.e(71).then(n.bind(null,954)))},k=function(){return Object(v.j)(n.e(72).then(n.bind(null,955)))},S=function(){return Object(v.j)(n.e(76).then(n.bind(null,956)))},A=function(){return Object(v.j)(n.e(18).then(n.bind(null,957)))},T=function(){return Object(v.j)(Promise.all([n.e(0),n.e(22)]).then(n.bind(null,958)))},P=function(){return Object(v.j)(n.e(34).then(n.bind(null,959)))},C=function(){return Object(v.j)(n.e(38).then(n.bind(null,945)))},x=function(){return Object(v.j)(n.e(44).then(n.bind(null,960)))},D=function(){return Object(v.j)(Promise.all([n.e(0),n.e(45)]).then(n.bind(null,961)))},I=function(){return Object(v.j)(n.e(59).then(n.bind(null,962)))},w=function(){return Object(v.j)(n.e(63).then(n.bind(null,946)))},R=function(){return Object(v.j)(n.e(64).then(n.bind(null,947)))},z=function(){return Object(v.j)(n.e(65).then(n.bind(null,963)))},L=function(){return Object(v.j)(n.e(67).then(n.bind(null,964)))},j=function(){return Object(v.j)(n.e(70).then(n.bind(null,965)))},M=function(){return Object(v.j)(n.e(73).then(n.bind(null,966)))},U=function(){return Object(v.j)(Promise.all([n.e(0),n.e(17)]).then(n.bind(null,967)))},F=function(){return Object(v.j)(n.e(19).then(n.bind(null,968)))},N=function(){return Object(v.j)(Promise.all([n.e(0),n.e(20)]).then(n.bind(null,969)))},$=function(){return Object(v.j)(Promise.all([n.e(0),n.e(23)]).then(n.bind(null,970)))},B=function(){return Object(v.j)(Promise.all([n.e(14),n.e(0),n.e(27)]).then(n.bind(null,971)))},G=function(){return Object(v.j)(Promise.all([n.e(0),n.e(28)]).then(n.bind(null,948)))},H=function(){return Object(v.j)(Promise.all([n.e(0),n.e(29)]).then(n.bind(null,972)))},V=function(){return Object(v.j)(Promise.all([n.e(0),n.e(32)]).then(n.bind(null,973)))},W=function(){return Object(v.j)(n.e(35).then(n.bind(null,974)))},K=function(){return Object(v.j)(Promise.all([n.e(0),n.e(39)]).then(n.bind(null,975)))},Y=function(){return Object(v.j)(n.e(43).then(n.bind(null,976)))},Z=function(){return Object(v.j)(Promise.all([n.e(0),n.e(46)]).then(n.bind(null,977)))},X=function(){return Object(v.j)(Promise.all([n.e(0),n.e(47)]).then(n.bind(null,978)))},J=function(){return Object(v.j)(Promise.all([n.e(0),n.e(50)]).then(n.bind(null,979)))},Q=function(){return Object(v.j)(n.e(51).then(n.bind(null,980)))},ee=function(){return Object(v.j)(n.e(60).then(n.bind(null,949)))},te=function(){return Object(v.j)(n.e(61).then(n.bind(null,981)))},ae=function(){return Object(v.j)(n.e(62).then(n.bind(null,982)))},ne=function(){return Object(v.j)(Promise.all([n.e(0),n.e(31)]).then(n.bind(null,983)))},ie=function(){return Object(v.j)(n.e(53).then(n.bind(null,984)))},re=function(){return Object(v.j)(n.e(54).then(n.bind(null,941)))},oe=function(){return Object(v.j)(n.e(25).then(n.bind(null,950)))},se=function(){return Object(v.j)(Promise.all([n.e(14),n.e(26)]).then(n.bind(null,951)))},le=function(){return Object(v.j)(n.e(30).then(n.bind(null,942)))},ce=function(){return Object(v.j)(Promise.all([n.e(3),n.e(10),n.e(36)]).then(n.bind(null,952)))},ue=function(){return Object(v.j)(n.e(37).then(n.bind(null,985)))},de=function(){return Object(v.j)(n.e(40).then(n.bind(null,986)))}
1,pe=function(){return Object(v.j)(n.e(41).then(n.bind(null,987)))},he=function(){return Object(v.j)(n.e(42).then(n.bind(null,988)))},fe=function(){return Object(v.j)(n.e(48).then(n.bind(null,989)))},me=function(){return Object(v.j)(n.e(49).then(n.bind(null,990)))},ge=function(){return Object(v.j)(Promise.all([n.e(3),n.e(13),n.e(11),n.e(12),n.e(56)]).then(n.bind(null,939)))},be=function(){return Object(v.j)(Promise.all([n.e(12),n.e(55)]).then(n.bind(null,940)))},ye=function(){return Object(v.j)(n.e(57).then(n.bind(null,943)))},ve=function(){return Object(v.j)(n.e(58).then(n.bind(null,991)))},_e=function(){return Object(v.j)(Promise.all([n.e(3),n.e(33)]).then(n.bind(null,992)))},Oe=function(){return Object(v.j)(n.e(74).then(n.bind(null,993)))},Ee=function(){return Object(v.j)(Promise.all([n.e(3),n.e(13),n.e(11),n.e(10),n.e(21)]).then(n.bind(null,938)))},ke=function(){return Object(v.j)(n.e(69).then(n.bind(null,994)))},Se=function(){return Object(v.j)(n.e(75).then(n.bind(null,995)))},Ae=function(){return Object(v.j)(n.e(77).then(n.bind(null,996)))},Te=function(){return Object(v.j)(n.e(66).then(n.bind(null,997)))},Pe=function(){return Object(v.j)(n.e(68).then(n.bind(null,998)))},Ce=function(){},xe=y.a.prototype.push;y.a.prototype.push=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce,n=arguments.length>2?arguments[2]:void 0;return xe.call(this,e,t,n)},l.default.use(y.a);var De={mode:"history",base:decodeURI("/"),linkActiveClass:"nuxt-link-active",linkExactActiveClass:"nuxt-link-exact-active",scrollBehavior:function(e,t,n){var r=!1,o=Object(v.e)(e);(o.length<2&&o.every((function(e){return!1!==e.options.scrollToTop}))||o.some((function(e){return e.options.scrollToTop})))&&(r={x:0,y:0}),n&&(r=n);var l=window.$nuxt;return e.path===t.path&&e.hash!==t.hash&&l.$nextTick((function(){return l.$emit("triggerScroll")})),new Promise((function(t){l.$once("triggerScroll",(function(){if(e.hash){var n=e.hash;void 0!==window.CSS&&void 0!==window.CSS.escape&&(n="#"+window.CSS.escape(n.substr(1)));try{document.querySelector(n)&&(r={selector:n})}catch(e){console.warn("Failed to save scroll position. Please add CSS.escape() polyfill (https://github.com/mathiasbynens/CSS.escape).")}}t(r)}))}))},routes:[{path:"/admin",component:_,name:"admin___en___default"},{path:"/client",component:O,name:"client___en___default"},{path:"/login",component:E,name:"login___en___default"},{path:"/maintenance",component:k,name:"maintenance___en___default"},{path:"/register",component:S,name:"register___en___default"},{path:"/admin/communication",component:A,name:"admin-communication___en___default"},{path:"/admin/errorlog",component:T,name:"admin-errorlog___en___default"},{path:"/admin/settings",component:P,name:"admin-settings___en___default"},{path:"/admin/template",component:C,name:"admin-template___en___default"},{path:"/admin/tools",component:x,name:"admin-tools___en___default"},{path:"/admin/tracking",component:D,name:"admin-tracking___en___default"},{path:"/client/offer",component:I,name:"client-offer___en___default"},{path:"/client/organization",component:w,name:"client-organization___en___default"},{path:"/client/user",component:R,name:"client-user___en___default"},{path:"/client/workspace",component:z,name:"client-workspace___en___default"},{path:"/en/",component:L,name:"index___en"},{path:"/en/admin",component:_,name:"admin___en"},{path:"/en/client",component:O,name:"client___en"},{path:"/en/login",component:E,name:"login___en"},{path:"/en/maintenance",component:k,name:"maintenance___en"},{path:"/en/register",component:S,name:"register___en"},{path:"/fr/",component:L,name:"index___fr"},{path:"/fr/admin",component:_,name:"admin___fr"},{path:"/fr/client",component:O,name:"client___fr"},{path:"/fr/login",component:E,name:"login___fr"},{path:"/fr/maintenance",component:k,name:"maintenance___fr"},{path:"/fr/register",component:S,name:"register___fr"},{path:"/login/callback",component:j,name:"login-callback___en___default"},{path:"/password/forgot",component:M,name:"password-forgot___en___default"},{path:"/admin/authStrategy/list",component:U,name:"admin-authStrategy-list___en___default"},{path:"/admin/communication/message",component:F,name:"admin-communication-message___en___default"},{path:"/admin/communication/notification",component:N,name:"admin-communication-notification___en___default"},{path:"/admin/format/list",component:$,name:"admin-format-list___en___default"},{path:"/admin/magazine/list",component:B,name:"admin-magazine-list___en___default"},{path:"/admin/offer/list",component:G,name:"admin-offer-list___en___default"},{path:"/admin/order/list",component:H,name:"admin-order-list___en___default"},{path:"/admin/organization/list",component:V,name:"admin-organization-list___en___default"},{path:"/admin/settings/maintenance",component:W,name:"admin-settings-maintenance___en___default"},{path:"/admin/template/list",component:K,name:"admin-template-list___en___default"},{path:"/admin/tools/exportMagazineThumb",component:Y,name:"admin-tools-exportMagazineThumb___en___default"},{path:"/admin/users/adminList",component:Z,name:"admin-users-adminList___en___default"},{path:"/admin/users/clientList",component:X,name:"admin-users-clientList___en___default"},{path:"/admin/workspace/list",component:J,name:"admin-workspace-list___en___default"},{path:"/client/error/noOffer",component:Q,name:"client-error-noOffer___en___default"},{path:"/client/order/cart",component:ee,name:"client-order-cart___en___default"},{path:"/client/order/checkoutFinish",component:te,name:"client-order-checkoutFinish___en___default"},{path:"/client/order/list",component:ae,name:"client-order-list___en___default"},{path:"/en/admin/communication",component:A,name:"admin-communication___en"},{path:"/en/admin/errorlog",component:T,name:"admin-errorlog___en"},{path:"/en/admin/settings",component:P,name:"admin-settings___en"},{path:"/en/admin/template",component:C,name:"admin-template___en"},{path:"/en/admin/tools",component:x,name:"admin-tools___en"},{path:"/en/admin/tracking",component:D,name:"admin-tracking___en"},{path:"/en/client/offer",component:I,name:"client-offer___en"},{path:"/en/client/organization",component:w,name:"client-organization___en"},{path:"/en/client/user",component:R,name:"client-user___en"},{path:"/en/client/workspace",component:z,name:"client-workspace___en"},{path:"/en/login/callback",component:j,name:"login-callback___en"},{path:"/en/password/forgot",component:M,name:"password-forgot___en"},{path:"/fr/admin/communication",component:A,name:"admin-communication___fr"},{path:"/fr/admin/errorlog",component:T,name:"admin-errorlog___fr"},{path:"/fr/admin/settings",component:P,name:"admin-settings___fr"},{path:"/fr/admin/template",component:C,name:"admin-template___fr"},{path:"/fr/admin/tools",component:x,name:"admin-tools___fr"},{path:"/fr/admin/tracking",component:D,name:"admin-tracking___fr"},{path:"/fr/client/offer",component:I,name:"client-offer___fr"},{path:"/fr/client/organization",component:w,name:"client-organization___fr"},{path:"/fr/client/user",component:R,name:"client-user___fr"},{path:"/fr/client/workspace",component:z,name:"client-workspace___fr"},{path:"/fr/login/callback",component:j,name:"login-callback___fr"},{path:"/fr/password/forgot",component:M,name:"password-forgot___fr"},{path:"/admin/organization/list/byGroupOffer",component:ne,name:"admin-organization-list-byGroupOffer___en___default"},{path:"/client/magazine/create/chooseMagazineName",component:ie,name:"client-magazine-create-chooseMagazineName___en___default"},{path:"/client/magazine/create/selectTemplate",component:re,name:"client-magazine-create-selectTemplate___en___default"},{path:"/en/admin/authStrategy/list",component:U,name:"admin-authStrategy-list___en"},{path:"/en/admin/communication/message",component:F,name:"admin-communication-message___en"},{path:"/en/admin/communication/notification",component:N,name:"admin-communication-notification___en"},{path:"/en/admin/format/list",component:$,name:"admin-format-list___en"},{path:"/en/admin/magazine/list",component:B,name:"admin-magazine-list___en"},{path:"/en/admin/offer/list",component:G,name:"admin-offer-list___en"},{path:"/en/admin/order/list",component:H,name:"admin-order-list___en"},{path:"/en/admin/organization/list",component:V,name:"admin-organization-list___en"},{path:"/en/admin/settings/maintenance",component:W,name:"admin-settings-maintenance___en"},{path:"/en/admin/template/list",component:K,name:"admin-template-list___en"},{path:"/en/admin/tools/exportMagazineThumb",component:Y,name:"admin-tools-exportMagazineThumb___en"},{path:"/en/admin/users/adminList",component:Z,name:"admin-users-adminList___en"},{path:"/en/admin/users/clientList",component:X,name:"admin-users-clientList___en"},{path:"/en/admin/workspace/list",component:J,name:"admin-workspace-list___en"},{path:"/en/client/error/noOffer",component:Q,name:"client-error-noOffer___en"},{path:"/en/client/order/cart",component:ee,name:"client-order-cart___en"},{path:"/en/client/order/checkoutFinish",component:te,name:"client-order-checkoutFinish___en"},{path:"/en/client/order/list",component:ae,name:"client-order-list___en"},{path:"/fr/admin/authStrategy/list",component:U,name:"admin-authStrategy-list___fr"},{path:"/fr/admin/communication/message",component:F,name:"admin-communication-message___fr"},{path:"/fr/admin/communication/notification",component:N,name:"admin-communication-notification___fr"},{path:"/fr/admin/format/list",component:$,name:"admin-format-list___fr"},{path:"/fr/admin/magazine/list",component:B,name:"admin-magazine-list___fr"},{path:"/fr/admin/offer/list",component:G,name:"admin-offer-list___fr"},{path:"/fr/admin/order/list",component:H,name:"admin-order-list___fr"},{path:"/fr/admin/organization/list",component:V,name:"admin-organization-list___fr"},{path:"/fr/admin/settings/maintenance",component:W,name:"admin-settings-maintenance___fr"},{path:"/fr/admin/template/list",component:K,name:"admin-template-list___fr"},{path:"/fr/admin/tools/exportMagazineThumb",component:Y,name:"admin-tools-exportMagazineThumb___fr"},{path:"/fr/admin/users/adminList",component:Z,name:"admin-users-adminList___fr"},{path:"/fr/admin/users/clientList",component:X,name:"admin-users-clientList___fr"},{path:"/fr/admin/workspace/list",component:J,name:"admin-workspace-list___fr"},{path:"/fr/client/error/noOffer",component:Q,name:"client-error-noOffer___fr"},{path:"/fr/client/order/cart",component:ee,name:"client-order-cart___fr"},{path:"/fr/client/order/checkoutFinish",component:te,name:"client-order-checkoutFinish___fr"},{path:"/fr/client/order/list",component:ae,name:"client-order-list___fr"},{path:"/en/admin/organization/list/byGroupOffer",component:ne,name:"admin-organization-list-byGroupOffer___en"},{path:"/en/client/magazine/create/chooseMagazineName",component:ie,name:"client-magazine-create-chooseMagazineName___en"},{path:"/en/client/magazine/create/selectTemplate",component:re,name:"client-magazine-create-selectTemplate___en"},{path:"/fr/admin/organization/list/byGroupOffer",component:ne,name:"admin-organization-list-byGroupOffer___fr"},{path:"/fr/client/magazine/create/chooseMagazineName",component:ie,name:"client-magazine-create-chooseMagazineName___fr"},{path:"/fr/client/magazine/create/selectTemplate",component:re,name:"client-magazine-create-selectTemplate___fr"},{path:"/en/admin/library/edit/:libraryId?",component:oe,name:"admin-library-edit-libraryId___en"},{path:"/en/admin/magazine/edit/:magazineId?",component:se,name:"admin-magazine-edit-magazineId___en"},{path:"/en/admin/organization/edit/:organizationId?",component:le,name:"admin-organization-edit-organizationId___en"},{path:"/en/admin/style/edit/:themeId?",component:ce,name:"admin-style-edit-themeId___en"},{path:"/en/admin/template/edit/:templateId?",component:ue,name:"admin-template-edit-templateId___en"},{path:"/en/admin/textblocktype/edit/:themeId?",component:de,name:"admin-textblocktype-edit-themeId___en"},{path:"/en/admin/theme/edit/:themeId?",component:pe,name:"admin-theme-edit-themeId___en"},{path:"/en/admin/theme/list/:templateId?",component:he,name:"admin-theme-list-templateId___en"},{path:"/en/admin/users/edit/:userId?",component:fe,name:"admin-users-edit-userId___en"},{path:"/en/admin/workspace/edit/:workspaceId?",component:me,name:"admin-workspace-edit-workspaceId___en"},{path:"/en/client/magazine/edit/:magazineId?",component:ge,name:"client-magazine-edit-magazineId___en"},{path:"/fr/admin/library/edit/:libraryId?",component:oe,name:"admin-library-edit-libraryId___fr"},{path:"/fr/admin/magazine/edit/:magazineId?",component:se,name:"admin-magazine-edit-magazineId___fr"},{path:"/fr/admin/organization/edit/:organizationId?",component:le,name:"admin-organization-edit-organizationId___fr"},{path:"/fr/admin/style/edit/:themeId?",component:ce,name:"admin-style-edit-themeId___fr"},{path:"/fr/admin/template/edit/:templateId?",component:ue,name:"admin-template-edit-templateId___fr"},{path:"/fr/admin/textblocktype/edit/:themeId?",component:de,name:"admin-textblocktype-edit-themeId___fr"},{path:"/fr/admin/theme/edit/:themeId?",component:pe,name:"admin-theme-edit-themeId___fr"},{path:"/fr/admin/theme/list/:templateId?",component:he,name:"admin-theme-list-templateId___fr"},{path:"/fr/admin/users/edit/:userId?",component:fe,name:"admin-users-edit-userId___fr"},{path:"/fr/admin/workspace/edit/:workspaceId?",component:me,name:"admin-workspace-edit-workspaceId___fr"},{path:"/fr/client/magazine/edit/:magazineId?",component:ge,name:"client-magazine-edit-magazineId___fr"},{path:"/en/client/magazine/edit/:magazineId?/collaboration",component:be,name:"client-magazine-edit-magazineId-collaboration___en"},{path:"/en/client/magazine/edit/:magazineId?/library",component:ye,name:"client-magazine-edit-magazineId-library___en"},{path:"/en/client/magazine/edit/:magazineId?/publication",component:ve,name:"client-magazine-edit-magazineId-publication___en"},{path:"/fr/client/magazine/edit/:magazineId?/collaboration",component:be,name:"client-magazine-edit-magazineId-collaboration___fr"},{path:"/fr/client/magazine/edit/:magazineId?/library",component:ye,name:"client-magazine-edit-magazineId-library___fr"},{path:"/fr/client/magazine/edit/:magazineId?/publication",component:ve,name:"client-magazine-edit-magazineId-publication___fr"},{path:"/en/admin/palette/edit/:templateId?/:themeId?",component:_e,name:"admin-palette-edit-templateId-themeId___en"},{path:"/fr/admin/palette/edit/:templateId?/:themeId?",component:_e,name:"admin-palette-edit-templateId-themeId___fr"},{path:"/admin/library/edit/:libraryId?",component:oe,name:"admin-library-edit-libraryId___en___default"},{path:"/admin/magazine/edit/:magazineId?",component:se,name:"admin-magazine-edit-magazineId___en___default"},{path:"/admin/organization/edit/:organizationId?",component:le,name:"admin-organization-edit-organizationId___en___default"},{path:"/admin/style/edit/:themeId?",component:ce,name:"admin-style-edit-themeId___en___default"},{path:"/admin/template/edit/:templateId?",component:ue,name:"admin-template-edit-templateId___en___default"},{path:"/admin/textblocktype/edit/:themeId?",component:de,name:"admin-textblocktype-edit-themeId___en___default"},{path:"/admin/theme/edit/:themeId?",component:pe,name:"admin-theme-edit-themeId___en___default"},{path:"/admin/theme/list/:templateId?",component:he,name:"admin-theme-list-templateId___en___default"},{path:"/admin/users/edit/:userId?",component:fe,name:"admin-users-edit-userId___en___default"},{path:"/admin/workspace/edit/:workspaceId?",component:me,name:"admin-workspace-edit-workspaceId___en___default"},{path:"/client/magazine/edit/:magazineId?",component:ge,name:"client-magazine-edit-magazineId___en___default"},{path:"/en/password/reset/:token?",component:Oe,name:"password-reset-token___en"},{path:"/fr/password/reset/:token?",component:Oe,name:"password-reset-token___fr"},{path:"/client/magazine/edit/:magazineId?/collaboration",component:be,name:"client-magazine-edit-magazineId-collaboration___en___default"},{path:"/client/magazine/edit/:magazineId?/library",component:ye,name:"client-magazine-edit-magazineId-library___en___default"},{path:"/client/magazine/edit/:magazineId?/publication",component:ve,name:"client-magazine-edit-magazineId-publication___en___default"},{path:"/admin/palette/edit/:templateId?/:themeId?",component:_e,name:"admin-palette-edit-templat
1eId-themeId___en___default"},{path:"/en/admin/editor/:magazineId?/:paletteId?",component:Ee,name:"admin-editor-magazineId-paletteId___en"},{path:"/fr/admin/editor/:magazineId?/:paletteId?",component:Ee,name:"admin-editor-magazineId-paletteId___fr"},{path:"/en/login/:providerKey",component:ke,name:"login-providerKey___en"},{path:"/en/register/:token",component:Se,name:"register-token___en"},{path:"/en/viewer/:magazineId?",component:Ae,name:"viewer-magazineId___en"},{path:"/fr/login/:providerKey",component:ke,name:"login-providerKey___fr"},{path:"/fr/register/:token",component:Se,name:"register-token___fr"},{path:"/fr/viewer/:magazineId?",component:Ae,name:"viewer-magazineId___fr"},{path:"/password/reset/:token?",component:Oe,name:"password-reset-token___en___default"},{path:"/en/groupoffer/:groupOfferId?/stats",component:Te,name:"groupoffer-groupOfferId-stats___en"},{path:"/fr/groupoffer/:groupOfferId?/stats",component:Te,name:"groupoffer-groupOfferId-stats___fr"},{path:"/admin/editor/:magazineId?/:paletteId?",component:Ee,name:"admin-editor-magazineId-paletteId___en___default"},{path:"/en/join/:accessId?/:nickname?",component:Pe,name:"join-accessId-nickname___en"},{path:"/fr/join/:accessId?/:nickname?",component:Pe,name:"join-accessId-nickname___fr"},{path:"/login/:providerKey",component:ke,name:"login-providerKey___en___default"},{path:"/register/:token",component:Se,name:"register-token___en___default"},{path:"/viewer/:magazineId?",component:Ae,name:"viewer-magazineId___en___default"},{path:"/groupoffer/:groupOfferId?/stats",component:Te,name:"groupoffer-groupOfferId-stats___en___default"},{path:"/join/:accessId?/:nickname?",component:Pe,name:"join-accessId-nickname___en___default"},{path:"/",component:L,name:"index___en___default"}],fallback:!1};function Ie(){return new y.a(De)}var we={name:"NuxtChild",functional:!0,props:{nuxtChildKey:{type:String,default:""},keepAlive:Boolean,keepAliveProps:{type:Object,default:void 0}},render:function(e,t){var n=t.parent,data=t.data,r=t.props;data.nuxtChild=!0;for(var o=n,l=n.$nuxt.nuxt.transitions,c=n.$nuxt.nuxt.defaultTransition,d=0;n;)n.$vnode&&n.$vnode.data.nuxtChild&&d++,n=n.$parent;data.nuxtChildDepth=d;var h=l[d]||c,f={};Re.forEach((function(e){void 0!==h[e]&&(f[e]=h[e])}));var m={};ze.forEach((function(e){"function"==typeof h[e]&&(m[e]=h[e].bind(o))}));var y=m.beforeEnter;if(m.beforeEnter=function(e){if(window.$nuxt.$nextTick((function(){window.$nuxt.$emit("triggerScroll")})),y)return y.call(o,e)},!1===h.css){var v=m.leave;(!v||v.length<2)&&(m.leave=function(e,t){v&&v.call(o,e),o.$nextTick(t)})}var _=e("routerView",data);return r.keepAlive&&(_=e("keep-alive",{props:r.keepAliveProps},[_])),e("transition",{props:f,on:m},[_])}},Re=["name","mode","appear","css","type","duration","enterClass","leaveClass","appearClass","enterActiveClass","enterActiveClass","leaveActiveClass","appearActiveClass","enterToClass","leaveToClass","appearToClass"],ze=["beforeEnter","enter","afterEnter","enterCancelled","beforeLeave","leave","afterLeave","leaveCancelled","beforeAppear","appear","afterAppear","appearCancelled"],Le={name:"NuxtError",props:{error:{type:Object,default:null}},computed:{statusCode:function(){return this.error&&this.error.statusCode||500},message:function(){return this.error.message||"Error"}},head:function(){return{title:this.message,meta:[{name:"viewport",content:"width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"}]}}},je=(n(567),n(6)),Me=Object(je.a)(Le,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"__nuxt-error-page"},[n("div",{staticClass:"error"},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"90",height:"90",fill:"#DBE1EC",viewBox:"0 0 48 48"}},[n("path",{attrs:{d:"M22 30h4v4h-4zm0-16h4v12h-4zm1.99-10C12.94 4 4 12.95 4 24s8.94 20 19.99 20S44 35.05 44 24 35.04 4 23.99 4zM24 40c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z"}})]),e._v(" "),n("div",{staticClass:"title"},[e._v(e._s(e.message))]),e._v(" "),404===e.statusCode?n("p",{staticClass:"description"},[n("NuxtLink",{staticClass:"error-link",attrs:{to:"/"}}
1,[e._v("Back to the home page")])],1):e._e(),e._v(" "),e._m(0)])])}),[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"logo"},[t("a",{attrs:{href:"https://nuxtjs.org",target:"_blank",rel:"noopener"}},[this._v("Nuxt.js")])])}],!1,null,null,null).exports,Ue=(n(101),n(102),n(52),n(39)),Fe={name:"Nuxt",components:{NuxtChild:we,NuxtError:Me},props:{nuxtChildKey:{type:String,default:void 0},keepAlive:Boolean,keepAliveProps:{type:Object,default:void 0},name:{type:String,default:"default"}},errorCaptured:function(e){this.displayingNuxtError&&(this.errorFromNuxtError=e,this.$forceUpdate())},computed:{routerViewKey:function(){if(void 0!==this.nuxtChildKey||this.$route.matched.length>1)return this.nuxtChildKey||Object(v.b)(this.$route.matched[0].path)(this.$route.params);var e=Object(Ue.a)(this.$route.matched,1)[0];if(!e)return this.$route.path;var t=e.components.default;if(t&&t.options){var n=t.options;if(n.key)return"function"==typeof n.key?n.key(this.$route):n.key}return/\/$/.test(e.path)?this.$route.path:this.$route.path.replace(/\/$/,"")}},beforeCreate:function(){l.default.util.defineReactive(this,"nuxt",this.$root.$options.nuxt)},render:function(e){var t=this;return this.nuxt.err?this.errorFromNuxtError?(this.$nextTick((function(){return t.errorFromNuxtError=!1})),e("div",{},[e("h2","An error occured while showing the error page"),e("p","Unfortunately an error occured and while showing the error page another error occured"),e("p","Error details: ".concat(this.errorFromNuxtError.toString())),e("nuxt-link",{props:{to:"/"}},"Go back to home")])):(this.displayingNuxtError=!0,this.$nextTick((function(){return t.displayingNuxtError=!1})),e(Me,{props:{error:this.nuxt.err}})):e("NuxtChild",{key:this.routerViewKey,props:this.$props})}},Ne=(n(82),n(36),n(2)),$e=n(29),Be={name:"OfflineModal",components:{MzAppIcon:$e.a},props:{visible:{type:Boolean,required:!0}},data:function(){return{secondsBeforeRetry:0}},computed:{time:function(){return this.$now.time}},watch:{time:function(){var e=Math.max(Math.floor((this.$online.nextRetryTime-Date.now())/1e3),0);this.secondsBeforeRetry=e<=2?0:e}}},Ge=(n(571),Object(je.a)(Be,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{staticClass:"offline",attrs:{visible:e.visible,center:"","show-close":!1}},[n("span",{staticClass:"el-dialog__title",attrs:{slot:"title"},slot:"title"},[n("MzAppIcon",{attrs:{name:"wifi_off"}}),e._v(" "),n("span",[e._v(e._s(e.$t("offline.title")))])],1),e._v(" "),n("div",{staticClass:"container"},[n("div",{staticClass:"content"},[n("div",[e._v(e._s(e.$t("offline.disconnect")))]),e._v(" "),n("div",[e._v(e._s(e.$t("offline.checkInternet")))]),e._v(" "),n("div",[e._v(e._s(e.$t("offline.contactSupport")))])]),e._v(" "),n("div",{staticClass:"retry"},[e._v("\n "+e._s(e.$tc("offline.retryIn",e.secondsBeforeRetry,{nb:e.secondsBeforeRetry}))+"\n ")])])])}),[],!1,null,"0147e17a",null).exports);function He(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Ve={name:"TemplatesHeader",props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?He(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):He(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{}},We=Object(je.a)(Ve,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{attrs:{type:"flex",align:"left"}},[e.checkPerm("template:create")?n("el-button",{directives:[{name:"t",rawName:"v-t",value:"admin.templates.createTemplate",expression:"'admin.templates.createTemplate'"}],attrs:{type:"primary"},on:{click:function(t){return e.$go2Route({name:"admin-template-edit-templateId"})}}}
1):e._e()],1)}),[],!1,null,"3879a833",null).exports;function Ke(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Ye={name:"FormatsHeader",components:{AddOrEditFormatModal:n(320).a},props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Ke(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Ke(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{onClickCreateFormat:function(){this.$refs.createFormatModal.showCreate()}}},Ze=Object(je.a)(Ye,(function(){var e=this.$createElement,t=this._self._c||e;return t("el-row",{attrs:{type:"flex",align:"left"}},[this.checkPerm("format:create")?t("el-button",{directives:[{name:"t",rawName:"v-t",value:"admin.formats.createFormat",expression:"'admin.formats.createFormat'"}],attrs:{type:"primary"},on:{click:this.onClickCreateFormat}}):this._e(),this._v(" "),t("AddOrEditFormatModal",{ref:"createFormatModal"})],1)}),[],!1,null,"65efed7a",null).exports,Xe=(n(30),n(51)),qe=n(161);function Je(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Qe={name:"EditTemplateHeader",components:{MzAppIcon:$e.a,RequestPdfOrPublishModal:qe.a},props:[],computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Je(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Je(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm","getUID"]),{},Object(Ne.e)("magazine",["magazine"]),{},Object(Ne.e)("app",["appGUI"]),{isOwner:function(){return this.magazine.owner===this.getUID},canSwitchPublish:function(){return!!this.magazine._id&&(this.isOwner||this.checkPerm("template:editPublish"))},previewPdfData:function(){return this.magazine&&this.magazine.exportedPdfs?this.magazine.exportedPdfs.find((function(e){return"draft"==e.version})):void 0},pdfIsOutOfDate:function(){return!!this.previewPdfData&&(this.previewPdfData.exportedAt&&this.previewPdfData.magazineDate!==this.magazine.lastVisualChangeAt)},pdfIsGenerated:function(){return!!this.previewPdfData&&(this.previewPdfData.exportedAt&&this.previewPdfData.files&&this.previewPdfData.files.magazine)},pdfIsInProgress:function(){return!!this.previewPdfData&&(this.previewPdfData.requestedAt&&!this.previewPdfData.exportedAt)}}),data:function(){return{activeTabName:""}},created:function(){this.$bus.$on("flatplanExtended",this.flatplanExtended),this.updateActiveTabName()},beforeDestroy:function(){this.$bus.$off("flatplanExtended",this.flatplanExtended)},methods:{updateActiveTabName:function(){switch(this.$nuxt.$route.name.split("___")[0]){case"admin-editor-magazineId-paletteId":this.activeTabName="flatplan";break;case"admin-library-edit-libraryId":this.activeTabName="library";break;case"admin-theme-list-templateId":this.activeTabName="themes";break;case"admin-template-edit-templateId":this.activeTabName="settings";break;default:this.activeTabName=""}},onTabClick:function(){switch(this.activeTabName){case"flatplan":this.go2Editor();break;case"library":this.go2Library();break;case"themes":this.go2ThemeList();break;case"settings":this.go2Compose()}},flatplanExtended:function(){this.activeTabName="extended"===this.appGUI.flatplan.state?"flatplan":"edition"},go2Compose:function(){this.$go2Route({name:"admin-template-edit-templateId",params:{templateId:this.magazine._id}})},go2Editor:function(){this.$go2Route({name:"admin-editor-magazineId-paletteId",params:{magazineId:this.magazine._id}}),this.$bus.$emit("extendFlatplan",!0)},go2ThemeList:function(){this.$go2Route({name:"admin-theme-list-templateId",params:{templateId:this.magazine._id}})},go2Library:function(){this.$go2Route({name:"admin-library-edit-libraryId",params:{libraryId:this.magazine.library}})},onClickPublishMagazine:function(){this.$refs.requestPdfOrPublishModal.switchPublish()},onClickViewPdf:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.pdfIsGenerated||this.pdfIsInProgress||t&&this.pdfIsOutOfDate)this.$refs.requestPdfOrPublishModal.requestPdf("draft",(function(){e.pdfIsOutOfDate?e.$confirm(e.$t("public.preview.magazineHasChangeDuringGeneratePdf.message"),"",{confirmButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.confirm"),cancelButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.cancel")}).then((function(){e.onClickViewPdf(!0)})).catch((function(){e.onClickViewPdf(!1)})):e.onClickViewPdf(!1)}),!1,this.$t("public.preview.open_preview"));else if(this.previewPdfData&&this.previewPdfData.files&&this.previewPdfData.files.magazine){var n="https://madmagz.app"+this.localePath({name:"viewer-magazineId",params:{magazineId:this.magazine._id},query:{preview:1}});window.open(n,"_blank")}else console.log("onClickViewPdf without files",JSON.parse(JSON.stringify(this.previewPdfData)))},onClickDownloadPdf:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.pdfIsGenerated||this.pdfIsInProgress||t&&this.pdfIsOutOfDate)this.$refs.requestPdfOrPublishModal.requestPdf("draft",(function(){e.pdfIsOutOfDate?e.$confirm(e.$t("public.preview.magazineHasChangeDuringGeneratePdf.message"),"",{confirmButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.confirm"),cancelButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.cancel")}).then((function(){e.onClickDownloadPdf(!0)})).catch((function(){e.onClickDownloadPdf(!1)})):e.onClickDownloadPdf(!1)}),!1,this.$t("public.preview.open_preview"));else if(this.previewPdfData&&this.previewPdfData.files&&this.previewPdfData.files.magazine){var n=Xe.a.getPdfSrc(this.magazine._id,"draft",this.previewPdfData.files.magazine);window.open(n,"_blank")}else console.log("onClickDownloadPdf without files",JSON.parse(JSON.stringify(this.previewPdfData)))}},watch:{$route:function(){this.updateActiveTabName()}}},et=(n(600),Object(je.a)(Qe,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{staticClass:"row-fit-parent mr-2",attrs:{type:"flex",align:"middle"}},[n("span",{directives:[{name:"show",rawName:"v-show",value:e.magazine._id,expression:"magazine._id"}]},[e._v(e._s(e.magazine.name))]),e._v(" "),"Published"!==e.magazine.status?n("el-dropdown",{staticClass:"ml-2",attrs:{trigger:"click",placement:"bottom-start",disabled:!e.magazine._id||!e.isOwner}},[n("el-button",{attrs:{type:"default",plain:""}},[e._v("\n "+e._s(e.$t("public.edit_magazine.preview"))+"\n "),n("MzAppIcon",{staticClass:"ml-1",attrs:{name:"keyboard_arrow_down",inline:""}})],1),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{nativeOn:{click:function(t){return e.onClickViewPdf(t)}}},[e._v("\n "+e._s(e.$t("public.preview.web_version"))+"\n ")]),e._v(" "),n("el-dropdown-item",{nativeOn:{click:function(t){return e.onClickDownloadPdf(t)}}},[e._v("\n "+e._s(e.$t("public.preview.pdf_version"))+"\n ")])],1)],1):e._e(
1),e._v(" "),n("el-button",{directives:[{name:"t",rawName:"v-t",value:"Published"===e.magazine.status?"public.edit_magazine.unpublish":"public.edit_magazine.publish",expression:"\n magazine.status === 'Published'\n ? 'public.edit_magazine.unpublish'\n : 'public.edit_magazine.publish'\n "}],staticClass:"ml-2",attrs:{type:"primary",plain:"",disabled:!e.canSwitchPublish},on:{click:e.onClickPublishMagazine}}),e._v(" "),n("el-row",{staticClass:"row-fit-parent",attrs:{type:"flex",align:"middle",justify:"end"}},[n("el-tabs",{staticClass:"mr-2 app-header-nav",on:{"tab-click":e.onTabClick},model:{value:e.activeTabName,callback:function(t){e.activeTabName=t},expression:"activeTabName"}},[n("el-tab-pane",{attrs:{label:"Flatplan",name:"flatplan",disabled:!e.magazine._id}}),e._v(" "),n("el-tab-pane",{attrs:{label:"Themes",name:"themes",disabled:!e.magazine._id}}),e._v(" "),n("el-tab-pane",{attrs:{label:"Library",name:"library",disabled:!e.magazine._id}}),e._v(" "),n("el-tab-pane",{attrs:{label:"Settings",name:"settings",disabled:!e.magazine._id}})],1)],1),e._v(" "),n("RequestPdfOrPublishModal",{ref:"requestPdfOrPublishModal"})],1)}),[],!1,null,"00274028",null).exports),tt=n(27);function at(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function nt(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?at(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):at(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var it={name:"InvitAdminUserModal",components:{MzAppIcon:$e.a},props:{},computed:nt({},Object(Ne.e)("user",["roles"]),{},Object(Ne.c)("api",["checkPerm"]),{},Object(Ne.e)("organization",["organizations"]),{validateButtonDisabled:function(){return!0===this.loading||null===this.form.organization||0===this.form.roles.length||0===this.form.emails.filter((function(e){return""!==e.value})).length},formatedRoles:function(){var e=this;return this.roles.reduce((function(t,n){return t.push(nt({},n,{selected:-1!==e.form.roles.indexOf(n.name)})),t}),[])},emailsList:{get:function(){return this.form.emails.reduce((function(e,t){return e.push(t.value),e}),[]).join(";")},set:function(e){var t=e.split(";");0===t.length?this.form.emails.push({value:"",userType:"internal"}):this.form.emails=t.reduce((function(e,t){return e.push({value:t.trim(),userType:"internal"}),e}),[])}}}),data:function(){return{loading:!1,displayModal:!1,displayTextareaList:!1,exportToCSV:!1,form:{emails:[{value:"",userType:"internal"}],roles:["user"],tag:null,organization:null,sendInvit:!0}}},methods:nt({},Object(Ne.b)({loadOrganizations:"organization/LOAD_ORGANIZATIONS",invitAdminUsers:"user/INVIT_ADMIN_USERS"}),{hide:function(){this.displayModal=!1},show:function(){this.loadOrganizations({filter:{}}),this.displayModal=!0},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this;this.displayTextareaList=!1,this.$nextTick((function(){e.$refs.form.validate((function(t){!0===t?(e.loading=!0,e.invitAdminUsers({organization:e.form.organization,emails:e.form.emails,roles:e.form.roles,tag:e.form.tag,sendInvit:e.form.sendInvit}).then((function(t){e.loading=!1,t&&(e.form.sendInvit&&t.length>0&&e.$message({type:"success",message:e.$t("layout.invit_user_modal.invit_users_success")}),e.exportToCSV&&t.length>0&&e.exportUsersToCSV(t),e.form={organization:null,emails:[{value:"",userType:"internal"}],roles:["user"],tag:null,sendInvit:!0},e.hide(),e.$emit("invitFinish"))}))):e.$message({type:"error",message:e.$t("layout.invit_user_modal.invalid_email")})}))}))},exportUsersToCSV:function(e){if(e.length>0){var t=["_id","name","email","tag","invitationCode","status","createdAt"],n="data:text/csv;charset=utf-8,";n+=[t.join(",")].concat(Object(tt.a)(e.map((function(e){for(var n=[],i=0;i<t.length;i++)n.push(e[t[i]]);return n.join(",")})))).join("\n");var data=encodeURI(n),link=document.createElement("a");link.setAttribute("href",data),link.setAttribute("download","export_invitation_user_list.csv"),link.click()}},addEmail:function(){this.form.emails.push({value:"",userType:"internal"})},removeEmail:function(e){this.form.emails.length>1?this.form.emails.splice(e,1):(this.form.emails[0].value="",this.form.emails[0].userType="internal")},changeRole:function(e,t){if(t)-1===this.form.roles.indexOf(e)&&this.form.roles.push(e);else{var n=this.form.roles.indexOf(e);n>=0&&this.form.roles.splice(n,1)}}})};n(601);function ot(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var st={name:"AdminUsersHeader",components:{InvitAdminUserModal:Object(je.a)(it,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.$t("layout.invit_user_modal.title"),visible:e.displayModal,"close-on-click-modal":!1,width:"50%","append-to-body":""},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{staticClass:"mt-1"},[n("el-col",{attrs:{span:2}},[n("h2",{directives:[{name:"t",rawName:"v-t",value:"layout.invit_user_modal.action",expression:"'layout.invit_user_modal.action'"}]})]),e._v(" "),n("el-col",{attrs:{span:10,offset:4}},[n("el-checkbox",{model:{value:e.form.sendInvit,callback:function(t){e.$set(e.form,"sendInvit",t)},expression:"form.sendInvit"}},[e._v(e._s(e.$t("layout.invit_user_modal.send_invit_mail")))]),e._v(" "),n("el-checkbox",{model:{value:e.exp
1ortToCSV,callback:function(t){e.exportToCSV=t},expression:"exportToCSV"}},[e._v(e._s(e.$t("layout.invit_user_modal.export_to_csv")))])],1),e._v(" "),n("el-col",{attrs:{span:10,offset:4}},[n("small",[e._v("Invitation mail will only send for new created users")])])],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Organization")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{staticClass:"el-col el-col-24",attrs:{filterable:"",placeholder:"Select an organization"},model:{value:e.form.organization,callback:function(t){e.$set(e.form,"organization",t)},expression:"form.organization"}},e._l(e.organizations,(function(e){return n("el-option",{key:e._id,attrs:{label:e.name,value:e._id}})})),1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:2}},[n("h2",{directives:[{name:"t",rawName:"v-t",value:"layout.invit_user_modal.roles",expression:"'layout.invit_user_modal.roles'"}]})]),e._v(" "),n("el-col",{attrs:{span:18}},[n("el-row",{attrs:{type:"flex",align:"middle",justify:"center"}},e._l(e.formatedRoles,(function(t){return n("div",{key:t.name,staticClass:"mr-2"},[n("div",{staticClass:"text-style-3 text-grey"},[e._v(e._s(t.label))]),e._v(" "),n("el-switch",{staticClass:"mt-0",attrs:{disabled:!e.checkPerm(t.updatePerm)},on:{change:function(n){return e.changeRole(t.name,n)}},model:{value:t.selected,callback:function(n){e.$set(t,"selected",n)},expression:"role.selected"}})],1)})),0)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:2}},[n("h2",{directives:[{name:"t",rawName:"v-t",value:"layout.invit_user_modal.tag",expression:"'layout.invit_user_modal.tag'"}]})]),e._v(" "),n("el-col",{attrs:{span:10,offset:4}},[n("el-input",{attrs:{placeholder:e.$t("layout.invit_user_modal.tag_placeholder"),clearable:""},model:{value:e.form.tag,callback:function(t){e.$set(e.form,"tag",t)},expression:"form.tag"}})],1)],1),e._v(" "),n("br"),e._v(" "),n("h2",[e._v("\n "+e._s(e.$t("layout.invit_user_modal.emails"))+"\n "),n("el-radio-group",{staticStyle:{float:"right"},attrs:{size:"mini"},model:{value:e.displayTextareaList,callback:function(t){e.displayTextareaList=t},expression:"displayTextareaList"}},[n("el-radio-button",{attrs:{label:!1}},[e._v(e._s(e.$t("layout.invit_user_modal.display_input_list")))]),e._v(" "),n("el-radio-button",{attrs:{label:!0}},[e._v(e._s(e.$t("layout.invit_user_modal.display_textarea_list")))])],1)],1),e._v(" "),n("el-row",{staticClass:"mt-1"},[n("el-col",{attrs:{span:18,offset:2}},[n("el-form",{ref:"form",attrs:{"label-position":"left","label-width":"50px",model:e.form},nativeOn:{submit:function(e){e.preventDefault()}}},[e.displayTextareaList?n("el-form-item",[n("el-input",{attrs:{type:"textarea",rows:5,placeholder:e.$t("layout.invit_user_modal.textarea_placeholder")},model:{value:e.emailsList,callback:function(t){e.emailsList=t},expression:"emailsList"}})],1):e._l(e.form.emails,(function(t,r){return n("el-form-item",{key:r,attrs:{label:"#"+(r+1),prop:"emails."+r+".value",rules:[{type:"email",message:e.$t("layout.invit_user_modal.check_valid_email"),trigger:["blur","change"]}]}},[n("el-row",{attrs:{type:"flex"}},[n("el-select",{staticClass:"mr-1",model:{value:t.userType,callback:function(n){e.$set(t,"userType",n)},expression:"email.userType"}},[n("el-option",{attrs:{value:"internal"}}),e._v(" "),n("el-option",{attrs:{value:"guest"}})],1),e._v(" "),n("el-input",{model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"email.value"}},[n("el-button",{attrs:{slot:"append"},on:{click:function(t){return t.preventDefault(),e.removeEmail(r)}},slot:"append"},[n("MzAppIcon",{attrs:{name:"delete",inline:"",size:"16"}})],1)],1),e._v(" "),r===e.form.emails.length-1?n("el-button",{staticClass:"add-email-button",attrs:{type:"success",circle:""},on:{click:function(t){return t.preventDefault(),e.addEmail()}}},[n("MzAppIcon",{attrs:{name:"add",inline:"",size:"16"}})],1):e._e()],1)],1)}))],2)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],on:{click:e.onClickCancel}}),e._v(" "),n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.confirm",expression:"'public.alert.confirm'"}],attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:e.onClickValidate}})],1)])}),[],!1,null,"1ed871f9",null).exports},data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?ot(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):ot(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{showInvitAdminUserModal:function(){this.$refs.invitAdminUserModal.show()}}},lt=Object(je.a)(st,(function(){var e=this.$createElement,t=this._self._c||e;return t("el-row",{attrs:{type:"flex",align:"left"}},[this.checkPerm("users:invitAdmin")?t("el-button",{attrs:{type:"primary"},on:{click:this.showInvitAdminUserModal}},[this._v(this._s(this.$t("admin.users.invitNewAdminUsers")))]):this._e(),this._v(" "),t("InvitAdminUserModal",{ref:"invitAdminUserModal"})],1)}),[],!1,null,"1d646fec",null).exports;function ct(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var ut={name:"OffersHeader",components:{EditOfferModal:n(160).a},props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ct(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):ct(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{}},pt=Object(je.a)(ut,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{attrs:{type:"flex",align:"left"}},[e.checkPerm("offer:create")?n("el-button",{directives:[{name:"t",rawName:"v-t",value:"admin.offers.createOffer",expression:"'admin.offers.createOffer'"}],attrs:{type:"primary"},on:{click:function(t){return e.$refs.editOfferModal.showCreate()}}}):e._e(),e._v(" "),n("EditOfferModal",{ref:"editOfferModal"})],1)}),[],!1,null,"7ec3bcf7",null).exports,ht=n(66),ft=n(230);function mt(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function gt(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?mt(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):mt(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var bt={name:"NewOrganizationModal",components:{AdminAddOfferForm:ft.a},props:[],computed:gt({},Object(Ne.e)("organization",["organization"]),{},Object(Ne.c)("organization",["listOrganizationMarketType"]),{validateButtonDisabled:function(){return!0===this.loading||null===this.form.name||this.form.name.trim().length<2}}),data:function(){return{loading:!1,displayModal:!1,form:{name:null,contactEmail:null,collaborationType:"nickname",status:"active",marketType:"B2B"}}},mounted:function(){this.resetOrganization()},methods:gt({},Object(Ne.b)({saveOrganization:"organization/SAVE_ORGANIZATION"}),{},Object(Ne.d)({updateOrganizationField:"organization/UPDATE_FIELD",resetOrganization:"organization/RESET_ORGANIZATION"}),{hide:function(){this.displayModal=!1},show:function(){this.displayModal=!0},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this;this.$refs.formOffer.checkForm()&&(this.form.contactEmail&&this.form.contactEmail.length>0&&!ht.a.isEmail(this.form.contactEmail)?this.$messageError("Set a valid email for the contact"):(this.loading=!0,this.updateOrganizationField({key:"name",value:this.form.name}),this.updateOrganizationField({key:"status",value:this.form.status}),this.updateOrganizationField({key:"marketType",value:this.form.marketType}),this.updateOrganizationField({key:"contactEmail",value:this.form.contactEmail}),this.updateOrganizationField({key:"offer",value:this.$refs.formOffer.getForm()}),this.updateOrganizationField({key:"collaborationType",value:this.form.collaborationType}),this.saveOrganization().then((function(t){t?(e.loading=!1,e.hide(),e.$go2Route({name:"admin-organization-edit-organizationId",params:{organizationId:e.organization._id}})):e.loading=!1}))))}})};function yt(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var vt={name:"OrganizationsHeader",components:{NewOrganizationModal:Object(je.a)(bt,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-dialog",{attrs:{title:e.$t("admin.organizations.createNewModal.title"),visible:e.displayModal,"close-on-click-modal":!1,width:"50%","append-to-body":""},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",{directives:[{name:"t",rawName:"v-t",value:"admin.organizations.createNewModal.name",expression:"'admin.organizations.createNewModal.name'"}]})]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"
1name",t)},expression:"form.name"}})],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Status")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{attrs:{placeholder:"Select a status"},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[n("el-option",{attrs:{label:"Active",value:"active"}}),e._v(" "),n("el-option",{attrs:{label:"Suspended",value:"suspended"}})],1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Market type")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{model:{value:e.form.marketType,callback:function(t){e.$set(e.form,"marketType",t)},expression:"form.marketType"}},e._l(e.listOrganizationMarketType,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Collaboration type")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{model:{value:e.form.collaborationType,callback:function(t){e.$set(e.form,"collaborationType",t)},expression:"form.collaborationType"}},[n("el-option",{attrs:{value:"email",label:"By email"}}),e._v(" "),n("el-option",{attrs:{value:"nickname",label:"By nickname"}})],1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Contact email "),n("small",[e._v("(optionnal)")])])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-input",{model:{value:e.form.contactEmail,callback:function(t){e.$set(e.form,"contactEmail",t)},expression:"form.contactEmail"}})],1)],1),e._v(" "),n("AdminAddOfferForm",{ref:"formOffer",attrs:{isOptionnal:!0,showAvailableTemplate:!0}})],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],on:{click:e.onClickCancel}}),e._v(" "),n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.confirm",expression:"'public.alert.confirm'"}],attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:e.onClickValidate}})],1)])],1)}),[],!1,null,"280c764c",null).exports},props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?yt(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):yt(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{showNewOrganizationModal:function(){this.$refs.newOrganizationModal.show()}}},_t=Object(je.a)(vt,(function(){var e=this.$createElement,t=this._self._c||e;return t("el-row",{attrs:{type:"flex",align:"left"}},[this.checkPerm("organization:create")?t("el-button",{attrs:{type:"primary"},on:{click:this.showNewOrganizationModal}},[this._v(this._s(this.$t("admin.organizations.createNewOrganization")))]):this._e(),this._v(" "),t("NewOrganizationModal",{ref:"newOrganizationModal"})],1)}),[],!1,null,"fef133c8",null).exports;function Ot(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Et={name:"AuthStrategiesHeader",components:{EditAuthStrategyModal:n(491).a},props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Ot(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Ot(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{}},kt=Object(je.a)(Et,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{attrs:{type:"flex",align:"left"}},[e.checkPerm("authStrategy:adminCreate")?n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.$refs.editAuthStrategyModal.showCreate()}}}
1,[e._v("Create an auth strategy")]):e._e(),e._v(" "),n("EditAuthStrategyModal",{ref:"editAuthStrategyModal"})],1)}),[],!1,null,"5e075388",null).exports;function St(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var At={name:"ScheduledNotificationsHeader",components:{EditScheduledNotificationModal:n(492).a},props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?St(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):St(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{}},Tt=Object(je.a)(At,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{attrs:{type:"flex",align:"left"}},[e.checkPerm("notification:scheduledCreate")?n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.$refs.editScheduledNotificationModal.showCreate()}}},[e._v("Schedule a notification")]):e._e(),e._v(" "),n("EditScheduledNotificationModal",{ref:"editScheduledNotificationModal"})],1)}),[],!1,null,"8af146cc",null).exports;function Pt(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Ct(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Pt(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Pt(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var xt={name:"NewGroupOfferModal",components:{MzAppIcon:$e.a,AdminAddOfferForm:ft.a},props:[],computed:Ct({},Object(Ne.e)("organization",["organization","organizationTagIndex"]),{},Object(Ne.c)("organization",["listOrganizationMarketType"]),{},Object(Ne.e)("authStrategy",["authStrategies"]),{validateButtonDisabled:function(){return!0===this.loading||null===this.form.name||this.form.name.trim().length<2},scopeList:{get:function(){return this.form.scope.reduce((function(e,t){return e.push(t.value),e}),[]).join(";")},set:function(e){var t=e.split(";");0===t.length?this.form.scope.push({value:""}):this.form.scope=t.reduce((function(e,t){return e.push({value:t.trim()}),e}),[])}}}),data:function(){return{loading:!1,displayModal:!1,displayTextareaList:!1,form:{name:null,lang:"fr",marketType:"EDU",collaborationType:"nickname",tags:[],contactEmail:"",adminComment:"",authentificationStrategy:"login_password",ssoConfiguration:null,alternativeSsoConfiguration:null,scope:[{value:""}]}}},mounted:function(){this.loadAuthStrategies()},methods:Ct({},Object(Ne.b)({saveGroupOffer:"organization/SAVE_GROUPOFFER",loadAuthStrategies:"authStrategy/LOAD_AUTHSTRATEGIES"}),{},Object(Ne.d)({}),{hide:function(){this.displayTextareaList=!1,this.form.name=null,this.form.lang="fr",this.form.marketType="EDU",this.form.collaborationType="nickname",this.form.tags=[],this.form.contactEmail="",this.form.adminComment="",this.form.authentificationStrategy="login_password",this.form.ssoConfiguration=null,this.form.alternativeSsoConfiguration=null,this.form.scope=[{value:""}],this.$refs.formOffer.resetForm(),this.displayModal=!1},show:function(){this.displayModal=!0},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.$refs.formOffer.checkForm()){this.loading=!0,"sso"===!this.form.authentificationStrategy&&(this.form.ssoConfiguration=null,this.form.alternativeSsoConfiguration=null),this.form.alternativeSsoConfiguration&&0===this.form.alternativeSsoConfiguration.length&&(this.form.alternativeSsoConfiguration=null);var n=Ct({},this.form,{offer:this.$refs.formOffer.getForm()});this.saveGroupOffer(n).then((function(n){n?(e.loading=!1,e.hide(),t?e.$nextTick((function(){e.show()})):e.$go2Route({name:"admin-organization-edit-organizationId",params:{organizationId:e.organization._id}})):e.loading=!1}))}},addScope:function(){this.form.scope.push({value:""})},removeScope:function(e){this.form.scope.length>1?this.form.scope.splice(e,1):this.form.scope[0].value=""}})};n(608);function Dt(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var It={name:"GroupOffersHeader",components:{NewGroupOfferModal:Object(je.a)(xt,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-dialog",{attrs:{title:"Create new Group Offer",visible:e.displayModal,"close-on-click-modal":!1,width:"50%","append-to-body":""},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Name")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"
1name",t)},expression:"form.name"}})],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Lang")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{model:{value:e.form.lang,callback:function(t){e.$set(e.form,"lang",t)},expression:"form.lang"}},[n("el-option",{attrs:{value:"fr",label:"FR"}}),e._v(" "),n("el-option",{attrs:{value:"en",label:"EN"}})],1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Market type")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{model:{value:e.form.marketType,callback:function(t){e.$set(e.form,"marketType",t)},expression:"form.marketType"}},e._l(e.listOrganizationMarketType,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Collaboration type")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{model:{value:e.form.collaborationType,callback:function(t){e.$set(e.form,"collaborationType",t)},expression:"form.collaborationType"}},[n("el-option",{attrs:{value:"email",label:"By email"}}),e._v(" "),n("el-option",{attrs:{value:"nickname",label:"By nickname"}})],1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Tags")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{staticClass:"el-col-24",attrs:{multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:e.$t("public.edit_magazine.add_tags")},model:{value:e.form.tags,callback:function(t){e.$set(e.form,"tags",t)},expression:"form.tags"}},e._l(e.organizationTagIndex,(function(e,t){return n("el-option",{key:t+e,attrs:{value:e}})})),1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Contact email")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-input",{model:{value:e.form.contactEmail,callback:function(t){e.$set(e.form,"contactEmail",t)},expression:"form.contactEmail"}})],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Comment")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-input",{attrs:{type:"textarea"},model:{value:e.form.adminComment,callback:function(t){e.$set(e.form,"adminComment",t)},expression:"form.adminComment"}})],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Auth Strategy")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:6}},[n("el-select",{model:{value:e.form.authentificationStrategy,callback:function(t){e.$set(e.form,"authentificationStrategy",t)},expression:"form.authentificationStrategy"}},[n("el-option",{attrs:{label:"Login / Password",value:"login_password"}}),e._v(" "),n("el-option",{attrs:{label:"Login / Code",value:"login_code"}}),e._v(" "),n("el-option",{attrs:{label:"SSO",value:"sso"}})],1)],1),e._v(" "),"sso"===e.form.authentificationStrategy?n("el-col",{attrs:{span:8}},[n("el-select",{staticClass:"el-col el-col-24",attrs:{placeholder:"Select default configuration"},model:{value:e.form.ssoConfiguration,callback:function(t){e.$set(e.form,"ssoConfiguration",t)},expression:"form.ssoConfiguration"}},e._l(e.authStrategies,(function(e){return n("el-option",{key:e._id,attrs:{label:e.key,value:e._id}})})),1),e._v(" "),n("el-select",{staticClass:"mt-1 el-col el-col-24",attrs:{placeholder:"Select alternative configuration",disabled:!e.form.ssoConfiguration,clearable:!0},model:{value:e.form.alternativeSsoConfiguration,callback:function(t){e.$set(e.form,"alternativeSsoConfiguration",t)},expression:"form.alternativeSsoConfiguration"}},e._l(e.authStrategies,(function(e){return n("el-option",{key:e._id,attrs:{label:e.key,value:e._id}})})),1)],1):e._e()],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Scope")])]),e._v(" "),n("el-col",{attrs:{span:14}},[n("el-radio-group",{staticStyle:{float:"right"},attrs:{size:"mini"},model:{value:e.displayTextareaList,callback:function(t){e.displayTextareaList=t},expression:"displayTextareaList"}},[n("el-radio-button",{attrs:{label:!1}},[e._v(" Input list ")]),e._v(" "),n("el-radio-button",{attrs:{label:!0}},[e._v(" Textarea ")])],1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-1"},[n("el-col",{attrs:{span:14,offset:8}},[e.displayTextareaList?n("el-input",{staticClass:"ml-2",attrs:{type:"textarea",rows:5,placeholder:"Please insert list of Emails or RNE separate with ';'"},model:{value:e.scopeList,callback:function(t){e.scopeList=t},expression:"scopeList"}}):e._l(e.form.scope,(function(t,r){return n("el-row",{key:r,staticClass:"ml-2",attrs:{type:"flex"}},[n("el-input",{model:{value:t.value,callback:function(n){e.$set(t,"value",n)},expression:"email.value"}},[n("el-button",{attrs:{slot:"append"},on:{click:function(t){return t.preventDefault(),e.removeScope(r)}},slot:"append"},[n("MzAppIcon",{attrs:{name:"delete",inline:"",size:"16"}})],1)],1),e._v(" "),r===e.form.scope.length-1?n("el-button",{staticClass:"add-scope-button",attrs:{type:"success",circle:""},on:{click:function(t){return t.preventDefault(),e.addScope()}}},[n("MzAppIcon",{attrs:{name:"add",inline:"",size:"16"}}
1)],1):e._e()],1)}))],2)],1),e._v(" "),n("AdminAddOfferForm",{ref:"formOffer",attrs:{showAvailableTemplate:!0}})],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],on:{click:e.onClickCancel}}),e._v(" "),n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.confirm",expression:"'public.alert.confirm'"}],attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:function(t){return e.onClickValidate()}}}),e._v(" "),n("el-button",{attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:function(t){return e.onClickValidate(!0)}}},[e._v("Valider et Continuer")])],1)])],1)}),[],!1,null,"423302bb",null).exports},props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Dt(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Dt(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{showNewGroupOfferModal:function(){this.$refs.newGroupOfferModal.show()}}},wt=Object(je.a)(It,(function(){var e=this.$createElement,t=this._self._c||e;return t("el-row",{attrs:{type:"flex",align:"left"}},[this.checkPerm("organization:create")?t("el-button",{attrs:{type:"primary"},on:{click:this.showNewGroupOfferModal}},[this._v("Create new group offer")]):this._e(),this._v(" "),t("NewGroupOfferModal",{ref:"newGroupOfferModal"})],1)}),[],!1,null,"bfa44720",null).exports,Rt=n(493),zt=n(494);function Lt(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function jt(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Lt(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Lt(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Mt={name:"CreateOrderModal",components:{FormPrintQuote:Rt.a,StripeAddressForm:zt.a},props:[],computed:jt({},Object(Ne.e)("offer",["offers"]),{},Object(Ne.e)("magazine",["magazine"]),{},Object(Ne.e)("order",["printQuote"]),{formIsValid:function(){return!!(this.form.magazine&&this.form.orderType&&this.form.user)&&(!("offer"===this.form.orderType&&!this.form.offer)&&(!!("print"!==this.form.orderType||this.printQuote&&this.printQuote.product&&this.printQuote.shipment&&this.printQuote.product.productPrice)&&!!this.addressFormValid))},canGoPreviousStep:function(){return this.currentOrderStep>0},canGoNextStep:function(){if(0===this.currentOrderStep)return this.form.orderType&&this.form.user;if(1===this.currentOrderStep){if("offer"===this.form.orderType)return this.form.offer;if("print"===this.form.orderType)return this.printQuote&&this.printQuote.product&&this.printQuote.shipment&&this.printQuote.product.productPrice}return 2===this.currentOrderStep?this.addressFormValid:this.currentOrderStep<4},validateButtonDisabled:function(){return!0===this.loading||!this.formIsValid},filteredOffers:function(){var e=this;if(!this.offers)return[];var t=!0;return Object(tt.a)(this.offers).sort((function(e,t){return e.upgradeIndex-t.upgradeIndex})).map((function(n){return n.isCurrent=e.magazine.recursiveActiveOffer&&e.magazine.recursiveActiveOffer._id===n._id,n.isDisabled=t,n.isCurrent&&(t=!1),n}))},defaultStripeEmail:function(){var e=this,t=this.form.user?this.usersList.find((function(u){return u._id===e.form.user})):null;return t&&t.email?t.email:""},selectedUser:function(){var e=this;return this.form.user?this.usersList.find((function(u){return u._id===e.form.user})):null},selectedOffer:function(){var e=this;return this.form.offer?this.filteredOffers.find((function(t){return t._id===e.form.offer})):null}}),data:function(){return{loading:!1,displayModal:!1,hasLoadedData:!1,currentOrderStep:0,form:{magazine:null,orderType:null,offer:null,user:null,sendMailAndNotif:!1,vatIntracom:"",marketType:"Education",priceList:"normal",additionalNotes:""},orderTypes:[],usersList:[],addressFormValid:!1}},mounted:function(){},methods:jt({},Object(Ne.b)({loadMagazine:"magazine/LOAD_MAGAZINE",loadDataForAdminOrder:"order/LOAD_DATA_FOR_ADMIN_ORDER",createAdminOrder:"order/CREATE_ADMIN_ORDER",loadOffers:"offer/LOAD_OFFERS"}),{},Object(Ne.d)({resetPrintQuote:"order/RESET_PRINT_QUOTE"}),{hide:function(){this.displayModal=!1},show:function(){var e=this;this.resetForm(),this.loading=!0,this.displayModal=!0,this.loadOffers({filter:{isPublic:!0}}).then((function(){e.loading=!1}))},resetForm:function(){this.hasLoadedData=!1,this.form.magazine=null,this.form.orderType=null,this.form.offer=null,this.form.user=null,this.form.sendMailAndNotif=!1,this.form.vatIntracom="",this.form.marketType="Education",this.form.additionalNotes="",this.form.priceList="normal",this.usersList=[],this.orderTypes=[],this.resetPrintQuote(),this.addressFormValid=!1,this.currentOrderStep=0,this.loading=!1},loadDataForMagazine:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.form.magazine){t.next=6;break}return e.loading=!0,t.next=4,e.loadMagazine({magazineId:e.form.magazine,loadType:"client"});case 4:return t.next=6,e.loadDataForAdminOrder({magazineId:e.form.magazine}).then((function(t){e.usersList=t.users,e.orderTypes=t.orderTypes,e.loading=!1,e.hasLoadedData=!0}));case 6:case"end":return t.stop()}}),t)})))()},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this;if(!this.validateButtonDisabled){if("print"===this.form.orderType){if(!this.$refs.stripeAddressForm.isComplete)return void this.$messageError("Please complete the address form.");if(this.$refs.stripeAddressForm.shippingAddress.address.country!==this.printQuote.country)return void this.$messageError("The selected delivery country does not match the shipment country.")}this.loading=!0;var t=jt({},this.form);"print"===this.form.orderType?(t.shippingAddress=this.$refs.stripeAddressForm.shippingAddress,t.billingAddress=this.$refs.stripeAddressForm.billingAddress,t.printQuote=this.printQuote):"offer"===this.form.orderType&&(t.billingAddress=this.$refs.stripeAddressForm.billingAddress),this.createAdminOrder({magazineId:this.form.magazine,orderData:t}).then((function(t){e.loading=!1,t&&e.hide()}))}},changeAddressFormComplete:function(e){this.addressFormValid=e}})};n(611);function Ut(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Ft={name:"OrdersHeader",components:{CreateOrderModal:Object(je.a)(Mt,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:"Create new order",visible:e.displayModal,"close-on-click-modal":!1,width:"75%","append-to-body":"","custom-class":"el-fullheigth-dialog"},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:20}},[n("el-form",{attrs:{"label-width":"150px"}},[n("el-row",{staticClass:"mt-1",attrs:{type:"flex",justify:"start",align:"top"}},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Magazine ID"}},[n("el-input",{attrs:{placeholder:"Please insert a magazine ID",disabled:e.hasLoadedData},model:{value:e.form.magazine,callback:function(t){e.$set(e.form,"magazine",t)},expression:"form.magazine"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:6}},[e.hasLoadedData?n("el-button",{staticClass:"ml-2",attrs:{type:"default"},on:{click:e.resetForm}},[e._v("reset")]):n("el-button",{staticClass:"ml-2",attrs:{type:"primary"},on:{click:e.loadDataForMagazine}},[e._v("continue")])],1)],1),e._v(" "),e.hasLoadedData?n("div",[n("el-divider",[n("h3",[e._v("\n Create order for magazine\n "),n("b",[e._v("'"+e._s(this.magazine.name)+" - "+e._s(this.magazine.issue)+"'")])])]),e._v(" "),n("el-row",[n("el-steps",{staticClass:"mt-1",attrs:{active:e.currentOrderStep,"align-center":""}},[n("el-step",{attrs:{title:"Type & User"}}),e._v(" "),n("el-step",{attrs:{title:"Item"}}),e._v(" "),n("el-step",{attrs:{title:"Address"}}),e._v(" "),n("el-step",{attrs:{title:"Other info"}}),e._v(" "),n("el-step",{attrs:{title:"Confirmation"}})],1)],1),e._v(" "),n("div",{staticClass:"mt-2"},[n("div",{directives:[{name:"show",rawName:"v-show",value:0===e.currentOrderStep,expression:"currentOrderStep
1=== 0"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Order type"}},[n("el-select",{staticClass:"el-col-24",attrs:{placeholder:"Select order type",clearable:""},model:{value:e.form.orderType,callback:function(t){e.$set(e.form,"orderType",t)},expression:"form.orderType"}},e._l(e.orderTypes,(function(e,t){return n("el-option",{key:t,attrs:{label:e,value:e}})})),1)],1)],1)],1),e._v(" "),n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"User"}},[n("el-select",{staticClass:"el-col-24",attrs:{placeholder:"Select user",clearable:"",filterable:""},model:{value:e.form.user,callback:function(t){e.$set(e.form,"user",t)},expression:"form.user"}},e._l(e.usersList,(function(e,t){return n("el-option",{key:t,attrs:{label:e.name+" ("+(e.email?e.email:e._id)+")",value:e._id}})})),1)],1)],1)],1)],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:1===e.currentOrderStep,expression:"currentOrderStep === 1"}]},["offer"===e.form.orderType?n("div",[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Offer"}},[n("el-select",{staticClass:"el-col-24",attrs:{placeholder:"Select offer",clearable:"",filterable:""},model:{value:e.form.offer,callback:function(t){e.$set(e.form,"offer",t)},expression:"form.offer"}},e._l(e.filteredOffers,(function(e,t){return n("el-option",{key:t,attrs:{label:e.name+(e.isCurrent?" (current)":""),value:e._id,disabled:e.isDisabled}})})),1)],1)],1)],1)],1):e._e(),e._v(" "),"print"===e.form.orderType?n("div",[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:12}},[e.magazine&&e.magazine._id?n("FormPrintQuote",{ref:"formPrintQuote",staticClass:"ml-2",attrs:{isAdminQuote:!0}}):e._e()],1)],1)],1):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:2===e.currentOrderStep,expression:"currentOrderStep === 2"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:18}},[n("StripeAddressForm",{ref:"stripeAddressForm",attrs:{defaultAddress:null,defaultCountry:e.printQuote&&e.printQuote.country?e.printQuote.country:null,defaultEmail:e.defaultStripeEmail,collectBilling:!0,collectShipping:"print"===e.form.orderType},on:{changeIsComplete:e.changeAddressFormComplete}})],1)],1)],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:3===e.currentOrderStep,expression:"currentOrderStep === 3"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Email and notifs"}},[n("el-checkbox",{model:{value:e.form.sendMailAndNotif,callback:function(t){e.$set(e.form,"sendMailAndNotif",t)},expression:"form.sendMailAndNotif"}})],1)],1)],1),e._v(" "),n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Market type"}},[n("el-select",{model:{value:e.form.marketType,callback:function(t){e.$set(e.form,"marketType",t)},expression:"form.marketType"}},e._l(["Education","Business","Publisher"],(function(e,t){return n("el-option",{key:t,attrs:{label:e,value:e}})})),1)],1)],1)],1),e._v(" "),"print"===e.form.orderType?n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Price list"}},[n("el-select",{model:{value:e.form.priceList,callback:function(t){e.$set(e.form,"priceList",t)},expression:"form.priceList"}},e._l(["normal","printer_error","madmagz_error"],(function(e,t){return n("el-option",{key:t,attrs:{label:e,value:e}})})),1)],1)],1)],1):e._e(),e._v(" "),n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"VAT intra"}},[n("el-input",{attrs:{placeholder:"Enter VAT intracommunity number (optionnal)"},model:{value:e.form.vatIntracom,callback:function(t){e.$set(e.form,"vatIntracom",t)},expression:"form.vatIntracom"}})],1)],1)],1),e._v(" "),n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Additional notes"}},[n("el-input",{attrs:{type:"textarea",placeholder:"Enter any additional notes or instructions (optionnal)",rows:"4"},model:{value:e.form.additionalNotes,callback:function(t){e.$set(e.form,"additionalNotes",t)},expression:"form.additionalNotes"}})],1)],1)],1)],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:4===e.currentOrderStep,expression:"currentOrderStep
1=== 4"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:18}},[n("p",{staticClass:"text-grey"},[e._v("\n Please review the order details before confirming the\n order.\n ")]),e._v(" "),n("p",[e._v("\n Order Type: "+e._s(e.form.orderType)),n("br"),e._v("\n User:\n "+e._s(e.selectedUser?e.selectedUser.name+" ("+e.selectedUser._id+")":"N/A")),n("br"),e._v("\n Magazine: "+e._s(e.magazine.name)+" - "+e._s(e.magazine.issue)+" ("+e._s(e.magazine._id)+")\n ")]),e._v(" "),"offer"===e.form.orderType?n("p",[e._v("\n Offer: "+e._s(e.selectedOffer?e.selectedOffer.name:"N/A")+"\n ")]):e._e(),e._v(" "),"print"===e.form.orderType?n("p",[e._v("\n Print quantity:\n "+e._s(e.printQuote?e.printQuote.product.quantity:"N/A")),n("br"),e._v("\n Delivery type :\n "+e._s(e.printQuote?e.printQuote.shipment.type:"N/A")),n("br"),e._v("\n Delivery country :\n "+e._s(e.printQuote?e.printQuote.country:"N/A")+"\n ")]):e._e(),e._v(" "),e.$refs.stripeAddressForm&&e.$refs.stripeAddressForm.shippingAddress?n("p",[e._v("\n Shipping Address:"),n("br"),e._v(" "),n("pre",[e._v(e._s(JSON.stringify(e.$refs.stripeAddressForm.shippingAddress,null,2)))])]):e._e(),e._v(" "),e.$refs.stripeAddressForm&&e.$refs.stripeAddressForm.billingAddress?n("p",[e._v("\n Billing Address:"),n("br"),e._v(" "),n("pre",[e._v(e._s(JSON.stringify(e.$refs.stripeAddressForm.billingAddress,null,2)))])]):e._e(),e._v(" "),n("p",[e._v("\n Send Email and Notifications:\n "+e._s(e.form.sendMailAndNotif?"Yes":"No")),n("br"),e._v("\n Market Type: "+e._s(e.form.marketType)),n("br"),e._v("\n Price List: "+e._s(e.form.priceList)),n("br"),e._v("\n VAT Intracom: "+e._s(e.form.vatIntracom||"N/A")),n("br"),e._v("\n Additional Notes: "+e._s(e.form.additionalNotes||"N/A")+"\n ")])])],1)],1)]),e._v(" "),n("el-row",{staticClass:"mt-2",attrs:{type:"flex",justify:"space-between"}},[n("el-button",{attrs:{type:"default",disabled:!e.canGoPreviousStep},on:{click:function(t){e.currentOrderStep--}}},[e._v("\n Previous step\n ")]),e._v(" "),e.currentOrderStep<4?n("el-button",{attrs:{type:"primary",disabled:!e.canGoNextStep},on:{click:function(t){e.currentOrderStep++}}},[e._v("\n Next step\n ")]):n("el-button",{attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:e.onClickValidate}},[e._v("\n Validate order\n ")])],1)],1):e._e()],1)],1)],1)],1)])}),[],!1,null,"240b44ea",null).exports},props:[],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Ut(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Ut(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["checkPerm"])),methods:{}},Nt=Object(je.a)(Ft,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{attrs:{type:"flex",align:"left"}},[e.checkPerm("order:createFromAdmin")?n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.$refs.createOrderModal.show()}}}
1,[e._v("Create an order")]):e._e(),e._v(" "),n("CreateOrderModal",{ref:"createOrderModal"})],1)}),[],!1,null,"20adcdd7",null).exports;function $t(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Bt={name:"MaintenanceAlert",data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?$t(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):$t(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("app",["maintenanceMode","publicMessage","publicMessageClosable","forceMaintenanceAccess"]),{displayAlert:function(){return this.maintenanceMode||this.publicMessage},titleAlert:function(){return this.maintenanceMode?"Application is currently in maintenance":decodeURIComponent(this.publicMessage)},typeAlert:function(){return this.maintenanceMode?"error":"warning"},alertIsClosable:function(){return!this.maintenanceMode&&this.publicMessageClosable}}),watch:{maintenanceMode:function(e){e&&!this.forceMaintenanceAccess&&this.$go2Route({name:"maintenance"})}}},Gt=(n(612),Object(je.a)(Bt,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("el-alert",{directives:[{name:"show",rawName:"v-show",value:this.displayAlert,expression:"displayAlert"}],staticClass:"maintenance-alert",attrs:{type:this.typeAlert,closable:this.alertIsClosable,center:"",effect:"dark"}},[t("span",{attrs:{slot:"title"},domProps:{innerHTML:this._s(this.titleAlert)},slot:"title"})])],1)}),[],!1,null,"a6fa0dc4",null).exports);function Ht(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Vt(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Ht(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Ht(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Wt={name:"InactiveUserAlert",data:function(){return{alertTimeoutId:null,logoutTimeoutId:null,displayAlert:!1}},computed:Vt({},Object(Ne.c)("api",["getTokenIdleTimeout"])),mounted:function(){this.startInactiveTimer(),this.$bus.$on("user_is_active",this.startInactiveTimer)},beforeDestroy:function(){this.$bus.$off("user_is_active",this.startInactiveTimer),this.stopInactiveTimer()},methods:Vt({},Object(Ne.b)({doLogout:"api/API_LOGOUT",checkToken:"api/API_CHECK"}),{startInactiveTimer:function(){if(this.displayAlert=!1,this.stopInactiveTimer(),this.getTokenIdleTimeout&&this.getTokenIdleTimeout>0){var e=.8*this.getTokenIdleTimeout*1e3,t=1e3*this.getTokenIdleTimeout;this.alertTimeoutId=setTimeout(this.displayInactiveAlert,e),this.logoutTimeoutId=setTimeout(this.autoLogoutUser,t)}},stopInactiveTimer:function(){null!==this.alertTimeoutId&&(clearTimeout(this.alertTimeoutId),this.alertTimeoutId=null),null!==this.logoutTimeoutId&&(clearTimeout(this.logoutTimeoutId),this.logoutTimeoutId=null)},displayInactiveAlert:function(){this.displayAlert=!0},autoLogoutUser:function(){var e=this;this.displayAlert=!1,this.doLogout({saveConnectedEmail:!0,debugSaveFrom:"InactiveUserAlert - autoLogoutUser"}).then((function(){e.$go2Route({name:"login"})}))},onClickTerminate:function(){var e=this;this.doLogout({debugSaveFrom:"InactiveUserAlert - onClickTerminate"}).then((function(){e.$go2Route({name:"login"})}))},onClickContinue:function(){this.startInactiveTimer(),this.checkToken()}})},Kt=(n(613),Object(je.a)(Wt,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"inactive-alert"},[n("el-alert",{directives:[{name:"show",rawName:"v-show",value:e.displayAlert,expression:"displayAlert"}],attrs:{type:"warning",closable:!1,center:""}},[n("span",{attrs:{slot:"title"},slot:"title"},[e._v("\n "+e._s(e.$t("public.inactiveAlert.message"))+"\n ")]),e._v(" "),n("div",[n("el-row",{staticClass:"mt-2 mb-0",attrs:{type:"flex",justify:"space-around"}},[n("el-button",{attrs:{type:"danger",size:"small"},on:{click:e.onClickTerminate}},[e._v("\n "+e._s(e.$t("public.inactiveAlert.terminateSession"))+"\n ")]),e._v(" "),n("el-button",{attrs:{type:"success",size:"small"},on:{click:e.onClickContinue}},[e._v("\n "+e._s(e.$t("public.inactiveAlert.continueSession"))+"\n ")])],1)],1)])],1)}
1),[],!1,null,"719e7202",null).exports),Yt={name:"KeyboardShortcutHelper",components:{MzAppIcon:$e.a},data:function(){return{popoverDisplay:!1}},computed:{shortcutList:function(){return this.$keyboardShortcut.list}},created:function(){},beforeDestroy:function(){},methods:{}};n(614);function Zt(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Xt(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Zt(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Zt(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var qt={components:{OfflineModal:Ge,TemplatesHeader:We,FormatsHeader:Ze,EditTemplateHeader:et,AdminUsersHeader:lt,OffersHeader:pt,OrganizationsHeader:_t,AuthStrategiesHeader:kt,GroupOffersHeader:wt,OrdersHeader:Nt,ScheduledNotificationsHeader:Tt,MaintenanceAlert:Gt,InactiveUserAlert:Kt,KeyboardShortcutHelper:Object(je.a)(Yt,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.shortcutList.length>0?n("div",{staticClass:"keyboard-shortcut-helper"},[n("el-popover",{attrs:{placement:"top",trigger:"click","popper-class":"is-dark el-functional-popover"},model:{value:e.popoverDisplay,callback:function(t){e.popoverDisplay=t},expression:"popoverDisplay"}},[n("el-tooltip",{attrs:{slot:"reference",effect:"dark",placement:"top",content:e.$t("public.keyboard_shortcut.tootlip"),disabled:e.popoverDisplay},slot:"reference"},[n("MzAppIcon",{staticClass:"keyboard-icon",attrs:{name:"keyboard_alt"}})],1),e._v(" "),n("div",[n("el-row",[n("b",[e._v(e._s(e.$t("public.keyboard_shortcut.title")))])]),e._v(" "),e._l(e.shortcutList,(function(t,r){return n("el-row",{key:r,staticClass:"mt-1"},[n("span",{staticClass:"mr-1",domProps:{innerHTML:e._s(t.displayKeys)}}),e._v(" "),n("span",[e._v(e._s(t.label))])])}))],2)],1)],1):e._e()}),[],!1,null,"17ef4b94",null).exports,MzAppIcon:$e.a},data:function(){return{isAutorizedUser:!0,menuIsVisible:!1,currentCollapseOpened:"",activeRouteName:""}},computed:Xt({},Object(Ne.c)("api",["checkPerm","nameFromEmail"]),{},Object(Ne.e)("api",["user"]),{},Object(Ne.e)("app",["apiBuild"]),{},Object(Ne.c)("app",["appBuild"]),{headerType:function(){return this.$route.matched.map((function(e){return e.components.default.options?e.components.default.options.layoutHeaderType:e.components.default.layoutHeaderType}))[0]},isOffline:function(){return!this.$online.online}}),created:function(){this.getBuildVersion()},mounted:function(){this.checkPerm("admin:all")||(this.isAutorizedUser=!1,this.$alert(this.$t("layout.unauthorized_user.message"),this.$t("layout.unauthorized_user.title"),{confirmButtonText:this.$t("layout.unauthorized_user.button"),callback:this.logout})),this.updateCurrentCollapseOpened()},methods:Xt({},Object(Ne.b)({doLogout:"api/API_LOGOUT",getBuildVersion:"app/GET_API_BUILD"}),{logout:function(){var e=this;this.doLogout({debugSaveFrom:"Admin logout"}).then((function(){return e.$go2Route({name:"login"})}))},toogleLeftMenu:function(){this.menuIsVisible=!this.menuIsVisible},closeLeftMenu:function(e){this.menuIsVisible=!1},onClickMenuLink:function(e){this.$go2Route(e),this.closeLeftMenu()},updateCurrentCollapseOpened:function(){switch(this.activeRouteName=this.$nuxt.$route.name.split("___")[0],this.activeRouteName){case"admin-template":case"admin-template-list":case"admin-template-edit-templateId":case"admin-format-list":this.currentCollapseOpened="editor";break;case"admin-users-clientList":this.currentCollapseOpened="clients";break;case"admin-magazine-list":this.currentCollapseOpened="magazines";break;case"admin-order-list":this.currentCollapseOpened="orders";break;case"admin-communication":case"admin-communication-message":case"admin-communication-notification":this.currentCollapseOpened="communication";break;case"admin-settings":case"admin-users-adminList":case"admin-sso-list":case"admin-offer-list":case"admin-authStrategy-list":case"admin-settings-maintenance":this.currentCollapseOpened="settings";break;case"admin-tools":case"admin-tools-exportMagazineThumb":this.currentCollapseOpened="tools";break;default:this.currentCollapseOpened=""}}}),watch:{$route:function(){this.updateCurrentCollapseOpened()}}},Jt=(n(615),Object(je.a)(qt,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-container",{attrs:{id:"app"}},[n("el-header",{staticClass:"app-header"},[n("span",{staticClass:"nav-button",on:{click:e.toogleLeftMenu}},[n("img",{attrs:{src:"/icons/nav.svg"}})]),e._v(" "),n("span",{staticClass:"header-content ml-2"},["templates"===e.headerType?n("TemplatesHeader"):"editTemplate"===e.headerType?n("EditTemplateHeader"):"formats"===e.headerType?n("FormatsHeader"):"adminUsers"===e.headerType?n("AdminUsersHeader"):"offers"===e.headerType?n("OffersHeader"):"organizations"===e.headerType?n("OrganizationsHeader"):"authStrategies"===e.headerType?n("AuthStrategiesHeader"):"groupOffers"===e.headerType?n("GroupOffersHeader"):"orders"===e.headerType?n("OrdersHeader"):"scheduledNotifications"===e.headerType?n("ScheduledNotifications
1Header"):n("img",{staticClass:"logo-admin",attrs:{src:"/logo-admin.svg"}})],1),e._v(" "),n("span",{staticClass:"mr-2 text-right"},[e._v("\n "+e._s(e.nameFromEmail)+"\n "),n("br"),e._v(" "),e._l(e.user.roles,(function(e){return n("el-tooltip",{key:e,attrs:{content:e}},[n("img",{staticClass:"mr-0 ml-0",attrs:{src:"/icons/admin-role-"+e+".svg"}})])}))],2)]),e._v(" "),e.menuIsVisible?n("div",{staticClass:"app-menu-clickout",on:{click:e.closeLeftMenu}}):e._e(),e._v(" "),n("transition",{attrs:{name:"openMenu"}},[e.menuIsVisible?n("el-aside",{staticClass:"app-menu"},[n("el-container",{staticClass:"app-menu-content"},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("img",{staticClass:"logo-admin",attrs:{src:"/logo-admin.svg"}})]),e._v(" "),n("el-collapse",{staticClass:"mt-2",attrs:{accordion:""},model:{value:e.currentCollapseOpened,callback:function(t){e.currentCollapseOpened=t},expression:"currentCollapseOpened"}},[n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"bar_chart_4_bars"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin"===e.activeRouteName},on:{click:function(t){return e.onClickMenuLink({name:"admin"})}}},[e._v(e._s(e.$t("admin.layout.stats")))])],1),e._v(" "),n("el-collapse-item",{staticClass:"mt-1",attrs:{name:"editor",disabled:!e.checkPerm("template:list")}},[n("template",{slot:"title"},[n("MzAppIcon",{attrs:{name:"brush"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-template"===e.activeRouteName},on:{click:function(t){return e.onClickMenuLink({name:"admin-template"})}}}
1,[e._v(e._s(e.$t("admin.layout.editor")))])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-template-list"===e.activeRouteName},on:{click:function(t){return e.onClickMenuLink({name:"admin-template-list"})}}},[e._v(e._s(e.$t("admin.layout.templates")))])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-format-list"===e.activeRouteName},on:{click:function(t){return e.onClickMenuLink({name:"admin-format-list"})}}},[e._v(e._s(e.$t("admin.layout.formats")))])],1)],2),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"person_edit"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-users-clientList"===e.activeRouteName},attrs:{disabled:!e.checkPerm("users:clientList")},on:{click:function(t){return e.onClickMenuLink({name:"admin-users-clientList"})}}},[e._v(e._s(e.$t("admin.layout.users")))])],1),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"graph_2"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-organization-list-byGroupOffer"===e.activeRouteName},attrs:{disabled:!e.checkPerm("organization:list")},on:{click:function(t){return e.onClickMenuLink({name:"admin-organization-list-byGroupOffer"})}}},[e._v(e._s(e.$t("admin.layout.groupOffers")))])],1),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"graph_2"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-organization-list"===e.activeRouteName},attrs:{disabled:!e.checkPerm("organization:list")},on:{click:function(t){return e.onClickMenuLink({name:"admin-organization-list"})}}},[e._v(e._s(e.$t("admin.layout.organizations")))])],1),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"graph_2"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-workspace-list"===e.activeRouteName},attrs:{disabled:!e.checkPerm("workspace:list")},on:{click:function(t){return e.onClickMenuLink({name:"admin-workspace-list"})}}},[e._v(e._s(e.$t("admin.layout.workspaces")))])],1),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"menu_book"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-magazine-list"===e.activeRouteName},attrs:{disabled:!e.checkPerm("magazine:clientList")},on:{click:function(t){return e.onClickMenuLink({name:"admin-magazine-list"})}}},[e._v(e._s(e.$t("admin.layout.magazines")))])],1),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"shopping_cart"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-order-list"===e.activeRouteName},attrs:{disabled:!e.checkPerm("order:adminList")},on:{click:function(t){return e.onClickMenuLink({name:"admin-order-list"})}}},[e._v(e._s(e.$t("admin.layout.orders")))])],1),e._v(" "),n("el-collapse-item",{staticClass:"mt-1",attrs:{name:"communication"}},[n("template",{slot:"title"},[n("MzAppIcon",{attrs:{name:"satellite_alt"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-communication"===e.activeRouteName},on:{click:function(t){return e.onClickMenuLink({name:"admin-communication"})}}},[e._v(e._s(e.$t("admin.layout.communication")))])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-communication-message"===e.activeRouteName},attrs:{disabled:!e.checkPerm("maintenance:update")},on:{click:function(t){return e.onClickMenuLink({name:"admin-communication-message"})}}},[e._v(e._s(e.$t("admin.layout.message")))])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-communication-notification"===e.activeRouteName},attrs:{disabled:!e.checkPerm("notification:scheduledList")},on:{click:function(t){return e.onClickMenuLink({name:"admin-communication-notification"})}}}
1,[e._v(e._s(e.$t("admin.layout.notification")))])],1)],2),e._v(" "),n("el-collapse-item",{staticClass:"mt-1",attrs:{name:"tools"}},[n("template",{slot:"title"},[n("MzAppIcon",{attrs:{name:"handyman"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-tools"===e.activeRouteName},on:{click:function(t){return e.onClickMenuLink({name:"admin-tools"})}}},[e._v("Tools")])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-tools-exportMagazineThumb"===e.activeRouteName},attrs:{disabled:!e.checkPerm("adminTools:exportThumb")},on:{click:function(t){return e.onClickMenuLink({name:"admin-tools-exportMagazineThumb"})}}},[e._v("Export thumbs")])],1)],2),e._v(" "),n("el-collapse-item",{staticClass:"mt-1",attrs:{name:"settings"}},[n("template",{slot:"title"},[n("MzAppIcon",{attrs:{name:"manufacturing"}}),e._v(" "),n("el-link",{staticClass:"header-link-primary",class:{"active-link":"admin-settings"===e.activeRouteName},on:{click:function(t){return e.onClickMenuLink({name:"admin-settings"})}}},[e._v(e._s(e.$t("admin.layout.settings")))])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-users-adminList"===e.activeRouteName},attrs:{disabled:!e.checkPerm("users:adminList")},on:{click:function(t){return e.onClickMenuLink({name:"admin-users-adminList"})}}},[e._v(e._s(e.$t("admin.layout.adminUsers")))])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-authStrategy-list"===e.activeRouteName},attrs:{disabled:!e.checkPerm("authStrategy:adminList")},on:{click:function(t){return e.onClickMenuLink({name:"admin-authStrategy-list"})}}},[e._v("Auth Strategies")])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-offer-list"===e.activeRouteName},attrs:{disabled:!e.checkPerm("offer:list")},on:{click:function(t){return e.onClickMenuLink({name:"admin-offer-list"})}}},[e._v(e._s(e.$t("admin.layout.offers")))])],1),e._v(" "),n("el-row",[n("el-link",{staticClass:"header-link-submenu",class:{"active-link":"admin-settings-maintenance"===e.activeRouteName},attrs:{disabled:!e.checkPerm("maintenance:update")},on:{click:function(t){return e.onClickMenuLink({name:"admin-settings-maintenance"})}}},[e._v(e._s(e.$t("admin.layout.maintenance")))])],1)],2)],1),e._v(" "),n("el-row",{staticClass:"app-menu-fit-height"}),e._v(" "),n("el-row",{staticClass:"mt-3",attrs:{type:"flex",align:"middle"}},[n("MzAppIcon",{attrs:{name:"logout"}}),e._v(" "),n("el-link",{staticClass:"header-link-secondary",on:{click:function(t){return e.logout()}}},[e._v(e._s(e.$t("public.layout.logout")))])],1),e._v(" "),e.checkPerm("editor:all")?n("el-row",{staticClass:"mt-1"},[n("el-link",{staticClass:"header-link-client-interface",attrs:{type:"primary"},on:{click:function(t){return e.onClickMenuLink({name:"client"})}}},[n("MzAppIcon",{attrs:{name:"open_in_new",size:"16"}}),e._v("\n "+e._s(e.$t("admin.layout.client_interface"))+"\n ")],1)],1):e._e(),e._v(" "),e.checkPerm("debug:all")?n("el-row",{staticClass:"mt-0 version"},[e._v("\n api: "+e._s(e.apiBuild)+" | app: "+e._s(e.appBuild)+"\n ")]):e._e()],1),e._v(" "),n("el-container",{staticClass:"app-menu-extend-button"},[n("img",{attrs:{src:"/icons/extend.svg"},on:{click:e.closeLeftMenu}})])],1):e._e()],1),e._v(" "),e.isAutorizedUser?n("el-main",{staticClass:"app-main"},[n("nuxt")],1):e._e(),e._v(" "),n("MaintenanceAlert"),e._v(" "),n("InactiveUserAlert"),e._v(" "),n("OfflineModal",{attrs:{visible:e.isOffline}}),e._v(" "),n("KeyboardShortcutHelper")],1)}),[],!1,null,"7491da4b",null).exports),Qt=n(14),ea=n(115),ta=(n(35),n(315)),aa=n(317),na=(n(91),n(174)),ia=n(162),ra=n(490);function oa(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function sa(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?oa(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):oa(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var la={name:"RefreshMagazineTextModal",components:{PageEditor:ia.a,RichTextEditor:ra.a,MzAppIcon:$e.a},props:[],data:function(){return{displayWaitingDialog:!1,currentGenerateIndex:0,currentTextBlock:null,pagesToGenerate:null,textblockToGenerate:null}},computed:sa({},Object(Ne.e)("magazine",["magazine"]),{},Object(Ne.e)("theme",["theme"]),{},Object(Ne.c)("api",["checkPerm"]),{},Object(Ne.c)("theme",["getFormatedStylesForFabric"]),{},Object(Ne.e)("article",["article","textblockMap"]),{},Object(Ne.c)("article",["getArticleOfPage"]),{globalPercentage:function(){return this.pagesToGenerate?Math.round(100*this.currentGenerateIndex/this.pagesToGenerate.length):0}}),methods:sa({},Object(Ne.b)({loadMagazine:"magazine/LOAD_MAGAZINE",generatePageThumb:"page/GENERATE_PAGE_THUMB",loadArticles:"article/LOAD_ARTICLES",loadArticleTextblocks:"article/LOAD_ARTICLE_TEXBLOCKS",updatePageDataObjects:"page/UPDATE_PAGE_DATA_OBJECTS",savePage:"page/SAVE_PAGE"}),{},Object(Ne.d)({resetTextBlocks:"article/RESET_TEXBLOCKS",setArticleOfPage:"article/SET_ARTICLE_OF_PAGE",updatePageField:"page/UPDATE_FIELD"}),{reloadDataAndHideDialog:function(){var e=this;this.loadMagazine({magazineId:this.magazine._id,loadType:"current"}).then((function(){e.hideDialog()}))},hideDialog:function(){this.$refs.pageEditor&&this.$refs.pageEditor.unloadEditor(),this.displayWaitingDialog=!1},startRefresh:function(e){var t=this;this.displayWaitingDialog||(this.currentGenerateIndex=0,this.pagesToGenerate=e.map((function(e){return{page:e._id,palette:null}})),this.displayWaitingDialog=!0,this.loadArticles({magazine:this.magazine._id,page:null}).then((function(){t.startGeneratePage()})))},startGeneratePage:function(){this.currentGenerateIndex=0,this.displayWaitingDialog=!0,this.generateNextPage()},generateNextPage:function(){var e=this;if(this.currentGenerateIndex<this.pagesToGenerate.length){if(!this.$refs.pageEditor)return this.displayWaitingDialog=!0,void this.$nextTick(this.generateNextPage);var t=this.pagesToGenerate[this.currentGenerateIndex];this.$refs.pageEditor.loadEditorForPage(t.page,t.palette)}else this.$bus.$emit("forceReloadPageFlatplan"),setTimeout((function(){e.reloadDataAndHideDialog()}),250)},onEditorReady:function(){if(this.displayWaitingDialog){var e=this.pagesToGenerate[this.currentGenerateIndex];this.loadTextblockForPage(e.page)}},loadTextblockForPage:function(e){var t=this;return Object(r.a)(regeneratorRuntime.mark((function n(){var r,o,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.getArticleOfPage(e)&&t.setArticleOfPage(e),t.resetTextBlocks(),n.next=5,t.loadArticleTextblocks({articleId:t.article._id});case 5:for(t.textblockToGenerate=[],r=0,o=Object.values(t.textblockMap);r<o.length;r++)(l=o[r]).target&&l.html&&l.html.length>0&&t.textblockToGenerate.push(l);t.generateNextTextblock();case 8:case"end":return n.stop()}}),n)})))()},generateNextTextblock:function(){this.textblockToGenerate.length>0?this.currentTextBlock=this.textblockToGenerate.shift():(this.currentTextBlock=null,this.endGenerateTextblock())},onRteReady:function(){var e=this;this.$refs.richTextEditor.onTextblockChanged(),this.$nextTick((function(){e.generateNextTextblock()}))},endGenerateTextblock:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var n,r,o,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.displayWaitingDialog){t.next=2;break}return t.abrupt("return");case 2:return n=e.$fabric.page.export(),e.updatePageField({key:"pageData",value:n}),e.updatePageField({key:"needCompleteTextblockRefresh",value:!1}),t.next=7,e.savePage();case 7:return r=e.pagesToGenerate[e.currentGenerateIndex],o=e.$fabric.page.getSVG({fonts:na.a.fontListUrl([].concat(Object(tt.a)(e.$fontManager.defaultFonts),Object(tt.a)(e.theme.fonts))),styles:e.getFormatedStylesForFabric}),l=e.$fabric.page.getThumb(),t.next=12,e.generatePageThumb({pageId:r.page,paletteId:r.palette,isDefaultPalette:r.palette&&r.palette===e.theme.paletteList[0]._id,svgData:o,thumbData:l});case 12:e.endGenerateCurrentPage();case 13:case"end":return t.stop()}}),t)})))()},endGenerateCurrentPage:function(){this.currentGenerateIndex++,this.generateNextPage()},cancelProcess:function(){this.hideDialog(!1)}})},ca=(n(637),Object(je.a)(la,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-dialog",{attrs:{visible:e.displayWaitingDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,"append-to-body":""},on:{"update:visible":function(t){e.displayWaitingDialog=t}}},[n("span",{staticClass:"el-dialog__title",attrs:{slot:"title"},slot:"title"},[n("MzAppIcon",{attrs:{name:"translate"}}),e._v("\n "+e._s(e.$t("public.refreshTextBlockModal.title"))+"\n ")],1),e._v(" "),n("el-row",{staticClass:"row-editor"},[n("el-col",{staticClass:"content-text-editor",attrs:{span:12}},[e.currentTextBlock&&e.currentTextBlock._id?n("RichTextEditor",{key:e.currentTextBlock._id,ref:"richTextEditor",attrs:{textblock:e.currentTextBlock,backgroundProcess:!0},on:{ready:e.onRteReady}}
1):e._e()],1),e._v(" "),n("el-col",{staticClass:"content-page-editor",attrs:{span:12}},[n("PageEditor",{ref:"pageEditor",attrs:{editDisabled:!0,lowDefinitionImage:!0,backgroundProcess:!0},on:{ready:e.onEditorReady}})],1)],1),e._v(" "),n("el-row",{attrs:{type:"flex",align:"middle"}},[n("el-col",[n("el-progress",{attrs:{"text-inside":!0,"stroke-width":26,percentage:e.globalPercentage}})],1)],1),e._v(" "),e.checkPerm("debug:all")?n("el-row",{staticClass:"mt-1"},[n("small",[e._v("\n Pages to generate:\n "+e._s(this.pagesToGenerate?this.currentGenerateIndex+"/"+this.pagesToGenerate.length:"-")+"\n ")])]):e._e()],1)],1)}),[],!1,null,"d90ce2e6",null).exports),ua={name:"ItemOffer",components:{},props:["offer","disabled","isCurrent","alternateColor"],data:function(){return{bodyStyle:{padding:"0px 0px 100px 0px"}}},computed:{productPrice:function(){var e="0 â¬";if(this.offer.stripePriceId&&this.offer.stripePriceId.length>0&&this.offer.productPrice&&void 0!==this.offer.productPrice.amount&&void 0!==this.offer.productPrice.currency){switch(e=""+this.offer.productPrice.amount/100,"fr"===this.$i18n.locale&&(e=e.replace(".",",")),this.offer.productPrice.currency){case"eur":e+=" â¬";break;default:e+=" "+this.offer.productPrice.currency}e+=" "+this.$t("public.card_magazine_offer.priceExcludeTaxes")}return e}},methods:{}};n(638);function da(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function pa(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?da(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):da(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var ha={name:"UpgradeOfferModal",components:{ItemOffer:Object(je.a)(ua,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-col",{staticClass:"el-col-cardoffer"},[e.offer?n("el-card",{staticClass:"m-1 p-2",class:{"alternate-color":e.alternateColor},attrs:{shadow:"none","body-style":e.bodyStyle}},[n("div",{staticClass:"el-header"},[n("div",{attrs:{slot:"header"},slot:"header"},[n("h2",[e._v(e._s(e.offer.name))]),e._v(" "),n("h2",[e._v(e._s(e.productPrice))])])]),e._v(" "),n("el-row",{staticClass:"mt-2"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.forOnePublication"))+"\n ")]),e._v(" "),n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.templateChoice"))+"\n ")]),e._v(" "),n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.interactivity"))+"\n ")]),e._v(" "),n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(-1===e.offer.offerSettings.limits.numberCollaborators?e.$t("public.card_magazine_offer.illimitedCollaborator"):e.$tc("public.card_magazine_offer.numberOfCollaborator",e.offer.offerSettings.limits.numberCollaborators-1,{nb:e.offer.offerSettings.limits.numberCollaborators-1}))+"\n ")]),e._v(" "),n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.offer.offerSettings.accessList.indexOf("magazine:trackingViewer")>=0?e.$t("public.card_magazine_offer.advancedTracking"):e.$t("public.card_magazine_offer.basicTracking"))+"\n ")]),e._v(" "),e.offer.offerSettings.accessList.indexOf("magazine:pdfRequest:web")>=0?n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.pdfWeb"))+"\n ")]):e._e(),e._v(" "),e.offer.offerSettings.accessList.indexOf("magazine:pdfRequest:print")>=0?n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.pdfPrint"))+"\n ")]):e._e(),e._v(" "),e.offer.offerSettings.accessList.indexOf("magazine:privacyManagement")>=0?n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.privacyManagement"))+"\n ")]):e._e(),e._v(" "),e.offer.offerSettings.accessList.indexOf("magazine:personnalizeViewer")>
1=0?n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.personnalizeViewer"))+"\n ")]):e._e(),e._v(" "),e.offer.offerSettings.accessList.indexOf("magazine:pdfRequest:viewercode")>=0?n("el-row",{staticClass:"mt-0"},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.viewerCode"))+"\n ")]):e._e(),e._v(" "),n("div",{staticClass:"card-footer"},[n("el-row",{staticClass:"mt-2",attrs:{type:"flex",justify:"center"}},[e.isCurrent?n("el-button",{attrs:{disabled:!0,type:"info"}},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.btnIsCurrent"))+"\n ")]):n("el-button",{attrs:{disabled:e.disabled,type:"primary"},on:{click:function(t){return e.$emit("select",e.offer)}}},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.btnChoose"))+"\n ")])],1),e._v(" "),n("el-row",{staticClass:"mt-2",attrs:{type:"flex",justify:"center"}},[n("el-link",{attrs:{type:"primary",href:"https://madmagz.com/pricing",target:"_blank"}},[e._v("\n "+e._s(e.$t("public.card_magazine_offer.viewMore"))+"\n ")])],1)],1)],1):e._e()],1)}),[],!1,null,"bf11f1d6",null).exports,StripeCheckout:n(495).a,MzAppIcon:$e.a},data:function(){return{displayDialog:!1,loading:!1,displayStripeCheckout:!1,stripeCheckoutClientSecret:null}},computed:pa({},Object(Ne.e)("magazine",["magazine"]),{},Object(Ne.c)("api",["checkPerm"]),{},Object(Ne.e)("offer",["offers"]),{stripeIsLoaded:function(){return null!==this.$stripe&&void 0!==this.$stripe},filteredOffers:function(){var e=this;if(!this.offers)return[];var t=!0;return Object(tt.a)(this.offers).sort((function(e,t){return e.upgradeIndex-t.upgradeIndex})).map((function(n){return n.isCurrent=e.magazine.recursiveActiveOffer&&e.magazine.recursiveActiveOffer._id===n._id,n.isDisabled=t,n.isCurrent&&(t=!1),n}))}}),methods:pa({},Object(Ne.b)({saveMagazineOffer:"magazine/SAVE_MAGAZINE_OFFER",loadOffers:"offer/LOAD_OFFERS"}),{show:function(){var e=this;this.displayDialog=!0,this.loading=!0,this.displayStripeCheckout=!1,this.stripeCheckoutClientSecret=null,this.loadOffers({filter:{isPublic:!0}}).then((function(){e.loading=!1,console.log("mag",JSON.parse(JSON.stringify(e.magazine)))}))},hide:function(){this.displayDialog=!1},onSelectOffer:function(e){var t=this;this.saveMagazineOffer({offerId:e._id,checkoutPageFrom:this.$route.name.split("___")[0]}).then((function(e){t.saveInProgress=!1,e&&(e.checkout?(t.stripeCheckoutClientSecret=e.checkout.clientSecret,t.displayStripeCheckout=!0):t.hide())}))}})},fa=Object(je.a)(ha,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-dialog",{attrs:{visible:e.displayDialog,"custom-class":"el-maxheigth-dialog","append-to-body":"",width:"95%"},on:{"update:visible":function(t){e.displayDialog=t}}},[n("span",{staticClass:"el-dialog__title",attrs:{slot:"title"},slot:"title"},[n("MzAppIcon",{attrs:{name:"upgrade"}}),e._v("\n "+e._s(e.$t("public.upgrade_offer_modal.title"))+"\n ")],1),e._v(" "),n("el-row",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[e.stripeIsLoaded?e.displayStripeCheckout?n("div",[n("StripeCheckout",{attrs:{stripeClientSecret:e.stripeCheckoutClientSecret}})],1):n("div",[0===e.filteredOffers.length?n("el-row",{staticClass:"m-2"},[n("el-col",{staticClass:"mt-2"},[n("span",{staticClass:"text-style-2"},[e._v(e._s(e.$t("public.create_magazine.empty_offer_list")))])])],1):n("el-row",{staticClass:"mb-2",attrs:{type:"flex",justify:"center"}},e._l(e.filteredOffers,(function(t){return n("ItemOffer",{key:t._id,attrs:{offer:t,isCurrent:t.isCurrent,alternateColor:t.isCurrent,disabled:t.isDisabled},on:{select:e.onSelectOffer}})})),1)],1):n("div",[n("el-alert",{attrs:{description:e.$t("public.layout.stripe.errorCode"),type:"error",effect:"dark",closable:!1,center:""}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("span",{domProps:{innerHTML:e._s(e.$t("public.layout.stripe.errorMessage"))}})])])],1)])],1)],1)}),[],!1,null,"a0876f5a",null).exports;function ma(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function ga(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?ma(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):ma(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var ba={name:"EditMagazineHeader",components:{UserRoleTag:aa.a,RequestPdfOrPublishModal:qe.a,RefreshMagazineTextModal:ca,EditableText:ta.a,UpgradeOfferModal:fa,MzAppIcon:$e.a},props:[],computed:ga({},Object(Ne.e)("magazine",["magazine","template","magazineForEditingLoadComplete","userMagazines"]),{},Object(Ne.e)("collaboration",["userCollaboration"]),{},Object(Ne.e)("app",["appGUI"]),{},Object(Ne.c)("magazine",["checkMagazinePerm"]),{},Object(Ne.c)("api",["checkPerm","getUID"]),{},Object(Ne.c)("collaboration",["collaborationIsActive"]),{canAccessPreview:function(){return"Published"!==this.magazine.status&&this.checkMagazinePerm("magPerms:magazine:preview")},canGeneratePdfPreview:function(){return this.checkMagazinePerm("magPerms:magazine:pdfRequest:draft")},canAccessPublication:function(){return"Published"===this.magazine.status},canAccessCollaboration:function(){return!!this.canAccessEdition&&(this.collaborationIsActive?this.checkMagazinePerm("magPerms:collaboration:user:list"):this.checkMagazinePerm("magPerms:collaboration:create")||!this.checkPerm("offer:hideUpgradeAction"))},canAccessLibrary:function(){return!!this.canAccessEdition&&this.checkMagazinePerm("magPerms:library:show")},canAccessChangeName:function(){return"Published"!==this.magazine.status&&this.checkMagazinePerm("magPerms:magazine:updateMagazineField")},canAccessEdition:function(){return"Published"!==this.magazine.status},isChief:function(){return this.collaborationIsActive?this.userCollaboration&&"chief"===this.userCollaboration.role:this.magazine.owner===this.getUID},previewPdfData:function(){return this.magazine&&this.magazine.exportedPdfs?this.magazine.exportedPdfs.find((function(e){return"draft"==e.version})):void 0},pdfIsOutOfDate:function(){return!!this.previewPdfData&&(this.previewPdfData.exportedAt&&this.previewPdfData.magazineDate!==this.magazine.lastVisualChangeAt)},pdfIsGenerated:function(){return!!this.previewPdfData&&(this.previewPdfData.exportedAt&&this.previewPdfData.files&&this.previewPdfData.files.magazine)},pdfIsInProgress:function(){return!!this.previewPdfData&&(this.previewPdfData.requestedAt&&!this.previewPdfData.exportedAt)},magazineNames:function(){var e=this;return this.userMagazines.reduce((function(t,n){return n.owner===e.getUID&&-1===t.indexOf(n.name)&&t.push(n.name),t}),[]).sort((function(a,b){return a.toLowerCase()>b.toLowerCase()}))},pagesToRefreshTextblock:function(){return this.magazine&&this.magazine.pageOrder?this.magazine.pageOrder.filter((function(e){return e.needCompleteTextblockRefresh})):[]},magazineGlobalsVariables:function(){var e=this,t=[],n=[];if(this.template&&this.template.settings&&(this.template.settings.footer&&(this.template.settings.footer.left&&n.push(this.template.settings.footer.left),this.template.settings.footer.right&&n.push(this.template.settings.footer.right)),this.template.settings.globalsText)){var r=!0,o=!1,l=void 0;try{for(var c,d=this.template.settings.globalsText[Symbol.iterator]();!(r=(c=d.next()).done);r=!0){var text=c.value;text.left&&n.push(text.left),text.right&&n.push(text.right)}}catch(e){o=!0,l=e}finally{try{r||null==d.return||d.return()}finally{if(o)throw l}}}for(var h=function(){var r=m[f];if(!n.some((function(text){return text&&text.indexOf(r)>=0})))return"continue";var o=e.magazine&&e.magazine.redactorGlobalsVariables?e.magazine.redactorGlobalsVariables.find((function(e){return e.key===r})):null,l=e.template&&e.template.displayVariablesNames?e.template.displayVariablesNames.find((function(e){return e.key===r})):null;t.push({key:r,value:o?o.value:"",name:l&&l.name?l.name:e.$t("public.edit_magazine.magazineVariable."+r)})},f=0,m=["global1","global2","global3"];f<m.length;f++)h();return t}}),created:function(){this.$bus.$on("flatplanExtended",this.flatplanExtended),this.$bus.$on("showUpgradeOffer",this.onClickUpgradeOffer),this.updateActiveTabName(),this.userMagazines&&0!==this.userMagazines.length||this.loadUserMagazines()},beforeDestroy:function(){this.$bus.$off("flatplanExtended",this.flatplanExtended),this.$bus.$off("showUpgradeOffer",this.onClickUpgradeOffer),this.resetAllMagazineDepen
1dency()},data:function(){return{activeTabName:""}},methods:ga({},Object(Ne.b)({saveMagazine:"magazine/SAVE_MAGAZINE",resetAllMagazineDependency:"magazine/RESET_ALL_MAGAZINE_DEPENDENCY",loadUserMagazines:"magazine/LOAD_USER_MAGAZINES"}),{},Object(Ne.d)({updateMagazineField:"magazine/UPDATE_FIELD",updateMagazineRedactorGlobalVariable:"magazine/UPDATE_REDACTOR_GLOBAL_VARIABLE"}),{updateActiveTabName:function(){var e=null;if(0===this.$nuxt.$route.name.indexOf("client-magazine-edit-magazineId")){e="flatplan";var t=this.$nuxt.$route.path.split("/"),n=t[t.length-1];e="collaboration"===n?"collaboration":"library"===n?"library":"publication"===n||"order"===n?"publication":this.$nuxt.$route.query.flatplan?"extended"===this.$nuxt.$route.query.flatplan?"flatplan":"edition":"extended"===this.appGUI.flatplan.state?"flatplan":"edition"}e&&this.activeTabName!=e&&(this.activeTabName=e)},onLeaveTab:function(e,t){var n=this;return Object(r.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("edition"!==t||!l.default.prototype.$confirmBeforeLeave){r.next=5;break}return r.next=3,l.default.prototype.$confirmBeforeLeave();case 3:if(r.sent){r.next=5;break}return r.abrupt("return",Promise.reject(!1));case 5:return n.activeTabName=e,n.loadTab(),r.abrupt("return",Promise.resolve(!0));case 8:case"end":return r.stop()}}),r)})))()},loadTab:function(){var e=this.$nuxt.$route.name;"edition"===this.activeTabName||"flatplan"===this.activeTabName?"client-magazine-edit-magazineId"===e.split("_")[0]?this.$bus.$emit("extendFlatplan","flatplan"===this.activeTabName):this.$go2Route({name:"client-magazine-edit-magazineId",params:{magazineId:this.magazine._id},query:{flatplan:"flatplan"===this.activeTabName?"extended":"opened"}}):"collaboration"===this.activeTabName?this.$go2Route({name:"client-magazine-edit-magazineId-collaboration",params:{magazineId:this.magazine._id}}):"library"===this.activeTabName?this.$go2Route({name:"client-magazine-edit-magazineId-library",params:{magazineId:this.magazine._id}}):"publication"===this.activeTabName&&this.$go2Route({name:"client-magazine-edit-magazineId-publication",params:{magazineId:this.magazine._id}})},flatplanExtended:function(){this.activeTabName="extended"===this.appGUI.flatplan.state?"flatplan":"edition"},onClickPublishMagazine:function(){var e=this;this.$refs.requestPdfOrPublishModal.switchPublish((function(){"Published"===e.magazine.status?e.$go2Route({name:"client-magazine-edit-magazineId-publication",params:{magazineId:e.magazine._id}}):e.$go2Route({name:"client-magazine-edit-magazineId",params:{magazineId:e.magazine._id},query:{flatplan:"extended"}})}))},onClickViewPdf:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.pdfIsGenerated||this.pdfIsInProgress||t&&this.pdfIsOutOfDate)this.canGeneratePdfPreview&&this.$refs.requestPdfOrPublishModal.requestPdf("draft",(function(){e.pdfIsOutOfDate?e.$confirm(e.$t("public.preview.magazineHasChangeDuringGeneratePdf.message"),"",{confirmButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.confirm"),cancelButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.cancel")}).then((function(){e.onClickViewPdf(!0)})).catch((function(){e.onClickViewPdf(!1)})):e.onClickViewPdf(!1)}),!1,this.$t("public.preview.open_preview"));else if(this.previewPdfData&&this.previewPdfData.files&&this.previewPdfData.files.magazine){var n="https://madmagz.app"+this.localePath({name:"viewer-magazineId",params:{magazineId:this.magazine._id},query:{preview:1}});window.open(n,"_blank")}else console.log("onClickViewPdf without files",JSON.parse(JSON.stringify(this.previewPdfData)))},onClickDownloadPdf:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.pdfIsGenerated||this.pdfIsInProgress||t&&this.pdfIsOutOfDate)this.canGeneratePdfPreview&&this.$refs.requestPdfOrPublishModal.requestPdf("draft",(function(){e.pdfIsOutOfDate?e.$confirm(e.$t("public.preview.magazineHasChangeDuringGeneratePdf.message"),"",{confirmButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.confirm"),cancelButtonText:e.$t("public.preview.magazineHasChangeDuringGeneratePdf.cancel")}).then((function(){e.onClickDownloadPdf(!0)})).catch((function(){e.onClickDownloadPdf(!1)})):e.onClickDownloadPdf(!1)}),!1,this.$t("public.preview.open_preview"));else if(this.previewPdfData&&this.previewPdfData.files&&this.previewPdfData.files.magazine){var n=Xe.a.getPdfSrc(this.magazine._id,"draft",this.previewPdfData.files.magazine);window.open(n,"_blank")}else console.log("onClickDownloadPdf without files",JSON.parse(JSON.stringify(this.previewPdfData)))},debounceSaveMagazine:function(){var e=this;Qt.a.debounce((function(){e.saveMagazine().then((function(t){t&&e.$bus.$emit("forceReloadPageFlatplan")}))}),250,this,"debounceSave")()},changeGlobalVariableValue:function(e,t){this.updateMagazineRedactorGlobalVariable({key:e,value:t}),this.debounceSaveMagazine()},changeMagazineProp:function(e,t){this.updateMagazineField({key:e,value:t}),this.debounceSaveMagazine()},autoSuggestMagazineName:function(e,t){t(this.magazineNames.filter((function(t){return 0===t.toLowerCase().indexOf(e.toLowerCase())})).map((function(e){return{value:e}})))},onClickUpgradeOffer:function(){this.$refs.upgradeOfferModal.show()}}),watch:{$route:function(){this.updateActiveTabName()},pagesToRefreshTextblock:function(e){e&&e.length>0&&this.$refs.refreshMagazineTextModal.startRefresh(e)}}},ya=(n(639),Object(je.a)(ba,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{staticClass:"edit-magazine-header row-fit-parent",attrs:{type:"flex",align:"middle"}},[e.checkPerm("magazine:createWithPublicOffer")&&e.magazine.recursiveActiveOffer?n("div",{staticClass:"btn-upgrade-offer",on:{click:e.onClickUpgradeOffer}},[n("MzAppIcon",{attrs:{name:"sell",size:"24"}}),e._v(" "),n("span",{staticClass:"offer-name"}
1,[e._v(e._s(e.magazine.recursiveActiveOffer.name))])],1):e._e(),e._v(" "),n("div",{staticClass:"magazine-name-content ml-1 mr-1"},[n("el-popover",{staticClass:"magazine-name-popover",attrs:{placement:"bottom",trigger:"click",width:"300","visible-arrow":!1}},[n("el-row",{attrs:{type:"flex",align:"middle",justify:"start"}},[n("el-col",{attrs:{span:6}},[n("small",[e._v(e._s(e.$t("public.edit_magazine.magazineName")))])]),e._v(" "),n("el-col",{attrs:{span:18}},[n("EditableText",{staticClass:"text-blue",attrs:{value:e.magazine.name,disableEditing:!e.canAccessChangeName,autoSuggest:e.autoSuggestMagazineName},on:{change:function(t){return e.changeMagazineProp("name",t)}}})],1)],1),e._v(" "),n("el-row",{attrs:{type:"flex",align:"middle",justify:"start"}},[n("el-col",{attrs:{span:6}},[n("small",[e._v(e._s(e.$t("public.edit_magazine.magazineIssue")))])]),e._v(" "),n("el-col",{attrs:{span:18}},[n("EditableText",{staticClass:"text-style-small",attrs:{value:e.magazine.issue,disableEditing:!e.canAccessChangeName},on:{change:function(t){return e.changeMagazineProp("issue",t)}}})],1)],1),e._v(" "),e.userCollaboration?n("el-row",{attrs:{type:"flex",align:"middle",justify:"start"}},[n("el-col",{attrs:{span:6}},[n("small",[e._v(e._s(e.$t("public.edit_magazine.magazineUserRole")))])]),e._v(" "),n("el-col",{attrs:{span:18}},[n("UserRoleTag",{attrs:{user:e.userCollaboration,applyCurrentUserStyle:!0}})],1)],1):e._e(),e._v(" "),e.magazineGlobalsVariables&&e.magazineGlobalsVariables.length>0?n("div",[n("el-divider"),e._v(" "),e._l(e.magazineGlobalsVariables,(function(t){return n("el-row",{key:t.key,attrs:{type:"flex",align:"middle",justify:"start"}},[n("el-col",{attrs:{span:6}},[n("small",[e._v(e._s(t.name))])]),e._v(" "),n("el-col",{attrs:{span:18}},[n("EditableText",{staticClass:"text-style-small",attrs:{value:t.value,disableEditing:!e.canAccessChangeName},on:{change:function(n){return e.changeGlobalVariableValue(t.key,n)}}})],1)],1)}))],2):e._e(),e._v(" "),n("el-button",{staticClass:"magazine-name-trigger text-style-3 text-blue text-left mt-0",attrs:{slot:"reference",type:"text"},slot:"reference"},[n("span",{staticClass:"magazine-name-label single-line-text"},[e._v(e._s(e.magazine.name))]),e._v(" "),n("small",{staticClass:"magazine-issue-label single-line-text"},[e._v(e._s(e.magazine.issue))])])],1)],1),e._v(" "),n("el-row",{staticClass:"edit-magazine-header-nav",attrs:{type:"flex",align:"middle",justify:"end"}},[e.magazineForEditingLoadComplete?n("el-tabs",{staticClass:"mr-2 app-header-nav",attrs:{"before-leave":e.onLeaveTab},model:{value:e.activeTabName,callback:function(t){e.activeTabName=t},expression:"activeTabName"}},[e.canAccessEdition?n("el-tab-pane",{attrs:{label:e.$t("public.edit_magazine.edition"),name:"edition"}}):e._e(),e._v(" "),e.canAccessEdition?n("el-tab-pane",{attrs:{label:e.$t("public.edit_magazine.flatplan"),name:"flatplan"}}):e._e(),e._v(" "),e.canAccessCollaboration?n("el-tab-pane",{attrs:{label:e.$t("public.edit_magazine.collaboration"),name:"collaboration"}}):e._e(),e._v(" "),e.canAccessLibrary?n("el-tab-pane",{attrs:{label:e.$t("public.edit_magazine.library"),name:"library"}}):e._e()],1):e._e()],1),e._v(" "),e.canAccessPreview?n("el-dropdown",{staticClass:"ml-1 mr-1",attrs:{trigger:"click",placement:"bottom-start",disabled:!e.checkPerm("magazine:update")}},[n("el-button",{attrs:{type:"primary",size:"medium"}},[e._v("\n "+e._s(e.$t("public.edit_magazine.preview"))+"\n "),n("MzAppIcon",{staticClass:"ml-1",attrs:{name:"keyboard_arrow_down",inline:""}})],1),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{attrs:{disabled:!e.pdfIsGenerated&&!e.canGeneratePdfPreview},nativeOn:{click:function(t){return e.onClickViewPdf(t)}}},[e._v("\n "+e._s(e.$t("public.preview.web_version"))+"\n ")]),e._v(" "),n("el-dropdown-item",{attrs:{disabled:!e.pdfIsGenerated&&!e.canGeneratePdfPreview},nativeOn:{click:function(t){return e.onClickDownloadPdf(t)}}},[e._v("\n "+e._s(e.$t("public.preview.pdf_version"))+"\n ")])],1)],1):e._e(),e._v(" "),"Published"===e.magazine.status&&e.checkMagazinePerm("magPerms:magazine:unpublish")||"Published"!==e.magazine.status&&e.checkMagazinePerm("magPerms:magazine:publish")?n("el-button",{directives:[{name:"t",rawName:"v-t",value:"Published"===e.magazine.status?"public.edit_magazine.unpublish":"public.edit_magazine.publish",expression:"\n magazine.status === 'Published'\n ? 'public.edit_magazine.unpublish'\n : 'public.edit_magazine.publish'\n "}],staticClass:"mr-1",attrs:{type:"success",size:"medium"},on:{click:e.onClickPublishMagazine}}
1):e._e(),e._v(" "),n("RequestPdfOrPublishModal",{ref:"requestPdfOrPublishModal"}),e._v(" "),n("RefreshMagazineTextModal",{ref:"refreshMagazineTextModal"}),e._v(" "),n("UpgradeOfferModal",{ref:"upgradeOfferModal"})],1)}),[],!1,null,"49c958d8",null).exports),va="DUPLICATED_MAGAZINE",_a="WORKSPACE_EXPORT_MAGAZINES_ZIP_COMPLETE",Oa="PUBLISHED_MAGAZINE",Ea="DELETED_MAGAZINE",ka="WARNING_DELETED_MAGAZINE",Sa="FIRST_ACCESS_MAGAZINE",Aa="INVIT_COLLABORATION",Ta="REVOKE_COLLABORATION",Pa="CHANGE_COLLABORATION_ROLE",Ca="ASSIGN_PAGES",xa="TAKEBACK_PAGES",Da="UPDATE_COLLABORATION_SETTINGS",Ia="TAKE_CONTROL_PAGE",wa="END_TAKE_CONTROL_PAGE",Ra="ORDER_MAGAZINE_OFFER_CONFIRMED",za="ORDER_MAGAZINE_PRINT_CONFIRMED",La="ORDER_MAGAZINE_PRINT_SHIPPED",ja="ORDER_MAGAZINE_PRINT_DELIVERED",Ma="MZ_SCHEDULED_NOTIFICATION",Ua="NEW_PAGE_COMMENT",Fa="PAGE_COMMENT_MENTION";function Na(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function $a(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Na(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Na(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Ba={name:"Notification",components:{MzMagazineThumb:n(314).a},props:["notification"],data:function(){return{image:null,message:"",title:"",primaryAction:{label:"",go2Params:null},secondaryAction:{label:"",go2Params:null}}},computed:{magazine:function(){return this.notification&&this.notification.data&&this.notification.data.magazine?this.notification.data.magazine:null},hasImage:function(){return null!==this.magazine||this.notification.type===Ma},hasActions:function(){return null!==this.primaryAction.go2Params||null!==this.secondaryAction.go2Params},displayTime:function(){var e=new Date(this.notification.createdAt).getTime(),t=this.$now.time,n=Math.round((t-e)/1e3);return n<=120?this.$t("public.notofications.elaspedTime.now"):n<=3600?this.$t("public.notofications.elaspedTime.minutes",{elapse:Math.round(n/60)}):n<=86400?this.$t("public.notofications.elaspedTime.hours",{elapse:Math.round(n/3600)}):n<=604800?this.$t("public.notofications.elaspedTime.days",{elapse:Math.round(n/86400)}):this.$t("public.notofications.elaspedTime.weeks",{elapse:Math.round(n/604800)})}},created:function(){this.extractDataFromNotification()},methods:$a({},Object(Ne.b)({setClickNotification:"notification/SET_CLICK_NOTIFICATION"}),{goto:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.$bus.$emit("hide_client_popover"),t&&this.setClickNotification({notificationId:this.notification._id,type:t}),this.$go2Route(e)},onClickMagazine:function(){this.magazine&&!this.magazine.deleted&&("Published"===this.magazine.status?this.goto({name:"client-magazine-edit-magazineId-publication",params:{magazineId:this.notification.data.magazineId}}):this.goto({name:"client-magazine-edit-magazineId",params:{magazineId:this.notification.data.magazineId}}))},extractDataFromNotification:function(){var e=this;if(this.image=null,this.message="",this.title="",this.primaryAction.label="",this.primaryAction.go2Params=null,this.secondaryAction.label="",this.secondaryAction.go2Params=null,this.notification)switch(this.notification.type){case Ma:if(this.notification.data&&this.notification.data.scheduledNotification){var t=this.notification.data.scheduledNotification;this.message=t.description,this.title=t.title,this.image=t.visualUrl&&t.visualUrl.length>0?t.visualUrl:null,t.primaryAction&&t.primaryAction.label&&t.primaryAction.label.length>0&&t.primaryAction.url&&t.primaryAction.url.length>0&&(this.primaryAction.label=t.primaryAction.label,this.primaryAction.go2Params={target:"_blank",url:t.primaryAction.url}),t.secondaryAction&&t.secondaryAction.label&&t.secondaryAction.label.length>0&&t.secondaryAction.url&&t.secondaryAction.url.length>0&&(this.secondaryAction.label=t.secondaryAction.label,this.secondaryAction.go2Params={target:"_blank",url:t.secondaryAction.url})}break;case Oa:this.message=this.$t(this.notification.data.isOwner?"public.notifications.publishedMagazine.ownerMessage":"public.notifications.publishedMagazine.message",this.notification.data),this.title=this.$t("public.notifications.publishedMagazine.title",this.notification.data),this.primaryAction.label=this.$t("public.notifications.publishedMagazine.primaryAction"),this.primaryAction.go2Params={target:"_blank",name:"viewer-magazineId",params:{magazineId:this.notification.data.magazineId}},this.notification.data.isOwner&&(this.secondaryAction.label=this.$t("public.notifications.publishedMagazine.secondaryAction"),this.secondaryAction.go2Params={name:"client-magazine-edit-magazineId-publication",params:{magazineId:this.notification.data.magazineId}});break;case Ea:this.message=this.$t(this.notification.data.isAutoDelete?"public.notifications.deletedMagazine.autoMessage":"public.notifications.deletedMagazine.message",this.notification.data),this.title=this.$t("public.notifications.deletedMagazine.title",this.notification.data);break;case ka:this.message=this.$t("public.notifications.warningDeletedMagazine.message",this.notification.data),this.title=this.$t("public.notifications.warningDeletedMagazine.title",this.notification.data);break;case Sa:this.message=this.$t("public.notifications.firstAccessMagazine.message",this.notification.data),this.title=this.$t("public.notifications.firstAccessMagazine.title",this.notification.data);break;case Aa:this.message=this.$t("public.notifications.invitCollaboration.message",$a({},this.notification.data,{role:this.$t("public.collaboration.roles."+this.notification.data.collaboratorRole)})),this.title=this.$t("public.notifications.invitCollaboration.title",this.notification.data),this.primaryAction.label=this.$t("public.notifications.invitCollaboration.primaryAction"),this.primaryAction.go2Params={name:"client-magazine-edit-magazineId",params:{magazineId:this.notification.data.magazineId}};break;case Ta:this.message=this.$t("public.notifications.revokeCollaboration.message",this.notification.data),this.title=this.$t("public.notifications.revokeCollaboration.title",this.notification.data);break;case Pa:this.message=this.$t("public.notifications.changeCollaborationRole.message",$a({},this.notification.data,{role:this.$t("public.collaboration.roles."+this.notification.data.collaboratorRole)})),this.title=this.$t("public.notifications.changeCollaborationRole.title",this.notification.data),this.primaryAction.label=this.$t("public.notifications.learnMoreAction"),this.primaryAction.go2Params={target:"_blank",url:this.$t("public.notifications.changeCollaborationRole.linkTo")};break;case Da:var n="";this.notification.data.associateSettings.viewFlatplan?n="viewFlatplan."+this.notification.data.associateSettings.viewFlatplan:this.notification.data.associateSettings.editFlatplan?n="editFlatplan."+this.notification.data.associateSettings.editFlatplan:this.notification.data.associateSettings.assignToAnother&&(n="assignToAnother."+this.notification.data.associateSettings.assignToAnother),this.message=this.$t("public.notifications.updateCollaborationSettings.message."+n,this.notification.data),this.title=this.$t("public.notifications.updateCollaborationSettings.title."+n,this.notification.data),this.primaryAction.label=this.$t("public.notifications.learnMoreAction"),this.primaryAction.go2Params={target:"_blank",url:this.$t("public.notifications.updateCollaborationSettings.linkTo")};break;case Ca:case xa:var r=this.notification.type===Ca,o=0,l="";this.notification.data.assignedPages&&this.notification.data.assignedPages.length>0&&(o=this.notification.data.assignedPages.length,l=this.notification.data.assignedPages.map((function(t){return t.pageName?t.pageName:e.$t(t.double?"public.edit_magazine.double_page_name":"public.edit_magazine.page_name",{number:t.pageNumber})})).join(", ")),this.message=this.$tc(r?"public.notifications.assignPages.message":"public.notifications.takeBackPages.message",o,$a({},this.notification.data,{nbPages:o,pageList:l})),this.title=this.$tc(r?"public.notifications.assignPages.title":"public.notifications.takeBackPages.title",o,$a({},this.notification.data,{nbPages:o})),r&&(this.primaryAction.label=this.$t("public.notifications.assignPages.primaryAction"),this.primaryAction.go2Params={name:"client-magazine-edit-magazineId",params:{magazineId:this.notification.data.magazineId}});break;case Ia:case wa:var c=this.notification.type===wa;this.message=this.$t(c?"public.notifications.endTakeControlPages.message":"public.notifications.takeControlPages.message",this.notification.data),this.title=this.$t(c?"public.notifications.endTakeControlPages.title":"public.notifications.takeControlPages.title",this.notification.data),this.primaryAction.label=this.$t("public.notifications.takeControlPages.primaryAction"),this.primaryAction.go2Params={name:"client-magazine-edit-magazineId",params:{magazineId:this.notification.data.magazineId},query:{page:this.notification.data.pageId}};break;case Ra:this.message=this.$t("public.notifications.orderMagazineOfferConfirmed.message",this.notification.data),this.title=this.$t("public.notifications.orderMagazineOfferConfirmed.title",this.notification.data);break;case za:this.message=this.$t("public.notifications.orderMagazinePrintConfirmed.message",this.notification.data),this.title=this.$t("public.notifications.orderMagazinePrintConfirmed.title",this.notification.data);break;case La:this.message=this.$t("public.notifications.orderMagazinePrintShipped.message",this.notification.data),this.title=this.$t("public.notifications.orderMagazinePrintShipped.title",this.notification.data);break;case ja:this.message=this.$t("public.notifications.orderMagazinePrintDelivered.message",this.notification.data),this.title=this.$t("public.notifications.orderMagazinePrintDelivered.title",this.notification.data);break;case va:this.notification.data.duplicateInOtherLang?(this.message=this.$t("public.notifications.message.duplicatedMagazineInLang",{magazineName:this.notification.data.magazineNameFrom,lang:this.$t("public.lang."+this.notification.data.duplicateInOtherLang)}),this.title=this.$t("public.notifications.title.duplicatedMagazineInLang",{magazineName:this.notification.data.magazineNameFrom,lang:this.$t("public.lang."+this.notification.data.duplicateInOtherLang)}),this.primaryAction.label=this.$t("public.notifications.duplicatedMagazineInLang.primaryAction"),this.primaryAction.go2Params={name:"client-magazine-edit-magazineId",params:{magazineId:this.notification.data.magazineId}}):(this.message=this.$t("public.notifications.message.duplicatedMagazine",{magazineName:this.notification.data.magazineName}),this.title=this.$t("public.notifications.title.duplicatedMagazine",{magazineName:this.notification.data.magazineName}));break;case _a:this.message=this.$t("public.notifications.message.workspaceExportMagazinesZipComplete",{zipVersion:this.notification.data.zipVersion,workspaceName:this.notification.data.workspaceName}),this.title=this.$t("public.notifications.title.workspaceExportMagazinesZipComplete",{zipVersion:this.notification.data.zipVersion,workspaceName:this.notification.data.workspaceName});break;case Ua:this.message=this.$t("public.notifications.newPageComment.message",this.notification.data),this.title=this.$t("public.notifications.newPageComment.title",this.notification.data),this.primaryAction.label=this.$t("public.notifications.newPageComment.primaryAction"),this.primaryAction.go2Params={name:"client-magazine-edit-magazineId",params:{magazineId:this.notification.data.magazineId},query:{page:this.notification.data.pageId}};break;case Fa:this.message=this.$t("public.notifications.pageCommentMention.message",this.notification.data),this.title=this.$t("public.notifications.pageCommentMention.title",this.notification.data),this.primaryAction.label=this.$t("public.notifications.pageCommentMention.primaryAction"),this.primaryAction.go2Params={name:"client-magazine-edit-magazineId",params:{magazineId:this.notification.data.magazineId},query:{page:this.notification.data.pageId}};break;default:this.message="---",this.title="Unknow notification type"}}}),watch:{notification:function(e){this.extractDataFromNotification()}}};n(640);function Ga(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Ha(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?Ga(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Ga(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Va={name:"NotificationMenu",components:{Notification:Object(je.a)(Ba,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{notification:!0,"is-unread":!1===e.notification.read}},[n("el-row",{attrs:{type:"flex"}},[e.hasImage?n("el-col",{attrs:{span:4}},[e.image&&e.image.length>0?n("span",[n("img",{staticClass:"notification-image",attrs:{src:e.image}})]):e.magazine?n("MzMagazineThumb",{staticClass:"notification-magazine",attrs:{magazine:e.magazine},nativeOn:{click:function(t){return e.onClickMagazine(t)}}}):n("span",[n("img",{staticClass:"notification-logo",attrs:{src:"/logo-madmagz-small.svg"}})])],1):e._e(),e._v(" "),n("el-col",{attrs:{span:e.hasImage?20:24}},[n("div",[n("div",{staticClass:"time"},[e._v("\n "+e._s(e.displayTime)+"\n "),!1===e.notification.read?n("div",{staticClass:"unread-dot"}):e._e()]),e._v(" "),e.magazine?n("span",{staticClass:"magazineName"},[e._v("\n "+e._s(e.magazine.name+", "+e.magazine.issue)),n("br")]):e._e(
1),e._v(" "),n("span",{staticClass:"title",domProps:{innerHTML:e._s(e.title)}})]),e._v(" "),n("div",{staticClass:"message",domProps:{innerHTML:e._s(e.message)}}),e._v(" "),e.hasActions?n("div",{staticClass:"actions"},[e.primaryAction.go2Params?n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.goto(e.primaryAction.go2Params,"cta1")}}},[e._v(e._s(e.primaryAction.label))]):e._e(),e._v(" "),e.secondaryAction.go2Params?n("el-button",{attrs:{size:"small"},on:{click:function(t){return e.goto(e.secondaryAction.go2Params,"cta2")}}},[e._v(e._s(e.secondaryAction.label))]):e._e()],1):e._e()])],1)],1)}),[],!1,null,"57bf11ee",null).exports},props:["isVisible"],data:function(){return{activeTab:""}},computed:Ha({},Object(Ne.e)("notification",["notifications"]),{magazinesList:function(){return this.notifications?this.notifications.filter((function(e){return e.type!==Ma})):[]},unreadMagazinesCount:function(){return this.magazinesList.filter((function(e){return!1===e.read})).length},annoucementsList:function(){return this.notifications?this.notifications.filter((function(e){return e.type===Ma})):[]},unreadAnnoucementsCount:function(){return this.annoucementsList.filter((function(e){return!1===e.read})).length}}),mounted:function(){this.loadNotifications()},methods:Ha({},Object(Ne.b)({loadNotifications:"notification/LOAD_NOTIFICATIONS",setReadNotification:"notification/SET_READ_NOTIFICATION"}),{onNotificationsRead:function(e){console.log("set read notif for category ",e);var t=null;if("magazine"===e?t=this.magazinesList:"annoucement"===e&&(t=this.annoucementsList),t&&t.length>0){var n=t.filter((function(e){return!1===e.read})).map((function(e){return e._id}));n&&n.length>0&&this.setReadNotification({notificationIds:n})}}}),watch:{isVisible:function(e){this.activeTab=e?"magazine":""},activeTab:function(e,t){t&&-1!==["magazine","annoucement"].indexOf(t)&&this.onNotificationsRead(t)}}},Wa=(n(641),Object(je.a)(Va,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("h3",{staticClass:"header"},[e._v(e._s(e.$t("public.notifications.menu.title")))]),e._v(" "),n("el-tabs",{staticClass:"notification-nav",model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[n("el-tab-pane",{attrs:{name:"magazine"}},[n("span",{attrs:{slot:"label"},slot:"label"},[e._v("\n "+e._s(e.$t("public.notifications.menu.magazineTab"))+"\n "),n("el-badge",{staticClass:"ml-0",attrs:{value:e.unreadMagazinesCount,type:"info"}})],1),e._v(" "),e.magazinesList.length>0?n("div",[e._l(e.magazinesList,(function(e){return[n("Notification",{key:e._id,staticClass:"notification",attrs:{notification:e}})]}))],2):n("div",{staticClass:"empty-list"},[e._v("\n "+e._s(e.$t("public.notifications.menu.empty"))+"\n ")])]),e._v(" "),n("el-tab-pane",{attrs:{name:"annoucement"}},[n("span",{attrs:{slot:"label"},slot:"label"},[e._v("\n "+e._s(e.$t("public.notifications.menu.annoncementTab"))+"\n "),n("el-badge",{staticClass:"ml-0",attrs:{value:e.unreadAnnoucementsCount,type:"info"}})],1),e._v(" "),e.annoucementsList.length>0?n("div",[e._l(e.annoucementsList,(function(e){return[n("Notification",{key:e._id,staticClass:"notification",attrs:{notification:e}})]}))],2):n("div",{staticClass:"empty-list"},[e._v("\n "+e._s(e.$t("public.notifications.menu.empty"))+"\n ")])])],1)],1)}),[],!1,null,"38266172",null).exports),Ka=n(155);function Ya(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Za(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Ya(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Ya(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Xa={name:"SwitchWorkspaceButton",components:{MzSingleLineText:n(158).a,MzAppIcon:$e.a},props:{},data:function(){return{displayPopover:!1,displayChoiceWorkspaceDialog:!1,selectedOrganizationAndWorkspace:null}},computed:Za({},Object(Ne.c)("api",["getOrganizations","getCurrentOrganizationId","getWorkspaces","getCurrentWorkspaceId","currentWorkspace","currentOrganization","getUID","isB2cOrganization","getDisplayChoiceWorkspace","hasErrorNoOfferEdu"]),{labelButton:function(){if(!this.isB2cOrganization){if(this.currentWorkspace)return this.currentWorkspace.name;if(this.currentOrganization)return this.currentOrganization.name}return this.$t("public.switchWorkspace.defaultLabel")},nbSelectChoice:function(){var e=0,t=!0,n=!1,r=void 0;try{for(var o,l=this.filteredOrganizations[Symbol.iterator]();!(t=(o=l.next()).done);t=!0){var c=o.value;if(0===c.workspaces.length)c.isCurrent||e++;else{var d=!0,h=!1,f=void 0;try{for(var m,y=c.workspaces[Symbol.iterator]();
1!(d=(m=y.next()).done);d=!0){m.value.isCurrent||e++}}catch(e){h=!0,f=e}finally{try{d||null==y.return||y.return()}finally{if(h)throw f}}}}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}return e},filteredOrganizations:function(){var e=this;return this.getOrganizations.map((function(t){return Za({},t,{isCurrent:t._id===e.getCurrentOrganizationId,workspaces:e.getWorkspaces.filter((function(e){return e.organization._id===t._id})).map((function(t){return Za({},t,{isCurrent:t._id===e.getCurrentWorkspaceId})}))})})).filter((function(t){return t.workspaces.length>0||t.admin===e.getUID}))}}),mounted:function(){this.getDisplayChoiceWorkspace&&this.nbSelectChoice>0&&(this.selectedOrganizationAndWorkspace=null,this.getCurrentOrganizationId&&(this.selectedOrganizationAndWorkspace=""+this.getCurrentOrganizationId,this.getCurrentWorkspaceId&&(this.selectedOrganizationAndWorkspace+="_"+this.getCurrentWorkspaceId)),this.displayChoiceWorkspaceDialog=!0,this.updateApiRootField({key:"displayChoiceWorkspace",value:!1}))},methods:Za({},Object(Ne.b)({doChangeWorkspace:"api/API_CHANGE_WORKSPACE"}),{},Object(Ne.d)({updateApiRootField:"api/UPDATE_ROOT_FIELD"}),{hide:function(){this.displayPopover=!1,this.displayChoiceWorkspaceDialog=!1},show:function(){this.displayPopover=!0},onSelectWorkspace:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.doChangeWorkspace({organizationId:e,workspaceId:n}).then((function(e){t.hasErrorNoOfferEdu?t.$go2Route({name:"client-error-noOffer"}):t.$go2Route({name:"client"}),e&&t.hide()}))},onClickChoiceWorkspace:function(){if(this.selectedOrganizationAndWorkspace){var e=this.selectedOrganizationAndWorkspace.split("_"),t=e[0],n=e.length>1?e[1]:null;t!==this.getCurrentOrganizationId||n!==this.getCurrentWorkspaceId?this.onSelectWorkspace(t,n):this.displayChoiceWorkspaceDialog=!1}}})},qa=(n(642),Object(je.a)(Xa,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-popover",{attrs:{placement:"bottom",trigger:"click",disabled:0===e.nbSelectChoice},model:{value:e.displayPopover,callback:function(t){e.displayPopover=t},expression:"displayPopover"}},[n("div",{attrs:{slot:"reference"},slot:"reference"},[n("el-row",{class:{"content-workspace":!0,"has-choices":e.nbSelectChoice>0},attrs:{type:"flex",align:"middle",justify:"space-between"}},[n("MzSingleLineText",{style:{"max-width":e.nbSelectChoice>0?"200px":"240px"}},[e._v(e._s(e.labelButton)+"\n ")]),e._v(" "),e.nbSelectChoice>0?n("MzAppIcon",{attrs:{name:"repeat",size:"16",inline:""}}):e._e()],1)],1),e._v(" "),n("div",{staticClass:"mt-0 mb-0"},[n("el-row",{staticClass:"mb-1"},[e._v(e._s(e.$t("public.switchWorkspace.myWorkspaces")))]),e._v(" "),e._l(e.filteredOrganizations,(function(t){return n("div",{key:t._id},[0===t.workspaces.length?n("el-row",{staticClass:"mt-0 ml-1"},[t.isCurrent?n("el-badge",{attrs:{"is-dot":"",type:"success"}},[e._v("\n "+e._s(t.name+"Â Â ")+"\n ")]):n("el-link",{on:{click:function(n){return e.onSelectWorkspace(t._id)}}},[e._v("\n "+e._s(t.name)+"\n ")])],1):e._l(t.workspaces,(function(r){return n("el-row",{key:r._id,staticClass:"mt-0 ml-1"},[r.isCurrent?n("el-badge",{attrs:{"is-dot":"",type:"success"}},[e._v("\n "+e._s(t.name+" > "+r.name+"Â Â ")+"\n ")]):n("el-link",{on:{click:function(n){return e.onSelectWorkspace(t._id,r._id)}}},[e._v("\n "+e._s(t.name+" > "+r.name)+"\n ")])],1)}))],2)}))],2)]),e._v(" "),n("el-dialog",{attrs:{visible:e.displayChoiceWorkspaceDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,"append-to-body":""},on:{"update:visible":function(t){e.displayChoiceWorkspaceDialog=t}}},[n("span",{staticClass:"el-dialog__title",attrs:{slot:"title"},slot:"title"},[n("MzAppIcon",{attrs:{name:"switch_account"}}),e._v("\n "+e._s(e.$t("public.switchWorkspace.choice.title"))+"\n ")],1),e._v(" "),n("div",{staticClass:"mt-0 mb-0"},[n("el-row",{staticClass:"mb-0"},[e._v("\n "+e._s(e.$t("public.switchWorkspace.choice.description1"))+"\n ")]),e._v(" "),n("el-row",{staticClass:"mb-1 text-grey"},[e._v("\n "+e._s(e.$t("public.switchWorkspace.choice.description2"))+"\n ")]),e._v(" "),n("el-radio-group",{model:{value:e.selectedOrganizationAndWorkspace,callback:function(t){e.selectedOrganizationAndWorkspace=t},expression:"selectedOrganizationAndWorkspace"}},e._l(e.filteredOrganizations,(function(t){return n("div",{key:t._id},[0===t.workspaces.length?n("el-row",{staticClass:"mt-0 ml-1",attrs:{type:"flex",align:"middle"}},[n("el-radio",{staticClass:"choice-workspace-radio",attrs:{label:t._id}},[n("span",{staticClass:"choice-workspace-label"},[e._v(e._s(t.name))]),e._v(" "),t.isCurrent?n("el-tag",{attrs:{effect:"dark",type:"success",size:"mini"}},[e._v("\n "+e._s(e.$t("public.switchWorkspace.choice.tagIsCurrent"))+"\n ")]):e._e(
1)],1)],1):e._l(t.workspaces,(function(r){return n("el-row",{key:r._id,staticClass:"mt-0 ml-1",attrs:{type:"flex",align:"middle"}},[n("el-radio",{staticClass:"choice-workspace-radio",attrs:{label:t._id+"_"+r._id}},[n("span",{staticClass:"choice-workspace-label"},[e._v(e._s(t.name+" > "+r.name))]),e._v(" "),r.isCurrent?n("el-tag",{attrs:{effect:"dark",type:"success",size:"mini"}},[e._v("\n "+e._s(e.$t("public.switchWorkspace.choice.tagIsCurrent"))+"\n ")]):e._e()],1)],1)}))],2)})),0)],1),e._v(" "),n("span",{staticClass:"dialog-footer-buttons",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"success"},on:{click:e.onClickChoiceWorkspace}},[e._v(e._s(e.$t("public.switchWorkspace.choice.continue")))])],1)])],1)}),[],!1,null,"6082f168",null).exports),Ja=n(318);function Qa(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function en(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Qa(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Qa(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var tn={name:"CurrentCartIcon",components:{MzIconButton:ea.a},computed:en({},Object(Ne.e)("order",["currentCart"]),{isSelected:function(){return-1!==this.$nuxt.$route.name.indexOf("client-order-cart")},isInProgress:function(){return this.currentCart&&"draft"===this.currentCart.status&&!this.currentCart.deleted},nbProduct:function(){return this.currentCart&&this.currentCart.printProducts?this.currentCart.printProducts.length:0}}),mounted:function(){this.loadCurrentCart()},methods:en({},Object(Ne.b)({loadCurrentCart:"order/LOAD_CURRENT_CART"}))},an=Object(je.a)(tn,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("MzIconButton",{directives:[{name:"show",rawName:"v-show",value:e.isInProgress&&e.nbProduct>0,expression:"isInProgress && nbProduct > 0"}],attrs:{name:"shopping_cart",tag:e.nbProduct,iconColor:"blue",selected:e.isSelected},on:{click:function(t){return e.$emit("click")}}})}),[],!1,null,"1bf54e53",null).exports;function nn(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var rn={name:"ChatBotAi",props:["setCurrentUser"],data:function(){return{checkInterval:null,hasSetUser:!1,needInstantiateScript:!1}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?nn(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):nn(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(Ne.c)("api",["isLogged"]),{},Object(Ne.e)("api",["user"])),created:function(){this.checkInterval=setInterval(this.checkChatbot,1e3),this.needInstantiateScript=!window.$yourgptChatbot,document.getElementById("yourgpt_root")&&(document.getElementById("yourgpt_root").style.display="unset"),this.$bus.$on("display_comment_bar",this.updateChatBotPosition)},beforeDestroy:function(){this.checkInterval&&(clearInterval(this.checkInterval),this.checkInterval=null),document.getElementById("yourgpt_root")&&(document.getElementById("yourgpt_root").style.display="none"),this.$bus.$off("display_comment_bar",this.updateChatBotPosition)},methods:{checkChatbot:function(){if(window.$yourgptChatbot)if(this.checkInterval&&(clearInterval(this.checkInterval),this.checkInterval=null,console.log("Chatbot is loaded")),this.setCurrentUser&&this.isLogged&&!this.hasSetUser){this.hasSetUser=!0;var e=this.user.email?{user_id:this.user._id,email:this.user.email,name:this.user.n
1ame}:{user_id:this.user._id,name:this.user.name};console.log("Chatbot set connected user",JSON.parse(JSON.stringify(this.user))),this.user.chatbotHmac&&window.$yourgptChatbot.set("contact:data",{email:this.user.email?this.user.email:this.user.ssoUserId,name:this.user.name,ext_user_id:this.user._id,user_hash:this.user.chatbotHmac}),window.$yourgptChatbot.set("visitor:data",e),window.$yourgptChatbot.set("session:data",e)}else!this.isLogged&&this.hasSetUser&&(this.hasSetUser=!1,console.log("Chatbot unset connected user"),window.$yourgptChatbot.set("contact:data",null),window.$yourgptChatbot.set("visitor:data",null),window.$yourgptChatbot.set("session:data",null))},updateChatBotPosition:function(e){var t=e.right,n=e.transition,r=document.querySelector("#yourgpt_root .ygpts-widgetBtnOuter");r&&(r.style.right=(t?parseInt(t)+20:20)+"px",r.style.transition=n||"none")}},watch:{isLogged:function(e){var t=this;this.$nextTick((function(){t.checkChatbot()}))}}},on=(n(644),Object(je.a)(rn,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",[this.needInstantiateScript?t("script",{attrs:{src:"https://widget.yourgpt.ai/script.js",id:"yourgpt-chatbot","data-widget":"d1aa2cf5-4302-41bc-b073-fcafef8ac6d4"}}):this._e()])}),[],!1,null,null,null).exports),sn={name:"ListMagazinesHeader",components:{MzCheckOfferAccessButton:Ka.a},props:[],created:function(){},beforeDestroy:function(){},data:function(){return{}},computed:{currentRouteName:function(){return this.$route.name.split("___")[0]}},methods:{}},ln=(n(645),Object(je.a)(sn,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-row",{staticClass:"list-magazines-header",attrs:{type:"flex",align:"middle",justify:"end"}},[n("MzCheckOfferAccessButton",{staticClass:"mr-1",class:{"is-selected":0===e.currentRouteName.indexOf("client-magazine-create")},attrs:{label:e.$t("public.layout.create_magazine"),permission:"magazine:create",size:"medium"},on:{click:function(t){return e.$go2Route({name:"client-magazine-create-selectTemplate"})}}}),e._v(" "),n("el-button",{staticClass:"ml-0 mr-2",class:{"is-selected":"client"===e.currentRouteName},attrs:{type:"primary",size:"medium"},on:{click:function(t){return e.$go2Route({name:"client"})}}},[e._v("\n "+e._s(e.$t("public.layout.my_magazines"))+"\n ")])],1)}),[],!1,null,"26e3a99c",null).exports);function cn(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function un(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?cn(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):cn(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var dn={head:function(){return{title:this.$t("layout.html.title"),meta:[{hid:"description",name:"description",content:this.$t("layout.html.description")},{hid:"ogtitle",property:"og:title",content:this.$t("layout.html.title")},{hid:"ogsitename",property:"og:site_name",content:this.$t("layout.html.title")},{hid:"ogdescription",property:"og:description",content:this.$t("layout.html.description")},{hid:"itempropname",itemprop:"name",content:this.$t("layout.html.title")}]}},components:{MzAppIcon:$e.a,MzIconButton:ea.a,EditMagazineHeader:ya,ListMagazinesHeader:ln,OfflineModal:Ge,NotificationMenu:Wa,MzCheckOfferAccessButton:Ka.a,MaintenanceAlert:Gt,InactiveUserAlert:Kt,MzUserAvatar:Ja.a,SwitchWorkspaceButton:qa,CurrentCartIcon:an,ChatBotAi:on},computed:un({},Object(Ne.c)("api",["checkPerm","isLogged","isLoggedAsSupport","currentWorkspace","currentOrganization","getOrganizations","getWorkspaces","getUID","isB2cOrganization","isB2bOrganization","hasErrorNoOfferEdu"]),{},Object(Ne.e)("api",["user","supportUser"]),{},Object(Ne.e)("app",["apiBuild"]),{},Object(Ne.c)("app",["appBuild"]),{},Object(Ne.c)("magazine",["getDraftUserMagazines","getPublishUserMagazines"]),{},Object(Ne.c)("notification",["getNbUnreadNotification"]),{mainKey:function(){var e=this.currentWorkspace?this.currentWorkspace._id:-1;return console.log("client main key "+e,JSON.parse(JSON.stringify(this.currentWorkspace))),e},headerType:function(){return this.$route.matched.map((function(e){return e.components.default.options?e.components.default.options.layoutHeaderType:e.components.default.layoutHeaderType}))[0]},isOffline:function(){return!this.$online.online},authorizedNotLogged:function(){return this.$route.matched.map((function(e){return e.components.default.options?e.components.default.options.authorizedNotLogged:e.components.default.authorizedNotLogged}))[0]},displayStickyMessage:function(){return this.currentOrganization&&"active"!==this.currentOrganization.status?this.$t("public.client.alertOrganizationNotActive"):this.currentWorkspace&&"active"!==this.currentWorkspace.status?this.$t("public.client.alertWorkspaceNotActive"):this.currentWorkspace&&this.currentOrganization&&!this.currentWorkspace.activeOffer&&!this.currentOrganization.activeOffer&&-1===this.$route.name.indexOf("client-error-noOffer")?this.$t("public.client.alertWorkspaceOfferExpired"):null},hasWorkspaceAccess:function(){return!(!this.isLogged||!this.currentWorkspace)},hasOrganizationAccess:function(){return!(!this.isLogged||!this.currentOrganization||"active"!==this.currentOrganization.status)},showMadmagzV1Access:function(){return!this.isB2bOrganization}}),data:function(){return{isAutorizedUser:!0,displayNotificationsPop
1over:!1,displayUserPopover:!1,displayMagazinePopover:!1,gtagId:"GTM-5QHPJQQ9"}},created:function(){this.getBuildVersion(),this.hasErrorNoOfferEdu&&this.$go2Route({name:"client-error-noOffer"})},mounted:function(){this.authorizedNotLogged||this.checkPerm("editor:all")||(this.isAutorizedUser=!1,this.$alert(this.$t("layout.unauthorized_user.message"),this.$t("layout.unauthorized_user.title"),{confirmButtonText:this.$t("layout.unauthorized_user.button"),callback:this.logout})),this.$bus.$on("hide_client_popover",this.hideClientPopover)},beforeDestroy:function(){this.$bus.$off("hide_client_popover",this.hideClientPopover)},methods:un({},Object(Ne.b)({doLogout:"api/API_LOGOUT",doLogoutSupport:"api/API_LOGOUT_SUPPORT",getBuildVersion:"app/GET_API_BUILD"}),{hideClientPopover:function(){this.displayUserPopover=!1,this.displayMagazinePopover=!1,this.displayNotificationsPopover=!1},logout:function(){var e=this;this.isAutorizedUser=!1,this.isLoggedAsSupport?this.doLogoutSupport().then((function(){e.doLogout({debugSaveFrom:"Client logout after logout support"}).then((function(){e.$go2Route({name:"login"})}))})):this.doLogout({debugSaveFrom:"Client logout"}).then((function(){e.$go2Route({name:"login"})}))},logoutSupport:function(){var e=this;this.isAutorizedUser=!1,this.doLogoutSupport().then((function(t){t&&e.$go2Route({name:"admin"})}))},onClickCart:function(){this.onClickMenuLink({name:"client-order-cart"})},onClickMenuLink:function(e){this.hideClientPopover(),this.$go2Route(e)},onClickMag:function(e){this.onClickMenuLink({name:"client-magazine-edit-magazineId",params:{magazineId:e._id},query:{flatplan:"extended"}})}}),watch:{getNbUnreadNotification:function(e,t){e>t&&this.$refs.notifButton&&this.$refs.notifButton.shake()}}},pn=(n(646),Object(je.a)(dn,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-container",{class:{"app-support":e.isLoggedAsSupport},attrs:{id:"app"}},[n("div",{staticClass:"content-sticky-alert"},[n("el-alert",{directives:[{name:"show",rawName:"v-show",value:null!==e.displayStickyMessage,expression:"displayStickyMessage !== null"}],attrs:{type:"warning",center:"",closable:!1}},[n("span",{attrs:{slot:"title"},slot:"title"},[e._v("\n "+e._s(e.displayStickyMessage)+"\n\n "),e.hasErrorNoOfferEdu?n("el-button",{staticClass:"ml-1",attrs:{type:"warning",size:"small"},on:{click:function(t){return e.$go2Route({name:"client-error-noOffer"})}}},[e._v(e._s(e.$t("public.client.alertWorkspaceOfferExpiredButton")))]):e._e()],1)])],1),e._v(" "),n("el-header",{staticClass:"app-header"},[n("span",{staticClass:"nav-logo"},[n("el-link",{attrs:{underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client"})}}},[n("img",{attrs:{src:"/logo-madmagz-small.svg",height:"40px"}})])],1),e._v(" "),n("span",{staticClass:"header-content"},["welcome"===e.headerType?n("el-row",{staticClass:"welcome-header",attrs:{type:"flex",align:"middle",justify:"center"}},[n("span",{domProps:{innerHTML:e._s(e.$t("public.layout.welcome_user",{name:e.user.name}))}})]):"home"===e.headerType&&e.hasWorkspaceAccess?n("ListMagazinesHeader",{staticClass:"ml-2"}):"editMag"===e.headerType&&e.hasWorkspaceAccess?n("EditMagazineHeader",{staticClass:"ml-2"}):e._e()],1),e._v(" "),e.hasWorkspaceAccess?n("span",{staticClass:"ml-1"},[n("CurrentCartIcon",{on:{click:e.onClickCart}})],1):e._e(),e._v(" "),e.hasWorkspaceAccess?n("span",{staticClass:"ml-1"},[n("el-popover",{attrs:{placement:"bottom-end",trigger:"click",width:"500","visible-arrow":!1,"popper-class":"el-popper-no-padding"},model:{value:e.displayNotificationsPopover,callback:function(t){e.displayNotificationsPopover=t},expression:"displayNotificationsPopover"}},[n("NotificationMenu",{attrs:{isVisible:e.displayNotificationsPopover}}),e._v(" "),n("MzIconButton",{ref:"notifButton",attrs:{slot:"reference",name:"notifications",disableStopEvent:!0,tag:e.getNbUnreadNotification,tagType:"blue",iconColor:"blue",selected:e.displayNotificationsPopover},slot:"reference"})],1)],1):e._e(),e._v(" "),e.hasWorkspaceAccess?n("span",{staticClass:"ml-1"},[n("el-popover",{attrs:{placement:"bottom-end",trigger:"click",width:"300","visible-arrow":!1},model:{value:e.displayMagazinePopover,callback:function(t){e.displayMagazinePopover=t},expression:"displayMagazinePopover"}},[e.getDraftUserMagazines&&e.getDraftUserMagazines.length>0||e.getPublishUserMagazines&&e.getPublishUserMagazines.length>0?n("div",[n("el-row",{staticClass:"popover-row"},[n("h3",[e._v(e._s(e.$t("public.layout.my_magazines")))])]),e._v(" "),n("el-divider",{staticClass:"full-popover-divider"}),e._v(" "),e.getDraftUserMagazines&&e.getDraftUserMagazines.length>0?n("div",{staticClass:"popover-row"},[n("div",{staticClass:"mb-10px"},[e._v("\n "+e._s(e.$t("public.layout.my_magazines.in_progress"))+"\n ")]),e._v(" "),e._l(e.getDraftUserMagazines.slice(0,3),(function(t){return n("div",{key:t._id,staticClass:"magazine-row"},[n("el-link",{attrs:{underline:!1},on:{click:function(n){return e.onClickMag(t)}}},[n("span",[e._v("\n "+e._s(t.name)),n("small",[e._v(", "+e._s(t.issue))])])])],1
1)})),e._v(" "),n("div",{staticClass:"magazine-row"},[n("el-link",{staticClass:"see-all-link",attrs:{underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client"})}}},[e._v("\n "+e._s(e.$t("public.layout.my_magazines.see_all"))+"\n ")])],1),e._v(" "),n("br")],2):e._e(),e._v(" "),e.getPublishUserMagazines&&e.getPublishUserMagazines.length>0?n("div",{staticClass:"popover-row"},[n("div",{staticClass:"mb-10px"},[e._v("\n "+e._s(e.$t("public.layout.my_magazines.published"))+"\n ")]),e._v(" "),e._l(e.getPublishUserMagazines.slice(0,3),(function(t){return n("div",{key:t._id,staticClass:"magazine-row"},[n("el-link",{attrs:{underline:!1},on:{click:function(n){return e.onClickMag(t)}}},[n("span",[e._v("\n "+e._s(t.name)),n("small",[e._v(", "+e._s(t.issue))])])])],1)})),e._v(" "),n("div",{staticClass:"magazine-row"},[n("el-link",{staticClass:"see-all-link",attrs:{underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client"})}}},[e._v("\n "+e._s(e.$t("public.layout.my_magazines.see_all"))+"\n ")])],1)],2):e._e(),e._v(" "),n("el-divider",{staticClass:"full-popover-divider"})],1):e._e(),e._v(" "),n("div",{staticClass:"popover-row"},[n("el-row",{staticClass:"mt-1"},[n("MzCheckOfferAccessButton",{attrs:{label:e.$t("public.layout.create_magazine"),buttonClass:"el-col el-col-24",permission:"magazine:create"},on:{click:function(t){return e.onClickMenuLink({name:"client-magazine-create-selectTemplate"})}}})],1),e._v(" "),n("el-row",{staticClass:"mt-0"},[e.checkPerm("magazine:list")?n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.layout.my_magazines",expression:"'public.layout.my_magazines'"}],staticClass:"mt-0 el-col el-col-24",attrs:{type:"info"},on:{click:function(t){return e.onClickMenuLink({name:"client"})}}}):e._e()],1)],1),e._v(" "),e.showMadmagzV1Access?n("div",[n("el-divider",{staticClass:"full-popover-divider"}),e._v(" "),n("el-row",{staticClass:"popover-row"},[n("el-link",{staticClass:"is-last",attrs:{href:e.$t("public.layout.madmagzV1Link"),target:"_blank",underline:!1}},[n("h3",[e._v("\n "+e._s(e.$t("public.layout.my_magazines_v1"))+"\n "),n("MzAppIcon",{staticClass:"ml-1",attrs:{name:"open_in_new",size:"16",inline:""}})],1)])],1)],1):e._e(),e._v(" "),n("MzIconButton",{attrs:{slot:"reference",name:"menu_book",disableStopEvent:!0,iconColor:"blue",selected:e.displayMagazinePopover},slot:"reference"})],1)],1):e._e(),e._v(" "),e.isLogged?n("el-popover",{attrs:{placement:"bottom-end",trigger:"click",width:"300","visible-arrow":!1},model:{value:e.displayUserPopover,callback:function(t){e.displayUserPopover=t},expression:"displayUserPopover"}},[n("div",[n("el-row",{staticClass:"popover-row"},[n("h3",[e._v(e._s(e.user.name))]),e._v(" "),e.user.email?n("small",[e._v(e._s(e.user.email))]):e._e()]),e._v(" "),n("el-row",{staticClass:"popover-row"},[e.checkPerm("organization:showIsAdmin")?n("el-tag",{attrs:{effect:"dark",size:"mini",type:"danger"}},[e._v("\n "+e._s(e.$t("public.organization.userStatus.isAdmin"))+"\n ")]):e._e(),e._v(" "),e.checkPerm("workspace:showIsAdmin")?n("el-tag",{attrs:{effect:"dark",size:"mini",type:"warning"}},[e._v("\n "+e._s(e.$t("public.workspace.userStatus.isAdmin"))+"\n ")]):e._e()],1),e._v(" "),n("el-divider",{staticClass:"full-popover-divider"}),e._v(" "),n("el-row",{staticClass:"popover-row"},[n("SwitchWorkspaceButton")],1),e._v(" "),n("el-divider",{staticClass:"full-popover-divider"}),e._v(" "),e.isB2cOrganization?e._e():n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client-offer"})}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"settings",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.my_offer"))+"\n ")],1)],1),e._v(" "),n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client-user"})}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"person",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.my_profile"))+"\n ")],1)],1),e._v(" "),n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client-order-list"})}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"shopping_cart",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.my_order_list"))+"\n ")],1)],1),e._v(" "),e.checkPerm("workspace:show")&&e.checkPerm("workspace:showManagePage")?n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{disabled:!e.hasWorkspaceAccess,underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client-workspace"})}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"folder",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.my_workspace")))],1)],1):e._e(
1),e._v(" "),e.checkPerm("organization:show")&&e.checkPerm("organization:showManagePage")?n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{disabled:!e.hasOrganizationAccess,underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"client-organization"})}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"group",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.my_organization"))+"\n ")],1)],1):e._e(),e._v(" "),!e.isLoggedAsSupport&&e.checkPerm("admin:all")?n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{underline:!1},on:{click:function(t){return e.onClickMenuLink({name:"admin"})}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"star",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.admin_interface"))+"\n ")],1)],1):e._e(),e._v(" "),n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{href:e.$t("public.layout.supportLink"),target:"_blank",underline:!1}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"headphones",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.support"))+"\n "),n("MzAppIcon",{staticClass:"ml-1",attrs:{name:"open_in_new",size:"16",inline:""}})],1)],1),e._v(" "),n("div",{staticClass:"popover-row"},[n("el-link",{attrs:{underline:!1},on:{click:function(t){return e.logout()}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"logout",inline:""}}),e._v("\n "+e._s(e.$t("public.layout.logout"))+"\n ")],1)],1),e._v(" "),e.isLoggedAsSupport?n("div",[n("el-divider",{staticClass:"full-popover-divider"},[n("small",[e._v(e._s(e.$t("public.layout.support_title")))])]),e._v(" "),n("el-row",{staticClass:"popover-row"},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"person",size:"16",inline:""}}),e._v(" "),n("small",[e._v(e._s(e.user.email?e.user.email:e.user.name))])],1),e._v(" "),n("el-row",{staticClass:"popover-row"},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"star",size:"16",inline:""}}),e._v(" "),n("small",[e._v(e._s(e.supportUser.email?e.supportUser.email:e.supportUser.name))])],1),e._v(" "),n("el-row",{staticClass:"popover-row"},[n("el-link",{attrs:{underline:!1},on:{click:e.logoutSupport}},[e._v(e._s(e.$t("public.layout.logout_support")))])],1)],1):e._e(),e._v(" "),e.checkPerm("debug:all")?n("div",{staticClass:"version"},[e._v("\n api: "+e._s(e.apiBuild)+" | app: "+e._s(e.appBuild)+"\n ")]):e._e()],1),e._v(" "),n("div",{staticClass:"ml-1 mr-2 button-avatar",attrs:{slot:"reference"},slot:"reference"},[n("MzUserAvatar",{attrs:{user:e.user}})],1)]):e._e()],1),e._v(" "),e.isAutorizedUser?n("el-main",{key:e.mainKey,staticClass:"app-main"},[n("nuxt")],1):e._e(),e._v(" "),n("MaintenanceAlert"),e._v(" "),n("InactiveUserAlert"),e._v(" "),n("OfflineModal",{attrs:{visible:e.isOffline}}),e._v(" "),e.gtagId?n("script",[e._v('\n (function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != "dataLayer" ? "&l=" + l : "";\n j.async = true;\n j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, "script", "dataLayer", "'+e._s(e.gtagId)+'");\n ')]):e._e(),e._v(" "),n("ChatBotAi",{attrs:{setCurrentUser:!0}})],1)}),[],!1,null,"5484664c",null).exports),hn={head:function(){return{title:this.$t("layout.html.title"),meta:[{hid:"description",name:"description",content:this.$t("layout.html.description")},{hid:"ogtitle",property:"og:title",content:this.$t("layout.html.title")},{hid:"ogsitename",property:"og:site_name",content:this.$t("layout.html.title")},{hid:"ogdescription",property:"og:description",content:this.$t("layout.html.description")},{hid:"itempropname",itemprop:"name",content:this.$t("layout.html.title")}]}},components:{MaintenanceAlert:Gt,MzSwitchLang:n(496).a,ChatBotAi:on},computed:{},methods:{}},fn=(n(648),{head:function(){return{title:this.$t("layout.html.title"),meta:[{hid:"description",name:"description",content:this.$t("layout.html.description")},{hid:"ogtitle",property:"og:title",content:this.$t("layout.html.title")},{hid:"ogsitename",property:"og:site_name",content:this.$t("layout.html.title")},{hid:"ogdescription",property:"og:description",content:this.$t("layout.html.description")},{hid:"itempropname",itemprop:"name",content:this.$t("layout.html.title")}]}}}),mn={_admin:Jt,_client:pn,_default:Object(je.a)(hn,(function(){var e=this.$createElement,t=this._self._c||e;return t("el-container",{attrs:{id:"app"}},[t("el-main",[t("nuxt")],1),this._v(" "),t("div",{staticClass:"change-locale-button"},[t("MzSwitchLang")],1),this._v(" "),t("MaintenanceAlert"),this._v(" "),t("ChatBotAi")],1)}),[],!1,null,"c6581050",null).exports,_empty:Object(je.a)(fn,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"app"}},[t("el-main",[t("nuxt")],1)],1)}),[],!1,null,"f5f02bc4",null).exports},gn={head:{htmlAttrs:{translate:"no"},title:"Create your mag for free: Madmagz",meta:[{charset:"utf-8"},{hid:"robots",name:"robots",content:"noindex, nofollow"},{hid:"viewport",name:"viewport",content:"width=device-width, initial-scale=1"},{name:"msapplication-TileColor",content:"#f2f2f2"},{name:"theme-color",content:"#f2f2f2"},{hid:"description",name:"description",content:"Madmagz enables you to create a digital or a print magazine. Try it, it's free!"},{hid:"ogurl",property:"og:url",content:"https://madmagz.com"},{hid:"ogtitle",property:"og:title",content:"Create your mag for free: Madmagz"},{hid:"ogsitename",property:"og:site_name",content:"Create your mag for free: Madmagz"},{hid:"ogdescription",property:"og:description",content:"Madmagz enables you to create a digital or a print magazine. Try it, it's free!"},{hid:"ogimage",property:"og:image",content:"https://madmagz.app/logo-madmagz.jpg"},{hid:"twittercard",name:"twitter:card",content:"summary_large_image"},{hid:"itempropname",itemprop:"name",content:"Create your mag for free: Madmagz"},{itemprop:"image",content:"https://madmagz.app/logo-madmagz.jpg"},{hid:"googleVerification",name:"google-site-verification",content:"uDzPC0wkr0YSR2gDFwPa7umPJs08HEXb6mdzUZ
1ILwsk"}],link:[{rel:"apple-touch-icon",sizes:"180x180",href:"/apple-touch-icon.png"},{rel:"icon",type:"image/png",sizes:"32x32",href:'/favicon-32x32.png"'},{rel:"icon",type:"image/png",sizes:"16x16",href:'/favicon-16x16.png"'},{rel:"manifest",href:"/site.webmanifest"},{rel:"mask-icon",href:"/safari-pinned-tab.svg",color:"#5bbad5"},{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}],script:[{src:"https://js.stripe.com/v3"}],style:[]},render:function(e,t){var n=e(this.layout||"nuxt"),r=e("div",{domProps:{id:"__layout"},key:this.layoutName},[n]),o=e("transition",{props:{name:"layout",mode:"out-in"},on:{beforeEnter:function(e){window.$nuxt.$nextTick((function(){window.$nuxt.$emit("triggerScroll")}))}}},[r]);return e("div",{domProps:{id:"__nuxt"}},[o])},data:function(){return{isOnline:!0,layout:null,layoutName:""}},beforeCreate:function(){l.default.util.defineReactive(this,"nuxt",this.$options.nuxt)},created:function(){l.default.prototype.$nuxt=this,window.$nuxt=this,this.refreshOnlineStatus(),window.addEventListener("online",this.refreshOnlineStatus),window.addEventListener("offline",this.refreshOnlineStatus),this.error=this.nuxt.error,this.context=this.$options.context},computed:{isOffline:function(){return!this.isOnline}},methods:{refreshOnlineStatus:function(){void 0===window.navigator.onLine?this.isOnline=!0:this.isOnline=window.navigator.onLine},refresh:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=Object(v.f)(e.$route)).length){t.next=3;break}return t.abrupt("return");case 3:return r=n.map((function(t){var p=[];return t.$options.fetch&&p.push(Object(v.m)(t.$options.fetch,e.context)),t.$options.asyncData&&p.push(Object(v.m)(t.$options.asyncData,e.context).then((function(e){for(var n in e)l.default.set(t.$data,n,e[n])}))),Promise.all(p)})),t.prev=4,t.next=7,Promise.all(r);case 7:t.next=13;break;case 9:t.prev=9,t.t0=t.catch(4),Object(v.i)(t.t0),e.error(t.t0);case 13:case"end":return t.stop()}}),t,null,[[4,9]])})))()},setLayout:function(e){return e&&mn["_"+e]||(e="default"),this.layoutName=e,this.layout=mn["_"+e],this.layout},loadLayout:function(e){return e&&mn["_"+e]||(e="default"),Promise.resolve(mn["_"+e])}}};n(83);l.default.use(Ne.a);var bn=["state","getters","actions","mutations"],yn={};(yn=function(e,t){if((e=e.default||e).commit)throw new Error("[nuxt] ".concat(t," should export a method that returns a Vuex instance."));return"function"!=typeof e&&(e=Object.assign({},e)),_n(e,t)}(n(649),"store/index.js")).modules=yn.modules||{},On(n(283),"modules/api.js"),On(n(282),"modules/app.js"),On(n(299),"modules/storeAdminSettings.js"),On(n(292),"modules/storeArticle.js"),On(n(300),"modules/storeAuthStrategy.js"),On(n(293),"modules/storeCollaboration.js"),On(n(303),"modules/storeErrorLog.js"),On(n(290),"modules/storeFabric.js"),On(n(284),"modules/storeFormat.js"),On(n(286),"modules/storeLibrary.js"),On(n(285),"modules/storeMagazine.js"),On(n(294),"modules/storeNotification.js"),On(n(295),"modules/storeOffer.js"),On(n(296),"modules/storeOrder.js"),On(n(298),"modules/storeOrganization.js"),On(n(287),"modules/storePage.js"),On(n(302),"modules/storePageComment.js"),On(n(289),"modules/storePalette.js"),On(n(288),"modules/storeTheme.js"),On(n(301),"modules/storeTracking.js"),On(n(291),"modules/storeUser.js"),On(n(297),"modules/storeWorkspace.js");var vn=yn instanceof Function?yn:function(){return new Ne.a.Store(Object.assign({strict:!1},yn))};function _n(e,t){if(e.state&&"function"!=typeof e.state){console.warn("'state' should be a method that returns an object in ".concat(t));var n=Object.assign({},e.state);e=Object.assign({},e,{state:function(){return n}})}return e}function On(e,t){e=e.default||e;var n=t.replace(/\.(js|mjs)$/,"").split("/"),r=n[n.length-1],o="store/".concat(t);if(e="state"===r?function(e,t){if("function"!=typeof e){console.warn("".concat(t," should export a method that returns an object"));var n=Object.assign({},e);return function(){return n}}return _n(e,t)}(e,o):_n(e,o),bn.includes(r)){var l=r;kn(En(yn,n,{isProperty:!0}),e,l)}else{"index"===r&&(n.pop(),r=n[n.length-1]);var c=En(yn,n),d=!0,h=!1,f=void 0;try{for(var m,y=bn[Symbol.iterator]();
1!(d=(m=y.next()).done);d=!0){var v=m.value;kn(c,e[v],v)}}catch(e){h=!0,f=e}finally{try{d||null==y.return||y.return()}finally{if(h)throw f}}!1===e.namespaced&&delete c.namespaced}}function En(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.isProperty,o=void 0!==r&&r;if(!t.length||o&&1===t.length)return e;var l=t.shift();return e.modules[l]=e.modules[l]||{},e.modules[l].namespaced=!0,e.modules[l].modules=e.modules[l].modules||{},En(e.modules[l],t,{isProperty:o})}function kn(e,t,n){t&&("state"===n?e.state=t||e.state:e[n]=Object.assign({},e[n],t))}var Sn=n(520),An=n(150),Tn=n(9),Pn=n(99);function Cn(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function xn(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Cn(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Cn(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}function Dn(e,t){if(e){var n=this.i18n;if(Tn.u===Tn.g.NO_PREFIX&&t&&t!==n.locale&&console.warn("[".concat(Tn.f,"] Passing non-current locale to localePath is unsupported when using no_prefix strategy")),t=t||n.locale){"string"==typeof e&&(e="/"===e[0]?{path:e}:{name:e});var r=Object.assign({},e);if(e.path&&!e.name){var path=!(t===Tn.j&&Tn.u===Tn.g.PREFIX_EXCEPT_DEFAULT||Tn.u===Tn.g.NO_PREFIX||n.differentDomains)?"/".concat(t).concat(e.path):e.path;r.path=path}else{var o=e.name+(Tn.u===Tn.g.NO_PREFIX?"":Tn.t+t);t===Tn.j&&Tn.u===Tn.g.PREFIX_AND_DEFAULT&&(o+=Tn.t+Tn.k),r.name=o;var l=r.params;l&&void 0===l[0]&&l.pathMatch&&(l[0]=l.pathMatch)}return this.router.resolve(r).route.fullPath}}}function In(e){var t=this.i18n;Tn.u===Tn.g.NO_PREFIX&&e&&e!==t.locale&&console.warn("[".concat(Tn.f,"] Passing non-current locale to switchLocalePath is unsupported when using no_prefix strategy"));var n=this.getRouteBaseName();if(!n)return"";var r=this.route,o=this.store,l=r.params,c=Object(Sn.a)(r,["params"]),d={};Tn.w&&o&&(d=o.getters["".concat(Tn.w.moduleName,"/localeRouteParams")](e));var h=Object.assign({},c,{name:n,params:xn({},l,{},d,{0:l.pathMatch})}),path=this.localePath(h,e);if(t.differentDomains){var f=t.locales.find((function(t){return t[Tn.b]===e}));if(f&&f[Tn.c])path=window.location.protocol.split(":")[0]+"://"+f[Tn.c]+path;else console.warn("[".concat(Tn.f,"] Could not find domain name for locale ").concat(e))}return path}function wn(e){var t=e||this.route;return t.name?t.name.split(Tn.t)[0]:null}An.a.nuxti18n=function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r,o,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.app,r=t.route,o=t.redirect,!t.isHMR){e.next=3;break}return e.abrupt("return");case 3:if("/"!==r.path||!Tn.s){e.next=6;break}return o("/"+Tn.s,r.query),e.abrupt("return");case 6:if(e.t0=Tn.l,!e.t0){e.next=11;break}return e.next=10,n.i18n.__detectBrowserLanguage();case 10:e.t0=e.sent;case 11:if(!e.t0){e.next=13;break}return e.abrupt("return");case 13:return l=n.i18n.locale||n.i18n.defaultLocale||null,c=Object(Pn.getLocaleFromRoute)(r),e.next=17,n.i18n.setLocale(c||l);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var Rn=function(e){return function(){var t={getRouteBaseName:this.getRouteBaseName,i18n:this.$i18n,localePath:this.localePath,req:null,route:this.$route,router:this.$router,store:this.$store};return e.apply(t,arguments)}},zn=function(e,t){return function(){var n=e.app,r=(e.req,e.route),o=e.store,l={getRouteBaseName:n.getRouteBaseName,i18n:n.i18n,localePath:n.localePath,req:null,route:r,router:n.router,store:o};return t.apply(l,arguments)}},Ln={install:function(e){e.mixin({methods:{localePath:Rn(Dn),switchLocalePath:Rn(In),getRouteBaseName:Rn(wn)}})}},jn=function(e){l.default.use(Ln);var t=e.app;t.localePath=zn(e,Dn),t.switchLocalePath=zn(e,In),t.getRouteBaseName=zn(e,wn)},Mn=(n(103),n(651),n(72)),Un=n.n(Mn),Fn=n(306),Nn=(n(135),function(){var e=this;if(!(c.a.hasMetaInfo?c.a.hasMetaInfo(this):this._hasMetaInfo)||!this.$i18n||!this.$i18n.locale||!this.$i18n.locales||!1===this.$options[Tn.a]||this.$options[Tn.a]&&!1===this.$options[Tn.a].seo)return{};var t={htmlAttrs:{},link:[],meta:[]},n=this.$i18n.locales.find((function(t){return Kn(t)===e.$i18n.locale})),r=Vn(n);return n&&r&&(t.htmlAttrs.lang=r),$n.bind(this)(this.$i18n.locales,t.link),Bn.bind(this)(n,t.link),Gn.bind(this)(n,r,t.meta),Hn.bind(this)(this.$i18n.locales,r,t.meta),t});
1function $n(e,link){if(Tn.u!==Tn.g.NO_PREFIX){var t=new Map,n=!0,r=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value,h=Vn(d);if(h){var f=h.split("-"),m=Object(Ue.a)(f,2),y=m[0],v=m[1];y&&v&&(d.isCatchallLocale||!t.has(y))&&t.set(y,d),t.set(h,d)}else console.warn("[".concat(Tn.f,"] Locale ISO code is required to generate alternate link"))}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}var _=!0,O=!1,E=void 0;try{for(var k,S=t.entries()[Symbol.iterator]();!(_=(k=S.next()).done);_=!0){var A=Object(Ue.a)(k.value,2),T=A[0],P=A[1];link.push({hid:"alternate-hreflang-".concat(T),rel:"alternate",href:Tn.h+this.switchLocalePath(P.code),hreflang:T})}}catch(e){O=!0,E=e}finally{try{_||null==S.return||S.return()}finally{if(O)throw E}}}}function Bn(e,link){if(Tn.u===Tn.g.PREFIX_AND_DEFAULT){var t=Kn(e),n=this.switchLocalePath(t),r=n!==this.$route.path;n&&r&&link.push({hid:"canonical-lang-".concat(t),rel:"canonical",href:Tn.h+n})}}function Gn(e,t,meta){e&&t&&meta.push({hid:"og:locale",property:"og:locale",content:Wn(e)})}function Hn(e,t,meta){var n=e.filter((function(e){var n=Vn(e);return n&&n!==t})).map((function(e){return{hid:"og:locale:alternate-".concat(Vn(e)),property:"og:locale:alternate",content:Wn(e)}}));meta.push.apply(meta,Object(tt.a)(n))}function Vn(e){return e[Tn.e]}function Wn(e){return Vn(e).replace(/-/g,"_")}function Kn(e){return e[Tn.b]}function Yn(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Zn(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Yn(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Yn(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}l.default.use(Fn.a);for(var Xn=function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){var o,c,d,h,f,m,y,v,_,O,E,k,S,A,T;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.app,c=t.route,d=t.store,h=t.req,t.res,f=t.redirect,Tn.w&&d&&d.registerModule(Tn.w.moduleName,{namespaced:!0,state:function(){return Zn({},Tn.w.syncLocale?{locale:""}:{},{},Tn.w.syncMessages?{messages:{}}:{},{},Tn.w.syncRouteParams?{routeParams:{}}:{})},actions:Zn({},Tn.w.syncLocale?{setLocale:function(e,t){(0,e.commit)("setLocale",t)}}:{},{},Tn.w.syncMessages?{setMessages:function(e,t){(0,e.commit)("setMessages",t)}}:{},{},Tn.w.syncRouteParams?{setRouteParams:function(e,t){(0,e.commit)("setRouteParams",t)}}:{}),mutations:Zn({},Tn.w.syncLocale?{setLocale:function(e,t){e.locale=t}}:{},{},Tn.w.syncMessages?{setMessages:function(e,t){e.messages=t}}:{},{},Tn.w.syncRouteParams?{setRouteParams:function(e,t){e.routeParams=t}}:{}),getters:Zn({},Tn.w.syncRouteParams?{localeRouteParams:function(e){var t=e.routeParams;return function(e){return t[e]||{}}}}:{})},{preserveState:!!d.state[Tn.w.moduleName]}),m=Tn.l.useCookie,y=Tn.l.cookieKey,v=Tn.l.cookieDomain,_=function(){if(m)return Un.a.get(y)},O=function(e){if(m){var t=new Date,n={expires:new Date(t.setDate(t.getDate()+365)),path:"/",sameSite:"lax"};v&&(n.domain=v),Un.a.set(y,e,n)}},E=function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(r){var l,c,h,y,v,_,O,E,k,S=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=S.length>1&&void 0!==S[1]?S[1]:{},c=l.initialSetup,(h=void 0!==c&&c)||!o.i18n.differentDomains){e.next=3;break}return e.abrupt("return");case 3:if(r!==o.i18n.locale){e.next=5;break}return e.abrupt("return");case 5:if(y=o.i18n.locale,h||(o.i18n.beforeLanguageSwitch(y,r),m&&o.i18n.setLocaleCookie(r)),!Tn.o){e.next=14;break}if(v=n(99),_=v.loadLanguageAsync,!o.i18n.fallbackLocale||r===o.i18n.fallbackLocale){e.next=12;break}return e.next=12,_(t,o.i18n.fallbackLocale);case 12:return e.next=14,_(t,r);case 14:return o.i18n.locale=r,e.next=17,Object(Pn.syncVuex)(d,r,o.i18n.getLocaleMessage(r));
1case 17:h||o.i18n.onLanguageSwitched(y,r),h||Tn.u===Tn.g.NO_PREFIX||(O=o.switchLocalePath(r)||o.localePath("index",r),E=o.router.resolve(O).route,(k=t.route)&&!Object(Pn.isSameRoute)(k,E)&&f(O));case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.i18n=new Fn.a("function"==typeof Tn.v?Object(Tn.v)(t):Tn.v),o.i18n.locales=Tn.q,o.i18n.defaultLocale=Tn.j,o.i18n.differentDomains=Tn.m,o.i18n.forwardedHost=Tn.n,o.i18n.beforeLanguageSwitch=Tn.i,o.i18n.onLanguageSwitched=Tn.r,o.i18n.setLocaleCookie=O,o.i18n.getLocaleCookie=_,o.i18n.setLocale=function(e){return E(e)},l.default.prototype.$nuxtI18nSeo=Nn,d&&(d.$i18n=o.i18n,d.state.localeDomains&&o.i18n.locales.forEach((function(e){e.domain=d.state.localeDomains[e.code]}))),k=o.i18n.defaultLocale||null,o.i18n.differentDomains?(S=Object(Pn.getLocaleDomain)(o.i18n,h),k=S||k):Tn.u!==Tn.g.NO_PREFIX?(A=Object(Pn.getLocaleFromRoute)(c),k=A||k):m&&(T=_(),Tn.p.includes(T)&&(k=T)),e.next=22,E(k,{initialSetup:!0});case 22:return o.i18n.__detectBrowserLanguage=Object(r.a)(regeneratorRuntime.mark((function e(){var t,n,r,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Tn.l){e.next=15;break}if(t=Tn.l.alwaysRedirect,n=Tn.l.fallbackLocale,m&&(r=_())&&1!==r&&"1"!==r||("undefined"!=typeof navigator&&navigator.language?r=navigator.language.toLocaleLowerCase().substring(0,2):h&&void 0!==h.headers["accept-language"]&&(r=h.headers["accept-language"].split(",")[0].toLocaleLowerCase().substring(0,2))),!r){e.next=15;break}if(m&&!t&&_()){e.next=15;break}if(l=n,Tn.p.includes(r)&&(l=r),!l||!Tn.p.includes(l)){e.next=14;break}if(l===o.i18n.locale){e.next=13;break}return e.next=11,o.i18n.setLocale(l);case 11:e.next=14;break;case 13:m&&!_()&&o.i18n.setLocaleCookie(l);case 14:return e.abrupt("return",!0);case 15:return e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e)}))),e.next=25,o.i18n.__detectBrowserLanguage();case 25:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),qn=n(126),Jn=n.n(qn),Qn=n(502),ei=n.n(Qn),ti=n(503),ai=n.n(ti),ni={setBaseURL:function(e){this.defaults.baseURL=e},setHeader:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"common",r=!0,o=!1,l=void 0;try{for(var c,d=(Array.isArray(n)?n:[n])[Symbol.iterator]();!(r=(c=d.next()).done);r=!0){var h=c.value;if(!t)return void delete this.defaults.headers[h][e];this.defaults.headers[h][e]=t}}catch(e){o=!0,l=e}finally{try{r||null==d.return||d.return()}finally{if(o)throw l}}},setToken:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"common",r=e?(t?t+" ":"")+e:null;this.setHeader("Authorization",r,n)},onRequest:function(e){this.interceptors.request.use((function(t){return e(t)||t}))},onResponse:function(e){this.interceptors.response.use((function(t){return e(t)||t}))},onRequestError:function(e){this.interceptors.request.use(void 0,(function(t){return e(t)||Promise.reject(t)}))},onResponseError:function(e){this.interceptors.response.use(void 0,(function(t){return e(t)||Promise.reject(t)}))},onError:function(e){this.onRequestError(e),this.onResponseError(e)},create:function(e){return si(ei()(e,this.defaults))}},ii=function(){var e=oi[ri];ni["$"+e]=function(){return this[e].apply(this,arguments).then((function(e){return e&&e.data}))}},ri=0,oi=["request","delete","get","head","options","post","put","patch"];ri<oi.length;ri++)ii();var si=function(e){var t=Jn.a.create(e);return t.CancelToken=Jn.a.CancelToken,t.isCancel=Jn.a.isCancel,function(e){for(var t in ni)e[t]=ni[t].bind(e)}(t),ci(t),ui(t),ai()(t,{retries:3,retryDelay:function(e){return 500*e}}),t},ci=function(e){e.onRequest((function(e){void 0===e.withCredentials&&(/^https?:\/\//i.test(e.url)&&0!==e.url.indexOf(e.baseURL)||(e.withCredentials=!0))}))},ui=function(e){var t={finish:function(){},start:function(){},fail:function(){},set:function(){}},n=function(){return window.$nuxt&&window.$nuxt.$loading&&window.$nuxt.$loading.set?window.$nuxt.$loading:t},r=0;e.onRequest((function(e){e&&!1===e.progress||r++})),e.onResponse((function(e){e&&e.config&&!1===e.config.progress||--r<=0&&(r=0,n().finish())})),e.onError((function(e){e&&e.config&&!1===e.config.progress||(r--,Jn.a.isCancel(e)||(n().fail(),n().finish()))}));var o=function(e){if(r){var progress=100*e.loaded/(e.total*r);n().set(Math.min(100,progress))}};e.defaults.onUploadProgress=o,e.defaults.onDownloadProgress=o},di=function(e,t){var n={baseURL:"https://api.madmagz.app",headers:{common:{Accept:"application/json, text/plain, */*"},delete:{},get:{},head:{},post:{},put:{},patch:{}}
1};n.headers.common=e.req&&e.req.headers?Object.assign({},e.req.headers):{},delete n.headers.common.accept,delete n.headers.common.host,delete n.headers.common["cf-ray"],delete n.headers.common["cf-connecting-ip"],delete n.headers.common["content-length"],delete n.headers.common["content-md5"],delete n.headers.common["content-type"];var r=si(n);e.$axios=r,t("axios",r)},pi=n(307),hi=(n(47),n(231));function fi(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function mi(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?fi(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):fi(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var gi,bi=!1,yi=!1,vi=null,_i=["ResizeObserver loop completed with undelivered notifications.","Script error."],Oi=["Loading CSS chunk","Loading chunk"],Ei=function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t,data){var n,r,o,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(vi&&vi>(new Date).getTime()-6e4)){e.next=2;break}return e.abrupt("return");case 2:if(n=!bi,r=data&&data.error&&data.error.message?data.error.message:"",o=mi({from:"Nuxt "+t+" : "+r,windowLocation:window.location.href,appIsLoaded:bi,pluginsIsLoaded:yi},data),vi=(new Date).getTime(),!gi){e.next=9;break}return e.next=7,gi.dispatch("api/API_SEND_ERROR",o);case 7:e.next=12;break;case 9:return l=hi.version||0,e.next=12,fetch("https://api.madmagz.app/api/v1/users/sendError",{method:"post",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(mi({},o,{appVersion:l}))});case 12:n&&(c="An error occurred while loading external dependencies. Please try again later or contact us.",r&&r.length>0&&(c+="\n("+r+")"),alert(c));case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();l.default.config.errorHandler=function(e,t,n){var r=e&&e.message?e.message.trim():"";if(_i.findIndex((function(e){return r.indexOf(e)>=0}))>=0)console.warn("APP DEBUGGER ignore vue error",{error:e,vm:t,info:n});else{if(Oi.findIndex((function(e){return r.indexOf(e)>=0}))>=0)return console.warn("APP DEBUGGER reload vue error",{error:e,vm:t,info:n}),void window.location.reload();console.error("APP DEBUGGER vue error",{error:e,vm:t,info:n}),Ei("VueErrorHandler",{error:e?{message:e.message,mzData:e.mzData,stack:e.stack}:null,info:n})}},window.onerror=function(e,t,line,col,n){if(_i.findIndex((function(t){return e.indexOf(t)>=0}))>=0)console.warn("APP DEBUGGER ignore window error",{msg:e,url:t,line:line,col:col,error:n});else{if(Oi.findIndex((function(t){return e.indexOf(t)>=0}))>=0)return console.warn("APP DEBUGGER reload window error",{msg:e,url:t,line:line,col:col,error:n}),void window.location.reload();console.error("APP DEBUGGER window error",{msg:e,url:t,line:line,col:col,error:n}),Ei("WindowError",{msg:e,error:n?{message:n.message,mzData:n.mzData,stack:n.stack}:null,file:{url:t,line:line,col:col}})}};var ki=function(e){e.app;var t=e.store;yi=!0,gi=t,setTimeout((function(){bi=!0}),1e3)},Si=n(511),Ai=function(e,t){var n,r=e.store,o=!1,l=!1;try{localStorage?(localStorage.setItem("mztestenable",!0),localStorage.getItem("mztestenable")&&(localStorage.removeItem("mztestenable"),o=!0)):console.warn("LocalStorage localStorage is undefined ",localStorage)}catch(e){console.error("LocalStorage access error",e),o=!1}try{Mn?(Mn.set("mztestenable",!0,{expires:365,secure:!0}),Mn.get("mztestenable")&&(Mn.remove("mztestenable"),l=!0)):console.warn("LocalStorage Cookies is undefined ",Mn)}catch(e){console.error("LocalStorage cookies access error",e),l=!1}if(console.log("LocalStorage - has local storage access "+o),console.log("LocalStorage - has cookies access "+l),o?n={storageIsDisabled:!1,getItem:function(e){return localStorage.getItem(e)},setItem:function(e,t){return localStorage.setItem(e,t)},removeItem:function(e){return localStorage.removeItem(e)}}:l?(console.warn("LocalStorage - not enable, use cookies in env production"),n={storageIsDisabled:!1,getItem:function(e){return Mn.get(e)},setItem:function(e,t){return Mn.set(e,t,{expires:365,secure:!0})},removeItem:function(e){return Mn.remove(e)}}):(console.warn("LocalStorage - not enable, and cookies not enable - set storage in disabled mode"),n={storageIsDisabled:!0,getItem:function(e){return null},setItem:function(e,t){return null},removeItem:function(e){return null}}),o)try{Object(Si.a)({key:"madmagz-athena",paths:["app","api","fabric"]})(r)}catch(e){console.error("Unable to create persisted state",e)}t("mzLocalStorage",n)},Ti=new l.default,Pi={install:function(e){e.prototype.$bus=Ti}};l.default.use(Pi);var Ci=function(e,t){t("bus",Ti)},xi=(n(185),function(e){var t=e.$axios,n=e.redirect,o=e.store,l=e.app,c=["/api/v1/users/token","/api/v1/users/login","/api/v1/users","/api/v1/users/forgot"],d=["/api/v1/users/active","/api/v1/users/logout"],h=function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("AXIOS DEBUG refreshTokenAndRetry for request ",t),t.isRetry){e.next=9;break}return e.next=4,o.dispatch("api/API_CHECK");case 4:if(!(r=e.sent)){e.next=9;break}return t.headers.Authorization="Token "+r,t.isRetry=!0,e.abrupt("return",t);case 9:return e.next=11,o.dispatch("api/API_LOGOUT",{debugSaveFrom:"Axios received invali
1d API CHECK"});case 11:return-1===d.indexOf(t.url)&&(console.log("AXIOS DEBUG redirect to login"),n("/login")),e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();o.getters["api/getToken"]&&t.setToken(o.getters["api/getToken"],"Token"),t.interceptors.request.use(function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,path;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.headers["mz-lang"]=l.i18n.locale,o.getters["app/forceMaintenanceAccess"]&&(t.headers["force-maintenance-access"]=!0),"get"!==t.method&&(n=l&&l.$socket?l.$socket.getConnectionId():void 0)&&(t.headers["socket-connection"]=n),"/api/v1/users/token"!==(path=t.url.split("?").shift())&&-1==c.indexOf(path)){e.next=6;break}return e.abrupt("return",t);case 6:return-1===d.indexOf(path)&&l.$bus.$emit("user_is_active"),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("ERROR AXIOS",t),e.abrupt("return",Promise.reject(t));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.interceptors.response.use(function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.headers&&(o.commit("app/UPDATE_SETTINGS",{key:"maintenanceMode",value:"active"==t.headers["maintenance-mode"]}),o.commit("app/UPDATE_SETTINGS",{key:"publicMessage",value:t.headers["public-message"]}),o.commit("app/UPDATE_SETTINGS",{key:"publicMessageClosable",value:"true"==t.headers["public-message-closable"]})),!(t&&t.headers&&"get"==t.config.method&&t.headers["needed-app-build"])){e.next=11;break}n=t.headers["needed-app-build"].split("."),r=o.getters["app/appBuild"].split("."),i=0;case 4:if(!(i<n.length)){e.next=11;break}if(parseInt(n[i])>parseInt(r[i])&&window.location.reload(),!(parseInt(n[i])<parseInt(r[i]))){e.next=8;break}return e.abrupt("break",11);case 8:i++,e.next=4;break;case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(r){var l,c,d,f,m,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r.config,(c=r.response)&&c.headers&&(o.commit("app/UPDATE_SETTINGS",{key:"maintenanceMode",value:"active"==c.headers["maintenance-mode"]}),o.commit("app/UPDATE_SETTINGS",{key:"publicMessage",value:c.headers["public-message"]}),o.commit("app/UPDATE_SETTINGS",{key:"publicMessageClosable",value:"true"==c.headers["public-message-closable"]})),!c||503!==c.status){e.next=5;break}return n("/maintenance"),e.abrupt("return",Promise.reject(c.data));case 5:if(!(c&&401===c.status&&c.data&&c.data.error&&0===c.data.error.indexOf("UnauthorizedError"))){e.next=21;break}if(d=o.getters["api/isLogged"],f="UnauthorizedError: jwt expired"==c.data.error,m="UnauthorizedError: The token has been revoked."==c.data.error,console.log("AXIOS DEBUG response received UnauthorizedError "+JSON.stringify({isLogged:d,tokenExpired:f,tokenIsRevoked:m})),!d){e.next=21;break}if(!f&&!m){e.next=21;break}return e.next=14,h(l);case 14:if(!(y=e.sent)){e.next=19;break}return e.abrupt("return",t(y));case 19:return console.log("AXIOS DEBUG response rejected"),e.abrupt("return",Promise.reject(r));case 21:return e.abrupt("return",Promise.reject(r));case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),Di=function(e){var t=e.app,n=(e.redirect,e.store),r=(e.route,t.$mzLocalStorage.getItem("mzlastsession")),o=t.$mzLocalStorage.getItem("mzkeeplogin"),l=!r||r<(new Date).getTime()-3e5;(console.log("session check lastSession",r?new Date(parseInt(r)):null),console.log("session check lastSessionIsOut",l),console.log("session check keepLogin",o),o||!l)?n.dispatch("api/RELOAD_CURRENT_SESSION_USER").then((function(e){e&&n.dispatch("api/API_SESSION_ACTIVE",!0)})):n.getters["api/isLogged"]&&n.dispatch("api/API_LOGOUT",{debugSaveFrom:"Session Check last session is out"});var c=setInterval((function(){t.$mzLocalStorage.setItem("mzlastsession",(new Date).getTime()),n.getters["api/isLogged"]&&n.dispatch("api/API_SESSION_ACTIVE",!0)}),6e4);window.addEventListener("beforeunload",(function(e){c&&(clearInterval(c),c=null),n.dispatch("api/API_SESSION_ACTIVE",!1)}),!1)},Ii=n(40);l.default.filter("px2mm",(function(e,t){return e?(Object(Ii.a)(e)===String&&(e=parseFloat(e)),Qt.a.convertPixelToMilimeters(e,t)):0})),l.default.filter("mm2px",(function(e,t){return e?(Object(Ii.a)(e)===String&&(e=parseFloat(e)),Qt.a.convertMilimetersToPixels(e,t)):0})),l.default.filter("round",(function(e,t){return e||(e=0),t||(t=0),e=Math.round(e*Math.pow(10,t))/Math.pow(10,t)}));var wi,Ri,zi,Li=n(0),ji=n(12);function Mi(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Ui(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?Mi(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Mi(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}Li.fabric.history={MAX_STACK_LENGTH:20,canvas:null,done:[],undone:[],paused:!1,isApplyingAction:!1,_transformStartByObjectId:{},state:l.default.observable({canUndo:!1,canRedo:!1}),init:function(canvas){this.isInitialized()||(this.canvas=canvas,this.paused=!1,this.beforeTransformHandler=this.beforeTransformHandler.bind(this),this.objectTransformHandler=this.objectTransformHandler.bind(this),this.objectAddedHandler=this.objectAddedHandler.bind(this),this.objectRemovedHandler=this.objectRemovedHandler.bind(this),this.initListeners())},kill:function(){this.isInitialized()&&(this.done=[],this.undone=[],this.isApplyingAction=!1,this._transformStartByObjectId={},this.updateState(),this.removeListeners(),this.canvas=null)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},isInitialized:function(){return null!==this.canvas},initListeners:function(){this.isInitialized()&&(this.removeListeners(),this.canvas.on("before:transform",this.beforeTransformHandler),this.canvas.on("object:modified",this.objectTransformHandler),this.canvas.on("object:reordered",this.objectTransformHandler),this.canvas.on("object:added",this.objectAddedHandler),this.canvas.on("object:removed",this.objectRemovedHandler))},removeListeners:function(){this.isInitialized()&&(this.canvas.off("before:transform",this.beforeTransformHandler),this.canvas.off("object:modified",this.objectTransformHandler),this.canvas.off("object:reordered",this.objectTransformHandler),this.canvas.off("object:added",this.objectAddedHandler),this.canvas.off("object:removed",this.objectRemovedHandler))},canUndo:function(){return this.state.canUndo},canRedo:function(){return this.state.canRedo},updateState:function(){this.state.canUndo=this.done.length>0,this.state.canRedo=this.undone.length>0},getCanvasOrder:function(){return this.canvas.getObjects().map((function(object){return object.id}))},applyCanvasOrder:function(e){if(!Array.isArray(e)||0===e.length)return!1;for(var i=0;i<e.length;i++){var t=e[i],object=this.canvas.getObjectById(t);object&&this.canvas.moveTo(object,i)}return!0},undo:(zi=Object(r.a)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isApplyingAction){e.next=2;break}return e.abrupt("return",!1);case 2:if(this.done.length){e.next=5;break}return console.log("fabric history cannot undo"),e.abrupt("return",!1);case 5:return this.isApplyingAction=!0,t=this.done.pop(),n=this.paused,this.pause(),e.next=11,this.applyAction(t);case 11:return(r=e.sent)?this.addRedo(r):this.updateState(),this.isApplyingAction=!1,n||this.resume(),e.abrupt("return",!!r);case 16:case"end":return e.stop()}}),e,this)}))),function(){return zi.apply(this,arguments)}),redo:(Ri=Object(r.a)(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isApplyingAction){e.next=2;break}return e.abrupt("return",!1);case 2:if(this.undone.length){e.next=5;break}return console.log("fabric history cannot redo"),e.abrupt("return",!1);case 5:return this.isApplyingAction=!0,t=this.undone.pop(),n=this.paused,this.pause(),e.next=11,this.applyAction(t);case 11:if(r=e.sent,n||this.resume(),!r){e.next=17;break}return this.addUndo(r),this.isApplyingAction=!1,e.abrupt("return",!0);case 17:return this.updateState(),this.isApplyingAction=!1,e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e,this)}))),function(){return Ri.apply(this,arguments)}),applyAction:(wi=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r,o,l,c,d,h,f,m,y,v,_,O,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,!t.callbackAction){e.next=6;break}return e.next=4,t.callbackAction(t);case 4:return n=e.sent,e.abrupt("return",n);case 6:if("added"!==t.action){e.next=15;break}if(r=this.canvas.getObjectById(t.id)){e.next=10;break}return e.abrupt("return",null);case 10:return o=this.canvas.getObjects().indexOf(r),this.canvas.remove(r),n={id:t.id,action:"removed",transform:{__index:o,object:r}},this.canvas.requestRenderAll(),e.abrupt("return",n);case 15:if("removed"!==t.action){e.next=24;break}if(t.transform&&t.transform.__index&&t.transform.object){e.next=18;break}return e.abrupt("return",null);case 18:return l=t.transform.object,this.canvas.insertAt(l,t.transform.__index),n={id:t.id,action:"added",transform:{__index:this.canvas.getObjects().indexOf(l),object:l}},l.setCoords(),this.canvas.requestRenderAll(),e.abrupt("return",n);case 24:if("reorder"!==t.action){e.next=32;break}if(t.transform&&t.transform.__order){e.next=27;break}return e.abrupt("return",null);case 27:return c=this.getCanvasOrder(),this.applyCanvasOrder(t.transform.__order),n={id:t.id,action:"reorder",transform:{__order:c}},this.canvas.requestRenderAll(),e.abrupt("return",n);case 32:if("updatedSvg"!==t.action){e.next=40;break}if((d=this.canvas.getObjectById(t.id))&&"MzShapeGroup"===d.type&&t.transform&&t.transform.sourcePath&&t.transform.opacity){e.
1next=36;break}return e.abrupt("return",null);case 36:return n={id:t.id,action:"updatedSvg",transform:{sourcePath:d.sourcePath,opacity:d.opacity}},e.next=39,d.updateFromSvgUrl(t.transform.sourcePath,t.transform.opacity);case 39:return e.abrupt("return",n);case 40:if("updatedImage"!==t.action){e.next=48;break}if((h=this.canvas.getObjectById(t.id))&&"MzImage"===h.type&&t.transform&&t.transform.src){e.next=44;break}return e.abrupt("return",null);case 44:return n={id:t.id,action:"updatedImage",transform:h.getImageUpdateData()},e.next=47,h.applyImageUpdateData(t.transform);case 47:return e.abrupt("return",n);case 48:if("toogleHide"!==t.action){e.next=55;break}if((f=this.canvas.getObjectById(t.id))&&"MzTextbox"===f.type){e.next=52;break}return e.abrupt("return",null);case 52:return n={id:t.id,action:"toogleHide",transform:{opacity:f.opacity,selectable:f.selectable,evented:f.evented}},f.toogleHide(),e.abrupt("return",n);case 55:if("overrideStyle"!==t.action){e.next=62;break}if((m=this.canvas.getObjectById(t.id))&&"MzTextbox"===m.type){e.next=59;break}return e.abrupt("return",null);case 59:if(n={id:t.id,action:"overrideStyle",transform:{overrideStyle:m.overrideStyle?Ui({},m.overrideStyle):null}},t.transform.overrideStyle)for(y in t.transform.overrideStyle)m.applyOverrideStyle(y,t.transform.overrideStyle[y]);else m.removeOverrideStyle();return e.abrupt("return",n);case 62:if("styledText"!==t.action){e.next=69;break}if((v=this.canvas.getObjectById(t.id))&&"MzTextbox"===v.type){e.next=66;break}return e.abrupt("return",null);case 66:return n={id:t.id,action:"styledText",transform:{text:v.text,flatStyle:v.flatStyle,htmlText:v.htmlText}},v.setStyledText(t.transform),e.abrupt("return",n);case 69:if(_=this.canvas.getObjectById(t.id)){e.next=72;break}return e.abrupt("return",null);case 72:for(E in O={},t.transform)O[E]=ji.a.getProperty(E,_),ji.a.setProperty(E,_,t.transform[E],!0);return n={id:t.id,action:t.action,transform:O},_.setCoords(),this.canvas.requestRenderAll(),e.abrupt("return",n);case 78:case"end":return e.stop()}}),e,this)}))),function(e){return wi.apply(this,arguments)}),addRedo:function(e){this.undone.push(e),this.undone.length>=this.MAX_STACK_LENGTH&&this.undone.shift(),this.updateState()},addUndo:function(e){this.done.push(e),this.done.length>=this.MAX_STACK_LENGTH&&this.done.shift(),this.updateState()},getTransformSnapshot:function(e){return e?{left:e.left,top:e.top,angle:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,width:e.width,height:e.height,skewX:e.skewX,skewY:e.skewY}:null},beforeTransformHandler:function(e){if(!this.paused&&e&&e.transform&&e.transform.target&&e.transform.target.id){var t=e.transform.target.id;this._transformStartByObjectId[t]=Ui({},this.getTransformSnapshot(e.transform.target))}},objectTransformHandler:function(e){if(!this.paused&&e&&e.target&&e.transform&&e.transform.action){var t=null;switch(e.transform.action){case"drag":case"rotate":case"scale":case"scaleY":case"scaleX":case"skewY":case"skewX":t=this._transformStartByObjectId[e.target.id]||null;break;case"modified":case"reorder":case"updatedSvg":case"updatedImage":case"toogleHide":case"overrideStyle":case"styledText":t=e.transform.original||null}t?(this.addUndo({id:e.target.id,action:e.transform.action,transform:t}),delete this._transformStartByObjectId[e.target.id]):console.warn("fabric history objectTransformHandler unknown action ",e)}},objectAddedHandler:function(e){this.paused||this.addUndo({id:e.target.id,action:"added",transform:{__index:this.canvas.getObjects().indexOf(e.target),object:e.target}})},objectRemovedHandler:function(e){if(!this.paused){var t="number"==typeof e.target.__historyIndexBeforeRemove?e.target.__historyIndexBeforeRemove:this.canvas.getObjects().length;delete e.target.__historyIndexBeforeRemove,this.addUndo({id:e.target.id,action:"removed",transform:{__index:t,object:e.target}})}}};var Fi=function(e,t){var n=e.app;t("go2Route",(function(e){if("_blank"===e.target){delete e.target;var t=e.url?e.url:"https://madmagz.app"+n.localePath(e);window.open(t,"_blank")}else n.router.push(n.localePath(e))}))},Ni=(n(655),n(304)),$i=n.n(Ni),Bi=n(123),Gi=n.n(Bi),Hi=n(17),Vi=function(){Gi.a.use($i.a),l.default.use(Hi.Pagination),l.default.use(Hi.Dialog),l.default.use(Hi.Autocomplete),l.default.use(Hi.Dropdown),l.default.use(Hi.DropdownMenu),l.default.use(Hi.DropdownItem),l.default.use(Hi.Menu),l.default.use(Hi.Submenu),l.default.use(Hi.MenuItem),l.default.use(Hi.MenuItemGroup),l.default.use(Hi.Input),l.default.use(Hi.InputNumber),l.default.use(Hi.Radio),l.default.use(Hi.RadioGroup),l.default.use(Hi.RadioButton),l.default.use(Hi.Checkbox),l.default.use(Hi.CheckboxButton),l.default.use(Hi.CheckboxGroup),l.default.use(Hi.Switch),l.default.use(Hi.Select),l.default.use(Hi.Option),l.default.use(Hi.OptionGroup),l.default.use(Hi.Button),l.default.use(Hi.ButtonGroup),l.default.use(Hi.Table),l.default.use(Hi.TableColumn),l.default.use(Hi.DatePicker),l.default.use(Hi.Popover),l.default.use(Hi.Tooltip),l.default.use(Hi.Form),l.default.use(Hi.FormItem),l.default.use(Hi.Tabs),l.default.use(Hi.TabPane),l.default.use(Hi.Tag),l.default.use(Hi.Tree),l.default.use(Hi.Alert),l.default.use(Hi.Slider),l.default.use(Hi.Icon),l.default.use(Hi.Row),l.default.use(Hi.C
1ol),l.default.use(Hi.Upload),l.default.use(Hi.Progress),l.default.use(Hi.Spinner),l.default.use(Hi.Badge),l.default.use(Hi.Card),l.default.use(Hi.Steps),l.default.use(Hi.Step),l.default.use(Hi.Carousel),l.default.use(Hi.CarouselItem),l.default.use(Hi.Collapse),l.default.use(Hi.CollapseItem),l.default.use(Hi.Cascader),l.default.use(Hi.Transfer),l.default.use(Hi.Container),l.default.use(Hi.Header),l.default.use(Hi.Aside),l.default.use(Hi.Main),l.default.use(Hi.Footer),l.default.use(Hi.Link),l.default.use(Hi.Divider),l.default.use(Hi.Image),l.default.use(Hi.Loading.directive),l.default.prototype.$loading=Hi.Loading.service,l.default.prototype.$msgbox=Hi.MessageBox,l.default.prototype.$alert=Hi.MessageBox.alert,l.default.prototype.$confirm=Hi.MessageBox.confirm,l.default.prototype.$prompt=Hi.MessageBox.prompt,l.default.prototype.$notify=Hi.Notification,l.default.prototype.$message=function(e){return"string"==typeof e&&(e={message:e}),void 0===e.duration&&(e.duration=1e4),void 0===e.showClose&&(e.showClose=!0),!!e.message&&(("string"!=typeof e.message||0!==e.message.trim().length)&&Object(Hi.Message)(e))},l.default.prototype.$messageError=function(e){return"string"==typeof e?e={message:e,type:"error"}:void 0===e.type&&(e.type="error"),l.default.prototype.$message(e)},l.default.prototype.$messageWarning=function(e){return"string"==typeof e?e={message:e,type:"warning"}:void 0===e.type&&(e.type="warning"),l.default.prototype.$message(e)},l.default.prototype.$messageInfo=function(e){return"string"==typeof e?e={message:e,type:"info"}:void 0===e.type&&(e.type="info"),l.default.prototype.$message(e)},l.default.prototype.$messageSuccess=function(e){return"string"==typeof e?e={message:e,type:"success"}:void 0===e.type&&(e.type="success"),l.default.prototype.$message(e)}},Wi=n(512),Ki=(n(714),function(){l.default.use(Wi.a)}),Yi=n(514),Zi=n.n(Yi),Xi=function(){l.default.use(Zi.a)},qi=n(129),Ji=n(130),Qi=n(131),er=n(67),ar=n(132),nr=n(133),ir=(n(716),n(717),n(100)),rr=n.n(ir),or=n(38),sr=n.n(or),lr=(n(718),n(515));sr.a.register("modules/mention",lr.a);var cr={theme:!1,modules:{toolbar:!1,clipboard:{matchVisual:!1},keyboard:{bindings:{enter:{key:13,handler:function(e,t){return t.format={},!0}}}}}},ur={h1:{className:"fabric-style-h1"},h2:{className:"fabric-style-h2"},h3:{className:"fabric-style-h3"},h4:{className:"fabric-style-h4"},h5:{className:"fabric-style-h5"},h6:{className:"fabric-style-h6"},h7:{className:"fabric-style-h7"},span:{className:"fabric-style-span"}},dr={bullet_1:"â¢",bullet_2:"â¦",bullet_3:"âª",bullet_4:"â«",bullet_5:"â¸",bullet_6:"â¹"},pr=sr.a.import("blots/inline"),fr=sr.a.import("parchment"),mr=function(e){function t(){return Object(qi.a)(this,t),Object(Qi.a)(this,Object(er.a)(t).apply(this,arguments))}return Object(nr.a)(t,e),Object(Ji.a)(t,null,[{key:"create",value:function(e){var n=Object(ar.a)(Object(er.a)(t),"create",this).call(this);ur[e.htmlTag]||(e.htmlTag="span");var r=[e.htmlTag,ur[e.htmlTag].className];return e.key&&"null"!==e.key&&"undefined"!==e.key&&(n.setAttribute("fabric-key-style",e.key),r.push("fabric-style-"+e.key)),n.className=r.join(" "),n}},{key:"formats",value:function(e){return{htmlTag:e.className,key:e.getAttribute("fabric-key-style")}}}]),t}(pr);mr.blotName="fabricStyle",mr.tagName="span",sr.a.register(mr);var gr=function(e){function t(){return Object(qi.a)(this,t),Object(Qi.a)(this,Object(er.a)(t).apply(this,arguments))}return Object(nr.a)(t,e),Object(Ji.a)(t,null,[{key:"create",value:function(e){var n=Object(ar.a)(Object(er.a)(t),"create",this).call(this);return n.className="overflowText",n}},{key:"formats",value:function(e){return e.className}}]),t}(pr);gr.blotName="overflowBackground",gr.tagName="overflowSpan",sr.a.register(gr);var yr=function(e){function t(){return Object(qi.a)(this,t),Object(Qi.a)(this,Object(er.a)(t).apply(this,arguments))}return Object(nr.a)(t,e),Object(Ji.a)(t,null,[{key:"create",value:function(e){var n=Object(ar.a)(Object(er.a)(t),"create",this).call(this);return"string"!=typeof e?(n.setAttribute("href",e.href),n.setAttribute("title",e.title),e.target&&n.setAttribute("target",e.target)):(n.setAttribute("href",e),n.setAttribute("title",e),n.setAttribute("target",0===e.indexOf("#")?"_self":"_blank")),n}},{key:"formats",value:function(e){var t={href:e.getAttribute("href"),title:e.getAttribute("title"),target:e.getAttribute("target")};if(rr.a&&rr.a.store&&rr.a.store.getters["magazine/pageNameMap"]&&0===t.href.indexOf("#page_")){var n=t.href.substr(6);rr.a.store.getters["magazine/pageNameMap"][n]&&(t.title=rr.a.store.getters["magazine/pageNameMap"][n]),t.target="_self"}return t.title&&0!==t.title.length||(t.title=t.href),t}}]),t}(pr);yr.blotName="link",yr.tagName="a",sr.a.register(yr);var vr=new fr.Attributor.Style("fontSize","font-size",{scope:fr.Scope.INLINE});sr.a.register(vr,!0);var _r=new fr.Attributor.Style("fontFamily","font-family",{scope:fr.Scope.INLINE});sr.a.register(_r,!0);var Or=new fr.Attributor.Style("textAlign","text-align",{scope:fr.Scope.BLOCK,whitelist:["left","right","center","justify"]});sr.a.register(Or,!0);var Er=new fr.Attributor.Style("lineHeight","line-height",{scope:fr.Scope.BLOCK,whitelist:["1","1.25","1.5","2"]});sr.a.register(Er,!0),pr.order=["cursor","inline","underline","strike","italic","bold","script","fabricStyle","link","overflowBackgroun
1d","code"];var kr=sr.a.import("modules/clipboard"),Sr=sr.a.import("delta"),Ar=function(e){function t(){return Object(qi.a)(this,t),Object(Qi.a)(this,Object(er.a)(t).apply(this,arguments))}return Object(nr.a)(t,e),Object(Ji.a)(t,[{key:"onPaste",value:function(e){e.preventDefault();for(var t=this.quill.getSelection(),text=e.clipboardData.getData("text/plain").replace(/\n\n/g,"\n"),n="",r={56814:97,56788:65,56398:97,56372:65,56346:97,56320:65,56450:97,56424:65,56866:97,56840:65,56918:97,56892:65,56710:97,56684:65,56554:97,56528:65,56658:97,56632:65,56502:97,56476:65},o=Object.keys(r).map((function(e){return parseInt(e)})).sort().reverse(),i=0;i<text.length;i++){var l=text.charCodeAt(i);if(55349===l){var c=text.charCodeAt(i+1),d=!0,h=!1,f=void 0;try{for(var m,y=o[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var code=m.value;if(c>=code){n+=String.fromCharCode(c-(code-r[code]));break}}}catch(e){h=!0,f=e}finally{try{d||null==y.return||y.return()}finally{if(h)throw f}}i++}else n+=String.fromCharCode(l)}var v=(new Sr).retain(t.index).delete(t.length).insert(n);this.quill.updateContents(v,sr.a.sources.USER),this.quill.setSelection(v.length()-t.length,sr.a.sources.SILENT),this.quill.scrollIntoView()}}]),t}(kr);sr.a.register("modules/clipboard",Ar,!0);var Tr=function(e){function t(){return Object(qi.a)(this,t),Object(Qi.a)(this,Object(er.a)(t).apply(this,arguments))}return Object(nr.a)(t,e),Object(Ji.a)(t,null,[{key:"create",value:function(e){var n=Object(ar.a)(Object(er.a)(t),"create",this).call(this,e);return dr[e]&&(n.className="fabric-list-style-"+e),n}},{key:"formats",value:function(e){if(e.className&&0===e.className.indexOf("fabric-list-style-")){var n=e.className.substr("fabric-list-style-".length);if(dr[n])return n}return Object(ar.a)(Object(er.a)(t),"formats",this).call(this,e)}}]),t}(sr.a.import("formats/list"));sr.a.register(Tr,!0);var Pr=function(e){var t=e.store;l.default.use(rr.a,cr),l.default.prototype.$fabricStyleBlotTag=Object.keys(ur),l.default.prototype.$fabricStyleBlotList=dr,rr.a.store=t},Cr=n(516),xr=n.n(Cr),Dr=n(5);n(279),n(280),l.default.use(xr.a,{moment:Dr});var Ir=function(e){var t=e.app;Dr.locale(t.i18n.locale)};l.default.prototype.$fabric=Li.fabric;var wr=n(517),Rr=n.n(wr);function zr(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Lr=["Abril Fatface","Amatic SC","Anton","Barlow","Bebas Neue","Bitter","Cinzel","Cormorant Garamond","Crimson Text","Dancing Script","Fjalla One","Josefin Slab","Lato","Libre Baskerville","Livvic","Lora","Merriweather","Montserrat","Noto Sans","Open Sans","Oswald","Pacifico","Playfair Display","Poppins","PT Serif","Raleway","Roboto","Source Sans Pro","Ubuntu","Work Sans"].map((function(e){return{name:e,provider:"google"}}));function jr(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Mr(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?jr(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):jr(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}l.default.prototype.$fontManager={loadedFonts:[],defaultFonts:[].concat(Object(tt.a)(Lr),[{name:"Open Dyslexic",url:"fonts/default/OpenDyslexic/OpenDyslexic.css",provider:"custom"},{name:"Slabo",url:"fonts/default/Slabo/Slabo.css",provider:"custom"}]),parseFontList:function(e){for(var t={},i=0;i<e.length;i++)if(e[i].name&&!this.loadedFonts.includes(e[i].name)){var n="";switch("custom"!==e[i].provider&&(e[i].styles&&e[i].styles.length>0&&(n+=":"+e[i].styles.join(",")),e[i].subsets&&e[i].subsets.length>0&&(n+=":"+e[i].subsets.join(","))),e[i].provider){case"typekit":t.typekit?t.typekit.id+=";"+e[i].name+n:t.typekit={id:e[i].id+n,api:"//use.edgefonts.net"};break;
1case"custom":var r=e[i].url,o=r.indexOf("amazonaws.com/");r=o>=0?"https://mz-media-data-production.s3.eu-west-1.amazonaws.com/"+r.substr(o+14):"https://mz-media-data-production.s3.eu-west-1.amazonaws.com/"+r,t.custom?(t.custom.families.push(e[i].name+n),t.custom.urls.push(r)):t.custom={families:[e[i].name+n],urls:[r]};break;case"google":default:t.google?t.google.families.push(e[i].name+n):t.google={families:[e[i].name+n]}}}return t},loadFontList:function(e){var t=this,n=[].concat(Object(tt.a)(this.defaultFonts),Object(tt.a)(e)).filter((function(e){return e.name&&!t.loadedFonts.includes(e.name)}));console.log("FontManager - loadFontList",n);var r=this.parseFontList(n);if(0===Object.keys(r).length&&r.constructor===Object)return Promise.resolve();var l=n.map((function(e){return e.name}));return new Promise((function(e,n){Rr.a.load(function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?zr(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):zr(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},r,{classes:!1,active:function(n){var r;(r=t.loadedFonts).push.apply(r,Object(tt.a)(l)),console.log("FontManager - fonts is loaded",l,n),e(l)},inactive:function(e){console.log("FontManager - error loading font",e),n()}}))}))}};var Ur=function(){Li.fabric.canvas=null,Li.fabric.page=null,Li.fabric.textStylesList={},Object.defineProperty(Li.fabric,"hasCanvas",{get:function(){return Boolean(this.canvas)}}),Object.defineProperty(Li.fabric,"activeObject",{get:function(){return this.canvas?this.canvas.getActiveObject():null}}),Li.fabric.createCanvas=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.canvas?this.canvas.clear():this.canvas=new Li.fabric.MzCanvas(e,Mr({width:t,height:n,backgroundColor:"#ffffff"},r))},Li.fabric.createPage=function(e){this.canvas?(Li.fabric.Object.__uid=parseInt(parseInt(Date.now()/1e3)+""+parseInt(10+980*Math.random())+"000"),this.page=new Li.fabric.MzPage(this.canvas,e),this.page.drawPage(e),this.canvas.maxScrollY=e.pageRect.height+20,this.canvas.maxScrollX=e.pageRect.width+20):console.warn("Invalid create page, canvas is not instantiate")},Li.fabric.getPositionInPage=function(){var object=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null===object&&(object=this.canvas.getActiveObject()),object)return{top:this.object.top-this.page.printMarginRect.top,left:this.object.left-this.page.printMarginRect.left}},Li.fabric.objectControlAction=function(e){var t=this,object=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===object&&(object=this.canvas.getActiveObject()),object){if("remove"===e&&("activeSelection"===object.type&&object.forEachObject((function(e){t.objectControlAction("remove",e)})),this.canvas.discardActiveObject()),object.group&&"remove"===e){var n=object.group,r=object.group[e](object);return this.refresh(n),r}return this.canvas[e](object)}},Li.fabric.callObjectFunction=function(e,t){var n=this,object=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];null===object&&(object=this.canvas.getActiveObject()),object&&("activeSelection"===object.type&&r?object._objects.forEach((function(r){r[e](t),n.refresh(r)})):(object[e](t),this.refresh(object)))},Li.fabric.setObjectProp=function(e,t){var object=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null===object&&(object=this.canvas.getActiveObject()),object){if("activeSelection"!==object.type||object.hasOwnProperty(e)){var r=ji.a.getProperty(e,object);ji.a.setProperty(e,object,t,n),this.canvas.fire("object:modified",{target:object,transform:{action:"modified",original:Object(o.a)({},e,r)}})}else this.setMultipleObjectProp(e,t,object._objects,n);this.refresh(object)}},Li.fabric.setObjectProps=function(e){var object=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===object&&(object=this.canvas.getActiveObject()),object){var t={};e.forEach((function(e){t[e.key]=ji.a.getProperty(e.key,object),ji.a.setProperty(e.key,object,e.value,e.useSet)})),this.canvas.fire("object:modified",{target:object,transform:{action:"modified",original:Mr({},t)}}),this.refresh(object)}},Li.fabric.setMultipleObjectProp=function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null===n&&(n=this.canvas.getActiveObjects()),n.length<1||n.forEac
1h((function(object){r.setObjectProp(e,t,object,o),r.refresh(object)}))},Li.fabric.refresh=function(){var object=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.canvas&&(null===object&&(object=this.canvas.getActiveObject()),object&&(object.setCoords(),object.group&&(object.group.setCoords(),object.group.dirty=!0)),this.canvas.requestRenderAll())},Li.fabric.setTextStylesList=function(e){if(JSON.stringify(this.textStylesList)!==JSON.stringify(e)&&(this.textStylesList=e,this.canvas)){var t=this.canvas.getObjectsOfType("MzTextbox"),n=!0,r=!1,o=void 0;try{for(var l,c=t[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value,h=!1;d.textStyleKey&&(d.applyTextStyle(d.textStyleKey),h=!0),d.dropCapStyleKey&&(d.applyDropCapStyle(d.dropCapStyleKey),h=!0),d.bulletPointStyleKey&&(d.applyBulletPointStyle(d.bulletPointStyleKey),h=!0),d.textLinkStyleKey&&(d.applyTextLinkStyle(d.textLinkStyleKey),h=!0),d.endSignStyleKey&&(d.applyEndSignStyle(d.endSignStyleKey),h=!0),h&&this.refresh(d)}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}}},Li.fabric.getTextBoxStyle=function(){var object=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.canvas&&(null===object&&(object=this.canvas.getActiveObject()),object&&("activeSelection"===object.type&&(object=object._objects[0]),object&&"MzTextbox"==object.type)))return object.getTextBoxStyle(e)},Li.fabric.disposeCanvas=function(){this.canvas&&(this.canvas.dispose(),this.canvas=null)},Li.fabric.reorganizeStackReflow=function(){var e=this.canvas.getObjectsOfType("MzTextbox").filter((function(e){return e.isRootTextbox()})),t=!0,n=!1,r=void 0;try{for(var o,l=e[Symbol.iterator]();!(t=(o=l.next()).done);t=!0){o.value.updateReflowStackOrder()}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}},Li.fabric.updateStackReflowStyle=function(){var object=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.canvas&&(null===object&&(object=this.canvas.getActiveObject()),object&&"MzTextbox"===object.type&&object.hasReflow&&(object.setAsStyleForAllReflowStack(),this.refresh(object)))}},Fr=function(){Li.fabric.MzNonInteractiveGroup=Li.fabric.util.createClass(Li.fabric.Group,{type:"MzNonInteractiveGroup",topLayer:!1,backLayer:!1,initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.topLayer=t.topLayer||!1,this.backLayer=t.backLayer||!1,t.selectable=!1,t.evented=!1,t.hasControls=!1,t.hasBorders=!1,t.excludeFromExport=!0,this.callSuper("initialize",e,t,n)}}),Li.fabric.MzNonInteractiveGroup.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzNonInteractiveGroup",object,e)}},Nr=function(){Li.fabric.MzNonInteractiveRect=Li.fabric.util.createClass(Li.fabric.Rect,{type:"MzNonInteractiveRect",topLayer:!1,backLayer:!1,isSnappable:!1,initialize:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.topLayer=e.topLayer||!1,this.backLayer=e.backLayer||!1,this.isSnappable=e.isSnappable||!1,e.selectable=!1,e.evented=!1,e.hasControls=!1,e.hasBorders=!1,e.excludeFromExport=!0,this.callSuper("initialize",e)}}),Li.fabric.MzNonInteractiveRect.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzNonInteractiveRect",object,e)}},$r=function(){Li.fabric.MzNonInteractiveLine=Li.fabric.util.createClass(Li.fabric.Line,{type:"MzNonInteractiveLine",topLayer:!1,backLayer:!1,initialize:function(element){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.topLayer=e.topLayer||!1,this.backLayer=e.backLayer||!1,e.selectable=!1,e.evented=!1,e.hasControls=!1,e.hasBorders=!1,e.excludeFromExport=!0,this.callSuper("initialize",element,e)}}),Li.fabric.MzNonInteractiveLine.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzNonInteractiveLine",object,e)}};Li.fabric.Object.NUM_FRACTION_DIGITS=10;var Br={id:0,paletteSwatchName:{},toObjectProps:["id","paletteSwatchName","clientSideLocked","adminSideLocked"],locked:!1,clientSideLocked:!1,adminSideLocked:!1,initMzObject:function(e){return e||(e={}),e.strokeUniform=!1,e.lockScalingFlip=!0,this.id=e.id||Qt.a.uniqidplus(),this.paletteSwatchName=e.paletteSwatchName||{},this.locked=e.locked||!1,!0===e.readOnly?(this.locked=!0,this.selectable=!1,this.evented=!1):!0===e.locked&&("MzImage"===e.type||"MzTextbox"===e.type||"MzShapeGroup"===e.type&&e.variantGroup?(this.hasControls=!1,this.hasBorders=!1,this.perPixelTargetFind=!0,this.lockRotation=!0,this.lockScalingX=!0,this.lockScalingY=!0,this.lockMovementX=!0,this.lockMovementY=!0,this.hoverCurs
1or="pointer",this.editable=!1):"MzGroup"===e.type?(this.selectInsideGroup=!0,this.selectable=!1):(this.selectable=!1,this.evented=!1)),e},changeReadOnly:function(e){e?(this.adminSideLocked=!0,this.locked=!0,this.selectable=!1,this.evented=!1):(this.adminSideLocked=!1,this.locked=!1,this.selectable=!0,this.evented=!0)},toObject:function(e){var object=this.callSuper("toObject",this.toObjectProps.concat(e));return"MzImage"===this.type?this.formatToObjectResult(object):object}},Gr=function(){Li.fabric.MzRect=Li.fabric.util.createClass(Li.fabric.Rect,{type:"MzRect",initialize:function(e){Object.assign(this,Br),e=this.initMzObject(e),this.callSuper("initialize",e),this.initNoScale()},initNoScale:function(){var e=this;this.on({scaled:function(t){var n=e.width*e.scaleX,r=e.height*e.scaleY;e.set({height:r,width:n,scaleX:1,scaleY:1})}})}}),Li.fabric.MzRect.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzRect",object,e)}},Hr=function(){Li.fabric.MzCircle=Li.fabric.util.createClass(Li.fabric.Ellipse,{type:"MzCircle",initialize:function(e){Object.assign(this,Br),e=this.initMzObject(e),this.callSuper("initialize",e),this.initNoScale()},initNoScale:function(){var e=this;this.on({scaled:function(t){var n=e.width*e.scaleX,r=e.height*e.scaleY;e.set({rx:n/2,ry:r/2,scaleX:1,scaleY:1})}})},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.width=2*t;break;case"ry":this.ry=t,this.height=2*t;break;case"width":this.width=t,this.rx=t/2;break;case"height":this.height=t,this.ry=t/2}return this}}),Li.fabric.MzCircle.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzCircle",object,e)}},Vr=function(){Li.fabric.MzTriangle=Li.fabric.util.createClass(Li.fabric.Triangle,{type:"MzTriangle",initialize:function(e){Object.assign(this,Br),e=this.initMzObject(e),this.callSuper("initialize",e),this.initNoScale()},initNoScale:function(){var e=this;this.on({scaled:function(t){var n=e.width*e.scaleX,r=e.height*e.scaleY;e.set({height:r,width:n,scaleX:1,scaleY:1})}})}}),Li.fabric.MzTriangle.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzTriangle",object,e)}},Wr=function(){Li.fabric.MzLine=Li.fabric.util.createClass(Li.fabric.Line,{type:"MzLine",initialize:function(element,e){Object.assign(this,Br),e=this.initMzObject(e),this.callSuper("initialize",element,e)}}),Li.fabric.MzLine.fromElement=function(element,e,t){t=t||{};var n=Li.fabric.parseAttributes(element,Li.fabric.Line.ATTRIBUTE_NAMES),r=[n.x1||0,n.y1||0,n.x2||0,n.y2||0];e(new Li.fabric.MzLine(r,extend(n,t)))},Li.fabric.MzLine.fromObject=function(object,e){var t=Li.fabric.util.object.clone(object,!0);t.points=[object.x1,object.y1,object.x2,object.y2],Li.fabric.Object._fromObject("MzLine",t,(function(t){delete t.points,e&&e(t)}),"points")}};n(117);function Kr(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Yr(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Kr(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Kr(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Zr=function(){Li.fabric.MzImage=Li.fabric.util.createClass(Li.fabric.Image,{type:"MzImage",originalDefinitionData:null,originalClipPathData:null,link:"",_isFullTransparentCache:null,qualityStatus:-1,initialize:function(element,e){Object.assign(this,Br),e=this.initMzObject(e),this.toObjectProps.push("link","qualityStatus"),this.originalDefinitionData=e.originalDefinitionData||null,this.link=e.link||"",this.initLegend(e),this.callSuper("initialize",element,e),e.originalDefinitionData&&this.clipPath&&(this.originalClipPathData={left:this.clipPath.left,top:this.clipPath.top,scaleX:this.clipPath.scaleX,scaleY:this.clipPath.scaleY},this.updateImageBeforeChangeSrc(e.scaleX,e.scaleY,e.originalDefinitionData.scaleX,e.originalDefinitionData.scaleY))},activate:function(){this.activateLegend()},getOriginalSrc:function(e){return this.originalDefinitionData&&this.originalDefinitionData.src?this.originalDefinitionData.src:this.getSrc(e)},isFullTransparent:function(){if(null!==this._isFullTransparentCache)return this._isFullTransparentCache;if(!this._element)return!0;
1if(0===this.opacity)return!0;var canvas=document.createElement("canvas"),e=canvas.getContext("2d");canvas.width=this.width,canvas.height=this.height,e.drawImage(this._element,0,0);for(var t=!0,data=e.getImageData(0,0,canvas.width,canvas.height).data,i=3;i<data.length;i+=4)if(data[i]>0){t=!1;break}return this._isFullTransparentCache=t,t},isLowDefinitionDisplay:function(){return null!==this.originalDefinitionData},updateOriginalDefinitionData:function(e){if(this.originalClipPathData){var t=this.originalDefinitionData.scaleX/e.scaleX,n=this.originalDefinitionData.scaleY/e.scaleY;this.originalClipPathData.scaleX*=t,this.originalClipPathData.scaleY*=n,this.originalClipPathData.left*=t,this.originalClipPathData.top*=n}this.originalDefinitionData=Object.assign({},this.originalDefinitionData,e)},formatToObjectResult:function(object){if(this.isLowDefinitionDisplay()){if(Math.round(object.scaleX*object.width*1e3)!==Math.round(this.originalDefinitionData.scaleX*this.originalDefinitionData.width*1e3)||Math.round(object.scaleY*object.height*1e3)!==Math.round(this.originalDefinitionData.scaleY*this.originalDefinitionData.height*1e3)){var e=Math.min(this.originalDefinitionData.scaleX,this.originalDefinitionData.scaleY);this.updateOriginalDefinitionData({scaleX:object.scaleX*e,scaleY:object.scaleY*e,width:object.width/e,height:object.height/e}),this.qualityStatus=0}var t=null;if(object.clipPath){var n=object.scaleX/this.originalDefinitionData.scaleX,r=object.scaleY/this.originalDefinitionData.scaleY;t=Object.assign({},object.clipPath,{left:this.clipPath.left*n,top:this.clipPath.top*r,scaleX:this.clipPath.scaleX*n,scaleY:this.clipPath.scaleY*r})}else this.originalClipPathData&&(t=this.originalClipPathData);return Object.assign({},object,this.originalDefinitionData,t?{clipPath:t}:{})}return object},updateImageBeforeChangeSrc:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(null===n&&(n=this.scaleX),null===r&&(r=this.scaleY),this.clipPath){var o=n/e,l=r/t;this.clipPath.scaleX*=o,this.clipPath.scaleY*=l,this.clipPath.left*=o,this.clipPath.top*=l}this.set("scaleX",e),this.set("scaleY",t),this.set("cropX",0),this.set("cropY",0)},getImageUpdateData:function(){var e=this.getOriginalSrc(),t=this.originalDefinitionData?JSON.parse(JSON.stringify(this.originalDefinitionData)):null;return t&&!t.src&&e&&(t.src=e),{src:this.getSrc(),originalSrc:e,width:this.width,height:this.height,scaleX:this.scaleX,scaleY:this.scaleY,qualityStatus:this.qualityStatus,originalDefinitionData:t,link:this.link}},applyImageUpdateData:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n||(n=this.getImageUpdateData()),new Promise((function(r,o){t.updateImageBeforeChangeSrc(e.scaleX,e.scaleY),t.setSrc(e.src,(function(l){if(l&&l._element){l.set("dirty",!0),l.set("width",e.width),l.set("height",e.height),l.set("qualityStatus",e.qualityStatus),l.set("link",e.link);var c=e.originalDefinitionData?JSON.parse(JSON.stringify(e.originalDefinitionData)):null;c&&e.originalSrc&&(c.src=e.originalSrc),l.originalDefinitionData=c,l.setCoords(),t.canvas&&(t.canvas.requestRenderAll(),t.canvas.fire("object:modified",{target:l,transform:{action:"updatedImage",original:Yr({},n)}})),r()}else o(new Error("image load error"))}),{crossOrigin:"anonymous"})}))},updateSourceFromCropped:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=Xe.a.getImageBaseSrc(e),o=e.rect.width,l=e.rect.height,c=e.scale,d=this.getImageUpdateData();if(this.isLowDefinitionDisplay()){this.updateOriginalDefinitionData({src:r,scaleX:e.scale,scaleY:e.scale,width:e.rect.width,height:e.rect.height});var h=Xe.a.getFabricImageResizedData({src:r,scaleX:e.scale,scaleY:e.scale,width:e.rect.width,height:e.rect.height},1);o=h.width,l=h.height,c=h.scaleX,r=h.src}var f={src:r,width:o,height:l,scaleX:c,scaleY:c,qualityStatus:t,originalDefinitionData:this.originalDefinitionData?JSON.parse(JSON.stringify(this.originalDefinitionData)):null,link:n};return this.applyImageUpdateData(f,d)},getSvgSrc:function(){return this.getOriginalSrc(!0)},_toSVG:function(){if(!this._element)return[];var e=this.callSuper("_toSVG");this.link&&this.link.length>0&&(0===this.link.indexOf("#")?e.unshift('<a href="'+this.link+'" target="_self">'):e.unshift('<a xlink:href="'+this.link+'" target="_blank">'),e.push("</a>"));var t=e.indexOf("></image>\n");return t>=0&&this.originalDefinitionData&&e.splice(t,0,' _original-scale-x="'.concat(this.originalDefinitionData.scaleX,'" _original-scale-y="').concat(this.originalDefinitionData.scaleY,'" ')),e},setElement:function(element,e){this._isFullTransparentCache=null,this.callSuper("setElement",element,e)}}),Li.fabric.MzImage.fromObject=function(e,t){var object=Li.fabric.util.object.clone(e);Li.fabric.util.loadImage(object.src,(function(img,e){Li.fabric.MzImage.prototype._initFilters.call(object,object.filters,(function(n){object.filters=n||[],Li.fabric.MzImage.prototype._initFilters.call(object,[object.resizeFilter],(function(n){object.resizeFilter=n[0],Li.fabric.util.enlivenObjects([object.clipPath],(function(n){object.clipPath=n[0];var image=new Li.fabric.MzImage(img,object);e&&(image.backgroundColor="#f5b1b1"),t(image)}))}))}))}),null,object.crossOrigin)},Li.fabric.MzImage.fromURL=function(e,t,n){Li.fabric.util.loadImage(e,(function(img){t&&t(new Li.fabric.MzImage(img,n))}),null,n&&n.crossOrigin)},Li.fabric.MzImage.ATTRIBUTE_NAMES=Li.fabric.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin".split(" ")),Li.fabric.MzImage.fromElement=function(element,e,t){var n=Li.fabric.parseAttributes(element,Li.fabric.MzImage.ATTRIBUTE_NAMES);Li.fabric.MzImage.fromURL(n["xlink:href"],e,extend(t?Li.fabric.util.object.clone(t):{},n))}};n(55),n(118);function Xr(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function qr(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?Xr(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Xr(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Jr=function(){Li.fabric.MzTextbox=Li.fabric.util.createClass(Li.fabric.Text,{_wordJoiners:/[ \t\r]/,_reSpace:/\s|\n/,minWidth:20,flatStyle:null,htmlText:null,displayedText:"",superscript:{size:.7,baseline:-.35},subscript:{size:.7,baseline:.11},_mzActiveProps:["fontSize","fontFamily","fontStyle","lineHeight"],type:"MzTextbox",blockType:"Body",textOverflow:!1,textOverflowLength:0,isPlaceholderText:!1,initialHeight:200,_dimensionAffectingProps:Li.fabric.Text.prototype._dimensionAffectingProps.concat("width","height"),initialize:function(text,e){Object.assign(this,Br),e=this.initMzObject(e),this.toObjectProps.push("blockType","condensedFlatStyle","isPlaceholderText","htmlText"),this.height=e.height||this.initialHeight,this.blockType=e.blockType||"Body",e.condensedFlatStyle&&(this.condensedFlatStyle=e.condensedFlatStyle),e.htmlText&&(this.htmlText=e.htmlText),this.initIndent(e),this.initList(e),this.initEndSign(e),this.initTextLink(e),this.initDropCap(e),this.initDodging(e),this.initReflow(e),this.initLegend(e),this.initPadding(e),this.initOverrideStyle(e),this.setupState({propertySet:"_mzActiveProps"}),delete e.text,this.callSuper("initialize","",e),this.initThemeStyle(e),this.styles=e&&e.styles||{},this.set("text",text),this.textOverflow=!1,0===text.length&&e.placeholder&&e.placeholder.length>0&&(this.set("text",e.placeholder),this.isPlaceholderText=!0)},setStyledText:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],text=e.text,n=e.flatStyle,r=e.htmlText,o={text:this.text,flatStyle:this.flatStyle,htmlText:this.htmlText};this.htmlText=void 0!==r?r:null,this.flatStyle=n,this.applyFlatStyle(text),this.text=text,this.isPlaceholderText=!1,this._forceClearCache=!0,this.updateOnRender(),t&&this.canvas.fire("object:modified",{target:this,transform:{action:"styledText",original:qr({},o)}})},getMinWidth:function(){return 10},getMinHeight:function(){return 10},activate:function(){this.activateDropCap(),this.activateDodging(),this.activateReflow(),this.activateLegend(),this.activateVariableList()},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this.isMoving||(this.hasStateChanged("_mzActiveProps")||this.hasStateChanged("_mzDropCapProps"))&&this.updateOnRender(),this.callSuper("render",e)))},updateOnRender:function(){this.updateDropCap(),this.saveState({propertySet:"_mzDropCapProps"}),this.saveState({propertySet:"_mzActiveProps"})},initDimensions:function(){this.__skipDimension||(this._clearCache(),this._splitText(),this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},_splitText:function(){var e=this.processTextToLines(this.text+this.getEndSignCharacter());if(this.childTextBoxId?(this.updateReflowText(e),this.textOverflow=!1):(this.textOverflow=e.hasOverflow,this.textOverflowLength=e.overflowText.length),this.hasReflow){var t=Li.fabric.textGroups.get(this.textgroupId);t&&(t.updateGroupTextOverflow(),this.canvas&&t.getLastTexBox().id===this.id&&this.canvas.fire("text:overflow",{id:this.id,value:this.textOverflow,length:this.textOverflow?this.textOverflowLength:0}))}else this.canvas&&this.canvas.fire("text:overflow",{id:this.id,value:this.textOverflow,length:this.textOverflow?this.textOverflowLength:0});return e},hasTextOverflow:function(){if(this.hasReflow){var e=Li.fabric.textGroups.get(this.textgroupId);return e?e.getLastTexBox().textOverflow:this.textOverflow}return this.textOverflow},processTextToLines:function(text){var e=this.wrapAndSetLines(text),t=this.getLastFittingLineIndex();if(this.textOverflow=!1,e.overflowText="",e.overflowStyle=null,e.hasOverflow=!1,t<e.lines.length-1){e.hasOverflow=!0;var n=this._wrapLineOriginalTextMap&&this._wrapLineOriginalTextMap[t+1]?this._wrapLineOriginalTextMap[t+1].start:text.length+1;for(e.displayedText=text.slice(0,n),e.overflowText=text.slice(n);e.overflowText.charAt(0).match(this._reNewline)||e.overflowText.charAt(0).match(this._reSpace);)e.overflowText=e.overflowText.substring(1),n+=1;if(this.flatStyle){e.overflowStyle=this.flatStyle.slice(n);var r=this.getStyleListByLine(t+1);r&&r.list&&(e.overflowStyle[0]&&e.overflowStyle[0].list||(e.overflowStyle[0]=qr({},e.overflowStyle[0],{},r),e.overflowStyle[0].hideListBullet=!0))}var o=this.splitTextIntoLines(e.displayedText);e.graphemeText=o.graphemeText,e._unwrappedLines=o._unwrappedLines,e.graphemeLines=e.graphemeLines.slice(0,t+1),e.lines=e.lines.slice(0,t+1),this.textLines=e.lines,this._textLines=e.graphemeLines,this.displayedText=e.displayedText}else e.displayedText=text,this.displayedText=e.displayedText;return e},applyFlatStyle:function(text){var output={},line=0,e=0;if(this.flatStyle)for(var t=0;t<this.flatStyle.length;t++)text.charAt(t).match(this._reNewline)?(line++,e=0):(this.flatStyle[t]&&0!==Object.keys(this.flatStyle[t]).length&&(output[line]||(output[line]={}),output[line][e]=qr({},this.flatStyle[t])),e++),this.isHighSurrogateChar(text,t)&&t++;this.styles=output},isHighSurrogateChar:function(e,i){var code=e.charCodeAt(i);if(isNaN(code))return!1;if(code<55296||code>57343)return!1;if(55296<=code&&code<=56319){if(e.length<=i+1)throw"Detect surrogate char Error - High surrogate without following low surrogate";var t=e.charCodeAt(i+1);if(56320>t||t>57343)throw"Detect surrogate char Error - High surrogate without following low surrogate";return!0}return!1},wrapAndSetLines:function(text){for(var e=this.splitTextIntoLines(text),t=this._wrapText(e.lines,this.width),n=new Array(t.length),i=0;i<t.length;i++)n[i]=t[i].join("");return e.lines=n,e.graphemeLines=t,e},splitTextIntoLines:function(text){for(var e=text.split(this._reNewline),t=new Array(e.length),n=["\n"],r=[],i=0;i<e.length;i++)t[i]=Li.fabric.util.string.graphemeSplit(e[i]),r=r.concat(t[i],n);return r.pop(),this._unwrappedTextLines=t,this._text=r,{_unwrappedLines:t,lines:e,graphemeText:r,graphemeLines:t}},_wrapText:function(e,t){var n=[];this.resetBeforeApplyGraphemeLineOnFly(),this.clearLineList();for(var i=0;i<e.length;i++){var line=this.checkExistingVarIntoLine(e[i],i);n=n.concat(this._wrapLine(line,i,t,0,n.length))}return n},getLastFittingLineIndex:function(){for(var e,i=0,t=this._textLines.length,n=0;i<t&&(e=this.getHeightOfLine(i),!((n+=i===t-1?e/this.lineHeight:e)>=this.height));++i);return i-1},_wrapLine:function(e,t,n,r,o){var l,c=0,d=this.splitByGrapheme,h=[],line=[],f=d?Li.fabric.util.string.graphemeSplit(e):e.split(this._wordJoiners),m="",y=0,v=0,_=d?"":" ",O=0,E=0,k=!0,S=d?0:this._getWidthOfCharSpacing(),A=0,T=0,P=!1;if(this.setLineList(t,o,!0),e.length>0){n-=r=r||0;for(var i=0;i<f.length;i++)for(A=this.getOffsetAt(o),P=!0,null===(l=this._nextWrappedWord(f[i],o,v,
1n-A))&&T++;null!==l;)m=l.word,O=l.width,y=m.join("").length,v+=m.length,(c+=E+O-S)>=n-A&&!k?(h.push(line),this.applyGraphemeLineOnFly(line,t,!1,o,T,!P),line=[],c=O,k=!0,o++,T=0,this.setLineList(t,o,!1),A=this.getOffsetAt(o),v=m.length):c+=S,!k&&P&&(line.push(_),T++),line=line.concat(m),T+=y,P?(E=this._measureWord([_],o,v),v++):E=0,l=this._nextWrappedWord(l.next,o,v,n-A,!1),P=!1,k=!1}return h.push(line),this.applyGraphemeLineOnFly(line,t,!0,o,T),h},_nextWrappedWord:function(e,t,n,r){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e||0===e.length)return null;var l,c=Li.fabric.util.string.graphemeSplit(e),d=0,h="",f=!0;n=n||0;for(var i=0,m=c.length;i<m;i++){var y=this._getGraphemeBox(c[i],t,i+n,l,f),v=-1;if(d+y.kernedWidth>r?v=i:o&&"-"===c[i]&&(v=i+1),v>=0){this.isHighSurrogateChar(c.join(""),v)&&(v+=1),h=c.slice(0,v).join("");break}d+=y.kernedWidth,l=c[i]}return 0===h.length&&(h=e),{word:this.splitByGrapheme?h:Li.fabric.util.string.graphemeSplit(h),width:d,next:e.substring(h.length)}},resetBeforeApplyGraphemeLineOnFly:function(){this._textLines=[],this.textLines=[],this._styleMap={0:{line:0,offset:0}},this._charIndexStyleDiffMap={},this._wrapLineOriginalTextMap={}},applyGraphemeLineOnFly:function(line,e,t,n,r){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=this._textLines.length;this._styleMap[l+1]=t?{line:e+1,offset:0}:{line:e,offset:this._styleMap[l].offset+line.length+(o?0:1)};var c=0;n>0&&(c=this._wrapLineOriginalTextMap[n-1].end,this._wrapLineOriginalTextMap[n-1].isCutInsideWord||(c+=1)),this._wrapLineOriginalTextMap[n]={start:c,end:c+r,length:r,isCutInsideWord:o},this._textLines.push(line),this.textLines.push(line.join(""))},_getGraphemeBox:function(e,t,n,r,o){var l,style=this.getCompleteStyleDeclaration(t,n),c=r?this.getCompleteStyleDeclaration(t,n-1):{},d=this._measureChar(e,style,r,c),h=d.kernedWidth,f=d.width;0!==this.charSpacing&&(f+=l=this._getWidthOfCharSpacing(),h+=l);var m={width:f,left:0,height:style.fontSize,kernedWidth:h,deltaY:style.deltaY};if(n>0&&!o){var y=this.__charBounds[t][n-1];m.left=y.left+y.width+d.kernedWidth-d.width}return this.dropCap&&1===n&&0===t&&(m.left+=this.dropCapStyle.dropCapSpacing,m.kernedWidth+=this.dropCapStyle.dropCapSpacing),m},_getLineLeftOffset:function(e){if(0===this._textLines.length)return 0;var t=this.getLineWidth(e),n=this.getOffsetAt(e),r=this.getStyleTextAlignByLine?this.getStyleTextAlignByLine(e):this.textAlign;if("left"===r||"justify-left"===r)return n;if("center"===r)return this.dropCap&&0===e?n:this.dropCap&&e<this.dropCapStyle.dropCapHeight?n+(this.width-t)/2:(n+this.width-t)/2;if("right"===r)return this.dropCap&&0===e?n:n+this.width-t;if("justify-center"===r&&this.isEndOfWrapping(e))return(n+this.width-t)/2;if("justify-right"===r&&this.isEndOfWrapping(e))return n+this.width-t;if(this.isEndOfWrapping(e)){if("justify-center"===r&&this.isEndOfWrapping(e))return(this.width-t)/2;if("justify-right"===r&&this.isEndOfWrapping(e))return this.width-t}return"justify"===r||"justify-center"===r||"justify-right"===r?n:0},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t.width+=this.getOffsetAt(e),t},_createTextCharSpan:function(e,t,n,r){t.link&&void 0===t.fill&&(t.fill=this.fill);var o=e!==e.trim()||e.match(/ +/g),l=this.getSvgSpanStyles(t,o),c=l?'style="'+l+'"':"",d=Li.fabric.Object.NUM_FRACTION_DIGITS,h=Li.fabric.util.toFixed,f="";var m=['<tspan x="',h(n,d),'" y="',h(r,d),'" ',f,c,">",Li.fabric.util.string.escapeXml(e),"</tspan>"].join("");return t.link?0===t.link.indexOf("#")?['<a href="',t.link,'" target="_self">',m,"</a>"].join(""):['<a xlink:href="',t.link,'" target="_blank">',m,"</a>"].join(""):m},_measureWord:function(e,t,n){var r,o=0;n=n||0;for(var i=0,l=e.length;i<l;i++){o+=this._getGraphemeBox(e[i],t,i+n,r,!0).kernedWidth,r=e[i]}return o},_measureLine:function(e){var i,t,n,r,o=0,line=this._textLines[e],l=new Array(line.length);for(this.__charBounds[e]=l,i=0;i<line.length;i++)t=line[i],r=this._getGraphemeBox(t,e,i,n),l[i]=r,o+=r.kernedWidth,n=t;
1return l[i]={left:r?r.left+r.width:0,width:0,kernedWidth:0,height:this.fontSize},{width:o,numOfSpaces:0}},getSaveData:function(){for(var e=this.hasReflow?Li.fabric.textGroups.get(this.textgroupId).textBoxes:[this],output=[],i=0;i<e.length;i++){var t=e[i];output.push({id:t.id,text:t.text,styles:t.styles,overrideStyle:t.overrideStyle,opacity:t.opacity,condensedFlatStyle:t.condensedFlatStyle,htmlText:t.htmlText})}return output}}),Li.fabric.MzTextbox.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzTextbox",object,e,"text")},Object.defineProperty(Li.fabric.MzTextbox.prototype,"condensedFlatStyle",{get:function(){var e=this,t=null,n=-1;return this.flatStyle&&this.hasReflow&&this.isRootTextbox()?this.flatStyle.reduce((function(r,o,l){return null===t||JSON.stringify(t)==JSON.stringify(o)&&l!==e.flatStyle.length-1||(r[n+"-"+(l-1)]=t,n=-1,t=null),o&&Object.keys(o).length>0&&-1===n&&(n=l,t=o),r}),{}):null},set:function(e){this.flatStyle=e?Object.keys(e).reduce((function(t,n){for(var r=n.split("-"),i=parseInt(r[0]);i<=parseInt(r[1]);i++)t[i]=e[n];return t}),[]):null}})};function Qr(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function eo(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Qr(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Qr(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var to=function(){Li.fabric.MzShapeGroup=Li.fabric.util.createClass(Li.fabric.Group,{type:"MzShapeGroup",_fill:null,_stroke:null,_strokeWidth:0,_strokeDashArray:null,variantGroup:null,_isFullTransparentCache:null,initialize:function(e,t){Object.assign(this,Br),t=this.initMzObject(t),this.toObjectProps.push("sourcePath"),this.sourcePath=t.sourcePath||"",this.variantGroup=t.variantGroup||null,e.forEach((function(e){e.strokeUniform=!1,e.backup||(e.backup={},e.backup.fill=e.fill,e.backup.stroke=e.stroke,e.backup.strokeWidth=e.strokeWidth,e.backup.strokeDashArray=e.strokeDashArray)})),this.callSuper("initialize",e,t)},setChildProp:function(e,t){t?this._objects.forEach((function(n){n.set(e,t)})):this._objects.forEach((function(t){t.set(e,t.backup[e])}))},updateFromSvgUrl:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r={opacity:this.opacity,sourcePath:this.sourcePath};if(null===n&&(n=this.opacity),this.sourcePath===e&&this.opacity===n)return Promise.resolve();if(this.sourcePath!==e){for(var o=this.getObjects(),i=0;i<o.length;i++)this.remove(o[i]);return this.sourcePath=e,this.opacity=n,this._isFullTransparentCache=null,new Promise((function(n,o){Li.fabric.loadSVGFromURL(e,(function(e,o){Li.fabric.MzShapeGroup.fromSVG(e,o).forEachObject((function(object){t.fill&&(object.fill=t.fill),t.stroke&&(object.stroke=t.stroke),t.strokeWidth&&(object.strokeWidth=t.strokeWidth),t.strokeDashArray&&(object.strokeDashArray=t.strokeDashArray),object.strokeUniform=!1,object.backup||(object.backup={},object.backup.fill=object.fill,object.backup.stroke=object.stroke,object.backup.strokeWidth=object.strokeWidth,object.backup.strokeDashArray=object.strokeDashArray),t.add(object)}));var l=t.width,c=t.height,d=t.scaleX,h=t.scaleY;t.width=o.width,t.height=o.height,t.scaleX=d/(o.width/l),t.scaleY=h/(o.height/c),t.canvas.requestRenderAll(),t.canvas.fire("object:modified",{target:t,transform:{action:"updatedSvg",original:eo({},r)}}),n()}))}))}return this.opacity=n,this.canvas.fire("object:modified",{target:this,transform:{action:"updatedSvg",original:eo({},r)}}),Promise.resolve()},isFullTransparent:function(){if(null!==this._isFullTransparentCache)return this._isFullTransparentCache;if(!this._objects||0===this._objects.length)return!0;if(0===this.opacity)return!0;var canvas=document.createElement("canvas"),e=canvas.getContext("2d");e.width=this.width,e.height=this.height;for(var i=0,t=this._objects.length;i<t;i++)this._objects[i]._render(e);for(var n=!0,data=e.getImageData(0,0,canvas.width,canvas.height).data,r=3;r<data.length;r+=4)if(data[r]>0){n=!1;break}return this._isFullTransparentCache=n,n}}),Li.fabric.MzShapeGroup.fromSVG=function(e,t,path){var object;return t&&(t.width&&t.height?t.centerPoint={x:t.width/2,y:t.height/2}:(delete t.width,delete t.height)),object=new Li.fabric.MzShapeGroup(e,t),void 0!==path&&(object.sourcePath=path),object},Li.fabric.MzShapeGroup.fromSVGUrl=function(e,t){Li.fabric.loadSVGFromURL(e,(function(n,r){t&&t(Li.fabric.MzShapeGroup.fromSVG(n,r,e))}))},Li.fabric.MzShapeGroup.fromObject=function(object,e){Li.fabric.util.enlivenObjects(object.objects,(function(t){Li.fabric.util.enlivenObjects([object.clipPath],(function(n){var r=Li.fabric.util.object.clone(object,!0);r.clipPath=n[0],delete r.objects,e&&e(new Li.fabric.MzShapeGroup(t,r,!0))}))}))},Object.defineProperty(Li.fabric.MzShapeGroup.prototype,"fill",{get:function(){return this._fill},set:function(e){this._fill=e,this.setChildProp("fill",e)}
1}),Object.defineProperty(Li.fabric.MzShapeGroup.prototype,"stroke",{get:function(){return this._stroke},set:function(e){this._stroke=e,this.setChildProp("stroke",e)}}),Object.defineProperty(Li.fabric.MzShapeGroup.prototype,"strokeWidth",{get:function(){return this._strokeWidth},set:function(e){this._strokeWidth=e,this.setChildProp("strokeWidth",e)}}),Object.defineProperty(Li.fabric.MzShapeGroup.prototype,"strokeDashArray",{get:function(){return this._strokeDashArray},set:function(e){this._strokeDashArray=e,this.setChildProp("strokeDashArray",e)}})},ao=(n(159),n(721),function(){Li.fabric.MzCanvas=Li.fabric.util.createClass(Li.fabric.Canvas,{type:"MzCanvas",_clipboard:null,enableSelectionRect:!1,autoSelectRootTextbox:!1,showSpecificControls:!1,initialize:function(element,e){e.fireRightClick=!0,e.stopContextMenu=!0,Li.fabric.Object.prototype.set({transparentCorners:!1,borderColor:"#b7b8b9",borderScaleFactor:1,cornerColor:"#b7b8b9",cornerSize:10,cornerStyle:"circle"}),this.preserveObjectStacking=!0,this.autoSelectRootTextbox=e.autoSelectRootTextbox||!1,this.showSpecificControls=e.showSpecificControls||!1,this.initShapeDraw(e),this.initViewportControl(e),this.callSuper("initialize",element,e),this.initGrid(e),e.useOverEffect&&(this.initEffectCanvas(e),this.on("mouse:over",this.onMouseOver),this.on("mouse:out",this.onMouseOut),this.on("selection:created",this.updateEffectSelectionUpdate),this.on("selection:updated",this.updateEffectSelectionUpdate),this.on("selection:cleared",this.updateEffectSelectionUpdate)),e.disableMultiSelection?this.selection=!1:(this.on("selection:created",this.onSelectionUpdate),this.on("selection:updated",this.onSelectionUpdate)),e.useKeyboardControl&&(console.log("====================== keyboard control on"),this.initKeyboardControl(e))},dispose:function(){return this.off("mouse:over",this.onMouseOver),this.off("mouse:out",this.onMouseOut),this.off("selection:created",this.onSelectionUpdate),this.off("selection:updated",this.onSelectionUpdate),this.off("selection:created",this.updateEffectSelectionUpdate),this.off("selection:updated",this.updateEffectSelectionUpdate),this.off("selection:cleared",this.updateEffectSelectionUpdate),this.disableSnapping(),this.disableViewportControl(),this.disableKeyboardControl(),this.callSuper("dispose")},onMouseOver:function(e){e.target&&e.target.id&&this.addOverEffect(e.target)},onMouseOut:function(e){this.removeOverEffect()},onSelectionUpdate:function(e){console.log("selection update",e.target.type),e.target&&"activeSelection"===e.target.type&&e.target.set({lockScalingX:!0,lockScalingY:!0})},updateEffectSelectionUpdate:function(e){e.target&&e.target.id?this.addSelectedEffect(e.target):this.removeSelectedEffect(e.target)},resizeToDimensions:function(e,t){e&&t&&(this.setDimensions({width:e,height:t}),this.resizeOverlayCanvas(this.gridCanvasEl),this.resizeOverlayCanvas(this.effectCanvasEl))},resizeOverlayCanvas:function(e){e&&this.lowerCanvasEl&&(e.width=this.lowerCanvasEl.width,e.height=this.lowerCanvasEl.height,e.style.width=this.lowerCanvasEl.style.width,e.style.height=this.lowerCanvasEl.style.height)},_createActiveSelection:function(e,t){var n=this,r=this.getActiveObjects(),o=this._createGroup(e);
1this._hoveredTarget=o,this._setActiveObject(o,t),this._fireSelectionEvents(r,t),setTimeout((function(){0!==o.angle&&(o.rotate(0),o.setCoords(),n.requestRenderAll())}),50)},renderTopLayer:function(e){e&&(e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),!1===this.enableSelectionRect&&(this._groupSelector=null),this.enableSelectionRect&&this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore())},_chooseObjectsToRender:function(){var e=this.getActiveObjects(),t=[];if(e.length>0&&!this.preserveObjectStacking){for(var n=[],i=0,r=this._objects.length;i<r;i++){var object=this._objects[i];-1===e.indexOf(object)?t.push(object):n.push(object)}e.length>1&&(this._activeObject._objects=n),t.push.apply(t,n)}else{for(var o=[],l=[],c=0,d=this._objects.length;c<d;c++){var h=this._objects[c];h.topLayer?l.push(h):h.backLayer?o.push(h):t.push(h)}t.unshift.apply(t,o),t.push.apply(t,l)}return t},setActiveObject:function(object,e){var t=this.getActiveObjects();return this.autoSelectRootTextbox&&object.hasReflow&&object.parentTextBoxId?this.setActiveObject(object.getRootTextbox(),e):(this._setActiveObject(object,e),this._fireSelectionEvents(t,e),this)},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},copy:function(){var e=this,t=this.getActiveObject();if(t&&!t.isEditing)return new Promise((function(n){t.clone((function(t){e._clipboard=t,n(t.toJSON())}))}))},cut:function(){var e=this;return this.copy().then((function(t){return e.delete(),t}))},paste:function(){var e=this;if(this._clipboard){var t=this.getActiveObject();t&&t.isEditing||this._clipboard.clone((function(t){e.discardActiveObject(),t.set({evented:!0}),t.id=Qt.a.uniqidplus(),"group"!==t.type&&"MzGroup"!==t.type&&"activeSelection"!==t.type||t._objects.forEach((function(e){e.id=Qt.a.uniqidplus()})),"activeSelection"===t.type?(t.canvas=e,t.forEachObject((function(t){e.add(t)})),t.setCoords()):e.add(t),e.setActiveObject(t),e.requestRenderAll()}))}},pasteFromJson:function(e){var t,n=this;if(e)if((t="activeSelection"===e.type?"ActiveSelection":e.type)&&Li.fabric[t]){var r=JSON.parse(JSON.stringify(e));Li.fabric[t].fromObject(r,(function(e){n._clipboard=e,n.paste()}))}else console.warn("invalid paste object type",e)},delete:function(){var e=this.getActiveObject();e&&!e.isEditing&&this.remove(e)},remove:function(){for(var i=0;i<arguments.length;i++){var object=arguments[i];object&&(object.__historyIndexBeforeRemove=this._objects.indexOf(object))}return this.callSuper.apply(this,["remove"].concat(Array.prototype.slice.call(arguments)))},moveObject:function(e,t){var n=this.getActiveObject();n&&!n.isEditing&&(n.left+=e,n.top+=t,n.setCoords(),this.requestRenderAll())},setObjectsSelectable:function(e){this.discardActiveObject(),this.forEachObject((function(t){"MzNonInteractiveRect"==t.type||"MzNonInteractiveLine"==t.type||"MzNonInteractiveGroup"==t.type||t.locked||(t.selectable=e)}))},getObjectById:function(e){return function t(n){var r=!0,o=!1,l=void 0;try{for(var c,d=n[Symbol.iterator]();!(r=(c=d.next()).done);r=!0){var object=c.value;if(object.id===e)return object;if(("group"===object.type||"MzGroup"===object.type)&&object._objects&&object._objects.length>0){var h=t(object._objects);if(h)return h}}}catch(e){o=!0,l=e}finally{try{r||null==d.return||d.return()}finally{if(o)throw l}}return null}(this.getObjects())},getObjectsOfType:function(e){return function t(n){return n.reduce((function(n,object){return object.type===e&&n.push(object),"group"!==object.type&&"MzGroup"!==object.type||object._objects&&object._objects.length>0&&n.push.apply(n,Object(tt.a)(t(object._objects))),n}),[])}(this.getObjects())},selectObjectById:function(e){var t=this.getObjectById(e);t&&(this.setActiveObject(t),this.requestRenderAll())},getEditableTextboxes:function(){for(var e=this.getObjectsOfType("MzTextbox"),t=[],i=0;i<e.length;i++)e[i].parentTextBoxId||t.push(e[i]);return t},unselectActiveObject:function(){this.discardActiveObject(),this.requestRenderAll()},getToolbarAnchorPosition:function(){var object=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=object||this.getActiveObject();
1if(!t&&Li.fabric.page&&Li.fabric.page.displayBackground&&(t=Li.fabric.page.displayBackground),!t)return null;var n=Number.isFinite(e.offset)?e.offset:50;"function"==typeof t.setCoords&&t.setCoords();var r=this.lowerCanvasEl?this.lowerCanvasEl.getBoundingClientRect():null,o="function"==typeof t.getCenterPoint?t.getCenterPoint():new Li.fabric.Point(t.left||0,t.top||0),l=Li.fabric.util.transformPoint(o,this.viewportTransform),c=r?r.width:window.innerWidth,d=l.x>c/2?"left":"right",h=t.getBoundingRect(!0,!0),f=new Li.fabric.Point("left"===d?h.left:h.left+h.width,h.top+h.height/2),m=Li.fabric.util.transformPoint(f,this.viewportTransform);return r?{x:r.left+m.x+("right"===d?n:-n),y:r.top+m.y,side:d}:{x:m.x+("right"===d?n:-n),y:m.y,side:d}},getPagePositionInDOM:function(){var e,t=null===Li.fabric||void 0===Li.fabric||null===(e=Li.fabric.page)||void 0===e?void 0:e.displayBackground;if(!t)return null;"function"==typeof t.setCoords&&t.setCoords();var n=this.lowerCanvasEl?this.lowerCanvasEl.getBoundingClientRect():null,r=t.getBoundingRect(!0,!0),o=Li.fabric.util.transformPoint(new Li.fabric.Point(r.left,r.top),this.viewportTransform),l=Li.fabric.util.transformPoint(new Li.fabric.Point(r.left+r.width,r.top+r.height),this.viewportTransform),c=Math.min(o.x,l.x),d=Math.min(o.y,l.y),h=Math.abs(l.x-o.x),f=Math.abs(l.y-o.y);return n?{left:n.left+c,top:n.top+d,width:h,height:f}:{left:c,top:d,width:h,height:f}},ungroup:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null===e&&(e=this.getActiveObject()),"group"===e.type||"MzGroup"===e.type){var t=e._objects;e._restoreObjectsState(),this.remove(e),this.renderAll();for(var i=0;i<t.length;i++)this.add(t[i]);return this.renderAll(),t}return"MzShapeGroup"===e.type?this.explodeShapeGroup(e):(console.log("ERROR : try to ungroup non Group Object : "+e.type),null)},group:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(t=t||this.getActiveObjects()))return null;if(this.discardActiveObject(),n){e=[];var r=!0,o=!1,l=void 0;try{for(var c,d=t[Symbol.iterator]();!(r=(c=d.next()).done);r=!0){var object=c.value;if("group"===object.type||"MzGroup"===object.type){var h,f=this.ungroup(object);if(f&&f.length>0)(h=e).push.apply(h,Object(tt.a)(f))}else e.push(object)}}catch(e){o=!0,l=e}finally{try{r||null==d.return||d.return()}finally{if(o)throw l}}}else e=t;var m=new Li.fabric.ActiveSelection(e,{canvas:this});return this.setActiveObject(m),n?this.selectionToGroup(m):m.toGroup()},selectionToGroup:function(e){var t=e._objects.concat();e._objects=[];var n=Li.fabric.Object.prototype.toObject.call(e),r=new Li.fabric.MzGroup([]);if(delete n.type,r.set(n),t.forEach((function(object){object.canvas.remove(object),object.group=r})),r._objects=t,!e.canvas)return r;var canvas=e.canvas;return canvas.add(r),canvas._activeObject=r,r.setCoords(),r},convertToShapeGroup:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e=e||this.getActiveObjects(),this.discardActiveObject(),(e=e.filter((function(object){return"MzImage"!==object.type}))).length>0){this.add(new Li.fabric.MzShapeGroup(e,{}));for(var i=0;i<e.length;i++)this.remove(e[i])}},explodeShapeGroup:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null===e&&(e=this.getActiveObject()),"MzShapeGroup"===e.type){var t=e._objects;if(t.find((function(object){return-1===["MzRect","MzCircle","MzTriangle","MzLine","MzShapeGroup","MzGroup","MzImage","MzTextbox"].indexOf(object.type)}
1)))return console.log("ERROR : try to ungroup invalid Object in ShapeGroup"),null;e._restoreObjectsState(),this.remove(e),this.renderAll();for(var i=0;i<t.length;i++)this.add(t[i]);return this.renderAll(),t}return console.log("ERROR : try to ungroup non ShapeGroup Object : "+e.type),null},createSVGFontFacesMarkup:function(){var e,t,style,n,r,o,l,i,c,d="",h={},f=Li.fabric.fontPaths,m=Li.fabric.textStylesList,y=this._objects;for(i=0,c=y.length;i<c;i++)if("MzTextbox"===(e=y[i]).type){if(!h[t=e.fontFamily]&&f[t]&&(h[t]=!0),e.styles&&(style=e.styles))for(r in style)if(null!=r)for(l in n=style[r])null!=l&&(o=n[l])&&(o.fontFamily?t=o.fontFamily:o.textStyleKey&&m&&m[o.textStyleKey]&&(t=m[o.textStyleKey].fontFamily),t&&!h[t]&&f[t]&&(h[t]=!0));e.dropCapStyle&&(t=e.dropCapStyle.textStyleKey&&m&&m[e.dropCapStyle.textStyleKey]?m[e.dropCapStyle.textStyleKey].fontFamily:e.dropCapStyle.fontFamily)&&!h[t]&&f[t]&&(h[t]=!0)}for(var v in h)d+="\t\t@import url("+f[v]+");\n";return d&&(d=['\t<style type="text/css">',"<![CDATA[\n",d,"]]>","</style>\n"].join("")),d},_checkTarget:function(e,t,n){var r=!1,o=!1;if(t&&t.visible&&t.evented&&this.containsPoint(null,t,e))if(r=!0,!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)o=!0;else if("MzTextbox"===t.type&&0===t.text.trim().length)o=!0;else if("MzImage"===t.type&&t.isFullTransparent())o=!0;else if("MzShapeGroup"===t.type&&t.isFullTransparent())o=!0;else{var l=0===t.opacity;l&&(t.opacity=.1),this.targetFindTolerance="MzTextbox"===t.type?Math.round(10*this.viewportTransform[0]):0,this.isTargetTransparent
1(t,n.x,n.y)||(o=!0),l&&(t.opacity=0)}return{isOverPointer:o,isOverBounds:r}},_searchPossibleTargets:function(e,t){for(var n,r,o,i=e.length;i--;){var l=e[i],c=l.group&&"activeSelection"!==l.group.type?this._normalizePointer(l.group,t):t,d=this._checkTarget(c,l,t);if(d.isOverPointer){if((n=e[i]).subTargetCheck&&n instanceof Li.fabric.Group||"MzGroup"===n.type&&n.selectInsideGroup){if(r=this._searchPossibleTargets(n._objects,t),"MzGroup"===n.type&&n.selectInsideGroup)return r;r&&this.targets.push(r)}break}!o&&d.isOverBounds&&"MzTextbox"===l.type&&(o=l)}return n||o},bringToFront:function(e){this.reorderObject(e,"bringToFront")},bringForward:function(e){this.reorderObject(e,"bringForward")},sendBackwards:function(e){this.reorderObject(e,"sendBackwards")},sendToBack:function(e){this.reorderObject(e,"sendToBack")},reorderObject:function(e,t){if(["bringToFront","bringForward","sendBackwards","sendToBack"].includes(t)){var n=this._objects.indexOf(e),r=this._objects.map((function(object){return object.id}));this.callSuper(t,e);var o=this._objects.indexOf(e);n!==o&&this.fire("object:reordered",{target:e,action:t,transform:{action:"reorder",original:{__order:r},fromIndex:n,toIndex:o}})}},toObject:function(){return Li.fabric.util.object.extend(this.callSuper("toObject"),{})}})}),no=function(){Li.fabric.MzGroup=Li.fabric.util.createClass(Li.fabric.Group,{type:"MzGroup",selectInsideGroup:!1,initialize:function(e,t,n){Object.assign(this,Br),t=this.initMzObject(t),this.lockScalingX=!0,this.lockScalingY=!0,this.callSuper("initialize",e,t,n)}}),Li.fabric.MzGroup.fromObject=function(object,e){Li.fabric.util.enlivenObjects(object.objects,(function(t){Li.fabric.util.enlivenObjects([object.clipPath],(function(n){var r=Li.fabric.util.object.clone(object,!0);r.clipPath=n[0],delete r.objects,e&&e(new Li.fabric.MzGroup(t,r,!0))}))}))}};n(146);function io(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function ro(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?io(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):io(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var oo=function(){Li.fabric.MzPage=Li.fabric.util.createClass(Li.fabric.Object,{initialized:!1,type:"MzPage",id:"page",canvas:null,pageRect:{},format:{},printMarginRect:{},safeZonenRect:{},displayBackground:null,displayPageRect:null,marginTop:0,marginLeft:0,marginBottom:0,marginRight:0,doublePage:!1,specificMagazineData:null,paletteSwatchName:{},_backgroundFill:null,defaultPageBackgroundColor:"#ffffff",initialize:function(canvas,e){this.canvas=canvas,this.pageRect=e.pageRect,this.format=e.format,this.doublePage=e.double;var t=this.pageRect.width;if(this.doublePage&&(this.pageRect.width*=2),this.specificMagazineData=e.specificMagazineData||null,this.specificMagazineData&&this.specificMagazineData.defaultPageBackgroundColor&&(this.defaultPageBackgroundColor=this.specificMagazineData.defaultPageBackgroundColor),this.marginTop=Qt.a.convertMilimetersToPixels(this.format.printMargins.top,this.format.dpi),this.marginLeft=Qt.a.convertMilimetersToPixels(this.format.printMargins.left,this.format.dpi),this.marginRight=Qt.a.convertMilimetersToPixels(this.format.printMargins.right,this.format.dpi),this.marginBottom=Qt.a.convertMilimetersToPixels(this.format.printMargins.bottom,this.format.dpi),this.printMarginRect={top:this.pageRect.top-this.marginTop,left:this.pageRect.left-this.marginLeft,width:this.pageRect.width+Qt.a.convertMilimetersToPixels(this.format.printMargins.left+this.format.printMargins.right,this.format.dpi),height:this.pageRect.height+Qt.a.convertMilimetersToPixels(this.format.printMargins.top+this.format.printMargins.bottom,this.format.dpi)},this.safeZoneRects=[],this.safeZoneRects.push({top:this.pageRect.top+Qt.a.convertMilimetersToPixels(this.format.safeZone.top,this.format.dpi),left:this.pageRect.left+Qt.a.convertMilimetersToPixels(this.format.safeZone.left,this.format.dpi),width:t-Qt.a.convertMilimetersToPixels(this.format.safeZone.left+this.format.safeZone.right,this.format.dpi),height:this.pageRect.height-Qt.a.convertMilimetersToPixels(this.format.safeZone.top+this.format.safeZone.bottom,this.format.dpi)}),this.doublePage&&this.safeZoneRects.push({top:this.pageRect.top+Qt.a.convertMilimetersToPixels(this.format.safeZone.top,this.format.dpi),left:this.pageRect.left+t+Qt.a.convertMilimetersToPixels(this.format.safeZone.left,this.format.dpi),width:t-Qt.a.convertMilimetersToPixels(this.format.safeZone.left+this.format.safeZone.right,this.format.dpi),height:this.pageRect.height-Qt.a.convertMilimetersToPixels(this.format.safeZone.top+this.format.safeZone.bottom,this.format.dpi)}),e.hideOutContent){var n=new Li.fabric.Rect(ro({},this.pageRect,{fill:"red"}));this.canvas.clipPath=n}this.initialized=!0,this.callSuper("initialize",e)}
1,drawPage:function(e){if(this.displayBackground=new Li.fabric.MzNonInteractiveRect(ro({},this.pageRect,{fill:this.defaultPageBackgroundColor,backLayer:!0})),this.canvas.add(this.displayBackground),this.doublePage){var t=new Li.fabric.MzNonInteractiveRect({top:this.pageRect.top,left:this.pageRect.left,width:this.pageRect.width/2,height:this.pageRect.height,fill:null,backLayer:!0,isSnappable:!0});this.canvas.add(t);var n=new Li.fabric.MzNonInteractiveRect({top:this.pageRect.top,left:this.pageRect.left+this.pageRect.width/2,width:this.pageRect.width/2,height:this.pageRect.height,fill:null,backLayer:!0,isSnappable:!0});this.canvas.add(n)}else{var r=new Li.fabric.MzNonInteractiveRect({top:this.pageRect.top,left:this.pageRect.left,width:this.pageRect.width,height:this.pageRect.height,fill:null,backLayer:!0,isSnappable:!0});this.canvas.add(r)}if(this.displayPageRect=new Li.fabric.MzNonInteractiveRect(ro({},this.pageRect,{fill:null,topLayer:!0,stroke:"#dddddd",shadow:"rgba(0,0,0,0.2) 1px 1px 5px"})),this.canvas.add(this.displayPageRect),!e||!e.hideMargin){var o=new Li.fabric.MzNonInteractiveGroup,l=new Li.fabric.MzNonInteractiveRect(ro({},this.printMarginRect,{fill:null,topLayer:!0,stroke:"#49BED6"}));o.addWithUpdate(l),this.canvas.columnAnchors=[],this.canvas.rowAnchors=[];var c=!0,d=!1,h=void 0;try{for(var f,m=this.safeZoneRects[Symbol.iterator]();!(c=(f=m.next()).done);c=!0){var y=f.value,v=new Li.fabric.MzNonInteractiveRect(ro({},y,{fill:null,topLayer:!0,stroke:"#DE5FD6"}));if(o.addWithUpdate(v),this.format.grid&&this.format.grid.column>1){this.canvas.columnRendererGroup||(this.canvas.columnRendererGroup=new Li.fabric.MzNonInteractiveGroup,this.canvas.add(this.canvas.columnRendererGroup));var _=this.canvas.columnRendererGroup,O=this.format.grid.column,E=this.format.grid.gutter>0?O-1:0,k=this.format.grid.gutter>0?Qt.a.convertMilimetersToPixels(this.format.grid.gutter,this.format.dpi):0;this.canvas.columnAnchors.push(y.left),this.canvas.columnAnchors.push(y.left+y.width),this.canvas.columnAnchors.push(this.pageRect.left),this.canvas.columnAnchors.push(this.pageRect.left+this.pageRect.width),this.canvas.columnAnchors.push(this.printMarginRect.left),this.canvas.columnAnchors.push(this.printMarginRect.left+this.printMarginRect.width),this.canvas.rowAnchors.push(y.top),this.canvas.rowAnchors.push(y.top+y.height),this.canvas.rowAnchors.push(this.pageRect.top),this.canvas.rowAnchors.push(this.pageRect.top+this.pageRect.height),this.canvas.rowAnchors.push(this.printMarginRect.top),this.canvas.rowAnchors.push(this.printMarginRect.top+this.printMarginRect.height);for(var S=(y.width-k*E)/O,A=S;A<y.width-S;A+=S+k){var T=new Li.fabric.MzNonInteractiveLine([0,0,0,y.height],{top:y.top,left
1:y.left+A,fill:null,topLayer:!0,stroke:"#DE5FD6",strokeWidth:1});if(_.addWithUpdate(T),this.canvas.columnAnchors.push(y.left+A),k>0){var P=new Li.fabric.MzNonInteractiveLine([0,0,0,y.height],{top:y.top,left:y.left+A+k,fill:null,topLayer:!0,stroke:"#DE5FD6",strokeWidth:1});_.addWithUpdate(P),this.canvas.columnAnchors.push(y.left+A+k)}}this.canvas.columnAnchors.push(y.left+y.width)}}}catch(e){d=!0,h=e}finally{try{c||null==m.return||m.return()}finally{if(d)throw h}}if(this.doublePage){var C=new Li.fabric.MzNonInteractiveRect({top:this.printMarginRect.top,left:this.printMarginRect.left+this.printMarginRect.width/2,width:0,height:this.printMarginRect.height,fill:null,topLayer:!0,stroke:"#49BED6"});o.addWithUpdate(C)}this.canvas.add(o),this.canvas.marginRendererGroup=o}this.canvas.requestRenderAll()},getObjectsWithin:function(){var e=[],t=this.displayPageRect;return this.canvas.forEachObject((function(n){"MzNonInteractiveRect"!=n.type&&"MzNonInteractiveLine"!=n.type&&"MzNonInteractiveGroup"!=n.type&&t.intersectsWithObject(n)&&-1===e.indexOf(n)&&e.push(n)})),e},export:function(){Li.fabric.history.pause();var e=this.canvas.getActiveObject();this.canvas.discardActiveObject();var t=this.getObjectsWithin(),n=this.canvas.group(t),r=n.toObject();return this.canvas.ungroup(n),e&&(this.canvas.setActiveObject(e),this.canvas.requestRenderAll()),r.pageData={backgroundFill:this.backgroundFill,paletteSwatchName:this.paletteSwatchName},Li.fabric.history.resume(),r},normalizeObjectOriginToLeftTop:function(e){if(e&&e.getPointByOrigin&&e.setPositionByOrigin){var t=e._objects&&e._objects.length?e._objects:null;if(t)for(var i=0;i<t.length;i++)this.normalizeObjectOriginToLeftTop(t[i]);if("left"!==e.originX||"top"!==e.originY){e.setCoords();var n=e.getPointByOrigin("left","top");e.set({originX:"left",originY:"top"}),e.setPositionByOrigin(n,"left","top"),e.setCoords()}}},import:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Li.fabric.history.pause(),this.canvas.discardActiveObject();var r=e;r.pageData&&(this.paletteSwatchName=r.pageData.paletteSwatchName||{},this.backgroundFill=r.pageData.backgroundFill||null,delete r.pageData);var o=new Promise((function(e,o){Li.fabric.Group.fromObject(r,(function(r){var o=r.getObjects();r.destroy();for(var i=0;i<o.length;i++)t.canvas.add(o[i]),t.normalizeObjectOriginToLeftTop(o[i]);if(n){var l=t.canvas.getObjectsOfType("MzGroup"),c=!0,d=!1,h=void 0;try{for(var f,m=l[Symbol.iterator]();!(c=(f=m.next()).done);c=!0){var y=f.value;t.canvas.ungroup(y)}}catch(e){d=!0,h=e}finally{try{c||null==m.return||m.return()}finally{if(d)throw h}}}return t.canvas.requestRenderAll(),t.importedCallback().then((function(){Li.fabric.history.resume(),e()}))}))}));return o},importedCallback:function(){var e=this;return new Promise((function(t,n){e.canvas.forEachObject((function(e){return e.activate?e.activate():null})),e.canvas.renderAll(),console.log("----- canvas page loaded -----"),t()}))},clearFontCache:function(){Li.fabric.util.clearFabricFontCache();var e=this.canvas.getObjectsOfType("MzTextbox"),t=!0,n=!1,r=void 0;try{for(var o,l=e[Symbol.iterator]();!(t=(o=l.next()).done);t=!0){var c=o.value;c.initDimensions(),c.setCoords(),c.dirty=!0}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}this.canvas.requestRenderAll()},getThumb:function(){Li.fabric.history.pause();var e=this.canvas.getActiveObject();this.canvas.discardActiveObject();var t=this.getObjectsWithin();t.unshift(this.displayBackground);var n=this.canvas.group(t),r=n.toDataURL({format:"jpeg",quality:.5,multiplier:.5,left:this.pageRect.left-n.left,top:this.pageRect.top-n.top,width:this.pageRect.width,height:this.pageRect.height,crossOrigin:"anonymous"});return this.canvas.ungroup(n),e&&(this.canvas.setActiveObject(e),this.canvas.requestRenderAll()),Li.fabric.history.resume(),r},getSVG:function(e){var t=e.fonts,n=e.styles;Li.fabric.history.pause();var r=this.canvas.getActiveObject();this.canvas.discardActiveObject(),Li.fabric.fontPaths=t,Li.fabric.setTextStylesList(n);var o=null;this.canvas.clipPath&&(o=this.canvas.clipPath,this.canvas.clipPath=null);var l=new Li.fabric.Rect(ro({}
1,this.printMarginRect,{fill:this.displayBackground.fill}));this.canvas.insertAt(l,0);var svg=this.canvas.toSVG({viewBox:{x:this.printMarginRect.left,y:this.printMarginRect.top,width:this.printMarginRect.width,height:this.printMarginRect.height},width:this.printMarginRect.width,height:this.printMarginRect.height});return this.canvas.remove(l),o&&(this.canvas.clipPath=o),r&&(this.canvas.setActiveObject(r),this.canvas.requestRenderAll()),Li.fabric.history.resume(),svg},getTextWithOverflow:function(){var e=this.canvas.getEditableTextboxes(),t=[];if(e&&e.length>0){var n=!0,r=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value;d.hasTextOverflow()&&t.push(d.id)}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}}return t},getImageWithLowDefinition:function(e){var t=this.canvas.getObjectsOfType("MzImage"),n=[];if(t&&t.length>0){var r=!0,o=!1,l=void 0;try{for(var c,d=t[Symbol.iterator]();!(r=(c=d.next()).done);r=!0){var image=c.value;void 0!==image.qualityStatus&&-1!==image.qualityStatus&&image.qualityStatus<e&&n.push(image.id)}}catch(e){o=!0,l=e}finally{try{r||null==d.return||d.return()}finally{if(o)throw l}}}return n},addObjectAtCenter:function(object){object.left=(this.pageRect.width-object.width*object.scaleX)/2,object.top=(this.pageRect.height-object.height*object.scaleY)/2,this.canvas.add(object)},changePalette:function(e){if(this.paletteSwatchName)for(var t=0,n=Object.entries(this.paletteSwatchName);t<n.length;t++){var r=Object(Ue.a)(n[t],2),o=r[0],l=r[1];e[l]&&this.set(o,e[l])}var c=this.canvas.getObjects(),d=!0,h=!1,f=void 0;try{for(var m,y=c[Symbol.iterator]();!(d=(m=y.next()).done);d=!0){var object=m.value;"MzGroup"===object.type&&c.push.apply(c,Object(tt.a)(object.getObjects()))}}catch(e){h=!0,f=e}finally{try{d||null==y.return||y.return()}finally{if(h)throw f}}var v=!0,_=!1,O=void 0;try{for(var E,k=c[Symbol.iterator]();!(v=(E=k.next()).done);v=!0){var S=E.value;if(S.paletteSwatchName)for(var A=0,T=Object.entries(S.paletteSwatchName);A<T.length;A++){var P=Object(Ue.a)(T[A],2),C=P[0],x=P[1];e[x]&&S.set(C,e[x])}}}catch(e){_=!0,O=e}finally{try{v||null==k.return||k.return()}finally{if(_)throw O}}var D=this.canvas.getObjectsOfType("MzTextbox"),I=!0,w=!1,R=void 0;try{for(var z,L=D[Symbol.iterator]();!(I=(z=L.next()).done);I=!0){var j=z.value;if(j.styles)for(var M=0,U=Object.values(j.styles);M<U.length;M++){var F=U[M];if(F)for(var N=0,$=Object.values(F);N<$.length;N++){var B=$[N];if(B)for(var G=0,H=Object.entries(B);G<H.length;G++){var V=Object(Ue.a)(H[G],2),W=V[0],K=V[1];if(W&&K&&0===W.indexOf("swatch_")&&void 0!==e[K])B[W.split("_")[1]]=e[K]}}}}}catch(e){w=!0,R=e}finally{try{I||null==L.return||L.return()}finally{if(w)throw R}}this.canvas.requestRenderAll()}}),Li.fabric.MzPage.fromObject=function(object,e){return Li.fabric.Object._fromObject("MzPage",e,extraParam)},Object.defineProperty(Li.fabric.MzPage.prototype,"backgroundFill",{get:function(){return this._backgroundFill},set:function(e){this._backgroundFill=e,null===e?this.displayBackground.set("fill",this.defaultPageBackgroundColor):this.displayBackground.set("fill",e)}})},so=function(){Li.fabric.MzTextGroup=function(){this.id=0,this.textBoxes=[],this.groupOverflow=!1,this.init=function(){this.id=Qt.a.uniqidplus(),Li.fabric.textGroups.set(this.id,this)},this.delete=function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.textBoxes[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var l=r.value;l.textgroupId=null,l.parentTextBoxId=null,l.childTextBoxId=null,l.hasReflow=!1}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}Li.fabric.textGroups.delete(this.id)},this.add=function(e){this.textBoxes.push(e),e.textgroupId=this.id},this.containsTextbox=function(e){return void 0!==this.textBoxes.find((function(t){return t.id===e}))},this.getRootTextbox=function(){return this.textBoxes[0]},this.getLastTexBox=function(){return this.textBoxes[this.textBoxes.length-1]},this.updateGroupTextOverflow=function(){for(var e=this.textBoxes[this.textBoxes.length-1].textOverflow,t=this.textBoxes[this.textBoxes.length-1].textOverflowLength,i=0;i<this.textBoxes.length;i++)this.textBoxes[i].textOverflow=e,this.textBoxes[i].textOverflowLength=t},this.drawAllBorders=function(e){for(var i=1;i<this.textBoxes.length;i++)this.textBoxes[i]._renderControls(e)}},Li.fabric.textGroups=new Map}
1,lo=function(){var e=Li.fabric.MzCanvas.prototype._beforeTransform,t=Li.fabric.MzCanvas.prototype._performTransformAction;Li.fabric.MzCanvas.prototype._beforeTransform=function(t){return this._currentTransform.cropX=this._currentTransform.target.cropX,this._currentTransform.cropY=this._currentTransform.target.cropY,e.call(this,t)},Li.fabric.MzCanvas.prototype.cropTransform=function(e,t,n,r){var o=e.getOriginalSize(),l=Math.max(0,Math.min(o.width-e.width,t.cropX-(n-t.lastX))),c=Math.max(0,Math.min(o.height-e.height,t.cropY-(r-t.lastY))),d=e.cropX!==l,h=e.cropY!==c;return e.set("cropX",l),e.set("cropY",c),d||h},Li.fabric.MzCanvas.prototype._rotateObject=function(e,t){var n=this._currentTransform,r=n.target,o=r.translateToOriginPoint(r.getCenterPoint(),n.originX,n.originY);if(r.lockRotation)return!1;var l=Math.atan2(n.ey-o.y,n.ex-o.x),c=Math.atan2(t-o.y,e-o.x),d=Li.fabric.util.radiansToDegrees(c-l+n.theta),h=!0;if(r.snapAngle>0){var f=r.snapAngle,m=r.snapThreshold||f,y=Math.ceil(d/f)*f,v=Math.floor(d/f)*f;Math.abs(d-v)<m?d=v:Math.abs(d-y)<m&&(d=y)}return d<0&&(d=360+d),d=Math.round(d%360),n.shiftKey&&(d=45*Math.round(d/45)),r.angle===d?h=!1:(r.angle=d,r.setPositionByOrigin(o,n.originX,n.originY)),h},Li.fabric.MzCanvas.prototype._performTransformAction=function(e,n,r){var o=r.x,l=r.y,c=n.action,d=!1,h={target:n.target,e:e,transform:n,pointer:r};if("edit"!==c)return"crop"!==c?t.call(this,e,n,r):((d=this.cropTransform(n.target,n,o,l))&&(this._fire("cropping",h),this.setCursor(h.target.moveCursor||this.moveCursor)),void(n.actionPerformed=n.actionPerformed||d))}},co="rgba(120,120,120,1)",uo=function(){var e;Li.fabric.util.object.extend(Li.fabric.MzCanvas.prototype,{gridEnabled:!1,gridSize:1,gridSizeX:1,gridSizeY:1,gridOffsetX:1,gridOffsetY:1,gridCanvasEl:null,contextGrid:null,rulerEnabled:!1,marginRendererGroup:null,colmunEnabled:!1,columnMagnetMargin:10,columnMagnetEnabled:!1,columnRendererGroup:null,columnAnchors:[],rowAnchors:[],unitMode:0,units:["px","mm","%"],params:(e={zoom:1,mult:1,rWidth:1,rHeight:1},Object(o.a)(e,"rWidth",1),Object(o.a)(e,"stepX",1),Object(o.a)(e,"stepY",1),Object(o.a)(e,"lastValX",1),Object(o.a)(e,"lastValY",1),Object(o.a)(e,"unit","px"),Object(o.a)(e,"zeroX",1),Object(o.a)(e,"zeroY",1),Object(o.a)(e,"prevViewportTransform",[0,0]),Object(o.a)(e,"mt",0),Object(o.a)(e,"ml",0),Object(o.a)(e,"mr",0),Object(o.a)(e,"mb",0),e),initGrid:function(e){this.createGridCanvas()},createGridCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,"");this.gridCanvasEl?this.gridCanvasEl.className="":this.gridCanvasEl=this._createCanvasElement(),Li.fabric.util.addClass(this.gridCanvasEl,"grid-canvas "+e),this.wrapperEl.insertBefore(this.gridCanvasEl,this.upperCanvasEl),this._copyCanvasStyle(this.lowerCanvasEl,this.gridCanvasEl),this._applyCanvasStyle(this.gridCanvasEl),this.contextGrid=this.gridCanvasEl.getContext("2d")},updateZoom:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getZoom();if(!1===e&&this.params.zoom===t)return!1;switch(this.params.zoom=t,this.params.ml=Li.fabric.page.marginLeft*this.params.zoom,this.params.mt=Li.fabric.page.marginTop*this.params.zoom,this.params.mr=Li.fabric.page.marginRight*this.params.zoom,this.params.mb=Li.fabric.page.marginBottom*this.params.zoom,this.params.rWidth=Li.fabric.page.pageRect.width*this.params.zoom,this.params.rHeight=Li.fabric.page.pageRect.height*this.params.zoom,this.params.unit=this.units[this.unitMode],this.params.mult=1,this.unitMode){case 0:this.params.mult=this.params.zoom<2.8?this.params.zoom<.5?100:10:1,this.params.stepX=this.params.stepY=this.params.mult*this.params.zoom,this.params.lastValX=Li.fabric.page.pageRect.width,this.params.lastValY=Li.fabric.page.pageRect.height,this.gridSizeX=this.gridSizeY=this.params.mult;break;case 2:var n=.01;this.params.stepX=this.params.rWidth*n,this.params.stepY=this.params.rHeight*n,(this.params.stepX<3||this.params.stepY<3)&&(n=.05,this.params.stepX=this.params.rWidth*n,this.params.stepY=this.params.rHeight*n,this.params.mult=5),this.gridSizeX=Li.fabric.page.pageRect.width*n,this.gridSizeY=Li.fabric.page.pageRect.height*n,this.params.lastV
1alX=this.params.lastValY=100;break;case 1:default:this.gridSizeX=Li.fabric.page.format.canvasWidth/Li.fabric.page.format.formatBase.pageWidth,this.gridSizeY=Li.fabric.page.format.canvasHeight/Li.fabric.page.format.formatBase.pageHeight,this.params.stepX=this.gridSizeX*this.params.zoom,this.params.stepY=this.gridSizeY*this.params.zoom,(this.params.stepX<3||this.params.stepY<3)&&(this.params.mult=10,this.gridSizeX=this.gridSizeY=Qt.a.convertMilimetersToPixels(this.params.mult,Li.fabric.page.format.dpi),this.params.stepX=this.params.stepY=Qt.a.convertMilimetersToPixels(this.params.zoom*this.params.mult,Li.fabric.page.format.dpi),this.params.unit="cm"),this.params.lastValX=Li.fabric.page.format.formatBase.pageWidth-(Li.fabric.page.format.printMargins.left+Li.fabric.page.format.printMargins.right),this.params.lastValY=Li.fabric.page.format.formatBase.pageHeight-(Li.fabric.page.format.printMargins.top+Li.fabric.page.format.printMargins.bottom)}return this.gridSizeX*=this.gridSize,this.gridSizeY*=this.gridSize,this.gridOffsetX=Li.fabric.page.pageRect.left%this.gridSizeX,this.gridOffsetY=Li.fabric.page.pageRect.top%this.gridSizeY,!0},updatePan:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(!0===e||this.viewportTransform[4]!==this.params.prevViewportTransform[0]||this.viewportTransform[5]!==this.params.prevViewportTransform[1])&&(this.params.prevViewportTransform[0]=this.viewportTransform[4],this.params.prevViewportTransform[1]=this.viewportTransform[5],this.params.zeroX=Li.fabric.page.pageRect.left*this.params.zoom+this.viewportTransform[4],this.params.zeroY=Li.fabric.page.pageRect.top*this.params.zoom+this.viewportTransform[5],!0)},drawGrid:function(e){for(var t=this.params.stepX*this.gridSize,n=this.params.stepY*this.gridSize,r=5*t*this.params.mult,o=Math.round(this.params.zeroX/r)+1,l=this.params.zeroX-r*o+t,c=5*n*this.params.mult,d=Math.round(this.params.zeroY/c)+1,h=this.params.zeroY-c*d+n,f=0,m=l;m<=this.width;m+=t)e.beginPath(),f++,e.strokeStyle=f%5==0?"rgba(50,140,140,0.2)":"rgba(120,120,120,0.1)",e.moveTo(m,0),e.lineTo(m,this.height),e.stroke();f=0;for(var y=h;y<=this.height;y+=n)e.beginPath(),f++,e.strokeStyle=f%5==0?"rgba(50,140,140,0.2)":"rgba(120,120,120,0.1)",e.moveTo(0,y),e.lineTo(this.width,y),e.stroke()},drawRulers:function(e){var t=this,n=0,r=20,o=this.params.zeroX+this.params.rWidth,l=this.params.zeroY+this.params.rHeight;e.fillStyle="rgba(120,0,0,0.1)",e.fillRect(0,0,this.params.zeroX-this.params.ml,20),e.fillRect(o+this.params.mr,0,this.width-o,20),e.fillRect(0,0,20,this.params.zeroY-this.params.mt),e.fillRect(0,l+this.params.mb,20,this.height-l),e.fillStyle="rgba(0,120,120,0.2)",e.fillRect(this.params.zeroX-this.params.ml,0,this.params.ml,20),e.fillRect(o,0,this.params.mr,20),e.fillRect(0,this.params.zeroY-this.params.mt,20,this.params.mt),e.fillRect(0,l,20,this.params.mb),e.fillStyle="rgba(0,0,0,0.1)",e.fillRect(this.params.zeroX,0,this.params.rWidth,20),e.fillRect(0,this.params.zeroY,20,this.params.rHeight),e.font="9px Poppins",e.fillStyle=co,e.fillText(this.params.unit,5,10);for(var c=this.params.zeroX;c<=o;c+=this.params.stepX)e.beginPath(),n%10==0||0===n?(e.strokeStyle=co,r=0):(e.strokeStyle="rgba(50,140,140,0.5)",r=n%5==0?10:15),e.moveTo(c,r),e.lineTo(c,20),e.stroke(),n%10==0&&(e.fillStyle=co,e.fillText((n*this.params.mult).toString(),c+2,10)),n++;n--,n=0;for(var d=function(o){e.beginPath(),n%10==0||0===n?(e.strokeStyle=co,r=0):(e.strokeStyle="rgba(50,140,140,0.5)",r=n%5==0?10:15),e.moveTo(r,o),e.lineTo(20,o),e.stroke(),n%10==0&&(e.fillStyle=co,(n*t.params.mult).toString().split("").forEach((function(t,i){e.fillText(t,5,o+2+8*(1+i))}))),n++},h=this.params.zeroY;h<=l;h+=this.params.stepY)d(h);n--},renderGrid:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.contextGrid){var t=!1;this.gridEnabled||this.rulerEnabled||this.colmunEnabled&&this.columnMagnetEnabled?(t=this.updateZoom(e),!1!==(t=this.updatePan(e)||t)&&(this.clearContext(this.contextGrid),this.gridEnabled&&this.drawGrid(this.contextGrid),this.rulerEnabled&&this.drawRulers(this.contextGrid))):e&&this.clearContext(this.contextGrid)}},setGridSize:function(e){this.gridSize=parseInt(e),this.renderGrid(!0)},setGridUnitMode:function(e){this.unitMode=e,this.renderGrid(!0)},switchGridMode:function(e){this.gridEnabled=e,this.gridEnabled?this.on("object:moving",this.moveSnapedToGrid):this.off("object:moving",this.moveSnapedToGrid),this.renderGrid(!0)},switchRulerMode:function(e){this.rulerEnabled=e,this.renderGrid(!0)},switchMarginAndColumnMode:function(e){this.colmunEnabled=e,this.columnRendererGroup&&(this.columnRendererGroup.visible=e),this.marginRendererGroup&&(this.marginRendererGroup.visible=e),this.requestRenderAll(),this.renderGrid(!0)},switchColumnMode:function(e){this.colmunEnabled=e,this.columnRendererGroup&&(this.columnRendererGroup.visible=e),this.requestRenderAll(),this.renderGrid(!0)},setColumnMagnetMargin:function(e){this.columnMagnetMargin=parseInt(e),this.renderGrid(!0)},switchColumnMagnetMode:function(e){this.columnMagnetEnabled=e&&Li.fabric.page.format&&Li.fabric.page.format.grid&&Li.fabric.page.format.grid.column>0,this.columnMagnetEnabled?this.on("object:moving",this.moveSnapedToColumn):this.off("object:moving",this.moveSnapedToColumn),this.renderGrid(!0)},roundToGrid:function(p,e){return Math.round(p/e)*e},roundToColumn:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=null,r=null,o=!0,l=!1,c=void 0;try{for(var d,h=this.columnAnchors[Symbol.iterator]();!(o=(d=h.next()).done);o=!0){var f=d.value;if(f-this.columnMagnetMargin<e&&f+this.columnMagnetMargin>e){var m=Math.abs(f-e);(null===n||m<r)&&(n=f,r=m)}if(null!==t&&t>0&&f-this.columnMagnetMargin<e+t&&f+this.columnMagnetMargin>e+t){var y=Math.abs(f-(e+t));(null===n||y<r)&&(n=f-t,r=y)}}}catch(e){l=!0,c=e}finally{try{o||null==h.return||h.return()}finally{if(l)throw c}}return null!==n?n:e},roundToRow:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=null,r=null,o=!0,l=!1,c=void 0;try{for(var d,h=this.rowAnchors[Symbol.iterator]();!(o=(d=h.next()).done);o=!0){var f=d.value;if(f-this.columnMagnetMargin<e&&f+this.columnMagnetMargin>e){var m=Math.abs(f-e);(null===n||m<r)&&(n=f,r=m)}else if(null!==t&&t>0&&f-this.columnMagnetMargin<e+t&&f+this.columnMagnetMargin>e+t){var y=Math.abs(f-(e+t));(null===n||y<r)&&(n=f-t,r=y)}}}catch(e){l=!0,c=e}finally{try{o||null==h.return||h.return()}finally{if(l)throw c}}return null!==n?n:e},moveSnapedToGrid:function(e){this.snappingEnabled||this.colmunEnabled&&this.columnMagnetEnabled||0==e.target.angle&&(e.target.set({left:this.roundToGrid(e.target.left,this.gridSizeX)+this.gridOffsetX,top:this.roundToGrid(e.target.top,this.gridSizeY)+this.gridOffsetY}).setCoords(),this.requestRenderAll())},moveSnapedToColumn:function(e){this.snappingEnabled||this.colmunEnabled&&0==e.target.angle&&(e.target.set({left:this.roundToColumn(e.target.left,e.target.getScaledWidth()),top:this.roundToRow(e.target.top,e.target.getScaledHeight())}
1).setCoords(),this.requestRenderAll())},snapPointToGridOrColumn:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t&&t.target&&0!=t.target.angle)return e;if(this.colmunEnabled&&this.columnMagnetEnabled){var n=t&&t.target?t.target:null,r=t&&t.action?t.action:null;if(!n)return{x:this.roundToColumn(e.x),y:this.roundToRow(e.y)};var o="right"===t.originX,l="bottom"===t.originY,c=n.left,d=n.top,h=n.getScaledWidth(),f=n.getScaledHeight(),m=c+h,y=d+f,v={x:e.x,y:e.y};if("scaleX"===r||"scale"===r)if(o){var _=m-e.x,O=this.roundToColumn(_);v.x=m-O}else{var E=c+e.x,k=this.roundToColumn(E);v.x=k-c}if("scaleY"===r||"scale"===r)if(l){var S=y-e.y,A=this.roundToRow(S);v.y=y-A}else{var T=d+e.y,P=this.roundToRow(T);v.y=P-d}return v}if(this.gridEnabled){var C={x:this.roundToGrid(e.x-(t?0:this.gridOffsetX),this.gridSizeX)+(t?0:this.gridOffsetX),y:this.roundToGrid(e.y-(t?0:this.gridOffsetY),this.gridSizeY)+(t?0:this.gridOffsetY)};return C}return e}})},po=function(e,t,n,r,o,l){r<2*l&&(l=r/2),o<2*l&&(l=o/2),e.beginPath(),e.moveTo(t+l,n),e.arcTo(t+r,n,t+r,n+o,l),e.arcTo(t+r,n+o,t,n+o,l),e.arcTo(t,n+o,t,n,l),e.arcTo(t,n,t+r,n,l),e.closePath(),e.stroke()},ho=function(e,t,n,r,o,l){r<2*l&&(l=r/2),o<2*l&&(l=o/2),e.save(),e.beginPath(),e.moveTo(t+l,n),e.arcTo(t+r,n,t+r,n+o,l),e.arcTo(t+r,n+o,t,n+o,l),e.arcTo(t,n+o,t,n,l),e.arcTo(t,n,t+r,n,l),e.closePath(),e.clip(),e.clearRect(t,n,r,o),e.restore()},fo=function(e,t,n,r){e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.strokeStyle=r,e.lineWidth=1,e.setLineDash([2,2]),e.stroke()},mo=function(e,t,n,r,o){var l,c=r,d=Math.PI/8;l=Math.atan2(n.y-t.y,n.x-t.x),e.save(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.strokeStyle=o,e.lineWidth=1,e.setLineDash([8,4,2,4]),e.stroke(),e.lineTo(n.x-c*Math.cos(l-d),n.y-c*Math.sin(l-d)),e.lineTo(n.x-.7*c*Math.cos(l),n.y-.7*c*Math.sin(l)),e.lineTo(n.x-c*Math.cos(l+d),n.y-c*Math.sin(l+d)),e.lineTo(n.x,n.y),e.fillStyle=o,e.fill(),e.restore()},go=function(){Li.fabric.util.object.extend(Li.fabric.MzCanvas.prototype,{useCanvasEffect:!1,effectCanvasEl:null,contextEffect:null,effectType:"border",useCssBlurFilter:!1,effectPadding:10,effectEnabled:!1,overObjects:null,selectedObjects:null,updateEffectCanvasOnRender:!1,initEffectCanvas:function(e){this.useCanvasEffect=!0,this.createEffectCanvas()},createEffectCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,"");this.effectCanvasEl?this.effectCanvasEl.className="":this.effectCanvasEl=this._createCanvasElement(),Li.fabric.util.addClass(this.effectCanvasEl,"effect-canvas "+e),this.wrapperEl.insertBefore(this.effectCanvasEl,this.upperCanvasEl),this._copyCanvasStyle(this.lowerCanvasEl,this.effectCanvasEl),this._applyCanvasStyle(this.effectCanvasEl),this.contextEffect=this.effectCanvasEl.getContext("2d"),"blur"===this.effectType&&(!0===this.useCssBlurFilter?this.effectCanvasEl.style.filter="blur(2px)":this.contextEffect.filter="blur(2px)")},renderEffect:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null!==this.contextEffect&&(!0===this.effectEnabled?(this.clearContext(this.contextEffect),this.effectPadding=10*this.getZoom(),this.updateEffectCanvasOnRender=!0,!0===e&&this.renderAll()):!0===e&&this.clearContext(this.contextEffect))},renderCanvas:function(e,t){null!==e&&(this.callSuper("renderCanvas",e,t),!0===this.effectEnabled&&!0===this.updateEffectCanvasOnRender&&(this.updateEffectCanvasOnRender=!1,null!==this.contextEffect&&("blur"===this.effectType?this.drawBlur(this.contextEffect):"border"===this.effectType&&this.drawBorder(this.contextEffect))))},addOverEffect:function(object){if(null!==this.contextEffect){if("MzTextbox"===object.type&&!0===object.hasReflow){var e=Li.fabric.textGroups.get(object.textgroupId);this.overObjects=e?Object(tt.a)(e.textBoxes):[object]}else this.overObjects=[object];this.effectEnabled=!0,this.renderEffect(!0)}},removeOverEffect:function(){this.overObjects=null,this.effectEnabled=null!==this.overObjects||null!==this.selectedObjects,this.renderEffect(!0)},addSelectedEffect:function(object){if(null!==this.contextEffect){if("MzTextbox"===object.type&&!0===object.hasReflow){var e=Li.fabric.textGroups.get(object.textgroupId);this.selectedObjects=e?Object(tt.a)(e.textBoxes):[object]}else this.selectedObjects=[object];this.effectEnabled=!0,this.renderEffect()}},removeSelectedEffect:function(){this.selectedObjects=null,this.effectEnabled=null!==this.overObjects||null!==this.selectedObjects,this.renderEffect(!0)},drawBorder:function(e){this.applyEffectCanvasTransform(e),null!==this.selectedObjects&&this.drawBorderForObjects(e,this.selectedObjects,"#0d1787"),null!==this.overObjects&&this.drawBorderForObjects(e,this.overObjects,"#345dee")},drawBorderForObjects:function(e,t,n){var r=this;e.lineWidth=2,e.strokeStyle=n;for(var o=function(i){var n=t[i].group?t[i].group.getBoundingRect
1():t[i].getBoundingRect();po(e,n.left-r.effectPadding,n.top-r.effectPadding,n.width+2*r.effectPadding,n.height+2*r.effectPadding,r.effectPadding)},i=0;i<t.length;i++)o(i);if(t.length>1)for(var l=0;l<t.length;l++){var c=t[l].group?t[l].group.getBoundingRect():t[l].getBoundingRect();ho(e,c.left-this.effectPadding+1,c.top-this.effectPadding+1,c.width+2*this.effectPadding-2,c.height+2*this.effectPadding-2,this.effectPadding)}},drawBlur:function(e){var t=this;this.applyEffectCanvasTransform(e);var n=this.width*this._canvasRatioWidth,r=this.height,o=Li.fabric.page.displayBackground.getBoundingRect();o.left<0&&(o.width-=o.left,o.left=0),o.left+o.width>n&&(o.width=n-o.left),o.top<0&&(o.height-=o.top,o.top=0),o.top+o.height>r&&(o.height=r-o.top);var l=this.contextContainer.getImageData(o.left,o.top,o.width,o.height);!0===this.useCssBlurFilter?(e.putImageData(l,o.left,o.top),this.drawBlurFilterAndClearObjectRect(e,o)):createImageBitmap(l).then((function(n){e.drawImage(n,o.left,o.top),t.drawBlurFilterAndClearObjectRect(e,o)}))},drawBlurFilterAndClearObjectRect:function(e,t){e.fillStyle="#00000015",e.fillRect(t.left,t.top,t.width,t.height);for(var i=0;i<this.overObjects.length;i++){var n=this.overObjects[i].getBoundingRect();e.clearRect(n.left-this.effectPadding,n.top-this.effectPadding,n.width+2*this.effectPadding,n.height+2*this.effectPadding)}},applyEffectCanvasTransform:function(e){if(e&&this.lowerCanvasEl&&this.width&&this.height){var t=this.lowerCanvasEl.width/this.width,n=this.lowerCanvasEl.height/this.height;e.setTransform(t,0,0,n,0,0)}}})},bo=function(){Li.fabric.util.object.extend(Li.fabric.MzCanvas.prototype,{spaceIsDown:!1,keyboardListenersEnabled:!1,initKeyboardControl:function(){this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.initKeyboardListeners=this.initKeyboardListeners.bind(this),this.removeKeyboardListeners=this.removeKeyboardListeners.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),Li.fabric.util.addListener(this.wrapperEl,"mouseenter",this.onMouseEnter),Li.fabric.util.addListener(this.wrapperEl,"mouseleave",this.onMouseLeave),this.upperCanvasEl.tabIndex=1,this.upperCanvasEl.style.border="none",this.upperCanvasEl.style.outline="none",Li.fabric.util.addListener(this.upperCanvasEl,"focus",this.onFocus),Li.fabric.util.addListener(this.upperCanvasEl,"blur",this.onBlur),this.on("text:editing:entered",this.removeKeyboardListeners),this.on("text:editing:exited",this.initKeyboardListeners)},onMouseEnter:function(){document.activeElement!==this.upperCanvasEl&&this.upperCanvasEl.focus()},onMouseLeave:function(){document.activeElement!==this.upperCanvasEl&&this.removeKeyboardListeners()},onFocus:function(){this.initKeyboardListeners()},onBlur:function(){this.removeKeyboardListeners()},disableKeyboardControl:function(){Li.fabric.util.removeListener(this.wrapperEl,"mouseenter",this.onMouseEnter),Li.fabric.util.removeListener(this.wrapperEl,"mouseleave",this.onMouseLeave),Li.fabric.util.removeListener(this.upperCanvasEl,"focus",this.onFocus),Li.fabric.util.removeListener(this.upperCanvasEl,"blur",this.onBlur),this.off("text:editing:entered",this.removeKeyboardListeners),this.off("text:editing:exited",this.initKeyboardListeners),this.removeKeyboardListeners()},initKeyboardListeners:function(){this.keyboardListenersEnabled||(Li.fabric.util.addListener(window,"keydown",this.onKeyDown),Li.fabric.util.addListener(window,"keyup",this.onKeyUp),this.keyboardListenersEnabled=!0)},removeKeyboardListeners:function(){this.keyboardListenersEnabled&&(Li.fabric.util.removeListener(window,"keydown",this.onKeyDown),Li.fabric.util.removeListener(window,"keyup",this.onKeyUp),this.keyboardListenersEnabled=!1,this.spaceIsDown&&(this.spaceIsDown=!1,this.setObjectsSelectable(!0)))},onKeyUp:function(e){switch(e.preventDefault(),e.code){case"Space":this.spaceIsDown=!1,this.setObjectsSelectable(!0)}},onKeyDown:function(e){switch(e.preventDefault(),e.key){case"z":e.ctrlKey&&Li.fabric.history.undo();break;case"y":e.ctrlKey&&Li.fabric.history.redo();break;case"ArrowDown":this.moveObject(0,e.shiftKey?10:1);break;case"ArrowUp":this.moveObject(0,e.shiftKey?-10:-1);break;case"ArrowLeft":this.moveObject(e.shiftKey?-10:-1,0);break;case"ArrowRight":this.moveObject(e.shiftKey?10:1,0);break;case" ":this.spaceIsDown=!0,this.setObjectsSelectable(!1)}}})};function yo(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function vo(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?yo(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):yo(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var _o=function(){var e;Li.fabric.util.object.extend(Li.fabric.MzCanvas.prototype,{origX:0,origY:0,drawingObject:null,isDown:!1,drawModeEnabled:!1,previousDefaultCursor:null,drawType:0,drawOptions:null,drawColor:"#000000",initShapeDraw:function(e){},switchDrawMode:function(e){!0===e?this.initDraw():this.stopDraw()},autoDraw:function(){var e=Li.fabric.page.pageRect.width/2,t=Li.fabric.page.pageRect.height/2,n=100,r=100;switch(console.log("autoDraw",e,t,n,r),console.log("canvas dimension",Li.fabric.page),this.drawType){case 0:n=200,r=0;break;case 1:break;case 2:n=400,r=200;break;case 3:n=r=50;break;case 4:break;case 5:n=r=250}this.createDrawingObject(e-n/2,t-r/2,e+n/2,t+r/2),this.drawEnds()},initDraw:function(){!0!==this.drawModeEnabled&&(this.drawModeEnabled=!0,this.previousDefaultCursor=this.defaultCursor,this.defaultCursor="crosshair",this.setObjectsSelectable(!1),this.on("mouse:down",this.drawStart),this.on("mouse:move",this.drawChange),this.on("mouse:up",this.drawEnds))},stopDraw:function(){this.drawModeEnabled=!1,this.defaultCursor=this.previousDefaultCursor||"default",this.previousDefaultCursor=null,this.setObjectsSelectable(!0),this.off("mouse:down",this.drawStart),this.off("mouse:move",this.drawChange),this.off("mouse:up",this.drawEnds)},drawStart:(e=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.isDown=!0,n=this.getPointer(t.e),r=this.snapPointToGridOrColumn(n),this.origX=r.x,this.origY=r.y,this.createDrawingObject(this.origX,this.origY,n.x,n.y);case 6:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)}),createDrawingObject:function(e,t,n,r){switch(console.log("createDrawingObject",this.drawType),console.log("drawOptions",this.drawOptions),console.log("drawColor",this.drawColor),this.drawType){case 0:this.drawingObject=new Li.fabric.MzLine([e,t,n,r],vo({strokeWidth:2,stroke:this.drawColor},this.drawOptions));break;case 1:this.drawingObject=new Li.fabric.MzRect(vo({left:e,top:t,originX:"left",originY:"top",width:n-e,height:r-t,angle:0,fill:this.drawColor,stroke:null,strokeWidth:0},this.drawOptions));break;case 2:this.drawingObject=new Li.fabric.MzTextbox("",vo({placeholder:"Enter text",left:e,top:t,originX:"left",originY:"top",width:n-e,height:r-t,angle:0,fill:this.drawColor,fontSize:50,stroke:null,strokeWidth:0},this.drawOptions));break;case 3:this.drawingObject=new Li.fabric.MzCircle(vo({left:e,top:t,originX:"left",originY:"top",rx:n-e,ry:r-t,angle:0,fill:this.drawColor,stroke:null,strokeWidth:0},this.drawOptions));break;case 4:this.drawingObject=new Li.fabric.MzTriangle(vo({left:e,top:t,originX:"left",originY:"top",width:n-e,height:r-t,angle:0,fill:this.drawColor,stroke:null,strokeWidth:0},this.drawOptions));break;case 5:this.drawingObject=new Li.fabric.MzImage("",vo({left:e,top:t,originX:"left",originY:"top",width:n-e,height:r-t,angle:0,backgroundColor:"rgba(0, 0, 0, 0.15)"},this.drawOptions))}this.drawingObject.hasControls=!1,this.add(this.drawingObject),this.requestRenderAll(),this.setActiveObject(this.drawingObject)},drawChange:function(e){if(this.isDown){var t=this.getPointer(e.e),n=this.snapPointToGridOrColumn(t),r=n.x,o=n.y,l=Math.abs(this.origX-r),c=Math.abs(this.origY-o);switch(this.drawType){case 0:if(!0===e.e.ctrlKey){var d=r-this.origX,h=o-this.origY,f=Math.sqrt(d*d+h*h),m=Math.atan2(h,d)/Math.PI*180;m=m%360+180,m=15*parseInt((m+7.4)%360/15),m-=180;var y=f*Math.cos(m*Math.PI/180),v=f*Math.sin(m*Math.PI/180);this.drawingObject.set({x2:y+this.origX,y2:v+this.origY})}else this.drawingObject.set({x2:r,y2:o});break;case 1:case 2:case 3:case 4:default:this.origX>r&&this.drawingObject.set({left:Math.abs(r)}),this.origY>o&&this.drawingObject.set({top:Math.abs(o)}),!0===e.e.ctrlKey&&(l=c=Math.max(l,c)),this.drawingObject.set({width:l}),this.drawingObject.set({height:c})}this.renderAll()}},drawEnds:function(e){this.isDown=!1,this.drawingObject.hasControls=!0,this.drawingObject.hasBorders=!0,this.requestRenderAll(),this.drawingObject.setCoords(),this.stopDraw(),this.setActiveObject(this.drawingObject),this.fire("object:drawn",{target:this.drawingObject})}})}
1,Oo=function(){Li.fabric.util.object.extend(Li.fabric.MzCanvas.prototype,{maxScrollY:0,maxScrollX:0,useSpaceForPanning:!0,zoomModeEnabled:!1,_canvasRatioWidth:1,restoreSelectionAfterPanning:!1,initViewportControl:function(e){this.maxScrollY=e.maxScrollY,this.maxScrollX=e.maxScrollX,this.useSpaceForPanning=e.useSpaceForPanning,this.initZoom(),this.initImageControls(),this.initPanning()},disableViewportControl:function(){this.disablePanning(),this.disableZoom(),this.disableImageControl()},initZoom:function(){this.on("mouse:wheel",this.onZoom)},disableZoom:function(){this.off("mouse:wheel",this.onZoom)},switchZoomMode:function(e){this.zoomModeEnabled=e,this.zoomModeEnabled?(this.defaultCursor="nwse-resize",this.hoverCursor="nwse-resize",this.unselectActiveObject(),this.setObjectsSelectable(!1),this.on("mouse:down",this.onZoom)):(this.defaultCursor="default",this.hoverCursor="move",this.off("mouse:down",this.onZoom),this.setObjectsSelectable(!0))},initPanning:function(){this.on("mouse:down",this.onMouseDown)},disablePanning:function(){this.off("mouse:down",this.onMouseDown),this.off("mouse:move",this.onPanMove),this.off("mouse:up",this.onPanStop)},initImageControls:function(){this.on("before:transform",this.onObjectMove)},disableImageControl:function(){this.off("before:transform",this.onObjectMove)},onObjectMove:function(e){"MzImage"===e.transform.target.type&&e.transform.shiftKey&&"drag"===e.transform.action&&(e.transform.action="crop")},onMouseDown:function(e){if(!this.drawModeEnabled){if(this.selection&&e.e.shiftKey)return this.enableSelectionRect=!0,void this.on("mouse:up",this.onSelectStop);(this.useSpaceForPanning?this.spaceIsDown:null===e.target||3===e.button)&&this.startPan(e),e.transform&&"edit"===e.transform.action&&("MzTextbox"===e.transform.target.type?this.fire("text:editContent"):"MzImage"===e.transform.target.type?this.fire("image:editContent"):"MzShapeGroup"===e.transform.target.type&&this.fire("shapeGroup:editContent"))}},startPan:function(e){this.discardActiveObject(),this.isDragging=!0,this.restoreSelectionAfterPanning=this.selection,this.selection=!1,this.lastPosX=e.e.clientX,this.lastPosY=e.e.clientY,this.on("mouse:move",this.onPanMove),this.on("mouse:up",this.onPanStop),this.off("mouse:down",this.onMouseDown)},onPanMove:function(e){if(this.isDragging){var t=this.viewportTransform.slice(0);t[4]+=e.e.clientX-this.lastPosX,t[5]+=e.e.clientY-this.lastPosY,this.setViewportTransform(t),this.zoomOrPanHasChange(),this.lastPosX=e.e.clientX,this.lastPosY=e.e.clientY}},onPanStop:function(e){this.off("mouse:move",this.onPanMove),this.off("mouse:up",this.onPanStop),this.isDragging=!1,this.restoreSelectionAfterPanning&&(this.selection=!0);for(var t=this.getObjects(),i=0;i<t.length;i++)t[i].setCoords();this.on("mouse:down",this.onMouseDown)},onSelectStop:function(e){this.off("mouse:up",this.onSelectStop),this.enableSelectionRect=!1},setZoom:function(e){var t=this.getWidth()*this._canvasRatioWidth,n=this.getHeight(),r=this.maxScrollX*this.viewportTransform[0],o=this.maxScrollY*this.viewportTransform[3],l=this.viewportTransform[4],c=this.viewportTransform[5],d=this.viewportTransform[0]<e,h=t/2;l+r/2<t/2-100?h=d?l:l+r:l+r/2>t/2+100&&(h=d?l+r:l);var f=n/2;return c+o/2<n/2-100?f=d?c:c+o:c+o/2>n/2+100&&(f=d?c+o:c),this.zoomToPoint(new Li.fabric.Point(h,f),e),this.zoomOrPanHasChange(),this},onZoom:function(e){if(e.e.preventDefault(),e.e.stopPropagation(),e.target&&e.e.shiftKey)return this.onWheelScale(e);var t;if(!((t=void 0!==e.e.deltaY&&null!==e.e.deltaY?0===e.e.deltaMode?-1*Math.round(e.e.deltaY/3.5):-1*Math.round(5*e.e.deltaY):e.e.altKey?-25:25)>-15&&t<15)){t<-15?t=-15:t>15&&(t=15);var n=Math.min(3,Math.max(.1,.01*Math.round(100*this.getZoom()+t)));n=.05*Math.round(n/.05),this.zoomToPoint({x:e.e.offsetX,y:e.e.offsetY},n),this.zoomOrPanHasChange()}},zoomOrPanHasChange:function(){this.checkViewportLimits(),this.renderGrid(),this.renderEffect(),this.fire("canvas:zoom",{zoom:this.getZoom()})},checkViewportLimits:function(){var e,t,n,r,o=this.getZoom(),l=this.maxScrollX*o,c=this.getWidth()*this._canvasRatioWidth,d=this.maxScrollY*o;e=c-30,t=30-l,n=this.getHeight()-30,r=30-d,this.viewportTransform[4]>e?this.viewportTransform[4]=e:this.viewportTransform[4]<t&&(this.viewportTransform[4]=t),this.viewportTransform[5]>n?this.viewportTransform[5]=n:this.viewportTransform[5]<r&&(this.viewportTransform[5]=r),this.requestRenderAll()},onWheelScale:function(e){var t=e.target,n=.01*Math.round(e.e.deltaY/50),r=.01*Qt.a.roundToPrecision(100*t.scaleX,2)-n,o=.01*Qt.a.roundToPrecision(100*t.scaleY,2)-n;r=Math.min(1,Math.max(.01,r)),o=Math.min(1,Math.max(.01,o)),t.set("scaleX",r),t.set("scaleY",o);var l={target:t,e:e.e,transform:{action:"scale"},pointer:e.absolutePointer};t.setCoords(),this.fire("object:wheelScaling",l),this.requestRenderAll()},zoomToObject:function(object){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.setZoom(1);var t=this.width/e,n=this.height/e,r=object.left-t/2,o=object.top-n/2;this.absolutePan({x:r,y:o})},zoomToTexBox:function(object){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=220,n=90,r=40,o=1.5,l=object.aCoords.tl,c=object.aCoords.br;if(object.hasReflow){var d=Li.fabric.textGroups.get(object.textgroupId);if(d)for(var i=0;i<d.textBoxes.length;i++){var h=d.textBoxes[i].aCoords.tl,f=d.textBoxes[i].aCoords.br;h.x<l.x&&(l.x=h.x),h.y<l.y&&(l.y=h.y),f.x>c.x&&(c.x=f.x),f.y>c.y&&(c.y=f.y)}}var m=l.x,y=l.y,v=c.x-l.x,_=c.y-l.y,O=.1*Math.floor(.5*this.width/(v+2*r)*10),E=.1*Math.floor(this.height/(_+t+n)*10),k=Math.min(o,O,E),S=this.getWidth()*this._canvasRatioWidth,A=m*k-(S-v*k)/2,T=y*k-t;return this.setZoomAndPosition(k,-A,-T,e),k},setZoomAndPosition:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;
1if(r<=0){var o=this.viewportTransform.slice(0);o[0]=o[3]=e,o[4]=t,o[5]=n,this.setViewportTransform(o),this.zoomOrPanHasChange()}else{var l=this,c=this.viewportTransform[4],d=this.viewportTransform[5],h=this.viewportTransform[0],f=t-c,m=n-d,y=e-h;Li.fabric.util.animate({startValue:0,endValue:1,duration:r,onChange:function(e){var t=l.viewportTransform.slice(0);t[0]=t[3]=h+y*e,t[4]=c+f*e,t[5]=d+m*e,l.setViewportTransform(t),l.fire("canvas:zoom",{zoom:l.getZoom()})},onComplete:function(){var r=l.viewportTransform.slice(0);r[0]=r[3]=e,r[4]=t,r[5]=n,l.setViewportTransform(r),l.zoomOrPanHasChange()}})}},centerOnScreen:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.getWidth()*this._canvasRatioWidth-(e.left||0)-(e.right||0),r=this.getHeight()-(e.top||0)-(e.bottom||0),o=Math.floor(n/this.maxScrollX*10)/10,l=Math.floor(r/this.maxScrollY*10)/10,c=Math.min(1,o,l),d=.5*(n-this.maxScrollX*c)+(e.left||0),h=.5*(r-this.maxScrollY*c)+(e.top||0);return this.setZoomAndPosition(c,d,h,t),c},setCanvasRatioWidth:function(e){this._canvasRatioWidth=Math.min(1,Math.max(0,e))},mouseDownTimeout:null,mouseDownTimeoutCallback:null,__onMouseDown:function(e){var t=this;this.useSpaceForPanning?this.callSuper("__onMouseDown",e):(null!==this.mouseDownTimeoutCallback&&this.mouseDownTimeoutCallback(),this.on("mouse:move",this.invalidateOnMouseDown),this.on("mouse:up:before",this.validateOnMouseDown),this.mouseDownTimeoutCallback=function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t.mouseDownTimeoutCallback=null,null!==t.mouseDownTimeout&&(clearTimeout(t.mouseDownTimeout),t.mouseDownTimeout=null),t.off("mouse:move",t.invalidateOnMouseDown),t.off("mouse:up:before",t.validateOnMouseDown),n&&t.callSuper("__onMouseDown",e)},this.mouseDownTimeout=setTimeout(this.mouseDownTimeoutCallback,150))},invalidateOnMouseDown:function(e){null!==this.mouseDownTimeoutCallback&&this.mouseDownTimeoutCallback(!1),this.startPan(e)},validateOnMouseDown:function(){null!==this.mouseDownTimeoutCallback&&this.mouseDownTimeoutCallback(!0)}})},Eo=function(){Li.fabric.util.object.extend(Li.fabric.MzCanvas.prototype,{proximityDrawTreshold:15,proximitySnapTreshold:5,currentSnappingObj:null,snappingEnabled:!1,switchSnapMode:function(e){this.snappingEnabled=e,!0===this.snappingEnabled?this.activateSnapping():this.disableSnapping()},activateSnapping:function(){this.on("object:moving",this.onSnappingObjectMoving),this.on("object:scaling",this.onSnappingObjectScaling),this.on("object:rotating",this.onSnappingObjectRotating)},disableSnapping:function(){this.off("object:moving",this.onSnappingObjectMoving),this.off("object:scaling",this.onSnappingObjectScaling),this.off("object:rotating",this.onSnappingObjectRotating),this.currentSnappingObj&&(this.currentSnappingObj.hasProximityControl=!1,this.requestRenderAll())},onSnappingObjectMoving:function(e){this.findMatchingCoord(e.target),this.moveSnapTo(e.target)},onSnappingObjectScaling:function(e){this.findMatchingCoord(e.target)},onSnappingObjectRotating:function(e){this.findMatchingCoord(e.target)},findMatchingCoord:function(e){var t=this;if(e.proximityLR=[],e.proximityTB=[],e.hasProximityControl=!1,this.currentSnappingObj=e,0==e.angle){var n=e.getSnapPoints(),r=[];this.forEachObject((function(o){var l,c;o.id!==e.id&&("MzNonInteractiveRect"===o.type&&!o.isSnappable||"MzNonInteractiveLine"===o.type||"MzNonInteractiveGroup"===o.type||0==o.angle&&(r=o.getSnapPoints(),(l=e.proximityLR).push.apply(l,Object(tt.a)(r.filter((function(th){return n.find((function(e){return Qt.a.isWithinRange(e.x,th.x,t.proximityDrawTreshold)}))})))),(c=e.proximityTB).push.apply(c,Object(tt.a)(r.filter((function(e){return n.find((function(n){return Qt.a.isWithinRange(n.y,e.y,t.proximityDrawTreshold)}))})))),e.hasProximityControl=e.proximityTB.length>0||e.proximityLR.length>0))}))}},moveSnapTo:function(e){var t=this;if(0==e.angle){var n=e._getTransformedDimensions(),r=e.getSnapPoints();e.proximityLR.some((function(o){return Qt.a.isWithinRange(r[0].x,o.x,t.proximitySnapTreshold)?(e.left=o.x+(e.left-r[0].x),!0):Qt.a.isWithinRange(r[1].x,o.x,t.proximitySnapTreshold)?(e.left=o.x+(e.left-r[1].x),!0):Qt.a.isWithinRange(r[2].x,o.x,t.proximitySnapTreshold)?(e.left=o.x-.5*n.x,!0):void 0})),e.proximityTB.some((function(o){return Qt.a.isWithinRange(r[0].y,o.y,t.proximitySnapTreshold)?(e.top=o.y+(e.top-r[0].y),!0):Qt.a.isWithinRange(r[1].y,o.y,t.proximitySnapTreshold)?(e.top=o.y+(e.top-r[1].y),!0):Qt.a.isWithinRange(r[2].y,o.y,t.proximitySnapTreshold)?(e.top=o.y-.5*n.y,!0):void 0}))}},scaleSnapTo:function(e,t,n){var r=this;if(0!=e.angle)return n;var o,l=e._getTransformedDimensions(),c=n.x,d=n.y;
1return"x"!==t&&"equally"!==t||e.proximityLR.forEach((function(t){o=e.toLocalPoint(t),Qt.a.isWithinRange(n.x,o.x,r.proximitySnapTreshold)&&(c=o.x),Math.abs(o.x)<=r.proximitySnapTreshold&&Qt.a.isWithinRange(n.x,l.x,r.proximitySnapTreshold)&&(c=l.x-o.x)})),"y"!==t&&"equally"!==t||e.proximityTB.forEach((function(t){o=e.toLocalPoint(t),Qt.a.isWithinRange(n.y,o.y,r.proximitySnapTreshold)&&(d=o.y),Math.abs(o.y)<=r.proximitySnapTreshold&&Qt.a.isWithinRange(n.y,l.y,r.proximitySnapTreshold)&&(d=l.y-o.y)})),{x:c,y:d}}})};function ko(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function So(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ko(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):ko(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var Ao=function(){var e=Li.fabric.Object.prototype.drawControls;Li.fabric.Object.prototype.proximityLR=[],Li.fabric.Object.prototype.proximityTB=[],Li.fabric.Object.prototype.hasProximityControl=!1,Li.fabric.Object.prototype.getObjectLocalCoord=function(e,t){var n=e.calcCoords(!0)[t];return this.getPointLocalCoord(n)},Li.fabric.Object.prototype.getPointLocalCoord=function(e){var t=this.getCenterPoint(),n=this.canvas.getZoom(),r=new Li.fabric.Point((e.x-t.x)*n,(e.y-t.y)*n);return r=Li.fabric.util.rotatePoint(r,new Li.fabric.Point(0,0),Li.fabric.util.degreesToRadians(-this.angle))},Li.fabric.Object.prototype.getSnapPoints=function(){var e=this.getBoundingRect(!0,!0),t=this.getCenterPoint();return[new Li.fabric.Point(e.left,e.top),new Li.fabric.Point(e.left+e.width,e.top+e.height),So({type:"center"},t)]},Li.fabric.Object.prototype.drawProximityAlignement=function(e){var t,n,r,o=this,l=this._calculateCurrentDimensions();l=l.multiply(.5),this.proximityTB.forEach((function(c){t=o.getPointLocalCoord(c),n=new Li.fabric.Point(t.x,t.y),r=new Li.fabric.Point(l.x,n.y),"center"===c.type?r.x=0:n.x>r.x&&(r.x=-l.x),fo(e,n,r,"center"===c.type?"rgb(0, 180, 180)":"rgb(200, 0, 200)")})),this.proximityLR.forEach((function(c){t=o.getPointLocalCoord(c),n=new Li.fabric.Point(t.x,t.y),r=new Li.fabric.Point(n.x,l.y),"center"===c.type?r.y=0:n.y>r.y&&(r.y=-l.y),fo(e,n,r,"center"===c.type?"rgb(0, 180, 180)":"rgb(200, 0, 200)")}))},Li.fabric.Object.prototype.drawControls=function(t,n){this.hasProximityControl&&(t.globalAlpha=this.isMoving?.8:1,this.drawProximityAlignement(t)),e.call(this,t,n)}},To=function(){var e=Li.fabric.MzCanvas.prototype._setObjectScale;Li.fabric.MzCanvas.prototype._setObjectScale=function(t,n,r,o,l,c,d){var h,f=null,m=f=this.snappingEnabled?this.scaleSnapTo(n.target,l,t):this.snapPointToGridOrColumn(t,n),y=f.x!==t.x,v=f.y!==t.y,_=m.x,O=m.y,E=n.target;if("equally"===l&&(y&&0!==d.x&&0!==E.scaleY?O=_*E.scaleX*d.y/(d.x*E.scaleY):v&&0!==d.y&&0!==E.scaleX&&(_=O*E.scaleY*d.x/(d.y*E.scaleX))),"MzTextbox"===E.type){var k=E._getTransformedDimensions(),S=Qt.a.roundToPrecision(E.width*(_/k.x),2),A=Qt.a.roundToPrecision(E.height*(O/k.y),2);return("x"===l||"equally"===l)&&S>=E.getMinWidth()&&(h=S!==E.width,E.set("width",S)),("y"===l||"equally"===l)&&A>=E.getMinHeight()&&(h=A!==E.height||h,E.set("height",A)),h}return e.call(Li.fabric.MzCanvas.prototype,{x:_,y:O},n,r,o,l,c,d)}};function Po(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Co(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Po(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Po(Object(source)).forEac
1h((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var xo=function(){Object.defineProperty(Li.fabric.MzTextbox.prototype,"textStyleKey",{get:function(){return this._textStyleKey},set:function(e){this.applyTextStyle(e)}}),Object.defineProperty(Li.fabric.MzTextbox.prototype,"dropCapStyleKey",{get:function(){return this._dropCapStyleKey},set:function(e){this.applyDropCapStyle(e)}}),Object.defineProperty(Li.fabric.MzTextbox.prototype,"bulletPointStyleKey",{get:function(){return this._bulletPointStyleKey},set:function(e){this.applyBulletPointStyle(e)}}),Object.defineProperty(Li.fabric.MzTextbox.prototype,"textLinkStyleKey",{get:function(){return this._textLinkStyleKey},set:function(e){this.applyTextLinkStyle(e)}}),Object.defineProperty(Li.fabric.MzTextbox.prototype,"endSignStyleKey",{get:function(){return this._endSignStyleKey},set:function(e){this.applyEndSignStyle(e)}}),Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{overrideStyle:null,_textStyleKey:null,_dropCapStyleKey:null,_bulletPointStyleKey:null,_textLinkStyleKey:null,_endSignStyleKey:null,initOverrideStyle:function(e){this.overrideStyle=e.overrideStyle||null,this.toObjectProps.push("overrideStyle"),0===e.opacity&&this.toogleHide(!0)},initThemeStyle:function(e){this.toObjectProps.push("_textStyleKey","_dropCapStyleKey","_bulletPointStyleKey","_textLinkStyleKey","_endSignStyleKey"),e._textStyleKey&&this.applyTextStyle(e._textStyleKey),e._dropCapStyleKey&&this.applyDropCapStyle(e._dropCapStyleKey),e._bulletPointStyleKey&&this.applyBulletPointStyle(e._bulletPointStyleKey),e._textLinkStyleKey&&this.applyTextLinkStyle(e._textLinkStyleKey),e._endSignStyleKey&&this.applyEndSignStyle(e._endSignStyleKey)},applyTextStyle:function(e){var t=this;if(this._textStyleKey=e,this.paletteSwatchName={},e){var n=Li.fabric.textStylesList?Li.fabric.textStylesList[e]:null;n&&(Object.entries(n).forEach((function(e){ji.a.setProperty(e[0],t,e[1],!1)})),this.hasReflow&&this.setAsStyleForAllReflowStack())}},applyDropCapStyle:function(e){if(this._dropCapStyleKey=e,e){var t=Li.fabric.textStylesList?Li.fabric.textStylesList[e]:null;t&&(this.dropCapStyle=Co({},t))}},applyBulletPointStyle:function(e){if(this._bulletPointStyleKey=e,e){var t=Li.fabric.textStylesList?Li.fabric.textStylesList[e]:null;t&&(this.bulletPointStyle=Co({},t))}},applyTextLinkStyle:function(e){if(this._textLinkStyleKey=e,e){var t=Li.fabric.textStylesList?Li.fabric.textStylesList[e]:null;t&&(this.textLinkStyle=Co({},t))}},applyEndSignStyle:function(e){if(this._endSignStyleKey=e,e){var t=Li.fabric.textStylesList?Li.fabric.textStylesList[e]:null;t&&(this.endSignStyle=Co({},t))}},applyOverrideStyle:function(e,t){if(!this.overrideStyle||this.overrideStyle[e]!==t){var n=this.overrideStyle?Co({},this.overrideStyle):null;this.overrideStyle||(this.overrideStyle={}),this.overrideStyle[e]=t,this._forceClearCache=!0,this.updateOnRender(),this.canvas&&this.canvas.fire("object:modified",{target:this,transform:{action:"overrideStyle",original:{overrideStyle:n}}})}},removeOverrideStyle:function(){if(null!==this.overrideStyle){var e=this.overrideStyle?Co({},this.overrideStyle):null;this.overrideStyle=null,this._forceClearCache=!0,this.updateOnRender(),this.canvas&&this.canvas.fire("object:modified",{target:this,transform:{action:"overrideStyle",original:{overrideStyle:e}}})}},toogleHide:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!1,n={opacity:this.opacity,selectable:this.selectable,evented:this.evented};1==this.opacity||e?(this.set({opacity:0,selectable:!1,evented:!1}),t=!0):(this.set({opacity:1,selectable:!0,evented:!0}),t=!0),!e&&t&&this.canvas&&this.canvas.fire("object:modified",{target:this,transform:{action:"toogleHide",original:Co({},n)}})},_generateStyleMap:function(e){for(var t=0,n=0,r=0,map={},i=0;i<e.graphemeLines.length;i++)"\n"===e.graphemeText[r]&&i>0?(n=0,r++,t++):!this.graphemeSplit&&this._reSpaceAndTab.test(e.graphemeText[r])&&i>0&&(n++,r++),map[i]={line:t,offset:n},r+=e.graphemeLines[i].length,n+=e.graphemeLines[i].length;return map},getTextBoxStyle:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={fill:e?this.paletteSwatchName.fill||"":this.fill,stroke:e?this.paletteSwatchName.stroke||"":this.stroke,strokeWidth:this.strokeWidth,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontWeight:this.fontWeight,underline:this.underline,overline:this.overline,linethrough:this.linethrough,deltaY:this.deltaY,textBackgroun
1dColor:e?this.paletteSwatchName.textBackgroundColor||"":this.textBackgroundColor,lineHeight:this.lineHeight,textAlign:this.textAlign,charSpacing:this.charSpacing,textBackgroundPadding:this.textBackgroundPadding};return t},resetAllStyles:function(){this.set("styles",{})},styleHas:function(e,t){if(this._styleMap&&!this.isWrapping){var map=this._styleMap[t];map&&(t=map.line)}if(!this.styles||!e||""===e)return!1;if(void 0!==t&&!this.styles[t])return!1;var n=void 0===t?this.styles:{0:this.styles[t]};if(null!=n)for(var r in n)if(null!=r&&null!==n[r]&&void 0!==n[r])for(var o in n[r])if(null!=o&&null!==n[r][o]&&void 0!==n[r][o]){if(null!==n[r][o][e]&&void 0!==n[r][o][e])return!0;if(n[r][o].textStyleKey){var l=Li.fabric.textStylesList?Li.fabric.textStylesList[n[r][o].textStyleKey]:null;if(l&&null!==l[e]&&void 0!==l[e]&&!1!==l[e]&&""!==l[e])return!0}else if(n[r][o].link){var c=this.getTextLinkStyle();if(c&&null!==c[e]&&void 0!==c[e]&&!1!==c[e]&&""!==c[e])return!0}}return!1},isEmptyStyles:function(e){if(e===this.textLines.length-1&&null!==this.getEndSignStyle())return!1;var t,n,r=0,o=!1,map=this._styleMap[e],l=this._styleMap[e+1];for(var c in map&&(e=map.line,r=map.offset),l&&(o=l.line===e,t=l.offset),n=void 0===e?this.styles:{line:this.styles[e]})for(var d in n[c])if(d>=r&&(!o||d<t))for(var h in n[c][d])return!1;return!0},_getStyleDeclaration:function(e,t){if(-1===t){var n=this.getStyleListByLine(e);if(n&&"bullet"===n.list&&n.bulletFill)return Co({},this._getStyleDeclaration(e,0),{},{fill:n.bulletFill});t=0}if(e===this.textLines.length-1&&t>=this.textLines[e].length-this.getEndSignCharacter().length){var r=this.getEndSignStyle();if(r)return r}if(this._styleMap&&!this.isWrapping){var map=this._styleMap[e];if(!map)return null;e=map.line,t=map.offset+t}if(this._charIndexStyleDiffMap){var o=this._charIndexStyleDiffMap[e];o&&o[t]&&(t+=o[t])}var style=Li.fabric.Text.prototype._getStyleDeclaration.call(this,e,t);return style&&style.textStyleKey&&(style=this.applyStyleKeyToStyle(style)),style&&style.link&&(style=Co({},style,{},this.getTextLinkStyle())),style&&style.script&&(style=this.applyScriptToStyle(style)),this.overrideStyle&&(style=Co({},style,{},this.overrideStyle)),style},applyStyleKeyToStyle:function(style){if(style.textStyleKey){var e=Li.fabric.textStylesList?Li.fabric.textStylesList[style.textStyleKey]:null;if(e)return Co({},e,{},style)}return style},applyScriptToStyle:function(style){var e=null;if("super"===style.script)e=this.superscript;else{if("sub"!==style.script)return style;e=this.subscript}var t=style.fontSize?style.fontSize:this.fontSize,n=style.deltaY?style.deltaY:this.deltaY;return Co({},style,{},{fontSize:t*e.size,deltaY:n+t*e.baseline})},_setStyleDeclaration:function(e,t,style){var map=this._styleMap[e];e=map.line,t=map.offset+t,this.styles[e]||(this.styles[e]=[]),this.styles[e][t]=style},_deleteStyleDeclaration:function(e,t){var map=this._styleMap[e];e=map.line,t=map.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var map=this._styleMap[e];return this.styles[map.line]},_setLineStyle:function(e,style){var map=this._styleMap[e];this.styles[map.line]=style},_deleteLineStyle:function(e){var map=this._styleMap[e];delete this.styles[map.line]}})};n(134);function Do(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var Io=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{_charIndexStyleDiffMap:{},getVariableList:function(){return 0===this.blockType.indexOf("Footer")&&Li.fabric.page.specificMagazineData&&Li.fabric.page.specificMagazineData.footerVariables&&Li.fabric.page.specificMagazineData.footerVariables.list?Li.fabric.page.specificMagazineData.footerVariables.list:null},getVariableData:function(){return 0===this.blockType.indexOf("Footer")&&Li.fabric.page.specificMagazineData&&Li.fabric.page.specificMagazineData.footerVariables&&Li.fabric.page.specificMagazineData.footerVariables.globalsTextByType&&Li.fabric.page.specificMagazineData.footerVariables.globalsTextByType[this.blockType]?Li.fabric.page.specificMagazineData.footerVariables.globalsTextByType[this.blockType]:null}
1,updateVariableList:function(e,t){0===this.blockType.indexOf("Footer")&&Li.fabric.page.specificMagazineData&&Li.fabric.page.specificMagazineData.footerVariables&&Li.fabric.page.specificMagazineData.footerVariables.list&&(Li.fabric.page.specificMagazineData.footerVariables.list[e]=t,this.canvas.getObjectsOfType("MzTextbox").forEach((function(e){0===e.blockType.indexOf("Footer")&&e.activateVariableList()})))},activateVariableList:function(){if(0===this.blockType.indexOf("Footer")){var e=this.getVariableData();if(e){var t=e.left?JSON.parse(e.left):null,n=e.right?JSON.parse(e.right):null;t&&this.setStyledTextIfLeftPage(t),n&&this.setStyledTextIfRightPage(n)}}},getExistingVariablePage:function(){var e=this.getVariableList();return e&&e.page?e.page:e&&e.doublePage?this.canvas&&this.left>=this.canvas.maxScrollX/2?e.doublePage.right:e.doublePage.left:null},shouldInverseTextAlignByVariable:function(e){if(0===this.blockType.indexOf("Footer")){var t=this.getExistingVariablePage();if(t&&t%2==1){if("left"===e)return"right";if("right"===e)return"left"}}return e},setStyledTextIfLeftPage:function(data){if(0===this.blockType.indexOf("Footer")){var e=this.getExistingVariablePage();e&&e%2==0&&this.setStyledText(data)}},setStyledTextIfRightPage:function(data){if(0===this.blockType.indexOf("Footer")){var e=this.getExistingVariablePage();e&&e%2==1&&this.setStyledText(data)}},textContainsVariable:function(e){return this.text.indexOf("{"+e+"}")>=0},checkExistingVarIntoLine:function(line,e){var t=this.getVariableList();if(!t)return line;var n=function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Do(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Do(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},t);n.doublePage&&(n.page=this.getExistingVariablePage(),delete n.doublePage);var r=line,l=!1,c={},d=Object.keys(n);if(d.length>0)for(var h,f=0;h=r.match(new RegExp("{("+d.join("|")+")}"));){var m=h[0],y=""+n[h[1]];r=r.substring(0,h.index)+y+r.substring(h.index+m.length),l=!0;for(var i=h.index;i<r.length;i++)i<h.index+y.length?c[i]=f+h.index+1-i:c[i]=f+m.length-y.length;f+=m.length-y.length}return l&&(this._charIndexStyleDiffMap[e]=c),r}})},wo=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{parentTextBoxId:null,childTextBoxId:null,parentTextBox:null,textgroupId:null,initReflow:function(e){this.set("parentTextBoxId",e.parentTextBoxId||null),this.set("childTextBoxId",e.childTextBoxId||null),this.set("hasReflow",!(!e.parentTextBoxId&&!e.childTextBoxId)),this.toObjectProps.push("parentTextBoxId","childTextBoxId")},activateReflow:function(){this.initMzTextGroup(!0),this.parentTextBoxId&&this.setParentTextBox(this.canvas.getObjectById(this.parentTextBoxId)),this.childTextBoxId&&this.setChildTextBox(this.canvas.getObjectById(this.childTextBoxId))},removeReflowLink:function(){if(this.parentTextBoxId=null,this.childTextBoxId=null,this.hasReflow=!1,this.textgroupId){var e=Li.fabric.textGroups.get(this.textgroupId);e&&e.delete()}},initMzTextGroup:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.parentTextBoxId||this.childTextBoxId;if(!this.textgroupId&&t){for(var p=this.canvas.getObjectById(t),n=!1;p&&p.parentTextBoxId;)t=p.parentTextBoxId,p=this.canvas.getObjectById(t);if(e&&!p)n=!0;else{var r=new Li.fabric.MzTextGroup;r.init();for(var o=!0;p&&o;)r.add(p),p.childTextBoxId?p=this.canvas.getObjectById(p.childTextBoxId):o=!1;!e||p&&r.containsTextbox(this.id)||(n=!0,r.delete())}e&&n&&(console.log("reflow is broken for "+this.id),this.parentTextBoxId=null,this.childTextBoxId=null,this.hasReflow=!1)}},updateReflowText:function(e){this.canvas&&this.canvas.getObjectById&&this.canvas.getObjectById(this.childTextBoxId).setStyledText({text:e.overflowText,flatStyle:e.overflowStyle})},getRootTextbox:function(){var e=this.textgroupId&&Li.fabric.textGroups?Li.fabric.textGroups.get(this.textgroupId):null;return e?e.getRootTextbox():null},isLinkedWith:function(e){return this.hasReflow&&(this.parentTextBoxId==e||this.childTextBoxId==e)},isInSameTextGroupAs:function(e){var t=this.textgroupId&&Li.fabric.textGroups?Li.fabric.textGroups.get(this.textgroupId):null;return!!t&&t.containsTextbox(e)},isRootTextbox:function(){return this.hasReflow&&!this.parentTextBoxId},setChildTextBox:function(e){e!==this&&(this.childTextBoxId=e.id,this.hasReflow=!0,this.textgroupId||this.initMzTextGroup(),e.textgroupId||Li.fabric.textGroups.get(this.textgroupId).add(e))},setParentTextBox:function(e){e&&e!==this&&(this.parentTextBoxId=e.id,this.hasReflow=!0)},updateReflowStackOrder:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.isRootTextbox()&&!(e>50)){for(var t=!1,n=this.canvas._objects.indexOf(this),r=this.canvas.getObjectById(this.childTextBoxId);r;)++n!==this.canvas._objects.indexOf(r)&&(console.log("reorganize reflow index for "+r.id),this.canvas.moveTo(r,n),t=!0),r=this.canvas.getObjectById(r.childTextBoxId);t&&this.updateReflowStackOrder(e+1)}},setAsStyleForAllReflowStack:function(){var e=this.textgroupId&&Li.fabric.textGroups?Li.fabric.textGroups.get(this.textgroupId):null;if(e){var t=!0,n=!1,r=void 0;try{for(var o,l=e.textBoxes[Symbol.iterator]();!(t=(o=l.next()).done);t=!0){var c=o.value;c.id!==this.id&&(c.blockType=this.blockType,c._textStyleKey=this._textStyleKey,c._dropCapStyleKey=this._dropCapStyleKey,c._bulletPointStyleKey=this._bulletPointStyleKey,c._endSignStyleKey=this._endSignStyleKey,c._textLinkStyleKey=this._textLinkStyleKey,c.fontFamily=this.fontFamily,c.fontWeight=this.fontWeight,c.fontSize=this.fontSize,c.lineHeight=this.lineHeight,c.fontStyle=this.fontStyle,c.underline=this.underline,c.linethrough=this.linethrough,c.textAlign=this.textAlign,c.fill=this.fill,c.textBackgroun
1dColor=this.textBackgroundColor,c.paletteSwatchName=this.paletteSwatchName,c.textBackgroundPadding=this.textBackgroundPadding,c.charSpacing=this.charSpacing,c.bulletPoint=this.bulletPoint,c.bulletPointStyle=this.bulletPointStyle,c.textLink=this.textLink,c.textLinkStyle=this.textLinkStyle)}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}}}})},Ro=(n(254),function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{maxListIndent:4,listSpaceCharBefore:"â",listSpaceCharAfter:"â",_bulletPoint:!1,_defaultBulletPointCharacter:"â¢",bulletPointStyle:{fill:"",character:""},_numericListSign:".",_currentNumericIndex:[0],charsListByLines:[],initList:function(e){!0!==e._bulletPoint&&(e._bulletPoint=!1),this.toObjectProps.push("_bulletPoint","bulletPointStyle"),this._bulletPoint=!0===e._bulletPoint,e.bulletPointStyle&&(this.bulletPointStyle=e.bulletPointStyle)},clearLineList:function(){this.charsListByLines=[],this.clearOffsetsOf("list")},setLineList:function(e,t,n){var r=this.getStyleListByLine(t),o=this.getListCharsToRender(e,r);if(null!==o){var l=this._getGraphemeBox(o,t,-1,null,!1);this.setOffsetAt(t,"list",l.width),n&&!r.hideListBullet&&(this.charsListByLines[t]={charsToRender:o,graphemeBox:l})}},getBulletPointCharacter:function(){return this._bulletPoint&&this.bulletPointStyle.character?this.bulletPointStyle.character:Li.fabric.page.specificMagazineData&&Li.fabric.page.specificMagazineData.bulletPointStyle&&Li.fabric.page.specificMagazineData.bulletPointStyle.character?Li.fabric.page.specificMagazineData.bulletPointStyle.character:this._defaultBulletPointCharacter},getBulletPointFillStyle:function(){return this._bulletPoint&&this.bulletPointStyle.fill&&this.bulletPointStyle.fill.length>0?this.bulletPointStyle.fill:Li.fabric.page.specificMagazineData&&Li.fabric.page.specificMagazineData.bulletPointStyle&&Li.fabric.page.specificMagazineData.bulletPointStyle.fill&&Li.fabric.page.specificMagazineData.bulletPointStyle.fill.length>0?Li.fabric.page.specificMagazineData.bulletPointStyle.fill:null},getListCharsToRender:function(e,style){if(0===e)this._currentNumericIndex=[0];else if("ordered"!==style.list)for(var i=0;i<this._currentNumericIndex.length;i++)this._currentNumericIndex[i]=0;else if("ordered"===style.list)for(var t=style.indent+1;t<this._currentNumericIndex.length;t++)this._currentNumericIndex[t]=0;if(-1===["ordered","bullet"].indexOf(style.list))return null;var n=null;if("ordered"===style.list){void 0===this._currentNumericIndex[style.indent]&&(this._currentNumericIndex[style.indent]=0);var r=style.listIndex?style.listIndex+1:this._currentNumericIndex[style.indent]+1;n=this.getNumericGlyph(r,style.indent),this._currentNumericIndex[style.indent]++}else"bullet"===style.list&&(n=style.bulletChar?style.bulletChar:this.getBulletPointCharacter());return this.listSpaceCharBefore.repeat(style.indent+1)+n+this.listSpaceCharAfter},getNumericGlyph:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t%3==0?e.toString()+this._numericListSign:t%3==1?String.fromCharCode(96+e)+this._numericListSign:t%3==2?Qt.a.convertToRoman(e)+this._numericListSign:void 0}}),Object.defineProperty(Li.fabric.MzTextbox.prototype,"bulletPoint",{get:function(){return this._bulletPoint},set:function(e){this._bulletPoint=e,e||(this.bulletPointStyle={fill:"",character:""}),this._forceClearCache=!0}})}),zo=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{_endSign:!1,endSignStyle:{fill:"",character:""},initEndSign:function(e){!0!==e._endSign&&(e._endSign=!1),this.toObjectProps.push("_endSign","endSignStyle"),this._endSign=!0===e._endSign,e.endSignStyle&&(this.endSignStyle=e.endSignStyle)},getEndSignCharacter:function(){return this._endSign&&this.endSignStyle.character?this.endSignStyle.character:""},getEndSignStyle:function(){return this._endSign&&this.endSignStyle.fill&&this.endSignStyle.fill.length>0?{fill:this.endSignStyle.fill}:null}}),Object.defineProperty(Li.fabric.MzTextbox.prototype,"endSign",{get:function(){return this._endSign},set:function(e){this._endSign=e,e||(this.endSignStyle={fill:"",character:""}),this._forceClearCache=!0}})},Lo=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{_textLink:!1,textLinkStyle:{fill:"",underline:!1,fontStyle:"normal",fontWeight:"normal"},_textLinkZone:[],initTextLink:function(e){this._styleProperties.push("link"),this.toObjectProps.push("_textLink","textLinkStyle"),this._textLink=!0===e._textLink,e.textLinkStyle&&(this.textLinkStyle=e.textLinkStyle)},getTextLinkStyle:function(){return this._textLink&&this.textLinkStyle?{fill:this.textLinkStyle.fill&&this.textLinkStyle.fill.length>0?this.textLinkStyle.fill:void 0,fontStyle:this.textLinkStyle.fontStyle&&this.textLinkStyle.fontStyle.length>0?this.textLinkStyle.fontStyle:void 0,fontWeight:this.textLinkStyle.fontWeight&&this.textLinkStyle.fontWeight.length>0?this.textLinkStyle.fontWeight:void 0,linethrough:void 0!==this.textLinkStyle.linethrough&&null!==this.textLinkStyle.linethrough?this.textLinkStyle.linethrough:void 0,underline:void 0!==this.textLinkStyle.underline&&null!==this.textLinkStyle.underline?this.textLinkStyle.underline:void 0,overline:void 0!==this.textLinkStyle.overline&&null!==this.textLinkStyle.overline?this.textLinkStyle.overline:void 0,textBackgroun
1dColor:this.textLinkStyle.textBackgroundColor&&this.textLinkStyle.textBackgroundColor.length>0?this.textLinkStyle.textBackgroundColor:void 0,textBackgroundPadding:this.textLinkStyle.textBackgroundPadding}:Li.fabric.page.specificMagazineData&&Li.fabric.page.specificMagazineData.textLinkStyle?{fill:Li.fabric.page.specificMagazineData.textLinkStyle.fill&&Li.fabric.page.specificMagazineData.textLinkStyle.fill.length>0?Li.fabric.page.specificMagazineData.textLinkStyle.fill:void 0,fontStyle:Li.fabric.page.specificMagazineData.textLinkStyle.fontStyle&&Li.fabric.page.specificMagazineData.textLinkStyle.fontStyle.length>0?Li.fabric.page.specificMagazineData.textLinkStyle.fontStyle:void 0,fontWeight:Li.fabric.page.specificMagazineData.textLinkStyle.fontWeight&&Li.fabric.page.specificMagazineData.textLinkStyle.fontWeight.length>0?Li.fabric.page.specificMagazineData.textLinkStyle.fontWeight:void 0,linethrough:void 0!==Li.fabric.page.specificMagazineData.textLinkStyle.linethrough&&null!==Li.fabric.page.specificMagazineData.textLinkStyle.linethrough?Li.fabric.page.specificMagazineData.textLinkStyle.linethrough:void 0,underline:void 0!==Li.fabric.page.specificMagazineData.textLinkStyle.underline&&null!==Li.fabric.page.specificMagazineData.textLinkStyle.underline?Li.fabric.page.specificMagazineData.textLinkStyle.underline:void 0,overline:void 0!==Li.fabric.page.specificMagazineData.textLinkStyle.overline&&null!==Li.fabric.page.specificMagazineData.textLinkStyle.overline?Li.fabric.page.specificMagazineData.textLinkStyle.overline:void 0,textBackgroundColor:Li.fabric.page.specificMagazineData.textLinkStyle.textBackgroundColor&&Li.fabric.page.specificMagazineData.textLinkStyle.textBackgroundColor.length>0?Li.fabric.page.specificMagazineData.textLinkStyle.textBackgroundColor:void 0,textBackgroundPadding:Li.fabric.page.specificMagazineData.textLinkStyle.textBackgroundPadding}:{underline:!0}},_cleanTextLinkZone:function(){this._textLinkZone=[]},_declareTextLinkZone:function(e,t,link){var n={link:link,left:t.left+this.width/2,top:t.top+this.height/2,width:t.width,height:t.height};this._textLinkZone.push(n)},getPointerOverLink:function(){var e=this.canvas.getPointer();e.x-=this.left,e.y-=this.top;var t=!0,n=!1,r=void 0;try{for(var o,l=this._textLinkZone[Symbol.iterator]();!(t=(o=l.next()).done);t=!0){var c=o.value;if(e.x>=c.left&&e.x<=c.left+c.width&&e.y>=c.top&&e.y<=c.top+c.height)return c.link}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}}}),Object.defineProperty(Li.fabric.MzTextbox.prototype,"textLink",{get:function(){return this._textLink},set:function(e){this._textLink=e,e||(this.textLinkStyle={fill:"",underline:!1,fontStyle:"normal",fontWeight:"normal"}),this._forceClearCache=!0}})},jo=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{dodgingShapesIds:[],dodgingShapes:[],initDodging:function(e){this.set("dodgingShapesIds",e.dodgingShapesIds||[]),this.toObjectProps.push("dodgingShapesIds")},activateDodging:function(){if(this.dodgingShapesIds.length>0)for(var i=0;i<this.dodgingShapesIds.length;i++)this.dodgingShapes.push(this.canvas.getObjectById(this.dodgingShapesIds[i]))},setDodgingShape:function(e){"MzRect"==e.type&&-1==this.dodgingShapesIds.indexOf(e.id)&&(this.dodgingShapesIds.push(e.id),this.dodgingShapes.push(e))}})},Mo=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{offsetLines:[],initIndent:function(e){this.offsetLines=[]},createOffsetMap:function(){return new Map},setOffsetAt:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.offsetLines[e]||(this.offsetLines[e]=new Map),this.offsetLines[e].set(t,{value:n,conditions:r})},clearOffsetsOf:function(e){this.offsetLines.forEach((function(map){map.delete(e)}))},getNumOffsetAt:function(e){return this.offsetLines[e]?this.offsetLines[e].size:0},getOffsetAt:function(e){var t=0;if(this.offsetLines[e]){var n=!0,r=!1,o=void 0;try{for(var l,c=this.offsetLines[e].values()[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value,h=d.value,f=d.conditions;
1if(f){if(f.maxTop)this.getTopOfLine(e)<=f.maxTop&&(t+=h)}else t+=h}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}}return t}})};function Uo(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function Fo(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?Uo(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):Uo(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var No,$o,Bo,Go=n(722).createCanvas,Ho=!1,Vo={chars:{capHeight:"S",baseline:"n",xHeight:"x",descent:"p",ascent:"h",tittle:"i"}},Wo=function(e,t,n){Ho||(Bo=Go(200,200),$o=Bo.getContext("2d"),Ho=!0),No=.5*t,Bo.width=2*t,Bo.height=2*t+No,$o.font="".concat(n," ").concat(t,"px ").concat(e),$o.textBaseline="top",$o.textAlign="center"},Ko=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top",t="bottom"===e?Bo.height:0;$o.setTransform(1,0,0,1,0,t),$o.textBaseline=e},Yo=function(){Ko("bottom");var e=Bo.height-Jo("A");return Ko("top"),Jo("A")+e},Zo=function(text){return function(text){$o.clearRect(0,0,Bo.width,Bo.height),$o.fillText(text,Bo.width/2,No,Bo.width)}(text),$o.getImageData(0,0,Bo.width,Bo.height).data},Xo=function(e,t,n){var r={},o=e[n];for(var l in e)r[l]=(e[l]-o)/t;return r},qo=function(text){return Math.round(function(e){for(var i=3,t=e.length;i<t;i+=4)if(e[i]>0)return(i-3)/4;return e.length}(Zo(text))/Bo.width)-No},Jo=function(text){return Math.round(function(e){for(var i=e.length-1;i>=3;i-=4)if(e[i]>0)return i/4;return 0}(Zo(text))/Bo.width)-No},Qo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vo.chars;return{capHeight:qo(e.capHeight),baseline:Jo(e.baseline),xHeight:qo(e.xHeight),descent:Jo(e.descent),bottom:Yo(),ascent:qo(e.ascent),tittle:qo(e.tittle),top:0}},es=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vo.chars;return{capHeight:qo(e.capHeight),capBottom:Jo(e.capHeight),top:0}},ts=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fontFamily,n=void 0===t?"Times":t,r=e.fontWeight,o=void 0===r?"normal":r,l=e.fontSize,c=void 0===l?200:l,d=e.origin,h=void 0===d?"baseline":d;return Wo(n,c,o),Fo({},Xo(Qo(),c,h),{fontFamily:n,fontWeight:o,fontSize:c})};ts.measureCap=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fontFamily,n=void 0===t?"Times":t,r=e.fontWeight,o=void 0===r?"normal":r,l=e.fontSize,c=void 0===l?200:l,d=e.origin,h=void 0===d?"baseline":d;return Wo(n,c,o),Fo({},Xo(es(),c,h),{fontFamily:n,fontWeight:o,fontSize:c})},ts.settings=Vo;var as=ts;function ns(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var is=function(){Object.defineProperty(Li.fabric.MzTextbox.prototype,"dropCap",{get:function(){return this._dropCap},set:function(e){this._dropCap&&0==e&&this.removeDropCap(),this._dropCap=e}}),Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{_mzDropCapProps:["_dropCap","dropCapStyle"],_dropCap:!1,dropCapStyle:{dropCapHeight:3,dropCapSpacing:0,dropCapYOffset:0,dropCapFontSizeOffset:0,fill:"",fontFamily:"",fontStyle:"normal",fontWeight:"normal"},dropCapComputedStyle:{fontSize:16,deltaY:0},_prevLetter:"",_prevStyle:{},_metrics:{},initDropCap:function(e){this.toObjectProps.push("_dropCap","dropCapStyle")},activateDropCap:function(){this.setupState({propertySet:"_mzDropCapProps"}),this.updateDropCap()},updateDropCap:function(){this._dropCap&&(this.removeDropCap(),this._dropCap&&this.text&&this.text.length>0&&(this.setDropCapStyle(this.text.charAt(0)),this.saveState({propertySet:"_mzDropCapProps"})))},removeDropCap:function(){for(var i=0;i<3;i++){var style=this.getStyleAtPosition(i),e=this.getCompleteStyleDeclaration(0,i+1);style&&style.dropCapHeight&&this.setStyleAt(0,i,e)}this.clearOffsetsOf("dropCap")},setDropCapStyle:function(e){var t=this.getDropCapSize(e);this.dropCapComputedStyle.deltaY=t.delta,this.dropCapComputedStyle.fontSize=t.fontSize;var n=function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?ns(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):ns(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},this.dropCapStyle,{},this.dropCapComputedStyle);this.setStyleAt(0,0,n);var r=this._measureChar(e,n).kernedWidth;0!==this.charSpacing&&(r+=this._getWidthOfCharSpacing());this.setDropCapOffsetLines(t.height,r+this.dropCapStyle.dropCapSpacing),this._prevLetter=e,this._prevStyle=n},getDropCapSize:function(e){this._prevStyle.fontFamily==this.dropCapStyle.fontFamily&&this._prevStyle.fontWeight==this.dropCapStyle.fontWeight||(as.settings.chars.capHeight="I",this._metrics=as.measureCap({fontFamily:this.dropCapStyle.fontFamily,fontWeight:this.dropCapStyle.fontWeight,fontSize:1e3,origin:"capHeight"}));var t=this.fontSize*this.lineHeight*this._fontSizeMult,n=t*this.dropCapStyle.dropCapHeight,r=this.lineHeight*this.dropCapStyle.dropCapHeight,o=n/this._metrics.capBottom-r,l=n-t;return{fontSize:o+=this.dropCapStyle.dropCapFontSizeOffset,delta:l+=this.dropCapStyle.dropCapYOffset,height:n}},setDropCapOffsetLines:function(e,t){this.clearOffsetsOf("dropCap");for(var i=1;i<this.dropCapStyle.dropCapHeight;i++)this.setOffsetAt(i,"dropCap",t,{maxTop:e})},getCharStylePropertyAt:function(e,t,n){var r=this._getStyleDeclaration(e,t);return r&&void 0!==r[n]?r[n]:null},getHeightOfChar:function(line,e){return this._dropCap&&0===line&&this.getCharStylePropertyAt(line,e,"dropCapHeight")?this.fontSize:this.getValueOfPropertyAt(line,e,"fontSize")},setStyleAt:function(e,t,style){this._getLineStyle(e)||this._setLineStyle(e,{}),this._setStyleDeclaration(e,t,style),this._forceClearCache=!0}})},rs=new Image;rs.src="/icons/edit.svg";var os={shouldShowEditControl:function(){var e;return!(null===(e=this.canvas)||void 0===e||!e.showSpecificControls)&&("MzTextbox"===this.type||"MzImage"===this.type||"MzShapeGroup"===this.type&&this.variantGroup)},addVirtualEditCorner:function(){if(this.oCoords&&this.oCoords.mt&&void 0!==this.oCoords.mt.x&&void 0!==this.oCoords.mt.y){var e=this.oCoords.mt,t=e.x+18+7.5-this.cornerSize/2,n=e.y-18+7.5-this.cornerSize/2;this.oCoords.edit={x:t,y:n,corner:{tl:{x:t-12.5,y:n-12.5},tr:{x:t+12.5,y:n-12.5},br:{x:t+12.5,y:n+12.5},bl:{x:t-12.5,y:n+12.5}}}}},isControlVisible:function(e){return"edit"===e?this.shouldShowEditControl():this.callSuper("isControlVisible",e)},_drawControl:function(e,t,n,r,o,l){if(this.isControlVisible(e))return"mt"===e&&this.shouldShowEditControl()&&t.drawImage(rs,r+18,o-18,15,15),this.callSuper("_drawControl",e,t,n,r,o,l)},_setCornerCoords:function(){this.callSuper("_setCornerCoords"),this.shouldShowEditControl()&&this.addVirtualEditCorner()}},ss=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,os),Li.fabric.util.object.extend(Li.fabric.MzImage.prototype,os),Li.fabric.util.object.extend(Li.fabric.MzShapeGroup.prototype,os),Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{drawControls:function(e,t){if(t=t||{},this.hasReflow){var n=this._calculateCurrentDimensions(),r=new Li.fabric.Point(.5*n.x,.5*n.y);if(this.childTextBoxId){var o=this.canvas.getObjectById(this.childTextBoxId);o&&mo(e,r,this.getObjectLocalCoord(o,"tl"),14,"#b7b8b9")}if(this.parentTextBoxId){var l=this.canvas.getObjectById(this.parentTextBoxId);l&&(r=r.multiply(-1),mo(e,this.getObjectLocalCoord(l,"br"),r,14,"#b7b8b9"))}}this.hasRestoreLastValidProps&&(t.cornerColor="#ff0000"),this.callSuper("drawControls",e,t)},drawBorders:function(e,t){var n=this;return t=t||{},(this.hasRestoreLastValidProps||this.textOverflow)&&(t.borderColor="#ff0000",setTimeout((function(){n.hasRestoreLastValidProps=!1}),300)),this.canvas.useCanvasEffect?this:this.callSuper("drawBorders",e,t)}}),Li.fabric.util.object.extend(Li.fabric.MzCanvas.prototype,{_getActionFromCorner:function(e,t,n){if(!t||!e)return"drag";switch(t){case"mtr":return"rotate";case"mr":case"ml":return n[this.altActionKey]?"skewY":"scaleX";case"mt":case"mb":return n[this.altActionKey]?"skewX":"scaleY";case"edit":return"edit";default:return"scale"}},getCornerCursor:function(e,t,n){return this.actionIsDisabled(e,t,n)?this.notAllowedCursor:"edit"===e?"pointer":this.callSuper("getCornerCursor",e,t,n)}})},ls=(n(723),function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{getFirstCharStyleByLine:function(e){var map=this._styleMap[e];return map&&this.styles[map.line]?this.styles[map.line][0]:null},getStylesByLine:function(e){var t=0,n=0;if(this._textLines){for(var i=0;i<e;i++)this._textLines[i]&&(t+=this._textLines[i].length+1);this._textLines[e]&&(n=t+this._textLines[e].length)}
1return this.getSelectionStyles(t,n)},getStyleLineHeightByLine:function(e){if(this.__lineStyleLineHeight[e])return this.__lineStyleLineHeight[e];var t=0,n=this.getStylesByLine(e);if(n)for(var r=0,o=Object.values(n);r<o.length;r++){var l=o[r];l.lineHeight&&(t=Math.max(t,l.lineHeight))}return t<=0&&(t=this.lineHeight),this.__lineStyleLineHeight[e]=t,t},getStyleTextAlignByLine:function(e){if(this.__lineStyleTextAlign[e])return this.__lineStyleTextAlign[e];var t=this.textAlign,n=this.getFirstCharStyleByLine(e);return t=n&&n.textAlign?n.textAlign:this.shouldInverseTextAlignByVariable(t),this.__lineStyleTextAlign[e]=t,t},getStyleListByLine:function(e){if(this.__lineStyleList[e])return this.__lineStyleList[e];var style={list:null,indent:0},t=this.getFirstCharStyleByLine(e);return t&&t.list&&(style.list=t.list,style.indent=t.indent||0,style.listIndex=t.listIndex||void 0,t.hideListBullet&&(style.hideListBullet=!0),"bullet"===style.list&&(style.bulletFill=t.bulletFill?t.bulletFill:this.getBulletPointFillStyle(),style.bulletChar=t.bulletChar?t.bulletChar:this.getBulletPointCharacter())),this.__lineStyleList[e]=style,style},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__lineStyleList=[],this.__charBounds=[],this.__lineStyleTextAlign=[],this.__lineStyleLineHeight=[]},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];if(!this._textLines[e]||0===this._textLines[e].length)return this.fontSize*this.lineHeight*this._fontSizeMult;for(var line=this._textLines[e],t=this.getHeightOfChar(e,0),i=1,n=line.length;i<n;i++)t=Math.max(this.getHeightOfChar(e,i),t),this.getHeightOfChar(e,i);var r=t*this.getStyleLineHeightByLine(e)*this._fontSizeMult;return this.__lineHeights[e]=r,r},getTopOfLine:function(e){for(var t=0,i=0;i<e;i++)t+=this.getHeightOfLine(i);return t},enlargeSpaces:function(){for(var e,t,n,r,line,o,l,i=0,c=this._textLines.length;i<c;i++){var d=this.getStyleTextAlignByLine(i);if(-1!==d.indexOf("justify")){var h=!this.hasReflow&&i===c-1;if(("justify"===d||!h&&!this.isEndOfWrapping(i))&&(r=0,line=this._textLines[i],(t=this.getLineWidth(i))<this.width&&(l=this.textLines[i].match(this._reSpacesAndTabs)))){n=l.length,e=(this.width-t)/n;for(var f=0,m=line.length;f<=m;f++)o=this.__charBounds[i][f],this._reSpaceAndTab.test(line[f])?(o.width+=e,o.kernedWidth+=e,o.left+=r,r+=e):o.left+=r}}}},_renderText:function(e){this._cleanTextLinkZone(),"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_renderChars:function(e,t,line,n,r,o){var l,c,d,h,f=this.getHeightOfLine(o),m=-1!==this.getStyleTextAlignByLine(o).indexOf("justify"),y="",v=0,_=!m&&0===this.charSpacing&&this.isEmptyStyles(o);if(t.save(),r-=f*this._fontSizeFraction/this.lineHeight,_)return this._renderChar(e,t,o,0,this.textLines[o],n,r,f),void t.restore();this.charsListByLines[o]&&this._renderChar(e,t,o,-1,this.charsListByLines[o].charsToRender,n-this.charsListByLines[o].graphemeBox.width,r,f);for(var i=0,O=line.length-1;i<=O;i++)h=i===O||this.charSpacing,y+=line[i],d=this.__charBounds[o][i],0===v?(n+=d.kernedWidth-d.width,v+=d.width):v+=d.kernedWidth,m&&!h&&this._reSpaceAndTab.test(line[i])&&(h=!0),h||(l=l||this.getCompleteStyleDeclaration(o,i),c=this.getCompleteStyleDeclaration(o,i+1),h=this._hasStyleChanged(l,c)||l.link!==c.link),h&&(this._renderChar(e,t,o,i,y,n,r,f),y="",l=c,n+=v,v=0);t.restore()},_renderChar:function(e,t,n,r,o,l,c){var d=this._getStyleDeclaration(n,r),h=this.getCompleteStyleDeclaration(n,r),f="fillText"===e&&h.fill,m="strokeText"===e&&h.stroke&&h.strokeWidth;if(m||f){if(d&&t.save(),this._applyCharStyles(e,t,n,r,h),d&&d.textBackgroundColor&&this._removeShadow(t),d&&d.deltaY&&(c+=d.deltaY),f&&t.fillText(o,l,c),m&&t.strokeText(o,l,c),d&&d.link){var y=t.measureText(o),v={left:l-y.actualBoundingBoxLeft,top:c-y.actualBoundingBoxAscent,width:y.actualBoundingBoxRight-y.actualBoundingBoxLeft,height:y.actualBoundingBoxAscent-y.actualBoundingBoxDescent};this._declareTextLinkZone(t,v,d.link)}d&&t.restore()}},_setSVGTextLineText:function(e,t,n,r){var o,style,l,c=this.getHeightOfLine(t),d=-1!==this.getStyleTextAlignByLine(t).indexOf("justify"),h="",f=0,line=this._textLines[t];r+=c*(1-this._fontSizeFraction)/this.lineHeight,this.charsListByLines[t]&&(style=this._getStyleDeclaration(t,-1)||{},e.push(this._createTextCharSpan(this.charsListByLines[t].charsToRender,style,n-this.charsListByLines[t].graphemeBox.width,r)));for(var i=0,m=line.length-1;i<=m;i++){if(l=i===m||this.charSpacing,h+=line[i],o=this.__charBounds[t][i],0===f?(n+=o.kernedWidth-o.width,f+=o.width):f+=o.kernedWidth,d&&!l&&this._reSpaceAndTab.test(line[i])&&(l=!0),!l){var y=this.getCompleteStyleDeclaration(t,i),v=this.getCompleteStyleDeclaration(t,i+1);l=this._hasStyleChangedForSvg(y,v)}l&&(style=this._getStyleDeclaration(t,i)||{},1===h.length&&173===h.codePointAt(0)&&(h+=" "),e.push(this._createTextCharSpan(h,style,n,r)),h="",n+=f,f=0)}}})}),cs=function(){Li.fabric.util.object.extend(Li.fabric.MzTextbox.prototype,{backgroundPadding:{left:0,right:0,top:0,bottom:0}
1,textBackgroundPadding:{left:0,right:0,top:0,bottom:0},initPadding:function(e){e.backgroundPadding&&(this.backgroundPadding=e.backgroundPadding),e.textBackgroundPadding&&(this.textBackgroundPadding=e.textBackgroundPadding),this.toObjectProps.push("backgroundPadding","textBackgroundPadding")},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2-this.backgroundPadding.left,-t.y/2-this.backgroundPadding.top,t.x+this.backgroundPadding.left+this.backgroundPadding.right,t.y+this.backgroundPadding.top+this.backgroundPadding.bottom),this._removeShadow(e)}},_setSVGBg:function(e){var t=Li.fabric.util.toFixed;if(this.backgroundColor){var n=Li.fabric.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',t(-this.width/2-this.backgroundPadding.left,n),'" y="',t(-this.height/2-this.backgroundPadding.top,n),'" width="',t(this.width+this.backgroundPadding.left+this.backgroundPadding.right,n),'" height="',t(this.height+this.backgroundPadding.top+this.backgroundPadding.bottom,n),'"></rect>\n')}},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){var t=e.fillStyle;this.__renderStyleTextBackground(e),e.fillStyle=t,this._removeShadow(e)}},__renderStyleTextBackground:function(e){if(this.styleHas("textBackgroundColor")||this.textBackgroundColor)for(var t,n,line,r,o,l,c,d,h=0,f=this._getLeftOffset(),m=this._getTopOffset(),y=0,v=0,i=0,_=this._textLines.length;i<_;i++)if(t=this.getHeightOfLine(i),this.styleHas("textBackgroundColor",i)||this.textBackgroundColor){line=this._textLines[i],n=this._getLineLeftOffset(i),v=0,y=0,r=this.getCharStylePropertyAt(i,0,"textBackgroundColor"),c=this.getCharStylePropertyAt(i,0,"textBackgroundPadding"),null===r&&(r=this.textBackgroundColor,c=this.textBackgroundPadding);for(var O=0,E=line.length;O<E;O++)o=this.__charBounds[i][O],l=this.getCharStylePropertyAt(i,O,"textBackgroundColor"),d=this.getCharStylePropertyAt(i,O,"textBackgroundPadding"),null===l&&(l=this.textBackgroundColor,d=this.textBackgroundPadding),l!==r?(e.fillStyle=r,r&&e.fillRect(f+n+y-(c?c.left:0),m+h-(c?c.top:0),v+(c?c.left+c.right:0),t/this.lineHeight+(c?c.top+c.bottom:0)),y=o.left,v=o.width,r=l,c=d):v+=o.kernedWidth;l&&(e.fillStyle=l,e.fillRect(f+n+y-(d?d.left:0),m+h-(d?d.top:0),v+(d?d.left+d.right:0),t/this.lineHeight+(d?d.top+d.bottom:0))),h+=t}else h+=t},_pushTextBgRect:function(e,t,n,r,o,l){var c=Li.fabric.util.toFixed,d=Li.fabric.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(t),' x="',c(n-this.textBackgroundPadding.left,d),'" y="',c(r-this.textBackgroundPadding.top,d),'" width="',c(o+this.textBackgroundPadding.left+this.textBackgroundPadding.right,d),'" height="',c(l+this.textBackgroundPadding.bottom+this.textBackgroundPadding.top,d),'"></rect>\n')},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=Math.max(this.backgroundPadding.left,this.textBackgroundPadding.left),n=Math.max(this.backgroundPadding.right,this.textBackgroundPadding.right),r=Math.max(this.backgroundPadding.top,this.textBackgroundPadding.top),o=Math.max(this.backgroundPadding.left,this.textBackgroundPadding.bottom);return e.x-=t,e.width+=t+n,e.y-=r,e.height+=r+o,e}})},us=function(){Li.fabric.util.object.extend(Li.fabric.Object.prototype,{legendTextBoxId:null,legendImageId:null,legendTextBox:null,legendImage:null,initLegend:function(e){this.set("legendTextBoxId",e.legendTextBoxId||null),this.set("legendImageId",e.legendImageId||null),this.toObjectProps.push("legendTextBoxId","legendImageId")},activateLegend:function(){this.legendTextBoxId&&this.setLegendTextBox(this.canvas.getObjectById(this.legendTextBoxId)),this.legendImageId&&this.setLegendImage(this.canvas.getObjectById(this.legendImageId))},setLegendTextBox:function(e){e&&"MzImage"===this.type&&"MzTextbox"===e.type?(this.legendTextBox=e,this.legendTextBoxId=e.id):(this.legendTextBox=null,this.legendTextBoxId=null)},setLegendImage:function(e){e&&"MzTextbox"===this.type&&"MzImage"===e.type?(this.legendImage=e,this.legendImageId=e.id,0!==this.blockType.indexOf("Legend")&&(this.blockType="Legend")):(this.legendImage=null,this.legendImageId=null,0===this.blockType.indexOf("Legend")&&(this.blockType="Body"))}})},ds=l.default.observable({online:!0,retries:0,lastRetryTime:0,nextRetryTime:0});var ps=function(e){var t,n,r=e.$axios,o=e.store;function c(){var e,n=(e=ds.retries)<5?2e3:e<10?1e4:6e4;console.log("ONLINE setTimeoutCheck ",n),ds.retries++,ds.lastRetryTime=Date.now(),ds.nextRetryTime=Date.now()+n,o.dispatch("api/API_STATUS").then((function(e){console.log("ONLINE check API_STATUS ",e),!e&&ds.online&&(ds.online=!1)})).catch((function(e){console.log("ONLINE check API_STATUS error ",e),ds.online&&(ds.online=!1)})),clearTimeout(t),t=setTimeout(c,n)}l.default.prototype.$online=ds;var d=function(data){console.log("ONLINE triggerOffline "+data),clearTimeout(n),n=setTimeout((function(){ds.online&&c()}),1500)},h=function(){clearTimeout(t),clearTimeout(n),ds.online||(console.log("ONLINE triggerOnline"),ds.online=!0,ds.retries=0,ds.lastRetryTime=0,ds.nextRetryTime=0)};r.interceptors.response.use((function(e){return h(),e}),(function(e){e.response?(h(),502===e.response.status&&d("502 response")):d("no response");return Promise.reject(e)}))},hs=l.default.observable({time:Date.now()});setInterval((function(){return hs.time=Date.now()}),500);var fs,ms=function(){l.default.prototype.$now=hs},gs="GET_CONNECTION_ID",bs="JOIN_MAGAZINE",ys="LEAVE_MAGAZINE",vs="LOGOUT_USER",_s="UPDATE_USER_ACCESS",Os="UPDATE_PAGE",Es="UPDATE_THUMBNAIL",ks="UPDATE_MAGAZINE",Ss="UPDATE_MAGAZINE_LIST",As="UPDATE_LIBRARY",Ts="UPDATE_COLLABORATION",Ps="UPDATE_ORDER",Cs="REMOVE_ORDER",xs="NEW_NOTIFICATION",Ds="UPDATE_PDF_STATUS",Is="UPDATE_MAINTENANCE",ws="UPDATE_WORKSPACE",Rs="NEW_PAGE_COMMENT",zs="UPDATE_PAGE_COMMENT",Ls=[],js=[],Ms=!0,Us=0,Fs=null,Ns="wss://5ekt47tv7c.execute-api.eu-west-1.amazonaws.com/dev",$s=[],Bs="",Gs=null;function Hs(e){return Vs.apply(this,arguments)}function Vs(){return(Vs=Object(r.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(fs&&(!fs||2!==fs.readyState&&3!==fs.readyState)||!t){e.next=8;break}Bs=t,Ms=!0,Gs=null;try{fs=new WebSocket("".concat(Ns,"?token=").concat(t))}catch(e){console.log("WEBSOCKET instantiate error",e)}return fs.addEventListener("message",(function(e){console.log("WEBSOCKET message",e),Fs&&(clearTimeout(Fs),Fs=null);var data=e.data;if(data){var t;try{t=JSON.parse(data)}catch(e){console.log("WEBSOCKET message invalid decode data",e)}t&&t.action&&t.data&&(t.action===gs&&(Gs=t.data.connectionId),$s.filter((function(e){return e.topic===t.action}
1)).forEach((function(e){return e.listener(t.data)})))}})),fs.addEventListener("close",(function(){Gs=null,Fs&&(clearTimeout(Fs),Fs=null),Ms&&(Us++,Fs=setTimeout((function(){Hs(Bs)}),Math.min(6e4,5e3*Us)))})),e.abrupt("return",new Promise((function(e,t){fs.addEventListener("open",(function(t){Us=0,Fs&&(clearTimeout(Fs),Fs=null),Ls.forEach((function(e){return e.resolve()})),Ls.splice(0,Ls.length),Ks({action:gs,data:{}}),e()})),fs.addEventListener("error",(function(e){console.log("WEBSOCKET error",e),Ls.forEach((function(e){return e.reject()})),Ls.splice(0,Ls.length),t(e)}))})));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ws(){return(Ws=Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!fs){e.next=7;break}return Ms=!1,Us=0,Gs=null,e.next=6,fs.close();case 6:fs=null;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ks(e){return Ys.apply(this,arguments)}function Ys(){return(Ys=Object(r.a)(regeneratorRuntime.mark((function e(data){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!fs||2!==fs.readyState&&3!==fs.readyState){e.next=3;break}return e.next=3,Hs(Bs);case 3:if(!data||!fs){e.next=10;break}if("object"!==Object(Ii.a)(data)){e.next=10;break}if(0!==fs.readyState){e.next=9;break}return t=new Promise((function(e,t){Ls.push({resolve:e,reject:t})})),e.next=9,t;case 9:fs.send(JSON.stringify(data));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zs(){return(Zs=Object(r.a)(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t&&n&&$s.push({topic:t,listener:n});case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xs(){return(Xs=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:fs&&t&&n&&-1!==(r=$s.findIndex((function(e){return e.topic===t&&e.listener===n})))&&$s.splice(r,1);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qs(){return(qs=Object(r.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:js.includes("magazine#".concat(t))||(js.push("magazine#".concat(t)),Ks({action:bs,data:{magazine:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Js(){return(Js=Object(r.a)(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ks({action:ys,data:{magazine:t}}),-1!=(n=js.indexOf("magazine#".concat(t)))&&js.splice(n,1);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qs={connect:Hs,close:function(){return Ws.apply(this,arguments)},joinMagazine:function(e){return qs.apply(this,arguments)},leaveMagazine:function(e){return Js.apply(this,arguments)},addListener:function(e,t){return Zs.apply(this,arguments)},removeListener:function(e,t){return Xs.apply(this,arguments)},getConnectionId:function(){return Gs}};l.default.prototype.$socket=Qs;var el=function(e,t){t("socket",Qs)},tl=function(e){var t=e.store,n=e.app,r=e.redirect,o=e.route;t.watch((function(e){return e.magazine.magazine&&e.magazine.magazine._id}),(function(e,r){r!==e&&(r&&n.$socket.leaveMagazine(r),e&&(t.state.magazine.magazineLoadType&&-1!==["client","public"].indexOf(t.state.magazine.magazineLoadType)||n.$socket.joinMagazine(e)))})),t.state.api.user.websocketToken&&(console.log("WEBSOCKET first connect"),n.$socket.connect(t.state.api.user.websocketToken)),t.watch((function(e){return e.api.user.websocketToken}),(function(e){console.log("WEBSOCKET change connect to ",e),e?n.$socket.close().then((function(){n.$socket.connect(e)})):n.$socket.close()})),n.$socket.addListener(_s,(function(data){t.dispatch("api/API_CHECK").then((function(e){e||t.dispatch("api/API_LOGOUT",{debugSaveFrom:"WebSocket update user access received invalid API CHECK"}).then((function(){o&&o.path&&"/login"==o.path?window.location.reload():r("/login")}))}))})),n.$socket.addListener(vs,(function(data){t.state.api.user.sessionId===data.sessionId&&(t.state.api.supportUser?t.dispatch("api/API_LOGOUT_SUPPORT").then((function(){r("/admin")})):t.dispatch("api/API_LOGOUT",{debugSaveFrom:"WebSocket received logout user"}).then((function(){r("/login")})))})),n.$socket.addListener(Es,(function(data){data.page&&n.$bus.$emit("thumb_page_change_"+data.page)})),n.$socket.addListener(ws,(function(data){if(t.state.workspace.workspace._id===data.workspaceId)if(data.updatedFields)for(var e=0,n=Object.keys(data.updatedFields);e<n.length;e++){var r=n[e];t.commit("workspace/UPDATE_FIELD",{key:r,value:data.updatedFields[r]})}else t.dispatch("workspace/LOAD_WORKSPACE",{workspaceId:data.workspaceId})})),n.$socket.addListener(ks,(function(data){if(data.magazine&&t.state.magazine.magazine&&t.state.magazine.magazine._id===data.magazine)if(data.updatedFields)for(var e=0,n=Object.keys(data.updatedFields);e<n.length;e++){var r=n[e];t.commit("magazine/UPDATE_FIELD",{key:r,value:data.updatedFields[r]})}else t.dispatch("magazine/LOAD_MAGAZINE",{magazineId:data.magazine,loadType:"current"})}
1)),n.$socket.addListener(Ss,(function(data){t.state.magazine.userMagazines&&t.dispatch("magazine/LOAD_USER_MAGAZINES"),t.state.magazine.organizationMagazines&&t.dispatch("magazine/LOAD_ORGANIZATION_MAGAZINES")})),n.$socket.addListener(As,(function(data){data.library&&t.state.library.library&&t.state.library.library._id===data.library&&t.dispatch("library/LOAD_LIBRARY",{libraryId:data.library,full:t.state.library.hasLoadedFullLibrary})})),n.$socket.addListener(Os,(function(data){data.magazine&&t.state.magazine.magazine&&t.state.magazine.magazine._id===data.magazine&&(data.updatedFields?t.commit("magazine/UPDATE_CURRENT_PAGE_ORDER",{pageId:data.page,value:data.updatedFields}):t.dispatch("magazine/LOAD_MAGAZINE",{magazineId:data.magazine,loadType:"current"}))})),n.$socket.addListener(Ts,(function(data){if(data.collaboration&&t.state.collaboration.collaboration&&t.state.collaboration.collaboration._id===data.collaboration)if(data.updatedFields||data.updatedArrays){if(data.updatedFields)for(var e=0,n=Object.keys(data.updatedFields);e<n.length;e++){var r=n[e];t.commit("collaboration/UPDATE_FIELD",{key:r,value:data.updatedFields[r]})}if(data.updatedArrays)for(var o=0,l=Object.keys(data.updatedArrays);o<l.length;o++){var c=l[o];t.commit("collaboration/UPDATE_IN_ARRAY",{key:c,values:data.updatedArrays[c]})}}else t.dispatch("collaboration/LOAD_COLLABORATION",data.collaboration)})),n.$socket.addListener(Ps,(function(data){data.order&&t.dispatch("order/LOAD_ORDER",{orderId:data.order,force:!0})})),n.$socket.addListener(Cs,(function(data){if(data.orders){var e=!0,n=!1,r=void 0;try{for(var o,l=data.orders[Symbol.iterator]();!(e=(o=l.next()).done);e=!0){var c=o.value;t.commit("order/REMOVE_ORDER",c)}}catch(e){n=!0,r=e}finally{try{e||null==l.return||l.return()}finally{if(n)throw r}}}})),n.$socket.addListener(xs,(function(data){data&&t.commit("notification/ADD_NOTIFICATION",data)})),n.$socket.addListener(Rs,(function(data){data&&data.comment&&data.magazine&&t.state.magazine.magazine&&t.state.magazine.magazine._id===data.magazine&&(data.page&&t.state.page.page&&t.state.page.page._id===data.page&&t.commit("pagecomment/ADD_COMMENT",data.comment),console.log("New page comment",data.comment),data.page&&t.state.pagecomment.commentCountByPage&&t.state.pagecomment.commentCountByPage.magazineId===data.magazine&&t.commit("pagecomment/ADD_COMMENT_COUNT",{magazineId:data.magazine,pageId:data.page,count:1}))})),n.$socket.addListener(zs,(function(data){data&&data.comment&&data.magazine&&t.state.magazine.magazine&&t.state.magazine.magazine._id===data.magazine&&(data.page&&t.state.page.page&&t.state.page.page._id===data.page&&t.commit("pagecomment/UPDATE_COMMENT_CONTENT",data.comment),data.page&&t.state.pagecomment.commentCountByPage&&t.state.pagecomment.commentCountByPage.magazineId===data.magazine&&data.deleted&&t.commit("pagecomment/ADD_COMMENT_COUNT",{magazineId:data.magazine,pageId:data.page,count:-1}))})),n.$socket.addListener(Ds,(function(data){data.id&&data.version&&t.state.magazine.pdfStatus&&t.state.magazine.pdfStatus.id===data.id&&t.state.magazine.pdfStatus.version===data.version&&t.commit("magazine/UPDATE_ROOT_FIELD",{key:"pdfStatus",value:data})})),n.$socket.addListener(Is,(function(data){data&&t.commit("app/UPDATE_SETTINGS",{key:"maintenanceMode",value:data.maintenanceMode})}))},al=n(312),nl=n(519);try{l.default.use(nl.StripePlugin,{pk:"pk_live_51OD2WpDh8IL4BKP9Hokr0LjJYZL5zLPjcjPNBw8nCH1njJJHI9FaAIBzCYFPglx95Z7B6Lmoru0x1FQiJY6WydGQ00Uj5r48ll",locale:"en"})}catch(e){console.error("Unable to load Stripe plugin",e)}var il=function(e){var t,n=e.app,r={},o=n.$mzLocalStorage.getItem("mzexplainfeature");if(o)try{t=JSON.parse(o)}catch(e){t={}}else t={};function c(){var e=Object.values(r).sort((function(e,t){var n=e.priority?parseInt(e.priority):-1;return(t.priority?parseInt(t.priority):-1)-n}));if(e.length>0){var o=e[0];console.log("EXPLAIN FEATURE - showNextFeature ",o.tag),o.showFeature(),t[o.tag]=!0,n.$mzLocalStorage.setItem("mzexplainfeature",JSON.stringify(t))}}l.default.prototype.$explainFeatures={register:function(e){console.log("EXPLAIN FEATURE - onReg
1ister new features with ",e);var n=e.tag,o=e.expireAt;n&&!r[n]&&(!o||new Date(o).getTime()>Date.now())&&(t[n]||(console.log("EXPLAIN FEATURE - onRegister feature "+n+" (expire at:"+o+")"),r[n]=e,Qt.a.debounce(c,1e3,l.default,"debounceShowFeature")()))},unregister:function(e){console.log("EXPLAIN FEATURE - onUnregister new features with ",e);var t=e.tag;t&&r[t]&&(delete r[t],Qt.a.debounce(c,500,l.default,"debounceShowFeature")())}}},rl=navigator&&navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0,sl=rl?"Cmd":"Ctrl",ll=rl?"Option":"Alt",cl=!0;function pl(e,t,n,label,r){console.log("SHORTCUT - register",e,t,n);var o=[];switch(n.ctrl&&o.push(sl),n.alt&&o.push(ll),n.shift&&o.push("Shift"),n.key){case"ArrowLeft":o.push("â¬
");break;case"ArrowRight":o.push("â¡");break;default:o.push(n.key.toUpperCase())}hl.list.push({tag:e,id:t,keys:n,label:label,callback:r,displayKeys:o.map((function(e){return'<span class="keyboard-key">'.concat(e,"</span>")})).join('<span class="keyboard-key-plus">+</span>')})}var hl=l.default.observable({list:[],register:function(e,t){var n=!0,r=!1,o=void 0;try{for(var l,c=t[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value;d.keys&&d.id&&d.callback&&d.label?pl(e,d.id,d.keys,d.label,d.callback):console.warn("SHORTCUT - Invalid shortcut definition",d)}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}console.log("SHORTCUT - current list",hl.list)},unregister:function(e){console.log("SHORTCUT - unregister by tag",e);var t=hl.list.filter((function(t){return t.tag===e})),n=!0,r=!1,o=void 0;try{for(var l,c=t[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value,h=hl.list.indexOf(d);h>-1&&hl.list.splice(h,1)}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}console.log("SHORTCUT - current list",hl.list)},getTootltip:function(e){var label=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=hl.list.find((function(t){return t.id===e}));return t?"".concat(label||t.label," ").concat(t.displayKeys):label||null},enableGlobalShortcuts:function(e){cl=e}}),fl=function(e){e.app;l.default.prototype.$keyboardShortcut=hl,document.addEventListener("keydown",(function(e){var t=e.ctrlKey||e.metaKey,n=e.altKey,r=e.shiftKey,o=e.key?e.key.toLowerCase():null;if(o&&cl){var l=hl.list.find((function(e){return e.keys.key&&e.keys.key.toLowerCase()===o&&(e.keys.ctrl===t||void 0===e.keys.ctrl&&!t)&&(e.keys.alt===n||void 0===e.keys.alt&&!n)&&(e.keys.shift===r||void 0===e.keys.shift&&!r)}));l&&(console.log("SHORTCUT - found shortcut",l),e.preventDefault(),e.stopImmediatePropagation(),l.callback())}}))};function ml(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function gl(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ml(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):ml(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}n.d(t,"b",(function(){return yl})),n.d(t,"a",(function(){return Me})),l.default.component(h.a.name,h.a),l.default.component(m.a.name,gl({},m.a,{render:function(e,t){return m.a._warned||(m.a._warned=!0,console.warn("<no-ssr> has been deprecated and will be removed in Nuxt 3, please use <client-only> instead")),m.a.render(e,t)}})),l.default.component(we.name,we),l.default.component("NChild",we),l.default.component(Fe.name,Fe),l.default.use(c.a,{keyName:"head",attribute:"data-n-head",ssrAttribute:"data-n-head-ssr",tagIDKeyName:"hid"});var bl={name:"page",mode:"out-in",appear:!0,appearClass:"appear",appearActiveClass:"appear-active",appearToClass:"appear-to"};function yl(e){return vl.apply(this,arguments)}function vl(){return(vl=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r,o,c,d,path,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ie();case 2:return n=e.sent,(r=vn(t)).$router=n,o=gl({store:r,router:n,nuxt:{defaultTransition:bl,transitions:[bl],setTransitions:function(e){return Array.isArray(e)||(e=[e]),e=e.map((function(e){return e=e?"string"==typeof e?Object.assign({},bl,{name:e}):Object.assign({},bl,e):bl})),this.$options.nuxt.transitions=e,e},err:null,dateErr:null,error:function(e){e=e||null,o.context._errored=Bo
1olean(e),e=e?Object(v.l)(e):null;var n=this.nuxt||this.$options.nuxt;return n.dateErr=Date.now(),n.err=e,t&&(t.nuxt.error=e),e}}},gn),r.app=o,c=t?t.next:function(e){return o.router.push(e)},t?d=n.resolve(t.url).route:(path=Object(v.d)(n.options.base,n.options.mode),d=n.resolve(path).route),e.next=11,Object(v.o)(o,{store:r,route:d,next:c,error:o.nuxt.error.bind(o),payload:t?t.payload:void 0,req:t?t.req:void 0,res:t?t.res:void 0,beforeRenderFns:t?t.beforeRenderFns:void 0,ssrContext:t});case 11:return h=function(e,t){if(!e)throw new Error("inject(key, value) has no key provided");if(void 0===t)throw new Error("inject(key, value) has no value provided");o[e="$"+e]=t,r[e]=o[e];var n="__nuxt_"+e+"_installed__";l.default[n]||(l.default[n]=!0,l.default.use((function(){Object.prototype.hasOwnProperty.call(l.default,e)||Object.defineProperty(l.default.prototype,e,{get:function(){return this.$root.$options[e]}})})))},window.__NUXT__&&window.__NUXT__.state&&r.replaceState(window.__NUXT__.state),e.next=16,jn(o.context);case 16:if("function"!=typeof Xn){e.next=19;break}return e.next=19,Xn(o.context,h);case 19:return e.next=22,di(o.context,h);case 22:if("function"!=typeof pi.a){e.next=25;break}return e.next=25,Object(pi.a)(o.context,h);case 25:return e.next=28,ki(o.context);case 28:return e.next=31,Ai(o.context,h);case 31:return e.next=34,Ci(o.context,h);case 34:return e.next=37,xi(o.context);case 37:return e.next=40,Di(o.context);case 40:e.next=43;break;case 43:e.next=46;break;case 46:return e.next=49,Fi(o.context,h);case 49:return e.next=52,Vi(o.context);case 52:return e.next=55,Ki(o.context);case 55:return e.next=58,Xi(o.context);case 58:return e.next=61,Pr(o.context);case 61:return e.next=64,Ir(o.context);case 64:e.next=67;break;case 67:e.next=70;break;case 70:return e.next=73,Ur(o.context);case 73:return e.next=76,Fr(o.context);case 76:return e.next=79,Nr(o.context);case 79:return e.next=82,$r(o.context);case 82:return e.next=85,Gr(o.context);case 85:return e.next=88,Hr(o.context);case 88:return e.next=91,Vr(o.context);case 91:return e.next=94,Wr(o.context);case 94:return e.next=97,Zr(o.context);case 97:return e.next=100,Jr(o.context);case 100:return e.next=103,to(o.context);case 103:return e.next=106,ao(o.context);case 106:return e.next=109,no(o.context);case 109:return e.next=112,oo(o.context);case 112:return e.next=115,so(o.context);case 115:if("function"!=typeof Br){e.next=118;break}return e.next=118,Br(o.context,h);case 118:return e.next=121,lo(o.context);case 121:return e.next=124,uo(o.context);case 124:return e.next=127,go(o.context);case 127:return e.next=130,bo(o.context);case 130:return e.next=133,_o(o.context);case 133:return e.next=136,Oo(o.context);case 136:return e.next=139,Eo(o.context);case 139:return e.next=142,Ao(o.context);case 142:return e.next=145,To(o.context);case 145:return e.next=148,xo(o.context);case 148:return e.next=151,Io(o.context);case 151:return e.next=154,wo(o.context);case 154:return e.next=157,Ro(o.context);case 157:return e.next=160,zo(o.context);case 160:return e.next=163,Lo(o.context);case 163:return e.next=166,jo(o.context);case 166:return e.next=169,Mo(o.context);case 169:return e.next=172,is(o.context);case 172:return e.next=175,ss(o.context);case 175:return e.next=178,ls(o.context);case 178:return e.next=181,cs(o.context);case 181:return e.next=184,us(o.context);case 184:return e.next=187,ps(o.context);case 187:return e.next=190,ms(o.context);case 190:return e.next=193,el(o.context,h);case 193:return e.next=196,tl(o.context);case 196:if("function"!=typeof al.a){e.next=199;break}return e.next=199,Object(al.a)(o.context,h);case 199:e.next=202;break;case 202:return e.next=205,il(o.context);case 205:return e.next=208,fl(o.context);case 208:e.next=211;break;case 211:return e.abrupt("return",{store:r,app:o,router:n});case 212:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},,,,,,,,,function(e,t,n){"use strict";n.r(t),n.d(t,"loadLanguageAsync",(function(){return d})),n.d(t,"validateRouteParams",(function(){return m})),n.d(t,"isSameRoute",(function(){return _})),n.d(t,"getLocaleDomain",(function(){return O})),n.d(t,"getLocaleFromRoute",(function(){return E})),n.d(t,"syncVuex",(function(){return k}));n(28),n(118),n(134),n(30),n(36),n(26),n(52),n(16),n(83),n(103);var r=n(39),o=(n(11),n(7),n(146),n(40)),l=n(3),c=n(9);function d(e,t){return h.apply(this,arguments)}
1function h(){return(h=Object(l.a)(regeneratorRuntime.mark((function e(t,r){var o,l,d,h,f,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((o=t.app).i18n.loadedLanguages||(o.i18n.loadedLanguages=[]),o.i18n.loadedLanguages.includes(r)){e.next=30;break}if(!(l=o.i18n.locales.find((function(e){return e[c.b]===r})))){e.next=30;break}if(!(d=l[c.d])){e.next=29;break}return e.prev=7,e.next=10,n(650)("./"+d);case 10:if(h=e.sent,"function"!=typeof(f=h.default?h.default:h)){e.next=18;break}return e.next=15,Promise.resolve(f(t));case 15:e.t0=e.sent,e.next=19;break;case 18:e.t0=f;case 19:m=e.t0,o.i18n.setLocaleMessage(r,m),o.i18n.loadedLanguages.push(r),e.next=27;break;case 24:e.prev=24,e.t1=e.catch(7),console.error(e.t1);case 27:e.next=30;break;case 29:console.warn("[".concat(c.f,"] Could not find lang file for locale ").concat(r));case 30:case"end":return e.stop()}}),e,null,[[7,24]])})))).apply(this,arguments)}var f=function(e){return e&&!Array.isArray(e)&&"object"===Object(o.a)(e)},m=function(e){f(e)?Object.entries(e).forEach((function(e){var t=Object(r.a)(e,2),n=t[0],o=t[1];c.p.includes(n)?f(o)||console.warn("[".concat(c.f,"] Trying to set route params for locale ").concat(n," with a non-object value")):console.warn("[".concat(c.f,"] Trying to set route params for key ").concat(n," which is not a valid locale"))})):console.warn("[".concat(c.f,"] Route params should be an object"))},y=/\/?$/;function v(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!a||!b)return a===b;var e=Object.keys(a),t=Object.keys(b);return e.length===t.length&&e.every((function(e){var t=a[e],n=b[e];return"object"===Object(o.a)(t)&&"object"===Object(o.a)(n)?v(t,n):String(t)===String(n)}))}function _(a,b){return!!b&&(a.path&&b.path?a.path.replace(y,"")===b.path.replace(y,"")&&a.hash===b.hash&&v(a.query,b.query):!(!a.name||!b.name)&&(a.name===b.name&&a.hash===b.hash&&v(a.query,b.query)&&v(a.params,b.params)))}var O=function(e,t){var n=(e.forwardedHost,window.location.href.split("/")[2]);if(n){var r=e.locales.find((function(e){return e[c.c]===n}));if(r)return r[c.b]}return null},E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="(".concat(c.p.join("|"),")"),n="(?:".concat(c.t).concat(c.k,")?");if(e.name){var r=new RegExp("".concat(c.t).concat(t).concat(n,"$"),"i"),o=e.name.match(r);if(o&&o.length>1)return o[1]}else if(e.path){var l=new RegExp("^/".concat(t,"/"),"i"),d=e.path.match(l);if(d&&d.length>1)return d[1]}return null},k=function(){var e=Object(l.a)(regeneratorRuntime.mark((function e(t){var n,r,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:null,r=o.length>2&&void 0!==o[2]?o[2]:null,!c.w||!t){e.next=9;break}if(null===n||!c.w.syncLocale){e.next=6;break}return e.next=6,t.dispatch(c.w.moduleName+"/setLocale",n);case 6:if(null===r||!c.w.syncMessages){e.next=9;break}return e.next=9,t.dispatch(c.w.moduleName+"/setMessages",r);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r={name:"MzIconButton",components:{MzAppIcon:n(29).a},props:["src","name","label","labelPlacement","disabled","tag","tagType","type","selected","noBorder","disableStopEvent","keepFocusOnClick","tooltip","tooltipPlacement","color","iconColor"],computed:{buttonElementIoType:function(){return"green"===this.color?"success":"blue"===this.color?"primary":"default"},iconSrcStyle:function(){if(!this.src)return{};var e="url(".concat(this.src,")");return{maskImage:e,WebkitMaskImage:e}}},data:function(){return{animationShake:!1}},methods:{onClickEvent:function(e){this.disableStopEvent||e.stopImmediatePropagation(),this.keepFocusOnClick||e.target.blur(),this.$emit("click")},shake:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;t<=0?(this.animationShake=!0,setTimeout((function(){e.animationShake=!1}),500)):setTimeout((function(){e.shake(0)}),t)}}},o=(n(616),n(6)),component=Object(o.a)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-tooltip",{attrs:{disabled:!e.tooltip,placement:e.tooltipPlacement,"open-delay":500,enterable:!1}},[n("div",{attrs:{slot:"content"},domProps:{innerHTML:e._s(e.tooltip)},slot:"content"}),e._v(" "),n("el-button",{class:{"el-label-button":e.label,"el-big-button":"big"===e.type,"el-large-button":"large"===e.type,"el-medium-button":"medium"===e.type,"el-small-button":"small"===e.type,"el-no-border-button":e.noBorder,"is-selected":e.selected,"is-selected-background-effect":e.selected&&e.noBorder&&!e.label,"is-colored":e.color,"is-icon-color-blue":e.iconColor&&"blue"===e.iconColor,"is-icon-color-blue-dark":e.iconColor&&"blue-dark"===e.iconColor}
1,attrs:{circle:!e.label,round:null!==e.label&&void 0!==e.label&&e.label.length>0,plain:!0!==e.noBorder&&!e.color,disabled:e.disabled,type:e.buttonElementIoType},on:{click:e.onClickEvent}},[e.label?n("span",{class:{"span-label-with-icon":!0,"placement-bottom":"bottom"===e.labelPlacement}},[n("span",{staticClass:"label-text"},[e._v(e._s(e.label))]),e._v(" "),e.name?n("MzAppIcon",{class:{shake:e.animationShake},attrs:{name:e.name}}):e.src?n("span",{class:{"icon-src":!0,shake:e.animationShake},style:e.iconSrcStyle}):e._e()],1):e.name?n("MzAppIcon",{class:{shake:e.animationShake},attrs:{name:e.name}}):e.src?n("span",{class:{"icon-src":!0,shake:e.animationShake},style:e.iconSrcStyle}):e._e(),e._v(" "),e.tag?n("el-tag",{class:{"el-tag-blue":"blue"===e.tagType},attrs:{size:"mini"}},[e._v(e._s(e.tag))]):e._e()],1)],1)}),[],!1,null,"d745e9bc",null);t.a=component.exports},function(e,t,n){"use strict";n(16),n(55),n(30),n(26);var r=n(39),o=(n(146),n(52),n(11),n(7),n(82),n(135),n(14));t.a={convertCsstoFabric:function(e,t){var output={},n=null,map=new Map([["bold",{name:"fontWeight",value:function(e){return new Map([[!0,"bold"],[!1,"normal"]]).get(e)}}],["italic",{name:"fontStyle",value:function(e){return new Map([[!0,"italic"],[!1,"normal"]]).get(e)}}],["underline",{name:"underline",value:function(e){return e}}],["strike",{name:"linethrough",value:function(e){return e}}],["background",{name:"textBackgroundColor",value:function(e){return e}}],["color",{name:"fill",value:function(e){return e}}],["link",{name:"link",value:function(e){return"string"!=typeof e?e.href:e}}],["textAlign",{name:"textAlign",value:function(e){return"justify"===e?"justify-left":e}}],["lineHeight",{name:"lineHeight",value:function(e){return e}}],["fontSize",{name:"fontSize",value:function(e){return e.indexOf("rem")>=0?null:o.a.parseToPixel(e)}}],["fontFamily",{name:"fontFamily",value:function(e){return e.replace(/"/g,"")}}],["list",{name:"list",value:function(e){return t?e:void 0}}],["indent",{name:"indent",value:function(e){return t?e:void 0}}],["script",{name:"script",value:function(e){return e}}]]),l={};if(e.fabricStyle&&e.fabricStyle.key&&"null"!==e.fabricStyle.key&&"undefined"!==e.fabricStyle.key&&e.fabricStyle.style&&"null"!==e.fabricStyle.style&&"undefined"!==e.fabricStyle.style)try{l=JSON.parse(e.fabricStyle.style)}catch(e){l={}}for(var c=0,d=Object.entries(e);c<d.length;c++){var h=Object(r.a)(d[c],2),f=h[0],m=h[1];if("overflowBackground"!==f)if("fabricStyle"===f){if(m.key&&"null"!==m.key&&"undefined"!==m.key)output.textStyleKey=m.key;else if(m.style&&"null"!==m.style&&"undefined"!==m.style){var y={};try{y=JSON.parse(m.style)}catch(e){y={}}output=Object.assign(y,output)}}else{if(!(n=map.get(f))){console.warn("Unmapped css property "+f+" -> "+m);continue}var v=n.value(m);v&&l[n.name]!=v&&(output[n.name]=v)}}return output},fabricStyleToCss:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30;if(!e)return"";var r="string"==typeof e?JSON.parse(e):e,o="none";r.underline&&(o="underline"),r.overline&&(o="none"!=o?o+" overline":"overline"),r.linethrough&&(o="none"!=o?o+" line-through":"line-through");var l=t?t.find((function(e){return e.name===r.fill})):void 0,c=t?t.find((function(e){return e.name===r.textBackgroundColor})):void 0,d=r.fontSize;d>16&&(d=16+(d-16)/2.5),d=Math.max(10,Math.min(n,d));for(var h={color:l?l.color:r.fill,"font-family":r.fontFamily,"font-weight":r.fontWeight||"normal","font-size":d+"px","font-style":r.fontStyle,"text-decoration":o,"background-color":c?c.color:r.textBackgroundColor,"text-align":r.textAlign},f=0,m=Object.keys(h);f<m.length;f++){var y=m[f];""!==h[y]&&void 0!==h[y]&&null!==h[y]||delete h[y]}return h},fabricStyleToQuillEditor:function(e){if(!e)return{};for(var t="string"==typeof e?JSON.parse(e):e,n={color:t.fill,background:t.textBackgroundColor,bold:!(!t.fontWeight||"bold"!==t.fontWeight)||void 0,italic:!(!t.fontStyle||"italic"!==t.fontStyle)||void 0,strike:!!t.linethrough||void 0,underline:!!t.underline||void 0},r={textAlign:t.textAlign},o=0,l=Object.keys(n);o<l.length;o++){var c=l[o];""!==n[c]&&void 0!==n[c]&&null!==n[c]||delete n[c]}for(var d=0,h=Object.keys(r);d<h.length;d++){var f=h[d];""!==r[f]&&void 0!==r[f]&&null!==r[f]||delete r[f]}return{formatText:Object.keys(n).length>0?n:null,formatLine:Object.keys(r).length>0?r:null,textStyleKey:t.textStyleKey}}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r={};r.authenticated=n(554),r.authenticated=r.authenticated.default||r.authenticated,r.redirectToLogin=n(557),r.redirectToLogin=r.redirectToLogin.default||r.redirectToLogin,r.setAppMode=n(558),r.setAppMode=r.setAppMode.default||r.setAppMode,t.a=r},,,,,function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(30);var r=n(4),o=n(2);function l(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var c={name:"MzCheckOfferAccessButton",components:{},props:["type","size","disabled","loading","label","permission","permissionLimit","isMagazinePermission","buttonClass","keepOriginalTextIfDisabled"],computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?l(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(o.e)("magazine",["magazine"]),{},Object(o.c)("api",["getUID","permissions","checkPerm","checkPermLimit"]),{},Object(o.c)("magazine",["checkMagazinePerm","checkMagazinePermLimit"]),{buttonType:function(){return this.hasPermission?this.type?this.type:"primary":"info"},buttonLabel:function(){return this.hasPermission||this.keepOriginalTextIfDisabled?this.label:this.$t("public.checkAccess.noAvailable")},canUpgradeOffer:function(){return!this.checkPerm("offer:hideUpgradeAction")},hasPermission:function(){var e=this;if(this.permission)if(Array.isArray(this.permission)){if(this.isMagazinePermission){if(void 0===this.permission.find((function(t){return e.checkMagazinePerm(t)})))return!1}else if(void 0===this.permission.find((function(t){return e.checkPerm(t)})))return!1}else if(this.isMagazinePermission){if(!this.checkMagazinePerm(this.permission))return!1}else if(!this.checkPerm(this.permission))return!1;if(this.permissionLimit)if(this.isMagazinePermission){if(!this.checkMagazinePermLimit(this.permissionLimit.key,this.permissionLimit.nb))return!1}else if(!this.checkPermLimit(this.permissionLimit.key,this.permissionLimit.nb))return!1;return!0}}),methods:{onClickEvent:function(e){if(e.stopImmediatePropagation(),this.hasPermission)this.$emit("click");else{if(this.isMagazinePermission){if(this.magazine.owner!=this.getUID)return void this.$alert(this.$t("public.updateOfferForAccess.messageNotOwner"),this.$t("public.updateOfferForAccess.titleNotOwner"),{dangerouslyUseHTMLString:!0});if(this.checkPerm("magazine:createWithPublicOffer"))return void this.$bus.$emit("showUpgradeOffer")}this.$alert(this.$t("public.updateOfferForAccess.message"),this.$t("public.updateOfferForAccess.title"),{dangerouslyUseHTMLString:!0,showConfirmButton:!1,showCancelButton:!0,cancelButtonText:this.$t("public.updateOfferForAccess.cancelButton")})}}}},d=n(6),component=Object(d.a)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.hasPermission||e.canUpgradeOffer?n("el-button",{class:e.buttonClass,attrs:{type:e.buttonType,size:e.size?e.size:"default",disabled:e.disabled||e.loading,loading:e.loading},on:{click:e.onClickEvent}},[e._v("\n "+e._s(e.buttonLabel)+"\n")]):e._e()}),[],!1,null,"54ff5c32",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(26);var r=n(4),o=n(2);function l(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var c={name:"MzOfferTag",props:["offer","showCompleteTag"],computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(o.c)("offer",["offerTagData"]),{textColor:function(){return this.offer&&this.offer.tag&&this.offerTagData[this.offer.tag]?this.offerTagData[this.offer.tag].textColor:null},bgColor:function(){return this.offer&&this.offer.tag&&this.offerTagData[this.offer.tag]?this.offerTagData[this.offer.tag].backgroundColor:"#cccccc"},tagText:function(){return this.offer&&this.offer.name?this.offer.name:"unknown"},tooltipText:function(){return!this.showCompleteTag&&this.tagText.length>30?this.tagText:null}})},d=(n(602),n(6)),component=Object(d.a)(c,(function(){var e=this.$createElement;return(this._self._c||e)("el-tag",{class:{"offer-tag":!0,"offer-tag-truncate":!this.showCompleteTag},attrs:{size:"mini",title:this.tooltipText}},[this._v(this._s(this.tagText))])}),[],!1,null,"934a7474",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16);var r=n(40),o=n(4),l=n(2),c=n(51);function d(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var h={name:"MzPageImage",props:["page","type","specificPalette"],data:function(){return{pageId:null,isPaletteDependant:!1,isDoublePage:!1,pageUpdatedAt:null,thumbData:null,isFirstLoadedTry:!0}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?d(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):d(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(l.e)("palette",["palette"]),{paletteForPage:function(){return this.specificPalette?this.specificPalette:this.palette},imgSrcError:function(){return this.isDoublePage?"big"===this.type||"very-big"===this.type||"big2"===this.type?"/placeholder/doublepage_big_size.svg":"/placeholder/doublepage_normal_size.svg":"big"===this.type||"very-big"===this.type||"big2"===this.type?"/placeholder/page_big_size.svg":"/placeholder/page_normal_size.svg"},imgSrc:function(){return this.thumbData?this.thumbData:this.pageId?("very-big"===this.type?(e=this.isDoublePage?600:300,t=420):"big2"===this.type?(e=this.isDoublePage?330:165,t=232):(e=this.isDoublePage?220:110,t=155),c.a.getImageResizedSrc({key:c.a.computePageKey(this.pageId,this.page.isPaletteDependant?this.paletteForPage._id:null),updatedAt:this.pageUpdatedAt?this.pageUpdatedAt:void 0},e,t,"inside")):this.imgSrcError;var e,t}}),mounted:function(){this.refresh(this.page)},beforeDestroy:function(){this.pageId&&this.$bus.$off("thumb_page_change_"+this.pageId,this.onThumbImageChange)},methods:{refresh:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.isFirstLoadedTry=!0,this.pageId&&this.$bus.$off("thumb_page_change_"+this.pageId,this.onThumbImageChange),"object"===Object(r.a)(e)?(this.pageId=e._id,this.isDoublePage=e.double):(this.pageId=e,this.isDoublePage=!1),this.pageId?(this.pageUpdatedAt=t?new Date:e.updatedAt,this.$bus.$on("thumb_page_change_"+this.pageId,this.onThumbImageChange)):this.pageUpdatedAt=null},onThumbImageChange:function(data){data&&data.thumbData?this.thumbData=data.thumbData:(this.thumbData=null,this.refresh(data&&data.page?data.page:this.page,!0))},onImageLoadError:function(e){var t=this;e.target.src=this.imgSrcError,this.isFirstLoadedTry&&(this.isFirstLoadedTry=!1,setTimeout((function(){t.pageUpdatedAt=new Date}),1e3))}},watch:{page:function(e){this.refresh(e)}}},f=(n(632),n(6)),component=Object(f.a)(h,(function(){var e=this.$createElement;return(this._self._c||e)("img",{key:this.pageId,class:{"page-very-big-size":"very-big"===this.type,"page-big-size":"big"===this.type,"page-big2-size":"big2"===this.type,"is-double-page":this.isDoublePage},attrs:{src:this.imgSrc,draggable:!1},on:{error:this.onImageLoadError}})}),[],!1,null,"7e6d9bd4",null);t.a=component.exports},function(e,t,n){"use strict";var r={name:"MzSingleLineText",props:[],computed:{},methods:{onMouseEnter:function(e){if(e&&e.target){var t=e.target;t.offsetWidth<t.scrollWidth?t.title=t.innerHTML:t.title=""}}}},o=(n(617),n(6)),component=Object(o.a)(r,(function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"single-line-text",on:{mouseenter:this.onMouseEnter}},[this._t("default",[this._v("single line text here")])],2)}),[],!1,null,"68aa1352",null);t.a=component.exports},,function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16);var r=n(27),o=(n(26),n(4)),l=n(2);function c(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function d(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var h={name:"EditOfferModal",components:{MzOfferTag:n(156).a},props:[],computed:d({},Object(l.e)("offer",["offer"]),{},Object(l.c)("offer",["listOfferTag","listOfferMarketType","listExistingAccess","listExistingLimits"]),{},Object(l.e)("magazine",["templateMagazines"]),{dialogTitle:function(){return this.editDisabled?this.$t("admin.offer.showTitle"):this.offer._id?this.$t("admin.offer.editTitle"):this.$t("admin.offer.createTitle")},productPrice:function(){return this.stripePriceId&&this.stripePriceId.length>0&&this.offer.productPrice&&void 0!==this.offer.productPrice.amount&&void 0!==this.offer.productPrice.currency?this.offer.productPrice.amount/100+" "+this.offer.productPrice.currency:"-"},name:{get:function(){return this.offer.name},set:function(e){this.updateField({key:"name",value:e})}},stripePriceId:{get:function(){return this.offer.stripePriceId},set:function(e){this.updateField({key:"stripePriceId",value:e})}},upgradeIndex:{get:function(){return this.offer.upgradeIndex},set:function(e){this.updateField({key:"upgradeIndex",value:e})}},isPublic:{get:function(){return this.offer.isPublic}
1,set:function(e){this.updateField({key:"isPublic",value:e})}},isDefault:{get:function(){return this.offer.isDefault},set:function(e){this.updateField({key:"isDefault",value:e})}},tag:{get:function(){return this.offer.tag},set:function(e){this.updateField({key:"tag",value:e})}},marketType:{get:function(){return this.offer.marketType},set:function(e){this.updateField({key:"marketType",value:e})}},duration:{get:function(){return this.offer.duration},set:function(e){this.updateField({key:"duration",value:e})}},offerDurationDate:{get:function(){return this.offer.duration.durationDate},set:function(e){var t=JSON.parse(JSON.stringify(this.offer.duration));t.durationDate=e,this.updateField({key:"duration",value:t})}},offerSettings:{get:function(){return this.offer.offerSettings},set:function(e){this.updateField({key:"offerSettings",value:e})}},availableTemplates:{get:function(){return this.offer.offerSettings.availableTemplates},set:function(e){this.updateField({key:"offerSettings.availableTemplates",value:e})}},formatedTemplates:function(){return[]},validateButtonDisabled:function(){return!0===this.loading||null===this.name||this.name.trim().length<2}}),data:function(){return{loading:!1,displayModal:!1,editDisabled:!1}},mounted:function(){var e=this;this.loadTemplateMagazines({filter:{status:"Published"},sort:"name"}).then((function(){console.log("templateMagazines",JSON.parse(JSON.stringify(e.templateMagazines)))}))},methods:d({},Object(l.b)({loadOffer:"offer/LOAD_OFFER",loadOffers:"offer/LOAD_OFFERS",saveOffer:"offer/SAVE_OFFER",loadTemplateMagazines:"magazine/LOAD_TEMPLATE_MAGAZINES"}),{},Object(l.d)({updateField:"offer/UPDATE_FIELD",resetOffer:"offer/RESET_OFFER",resetOffers:"offer/RESET_OFFERS"}),{hide:function(){this.displayModal=!1},show:function(e){var t=this;this.loading=!0,this.loadOffer(e).then((function(){t.loading=!1})),this.editDisabled=!0,this.displayModal=!0},showCreate:function(){this.resetOffer(),this.editDisabled=!1,this.displayModal=!0},showEdit:function(e){var t=this;this.loading=!0,this.loadOffer(e).then((function(){t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},showDuplicate:function(e){var t=this;this.loading=!0,this.resetOffer(),this.loadOffer(e).then((function(){t.updateField({key:"_id",value:null}),t.updateField({key:"isDefault",value:!1}),t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},switchAccessFor:function(e,t){if(!this.editDisabled){var n=Object(r.a)(this.offerSettings.accessList),o=n.indexOf(e);t?-1===o&&(n.push(e),this.updateField({key:"offerSettings.accessList",value:n})):o>=0&&(n.splice(o,1),this.updateField({key:"offerSettings.accessList",value:n}))}},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this;this.editDisabled?this.hide():(this.loading=!0,this.saveOffer().then((function(t){e.loading=!1,t&&(e.$emit("save",e.offer),e.hide())})))}})},f=(n(603),n(6)),component=Object(f.a)(h,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.dialogTitle,visible:e.displayModal,"close-on-click-modal":!1,width:"75%","append-to-body":""},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:24}},[n("el-form",{attrs:{"label-width":"250px",disabled:e.editDisabled}},[n("el-row",{staticClass:"mt-2",attrs:{type:"flex",justify:"start",align:"top"}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Name"}},[n("el-input",{attrs:{placeholder:"please input text"},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"Status"}},[n("el-switch",{model:{value:e.isPublic,callback:function(t){e.isPublic=t},expression:"isPublic"}}),e._v(" "),n("el-tag",{staticClass:"ml-1",attrs:{type:e.isPublic?"success":"danger",effect:"dark",size:"small"}},[e._v(e._s(e.isPublic?"public":"private"))])],1),e._v(" "),n("el-form-item",{attrs:{label:"Tag icon"}},[n("el-select",{staticClass:"el-select-tag",model:{value:e.tag,callback:function(t){e.tag=t},expression:"tag"}},e._l(e.listOfferTag,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value}},[n("span",[n("img",{attrs:{src:e.image}})])])})),1),e._v(" "),n("MzOfferTag",{staticClass:"display-tag-over-select",attrs:{offer:e.offer}}
1)],1),e._v(" "),n("el-form-item",{attrs:{label:"Stripe price ID"}},[n("el-input",{attrs:{clearable:""},model:{value:e.stripePriceId,callback:function(t){e.stripePriceId=t},expression:"stripePriceId"}})],1),e._v(" "),e.stripePriceId&&e.stripePriceId.length>0?n("el-form-item",{attrs:{label:"Stripe product price"}},[n("el-input",{attrs:{value:e.productPrice,disabled:!0}})],1):e._e()],1),e._v(" "),n("el-col",{attrs:{span:12,xl:8}},[n("el-form-item",[n("span",{attrs:{slot:"label"},slot:"label"},[e._v("Default B2C offer")]),e._v(" "),n("el-switch",{model:{value:e.isDefault,callback:function(t){e.isDefault=t},expression:"isDefault"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"Market"}},[n("el-select",{model:{value:e.marketType,callback:function(t){e.marketType=t},expression:"marketType"}},e._l(e.listOfferMarketType,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1),e._v(" "),n("el-form-item",{attrs:{label:"Plan Duration"}},[n("el-row",{attrs:{type:"flex"}},["date"===e.offer.duration.durationUnit?n("el-date-picker",{attrs:{type:"date",placeholder:"End date",clearable:!1},model:{value:e.offerDurationDate,callback:function(t){e.offerDurationDate=t},expression:"offerDurationDate"}}):"illimited"!==e.offer.duration.durationUnit?n("el-input-number",{attrs:{"controls-position":"right",value:e.offer.duration.durationTime},on:{change:function(t){return e.updateField({key:"duration.durationTime",value:t})}}}):e._e(),e._v(" "),n("el-select",{attrs:{value:e.offer.duration.durationUnit},on:{change:function(t){return e.updateField({key:"duration.durationUnit",value:t})}}},[n("el-option",{attrs:{value:"year",label:"Year"}}),e._v(" "),n("el-option",{attrs:{value:"month",label:"Month"}}),e._v(" "),n("el-option",{attrs:{value:"day",label:"Day"}}),e._v(" "),n("el-option",{attrs:{value:"date",label:"Date"}}),e._v(" "),n("el-option",{attrs:{value:"illimited",label:"Illimited"}})],1)],1)],1),e._v(" "),e.offer.isPublic?n("el-form-item",{attrs:{label:"Upgrade index"}},[n("el-input-number",{model:{value:e.upgradeIndex,callback:function(t){e.upgradeIndex=t},expression:"upgradeIndex"}})],1):e._e()],1)],1),e._v(" "),e._l(["workspace","magazine"],(function(t){return n("div",{key:t},[n("el-divider"),e._v(" "),n("el-row",[n("h2",[e._v("Options for "+e._s(t))])]),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},e._l(e.listExistingLimits[t],(function(t){return n("el-form-item",{key:t.value,attrs:{label:t.label}},[n("el-row",{attrs:{type:"flex",align:"middle"}},[n("el-switch",{attrs:{value:-1===e.offerSettings.limits[t.value]},on:{change:function(n){return e.updateField({key:"offerSettings.limits."+t.value,value:n?-1:0})}}}),e._v(" "),n("el-input-number",{directives:[{name:"show",rawName:"v-show",value:-1!==e.offerSettings.limits[t.value],expression:"offerSettings.limits[limitType.value] !== -1"}],staticClass:"ml-1",staticStyle:{width:"100px"},attrs:{"controls-position":"right",value:e.offerSettings.limits[t.value]},on:{change:function(n){return e.updateField({key:"offerSettings.limits."+t.value,value:n})}}}),e._v(" "),n("el-tag",{directives:[{name:"show",rawName:"v-show",value:-1===e.offerSettings.limits[t.value],expression:"offerSettings.limits[limitType.value] === -1"}],staticClass:"ml-1",attrs:{type:"info",effect:"dark"}},[e._v("illimited")])],1)],1)})),1),e._v(" "),n("el-col",{attrs:{span:16}},[n("el-row",e._l(e.listExistingAccess[t],(function(t){return n("el-col",{key:t.value,attrs:{span:12}},[n("el-form-item",{attrs:{label:t.label}},[n("el-switch",{attrs:{value:-1!==e.offer.offerSettings.accessList.indexOf(t.value)},on:{change:function(n){return e.switchAccessFor(t.value,n)}}})],1)],1)})),1)],1)],1),e._v(" "),"workspace"===t?n("el-row",{staticClass:"mt-1"},[n("el-form-item",{attrs:{label:"Specific Available Templates"}},[n("el-row",{attrs:{type:"flex",align:"middle"}},[n("el-select",{staticClass:"el-col el-col-18",attrs:{filterable:"",multiple:"",placeholder:"Select one or more specific template"},model:{value:e.availableTemplates,callback:function(t){e.availableTemplates=t},expression:"availableTemplates"}},e._l(e.templateMagazines,(function(template){return n("el-option",{key:template._id,attrs:{label:template.name,value:template._id}},[n("span",{staticStyle:{float:"left"}},[e._v(e._s(template.name))]),e._v(" "),template.format.formatBase?n("span",{staticStyle:{float:"left",color:"#8492a6","font-size":"12px","margin-left":"1rem"}}
1,[e._v(e._s(template.format.formatBase.name))]):e._e()])})),1),e._v(" "),n("el-col",{attrs:{span:6}},[n("el-tag",{staticClass:"ml-1",attrs:{type:"info",effect:"dark"}},[e._v("\n "+e._s(e.availableTemplates.length+" specific templates")+"\n ")])],1)],1)],1)],1):e._e()],1)}))],2)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],on:{click:e.onClickCancel}}),e._v(" "),e.editDisabled?e._e():n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.confirm",expression:"'public.alert.confirm'"}],attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:e.onClickValidate}})],1)])}),[],!1,null,"3011e16c",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16);var r=n(27),o=(n(30),n(4)),l=n(2),c=n(174),d=n(162),h=n(29),f="EndProcess",m={GetAllSvgFromS3:5,CreateHtmlPage:10,ExportPageStart:20,ExportPageEnd:40,GhostScriptConvertPdf:50,SendPdfToS3:75,GetPdfFromS3:5,GenerateZip:50,SendZipToS3:75,SendCompletedRequest:95,EndProcess:100};function y(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function v(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?y(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):y(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var _={name:"RequestPdfOrPublishModal",components:{PageEditor:d.a,MzAppIcon:h.a},props:[],data:function(){return{dialogTitle:"",dialogIcon:"",displayWaitingDialog:!1,currentGenerateIndex:0,pagesToGenerate:null,callbackAfterGenerate:null,statusInterval:null,callbackOnHideDialog:null,isPublishProcess:!1,displayCallbackButton:!1,disabledCallbackButton:!1,callbackButtonLabel:"",forceCompletePourcentage:!1}},computed:v({},Object(l.e)("magazine",["magazine","pdfStatus"]),{},Object(l.e)("theme",["theme"]),{},Object(l.c)("api",["checkPerm"]),{},Object(l.c)("app",["adminMode"]),{},Object(l.c)("theme",["getFormatedStylesForFabric"]),{pageStatePercentage:function(){return this.pagesToGenerate?Math.round(100*this.currentGenerateIndex/this.pagesToGenerate.length):0},pdfStatePercentage:function(){return this.pdfStatus&&this.pdfStatus.pdfProgressState&&m[this.pdfStatus.pdfProgressState]?m[this.pdfStatus.pdfProgressState]:0},globalPercentage:function(){return this.forceCompletePourcentage?100:null===this.pagesToGenerate?this.pdfStatePercentage:Math.round((this.pageStatePercentage+this.pdfStatePercentage)/2)}}),beforeDestroy:function(){this.stopRequestStatusInterval()},methods:v({},Object(l.b)({loadMagazine:"magazine/LOAD_MAGAZINE",publishMagazine:"magazine/PUBLISH_MAGAZINE",requestExportMagazinePdf:"magazine/REQUEST_EXPORT_MAGAZINE_PDF",requestExportMagazinePdfStatus:"magazine/REQUEST_EXPORT_MAGAZINE_PDF_STATUS",generatePageThumb:"page/GENERATE_PAGE_THUMB"}),{},Object(l.d)({resetPdfStatus:"magazine/RESET_PDF_STATUS_STATE"}),{reloadDataAndHideDialog:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.loadMagazine({magazineId:this.magazine._id,loadType:"current"}).then((function(){e.hideDialog(t)}))},hideDialog:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.forceCompletePourcentage=!0,this.stopRequestStatusInterval(),this.$refs.pageEditorModal&&this.$refs.pageEditorModal.unloadEditor(),e&&this.callbackOnHideDialog){if(this.displayCallbackButton)return void(this.disabledCallbackButton=!1);this.callbackOnHideDialog()}this.displayWaitingDialog=!1,this.displayCallbackButton=!1,this.disabledCallbackButton=!1,this.callbackOnHideDialog=null,this.isPublishProcess=!1,this.forceCompletePourcentage=!1,this.$bus.$emit("forceReloadPageFlatplan")},onClickCallbackButton:function(){this.callbackOnHideDialog&&this.callbackOnHideDialog(),this.hideDialog(!1)},askCleanBeforeRequestPdf:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.displayWaitingDialog||this.$confirm("Do you wan't to clean all data (existing SVG and PDF files) before request the new PDF version ?","Clean all data before request",{confirmButtonText:"No, just request the pdf with existing files",cancelButtonText:"Yes, clean all",distinguishCancelAndClose:!0}).then((function(){t.requestPdf(e,n)})).catch((function(r){"cancel"===r&&t.requestPdf(e,n,!0)}))},requestPdf:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.displayWaitingDialog||(this.resetPdfStatus(),this.forceCompletePourcentage=!1,this.pagesToGenerate=null,this.callbackAfterGenerate=null,this.callbackOnHideDialog=t,this.isPublishProcess=!1,r&&(this.displayCallbackButton=!0,this.disabledCallbackButton=!0,this.callbackButtonLabel=r),"viewercode"==e?(this.dialogTitle=this.$t("public.regenModal.requestViewerCodeTitle"),this.dialogIcon="file_download"):"draft"==e?(this.dialogTitle=this.$t("public.regenModal.requestPreviewTitle"),this.dialogIcon="preview"):(this.dialogTitle=this.$t("public.regenModal.requestPdfTitle"),this.dialogIcon="preview"),this.adminMode||"draft"!=e&&"web"!=e&&"viewercode"!=e||(this.displayWaitingDialog=!0),this._sendRequestPdf(e,n))},_sendRequestPdf:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.requestExportMagazinePdf({magazineId:this.magazine._id,version:e,forceCleanAll:n,isAdminRequest:this.adminMode,forceGenerateWithInvalidPage:r}).then((function(n){n&&n.missingSvgs?(console.log("missing svgs",n.missingSvgs),t.dis
1playWaitingDialog=!0,t.callbackAfterGenerate=function(){t._sendRequestPdf(e,!1,!0)},t.regenMissingSvgs(n.missingSvgs)):!n||"draft"!=e&&"web"!=e&&"viewercode"!=e?t.reloadDataAndHideDialog():t.startRequestStatusInterval(e)}))},requestPdfStatus:function(e){var t=this;this.displayWaitingDialog||this.requestExportMagazinePdfStatus({magazineId:this.magazine._id,version:e}).then((function(n){n?n&&n.missingSvgs?(t.resetPdfStatus(),t.displayWaitingDialog=!0,t.dialogTitle=t.$t("public.regenModal.requestPdfTitle"),t.dialogIcon="preview",t.callbackAfterGenerate=function(){t._sendRequestPdf(e)},t.regenMissingSvgs(n.missingSvgs)):t.reloadDataAndHideDialog():(console.log("no response for requestPdfStatus"),t.reloadDataAndHideDialog())}))},switchPublish:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.displayWaitingDialog)if(this.isPublishProcess=!1,"Published"!==this.magazine.status){var n=this.magazine.isTemplate?this.$t("admin.publish_template.publish_message"):this.$t("public.publish_magazine.publish_message_without_clean_library"),r=this.magazine.isTemplate?this.$t("admin.publish_template.publish_title"):this.$t("public.publish_magazine.publish_title"),o=this.magazine.isTemplate?this.magazine.isPrivate?this.$t("admin.publish_template.private_publish_button"):this.$t("admin.publish_template.public_publish_button"):this.$t("public.publish_magazine.publish_button");if(!this.magazine.isTemplate){(this.magazine.pageCount<8||this.magazine.pageCount%4!=0)&&(n+=this.$t("public.publish_magazine.message_invalid_page_count"));var l=this.magazine.pageOrder.find((function(e){return!!e.missingPreviousPage||(!!(e.textWithOverflow&&e.textWithOverflow.length>0)||(!!(e.imageLowDefinitionWeb&&e.imageLowDefinitionWeb.length>0)||!!(e.imageLowDefinitionPrint&&e.imageLowDefinitionPrint.length>0)))}));l&&(n+=this.$t("public.publish_magazine.message_page_warning"))}this.$confirm(n,r,{dangerouslyUseHTMLString:!0,confirmButtonText:o,cancelButtonText:this.$t("public.alert.cancel")}).then((function(){e.confirmPublish(t)})).catch((function(){}))}else{var c=this.magazine.isTemplate?this.$t("admin.publish_template.unpublish_message"):this.$t("public.publish_magazine.unpublish_message"),d=this.magazine.isTemplate?this.$t("admin.publish_template.unpublish_title"):this.$t("public.publish_magazine.unpublish_title"),h=this.magazine.isTemplate?this.$t("admin.publish_template.unpublish_button"):this.$t("public.publish_magazine.unpublish_button");this.$confirm(c,d,{confirmButtonText:h,cancelButtonText:this.$t("public.alert.cancel")}).then((function(){e.confirmUnpublish(t)})).catch((function(){}))}},confirmPublish:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.displayWaitingDialog||(this.resetPdfStatus(),this.forceCompletePourcentage=!1,this.pagesToGenerate=null,this.callbackAfterGenerate=null,this.isPublishProcess=!0,this.callbackOnHideDialog=e,this.dialogTitle=this.$t("public.regenModal.publishTitle"),this.dialogIcon="publish",this.displayCallbackButton=!1,this.displayWaitingDialog=!0,this.$bus.$emit("unselectPageFlatplan",!0),this._sendPublish())},_sendPublish:function(){var e=this;this.publishMagazine({publish:!0}).then((function(t){t&&t.missingSvgs?(e.callbackAfterGenerate=function(){e._sendPublish()},e.regenMissingSvgs(t.missingSvgs)):t&&t.invalidPages?(e.callbackAfterGenerate=function(){e._sendPublish()},e.regenInvalidPages(t.invalidPages)):t?e.startRequestStatusInterval("web"):e.reloadDataAndHideDialog()}))},confirmUnpublish:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.$bus.$emit("unselectPageFlatplan",!0),this.publishMagazine({publish:!1}).then((function(){e&&e()}))},regenMissingSvgs:function(e){var t=this;this.pagesToGenerate=e.map((function(e){return{page:e,palette:t.magazine.isTemplate?t.theme.paletteList[0]._id:null,missingSvg:!0,missingPng:!1}})),this.startGeneratePageThumb()},regenInvalidPages:function(e){this.pagesToGenerate=e,this.startGeneratePageThumb()},startGeneratePageThumb:function(){this.currentGenerateIndex=0,this.displayWaitingDialog=!0,console.log("startGeneratePageThumb",JSON.parse(JSON.stringify(this.pagesToGenerate))),this.generateNextPageThumb()},generateNextPageThumb:function(){var e=this;if(this.currentGenerateIndex<this.pagesToGenerate.length){if(!this.$refs.pageEditorModal)return this.displayWaitingDialog=!0,void this.$nextTick(this.generateNextPageThumb);var t=this.pagesToGenerate[this.currentGenerateIndex];this.$refs.pageEditorModal.loadEditorForPage(t.page,t.palette)}else setTimeout((function(){e.callbackAfterGenerate?(e.callbackAfterGenerate(),e.callbackAfterGenerate=null):e.hideDialog()}),250)},onEditorReady:function(){var e=this;if(this.displayWaitingDialog){var t=this.pagesToGenerate[this.currentGenerateIndex],n=t.missingSvg?this.$fabric.page.getSVG({fonts:c.a.fontListUrl([].concat(Object(r.a)(this.$fontManager.defaultFonts),Object(r.a)(this.theme.fonts))),styles:this.getFormatedStylesForFabric}):void 0,o=t.missingPng?this.$fabric.page.getThumb():void 0;this.generatePageThumb({pageId:t.page,paletteId:t.palette,isDefaultPalette:t.palette&&t.palette===this.theme.paletteList[0]._id,svgData:n,thumbData:o}).then((function(){e.currentGenerateIndex++,e.generateNextPageThumb()}))}},startRequestStatusInterval:function(e){var t=this;console.log("startRequestStatusInterval for "+e),this.statusInterval&&this.stopRequestStatusInterval(),this.statusInterval=setInterval((function(){console.log("startRequestStatusInterval send for "+e),t.requestExportMagazinePdfStatus({magazineId:t.magazine._id,version:e,updateStore:!0}).then((function(e){e||(console.log("no response for startRequestStatusInterval"),t.reloadDataAndHideDialog())}))}),5e3)},stopRequestStatusInterval:function(){this.statusInterval&&(clearInterval(this.statusInterval),this.statusInterval=null)},cancelProcess:function(){this.isPublishProcess&&"Published"===this.magazine.status&&this.publishMagazine({publish:!1}),this.hideDialog(!1)}}),watch:{pdfStatus:function(){this.displayWaitingDialog&&this.pdfStatus.pdfProgressState===f&&this.reloadDataAndHideDialog()}}}
1,O=(n(599),n(6)),component=Object(O.a)(_,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-dialog",{attrs:{visible:e.displayWaitingDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,"append-to-body":""},on:{"update:visible":function(t){e.displayWaitingDialog=t}}},[n("span",{staticClass:"el-dialog__title",attrs:{slot:"title"},slot:"title"},[n("MzAppIcon",{attrs:{name:e.dialogIcon}}),e._v("\n "+e._s(e.dialogTitle)+"\n\n "),n("button",{staticClass:"el-dialog__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:e.cancelProcess}},[n("MzAppIcon",{staticClass:"el-dialog__close ml-1 mt-1",attrs:{name:"close"}})],1)],1),e._v(" "),n("el-row",{staticClass:"content-page-editor"},[n("PageEditor",{ref:"pageEditorModal",attrs:{editDisabled:!0,lowDefinitionImage:!0,backgroundProcess:!0},on:{ready:e.onEditorReady}})],1),e._v(" "),n("el-row",{attrs:{type:"flex",align:"middle"}},[n("el-col",[n("el-progress",{attrs:{"text-inside":!0,"stroke-width":26,percentage:e.globalPercentage}})],1),e._v(" "),e.displayCallbackButton?n("el-button",{staticClass:"ml-2",attrs:{disabled:e.disabledCallbackButton,size:"medium",type:"primary"},nativeOn:{click:function(t){return e.onClickCallbackButton(t)}}},[e._v("\n "+e._s(e.callbackButtonLabel)+"\n ")]):e._e()],1),e._v(" "),e.checkPerm("debug:all")?n("el-row",{staticClass:"mt-1"},[n("small",[e._v("\n Pages to generate:\n "+e._s(this.pagesToGenerate?this.currentGenerateIndex+"/"+this.pagesToGenerate.length:"-")+"\n | Pdf status : "+e._s(e.pdfStatus.pdfProgressState)+"\n ")])]):e._e()],1)],1)}),[],!1,null,"7e1784d4",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(16),n(7),n(35),n(13),n(11);var r=n(27),o=(n(28),n(3)),l=(n(30),n(4)),c=n(2),d=n(281),h=n(51),f=n(14);function m(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function y(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?m(Object(source),!0).forEach((function(t){Object(l.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):m(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var v,_={name:"PageEditor",props:["pageId","paletteId","editDisabled","editObjectsEnabled","updatePageAccess","lowDefinitionImage","backgroundProcess"],computed:y({},Object(c.e)("page",["page"]),{},Object(c.e)("magazine",["magazine","template"]),{},Object(c.e)("palette",["palette"]),{},Object(c.e)("theme",["theme"]),{},Object(c.e)("fabric",["activeObject"]),{},Object(c.e)("library",["publicTemplateLibrary"]),{},Object(c.c)("theme",["getFormatedStylesForFabric"]),{},Object(c.e)("collaboration",["collaboration","userCollaboration"]),{},Object(c.c)("collaboration",["collaborationIsActive","activeCollaborationUserByPages"]),{},Object(c.c)("app",["adminMode","appGUI"]),{},Object(c.c)("api",["getUID"]),{canEditPage:function(){return!this.editDisabled&&"Published"!==this.magazine.status&&(!!this.isPageControler||!this.userPageControler&&this.isPageOwner)},canEditObjectsInPage:function(){return this.canEditPage&&(this.adminMode||this.editObjectsEnabled)},isPageOwner:function(){if(this.collaborationIsActive){var e=this.activeCollaborationUserByPages[this.page._id];return e?e.user._id===this.userCollaboration._id:"chief"===this.userCollaboration.role}return this.magazine.owner===this.getUID},isPageControler:function(){return this.userPageControler&&this.userPageControler._id===this.userCollaboration._id},userPageControler:function(){var e=this;if(!this.collaborationIsActive)return null;var t=this.collaboration.pagesCollaboration.find((function(t){return e.page._id===t.page}));return t&&t.takeControlUser?this.collaboration.users.find((function(e){return e._id===t.takeControlUser})):null}}),data:function(){return{loading:!1,reloadIfCanEditChange:!1,pageToLoadAfterLoadingFinish:null,forceRefreshCacheFont:!1,
1currentTextSize:null,hiddenObjects:[],currentPageId:null,canvasDomId:null}},mounted:function(){this.canvasDomId="background_"+f.a.uniqidplus(),window.addEventListener("resize",this.onWindowResize,!1),this.pageId&&this.loadEditorForPage(this.pageId)},beforeDestroy:function(){window.removeEventListener("resize",this.onWindowResize),this.unloadEditor(),this.canvasDomId=null},methods:y({},Object(c.b)({loadTemplate:"magazine/LOAD_TEMPLATE",loadPage:"page/LOAD_PAGE",loadTheme:"theme/LOAD_THEME",loadThemePalettes:"palette/LOAD_THEME_PALETTES",apiSendError:"api/API_SEND_ERROR"}),{},Object(c.d)({updateFabricStateField:"fabric/UPDATE_ROOT_FIELD",clearActiveObject:"fabric/CLEAR_ACTIVE_OBJECT",setActiveObject:"fabric/SET_ACTIVE_OBJECT",selectPalette:"palette/SET_CURRENT_PALETTE",resetPage:"page/RESET_PAGE"}),{loadEditorForPage:(v=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loading){e.next=3;break}return this.pageToLoadAfterLoadingFinish=t,e.abrupt("return");case 3:return console.log("DEBUG loadEditorForPage received , unload editor",t,n),this.unloadEditor(),this.loading=!0,this.reloadIfCanEditChange=!1,this.currentPageId=t,e.next=10,this.loadPage(t);case 10:return e.next=12,this.loadTemplate(this.magazine.template);case 12:return e.next=14,this.loadTheme(this.magazine.theme);case 14:return e.next=16,this.loadThemePalettes(this.magazine.theme);case 16:return console.log("DEBUG loadEditorForPage",y({},this.page)),n?this.selectPalette(n):this.page.palette?this.selectPalette(this.page.palette):this.theme&&this.theme.paletteList&&this.theme.paletteList.length>0&&this.selectPalette(this.theme.paletteList[0]._id),e.next=20,this.$fontManager.loadFontList(this.theme.fonts);case 20:r=e.sent,this.forceRefreshCacheFont=r&&r.length>0,this.initCanvas(),this.initPage();case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),unloadEditor:function(){this.currentPageId=null,this.$fabric.disposeCanvas(),this.clearActiveObject(),this.removeCanvasListeners(),this.loading=!1},onWindowResize:function(){this.resizeCanvasToContainer()},resizeCanvasToContainer:function(){if(this.$fabric&&this.$fabric.canvas&&this.$refs.pageEditorContent){var e=this.$refs.pageEditorContent.clientWidth,t=this.$refs.pageEditorContent.clientHeight;e&&t&&this.$fabric.canvas.resizeToDimensions(e,t)}},initCanvas:function(){this.$fabric.createCanvas(this.canvasDomId,this.$refs.pageEditorContent.clientWidth,this.$refs.pageEditorContent.clientHeight,{useSpaceForPanning:this.canEditObjectsInPage,useOverEffect:!this.canEditObjectsInPage,disableMultiSelection:!this.adminMode,useKeyboardControl:this.canEditObjectsInPage,autoSelectRootTextbox:!this.canEditObjectsInPage,showSpecificControls:this.adminMode}),this.resizeCanvasToContainer()},initPage:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.clearActiveObject(),e.$fabric.canvas){t.next=3;break}return t.abrupt("return");case 3:if(e.$fabric.canvas.clear(),e.magazine&&e.magazine.format&&e.magazine._id&&e.page&&e.page._id){t.next=8;break}return console.error("invalid magazine data for init page",JSON.parse(JSON.stringify(e.magazine))),console.error("invalid page data for init page",JSON.parse(JSON.stringify(e.page))),t.abrupt("return");case 8:if((n={}).pageId=e.page._id,n.pageRect={top:10,left:10,width:e.magazine.format.canvasWidth,height:e.magazine.format.canvasHeight},n.format=e.magazine.format,n.double=e.page.double,n.hideOutContent=!e.canEditObjectsInPage,n.hideMargin=!e.canEditObjectsInPage,n.specificMagazineData=d.a.generateSpecificMagazineData({template:e.template,magazine:e.magazine,page:e.page,palette:e.palette,theme:e.theme}),console.log("PageEditor init page"),e.$fabric.createPage(n),e.centerFabricPageOnScreen(!1),e.$fabric.setTextStylesList(e.getFormatedStylesForFabric),!e.page.pageData){t.next=31;break}try{r=e.formatPageData()}catch(t){console.error("error on PageEditor.vue - initPage - formatPageData",t),e.apiSe
1ndError({from:"PageEditor.vue - initPage - formatPageData",error:t})}return t.prev=22,t.next=25,e.$fabric.page.import(r,e.canEditObjectsInPage&&!e.adminMode);case 25:t.next=31;break;case 27:t.prev=27,t.t0=t.catch(22),console.error("error on PageEditor.vue - initPage - import",t.t0),e.apiSendError({from:"PageEditor.vue - initPage - import",error:t.t0,formatedData:r});case 31:e.initPageComplete();case 32:case"end":return t.stop()}}),t,null,[[22,27]])})))()},centerFabricPageOnScreen:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.$fabric.canvas){var t=this.$fabric.canvas.centerOnScreen(e?{top:this.appGUI.pageEditor.marginTop,bottom:this.appGUI.pageEditor.marginBottom}:{});this.backgroundProcess||this.updateFabricStateField({key:"canvas.zoom",value:100*t})}},initPageComplete:function(){var e=this;if(this.pageToLoadAfterLoadingFinish)return this.loading=!1,this.loadEditorForPage(this.pageToLoadAfterLoadingFinish),void(this.pageToLoadAfterLoadingFinish=null);setTimeout((function(){e.forceRefreshCacheFont=!1,e.$fabric.page.clearFontCache(),e.$nextTick((function(){e.initPageFinished()}))}),250)},initPageFinished:function(){this.centerFabricPageOnScreen(),this.backgroundProcess||this.initCanvasListeners(),this.$emit("ready",{hiddenObjects:this.hiddenObjects}),this.loading=!1},formatPageData:function(){var e=this,t=d.a.formatPageDataBeforeImport({magazine:this.magazine,page:this.page,palette:this.palette,lowDefinitionImage:this.lowDefinitionImage});this.hiddenObjects=[];var n=t.objects.reduce((function(e,object){return e.push(object),"MzGroup"===object.type&&object.objects&&e.push.apply(e,Object(r.a)(object.objects)),e}),[]),o=!0,l=!1,c=void 0;try{for(var f,m=n[Symbol.iterator]();!(o=(f=m.next()).done);o=!0){var object=f.value;object.readOnly=!this.canEditPage||!this.adminMode&&!this.canEditObjectsInPage&&object.clientSideLocked||this.adminMode&&object.adminSideLocked,object.locked=!this.canEditObjectsInPage,"MzTextbox"===object.type&&0===object.opacity&&this.hiddenObjects.push(object.id),!this.adminMode&&"MzShapeGroup"===object.type&&this.publicTemplateLibrary.shapes.length>0&&function(){var t=h.a.getImageBaseKey(object.sourcePath),n=e.publicTemplateLibrary.shapes.find((function(e){return e.key===t}));object.variantGroup=n&&n.variantGroup?n.variantGroup:null}()}}catch(e){l=!0,c=e}finally{try{o||null==m.return||m.return()}finally{if(l)throw c}}return this.reloadIfCanEditChange=!0,t},updateImageSourceFromCropped:function(e,source,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return e&&"MzImage"===e.type?e.updateSourceFromCropped(t,n,r):Promise.reject(new Error("Invalid object for cropped update"))},initCanvasListeners:function(){this.removeCanvasListeners(),this.$fabric&&this.$fabric.canvas&&(this.$fabric.canvas.on("selection:cleared",this.onSelectionCleared),this.$fabric.canvas.on("selection:created",this.onSelectionUpdate),this.$fabric.canvas.on("selection:updated",this.onSelectionUpdate),this.$fabric.canvas.on("canvas:zoom",this.onCanvasZoom),this.$fabric.canvas.on("object:rotating",this.onObjectTranform),this.$fabric.canvas.on("object:scaling",this.onObjectTranform),this.$fabric.canvas.on("object:wheelScaling",this.onObjectTranform),this.$fabric.canvas.on("object:modified",this.onObjectTranform),this.$fabric.canvas.on("object:moving",this.onObjectTranform),this.$fabric.canvas.on("object:cropping",this.onObjectTranform),this.$fabric.canvas.on("object:removed",this.onObjectRemoved))},removeCanvasListeners:function(){this.$fabric&&this.$fabric.canvas&&(this.$fabric.canvas.off("selection:cleared",this.onSelectionCleared),this.$fabric.canvas.off("selection:created",this.onSelectionUpdate),this.$fabric.canvas.off("selection:updated",this.onSelectionUpdate),this.$fabric.canvas.off("canvas:zoom",this.onCanvasZoom),this.$fabric.canvas.off("object:rotating",this.onObjectTranform),this.$fabric.canvas.off("object:scaling",this.onObjectTranform),this.$fabric.canvas.off("object:wheelScaling",this.onObjectTranform),this.$fabric.canvas.off("object:modified",this.onObjectTranform),this.$fabric.canvas.off("object:moving",this.onObjectTranform),this.$fabric.canvas.off("object:cropping",this.onObjectTranform),this.$fabric.canvas.off("object:removed",this.onObjectRemoved))},onSelectionCleared:function(e){this.clearActiveObject(),this.$bus.$emit("selectionCleared")},onSelectionUpdate:function(e){this.setActiveObject({value:this.$fabric.activeObject}),this.$bus.$emit("activeObjectChanged"),"MzTextbox"===this.activeObject.type?(this.$bus.$emit("textBoxSelectionChanged"),this.initTextListeners(),this.currentTextSize={
1width:this.activeObject.width,height:this.activeObject.height}):(this.removeTextListeners(),this.currentTextSize=null)},onCanvasZoom:function(e){this.updateFabricStateField({key:"canvas.zoom",value:100*e.zoom})},onObjectTranform:function(e){var t=this,n=this.$fabric.activeObject;if(n&&this.activeObject){var r=["width","height"];if(e.transform)switch(e.transform.action){case"drag":r=["top","left"];break;case"crop":r=["cropX","cropY"];break;case"scale":r=["scaleX","scaleY","width","height","angle"];case"rotate":r=["angle"]}r.forEach((function(e){t.activeObject[e]!=n[e]&&t.updateFabricStateField({key:"activeObject."+e,value:n[e]})}))}},onObjectRemoved:function(e){this.clearActiveObject()},initTextListeners:function(){this.removeTextListeners(),this.$fabric&&this.$fabric.canvas&&this.$fabric.canvas.on("text:error",this.onTextStyleError)},removeTextListeners:function(){this.$fabric&&this.$fabric.canvas&&this.$fabric.canvas.off("text:error",this.onTextStyleError)},onTextStyleError:function(e){var t;e.errors.text?t=this.$t("public.edit_magazine.edit_textbox_error.text"):e.errors.styles&&(t=this.$t("public.edit_magazine.edit_textbox_error.style")),t&&this.$message({type:"error",message:t}),this.$fabric.refresh()}}),watch:{canEditPage:function(e){var t=this;this.reloadIfCanEditChange&&(this.reloadIfCanEditChange=!1,this.resetPage(),this.loadPage(this.currentPageId).then((function(){t.initPage()})))}}},O=(n(598),n(6)),component=Object(O.a)(_,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:!this.backgroundProcess&&this.loading,expression:"!backgroundProcess && loading"}],ref:"pageEditorContent",staticClass:"pageEditorContent"},[this.canvasDomId?t("canvas",{attrs:{id:this.canvasDomId}}):this._e()])}),[],!1,null,"abeb0d3a",null);t.a=component.exports},,,,,,,,,,,,function(e,t,n){"use strict";n(52),n(7),n(26);var r=n(126);t.a={fontListUrl:function(e){for(var t={},i=0;i<e.length;i++)if(e[i].name)switch(e[i].provider){case"typekit":console.warn("get url for typekit not implemented");break;case"custom":var n=e[i].url,r=n.indexOf("amazonaws.com/");n=r>=0?"https://mz-media-data-production.s3.eu-west-1.amazonaws.com/"+n.substr(r+14):"https://mz-media-data-production.s3.eu-west-1.amazonaws.com/"+n,t[e[i].name]=encodeURI(n);break;case"google":default:t[e[i].name]="https://fonts.googleapis.com/css?family="+encodeURI(e[i].name)+":"+(e[i].styles?e[i].styles.join(","):"")+"&subset="+(e[i].subsets?e[i].subsets.join(","):"")}return t},extractTTFdataFromUrl:function(e){var t=e.substring(0,e.lastIndexOf("/"));return new Promise((function(n,o){r.get(e).then((function(e){if(200==e.status){var data=e.data,r=[];if(data.length>0){var l,c,d,h,f;data=data.replace(/\n|\r/g,"");for(var m=/@font-face \{([^\}]*)\}/g;null!==(l=m.exec(data));)if(c=/font-family: '([^']*)';/.exec(l[1]),d=/font-style: ([^;]*);/.exec(l[1]),h=/font-weight: ([^;]*);/.exec(l[1]),f=/src:.*url\(([^)]*)\).*;/.exec(l[1]),c&&d&&h&&f){var y=f[1];(0===y.indexOf("'")&&y.lastIndexOf("'")===y.length-1||0===y.indexOf('"')&&y.lastIndexOf('"')===y.length-1)&&(y=y.substring(1,y.length-1)),0===y.indexOf("./")&&(y=t+"/"+y),r.push({family:c[1],style:d[1],weight:h[1],url:y})}}n(r.length>0&&r)}else o("error load font")})).catch((function(e){console.log("load font error ",e),o(e)}))}))}}},,,,,,,,,,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t){e.exports=[{currencies:[{code:"AFN",name:"Afghan afghani",symbol:"Ø"}],name:"Afghanistan",alpha2Code:"AF",alpha3Code:"AFG"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Ã
land Islands",alpha2Code:"AX",alpha3Code:"ALA"},{currencies:[{code:"ALL",name:"Albanian lek",symbol:"L"}],name:"Albania",alpha2Code:"AL",alpha3Code:"ALB"},{currencies:[{code:"DZD",name:"Algerian dinar",symbol:"د.ج"}],name:"Algeria",alpha2Code:"DZ",alpha3Code:"DZA"}
1,{currencies:[{code:"USD",name:"United State Dollar",symbol:"$"}],name:"American Samoa",alpha2Code:"AS",alpha3Code:"ASM"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Andorra",alpha2Code:"AD",alpha3Code:"AND"},{currencies:[{code:"AOA",name:"Angolan kwanza",symbol:"Kz"}],name:"Angola",alpha2Code:"AO",alpha3Code:"AGO"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Anguilla",alpha2Code:"AI",alpha3Code:"AIA"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"},{code:"GBP",name:"British pound",symbol:"£"}],name:"Antarctica",alpha2Code:"AQ",alpha3Code:"ATA"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Antigua and Barbuda",alpha2Code:"AG",alpha3Code:"ATG"},{currencies:[{code:"ARS",name:"Argentine peso",symbol:"$"}],name:"Argentina",alpha2Code:"AR",alpha3Code:"ARG"},{currencies:[{code:"AMD",name:"Armenian dram"}],name:"Armenia",alpha2Code:"AM",alpha3Code:"ARM"},{currencies:[{code:"AWG",name:"Aruban florin",symbol:"Æ"}],name:"Aruba",alpha2Code:"AW",alpha3Code:"ABW"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"}],name:"Australia",alpha2Code:"AU",alpha3Code:"AUS"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Austria",alpha2Code:"AT",alpha3Code:"AUT"},{currencies:[{code:"AZN",name:"Azerbaijani manat"}],name:"Azerbaijan",alpha2Code:"AZ",alpha3Code:"AZE"},{currencies:[{code:"BSD",name:"Bahamian dollar",symbol:"$"}],name:"Bahamas",alpha2Code:"BS",alpha3Code:"BHS"},{currencies:[{code:"BHD",name:"Bahraini dinar",symbol:".د.ب"}],name:"Bahrain",alpha2Code:"BH",alpha3Code:"BHR"},{currencies:[{code:"BDT",name:"Bangladeshi taka",symbol:"à§³"}],name:"Bangladesh",alpha2Code:"BD",alpha3Code:"BGD"},{currencies:[{code:"BBD",name:"Barbadian dollar",symbol:"$"}],name:"Barbados",alpha2Code:"BB",alpha3Code:"BRB"},{currencies:[{code:"BYN",name:"New Belarusian ruble",symbol:"Br"},{code:"BYR",name:"Old Belarusian ruble",symbol:"Br"}],name:"Belarus",alpha2Code:"BY",alpha3Code:"BLR"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Belgium",alpha2Code:"BE",alpha3Code:"BEL"},{currencies:[{code:"BZD",name:"Belize dollar",symbol:"$"}],name:"Belize",alpha2Code:"BZ",alpha3Code:"BLZ"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Benin",alpha2Code:"BJ",alpha3Code:"BEN"},{currencies:[{code:"BMD",name:"Bermudian dollar",symbol:"$"}],name:"Bermuda",alpha2Code:"BM",alpha3Code:"BMU"},{currencies:[{code:"BTN",name:"Bhutanese ngultrum",symbol:"Nu."},{code:"INR",name:"Indian rupee",symbol:"â¹"}],name:"Bhutan",alpha2Code:"BT",alpha3Code:"BTN"},{currencies:[{code:"BOB",name:"Bolivian boliviano",symbol:"Bs."}],name:"Bolivia (Plurinational State of)",alpha2Code:"BO",alpha3Code:"BOL"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Bonaire, Sint Eustatius and Saba",alpha2Code:"BQ",alpha3Code:"BES"},{currencies:[{code:"BAM",name:"Bosnia and Herzegovina convertible mark"}],name:"Bosnia and Herzegovina",alpha2Code:"BA",alpha3Code:"BIH"},{currencies:[{code:"BWP",name:"Botswana pula",symbol:"P"}],name:"Botswana",alpha2Code:"BW",alpha3Code:"BWA"},{currencies:[{code:"NOK",name:"Norwegian krone",symbol:"kr"}],name:"Bouvet Island",alpha2Code:"BV",alpha3Code:"BVT"},{currencies:[{code:"BRL",name:"Brazilian real",symbol:"R$"}],name:"Brazil",alpha2Code:"BR",alpha3Code:"BRA"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"British Indian Ocean Territory",alpha2Code:"IO",alpha3Code:"IOT"},{currencies:[{code:"USD",name:"United States Dollar",symbol:"$"}],name:"United States Minor Outlying Islands",alpha2Code:"UM",alpha3Code:"UMI"},{currencies:[{name:"[D]",symbol:"$"},{code:"USD",name:"United States dollar",symbol:"$"}],name:"Virgin Islands (British)",alpha2Code:"VG",alpha3Code:"VGB"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Virgin Islands (U.S.)",alpha2Code:"VI",alpha3Code:"VIR"},{currencies:[{code:"BND",name:"Brunei dollar",symbol:"$"},{code:"SGD",name:"Singapore dollar",symbol:"$"}],name:"Brunei Darussalam",alpha2Code:"BN",alpha3Code:"BRN"}
1,{currencies:[{code:"BGN",name:"Bulgarian lev",symbol:"лв"}],name:"Bulgaria",alpha2Code:"BG",alpha3Code:"BGR"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Burkina Faso",alpha2Code:"BF",alpha3Code:"BFA"},{currencies:[{code:"BIF",name:"Burundian franc",symbol:"Fr"}],name:"Burundi",alpha2Code:"BI",alpha3Code:"BDI"},{currencies:[{code:"KHR",name:"Cambodian riel",symbol:"á"},{code:"USD",name:"United States dollar",symbol:"$"}],name:"Cambodia",alpha2Code:"KH",alpha3Code:"KHM"},{currencies:[{code:"XAF",name:"Central African CFA franc",symbol:"Fr"}],name:"Cameroon",alpha2Code:"CM",alpha3Code:"CMR"},{currencies:[{code:"CAD",name:"Canadian dollar",symbol:"$"}],name:"Canada",alpha2Code:"CA",alpha3Code:"CAN"},{currencies:[{code:"CVE",name:"Cape Verdean escudo",symbol:"Esc"}],name:"Cabo Verde",alpha2Code:"CV",alpha3Code:"CPV"},{currencies:[{code:"KYD",name:"Cayman Islands dollar",symbol:"$"}],name:"Cayman Islands",alpha2Code:"KY",alpha3Code:"CYM"},{currencies:[{code:"XAF",name:"Central African CFA franc",symbol:"Fr"}],name:"Central African Republic",alpha2Code:"CF",alpha3Code:"CAF"},{currencies:[{code:"XAF",name:"Central African CFA franc",symbol:"Fr"}],name:"Chad",alpha2Code:"TD",alpha3Code:"TCD"},{currencies:[{code:"CLP",name:"Chilean peso",symbol:"$"}],name:"Chile",alpha2Code:"CL",alpha3Code:"CHL"},{currencies:[{code:"CNY",name:"Chinese yuan",symbol:"Â¥"}],name:"China",alpha2Code:"CN",alpha3Code:"CHN"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"}],name:"Christmas Island",alpha2Code:"CX",alpha3Code:"CXR"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"}],name:"Cocos (Keeling) Islands",alpha2Code:"CC",alpha3Code:"CCK"},{currencies:[{code:"COP",name:"Colombian peso",symbol:"$"}],name:"Colombia",alpha2Code:"CO",alpha3Code:"COL"},{currencies:[{code:"KMF",name:"Comorian franc",symbol:"Fr"}],name:"Comoros",alpha2Code:"KM",alpha3Code:"COM"},{currencies:[{code:"XAF",name:"Central African CFA franc",symbol:"Fr"}],name:"Congo",alpha2Code:"CG",alpha3Code:"COG"},{currencies:[{code:"CDF",name:"Congolese franc",symbol:"Fr"}],name:"Congo (Democratic Republic of the)",alpha2Code:"CD",alpha3Code:"COD"},{currencies:[{code:"NZD",name:"New Zealand dollar",symbol:"$"},{code:"CKD",name:"Cook Islands dollar",symbol:"$"}],name:"Cook Islands",alpha2Code:"CK",alpha3Code:"COK"},{currencies:[{code:"CRC",name:"Costa Rican colón",symbol:"â¡"}],name:"Costa Rica",alpha2Code:"CR",alpha3Code:"CRI"},{currencies:[{code:"HRK",name:"Croatian kuna",symbol:"kn"}],name:"Croatia",alpha2Code:"HR",alpha3Code:"HRV"},{currencies:[{code:"CUC",name:"Cuban convertible peso",symbol:"$"},{code:"CUP",name:"Cuban peso",symbol:"$"}],name:"Cuba",alpha2Code:"CU",alpha3Code:"CUB"},{currencies:[{code:"ANG",name:"Netherlands Antillean guilder",symbol:"Æ"}],name:"Curaçao",alpha2Code:"CW",alpha3Code:"CUW"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Cyprus",alpha2Code:"CY",alpha3Code:"CYP"},{currencies:[{code:"CZK",name:"Czech koruna",symbol:"KÄ"}],name:"Czech Republic",alpha2Code:"CZ",alpha3Code:"CZE"},{currencies:[{code:"DKK",name:"Danish krone",symbol:"kr"}],name:"Denmark",alpha2Code:"DK",alpha3Code:"DNK"},{currencies:[{code:"DJF",name:"Djiboutian franc",symbol:"Fr"}],name:"Djibouti",alpha2Code:"DJ",alpha3Code:"DJI"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Dominica",alpha2Code:"DM",alpha3Code:"DMA"},{currencies:[{code:"DOP",name:"Dominican peso",symbol:"$"}],name:"Dominican Republic",alpha2Code:"DO",alpha3Code:"DOM"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Ecuador",alpha2Code:"EC",alpha3Code:"ECU"},{currencies:[{code:"EGP",name:"Egyptian pound",symbol:"£"}],name:"Egypt",alpha2Code:"EG",alpha3Code:"EGY"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"El Salvador",alpha2Code:"SV",alpha3Code:"SLV"},{currencies:[{code:"XAF",name:"Central African CFA franc",symbol:"Fr"}],name:"Equatorial Guinea",alpha2Code:"GQ",alpha3Code:"GNQ"},{currencies:[{code:"ERN",name:"Eritrean nakfa",symbol:"Nfk"}],name:"Eritrea",alpha2Code:"ER",alpha3Code:"ERI"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Estonia",alpha2Code:"EE",alpha3Code:"EST"}
1,{currencies:[{code:"ETB",name:"Ethiopian birr",symbol:"Br"}],name:"Ethiopia",alpha2Code:"ET",alpha3Code:"ETH"},{currencies:[{code:"FKP",name:"Falkland Islands pound",symbol:"£"}],name:"Falkland Islands (Malvinas)",alpha2Code:"FK",alpha3Code:"FLK"},{currencies:[{code:"DKK",name:"Danish krone",symbol:"kr"},{code:"(none)",name:"Faroese króna",symbol:"kr"}],name:"Faroe Islands",alpha2Code:"FO",alpha3Code:"FRO"},{currencies:[{code:"FJD",name:"Fijian dollar",symbol:"$"}],name:"Fiji",alpha2Code:"FJ",alpha3Code:"FJI"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Finland",alpha2Code:"FI",alpha3Code:"FIN"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"France",alpha2Code:"FR",alpha3Code:"FRA"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"French Guiana",alpha2Code:"GF",alpha3Code:"GUF"},{currencies:[{code:"XPF",name:"CFP franc",symbol:"Fr"}],name:"French Polynesia",alpha2Code:"PF",alpha3Code:"PYF"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"French Southern Territories",alpha2Code:"TF",alpha3Code:"ATF"},{currencies:[{code:"XAF",name:"Central African CFA franc",symbol:"Fr"}],name:"Gabon",alpha2Code:"GA",alpha3Code:"GAB"},{currencies:[{code:"GMD",name:"Gambian dalasi",symbol:"D"}],name:"Gambia",alpha2Code:"GM",alpha3Code:"GMB"},{currencies:[{code:"GEL",name:"Georgian Lari",symbol:"á"}],name:"Georgia",alpha2Code:"GE",alpha3Code:"GEO"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Germany",alpha2Code:"DE",alpha3Code:"DEU"},{currencies:[{code:"GHS",name:"Ghanaian cedi",symbol:"âµ"}],name:"Ghana",alpha2Code:"GH",alpha3Code:"GHA"},{currencies:[{code:"GIP",name:"Gibraltar pound",symbol:"£"}],name:"Gibraltar",alpha2Code:"GI",alpha3Code:"GIB"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Greece",alpha2Code:"GR",alpha3Code:"GRC"},{currencies:[{code:"DKK",name:"Danish krone",symbol:"kr"}],name:"Greenland",alpha2Code:"GL",alpha3Code:"GRL"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Grenada",alpha2Code:"GD",alpha3Code:"GRD"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Guadeloupe",alpha2Code:"GP",alpha3Code:"GLP"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Guam",alpha2Code:"GU",alpha3Code:"GUM"},{currencies:[{code:"GTQ",name:"Guatemalan quetzal",symbol:"Q"}],name:"Guatemala",alpha2Code:"GT",alpha3Code:"GTM"},{currencies:[{code:"GBP",name:"British pound",symbol:"£"},{code:"(none)",name:"Guernsey pound",symbol:"£"}],name:"Guernsey",alpha2Code:"GG",alpha3Code:"GGY"},{currencies:[{code:"GNF",name:"Guinean franc",symbol:"Fr"}],name:"Guinea",alpha2Code:"GN",alpha3Code:"GIN"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Guinea-Bissau",alpha2Code:"GW",alpha3Code:"GNB"},{currencies:[{code:"GYD",name:"Guyanese dollar",symbol:"$"}],name:"Guyana",alpha2Code:"GY",alpha3Code:"GUY"},{currencies:[{code:"HTG",name:"Haitian gourde",symbol:"G"}],name:"Haiti",alpha2Code:"HT",alpha3Code:"HTI"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"}],name:"Heard Island and McDonald Islands",alpha2Code:"HM",alpha3Code:"HMD"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Holy See",alpha2Code:"VA",alpha3Code:"VAT"},{currencies:[{code:"HNL",name:"Honduran lempira",symbol:"L"}],name:"Honduras",alpha2Code:"HN",alpha3Code:"HND"},{currencies:[{code:"HKD",name:"Hong Kong dollar",symbol:"$"}],name:"Hong Kong",alpha2Code:"HK",alpha3Code:"HKG"},{currencies:[{code:"HUF",name:"Hungarian forint",symbol:"Ft"}],name:"Hungary",alpha2Code:"HU",alpha3Code:"HUN"},{currencies:[{code:"ISK",name:"Icelandic króna",symbol:"kr"}],name:"Iceland",alpha2Code:"IS",alpha3Code:"ISL"},{currencies:[{code:"INR",name:"Indian rupee",symbol:"â¹"}],name:"India",alpha2Code:"IN",alpha3Code:"IND"},{currencies:[{code:"IDR",name:"Indonesian rupiah",symbol:"Rp"}],name:"Indonesia",alpha2Code:"ID",alpha3Code:"IDN"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Côte d'Ivoire",alpha2Code:"CI",alpha3Code:"CIV"},{currencies:[{code:"IRR",name:"Iranian rial",symbol:"ï·¼"}],name:"Iran (Islamic Republic of)",alpha2Code:"IR",alpha3Code:"IRN"}
1,{currencies:[{code:"IQD",name:"Iraqi dinar",symbol:"ع.د"}],name:"Iraq",alpha2Code:"IQ",alpha3Code:"IRQ"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Ireland",alpha2Code:"IE",alpha3Code:"IRL"},{currencies:[{code:"GBP",name:"British pound",symbol:"£"},{code:"IMP[G]",name:"Manx pound",symbol:"£"}],name:"Isle of Man",alpha2Code:"IM",alpha3Code:"IMN"},{currencies:[{code:"ILS",name:"Israeli new shekel",symbol:"âª"}],name:"Israel",alpha2Code:"IL",alpha3Code:"ISR"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Italy",alpha2Code:"IT",alpha3Code:"ITA"},{currencies:[{code:"JMD",name:"Jamaican dollar",symbol:"$"}],name:"Jamaica",alpha2Code:"JM",alpha3Code:"JAM"},{currencies:[{code:"JPY",name:"Japanese yen",symbol:"Â¥"}],name:"Japan",alpha2Code:"JP",alpha3Code:"JPN"},{currencies:[{code:"GBP",name:"British pound",symbol:"£"},{code:"JEP[G]",name:"Jersey pound",symbol:"£"}],name:"Jersey",alpha2Code:"JE",alpha3Code:"JEY"},{currencies:[{code:"JOD",name:"Jordanian dinar",symbol:"د.ا"}],name:"Jordan",alpha2Code:"JO",alpha3Code:"JOR"},{currencies:[{code:"KZT",name:"Kazakhstani tenge"}],name:"Kazakhstan",alpha2Code:"KZ",alpha3Code:"KAZ"},{currencies:[{code:"KES",name:"Kenyan shilling",symbol:"Sh"}],name:"Kenya",alpha2Code:"KE",alpha3Code:"KEN"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"},{code:"(none)",name:"Kiribati dollar",symbol:"$"}],name:"Kiribati",alpha2Code:"KI",alpha3Code:"KIR"},{currencies:[{code:"KWD",name:"Kuwaiti dinar",symbol:"د.Ù"}],name:"Kuwait",alpha2Code:"KW",alpha3Code:"KWT"}
1,{currencies:[{code:"KGS",name:"Kyrgyzstani som",symbol:"Ñ"}],name:"Kyrgyzstan",alpha2Code:"KG",alpha3Code:"KGZ"},{currencies:[{code:"LAK",name:"Lao kip",symbol:"â"}],name:"Lao People's Democratic Republic",alpha2Code:"LA",alpha3Code:"LAO"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Latvia",alpha2Code:"LV",alpha3Code:"LVA"},{currencies:[{code:"LBP",name:"Lebanese pound",symbol:"Ù.Ù"}],name:"Lebanon",alpha2Code:"LB",alpha3Code:"LBN"},{currencies:[{code:"LSL",name:"Lesotho loti",symbol:"L"},{code:"ZAR",name:"South African rand",symbol:"R"}],name:"Lesotho",alpha2Code:"LS",alpha3Code:"LSO"},{currencies:[{code:"LRD",name:"Liberian dollar",symbol:"$"}],name:"Liberia",alpha2Code:"LR",alpha3Code:"LBR"},{currencies:[{code:"LYD",name:"Libyan dinar",symbol:"Ù.د"}],name:"Libya",alpha2Code:"LY",alpha3Code:"LBY"},{currencies:[{code:"CHF",name:"Swiss franc",symbol:"Fr"}],name:"Liechtenstein",alpha2Code:"LI",alpha3Code:"LIE"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Lithuania",alpha2Code:"LT",alpha3Code:"LTU"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Luxembourg",alpha2Code:"LU",alpha3Code:"LUX"},{currencies:[{code:"MOP",name:"Macanese pataca",symbol:"P"}],name:"Macao",alpha2Code:"MO",alpha3Code:"MAC"},{currencies:[{code:"MKD",name:"Macedonian denar",symbol:"ден"}],name:"Macedonia (the former Yugoslav Republic of)",alpha2Code:"MK",alpha3Code:"MKD"},{currencies:[{code:"MGA",name:"Malagasy ariary",symbol:"Ar"}],name:"Madagascar",alpha2Code:"MG",alpha3Code:"MDG"},{currencies:[{code:"MWK",name:"Malawian kwacha",symbol:"MK"}],name:"Malawi",alpha2Code:"MW",alpha3Code:"MWI"},{currencies:[{code:"MYR",name:"Malaysian ringgit",symbol:"RM"}],name:"Malaysia",alpha2Code:"MY",alpha3Code:"MYS"},{currencies:[{code:"MVR",name:"Maldivian rufiyaa",symbol:".Þ"}],name:"Maldives",alpha2Code:"MV",alpha3Code:"MDV"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Mali",alpha2Code:"ML",alpha3Code:"MLI"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Malta",alpha2Code:"MT",alpha3Code:"MLT"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Marshall Islands",alpha2Code:"MH",alpha3Code:"MHL"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Martinique",alpha2Code:"MQ",alpha3Code:"MTQ"},{currencies:[{code:"MRO",name:"Mauritanian ouguiya",symbol:"UM"}],name:"Mauritania",alpha2Code:"MR",alpha3Code:"MRT"},{currencies:[{code:"MUR",name:"Mauritian rupee",symbol:"â¨"}],name:"Mauritius",alpha2Code:"MU",alpha3Code:"MUS"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Mayotte",alpha2Code:"YT",alpha3Code:"MYT"},{currencies:[{code:"MXN",name:"Mexican peso",symbol:"$"}],name:"Mexico",alpha2Code:"MX",alpha3Code:"MEX"},{currencies:[{name:"[D]",symbol:"$"},{code:"USD",name:"United States dollar",symbol:"$"}],name:"Micronesia (Federated States of)",alpha2Code:"FM",alpha3Code:"FSM"},{currencies:[{code:"MDL",name:"Moldovan leu",symbol:"L"}],name:"Moldova (Republic of)",alpha2Code:"MD",alpha3Code:"MDA"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Monaco",alpha2Code:"MC",alpha3Code:"MCO"},{currencies:[{code:"MNT",name:"Mongolian tögrög",symbol:"â®"}],name:"Mongolia",alpha2Code:"MN",alpha3Code:"MNG"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Montenegro",alpha2Code:"ME",alpha3Code:"MNE"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Montserrat",alpha2Code:"MS",alpha3Code:"MSR"},{currencies:[{code:"MAD",name:"Moroccan dirham",symbol:"د.Ù
."}],name:"Morocco",alpha2Code:"MA",alpha3Code:"MAR"}
1,{currencies:[{code:"MZN",name:"Mozambican metical",symbol:"MT"}],name:"Mozambique",alpha2Code:"MZ",alpha3Code:"MOZ"},{currencies:[{code:"MMK",name:"Burmese kyat",symbol:"Ks"}],name:"Myanmar",alpha2Code:"MM",alpha3Code:"MMR"},{currencies:[{code:"NAD",name:"Namibian dollar",symbol:"$"},{code:"ZAR",name:"South African rand",symbol:"R"}],name:"Namibia",alpha2Code:"NA",alpha3Code:"NAM"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"},{code:"(none)",symbol:"$"}],name:"Nauru",alpha2Code:"NR",alpha3Code:"NRU"},{currencies:[{code:"NPR",name:"Nepalese rupee",symbol:"â¨"}],name:"Nepal",alpha2Code:"NP",alpha3Code:"NPL"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Netherlands",alpha2Code:"NL",alpha3Code:"NLD"},{currencies:[{code:"XPF",name:"CFP franc",symbol:"Fr"}],name:"New Caledonia",alpha2Code:"NC",alpha3Code:"NCL"},{currencies:[{code:"NZD",name:"New Zealand dollar",symbol:"$"}],name:"New Zealand",alpha2Code:"NZ",alpha3Code:"NZL"},{currencies:[{code:"NIO",name:"Nicaraguan córdoba",symbol:"C$"}],name:"Nicaragua",alpha2Code:"NI",alpha3Code:"NIC"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Niger",alpha2Code:"NE",alpha3Code:"NER"},{currencies:[{code:"NGN",name:"Nigerian naira",symbol:"â¦"}],name:"Nigeria",alpha2Code:"NG",alpha3Code:"NGA"},{currencies:[{code:"NZD",name:"New Zealand dollar",symbol:"$"},{code:"(none)",name:"Niue dollar",symbol:"$"}],name:"Niue",alpha2Code:"NU",alpha3Code:"NIU"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"}],name:"Norfolk Island",alpha2Code:"NF",alpha3Code:"NFK"}
1,{currencies:[{code:"KPW",name:"North Korean won",symbol:"â©"}],name:"Korea (Democratic People's Republic of)",alpha2Code:"KP",alpha3Code:"PRK"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Northern Mariana Islands",alpha2Code:"MP",alpha3Code:"MNP"},{currencies:[{code:"NOK",name:"Norwegian krone",symbol:"kr"}],name:"Norway",alpha2Code:"NO",alpha3Code:"NOR"},{currencies:[{code:"OMR",name:"Omani rial",symbol:"ر.ع."}],name:"Oman",alpha2Code:"OM",alpha3Code:"OMN"},{currencies:[{code:"PKR",name:"Pakistani rupee",symbol:"â¨"}],name:"Pakistan",alpha2Code:"PK",alpha3Code:"PAK"},{currencies:[{code:"(none)",name:"[E]",symbol:"$"},{code:"USD",name:"United States dollar",symbol:"$"}],name:"Palau",alpha2Code:"PW",alpha3Code:"PLW"},{currencies:[{code:"ILS",name:"Israeli new sheqel",symbol:"âª"}],name:"Palestine, State of",alpha2Code:"PS",alpha3Code:"PSE"},{currencies:[{code:"PAB",name:"Panamanian balboa",symbol:"B/."},{code:"USD",name:"United States dollar",symbol:"$"}],name:"Panama",alpha2Code:"PA",alpha3Code:"PAN"},{currencies:[{code:"PGK",name:"Papua New Guinean kina",symbol:"K"}],name:"Papua New Guinea",alpha2Code:"PG",alpha3Code:"PNG"},{currencies:[{code:"PYG",name:"Paraguayan guaranÃ",symbol:"â²"}],name:"Paraguay",alpha2Code:"PY",alpha3Code:"PRY"},{currencies:[{code:"PEN",name:"Peruvian sol",symbol:"S/."}],name:"Peru",alpha2Code:"PE",alpha3Code:"PER"},{currencies:[{code:"PHP",name:"Philippine peso",symbol:"â±"}],name:"Philippines",alpha2Code:"PH",alpha3Code:"PHL"},{currencies:[{code:"NZD",name:"New Zealand dollar",symbol:"$"},{name:"Pitcairn Islands dollar",symbol:"$"}],name:"Pitcairn",alpha2Code:"PN",alpha3Code:"PCN"},{currencies:[{code:"PLN",name:"Polish zÅoty",symbol:"zÅ"}],name:"Poland",alpha2Code:"PL",alpha3Code:"POL"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Portugal",alpha2Code:"PT",alpha3Code:"PRT"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Puerto Rico",alpha2Code:"PR",alpha3Code:"PRI"},{currencies:[{code:"QAR",name:"Qatari riyal",symbol:"ر.Ù"}],name:"Qatar",alpha2Code:"QA",alpha3Code:"QAT"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Republic of Kosovo",alpha2Code:"XK",alpha3Code:"KOS"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Réunion",alpha2Code:"RE",alpha3Code:"REU"},{currencies:[{code:"RON",name:"Romanian leu",symbol:"lei"}],name:"Romania",alpha2Code:"RO",alpha3Code:"ROU"},{currencies:[{code:"RUB",name:"Russian ruble",symbol:"â½"}],name:"Russian Federation",alpha2Code:"RU",alpha3Code:"RUS"},{currencies:[{code:"RWF",name:"Rwandan franc",symbol:"Fr"}],name:"Rwanda",alpha2Code:"RW",alpha3Code:"RWA"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Saint Barthélemy",alpha2Code:"BL",alpha3Code:"BLM"},{currencies:[{code:"SHP",name:"Saint Helena pound",symbol:"£"}],name:"Saint Helena, Ascension and Tristan da Cunha",alpha2Code:"SH",alpha3Code:"SHN"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Saint Kitts and Nevis",alpha2Code:"KN",alpha3Code:"KNA"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Saint Lucia",alpha2Code:"LC",alpha3Code:"LCA"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Saint Martin (French part)",alpha2Code:"MF",alpha3Code:"MAF"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Saint Pierre and Miquelon",alpha2Code:"PM",alpha3Code:"SPM"},{currencies:[{code:"XCD",name:"East Caribbean dollar",symbol:"$"}],name:"Saint Vincent and the Grenadines",alpha2Code:"VC",alpha3Code:"VCT"},{currencies:[{code:"WST",name:"Samoan tÄlÄ",symbol:"T"}],name:"Samoa",alpha2Code:"WS",alpha3Code:"WSM"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"San Marino",alpha2Code:"SM",alpha3Code:"SMR"},{currencies:[{code:"STD",name:"São Tomé and PrÃncipe dobra",symbol:"Db"}],name:"Sao Tome and Principe",alpha2Code:"ST",alpha3Code:"STP"},{currencies:[{code:"SAR",name:"Saudi riyal",symbol:"ر.س"}],name:"Saudi Arabia",alpha2Code:"SA",alpha3Code:"SAU"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Senegal",alpha2Code:"SN",alpha3Code:"SEN"}
1,{currencies:[{code:"RSD",name:"Serbian dinar",symbol:"дин."}],name:"Serbia",alpha2Code:"RS",alpha3Code:"SRB"},{currencies:[{code:"SCR",name:"Seychellois rupee",symbol:"â¨"}],name:"Seychelles",alpha2Code:"SC",alpha3Code:"SYC"},{currencies:[{code:"SLL",name:"Sierra Leonean leone",symbol:"Le"}],name:"Sierra Leone",alpha2Code:"SL",alpha3Code:"SLE"},{currencies:[{code:"BND",name:"Brunei dollar",symbol:"$"},{code:"SGD",name:"Singapore dollar",symbol:"$"}],name:"Singapore",alpha2Code:"SG",alpha3Code:"SGP"},{currencies:[{code:"ANG",name:"Netherlands Antillean guilder",symbol:"Æ"}],name:"Sint Maarten (Dutch part)",alpha2Code:"SX",alpha3Code:"SXM"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Slovakia",alpha2Code:"SK",alpha3Code:"SVK"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Slovenia",alpha2Code:"SI",alpha3Code:"SVN"},{currencies:[{code:"SBD",name:"Solomon Islands dollar",symbol:"$"}],name:"Solomon Islands",alpha2Code:"SB",alpha3Code:"SLB"},{currencies:[{code:"SOS",name:"Somali shilling",symbol:"Sh"}],name:"Somalia",alpha2Code:"SO",alpha3Code:"SOM"},{currencies:[{code:"ZAR",name:"South African rand",symbol:"R"}],name:"South Africa",alpha2Code:"ZA",alpha3Code:"ZAF"},{currencies:[{code:"GBP",name:"British pound",symbol:"£"},{code:"(none)",symbol:"£"}],name:"South Georgia and the South Sandwich Islands",alpha2Code:"GS",alpha3Code:"SGS"}
1,{currencies:[{code:"KRW",name:"South Korean won",symbol:"â©"}],name:"Korea (Republic of)",alpha2Code:"KR",alpha3Code:"KOR"},{currencies:[{code:"SSP",name:"South Sudanese pound",symbol:"£"}],name:"South Sudan",alpha2Code:"SS",alpha3Code:"SSD"},{currencies:[{code:"EUR",name:"Euro",symbol:"â¬"}],name:"Spain",alpha2Code:"ES",alpha3Code:"ESP"},{currencies:[{code:"LKR",name:"Sri Lankan rupee",symbol:"Rs"}],name:"Sri Lanka",alpha2Code:"LK",alpha3Code:"LKA"},{currencies:[{code:"SDG",name:"Sudanese pound",symbol:"ج.س."}],name:"Sudan",alpha2Code:"SD",alpha3Code:"SDN"},{currencies:[{code:"SRD",name:"Surinamese dollar",symbol:"$"}],name:"Suriname",alpha2Code:"SR",alpha3Code:"SUR"},{currencies:[{code:"NOK",name:"Norwegian krone",symbol:"kr"}],name:"Svalbard and Jan Mayen",alpha2Code:"SJ",alpha3Code:"SJM"},{currencies:[{code:"SZL",name:"Swazi lilangeni",symbol:"L"}],name:"Swaziland",alpha2Code:"SZ",alpha3Code:"SWZ"},{currencies:[{code:"SEK",name:"Swedish krona",symbol:"kr"}],name:"Sweden",alpha2Code:"SE",alpha3Code:"SWE"},{currencies:[{code:"CHF",name:"Swiss franc",symbol:"Fr"}],name:"Switzerland",alpha2Code:"CH",alpha3Code:"CHE"},{currencies:[{code:"SYP",name:"Syrian pound",symbol:"£"}],name:"Syrian Arab Republic",alpha2Code:"SY",alpha3Code:"SYR"},{currencies:[{code:"TWD",name:"New Taiwan dollar",symbol:"$"}],name:"Taiwan",alpha2Code:"TW",alpha3Code:"TWN"},{currencies:[{code:"TJS",name:"Tajikistani somoni",symbol:"Ð
Ð"}],name:"Tajikistan",alpha2Code:"TJ",alpha3Code:"TJK"},{currencies:[{code:"TZS",name:"Tanzanian shilling",symbol:"Sh"}],name:"Tanzania, United Republic of",alpha2Code:"TZ",alpha3Code:"TZA"},{currencies:[{code:"THB",name:"Thai baht",symbol:"฿"}],name:"Thailand",alpha2Code:"TH",alpha3Code:"THA"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"},{}],name:"Timor-Leste",alpha2Code:"TL",alpha3Code:"TLS"},{currencies:[{code:"XOF",name:"West African CFA franc",symbol:"Fr"}],name:"Togo",alpha2Code:"TG",alpha3Code:"TGO"},{currencies:[{code:"NZD",name:"New Zealand dollar",symbol:"$"}],name:"Tokelau",alpha2Code:"TK",alpha3Code:"TKL"},{currencies:[{code:"TOP",name:"Tongan paÊ»anga",symbol:"T$"}],name:"Tonga",alpha2Code:"TO",alpha3Code:"TON"},{currencies:[{code:"TTD",name:"Trinidad and Tobago dollar",symbol:"$"}],name:"Trinidad and Tobago",alpha2Code:"TT",alpha3Code:"TTO"},{currencies:[{code:"TND",name:"Tunisian dinar",symbol:"د.ت"}],name:"Tunisia",alpha2Code:"TN",alpha3Code:"TUN"},{currencies:[{code:"TRY",name:"Turkish lira"}],name:"Turkey",alpha2Code:"TR",alpha3Code:"TUR"},{currencies:[{code:"TMT",name:"Turkmenistan manat",symbol:"m"}],name:"Turkmenistan",alpha2Code:"TM",alpha3Code:"TKM"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"Turks and Caicos Islands",alpha2Code:"TC",alpha3Code:"TCA"},{currencies:[{code:"AUD",name:"Australian dollar",symbol:"$"},{code:"TVD[G]",name:"Tuvaluan dollar",symbol:"$"}],name:"Tuvalu",alpha2Code:"TV",alpha3Code:"TUV"},{currencies:[{code:"UGX",name:"Ugandan shilling",symbol:"Sh"}],name:"Uganda",alpha2Code:"UG",alpha3Code:"UGA"},{currencies:[{code:"UAH",name:"Ukrainian hryvnia",symbol:"â´"}],name:"Ukraine",alpha2Code:"UA",alpha3Code:"UKR"},{currencies:[{code:"AED",name:"United Arab Emirates dirham",symbol:"د.Ø¥"}],name:"United Arab Emirates",alpha2Code:"AE",alpha3Code:"ARE"},{currencies:[{code:"GBP",name:"British pound",symbol:"£"}],name:"United Kingdom of Great Britain and Northern Ireland",alpha2Code:"GB",alpha3Code:"GBR"},{currencies:[{code:"USD",name:"United States dollar",symbol:"$"}],name:"United States of America",alpha2Code:"US",alpha3Code:"USA"},{currencies:[{code:"UYU",name:"Uruguayan peso",symbol:"$"}],name:"Uruguay",alpha2Code:"UY",alpha3Code:"URY"},{currencies:[{code:"UZS",name:"Uzbekistani so'm"}],name:"Uzbekistan",alpha2Code:"UZ",alpha3Code:"UZB"},{currencies:[{code:"VUV",name:"Vanuatu vatu",symbol:"Vt"}],name:"Vanuatu",alpha2Code:"VU",alpha3Code:"VUT"},{currencies:[{code:"VEF",name:"Venezuelan bolÃvar",symbol:"Bs F"}],name:"Venezuela (Bolivarian Republic of)",alpha2Code:"VE",alpha3Code:"VEN"}
1,{currencies:[{code:"VND",name:"Vietnamese Äá»ng",symbol:"â«"}],name:"Viet Nam",alpha2Code:"VN",alpha3Code:"VNM"},{currencies:[{code:"XPF",name:"CFP franc",symbol:"Fr"}],name:"Wallis and Futuna",alpha2Code:"WF",alpha3Code:"WLF"},{currencies:[{code:"MAD",name:"Moroccan dirham",symbol:"د.Ù
."},{code:"DZD",name:"Algerian dinar",symbol:"د.ج"}],name:"Western Sahara",alpha2Code:"EH",alpha3Code:"ESH"},{currencies:[{code:"YER",name:"Yemeni rial",symbol:"ï·¼"}],name:"Yemen",alpha2Code:"YE",alpha3Code:"YEM"},{currencies:[{code:"ZMW",name:"Zambian kwacha",symbol:"ZK"}],name:"Zambia",alpha2Code:"ZM",alpha3Code:"ZMB"},{currencies:[{code:"BWP",name:"Botswana pula",symbol:"P"},{code:"GBP",name:"British pound",symbol:"£"},{code:"CNY",name:"Chinese yuan",symbol:"Â¥"},{code:"EUR",name:"Euro",symbol:"â¬"},{code:"INR",name:"Indian rupee",symbol:"â¹"},{code:"JPY",name:"Japanese yen",symbol:"Â¥"},{code:"ZAR",name:"South African rand",symbol:"Rs"},{code:"USD",name:"United States dollar",symbol:"$"},{code:"(none)"}],name:"Zimbabwe",alpha2Code:"ZW",alpha3Code:"ZWE"}].reduce((function(e,t){return e[t.alpha2Code]=t,e}),{})},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16);var r=n(4),o=n(2),l=n(156),c=n(160);function d(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function h(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?d(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):d(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var f={name:"AdminAddOfferForm",components:{MzAppIcon:n(29).a,MzOfferTag:l.a,EditOfferModal:c.a},props:["isOptionnal","disabled","showAvailableTemplate"],data:function(){return{form:{offer:null,offerStartAt:null,offerEndAt:null,availableTemplates:[]}}},computed:h({},Object(o.e)("offer",["offers"]),{},Object(o.e)("magazine",["templateMagazines"]),{offersById:function(){return this.offers.reduce((function(e,t){return e[t._id]=t,e}),{})},templatesById:function(){return this.templateMagazines?this.templateMagazines.reduce((function(e,template){return e[template._id]=template,e}),{}):{}}}),mounted:function(){this.loadOffers(),this.loadTemplateMagazines({filter:{status:"Published"},sort:"name"})},methods:h({},Object(o.b)({loadOffers:"offer/LOAD_OFFERS",loadTemplateMagazines:"magazine/LOAD_TEMPLATE_MAGAZINES"}),{resetForm:function(){this.form.offer=null,this.form.offerStartAt=null,this.form.offerEndAt=null,this.form.availableTemplates=[]},checkForm:function(){return this.isOptionnal||this.form.offer?!this.form.offer||!(null===this.form.offerStartAt||null!==this.form.offerEndAt&&this.form.offerStartAt>this.form.offerEndAt)||(this.$messageError("invalid date"),!1):(this.$messageError("invalid offer"),!1)},getForm:function(){return this.form.offer&&this.form.offer._id?{offerId:this.form.offer._id,offerStartAt:this.form.offerStartAt,offerEndAt:this.form.offerEndAt,availableTemplates:this.showAvailableTemplate?this.form.availableTemplates:null}:null},updateValidityDatesFromOffer:function(){if(this.form.offer)if(this.form.offerStartAt||(this.form.offerStartAt=new Date),"illimited"===this.form.offer.duration.durationUnit)this.form.offerEndAt=null;else{var e=new Date(this.form.offerStartAt);switch(this.form.offer.duration.durationUnit){case"year":e.setFullYear(e.getFullYear()+this.form.offer.duration.durationTime);break;case"month":e.setMonth(e.getMonth()+this.form.offer.duration.durationTime);break;case"day":e.setDate(e.getDate()+this.form.offer.duration.durationTime);break;case"date":e=new Date(this.form.offer.duration.durationDate)}e.setHours(23,59,59),this.form.offerEndAt=e}else this.form.offerStartAt=null,this.form.offerEndAt=null},onSaveOffer:function(e){this.form.offer&&this.form.offer._id==e._id||(this.form.offer=e),this.updateV
1alidityDatesFromOffer()}})},m=(n(604),n(6)),component=Object(m.a)(f,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Offer "),e.isOptionnal?n("small",[e._v("(optionnal)")]):e._e()])]),e._v(" "),n("el-col",{staticClass:"el-select-offer ml-2",attrs:{span:8}},[n("el-select",{attrs:{disabled:e.disabled,clearable:""},on:{change:e.updateValidityDatesFromOffer},model:{value:e.form.offer,callback:function(t){e.$set(e.form,"offer",t)},expression:"form.offer"}},e._l(e.offers,(function(e){return n("el-option",{key:e._id,attrs:{value:e}},[n("span",[n("MzOfferTag",{attrs:{offer:e,showCompleteTag:!0}})],1)])})),1),e._v(" "),e.form.offer?n("MzOfferTag",{staticClass:"display-offer-over-select",attrs:{offer:e.form.offer}}):e._e()],1),e._v(" "),e.form.offer?n("el-col",{staticClass:"mt-0",attrs:{span:6}},[n("el-button",{attrs:{size:"small",disabled:e.disabled||null===e.form.offer},on:{click:function(t){return e.$refs.editOfferModal.showEdit(e.form.offer._id)}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"edit",inline:"",size:"16"}}),e._v("\n Edit\n ")],1),e._v(" "),n("el-button",{attrs:{size:"small",disabled:e.disabled||null===e.form.offer},on:{click:function(t){return e.$refs.editOfferModal.showDuplicate(e.form.offer._id)}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"content_copy",inline:"",size:"16"}}),e._v("\n Duplicate\n ")],1)],1):e._e()],1),e._v(" "),e.form.offer?n("el-row",{staticClass:"mt-0"},[n("el-col",{staticClass:"text-style-small",attrs:{span:10,offset:9}},["illimited"===e.form.offer.duration.durationUnit?n("span",[e._v("\n Expire At : Illimited\n ")]):"date"===e.form.offer.duration.durationUnit?n("span",[e._v("\n Expire At : "+e._s(e._f("moment")(e.form.offer.duration.durationDate,"L"))+"\n ")]):n("span",[e._v("\n Expire in :\n "+e._s(e.form.offer.duration.durationTime+" "+e.form.offer.duration.durationUnit)+"\n ")])]),e._v(" "),n("el-col",{staticClass:"text-style-small",attrs:{span:10,offset:9}},[e._v("\n Maximum users per magazine :\n "+e._s(-1!==e.form.offer.offerSettings.limits.numberCollaborators?e.form.offer.offerSettings.limits.numberCollaborators:"unlimited")+"\n ")])],1):e._e(),e._v(" "),e.form.offer?n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Validity dates")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:7}},[n("el-date-picker",{attrs:{disabled:e.disabled||null===e.form.offer,type:"date",placeholder:"Start date",clearable:!1},on:{change:e.updateValidityDatesFromOffer},model:{value:e.form.offerStartAt,callback:function(t){e.$set(e.form,"offerStartAt",t)},expression:"form.offerStartAt"}})],1),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:7}},[n("el-date-picker",{attrs:{disabled:e.disabled||null===e.form.offer,type:"date",placeholder:"End date",clearable:!1},model:{value:e.form.offerEndAt,callback:function(t){e.$set(e.form,"offerEndAt",t)},expression:"form.offerEndAt"}})],1)],1):e._e(),e._v(" "),e.form.offer&&e.showAvailableTemplate?n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("h2",[e._v("Specific available templates")])]),e._v(" "),n("el-col",{staticClass:"ml-2",attrs:{span:14}},[n("el-select",{staticClass:"el-col el-col-24",attrs:{disabled:e.disabled||null===e.form.offer,filterable:"",multiple:"",placeholder:"Select one or more specific template"},model:{value:e.form.availableTemplates,callback:function(t){e.$set(e.form,"availableTemplates",t)},expression:"form.availableTemplates"}},e._l(e.templateMagazines,(function(template){return n("el-option",{key:template._id,attrs:{label:template.name,value:template._id}},[n("span",{staticStyle:{float:"left"}},[e._v(e._s(template.name))]),e._v(" "),template.format.formatBase?n("span",{staticStyle:{float:"left",color:"#8492a6","font-size":"12px","margin-left":"1rem"}},[e._v(e._s(template.format.formatBase.name))]):e._e()])})),1)],1)],1):e._e(),e._v(" "),n("EditOfferModal",{ref:"editOfferModal",on:{save:e.onSaveOffer}})],1)}),[],!1,null,"83223ea4",null);t.a=component.exports},function(e){e.exports=JSON.parse('{"name":"athena","version":"3.5.1","description":"Athena Amazing Disrupting Printing Magazine Editor Experience","author":"JOLLY <[email protected]>","private":true,"scripts":{"dev":"nuxt","build":"nuxt build","help":"nuxt --help","nuxt_version":"nuxt --version","start":"nuxt start","generate":"nuxt generate","lint":"eslint --ext .js,.vue --ignore-path .gitignore .","precommit":"npm run lint"}
1,"dependencies":{"@nuxtjs/axios":"^5.9.5","@nuxtjs/dotenv":"^1.4.1","@nuxtjs/proxy":"^1.3.3","@nuxtjs/separate-env":"0.0.1","@sentry/vue":"^8.47.0","@vue-stripe/vue-stripe":"^4.5.0","axios":"^0.19.2","babel-es6-polyfill":"^1.1.0","canvas":"^3.2.3","element-ui":"^2.13.0","fabric":"^3.6.6","floating-vue":"^1.0.0-beta.19","iso-639-3":"^2.2.0","jwt-decode":"^2.2.0","lorem-ipsum":"^2.0.3","nuxt":"^2.11.0","nuxt-i18n":"^6.6.0","qrcode.vue":"^1.7.0","quill-mention":"^4.1.0","uniqid":"^5.2.0","vue-clipboard2":"^0.3.1","vue-color":"^2.7.0","vue-croppie":"^2.0.1","vue-matomo":"^4.2.0","vue-moment":"^4.1.0","vue-quill-editor":"^3.0.6","vuedraggable":"^2.23.2","vuex-persistedstate":"^2.7.1","webfontloader":"^1.6.28"},"devDependencies":{"acorn":"^7.1.0","acorn-dynamic-import":"^4.0.0","babel-eslint":"^10.1.0","concurrent-transform":"^1.0.0","core-js":"^2.6.11","eslint":"^6.8.0","eslint-friendly-formatter":"^4.0.1","eslint-loader":"^3.0.3","eslint-plugin-vue":"^6.2.1","gulp":"^4.0.2","gulp-awspublish":"^4.1.2","gulp-cloudfront-invalidate-aws-publish":"^1.0.0","node-sass":"^4.14.1","nodemon":"^2.0.2","passport-local":"^1.0.0","sass-loader":"^8.0.2","stylus":"^0.54.7","stylus-loader":"^3.0.2"}}')},,,,function(e,t,n){"use strict";n(7),n(35),n(13),n(11),n(83),n(103);var r=n(1),o=window.requestIdleCallback||function(e){var t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1)},l=window.cancelIdleCallback||function(e){clearTimeout(e)},c=window.IntersectionObserver&&new window.IntersectionObserver((function(e){e.forEach((function(e){var t=e.intersectionRatio,link=e.target;t<=0||link.__prefetch()}))}));t.a={name:"NuxtLink",extends:r.default.component("RouterLink"),props:{prefetch:{type:Boolean,default:!0},noPrefetch:{type:Boolean,default:!1}},mounted:function(){this.prefetch&&!this.noPrefetch&&(this.handleId=o(this.observe,{timeout:2e3}))},beforeDestroy:function(){l(this.handleId),this.__observed&&(c.unobserve(this.$el),delete this.$el.__prefetch)},methods:{observe:function(){c&&this.shouldPrefetch()&&(this.$el.__prefetch=this.prefetchLink.bind(this),c.observe(this.$el),this.__observed=!0)},shouldPrefetch:function(){return this.getPrefetchComponents().length>0},canPrefetch:function(){var e=navigator.connection;return!(this.$nuxt.isOffline||e&&((e.effectiveType||"").includes("2g")||e.saveData))},getPrefetchComponents:function(){return this.$router.resolve(this.to,this.$route,this.append).resolved.matched.map((function(e){return e.components.default})).filter((function(e){return"function"==typeof e&&!e.options&&!e.__prefetched}))},prefetchLink:function(){if(this.canPrefetch()){c.unobserve(this.$el);var e=this.getPrefetchComponents(),t=!0,n=!1,r=void 0;try{for(var o,l=e[Symbol.iterator]();!(t=(o=l.next()).done);t=!0){var d=o.value,h=d();h instanceof Promise&&h.catch((function(){})),d.__prefetched=!0}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}}}}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(19),n(13),n(16);var r=n(4),o=n(27),l=(n(26),n(36),n(91),n(39)),c=(n(11),n(7),n(146),n(55),n(30),n(0),n(12)),d=n(51);function h(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?h(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):h(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var m={generateSpecificMagazineData:function(e){var template=e.template,t=e.magazine,n=e.page,r=e.palette,o=e.theme,l={},c=m.extractSwatchesColorByName({palette:r}),d=!1===t.isTemplate&&template?template.settings:t.settings;d&&d.backgroundFillSwatchName&&c&&c[d.backgroundFillSwatchName]&&(l.defaultPageBackgroun
1dColor=c[d.backgroundFillSwatchName]);var h=o.styles.find((function(style){return"bulletPoint"===style.element&&style.isDefault}));if(h){var f=JSON.parse(h.style);c&&f.fill&&c[f.fill]&&(f.fill=c[f.fill]),l.bulletPointStyle=f}var y=o.styles.find((function(style){return"textLink"===style.element&&style.isDefault}));if(y){var v=JSON.parse(y.style);c&&v.fill&&c[v.fill]&&(v.fill=c[v.fill]),l.textLinkStyle=v}var _=m.extractVariableByBlocktype("Footer",{template:template,magazine:t,page:n,swatchesColorByName:c});return _&&(l.footerVariables=_),l},formatPageDataBeforeImport:function(e){e.magazine;var t=e.page,n=e.palette,r=e.lowDefinitionImage,o="string"==typeof t.pageData?JSON.parse(t.pageData):JSON.parse(JSON.stringify(t.pageData)),d=m.extractSwatchesColorByName({palette:n});if(o.pageData&&d&&void 0!==o.pageData.paletteSwatchName)for(var h=0,f=Object.entries(o.pageData.paletteSwatchName);h<f.length;h++){var y=Object(l.a)(f[h],2),v=y[0],_=y[1];void 0!==d[_]&&c.a.setProperty(v,o.pageData,d[_],!1)}for(var O in o.objects)m.formatObjectBeforeImport(o.objects[O],{swatchesColorByName:d,lowDefinitionImage:r});return o},formatObjectBeforeImport:function(object,e){var t=e.swatchesColorByName,n=e.lowDefinitionImage;if(t&&void 0!==object.paletteSwatchName){for(var r=0,o=Object.entries(object.paletteSwatchName);r<o.length;r++){var h=Object(l.a)(o[r],2),f=h[0],y=h[1];void 0!==t[y]&&c.a.setProperty(f,object,t[y],!1)}if("MzTextbox"===object.type&&object.styles)for(var v=0,_=Object.values(object.styles);v<_.length;v++){var O=_[v];if(O)for(var E=0,k=Object.values(O);E<k.length;E++){var S=k[E];if(S)for(var A=0,T=Object.entries(S);A<T.length;A++){var P=Object(l.a)(T[A],2),C=P[0],x=P[1];if(C&&x&&0===C.indexOf("swatch_")&&void 0!==t[x])S[C.split("_")[1]]=t[x]}}}}if("MzImage"===object.type)if(n){object.originalDefinitionData={src:object.src,width:object.width,height:object.height,scaleX:object.scaleX,scaleY:object.scaleY};var D=d.a.getFabricImageResizedData({src:object.src,width:object.width,height:object.height,scaleX:object.scaleX,scaleY:object.scaleY},1);D&&(object.src=D.src,object.width=D.width,object.height=D.height,object.scaleX=D.scaleX,object.scaleY=D.scaleY),object.crossOrigin="anonymous"}else{var I=d.a.getImageBaseKey(object.src);I&&(object.src="https://mz-media-data-production.s3.eu-west-1.amazonaws.com/"+I)}if("MzGroup"===object.type&&object.objects)for(var w in object.objects)m.formatObjectBeforeImport(object.objects[w],{swatchesColorByName:t,lowDefinitionImage:n});return object},extractSwatchesColorByName:function(e){return e.palette.swatches.reduce((function(e,t){return e[t.name]=t.color,e}),{})},extractVariableByBlocktype:function(e,t){var template=t.template,n=t.magazine,r=t.page,c=t.swatchesColorByName;if(0===e.indexOf("Footer")){var d=0,h=Object(o.a)(n.pageOrder).reduce((function(e,t){return t.double&&d%2==0&&d++,e[t._id]=t.double?d+1+"-"+(d+2):d+1,d+=t.double?2:1,e}),{}),m=r.redactorVariables?r.redactorVariables.reduce((function(e,t){return e[t.key]=t.value,e}),{}):{},y=n.redactorGlobalsVariables?n.redactorGlobalsVariables.reduce((function(e,t){return e[t.key]=t.value,e}),{}):{},v={list:f({nb:d,name:n.name,issue:n.issue,var1:"",var2:"",var3:"",global1:"",global2:"",global3:""},m,{},y),globalsTextByType:{}},_=!1===n.isTemplate&&template?template.settings:n.settings;_&&(_.footer&&(v.globalsTextByType.Footer=f({},_.footer)),_.globalsText&&_.globalsText.forEach((function(e){e.textBlockType&&(v.globalsTextByType[e.textBlockType]=f({},e))}))),n.isTemplate&&(v.list.issue="Template edition",v.list.var1="Page variable #1",v.list.var2="Page variable #2",v.list.var3="Page variable #3",v.list.global1="Magazine variable #1",v.list.global2="Magazine variable #2",v.list.global3="Magazine variable #3");var O=h[r._id];if(O&&"string"==typeof O&&O.indexOf("-")){var E=O.split("-");v.list.doublePage={left:parseInt(E[0]),right:parseInt(E[1])}}else v.list.page=parseInt(O);if(c)for(var k in v.footer){var footer=JSON.parse(v.footer[k]);if(footer&&footer.flatStyle){for(var S=0,A=Object.values(footer.flatStyle);S<A.length;S++)for(var T=A[S],P=0,C=Object.entries(T);P<C.length;P++){var x=Object(l.a)(C[P],2),D=x[0],I=x[1];if(0===D.indexOf("swatch_")&&void 0!==c[I])T[D.split("_")[1]]=c[I]}v.footer[k]=JSON.stringify(footer)}}return v}return null}};t.a=m},function(e,t,n){"use strict";n.r(t);n(28);var r=n(3),o=n(1),l=n(2),c=n(12),d=n(231);o.default.use(l.a);var h,f=function(){return{apiBuild:0,adminDashboard:{},settings:{adminMode:!1,maintenanceMode:!1,forceMaintenanceAccess:!1,publicMessage:null,publicMessageClosable:!1},existingLanguages:["en","fr"],existingPrinterKeys:["gelato","hpc"],appGUI:{debug:{svgMode:!1},flatplan:{contentBaseWidth:210,state:"opened"},pageEditor:{marginTop:20,marginBottom:60,zoomValues:[10,25,50,75,100,150,200,250,300],centerAnimationDuration:250},adminFilters:{templates:[],formats:[],clientUsers:[],adminUsers:[],offers:[],orders:[],magazines:[],dashboard:[],workspaces:[],organizations:[],authStrategies:[],groupOffers:[],scheduledNotifications:[],trackings:[],errorlogs:[]}}}},m=f,y={appGUI:function(e){return e.appGUI},appBuild:function(e){return d.version||0},apiBuild:function(e){return e.apiBuild},publicMessage:function(e){return e.settings.publicMessage},publicMessageClosable:function(e){return e.settings.publicMessageClosable},maintenanceMode:function(e){return e.settings.maintenanceMode},forceMaintenanceAccess:function(e){return e.settings.forceMaintenanceAccess},existingLanguages:function(e){return e.existingLanguages},existingPrinterKeys:function(e){return e.existingPrinterKeys},aiFeaturesLanguages:function(e){return["fr","en","de","da","es","fi","hu","it","nl","no","pl","pt","ro","sk","sl","sv","cs"]},adminMode:function(e){return e.settings.adminMode},getAdminFiltersQuery:function(e){return function(t){return e.appGUI.adminFilters[t]?e.appGUI.adminFilters[t].reduce((function(e,filter){return e=Object.assign({},e,filter.query)}),{}):(console.warn("you need to implement adminFilter "+t),[])}}},v={UPDATE_SETTINGS:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.settings,r)},UPDATE_INTERFACE:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.appGUI,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},RESET_STATE:function(e){Object.assign(e,{apiBuild:0,adminDashboard:{},settings:{adminMode:!1,maintenanceMode:!1,forceMaintenanceAccess:!1,publicMessage:null,publicMessageClosable:!1},existingLanguages:["en","fr"],existingPrinterKeys:["gelato","hpc"],appGUI:{debug:{svgMode:!1},flatplan:{contentBaseWidth:210,state:"opened"},pageEditor:{marginTop:20,marginBottom:60,zoomValues:[10,25,50,75,100,150,200,250,300],centerAnimationDuration:250},adminFilters:{templates:[],formats:[],clientUsers:[],adminUsers:[],offers:[],orders:[],magazines:[],dashboard:[],workspaces:[],organizations:[],authStrategies:[],groupOffers:[],scheduledNotifications:[],trackings:[],errorlogs:[]}}})}},_={GET_API_BUILD:function(){var e=this;return this.$axios.get("/build").then((function(e){return e.data})).then((function(t){return e.commit("app/UPDATE_ROOT_FIELD",{key:"apiBuild",value:t.v}),!0}),(function(e){return!1}))},LOAD_ADMIN_DASHBOARD:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/admin/dashboard?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("app/UPDATE_ROOT_FIELD",{key:"adminDashboard",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"ADMIN_DASHBOARD are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})};t.default={namespaced:!0,state:m,getters:y,actions:_,mutations:v}},function(e,t,n){"use strict";n.r(t);n(19),n(13),n(11),n(16),n(28);var r=n(3),o=(n(7),n(4)),l=n(40),c=(n(30),n(26),n(36),n(1)),d=n(2),h=n(185),f=n.n(h),m=n(12);function y(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function v(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?y(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):y(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}c.default.use(d.a);var _,O,E,k,S,A,T,P,C,x,D,I,w={isLogged:function(e){return null!=e.user.token&&null!=e.user._id&&""!=e.user._id},permissions:function(e){return e.user.permissions},nameFromEmail:function(e){return e.user.email?e.user.email.split("@").shift():e.user.name},getToken:function(e){return e.user.token},getTokenIdleTimeout:function(e){return e.user.tokenIdleTimeout},getUser:function(e){return e.user},getUID:function(e){return e.user._id},checkPerm:function(e){return function(t){return-1!=e.user.permissions.indexOf(t)}},checkPermLimit:function(e){return function(t,n){var r=e.user.permissions.find((function(e){return e&&0===e.indexOf(t)})),o=r?parseInt(r.split(":")[2]):0;return!(-1!==o&&n>o)}},isLoggedAsSupport:function(e){return null!==e.supportUser},getDisplayChoiceWorkspace:function(e){return e.displayChoiceWorkspace},getDefaultRoute:function(e){return e.user&&e.user.token?e.forceDefaultRoute?e.forceDefaultRoute:-1!==e.user.permissions.indexOf("admin:all")?{name:"admin"}:-1!==e.user.permissions.indexOf("editor:all")?{name:"client"}:{name:"login"}:{name:"login"}},getCurrentOrganizationId:function(e){return e.user&&e.user.currentOrganization?e.user.currentOrganization:null},getOrganizations:function(e){return e.user&&e.user.organizations?e.user.organizations:null},getCurrentWorkspaceId:function(e){return e.user&&e.user.currentWorkspace?e.user.currentWorkspace:null},getWorkspaces:function(e){return e.user&&e.user.workspaces?e.user.workspaces:null},currentOrganization:function(e){if(e.user&&e.user.currentOrganization&&e.user.organizations){var t=e.user.organizations.find((function(t){return t._id===e.user.currentOrganization}));if(t)return t}return null},currentWorkspace:function(e){if(e.user&&e.user.currentWorkspace&&e.user.workspaces){var t=e.user.workspaces.find((function(t){return t._id===e.user.currentWorkspace}));if(t)return t}return null},isB2cOrganization:function(e,t){return t.currentOrganization&&"B2C"===t.currentOrganization.marketType},isB2bOrganization:function(e,t){return t.currentOrganization&&"B2B"===t.currentOrganization.marketType},getPreviousConnectedEmail:function(e){return e.previousConnectedEmail},hasErrorNoOfferEdu:function(e,t){return!(!t.currentWorkspace||!t.currentOrganization||t.currentWorkspace.activeOffer||t.currentOrganization.activeOffer||"EDU"!==t.currentOrganization.marketType)}},R={UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;m.a.setProperty(n,e.user,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;m.a.setProperty(n,e,r)},RESET_USER:function(e){e.user=Object.assign({},{_id:"",email:"",name:"",ssoUserId:null,workspaces:[],organizations:[],currentWorkspace:null,currentOrganization:null,token:null,tokenIdleTimeout:0,refreshToken:null,websocketToken:null,chatbotHmac:null,permissions:[],roles:[]})},RESET_STATE:function(e){e.user=Object.assign({},{_id:"",email:"",name:"",ssoUserId:null,workspaces:[],organizations:[],currentWorkspace:null,currentOrganization:null,token:null,tokenIdleTimeout:0,refreshToken:null,websocketToken:null,chatbotHmac:null,permissions:[],roles:[]}),e.supportUser=null},UPDATE_PERMISSIONS:function(e){var t=f()(e.user.token);e.user.permissions=t.permissions,e.user.sessionId=t.sessionId}},z={API_SUCCESS:function(e,t){!0===t.display&&(t.tr&&(t.message=this.app.i18n.t(t.tr,t.trParams)),this._vm.$message(t))},API_ERROR:function(e,t){if(console.error("API_ERROR payload",t),void 0!==t){if(this.commit("api/UPDATE_ROOT_FIELD",{key:"lastApiError",value:t}),"object"===Object(l.a)(t)){if((t=JSON.parse(JSON.stringify(t))).tr&&(t.message=this.app.i18n.t(t.tr,t.trParams)),t.message||(t.message=t.error),t.message&&(0===t.message.indexOf("UnauthorizedError")||0===t.message.indexOf("Invalid token specified")))return;if(t.type)switch(t.type){case"alert":return void this._vm.$alert(t.message,"",{c
1onfirmButtonText:this.app.i18n.t("public.alert.ok")})}}this._vm.$messageError(t)}},API_CHECK_EMAIL_LOGIN:function(e,t){var n=this;return this.$axios.post("/api/v1/users/checkEmailLogin",t).then((function(e){return e.data})).then((function(e){return e}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_CHECK_LOGIN_BY_NICKNAME_CODE:function(e,t){var n=this;return this.$axios.post("/api/v1/users/checkLoginByNicknameCode",t).then((function(e){return e.data})).then((function(e){return e}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_LOGIN:function(e,t){var n=this;return this.$axios.post("/api/v1/users/login/"+t.authStrategy,t).then((function(e){return e.data})).then((function(e){var t=e.token;return n.dispatch("api/API_LOAD_LOGGED_USER",{token:t})}),(function(e){if(e.response&&e.response.data&&e.response.data.error)switch(e.response.data.error){case"validatePasswordError":"login_code"===t.authStrategy?n.dispatch("api/API_ERROR","This code is not valid or has expired."):"login_password"===t.authStrategy?n.dispatch("api/API_ERROR","This password is not valid."):n.dispatch("api/API_ERROR","This credentials is not valid.");break;case"collaborationUserNotFound":n.dispatch("api/API_ERROR",{tr:"serverResponse.login.collaborationUserNotFound"});break;default:n.dispatch("api/API_ERROR",e.response?e.response.data:e)}else n.dispatch("api/API_ERROR",e.response?e.response.data:e);return!1}))},API_LOAD_LOGGED_USER:function(e,t){var n=this,r=t.token,o=t.force;return this.$axios.post("/api/v1/users/userFromLoginToken",{token:r,force:o,storageIsDisabled:this.$mzLocalStorage.storageIsDisabled}).then((function(e){return e.data})).then((function(t){var r=t.user,o=t.routeAfterLogin,l=t.keepLogin;if(t.supportLogin){n.commit("api/UPDATE_ROOT_FIELD",{key:"supportUser",value:v({},e.state.user)});var c=["api","app","i18n"];for(var d in e.rootState)-1===c.indexOf(d)&&n.commit(d+"/RESET_STATE")}else n.commit("api/UPDATE_ROOT_FIELD",{key:"supportUser",value:null}),l?n.$mzLocalStorage.setItem("mzkeeplogin",!0):n.$mzLocalStorage.removeItem("mzkeeplogin"),n.$mzLocalStorage.storageIsDisabled&&n._vm.$alert(n.app.i18n.t("public.layout.localStorage.error.message"),n.app.i18n.t("public.layout.localStorage.error.title"),{dangerouslyUseHTMLString:!0});return n.$mzLocalStorage.setItem("mztoken",r.token),n.$mzLocalStorage.setItem("mzrefreshtoken",r.refreshToken),n.commit("api/UPDATE_FIELD",{key:"refreshToken",value:r.refreshToken}),n.commit("api/UPDATE_FIELD",{key:"token",value:r.token}),n.commit("api/UPDATE_FIELD",{key:"tokenIdleTimeout",value:r.tokenIdleTimeout}),n.commit("api/UPDATE_FIELD",{key:"websocketToken",value:r.websocketToken}),n.commit("api/UPDATE_FIELD",{key:"chatbotHmac",value:r.chatbotHmac}),n.commit("api/UPDATE_FIELD",{key:"email",value:r.email}),n.commit("api/UPDATE_FIELD",{key:"ssoUserId",value:r.ssoUserId}),n.commit("api/UPDATE_FIELD",{key:"workspaces",value:r.workspaces}),n.commit("api/UPDATE_FIELD",{key:"organizations",value:r.organizations}),n.commit("api/UPDATE_FIELD",{key:"currentWorkspace",value:r.currentWorkspace}),n.commit("api/UPDATE_FIELD",{key:"currentOrganization",value:r.currentOrganization}),n.commit("api/UPDATE_FIELD",{key:"name",value:r.name}),n.commit("api/UPDATE_FIELD",{key:"roles",value:r.roles}),n.commit("api/UPDATE_FIELD",{key:"_id",value:r._id}),n.commit("api/UPDATE_PERMISSIONS"),n.$axios.setToken(r.token,"Token"),o&&n.commit("api/UPDATE_ROOT_FIELD",{key:"forceDefaultRoute",value:o}),n.dispatch("api/API_SUCCESS",{type:"info",message:"user is logged"}),n.commit("api/UPDATE_ROOT_FIELD",{key:"displayChoiceWorkspace",value:r.organizations.length>1||r.workspaces.length>1}),!0}),(function(e){return e.response&&e.response.data&&e.response.data.canForce&&!o?new Promise((function(t,o){n._vm.$confirm(n.app.i18n.t(e.response.data.tr,e.response.data.trParams),n.app.i18n.t("public.login.alreadyLoggedUser.title"),{confirmButtonText:n.app.i18n.t("public.login.alreadyLoggedUser.confirm"),cancelButtonText:n.app.i18n.t("public.login.alreadyLoggedUser.cancel"),dangerouslyUseHTMLString:!0}).then((function(){n.dispatch("api/API_LOAD_LOGGED_USER",{token:r,force:!0}).then((function(e){t(e)}))})).catch((function(){t(!1)}))})):(console.log("login error",e),n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1)}))},API_CHECK_INVIT_TOKEN:(I=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.token,e.abrupt("return",this.$axios.get("/api/v1/users/checkInvitationToken/"+r).then((function(e){return e.data})).then((function(e){return o.dispatch("api/API_SUCCESS",{type:"info",message:"invit token is valid"}),e}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)}),API_RESEND_AUTH_CODE:function(e,t){var n=this;return this.$axios.post("/api/v1/users/resendAuthCode",t).then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"A new authentication code has been sent.",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_CHANGE_WORKSPACE:function(e,t){var n=this;
1return this.$axios.post("/api/v1/users/changeWorkspace",t).then((function(e){return e.data})).then((function(e){var t=e.user;return n.$mzLocalStorage.setItem("mztoken",t.token),t.refreshToken&&(n.$mzLocalStorage.setItem("mzrefreshtoken",t.refreshToken),n.commit("api/UPDATE_FIELD",{key:"refreshToken",value:t.refreshToken})),n.commit("api/UPDATE_FIELD",{key:"token",value:t.token}),n.commit("api/UPDATE_FIELD",{key:"tokenIdleTimeout",value:t.tokenIdleTimeout}),n.commit("api/UPDATE_FIELD",{key:"websocketToken",value:t.websocketToken}),n.commit("api/UPDATE_FIELD",{key:"chatbotHmac",value:t.chatbotHmac}),n.commit("api/UPDATE_FIELD",{key:"workspaces",value:t.workspaces}),n.commit("api/UPDATE_FIELD",{key:"organizations",value:t.organizations}),n.commit("api/UPDATE_FIELD",{key:"currentWorkspace",value:t.currentWorkspace}),n.commit("api/UPDATE_FIELD",{key:"currentOrganization",value:t.currentOrganization}),n.commit("api/UPDATE_FIELD",{key:"roles",value:t.roles}),n.commit("api/UPDATE_FIELD",{key:"_id",value:t._id}),n.$axios.setToken(t.token,"Token"),n.commit("api/UPDATE_PERMISSIONS"),n.dispatch("api/API_SUCCESS",{type:"info",message:"change workspace success"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_CHANGE_USERDATA:function(e,t){var n=this;return this.$axios.put("/api/v1/users/update",t).then((function(e){return e.data})).then((function(e){var t=e.user;return n.commit("api/UPDATE_FIELD",{key:"name",value:t.name}),n.dispatch("api/API_SUCCESS",{type:"info",message:"change name success"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_LOGOUT_SUPPORT:function(e,t){var n=this;return this.$axios.post("/api/v1/users/logout",{userId:e.state.user._id}).then((function(e){return e.data})).then((function(t){var r=v({},e.state.supportUser);n.commit("api/UPDATE_ROOT_FIELD",{key:"supportUser",value:null});var o=["api","app","i18n"];for(var l in e.rootState)-1===o.indexOf(l)&&n.commit(l+"/RESET_STATE");return n.$mzLocalStorage.setItem("mztoken",r.token),n.$mzLocalStorage.setItem("mzrefreshtoken",r.refreshToken),n.commit("api/UPDATE_FIELD",{key:"refreshToken",value:r.refreshToken}),n.commit("api/UPDATE_FIELD",{key:"token",value:r.token}),n.commit("api/UPDATE_FIELD",{key:"tokenIdleTimeout",value:r.tokenIdleTimeout}),n.commit("api/UPDATE_FIELD",{key:"websocketToken",value:r.websocketToken}),n.commit("api/UPDATE_FIELD",{key:"chatbotHmac",value:r.chatbotHmac}),n.commit("api/UPDATE_FIELD",{key:"email",value:r.email}),n.commit("api/UPDATE_FIELD",{key:"ssoUserId",value:r.ssoUserId}),n.commit("api/UPDATE_FIELD",{key:"workspaces",value:r.workspaces}),n.commit("api/UPDATE_FIELD",{key:"organizations",value:r.organizations}),n.commit("api/UPDATE_FIELD",{key:"currentWorkspace",value:r.currentWorkspace}),n.commit("api/UPDATE_FIELD",{key:"currentOrganization",value:r.currentOrganization}),n.commit("api/UPDATE_FIELD",{key:"name",value:r.name}),n.commit("api/UPDATE_FIELD",{key:"roles",value:r.roles}),n.commit("api/UPDATE_FIELD",{key:"_id",value:r._id}),n.commit("api/UPDATE_PERMISSIONS"),n.$axios.setToken(r.token,"Token"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_REGISTER:function(e,t){var n=this;return this.$axios.post("/api/v1/users",{user:t.user}).then((function(e){return e.data})).then((function(e){var t=e.user,r=e.routeAfterLogin;return t&&(n.$mzLocalStorage.setItem("mztoken",t.token),n.$mzLocalStorage.setItem("mzrefreshtoken",t.refreshToken),n.commit("api/UPDATE_FIELD",{key:"refreshToken",value:t.refreshToken}),n.commit("api/UPDATE_FIELD",{key:"token",value:t.token}),n.commit("api/UPDATE_FIELD",{key:"tokenIdleTimeout",value:t.tokenIdleTimeout}),n.commit("api/UPDATE_FIELD",{key:"websocketToken",value:t.websocketToken}),n.commit("api/UPDATE_FIELD",{key:"chatbotHmac",value:t.chatbotHmac}),n.commit("api/UPDATE_FIELD",{key:"email",value:t.email}),n.commit("api/UPDATE_FIELD",{key:"ssoUserId",value:t.ssoUserId}),n.commit("api/UPDATE_FIELD",{key:"workspaces",value:t.workspaces}),n.commit("api/UPDATE_FIELD",{key:"organizations",value:t.organizations}),n.commit("api/UPDATE_FIELD",{key:"currentWorkspace",value:t.currentWorkspace}),n.commit("api/UPDATE_FIELD",{key:"currentOrganization",value:t.currentOrganization}),n.commit("api/UPDATE_FIELD",{key:"name",value:t.name}),n.commit("api/UPDATE_FIELD",{key:"roles",value:t.roles}),n.commit("api/UPDATE_FIELD",{key:"_id",value:t._id}),n.commit("api/UPDATE_PERMISSIONS"),n.$axios.setToken(t.token,"Token")),r&&n.commit("api/UPDATE_ROOT_FIELD",{key:"forceDefaultRoute",value:r}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_FORGOT_PASSWORD:function(e,t){var n=this;return this.$axios.post("/api/v1/users/forgotPassword",{user:t.user,locale:e.rootState.i18n.locale}).then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"an email has been sent on "+t.user.email}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_CHECK_PASSWORD_TOKEN:(D=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.token,e.abrupt("return",this.$axios.get("/api/v1/users/checkPasswordToken/"+r).then((function(e){return e.data})).then((function(e){return o.dispatch("api/API_SUCCESS",{type:"info",message:"password token is valid"}),e}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)}),API_RESET_PASSWORD:function(e,t){var n=this;return this.$axios.post("/api/v1/users/resetPassword",{user:t.user,token:t.token}).then((function(e){return e.data})).then((function(e){var r=e.token;return n.dispatch("api/API_SUCCESS",{type:"info",message:"paswword reset for "+t.user.email}),!r||n.dispatch("api/API_LOAD_LOGGED_USER",{token:r})}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},API_SESSION_ACTIVE:(x=Object(r.a)(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.state.user.token){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.$axios.put("/api/v1/users/active",{isActive:n}));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)}),RELOAD_CURRENT_SESSION_USER:(C=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.$mzLocalStorage.getItem("mztoken"),o=this.$mzLocalStorage.getItem("mzrefreshtoken"),!r||!o){e.next=14;break}return this.commit("api/UPDATE_FIELD",{key:"token",value:r}),this.commit("api/UPDATE_FIELD",{key:"refreshToken",value:o}),this.$axios.setToken(r,"Token"),e.next=7,this.dispatch("api/API_CHECK");case 7:if(l=e.sent){e.next=13;break}return e.next=11,this.dispatch("api/API_LOGOUT",{debugSaveFrom:"RELOAD_CURRENT_SESSION_USER received invali
1d API CHECK"});case 11:e.next=14;break;case 13:return e.abrupt("return",l);case 14:return e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)}),API_CHECK:(P=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===t.state.refreshTokenPromise||"object"!==Object(l.a)(t.state.refreshTokenPromise)||"function"!=typeof t.state.refreshTokenPromise.then){e.next=3;break}return console.log("API_CHECK detect is already in progress ",t.state.refreshTokenPromise),e.abrupt("return",t.state.refreshTokenPromise);case 3:return console.log("API_CHECK send refresh user token"),r=this.$axios.post("/api/v1/users/token",{refreshToken:t.state.user.refreshToken,userToken:t.state.user.token,userId:t.state.user._id}).then((function(e){return e.data})).then((function(e){o.commit("api/UPDATE_ROOT_FIELD",{key:"refreshTokenPromise",value:null});var t=e.user;return o.$mzLocalStorage.setItem("mztoken",t.token),t.refreshToken&&(o.$mzLocalStorage.setItem("mzrefreshtoken",t.refreshToken),o.commit("api/UPDATE_FIELD",{key:"refreshToken",value:t.refreshToken})),o.commit("api/UPDATE_FIELD",{key:"token",value:t.token}),o.commit("api/UPDATE_FIELD",{key:"tokenIdleTimeout",value:t.tokenIdleTimeout}),o.commit("api/UPDATE_FIELD",{key:"websocketToken",value:t.websocketToken}),o.commit("api/UPDATE_FIELD",{key:"chatbotHmac",value:t.chatbotHmac}),o.commit("api/UPDATE_FIELD",{key:"email",value:t.email}),o.commit("api/UPDATE_FIELD",{key:"ssoUserId",value:t.ssoUserId}),o.commit("api/UPDATE_FIELD",{key:"workspaces",value:t.workspaces}),o.commit("api/UPDATE_FIELD",{key:"organizations",value:t.organizations}),o.commit("api/UPDATE_FIELD",{key:"currentWorkspace",value:t.currentWorkspace}),o.commit("api/UPDATE_FIELD",{key:"currentOrganization",value:t.currentOrganization}),o.commit("api/UPDATE_FIELD",{key:"name",value:t.name}),o.commit("api/UPDATE_FIELD",{key:"roles",value:t.roles}),o.commit("api/UPDATE_FIELD",{key:"_id",value:t._id}),o.commit("api/UPDATE_PERMISSIONS"),o.$axios.setToken(t.token,"Token"),o.dispatch("api/API_SUCCESS",{type:"info",message:"user is logged"}),t.token}),(function(e){return o.commit("api/UPDATE_ROOT_FIELD",{key:"refreshTokenPromise",value:null}),o.commit("api/UPDATE_FIELD",{key:"token",value:null}),o.commit("api/UPDATE_FIELD",{key:"tokenIdleTimeout",value:null}),o.commit("api/UPDATE_FIELD",{key:"websocketToken",value:null}),e&&e.response&&401==e.response.status&&(o.commit("api/UPDATE_ROOT_FIELD",{key:"previousConnectedEmail",value:t.state.user.email}),o.commit("api/UPDATE_ROOT_FIELD",{key:"forceDefaultRoute",value:o.$router.currentRoute.path})),console.log("API_CHECK error remove keep login and token",e),o.$mzLocalStorage.removeItem("mzkeeplogin"),o.$mzLocalStorage.removeItem("mztoken"),o.$mzLocalStorage.removeItem("mzrefreshtoken"),o.$axios.setToken(!1,"Token"),!1})),this.commit("api/UPDATE_ROOT_FIELD",{key:"refreshTokenPromise",value:r}),e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)}),API_LOGOUT:(T=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.post("/api/v1/users/logout",{userId:t.state.user._id,debugSaveFrom:n.debugSaveFrom}).then((function(e){return e.data})).then((function(e){return r.dispatch("api/API_RESET_ALL_STATE_AND_TOKEN"),n&&n.nextLoginRoute&&r.commit("api/UPDATE_ROOT_FIELD",{key:"forceDefaultRoute",value:n.nextLoginRoute}),n&&n.saveConnectedEmail&&t.state.user.email&&r.commit("api/UPDATE_ROOT_FIELD",{key:"previousConnectedEmail",value:t.state.user.email}),!0}),(function(e){return r.dispatch("api/API_RESET_ALL_STATE_AND_TOKEN"),n&&n.nextLoginRoute&&r.commit("api/UPDATE_ROOT_FIELD",{key:"forceDefaultRoute",value:n.nextLoginRoute}),n&&n.saveConnectedEmail&&t.state.user.email&&r.commit("api/UPDATE_ROOT_FIELD",{key:"previousConnectedEmail",value:t.state.user.email}),r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)}),API_RESET_ALL_STATE_AND_TOKEN:(A=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r in console.log("API_RESET_ALL_STATE_AND_TOKEN remove keep login"),this.$mzLocalStorage.removeItem("mzkeeplogin"),this.$mzLocalStorage.removeItem("mztoken"),this.$mzLocalStorage.removeItem("mzrefreshtoken"),this.$axios.setToken(!1,"Token"),n=["i18n"],t.rootState)-1===n.indexOf(r)&&this.commit(r+"/RESET_STATE");case 7:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)}),API_REPORT:(S=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.post("/api/v1/users/report",n).then((function(e){return e.data})).then((function(e){return!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)}),API_CONTACT:(k=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.post("/api/v1/users/contact",n).then((function(e){return e.data})).then((function(e){return!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)}),API_SEND_ERROR:(E=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=r.length>1&&void 0!==r[1]?r[1]:{}
1)&&n.error&&n.error.name&&n.error.message&&(n.error={name:n.error.name,message:n.error.message,mzData:n.error.mzData,stack:n.error.stack}),n.appBuild=t.rootGetters["app/appBuild"],n.apiBuild=t.rootGetters["app/apiBuild"],n.userId=t.state.user._id,e.abrupt("return",this.$axios.post("/api/v1/users/sendError",n).then((function(e){return e.data})).then((function(e){return!0}),(function(e){return console.error("API_SEND_ERROR error",e),!1})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)}),API_STATUS:(O=Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/health/status"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)}),API_GET_STRIPE_PORTAL_LINK:(_=Object(r.a)(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/users/stripePortalLink/").then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"success get stripe portal link"}),e}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})};t.default={namespaced:!0,getters:w,mutations:R,state:function(){return{user:{_id:"",email:"",name:"",ssoUserId:null,workspaces:[],organizations:[],currentWorkspace:null,currentOrganization:null,token:null,tokenIdleTimeout:0,refreshToken:null,websocketToken:null,chatbotHmac:null,permissions:[],roles:[]},supportUser:null,forceDefaultRoute:null,previousConnectedEmail:null,refreshTokenPromise:null,displayChoiceWorkspace:!1,lastApiError:null}},actions:z}},function(e,t,n){"use strict";n.r(t);n(26),n(7),n(28);var r=n(3),o=(n(47),n(1)),l=n(2),c=n(12),d=n(14);o.default.use(l.a);var h,f,m,y=function(){return{formatBaseList:[],formatBaseListQuery:null,format:{_id:null,formatBase:null,canvasWidth:794,canvasHeight:1123,dpi:96,dpiLD:96,dpiHD:300,printMargins:{top:5,left
1:5,bottom:5,right:5},safeZone:{top:5,left:5,bottom:5,right:5},grid:{column:0,gutter:0}},formatBase:{_id:null,name:"",pageWidth:210,pageHeight:297,orientation:"Portrait",description:"",printProducts:[]}}},v={SET_FORMAT_BASE_LIST:function(e,t){var n=t.formats,r=t.query;e.formatBaseList=n,e.formatBaseListQuery=r},ADD_FORMAT_BASE:function(e,t){e.formatBaseList.push(t.format)},UPDATE_FORMAT_BASE:function(e,t){console.log("UPDATE_FORMAT_BASE",JSON.parse(JSON.stringify(t)));var n=e.formatBaseList.findIndex((function(e){return e._id===t.format._id}));n>=0&&Object.assign(e.formatBaseList[n],t.format)},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.format,r)},UPDATE_FIELD_BASE:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.formatBase,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.format[t.key].findIndex(t.cb):e.format[t.key].indexOf(t.value);n>=0&&e.format[t.key].splice(n,1)}else e.format[t.key].push(t.value)},UPDATE_ARRAY_BASE:function(e,t){if(!0===t.delete){var n=t.cb?e.formatBase[t.key].findIndex(t.cb):e.formatBase[t.key].indexOf(t.value);n>=0&&e.formatBase[t.key].splice(n,1)}else e.formatBase[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.format[t.key][t.from];e.format[t.key][t.from]=e.format[t.key][t.to],o.default.set(e.format[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_FORMAT:function(e){e.format=Object.assign({},{_id:null,formatBase:null,canvasWidth:794,canvasHeight:1123,dpi:96,dpiLD:96,dpiHD:300,printMargins:{top:5,left
1:5,bottom:5,right:5},safeZone:{top:5,left:5,bottom:5,right:5},grid:{column:0,gutter:0}})},RESET_FORMAT_BASE:function(e){e.formatBase=Object.assign({},{_id:null,name:"",pageWidth:210,pageHeight:297,orientation:"Portrait",description:"",printProducts:[]})},RESET_STATE:function(e){Object.assign(e,{formatBaseList:[],formatBaseListQuery:null,format:{_id:null,formatBase:null,canvasWidth:794,canvasHeight:1123,dpi:96,dpiLD:96,dpiHD:300,printMargins:{top:5,left:5,bottom:5,right:5},safeZone:{top:5,left:5,bottom:5,right:5},grid:{column:0,gutter:0}},formatBase:{_id:null,name:"",pageWidth:210,pageHeight:297,orientation:"Portrait",description:"",printProducts:[]}})},REFRESH_ORIENTATION_BASE:function(e){e.formatBase.orientation=e.formatBase.pageWidth===e.formatBase.pageHeight?"Square":e.formatBase.pageWidth>e.formatBase.pageHeight?"Landscape":"Portrait"},UPDATE_CANVAS_SIZE:function(e){e.format.canvasWidth=d.a.convertMilimetersToPixels(e.format.formatBase.pageWidth,e.format.dpi),e.format.canvasHeight=d.a.convertMilimetersToPixels(e.format.formatBase.pageHeight,e.format.dpi)}},_={namespaced:!0,state:y,getters:{},actions:{LOAD_FORMAT_BASE_LIST:(m=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:"",!(t.state.formatBaseList.length>0&&t.state.formatBaseListQuery===n)){e.next=4;break}return console.log("LOAD_FORMAT_BASE_LIST already in state"),e.abrupt("return",Promise.resolve(!0));case 4:return e.abrupt("return",this.$axios.get("/api/v1/format/base/"+n).then((function(e){return e.data})).then((function(e){return r.commit("format/SET_FORMAT_BASE_LIST",{formats:e,query:n}),r.dispatch("api/API_SUCCESS",{type:"info",message:"FORMAT_BASE_LIST are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)}),LOAD_FORMAT:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.format._id){e.next=3;break}return console.log("LOAD_FORMAT already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/format/"+c.a.normalizePayloadURI(n,"formatId")).then((function(e){return e.data})).then((function(e){return r.commit("format/UPDATE_FIELD",{key:"formatBase",value:e.formatBase}),r.commit("format/UPDATE_FIELD",{key:"canvasWidth",value:e.canvasWidth}),r.commit("format/UPDATE_FIELD",{key:"canvasHeight",value:e.canvasHeight}),r.commit("format/UPDATE_FIELD",{key:"dpi",value:e.dpi}),r.commit("format/UPDATE_FIELD",{key:"dpiLD",value:e.dpiLD}),r.commit("format/UPDATE_FIELD",{key:"dpiHD",value:e.dpiHD}),r.commit("format/UPDATE_FIELD",{key:"printMargins",value:e.printMargins}),r.commit("format/UPDATE_FIELD",{key:"safeZone",value:e.safeZone}),r.commit("format/UPDATE_FIELD",{key:"grid",value:e.grid}),r.commit("format/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"format is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),SAVE_FORMAT:function(e,t){var n=this,r=null===e.state.format._id?"post":"put",o=null===e.state.format._id?"":e.state.format._id;return this.$axios[r]("/api/v1/format/"+o,e.state.format).then((function(e){return e.data})).then((function(e){return n.commit("format/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("format/UPDATE_FIELD",{key:"formatBase",value:e.formatBase}),n.commit("format/UPDATE_FIELD",{key:"canvasWidth",value:e.canvasWidth}),n.commit("format/UPDATE_FIELD",{key:"canvasHeight",value:e.canvasHeight}),n.commit("format/UPDATE_FIELD",{key:"dpi",value:e.dpi}),n.commit("format/UPDATE_FIELD",{key:"dpiLD",value:e.dpiLD}),n.commit("format/UPDATE_FIELD",{key:"dpiHD",value:e.dpiHD}),n.commit("format/UPDATE_FIELD",{key:"printMargins",value:e.printMargins}),n.commit("format/UPDATE_FIELD",{key:"safeZone",value:e.safeZone}),n.commit("format/UPDATE_FIELD",{key:"grid",value:e.grid}),n.dispatch("api/API_SUCCESS",{type:"info",message:"format is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},LOAD_FORMAT_BASE:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.formatBase._id){e.next=3;break}return console.log("LOAD_FORMAT_BASE already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/format/base/"+c.a.normalizePayloadURI(n,"formatId")).then((function(e){return e.data})).then((function(e){return r.commit("format/UPDATE_FIELD_BASE",{key:"name",value:e.name}),r.commit("format/UPDATE_FIELD_BASE",{key:"pageWidth",value:e.pageWidth}),r.commit("format/UPDATE_FIELD_BASE",{key:"pageHeight",value:e.pageHeight}),r.commit("format/UPDATE_FIELD_BASE",{key:"orientation",value:e.orientation}),r.commit("format/UPDATE_FIELD_BASE",{key:"description",value:e.description}),r.commit("format/UPDATE_FIELD_BASE",{key:"printProducts",value:e.printProducts}),r.commit("format/UPDATE_FIELD_BASE",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"formatBase is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),SAVE_FORMAT_BASE:function(e,t){var n=this,r=null===e.state.formatBase._id?"post":"put",o=null===e.state.formatBase._id?"":e.state.formatBase._id;return this.$axios[r]("/api/v1/format/base/"+o,e.state.formatBase).then((function(e){return e.data})).then((function(e){return n.commit("format/UPDATE_FIELD_BASE",{key:"_id",value:e._id}),n.commit("format/UPDATE_FIELD_BASE",{key:"name",value:e.name}),n.commit("format/UPDATE_FIELD_BASE",{key:"pageWidth",value:e.pageWidth}),n.commit("format/UPDATE_FIELD_BASE",{key:"pageHeight",value:e.pageHeight}),n.commit("format/UPDATE_FIELD_BASE",{key:"orientation",value:e.orientation}),n.commit("format/UPDATE_FIELD_BASE",{key:"description",value:e.description}),n.commit("format/UPDATE_FIELD_BASE",{key:"printProducts",value:e.printProducts}),0===o.length?n.commit("format/ADD_FORMAT_BASE",{format:e}):n.commit("format/UPDATE_FORMAT_BASE",{format:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"format is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))}},mutations:v};t.default=_},function(e,t,n){"use strict";n.r(t);var r=n(40),o=(n(11),n(82),n(7),n(28),n(3)),l=(n(47),n(27)),c=(n(36),n(30),n(26),n(1)),d=n(2),h=n(12);c.default.use(d.a);
1var f={footer:{left:null,right:null},globalsText:[],backgroundFillSwatchName:null};function m(e){return{_id:e._id,name:e.name,issue:e.issue,published:e.published,format:e.format._id,template:e.template,isTemplate:e.isTemplate,isPrivate:e.isPrivate,status:e.status,tags:e.tags,theme:e.theme,themeList:e.themeList,createdAt:e.createdAt,updatedAt:e.updatedAt,thumb:e.thumb,collaboration:e.collaboration}}var y,v,_,O,E,k,S,A,T,P,C,x,D,I,w,R,z,L,j,M=function(){return{magazineForEditingLoadComplete:!1,magazineLoadType:"",magazine:{_id:null,name:"",displayName:"",description:"",owner:null,workspace:null,issue:"",version:1,isPrivate:!1,published:null,status:"New",deleted:!1,tags:[],category:"",format:null,themeList:[],theme:null,themeExtended:null,isTemplate:!1,template:null,pageOrder:[],thumb:"",collaboration:null,library:null,settings:null,lastVisualChangeAt:null,exportedPdfs:null,googleAnalyticsId:"",matomoAnalyticsId:"",matomoAnalyticsUrl:"",viewerIsIndexable:!1,otherIssues:null,viewerShowDownload:!1,sendWarningBeforeDeleteAt:null,viewerViewCounter:0,viewerSpecificLogo:"",viewerSpecificLogoLink:"",collaboratorCount:0,pageCount:0,bonusNbCollaborators:0,activeOffer:null,offers:[],userPermissions:[],recursiveActiveOffer:null,magazineFrom:null,language:null,aiTranslate:null,redactorGlobalsVariables:[],displayVariablesNames:[]},magazineDeletedPages:null,template:{_id:null,name:"",displayName:"",description:"",owner:null,workspace:null,issue:"",version:1,isPrivate:!1,published:null,status:"New",deleted:!1,tags:[],category:"",format:null,themeList:[],theme:null,themeExtended:null,isTemplate:!1,template:null,pageOrder:[],thumb:"",collaboration:null,library:null,settings:null,lastVisualChangeAt:null,exportedPdfs:null,googleAnalyticsId:"",matomoAnalyticsId:"",matomoAnalyticsUrl:"",viewerIsIndexable:!1,otherIssues:null,viewerShowDownload:!1,sendWarningBeforeDeleteAt:null,viewerViewCounter:0,viewerSpecificLogo:"",viewerSpecificLogoLink:"",collaboratorCount:0,pageCount:0,bonusNbCollaborators:0,activeOffer:null,offers:[],userPermissions:[],recursiveActiveOffer:null,magazineFrom:null,language:null,aiTranslate:null,redactorGlobalsVariables:[],displayVariablesNames:[]},userMagazines:null,organizationMagazines:null,templateMagazines:null,templateMagazinesCount:0,clientMagazines:null,clientMagazinesCount:0,pdfStatus:{id:null,version:"",startAt:0,pdfProgressState:""},existingMagazinesLanguage:null}},U={ADD_MAGAZINE:function(e,t){var n=t.magazine,r=m(n);null!==e.userMagazines&&!1===n.deleted&&!1===n.isTemplate&&e.userMagazines.push(r),null!==e.templateMagazines&&!1===n.deleted&&!0===n.isTemplate&&e.templateMagazines.push(r)},UPDATE_MAGAZINE:function(e,t){var n=t.magazine,r=n._id,o=m(n),l=null!==e.userMagazines?e.userMagazines.findIndex((function(e){return e._id===r})):-1,c=null!==e.templateMagazines?e.templateMagazines.findIndex((function(e){return e._id===r})):-1,d=null!==e.clientMagazines?e.clientMagazines.findIndex((function(e){return e._id===r})):-1;l>=0&&(!1===n.deleted&&!1===n.isTemplate?Object.assign(e.userMagazines[l],o):e.userMagazines.splice(l,1)),c>=0&&(!1===n.deleted&&!0===n.isTemplate?Object.assign(e.templateMagazines[c],o):e.templateMagazines.splice(c,1)),d>=0&&Object.assign(e.clientMagazines[d],n),e.template._id===n._id&&h.a.setProperty("template",e,n)},REMOVE_MAGAZINE:function(e,t){var n=null!==e.userMagazines?e.userMagazines.findIndex((function(e){return e._id===t})):-1,r=null!==e.templateMagazines?e.templateMagazines.findIndex((function(e){return e._id===t})):-1,o=null!==e.clientMagazines?e.clientMagazines.findIndex((function(e){return e._id===t})):-1;n>=0&&e.userMagazines.splice(n,1),r>=0&&e.templateMagazines.splice(r,1),o>=0&&e.clientMagazines.splice(o,1)},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;h.a.setProperty(n,e.magazine,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;h.a.setProperty(n,e,r)},UPDATE_SETTINGS:function(e,t){var n=t.key,r=t.value;e.magazine.settings||(e.magazine.settings=f),h.a.setProperty(n,e.magazine.settings,r)},UPDATE_GLOBALS_TEXT_SETTINGS:function(e,t){var n=t.type,r=t.position,o=t.value;if(("left"===r||"right"===r)&&0===n.indexOf("Footer"))if(e.magazine.settings||(e.magazine.settings=f),"Footer"===n)e.magazine.settings.footer||(e.magazine.settings.footer={left:null,right:null}),h.a.setProperty("footer."+r,e.magazine.settings,o);else{e.magazine.settings.globalsText||(e.magazine.settings.globalsText=[]);var l=e.magazine.settings.globalsText.findIndex((function(e){return e.textBlockType===n}));-1===l?e.magazine.settings.globalsText.push({textBlockType:n,left:"left"===r?o:null,right:"right"===r?o:null}):h.a.setProperty(r,e.magazine.settings.globalsText[l],o)}},UPDATE_REDACTOR_GLOBAL_VARIABLE:function(e,t){var n=t.key,r=t.value,o=e.magazine.redactorGlobalsVariables.findIndex((function(e){return e.key===n}));o>=0?r&&r.trim().length>0?e.magazine.redactorGlobalsVariables[o].value=r:e.magazine.redactorGlobalsVariables.splice(o,1):r&&r.trim().length>0&&e.magazine.redactorGlobalsVariables.push({key:n,value:r})},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.magazine[t.key].findIndex(t.cb):e.magazine[t.key].indexOf(t.value);n>=0&&e.magazine[t.key].splice(n,1)}else e.magazine[t.key].push(t.value)},MOVE_ARRAY:function(e,t){e.magazine[t.key].splice(t.to,0,e.magazine[t.key].splice(t.from,1)[0]),"pageOrder"===t.key&&0===t.to&&(e.magazine.thumb=e.magazine.pageOrder[0]&&e.magazine.pageOrder[0]._id?e.magazine.pageOrder[0]._id:e.magazine.pageOrder[0])},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_MAGAZINE:function(e){e.magazine=Object.assign({},{_id:null,name:"",displayName:"",description:"",owner:null,workspace:null,issue:"",version:1,isPrivate:!1,published:null,status:"New",deleted:!1,tags:[],category:"",format:null,themeList:[],theme:null,themeExtended:null,isTemplate:!1,template:null,pageOrder:[],thumb:"",collaboration:null,library:null,settings:null,lastVisualChangeAt:null,exportedPdfs:null,googleAnalyticsId:"",matomoAnalyticsId:"",matomoAnalyticsUrl:"",viewerIsIndexable:!1,otherIssues:null,viewerShowDownload:!1,sendWarningBeforeDeleteAt:null,viewerViewCounter:0,viewerSpecificLogo:"",viewerSpecificLogoLink:"",collaboratorCount:0,pageCount:0,bonusNbCollaborators:0,activeOffer:null,offers:[],userPermissions:[],recursiveActiveOffer:null,magazineFrom:null,language:null,aiTranslate:null,redactorGlobalsVariables:[],displayVariablesNames:[]})},RESET_TEMPLATE:function(e){e.template=Object.assign({},{_id:null,name:"",displayName:"",description:"",owner:null,workspace:null,issue:"",version:1,isPrivate:!1,published:null,status:"New",deleted:!1,tags:[],category:"",format:null,themeList:[],theme:null,themeExtended:null,isTemplate:!1,template:null,pageOrder:[],thumb:"",collaboration:null,library:null,settings:null,lastVisualChangeAt:null,exportedPdfs:null,googleAnalyticsId:"",matomoAnalyticsId:"",matomoAnalyticsUrl:"",viewerIsIndexable:!1,otherIssues:null,viewerShowDownload:!1,sendWarningBeforeDeleteAt:null,viewerViewCounter:0,viewerSpecificLogo:"",viewerSpecificLogoLink:"",collaboratorCount:0,pageCount:0,bonusNbCollaborators:0,activeOffer:null,offers:[],userPermissions:[],recursiveActiveOffer:null,magazineFrom:null,language:null,aiTranslate:null,redactorGlobalsVariables:[],displayVariablesNames:[]})},RESET_STATE:function(e){Object.assign(e,{magazineForEditingLoadComplete:!1,magazineLoadType:"",magazine:{_id:null,name:"",displayName:"",description:"",owner:null,workspace:null,issue:"",version:1,isPrivate:!1,published:null,status:"New",deleted:!1,tags:[],category:"",format:null,themeList:[],theme:null,themeExtended:null,isTemplate:!1,template:null,pageOrder:[],thumb:"",collaboration:null,library:null,settings:null,lastVisualChangeAt:null,exportedPdfs:null,googleAnalyticsId:"",matomoAnalyticsId:"",matomoAnalyticsUrl:"",viewerIsIndexable:!1,otherIssues:null,viewerShowDownload:!1,sendWarningBeforeDeleteAt:null,viewerViewCounter:0,viewerSpecificLogo:"",viewerSpecificLogoLink:"",collaboratorCount:0,pageCount:0,bonusNbCollaborators:0,activeOffer:null,offers:[],userPermissions:[],recursiveActiveOffer:null,magazineFrom:null,language:null,aiTranslate:null,redactorGlobalsVariables:[],displayVariablesNames:[]},magazineDeletedPages:null,template:{_id:null,name:"",displayName:"",description:"",owner:null,workspace:null,issue:"",version:1,isPrivate:!1,published:null,status:"New",deleted:!1,tags:[],category:"",format:null,themeList:[],theme:null,themeExtended:null,isTemplate:!1,template:null,pageOrder:[],thumb:"",collaboration:null,library:null,settings:null,lastVisualChangeAt:null,exportedPdfs:null,googleAnalyticsId:"",matomoAnalyticsId:"",matomoAnalyticsUrl:"",viewerIsIndexable:!1,otherIssues:null,viewerShowDownload:!1,sendWarningBeforeDeleteAt:null,viewerViewCounter:0,viewerSpecificLogo:"",viewerSpecificLogoLink:"",collaboratorCount:0,pageCount:0,bonusNbCollaborators:0,activeOffer:null,offers:[],userPermissions:[],recursiveActiveOffer:null,magazineFrom:null,language:null,aiTranslate:null,redactorGlobalsVariables:[],displayVariablesNames:[]},userMagazines:null,organizationMagazines:null,templateMagazines:null,templateMagazinesCount:0,clientMagazines:null,clientMagazinesCount:0,pdfStatus:{id:null,version:"",startAt:0,pdfProgressState:""},existingMagazinesLanguage:null})},UPDATE_CURRENT_PAGE_ORDER:function(e,t){var n=t.pageId,r=t.value,o=e.magazine.pageOrder.findIndex((function(e){return e._id===n}));o>=0&&(e.magazine.pageOrder[o]=Object.assign(e.magazine.pageOrder[o],r))},SET_CLIENT_MAGAZINES_COUNT:function(e,t){var n=t.count;e.clientMagazinesCount=n}
1,SET_TEMPLATE_MAGAZINES_COUNT:function(e,t){var n=t.count;e.templateMagazinesCount=n},RESET_PDF_STATUS_STATE:function(e){e.pdfStatus=Object.assign({},{id:null,version:"",startAt:0,pdfProgressState:""})}},F={namespaced:!0,state:M,getters:{getDefaultMagazine:function(e){return{_id:null,name:"",displayName:"",description:"",owner:null,workspace:null,issue:"",version:1,isPrivate:!1,published:null,status:"New",deleted:!1,tags:[],category:"",format:null,themeList:[],theme:null,themeExtended:null,isTemplate:!1,template:null,pageOrder:[],thumb:"",collaboration:null,library:null,settings:null,lastVisualChangeAt:null,exportedPdfs:null,googleAnalyticsId:"",matomoAnalyticsId:"",matomoAnalyticsUrl:"",viewerIsIndexable:!1,otherIssues:null,viewerShowDownload:!1,sendWarningBeforeDeleteAt:null,viewerViewCounter:0,viewerSpecificLogo:"",viewerSpecificLogoLink:"",collaboratorCount:0,pageCount:0,bonusNbCollaborators:0,activeOffer:null,offers:[],userPermissions:[],recursiveActiveOffer:null,magazineFrom:null,language:null,aiTranslate:null,redactorGlobalsVariables:[],displayVariablesNames:[]}},getDraftUserMagazines:function(e){return null===e.userMagazines?[]:e.userMagazines.filter((function(e){return null===e.published})).sort((function(a,b){return a.lastVisualChangeAt<b.lastVisualChangeAt?1:a.lastVisualChangeAt>b.lastVisualChangeAt?-1:0}))},getPublishUserMagazines:function(e){return null===e.userMagazines?[]:e.userMagazines.filter((function(e){return null!==e.published})).sort((function(a,b){return a.published<b.published?1:a.published>b.published?-1:0}))},getCollaborationUserMagazines:function(e){return null===e.userMagazines?[]:e.userMagazines.filter((function(e){return null===e.published&&e.collaboration})).sort((function(a,b){return a.lastVisualChangeAt<b.lastVisualChangeAt?1:a.lastVisualChangeAt>b.lastVisualChangeAt?-1:0}))},checkMagazinePerm:function(e){return function(t){return e.magazine&&e.magazine.userPermissions&&e.magazine.userPermissions.indexOf(t)>=0}},checkMagazinePermLimit:function(e){return function(t,n){var r=e.magazine.userPermissions.find((function(e){return e&&0===e.indexOf(t)})),o=r?parseInt(r.split(":")[2]):0;return!(-1!==o&&n>o)}},magazinePages:function(e,t){if(null===e.magazine._id||!e.magazine.pageOrder)return[];var n=0;return Object(l.a)(e.magazine.pageOrder).reduce((function(e,t,r){return t.double&&n%2==0&&(n++,t.missingPreviousPage=!0),e.push(t),n+=t.double?2:1,e}),[])},pageIndexMap:function(e,t){var n=1;return t.magazinePages.reduce((function(e,t){return t.isEmpty&&!t.isMissing||(e[t._id]=t.double?n+"-"+(n+1):"".concat(n),n+=t.double?2:1),e}),{})},pageNameMap:function(e,t){var n=1;return t.magazinePages.reduce((function(e,t){if(!t.isEmpty||t.isMissing){var r=t.double?n+"-"+(n+1):"".concat(n);t.name&&t.name.length>0?(e[t._id]=r+" - "+t.name,t.double&&(e[t._id+"_left"]=n+" - "+t.name+" (left)",e[t._id+"_right"]=n+1+" - "+t.name+" (right)")):t.double?(e[t._id]=r,e[t._id+"_left"]=n+" (left)",e[t._id+"_right"]=n+1+" (right)"):e[t._id]=r,n+=t.double?2:1}return e}),{})}},actions:{LOAD_MAGAZINE:(j=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l,c,d,f,m,y,v=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.magazineId,o=n.loadType,l=n.incrementNbView,c=n.forceReload,d=n.includeIntl,console.log("LOAD_MAGAZINE "+r+" - "+o),o&&"current"==o&&(c=!0,o=t.state.magazineLoadType),f=o&&["client","public"].indexOf(o)>=0?o:"",r===t.state.magazine._id&&f===t.state.magazineLoadType){e.next=8;break}this.commit("magazine/RESET_MAGAZINE"),e.next=11;break;case 8:if(c){e.next=11;break}return console.log("LOAD_MAGAZINE already in state "+r+" - "+o),e.abrupt("return",Promise.resolve(!0));case 11:return m="/api/v1/magazine/","client"===f?m="/api/v1/magazine/client/show/":"public"===f&&(m="/api/v1/magazine/public/show/"),m+=h.a.normalizePayloadURI(r,"magazineId"),y=[],d&&y.push("includeIntl=1"),l&&y.push("incrementNbView=1"),y.length>0&&(m+="?"+y.join("&")),e.abrupt("return",this.$axios.get(m).then((function(e){return e.data})).then((function(e){return v.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineLoadType",value:f}),v.commit("magazine/UPDATE_FIELD",{key:"name",value:e.name}),v.commit("magazine/UPDATE_FIELD",{key:"displayName",value:e.displayName}),v.commit("magazine/UPDATE_FIELD",{key:"description",value:e.description}),v.commit("magazine/UPDATE_FIELD",{key:"owner",value:e.owner}),v.commit("magazine/UPDATE_FIELD",{key:"workspace",value:e.workspace}),v.commit("magazine/UPDATE_FIELD",{key:"issue",value:e.issue}),v.commit("magazine/UPDATE_FIELD",{key:"version",value:e.version}),v.commit("magazine/UPDATE_FIELD",{key:"isPrivate",value:e.isPrivate}),v.commit("magazine/UPDATE_FIELD",{key:"published",value:e.published}),v.commit("magazine/UPDATE_FIELD",{key:"status",value:e.status}),v.commit("magazine/UPDATE_FIELD",{key:"deleted",value:e.deleted}),v.commit("magazine/UPDATE_FIELD",{key:"tags",value:e.tags}),v.commit("magazine/UPDATE_FIELD",{key:"category",value:e.category}),v.commit("magazine/UPDATE_FIELD",{key:"format",value:e.format}),v.commit("magazine/UPDATE_FIELD",{key:"themeList",value:e.themeList}),v.commit("magazine/UPDATE_FIELD",{key:"theme",value:e.theme}),v.commit("magazine/UPDATE_FIELD",{key:"themeExtended",value:e.themeExtended}),v.commit("magazine/UPDATE_FIELD",{key:"isTemplate",value:e.isTemplate}),v.commit("magazine/UPDATE_FIELD",{key:"template",value:e.template}),v.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),v.commit("magazine/UPDATE_FIELD",{key:"thumb",value:e.thumb}
1),v.commit("magazine/UPDATE_FIELD",{key:"collaboration",value:e.collaboration}),v.commit("magazine/UPDATE_FIELD",{key:"library",value:e.library}),v.commit("magazine/UPDATE_FIELD",{key:"settings",value:e.settings}),v.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),v.commit("magazine/UPDATE_FIELD",{key:"exportedPdfs",value:e.exportedPdfs}),v.commit("magazine/UPDATE_FIELD",{key:"googleAnalyticsId",value:e.googleAnalyticsId}),v.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsId",value:e.matomoAnalyticsId}),v.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsUrl",value:e.matomoAnalyticsUrl}),v.commit("magazine/UPDATE_FIELD",{key:"viewerIsIndexable",value:e.viewerIsIndexable}),v.commit("magazine/UPDATE_FIELD",{key:"otherIssues",value:e.otherIssues}),v.commit("magazine/UPDATE_FIELD",{key:"viewerShowDownload",value:e.viewerShowDownload}),v.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:e.sendWarningBeforeDeleteAt}),v.commit("magazine/UPDATE_FIELD",{key:"viewerViewCounter",value:e.viewerViewCounter}),v.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogo",value:e.viewerSpecificLogo}),v.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogoLink",value:e.viewerSpecificLogoLink}),v.commit("magazine/UPDATE_FIELD",{key:"collaboratorCount",value:e.collaboratorCount}),v.commit("magazine/UPDATE_FIELD",{key:"bonusNbCollaborators",value:e.bonusNbCollaborators}),v.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:e.pageCount}),v.commit("magazine/UPDATE_FIELD",{key:"createdAt",value:e.createdAt}),v.commit("magazine/UPDATE_FIELD",{key:"updatedAt",value:e.updatedAt}),v.commit("magazine/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),v.commit("magazine/UPDATE_FIELD",{key:"offers",value:e.offers}),v.commit("magazine/UPDATE_FIELD",{key:"userPermissions",value:e.userPermissions}),v.commit("magazine/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),v.commit("magazine/UPDATE_FIELD",{key:"magazineFrom",value:e.magazineFrom}),v.commit("magazine/UPDATE_FIELD",{key:"language",value:e.language}),v.commit("magazine/UPDATE_FIELD",{key:"aiTranslate",value:e.aiTranslate}),v.commit("magazine/UPDATE_FIELD",{key:"redactorGlobalsVariables",value:e.redactorGlobalsVariables}),v.commit("magazine/UPDATE_FIELD",{key:"displayVariablesNames",value:e.displayVariablesNames}),v.commit("magazine/UPDATE_FIELD",{key:"_id",value:e._id}),v.dispatch("api/API_SUCCESS",{type:"info",message:"magazine is loaded"}),!0}),(function(e){return v.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)}),SAVE_TEMPLATE_MAGAZINE:function(e,t){var n=this,r=null===e.state.magazine._id?"post":"put",o=null===e.state.magazine._id?"":e.state.magazine._id;return this.$axios[r]("/api/v1/magazine/template/"+o,e.state.magazine).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("magazine/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("magazine/UPDATE_FIELD",{key:"displayName",value:e.displayName}),n.commit("magazine/UPDATE_FIELD",{key:"description",value:e.description}),n.commit("magazine/UPDATE_FIELD",{key:"owner",value:e.owner}),n.commit("magazine/UPDATE_FIELD",{key:"workspace",value:e.workspace}),n.commit("magazine/UPDATE_FIELD",{key:"issue",value:e.issue}),n.commit("magazine/UPDATE_FIELD",{key:"isPrivate",value:e.isPrivate}),n.commit("magazine/UPDATE_FIELD",{key:"version",value:e.version}),n.commit("magazine/UPDATE_FIELD",{key:"published",value:e.published}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("magazine/UPDATE_FIELD",{key:"deleted",value:e.deleted}),n.commit("magazine/UPDATE_FIELD",{key:"tags",value:e.tags}),n.commit("magazine/UPDATE_FIELD",{key:"category",value:e.category}),n.commit("magazine/UPDATE_FIELD",{key:"format",value:e.format}),n.commit("magazine/UPDATE_FIELD",{key:"themeList",value:e.themeList}),n.commit("magazine/UPDATE_FIELD",{key:"theme",value:e.theme}),n.commit("magazine/UPDATE_FIELD",{key:"themeExtended",value:e.themeExtended}),n.commit("magazine/UPDATE_FIELD",{key:"isTemplate",value:e.isTemplate}),n.commit("magazine/UPDATE_FIELD",{key:"template",value:e.template}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"library",value:e.library}),n.commit("magazine/UPDATE_FIELD",{key:"thumb",value:e.thumb}
1),n.commit("magazine/UPDATE_FIELD",{key:"collaboration",value:e.collaboration}),n.commit("magazine/UPDATE_FIELD",{key:"settings",value:e.settings}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"exportedPdfs",value:e.exportedPdfs}),n.commit("magazine/UPDATE_FIELD",{key:"googleAnalyticsId",value:e.googleAnalyticsId}),n.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsId",value:e.matomoAnalyticsId}),n.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsUrl",value:e.matomoAnalyticsUrl}),n.commit("magazine/UPDATE_FIELD",{key:"viewerIsIndexable",value:e.viewerIsIndexable}),n.commit("magazine/UPDATE_FIELD",{key:"otherIssues",value:e.otherIssues}),n.commit("magazine/UPDATE_FIELD",{key:"viewerShowDownload",value:e.viewerShowDownload}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:e.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_FIELD",{key:"viewerViewCounter",value:e.viewerViewCounter}),n.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogo",value:e.viewerSpecificLogo}),n.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogoLink",value:e.viewerSpecificLogoLink}),n.commit("magazine/UPDATE_FIELD",{key:"collaboratorCount",value:e.collaboratorCount}),n.commit("magazine/UPDATE_FIELD",{key:"bonusNbCollaborators",value:e.bonusNbCollaborators}),n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:e.pageCount}),n.commit("magazine/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),n.commit("magazine/UPDATE_FIELD",{key:"userPermissions",value:e.userPermissions}),n.commit("magazine/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),n.commit("magazine/UPDATE_FIELD",{key:"magazineFrom",value:e.magazineFrom}),n.commit("magazine/UPDATE_FIELD",{key:"language",value:e.language}),n.commit("magazine/UPDATE_FIELD",{key:"aiTranslate",value:e.aiTranslate}),n.commit("magazine/UPDATE_FIELD",{key:"redactorGlobalsVariables",value:e.redactorGlobalsVariables}),n.commit("magazine/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("magazine/UPDATE_FIELD",{key:"displayVariablesNames",value:e.displayVariablesNames}),0===o.length?n.commit("magazine/ADD_MAGAZINE",{magazine:e}):n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),o.length>0&&n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:o,loadType:"current"}),!1}))},CREATE_MAGAZINE:function(e,t){var n=this;return this.$axios.post("/api/v1/magazine/",t).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("magazine/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("magazine/UPDATE_FIELD",{key:"displayName",value:e.displayName}),n.commit("magazine/UPDATE_FIELD",{key:"description",value:e.description}),n.commit("magazine/UPDATE_FIELD",{key:"owner",value:e.owner}),n.commit("magazine/UPDATE_FIELD",{key:"workspace",value:e.workspace}),n.commit("magazine/UPDATE_FIELD",{key:"issue",value:e.issue}),n.commit("magazine/UPDATE_FIELD",{key:"isPrivate",value:e.isPrivate}),n.commit("magazine/UPDATE_FIELD",{key:"version",value:e.version}),n.commit("magazine/UPDATE_FIELD",{key:"published",value:e.published}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("magazine/UPDATE_FIELD",{key:"deleted",value:e.deleted}),n.commit("magazine/UPDATE_FIELD",{key:"tags",value:e.tags}),n.commit("magazine/UPDATE_FIELD",{key:"category",value:e.category}),n.commit("magazine/UPDATE_FIELD",{key:"format",value:e.format}),n.commit("magazine/UPDATE_FIELD",{key:"themeList",value:e.themeList}),n.commit("magazine/UPDATE_FIELD",{key:"theme",value:e.theme}),n.commit("magazine/UPDATE_FIELD",{key:"themeExtended",value:e.themeExtended}),n.commit("magazine/UPDATE_FIELD",{key:"isTemplate",value:e.isTemplate}),n.commit("magazine/UPDATE_FIELD",{key:"template",value:e.template}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"library",value:e.library}),n.commit("magazine/UPDATE_FIELD",{key:"thumb",value:e.thumb}
1),n.commit("magazine/UPDATE_FIELD",{key:"collaboration",value:e.collaboration}),n.commit("magazine/UPDATE_FIELD",{key:"settings",value:e.settings}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"exportedPdfs",value:e.exportedPdfs}),n.commit("magazine/UPDATE_FIELD",{key:"googleAnalyticsId",value:e.googleAnalyticsId}),n.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsId",value:e.matomoAnalyticsId}),n.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsUrl",value:e.matomoAnalyticsUrl}),n.commit("magazine/UPDATE_FIELD",{key:"viewerIsIndexable",value:e.viewerIsIndexable}),n.commit("magazine/UPDATE_FIELD",{key:"otherIssues",value:e.otherIssues}),n.commit("magazine/UPDATE_FIELD",{key:"viewerShowDownload",value:e.viewerShowDownload}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:e.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_FIELD",{key:"viewerViewCounter",value:e.viewerViewCounter}),n.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogo",value:e.viewerSpecificLogo}),n.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogoLink",value:e.viewerSpecificLogoLink}),n.commit("magazine/UPDATE_FIELD",{key:"collaboratorCount",value:e.collaboratorCount}),n.commit("magazine/UPDATE_FIELD",{key:"bonusNbCollaborators",value:e.bonusNbCollaborators}),n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:e.pageCount}),n.commit("magazine/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),n.commit("magazine/UPDATE_FIELD",{key:"userPermissions",value:e.userPermissions}),n.commit("magazine/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),n.commit("magazine/UPDATE_FIELD",{key:"magazineFrom",value:e.magazineFrom}),n.commit("magazine/UPDATE_FIELD",{key:"language",value:e.language}),n.commit("magazine/UPDATE_FIELD",{key:"aiTranslate",value:e.aiTranslate}),n.commit("magazine/UPDATE_FIELD",{key:"redactorGlobalsVariables",value:e.redactorGlobalsVariables}),n.commit("magazine/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("magazine/UPDATE_FIELD",{key:"displayVariablesNames",value:e.displayVariablesNames}),n.commit("magazine/ADD_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},SAVE_MAGAZINE:function(e,t){var n=this;return this.$axios.put("/api/v1/magazine/"+e.state.magazine._id,e.state.magazine).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("magazine/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("magazine/UPDATE_FIELD",{key:"displayName",value:e.displayName}),n.commit("magazine/UPDATE_FIELD",{key:"description",value:e.description}),n.commit("magazine/UPDATE_FIELD",{key:"owner",value:e.owner}),n.commit("magazine/UPDATE_FIELD",{key:"workspace",value:e.workspace}),n.commit("magazine/UPDATE_FIELD",{key:"issue",value:e.issue}),n.commit("magazine/UPDATE_FIELD",{key:"isPrivate",value:e.isPrivate}),n.commit("magazine/UPDATE_FIELD",{key:"version",value:e.version}),n.commit("magazine/UPDATE_FIELD",{key:"published",value:e.published}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("magazine/UPDATE_FIELD",{key:"deleted",value:e.deleted}),n.commit("magazine/UPDATE_FIELD",{key:"tags",value:e.tags}),n.commit("magazine/UPDATE_FIELD",{key:"category",value:e.category}),n.commit("magazine/UPDATE_FIELD",{key:"format",value:e.format}),n.commit("magazine/UPDATE_FIELD",{key:"themeList",value:e.themeList}),n.commit("magazine/UPDATE_FIELD",{key:"theme",value:e.theme}),n.commit("magazine/UPDATE_FIELD",{key:"themeExtended",value:e.themeExtended}),n.commit("magazine/UPDATE_FIELD",{key:"isTemplate",value:e.isTemplate}),n.commit("magazine/UPDATE_FIELD",{key:"template",value:e.template}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"library",value:e.library}),n.commit("magazine/UPDATE_FIELD",{key:"thumb",value:e.thumb}
1),n.commit("magazine/UPDATE_FIELD",{key:"collaboration",value:e.collaboration}),n.commit("magazine/UPDATE_FIELD",{key:"settings",value:e.settings}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"exportedPdfs",value:e.exportedPdfs}),n.commit("magazine/UPDATE_FIELD",{key:"googleAnalyticsId",value:e.googleAnalyticsId}),n.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsId",value:e.matomoAnalyticsId}),n.commit("magazine/UPDATE_FIELD",{key:"matomoAnalyticsUrl",value:e.matomoAnalyticsUrl}),n.commit("magazine/UPDATE_FIELD",{key:"viewerIsIndexable",value:e.viewerIsIndexable}),n.commit("magazine/UPDATE_FIELD",{key:"otherIssues",value:e.otherIssues}),n.commit("magazine/UPDATE_FIELD",{key:"viewerShowDownload",value:e.viewerShowDownload}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:e.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_FIELD",{key:"viewerViewCounter",value:e.viewerViewCounter}),n.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogo",value:e.viewerSpecificLogo}),n.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogoLink",value:e.viewerSpecificLogoLink}),n.commit("magazine/UPDATE_FIELD",{key:"collaboratorCount",value:e.collaboratorCount}),n.commit("magazine/UPDATE_FIELD",{key:"bonusNbCollaborators",value:e.bonusNbCollaborators}),n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:e.pageCount}),n.commit("magazine/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),n.commit("magazine/UPDATE_FIELD",{key:"userPermissions",value:e.userPermissions}),n.commit("magazine/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),n.commit("magazine/UPDATE_FIELD",{key:"magazineFrom",value:e.magazineFrom}),n.commit("magazine/UPDATE_FIELD",{key:"language",value:e.language}),n.commit("magazine/UPDATE_FIELD",{key:"aiTranslate",value:e.aiTranslate}),n.commit("magazine/UPDATE_FIELD",{key:"redactorGlobalsVariables",value:e.redactorGlobalsVariables}),n.commit("magazine/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("magazine/UPDATE_FIELD",{key:"displayVariablesNames",value:e.displayVariablesNames}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine is saved"}),!0}),(function(t){return n.dispatch("api/API_ERROR",t.response?t.response.data:t),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:e.state.magazine._id,loadType:"current"}),!1}))},SAVE_MAGAZINE_OFFER:function(e,t){var n=this;return this.$axios.put("/api/v1/magazine/offer/"+e.state.magazine._id,t).then((function(e){return e.data})).then((function(e){return e.checkout?{checkout:e.checkout}:(n.commit("magazine/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine offer is saved"}),!0)}),(function(t){return n.dispatch("api/API_ERROR",t.response?t.response.data:t),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:e.state.magazine._id,loadType:"current"}),!1}))},SAVE_MAGAZINE_FLATPLAN:function(e,t){var n=this;return this.$axios.put("/api/v1/magazine/flatplan/"+e.state.magazine._id,{pageOrder:e.state.magazine.pageOrder}).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"exportedPdfs",value:e.exportedPdfs}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.magazine.flatplanIsSaved"}),!0}),(function(t){return console.log("SAVE_MAGAZINE_FLATPLAN error"),n.dispatch("api/API_ERROR",t.response?t.response.data:t),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:e.state.magazine._id,loadType:"current"}),!1}))},DUPLICATE_MAGAZINE:function(e,t){var n=this;return this.$axios.post("/api/v1/magazine/duplicateMagazine/"+t.id,t).then((function(e){return e.data})).then((function(e){var t=e.newMagazineId;return n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine is duplicated"}),t}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DUPLICATE_TEMPLATE:function(e,t){var n=this;
1return this.$axios.post("/api/v1/magazine/duplicateTemplate/"+t.id).then((function(e){return e.data})).then((function(e){var t=e.newTemplateId;return n.dispatch("api/API_SUCCESS",{type:"info",message:"template is duplicated"}),t}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),updateId.length>0&&n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:updateId,loadType:"current"}),!1}))},CHANGE_OWNER_MAGAZINE:function(e,t){var n=this,r=t.ownerId,o=null===e.state.magazine._id?"":e.state.magazine._id;return this.$axios.put("/api/v1/magazine/owner/"+o,{owner:r}).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"owner",value:e.owner}),n.commit("magazine/UPDATE_FIELD",{key:"workspace",value:e.workspace}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),o.length>0&&n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:o,loadType:"current"}),!1}))},DELETE_MAGAZINE:function(e,t){var n=this,r=t.id||e.state.magazine._id;return this.$axios.delete("/api/v1/magazine/"+r).then((function(e){return e.data})).then((function(e){return n.commit("magazine/REMOVE_MAGAZINE",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been deleted"}),n.commit("magazine/RESET_MAGAZINE"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},RESET_ALL_MAGAZINE_DEPENDENCY:function(e){console.log("RESET_ALL_MAGAZINE_DEPENDENCY"),this.commit("theme/RESET_THEME"),this.commit("library/RESET_LIBRARY"),this.commit("palette/RESET_PALETTE"),this.commit("magazine/RESET_MAGAZINE"),this.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineDeletedPages",value:null}),this.commit("collaboration/RESET_STATE"),this.commit("order/RESET_PRINT_QUOTE"),this.commit("fabric/RESET_STATE")},LOAD_MAGAZINE_FOR_EDITING:(L=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,l,c,d=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,l=n.paletteId,c=n.resetStore,this.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineForEditingLoadComplete",value:!1}),console.log("LOAD_MAGAZINE_FOR_EDITING / resetstore:"+c+" / previousMag "+t.state.magazine._id+" / currentMag "+r),(c||t.state.magazine._id!==r)&&this.dispatch("magazine/RESET_ALL_MAGAZINE_DEPENDENCY"),e.abrupt("return",new Promise((function(e,n){d.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r}).then(function(){var c=Object(o.a)(regeneratorRuntime.mark((function o(c){return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(console.log("LOAD_MAGAZINE_FOR_EDITING / LOAD_MAGAZINE success:"+c),c){o.next=4;break}return n(),o.abrupt("return");case 4:if(null===t.state.magazineDeletedPages&&d.dispatch("magazine/LOAD_MAGAZINE_DELETED_PAGES",{magazineId:r}),d.dispatch("pagecomment/LOAD_COMMENTS_BY_PAGE",{magazineId:r}),!t.state.magazine.collaboration){o.next=11;break}return o.next=9,d.dispatch("collaboration/LOAD_COLLABORATION",t.state.magazine.collaboration);case 9:o.next=12;break;case 11:d.commit("collaboration/RESET_STATE");case 12:return o.next=14,d.dispatch("magazine/LOAD_TEMPLATE",t.state.magazine.template);case 14:return o.next=16,d.dispatch("theme/LOAD_THEME",t.state.magazine.theme);case 16:return o.next=18,d.dispatch("palette/LOAD_THEME_PALETTES",t.rootState.theme.theme._id);case 18:d.commit("palette/SET_CURRENT_PALETTE",l||t.rootState.theme.theme.paletteList[0]._id),d.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineForEditingLoadComplete",value:!0}),e();case 21:case"end":return o.stop()}}),o)})));return function(e){return c.apply(this,arguments)}}())})));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)}),LOAD_TEMPLATE_MAGAZINE_FOR_EDITING:(z=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,l,c,d,h=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,l=n.paletteId,c=n.resetStore,d=[],this.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineForEditingLoadComplete",value:!1}),console.log("LOAD_TEMPLATE_MAGAZINE_FOR_EDITING / resetstore:"+c+" / previousMag "+t.state.magazine._id+" / currentMag "+r),(c||t.state.magazine._id!==r)&&this.dispatch("magazine/RESET_ALL_MAGAZINE_DEPENDENCY"),d.push(new Promise((function(e,n){h.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r,includeIntl:!0}).then(function(){var r=Object(o.a)(regeneratorRuntime.mark((function r(o){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o){r.next=3;break}return n(),r.abrupt("return");case 3:return r.next=5,h.dispatch("theme/LOAD_THEME",t.state.magazine.theme);case 5:return r.next=7,h.dispatch("palette/LOAD_THEME_PALETTES",t.rootState.theme.theme._id);case 7:h.commit("palette/SET_CURRENT_PALETTE",l||t.rootState.theme.theme.paletteList[0]._id),h.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineForEditingLoadComplete",value:!0}),e();case 10:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}))),null===t.state.magazineDeletedPages&&this.dispatch("magazine/LOAD_MAGAZINE_DELETED_PAGES",{magazineId:r}),e.abrupt("return",Promise.all(d));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)}),LOAD_MAGAZINE_DELETED_PAGES:(R=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,o={magazine:r,deleted:!0}
1,e.abrupt("return",this.$axios.get("/api/v1/page?filter="+JSON.stringify(o)).then((function(e){return e.data})).then((function(e){var t=e.pages;return l.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineDeletedPages",value:t}),l.dispatch("api/API_SUCCESS",{type:"info",message:"MAGAZINE DELETED PAGES are loaded"}),!0}),(function(e){return l.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)}),LOAD_USER_MAGAZINES:(w=Object(o.a)(regeneratorRuntime.mark((function e(t){var n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={deleted:!1,isTemplate:!1},e.abrupt("return",this.$axios.get("/api/v1/magazine?filter="+JSON.stringify(n)).then((function(e){return e.data})).then((function(e){return r.commit("magazine/UPDATE_ROOT_FIELD",{key:"userMagazines",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"USER MAGAZINES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)}),LOAD_ORGANIZATION_MAGAZINES:(I=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n&&n.organizationId?n.organizationId:t.rootGetters["api/getCurrentOrganizationId"]){e.next=4;break}return this.commit("magazine/UPDATE_ROOT_FIELD",{key:"organizationMagazines",value:magazines}),e.abrupt("return",Promise.reject("no current organization id"));case 4:return o={deleted:!1,isTemplate:!1,organization:r},e.abrupt("return",this.$axios.get("/api/v1/magazine?filter="+JSON.stringify(o)).then((function(e){return e.data})).then((function(e){return l.commit("magazine/UPDATE_ROOT_FIELD",{key:"organizationMagazines",value:e}),l.dispatch("api/API_SUCCESS",{type:"info",message:"ORGANIZATION MAGAZINES are loaded"}),!0}),(function(e){return l.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)}),LOAD_TEMPLATE:(D=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n&&"object"===Object(r.a)(n)&&n._id?n._id:n){e.next=4;break}return this.commit("magazine/RESET_TEMPLATE"),e.abrupt("return",Promise.resolve(!0));case 4:if(o!==t.state.template._id){e.next=6;break}return e.abrupt("return",Promise.resolve(!0));case 6:return e.abrupt("return",this.$axios.get("/api/v1/magazine/"+o+"?isTemplate=true").then((function(e){return e.data})).then((function(template){return l.commit("magazine/UPDATE_ROOT_FIELD",{key:"template",value:template}),l.dispatch("api/API_SUCCESS",{type:"info",message:"TEMPLATE are loaded"}),!0}),(function(e){return l.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)}),LOAD_LAST_TEMPLATE:(x=Object(o.a)(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/magazine/last?isTemplate=true").then((function(e){return e.data})).then((function(template){return n.commit("magazine/UPDATE_ROOT_FIELD",{key:"template",value:template}),n.dispatch("api/API_SUCCESS",{type:"info",message:"TEMPLATE are loaded"}),!0}),(function(e){return!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)}),SOFTDELETE_MAGAZINE:function(e,t){var n=this,r=t.id||e.state.magazine._id;return this.$axios.put("/api/v1/magazine/"+r+"/softDelete",{deleted:!0}).then((function(e){return e.data})).then((function(e){return n.commit("magazine/REMOVE_MAGAZINE",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been deleted"}),n.commit("magazine/RESET_MAGAZINE"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},UPDATE_CLIENT_MAGAZINE:function(e,t){var n=this;return this.$axios.put("/api/v1/magazine/clientUpdate/"+e.state.magazine._id,t).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"category",value:e.category}),n.commit("magazine/UPDATE_FIELD",{key:"viewerIsIndexable",value:e.viewerIsIndexable}),n.commit("magazine/UPDATE_FIELD",{key:"bonusNbCollaborators",value:e.bonusNbCollaborators}),n.commit("magazine/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),n.commit("magazine/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("magazine/UPDATE_FIELD",{key:"language",value:e.language}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},SET_DELETED_CLIENT_MAGAZINE:function(e,t){var n=this,r=t.id||e.state.magazine._id;return this.$axios.put("/api/v1/magazine/clientSetDeleted/"+r,{deleted:t.deleted}).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"deleted",value:e.deleted}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},ADD_EMPTY_PAGE:function(e,t){var n=this,r=e.state.magazine._id;return this.$axios.post("/api/v1/magazine/"+r+"/addEmptyPage/",{double:t.double,index:t.index}).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:e.page
1Count}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:e.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r,loadType:"current"}),!1}))},ADD_PAGES_FROM_TEMPLATE:function(e,t){var n=this,r=t.id||e.state.magazine._id;return this.$axios.post("/api/v1/magazine/"+r+"/addFromTemplate/",{pages:t.pages,index:t.index}).then((function(e){return e.data})).then((function(e){var t=e.magazine;return n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:t.pageCount}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:t.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"thumb",value:t.thumb}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:t.status}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:t.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:t.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:t}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r,loadType:"current"}),!1}))},REMOVE_PAGES:function(e,t){var n=this,r=e.state.magazine._id;return this.$axios.post("/api/v1/magazine/"+r+"/removePages/",{pageIds:t.pageIds}).then((function(e){return e.data})).then((function(r){return t.pageIds.forEach((function(t){var r=Object.assign({},e.state.magazine.pageOrder.find((function(e){return e._id==t})));r.deleted=!0,n.commit("magazine/UPDATE_ROOT_ARRAY",{key:"magazineDeletedPages",value:r})})),n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:r.pageCount}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:r.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:r.status}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:r.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:r.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:r}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r,loadType:"current"}),!1}))},HARD_DELETE_PAGES:function(e,t){var n=this,r=e.state.magazine._id,o=t.pageIds,c=null,d=Object(l.a)(e.state.magazineDeletedPages),h=!1;t.pageIds.forEach((function(e){n.commit("magazine/UPDATE_ROOT_ARRAY",{key:"magazineDeletedPages",cb:function(t){return t._id==e},delete:!0})}));var f=function(){h=!0,n.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineDeletedPages",value:d}),c&&c.close()},m=this._vm.$createElement;c=this._vm.$message({message:m("p",{class:"el-message__content el-message__content-with-action"},[m("span",null,this.app.i18n.t("public.edit_magazine.hardDeletePage.success")),m("button",{class:"el-button el-button--text",on:{click:f}},this.app.i18n.t("public.edit_magazine.hardDeletePage.cancel"))]),type:"info",showClose:!1,duration:4e3,onClose:function(){h||n.$axios.post("/api/v1/magazine/"+r+"/hardDeletePages/",{pageIds:o}).then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),f(),!1}))}})},COPY_PAGES:function(e,t){var n=this,r=e.state.magazine._id;return this.$axios.post("/api/v1/magazine/"+r+"/copyPages/",t).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:e.pageCount}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:e.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r,loadType:"current"}),!1}))},RESTORE_PAGES:function(e,t){var n=this,r=e.state.magazine._id;return this.$axios.post("/api/v1/magazine/"+r+"/restorePages/",{pageIds:t.pageIds}).then((function(e){return e.data})).then((function(e){return t.pageIds.forEach((function(e){n.commit("magazine/UPDATE_ROOT_ARRAY",{key:"magazineDeletedPages",cb:function(t){return t._id==e},delete:!0})}
1)),n.commit("magazine/UPDATE_FIELD",{key:"pageCount",value:e.pageCount}),n.commit("magazine/UPDATE_FIELD",{key:"pageOrder",value:e.pageOrder}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:e.lastVisualChangeAt}),n.commit("magazine/UPDATE_FIELD",{key:"sendWarningBeforeDeleteAt",value:e.sendWarningBeforeDeleteAt}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine has been updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r,loadType:"current"}),!1}))},LOAD_CREATE_FROM_TEMPLATE_MAGAZINES:(C=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/magazine/template/listCreateFrom").then((function(e){return e.data})).then((function(e){return r.commit("magazine/UPDATE_ROOT_FIELD",{key:"templateMagazines",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"TEMPLATE MAGAZINES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)}),LOAD_TEMPLATE_MAGAZINES:(P=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign({deleted:!1,isTemplate:!0},n.filter),e.abrupt("return",this.$axios.get("/api/v1/magazine/template/list?filter="+JSON.stringify(r)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return o.commit("magazine/UPDATE_ROOT_FIELD",{key:"templateMagazines",value:e}),o.dispatch("api/API_SUCCESS",{type:"info",message:"TEMPLATE MAGAZINES are loaded"}),!0}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)}),COUNT_TEMPLATE_MAGAZINES:(T=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign({deleted:!1,isTemplate:!0},n.filter),e.abrupt("return",this.$axios.get("/api/v1/magazine/template/count?filter="+JSON.stringify(r)).then((function(e){return e.data})).then((function(e){return o.commit("magazine/SET_TEMPLATE_MAGAZINES_COUNT",{count:e}),o.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT TEMPLATE MAGAZINES are loaded"}),!0}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)}),LOAD_CLIENT_MAGAZINES:(A=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/magazine/client/list?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("magazine/UPDATE_ROOT_FIELD",{key:"clientMagazines",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"MAGAZINES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)}),COUNT_CLIENT_MAGAZINES:(S=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/magazine/client/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("magazine/SET_CLIENT_MAGAZINES_COUNT",{count:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT CLIENT MAGAZINES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)}),EXPORT_CLIENT_MAGAZINES:(k=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/magazine/client/export?filter="+JSON.stringify(n.filter)+"&sort="+n.sort).then((function(e){return e.data})).then((function(data){var e="data:text/csv;charset=utf-8,"+data,link=document.createElement("a");return link.setAttribute("href",encodeURI(e)),link.setAttribute("download","magazines.csv"),link.click(),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)}),EXPORT_HPC_ZIP_TEST_ORDER:(E=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,o=n.version,e.abrupt("return",this.$axios.get("/api/v1/magazine/exportHpcZipTestOrder/"+r+"?version="+o).then((function(e){return e.data})).then((function(data){return l.dispatch("api/API_SUCCESS",data),!0}),(function(e){return l.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)}),REQUEST_EXPORT_MAGAZINE_PDF:(O=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l,c,d,h=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,o=n.version,l=n.forceCleanAll,c=n.isAdminRequest,d=n.forceGenerateWithInvalidPage,this.commit("magazine/RESET_PDF_STATUS_STATE"),e.abrupt("return",this.$axios.post("/api/v1/magazine/pdf/request",{magazineId:r,version:o,forceCleanAll:l,isAdminRequest:c,forceGenerateWithInvalidPage:d}).then((function(e){return e.data})).then((function(e){var t=e.magazine,n=e.pdfStatus;return h.commit("magazine/UPDATE_FIELD",{key:"exportedPdfs",value:t.exportedPdfs}),h.commit("magazine/UPDATE_ROOT_FIELD",{key:"pdfStatus",value:n}),!0}),(function(e){return e.response.data&&e.response.data.missingSvgs&&e.response.data.missingSvgs.length>0?{missingSvgs:e.response.data.missingSvgs}:(h.dispatch("api/API_ERROR",e.response?e.response.data:e),h.dispatch("magazine/LOAD_MAGAZINE",{magazineId:r,loadType:"current"}),!1)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)}),REQUEST_EXPORT_MAGAZINE_PDF_STATUS:(_=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,o=n.version,l=n.updateStore,e.abrupt("return",this.$axios.post("/api/v1/magazine/pdf/request/status",{magazineId:r,version:o}).then((function(e){return e.data})).then((function(e){var t=e.status;return l&&t&&c.commit("magazine/UPDATE_ROOT_FIELD",{key:"pdfStatus",value:t}),t}),(function(e){return e.response.data&&e.response.data.missingSvgs&&e.response.data.missingSvgs.length>0?{missingSvgs:e.response.data.missingSvgs}:(c.dispatch("api/API_ERROR",e.response?e.response.data:e),!1)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)}),PUBLISH_MAGAZINE:function(e,t){var n=this,r=t.magazineId,o=t.publish;this.commit("magazine/RESET_PDF_STATUS_STATE");var l=r||e.state.magazine._id;return this.$axios.put("/api/v1/magazine/"+l+"/publish",{publish:o}).then((function(e){return e.data})).then((function(e){var t=e.magazine,r=e.pdfStatus;return n.commit("magazine/UPDATE_FIELD",{key:"published",value:t.published}),n.commit("magazine/UPDATE_FIELD",{key:"status",value:t.status}
1),n.commit("magazine/UPDATE_FIELD",{key:"collaboration",value:t.collaboration}),n.commit("magazine/UPDATE_FIELD",{key:"exportedPdfs",value:t.exportedPdfs}),n.commit("magazine/UPDATE_FIELD",{key:"userPermissions",value:t.userPermissions}),n.commit("magazine/UPDATE_MAGAZINE",{magazine:t}),n.commit("collaboration/RESET_STATE"),n.commit("library/RESET_STATE"),n.commit("magazine/UPDATE_ROOT_FIELD",{key:"magazineDeletedPages",value:[]}),r&&n.commit("magazine/UPDATE_ROOT_FIELD",{key:"pdfStatus",value:r}),n.dispatch("api/API_SUCCESS",{type:"info",message:"magazine is saved"}),!0}),(function(e){return e.response.data&&e.response.data.missingSvgs&&e.response.data.missingSvgs.length>0?{missingSvgs:e.response.data.missingSvgs}:e.response.data&&e.response.data.invalidPages&&e.response.data.invalidPages.length>0?{invalidPages:e.response.data.invalidPages}:(n.dispatch("api/API_ERROR",e.response?e.response.data:e),n.dispatch("magazine/LOAD_MAGAZINE",{magazineId:l,loadType:"current"}),!1)}))},PROCEED_UPLOAD_VIEWER_LOGO:function(e,t){var n=this,r=t.file;if(r){var data=new FormData;return data.append("libraryID",e.state.magazine.library),data.append("image",r,r.name),this.$axios.post("/api/v1/magazine/uploadViewerLogo/"+e.state.magazine._id,data,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_FIELD",{key:"viewerSpecificLogo",value:e.viewerSpecificLogo}),!0})).catch((function(e){return n.dispatch("api/API_ERROR",e.response.data),!1}))}return!1},EXPORT_TEMPLATES:(v=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/magazine/template/exportList?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&rangeDate="+n.rangeDate).then((function(e){return e.data})).then((function(data){return r.dispatch("api/API_SUCCESS",data),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),LOAD_EXISTING_MAGAZINES_LANGUAGE:(y=Object(o.a)(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/magazine/client/language/list").then((function(e){return e.data})).then((function(e){return n.commit("magazine/UPDATE_ROOT_FIELD",{key:"existingMagazinesLanguage",value:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"MAGAZINES LANGUAGE are loaded"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},mutations:U};t.default=F},function(e,t,n){"use strict";n.r(t);n(19),n(16),n(35),n(13),n(11),n(26);var r=n(4),o=(n(7),n(28),n(3)),l=(n(47),n(30),n(1)),c=n(2),d=n(12),h=n(66);function f(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}l.default.use(c.a);var m,y,v,_,O,E=function(){return{library:{_id:null,magazine:null,images:[],shapes:[]},hasLoadedFullLibrary:!1,publicTemplateLibrary:{_id:null,magazine:null,images:[],shapes:[]},croppedImage:{_id:null,key:null,source:null,page:null,rect:{top:0,left:0,width:0,height:0},scale:1},imageUsedByPageList:[]}},k={UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;d.a.setProperty(n,e.library,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;d.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.library[t.key].findIndex(t.cb):e.library[t.key].indexOf(t.value);n>=0&&e.library[t.key].splice(n,1)}else e.library[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.library[t.key][t.from];e.library[t.key][t.from]=e.library[t.key][t.to],l.default.set(e.library[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_LIBRARY:function(e){e.library=Object.assign({},{_id:null,magazine:null,images:[],shapes:[]}),e.hasLoadedFullLibrary=!1,e.publicTemplateLibrary=Object.assign({},{_id:null,magazine:null,images:[],shapes:[]}),e.imageUsedByPageList=[]},RESET_CROPPED_IMAGE:function(e){e.croppedImage=Object.assign({}
1,{_id:null,key:null,source:null,page:null,rect:{top:0,left:0,width:0,height:0},scale:1})},RESET_STATE:function(e){Object.assign(e,{library:{_id:null,magazine:null,images:[],shapes:[]},hasLoadedFullLibrary:!1,publicTemplateLibrary:{_id:null,magazine:null,images:[],shapes:[]},croppedImage:{_id:null,key:null,source:null,page:null,rect:{top:0,left:0,width:0,height:0},scale:1},imageUsedByPageList:[]})},REMOVE_IMAGE:function(e,t){var n=e.library.images.findIndex((function(e){return e._id===t._id}));-1!=n&&(e.hasLoadedFullLibrary?l.default.set(e.library.images[n],"deleted",!0):e.library.images.splice(n,1))},REMOVE_SHAPE:function(e,t){var n=e.library.shapes.findIndex((function(e){return e._id===t._id}));-1!=n&&(e.hasLoadedFullLibrary?l.default.set(e.library.shapes[n],"deleted",!0):e.library.shapes.splice(n,1))},UPDATE_IMAGE:function(e,image){var t=e.library.images.findIndex((function(e){return e._id===image._id}));e.library.images.splice(t,1,image)},UPDATE_SHAPE:function(e,t){var n=e.library.shapes.findIndex((function(e){return e._id===t._id}));e.library.shapes.splice(n,1,t)}}
1,S={namespaced:!0,state:E,getters:{getExistingVariantGroups:function(e){return e.library.shapes.reduce((function(e,t){return t.variantGroup&&-1===e.indexOf(t.variantGroup)&&e.push(t.variantGroup),e}),[])},getImageUsedByPage:function(e){return function(t){return e.imageUsedByPageList.find((function(e){return e.image===t}))}}},actions:{LOAD_LIBRARY:(O=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.libraryId,o=n.full,l=void 0!==o&&o,this.commit("library/RESET_LIBRARY"),e.abrupt("return",this.$axios.get("/api/v1/library/"+r+(l?"?full=1":"")).then((function(e){return e.data})).then((function(e){return c.commit("library/UPDATE_ROOT_FIELD",{key:"hasLoadedFullLibrary",value:l}),c.commit("library/UPDATE_FIELD",{key:"magazine",value:e.magazine}),c.commit("library/UPDATE_FIELD",{key:"images",value:e.images}),c.commit("library/UPDATE_FIELD",{key:"shapes",value:e.shapes}),c.commit("library/UPDATE_FIELD",{key:"_id",value:e._id}),c.dispatch("api/API_SUCCESS",{type:"info",message:"library is loaded"}),!0}),(function(e){return c.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)}),LOAD_PUBLIC_TEMPLATE_LIBRARY:(_=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=n.templateId)!==t.state.publicTemplateLibrary.magazine){e.next=4;break}return console.log("LOAD_PUBLIC_TEMPLATE_LIBRARY already in state - "+r),e.abrupt("return",Promise.resolve(!0));case 4:return e.abrupt("return",this.$axios.get("/api/v1/library/public/"+r).then((function(e){return e.data})).then((function(e){return o.commit("library/UPDATE_ROOT_FIELD",{key:"publicTemplateLibrary",value:e}),o.dispatch("api/API_SUCCESS",{type:"info",message:"library is loaded"}),!0}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)}),UPDATE_IMAGE_INFOS:function(e,t){var n=this;if(t)return this.$axios.put("/api/v1/image/infos/"+t.id,function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?f(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):f(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({libraryId:e.state.library._id},t)).then((function(e){return e.data})).then((function(image){return n.commit("library/UPDATE_IMAGE",image),!0})).catch((function(e){return n.dispatch("api/API_ERROR",e.response.data),!1}))},UPDATE_SHAPE_INFOS:function(e,t){var n=this;if(t)return this.$axios.put("/api/v1/shape/infos/"+t.id,t).then((function(e){return e.data})).then((function(e){return n.commit("library/UPDATE_SHAPE",e),!0})).catch((function(e){return n.dispatch("api/API_ERROR",e.response.data),!1}))},SEARCH_IN_EXTERNAL_LIBRARY:function(e,t){var n=this,r=t.searchText,o=t.page;return this.$axios.get("/api/v1/library/searchExternalLibrary?search="+r+(o?"&page="+o:"")).then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"search result"}),e})).catch((function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},HTTP_UPLOAD:function(e,t){var n=this,r=t.url,o=t.credit,l=t.allowedTypes,c=t.libraryType,d=e.state.library._id;if(!d)return this.dispatch("api/API_ERROR",{tr:"serverResponse.library.errorLibraryNotLoaded"}),!1;if(h.a.isUrl(r)){var data={libraryID:d,imgUrl:r,imgCredit:o,allowedTypes:l,libraryType:c};return this.$axios.post("/api/v1/library/uploadFromUrl/"+d,data).then((function(e){return e.data})).then((function(t){if("image"===c)-1!=e.state.library.images.findIndex((function(e){return e._id===t.resource._id}))?(n.commit("library/UPDATE_IMAGE",t.resource),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.existingImageUpdated",display:!0})):(n.commit("library/UPDATE_ARRAY",{key:"images",value:t.resource}),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.imageUploaded",display:!0}));else if("shape"===c){-1!=e.state.library.shapes.findIndex((function(e){return e._id===t.resource._id}))?(n.commit("library/UPDATE_SHAPE",t.resource),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.existingShapeUpdated",display:!0})):(n.commit("library/UPDATE_ARRAY",{key:"shapes",value:t.resource}),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.shapeUploaded",display:!0}))}return t.resource})).catch((function(e){return n.dispatch("api/API_ERROR",e.response.data),!1}))}return this.dispatch("api/API_ERROR",{tr:"serverResponse.library.invalidUrl"}),!1},PROCEED_UPLOAD:function(e,t){var n=this,r=t.file,o=t.libraryType,l=t.displaySuccessMessage,c=void 0===l||l,d=e.state.library._id;if(!d)return this.dispatch("api/API_ERROR",{tr:"serverResponse.library.errorLibraryNotLoaded"}),!1;if(r){var data=new FormData;
1return data.append("libraryID",d),data.append("libraryType",o),data.append("image",r,r.name),this.$axios.post("/api/v1/library/upload/"+d,data,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){return e.data})).then((function(t){if("image"===o)-1!=e.state.library.images.findIndex((function(e){return e._id===t.resource._id}))?(n.commit("library/UPDATE_IMAGE",t.resource),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.existingImageUpdated",display:c})):(n.commit("library/UPDATE_ARRAY",{key:"images",value:t.resource}),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.imageUploaded",display:c}));else if("shape"===o){-1!=e.state.library.shapes.findIndex((function(e){return e._id===t.resource._id}))?(n.commit("library/UPDATE_SHAPE",t.resource),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.existingShapeUpdated",display:c})):(n.commit("library/UPDATE_ARRAY",{key:"shapes",value:t.resource}),n.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.library.shapeUploaded",display:c}))}return t.resource})).catch((function(e){return n.dispatch("api/API_ERROR",e.response.data),!1}))}return!1},DELETE_IMAGE:function(e,t){var n=this;return this.$axios.put("/api/v1/image/softdelete/"+t._id,{libraryId:e.state.library._id}).then((function(e){return e.data})).then((function(e){return e.error?(console.log("error on delete image"),n.dispatch("api/API_ERROR",e.message),!1):(n.commit("library/REMOVE_IMAGE",t),n.dispatch("api/API_SUCCESS",{type:"info",message:"image has been deleted"}),!0)})).catch((function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_SHAPE:function(e,t){var n=this;return this.$axios.put("/api/v1/shape/softdelete/"+t._id).then((function(e){return e.data})).then((function(e){return e.error?(console.log("error on delete shape"),n.dispatch("api/API_ERROR",e.message),!1):(n.commit("library/REMOVE_SHAPE",t),n.dispatch("api/API_SUCCESS",{type:"info",message:"shape has been deleted"}),!0)})).catch((function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},LOAD_CROPPED_IMAGE_BY_KEY:(v=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.key,o=n.pageId,r!==t.state.croppedImage.key||o!==t.state.croppedImage.page){e.next=4;break}return console.log("LOAD_LIBRARY already in state - "+r),e.abrupt("return",Promise.resolve(!0));case 4:return e.abrupt("return",this.$axios.get("/api/v1/cropped/?key="+r+"&pageId="+o).then((function(e){return e.data})).then((function(e){return l.commit("library/UPDATE_ROOT_FIELD",{key:"croppedImage",value:e}),!0}),(function(e){return!1})));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),LOAD_IMAGE_USED_BY_PAGE:(y=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.imageId,!t.state.imageUsedByPageList.find((function(e){return e.image===r}))){e.next=4;break}return console.log("LOAD_IMAGE_USED_BY_PAGE already in state for "+r),e.abrupt("return",Promise.resolve(!0));case 4:return e.abrupt("return",this.$axios.get("/api/v1/image/usedByPage/"+r).then((function(e){return e.data})).then((function(e){return o.commit("library/UPDATE_ROOT_ARRAY",{key:"imageUsedByPageList",value:e}),!0}),(function(e){return!1})));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)}),CLEAN_LIBRARY:(m=Object(o.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/library/clean/"+n).then((function(e){return e.data})).then((function(e){if(n===t.state.library._id){if(e.deletedImageIds&&e.deletedImageIds.length>0){var o=!0,l=!1,c=void 0;try{for(var d,h=function(){var e=d.value;r.commit("library/UPDATE_ARRAY",{delete:!0,key:"images",cb:function(t){return t._id===e}})},f=e.deletedImageIds[Symbol.iterator]();!(o=(d=f.next()).done);o=!0)h()}catch(e){l=!0,c=e}finally{try{o||null==f.return||f.return()}finally{if(l)throw c}}}if(e.deletedShapeIds&&e.deletedShapeIds.length>0){var m=!0,y=!1,v=void 0;try{for(var _,O=function(){var e=_.value;r.commit("library/UPDATE_ARRAY",{delete:!0,key:"shapes",cb:function(t){return t._id===e}})},E=e.deletedShapeIds[Symbol.iterator]();
1!(m=(_=E.next()).done);m=!0)O()}catch(e){y=!0,v=e}finally{try{m||null==E.return||E.return()}finally{if(y)throw v}}}}return r.dispatch("api/API_SUCCESS",{type:"info",message:"library is cleaned"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},mutations:k};t.default=S},function(e,t,n){"use strict";n.r(t),function(e){n(101),n(102),n(11),n(16),n(26),n(7),n(28);var r=n(3),o=(n(30),n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h,f,m,y,v=function(){return{pages:[],page:{_id:null,name:"",magazine:null,deleted:!1,locked:!1,tags:[],pageData:null,isPaletteDependant:[],palette:null,double:!1,redactorVariables:[],needCompleteTextblockRefresh:!1,textWithOverflow:[],imageLowDefinitionPrint:[],imageLowDefinitionWeb:[]},pageTagIndex:[]}},_={SET_PAGES:function(e,t){e.pages=t},ADD_PAGE:function(e,t){e.pages.push(t.page)},UPDATE_PAGE:function(e,t){var n=e.pages.findIndex((function(e){return e._id===t.page._id}));n>=0&&Object.assign(e.pages[n],t.page)},REMOVE_PAGE:function(e,t){var n=e.pages.findIndex((function(e){return e._id===t}));n>=0&&e.pages.splice(n,1)},SET_CURRENT_PAGE:function(e,t){e.page=null===t?Object.assign({},{_id:null,name:"",magazine:null,deleted:!1,locked:!1,tags:[],pageData:null,isPaletteDependant:[],palette:null,double:!1,redactorVariables:[],needCompleteTextblockRefresh:!1,textWithOverflow:[],imageLowDefinitionPrint:[],imageLowDefinitionWeb:[]}):Object.assign({},e.page,e.pages.find((function(e){return e._id==t})))},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.page,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.page[t.key].findIndex(t.cb):e.page[t.key].indexOf(t.value);n>=0&&e.page[t.key].splice(n,1)}else e.page[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.page[t.key][t.from];e.page[t.key][t.from]=e.page[t.key][t.to],o.default.set(e.page[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_PAGE:function(e){e.page=Object.assign({},{_id:null,name:"",magazine:null,deleted:!1,locked:!1,tags:[],pageData:null,isPaletteDependant:[],palette:null,double:!1,redactorVariables:[],needCompleteTextblockRefresh:!1,textWithOverflow:[],imageLowDefinitionPrint:[],imageLowDefinitionWeb:[]})},RESET_STATE:function(e){Object.assign(e,{pages:[],page:{_id:null,name:"",magazine:null,deleted:!1,locked:!1,tags:[],pageData:null,isPaletteDependant:[],palette:null,double:!1,redactorVariables:[],needCompleteTextblockRefresh:!1,textWithOverflow:[],imageLowDefinitionPrint:[],imageLowDefinitionWeb:[]},pageTagIndex:[]})},UPDATE_REDACTOR_VARIABLE:function(e,t){var n=t.key,r=t.value,o=e.page.redactorVariables.findIndex((function(e){return e.key===n}));o>=0?r&&r.trim().length>0?e.page.redactorVariables[o].value=r:e.page.redactorVariables.splice(o,1):r&&r.trim().length>0&&e.page.redactorVariables.push({key:n,value:r})}},O={namespaced:!0,state:v,getters:{getPages:function(e){return e.pages},getDefaultPage:function(e){return{_id:null,name:"",magazine:null,deleted:!1,locked:!1,tags:[],pageData:null,isPaletteDependant:[],palette:null,double:!1,redactorVariables:[],needCompleteTextblockRefresh:!1,textWithOverflow:[],imageLowDefinitionPrint:[],imageLowDefinitionWeb:[]}}},actions:{LOAD_PAGES:(y=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:"",e.abrupt("return",this.$axios.get("/api/v1/page"+n).then((function(e){return e.data})).then((function(e){var t=e.pages;return r.commit("page/SET_PAGES",t),r.dispatch("api/API_SUCCESS",{type:"info",message:"PAGES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)}),LOAD_PAGE:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.page._id){e.next=3;break}return console.log("LOAD_PAGE already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/page/"+c.a.normalizePayloadURI(n,"pageId")).then((function(e){return e.data})).then((function(e){return r.commit("page/UPDATE_FIELD",{key:"name",value:e.name}),r.commit("page/UPDATE_FIELD",{key:"magazine",value:e.magazine}),r.commit("page/UPDATE_FIELD",{key:"deleted",value:e.deleted}),r.commit("page/UPDATE_FIELD",{key:"locked",value:e.locked}),r.commit("page/UPDATE_FIELD",{key:"tags",value:e.tags}),r.commit("page/UPDATE_FIELD",{key:"pageData",value:JSON.parse(e.dt)}),r.commit("page/UPDATE_FIELD",{key:"isPaletteDependant",value:e.isPaletteDependant}),r.commit("page/UPDATE_FIELD",{key:"needCompleteTextblockRefresh",value:e.needCompleteTextblockRefresh}),r.commit("page/UPDATE_FIELD",{key:"palette",value:e.palette}),r.commit("page/UPDATE_FIELD",{key:"double",value:e.double}),r.commit("page/UPDATE_FIELD",{key:"redactorVariables",value:e.redactorVariables}),r.commit("page/UPDATE_FIELD",{key:"textWithOverflow",value:e.textWithOverflow}),r.commit("page/UPDATE_FIELD",{key:"imageLowDefinitionPrint",value:e.imageLowDefinitionPrint}),r.commit("page/UPDATE_FIELD",{key:"imageLowDefinitionWeb",value:e.imageLowDefinitionWeb}),r.commit("page/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"page is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),SAVE_PAGE:function(e,t){var n=this,r=null===e.state.page._id?"post":"put",o=null===e.state.page._id?"":e.state.page._id;return this.$axios[r]("/api/v1/page/"+o,e.state.page).then((function(e){return e.data})).then((function(e){var t=e.page,r=e.magazineLastVisualChangeAt;return n.commit("page/UPDATE_FIELD",{key:"_id",value:t._id}),n.commit("page/UPDATE_FIELD",{key:"name",value:t.name}),n.commit("page/UPDATE_FIELD",{key:"magazine",value:t.magazine}),n.commit("page/UPDATE_FIELD",{key:"deleted",value:t.deleted}),n.commit("page/UPDATE_FIELD",{key:"locked",value:t.locked}),n.commit("page/UPDATE_FIELD",{key:"tags",value:t.tags}),n.commit("page/UPDATE_FIELD",{key:"pageData",value:JSON.parse(t.dt)}),n.commit("page/UPDATE_FIELD",{key:"isPaletteDependant",value:t.isPaletteDependant}),n.commit("page/UPDATE_FIELD",{key:"needCompleteTextblockRefresh",value:t.needCompleteTextblockRefresh}),n.commit("page/UPDATE_FIELD",{key:"palette",value:t.palette}),n.commit("page/UPDATE_FIELD",{key:"double",value:t.double}),n.commit("page/UPDATE_FIELD",{key:"redactorVariables",value:t.redactorVariables}),n.commit("page/UPDATE_FIELD",{key:"textWithOverflow",value:t.textWithOverflow}),n.commit("page/UPDATE_FIELD",{key:"imageLowDefinitionPrint",value:t.imageLowDefinitionPrint}),n.commit("page/UPDATE_FIELD",{key:"imageLowDefinitionWeb",value:t.imageLowDefinitionWeb}),0===o.length?n.commit("page/ADD_PAGE",{page:t}):(n.commit("page/UPDATE_PAGE",{page:t}),n.commit("magazine/UPDATE_CURRENT_PAGE_ORDER",{pageId:t._id,value:t})),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:r}),n.dispatch("api/API_SUCCESS",{type:"info",message:"page is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},UPDATE_PAGE_DATA_OBJECTS:function(e,t){var n=this,r=t.objects,o=t.textWithOverflow,l=t.imageLowDefinitionPrint,c=t.imageLowDefinitionWeb;return this.$axios.put("/api/v1/page/"+e.state.page._id+"/pageData",{objects:r,textWithOverflow:o,imageLowDefinitionPrint:l,imageLowDefinitionWeb:c}).then((function(e){return e.data})).then((function(t){var r=t.page,o=t.magazineLastVisualChangeAt;return n.commit("page/UPDATE_FIELD",{key:"pageData",value:JSON.parse(r.dt)}),n.commit("page/UPDATE_FIELD",{key:"textWithOverflow",value:r.textWithOverflow}),n.commit("page/UPDATE_FIELD",{key:"imageLowDefinitionPrint",value:r.
1imageLowDefinitionPrint}),n.commit("page/UPDATE_FIELD",{key:"imageLowDefinitionWeb",value:r.imageLowDefinitionWeb}),n.commit("page/UPDATE_PAGE",{page:e.state.page}),n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:o}),n.commit("magazine/UPDATE_CURRENT_PAGE_ORDER",{pageId:r._id,value:r}),n.dispatch("api/API_SUCCESS",{type:"info",message:"page is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},SAVE_PAGE_FIELD:function(e,t){var n=this,r=t.pageId,o=t.fields;return this.$axios.put("/api/v1/page/"+r+"/fields",o).then((function(e){return e.data})).then((function(t){var l=t.page,c=t.magazineLastVisualChangeAt;if(e.state.page._id===r)for(var d=0,h=Object.keys(o);d<h.length;d++){var f=h[d];n.commit("page/UPDATE_FIELD",{key:f,value:l[f]})}return n.commit("page/UPDATE_PAGE",{page:l}),n.commit("magazine/UPDATE_CURRENT_PAGE_ORDER",{pageId:l._id,value:l}),c&&n.commit("magazine/UPDATE_FIELD",{key:"lastVisualChangeAt",value:c}),n.dispatch("api/API_SUCCESS",{type:"info",message:"page is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},LOAD_AVAILABLE_TAGS:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/page/allBy/tags?q[magazine]="+n).then((function(e){return e.data})).then((function(e){return r.commit("page/UPDATE_ROOT_FIELD",{key:"pageTagIndex",value:e}),!0}),(function(e){return console.log(e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),INSERT_CROPPED_IMAGE_TO_PAGE:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,data){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return data.cropRect&&(data.cropRect.left=Math.round(data.cropRect.left),data.cropRect.top=Math.round(data.cropRect.top),data.cropRect.width=Math.round(data.cropRect.width),data.cropRect.height=Math.round(data.cropRect.height)),e.abrupt("return",this.$axios.post("/api/v1/image/insertToPage",data).then((function(e){return e.data})).then((function(e){return e}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),null})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),GENERATE_PAGE_THUMB:(d=Object(r.a)(regeneratorRuntime.mark((function t(n,r){var o,l,c,d,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.pageId,l=r.paletteId,c=r.isDefaultPalette,d=r.svgData,h=r.thumbData,console.log("GENERATE_PAGE_THUMB"),t.abrupt("return",this.$axios.post("/api/v1/page/thumb/request",{pageId:o,paletteId:l,isDefaultPalette:c,svgData:d?e.from(d).toString("base64"):void 0,thumbData:h}).then((function(e){})).catch((function(e){console.log(e)})));case 3:case"end":return t.stop()}}),t,this)}))),function(e,t){return d.apply(this,arguments)})},mutations:_};t.default=O}.call(this,n(173).Buffer)},function(e,t,n){"use strict";n.r(t);n(7),n(28);var r=n(3),o=(n(47),n(30),n(36),n(39)),l=(n(26),n(35),n(13),n(11),n(1)),c=n(2),d=n(12);l.default.use(c.a);var h=function(){return{theme:{_id:null,name:"New Theme",template:null,fonts:[],styles:[],paletteList:[],textblockTypes:[]},templateThemes:[],currentFont:{_id:null,name:"",url:"",styles:[],subsets:[],provider:""}}};var f,m,y={UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;d.a.setProperty(n,e.theme,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;d.a.setProperty(n,e,r)},SWAP_ARRAY:function(e,t){if(t.swapType&&"move"===t.swapType){console.log("SWAP_ARRAY",JSON.parse(JSON.stringify(t)));var n=e.theme[t.key].splice(t.from,1)[0];console.log("SWAP_ARRAY moveVal",JSON.parse(JSON.stringify(n))),e.theme[t.key].splice(t.to,0,n),console.log("SWAP_ARRAY state",JSON.parse(JSON.stringify(e.theme[t.key]))),l.default.set(e.theme,t.key,e.theme[t.key])}else{var r=e.theme[t.key][t.from];e.theme[t.key][t.from]=e.theme[t.key][t.to],l.default.set(e.theme[t.key],t.to,r)}},RESET_THEME:function(e){e.theme=Object.assign({},{_id:null,name:"New Theme",template:null,fonts:[],styles:[],paletteList:[],textblockTypes:[]})},RESET_STATE:function(e){Object.assign(e,{theme:{_id:null,name:"New Theme",template:null,fonts:[],styles:[],paletteList:[],textblockTypes:[]},templateThemes:[],currentFont:{_id:null,name:"",url:"",styles:[],subsets:[],provider:""}})},ADD_THEME_PALETTE:function(e,t){var n=t.palette,r=t.themeId;e.theme._id===r&&e.theme.paletteList.push(n._id);var o=e.templateThemes.findIndex((function(e){return e._id===r}));o>=0&&e.templateThemes[o].paletteList.push(n._id)},REMOVE_THEME_PALETTE:function(e,t){if(null!==e.theme._id){var n=e.theme.paletteList.indexOf(t);n>=0&&e.theme.paletteList.splice(n,1)}e.templateThemes.length>
10&&e.templateThemes.forEach((function(e){var n=e.paletteList.indexOf(t);n>=0&&e.paletteList.splice(n,1)}))},REMOVE_STYLE:function(e,t){var n=e.theme.styles.findIndex((function(e){return e.name===t.name}));-1!=n&&e.theme.styles.splice(n,1)},ADD_OR_UPDATE_STYLE:function(e,t){t.isDefault&&e.theme.styles.forEach((function(style){style.element===t.element&&(style.isDefault=!1)}));var n=t._id?e.theme.styles.findIndex((function(e){return e._id===t._id})):-1;-1===n?e.theme.styles.push(t):e.theme.styles.splice(n,1,t)},UPDATE_STYLE_BY_NAME:function(e,t){var n=t.name,style=t.style,r=e.theme.styles.findIndex((function(e){return e.name===n}));-1!==r&&e.theme.styles.splice(r,1,style)},ADD_OR_UPDATE_TEXTBLOCK:function(e,t){var n=t.textblock,r=n._id?e.theme.textblockTypes.findIndex((function(e){return e._id===n._id})):-1;-1!==r?e.theme.textblockTypes.splice(r,1,n):e.theme.textblockTypes.push(n)},SET_CURRENT_FONT:function(e,t){e.currentFont=null===t?(void 0).theme.fonts[0]||{_id:null,name:"",url:"",styles:[],subsets:[],provider:""}:t},SET_NEW_FONT:function(e,t){e.currentFont={_id:null,name:"",url:"",styles:[],subsets:[],provider:""}},REMOVE_FONT:function(e,t){var n=e.theme.fonts.findIndex((function(e){return e.name===t.name}));-1!=n&&e.theme.fonts.splice(n,1),e.currentFont={_id:null,name:"",url:"",styles:[],subsets:[],provider:""}},ADD_OR_UPDATE_FONT:function(e,t){var n=e.theme.fonts.findIndex((function(e){return e.name===t.name}));-1===n?e.theme.fonts.push(t):e.theme.fonts[n]=t}},v={namespaced:!0,state:h,getters:{getDefaultStyle:function(e){return{key:null,name:"",element:"",style:"",htmlTag:null,isDefault:!1}},getDefaultFabricTextStyle:function(e){return{fill:"",stroke:"",strokeWidth:0,fontFamily:"",fontSize:18,fontStyle:"normal",fontWeight:"normal",underline:!1,overline:!1,linethrough:!1,deltaY:0,textBackgroundColor:"",lineHeight:1.16,textAlign:"left",charSpacing:0,textBackgroundPadding:{left:0,right:0,top:0,bottom:0}}},getDefaultFabricDropcapStyle:function(e){return{dropCapHeight:3,dropCapSpacing:0,dropCapYOffset:0,dropCapFontSizeOffset:0,fill:"",fontFamily:"",fontStyle:"normal",fontWeight:"normal"}},getDefaultFabricBulletPointStyle:function(e){return{fill:"",character:""}},getDefaultFabricEndSignStyle:function(e){return{fill:"",character:""}},getDefaultFabricTextLinkStyle:function(e){return{fill:"",stroke:"",strokeWidth:0,fontStyle:"normal",fontWeight:"normal",underline:!1,overline:!1,linethrough:!1,textBackgroundColor:"",textBackgroundPadding:{left:0,right:0,top:0,bottom:0}}},getFormatedStylesForFabric:function(e,t,n,r){var o=r["palette/getColorBySwatchName"];return e.theme.styles.reduce((function(e,t){if(t.key)try{var r=JSON.parse(t.style),l=!0,c=!1,d=void 0;try{for(var h,f=n.palette.paletteDependantProperty[Symbol.iterator]();!(l=(h=f.next()).done);l=!0){var m=h.value;r[m]&&(r[m]=o[r[m]])}}catch(e){c=!0,d=e}finally{try{l||null==f.return||f.return()}finally{if(c)throw d}}e[t.key]=r}catch(e){}return e}),{})},getTextblockTypes:function(e){var t=["Header","Body","Box","Legend","Footer"].map((function(e){return{value:e,type:e}}));return e.theme.textblockTypes.reduce((function(e,t){return t.key&&e.push({value:t.type+"-"+t.key,name:t.name,type:t.type,key:t.key}),e}),t)},findTextblockTypeData:function(e){return function(t){if(t){var n=t.split("-"),r=Object(o.a)(n,2),l=r[0],c=r[1];return e.theme.textblockTypes.find((function(e){return e.type===l&&e.key===c}))}}}},actions:{LOAD_THEME:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.theme._id){e.next=5;break}return console.log("LOAD_THEME already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 5:console.log("LOAD_THEME - "+n);case 6:return e.abrupt("return",this.$axios.get("/api/v1/theme/"+d.a.normalizePayloadURI(n,"themeId")).then((function(e){return e.data})).then((function(e){return r.commit("theme/UPDATE_FIELD",{key:"name",value:e.name}),r.commit("theme/UPDATE_FIELD",{key:"template",value:e.template}),r.commit("theme/UPDATE_FIELD",{key:"fonts",value:e.fonts}),r.commit("theme/UPDATE_FIELD",{key:"styles",value:e.styles}),r.commit("theme/UPDATE_FIELD",{key:"paletteList",value:e.paletteList}),r.commit("theme/UPDATE_FIELD",{key:"textblockTypes",value:e.textblockTypes}),r.commit("theme/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"theme is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),SAVE_THEME:function(e,t){var n=this,r=null===e.state.theme._id?"post":"put",o=null===e.state.theme._id?"":e.state.theme._id;return this.$axios[r]("/api/v1/theme/"+o,e.state.theme).then((function(e){return e.data})).then((function(e){return n.commit("theme/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("theme/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("theme/UPDATE_FIELD",{key:"template",value:e.template}),n.commit("theme/UPDATE_FIELD",{key:"fonts",value:e.fonts}),n.commit("theme/UPDATE_FIELD",{key:"styles",value:e.styles}),n.commit("theme/UPDATE_FIELD",{key:"paletteList",value:e.paletteList}),n.commit("theme/UPDATE_FIELD",{key:"textblockTypes",value:e.textblockTypes}),n.dispatch("api/API_SUCCESS",{type:"info",message:"theme is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_THEME:function(e,t){var n=this,r=t.id||e.state.theme._id;return this.$axios.delete("/api/v1/theme/"+r).then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"theme has been deleted"}),n.commit("theme/RESET_THEME"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},LOAD_TEMPLATE_THEMES:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.state.templateThemes.length>0)){e.next=7;break}if(t.state.templateThemes[0].template!==n){e.next=6;break}return console.log("LOAD_TEMPLATE_THEMES already in state"),e.abrupt("return",Promise.resolve(!0));case 6:this.commit("theme/UPDATE_ROOT_FIELD",{key:"templateThemes",value:[]});case 7:return e.abrupt("return",this.$axios.get("/api/v1/theme?template="+n).then((function(e){return e.data})).then((function(e){return r.commit("theme/UPDATE_ROOT_FIELD",{key:"templateThemes",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"THEMES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),PROCEED_UPLOAD_FONTS:function(e,t){var n=this,r=t.files,o=t.fontName,l=t.fontStyles;if(r&&r.length>0){var data=new FormData;data.append("themeID",e.state.theme._id),data.append("fontName",o),data.append("fontStyles",JSON.stringify(l));var c=!0,d=!1,h=void 0;try{for(var f,m=r[Symbol.iterator]();!(c=(f=m.next()).done);c=!0){var y=f.value;data.append("font",y,y.name)}}catch(e){d=!0,h=e}finally{try{c||null==m.return||m.return()}finally{if(d)throw h}}return this.$axios.post("/api/v1/theme/uploadFont/"+e.state.theme._id,data,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){return e.data})).then((function(e){return n.commit("theme/UPDATE_FIELD",{key:"fonts",value:e.fonts}),!0})).catch((function(e){return n.dispatch("api/API_ERROR",e.response.data),!1}))}return!1}},mutations:y};t.default=v},function(e,t,n){"use strict";n.r(t);n(35),n(13),n(11),n(7),n(28);var r=n(3),o=(n(30),n(47),n(26),n(1)),l=n(2),c=n(12),d=(n(14),n(84)),h=n.n(d);o.default.use(l.a);var f,m,y=function(){return{palette:{_id:null,name:"New Palette",swatches:[],color:null},themePalettes:[],themePalettesLoadedId:null,paletteDependantProperty:["fill","textBackgroun
1dColor","stroke"],defaultPalettePublicColors:[]}},v={ADD_THEME_PALETTE:function(e,t){e.themePalettesLoadedId===t.themeId&&e.themePalettes.push(t.palette)},UPDATE_PALETTE:function(e,t){var n=e.themePalettes.findIndex((function(e){return e._id===t.palette._id}));n>=0&&Object.assign(e.themePalettes[n],t.palette)},REMOVE_PALETTE:function(e,t){var n=e.themePalettes.findIndex((function(e){return e._id===t}));n>=0&&e.themePalettes.splice(n,1)},SET_CURRENT_PALETTE:function(e,t){if(null===t)e.palette=Object.assign({},{_id:null,name:"New Palette",swatches:[],color:null});else{var n=e.themePalettes.find((function(e){return e._id==t}));n||console.warn("invalid SET_CURRENT_PALETTE for "+t,JSON.parse(JSON.stringify(e.themePalettes))),e.palette=Object.assign({},e.palette,n)}},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.palette,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.palette[t.key].findIndex(t.cb):e.palette[t.key].indexOf(t.value);n>=0&&e.palette[t.key].splice(n,1)}else if(!0===t.update){var r=t.cb?e.palette[t.key].findIndex(t.cb):e.palette[t.key].indexOf(t.value);r>=0&&e.palette[t.key].splice(r,1,t.value)}else e.palette[t.key].push(t.value)},RESET_PALETTE:function(e){e.palette=Object.assign({},{_id:null,name:"New Palette",swatches:[],color:null})},RESET_STATE:function(e){Object.assign(e,{palette:{_id:null,name:"New Palette",swatches:[],color:null},themePalettes:[],themePalettesLoadedId:null,paletteDependantProperty:["fill","textBackgroundColor","stroke"],defaultPalettePublicColors:[]})}},_={namespaced:!0,state:y,getters:{getColorBySwatchName:function(e){return e.palette.swatches.reduce((function(e,t){return e[t.name]=t.color,e}),{})}},actions:{LOAD_THEME_PALETTES:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.state.themePalettes.length>0)){e.next=8;break}if(t.state.themePalettesLoadedId!==n){e.next=6;break}return console.log("LOAD_THEME_PALETTES already in state for "+n),e.abrupt("return",Promise.resolve(!0));case 6:console.log("LOAD_THEME_PALETTES for "+n),this.commit("palette/UPDATE_ROOT_FIELD",{key:"themePalettes",value:[]});case 8:return e.abrupt("return",this.$axios.get("/api/v1/palette?theme="+n).then((function(e){return e.data})).then((function(e){return r.commit("palette/UPDATE_ROOT_FIELD",{key:"themePalettesLoadedId",value:n}),r.commit("palette/UPDATE_ROOT_FIELD",{key:"themePalettes",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"PALETTES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),LOAD_PALETTE:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.palette._id){e.next=5;break}return console.log("LOAD_PALETTE already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 5:console.log("LOAD_PALETTE - "+n);case 6:return e.abrupt("return",this.$axios.get("/api/v1/palette/"+c.a.normalizePayloadURI(n,"paletteId")).then((function(e){return e.data})).then((function(e){return r.commit("palette/UPDATE_FIELD",{key:"name",value:e.name}),r.commit("palette/UPDATE_FIELD",{key:"swatches",value:e.swatches}),r.commit("palette/UPDATE_FIELD",{key:"color",value:e.color}),r.commit("palette/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"palette is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),SAVE_PALETTE_SWATCHES_AND_UPDATE_OTHERS:function(e,t){var n=this,r=e.state.palette._id;return this.$axios.put("/api/v1/palette/"+r,{updateOthers:!0,swatches:e.state.palette.swatches}).then((function(e){return e.data})).then((function(e){var t=!0,r=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(t=(l=c.next()).done);t=!0){var d=l.value;n.commit("palette/UPDATE_PALETTE",{palette:d})}}catch(e){r=!0,o=e}finally{try{t||null==c.return||c.return()}finally{if(r)throw o}}return n.dispatch("api/API_SUCCESS",{type:"info",message:"palette is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},UPDATE_THEME_PALETTE:function(e,t){var n=this,r=e.state.themePalettes.find((function(e){return e._id===t.paletteId}));if(void 0===r)return this.dispatch("api/API_ERROR","no palettes found in themePalettes with id "+t.paletteId),!1;var o={};return o[t.key]=t.value,o.updateOthers=t.updateOthers,this.$axios.put("/api/v1/palette/"+r._id,o).then((function(e){return e.data})).then((function(r){var o=t.updateOthers?r:[r],l=!0,c=!1,d=void 0;try{for(var h,f=o[Symbol.iterator]();!(l=(h=f.next()).done);l=!0){var m=h.value;m._id===e.state.palette._id&&(n.commit("palette/UPDATE_FIELD",{key:"name",value:m.name}),n.commit("palette/UPDATE_FIELD",{key:"swatches",value:m.swatches}
1),n.commit("palette/UPDATE_FIELD",{key:"color",value:m.color})),n.commit("palette/UPDATE_PALETTE",{palette:m})}}catch(e){c=!0,d=e}finally{try{l||null==f.return||f.return()}finally{if(c)throw d}}return n.dispatch("api/API_SUCCESS",{type:"info",message:"palette is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},COPY_THEME_PALETTE:function(e,t){var n=this;return this.$axios.post("/api/v1/palette/"+t.paletteId+"/copy/",{themeId:t.themeId}).then((function(e){return e.data})).then((function(e){return n.commit("palette/ADD_THEME_PALETTE",{palette:e,themeId:t.themeId}),n.commit("theme/ADD_THEME_PALETTE",{palette:e,themeId:t.themeId}),n.dispatch("api/API_SUCCESS",{type:"info",message:"palette is saved"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_THEME_PALETTE:function(e,t){var n=this,r=t.paletteId;return this.$axios.delete("/api/v1/palette/"+r).then((function(e){return e.data})).then((function(e){return n.commit("palette/REMOVE_PALETTE",r),n.commit("theme/REMOVE_THEME_PALETTE",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"palette has been deleted"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},CHANGE_FABRIC_OBJECT_PROPERTY_COLOR:function(e,t){var n=t.color,r=t.swatchName,o=t.objectProperty,l=t.$fabric,c=t.fabricObject,d=void 0===c?null:c,f=d||l.canvas.getActiveObject(),m=e.rootState.fabric.hasActiveObject&&e.rootState.fabric.activeObject.id===f.id,y=n?h()(n).toHex8String():null;if(console.log("CHANGE_FABRIC_OBJECT_PROPERTY_COLOR"),n&&!r||!n&&r)return this.dispatch("api/API_ERROR",{message:"Error on change fabric color, you need to set color AND swatchName"}),!1;if(null!==n&&null!==r&&-1===e.state.palette.swatches.findIndex((function(e){return h()(e.color).toHex8String()===y&&e.name===r})))return this.dispatch("api/API_ERROR",{message:"Error on change fabric color, color not find in current palette"}),!1;m&&this.commit("fabric/UPDATE_ROOT_FIELD",{key:"activeObject."+o,value:y});var v=Object.assign({},f.paletteSwatchName);r?v[o]=r:delete v[o],m&&this.commit("fabric/UPDATE_ROOT_FIELD",{key:"activeObject.paletteSwatchName",value:v});var _=[{key:o,value:y,useSet:-1===o.indexOf("dropCapStyle")&&-1===o.indexOf("bulletPointStyle")&&-1===o.indexOf("endSignStyle")&&-1===o.indexOf("textLinkStyle")},{key:"paletteSwatchName",value:v,useSet:!0}];l.setObjectProps(_,f)}},mutations:v};t.default=_},function(e,t,n){"use strict";n.r(t);n(30),n(11),n(7),n(16);var r=n(1),o=n(2),l=n(12);r.default.use(o.a);var c={type:"",id:""},d={top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,angle:0,fill:"",stroke:null,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeWidth:0,backgroundColor:"",paletteSwatchName:{},clipPath:null,clientSideLocked:!1,adminSideLocked:!1},h={textStyleKey:null,blockType:"Body",fontFamily:"",fontWeight:"normal",fontSize:10,fontStyle:"normal",underline:!1,overline:!1,linethrough:!1,textBackgroundColor:"",deltaY:0,lineHeight:1,charSpacing:1,dropCap:!1,dropCapStyle:{},dropCapStyleKey:null,bulletPoint:!1,bulletPointStyle:{},bulletPointStyleKey:null,endSign:!1,endSignStyle:{},endSignStyleKey:null,textLink:!1,textLinkStyle:{},textLinkStyleKey:null,textAlign:"",parentTextBoxId:"",childTextBoxId:"",legendImageId:"",backgroundPadding:{left:0,right:0,bottom:0,top:0},textBackgroundPadding:{left:0,right:0,bottom:0,top:0}},f={dropCapHeight:3,dropCapSpacing:0,dropCapYOffset:0,dropCapFontSizeOffset:0,fill:"",fontFamily:"",fontStyle:"normal",fontWeight:"normal"},m={fill:"",character:""},y={fill:"",character:""},v={fill:"",underline:!1,fontStyle:"normal",fontWeight:"normal"},_={cropX:0,cropY:0,src:"",legendTextBoxId:"",link:""},O={rx:0,ry:0};var E=function(){return{canvas:{zoom:100},gui:{drawModeEnabled:!1,gridEnabled:!1,gridSize:10,gridUnitMode:1,rulerEnabled:!1,snapEnabled:!1,columnMagnetMargin:10,marginAndColumnEnabled:!0,columnMagnetEnabled:!0,dimensionsExpanded:[],inpuNumberUnitMode:{default:"px"}},hasMultipleSelection:!1,hasActiveObject:!1,activeObject:{type:"",id:"",props:{}},selectionOfTypes:"",copiedObjects:[]}},k=E,S={UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;l.a.setProperty(n,e,r)},UPDATE_INPUT_NUMBER_UNIT_MODE:function(e,t){var n=t.key,o=t.value;r.default.set(e.gui.inpuNumberUnitMode,n,o)},TOGGLE_VALUE:function(e,t){var n=t.key;l.a.setProperty(n,e,!l.a.getProperty(n,e))},SET_ACTIVE_OBJECT:function(e,t){var n=t.value;if("activeSelection"===n.type&&n._objects&&n._objects.length>1)return e.hasMultipleSelection=!0,e.activeObject=c,e.hasActiveObject=!1,e.activeObject.type=n.type,e.selectionOfTypes=n.type,void r.default.set(e.activeObject,"adminSideLocked",!1);if(!n||!n.id)return e.activeObject=c,e.hasMultipleSelection=!1,void(e.hasActiveObject=!1);function o(e){return"activeSelection"!==n.type||n[e]?n[e]:n._objects[0][e]}if(e.activeObject={},e.activeObject.id=n.id,e.activeObject.type=n.type,e.hasActiveObject=!0,e.hasMultipleSelection=!1,e.selectionOfTypes=n.type,"activeSelection"===n.type){var l=n._objects[0].type;n._objects.every((function(e){return e.type===l}))&&(e.selectionOfTypes=l)}
1if(Object.keys(d).forEach((function(t){if("clipPath"===t)if(n[t]){var l=n[t].toObject();r.default.set(e.activeObject,t,{inverted:l.inverted,nbObjects:l.objects.length})}else r.default.set(e.activeObject,t,null);else r.default.set(e.activeObject,t,o(t))})),"MzTextbox"===e.selectionOfTypes){Object.keys(h).forEach((function(t){r.default.set(e.activeObject,t,o(t))}));var E=o("dropCapStyle");E&&Object.keys(f).forEach((function(t){r.default.set(e.activeObject.dropCapStyle,t,E[t])}));var k=o("bulletPointStyle");k&&Object.keys(m).forEach((function(t){r.default.set(e.activeObject.bulletPointStyle,t,k[t])}));var S=o("endSignStyle");S&&Object.keys(y).forEach((function(t){r.default.set(e.activeObject.endSignStyle,t,S[t])}));var A=o("textLinkStyle");A&&Object.keys(v).forEach((function(t){r.default.set(e.activeObject.textLinkStyle,t,A[t])}))}"MzImage"===n.type&&(Object.keys(_).forEach((function(t){r.default.set(e.activeObject,t,n[t])})),n.src||r.default.set(e.activeObject,"src",n.getSrc())),"MzRect"===n.type&&Object.keys(O).forEach((function(t){r.default.set(e.activeObject,t,n[t])}))},SET_ACTIVE_OBJECT_PROP:function(e,t){var n=t.key,r=t.value;e.activeObject[n]=r},CLEAR_ACTIVE_OBJECT:function(e){e.activeObject=c,e.hasActiveObject=!1},ADD_COPIED_OBJECT:function(e,object){if(object.id){var t=e.copiedObjects.find((function(e){return e.id==object.id}));t&&e.copiedObjects.splice(t,1)}e.copiedObjects.push(object)},REMOVE_COPIED_OBJECT:function(e,t){e.copiedObjects.splice(t,1)},REMOVE_ALL_COPIED_OBJECTS:function(e){e.copiedObjects=[]},RESET_STATE:function(e){Object.assign(e,{canvas:{zoom:100},gui:{drawModeEnabled:!1,gridEnabled:!1,gridSize:10,gridUnitMode:1,rulerEnabled:!1,snapEnabled:!1,columnMagnetMargin:10,marginAndColumnEnabled:!0,columnMagnetEnabled:!0,dimensionsExpanded:[],inpuNumberUnitMode:{default:"px"}},hasMultipleSelection:!1,hasActiveObject:!1,activeObject:{type:"",id:"",props:{}},selectionOfTypes:"",copiedObjects:[]})}};t.default={namespaced:!0,state:k,getters:{},actions:{},mutations:S}},function(e,t,n){"use strict";n.r(t);n(35),n(13),n(11),n(26),n(7),n(28);var r=n(3),o=(n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h,f,m,y,v,_,O,E,k=function(){return{users:[],usersCount:0,usersPayload:null,clientUser:null,roles:[]}},S={UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},SET_USERS:function(e,t){var n=t.users;e.users=n},SET_ROLES:function(e,t){e.roles=t},SET_USERS_COUNT:function(e,t){var n=t.count;e.usersCount=n},UPDATE_USER:function(e,t){var n=e.users.findIndex((function(e){return e._id===t.user._id}));n>=0&&Object.assign(e.users[n],t.user),null!==e.clientUser&&e.clientUser._id===t.user._id&&Object.assign(e.clientUser,t.user)},REMOVE_USER:function(e,t){var n=e.users.findIndex((function(e){return e._id===t}));n>=0&&e.users.splice(n,1)},RESET_STATE:function(e){Object.assign(e,{users:[],usersCount:0,usersPayload:null,clientUser:null,roles:[]})}},A={namespaced:!0,state:k,getters:{},actions:{LOAD_USERS:(E=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.commit("user/UPDATE_ROOT_FIELD",{key:"usersPayload",value:JSON.stringify(n)}),e.abrupt("return",this.$axios.get("/api/v1/users/list?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("user/SET_USERS",{users:e,payload:n}),r.dispatch("api/API_SUCCESS",{type:"info",message:"USERS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)}),LOAD_ROLES:(O=Object(r.a)(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.state.roles.length>0)){e.next=3;break}return console.log("LOAD_ROLES already in state"),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/users/roles").then((function(e){return e.data})).then((function(e){return n.commit("user/SET_ROLES",e),n.dispatch("api/API_SUCCESS",{type:"info",message:"ROLES are loaded"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)}),COUNT_USERS:(_=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/users/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("user/SET_USERS_COUNT",{count:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT USERS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)}),EXPORT_USERS:(v=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/users/export?filter="+JSON.stringify(n.filter)+"&sort="+n.sort).then((function(e){return e.data})).then((function(data){var e="data:text/csv;charset=utf-8,"+data,link=document.createElement("a");return link.setAttribute("href",encodeURI(e)),link.setAttribute("download","users.csv"),link.click(),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),UPDATE_USER_ROLE:(y=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.userId,o=n.name,l=n.value,e.abrupt("return",this.$axios.put("/api/v1/users/updateRole/"+r,{name:o,value:l}).then((function(e){return e.data})).then((function(e){return c.commit("user/UPDATE_USER",{user:e}),c.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.user.roleUpdated",display:!0}),!0}),(function(e){return c.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)}
1),UPDATE_USER:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/users/"+n.userId,n).then((function(e){return e.data})).then((function(e){return r.commit("user/UPDATE_USER",{user:e}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),DELETE_USERS:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.$axios.delete("/api/v1/users/softDelete/"+n).then((function(e){return e.data})).then((function(e){var n=!0,r=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value;t.commit("user/UPDATE_USER",{user:d})}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}return t.dispatch("api/API_SUCCESS",{type:"info",message:"users has been deleted"}),!0}),(function(e){return t.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},HARD_DELETE_USERS:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.$axios.delete("/api/v1/users/hardDelete/"+n).then((function(e){return e.data})).then((function(e){var n=!0,r=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value;t.commit("user/REMOVE_USER",d)}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}return t.dispatch("api/API_SUCCESS",{type:"info",message:"user has been deleted"}),!0}),(function(e){return t.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},RESTORE_USERS:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this.$axios.put("/api/v1/users/restore/"+n).then((function(e){return e.data})).then((function(e){var n=!0,r=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var d=l.value;t.commit("user/UPDATE_USER",{user:d})}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}return t.dispatch("api/API_SUCCESS",{type:"info",message:"users has been restored"}),!0}),(function(e){return t.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},INVIT_ADMIN_USERS:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l,c,d,h=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.organization,o=n.emails,l=n.roles,c=n.tag,d=n.sendInvit,e.abrupt("return",this.$axios.post("/api/v1/users/invitAdmin",{organization:r,emails:o,roles:l,tag:c,sendInvit:d}).then((function(e){return e.data})).then((function(e){if(null!==t.state.usersPayload){var n=JSON.parse(t.state.usersPayload);h.commit("user/SET_USERS",{users:[]}),h.commit("user/SET_USERS_COUNT",{count:0}),h.dispatch("user/LOAD_USERS",n),h.dispatch("user/COUNT_USERS",n)}return h.dispatch("api/API_SUCCESS",{type:"info",tr:"serverResponse.user.created",trParams:{nb:e.length},display:!0}),e}),(function(e){return h.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),REFRESH_INVIT_USERS:(h=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:"",e.abrupt("return",this.$axios.put("/api/v1/users/refreshInvit/"+n).then((function(e){return e.data})).then((function(e){var t=!0,n=!1,o=void 0;try{for(var l,c=e[Symbol.iterator]();!(t=(l=c.next()).done);t=!0){var d=l.value;r.commit("user/UPDATE_USER",{user:d})}}catch(e){n=!0,o=e}finally{try{t||null==c.return||c.return()}finally{if(n)throw o}}return r.dispatch("api/API_SUCCESS",{type:"info",message:"users invit sended"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)}),LOAD_CLIENT_USER:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/users/clientUser/"+n.userId).then((function(e){return e.data})).then((function(e){return r.commit("user/UPDATE_ROOT_FIELD",{key:"clientUser",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"CLIENT_USER are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},mutations:S};t.default=A},function(e,t,n){"use strict";n.r(t);n(35),n(13),n(11),n(7),n(28);var r=n(3),o=(n(47),n(30),n(1)),l=n(2),c=n(12);function d(e){return{Header:1,Body:2,Box:3,Legend:4,Footer:5}[e]}o.default.use(l.a);var h,f,m,y,v,_=function(){return{articles:[],article:{_id:null,name:"New Art
1icle",magazine:null,textblocks:[],pages:[]},textblockMap:{},debugLoadArticle:[]}},O={SET_ARTICLES:function(e,t){e.articles=t},ADD_ARTICLE:function(e,t){e.articles.push(t.article)},SET_NEW_ARTICLE:function(e,t){var n={_id:null,name:"New Article",magazine:null,textblocks:[],pages:[]};n.magazine=t.magazine,n.pages.push(t.page),e.article=Object.assign({},e.article,n)},UPDATE_ARTICLE:function(e,t){var n=e.articles.findIndex((function(article){return article._id===t.article._id}));n>=0&&Object.assign(e.articles[n],t.article)},REMOVE_ARTICLE:function(e,t){var n=e.articles.findIndex((function(article){return article._id===t}));n>=0&&e.articles.splice(n,1)},SET_ARTICLE_OF_PAGE:function(e,t){if(null===t)e.article=Object.assign({},{_id:null,name:"New Article",magazine:null,textblocks:[],pages:[]});else{var n=e.articles.find((function(article){return-1!==article.pages.indexOf(t)}));e.article=Object.assign({},e.article,n)}},SET_ARTICLE:function(e,t){e.article=null===t?Object.assign({},{_id:null,name:"New Article",magazine:null,textblocks:[],pages:[]}):Object.assign({},e.article,e.articles.find((function(article){return article._id===t})))},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARTICLE_ARRAY:function(e,t){var n=t.cb?e.article[t.key].findIndex(t.cb):e.article[t.key].indexOf(t.value);n>=0?!0===t.delete?e.article[t.key].splice(n,1):e.article[t.key].splice(n,1,t.value):e.article[t.key].push(t.value)},RESET_ARTICLE:function(e){e.article=Object.assign({},{_id:null,name:"New Article",magazine:null,textblocks:[],pages:[]})},RESET_STATE:function(e){Object.assign(e,{articles:[],article:{_id:null,name:"New Article",magazine:null,textblocks:[],pages:[]},textblockMap:{},debugLoadArticle:[]})},ADD_DEBUG_ERROR:function(e,t){var n=t.key,r=t.err;e.debugLoadArticle.push({key:n,response:r.response&&r.response.data?r.response.data:void 0,err:r})},SET_TEXT:function(e,t){e.textblockMap[t.id]&&(e.textblockMap[t.id].html=t.html)},SET_TEXTBLOCK_TYPE:function(e,t){e.textblockMap[t.id].type=t.type},UPDATE_TEXBLOCK_MAP:function(e,t){o.default.set(e.textblockMap,t._id,t)},REMOVE_FROM_TEXBLOCK_MAP:function(e,t){o.default.delete(e.textblockMap,t)},RESET_TEXBLOCKS:function(e){o.default.set(e,"textblockMap",{})}},E={namespaced:!0,state:_,getters:{getArticles:function(e){return e.articles},getTextblock:function(e){return function(t){return e.textblockMap[t]}},getTextblockList:function(e){var output=[];for(var t in e.textblockMap)output.push(e.textblockMap[t]);return output.sort((function(a,b){return d(a.type)-d(b.type)})),output},getTextblockByTarget:function(e){return function(t){for(var n in e.textblockMap)if(e.textblockMap[n].target===t)return e.textblockMap[n];return null}},getArticleOfPage:function(e){return function(t){var n=e.articles.find((function(article){return-1!==article.pages.indexOf(t)}));return!(!n||void 0===n)&&n}}},actions:{LOAD_ARTICLES:(v=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.magazine,!(t.state.articles.length>0&&t.state.articles[0].magazine==r)){e.next=3;break}return e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/article?magazine="+r).then((function(e){return e.data})).then((function(e){return o.commit("article/SET_ARTICLES",e),o.dispatch("api/API_SUCCESS",{type:"info",message:"ARTICLES are loaded"}),!0}),(function(e){return 404===e.response.status?(o.commit("article/RESET_ARTICLE"),o.commit("article/UPDATE_FIELD",{key:"article.magazine",value:r}),page&&o.commit("article/UPDATE_ARTICLE_ARRAY",{key:"page",value:page}),!0):(o.commit("article/ADD_DEBUG_ERROR",{key:"LOAD_ARTICLES",err:e}),o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),SAVE_ARTICLE:function(e,t){var n=this,r=null===e.state.article._id?"post":"put",o=null===e.state.article._id?"":e.state.article._id;return this.$axios[r]("/api/v1/article/"+o,e.state.article).then((function(e){return e.data})).then((function(article){return 0===o.length?n.commit("article/ADD_ARTICLE",{article:article}):n.commit("article/UPDATE_ARTICLE",{article:article}),n.commit("article/SET_ARTICLE",article._id),n.dispatch("api/API_SUCCESS",{type:"info",message:"article is saved"}),!0}),(function(e){return n.commit("article/ADD_DEBUG_ERROR",{key:"SAVE_ARTICLE",err:e}),n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_ARTICLE:function(e,t){var n=this,r=t.id||e.state.article._id;return this.$axios.delete("/api/v1/article/"+r).then((function(e){return e.data})).then((function(article){return n.commit("article/REMOVE_ARTICLE",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"article has been deleted"}
1),n.commit("article/RESET_ARTICLE"),n.commit("article/RESET_TEXBLOCKS"),!0}),(function(e){return n.commit("article/ADD_DEBUG_ERROR",{key:"DELETE_ARTICLE",err:e}),n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},SAVE_TEXTBLOCK:(y=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var data,r,o,l,c,d,h,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(data={},!n.keys){e.next=23;break}for(r=!0,o=!1,l=void 0,e.prev=5,c=n.keys[Symbol.iterator]();!(r=(d=c.next()).done);r=!0)h=d.value,data[h]=t.state.textblockMap[n.id][h];e.next=13;break;case 9:e.prev=9,e.t0=e.catch(5),o=!0,l=e.t0;case 13:e.prev=13,e.prev=14,r||null==c.return||c.return();case 16:if(e.prev=16,!o){e.next=19;break}throw l;case 19:return e.finish(16);case 20:return e.finish(13);case 21:e.next=24;break;case 23:data=t.state.textblockMap[n.id];case 24:return e.abrupt("return",this.$axios.put("/api/v1/textblock/"+n.id,data).then((function(e){return e.data})).then((function(e){return f.commit("article/UPDATE_TEXBLOCK_MAP",e),f.dispatch("api/API_SUCCESS",{type:"info",message:"text is saved"}),!0}),(function(e){return f.commit("article/ADD_DEBUG_ERROR",{key:"SAVE_TEXTBLOCK",err:e}),f.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 25:case"end":return e.stop()}}),e,this,[[5,9,13,21],[14,,16,20]])}))),function(e,t){return y.apply(this,arguments)}),UNDO_TEXTBLOCK:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/textblock/undo/"+n.id).then((function(e){return e.data})).then((function(e){return r.commit("article/UPDATE_TEXBLOCK_MAP",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"text is saved"}),!0}),(function(e){return r.commit("article/ADD_DEBUG_ERROR",{key:"UNDO_TEXTBLOCK",err:e}),r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),REDO_TEXTBLOCK:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/textblock/redo/"+n.id).then((function(e){return e.data})).then((function(e){return r.commit("article/UPDATE_TEXBLOCK_MAP",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"text is saved"}),!0}),(function(e){return r.commit("article/ADD_DEBUG_ERROR",{key:"REDO_TEXTBLOCK",err:e}),r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),CREATE_BATCH_TEXBLOCKS:function(e,t){var n=this,r=t.textboxes,o=t.pageId,l=e.state.article._id,c=r.map((function(e){return{target:e.id,type:e.blockType,page:o,article:l}})),data={article:l,list:c};return this.$axios.post("/api/v1/textblock/batch/",data).then((function(e){return e.data})).then((function(e){return e.forEach((function(e){n.commit("article/UPDATE_TEXBLOCK_MAP",e),n.commit("article/UPDATE_ARTICLE_ARRAY",{key:"textblocks",value:e._id})})),n.dispatch("api/API_SUCCESS",{type:"info",message:"article is saved"}),!0}),(function(e){return n.commit("article/ADD_DEBUG_ERROR",{key:"CREATE_BATCH_TEXBLOCKS",err:e}),n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_TEXTBLOCK:function(e,t){var n=this;return this.$axios.delete("/api/v1/textblock/"+t).then((function(e){return e.data})).then((function(article){return n.commit("article/REMOVE_FROM_TEXBLOCK_MAP",t),n.commit("article/UPDATE_ARTICLE_ARRAY",{key:"textblocks",value:t,delete:!0}),n.dispatch("api/API_SUCCESS",{type:"info",message:"textblock has been deleted"}),!0}),(function(e){return n.commit("article/ADD_DEBUG_ERROR",{key:"DELETE_TEXTBLOCK",err:e}),n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},LOAD_ARTICLE_TEXBLOCKS:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/textblock/?article="+n.articleId).then((function(e){return e.data})).then((function(e){return e.textblocks.forEach((function(e){r.commit("article/UPDATE_TEXBLOCK_MAP",e)})),r.dispatch("api/API_SUCCESS",{type:"info",message:"textblocks loaded"}),!0}),(function(e){return r.commit("article/ADD_DEBUG_ERROR",{key:"LOAD_ARTICLE_TEXBLOCKS",err:e}),r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},mutations:O};t.default=E},function(e,t,n){"use strict";n.r(t);n(19),n(16),n(28);var r=n(3),o=n(4),l=(n(47),n(35),n(13),n(11),n(7),n(26),n(30),n(1)),c=n(2),d=n(12);function h(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};
1i%2?h(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):h(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}l.default.use(c.a);var m=[{name:"redactor",priority:4},{name:"deputy",priority:2},{name:"chief",priority:0}],y=function(){return{collaborations:[],collaboration:null,userCollaboration:null}},v={namespaced:!0,state:y,getters:{collaborationIsActive:function(e){return null!==e.collaboration&&null!==e.collaboration._id&&void 0!==e.collaboration._id},getInferiorRoles:function(e){return function(e){var t=m.find((function(t){return t.name===e}));return t?m.filter((function(e){return e.priority>t.priority})).map((function(e){return e.name})):[]}},listCollaborationRoles:function(e){return m.map((function(e){return{value:e.name,priority:e.priority}}))},activeCollaborationUserByPages:function(e,t,n){if(!e.collaboration||!n.magazine.magazine.pageOrder||0===n.magazine.magazine.pageOrder.length)return[];var r=e.collaboration.users.find((function(e){return"chief"===e.role}));return n.magazine.magazine.pageOrder.reduce((function(t,n){var o=e.collaboration.pagesCollaboration.find((function(e){return n._id===e.page})),l=null,c=null,d=null,h=null,f=null;return o&&(l=o.history.length>=1?e.collaboration.users.find((function(e){return e._id===o.history[0].user})):null,c=o.history.length>=2?e.collaboration.users.find((function(e){return e._id===o.history[1].user})):null,d=o.takeControlUser?e.collaboration.users.find((function(e){return e._id===o.takeControlUser})):null),l||(l=r),l&&(e.userCollaboration&&l._id!==e.userCollaboration._id?function(){for(var t=l,n=!1;t&&t.parent;)t.parent===e.userCollaboration._id?(n=!0,t=null):t=e.collaboration.users.find((function(e){return e._id===t.parent}));h=Object.assign({},l,{isChildOfCurrentUser:n})}():h=Object.assign({},l,{isCurrentUser:!0})),c&&(e.userCollaboration&&c._id!==e.userCollaboration._id?function(){for(var t=c,n=!1;t&&t.parent;)t.parent===e.userCollaboration._id?(n=!0,t=null):t=e.collaboration.users.find((function(e){return e._id===t.parent}));f=Object.assign({},c,{isChildOfCurrentUser:n})}():f=Object.assign({},c,{isCurrentUser:!0}
1)),d&&console.log("pageCollaboration.takeControlUser",JSON.parse(JSON.stringify(d))),t[n._id]={page:n._id,user:l,displayedUser:h,displayedUserFrom:f,isNewAssign:!!o&&o.isNewAssign,takeControlUser:d},t}),{})},collaborationUsersByAccountId:function(e){return e.collaboration?e.collaboration.users.reduce((function(e,t){var n=t.linkedAccount?t.linkedAccount._id:null;return n&&(e[n]=t),e}),{}):{}},collaborationUsersAssignList:function(e,t,n,r){if(!e.collaboration||!e.userCollaboration)return[];var o=r["magazine/checkMagazinePerm"]("magPerms:collaboration:assign:bypassParent");return e.collaboration.users.reduce((function(t,n){return(n._id===e.userCollaboration._id||n.parent===e.userCollaboration._id||n._id===e.userCollaboration.parent||o)&&t.push(n),t}),[])}},actions:{LOAD_COLLABORATION:function(e,t){var n=this;return Object(r.a)(regeneratorRuntime.mark((function r(){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=4;break}e.commit("RESET_STATE"),r.next=9;break;case 4:return r.next=6,n.$axios.get("/api/v1/collaboration/".concat(t)).then((function(e){return e.data}));case 6:o=r.sent,e.commit("SET_COLLABORATION",o),e.commit("SET_USER_COLLABORATION",e.rootState.api.user);case 9:case"end":return r.stop()}}),r)})))()},LOAD_PUBLIC_COLLABORATION:function(e,t){var n=this;return Object(r.a)(regeneratorRuntime.mark((function r(){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n.$axios.get("/api/v1/collaboration/public/".concat(t)).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 2:if(o=r.sent){r.next=5;break}return r.abrupt("return",!1);case 5:return e.commit("SET_COLLABORATION",o),e.commit("SET_USER_COLLABORATION",null),r.abrupt("return",!0);case 8:case"end":return r.stop()}}),r)})))()},INIT_COLLABORATION:function(e,t){var n=this,o=t.magazineId,l=t.duplicateFromBackIssue;return Object(r.a)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.$axios.post("/api/v1/collaboration",{magazine:o,duplicateFromBackIssue:l}).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 2:if(r=t.sent){t.next=5;break}return t.abrupt("return",!1);case 5:return e.commit("SET_COLLABORATION",r),e.commit("SET_USER_COLLABORATION",e.rootState.api.user),e.rootState.magazine.magazine._id===o&&n.commit("magazine/UPDATE_FIELD",{key:"collaboration",value:r._id}),t.abrupt("return",!0);case 9:case"end":return t.stop()}}),t)})))()},UPDATE_COLLABORATION:function(e,t){var n=this,o=t.collaborationId,l=t.name;return Object(r.a)(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.$axios.put("/api/v1/collaboration/".concat(o),{name:l}).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 2:if(t=e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:return n.commit("collaboration/SET_COLLABORATION",t),e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e)})))()},INVITE_USER_TO_COLLABORATION:function(e,t){var n=this,o=t.collaborationId,l=t.userId,c=t.userName,d=t.role,h=t.fromAdmin,f=t.sendInvit;return Object(r.a)(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.$axios.post("/api/v1/collaboration/".concat(o,"/invite"),{userId:l,userName:c,role:d,fromAdmin:h,sendInvit:f}).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 2:if(t=e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:return!h&&t.collaboration&&n.commit("collaboration/SET_COLLABORATION",t.collaboration),e.abrupt("return",t.newCollabUser);case 7:case"end":return e.stop()}}),e)})))()},RESEND_INVITE_USER_TO_COLLABORATION:function(e,t){var n=this,o=t.collaborationId,l=t.userId;return Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.$axios.post("/api/v1/collaboration/".concat(o,"/resendInvit/").concat(l)).then((function(e){return e.data}
1)).catch((function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}));case 2:return e.t0=e.sent,e.abrupt("return",!1!==e.t0);case 4:case"end":return e.stop()}}),e)})))()},REMOVE_USER_FROM_COLLABORATION:function(e,t){var n=this;return Object(r.a)(regeneratorRuntime.mark((function r(){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n.$axios.put("/api/v1/collaboration/removeUser",t).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 2:if(o=r.sent){r.next=5;break}return r.abrupt("return",!1);case 5:return t.fromAdmin||e.commit("SET_COLLABORATION",o),r.abrupt("return",!0);case 7:case"end":return r.stop()}}),r)})))()},UPDATE_USER_FROM_COLLABORATION:function(e,t){var n=this,o=t.collaborationId,l=t.user;return Object(r.a)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.$axios.put("/api/v1/collaboration/".concat(o,"/users/").concat(l._id),{role:l.role,name:l.name,parent:l.parent}).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 2:if(r=t.sent){t.next=5;break}return t.abrupt("return",!1);case 5:return e.commit("SET_COLLABORATION",r),t.abrupt("return",!0);case 7:case"end":return t.stop()}}),t)})))()},UPDATE_PAGES_FROM_COLLABORATION:function(e,t){var n=this,o=t.collaborationId,l=t.pages,c=t.user;return Object(r.a)(regeneratorRuntime.mark((function t(){var d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.$axios.put("/api/v1/collaboration/".concat(o,"/pages"),{pages:l,user:c}).then((function(e){return e.data})).catch(function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.response||!t.response.data.canForce){e.next=6;break}return e.next=3,n._vm.$confirm(n.app.i18n.t("public.teams_list.force_assign_page.message",{name:t.response.data.currentOwner}),n.app.i18n.t("public.teams_list.force_assign_page.title"),{confirmButtonText:n.app.i18n.t("public.teams_list.force_assign_page.confirm"),cancelButtonText:n.app.i18n.t("public.teams_list.force_assign_page.cancel")}).then(Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.$axios.put("/api/v1/collaboration/".concat(o,"/pages"),{pages:l,user:c,force:!0}).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).catch((function(){return!1}));case 3:return e.abrupt("return",e.sent);case 6:n.dispatch("api/API_ERROR",t.response?t.response.data:t);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:if(d=t.sent){t.next=5;break}return t.abrupt("return",!1);case 5:return e.commit("SET_COLLABORATION",d),t.abrupt("return",!0);case 7:case"end":return t.stop()}}),t)})))()},SET_PAGE_VIEW_FROM_COLLABORATION:function(e,t){var n=this,o=t.collaborationId,l=t.pageId;return Object(r.a)(regeneratorRuntime.mark((function t(){var c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.$axios.put("/api/v1/collaboration/".concat(o,"/page/").concat(l),{isNewAssign:!1}).then((function(e){return e.data})).catch(function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:if(c=t.sent){t.next=5;break}return t.abrupt("return",!1);case 5:return e.commit("SET_COLLABORATION",c),t.abrupt("return",!0);case 7:case"end":return t.stop()}}),t)})))()},SET_TAKE_CONTROL_PAGE_FROM_COLLABORATION:function(e,t){var n=this,o=t.collaborationId,l=t.pageId,c=t.takeControl;return Object(r.a)(regeneratorRuntime.mark((function t(){var d;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.$axios.put("/api/v1/collaboration/".concat(o,"/page/").concat(l,"/takeControl"),{takeControl:c}).then((function(e){return e.data}
1)).catch(function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.dispatch("api/API_ERROR",t.response?t.response.data:t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:if(d=t.sent){t.next=5;break}return t.abrupt("return",!1);case 5:return e.commit("SET_COLLABORATION",d),t.abrupt("return",!0);case 7:case"end":return t.stop()}}),t)})))()},UPDATE_COLLABORATION_SETTINGS:function(e,t){var n=this,o=t.collaborationId,l=t.settings;return Object(r.a)(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.commit("collaboration/SET_COLLABORATION_SETTINGS",l),e.next=3,n.$axios.put("/api/v1/collaboration/".concat(o,"/settings"),{settings:l}).then((function(e){return e.data})).catch((function(e){n.dispatch("api/API_ERROR",e.response?e.response.data:e)}));case 3:if(t=e.sent){e.next=6;break}return e.abrupt("return",!1);case 6:return n.commit("collaboration/SET_COLLABORATION",t),e.abrupt("return",!0);case 8:case"end":return e.stop()}}),e)})))()},LOAD_COLLABORATIONS:function(e,t){return Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()}},mutations:{SET_COLLABORATIONS:function(e,t){e.collaborations=t},SET_COLLABORATION:function(e,t){e.collaboration=t},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;e.collaboration||(e.collaboration={}),d.a.setProperty(n,e.collaboration,r)},UPDATE_IN_ARRAY:function(e,t){var n=t.key,r=t.values;e.collaboration||(e.collaboration={}),e.collaboration[n]||(e.collaboration[n]=[]);var o=!0,l=!1,c=void 0;try{for(var d,h=function(){var t=d.value,r=e.collaboration[n].findIndex((function(e){return e._id===t._id}));-1===r?e.collaboration[n].push(t):e.collaboration[n].splice(r,1,t)},f=r[Symbol.iterator]();!(o=(d=f.next()).done);o=!0)h()}catch(e){l=!0,c=e}finally{try{o||null==f.return||f.return()}finally{if(l)throw c}}},SET_COLLABORATION_SETTINGS:function(e,t){t.associateSettings&&(e.collaboration.settings.associateSettings=f({},e.collaboration.settings.associateSettings,{},t.associateSettings)),t.writerSettings&&(e.collaboration.settings.writerSettings=f({},e.collaboration.settings.writerSettings,{},t.writerSettings))},SET_USER_COLLABORATION:function(e,t){var n;n=e.collaboration&&t&&t._id?e.collaboration.users.find((function(e){return e.linkedAccount&&t._id===e.linkedAccount._id})):null,e.userCollaboration=n},RESET_STATE:function(e){Object.assign(e,{collaborations:[],collaboration:null,userCollaboration:null})}}};t.default=v},function(e,t,n){"use strict";n.r(t);n(28);var r=n(3),o=(n(35),n(13),n(11),n(7),n(91),n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h,f,m=function(){return{notifications:[],limitDisplayNotifications:20,scheduledNotification:{_id:null,availableLanguages:["en","fr"],title:"",description:"",visualUrl:"",primaryAction:{label:"",url:""},secondaryAction:{label:"",url:""},scheduledAt:null,sended:!1,sendInProgress:!1,nbCreatedNotification:0,sendToType:"all",sendToData:""},scheduledNotifications:[],scheduledNotificationsCount:0}},y={UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},ADD_NOTIFICATION:function(e,t){var n=!0;"MZ_SCHEDULED_NOTIFICATION"===t.type&&(n=!!(t.data&&t.data.scheduledNotification&&t.data.scheduledNotification.availableLanguages)&&-1!==t.data.scheduledNotification.availableLanguages.indexOf(this.$i18n.locale));var r=-1!==e.notifications.findIndex((function(e){return e._id===t._id}));n&&!r&&(e.notifications.unshift(t),e.notifications.length>e.limitDisplayNotifications&&(e.notifications=e.notifications.slice(0,e.limitDisplayNotifications)))},SET_NOTIFICATIONS:function(e,t){var n=this,r=t.filter((function(e){return"MZ_SCHEDULED_NOTIFICATION"!==e.type||!!(e.data&&e.data.scheduledNotification&&e.data.scheduledNotification.availableLanguages)&&-1!==e.data.scheduledNotification.availableLanguages.indexOf(n.$i18n.locale)})),o={};r.forEach((function(e){o[e._id]||(o[e._id]=e)})),e.notifications=Object.values(o)},UPDATE_NOTIFICATION:function(e,t){var n=e.notifications.findIndex((function(e){return e._id===t._id}));n>
1=0&&Object.assign(e.notifications[n],t)},CLEAR_NOTIFICATIONS:function(e){e.notifications=[]},SET_SCHEDULED_NOTIFICATIONS:function(e,t){e.scheduledNotifications=t},UPDATE_SCHEDULED_NOTIFICATION_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.scheduledNotification,r)},ADD_SCHEDULED_NOTIFICATION:function(e,t){e.scheduledNotifications.unshift(t.notification)},UPDATE_SCHEDULED_NOTIFICATION:function(e,t){var n=e.scheduledNotifications.findIndex((function(e){return e._id===t.notification._id}));n>=0&&Object.assign(e.scheduledNotifications[n],t.notification)},RESET_SCHEDULED_NOTIFICATION:function(e){e.scheduledNotification=Object.assign({},{_id:null,availableLanguages:["en","fr"],title:"",description:"",visualUrl:"",primaryAction:{label:"",url:""},secondaryAction:{label:"",url:""},scheduledAt:null,sended:!1,sendInProgress:!1,nbCreatedNotification:0,sendToType:"all",sendToData:""})},RESET_STATE:function(e){Object.assign(e,{notifications:[],limitDisplayNotifications:20,scheduledNotification:{_id:null,availableLanguages:["en","fr"],title:"",description:"",visualUrl:"",primaryAction:{label:"",url:""},secondaryAction:{label:"",url:""},scheduledAt:null,sended:!1,sendInProgress:!1,nbCreatedNotification:0,sendToType:"all",sendToData:""},scheduledNotifications:[],scheduledNotificationsCount:0})}},v={namespaced:!0,state:m,getters:{getNbUnreadNotification:function(e){return null===e.notifications?0:e.notifications.filter((function(e){return!1===e.read})).length}},actions:{LOAD_NOTIFICATIONS:function(e){var t=this;return this.$axios.get("/api/v1/notification/",{params:{limit:e.state.limitDisplayNotifications}}).then((function(e){return e.data})).then((function(t){return e.commit("SET_NOTIFICATIONS",t),!0}),(function(n){return t.dispatch("api/API_ERROR",n.response?n.response.data:n),e.commit("CLEAR_NOTIFICATIONS"),!1}))},SET_READ_NOTIFICATION:function(e,t){var n=this,r=t.notificationIds;return this.$axios.put("/api/v1/notification/read",{notificationIds:r}).then((function(e){return e.data})).then((function(t){if(t&&t.success){var n=!0,o=!1,l=void 0;try{for(var c,d=r[Symbol.iterator]();!(n=(c=d.next()).done);n=!0){var h=c.value;e.commit("UPDATE_NOTIFICATION",{_id:h,read:!0})}}catch(e){o=!0,l=e}finally{try{n||null==d.return||d.return()}finally{if(o)throw l}}return!0}return!1}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},SET_CLICK_NOTIFICATION:function(e,t){var n=this,r=t.notificationId,o=t.type;return this.$axios.put("/api/v1/notification/click",{notificationId:r,type:o}).then((function(e){return e.data})).then((function(e){return!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},CLEAR_NOTIFICATIONS:function(e){e.commit("CLEAR_NOTIFICATIONS")},LOAD_SCHEDULED_NOTIFICATIONS:(f=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{filter:{}},e.abrupt("return",this.$axios.get("/api/v1/notification/scheduled?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return console.log("SET_SCHEDULED_NOTIFICATIONS",e),t.commit("SET_SCHEDULED_NOTIFICATIONS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"SCHEDULED_NOTIFICATIONS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)}),COUNT_SCHEDULED_NOTIFICATIONS:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/notification/scheduled/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return t.commit("UPDATE_ROOT_FIELD",{key:"scheduledNotificationsCount",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT SCHEDULED_NOTIFICATIONS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),LOAD_SCHEDULED_NOTIFICATION:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/notification/scheduled/"+c.a.normalizePayloadURI(n,"notificationId")).then((function(e){return e.data})).then((function(e){return r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"availableLanguages",value:e.availableLanguages}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"title",value:e.title}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"description",value:e.description}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"visualUrl",value:e.visualUrl}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"primaryAction",value:e.primaryAction}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"secondaryAction",value:e.secondaryAction}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"scheduledAt",value:e.scheduledAt}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sended",value:e.sended}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sendInProgress",value:e.sendInProgress}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"nbCreatedNotification",value:e.nbCreatedNotification}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sendToType",value:e.sendToType}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sendToData",value:e.sendToData}),r.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"notification is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)}),SAVE_SCHEDULED_NOTIFICATION:function(e,t){var n=this,r=null===e.state.scheduledNotification._id?"post":"put",o=null===e.state.scheduledNotification._id?"":e.state.scheduledNotification._id;return this.$axios[r]("/api/v1/notification/scheduled/"+o,e.state.scheduledNotification).then((function(e){return e.data})).then((function(e){return n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"_id",value:e._id}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"availableLanguages",value:e.availableLanguages}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"title",value:e.title}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"description",value:e.description}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"visualUrl",value:e.visualUrl}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"primaryAction",value:e.primaryAction}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"secondaryAction",value:e.secondaryAction}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"scheduledAt",value:e.scheduledAt}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sended",value:e.sended}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sendInProgress",value:e.sendInProgress}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"nbCreatedNotification",value:e.nbCreatedNotification}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sendToType",value:e.sendToType}),n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",{key:"sendToData",value:e.sendToData}),0===o.length?n.commit("notification/ADD_SCHEDULED_NOTIFICATION",{notification:e}):n.commit("notification/UPDATE_SCHEDULED_NOTIFICATION",{notification:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"notification is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))}},mutations:y};t.default=v},function(e,t,n){"use strict";n.r(t);n(26),n(7),n(28);var r=n(3),o=(n(30),n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h,f,m=function(){return{offers:[],offersCount:0,offersPayload:null,offer:{_id:null,name:"",isPublic:!1,isDefault:!1,tag:"free",marketType:"B2C",duration:{durationTime:1,durationDate:"",durationUnit:"year"},offerSettings:{availableTemplates:[],limits:{numberWorkspaceUsers:-1,numberCollaborators:-1,numberPages:-1},accessList:[]},stripePriceId:null,productPrice:null,upgradeIndex:0}}},y={SET_OFFERS:function(e,t){e.offers=t},ADD_OFFER:function(e,t){e.offers.push(t.offer)},UPDATE_OFFER:function(e,t){var n=e.offers.findIndex((function(e){return e._id===t.offer._id}));n>=0&&Object.assign(e.offers[n],t.offer)},REMOVE_OFFER:function(e,t){var n=e.offers.findIndex((function(e){return e._id===t}));n>=0&&e.offers.splice(n,1)},SET_CURRENT_OFFER:function(e,t){e.offer=null===t?Object.assign({},{_id:null,name:"",isPublic:!1,isDefault:!1,tag:"free",marketType:"B2C",duration:{durationTime:1,durationDate:"",durationUnit:"year"},offerSettings:{availableTemplates:[],limits:{numberWorkspaceUsers:-1,numberCollaborators:-1,numberPages:-1},accessList:[]},stripePriceId:null,productPrice:null,upgradeIndex:0}):Object.assign({},e.offer,e.offers.find((function(e){return e._id==t})))},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.offer,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.offer[t.key].findIndex(t.cb):e.offer[t.key].indexOf(t.value);n>=0&&e.offer[t.key].splice(n,1)}else e.offer[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.offer[t.key][t.from];e.offer[t.key][t.from]=e.offer[t.key][t.to],o.default.set(e.offer[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_OFFER:function(e){e.offer=Object.assign({},{_id:null,name:"",isPublic:!1,isDefault:!1,tag:"free",marketType:"B2C",duration:{durationTime:1,durationDate:"",durationUnit:"year"},offerSettings:{availableTemplates:[],limits:{numberWorkspaceUsers:-1,numberCollaborators:-1,numberPages:-1},accessList:[]},stripePriceId:null,productPrice:null,upgradeIndex:0})},RESET_OFFERS:function(e){e.offers=[],e.offersCount=0,e.offersPayload=null},RESET_STATE:function(e){Object.assign(e,m)}},v={namespaced:!0,state:m,getters:{getOffers:function(e){return e.offers},getDefaultOffer:function(e){return{_id:null,name:"",isPublic:!1,isDefault:!1,tag:"free",marketType:"B2C",duration:{durationTime:1,durationDate:"",durationUnit:"year"},offerSettings:{availableTemplates:[],limits:{numberWorkspaceUsers:-1,numberCollaborators:-1,numberPages:-1},accessList:[]},stripePriceId:null,productPrice:null,upgradeIndex:0}},listOfferTag:function(e){return["free","premium","gold","platinum","education","education_project","enterprise","custom"].map((function(e){return{value:e,image:"/badges/"+e+".svg"}}))},offerTagData:function(e){return{free:{textColor:"#fff",backgroundColor:"#bdbdbd"},premium:{textColor:"#fff",backgroundColor:"#2f80ed"},gold:{textColor:"#fff",backgroundColor:"#f2af4a"},platinum:{textColor:"#828282",backgroundColor:"#d7d7d7"},education:{textColor:"#fff",backgroundColor:"#25b585"},education_project:{textColor:"#fff",backgroundColor:"#25b585"},enterprise:{textColor:"#fff",backgroundColor:"#cc3333"},custom:{textColor:"#fff",backgroundColor:"#9b51e0"}}},listOfferMarketType:function(e){return[{value:"B2C",label:"B2C"},{value:"COMIN",label:"Com'In"},{value:"EDU",label:"Education"},{value:"B2B",label:"B2B"}]},listExistingAccess:function(e){return{workspace:[{value:"organization:addWorkspace",label:"Add workspace"}
1,{value:"magazine:createFrom:all",label:"All public published templates"},{value:"magazine:createWithPublicOffer",label:"Create magazine with public offer"},{value:"offer:hideUpgradeAction",label:"Hide upgrade plan"},{value:"workspace:exportMagazinesZip",label:"Export workspace magazine (ZIP)"}],magazine:[{value:"collaboration:create",label:"Activate collaboration"},{value:"magazine:pdfRequest:withoutWatermark",label:"PDF without watermark"},{value:"magazine:pdfRequest:web",label:"Access to PDF web"},{value:"magazine:pdfRequest:hd",label:"Access to PDF hd"},{value:"magazine:pdfRequest:print",label:"Access to PDF print (hd with margin)"},{value:"magazine:pdfRequest:viewercode",label:"Access to viewer zip code"},{value:"magazine:printRequest",label:"Access print order"},{value:"magazine:privacyManagement",label:"Privacy management (no index)"},{value:"magazine:basicStats",label:"Basic stats (# of views)"},{value:"magazine:trackingViewer",label:"Tracking viewer (Analytics)"},{value:"magazine:personnalizeViewer",label:"Personnalize viewer (Logo and Link)"},{value:"magazine:duplicateMagazine",label:"Duplicate published magazine"},{value:"magazine:duplicateInOtherLanguage",label:"Duplicate in other lang (AI)"},{value:"magazine:updatePageDataObjects",label:"Access to creator mode"}]}},listExistingLimits:function(e){return{workspace:[{value:"numberWorkspaceUsers",label:"Nb max workspace users"}],magazine:[{value:"numberCollaborators",label:"Nb max collaborators"},{value:"numberPages",label:"Nb max pages"}]}}},actions:{LOAD_OFFERS:(f=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>1&&void 0!==o[1]?o[1]:{filter:{}},!(null!==t.state.offers&&t.state.offers.length>0&&t.state.offersPayload===JSON.stringify(n))){e.next=4;break}return console.log("LOAD_OFFERS already in state"),e.abrupt("return",Promise.resolve(!0));case 4:return this.commit("offer/UPDATE_ROOT_FIELD",{key:"offersPayload",value:JSON.stringify(n)}),e.abrupt("return",this.$axios.get("/api/v1/offer?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("offer/SET_OFFERS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"OFFERS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)}),COUNT_OFFERS:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/offer/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("offer/UPDATE_ROOT_FIELD",{key:"offersCount",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT OFFERS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),LOAD_OFFER:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.offer._id){e.next=3;break}return console.log("LOAD_OFFER already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/offer/"+c.a.normalizePayloadURI(n,"offerId")).then((function(e){return e.data})).then((function(e){return r.commit("offer/UPDATE_FIELD",{key:"name",value:e.name}),r.commit("offer/UPDATE_FIELD",{key:"isPublic",value:e.isPublic}),r.commit("offer/UPDATE_FIELD",{key:"isDefault",value:e.isDefault}),r.commit("offer/UPDATE_FIELD",{key:"tag",value:e.tag}),r.commit("offer/UPDATE_FIELD",{key:"marketType",value:e.marketType}),r.commit("offer/UPDATE_FIELD",{key:"duration",value:e.duration}),r.commit("offer/UPDATE_FIELD",{key:"offerSettings",value:e.offerSettings}),r.commit("offer/UPDATE_FIELD",{key:"stripePriceId",value:e.stripePriceId}),r.commit("offer/UPDATE_FIELD",{key:"productPrice",value:e.productPrice}),r.commit("offer/UPDATE_FIELD",{key:"upgradeIndex",value:e.upgradeIndex}),r.commit("offer/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"offer is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)}),SAVE_OFFER:function(e,t){var n=this,r=null===e.state.offer._id?"post":"put",o=null===e.state.offer._id?"":e.state.offer._id;return this.$axios[r]("/api/v1/offer/"+o,e.state.offer).then((function(e){return e.data})).then((function(e){return n.commit("offer/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("offer/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("offer/UPDATE_FIELD",{key:"isPublic",value:e.isPublic}),n.commit("offer/UPDATE_FIELD",{key:"isDefault",value:e.isDefault}),n.commit("offer/UPDATE_FIELD",{key:"tag",value:e.tag}),n.commit("offer/UPDATE_FIELD",{key:"marketType",value:e.marketType}),n.commit("offer/UPDATE_FIELD",{key:"duration",value:e.duration}),n.commit("offer/UPDATE_FIELD",{key:"offerSettings",value:e.offerSettings}),n.commit("offer/UPDATE_FIELD",{key:"stripePriceId",value:e.stripePriceId}),n.commit("offer/UPDATE_FIELD",{key:"productPrice",value:e.productPrice}),n.commit("offer/UPDATE_FIELD",{key:"upgradeIndex",value:e.upgradeIndex}),0===o.length?n.commit("offer/ADD_OFFER",{offer:e}):n.commit("offer/UPDATE_OFFER",{offer:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"offer is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_OFFER:function(e,t){var n=this,r=t.id||e.state.offer._id;return this.$axios.delete("/api/v1/offer/"+r).then((function(e){return e.data})).then((function(e){return n.commit("offer/REMOVE_OFFER",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"offer has been deleted"}),n.commit("offer/RESET_OFFER"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))}},mutations:y};t.default=v},function(e,t,n){"use strict";n.r(t);n(28);var r=n(3),o=(n(30),n(47),n(26),n(11),n(7),n(91),n(1)),l=n(2),c=n(200),d=n.n(c),h=n(12);o.default.use(l.a);var f,m,y,v,_,O,E,k,S,A,T,P,C=function(){return{orders:[],ordersCount:null,order:{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]},printQuote:null,currentCart:{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]}}},x={SET_ORDERS:function(e,t){e.orders=t},ADD_ORDER:function(e,t){e.orders.unshift(t.order)},UPDATE_ORDER:function(e,t){var n=e.orders.findIndex((function(e){return e._id===t.order._id}));n>=0&&Object.assign(e.orders[n],t.order)},REMOVE_ORDER:function(e,t){var n=e.orders.findIndex((function(e){return e._id===t}));n>=0&&e.orders.splice(n,1)},SET_CURRENT_ORDER:function(e,t){e.order=null===t?Object.assign({},{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]}):Object.assign({},e.order,e.orders.find((function(e){return e._id==t})))},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;h.a.setProperty(n,e.order,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;h.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.order[t.key].findIndex(t.cb):e.order[t.key].indexOf(t.value);n>=0&&e.order[t.key].splice(n,1)}else e.order[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.order[t.key][t.from];e.order[t.key][t.from]=e.order[t.key][t.to],o.default.set(e.order[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_ORDER:function(e){e.order=Object.assign({},{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]})},RESET_PRINT_QUOTE:function(e){h.a.setProperty("printQuote",e,null)},RESET_STATE:function(e){Object.assign(e,{orders:[],ordersCount:null,order:{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]},printQuote:null,currentCart:{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]}})}},D={namespaced:!0,state:C,getters:{getOrders:function(e){return e.orders},getDefaultOrder:function(e){return{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]}},getAvailableCountries:function(){return Object.values(d.a).map((function(e){return{code:e.alpha2Code,name:e.name}})).sort((function(e,t){return e.name.localeCompare(t.name)}))},getAvailableQuantities:function(){return[1,5,10,15,20,30,40,50,100,150,200,250,300]}},actions:{LOAD_USER_ORDERS:(P=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/order/listByUser").then((function(e){return e.data})).then((function(e){return r.commit("order/SET_ORDERS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"ORDERS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)}),LOAD_ORDERS:(T=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/order/list?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("order/SET_ORDERS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"ORDERS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)}),COUNT_ORDERS:(A=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/order/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("order/UPDATE_ROOT_FIELD",{key:"ordersCount",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT ORDERS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)}),EXPORT_ORDERS:(S=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/order/export?filter="+JSON.stringify(n.filter)+"&sort="+n.sort).then((function(e){return e.data})).then((function(data){return r.dispatch("api/API_SUCCESS",data),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)}),LOAD_ORDER:(k=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.order._id||n.force){e.next=3;break}return console.log("LOAD_ORDER already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/order/"+h.a.normalizePayloadURI(n,"orderId")).then((function(e){return e.data})).then((function(e){return r.commit("order/UPDATE_ORDER",{order:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"order is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)}),REFRESH_ORDER_STATUS:function(e,t){var n=this,r=t.orderId;return this.$axios.put("/api/v1/order/"+r+"/updateStatus").then((function(e){return e.data})).then((function(e){return n.commit("order/UPDATE_ORDER",{order:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"order status is updated"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},REQUEST_PRINT_PRODUCT_QUOTE:(E=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,o=n.printQuoteData,e.abrupt("return",this.$axios.post("/api/v1/order/print/quote",{magazineId:r,printQuoteData:o}).then((function(e){return e.data})).then((function(e){return l.commit("order/UPDATE_ROOT_FIELD",{key:"printQuote",value:e}),l.dispatch("api/API_SUCCESS",{type:"info",message:"success get print quote"}),!0}),(function(e){return l.commit("order/RESET_PRINT_QUOTE"),l.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)}),ADD_QUOTE_TO_CART:(O=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.state.printQuote){e.next=3;break}return e.abrupt("return",!1);case 3:return e.abrupt("return",this.$axios.post("/api/v1/order/print/addToCart",{printQuoteResult:n}).then((function(e){return e.data})).then((function(e){var t=e.order;return r.commit("order/RESET_PRINT_QUOTE"),r.commit("order/UPDATE_ROOT_FIELD",{key:"currentCart",value:t}),r.dispatch("api/API_SUCCESS",{type:"info",message:"success add to cart"}),!0}),(function(e){return r.commit("order/RESET_PRINT_QUOTE"),r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)}),LOAD_CURRENT_CART:(_=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/order/cart"+(n&&n.orderId?"?orderId="+n.orderId:"")).then((function(e){return e.data})).then((function(e){var t=e.order;return r.commit("order/UPDATE_ROOT_FIELD",{key:"currentCart",value:t||{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]}}),r.dispatch("api/API_SUCCESS",{type:"info",message:"success load cart"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)}),UPDATE_CURRENT_CART:(v=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.printProductId,o=n.key,l=n.value,e.abrupt("return",this.$axios.put("/api/v1/order/cart",{printProductId:r,key:o,value:l}).then((function(e){return e.data})).then((function(e){var t=e.order;return c.commit("order/UPDATE_ROOT_FIELD",{key:"currentCart",value:t||{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]}}),c.dispatch("api/API_SUCCESS",{type:"info",message:"success load cart"}),!0}),(function(e){return c.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),CONFIRM_CURRENT_CART_ADDRESS:(y=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function
1(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.post("/api/v1/order/cart/confirmAddress",n).then((function(e){return e.data})).then((function(e){var t=e.order,n=e.checkout;return r.commit("order/UPDATE_ROOT_FIELD",{key:"currentCart",value:t||{_id:null,orderReferenceId:null,organization:null,status:"draft",deleted:!1,price:null,currency:"EUR",error:"",shippingAddress:null,printProducts:[],offerProducts:[]}}),r.dispatch("api/API_SUCCESS",{type:"info",message:"success confirm cart"}),{checkout:n}}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)}),RETRIEVE_CHECKOUT_SESSION:function(e,t){var n=this,r=t.stripeSessionId;return this.$axios.post("/api/v1/stripe/retrieve-session",{stripeSessionId:r}).then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"retrive session success"}),e}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},LOAD_DATA_FOR_ADMIN_ORDER:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,e.abrupt("return",this.$axios.get("/api/v1/order/adminOrder/"+r).then((function(e){return e.data})).then((function(data){return o.dispatch("api/API_SUCCESS",{type:"info",message:"success load data for admin order"}),data}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),CREATE_ADMIN_ORDER:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,o=n.orderData,e.abrupt("return",this.$axios.post("/api/v1/order/adminOrder/"+r,{orderData:o}).then((function(e){return e.data})).then((function(e){var t=e.order;return l.commit("order/ADD_ORDER",{order:t}),l.dispatch("api/API_SUCCESS",{type:"info",message:"success create admin order"}),!0}),(function(e){return l.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},mutations:x};t.default=D},function(e,t,n){"use strict";n.r(t);n(26),n(28);var r=n(3),o=(n(30),n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h,f,m,y,v,_,O,E=function(){return{workspaces:[],workspacesCount:0,workspace:{_id:null,ssoIdentifier:"",organization:null,name:"",status:"active",users:[],activeOffer:null,offers:[],recursiveActiveOffer:null,createdAt:null,exportedZips:null}}},k={SET_WORKSPACES:function(e,t){e.workspaces=t},SET_WORKSPACES_COUNT:function(e,t){var n=t.count;e.workspacesCount=n},ADD_WORKSPACE:function(e,t){e.workspaces.push(t.workspace)},UPDATE_WORKSPACE:function(e,t){var n=e.workspaces.findIndex((function(e){return e._id===t.workspace._id}));n>=0&&Object.assign(e.workspaces[n],t.workspace),null!==e.workspace&&e.workspace._id===t.workspace._id&&Object.assign(e.workspace,t.workspace)},REMOVE_WORKSPACE:function(e,t){var n=e.workspaces.findIndex((function(e){return e._id===t}));n>=0&&e.workspaces.splice(n,1)},SET_CURRENT_WORKSPACE:function(e,t){e.workspace=null===t?Object.assign({}
1,{_id:null,ssoIdentifier:"",organization:null,name:"",status:"active",users:[],activeOffer:null,offers:[],recursiveActiveOffer:null,createdAt:null,exportedZips:null}):Object.assign({},e.workspace,e.workspaces.find((function(e){return e._id==t})))},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.workspace,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.workspace[t.key].findIndex(t.cb):e.workspace[t.key].indexOf(t.value);n>=0&&e.workspace[t.key].splice(n,1)}else e.workspace[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.workspace[t.key][t.from];e.workspace[t.key][t.from]=e.workspace[t.key][t.to],o.default.set(e.workspace[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_WORKSPACE:function(e){e.workspace=Object.assign({},{_id:null,ssoIdentifier:"",organization:null,name:"",status:"active",users:[],activeOffer:null,offers:[],recursiveActiveOffer:null,createdAt:null,exportedZips:null})},RESET_STATE:function(e){Object.assign(e,{workspaces:[],workspacesCount:0,workspace:{_id:null,ssoIdentifier:"",organization:null,name:"",status:"active",users:[],activeOffer:null,offers:[],recursiveActiveOffer:null,createdAt:null,exportedZips:null}})}},S={namespaced:!0,state:E,getters:{},actions:{LOAD_WORKSPACES:(O=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/workspace/list?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("workspace/SET_WORKSPACES",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"WORKSPACES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)}),COUNT_WORKSPACES:(_=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/workspace/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("workspace/SET_WORKSPACES_COUNT",{count:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT WORKSPACES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)}),LOAD_WORKSPACE:(v=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/workspace/"+c.a.normalizePayloadURI(n,"workspaceId")).then((function(e){return e.data})).then((function(e){return r.commit("workspace/UPDATE_FIELD",{key:"ssoIdentifier",value:e.ssoIdentifier}),r.commit("workspace/UPDATE_FIELD",{key:"name",value:e.name}),r.commit("workspace/UPDATE_FIELD",{key:"organization",value:e.organization}),r.commit("workspace/UPDATE_FIELD",{key:"status",value:e.status}),r.commit("workspace/UPDATE_FIELD",{key:"users",value:e.users}),r.commit("workspace/UPDATE_FIELD",{key:"offers",value:e.offers}),r.commit("workspace/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),r.commit("workspace/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),r.commit("workspace/UPDATE_FIELD",{key:"createdAt",value:e.createdAt}),r.commit("workspace/UPDATE_FIELD",{key:"exportedZips",value:e.exportedZips}),r.commit("workspace/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"workspace is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),SAVE_WORKSPACE:function(e,t){var n=this;return this.$axios.post("/api/v1/workspace/",e.state.workspace).then((function(e){return e.data})).then((function(e){return n.commit("workspace/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("workspace/UPDATE_FIELD",{key:"ssoIdentifier",value:e.ssoIdentifier}),n.commit("workspace/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("workspace/UPDATE_FIELD",{key:"organization",value:e.organization}),n.commit("workspace/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("workspace/UPDATE_FIELD",{key:"users",value:e.users}),n.commit("workspace/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("workspace/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),n.commit("workspace/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),n.commit("workspace/UPDATE_FIELD",{key:"createdAt",value:e.createdAt}),n.commit("workspace/UPDATE_FIELD",{key:"exportedZips",value:e.exp
1ortedZips}),n.commit("workspace/ADD_WORKSPACE",{workspace:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"workspace is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},INVIT_USER_IN_WORKSPACE:function(e,t){var n=this;return this.$axios.post("/api/v1/workspace/invitUser",t).then((function(e){return e.data})).then((function(e){return n.commit("workspace/UPDATE_WORKSPACE",{workspace:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"invit user success"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},INVIT_EXISTING_USERS_IN_WORKSPACE:function(e,t){var n=this;return this.$axios.post("/api/v1/workspace/invitExistingUsers",t).then((function(e){return e.data})).then((function(e){return n.commit("workspace/UPDATE_WORKSPACE",{workspace:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"invit user success"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},REMOVE_USER_FROM_WORKSPACE:(y=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/workspace/removeUser",n).then((function(e){return e.data})).then((function(e){return r.commit("workspace/UPDATE_WORKSPACE",{workspace:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"remove user success"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)}),UPDATE_WORKSPACE:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/workspace/"+n.workspaceId,n).then((function(e){return e.data})).then((function(e){return r.commit("workspace/UPDATE_WORKSPACE",{workspace:e}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),UPDATE_WORKSPACE_NAME:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/workspace/"+n.workspaceId+"/updateName",n).then((function(e){return e.data})).then((function(e){return r.commit("workspace/UPDATE_WORKSPACE",{workspace:e}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),UPDATE_WORKSPACE_USER:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/workspace/"+n.workspaceId+"/updateUser",n).then((function(e){return e.data})).then((function(e){return r.commit("workspace/UPDATE_WORKSPACE",{workspace:e}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),DELETE_WORKSPACE:function(e,t){var n=this,r=t.id||e.state.workspace._id;return this.$axios.delete("/api/v1/workspace/"+r).then((function(e){return e.data})).then((function(e){return n.commit("workspace/REMOVE_WORKSPACE",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"workspace has been deleted"}),n.commit("workspace/RESET_WORKSPACE"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},REQUEST_EXPORT_MAGAZINES_ZIP:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.post("/api/v1/workspace/"+n.workspaceId+"/requestMagazinesZip",n).then((function(e){return e.data})).then((function(e){return r.commit("workspace/UPDATE_WORKSPACE",{workspace:e}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},mutations:k};t.default=S},function(e,t,n){"use strict";n.r(t);n(26),n(7),n(28);var r=n(3),o=(n(30),n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h,f,m,y,v,_,O,E,k,S,A,T=function(){return{organizations:[],organizationsCount:0,workspacesByOrganizations:[],organization:{_id:null,marketType:"",collaborationType:"nickname",name:"",admin:null,status:"active",contactEmail:"",adminComment:"",sessionStrategy:"",authentificationStrategy:"",ssoConfiguration:null,alternativeSsoConfiguration:null,users:[],workspaces:[],activeOffer:null,offers:[],recursiveActiveOffer:null,stripeCustomerId:"",tags:[],fromGroupOffer:!1,lang:"",createdAt:null,statsAccessKey:null},organizationTagIndex:[]}},P={SET_ORGANIZATIONS:function(e,t){e.organizations=t},SET_ORGANIZATIONS_COUNT:function(e,t){var n=t.count;e.organizationsCount=n},SET_WORKSPACES_BY_ORGANIZATION:function(e,t){e.workspacesByOrganizations=t},ADD_ORGANIZATION:function(e,t){e.organizations.push(t.organization)},UPDATE_ORGANIZATION:function(e,t){var n=e.organizations.findIndex((function(e){return e._id===t.organization._id}));n>=0&&Object.assign(e.organizations[n],t.organization),null!==e.organization&&e.organization._id===t.organization._id&&Object.assign(e.organization,t.organization)},REMOVE_ORGANIZATION:function(e,t){var n=e.organizations.findIndex((function(e){return e._id===t}));n>=0&&e.organizations.splice(n,1)},SET_CURRENT_ORGANIZATION:function(e,t){e.organization=null===t?Object.assign({},{_id:null,marketType:"",collaborationType:"nickname",name:"",admin:null,status:"active",contactEmail:"",adminComment:"",sessionStrategy:"",authentificationStrategy:"",ssoConfiguration:null,alternativeSsoConfiguration:null,users:[],workspaces:[],activeOffer:null,offers:[],recursiveActiveOffer:null,stripeCustomerId:"",tags:[],fromGroupOffer:!1,lang:"",createdAt:null,statsAccessKey:null}):Object.assign({},e.organization,e.organizations.find((function(e){return e._id==t})))},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.organization,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.organization[t.key].findIndex(t.cb):e.organization[t.key].indexOf(t.value);n>=0&&e.organization[t.key].splice(n,1)}else e.organization[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.organization[t.key][t.from];e.organization[t.key][t.from]=e.organization[t.key][t.to],o.default.set(e.organization[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_ORGANIZATION:function(e){e.organization=Object.assign({},{_id:null,marketType:"",collaborationType:"nickname",name:"",admin:null,status:"active",contactEmail:"",adminComment:"",sessionStrategy:"",authentificationStrategy:"",ssoConfiguration:null,alternativeSsoConfiguration:null,users:[],workspaces:[],activeOffer:null,offers:[],recursiveActiveOffer:null,stripeCustomerId:"",tags:[],fromGroupOffer:!1,lang:"",createdAt:null,statsAccessKey:null})},RESET_STATE:function(e){Object.assign(e,{organizations:[],organizationsCount:0,workspacesByOrganizations:[],organization:{_id:null,marketType:"",collaborationType:"nickname",name:"",admin:null,status:"active",contactEmail:"",adminComment:"",sessionStrategy:"",authentificationStrategy:"",ssoConfiguration:null,alternativeSsoConfiguration:null,users:[],workspaces:[],activeOffer:null,offers:[],recursiveActiveOffer:null,stripeCustomerId:"",tags:[],fromGroupOffer:!1,lang:"",createdAt:null,statsAccessKey:null},organizationTagIndex:[]})}},C={namespaced:!0,state:T,getters:{listOrganizationMarketType:function(e){return[{value:"B2C",label:"B2C"},{value:"EDU",label:"Education"},{value:"B2B",label:"B2B"}]}},actions:{LOAD_ORGANIZATIONS:(A=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/organization/list?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("organization/SET_ORGANIZATIONS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"ORGANIZATIONS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)}),COUNT_ORGANIZATIONS:(S=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/organization/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("organization/SET_ORGANIZATIONS_COUNT",{count:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT ORGANIZATIONS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)}),LOAD_ALL_WORKSPACES_BY_ORGANIZATION:(k=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.state.workspacesByOrganizations&&t.state.workspacesByOrganizations.length>0)){e.next=3;break}return console.log("WORKSPACES_BY_ORGANIZATION already in state"),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/organization/listAllWorksp
1aceByOrganization").then((function(e){return e.data})).then((function(e){return r.commit("organization/SET_WORKSPACES_BY_ORGANIZATION",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"WORKSPACES BY ORGANIZATION are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)}),LOAD_ORGANIZATION:(E=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/organization/"+c.a.normalizePayloadURI(n,"organizationId")).then((function(e){return e.data})).then((function(e){return r.commit("organization/UPDATE_FIELD",{key:"marketType",value:e.marketType}),r.commit("organization/UPDATE_FIELD",{key:"collaborationType",value:e.collaborationType}),r.commit("organization/UPDATE_FIELD",{key:"name",value:e.name}),r.commit("organization/UPDATE_FIELD",{key:"admin",value:e.admin}),r.commit("organization/UPDATE_FIELD",{key:"status",value:e.status}),r.commit("organization/UPDATE_FIELD",{key:"contactEmail",value:e.contactEmail}),r.commit("organization/UPDATE_FIELD",{key:"adminComment",value:e.adminComment}),r.commit("organization/UPDATE_FIELD",{key:"sessionStrategy",value:e.sessionStrategy}),r.commit("organization/UPDATE_FIELD",{key:"authentificationStrategy",value:e.authentificationStrategy}),r.commit("organization/UPDATE_FIELD",{key:"ssoConfiguration",value:e.ssoConfiguration}),r.commit("organization/UPDATE_FIELD",{key:"alternativeSsoConfiguration",value:e.alternativeSsoConfiguration}),r.commit("organization/UPDATE_FIELD",{key:"users",value:e.users}),r.commit("organization/UPDATE_FIELD",{key:"workspaces",value:e.workspaces}),r.commit("organization/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),r.commit("organization/UPDATE_FIELD",{key:"offers",value:e.offers}),r.commit("organization/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),r.commit("organization/UPDATE_FIELD",{key:"stripeCustomerId",value:e.stripeCustomerId}),r.commit("organization/UPDATE_FIELD",{key:"tags",value:e.tags}),r.commit("organization/UPDATE_FIELD",{key:"fromGroupOffer",value:e.fromGroupOffer}),r.commit("organization/UPDATE_FIELD",{key:"statsAccessKey",value:e.statsAccessKey}),r.commit("organization/UPDATE_FIELD",{key:"lang",value:e.lang}),r.commit("organization/UPDATE_FIELD",{key:"createdAt",value:e.createdAt}),r.commit("organization/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"organization is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)}),SAVE_ORGANIZATION:function(e,t){var n=this;return this.$axios.post("/api/v1/organization/",e.state.organization).then((function(e){return e.data})).then((function(e){return n.commit("organization/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("organization/UPDATE_FIELD",{key:"marketType",value:e.marketType}),n.commit("organization/UPDATE_FIELD",{key:"collaborationType",value:e.collaborationType}),n.commit("organization/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("organization/UPDATE_FIELD",{key:"admin",value:e.admin}),n.commit("organization/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("organization/UPDATE_FIELD",{key:"contactEmail",value:e.contactEmail}),n.commit("organization/UPDATE_FIELD",{key:"adminComment",value:e.adminComment}),n.commit("organization/UPDATE_FIELD",{key:"sessionStrategy",value:e.sessionStrategy}),n.commit("organization/UPDATE_FIELD",{key:"authentificationStrategy",value:e.authentificationStrategy}),n.commit("organization/UPDATE_FIELD",{key:"ssoConfiguration",value:e.ssoConfiguration}),n.commit("organization/UPDATE_FIELD",{key:"alternativeSsoConfiguration",value:e.alternativeSsoConfiguration}),n.commit("organization/UPDATE_FIELD",{key:"users",value:e.users}),n.commit("organization/UPDATE_FIELD",{key:"workspaces",value:e.workspaces}),n.commit("organization/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),n.commit("organization/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("organization/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),n.commit("organization/UPDATE_FIELD",{key:"stripeCustomerId",value:e.stripeCustomerId}),n.commit("organization/UPDATE_FIELD",{key:"tags",value:e.tags}),n.commit("organization/UPDATE_FIELD",{key:"fromGroupOffer",value:e.fromGroupOffer}),n.commit("organization/UPDATE_FIELD",{key:"statsAccessKey",value:e.statsAccessKey}),n.commit("organization/UPDATE_FIELD",{key:"lang",value:e.lang}),n.commit("organization/UPDATE_FIELD",{key:"createdAt",value:e.createdAt}),n.commit("organization/ADD_ORGANIZATION",{organization:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"organization is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},SAVE_GROUPOFFER:function(e,t){var n=this;return this.$axios.post("/api/v1/organization/groupOffer",t).then((function(e){return e.data})).then((function(e){return n.commit("organization/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("organization/UPDATE_FIELD",{key:"marketType",value:e.marketType}
1),n.commit("organization/UPDATE_FIELD",{key:"collaborationType",value:e.collaborationType}),n.commit("organization/UPDATE_FIELD",{key:"name",value:e.name}),n.commit("organization/UPDATE_FIELD",{key:"admin",value:e.admin}),n.commit("organization/UPDATE_FIELD",{key:"status",value:e.status}),n.commit("organization/UPDATE_FIELD",{key:"contactEmail",value:e.contactEmail}),n.commit("organization/UPDATE_FIELD",{key:"adminComment",value:e.adminComment}),n.commit("organization/UPDATE_FIELD",{key:"sessionStrategy",value:e.sessionStrategy}),n.commit("organization/UPDATE_FIELD",{key:"authentificationStrategy",value:e.authentificationStrategy}),n.commit("organization/UPDATE_FIELD",{key:"ssoConfiguration",value:e.ssoConfiguration}),n.commit("organization/UPDATE_FIELD",{key:"alternativeSsoConfiguration",value:e.alternativeSsoConfiguration}),n.commit("organization/UPDATE_FIELD",{key:"users",value:e.users}),n.commit("organization/UPDATE_FIELD",{key:"workspaces",value:e.workspaces}),n.commit("organization/UPDATE_FIELD",{key:"activeOffer",value:e.activeOffer}),n.commit("organization/UPDATE_FIELD",{key:"offers",value:e.offers}),n.commit("organization/UPDATE_FIELD",{key:"recursiveActiveOffer",value:e.recursiveActiveOffer}),n.commit("organization/UPDATE_FIELD",{key:"stripeCustomerId",value:e.stripeCustomerId}),n.commit("organization/UPDATE_FIELD",{key:"tags",value:e.tags}),n.commit("organization/UPDATE_FIELD",{key:"fromGroupOffer",value:e.fromGroupOffer}),n.commit("organization/UPDATE_FIELD",{key:"statsAccessKey",value:e.statsAccessKey}),n.commit("organization/UPDATE_FIELD",{key:"lang",value:e.lang}),n.commit("organization/UPDATE_FIELD",{key:"createdAt",value:e.createdAt}),n.commit("organization/ADD_ORGANIZATION",{organization:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"group offer is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},UPDATE_ORGANIZATION:(O=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/organization/"+n.organizationId,n).then((function(e){return e.data})).then((function(e){return r.commit("organization/UPDATE_ORGANIZATION",{organization:e}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)}),DELETE_ORGANIZATION:function(e,t){var n=this,r=t.id||e.state.organization._id;return this.$axios.delete("/api/v1/organization/"+r).then((function(e){return e.data})).then((function(e){return n.commit("organization/REMOVE_ORGANIZATION",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"organization has been deleted"}),n.commit("organization/RESET_ORGANIZATION"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},ADD_WORKSPACE_IN_ORGANIZATION:function(e,t){var n=this;return this.$axios.post("/api/v1/organization/"+t.organizationId+"/addWorkspace",t).then((function(e){return e.data})).then((function(e){return n.commit("organization/UPDATE_ORGANIZATION",{organization:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"add workspace success"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},ADD_USER_IN_ORGANIZATION:function(e,t){var n=this;return this.$axios.post("/api/v1/organization/"+t.organizationId+"/addUser",t).then((function(e){return e.data})).then((function(e){return n.commit("organization/UPDATE_ORGANIZATION",{organization:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"add user success"}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},REMOVE_USER_FROM_ORGANIZATION:(_=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/organization/removeUser",n).then((function(e){return e.data})).then((function(e){return r.commit("organization/UPDATE_ORGANIZATION",{organization:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"remove user success"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)}),UPDATE_ORGANIZATION_USER:(v=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.put("/api/v1/organization/"+n.organizationId+"/updateUser",n).then((function(e){return e.data})).then((function(e){return r.commit("organization/UPDATE_ORGANIZATION",{organization:e}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)}),LOAD_AVAILABLE_TAGS:(y=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n&&n.filter?"?filter="+JSON.stringify(n.filter):"",e.abrupt("return",this.$axios.get("/api/v1/organization/allBy/tags"+r).then((function(e){return e.data})).then((function(e){return o.commit("organization/UPDATE_ROOT_FIELD",{key:"organizationTagIndex",value:e}),!0}),(function(e){return console.log(e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)}),EXPORT_GROUP_OFFERS:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/organization/exportGroupOffers?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&rangeDate="+n.rangeDate).then((function(e){return e.data})).then((function(data){return r.dispatch("api/API_SUCCESS",data),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),LOAD_GROUP_OFFER:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.key?"?key="+n.key:"",e.abrupt("return",this.$axios.get("/api/v1/organization/groupoffer/"+n.id+r).then((function(e){return e.data})).then((function(data){return o.dispatch("api/API_SUCCESS",data),data}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),LOAD_GROUP_OFFER_STATS:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.key?"&key="+n.key:"",e.abrupt("return",this.$axios.get("/api/v1/organization/groupoffer/"+n.id+"/stats?rangeDate="+n.rangeDate+r).then((function(e){return e.data})).then((function(data){return o.dispatch("api/API_SUCCESS",data),data}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),GENERATE_GROUP_OFFER_STATS_KEY:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.post("/api/v1/organization/groupoffer/"+n.id+"/stats-key").then((function(e){return e.data})).then((function(data){return r.dispatch("api/API_SUCCESS",data),r.commit("organization/UPDATE_FIELD",{key:"statsAccessKey",value:data.statsAccessKey}),data}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},mutations:P};t.default=C},function(e,t,n){"use strict";n.r(t);n(28);var r=n(3),o=(n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h=function(){return{adminsettings:{_id:null,neededAppBuild:"0.0.0",maintenance:!1,maintenanceMessage:{title:"",description:""},publicMessage:{description:"",startAt:null,endAt:null,isClosable:!1}}}},f={UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.adminsettings,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.adminsettings[t.key].findIndex(t.cb):e.adminsettings[t.key].indexOf(t.value);n>=0&&e.adminsettings[t.key].splice(n,1)}else if(!0===t.update){var r=t.cb?e.adminsettings[t.key].findIndex(t.cb):e.adminsettings[t.key].indexOf(t.value);r>=0&&e.adminsettings[t.key].splice(r,1,t.value)}else e.adminsettings[t.key].push(t.value)},RESET_ADMINSETTINGS:function(e){e.adminsettings=Object.assign({},{_id:null,neededAppBuild:"0.0.0",maintenance:!1,maintenanceMessage:{title:"",description:""},publicMessage:{description:"",startAt:null,endAt:null,isClosable:!1}})},RESET_STATE:function(e){Object.assign(e,{adminsettings:{_id:null,neededAppBuild:"0.0.0",maintenance:!1,maintenanceMessage:{title:"",description:""},publicMessage:{description:"",startAt:null,endAt:null,isClosable:!1}}})}},m={namespaced:!0,state:h,getters:{},actions:{LOAD_ADMINSETTINGS:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/admin/adminsettings"+(n&&n.fromAdmin?"?fromAdmin=1":"")).then((function(e){return e.data})).then((function(e){return r.commit("adminsettings/UPDATE_FIELD",{key:"neededAppBuild",value:e.neededAppBuild}),r.commit("adminsettings/UPDATE_FIELD",{key:"maintenance",value:e.maintenance}),r.commit("adminsettings/UPDATE_FIELD",{key:"maintenanceMessage",value:e.maintenanceMessage}),r.commit("adminsettings/UPDATE_FIELD",{key:"publicMessage",value:e.publicMessage}),r.commit("adminsettings/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"Admin settings is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)}),SAVE_ADMINSETTINGS:function(e,t){var n=this;return this.$axios.put("/api/v1/admin/adminsettings",e.state.adminsettings).then((function(e){return e.data})).then((function(e){return n.commit("adminsettings/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("adminsettings/UPDATE_FIELD",{key:"neededAppBuild",value:e.neededAppBuild}),n.commit("adminsettings/UPDATE_FIELD",{key:"maintenance",value:e.maintenance}),n.commit("adminsettings/UPDATE_FIELD",{key:"maintenanceMessage",value:e.maintenanceMessage}),n.commit("adminsettings/UPDATE_FIELD",{key:"publicMessage",value:e.publicMessage}),n.dispatch("api/API_SUCCESS",{type:"info",message:"Admin settings is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},SEND_EXPORT_MAGAZINE_THUMB:function(e,t){var n=this;return this.$axios.post("/api/v1/admin/tools/exportMagazineThumb",{magazines:t.magazines,exportHD:t.exportHD}).then((function(e){return e.data})).then((function(e){return n.dispatch("api/API_SUCCESS",{type:"info",message:"Export magazine thumb request is sent"}),e}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))}},mutations:f};t.default=m},function(e,t,n){"use strict";n.r(t);n(26),n(7),n(28);var r=n(3),o=(n(30),n(47),n(1)),l=n(2),c=n(12);o.default.use(l.a);var d,h,f,m,y,v=function(){return{authStrategies:[],authStrategiesCount:0,authStrategy:{_id:null,debugMode:!1,strategy:"oauth2",key:null,clientId:null,clientSecret:null,scope:[],urlAuth:null,urlToken:null,urlData:null,validateUrl:null,loginUrl:null,logoutUrl:null,authResultMap:null,apiAccessToken:"",apiAccessExpireAt:null},authResultMaps:[],authResultMap:{_id:null,name:null,attributes:[]}}},_={SET_AUTHSTRATEGIES:function(e,t){e.authStrategies=t},SET_AUTHRESULTMAPS:function(e,t){e.authResultMaps=t},ADD_AUTHSTRATEGY:function(e,t){e.authStrategies.push(t.authStrategy)},ADD_AUTHRESULTMAP:function(e,t){e.authResultMaps.push(t.authResultMap)},UPDATE_AUTHSTRATEGY:function(e,t){var n=e.authStrategies.findIndex((function(e){return e._id===t.authStrategy._id}));n>=0&&Object.assign(e.authStrategies[n],t.authStrategy)},UPDATE_AUTHRESULTMAP:function(e,t){var n=e.authResultMaps.findIndex((function(e){return e._id===t.authResultMap._id}));n>=0&&Object.assign(e.authResultMaps[n],t.authResultMap)},REMOVE_AUTHSTRATEGY:function(e,t){var n=e.authStrategies.findIndex((function(e){return e._id===t}));n>=0&&e.authStrategies.splice(n,1)},REMOVE_AUTHRESULTMAP:function(e,t){var n=e.authResultMaps.findIndex((function(e){return e._id===t}));n>=0&&e.authResultMaps.splice(n,1)},SET_CURRENT_AUTHSTRATEGY:function(e,t){e.authStrategy=null===t?Object.assign({},{_id:null,debugMode:!1,strategy:"oauth2",key:null,clientId:null,clientSecret:null,scope:[],urlAuth:null,urlToken:null,urlData:null,validateUrl:null,loginUrl:null,logoutUrl:null,authResultMap:null,apiAccessToken:"",apiAccessExpireAt:null}):Object.assign({},e.authStrategy,e.authStrategies.find((function(e){return e._id==t})))},UPDATE_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.authStrategy,r)},UPDATE_AUTHRESULTMAP_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e.authResultMap,r)},UPDATE_ROOT_FIELD:function(e,t){var n=t.key,r=t.value;c.a.setProperty(n,e,r)},UPDATE_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e.authStrategy[t.key].findIndex(t.cb):e.authStrategy[t.key].indexOf(t.value);n>=0&&e.authStrategy[t.key].splice(n,1)}else e.authStrategy[t.key].push(t.value)},SWAP_ARRAY:function(e,t){var n=e.authStrategy[t.key][t.from];e.authStrategy[t.key][t.from]=e.authStrategy[t.key][t.to],o.default.set(e.authStrategy[t.key],t.to,n)},UPDATE_ROOT_ARRAY:function(e,t){if(!0===t.delete){var n=t.cb?e[t.key].findIndex(t.cb):e[t.key].indexOf(t.value);n>=0&&e[t.key].splice(n,1)}else e[t.key].push(t.value)},RESET_AUTHSTRATEGY:function(e){e.authStrategy=Object.assign({},{_id:null,debugMode:!1,strategy:"oauth2",key:null,clientId:null,clientSecret:null,scope:[],urlAuth:null,urlToken:null,urlData:null,validateUrl:null,loginUrl:null,logoutUrl:null,authResultMap:null,apiAccessToken:"",apiAccessExpireAt:null})},RESET_AUTHRESULTMAP:function(e){e.authResultMap=Object.assign({},{_id:null,name:null,attributes:[]})},RESET_AUTHSTRATEGIES:function(e){e.authStrategies=[],e.authStrategiesCount=0},RESET_STATE:function(e){Object.assign(e,v)}},O={namespaced:!0,state:v,getters:{getAuthStrategies:function(e){return e.authStrategies},getDefaultAuthStrategy:function(e){return{_id:null,debugMode:!1,strategy:"oauth2",key:null,clientId:null,clientSecret:null,scope:[],urlAuth:null,urlToken:null,urlData:null,validateUrl:null,loginUrl:null,logoutUrl:null,authResultMap:null,apiAccessToken:"",apiAccessExpireAt:null}},listAuthStrategyType:function(e){return["oauth2","cas","cas-default","cas-dynamic","mz1"]},listAuthResultMapKey:function(e){return[{key:"userId"},{key:"userLang",values:["en","fr"]},{key:"userProfile",values:["teacher","student"]},{key:"ssoIdentifier"},{key:"firstName"},{key:"lastName"}]}},actions:{LOAD_AUTHSTRATEGIES:(y=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{filter:{}},e.abrupt("return",this.$axios.get("/api/v1/authStrategy?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("authStrategy/SET_AUTHSTRATEGIES",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"AUTHSTRATEGIES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)}),COUNT_AUTHSTRATEGIES:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/authStrategy/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("authStrategy/UPDATE_ROOT_FIELD",{key:"au
1thStrategiesCount",value:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT AUTHSTRATEGIES are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),LOAD_AUTHSTRATEGY:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.authStrategy._id){e.next=3;break}return console.log("LOAD_AUTHSTRATEGY already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/authStrategy/"+c.a.normalizePayloadURI(n,"authStrategyId")).then((function(e){return e.data})).then((function(e){return r.commit("authStrategy/UPDATE_FIELD",{key:"debugMode",value:e.debugMode}),r.commit("authStrategy/UPDATE_FIELD",{key:"strategy",value:e.strategy}),r.commit("authStrategy/UPDATE_FIELD",{key:"key",value:e.key}),r.commit("authStrategy/UPDATE_FIELD",{key:"clientId",value:e.clientId}),r.commit("authStrategy/UPDATE_FIELD",{key:"clientSecret",value:e.clientSecret}),r.commit("authStrategy/UPDATE_FIELD",{key:"scope",value:e.scope}),r.commit("authStrategy/UPDATE_FIELD",{key:"urlAuth",value:e.urlAuth}),r.commit("authStrategy/UPDATE_FIELD",{key:"urlToken",value:e.urlToken}),r.commit("authStrategy/UPDATE_FIELD",{key:"urlData",value:e.urlData}),r.commit("authStrategy/UPDATE_FIELD",{key:"authResultMap",value:e.authResultMap}),r.commit("authStrategy/UPDATE_FIELD",{key:"apiAccessToken",value:e.apiAccessToken}),r.commit("authStrategy/UPDATE_FIELD",{key:"apiAccessExpireAt",value:e.apiAccessExpireAt}),r.commit("authStrategy/UPDATE_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"authStrategy is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),SAVE_AUTHSTRATEGY:function(e,t){var n=this,r=null===e.state.authStrategy._id?"post":"put",o=null===e.state.authStrategy._id?"":e.state.authStrategy._id;return this.$axios[r]("/api/v1/authStrategy/"+o,e.state.authStrategy).then((function(e){return e.data})).then((function(e){return n.commit("authStrategy/UPDATE_FIELD",{key:"_id",value:e._id}),n.commit("authStrategy/UPDATE_FIELD",{key:"debugMode",value:e.debugMode}),n.commit("authStrategy/UPDATE_FIELD",{key:"strategy",value:e.strategy}),n.commit("authStrategy/UPDATE_FIELD",{key:"key",value:e.key}),n.commit("authStrategy/UPDATE_FIELD",{key:"clientId",value:e.clientId}),n.commit("authStrategy/UPDATE_FIELD",{key:"clientSecret",value:e.clientSecret}),n.commit("authStrategy/UPDATE_FIELD",{key:"scope",value:e.scope}),n.commit("authStrategy/UPDATE_FIELD",{key:"urlAuth",value:e.urlAuth}),n.commit("authStrategy/UPDATE_FIELD",{key:"urlToken",value:e.urlToken}),n.commit("authStrategy/UPDATE_FIELD",{key:"urlData",value:e.urlData}),n.commit("authStrategy/UPDATE_FIELD",{key:"authResultMap",value:e.authResultMap}),n.commit("authStrategy/UPDATE_FIELD",{key:"apiAccessToken",value:e.apiAccessToken}),n.commit("authStrategy/UPDATE_FIELD",{key:"apiAccessExpireAt",value:e.apiAccessExpireAt}),0===o.length?n.commit("authStrategy/ADD_AUTHSTRATEGY",{authStrategy:e}):n.commit("authStrategy/UPDATE_AUTHSTRATEGY",{authStrategy:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"authStrategy is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_AUTHSTRATEGY:function(e,t){var n=this,r=t.id||e.state.authStrategy._id;return this.$axios.delete("/api/v1/authStrategy/"+r).then((function(e){return e.data})).then((function(e){return n.commit("authStrategy/REMOVE_AUTHSTRATEGY",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"authStrategy has been deleted"}),n.commit("authStrategy/RESET_AUTHSTRATEGY"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},LOAD_AUTHRESULTMAPS:(h=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r=this,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{filter:{}},e.abrupt("return",this.$axios.get("/api/v1/authStrategy/authResultMap?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("authStrategy/SET_AUTHRESULTMAPS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"AUTHRESULTMAPS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)}),LOAD_AUTHRESULTMAP:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==t.state.authResultMap._id){e.next=3;break}return console.log("LOAD_AUTHRESULTMAP already in state - "+n),e.abrupt("return",Promise.resolve(!0));case 3:return e.abrupt("return",this.$axios.get("/api/v1/authStrategy/authResultMap/"+c.a.normalizePayloadURI(n,"authResultMapId")).then((function(e){return e.data})).then((function(e){return r.commit("authStrategy/UPDATE_AUTHRESULTMAP_FIELD",{key:"name",value:e.name}),r.commit("authStrategy/UPDATE_AUTHRESULTMAP_FIELD",{key:"attributes",value:e.attributes}),r.commit("authStrategy/UPDATE_AUTHRESULTMAP_FIELD",{key:"_id",value:e._id}),r.dispatch("api/API_SUCCESS",{type:"info",message:"authResultMap is loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)}),SAVE_AUTHRESULTMAP:function(e,t){var n=this,r=null===e.state.authResultMap._id?"post":"put",o=null===e.state.authResultMap._id?"":e.state.authResultMap._id;return console.log("SAVE_AUTHRESULTMAP : "+r,JSON.parse(JSON.stringify(e.state.authResultMap))),this.$axios[r]("/api/v1/authStrategy/authResultMap/"+o,e.state.authResultMap).then((function(e){return e.data})).then((function(e){return n.commit("authStrategy/UPDATE_AUTHRESULTMAP_FIELD",{key:"_id",value:e._id}),n.commit("authStrategy/UPDATE_AUTHRESULTMAP_FIELD",{key:"name",value:e.name}),n.commit("authStrategy/UPDATE_AUTHRESULTMAP_FIELD",{key:"attributes",value:e.attributes}),0===o.length?n.commit("authStrategy/ADD_AUTHRESULTMAP",{authResultMap:e}):n.commit("authStrategy/UPDATE_AUTHRESULTMAP",{authResultMap:e}),n.dispatch("api/API_SUCCESS",{type:"info",message:"authResultMap is saved",display:!0}),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))},DELETE_AUTHRESULTMAP:function(e,t){var n=this,r=t.id||e.state.authResultMap._id;return this.$axios.delete("/api/v1/authStrategy/authResultMap/"+r).then((function(e){return e.data})).then((function(e){return n.commit("authStrategy/REMOVE_AUTHRESULTMAP",r),n.dispatch("api/API_SUCCESS",{type:"info",message:"authResultMap has been deleted"}),n.commit("authStrategy/RESET_AUTHRESULTMAP"),!0}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1}))}},mutations:_};t.default=O},function(e,t,n){"use strict";n.r(t);n(28);var r=n(3),o=n(1),l=n(2);n(12);o.default.use(l.a);var c,d,h,f=function(){return{trackings:[],trackingsCount:0}},m={SET_TRACKINGS:function(e,t){e.trackings=t},SET_TRACKINGS_COUNT:function(e,t){var n=t.count;e.trackingsCount=n},RESET_STATE:function(e){Object.assign(e,{trackings:[],trackingsCount:0})}},y={namespaced:!0,state:f,getters:{},actions:{LOAD_TRACKINGS:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/tracking/list?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("tracking/SET_TRACKINGS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"TRACKINGS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),COUNT_TRACKINGS:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/tracking/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("tracking/SET_TRACKINGS_COUNT",{count:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT TRACKINGS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)}),EXPORT_TRACKINGS:(c=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/tracking/export?filter="+JSON.stringify(n.filter)+"&sort="+n.sort).then((function(e){return e.data})).then((function(data){return r.dispatch("api/API_SUCCESS",data),data}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},mutations:m};t.default=y},function(e,t,n){"use strict";n.r(t);n(28);var r=n(3),o=(n(30),n(52),n(26),n(1)),l=n(2);n(12);o.default.use(l.a);var c,d,h,f,m,y=function(){return{comments:[],commentCountByPage:{magazineId:null,counts:{}}}},v={SET_COMMENTS:function(e,t){e.comments=t},ADD_COMMENT:function(e,t){e.comments.push(t)},ADD_COMMENT_COUNT:function(e,t){var n=t.magazineId,r=t.pageId,l=t.count;e.commentCountByPage&&e.commentCountByPage.magazineId===n&&(e.commentCountByPage.counts[r]?e.commentCountByPage.counts[r]=Math.max(0,e.commentCountByPage.counts[r]+l):l>0&&o.default.set(e.commentCountByPage.counts,r,l))},REMOVE_COMMENT:function(e,t){var n=e.comments.find((function(e){return e._id===t}));n&&(n.deleted=!0)},UPDATE_COMMENT_CONTENT:function(e,t){var n=e.comments.find((function(e){return e._id===t._id}));n&&(n.content=t.content,n.updatedAt=t.updatedAt,void 0!==t.deleted&&(n.deleted=t.deleted))},RESET_STATE:function(e){Object.assign(e,{comments:[],commentCountByPage:{magazineId:null,counts:{}}})},SET_COMMENT_COUNTS:function(e,t){var n=t.magazineId,r=t.commentsByPage;e.commentCountByPage={magazineId:n,counts:r}}},_={namespaced:!0,state:y,getters:{mentionnableUsers:function(e,t,n,r){if(!r["collaboration/collaborationIsActive"])return[];var o=n.collaboration.collaboration,l=n.collaboration.userCollaboration;return o.users.reduce((function(e,t){return(t.linkedAccount?t.linkedAccount._id:null)&&t._id!==l._id&&e.push({id:t.linkedAccount._id,value:t.name,oldValue:t.
1name.trim().replace(/ /g,"-").toLowerCase(),user:t}),e}),[]).sort((function(a,b){return a.value.localeCompare(b.value)}))},getCommentCount:function(e){return function(t){return e.commentCountByPage.counts[t]||0}}},actions:{LOAD_COMMENTS:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.pageId,e.abrupt("return",this.$axios.get("/api/v1/pagecomment/"+r).then((function(e){return e.data})).then((function(e){return o.commit("pagecomment/SET_COMMENTS",e),!0}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),LOAD_COMMENTS_BY_PAGE:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.magazineId,e.abrupt("return",this.$axios.get("/api/v1/pagecomment/magazine/"+r+"/count").then((function(e){return e.data})).then((function(e){return o.commit("pagecomment/SET_COMMENT_COUNTS",{magazineId:r,commentsByPage:e}),!0}),(function(e){return o.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),CREATE_COMMENT:(h=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var content,r,o,l,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return content=n.content,r=n.pageId,o=n.mentionedUsers,l=void 0===o?[]:o,e.abrupt("return",this.$axios.post("/api/v1/pagecomment/",{content:content,pageId:r,mentionedUsers:l}).then((function(e){return e.data})).then((function(e){return c.commit("pagecomment/ADD_COMMENT",e),t.state.commentCountByPage.magazineId&&c.commit("pagecomment/ADD_COMMENT_COUNT",{magazineId:t.state.commentCountByPage.magazineId,pageId:r,count:1}),e}),(function(e){return c.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)}),DELETE_COMMENT:(d=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,o,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.commentId,o=n.pageId,e.abrupt("return",this.$axios.delete("/api/v1/pagecomment/".concat(r)).then((function(e){return e.data})).then((function(){return l.commit("pagecomment/REMOVE_COMMENT",r),t.state.commentCountByPage.magazineId&&l.commit("pagecomment/ADD_COMMENT_COUNT",{magazineId:t.state.commentCountByPage.magazineId,pageId:o,count:-1}),l.dispatch("api/API_SUCCESS",{type:"info",message:"Comment has been deleted"}),!0}),(function(e){return l.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)}),UPDATE_COMMENT:(c=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r,content,o,l,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.commentId,content=n.content,o=n.mentionedUsers,l=void 0===o?[]:o,e.abrupt("return",this.$axios.put("/api/v1/pagecomment/".concat(r),{content:content,mentionedUsers:l}).then((function(e){return e.data})).then((function(e){return c.commit("pagecomment/UPDATE_COMMENT_CONTENT",e),c.dispatch("api/API_SUCCESS",{type:"info",message:"Comment has been updated"}),!0}),(function(e){return c.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},mutations:v};t.default=_},function(e,t,n){"use strict";n.r(t);n(28);var r=n(3),o=n(1),l=n(2);n(12);o.default.use(l.a);var c,d,h,f,m,y,v=function(){return{errorLogs:[],errorLogsCount:0,types:[]}},_={SET_ERRORLOGS:function(e,t){e.errorLogs=t},SET_ERRORLOGS_COUNT:function(e,t){var n=t.count;e.errorLogsCount=n},RESET_STATE:function(e){Object.assign(e,{errorLogs:[],errorLogsCount:0,types:[]})},SET_TYPES:function(e,t){e.types=t}},O={namespaced:!0,state:v,getters:{},actions:{LOAD_ERRORLOGS:(y=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/errorLog/list?filter="+JSON.stringify(n.filter)+"&sort="+n.sort+"&limit="+n.limit+"&skip="+n.skip).then((function(e){return e.data})).then((function(e){return r.commit("errorlog/SET_ERRORLOGS",e),r.dispatch("api/API_SUCCESS",{type:"info",message:"ERRORLOGS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)}),COUNT_ERRORLOGS:(m=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/errorLog/count?filter="+JSON.stringify(n.filter)).then((function(e){return e.data})).then((function(e){return r.commit("errorlog/SET_ERRORLOGS_COUNT",{count:e}),r.dispatch("api/API_SUCCESS",{type:"info",message:"COUNT ERRORLOGS are loaded"}),!0}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)}),EXPORT_ERRORLOGS:(f=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/errorLog/export?filter="+JSON.stringify(n.filter)+"&sort="+n.sort).then((function(e){return e.data})).then((function(data){return r.dispatch("api/API_SUCCESS",data),data}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)}),LOAD_TYPES:(h=Object(r.a)(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.get("/api/v1/errorLog/types").then((function(e){return e.data})).then((function(e){return n.commit("errorlog/SET_TYPES",e||[]),e}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),[]})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)}),CLEAR_ERRORLOGS:(d=Object(r.a)(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.delete("/api/v1/errorLog/clear").then((function(e){return e.data})).then((function(data){return n.commit("errorlog/RESET_STATE"),n.dispatch("api/API_SUCCESS",{type:"success",message:"Error logs cleared"}),data}),(function(e){return n.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)}),CLEAR_SELECTED:(c=Object(r.a)(regeneratorRuntime.mark((function e(t,n){var r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.$axios.delete("/api/v1/errorLog/bulk",{data:{ids:n}}).then((function(e){return e.data})).then((function(data){return r.commit("errorlog/RESET_STATE"),r.dispatch("api/API_SUCCESS",{type:"success",message:"Selected logs deleted"}),data}),(function(e){return r.dispatch("api/API_ERROR",e.response?e.response.data:e),!1})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},mutations:_};t.default=O},,,,function(e,t,n){"use strict";(function(e){var r=n(1),o=n(727),l=n(728),c=n(729),d=n(726);t.a=function(t){var n=t.app;e.env.VUE_SENTRY_DSN_URL&&(console.log("------------ START Sentry -----------------------"),o.a({Vue:r.default,dsn:e.env.VUE_SENTRY_DSN_URL,integrations:[l.a({router:n.router}),c.a(),d.a()],replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1}))}}).call(this,n(108))},,,,,function(e,t,n){"use strict";(function(e){var r=n(1),o=n(518),l=n.n(o);t.a=function(t){var n=t.app;e.env.VUE_MATOMO_ID&&e.env.VUE_MATOMO_URL&&(console.log("instantiate matomo plugin for "+e.env.VUE_MATOMO_URL),r.default.use(l.a,{router:n.router,host:e.env.VUE_MATOMO_URL,siteId:e.env.VUE_MATOMO_ID}))}}).call(this,n(108))},,function(e,t,n){"use strict";n(2);var r=n(51),o={name:"MzMagazineThumb",components:{MzPageImage:n(157).a},props:["magazine","type","linkToThumb"],data:function(){return{}},computed:{page:function(){return{_id:this.magazine.thumb,updatedAt:this.magazine.lastVisualChangeAt,double:!1}},thumbUrlLink:function(){return this.linkToThumb?r.a.getPageSrc(this.magazine.thumb):void 0}},methods:{}},l=n(6),component=Object(l.a)(o,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{key:this.magazine._id},[this.thumbUrlLink?t("el-link",{attrs:{href:this.thumbUrlLink,target:"_blank"}}
1,[t("MzPageImage",{attrs:{page:this.page,type:this.type}})],1):t("MzPageImage",{attrs:{page:this.page,type:this.type}})],1)}),[],!1,null,"51be2388",null);t.a=component.exports},function(e,t,n){"use strict";n(159);var r=n(158),o={name:"EditableText",components:{MzAppIcon:n(29).a,MzSingleLineText:r.a},props:{emptyValue:{type:String,default:"edit value"},disableEditing:{type:Boolean,default:!1},value:{type:String},displayValue:{type:String},maxlength:{type:Number},autoSuggest:{type:Function,default:function(e,t){return t([])}},displayEditIcon:{type:Boolean,default:!1}},data:function(){return{tmpValue:"No value",isEditingValue:!1}},methods:{infosChangedHandler:function(){this.isEditingValue=!1,this.$emit("change",this.tmpValue)},cancelEditing:function(){var e=this;setTimeout((function(){e.isEditingValue&&(e.isEditingValue=!1,e.tmpValue!=e.value&&e.$emit("change",e.tmpValue))}),150)},switchEditingvalue:function(){var e=this;this.disableEditing||(this.tmpValue=this.value,this.isEditingValue=!this.isEditingValue,this.isEditingValue&&this.$nextTick((function(){e.$refs.valueInput.focus()})))}},computed:{staticValue:function(){var e=this.displayValue?this.displayValue:this.value;return e&&0!==e.length?e:this.emptyValue}}},l=(n(618),n(619),n(6)),component=Object(l.a)(o,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"text-edit-input"},[n("el-autocomplete",{directives:[{name:"show",rawName:"v-show",value:e.isEditingValue,expression:"isEditingValue"}],ref:"valueInput",staticClass:"textEditInput",attrs:{maxlength:e.maxlength,"fetch-suggestions":e.autoSuggest,"popper-class":"autoSuggestPopover","trigger-on-focus":!1,"select-when-unmatched":!0},on:{select:e.infosChangedHandler,blur:e.cancelEditing},model:{value:e.tmpValue,callback:function(t){e.tmpValue=t},expression:"tmpValue"}}),e._v(" "),n("div",{staticClass:"staticText",class:{"edit-enable":!e.disableEditing,hidden:e.isEditingValue},on:{click:e.switchEditingvalue}},[n("MzSingleLineText",{class:{textContent:!0,textContentWithIcon:e.displayEditIcon}},[e._v("\n "+e._s(e.staticValue)+"\n ")]),e._v(" "),e.displayEditIcon?n("MzAppIcon",{staticClass:"edit-icon",attrs:{name:"edit",size:16}}):e._e()],1)],1)}),[],!1,null,"2af38c00",null);t.a=component.exports},,function(e,t,n){"use strict";n(26);var r={name:"UserRoleTag",components:{MzAppIcon:n(29).a},props:["user","hideRole","applyCurrentUserStyle","icon","tooltipKey","tooltipPlacement"],computed:{name:function(){return this.user&&this.user.name?this.user.name:""},tag:function(){return this.user&&this.user.role?this.$t("public.collaboration.roles_tag."+this.user.role):null},tooltipTag:function(){return this.user&&this.user.role?this.$t("public.collaboration.roles."+this.user.role):null},isPending:function(){return this.user&&"pending"===this.user.status},isDisabled:function(){return this.user&&"disabled"===this.user.status},isCurrentUser:function(){return this.user&&this.user.isCurrentUser},tooltipContent:function(){var e=[];return this.tooltipKey&&e.push(this.$t(this.tooltipKey,{name:this.name,role:this.tag})),this.isPending?e.push(this.$t("public.collaboration.userInfo.tooltipUserNotActive")):this.isDisabled&&e.push(this.$t("public.collaboration.userInfo.tooltipUserDisabled")),e.length>0?e.join("<br/>"):null}}},o=(n(620),n(6)),component=Object(o.a)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-tooltip",{attrs:{placement:e.tooltipPlacement?e.tooltipPlacement:"bottom",effect:"light",disabled:null===e.tooltipContent,enterable:!1,"open-delay":500}},[e.tooltipContent?n("div",{attrs:{slot:"content"},domProps:{innerHTML:e._s(e.tooltipContent)},slot:"content"}):e._e(),e._v(" "),n("span",{staticClass:"user-role single-line-text",class:{"is-pending":e.isPending,"is-disabled":e.isDisabled,"is-current-user":e.applyCurrentUserStyle&&e.isCurrentUser}},[e.icon?n("MzAppIcon",{attrs:{name:e.icon,inline:"",size:"14"}}):e._e(),e._v("\n\n "+e._s(e.isCurrentUser?e.$t("public.collaboration.assign_modal.user_list_me"):e.name)+"\n "),e.tag&&!e.hideRole?n("el-tooltip",{attrs:{content:e.tooltipTag,placement:"top"}},[n("el-tag",{staticClass:"ml-0",attrs:{size:"mini",type:e.isCurrentUser?"primary":"info",effect:e.isCurrentUser?"dark":"plain"}}
1,[e._v(e._s(e.tag))])],1):e._e()],1)])}),[],!1,null,"8acea6b6",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(134),n(52),n(36),n(26);var r=n(4),o=n(2);function l(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var c={name:"MzUserAvatar",props:["user","userCollaboration","size"],data:function(){return{}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(o.c)("api",["getUID"]),{displayName:function(){var e=null;if(this.userCollaboration&&this.userCollaboration.name?e=this.userCollaboration.name.split(/[ ,\.]/):this.user&&this.user.name?e=this.user.name.split(/[ ,\.]/):this.user&&this.user.email&&(e=this.user.email.substr(0,this.user.email.indexOf("@")).split(".")),e){var t=e.map((function(e){return e.replace(new RegExp("[^a-zA-Z]","g"),"").toUpperCase()}));return t.length>1?t[0].substr(0,1)+t[1].substr(0,1):t[0].substr(0,2)}return"MZ"},isCurrentUser:function(){return this.user&&this.user._id===this.getUID}}),methods:{}},d=(n(643),n(6)),component=Object(d.a)(c,(function(){var e=this.$createElement;return(this._self._c||e)("div",{class:{"avatar-content":!0,"is-current-user":this.isCurrentUser,"big-avatar":"big"===this.size,"small-avatar":"small"===this.size}},[this._v("\n "+this._s(this.displayName)+"\n")])}),[],!1,null,"736c8e3c",null);t.a=component.exports},,function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(26);var r=n(4),o=n(2);function l(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function c(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var d={name:"AddOrEditFormatModal",components:{},data:function(){return{visible:!1,loading:!1,newPrintProduct:{productUid:null,type:null,printerKey:"gelato"}}},props:{},computed:c({},Object(o.e)("format",["formatBase"]),{},Object(o.e)("app",["existingLanguages","existingPrinterKeys"]),{name:{get:function(){return this.formatBase.name},set:function(e){this.updateFieldBase({key:"name",value:e})}},description:{get:function(){return this.formatBase.description},set:function(e){}},pageWidth:{get:function(){return this.formatBase.pageWidth},set:function(e){this.updateFieldBase({key:"pageWidth",value:e}),this.updateOrientationBase()}},pageHeight:{get:function(){return this.formatBase.pageHeight},set:function(e){this.updateFieldBase({key:"pageHeight",value:e}),this.updateOrientationBase()}},orientation:{get:function(){return this.formatBase.orientation},set:function(e){this.updateFieldBase({key:"orientation",value:e})}}}),methods:c({},Object(o.b)({loadFormatBase:"format/LOAD_FORMAT_BASE",saveFormatBase:"format/SAVE_FORMAT_BASE"}),{},Object(o.d)({updateOrientationBase:"format/REFRESH_ORIENTATION_BASE",updateFieldBase:"format/UPDATE_FIELD_BASE",updateFormatArrayBase:"format/UPDATE_ARRAY_BASE",resetFormatBase:"format/RESET_FORMAT_BASE"}),{showEdit:function(e){var t=this;this.visible=!0,this.loading=!0,this.loadFormatBase(e).then((function(data){console.log("Format Base loaded",JSON.parse(JSON.stringify(t.formatBase))),t.loading=!1}))},showCreate:function(){this.resetFormatBase(),this.visible=!0},onSaveFormat:function(){var e=this;this.saveFormatBase().then((function(t){t&&e.onClose()})).catch((function(e){return console.error(e.stack)}))},onClose:function(){this.visible&&(this.visible=!1,this.$emit("close",this.formatBase._id),this.resetFormatBase())},updateDescription:function(e,t){var n=c({},this.description);n[e]=t,this.updateFieldBase({key:"description",value:n})},addNewPrintProduct:function(){this.newPrintProduct.productUid&&this.newPrintProduct.type?(this.updateFormatArrayBase({key:"printProducts",value:c({},this.newPrintProduct)}),this.newPrintProduct.productUid=null,this.newPrintProduct.type=null,this.newPrintProduct.printerKey="gelato"):this.$messageError("You must set a product uid and select a product type")},removePrintProduct:function(e){this.updateFormatArrayBase({delete:!0,key:"printProducts",cb:function(t){return t.productUid===e.productUid}})}})},h=(n(572),n(6)),component=Object(h.a)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{visible:e.visible,"show-close":"","close-on-click-modal":!1,"append-to-body":!0},on:{close:e.onClose}},[n("span",{attrs:{slot:"title"},slot:"title"},[n("h2",[e._v("\n "+e._s(e.$t(e.formatBase._id?"admin.format.editTitle":"admin.format.createTitle"))+"\n "),n("el-tag",{staticStyle:{float:"right","margin-right":"2rem"},attrs:{size:"small"}}
1,[e._v(e._s(e.orientation))])],1)]),e._v(" "),n("el-row",{staticClass:"modal-body-content"},[n("el-form",{attrs:{"label-width":"150px"}},[n("el-row",{staticClass:"mt-1",attrs:{gutter:100}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Name"}},[n("el-input",{attrs:{value:e.name},on:{input:function(t){return e.updateFieldBase({key:"name",value:t})}}})],1)],1)],1),e._v(" "),n("el-divider",{attrs:{"content-position":"left"}},[n("small",[e._v(e._s(e.$t("layout.format_edit.page_dimensions")))])]),e._v(" "),n("el-row",{attrs:{gutter:100}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Width"}},[n("el-input-number",{model:{value:e.pageWidth,callback:function(t){e.pageWidth=t},expression:"pageWidth"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Height"}},[n("el-input-number",{model:{value:e.pageHeight,callback:function(t){e.pageHeight=t},expression:"pageHeight"}})],1)],1)],1),e._v(" "),n("el-divider",{attrs:{"content-position":"left"}},[n("small",[e._v("Tooltip description")])]),e._v(" "),e._l(e.existingLanguages,(function(t){return n("el-row",{key:t,attrs:{gutter:100}},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:t.toUpperCase()}},[n("el-input",{attrs:{value:e.description[t]},on:{input:function(n){return e.updateDescription(t,n)}}})],1)],1)],1)})),e._v(" "),n("el-divider",{attrs:{"content-position":"left"}},[n("small",[e._v("Print products")])]),e._v(" "),n("el-row",{attrs:{gutter:100}},[n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"Add new product :"}},[n("el-col",{attrs:{span:24}},[n("el-input",{attrs:{placeholder:"product uid"},model:{value:e.newPrintProduct.productUid,callback:function(t){e.$set(e.newPrintProduct,"productUid",t)},expression:"newPrintProduct.productUid"}})],1),e._v(" "),n("el-col",{attrs:{span:7}},[n("el-select",{attrs:{placeholder:"product type"},model:{value:e.newPrintProduct.type,callback:function(t){e.$set(e.newPrintProduct,"type",t)},expression:"newPrintProduct.type"}},[n("el-option",{attrs:{label:"Glued (>=56pages)",value:"glued"}}),e._v(" "),n("el-option",{attrs:{label:"Stitched (<=52pages)",value:"stitched"}}),e._v(" "),n("el-option",{attrs:{label:"All (no nb pages check)",value:"all"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:7}},[n("el-select",{model:{value:e.newPrintProduct.printerKey,callback:function(t){e.$set(e.newPrintProduct,"printerKey",t)},expression:"newPrintProduct.printerKey"}},e._l(e.existingPrinterKeys,(function(e){return n("el-option",{key:e,attrs:{label:e,value:e}})})),1)],1),e._v(" "),n("el-col",{attrs:{span:3}},[n("el-button",{on:{click:e.addNewPrintProduct}},[e._v("ADD")])],1)],1)],1)],1),e._v(" "),n("el-row",{attrs:{gutter:100}},[n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"Existing products :"}},e._l(e.formatBase.printProducts,(function(t){return n("el-row",{key:t.productUid},[n("div",[e._v("\n - Type : "+e._s(t.printerKey)+" / "+e._s(t.type)+"\n ")]),e._v(" "),n("div",{staticClass:"ml-1"},[e._v("\n "+e._s(t.productUid)+"\n "),n("el-button",{staticStyle:{float:"right"},attrs:{size:"mini",type:"danger",plain:""},on:{click:function(n){return e.removePrintProduct(t)}}},[e._v("remove")])],1)])})),1)],1)],1)],2)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],staticClass:"mt-1",on:{click:e.onClose}}),e._v(" "),n("el-button",{directives:[{name:"t",rawName:"v-t",value:"layout.format_edit.save",expression:"'layout.format_edit.save'"}],staticClass:"mt-1",attrs:{type:"primary"},on:{click:e.onSaveFormat}})],1)],1)}),[],!1,null,"615b4f42",null);t.a=component.exports},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n(19),n(28);var r=n(3),o=(n(52),n(35),n(13),n(11),n(7),n(16),n(26),n(30),n(55),n(4)),l=n(2),c=n(116),d=n(14),h=n(84),f=n.n(h),m=n(501),y=(n(117),n(27)),v=(n(91),n(316)),_=[{char:"Â ",char_category:"Text",description_key:"no_break_space"}
1,{char:"$",char_category:"Currency",description_key:"dollar_sign"},{char:"â¬",char_category:"Currency",description_key:"euro_sign"},{char:"Â¥",char_category:"Currency",description_key:"yen_sign"},{char:"£",char_category:"Currency",description_key:"pound_sign"},{char:"¢",char_category:"Currency",description_key:"cent_sign"},{char:"â¡",char_category:"Currency",description_key:"colon_sign"},{char:"â£",char_category:"Currency",description_key:"french_franc_sign"},{char:"â¤",char_category:"Currency",description_key:"lira_sign"},{char:"â¦",char_category:"Currency",description_key:"naira_sign"},{char:"â¹",char_category:"Currency",description_key:"indian_rupee_sign"},{char:"â",char_category:"Text",description_key:"left_single_quotation_mark"},{char:"â",char_category:"Text",description_key:"right_single_quotation_mark"},{char:"â",char_category:"Text",description_key:"left_double_quotation_mark"},{char:"â",char_category:"Text",description_key:"right_double_quotation_mark"},{char:"â¦",char_category:"Text",description_key:"horizontal_ellipsis"},{char:"©",char_category:"Text",description_key:"copyright_sign"},{char:"®",char_category:"Text",description_key:"registered_sign"},{char:"â¢",char_category:"Text",description_key:"trade_mark_sign"},{char:"â¢",char_category:"Text",description_key:"bullet"},{char:"â",char_category:"Text",description_key:"en_dash"},{char:"±",char_category:"Mathematical",description_key:"plus_minus_sign"},{char:"Ã",char_category:"Mathematical",description_key:"multiplication_sign"},{char:"÷",char_category:"Mathematical",description_key:"division_sign"},{char:"â",char_category:"Mathematical",description_key:"almost_equal_to"},{char:"â ",char_category:"Mathematical",description_key:"not_equal_to"},{char:"â",char_category:"Mathematical",description_key:"infinity"},{char:"â",char_category:"Mathematical",description_key:"square_root"},{char:"â",char_category:"Mathematical",description_key:"n_ary_summation"},{char:"â",char_category:"Mathematical",description_key:"n_ary_product"},{char:"â",char_category:"Mathematical",description_key:"partial_differential"},{char:"â",char_category:"Arrows",description_key:"leftwards_arrow"},{char:"â",char_category:"Arrows",description_key:"upwards_arrow"},{char:"â",char_category:"Arrows",description_key:"rightwards_arrow"},{char:"â",char_category:"Arrows",description_key:"downwards_arrow"},{char:"â",char_category:"Arrows",description_key:"left_right_arrow"},{char:"â",char_category:"Arrows",description_key:"up_down_arrow"},{char:"â",char_category:"Arrows",description_key:"rightwards_double_arrow"},{char:"â",char_category:"Arrows",description_key:"leftwards_double_arrow"},{char:"â",char_category:"Arrows",description_key:"left_right_double_arrow"},{char:"â©",char_category:"Arrows",description_key:"leftwards_arrow_with_hook"},{char:"Ã",char_category:"Latin",description_key:"latin_capital_letter_ae"},{char:"æ",char_category:"Latin",description_key:"latin_small_letter_ae"},{char:"Ã",char_category:"Latin",description_key:"latin_capital_letter_o_with_stroke"},{char:"ø",char_category:"Latin",description_key:"latin_small_letter_o_with_stroke"},{char:"Ã",char_category:"Latin",description_key:"latin_capital_letter_thorn"},{char:"þ",char_category:"Latin",description_key:"latin_small_letter_thorn"},{char:"Ã",char_category:"Latin",description_key:"latin_capital_letter_eth"},{char:"ð",char_category:"Latin",description_key:"latin_small_letter_eth"},{char:"Ã",char_category:"Latin",description_key:"latin_capital_letter_c_with_cedilla"},{char:"ç",char_category:"Latin",description_key:"latin_small_letter_c_with_cedilla"},{char:"âµ",char_category:"Currency",description_key:"cedi_sign"},{char:"â",char_category:"Currency",description_key:"kip_sign"},{char:"â®",char_category:"Currency",description_key:"tugrik_sign"},{char:"â©",char_category:"Currency",description_key:"won_sign"},{char:"âª",char_category:"Currency",description_key:"new_sheqel_sign"},{char:"â ",char_category:"Text",description_key:"dagger"},{char:"â¡",char_category:"Text",description_key:"double_dagger"},{char:"§",char_category:"Text",description_key:"section_sign"},{char:"¶",char_category:"Text",description_key:"pilcrow_sign"},{char:"â²",char_category:"Text",description_key:"prime"},{char:"â³",char_category:"Text",description_key:"double_prime"},{char:"¸",char_category:"Text",description_key:"cedilla"},{char:"¨",char_category:"Text",description_key:"diaeresis"},{char:"¯",char_category:"Text",description_key:"macron"},{char:"Ë",char_category:"Text",description_key:"breve"},{char:"â",char_category:"Mathematical",description_key:"nabla"},{char:"â",char_category:"Mathematical",description_key:"element_of"},{char:"â",char_category:"Mathematical",description_key:"not_an_element_of"},{char:"â©",char_category:"Mathematical",description_key:"intersection"},{char:"âª",char_category:"Mathematical",description_key:"union"},{char:"â",char_category:"Mathematical",description_key:"subset_of"},{char:"â",char_category:"Mathematical",description_key:"superset_of"},{char:"â",char_category:"Mathematical",description_key:"subset_of_or_equal_to"},{char:"â",char_category:"Mathematical",description_key:"superset_of_or_equal_to"},{char:"â",char_category:"Mathematical",description_key:"proportional_to"},{char:"â",char_category:"Arrows",description_key:"upwards_double_arrow"},{char:"â",char_category:"Arrows",description_key:"downwards_double_arrow"},{char:"â±",char_category:"Arrows",description_key:"upwards_arrow_from_left_to_right"},{char:"â³",char_category:"Arrows",description_key:"downwards_arrow_from_left_to_right"},{char:"â¨",char_category:"Arrows",description_key:"rightwards_white_arrow"},{char:"â",char_category:"Arrows",description_key:"rightwards_arrow_with_tip_downwards"},{char:"â¤",char_category:"Arrows",description_key:"black_rightwards_arrowhead"},{char:"â²",char_category:"Arrows",description_key:"three_d_top_lighted_rightwards_arrowhead"},{char:"â",char_category:"Arrows",description_key:"upwards_arrow_with_tip_rightwards"},{char:"â",char_category:"Arrows",description_key:"downwards_arrow_with_tip_rightwards"},{char:"Ã",char_category:"Latin",description_key:"latin_capital_letter_n_with_tilde"},{char:"ñ",char_category:"Latin",description_key:"latin_small_letter_n_with_tilde"},{char:"Å ",char_category:"Latin",description_key:"latin_capital_letter_s_with_caron"},{char:"Å¡",char_category:"Latin",description_key:"latin_small_letter_s_with_caron"},{char:"Ž",char_category:"Latin",description_key:"latin_capital_letter_z_with_caron"},{char:"ž",char_category:"Latin",description_key:"latin_small_letter_z_with_caron"},{char:"Å",char_category:"Latin",description_key:"latin_capital_letter_l_with_stroke"},{char:"Å",char_category:"Latin",description_key:"latin_small_letter_l_with_stroke"},{char:"Å",char_category:"Latin",description_key:"latin_capital_letter_s_with_acute"},{char:"Å",char_category:"Latin",description_key:"latin_small_letter_s_with_acute"}
1],O=[{char:"ð",char_category:"Smileys_Expressions",description_key:"grinning_face"},{char:"ð",char_category:"Smileys_Expressions",description_key:"grinning_face_with_big_eyes"},{char:"ð",char_category:"Smileys_Expressions",description_key:"grinning_face_with_smiling_eyes"},{char:"ð",char_category:"Smileys_Expressions",description_key:"beaming_face_with_smiling_eyes"},{char:"ð",char_category:"Smileys_Expressions",description_key:"grinning_squinting_face"},{char:"ð
",char_category:"Smileys_Expressions",description_key:"grinning_face_with_sweat"},{char:"ð",char_category:"Smileys_Expressions",description_key:"face_with_tears_of_joy"},{char:"ð¤£",char_category:"Smileys_Expressions",description_key:"rolling_on_the_floor_laughing"},{char:"ð",char_category:"Smileys_Expressions",description_key:"smiling_face_with_smiling_eyes"},{char:"ð",char_category:"Smileys_Expressions",description_key:"smiling_face_with_halo"},{char:"ð",char_category:"Smileys_Expressions",description_key:"slightly_smiling_face"},{char:"ð",char_category:"Smileys_Expressions",description_key:"upside_down_face"},{char:"ð",char_category:"Smileys_Expressions",description_key:"winking_face"},{char:"ð",char_category:"Smileys_Expressions",description_key:"relieved_face"},{char:"ð",char_category:"Smileys_Expressions",description_key:"smiling_face_with_heart_eyes"},{char:"ð",char_category:"Smileys_Expressions",description_key:"face_blowing_a_kiss"},{char:"ð",char_category:"Smileys_Expressions",description_key:"kissing_face"},{char:"ð",char_category:"Smileys_Expressions",description_key:"kissing_face_with_smiling_eyes"},{char:"ð",char_category:"Smileys_Expressions",description_key:"kissing_face_with_closed_eyes"},{char:"ð",char_category:"Smileys_Expressions",description_key:"face_savoring_food"},{char:"ð",char_category:"Gestures_People",description_key:"waving_hand"},{char:"ð¤",char_category:"Gestures_People",description_key:"raised_back_of_hand"},{char:"ðï¸",char_category:"Gestures_People",description_key:"hand_with_fingers_splayed"},{char:"â",char_category:"Gestures_People",description_key:"raised_hand"},{char:"ð",char_category:"Gestures_People",description_key:"vulcan_salute"},{char:"ð",char_category:"Gestures_People",description_key:"ok_hand"},{char:"ð¤",char_category:"Gestures_People",description_key:"pinched_fingers"},{char:"ð¤",char_category:"Gestures_People",description_key:"pinching_hand"},{char:"âï¸",char_category:"Gestures_People",description_key:"victory_hand"},{char:"ð¤",char_category:"Gestures_People",description_key:"crossed_fingers"},{char:"ð¤",char_category:"Gestures_People",description_key:"love_you_gesture"},{char:"ð¤",char_category:"Gestures_People",description_key:"sign_of_the_horns"},{char:"ð¤",char_category:"Gestures_People",description_key:"call_me_hand"},{char:"ð«¶",char_category:"Gestures_People",description_key:"heart_hands"},{char:"ð",char_category:"Gestures_People",description_key:"clapping_hands"},{char:"ð",char_category:"Gestures_People",description_key:"raising_hands"},{char:"ð",char_category:"Gestures_People",description_key:"open_hands"},{char:"ð¤²",char_category:"Gestures_People",description_key:"palms_up_together"},{char:"ð",char_category:"Gestures_People",description_key:"folded_hands"},{char:"ðª",char_category:"Gestures_People",description_key:"flexed_biceps"},{char:"ð¶",char_category:"Animals_Nature",description_key:"dog_face"},{char:"ð±",char_category:"Animals_Nature",description_key:"cat_face"},{char:"ð",char_category:"Animals_Nature",description_key:"mouse_face"},{char:"ð¹",char_category:"Animals_Nature",description_key:"hamster_face"},{char:"ð°",char_category:"Animals_Nature",description_key:"rabbit_face"},{char:"ð¦",char_category:"Animals_Nature",description_key:"fox_face"},{char:"ð»",char_category:"Animals_Nature",description_key:"bear_face"},{char:"ð¼",char_category:"Animals_Nature",description_key:"panda_face"},{char:"ð»ââï¸",char_category:"Animals_Nature",description_key:"polar_bear"},{char:"ð¨",char_category:"Animals_Nature",description_key:"koala"},{char:"ð¯",char_category:"Animals_Nature",description_key:"tiger_face"},{char:"ð¦",char_category:"Animals_Nature",description_key:"lion_face"},{char:"ð®",char_category:"Animals_Nature",description_key:"cow_face"},{char:"ð·",char_category:"Animals_Nature",description_key:"pig_face"},{char:"ð¸",char_category:"Animals_Nature",description_key:"frog_face"},{char:"ðµ",char_category:"Animals_Nature",description_key:"monkey_face"},{char:"ð",char_category:"Animals_Nature",description_key:"see_no_evil_monkey"},{char:"ð",char_category:"Animals_Nature",description_key:"hear_no_evil_monkey"},{char:"ð",char_category:"Animals_Nature",description_key:"speak_no_evil_monkey"}
1,{char:"ð",char_category:"Food_Drinks",description_key:"green_apple"},{char:"ð",char_category:"Food_Drinks",description_key:"red_apple"},{char:"ð",char_category:"Food_Drinks",description_key:"pear"},{char:"ð",char_category:"Food_Drinks",description_key:"tangerine"},{char:"ð",char_category:"Food_Drinks",description_key:"lemon"},{char:"ð",char_category:"Food_Drinks",description_key:"banana"},{char:"ð",char_category:"Food_Drinks",description_key:"watermelon"},{char:"ð",char_category:"Food_Drinks",description_key:"grapes"},{char:"ð",char_category:"Food_Drinks",description_key:"strawberry"},{char:"ð«",char_category:"Food_Drinks",description_key:"blueberries"},{char:"ð",char_category:"Food_Drinks",description_key:"cherries"},{char:"ð",char_category:"Food_Drinks",description_key:"peach"},{char:"ð¥",char_category:"Food_Drinks",description_key:"mango"},{char:"ð",char_category:"Food_Drinks",description_key:"pineapple"},{char:"ð¥¥",char_category:"Food_Drinks",description_key:"coconut"},{char:"ð¥",char_category:"Food_Drinks",description_key:"kiwi_fruit"},{char:"ð
",char_category:"Food_Drinks",description_key:"tomato"},{char:"ð",char_category:"Food_Drinks",description_key:"eggplant"},{char:"ð¥",char_category:"Food_Drinks",description_key:"avocado"},{char:"ð½",char_category:"Food_Drinks",description_key:"ear_of_corn"},{char:"ð",char_category:"Travel_Places",description_key:"automobile"},{char:"ð",char_category:"Travel_Places",description_key:"taxi"},{char:"ð",char_category:"Travel_Places",description_key:"sport_utility_vehicle"},{char:"ð",char_category:"Travel_Places",description_key:"bus"},{char:"ð",char_category:"Travel_Places",description_key:"trolleybus"},{char:"ðï¸",char_category:"Travel_Places",description_key:"racing_car"},{char:"ð",char_category:"Travel_Places",description_key:"police_car"},{char:"ð",char_category:"Travel_Places",description_key:"ambulance"},{char:"ð",char_category:"Travel_Places",description_key:"fire_engine"},{char:"ð",char_category:"Travel_Places",description_key:"tractor"},{char:"âï¸",char_category:"Travel_Places",description_key:"airplane"},{char:"ð©ï¸",char_category:"Travel_Places",description_key:"small_airplane"},{char:"ð",char_category:"Travel_Places",description_key:"rocket"},{char:"ð",char_category:"Travel_Places",description_key:"helicopter"},{char:"ð",char_category:"Travel_Places",description_key:"locomotive"},{char:"ð",char_category:"Travel_Places",description_key:"train"},{char:"ð³ï¸",char_category:"Travel_Places",description_key:"passenger_ship"},{char:"â´ï¸",char_category:"Travel_Places",description_key:"ferry"},{char:"ð¢",char_category:"Travel_Places",description_key:"ship"},{char:"ð",char_category:"Travel_Places",description_key:"oncoming_automobile"},{char:"â½",char_category:"Activities",description_key:"soccer_ball"},{char:"ð",char_category:"Activities",description_key:"basketball"},{char:"ð",char_category:"Activities",description_key:"american_football"},{char:"â¾",char_category:"Activities",description_key:"baseball"},{char:"ð¾",char_category:"Activities",description_key:"tennis"},{char:"ð",char_category:"Activities",description_key:"volleyball"},{char:"ð",char_category:"Activities",description_key:"rugby_football"},{char:"ð±",char_category:"Activities",description_key:"pool_8_ball"},{char:"ð",char_category:"Activities",description_key:"ping_pong"},{char:"ð¸",char_category:"Activities",description_key:"badminton"},{char:"ð¥
",char_category:"Activities",description_key:"goal_net"},{char:"ð¯",char_category:"Activities",description_key:"direct_hit"},{char:"ð³",char_category:"Activities",description_key:"bowling"},{char:"ð¥",char_category:"Activities",description_key:"boxing_glove"},{char:"ð¥",char_category:"Activities",description_key:"martial_arts_uniform"},{char:"ð½",char_category:"Activities",description_key:"running_shirt"},{char:"â·ï¸",char_category:"Activities",description_key:"skier"},{char:"ð",char_category:"Activities",description_key:"snowboarder"},{char:"ðï¸",char_category:"Activities",description_key:"weightlifter"},{char:"ðï¸",char_category:"Activities",description_key:"golfer"},{char:"ð¡",char_category:"Objects",description_key:"light_bulb"},{char:"ð¦",char_category:"Objects",description_key:"flashlight"},{char:"ð¯ï¸",char_category:"Objects",description_key:"candle"},{char:"ð»",char_category:"Objects",description_key:"laptop"},{char:"ð¥ï¸",char_category:"Objects",description_key:"desktop_computer"},{char:"ð¨ï¸",char_category:"Objects",description_key:"printer"},{char:"â¨ï¸",char_category:"Objects",description_key:"keyboard"},{char:"ð±ï¸",char_category:"Objects",description_key:"computer_mouse"},{char:"ð±",char_category:"Objects",description_key:"mobile_phone"},{char:"ð·",char_category:"Objects",description_key:"camera"},{char:"ð¥",char_category:"Objects",description_key:"movie_camera"},{char:"ðº",char_category:"Objects",description_key:"television"},{char:"â°",char_category:"Objects",description_key:"alarm_clock"},{char:"â³",char_category:"Objects",description_key:"hourglass_not_done"}
1,{char:"ð",char_category:"Objects",description_key:"battery"},{char:"ð",char_category:"Objects",description_key:"electric_plug"},{char:"ð¿",char_category:"Objects",description_key:"optical_disk"},{char:"ð",char_category:"Objects",description_key:"dvd"},{char:"ð¦",char_category:"Objects",description_key:"package"},{char:"ð§¯",char_category:"Objects",description_key:"fire_extinguisher"},{char:"ðµ",char_category:"Symbols",description_key:"blue_circle"},{char:"ð´",char_category:"Symbols",description_key:"red_circle"},{char:"â«",char_category:"Symbols",description_key:"black_circle"},{char:"âª",char_category:"Symbols",description_key:"white_circle"},{char:"ðº",char_category:"Symbols",description_key:"red_triangle_pointed_up"},{char:"ð»",char_category:"Symbols",description_key:"red_triangle_pointed_down"},{char:"ð¸",char_category:"Symbols",description_key:"small_orange_diamond"},{char:"ð¹",char_category:"Symbols",description_key:"small_blue_diamond"},{char:"ð¶",char_category:"Symbols",description_key:"large_orange_diamond"},{char:"ð·",char_category:"Symbols",description_key:"large_blue_diamond"},{char:"â»ï¸",char_category:"Symbols",description_key:"recycling_symbol"},{char:"â¤ï¸",char_category:"Symbols",description_key:"red_heart"},{char:"ð§¡",char_category:"Symbols",description_key:"orange_heart"},{char:"ð",char_category:"Symbols",description_key:"yellow_heart"},{char:"ð",char_category:"Symbols",description_key:"green_heart"},{char:"ð",char_category:"Symbols",description_key:"blue_heart"},{char:"ð",char_category:"Symbols",description_key:"purple_heart"},{char:"ð¤",char_category:"Symbols",description_key:"black_heart"},{char:"ð¤",char_category:"Symbols",description_key:"white_heart"},{char:"ð¤",char_category:"Symbols",description_key:"brown_heart"},{char:"ð«ð·",char_category:"Flags",description_key:"flag_france"},{char:"ð¬ð§",char_category:"Flags",description_key:"flag_united_kingdom"},{char:"ðºð¸",char_category:"Flags",description_key:"flag_united_states"},{char:"ð©ðª",char_category:"Flags",description_key:"flag_germany"},{char:"ð®ð¹",char_category:"Flags",description_key:"flag_italy"},{char:"ðªð¸",char_category:"Flags",description_key:"flag_spain"},{char:"ð¨ð¦",char_category:"Flags",description_key:"flag_canada"},{char:"ð§ð·",char_category:"Flags",description_key:"flag_brazil"},{char:"ð¯ðµ",char_category:"Flags",description_key:"flag_japan"},{char:"ð°ð·",char_category:"Flags",description_key:"flag_south_korea"},{char:"ð¨ð³",char_category:"Flags",description_key:"flag_china"},{char:"ð¦ðº",char_category:"Flags",description_key:"flag_australia"},{char:"ð®ð³",char_category:"Flags",description_key:"flag_india"},{char:"ð·ðº",char_category:"Flags",description_key:"flag_russia"},{char:"ð²ð½",char_category:"Flags",description_key:"flag_mexico"},{char:"ð³ð±",char_category:"Flags",description_key:"flag_netherlands"},{char:"ð¸ðª",char_category:"Flags",description_key:"flag_sweden"},{char:"ð³ð´",char_category:"Flags",description_key:"flag_norway"},{char:"ð«ð®",char_category:"Flags",description_key:"flag_finland"},{char:"ð¨ð",char_category:"Flags",description_key:"flag_switzerland"}],E=n(115),k=n(497),S=n(29);function A(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function T(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?A(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):A(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var P={name:"RichTextEditorActions",components:{MzIconButton:E.a,Compact:v.Compact,AddLinkForm:k.a,MzAppIcon:S.a},props:["editor","textblock","isAdminEditor"],data:function(){return{updateInProgress:!1,currentStyleName:null,displayAddLinkModal:!1,currentlink:null,displayColorPopover:!1,displayBackgroun
1dColorPopover:!1,displayAlignPopover:!1,displayInsertSpecialCharsPopover:!1,displayInsertSmileyCharsPopover:!1,displayAIFeaturesPopover:!1,displayLineHeightPopover:!1,displayBulletListPopover:!1,defaultTextboxStyleName:null,defaultTextboxStyleKey:null,defaultTextBoxColor:null,defaultTextBoxFontSize:null,defaultTextBoxFontFamily:null,defaultBulletListChar:null,hasMultiFontSize:!1,hasMultiFontFamily:!1,hasMultiFabricStyle:!1,selectedSpecialCharsCategory:"All",selectedSmileyCharsCategory:"All",searchSmileyChars:"",lockSelection:!1,selection:{index:null,range:null,style:{}},currentSpecialCharOver:null,currentSmileyCharOver:null}},computed:T({},Object(l.e)("palette",["palette","defaultPalettePublicColors"]),{},Object(l.e)("theme",["theme"]),{},Object(l.e)("magazine",["magazine"]),{},Object(l.e)("page",["page"]),{},Object(l.c)("app",["adminMode"]),{},Object(l.c)("magazine",["pageNameMap","checkMagazinePerm"]),{},Object(l.c)("theme",["findTextblockTypeData","getDefaultFabricTextStyle"]),{},Object(l.c)("palette",["getColorBySwatchName"]),{},Object(l.c)("article",["getTextblock"]),{hasTextSelection:function(){return this.selection&&null!==this.selection.range},hasCursorIndex:function(){return this.selection&&null!==this.selection.index},canClearStyle:function(){return this.editor.getLength()>0},currentSelectionFabricStyle:function(){var e=this;if(this.selection.style.fabricStyle&&this.selection.style.fabricStyle.key){var t=this.theme.styles.find((function(style){return style.key===e.selection.style.fabricStyle.key}));if(t&&t.style)return JSON.parse(t.style)}return null},currentSelectionTextColor:function(){if(this.selection&&this.selection.style){if(this.selection.style.color)return this.selection.style.color;if(this.currentSelectionFabricStyle&&this.currentSelectionFabricStyle.fill&&this.getColorBySwatchName[this.currentSelectionFabricStyle.fill])return this.getColorBySwatchName[this.currentSelectionFabricStyle.fill]}return this.defaultTextBoxColor},currentSelectionBackgroundColor:function(){if(this.selection&&this.selection.style){if(this.selection.style.background)return this.selection.style.background;if(this.currentSelectionFabricStyle&&this.currentSelectionFabricStyle.textBackgroundColor&&this.getColorBySwatchName[this.currentSelectionFabricStyle.textBackgroundColor])return this.getColorBySwatchName[this.currentSelectionFabricStyle.textBackgroundColor]}return null},currentSelectionFontSizePlaceHolder:function(){return this.hasMultiFontSize?" ":this.selection&&this.selection.style&&this.currentSelectionFabricStyle&&this.currentSelectionFabricStyle.fontSize?""+Math.round(d.a.convertFromPixel(this.currentSelectionFabricStyle.fontSize,"pt")):""+Math.round(d.a.convertFromPixel(this.defaultTextBoxFontSize,"pt"))},currentSelectionFontSize:function(){return this.selection&&this.selection.style&&this.selection.style.fontSize&&"string"==typeof this.selection.style.fontSize&&-1===this.selection.style.fontSize.indexOf("rem")?Math.round(d.a.convertFromPixel(parseFloat(this.selection.style.fontSize),"pt")):null},currentSelectionFontFamilyPlaceHolder:function(){return this.hasMultiFontFamily?" ":this.selection&&this.selection.style&&this.currentSelectionFabricStyle&&this.currentSelectionFabricStyle.fontFamily?this.currentSelectionFabricStyle.fontFamily:this.defaultTextBoxFontFamily},currentSelectionFontFamily:function(){return this.selection&&this.selection.style&&this.selection.style.fontFamily&&"string"==typeof this.selection.style.fontFamily?this.selection.style.fontFamily.replace(/"/g,""):null},textblockTypeData:function(){return this.findTextblockTypeData(this.textblock.type)},specialCharsCategories:function(){var e=Object(o.a)({},"All",{label:this.$t("public.edit_magazine.insert_characters.category.All"),value:"All"}),t=!0,n=!1,r=void 0;try{for(var l,c=_[Symbol.iterator]();!(t=(l=c.next()).done);t=!0){var d=l.value;e[d.char_category]||(e[d.char_category]={label:this.$t("public.edit_magazine.insert_characters.category."+d.char_category),value:d.char_category})}}catch(e){n=!0,r=e}finally{try{t||null==c.return||c.return()}finally{if(n)throw r}}return Object.values(e)},filteredSpecialCharsList:function(){var e=this;return _?_.map((function(t){return{char:t.char,description:e.$t("public.specialChars."+t.description_key),category:t.char_category}})).filter((function(t){return!e.selectedSpecialCharsCategory||"All"===e.selectedSpecialCharsCategory||t.category===e.selectedSpecialCharsCategory})):[]},filteredSmileyCharsList:function(){var e=this;return O?O.map((function(t){return{char:t.char,description:e.$t("public.smileyChars."+t.description_key),category:t.char_category}})).filter((function(t){return e.searchSmileyChars&&e.searchSmileyChars.trim().length>0?d.a.isSearchInText(e.searchSmileyChars,t.description):!e.selectedSmileyCharsCategory||"All"===e.selectedSmileyCharsCategory||t.category===e.selectedSmileyCharsCategory})):[]},stylesListGrouped:function(){var e=this,t=this.theme.styles.reduce((function(t,s){if(("header"===s.element||"paragraph"===s.element)&&!s.hideInRTE&&(e.isAdminEditor||!e.textblockTypeData||null===e.textblockTypeData.availableStyles||e.textblockTypeData.availableStyles.indexOf(s._id)>=0)){var n,r=T({},e.getDefaultFabricTextStyle,{},JSON.parse(s.style));(n=s.key?c.a.fabricStyleToCss(s.style,e.palette.swatches):null)&&t[s.element].push({value:Object.assign({},s,{style:JSON.stringify(r)}),name:s.name,style:n,htmlTag:(s.htmlTag||"span").toLowerCase()})}return t}),{header:[],paragraph:[]}),n=[];return t.header&&t.header.length>0&&n.push({label:this.$t("public.edit_magazine.header_style"),styles:t.header}),t.paragraph&&t.paragraph.length>0&&n.push({label:this.$t("public.edit_magazine.paragraph_style"),styles:t.paragraph}),n},stylesList:function(){return this.stylesListGrouped.reduce((function(e,t){return e=e.concat(t.styles)}),[])},fontSizeList:function(){for(var e=[],i=6;i<=60;i+=2)e.push({value:d.a.parseToPixel(i+"pt")+"px",label:i});return e},fontFamilyList:function(){return this.$fontManager.defaultFonts.map((function(e){return{value:e.name,label:e.name,style:"font-family:"+e.name+";"}})).sort((function(e,t){return e.label.localeCompare(t.label)}))},colorsList:function(){var e=this;return this.palette.swatches.reduce((function(t,n){if(e.isAdminEditor||!e.textblockTypeData||null===e.textblockTypeData.availableColors||e.textblockTypeData.availableColors.indexOf(n.name)>=0){var r=f()(n.color).toHex8String();-1===t.indexOf(r)&&t.push(r)}return t}),Object(y.a)(this.defaultPalettePublicColors))},bulletCharsList:function(){var e=this,t=[{value:"bullet",label:this.defaultBulletListChar}];return this.$fabricStyleBlotList&&(t=t.concat(Object.keys(this.$fabricStyleBlotList).map((function(t){return{value:t,label:e.$fabricStyleBlotList[t]}})).filter((function(t){return t.label!==e.defaultBulletListChar})))),t},pagesToLink:function(){var e=this;return this.magazine.pageOrder.reduce((function(t,n){return n._id!==e.page._id&&(n.double?(t.push({page:n,label:e.pageNameMap[n._id+"_left"],value:"#page_"+n._id+"_left"}),t.push({page:n,label:e.pageNameMap[n._id+"_right"],value:"#page_"+n._id+"_right"})):t.push({page:n,label:e.pageNameMap[n._id],value:"#page_"+n._id})),t}),[])}}
1),mounted:function(){var e=this,t=this.textblock.target&&this.$fabric.canvas?this.$fabric.canvas.getObjectById(this.textblock.target):null;if(t){var n=t.getTextBoxStyle(!1);if(n)if(this.defaultTextBoxColor=n.fill,this.defaultTextBoxFontSize=n.fontSize,this.defaultTextBoxFontFamily=n.fontFamily,t.textStyleKey){var r=this.stylesList.find((function(s){return s.value.key==t.textStyleKey}));this.defaultTextboxStyleKey=t.textStyleKey,this.defaultTextboxStyleName=r?r.name:null}else this.defaultTextboxStyleName=null;this.defaultBulletListChar=t.getBulletPointCharacter()}document.querySelectorAll(".quill-editor-content .ql-container .ql-editor").forEach((function(t){t.classList.forEach((function(e){0===e.indexOf("fabric-style-")&&t.classList.remove(e)})),t.classList.add("fabric-style-"+e.defaultTextboxStyleKey)})),this.setMatchingStyle(),this.editor.on("selection-change",this.textBoxSelectedHandler)},beforeDestroy:function(){this.editor.off("selection-change",this.textBoxSelectedHandler)},methods:{canUpdateText:function(){return!!this.hasTextSelection||(this.$message({type:"error",message:this.$t("public.edit_magazine.edit_text_selection_error")}),!1)},insertChars:function(e){this.hasCursorIndex&&this.editor.insertText(this.selection.index,e),this.displayInsertSpecialCharsPopover=!1,this.selectedSpecialCharsCategory="All",this.displayInsertSmileyCharsPopover=!1,this.selectedSmileyCharsCategory="All",this.searchSmileyChars=""},switchList:function(e){this.hasCursorIndex&&(this.selection.style.list&&this.selection.style.list===e?this.applyStyleToCurrentLine("list",!1):this.applyStyleToCurrentLine("list",e))},selectedColorChanged:function(e){e?this.applyStyleToSelection("color",f()(e.rgba).toHex8String()):this.applyStyleToSelection("color",!1)},selectedBackgroundColorChanged:function(e){e?this.applyStyleToSelection("background",f()(e.rgba).toHex8String()):this.applyStyleToSelection("background",!1)},selectedStyleChanged:function(e){this.canUpdateText()&&null!==e&&(this.currentStyleName=e.name,this.applyStyleToSelection("fabricStyle",e),this.applyStyleToSelection("color",!1),this.applyStyleToSelection("fontSize",!1),this.applyStyleToSelection("fontFamily",!1))},textBoxSelectedHandler:function(e,t){this.lockSelection||e==this.selection.range||(e&&e.length>0?(this.selection.index=e.index,this.selection.range=e,this.selection.style=e?this.editor.getFormat(e.index,e.length):{}):(this.selection.index=e?e.index:null,this.selection.range=null,this.selection.style=e?this.editor.getFormat(e.index,e.length):{}),this.setMatchingStyle())},setMatchingStyle:function(){if(this.hasMultiFontSize=!1,this.hasMultiFontFamily=!1,this.hasMultiFabricStyle=!1,this.selection.range&&this.selection.range.length>1)for(var e=null,t=null,n=null,i=0;i<this.selection.range.length;i++){var r=this.editor.getFormat(this.selection.range.index+i,1),o=null;if(r.fabricStyle){var l=null;try{l=JSON.parse(r.fabricStyle.style)}catch(e){}o=T({},this.getDefaultFabricTextStyle,{},l,{},r)}else o=T({},this.getDefaultFabricTextStyle,{},r);if(0===i)e=o.fabricStyle?o.fabricStyle.key:null,t=o.fontFamily,n=o.fontSize;else{var c=o.fabricStyle?o.fabricStyle.key:null,d=o.fontFamily,h=o.fontSize;c!==e&&(this.hasMultiFabricStyle=!0),d!==t&&(this.hasMultiFontFamily=!0),h!==n&&(this.hasMultiFontSize=!0)}if(this.hasMultiFontFamily&&this.hasMultiFontSize&&this.hasMultiFabricStyle)break}if(this.hasMultiFabricStyle)this.currentStyleName=" ";else if(this.selection.style&&this.selection.style.fabricStyle){var f=this.selection.style.fabricStyle instanceof Array?this.selection.style.fabricStyle[0]:this.selection.style.fabricStyle;if(f.key){var m=this.stylesList.find((function(s){return s.value.key==f.key}));if(m)return void(this.currentStyleName=m.name)}this.currentStyleName=this.defaultTextboxStyleName}else this.currentStyleName=this.defaultTextboxStyleName},showAddTextLink:function(){this.canUpdateText()&&(this.currentlink=this.selection.style.link&&this.selection.style.link.href?this.selection.style.link.href:null,this.lockCurrentSelection(!0),this.displayAddLinkModal=!0)},addLinkModalClosed:function(){this.currentlink=null,this.lockCurrentSelection(!1)},confirmUpdateTextLink:function(){if(this.canUpdateText()){if(!this.$refs.addLinkForm.isValid)return void this.$message({type:"error",message:this.$t("public.edit_magazine.invalid_link")});var link=this.$refs.addLinkForm.computedLink;link?this.applyStyleToSelection("link",link):this.applyStyleToSelection("link",!1),this.displayAddLinkModal=!1,this.currentlink=null}},onClickUndoText:function(){var e=this;this.updateInProgress||(this.updateInProgress=!0,this.$emit("undo"),setTimeout((function(){e.updateInProgress=!1}),500))},onClickRedoText:function(){var e=this;this.updateInProgress||(this.updateInProgress=!0,this.$emit("redo"),setTimeout((function(){e.updateInProgress=!1}),500))},clearStyle:function(){this.selection.range?this.editor.removeFormat(this.selection.range.index,this.selection.range.length):this.editor.removeFormat(0,this.editor.getLength()-1),this.selection.style={},this.setMatchingStyle()},applyStyleToCurrentLine:function(e,t){this.hasCursorIndex&&(this.editor.formatLine(this.selection.index,this.selection.range&&this.selection.range.length&&this.selection.range.length>0?this.selection.range.length:1,e,t),this.selection.style=this.editor.getFormat(),this.setMatchingStyle(),this.displayColorPopover=!1,this.displayBackgroun
1dColorPopover=!1,this.displayAlignPopover=!1,this.displayInsertSpecialCharsPopover=!1,this.selectedSpecialCharsCategory="All",this.displayInsertSmileyCharsPopover=!1,this.selectedSmileyCharsCategory="All",this.searchSmileyChars="",this.displayLineHeightPopover=!1,this.displayBulletListPopover=!1)},applyStyleToSelection:function(e,t){this.canUpdateText()&&("color"==e&&this.$emit("colorChanged"),this.editor.formatText(this.selection.range.index,this.selection.range.length,e,t),this.selection.style=this.editor.getFormat(),this.setMatchingStyle(),this.displayColorPopover=!1,this.displayBackgroundColorPopover=!1,this.displayAlignPopover=!1,this.displayInsertSpecialCharsPopover=!1,this.selectedSpecialCharsCategory="All",this.displayInsertSmileyCharsPopover=!1,this.selectedSmileyCharsCategory="All",this.searchSmileyChars="",this.displayLineHeightPopover=!1,this.displayBulletListPopover=!1)},selectVisibleChange:function(e){e||this.lockCurrentSelection(!1)},lockCurrentSelection:function(e){(this.displayAddLinkModal||this.displayColorPopover||this.displayBackgroundColorPopover||this.displayAlignPopover||this.displayLineHeightPopover)&&(e=!0),this.lockSelection=e,!1===e&&this.hasTextSelection&&this.editor.setSelection(this.selection.range.index,this.selection.range.length)}}},C=(n(634),n(635),n(6));function x(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function D(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?x(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):x(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var I={name:"RichTextEditor",components:{RichTextEditorActions:Object(C.a)(P,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-row",{staticClass:"rte-actionbar",attrs:{type:"flex",align:"middle"}},[n("MzIconButton",{staticClass:"ml-0",attrs:{disabled:!e.canClearStyle,name:"format_clear",noBorder:!0,type:"small",tooltip:e.$t("public.edit_magazine.clear_style_tooltip"),tooltipPlacement:"top"},on:{click:e.clearStyle}}),e._v(" "),n("el-select",{directives:[{name:"show",rawName:"v-show",value:e.stylesListGrouped.length>0,expression:"stylesListGrouped.length > 0"}],staticClass:"mr-0",staticStyle:{"min-width":"100px"},attrs:{value:e.currentStyleName,size:"small",placeholder:e.$t("public.edit_magazine.select_style")},on:{change:function(t){return e.selectedStyleChanged(t)},"visible-change":e.selectVisibleChange},nativeOn:{mousedown:function(t){return t.preventDefault(),e.lockCurrentSelection(!0)},touchstart:function(t){return t.preventDefault(),e.lockCurrentSelection(!0)}}},e._l(e.stylesListGrouped,(function(t){return n("el-option-group",{key:t.label,attrs:{label:t.label}},e._l(t.styles,(function(t){return n("el-option",{key:t.name,attrs:{label:t.name,value:t.value}},[e.adminMode?n("span",{staticClass:"htmlTag"},[e._v(e._s("<"+t.htmlTag+"> "))]):e._e(),e._v(" "),n("span",{staticClass:"ml-0 styleName"},[e._v(e._s(t.name))])])})),1)})),1),e._v(" "),n("el-select",{staticClass:"mr-0",staticStyle:{"min-width":"100px"},attrs:{value:e.currentSelectionFontFamily,placeholder:e.currentSelectionFontFamilyPlaceHolder,filterable:"","default-first-option":"",size:"small"},on:{change:function(t){return e.applyStyleToSelection("fontFamily",t||!1)},"visible-change":e.selectVisibleChange},nativeOn:{mousedown:function(t){return t.preventDefault(),e.lockCurrentSelection(!0)},touchstart:function(t){return t.preventDefault(),e.lockCurrentSelection(!0)}}},[e.currentSelectionFontFamily?n("el-option-group",[n("el-option",{attrs:{label:e.$t("public.edit_magazine.resetFontFamily"),value:!1}})],1):e._e(),e._v(" "),n("el-option-group",e._l(e.fontFamilyList,(function(e){return n("el-option",{key:e.value,style:e.style,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),n("el-select",{staticClass:"mr-0",staticStyle:{width:"70px"},attrs:{value:e.currentSelectionFontSize,placeholder:e.currentSelectionFontSizePlaceHolder,filterable:"","allow-create":"","default-first-option":"",size:"small"},on:{change:function(t){e.applyStyleToSelection("fontSize",!!(t&&parseInt(t)>0)&&parseInt(t)+"px")},"visible-change":e.selectVisibleChange},nativeOn:{mousedown:function(t){return t.preventDefault(),e.lockCurrentSelection(!0)},touchstart:function(t){return t.preventDefault(),e.lockCurrentSelection(!0)}}},[e.currentSelectionFontSize?n("el-option-group",[n("el-option",{attrs:{label:e.$t("public.edit_magazine.resetFontSize"),value:!1}}
1)],1):e._e(),e._v(" "),n("el-option-group",e._l(e.fontSizeList,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),e.colorsList.length>0?n("el-popover",{staticClass:"ml-0 mr-0",attrs:{placement:"bottom",trigger:"click"},on:{show:function(t){return e.lockCurrentSelection(!0)},hide:function(t){return e.lockCurrentSelection(!1)}},model:{value:e.displayColorPopover,callback:function(t){e.displayColorPopover=t},expression:"displayColorPopover"}},[n("el-row",[n("Compact",{attrs:{value:{},palette:e.colorsList},on:{input:function(t){return e.selectedColorChanged(t)}}})],1),e._v(" "),n("el-tooltip",{attrs:{slot:"reference",content:e.$t("public.edit_magazine.change_color_tooltip"),placement:"top","open-delay":500,enterable:!1},slot:"reference"},[n("el-button",{staticClass:"icon-select-color",style:{backgroundColor:e.currentSelectionTextColor},attrs:{circle:""}})],1)],1):e._e()],1),e._v(" "),n("el-row",{staticClass:"rte-actionbar mt-0",attrs:{type:"flex",align:"middle"}},[n("el-popover",{staticClass:"ml-0",attrs:{placement:"bottom",trigger:"click"},on:{show:function(t){return e.lockCurrentSelection(!0)},hide:function(t){return e.lockCurrentSelection(!1)}},model:{value:e.displayAlignPopover,callback:function(t){e.displayAlignPopover=t},expression:"displayAlignPopover"}},[n("el-row",[n("MzIconButton",{attrs:{name:"format_align_left",noBorder:!0,type:"small",selected:"left"==e.selection.style.textAlign,tooltip:e.$t("public.edit_magazine.left_align_tooltip")},on:{click:function(t){return e.applyStyleToCurrentLine("textAlign","left")}}}),e._v(" "),n("MzIconButton",{attrs:{name:"format_align_center",noBorder:!0,selected:"center"==e.selection.style.textAlign,tooltip:e.$t("public.edit_magazine.center_align_tooltip")},on:{click:function(t){return e.applyStyleToCurrentLine("textAlign","center")}}}),e._v(" "),n("MzIconButton",{attrs:{name:"format_align_right",noBorder:!0,selected:"right"==e.selection.style.textAlign,tooltip:e.$t("public.edit_magazine.right_align_tooltip")},on:{click:function(t){return e.applyStyleToCurrentLine("textAlign","right")}}}),e._v(" "),n("MzIconButton",{attrs:{name:"format_align_justify",noBorder:!0,selected:"justify"==e.selection.style.textAlign,tooltip:e.$t("public.edit_magazine.justify_tooltip")},on:{click:function(t){return e.applyStyleToCurrentLine("textAlign","justify")}}})],1),e._v(" "),n("MzIconButton",{attrs:{slot:"reference",name:"format_align_"+(e.selection.style.textAlign?e.selection.style.textAlign:"left"),noBorder:!0,disableStopEvent:!0},slot:"reference"})],1),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"format_bold",noBorder:!0,selected:e.selection.style.bold,tooltip:e.$t("public.edit_magazine.bold_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.applyStyleToSelection("bold",!e.selection.style.bold)}}}),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"format_italic",noBorder:!0,selected:e.selection.style.italic,tooltip:e.$t("public.edit_magazine.italic_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.applyStyleToSelection("italic",!e.selection.style.italic)}}}),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"format_strikethrough",noBorder:!0,selected:e.selection.style.strike,tooltip:e.$t("public.edit_magazine.strikethrough_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.applyStyleToSelection("strike",!e.selection.style.strike)}}}),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"format_underlined",noBorder:!0,selected:e.selection.style.underline,tooltip:e.$t("public.edit_magazine.underline_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.applyStyleToSelection("underline",!e.selection.style.underline)}}}),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"add_link",noBorder:!0,tooltip:e.$t("public.edit_magazine.link_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.showAddTextLink()}}}),e._v(" "),n("el-popover",{staticClass:"ml-0",attrs:{placement:"bottom",trigger:"click"},on:{show:function(t){return e.lockCurrentSelection(!0)},hide:function(t){return e.lockCurrentSelection(!1)}},model:{value:e.displayLineHeightPopover,callback:function(t){e.displayLineHeightPopover=t},expression:"displayLineHeightPopover"}},[n("el-row",[n("el-tag",{staticClass:"tag-lineheight",attrs:{type:"info",effect:e.selection.style.lineHeight?"plain":"dark"},on:{click:function(t){return e.applyStyleToCurrentLine("lineHeight",!1)}}},[e._v("\n "+e._s(e.$t("public.edit_magazine.line_height_default_tooltip"))+"\n ")]),e._v(" "),n("el-tag",{staticClass:"tag-lineheight",attrs:{type:"info",effect:"1"==e.selection.style.lineHeight?"dark":"plain"},on:{click:function(t){return e.applyStyleToCurrentLine("lineHeight","1")}
1}},[e._v("\n "+e._s(e.$t("public.edit_magazine.line_height_single_tooltip"))+"\n ")]),e._v(" "),n("el-tag",{staticClass:"tag-lineheight",attrs:{type:"info",effect:"1.25"==e.selection.style.lineHeight?"dark":"plain"},on:{click:function(t){return e.applyStyleToCurrentLine("lineHeight","1.25")}}},[e._v("\n x1.25\n ")]),e._v(" "),n("el-tag",{staticClass:"tag-lineheight",attrs:{type:"info",effect:"1.5"==e.selection.style.lineHeight?"dark":"plain"},on:{click:function(t){return e.applyStyleToCurrentLine("lineHeight","1.5")}}},[e._v("\n x1.5\n ")]),e._v(" "),n("el-tag",{staticClass:"tag-lineheight",attrs:{type:"info",effect:"2"==e.selection.style.lineHeight?"dark":"plain"},on:{click:function(t){return e.applyStyleToCurrentLine("lineHeight","2")}}},[e._v("\n x2\n ")])],1),e._v(" "),n("MzIconButton",{attrs:{slot:"reference",name:"format_line_spacing",noBorder:!0,disableStopEvent:!0,tooltip:e.$t("public.edit_magazine.line_height_tooltip"),tooltipPlacement:"top"},slot:"reference"})],1),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"superscript",noBorder:!0,selected:"super"===e.selection.style.script,tooltip:e.$t("public.edit_magazine.superscript_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.applyStyleToSelection("script","super"!==e.selection.style.script&&"super")}}}),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"subscript",noBorder:!0,selected:"sub"===e.selection.style.script,tooltip:e.$t("public.edit_magazine.subscript_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.applyStyleToSelection("script","sub"!==e.selection.style.script&&"sub")}}}),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{name:"format_list_numbered",noBorder:!0,selected:"ordered"===e.selection.style.list,tooltip:e.$t("public.edit_magazine.numbered_list_tooltip"),tooltipPlacement:"top"},on:{click:function(t){return e.switchList("ordered")}}}),e._v(" "),n("el-popover",{staticClass:"ml-0",attrs:{placement:"bottom",trigger:"click"},on:{show:function(t){return e.lockCurrentSelection(!0)},hide:function(t){return e.lockCurrentSelection(!1)}},model:{value:e.displayBulletListPopover,callback:function(t){e.displayBulletListPopover=t},expression:"displayBulletListPopover"}},[n("el-row",{attrs:{type:"flex",justify:"left",align:"middle"}},e._l(e.bulletCharsList,(function(t){return n("el-col",{key:t.value,staticClass:"mr-0"},[n("el-button",{attrs:{size:"small",type:e.selection.style.list===t.value?"primary":"default"},on:{click:function(n){return e.switchList(t.value)}}},[e._v(e._s(t.label))])],1)})),1),e._v(" "),n("MzIconButton",{attrs:{slot:"reference",name:"format_list_bulleted",noBorder:!0,disableStopEvent:!0,selected:e.selection.style.list&&"ordered"!==e.selection.style.list,tooltip:e.$t("public.edit_magazine.bulleted_list_tooltip"),tooltipPlacement:"top"},slot:"reference"})],1),e._v(" "),n("el-popover",{staticClass:"ml-0",attrs:{placement:"bottom",trigger:"click","popper-class":"rte-action-popover"},model:{value:e.displayInsertSpecialCharsPopover,callback:function(t){e.displayInsertSpecialCharsPopover=t},expression:"displayInsertSpecialCharsPopover"}},[n("el-row",[e._v("\n "+e._s(e.$t("public.edit_magazine.insert_characters.title"))+"\n ")]),e._v(" "),n("el-row",{staticClass:"rte-special-char-filter-content"},[n("el-select",{staticClass:"el-col-24 mt-1",attrs:{placeholder:"Select",size:"small"},model:{value:e.selectedSpecialCharsCategory,callback:function(t){e.selectedSpecialCharsCategory=t},expression:"selectedSpecialCharsCategory"}},e._l(e.specialCharsCategories,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),n("div",{staticClass:"rte-special-char-content"},e._l(e.filteredSpecialCharsList,(function(t){return n("span",{key:t.char,staticClass:"rte-special-char",on:{click:function(n){return e.insertChars(t.char)},mouseover:function(n){e.currentSpecialCharOver=t},mouseout:function(t){e.currentSpecialCharOver=null}}},[e._v("\n "+e._s(t.char)+"\n ")])})),0),e._v(" "),n("el-row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[e.currentSpecialCharOver?n("span",[n("small",[e._v(e._s(e.currentSpecialCharOver.description))])]):e._e(
1),e._v(" "),n("span",[e._v("  ")])]),e._v(" "),n("MzIconButton",{attrs:{slot:"reference",name:"format_paragraph",noBorder:!0,tooltip:e.$t("public.edit_magazine.insert_characters_tooltip"),tooltipPlacement:"top",disableStopEvent:!0},slot:"reference"})],1),e._v(" "),n("el-popover",{staticClass:"ml-0",attrs:{placement:"bottom",trigger:"click","popper-class":"rte-action-popover"},model:{value:e.displayInsertSmileyCharsPopover,callback:function(t){e.displayInsertSmileyCharsPopover=t},expression:"displayInsertSmileyCharsPopover"}},[n("el-row",[e._v("\n "+e._s(e.$t("public.edit_magazine.insert_smiley.title"))+"\n ")]),e._v(" "),n("el-row",{staticClass:"rte-special-char-filter-content"},[n("el-input",{staticClass:"el-col-24 mt-1",attrs:{size:"small",clearable:"",placeholder:e.$t("public.edit_magazine.insert_smiley.search_placeholder")},on:{input:function(t){e.selectedSmileyCharsCategory="All"}},model:{value:e.searchSmileyChars,callback:function(t){e.searchSmileyChars=t},expression:"searchSmileyChars"}})],1),e._v(" "),n("el-row",{staticClass:"rte-special-char-filter-content"},[n("el-tabs",{staticClass:"rte-smiley-category-tabs",on:{"tab-click":function(t){e.searchSmileyChars=""}},model:{value:e.selectedSmileyCharsCategory,callback:function(t){e.selectedSmileyCharsCategory=t},expression:"selectedSmileyCharsCategory"}},[n("el-tab-pane",{attrs:{label:"ð",name:"Smileys_Expressions"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ð",name:"Gestures_People"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ð»",name:"Animals_Nature"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ð",name:"Food_Drinks"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ð",name:"Travel_Places"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ð",name:"Activities"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ð¡",name:"Objects"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ðµ",name:"Symbols"}}),e._v(" "),n("el-tab-pane",{attrs:{label:"ð¨ðµ",name:"Flags"}})],1)],1),e._v(" "),n("div",{staticClass:"rte-special-char-content rte-smiley-char-content"},e._l(e.filteredSmileyCharsList,(function(t){return n("span",{key:t.char,staticClass:"rte-special-char",on:{click:function(n){return e.insertChars(t.char)},mouseover:function(n){e.currentSmileyCharOver=t},mouseout:function(t){e.currentSmileyCharOver=null}}},[e._v("\n "+e._s(t.char)+"\n ")])})),0),e._v(" "),n("el-row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[e.currentSmileyCharOver?n("span",[n("small",[e._v(e._s(e.currentSmileyCharOver.description))])]):e._e(),e._v(" "),n("span",[e._v("  ")])]),e._v(" "),n("MzIconButton",{attrs:{slot:"reference",name:"sentiment_satisfied",noBorder:!0,tooltip:e.$t("public.edit_magazine.insert_smiley_tooltip"),tooltipPlacement:"top",disableStopEvent:!0},slot:"reference"})],1),e._v(" "),e.colorsList.length>0?n("el-popover",{staticClass:"ml-0 mr-0",attrs:{placement:"bottom",trigger:"click"},on:{show:function(t){return e.lockCurrentSelection(!0)},hide:function(t){return e.lockCurrentSelection(!1)}},model:{value:e.displayBackgroundColorPopover,callback:function(t){e.displayBackgroundColorPopover=t},expression:"displayBackgroundColorPopover"}},[n("el-row",{attrs:{type:"flex",justify:"left",align:"middle"}},[n("span",{staticClass:"clean-background-color",on:{click:function(t){return e.selectedBackgroundColorChanged(!1)}}},[e._v("\n X\n ")]),e._v(" "),n("Compact",{attrs:{value:{},palette:e.colorsList},on:{input:function(t){return e.selectedBackgroundColorChanged(t)}}})],1),e._v(" "),n("el-tooltip",{attrs:{slot:"reference",content:e.$t("public.edit_magazine.change_backgroundcolor_tooltip"),placement:"top","open-delay":500,enterable:!1},slot:"reference"},[n("span",{staticClass:"content-background-color"},[n("MzIconButton",{attrs:{name:"ink_highlighter",noBorder:!0,disableStopEvent:!0}}),e._v(" "),n("span",{staticClass:"display-background-color",style:{backgroundColor:e.currentSelectionBackgroundColor}},[e._v(" ")])],1)])],1):e._e(),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{disabled:e.updateInProgress||!e.textblock.canUndo,name:"undo",noBorder:!0,type:"small",tooltip:e.$t("public.edit_magazine.undo_text"),tooltipPlacement:"top"},on:{click:e.onClickUndoText}}),e._v(" "),n("MzIconButton",{staticClass:"ml-0",attrs:{disabled:e.updateInProgress||!e.textblock.canRedo,name:"redo",noBorder:!0,type:"small",tooltip:e.$t("public.edit_magazine.redo_text"),tooltipPlacement:"top"},on:{click:e.onClickRedoText}})],1),e._v(" "),n("el-dialog",{attrs:{visible:e.displayAddLinkModal,"append-to-body":""},on:{"update:visible":function(t){e.displayAddLinkModal=t},closed:e.addLinkModalClosed}},[n("span",{staticClass:"el-dialog__title",attrs:{slot:"title"},slot:"title"},[n("MzAppIcon",{attrs:{name:"link_2"}}),e._v(" "),n("span",[e._v(e._s(e.$t("public.edit_magazine.add_text_link")))])],1
1),e._v(" "),n("br"),e._v(" "),n("AddLinkForm",{ref:"addLinkForm",attrs:{defaultLink:e.currentlink}}),e._v(" "),n("br"),e._v(" "),n("span",{staticClass:"dialog-footer-buttons",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.validate",expression:"'public.alert.validate'"}],attrs:{type:"success"},on:{click:e.confirmUpdateTextLink}})],1)],1)],1)}),[],!1,null,"187ea63b",null).exports},props:["textblock","title","backgroundProcess"],data:function(){return{loading:!1,editorIsReady:!1,lockEditorChangeSave:!1,textOverflow:!1,textContent:"",refreshTextColorContrast:!1,lockSendSaveTextblock:!1,resendSaveTextBlock:!1,fabricStyleSheet:null}},computed:D({},Object(l.e)("theme",["theme"]),{},Object(l.e)("page",["page"]),{},Object(l.e)("magazine",["magazine"]),{},Object(l.e)("palette",["palette","themePalettes","paletteDependantProperty"]),{},Object(l.c)("app",["adminMode"]),{editor:function(){return this.$refs&&this.$refs.editor?this.$refs.editor.quill:null},quillEditorStyleVariables:function(){var e={},t=this.textblock.target&&this.$fabric&&this.$fabric.canvas?this.$fabric.canvas.getObjectById(this.textblock.target):null,n=t?t.getTextLinkStyle():null;n?Object.assign(e,{"--rte-link-color":n.fill,"--rte-link-text-decoration":n.underline?"underline":"","--rte-link-font-weight":n.fontWeight,"--rte-link-font-style":n.fontStyle}):Object.assign(e,{"--rte-link-text-decoration":"underline"});var r=t?t.getBulletPointFillStyle():null;r&&Object.assign(e,{"--rte-list-color":r});var o=t?t.getBulletPointCharacter():null;return o&&(e["--rte-list-character"]="'"+o+"'"),e},templateVariablesName:function(){var e=this,t={};return["global1","var1","global2","var2","global3","var3"].forEach((function(n){var r="#".concat(n),o=e.magazine.displayVariablesNames?e.magazine.displayVariablesNames.find((function(e){return e.key===n})):null;o&&o.name&&(o.name instanceof String?r+=" (".concat(o.name,")"):o.name.en&&(r+=" (".concat(o.name.en,")"))),t[n]=r})),t}}),mounted:function(){var e=this;this.fabricStyleSheet=document.createElement("style"),this.fabricStyleSheet.type="text/css",document.getElementsByTagName("head")[0].appendChild(this.fabricStyleSheet);for(var t=this.theme.styles.reduce((function(t,s){if(("header"===s.element||"paragraph"===s.element)&&!s.hideInRTE&&s.key){var n=c.a.fabricStyleToCss(s.style,e.palette.swatches,60),r=Object.keys(n).map((function(e){return e+":"+n[e]}));t.push({className:".ql-container .fabric-style-"+s.key,cssStyle:r.join(";")})}return t}),[]),n=0,r=Object.keys(this.$fabricStyleBlotList);n<r.length;n++){var o=r[n];t.push({className:".ql-container .ql-editor ul.fabric-list-style-".concat(o," li::before"),cssStyle:"content: '".concat(this.$fabricStyleBlotList[o],"'")})}var l=!0,d=!1,h=void 0;try{for(var f,m=t[Symbol.iterator]();!(l=(f=m.next()).done);l=!0){var style=f.value;(this.fabricStyleSheet.sheet||{}).insertRule?this.fabricStyleSheet.sheet.insertRule(style.className+"{"+style.cssStyle+"}",0):(this.fabricStyleSheet.styleSheet||this.fabricStyleSheet.sheet).addRule(style.className,style.cssStyle)}}catch(e){d=!0,h=e}finally{try{l||null==m.return||m.return()}finally{if(d)throw h}}},beforeDestroy:function(){this.fabricStyleSheet&&(this.fabricStyleSheet.parentNode.removeChild(this.fabricStyleSheet),this.fabricStyleSheet=null),d.a.executeDebounceNow(this,"debounceInput"),d.a.executeDebounceNow(this,"debounceSave"),this.removeCanvasListener()},methods:D({},Object(l.d)({updateFabricStateField:"fabric/UPDATE_ROOT_FIELD",setText:"article/SET_TEXT",updateMagazineGlobalsTextSettings:"magazine/UPDATE_GLOBALS_TEXT_SETTINGS"}),{},Object(l.b)({saveTextblock:"article/SAVE_TEXTBLOCK",saveMagazine:"magazine/SAVE_MAGAZINE",saveTemplateMagazine:"magazine/SAVE_TEMPLATE_MAGAZINE",apiSendError:"api/API_SEND_ERROR",undoTextblock:"article/UNDO_TEXTBLOCK",redoTextblock:"article/REDO_TEXTBLOCK"}),{updateText:function(){if(0===this.textblock.type.indexOf("Footer")){var e=this.extractTextAndFlatStyle();this.updateMagazineGlobalsTextSettings({type:this.textblock.type,position:this.textblock.pagePosition,value:JSON.stringify(D({html:this.editor.root.innerHTML},e))});var t=this.$fabric.canvas?this.$fabric.canvas.getObjectsOfType("MzTextbox"):[],n=!0,r=!1,o=void 0;try{for(var l,c=t[Symbol.iterator]();!(n=(l=c.next()).done);
1n=!0){var d=l.value;d.blockType===this.textblock.type&&("left"===this.textblock.pagePosition?d.setStyledTextIfLeftPage({text:e.text,flatStyle:e.flatStyle}):"right"===this.textblock.pagePosition&&d.setStyledTextIfRightPage({text:e.text,flatStyle:e.flatStyle}),this.$fabric.refresh(d))}}catch(e){r=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw o}}}else{var h=this.textblock.target&&this.$fabric.canvas?this.$fabric.canvas.getObjectById(this.textblock.target):null;if(h){var f=this.extractTextAndFlatStyle();h.setStyledText({text:f.text,flatStyle:f.flatStyle}),this.$fabric.refresh(h)}}},extractTextAndFlatStyle:function(){for(var e=this.editor.getLength(),t=this.editor.getLines(0,e),n=[],r=0,line=0,o=0,l=0;l<e;l++){t[line]&&t[line].cache&&t[line].cache.length===r&&(line++,r=0);var d=c.a.convertCsstoFabric(this.editor.getFormat(l,1),0===r);d&&0===r&&(d.list?(this.$fabricStyleBlotList[d.list]&&(d.bulletChar=this.$fabricStyleBlotList[d.list],d.list="bullet"),d.listIndex=o,o++):o=0),n.push(d),r++}return{text:this.editor.getText().slice(0,-1),flatStyle:n}},initCanvasListener:function(){this.$fabric&&this.$fabric.canvas&&this.$fabric.canvas.on("text:overflow",this.onFabricTextOverflowChanged)},removeCanvasListener:function(){this.$fabric&&this.$fabric.canvas&&this.$fabric.canvas.off("text:overflow",this.onFabricTextOverflowChanged)},onFabricTextOverflowChanged:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.editor.getLength();(t||this.textOverflow)&&this.editor.formatText(0,n,"overflowBackground",!1,"silent"),this.textOverflow=e.value,e.value&&e.length>0&&this.editor.formatText(n-e.length-1,e.length,"overflowBackground",!0,"silent")},onTextblockChanged:function(){var e=this,t=this.editor.getSelection();this.refreshTextContent(),this.$nextTick((function(){e.updateText(),setTimeout((function(){0===e.textblock.type.indexOf("Footer")?e.magazine.isTemplate?e.saveTemplateMagazine():e.saveMagazine():e.textblock.target&&!e.backgroundProcess&&e.$bus.$emit("rteTextHasChanged",e.textblock.target)}),100),t&&e.editor.setSelection(t)}))},refreshTextContent:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.lockEditorChangeSave=!0,this.refreshTextColorContrast=!0;var n=this.textblock.html;if("<p><br></p>"==(n=n.replace(/font-size:\s*1rem;?/g,"")).substr(-11)&&(n+="<p><br></p>"),this.textContent=n,this.editor.root.style.textAlign=0===this.textblock.type.indexOf("Footer")?this.textblock.pagePosition:"left",t&&0===n.trim().length){var r=this.textblock.target&&this.$fabric.canvas?this.$fabric.canvas.getObjectById(this.textblock.target):null;if(r){var o=r.text.length>0&&!r.isPlaceholderText?r.text:"";this.refreshTextColorContrast=!0,this.editor.setText(o);for(var l=r.getSelectionStyles(0,o.length),d=null,h=null,f=0;f<l.length;f++){var m=0===Object.keys(l[f]).length?null:JSON.stringify(l[f]);0===f&&(d=m,h=0),(f===l.length-1||f>0&&m!=d)&&(null!==d&&function(){var t=c.a.fabricStyleToQuillEditor(d),n=f-h;if(f===l.length-1&&n++,t.textStyleKey){var r=e.theme.styles.find((function(style){return style.key===t.textStyleKey}));if(r){var o=Object.assign({},r,{style:JSON.parse(r.style)});e.refreshTextColorContrast=!0,e.editor.formatText(h,n,{fabricStyle:o})}}t.formatText&&(e.refreshTextColorContrast=!0,e.editor.formatText(h,n,t.formatText)),t.formatLine&&e.editor.formatLine(h,n,t.formatLine)}(),d=m,h=f)}}}},onEditorFocus:function(e){if(this.$keyboardShortcut&&this.$keyboardShortcut.enableGlobalShortcuts(!1),this.textblock&&!this.backgroundProcess&&this.$fabric&&this.$fabric.canvas){var t=this.$fabric.canvas.getActiveObject();if(!t||t.id!==this.textblock.target){if(t&&"MzTextbox"===t.type&&t.isInSameTextGroupAs(this.textblock.target))return;this.$fabric.canvas.selectObjectById(this.textblock.target)}}},onEditorBlur:function(){this.$keyboardShortcut&&this.$keyboardShortcut.enableGlobalShortcuts(!0)},onEditorReady:function(e){var t=this;this.refreshTextContent(!0),this.editorIsReady=!0,this.initCanvasListener(),setTimeout((function(){if(t.editor.focus(),t.editor.setSelection(t.textContent.length),t.textblock&&!t.backgroundProcess){var e=t.$fabric&&t.$fabric.canvas?t.$fabric.canvas.getActiveObject():null;e&&e.id===t.textblock.target&&t.onFabricTextOverflowChanged({value:e.textOverflow,length:e.textOverflowLength},!0)}t.$emit("ready")}),100)},onEditorChange:function(e){var t=this,html=e.html,n=this.lockEditorChangeSave;this.textContent=html,this.lockEditorChangeSave=!1;try{if(html=html.replace(/contrast-text-color/g,""),this.refreshTextColorContrast&&(this.refreshTextColorContrast=!1,d.a.debounce((function(){var e=!1;document.querySelectorAll("div.ql-editor *[style]").forEach((function(element){element.style.color&&f()(element.style.color).getBrightness()>230?element.classList.contains("contrast-text-color")||(e=!0,element.classList.add("contrast-text-color")):element.classList.contains("contrast-text-color")&&(e=!0,element.classList.remove("contrast-text-color"))})),e&&n&&(t.lockEditorChangeSave=!0)}),100,this,"debounceContrast")()),this.textblock.html===html)return;if(0!==this.textblock.type.indexOf("Footer")&&this.setText({id:this.textblock._id,html:html}),n)return;var r=" </p>"===html.substr(-5)||"<br></p>"===html.substr(8);d.a.debounce((function(){try{t.updateText()}catch(e){console.error("error on RichTextEditor.vue - onEditorChange - debounceInput",e),t.apiSendError({from:"RichTextEditor.vue - onEditorChange - debounceInput",error:e})}}),100,this,"debounceInput")(),d.a.debounce((function(){try{if(!t.textblock)return;0===t.textblock.type.indexOf("Footer")?t.magazine.isTemplate?t.saveTemplateMagazine():t.saveMagazine():t.sendAsyncSaveTextblock()}catch(e){console.error("error on RichTextEditor.vue - onEditorChange - debounceSave",e),t.apiSendError({from:"RichTextEditor.vue - onEditorChange - debounceSave",error:e})}}),r?100:1e3,this,"debounceSave")()}catch(e){console.error("error on RichTextEditor.vue - onEditorChange",e),this.apiSendError({from:"RichTextEditor.vue - onEditorChange",error:e})}},onClickUndoText:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.lockSendSaveTextblock){t.next=2;break}return t.abrupt("return");case 2:return e.lockSendSaveTextblock=!0,t.next=5,e.undoTextblock({id:e.textblock._id});case 5:e.onTextblockChanged(),e.lockSendSaveTextblock=!1,e.resendSaveTextBlock&&(e.resendSaveTextBlock=!1,e.$nextTick((function(){e.sendAsyncSaveTextblock()})));case 8:case"end":return t.stop()}}),t)})))()},onClickRedoText:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.lockSendSaveTextblock){t.next=2;break}return t.abrupt("return");case 2:return e.lockSendSaveTextblock=!0,t.next=5,e.redoTextblock({id:e.textblock._id});case 5:e.onTextblockChanged(),e.lockSendSaveTextblock=!1,e.resendSaveTextBlock&&(e.resendSaveTextBlock=!1,e.$nextTick((function(){e.sendAsyncSaveTextblock()})));case 8:case"end":return t.stop()}}),t)})))()},sendAsyncSaveTextblock:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.lockSendSaveTextblock){t.next=3;break}return e.resendSaveTextBlock=!0,t.abrupt("return");case 3:return e.lockSendSaveTextblock=!0,e.textblock.target&&!e.backgroundProcess&&e.$bus.$emit("rteTextHasChanged",e.textblock.target),t.next=7,e.saveTextblock({id:e.textblock._id,keys:["html"]});case 7:e.lockSendSaveTextblock=!1,e.resendSaveTextBlock&&(e.resendSaveTextBlock=!1,e.$nextTick((function(){e.sendAsyncSaveTextblock()})));case 9:case"end":return t.stop()}}),t)})))()},generateLoremIpsum:function(e){var text=Object(m.loremIpsum)({count:1,units:e});text+="paragraphs"===e?"\n":" ";var t=this.editor.getLength();this.editor.insertText(t-1,text)},clearCurrentText:function(){var e=this.editor.getLength();this.editor.deleteText(0,e)},generateVariable:function(e){var text="{"+e+"}",t=this.editor.getSelection();this.editor.insertText(t?t.index+t.length:0,text)}})},w=(n(636),Object(C.a)(I,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.textblock?n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"rte-element"},[e.editorIsReady&&!e.backgroundProcess?n("RichTextEditorActions",{staticClass:"rte-actionbar",attrs:{editor:e.editor,textblock:e.textblock,isAdminEditor:e.adminMode},on:{colorChanged:function(t){e.refreshTextColorContrast=!0},undo:e.onClickUndoText,redo:e.onClickRedoText}}
1):e._e(),e._v(" "),e.adminMode&&0!==e.textblock.type.indexOf("Footer")&&!e.backgroundProcess?n("el-row",{staticClass:"rte-text-generator",attrs:{type:"flex",justify:"space-between",align:"middle"}},[e._v("\n "+e._s(e.$t("public.article_editor.text_generator.title"))+"\n "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateLoremIpsum("words")}}},[e._v(e._s(e.$t("public.article_editor.text_generator.add_world")))]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateLoremIpsum("sentences")}}},[e._v(e._s(e.$t("public.article_editor.text_generator.add_sentence")))]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateLoremIpsum("paragraphs")}}},[e._v(e._s(e.$t("public.article_editor.text_generator.add_paragraph")))]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:e.clearCurrentText}},[e._v(e._s(e.$t("public.article_editor.text_generator.clear")))])],1):e.adminMode&&0===e.textblock.type.indexOf("Footer")&&!e.backgroundProcess?n("div",{staticClass:"rte-text-generator"},[n("el-row",{attrs:{type:"flex",justify:"left",align:"middle"}},[n("span",{staticClass:"mr-1"},[e._v(e._s(e.$t("public.article_editor.variable_generator.title")))]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("page")}}},[e._v(e._s(e.$t("public.article_editor.variable_generator.page")))]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("nb")}}},[e._v(e._s(e.$t("public.article_editor.variable_generator.nb")))]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("name")}}},[e._v(e._s(e.$t("public.article_editor.variable_generator.name")))]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("issue")}}},[e._v(e._s(e.$t("public.article_editor.variable_generator.issue")))])],1),e._v(" "),n("el-row",{staticClass:"mt-0",attrs:{type:"flex",justify:"left",align:"middle"}},[n("span",{staticClass:"mr-1"},[e._v("Page Variables")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("var1")}}},[e._v("\n "+e._s(e.templateVariablesName.var1)+"\n ")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("var2")}}},[e._v("\n "+e._s(e.templateVariablesName.var2)+"\n ")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("var3")}}},[e._v("\n "+e._s(e.templateVariablesName.var3)+"\n ")])],1),e._v(" "),n("el-row",{staticClass:"mt-0",attrs:{type:"flex",justify:"left",align:"middle"}},[n("span",{staticClass:"mr-1"},[e._v("Magazine Variables")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("global1")}}},[e._v("\n "+e._s(e.templateVariablesName.global1)+"\n ")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("global2")}}},[e._v("\n "+e._s(e.templateVariablesName.global2)+"\n ")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"info"},on:{click:function(t){return e.generateVariable("global3")}}},[e._v("\n "+e._s(e.templateVariablesName.global3)+"\n ")])],1)],1):e._e(),e._v(" "),e.title?n("small",{staticClass:"mt-0 ml-2"},[e._v(e._s(e.title))]):e._e(),e._v(" "),n("div",{staticClass:"quill-editor-content"},[n("quill-editor",{ref:"editor",style:e.quillEditorStyleVariables,attrs:{disabled:e.backgroundProcess,content:e.textContent},on:{change:function(t){return e.onEditorChange(t)},ready:function(t){return e.onEditorReady(t)},focus:function(t){return e.onEditorFocus()},blur:function(t){return e.onEditorBlur()}},nativeOn:{click:function(t){return e.onEditorFocus()}}})],1),e._v(" "),n("el-alert",{directives:[{name:"show",rawName:"v-show",value:e.textOverflow,expression:"textOverflow"}],attrs:{closable:!1,type:"error"}},[n("div",{directives:[{name:"t",rawName:"v-t",value:"public.article_editor.overflow_alert_title",expression:"'public.article_editor.overflow_alert_title'"}],attrs:{slot:"title"},slot:"title"}),e._v(" "),n("div",{directives:[{name:"t",rawName:"v-t",value:"public.article_editor.overflow_alert",expression:"'public.article_editor.overflow_alert'"}]}
1)])],1):e._e()}),[],!1,null,"4d0b1051",null));t.a=w.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16);var r=n(27),o=n(4),l=n(2),c=n(14),d=(n(30),n(26),n(29));function h(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?h(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):h(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var m={name:"EditAuthResultMapModal",components:{MzAppIcon:d.a},computed:f({},Object(l.e)("authStrategy",["authResultMap"]),{},Object(l.c)("authStrategy",["listAuthResultMapKey"]),{dialogTitle:function(){return this.editDisabled?"Auth result map information":this.authResultMap._id?"Edit auth result map":"Create auth result map"},name:{get:function(){return this.authResultMap.name},set:function(e){this.updateAuthResultMapField({key:"name",value:e})}},validateButtonDisabled:function(){return!0===this.loading||null===this.name||this.name.trim().length<2}}),data:function(){return{loading:!1,displayModal:!1,editDisabled:!1,attributes:[]}},methods:f({},Object(l.b)({loadAuthResultMap:"authStrategy/LOAD_AUTHRESULTMAP",saveAuthResultMap:"authStrategy/SAVE_AUTHRESULTMAP"}),{},Object(l.d)({updateAuthResultMapField:"authStrategy/UPDATE_AUTHRESULTMAP_FIELD",resetAuthResultMap:"authStrategy/RESET_AUTHRESULTMAP"}),{hide:function(){this.displayModal=!1},show:function(e){var t=this;this.loading=!0,this.loadAuthResultMap(e).then((function(){t.attributes=JSON.parse(JSON.stringify(t.authResultMap.attributes)),t.loading=!1})),this.editDisabled=!0,this.displayModal=!0},showCreate:function(){this.resetAuthResultMap(),this.attributes=[],this.editDisabled=!1,this.displayModal=!0},showEdit:function(e){var t=this;this.loading=!0,this.loadAuthResultMap(e).then((function(){t.attributes=JSON.parse(JSON.stringify(t.authResultMap.attributes)),t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},showDuplicate:function(e){var t=this;this.loading=!0,this.resetAuthResultMap(),this.loadAuthResultMap(e).then((function(){t.updateAuthResultMapField({key:"_id",value:null}),t.updateAuthResultMapField({key:"name",value:t.authResultMap.name+" duplicated"}),t.attributes=JSON.parse(JSON.stringify(t.authResultMap.attributes)),t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this;if(this.editDisabled)this.hide();else{var t=!1;this.attributes.reduce((function(n,r){return r.key&&r.key.length>0&&(n[r.key]&&(t=!0,e.$messageError("Attribute with key '"+r.key+"' is already declared.")),n[r.key]=r),n}),{});t||(this.loading=!0,this.updateAuthResultMapField({key:"attributes",value:this.attributes.filter((function(e){return e.key&&e.key.length>0}))}),this.saveAuthResultMap().then((function(t){e.loading=!1,t&&(e.$emit("save",e.authResultMap),e.hide())})))}},addAttribute:function(){this.attributes.push({key:"",maps:[]})},removeAttribute:function(e){this.attributes.splice(e,1)},onChangeAttributeKey:function(e,t){var n=this.listAuthResultMapKey.find((function(e){return e.key===t})),r=null;n&&n.values&&(r=n.values.map((function(e){return{key:e,maps:[]}}))),this.$set(this.attributes[e],"values",r)}})},y=(n(605),n(6)),v=Object(y.a)(m,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.dialogTitle,visible:e.displayModal,"close-on-click-modal":!1,width:"75%","append-to-body":""},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:24}},[n("el-form",{attrs:{"label-width":"250px",disabled:e.editDisabled}},[n("el-row",{staticClass:"mt-2",attrs:{type:"flex",justify:"start",align:"top"}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Name"}},[n("el-input",{attrs:{placeholder:"please input text"},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})],1)],1)],1),e._v(" "),n("el-divider",[e._v(" Attributes ")]),e._v(" "),n("el-row",[n("el-button",{staticStyle:{float:"right"},attrs:{size:"small"},on:{click:e.addAttribute}},[n("MzAppIcon",{staticClass:"mr-1",attrs:{name:"add",inline:""}}),e._v("Add\n ")],1)],1),e._v(" "),e._l(e.attributes,(function(t,r){return n("div",{key:r},[n("el-row",{staticClass:"mt-1"},[n("el-col",{attrs:{span:4}},[n("el-select",{staticClass:"el-col el-col-22",attrs:{placeholder:"Select a key"},on:{change:function(t){return e.onChangeAttributeKey(r,t)}},model:{value:t.key,callback:function(n){e.$set(t,"key",n)},expression:"attribute.key"}},e._l(e.listAuthResultMapKey,(function(e){return n("el-option",{key:e.key,attrs:{label:e.key,value:e.key}})})),1)],1),e._v(" "),n("el-col",{attrs:{span:16}},[n("el-select",{staticClass:"el-col el-col-22",attrs:{clearable:!0,multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"Add a map"},model:{value:t.maps,callback:function(n){e.$set(t,"maps",n)},expression:"attribute.maps"}},e._l(t.maps,(function(e,t){return n("el-option",{key:t+e,attrs:{value:e}})})),1)],1),e._v(" "),n("el-col",{attrs:{span:4}},[n("el-button",{attrs:{size:"small",type:"danger",plain:""},on:{click:function(t){return e.removeAttribute(r)}}},[n("MzAppIcon",{staticClass:"mr-1",attrs:{name:"remove",inline:""}}),e._v("Remove\n ")],1)],1)],1),e._v(" "),t.values?n("div",e._l(t.values,(function(t,r){return n("el-row",{key:r,staticClass:"mt-1"},[n("el-col",{attrs:{span:2,offset:4}},[n("small",{staticClass:"ml-2"},[e._v(e._s(t.key))])]),e._v(" "),n("el-col",{attrs:{span:13}},[n("el-select",{staticClass:"el-col el-col-22",attrs:{size:"small",clearable:!0,multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"Add a map"},model:{value:t.maps,callback:function(n){e.$set(t,"maps",n)},expression:"value.maps"}},e._l(t.maps,(function(e,t){return n("el-option",{key:t+e,attrs:{value:e}})})),1)],1)],1)}
1)),1):e._e()],1)}))],2)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],on:{click:e.onClickCancel}}),e._v(" "),e.editDisabled?e._e():n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.confirm",expression:"'public.alert.confirm'"}],attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:e.onClickValidate}})],1)])}),[],!1,null,"09355be8",null).exports;function _(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function O(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?_(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):_(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var E={name:"EditAuthStrategyModal",components:{MzAppIcon:d.a,EditAuthResultMapModal:v},props:[],computed:O({},Object(l.e)("authStrategy",["authStrategy","authResultMaps"]),{},Object(l.c)("authStrategy",["listAuthStrategyType"]),{externalApiPOSTUrl:function(){return"https://api.madmagz.app/externalApi/activeSchools"},externalApiGETUrl:function(){return"https://api.madmagz.app/externalApi/catalogueEtab/{uai}?apiKey={apiKey}"},dialogTitle:function(){return this.editDisabled?"Auth strategy information":this.authStrategy._id?"Edit auth strategy":"Create auth strategy"},displayAttribute:function(){var e=[];switch(this.authStrategy.strategy){case"oauth2":e=["clientId","clientSecret","scope","urlAuth","urlToken","urlData"];break;case"cas-default":e=["urlAuth"];break;case"cas":case"cas-dynamic":e=["urlAuth","validateUrl","loginUrl","logoutUrl"];break;case"mz1":e=["urlAuth"]}return e},key:{get:function(){return this.authStrategy.key},set:function(e){this.updateField({key:"key",value:e})}},debugMode:{get:function(){return this.authStrategy.debugMode},set:function(e){this.updateField({key:"debugMode",value:e})}},strategy:{get:function(){return this.authStrategy.strategy},set:function(e){this.updateField({key:"strategy",value:e})}},authResultMap:{get:function(){return this.authStrategy.authResultMap},set:function(e){}},clientId:{get:function(){return this.authStrategy.clientId},set:function(e){this.updateField({key:"clientId",value:e})}},clientSecret:{get:function(){return this.authStrategy.clientSecret},set:function(e){this.updateField({key:"clientSecret",value:e})}},scopeList:{get:function(){return this.authStrategy&&this.authStrategy.scope?Object(r.a)(this.authStrategy.scope):[]},set:function(e){console.log("set scope with ",e),this.updateField({key:"scope",value:e})}},urlAuth:{get:function(){return this.authStrategy.urlAuth},set:function(e){this.updateField({key:"urlAuth",value:e})}},urlToken:{get:function(){return this.authStrategy.urlToken},set:function(e){this.updateField({key:"urlToken",value:e})}},urlData:{get:function(){return this.authStrategy.urlData},set:function(e){this.updateField({key:"urlData",value:e})}},validateUrl:{get:function(){return this.authStrategy.validateUrl},set:function(e){this.updateField({key:"validateUrl",value:e})}},loginUrl:{get:function(){return this.authStrategy.loginUrl},set:function(e){this.updateField({key:"loginUrl",value:e})}},logoutUrl:{get:function(){return this.authStrategy.logoutUrl},set:function(e){this.updateField({key:"logoutUrl",value:e})}},apiAccessToken:{get:function(){return this.authStrategy.apiAccessToken},set:function(e){this.updateField({key:"apiAccessToken",value:e})}},apiAccessExpireAt:{get:function(){return this.authStrategy.apiAccessExpireAt},set:function(e){if(e){var t=new Date(e);t.setHours(23,59,59),this.updateField({key:"apiAccessExpireAt",value:t})}else this.updateField({key:"apiAccessExpireAt",value:null})}},validateButtonDisabled:function(){return!0===this.loading||null===this.key||this.key.trim().length<2}}),data:function(){return{loading:!1,displayModal:!1,editDisabled:!1}},mounted:function(){this.loadAuthResultMaps()},methods:O({},Object(l.b)({loadAuthStrategy:"authStrategy/LOAD_AUTHSTRATEGY",saveAuthStrategy:"authStrategy/SAVE_AUTHSTRATEGY",loadAuthResultMaps:"authStrategy/LOAD_AUTHRESULTMAPS"}),{},Object(l.d)({updateField:"authStrategy/UPDATE_FIELD",resetAuthStrategy:"authStrategy/RESET_AUTHSTRATEGY"}),{hide:function(){this.displayModal=!1},show:function(e){var t=this;this.loading=!0,this.loadAuthStrategy(e).then((function(){t.loading=!1})),this.editDisabled=!0,this.displayModal=!0},showCreate:function(){this.resetAuthStrategy(),this.editDisabled=!1,this.displayModal=!0},showEdit:function(e){var t=this;this.loading=!0,this.loadAuthStrategy(e).then((function(){t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},showDuplicate:function(e){var t=this;this.loading=!0,this.resetAuthStrategy(),this.loadAuthStrategy(e).then((function(){t.updateField({key:"_id",value:null}),t.updateField({key:"key",value:t.authStrategy.key+"_duplicated"}),t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this;this.editDisabled?this.hide():(this.loading=!0,this.saveAuthStrategy().then((function(t){e.loading=!1,t&&(e.$emit("save",e.authStrategy),e.hide())})))},onSelectAuthResultMap:function(e){-1===e?this.$refs.editAuthResultMapModal.showCreate():(console.log("set authResultMap",e),this.updateField({key:"authResultMap",value:e||null}))},onSaveAuthResultMap:function(e){console.log("onSaveAuthResultMap",e),this.updateField({key:"authResultMap",value:e._id})},generateRandomApiAccessToken:function(){this.updateField({key:"apiAccessToken",value:c.a.uniqName()})}})},k=(n(606),Object(y.a)(E,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.dialogTitle,visible:e.displayModal,"close-on-click-modal":!1,width:"75%","append-to-body":""},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:24}},[n("el-form",{attrs:{"label-width":"250px",disabled:e.editDisabled}},[n("el-row",{staticClass:"mt-2",attrs:{type:"flex",justify:"start",align:"top"}},[n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:"Key"}},[n("el-input",{attrs:{placeholder:"please input text"},model:{value:e.key,callback:function(t){e.key=t},expression:"key"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"Active debug"}},[n("el-switch",{model:{value:e.debugMode,callback:function(t){e.debugMode=t},expression:"debugMode"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:14}},[n("el-form-item",{attrs:{label:"Strategy"}},[n("el-select",{model:{value:e.strategy,callback:function(t){e.strategy=t},expression:"strategy"}},e._l(e.listAuthStrategyType,(function(t){return n("el-option",{key:t,attrs:{value:t}},[e._v("\n "+e._s(t)+"\n ")])})),1),e._v(" "),n("el-tooltip",{attrs:{placement:"right"}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("p",[n("b",[e._v(" For cas-dynamic strategy :")]),n("br"),e._v("\n Add %SSO_IDENTIFIER% variable in your authorization URL\n ")]),e._v(" "),n("p",[n("b",[e._v(" cas-default strategy :")]),n("br"),e._v("\n Use real CAS library from Github
1(keep for test)\n ")])]),e._v(" "),n("MzAppIcon",{staticClass:"ml-1",attrs:{name:"info",inline:""}})],1)],1),e._v(" "),n("el-form-item",{attrs:{label:"Result map"}},[n("el-select",{attrs:{clearable:!0},on:{change:e.onSelectAuthResultMap},model:{value:e.authResultMap,callback:function(t){e.authResultMap=t},expression:"authResultMap"}},[n("el-option",{attrs:{value:-1,label:"Create new map"}},[n("span",[n("MzAppIcon",{staticClass:"mr-1",attrs:{name:"add_circle",inline:"",size:"16"}}),e._v("\n Create new map\n ")],1)]),e._v(" "),e._l(e.authResultMaps,(function(t){return n("el-option",{key:t._id,attrs:{value:t._id,label:t.name}},[e._v("\n "+e._s(t.name)+"\n ")])}))],2),e._v(" "),e.authResultMap?n("span",{staticClass:"ml-2"},[n("el-button",{attrs:{size:"small"},on:{click:function(t){return e.$refs.editAuthResultMapModal.showEdit(e.authResultMap)}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"edit",inline:"",size:"16"}}),e._v("\n Edit\n ")],1),e._v(" "),n("el-button",{attrs:{size:"small"},on:{click:function(t){return e.$refs.editAuthResultMapModal.showDuplicate(e.authResultMap)}}},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"content_copy",inline:"",size:"16"}}),e._v("\n Duplicate\n ")],1)],1):e._e()],1)],1)],1),e._v(" "),n("el-divider",[e._v("Auth configuration")]),e._v(" "),n("el-row",{staticClass:"mt-2"},[e.displayAttribute.indexOf("clientId")>=0?n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Client ID"}},[n("el-input",{model:{value:e.clientId,callback:function(t){e.clientId=t},expression:"clientId"}})],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("clientSecret")>=0?n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Client Secret"}},[n("el-input",{model:{value:e.clientSecret,callback:function(t){e.clientSecret=t},expression:"clientSecret"}})],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("scope")>=0?n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Scope"}},[n("el-select",{staticClass:"el-col el-col-24",attrs:{clearable:!0,multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"Add scope"},model:{value:e.scopeList,callback:function(t){e.scopeList=t},expression:"scopeList"}},e._l(e.scopeList,(function(e,t){return n("el-option",{key:t+e,attrs:{value:e}})})),1)],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("urlAuth")>=0?n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Authorization URL"}},[n("el-input",{model:{value:e.urlAuth,callback:function(t){e.urlAuth=t},expression:"urlAuth"}})],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("urlToken")>=0?n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Token URL"}},[n("el-input",{model:{value:e.urlToken,callback:function(t){e.urlToken=t},expression:"urlToken"}})],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("urlData")>=0?n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"User data URL"}},[n("el-input",{model:{value:e.urlData,callback:function(t){e.urlData=t},expression:"urlData"}})],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("validateUrl")>=0?n("div",[n("el-col",{attrs:{span:17}},[n("el-form-item",{attrs:{label:"Validate URL"}},[n("el-input",{attrs:{clearable:"",placeholder:"/serviceValidate"},model:{value:e.validateUrl,callback:function(t){e.validateUrl=t},expression:"validateUrl"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:1}},[n("el-tooltip",{attrs:{placement:"right"}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("p",[e._v("\n If not set, default is '/serviceValidate' url\n ")])]),e._v(" "),n("MzAppIcon",{staticClass:"ml-1 mt-1",attrs:{name:"info",inline:"",size:"16"}})],1)],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("loginUrl")>=0?n("div",[n("el-col",{attrs:{span:17}},[n("el-form-item",{attrs:{label:"Login URL"}},[n("el-input",{attrs:{clearable:"",placeholder:"/login"},model:{value:e.loginUrl,callback:function(t){e.loginUrl=t},expression:"loginUrl"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:1}},[n("el-tooltip",{attrs:{placement:"right"}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("p",[e._v("\n If not set, default is '/login' url\n ")])]),e._v(" "),n("MzAppIcon",{staticClass:"ml-1 mt-1",attrs:{name:"info",inline:"",size:"16"}}
1)],1)],1)],1):e._e(),e._v(" "),e.displayAttribute.indexOf("logoutUrl")>=0?n("div",[n("el-col",{attrs:{span:17}},[n("el-form-item",{attrs:{label:"Logout URL"}},[n("el-input",{attrs:{clearable:"",placeholder:"/logout"},model:{value:e.logoutUrl,callback:function(t){e.logoutUrl=t},expression:"logoutUrl"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:1}},[n("el-tooltip",{attrs:{placement:"right"}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("p",[e._v("\n If not set, default is '/logout' url\n ")])]),e._v(" "),n("MzAppIcon",{staticClass:"ml-1 mt-1",attrs:{name:"info",inline:"",size:"16"}})],1)],1)],1):e._e()],1),e._v(" "),n("el-divider",[e._v("\n Api endpoint access\n "),n("el-tooltip",{attrs:{placement:"right"}},[n("div",{attrs:{slot:"content"},slot:"content"},[n("p",[n("b",[e._v("Access with POST request")]),e._v(" "),n("ul",[n("li",[e._v(e._s(e.externalApiPOSTUrl))]),e._v(" "),n("li",[e._v("set your SECRET TOKEN in 'mz-external-token' header variable")]),e._v(" "),n("li",[e._v("response will send in JSON format")])])]),e._v(" "),n("p",[n("b",[e._v("Access with GET request (Pronote specific)")]),e._v(" "),n("ul",[n("li",[e._v(e._s(e.externalApiGETUrl))]),e._v(" "),n("li",[e._v("replace UAI and API_KEY in url with your specific variable")]),e._v(" "),n("li",[e._v("response will send in XML format")])])]),e._v(" "),n("p",[n("b",[e._v("JSON Response example")]),e._v(" "),n("pre",[n("small",[e._v("{\n status: 'ok',\n err: '',\n ressources: [\n '000000000X' => [\n 'offerStartDate' => '{Datetime début offre}',\n 'offerEndDate' => '{Datetime expiration offre}'\n ],\n '000000000Yâ => [\n 'offerStartDate' => '{Datetime début offre}',\n 'offerEndDate' => '{Datetime expiration offre}'\n ],\n ]\n}")])])])]),e._v(" "),n("MzAppIcon",{staticClass:"ml-1",attrs:{name:"info",inline:"",size:"16"}})],1)],1),e._v(" "),n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Secret token"}},[n("el-input",{attrs:{clearable:!0},model:{value:e.apiAccessToken,callback:function(t){e.apiAccessToken=t},expression:"apiAccessToken"}},[n("el-button",{attrs:{slot:"append"},on:{click:e.generateRandomApiAccessToken},slot:"append"},[n("MzAppIcon",{staticClass:"mr-0",attrs:{name:"refresh",inline:"",size:"16"}}),e._v("\n Generate\n ")],1)],1)],1)],1),e._v(" "),n("el-col",{attrs:{span:18}},[n("el-form-item",{attrs:{label:"Expire at"}},[n("el-date-picker",{attrs:{type:"date"},model:{value:e.apiAccessExpireAt,callback:function(t){e.apiAccessExpireAt=t},expression:"apiAccessExpireAt"}})],1)],1)],1)],1)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],on:{click:e.onClickCancel}}),e._v(" "),e.editDisabled?e._e():n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.confirm",expression:"'public.alert.confirm'"}],attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:e.onClickValidate}})],1),e._v(" "),n("EditAuthResultMapModal",{ref:"editAuthResultMapModal",on:{save:e.onSaveAuthResultMap}})],1)}),[],!1,null,"0816c168",null));t.a=k.exports},function(e,t,n){"use strict";n(19),n(7),n(16);var r=n(27),o=(n(35),n(13),n(11),n(4)),l=n(2);function c(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function d(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var h={name:"EditScheduledNotificationModal",components:{},props:[],computed:d({},Object(l.e)("notification",["scheduledNotification"]),{},Object(l.e)("app",["existingLanguages"]),{},Object(l.c)("offer",["listOfferMarketType"]),{},Object(l.c)("collaboration",["listCollaborationRoles"]),{dialogTitle:function(){return this.editDisabled?"Scheduled notification information":this.scheduledNotification._id?"Edit scheduled notification":"Create scheduled notification"},scheduledAt:{get:function(){return this.scheduledNotification.scheduledAt},set:function(e){this.updateScheduledNotificationField({key:"scheduledAt",value:e})}},sendToType:{get:function(){return this.scheduledNotification.sendToType},set:function(e){this.updateScheduledNotificationField({key:"sendToType",value:e}),"all"===e&&this.updateScheduledNotificationField({key:"sendToData",value:""})}},sendToData:{get:function(){return this.scheduledNotification.sendToData},set:function(e){this.updateScheduledNotificationField({key:"sendToData",value:e})}},title:{get:function(){return this.scheduledNotification.title},set:function(e){}},description:{get:function(){return this.scheduledNotification.description},set:function(e){}},visualUrl:{get:function(){return this.scheduledNotification.visualUrl},set:function(e){this.updateScheduledNotificationField({key:"visualUrl",value:e})}},primaryAction:{get:function(){return this.scheduledNotification.primaryAction?this.scheduledNotification.primaryAction:{label:"",url:""}},set:function(e){}},secondaryAction:{get:function(){return this.scheduledNotification.secondaryAction?this.scheduledNotification.secondaryAction:{label:"",url:""}},set:function(e){}}
1,validateButtonDisabled:function(){return!0===this.loading||this.editDisabled}}),data:function(){return{loading:!1,displayModal:!1,editDisabled:!1}},methods:d({},Object(l.b)({loadScheduledNotification:"notification/LOAD_SCHEDULED_NOTIFICATION",saveScheduledNotification:"notification/SAVE_SCHEDULED_NOTIFICATION"}),{},Object(l.d)({updateScheduledNotificationField:"notification/UPDATE_SCHEDULED_NOTIFICATION_FIELD",resetScheduledNotification:"notification/RESET_SCHEDULED_NOTIFICATION"}),{hide:function(){this.displayModal=!1},show:function(e){var t=this;this.loading=!0,this.loadScheduledNotification(e).then((function(){t.loading=!1})),this.editDisabled=!0,this.displayModal=!0},showCreate:function(){this.resetScheduledNotification(),this.editDisabled=!1,this.displayModal=!0,console.log("showCreate",JSON.parse(JSON.stringify(this.scheduledNotification)))},showEdit:function(e){var t=this;this.loading=!0,this.loadScheduledNotification(e).then((function(){t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},showDuplicate:function(e){var t=this;this.loading=!0,this.resetScheduledNotification(),this.loadScheduledNotification(e).then((function(){t.updateScheduledNotificationField({key:"_id",value:null}),t.updateScheduledNotificationField({key:"scheduledAt",value:""}),t.updateScheduledNotificationField({key:"sended",value:!1}),t.updateScheduledNotificationField({key:"sendInProgress",value:!1}),t.loading=!1})),this.editDisabled=!1,this.displayModal=!0},onClickCancel:function(){this.hide()},onClickValidate:function(){var e=this;if(this.editDisabled)this.hide();else if(0!==this.scheduledNotification.availableLanguages.length){var t=!0,n=!1,r=void 0;try{for(var o,l=this.scheduledNotification.availableLanguages[Symbol.iterator]();!(t=(o=l.next()).done);t=!0){var c=o.value;if(!this.scheduledNotification.title[c]||""===this.scheduledNotification.title[c]||!this.scheduledNotification.description[c]||""===this.scheduledNotification.description[c])return void this.$messageError("You must set a title and a description for the language "+c.toUpperCase())}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}this.loading=!0,this.saveScheduledNotification().then((function(t){e.loading=!1,t&&(e.$emit("save",e.scheduledNotification),e.hide())}))}else this.$messageError("you must select one or more available languages")},onSwitchLang:function(e,t){var n=Object(r.a)(this.scheduledNotification.availableLanguages);t?n.indexOf(e)<0&&n.push(e):n.indexOf(e)>=0&&(n.splice(n.indexOf(e),1),this.updateDescription(e,""),this.updateTitle(e,""),this.updatePrimaryAction("label",e,""),this.updatePrimaryAction("url",e,""),this.updateSecondaryAction("label",e,""),this.updateSecondaryAction("url",e,"")),this.updateScheduledNotificationField({key:"availableLanguages",value:n})},updateTitle:function(e,t){var n=d({},this.title);n[e]=t,this.updateScheduledNotificationField({key:"title",value:n})},updateDescription:function(e,t){var n=d({},this.description);n[e]=t,this.updateScheduledNotificationField({key:"description",value:n})},updatePrimaryAction:function(e,t,n){var r=JSON.parse(JSON.stringify(this.primaryAction));""===r[e]&&(r[e]={}),r[e][t]=n||"",this.updateScheduledNotificationField({key:"primaryAction",value:r})},updateSecondaryAction:function(e,t,n){var r=JSON.parse(JSON.stringify(this.secondaryAction));""===r[e]&&(r[e]={}),r[e][t]=n||"",this.updateScheduledNotificationField({key:"secondaryAction",value:r})}})},f=(n(607),n(6)),component=Object(f.a)(h,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:e.dialogTitle,visible:e.displayModal,"close-on-click-modal":!1,width:"75%","append-to-body":""},on:{"update:visible":function(t){e.displayModal=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}]},[n("el-row",{attrs:{type:"flex",justify:"center"}},[n("el-col",{attrs:{span:24}},[n("el-form",{attrs:{"label-width":"250px",disabled:e.editDisabled}},[n("el-row",{staticClass:"mt-2"},[n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:"Schedule At"}},[n("el-date-picker",{attrs:{type:"datetime"},model:{value:e.scheduledAt,callback:function(t){e.scheduledAt=t},expression:"scheduledAt"}})],1)],1),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"Sent to"}},[n("el-select",{attrs:{placeholder:"Select a value"},model:{value:e.sendToType,callback:function(t){e.sendToType=t},expression:"sendToType"}},[n("el-option",{attrs:{label:"All users",value:"all"}}),e._v(" "),n("el-option",{attrs:{label:"By users ID",value:"byUserId"}}),e._v(" "),n("el-option",{attrs:{label:"By organizations ID",value:"byOrganizationId"}}),e._v(" "),n("el-option",{attrs:{label:"By workspaces ID",value:"byWorkspaceId"}}),e._v(" "),n("el-option",{attrs:{label:"By market type",value:"byMarket"}}),e._v(" "),n("el-option",{attrs:{label:"By collaboration role",value:"byCollaborationRole"}})],1)],1)],1)],1),e._v(" "),e.sendToType&&"all"!==e.sendToType?n("el-row",{attrs:{type:"flex",justify:"start",align:"top"}},[n("el-col",{attrs:{offset:8,span:12}},["byMarket"===e.sendToType?n("el-form-item",[n("el-select",{model:{value:e.sendToData,callback:function(t){e.sendToData=t},expression:"sendToData"}},e._l(e.listOfferMarketType,(function(e){return n("el-option",{key:e.value,attrs:{value:e.value,label:e.label}})})),1)],1):"byCollaborationRole"===e.sendToType?n("el-form-item",[n("el-select",{model:{value:e.sendToData,callback:function(t){e.sendToData=t},expression:"sendToData"}},e._l(e.listCollaborationRoles,(function(t){return n("el-option",{key:t.value,attrs:{value:t.value,label:e.$t("public.collaboration.roles."+t.value)}})})),1)],1):n("el-form-item",[n("el-input",{attrs:{type:"textarea",rows:4,placeholder:"Add ids list separate with coma"},model:{value:e.sendToData,callback:function(t){e.sendToData=t},expression:"sendToData"}}
1)],1)],1)],1):e._e(),e._v(" "),n("el-row",[n("el-col",{attrs:{span:16}},[n("el-form-item",{attrs:{label:"Visual url"}},[n("el-input",{attrs:{clearable:"",placeholder:"default to MZ logo"},model:{value:e.visualUrl,callback:function(t){e.visualUrl=t},expression:"visualUrl"}})],1)],1)],1),e._v(" "),n("el-divider",{attrs:{"content-position":"left"}},[e._v("Translated text")]),e._v(" "),n("el-row",e._l(e.existingLanguages,(function(t){return n("el-col",{key:"title_"+t,attrs:{span:12}},[n("el-row",{staticClass:"text-center mb-1"},[e._v("\n "+e._s(t.toUpperCase())+"\n "),n("el-switch",{staticClass:"ml-2",attrs:{value:e.scheduledNotification.availableLanguages.indexOf(t)>=0},on:{change:function(n){return e.onSwitchLang(t,n)}}})],1),e._v(" "),e.scheduledNotification.availableLanguages.indexOf(t)<0?n("div",{staticClass:"text-center"},[n("el-tag",{attrs:{type:"warning",size:"small"}},[e._v("This language is not available")])],1):n("div",[n("el-form-item",{attrs:{label:"Title","label-width":"150px"}},[n("el-input",{attrs:{value:e.title[t]},on:{input:function(n){return e.updateTitle(t,n)}}})],1),e._v(" "),n("el-form-item",{attrs:{label:"Description","label-width":"150px"}},[n("el-input",{attrs:{value:e.description[t]},on:{input:function(n){return e.updateDescription(t,n)}}})],1),e._v(" "),n("el-row",{staticClass:"text-center mb-1"},[n("small",[e._v(" Primary action (optionnel) ")])]),e._v(" "),n("el-form-item",{attrs:{label:"Label","label-width":"150px"}},[n("el-input",{attrs:{value:e.primaryAction.label[t],clearable:""},on:{input:function(n){return e.updatePrimaryAction("label",t,n)}}})],1),e._v(" "),n("el-form-item",{attrs:{label:"Url","label-width":"150px"}},[n("el-input",{attrs:{value:e.primaryAction.url[t],clearable:""},on:{input:function(n){return e.updatePrimaryAction("url",t,n)}}})],1),e._v(" "),n("el-row",{staticClass:"text-center mb-1"},[n("small",[e._v(" Secondary action (optionnel) ")])]),e._v(" "),n("el-form-item",{attrs:{label:"Label","label-width":"150px"}},[n("el-input",{attrs:{value:e.secondaryAction.label[t],clearable:""},on:{input:function(n){return e.updateSecondaryAction("label",t,n)}}})],1),e._v(" "),n("el-form-item",{attrs:{label:"Url","label-width":"150px"}},[n("el-input",{attrs:{value:e.secondaryAction.url[t],clearable:""},on:{input:function(n){return e.updateSecondaryAction("url",t,n)}}})],1)],1)],1)})),1)],1)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.cancel",expression:"'public.alert.cancel'"}],on:{click:e.onClickCancel}}),e._v(" "),e.editDisabled?e._e():n("el-button",{directives:[{name:"t",rawName:"v-t",value:"public.alert.confirm",expression:"'public.alert.confirm'"}],attrs:{type:"primary",disabled:e.validateButtonDisabled},on:{click:e.onClickValidate}})],1)])}),[],!1,null,"4e6383f1",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(30);var r=n(4),o=n(2),l=n(200),c=n.n(l),d=n(14);function h(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?h(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):h(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var m={name:"FormPrintQuote",props:["isAdminQuote"],components:{},data:function(){return{loadingQuote:!1,loadingOrder:!1,formQuote:{quantity:1,currency:"EUR",country:"FR",delivery:"normal"}}},computed:f({},Object(o.e)("magazine",["magazine"]),{},Object(o.e)("order",["printQuote"]),{},Object(o.c)("order",["getAvailableCountries","getAvailableQuantities"]),{hasPrintProduct:function(){var e=this.magazine.pageCount<=52?"stitched":"glued";return void 0!==this.magazine.format.formatBase.printProducts.find((function(t){return t.type===e||"all"===t.type}))},hasValidPageNumber:function(){return this.magazine.pageCount>=8&&this.magazine.pageCount%4==0},hasExpressDelivery:function(){return"FR"!==this.formQuote.country},totalPrice:function(){return this.printQuote&&this.printQuote.shipment&&this.printQuote.product?parseFloat(Math.round(100*(this.printQuote.product.productPrice+this.printQuote.shipment.price))/100).toFixed(2):"-"}}),mounted:function(){this.printQuote&&this.printQuote.magazineId!==this.magazine._id&&this.resetPrintQuote()},methods:f({},Object(o.b)({requestPrintProductQuote:"order/REQUEST_PRINT_PRODUCT_QUOTE"}),{},Object(o.d)({resetPrintQuote:"order/RESET_PRINT_QUOTE"}),{reset:function(){this.resetPrintQuote()},onChangeCountry:function(e){console.log("onChangeCountry",e),e&&(this.formQuote.currency=c.a[e].currencies[0].code),this.onChangeQuoteData()},onChangeQuoteData:function(){var e=this;null!==this.printQuote&&d.a.debounce((function(){e.onClickSendQuote()}),250,this,"debounceSendQuote")()},onClickSendQuote:function(){var e=this;if(!this.loadingOrder&&!this.loadingQuote){var t=f({},this.formQuote,{pageCount:this.magazine.pageCount});this.loadingQuote=!0,this.requestPrintProductQuote({magazineId:this.magazine._id,printQuoteData:t}).then((function(t){e.loadingQuote=!1}))}}})},y=(n(609),n(6)),component=Object(y.a)(m,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loadingQuote,expression:"loadingQuote"}]},[e.hasPrintProduct?n("div",[n("div",{staticClass:"mt-1"},[n("el-row",[n("h3",[e._v(e._s(e.$t("public.printOrder.titleInstantQuote")))])]),e._v(" "),e.hasValidPageNumber?n("div",[n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("el-col",{staticClass:"text-grey",attrs:{span:8}},[e._v("\n "+e._s(e.$t("public.printOrder.quantity"))+"\n ")]),e._v(" "),n("el-col",{attrs:{span:3}},[n("el-select",{attrs:{size:"mini"},on:{change:e.onChangeQuoteData},model:{value:e.formQuote.quantity,callback:function(t){e.$set(e.formQuote,"quantity",t)},expression:"formQuote.quantity"}},e._l(e.getAvailableQuantities,(function(e){return n("el-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-0",attrs:{type:"flex",align:"middle"}},[n("el-col",{staticClass:"text-grey",attrs:{span:8}},[e._v("\n "+e._s(e.$t("public.printOrder.country"))+"\n ")]),e._v(" "),n("el-col",{attrs:{span:8}},[n("el-select",{attrs:{size:"mini",filterable:""},on:{change:e.onChangeCountry},model:{value:e.formQuote.country,callback:function(t){e.$set(e.formQuote,"country",t)},expression:"formQuote.country"}},e._l(e.getAvailableCountries,(function(e){return n("el-option",{key:e.code,attrs:{value:e.code,label:e.name}})})),1)],1)],1),e._v(" "),n("el-row",{staticClass:"mt-0",attrs:{type:"flex",align:"middle"}},[n("el-col",{staticClass:"text-grey",attrs:{span:8}},[e._v("\n "+e._s(e.$t("public.printOrder.delivery"))+"\n ")]),e._v(" "),n("el-col",{attrs:{span:12}},[n("el-radio-group",{attrs:{size:"mini"},on:{change:e.onChangeQuoteData},model:{value:e.formQuote.delivery,callback:function(t){e.$set(e.formQuote,"delivery",t)},expression:"formQuote.delivery"}},[n("el-radio-button",{attrs:{label:"normal"}},[e._v("Normal")]),e._v(" "),n("el-radio-button",{attrs:{label:"express",disabled:!e.hasExpressDelivery}},[e._v("Express")])],1)],1)],1),e._v(" "),null===e.printQuote?n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("el-col",{attrs:{offset:8,span:16}},[n("el-button",{attrs:{size:"small",type:"primary",disabled:!e.hasValidPageNumber},on:{click:e.onClickSendQuote}},[e._v("\n "+e._s(e.$t("public.printOrder.btnSendQuote"))+"\n ")])],1)],1):e._e(
1)],1):n("el-alert",{staticClass:"mt-1",attrs:{type:"error",title:e.$t("public.printOrder.errorNumberPageMessage"),closable:!1}})],1),e._v(" "),e.printQuote?n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loadingOrder,expression:"loadingOrder"}]},[n("el-row",{staticClass:"mt-1"},[n("h3",[e._v("\n "+e._s(e.$t("public.printOrder.titleOrderPrint"))+"\n "),e.isAdminQuote?n("small",[n("i",[e._v("(ESTIMATION DU TARIF CLIENT)")])]):e._e()])]),e._v(" "),e.printQuote.shipment?e.printQuote.product.productPrice?n("div",[n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("el-col",{staticClass:"text-grey",attrs:{span:8}},[e._v("\n "+e._s(e.$t("public.printOrder.productPrice"))+"\n ")]),e._v(" "),n("el-col",{staticClass:"text-right",attrs:{offset:8,span:8}},[e._v("\n "+e._s(parseFloat(e.printQuote.product.productPrice).toFixed(2))+"\n "),n("small",{staticClass:"ml-1"},[e._v(e._s(e.printQuote.currency))])])],1),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("el-col",{staticClass:"text-grey",attrs:{span:8}},[e._v("\n "+e._s(e.$t("public.printOrder.shippingPrice",{min:e.printQuote.shipment.minDeliveryDays,max:e.printQuote.shipment.maxDeliveryDays}))+"\n ")]),e._v(" "),n("el-col",{staticClass:"text-right",attrs:{offset:8,span:8}},[e._v("\n "+e._s(parseFloat(e.printQuote.shipment.price).toFixed(2))+"\n "),n("small",{staticClass:"ml-1"},[e._v(e._s(e.printQuote.currency))])])],1),e._v(" "),n("el-divider"),e._v(" "),n("el-row",{staticClass:"mt-1",attrs:{type:"flex",align:"middle"}},[n("el-col",{staticClass:"text-grey",attrs:{span:8}},[e._v("\n "+e._s(e.$t("public.printOrder.totalPrice"))+"\n ")]),e._v(" "),n("el-col",{staticClass:"text-right",attrs:{offset:8,span:8}},[e._v("\n "+e._s(e.totalPrice)+"\n "),n("small",{staticClass:"ml-1"},[e._v(e._s(e.printQuote.currency))])])],1),e._v(" "),e.isAdminQuote?e._e():n("div",[n("el-divider"),e._v(" "),n("el-row",{staticClass:"mt-1 text-grey"},[e._v("\n The printing of your magazine will cost you\n "),n("b",{staticClass:"text-blue"},[e._v(e._s(e.totalPrice)+" "+e._s(e.printQuote.currency))]),e._v(", taxes excluded. Taxes, if any, will be added later in the\n buying process.\n ")])],1)],1):n("el-row",{staticClass:"mt-1"},[n("el-alert",{staticClass:"alert-quote-error",attrs:{description:e.$t("public.printOrder.productPriceEmpty"),type:"warning",closable:!1}})],1):n("el-row",{staticClass:"mt-1"},[n("el-alert",{staticClass:"alert-quote-error",attrs:{description:e.$t("public.printOrder.shippingListEmpty"),type:"warning",closable:!1}})],1)],1):e._e()]):n("div",[n("el-row",{staticClass:"text-grey"},[e._v("\n Sorry, no print product is configured for this magazine.\n ")])],1)])}),[],!1,null,"78f7436c",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(28);var r=n(3),o=(n(26),n(4)),l=(n(2),n(66));function c(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function d(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var h={name:"StripeAddressForm",components:{},props:{defaultAddress:Object,defaultCountry:String,defaultEmail:String,collectShipping:{type:Boolean,default:!0},collectBilling:{type:Boolean,default:!1}},data:function(){return{stripeError:!1,shippingStripeElements:null,shippingAdressComplete:!1,shippingAdressData:null,shippingAddressFormErrors:[],shippingCustomerEmail:"",billingSameAsShipping:!0,billingStripeElements:null,billingAdressComplete:!1,billingAddressData:null,billingAddressFormErrors:[],billingCustomerEmail:""}},computed:{isComplete:function(){return!!(!this.collectBilling||this.billingSameAsShipping&&this.collectShipping||this.billingAdressComplete&&!(this.billingAddressFormErrors.length>0))&&!(this.collectShipping&&(!this.shippingAdressComplete||this.shippingAddressFormErrors.length>0))},shippingAddress:function(){if(!this.collectShipping)return null;var address=d({email:this.shippingCustomerEmail},this.shippingAdressData);return delete address.name,address},billingAddress:function(){if(!this.collectBilling)return null;if(this.billingSameAsShipping&&this.collectShipping)return this.shippingAddress;var address=d({email:this.billingCustomerEmail},this.billingAddressData);return delete address.name,address}},mounted:function(){var e=this;this.initShippingElement(),this.$nextTick((function(){e.initBillingElement()}))},methods:{initShippingElement:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var n,r,o,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.$stripe){t.next=4;break}
1return e.stripeError=!0,console.error("stripe js library is not loaded"),t.abrupt("return");case 4:e.shippingStripeElements||(n={appearance:{theme:"stripe"},locale:e.$i18n.locale},e.shippingStripeElements=e.$stripe.elements(n)),(r=e.shippingStripeElements.getElement("address"))||(o=e.defaultAddress?e.defaultAddress:e.defaultCountry?{address:{country:e.defaultCountry}}:void 0,console.log("defaultValues",o),r=e.shippingStripeElements.create("address",{mode:"shipping",fields:{phone:"always"},display:{name:"split"},defaultValues:o}),(c=e.defaultAddress&&e.defaultAddress.email?e.defaultAddress.email:e.defaultEmail)&&l.a.isEmail(c)&&(e.shippingCustomerEmail=c)),r.mount("#shipping-address-element"),r.on("change",e.onChangeShippingAddress);case 9:case"end":return t.stop()}}),t)})))()},onChangeShippingAddress:function(e){this.shippingAdressData=e.value,e.complete?this.shippingAdressComplete=!0:this.shippingAdressComplete=!1,this.shippingAddressFormErrors.length>0&&this.checkValidShippingAddress()},initBillingElement:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var n,r,o,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.$stripe){t.next=3;break}return e.stripeError=!0,t.abrupt("return");case 3:e.billingStripeElements||(n={appearance:{theme:"stripe"},locale:e.$i18n.locale},e.billingStripeElements=e.$stripe.elements(n)),(r=e.billingStripeElements.getElement("address"))||(o=e.defaultAddress?e.defaultAddress:e.defaultCountry?{address:{country:e.defaultCountry}}:void 0,r=e.billingStripeElements.create("address",{mode:"billing",fields:{ph
1one:"always"},display:{name:"split"},defaultValues:o}),(c=e.defaultAddress&&e.defaultAddress.email?e.defaultAddress.email:e.defaultEmail)&&l.a.isEmail(c)&&(e.billingCustomerEmail=c)),r.mount("#billing-address-element"),r.on("change",e.onChangeBillingAddress);case 8:case"end":return t.stop()}}),t)})))()},onChangeBillingAddress:function(e){this.billingAddressData=e.value,e.complete?this.billingAdressComplete=!0:this.billingAdressComplete=!1,this.billingAddressFormErrors.length>0&&this.checkValidBillingAddress()},getStripeAddressError:function(e){var t=[];return console.log("check valid address"),e.email&&l.a.isEmail(e.email)||t.push(this.$t("public.order.address.error.email")),e.address.country&&!1!==/^[A-Z]{2}$/.test(e.address.country)||t.push(this.$t("public.order.address.error.country")),(!e.firstName||e.firstName.length>25)&&t.push(this.$t("public.order.address.error.firstName")),(!e.lastName||e.lastName.length>25)&&t.push(this.$t("public.order.address.error.lastName")),(!e.address.line1||e.address.line1.length>35)&&t.push(this.$t("public.order.address.error.addressLine1")),e.address.line2&&e.address.line2.length>35&&t.push(this.$t("public.order.address.error.addressLine2")),e.address.state&&e.address.state.length>35&&t.push(this.$t("public.order.address.error.state")),(!e.address.city||e.address.city.length>30)&&t.push(this.$t("public.order.address.error.city")),(!e.address.postal_code||e.address.postal_code.length>15)&&t.push(this.$t("public.order.address.error.postalCode")),e.phone&&e.phone.length>25&&t.push(this.$t("public.order.address.error.phone")),t},checkValidShippingAddress:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(e||this.shippingAdressComplete)return this.shippingAddressFormErrors=this.getStripeAddressError(this.shippingAddress),0===this.shippingAddressFormErrors.length},checkValidBillingAddress:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(e||this.billingAdressComplete)return this.billingAddressFormErrors=this.getStripeAddressError(this.billingAddress),0===this.billingAddressFormErrors.length}},watch:{isComplete:function(){this.$emit("changeIsComplete",this.isComplete)},defaultEmail:function(){this.defaultEmail&&l.a.isEmail(this.defaultEmail)&&(this.shippingCustomerEmail=this.defaultEmail,this.billingCustomerEmail=this.defaultEmail)}}},f=(n(610),n(6)),component=Object(f.a)(h,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.stripeError?n("div",[n("el-alert",{attrs:{description:e.$t("public.layout.stripe.errorCode"),type:"error",effect:"dark",closable:!1,center:""}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("span",{domProps:{innerHTML:e._s(e.$t("public.layout.stripe.errorMessage"))}})])])],1):e._e(),e._v(" "),n("form",{directives:[{name:"show",rawName:"v-show",value:e.collectShipping,expression:"collectShipping"}],staticClass:"mt-2",attrs:{id:"shipping-address-form"}},[n("div",{staticClass:"mb-1 stripe-form-element"},[n("label",{attrs:{for:"emailInput"}},[e._v("Email")]),e._v(" "),n("div",[n("el-input",{attrs:{type:"email",id:"emailInput",name:"email",autocomplete:"",placeholder:""},on:{input:function(t){return e.checkValidShippingAddress(!1)}},model:{value:e.shippingCustomerEmail,callback:function(t){e.shippingCustomerEmail=t},expression:"shippingCustomerEmail"}})],1)]),e._v(" "),n("div",{attrs:{id:"shipping-address-element"}})]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.collectBilling,expression:"collectBilling"}]},[e.collectShipping?n("el-checkbox",{staticClass:"mt-2",model:{value:e.billingSameAsShipping,callback:function(t){e.billingSameAsShipping=t},expression:"billingSameAsShipping"}},[e._v("\n "+e._s(e.$t("public.order.address.billingSameAsShipping"))+"\n ")]):e._e(),e._v(" "),n("form",{directives:[{name:"show",rawName:"v-show",value:!e.billingSameAsShipping||!e.collectShipping,expression:"!billingSameAsShipping || !collectShipping"}],staticClass:"mt-2",attrs:{id:"billing-address-form"}},[n("div",{staticClass:"mb-1 stripe-form-element"},[n("label",{attrs:{for:"billingEmailInput"}},[e._v("Billing Email")]),e._v(" "),n("div",[n("el-input",{attrs:{type:"email",id:"billingEmailInput",n
1ame:"billingEmail",autocomplete:"",placeholder:""},on:{input:function(t){return e.checkValidBillingAddress(!1)}},model:{value:e.billingCustomerEmail,callback:function(t){e.billingCustomerEmail=t},expression:"billingCustomerEmail"}})],1)]),e._v(" "),n("div",{attrs:{id:"billing-address-element"}})])],1),e._v(" "),e.collectShipping&&e.shippingAddressFormErrors&&e.shippingAddressFormErrors.length>0?n("div",{staticClass:"mt-2"},[n("el-alert",{attrs:{type:"warning",closable:!1}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("div",[e._v(e._s(e.$t("public.order.address.error")))]),e._v(" "),n("ul",e._l(e.shippingAddressFormErrors,(function(t,r){return n("li",{key:r},[n("span",{domProps:{innerHTML:e._s(t)}})])})),0)])])],1):e._e(),e._v(" "),e.collectBilling&&e.billingAddressFormErrors&&e.billingAddressFormErrors.length>0&&!e.billingSameAsShipping?n("div",{staticClass:"mt-2"},[n("el-alert",{attrs:{type:"warning",closable:!1}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("div",[e._v(e._s(e.$t("public.order.address.error")))]),e._v(" "),n("ul",e._l(e.billingAddressFormErrors,(function(t,r){return n("li",{key:r},[n("span",{domProps:{innerHTML:e._s(t)}})])})),0)])])],1):e._e()])}),[],!1,null,"7d5b0098",null);t.a=component.exports},function(e,t,n){"use strict";n(28);var r=n(3),o=(n(2),{name:"StripeCheckout",components:{},props:["stripeClientSecret"],data:function(){return{isComplete:!1,checkout:null,stripeError:!1}},mounted:function(){this.initElement()},beforeDestroy:function(){this.checkout&&this.checkout.destroy()},methods:{initElement:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.$stripe){t.next=4;break}return e.stripeError=!0,console.error("stripe js library is not loaded"),t.abrupt("return");case 4:if(e.stripeClientSecret){t.next=8;break}return e.stripeError=!0,console.error("stripe client secret is not defined"),t.abrupt("return");case 8:return e.checkout&&e.checkout.destroy(),t.next=11,e.$stripe.initEmbeddedCheckout({clientSecret:e.stripeClientSecret});case 11:e.checkout=t.sent,e.checkout.mount("#checkout");case 13:case"end":return t.stop()}}),t)})))()}
1,stripCheckoutComplete:function(){this.isComplete=!0,this.$emit("checkoutIsComplete",this.isComplete)}}}),l=n(6),component=Object(l.a)(o,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",[this.stripeError?t("div",[t("el-alert",{attrs:{description:this.$t("public.layout.stripe.errorCode"),type:"error",effect:"dark",closable:!1,center:""}},[t("div",{attrs:{slot:"title"},slot:"title"},[t("span",{domProps:{innerHTML:this._s(this.$t("public.layout.stripe.errorMessage"))}})])])],1):this._e(),this._v(" "),t("div",{attrs:{id:"checkout"}})])}),[],!1,null,"06e7a00c",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(28);var r=n(3),o=(n(36),n(4)),l=n(2);function c(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}function d(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}var h={name:"MzSwitchLang",props:["disabled","to","type"],data:function(){return{fullscreenLoading:!1}},computed:d({},Object(l.c)("api",["isLogged"]),{currentLocale:function(){return this.$i18n.locale.toUpperCase()},getFlagClass:function(){var e=this;return function(t){return{isCurrent:e.$i18n.locale===t}}}}),mounted:function(){if(this.$route.query.lang&&["en","fr"].indexOf(this.$route.query.lang)>=0){var e=this.$route.query.lang;this.$route.query.lang=void 0,this.switchLocale(e);var t=document.location.href.split("?")[0];window.history.pushState("",document.title,t)}},methods:d({},Object(l.b)({doChangeUserData:"api/API_CHANGE_USERDATA"}),{switchLocale:function(e){var t=this;return Object(r.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.fullscreenLoading=!0,n.next=3,t.$i18n.setLocale(e);case 3:t.isLogged?(t.fullscreenLoading=!0,t.doChangeUserData({lang:e}).then((function(){window.location.reload(),t.fullscreenLoading=!1}))):t.fullscreenLoading=!1;case 4:case"end":return n.stop()}}),n)})))()}})},f=(n(647),n(6)),component=Object(f.a)(h,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dropdown",{directives:[{name:"loading",rawName:"v-loading.fullscreen.lock",value:e.fullscreenLoading,expression:"fullscreenLoading",modifiers:{fullscreen:!0,lock:!0}}],attrs:{size:"mini","split-button":"",type:"primary"},on:{command:e.switchLocale}},[n("span",[e._v(e._s(e.currentLocale))]),e._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{staticClass:"flags",attrs:{command:"fr"}},[n("span",{class:e.getFlagClass("fr")},[e._v(" FR ")])]),e._v(" "),n("el-dropdown-item",{staticClass:"flags",attrs:{command:"en"}},[n("span",{class:e.getFlagClass("en")},[e._v(" EN ")])])],1)],1)}),[],!1,null,"cd8b1b56",null);t.a=component.exports},function(e,t,n){"use strict";n(19),n(13),n(11),n(7),n(16),n(30);var r=n(4),o=n(2),l=n(66),c=n(157),d=n(29);function h(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var f={name:"AddLinkForm",components:{MzPageImage:c.a,MzAppIcon:d.a},props:["defaultLink","hideOrText"],data:function(){return{linkToPage:null,linkToUrl:null}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?h(Object(source),!0).forEach((function(t){Object(r.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):h(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(o.e)("magazine",["magazine"]),{},Object(o.e)("page",["page"]),{},Object(o.c)("magazine",["pageNameMap"]),{isValid:function(){return!this.linkToUrl||!1!==l.a.isUrl(this.linkToUrl)||!1!==l.a.isEmail(this.linkToUrl)},computedLink:function(){var e=this,t=this.linkToPage?this.linkToPage:this.linkToUrl;if(t){if(this.linkToPage){var n=this.pagesToLink.find((function(t){return t.value==e.linkToPage}));return{href:t,title:n?n.label:t}}return l.a.isEmail(t)?{href:"mailto:"+t,title:t}:{href:t,title:t}}return!1},pagesToLink:function(){var e=this;return this.magazine.pageOrder.reduce((function(t,n){return n._id!==e.page._id&&(n.double?(t.push({page:n,label:e.pageNameMap[n._id+"_left"],value:"#page_"+n._id+"_left"}),t.push({page:n,label:e.pageNameMap[n._id+"_right"],value:"#page_"+n._id+"_right"})):t.push({page:n,label:e.pageNameMap[n._id],value:"#page_"+n._id})),t}),[])}}
1),mounted:function(){this.updateLinkFromDefaultLink()},methods:{updateLinkFromDefaultLink:function(){this.linkToUrl=null,this.linkToPage=null,this.defaultLink&&(0===this.defaultLink.indexOf("#")?this.linkToPage=this.defaultLink:0===this.defaultLink.indexOf("mailto:")?this.linkToUrl=this.defaultLink.substr(7):this.linkToUrl=this.defaultLink)}},watch:{defaultLink:function(e){console.log("defaultLink",e),this.updateLinkFromDefaultLink()}}},m=(n(633),n(6)),component=Object(m.a)(f,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-row",{attrs:{type:"flex",justify:"center",align:"middle",gutter:25}},[n("el-col",{attrs:{span:e.hideOrText?12:10}},[n("el-row",{attrs:{type:"flex",justify:"start",align:"middle"}},[e._v("\n "+e._s(e.$t("public.edit_magazine.link_to_url"))+"\n "),n("el-tooltip",{attrs:{content:e.$t("public.edit_magazine.image_link_tooltip")}},[n("MzAppIcon",{staticClass:"ml-0 text-blue",attrs:{name:"info",size:"20"}})],1)],1),e._v(" "),n("el-input",{staticClass:"mt-10px",attrs:{clearable:"",placeholder:e.$t("public.edit_magazine.link_to_url.placeholder")},on:{input:function(t){e.linkToPage=null}},model:{value:e.linkToUrl,callback:function(t){e.linkToUrl=t},expression:"linkToUrl"}},[n("template",{slot:"prefix"},[n("MzAppIcon",{attrs:{name:"link_2"}})],1)],2)],1),e._v(" "),e.hideOrText?e._e():n("el-col",{attrs:{span:4,type:"flex",align:"middle"}},[n("span",{directives:[{name:"t",rawName:"v-t",value:"public.edit_magazine.or",expression:"'public.edit_magazine.or'"}],staticClass:"text-style-1 text-grey-light"})]),e._v(" "),n("el-col",{attrs:{span:e.hideOrText?12:10}},[n("div",[e._v("\n "+e._s(e.$t("public.edit_magazine.link_to_page"))+"\n ")]),e._v(" "),n("el-select",{staticClass:"mt-10px el-col-24",attrs:{placeholder:e.$t("public.edit_magazine.link_to_page.placeholder"),clearable:"","popper-class":"select-page-list"},on:{change:function(t){e.linkToUrl=null}},model:{value:e.linkToPage,callback:function(t){e.linkToPage=t},expression:"linkToPage"}},[n("template",{slot:"prefix"},[n("MzAppIcon",{attrs:{name:"auto_stories"}})],1),e._v(" "),e._l(e.pagesToLink,(function(t){return n("el-option",{key:"linkto_"+t.value,attrs:{label:t.label,value:t.value}},[n("MzPageImage",{attrs:{page:t.page}}),e._v(" "),n("span",{staticClass:"ml-1"},[e._v(e._s(t.label))])],1)}))],2)],1)],1)],1)}),[],!1,null,"98d684bc",null);t.a=component.exports},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(534)},function(e,t,n){"use strict";n.r(t),function(e){n(82),n(35),n(13);var t=n(40),r=(n(28),n(3)),o=(n(118),n(83),n(103),n(11),n(7),n(16),n(26),n(329),n(543),n(551),n(553),n(1)),l=n(498),c=n(150),d=n(10),h=n(90),f=n(235);o.default.component(f.a.name,f.a),o.default.component("NLink",f.a),e.fetch||(e.fetch=l.a);var m,y,v=[],_=window.__NUXT__||{};Object.assign(o.default.config,{silent:!0,performance:!1});var O=o.default.config.errorHandler||console.error;function E(e,t,n){var r=function(component){var e=function(component,e){if(!component||!component.options||!component.options[e])return{};var option=component.options[e];if("function"==typeof option){for(var t=arguments.length,n=new Array(t>2?t-2:0),r=2;r<t;r++)n[r-2]=arguments[r];return option.apply(void 0,n)}return option}(component,"transition",t,n)||{};return"string"==typeof e?{name:e}:e};return e.map((function(e){var t=Object.assign({},r(e));if(n&&n.matched.length&&n.matched[0].components.default){var o=r(n.matched[0].components.default);Object.keys(o).filter((function(e){return o[e]&&e.toLowerCase().includes("leave")})).forEach((function(e){t[e]=o[e]}))}return t}))}function k(e,t,n){this._pathChanged=Boolean(m.nuxt.err)||t.path!==e.path,this._queryChanged=JSON.stringify(e.query)!==JSON.stringify(t.query),this._diffQuery=this._queryChanged?Object(d.g)(e.query,t.query):[];try{n()}catch(c){var r=c||{},o=r.statusCode||r.status||r.response&&r.response.status||500,l=r.message||"";if(/^Loading( CSS)? chunk (\d)+ failed\./.test(l))return void window.location.reload(!0);this.error({statusCode:o,message:l}),this.$nuxt.$emit("routeChanged",e,t,r),n()}}function S(e,t){return _.serverRendered&&t&&Object(d.a)(e,t),e._Ctor=e,e}function A(e){var path=Object(d.d)(e.options.base,e.options.mode);return Object(d.c)(e.match(path),function(){var e=Object(r.a)(regeneratorRuntime.mark((function e(t,n,r,o,l){var c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t||t.options){e.next=4;break}return e.next=3,t();case 3:t=e.sent;case 4:return c=S(Object(d.n)(t),_.data?_.data[l]:null),r.components[o]=c,e.abrupt("return",c);case 7:case"end":return e.stop()}}),e)})));return function(t,n,r,o,l){return e.apply(this,arguments)}}())}function T(e,t,n){var r=this,o=["setAppMode","authenticated","nuxti18n"],l=!1;if(void 0!==n&&(o=[],(n=Object(d.n)(n)).options.middleware&&(o=o.concat(n.options.middleware)),e.forEach((function(e){e.options.middleware&&(o=o.concat(e.options.middleware))}))),o=o.map((function(e){return"function"==typeof e?e:("function"!=typeof c.a[e]&&(l=!0,r.error({statusCode:500,message:"Unknown middleware "+e})),c.a[e])})),!l)return Object(d.k)(o,t)}function P(e,t,n){return C.apply(this,arguments)}function C(){return(C=Object(r.a)(regeneratorRuntime.mark((function e(t,n,r){var o,l,c,f,y,_,O,k,S,A,P,C,x,D,I,w,R,z,L=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==this._pathChanged||!1!==this._queryChanged){e.next=2;break}return e.abrupt("return",r());case 2:return t===n?v=[]:(o=[],v=Object(d.e)(n,o).map((function(e,i){return Object(d.b)(n.matched[o[i]].path)(n.params)}))),l=!1,c=function(path){l||(l=!0,r(path))},e.next=7,Object(d.o)(m,{route:t,from:n,next:c.bind(this)});case 7:if(this._dateLastError=m.nuxt.dateErr,this._hadError=Boolean(m.nuxt.err),f=[],(y=Object(d.e)(t,f)).length){e.next=26;break}return e.next=14,T.call(this,y,m.context);case 14:if(!l){e.next=16;break}return e.abrupt("return");case 16:return _=(h.a.options||h.a).layout,e.next=19,this.loadLayout("function"==typeof _?_.call(h.a,m.context):_);case 19:return O=e.sent,e.next=22,T.call(this,y,m.context,O);case 22:if(!l){e.next=24;break}return e.abrupt("return");case 24:return m.context.error({statusCode:404,message:"This page could not be found"}),e.abrupt("return",r());
1case 26:return y.forEach((function(e){e._Ctor&&e._Ctor.options&&(e.options.asyncData=e._Ctor.options.asyncData,e.options.fetch=e._Ctor.options.fetch)})),this.setTransitions(E(y,t,n)),e.prev=28,e.next=31,T.call(this,y,m.context);case 31:if(!l){e.next=33;break}return e.abrupt("return");case 33:if(!m.context._errored){e.next=35;break}return e.abrupt("return",r());case 35:return"function"==typeof(k=y[0].options.layout)&&(k=k(m.context)),e.next=39,this.loadLayout(k);case 39:return k=e.sent,e.next=42,T.call(this,y,m.context,k);case 42:if(!l){e.next=44;break}return e.abrupt("return");case 44:if(!m.context._errored){e.next=46;break}return e.abrupt("return",r());case 46:S=!0,e.prev=47,A=!0,P=!1,C=void 0,e.prev=51,x=y[Symbol.iterator]();case 53:if(A=(D=x.next()).done){e.next=65;break}if("function"==typeof(I=D.value).options.validate){e.next=57;break}return e.abrupt("continue",62);case 57:return e.next=59,I.options.validate(m.context);case 59:if(S=e.sent){e.next=62;break}return e.abrupt("break",65);case 62:A=!0,e.next=53;break;case 65:e.next=71;break;case 67:e.prev=67,e.t0=e.catch(51),P=!0,C=e.t0;case 71:e.prev=71,e.prev=72,A||null==x.return||x.return();case 74:if(e.prev=74,!P){e.next=77;break}throw C;case 77:return e.finish(74);case 78:return e.finish(71);case 79:e.next=85;break;case 81:return e.prev=81,e.t1=e.catch(47),this.error({statusCode:e.t1.statusCode||"500",message:e.t1.message}),e.abrupt("return",r());case 85:if(S){e.next=88;break}return this.error({statusCode:404,message:"This page could not be found"}),e.abrupt("return",r());case 88:return e.next=90,Promise.all(y.map((function(e,i){if(e._path=Object(d.b)(t.matched[f[i]].path)(t.params),e._dataRefresh=!1,L._pathChanged&&L._queryChanged||e._path!==v[i])e._dataRefresh=!0;else if(!L._pathChanged&&L._queryChanged){var r=e.options.watchQuery;!0===r?e._dataRefresh=!0:Array.isArray(r)?e._dataRefresh=r.some((function(e){return L._diffQuery[e]})):"function"==typeof r&&(w||(w=Object(d.f)(t)),e._dataRefresh=r.apply(w[i],[t.query,n.query]))}if(L._hadError||!L._isMounted||e._dataRefresh){var o=[],l=e.options.asyncData&&"function"==typeof e.options.asyncData,c=Boolean(e.options.fetch);if(l){var h=Object(d.m)(e.options.asyncData,m.context).then((function(t){Object(d.a)(e,t)}));o.push(h)}if(L.$loading.manual=!1===e.options.loading,c){var p=e.options.fetch(m.context);p&&(p instanceof Promise||"function"==typeof p.then)||(p=Promise.resolve(p)),p.then((function(e){})),o.push(p)}return Promise.all(o)}})));case 90:l||r(),e.next=107;break;case 93:if(e.prev=93,e.t2=e.catch(28),"ERR_REDIRECT"!==(R=e.t2||{}).message){e.next=98;break}return e.abrupt("return",this.$nuxt.$emit("routeChanged",t,n,R));case 98:return v=[],Object(d.i)(R),"function"==typeof(z=(h.a.options||h.a).layout)&&(z=z(m.context)),e.next=104,this.loadLayout(z);case 104:this.error(R),this.$nuxt.$emit("routeChanged",t,n,R),r();case 107:case"end":return e.stop()}}),e,this,[[28,93],[47,81],[51,67,71,79],[72,,74,78]])})))).apply(this,arguments)}function x(e,n){Object(d.c)(e,(function(e,n,r,l){return"object"!==Object(t.a)(e)||e.options||((e=o.default.extend(e))._Ctor=e,r.components[l]=e),e}))}function D(e){this._hadError&&this._dateLastError===this.$options.nuxt.dateErr&&this.error();var t=this.$options.nuxt.err?(h.a.options||h.a).layout:e.matched[0].components.default.options.layout;"function"==typeof t&&(t=t(m.context)),this.setLayout(t)}function I(e,t){var n=this;if(!1!==this._pathChanged||!1!==this._queryChanged){var r=Object(d.f)(e),l=Object(d.e)(e);o.default.nextTick((function(){r.forEach((function(e,i){if(e&&!e._isDestroyed&&e.constructor._dataRefresh&&l[i]===e.constructor&&!0!==e.$vnode.data.keepAlive&&"function"==typeof e.constructor.options.data){var t=e.constructor.options.data.call(e);for(var n in t)o.default.set(e.$data,n,t[n]);window.$nuxt.$nextTick((function(){window.$nuxt.$emit("triggerScroll")}))}})),D.call(n,e)}))}}function w(e){window.onNuxtReadyCbs.forEach((function(t){"function"==typeof t&&t(e)})),"function"==typeof window._onNuxtLoaded&&window._onNuxtLoaded(e),y.afterEach((function(t,n){o.default.nextTick((function(){return e.$nuxt.$emit("routeChanged",t,n)}))}))}function R(){return(R=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r,l,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m=t.app,y=t.router,t.store,n=new o.default(m),r=function(){n.$mount("#__nuxt"),y.afterEach(x),y.afterEach(I.bind(n)),o.default.nextTick((function(){w(n)}))},e.next=7,Promise.all(A(y));case 7:if(l=e.sent,n.setTransitions=n.$options.nuxt.setTransitions.bind(n),l.length&&(n.setTransitions(E(l,y.currentRoute)),v=y.currentRoute.matched.map((function(e){return Object(d.b)(e.path)(y.currentRoute.params)}))),n.$loading={},_.error&&n.error(_.error),y.beforeEach(k.bind(n)),y.beforeEach(P.bind(n)),!_.serverRendered){e.next=17;break}return r(),e.abrupt("return");case 17:c=function(){x(y.currentRoute,y.currentRoute),D.call(n,y.currentRoute),r()},P.call(n,y.currentRoute,y.currentRoute,(function(path){if(path){var e=y.afterEach((function(t,n){e(),c()}));y.push(path,void 0,(function(e){e&&O(e)}))}else c()}));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Object(h.b)().then((function(e){return R.apply(this,arguments)})).catch(O)}.call(this,n(77))},,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);n(26),n(28);var r=n(3),o=(n(185),["index","login","login-callback","login-providerKey","register","register-token","password-reset-token","password-forgot","join-accessId-nickname"]),l=["login-callback"],c=["client-collaboration-teamId","viewer-magazineId","maintenance"];function d(){return(d=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r,d,h,f,m,y,v,_,O,E,k;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.app,r=t.store,d=t.redirect,h=t.route,f=h.name?h.name.substr(0,h.name.indexOf("__")):"index",console.log("check route: "+h.fullPath,f),m=-1!=o.indexOf(f),y=-1!=l.indexOf(f),v=-1!=c.indexOf(f),_=r.getters["api/isLogged"],O=r.getters["api/isLoggedAsSupport"],E=r.getters["app/adminMode"],_&&0===r.getters["api/permissions"].length&&r.commit("api/UPDATE_PERMISSIONS"),!(_&&E&&O)){e.next=13;break}return e.next=13,r.dispatch("api/API_LOGOUT_SUPPORT");case 13:if("index"!==f){e.next=19;break}if(!_){e.next=18;break}return e.abrupt("return",d(r.getters["api/checkPerm"]("admin:all")?"/admin":"/client"));case 18:return e.abrupt("return",d("/login"));case 19:if(!1!==m||!1!==v||!1!==_){e.next=27;break}if(console.warn("user try to access a non free route without login"),r.commit("api/UPDATE_ROOT_FIELD",{key:"forceDefaultRoute",value:{name:f,params:h.params,query:h.query}}),!h.query||!h.query.from){e.next=26;break}return e.abrupt("return",d("/login?email="+encodeURIComponent(h.query.from)));case 26:return e.abrupt("return",d("/login"));case 27:if(!m||!_){e.next=36;break}
1if(k=n.$mzLocalStorage.getItem("mzkeeplogin"),console.log("authenticated detect user is already logged. KeepLogin : "+k),!k||y){e.next=34;break}return e.abrupt("return",d(r.getters["api/checkPerm"]("admin:all")?"/admin":"/client"));case 34:return e.next=36,r.dispatch("api/API_LOGOUT",{debugSaveFrom:"Authenticated middleware access free route from logged user : "+f});case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(e){return d.apply(this,arguments)}},,,function(e,t,n){"use strict";n.r(t);n(28);var r=n(3);function o(){return(o=Object(r.a)(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.store,t.redirect,t.route;case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(e){return o.apply(this,arguments)}},function(e,t,n){"use strict";n.r(t);n(26),n(28);var r=n(3);function o(){return(o=Object(r.a)(regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.store,t.redirect,r=t.route,o=!!r.name&&0===r.name.indexOf("admin"),n.commit("app/UPDATE_SETTINGS",{key:"adminMode",value:o});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(e){return o.apply(this,arguments)}},,,,,,,,,function(e,t,n){"use strict";var r=n(186);n.n(r).a},,,,function(e,t,n){"use strict";var r=n(187);n.n(r).a},function(e,t,n){"use strict";var r=n(188);n.n(r).a},,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},,function(e,t,n){"use strict";var r=n(189);n.n(r).a},function(e,t,n){"use strict";var r=n(190);n.n(r).a},function(e,t,n){"use strict";var r=n(191);n.n(r).a},function(e,t,n){"use strict";var r=n(192);n.n(r).a},function(e,t,n){"use strict";var r=n(193);n.n(r).a},function(e,t,n){"use strict";var r=n(194);n.n(r).a},function(e,t,n){"use strict";var r=n(195);n.n(r).a},function(e,t,n){"use strict";var r=n(196);n.n(r).a},function(e,t,n){"use strict";var r=n(197);n.n(r).a},function(e,t,n){"use strict";var r=n(198);n.n(r).a},function(e,t,n){"use strict";var r=n(199);n.n(r).a},function(e,t,n){"use strict";var r=n(201);n.n(r).a},function(e,t,n){"use strict";var r=n(202);n.n(r).a},function(e,t,n){"use strict";var r=n(203);n.n(r).a},function(e,t,n){"use strict";var r=n(204);n.n(r).a},function(e,t,n){"use strict";var r=n(205);n.n(r).a},function(e,t,n){"use strict";var r=n(206);n.n(r).a},function(e,t,n){"use strict";var r=n(207);n.n(r).a},function(e,t,n){"use strict";var r=n(208);n.n(r).a},function(e,t,n){"use strict";var r=n(209);n.n(r).a},function(e,t,n){"use strict";var r=n(210);n.n(r).a},function(e,t,n){"use strict";var r=n(211);n.n(r).a},function(e,t,n){"use strict";var r=n(212);n.n(r).a},,,,,,,,,,,,function(e,t,n){"use strict";var r=n(213);n.n(r).a},function(e,t,n){"use strict";var r=n(214);n.n(r).a},function(e,t,n){"use strict";var r=n(215);n.n(r).a},function(e,t,n){"use strict";var r=n(216);n.n(r).a},function(e,t,n){"use strict";var r=n(217);n.n(r).a},function(e,t,n){"use strict";var r=n(218);n.n(r).a},function(e,t,n){"use strict";var r=n(219);n.n(r).a},function(e,t,n){"use strict";var r=n(220);n.n(r).a},function(e,t,n){"use strict";var r=n(221);n.n(r).a},function(e,t,n){"use strict";var r=n(222);n.n(r).a},function(e,t,n){"use strict";var r=n(223);n.n(r).a},function(e,t,n){"use strict";var r=n(224);n.n(r).a},function(e,t,n){"use strict";var r=n(225);n.n(r).a},function(e,t,n){"use strict";var r=n(226);n.n(r).a},function(e,t,n){"use strict";var r=n(227);n.n(r).a},function(e,t,n){"use strict";var r=n(228);n.n(r).a},function(e,t,n){"use strict";var r=n(229);n.n(r).a},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n(282),l=n(283),c=n(284),d=n(285),h=n(286),f=n(287),m=n(288),y=n(289),v=n(290),_=n(291),O=n(292),E=n(293),k=n(294),S=n(295),A=n(296),T=n(297),P=n(298),C=n(299),x=n(300),D=n(301),I=n(302),w=n(303);t.default=function(){return new r.a.Store({modules:{app:o.default,api:l.default,article:O.default,format:c.default,magazine:d.default,library:h.default,page:f.default,theme:m.default,palette:y.default,fabric:v.default,user:_.default,collaboration:E.default,notification:k.default,offer:S.default,order:A.default,workspace:T.default,organization:P.default,adminsettings:C.default,authStrategy:x.default,tracking:D.default,pagecomment:I.default,errorlog:w.default},strict:!1})}},function(e,t,n){var map={"./en-US/lang-admin":[522,4],"./en-US/lang-admin.js":[522,4],"./en-US/lang-client":[526,1],"./en-US/lang-client.js":[526,1],"./en-US/lang-global":[523,5],"./en-US/lang-global.js":[523,5],"./fr-FR/lang-admin":[524,6],"./fr-FR/lang-admin.js":[524,6],"./fr-FR/lang-client":[527,2],"./fr-FR/lang-client.js":[527,2],"./fr-FR/lang-global":[525,7],"./fr-FR/lang-global.js":[525,7],"./index-en-US":[531,1,8],"./index-en-US.js":[531,1,8],"./index-fr-FR":[532,2,9],"./index-fr-FR.js":[532,2,9]};function r(e){if(!n.o(map,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=map[e],r=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(r)}))}r.keys=function(){return Object.keys(map)},r.id=650,e.exports=r},,,,,function(e,t,n){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){var map={"./af":365,"./af.js":365,"./ar":366,"./ar-dz":367,"./ar-dz.js":367,"./ar-kw":368,"./ar-kw.js":368,"./ar-ly":369,"./ar-ly.js":369,"./ar-ma":370,"./ar-ma.js":370,"./ar-sa":371,"./ar-sa.js":371,"./ar-tn":372,"./ar-tn.js":372,"./ar.js":366,"./az":373,"./az.js":373,"./be":374,"./be.js":374,"./bg":375,"./bg.js":375,"./bm":376,"./bm.js":376,"./bn":377,"./bn.js":377,"./bo":378,"./bo.js":378,"./br":379,"./br.js":379,"./bs":380,"./bs.js":380,"./ca":381,"./ca.js":381,"./cs":382,"./cs.js":382,"./cv":383,"./cv.js":383,"./cy":384,"./cy.js":384,"./da":385,"./da.js":385,"./de":386,"./de-at":387,"./de-at.js":387,"./de-ch":388,"./de-ch.js":388,"./de.js":386,"./dv":389,"./dv.js":389,"./el":390,"./el.js":390,"./en-SG":391,"./en-SG.js":391,"./en-au":392,"./en-au.js":392,"./en-ca":393,"./en-ca.js":393,"./en-gb":279,"./en-gb.js":279,"./en-ie":394,"./en-ie.js":394,"./en-il":395,"./en-il.js":395,"./en-nz":396,"./en-nz.js":396,"./eo":397,"./eo.js":397,"./es":398,"./es-do":399,"./es-do.js":399,"./es-us":400,"./es-us.js":400,"./es.js":398,"./et":401,"./et.js":401,"./eu":402,"./eu.js":402,"./fa":403,"./fa.js":403,"./fi":404,"./fi.js":404,"./fo":405,"./fo.js":405,"./fr":280,"./fr-ca":406,"./fr-ca.js":406,"./fr-ch":407,"./fr-ch.js":407,"./fr.js":280,"./fy":408,"./fy.js":408,"./ga":409,"./ga.js":409,"./gd":410,"./gd.js":410,"./gl":411,"./gl.js":411,"./gom-latn":412,"./gom-latn.js":412,"./gu":413,"./gu.js":413,"./he":414,"./he.js":414,"./hi":415,"./hi.js":415,"./hr":416,"./hr.js":416,"./hu":417,"./hu.js":417,"./hy-am":418,"./hy-am.js":418,"./id":419,"./id.js":419,"./is":420,"./is.js":420,"./it":421,"./it-ch":422,"./it-ch.js":422,"./it.js":421,"./ja":423,"./ja.js":423,"./jv":424,"./jv.js":424,"./ka":425,"./ka.js":425,"./kk":426,"./kk.js":426,"./km":427,"./km.js":427,"./kn":428,"./kn.js":428,"./ko":429,"./ko.js":429,"./ku":430,"./ku.js":430,"./ky":431,"./ky.js":431,"./lb":432,"./lb.js":432,"./lo":433,"./lo.js":433,"./lt":434,"./lt.js":434,"./lv":435,"./lv.js":435,"./me":436,"./me.js":436,"./mi":437,"./mi.js":437,"./mk":438,"./mk.js":438,"./ml":439,"./ml.js":439,"./mn":440,"./mn.js":440,"./mr":441,"./mr.js":441,"./ms":442,"./ms-my":443,"./ms-my.js":443,"./ms.js":442,"./mt":444,"./mt.js":444,"./my":445,"./my.js":445,"./nb":446,"./nb.js":446,"./ne"
1:447,"./ne.js":447,"./nl":448,"./nl-be":449,"./nl-be.js":449,"./nl.js":448,"./nn":450,"./nn.js":450,"./pa-in":451,"./pa-in.js":451,"./pl":452,"./pl.js":452,"./pt":453,"./pt-br":454,"./pt-br.js":454,"./pt.js":453,"./ro":455,"./ro.js":455,"./ru":456,"./ru.js":456,"./sd":457,"./sd.js":457,"./se":458,"./se.js":458,"./si":459,"./si.js":459,"./sk":460,"./sk.js":460,"./sl":461,"./sl.js":461,"./sq":462,"./sq.js":462,"./sr":463,"./sr-cyrl":464,"./sr-cyrl.js":464,"./sr.js":463,"./ss":465,"./ss.js":465,"./sv":466,"./sv.js":466,"./sw":467,"./sw.js":467,"./ta":468,"./ta.js":468,"./te":469,"./te.js":469,"./tet":470,"./tet.js":470,"./tg":471,"./tg.js":471,"./th":472,"./th.js":472,"./tl-ph":473,"./tl-ph.js":473,"./tlh":474,"./tlh.js":474,"./tr":475,"./tr.js":475,"./tzl":476,"./tzl.js":476,"./tzm":477,"./tzm-latn":478,"./tzm-latn.js":478,"./tzm.js":477,"./ug-cn":479,"./ug-cn.js":479,"./uk":480,"./uk.js":480,"./ur":481,"./ur.js":481,"./uz":482,"./uz-latn":483,"./uz-latn.js":483,"./uz.js":482,"./vi":484,"./vi.js":484,"./x-pseudo":485,"./x-pseudo.js":485,"./yo":486,"./yo.js":486,"./zh-cn":487,"./zh-cn.js":487,"./zh-hk":488,"./zh-hk.js":488,"./zh-tw":489,"./zh-tw.js":489};function r(e){var t=o(e);return n(t)}function o(e){if(!n.o(map,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return map[e]}r.keys=function(){return Object.keys(map)},r.resolve=o,e.exports=r,r.id=720}],[[533,78,16,79]]]); 2//# sourceMappingURL=813f44d2b7f8b64eb281.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.