(()=>{var __webpack_modules__={2516:()=>{computeOffsetTitleHeroImages=function(){var t=$(".ccm-block-hero-image-offset-title");t.length&&t.each((function(){var t=$(this).find("img").css("height"),e=$(this).find("img").attr("data-height-ratio");if(t&&e){var n=parseInt(t)*e,i=parseInt(t)-n;$(this).find(".ccm-block-hero-image-offset-image-container").css("height",n+"px"),$(this).find(".ccm-block-hero-image-offset-image-container img").css("margin-top","-"+i+"px"),$(this).css("height","auto")}}))},$((function(){computeOffsetTitleHeroImages(),$(window).on("resize",(function(){computeOffsetTitleHeroImages()})),$(window).on("offsetTitleBlockLoaded",(function(){computeOffsetTitleHeroImages()}))}))},256:(t,e,n)=>{"use strict";var i=n(311),o=n.n(i);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0?i=setTimeout(l,e-c):(i=null,n||(a=t.apply(r,o),r=o=null))}null==e&&(e=100);var c=function(){r=this,o=arguments,s=Date.now();var c=n&&!i;return i||(i=setTimeout(l,e)),c&&(a=t.apply(r,o),r=o=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},c}m.debounce=m;var g=m,v=function(){return v=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?n.left=i.left:i.right&&i.right>0&&(n.left=-i.right),i.top&&i.top>0?n.top=i.top:i.bottom&&i.bottom>0&&(n.top=-i.bottom),n}function ot(t,e){var n;return e.minimum&&te.maximum&&(n=e.maximum),n}function rt(t,e){var n=et(t),i=et(e);return e.width<1/0&&e.height<1/0?n>i?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function st(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function at(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function lt(t,e){var n=G(ct(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,nt(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,nt(t,e)):1}function ct(t,e,n){void 0===n&&(n=!1);var i=it(t,e);return J(t,n?K(i):i)}function ut(t){return{width:void 0!==t.right&&void 0!==t.left?t.right-t.left:1/0,height:void 0!==t.bottom&&void 0!==t.top?t.bottom-t.top:1/0}}function ht(t,e,n){void 0===n&&(n=!0);var i={};return H.forEach((function(o){var r=t[o],s=e[o];void 0!==r&&void 0!==s?i[o]="left"===o||"top"===o?n?Math.max(r,s):Math.min(r,s):n?Math.min(r,s):Math.max(r,s):void 0!==s?i[o]=s:void 0!==r&&(i[o]=r)})),i}function ft(t,e){return ht(t,e,!0)}function dt(t){var e=t.size,n=t.aspectRatio,i=t.ignoreMinimum,o=t.sizeRestrictions;return Boolean((e.correctRatio||et(e)>=n.minimum&&et(e)<=n.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(i||e.height>=o.minHeight&&e.width>=o.minWidth))}function pt(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function mt(t){var e=t.width,n=t.height,i=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},r={width:Math.max(i.minWidth,Math.min(i.maxWidth,e)),height:Math.max(i.minHeight,Math.min(i.maxHeight,n))};function s(t,r){return void 0===r&&(r=!1),t.reduce((function(t,s){return dt({size:s,aspectRatio:o,sizeRestrictions:i,ignoreMinimum:r})&&(!t||pt(s,{width:e,height:n})1-u)||(h=v(v({},h),mt({sizeRestrictions:s,width:h.width,height:h.height,aspectRatio:{minimum:et(d),maximum:et(d)}})));var p=lt(f=tt(f,h.width*n.width/(f.width*d.width)),e({visibleArea:f,type:"resize"}));return 1!==p&&(f=tt(f,p),h=tt(h,p)),f=ct(f=J(f,V(Q(h),Q(f))),e({visibleArea:f,type:"move"})),{coordinates:h=ct(h,ft(Y(f),a)),visibleArea:f}}function yt(t){var e=t.event,n=t.getAreaRestrictions,i=t.boundaries,o=t.coordinates,r=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var s=t.positionRestrictions;t.stencilReference;var a=v({},o),l=v({},r);if(o&&r&&"manipulateImage"!==e.type){var c={width:0,height:0};l.width,i.width,et(i)>et(a)?(c.height=.8*i.height,c.width=c.height*et(a)):(c.width=.8*i.width,c.height=c.width*et(a));var u=lt(l=tt(l,a.width*i.width/(l.width*c.width)),n({visibleArea:l,type:"resize"}));l=tt(l,u),1!==u&&(c.height/=u,c.width/=u),l=ct(l=J(l,V(Q(a),Q(l))),n({visibleArea:l,type:"move"})),a=ct(a,ft(Y(l),s))}return{coordinates:a,visibleArea:l}}function bt(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.getAreaRestrictions,r=v({},i),s=v({},n);if("setCoordinates"===e.type){var a=Math.max(0,s.width-r.width),l=Math.max(0,s.height-r.height);a>l?r=tt(r,Math.min(s.width/r.width,nt(r,o({visibleArea:r,type:"resize"})))):l>a&&(r=tt(r,Math.min(s.height/r.height,nt(r,o({visibleArea:r,type:"resize"}))))),r=ct(r=J(r,K(it(s,Y(r)))),o({visibleArea:r,type:"move"}))}return{visibleArea:r,coordinates:s}}function wt(t){var e=t.imageSize,n=t.visibleArea,i=t.aspectRatio,o=t.sizeRestrictions,r=n||e,s=Math.min(i.maximum||1/0,Math.max(i.minimum||0,et(r))),a=r.widthet(r)?n=(e=l.height*c.height/r.height)*et(l):e=(n=l.width*c.width/r.width)/et(l),mt({width:n,height:e,aspectRatio:s,sizeRestrictions:a})}function xt(t,e){return ht(t,Y(e))}function kt(t){var e=t.directions,n=t.coordinates,i=t.positionRestrictions,o=void 0===i?{}:i,r=t.sizeRestrictions,s=t.preserveRatio,a=t.compensate,l=v({},e),c=Z(n,l).width,u=Z(n,l).height;c<0&&(l.left<0&&l.right<0?(l.left=-(n.width-r.minWidth)/(l.left/l.right),l.right=-(n.width-r.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-r.minWidth):l.right<0&&(l.right=-(n.width-r.minWidth))),u<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-r.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-r.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-r.minHeight):l.bottom<0&&(l.bottom=-(n.height-r.minHeight)));var h=G(Z(n,l),o);a&&(h.left&&h.left>0&&0===h.right?(l.right+=h.left,l.left-=h.left):h.right&&h.right>0&&0===h.left&&(l.left+=h.right,l.right-=h.right),h.top&&h.top>0&&0===h.bottom?(l.bottom+=h.top,l.top-=h.top):h.bottom&&h.bottom>0&&0===h.top&&(l.top+=h.bottom,l.bottom-=h.bottom),h=G(Z(n,l),o));var f={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(H.forEach((function(t){var e=h[t];e&&l[t]&&(f[t]=Math.max(0,1-e/l[t]))})),s){var d=Math.min.apply(null,H.map((function(t){return f[t]})));d!==1/0&&H.forEach((function(t){l[t]*=d}))}else H.forEach((function(t){f[t]!==1/0&&(l[t]*=f[t])}));if(c=Z(n,l).width,u=Z(n,l).height,l.right+l.left&&(c>r.maxWidth?f.width=(r.maxWidth-n.width)/(l.right+l.left):cr.maxHeight?f.height=(r.maxHeight-n.height)/(l.bottom+l.top):u=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):T({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&0===t.button){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top;this.anchor={x:t.clientX-n,y:t.clientY-i}},processMove:function(t,e){var n=c(e);if(this.touches.length){var i=this.$refs.container.getBoundingClientRect(),o=i.left,r=i.top;1===this.touches.length&&1===n.length&&this.$emit("move",new M({left:n[0].clientX-(o+this.anchor.x),top:n[0].clientY-(r+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Ft(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:(null===(e=null==t?void 0:t.flip)||void 0===e?void 0:e.horizontal)||!1,vertical:(null===(n=null==t?void 0:t.flip)||void 0===n?void 0:n.vertical)||!1}}}function jt(t){var e=t.rotate,n=t.flip,i=t.scaleX,o=t.scaleY,r="";return r+=" rotate("+e+"deg) ",(r+=" scaleX("+i*(n.horizontal?-1:1)+") ")+" scaleY("+o*(n.vertical?-1:1)+") "}var Lt=p("vue-preview-result");P({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes.root},[n("div",{ref:"wrapper",class:t.classes.wrapper,style:t.wrapperStyle},[n("img",{ref:"image",class:t.classes.image,style:t.imageStyle,attrs:{src:t.image.src}})])])},staticRenderFns:[]},void 0,{name:"PreviewResult",props:{image:{type:Object},transitions:{type:Object},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}},imageClass:{type:String}},computed:{classes:function(){return{root:Lt(),wrapper:Lt("wrapper"),imageWrapper:Lt("image-wrapper"),image:d(Lt("image"),this.imageClass)}},wrapperStyle:function(){var t={width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){var t=this.image.transforms,e=st({width:this.image.width,height:this.image.height},t.rotate),n={width:"".concat(this.image.width,"px"),height:"".concat(this.image.height,"px"),left:"0px",top:"0px"},i=(this.image.width-e.width)*t.scaleX/2,o=(this.image.height-e.height)*t.scaleY/2,r=(1-t.scaleX)*this.image.width/2,s=(1-t.scaleY)*this.image.height/2;return n.transform="translate(\n\t\t\t\t".concat(-this.stencilCoordinates.left-t.translateX-i-r,"px,").concat(-this.stencilCoordinates.top-t.translateY-o-s,"px) ")+jt(t),this.transitions&&this.transitions.enabled&&(n.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),n}}},void 0,!1,void 0,!1,void 0,void 0,void 0);function Ht(t,e){var n=e.getBoundingClientRect(),i=n.left,o=n.top,r={left:0,top:0},s=0;return t.forEach((function(e){r.left+=(e.clientX-i)/t.length,r.top+=(e.clientY-o)/t.length})),t.forEach((function(t){s+=T({x:r.left,y:r.top},{x:t.clientX-i,y:t.clientY-o})})),{centerMass:r,spread:s,count:t.length}}var Nt=P({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{ref:"container",on:{touchstart:t.onTouchStart,mousedown:t.onMouseDown,wheel:t.onWheel}},[t._t("default")],2)},staticRenderFns:[]},void 0,{props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=g(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(1===this.touches.length&&1===e.length)this.$emit("move",new z({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=Ht(e,this.$refs.container),i=this.oldGeometricProperties;i.count===n.count&&i.count>1&&this.$emit("resize",new z({left:i.centerMass.left-n.centerMass.left,top:i.centerMass.top-n.centerMass.top},{factor:i.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?!1!==this.eventsFilter(t,this.transforming):(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),i=n.left,o=n.top,r=n.bottom,s=n.right;this.touches=c(t.touches).filter((function(t){return t.clientX>i&&t.clientXo&&t.clientY0?1:-1),r={left:t.clientX-n,top:t.clientY-i};this.$emit("resize",new z({},{factor:o,center:r})),this.touches.length||this.debouncedProcessEnd()}var s}}},void 0,!1,void 0,!1,void 0,void 0,void 0),Wt=P({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("transformable-image",{attrs:{"touch-move":t.touchMove,"touch-resize":t.touchResize,"mouse-move":t.mouseMove,"wheel-resize":t.wheelResize},on:{move:function(e){return t.$emit("move",e)},resize:function(e){return t.$emit("resize",e)}}},[t._t("default")],2)},staticRenderFns:[]},void 0,{components:{TransformableImage:Nt},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}}},void 0,!1,void 0,!1,void 0,void 0,void 0),Ut=p("vue-preview"),Bt=P({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"root",class:t.classes.root,style:t.style},[n("div",{ref:"wrapper",class:t.classes.wrapper,style:t.wrapperStyle},[n("img",{directives:[{name:"show",rawName:"v-show",value:t.image&&t.image.src,expression:"image && image.src"}],ref:"image",class:t.classes.image,style:t.imageStyle,attrs:{src:t.image&&t.image.src}})])])},staticRenderFns:[]},void 0,{props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Ut({fill:this.fill}),wrapper:Ut("wrapper"),imageWrapper:Ut("image-wrapper"),image:d(Ut("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=a(a({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,i=this.imageSize.height,o=st({width:n,height:i},e.rotate),r={width:"".concat(n,"px"),height:"".concat(i,"px"),left:"0px",top:"0px"},s={rotate:{left:(n-o.width)*e.scaleX/2,top:(i-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*i/2}};return r.transform="translate(\n\t\t\t\t".concat(-this.coordinates.left/t-s.rotate.left-s.scale.left,"px,").concat(-this.coordinates.top/t-s.rotate.top-s.scale.top,"px) ")+jt(e),this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){t.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},destroyed:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}},void 0,!1,void 0,!1,void 0,void 0,void 0),qt=P({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("preview",t._b({attrs:{fill:!0}},"preview",t.$attrs,!1))},staticRenderFns:[]},void 0,{components:{Preview:Bt},inheritAttrs:!1},void 0,!1,void 0,!1,void 0,void 0,void 0),Xt=p("vue-rectangle-stencil"),Yt=P({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes.stencil,style:t.style},[n("bounding-box",{class:t.classes.boundingBox,attrs:{width:t.stencilCoordinates.width,height:t.stencilCoordinates.height,transitions:t.transitions,handlers:t.handlers,"handlers-component":t.handlersComponent,"handlers-classes":t.handlersClasses,"handlers-wrappers-classes":t.handlersWrappersClasses,lines:t.lines,"lines-component":t.linesComponent,"lines-classes":t.linesClasses,"lines-wrappers-classes":t.linesWrappersClasses,resizable:t.resizable},on:{resize:t.onResize,"resize-end":t.onResizeEnd}},[n("draggable-area",{attrs:{movable:t.movable},on:{move:t.onMove,"move-end":t.onMoveEnd}},[n("stencil-preview",{class:t.classes.preview,attrs:{image:t.image,coordinates:t.coordinates,width:t.stencilCoordinates.width,height:t.stencilCoordinates.height,transitions:t.transitions}})],1)],1)],1)},staticRenderFns:[]},void 0,{name:"RectangleStencil",components:{StencilPreview:qt,BoundingBox:Pt,DraggableArea:Dt},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return At}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return zt}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:d(Xt({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:d(Xt("preview"),this.previewClass),boundingBox:d(Xt("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,o=t.top,r={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}},void 0,!1,void 0,!1,void 0,void 0,void 0),Vt=p("vue-circle-stencil"),Qt=P({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes.stencil,style:t.style},[n("bounding-box",{class:t.classes.boundingBox,attrs:{width:t.stencilCoordinates.width,height:t.stencilCoordinates.height,transitions:t.transitions,handlers:t.handlers,"handlers-component":t.handlersComponent,"handlers-classes":t.handlersClasses,"handlers-wrappers-classes":t.handlersWrappersClasses,lines:t.lines,"lines-component":t.linesComponent,"lines-classes":t.linesClasses,"lines-wrappers-classes":t.linesWrappersClasses,resizable:t.resizable},on:{resize:t.onResize,"resize-end":t.onResizeEnd}},[n("draggable-area",{attrs:{movable:t.movable},on:{move:t.onMove,"move-end":t.onMoveEnd}},[n("stencil-preview",{class:t.classes.preview,attrs:{image:t.image,coordinates:t.coordinates,width:t.stencilCoordinates.width,height:t.stencilCoordinates.height,transitions:t.transitions}})],1)],1)],1)},staticRenderFns:[]},void 0,{components:{StencilPreview:qt,BoundingBox:Pt,DraggableArea:Dt},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}}},handlersComponent:{type:[Object,String],default:function(){return At}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return zt}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:d(Vt({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:d(Vt("preview"),this.previewClass),boundingBox:d(Vt("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,o=t.top,r={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(r.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),r}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:1,maximum:1}}}},void 0,!1,void 0,!1,void 0,void 0,void 0),Gt=["transitions"],Zt=p("vue-advanced-cropper"),Kt={name:"Cropper",components:{BackgroundWrapper:Wt},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return Yt}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Wt}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return-1!==B.indexOf(t)}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object],default:function(t){var e=t.imageSize,n=t.visibleArea,i=t.coordinates,o=n||e;return{left:(n?n.left:0)+o.width/2-i.width/2,top:(n?n.top:0)+o.height/2-i.height/2}}},defaultVisibleArea:{type:[Function,Object],default:function(t){var e=t.getAreaRestrictions,n=t.coordinates,i=t.imageSize,o=et(t.boundaries);if(n){var r={height:Math.max(n.height,i.height),width:Math.max(n.width,i.width)},s=rt({width:et(r)>o?r.width:r.height*o,height:et(r)>o?r.width/o:r.height},ut(e())),a={left:n.left+n.width/2-s.width/2,top:n.top+n.height/2-s.height/2,width:s.width,height:s.height},l=G(n,Y(v({left:0,top:0},i))),c={};return!l.left&&!l.right&&a.width<=i.width&&(c.left=0,c.right=i.width),!l.top&&!l.bottom&&a.height<=i.height&&(c.top=0,c.bottom=i.height),ct(a,c)}var u=et(i);return s={height:u>o?i.height:i.width/o,width:u>o?i.height*o:i.width},{left:i.width/2-s.width/2,top:i.height/2-s.height/2,width:s.width,height:s.height}}},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!("string"==typeof t&&"fill"!==t&&"fit"!==t)}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,i=t.aspectRatio,o=t.positionRestrictions,r=t.sizeRestrictions,s=v(v({},n),{right:n.left+n.width,bottom:n.top+n.height}),a=e.params||{},l=v({},e.directions),c=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};r.widthFrozen&&(l.left=0,l.right=0),r.heightFrozen&&(l.top=0,l.bottom=0),H.forEach((function(t){c[t]||(l[t]=0)}));var u=Z(s,l=kt({coordinates:s,directions:l,sizeRestrictions:r,positionRestrictions:o})).width,h=Z(s,l).height,f=a.preserveRatio?et(s):ot(u/h,i);if(f){var d=a.respectDirection;if(d||(d=s.width>=s.height||1===f?"width":"height"),"width"===d){var p=u/f-s.height;if(c.top&&c.bottom){var m=l.top,g=l.bottom;l.bottom=St(p,g,m),l.top=St(p,m,g)}else c.bottom?l.bottom=p:c.top?l.top=p:c.right?l.right=0:c.left&&(l.left=0)}else if("height"===d){var y=s.width-h*f;if(c.left&&c.right){var b=l.left,w=l.right;l.left=-St(y,b,w),l.right=-St(y,w,b)}else c.left?l.left=-y:c.right?l.right=-y:c.top?l.top=0:c.bottom&&(l.bottom=0)}l=kt({directions:l,coordinates:s,sizeRestrictions:r,positionRestrictions:o,preserveRatio:!0,compensate:a.compensate})}return u=Z(s,l).width,h=Z(s,l).height,(f=a.preserveRatio?et(s):ot(u/h,i))&&Math.abs(f-u/h)>.001&&H.forEach((function(t){c[t]||(l[t]=0)})),gt({event:new M({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:gt},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,i=et(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/i+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,i=t.aspectRatio,o=t.sizeRestrictions,r=t.positionRestrictions,s=v(v({},n),mt({width:n.width,height:n.height,aspectRatio:i,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return ct(s=J(s,V(Q(n),Q(s))),ft(Y(e),r))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.getAreaRestrictions,o=t.coordinates,r=v({},e);r.height=r.width/et(n),r.top+=(e.height-r.height)/2,(o.height-r.height>0||o.width-r.width>0)&&(r=tt(r,Math.max(o.height/r.height,o.width/r.width)));var s=K(it(o,Y(r=tt(r,lt(r,i({visibleArea:r,type:"resize"}))))));return r.widthet(i)?(s={top:0,bottom:i.height},e&&"move"===r&&(e.width>i.width?(s.left=-(e.width-i.width)/2,s.right=i.width-s.left):(s.left=0,s.right=i.width))):(s={left:0,right:i.width},e&&"move"===r&&(e.height>i.height?(s.top=-(e.height-i.height)/2,s.bottom=i.height-s.top):(s.top=0,s.bottom=i.height)))),s}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return"none"!==t.imageRestriction&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:!1,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:a({},q)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=function(t){return t*Math.PI/180}(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return Boolean(this.visibleArea&&this.imageLoaded)},settings:function(){var t=S(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:S(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:x(this.minWidth)?0:C(this.minWidth),minHeight:x(this.minHeight)?0:C(this.minHeight),maxWidth:x(this.maxWidth)?1/0:C(this.maxWidth),maxHeight:x(this.maxHeight)?1/0:C(this.maxHeight)});if(t=function(t){var e=t.areaRestrictions,n=t.sizeRestrictions,i=t.boundaries,o=t.positionRestrictions,r=v(v({},n),{minWidth:void 0!==n.minWidth?n.minWidth:0,minHeight:void 0!==n.minHeight?n.minHeight:0,maxWidth:void 0!==n.maxWidth?n.maxWidth:1/0,maxHeight:void 0!==n.maxHeight?n.maxHeight:1/0});void 0!==o.left&&void 0!==o.right&&(r.maxWidth=Math.min(r.maxWidth,o.right-o.left)),void 0!==o.bottom&&void 0!==o.top&&(r.maxHeight=Math.min(r.maxHeight,o.bottom-o.top));var s=ut(e),a=rt(i,s);return s.width<1/0&&(!r.maxWidth||r.maxWidth>a.width)&&(r.maxWidth=Math.min(r.maxWidth,a.width)),s.height<1/0&&(!r.maxHeight||r.maxHeight>a.height)&&(r.maxHeight=Math.min(r.maxHeight,a.height)),r.minWidth>r.maxWidth&&(r.minWidth=r.maxWidth,r.widthFrozen=!0),r.minHeight>r.maxHeight&&(r.minHeight=r.maxHeight,r.heightFrozen=!0),r}({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=ut(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidththis.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e=(t.width-this.imageSize.width)/(2*this.coefficient),n=(t.height-this.imageSize.height)/(2*this.coefficient),i=(1-1/this.coefficient)*t.width/2,o=(1-1/this.coefficient)*t.height/2,r=a(a({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),s={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e-i-this.imageTransforms.translateX,"px, ").concat(-n-o-this.imageTransforms.translateY,"px)")+jt(r)};return this.transitionsOptions.enabled&&(s.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),s}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick((function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(n){return t[n]!==e[n]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=g(this.update,this.debounce),this.debouncedDisableTransitions=g(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},destroyed:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(a({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:a({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?a({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?a({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).transitions,i=void 0===n||n;this.onManipulateImage(new z({},{factor:1/t,center:e}),{normalize:!1,transitions:i})},move:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).transitions,i=void 0===n||n;this.onManipulateImage(new z({left:t||0,top:e||0}),{normalize:!1,transitions:i})},setCoordinates:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.autoZoom,o=void 0===i||i,r=n.transitions,s=void 0===r||r;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(s&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),s&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then((function(){t.onChange()})):this.resetVisibleArea().then((function(){t.onChange()}))},reset:function(){var t=this;return this.resetVisibleArea().then((function(){t.onChange(!1)}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?function(t){var e=t.coordinates,n=t.sizeRestrictions,i=t.positionRestrictions,o={width:Math.round(e.width),height:Math.round(e.height),left:Math.round(e.left),top:Math.round(e.top)};return o.width>n.maxWidth?o.width=Math.floor(e.width):o.widthn.maxHeight?o.height=Math.floor(e.height):o.height1&&void 0!==arguments[1]?arguments[1]:{},n=e.transitions,i=void 0!==n&&n,o=function(t,e){if(null==t)return{};var n,i,o=function(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,Gt),r=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),s=r.visibleArea,a=r.coordinates,l=r.changed;i&&l&&this.enableTransitions(),this.visibleArea=s,this.coordinates=a,i&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(t){var e=t.event,n=t.visibleArea,i=t.coefficient;if("manipulateImage"===e.type)return v(v({},e),{move:{left:e.move&&e.move.left?i*e.move.left:0,top:e.move&&e.move.top?i*e.move.top:0},scale:{factor:e.scale&&e.scale.factor?e.scale.factor:1,center:e.scale&&e.scale.center?{left:e.scale.center.left*i+n.left,top:e.scale.center.top*i+n.top}:null}});if("resize"===e.type){var o=v(v({},e),{directions:v({},e.directions)});return H.forEach((function(t){o.directions[t]*=i})),o}if("move"===e.type){var r=v(v({},e),{directions:v({},e.directions)});return U.forEach((function(t){r.directions[t]*=i})),r}return e}(a(a({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=0!==this.imageTransforms.rotate||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(t,e,n){var i=n.rotate,o=n.flip,r={width:e.naturalWidth,height:e.naturalHeight},s=st(r,i),a=t.getContext("2d");t.height=s.height,t.width=s.width,a.save();var l=at(Q(v({left:0,top:0},r)),i);return a.translate(-(l.left-s.width/2),-(l.top-s.height/2)),a.rotate(i*Math.PI/180),a.translate(o.horizontal?r.width:0,o.vertical?r.height:0),a.scale(o.horizontal?-1:1,o.vertical?-1:1),a.drawImage(e,0,0,r.width,r.height),a.restore(),t}(this.$refs.sourceCanvas,e,this.imageTransforms):e,i=a({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(t){return t.find((function(t){return e=t,!Number.isNaN(parseFloat(e))&&isFinite(e);var e}))},r=mt({sizeRestrictions:{minWidth:o([i.width,i.minWidth])||0,minHeight:o([i.height,i.minHeight])||0,maxWidth:o([i.width,i.maxWidth])||1/0,maxHeight:o([i.height,i.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(i.maxArea&&r.width*r.height>i.maxArea){var s=Math.sqrt(i.maxArea/(r.width*r.height));r={width:Math.round(s*r.width),height:Math.round(s*r.height)}}return function(t,e,n,i,o){t.width=i?i.width:n.width,t.height=i?i.height:n.height;var r=t.getContext("2d");r.clearRect(0,0,t.width,t.height),o&&(o.imageSmoothingEnabled&&(r.imageSmoothingEnabled=o.imageSmoothingEnabled),o.imageSmoothingQuality&&(r.imageSmoothingQuality=o.imageSmoothingQuality),o.fillColor&&(r.fillStyle=o.fillColor,r.fillRect(0,0,t.width,t.height),r.save()));var s=n.left<0?-n.left:0,a=n.top<0?-n.top:0;r.drawImage(e,n.left+s,n.top+a,n.width,n.height,s,a,t.width,t.height)}(t,n,this.coordinates,r,i),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.visibleArea&&e?function(t,e){return v(v({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,i=this.visibleArea&&e?xt(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return function(t){var e=t.coordinates,n=t.transform,i=t.imageSize,o=t.sizeRestrictions,r=t.positionRestrictions,s=t.aspectRatio,a=t.visibleArea,l=function(t,e){return gt({coordinates:t,positionRestrictions:r,event:new M({left:e.left-t.left,top:e.top-t.top})})},c=v({},e);return(Array.isArray(n)?n:[n]).forEach((function(t){var e;x((e="function"==typeof t?t({coordinates:c,imageSize:i,visibleArea:a}):t).width)&&x(e.height)||(c=function(t,e){var n=v(v(v({},t),mt({width:e.width,height:e.height,sizeRestrictions:o,aspectRatio:s})),{left:0,top:0});return l(n,{left:t.left,top:t.top})}(c,v(v({},c),e))),x(e.left)&&x(e.top)||(c=l(c,v(v({},c),e)))})),c}({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:i,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?_t:wt);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var i=[_(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,function(e){var n=e.coordinates;return a({},_(t.defaultPosition)?t.defaultPosition({coordinates:n,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&i.push.apply(i,c(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(i,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var e={cropper:n,imageSize:t.imageSize};if(_(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(e):"fit"===t.defaultBoundaries?t.boundaries=function(t){var e=t.cropper,n=t.imageSize,i=e.clientHeight,o=e.clientWidth,r=i,s=n.width*i/n.height;return s>o&&(s=o,r=n.height*o/n.width),{width:s,height:r}}(e):t.boundaries=function(t){var e=t.cropper;return{width:e.clientWidth,height:e.clientHeight}}(e),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=a(a({},this.defaultImageTransforms),{},{flip:a({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){var e,n,i,o,r;"visible-area"!==t.priority&&(t.visibleArea=null,t.resetCoordinates()),t.visibleArea=_(t.defaultVisibleArea)?t.defaultVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:"visible-area"!==t.priority?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(n=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions}).boundaries,i=e.getAreaRestrictions,o=v({},e.visibleArea),r=et(n),o.width/o.height!==r&&(o.height=o.width/r),ct(o,i({visibleArea:o,type:"move"}))),"visible-area"===t.priority?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")})).catch((function(){t.visibleArea=null}))},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")})).catch((function(){t.visibleArea=null}))},onChange:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$listeners&&this.$listeners.change&&(t&&this.debounce?this.debouncedUpdate():this.update())},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(t){if(w(t))return!1;var e=window.location,n=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[],i={protocol:n[1]||"",host:n[2]||"",port:n[3]||""},o=function(t){return t.port||("http"===(t.protocol||e.protocol)?80:433)};return!(!i.protocol&&!i.host&&!i.port||Boolean(i.protocol&&i.protocol==e.protocol&&i.host&&i.host==e.host&&i.host&&o(i)==o(e)))}(this.src)){var n=x(this.crossOrigin)?this.canvas:this.crossOrigin;!0===n&&(n="anonymous"),this.imageAttributes.crossOrigin=n}if(this.checkOrientation){var i=(t=this.src,new Promise((function(e){(function(t){return new Promise((function(e,n){try{if(t)if(/^data:/i.test(t))e(function(t){t=t.replace(/^data:([^;]+);base64,/gim,"");for(var e=atob(t),n=e.length,i=new ArrayBuffer(n),o=new Uint8Array(i),r=0;r=8&&(s=i+u)}}if(s)for(var h=n.getUint16(s,o),f=0;f1?b(n)||!w(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([i])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(t){for(var e=[],n=new Uint8Array(t);n.length>0;){var i=n.subarray(0,8192);e.push(String.fromCharCode.apply(null,Array.from?Array.from(i):i.slice())),n=n.subarray(8192)}return"data:image/jpeg;base64,"+btoa(e.join(""))}(i):this.imageAttributes.src=n,_(this.defaultTransforms)?this.appliedImageTransforms=Ft(this.defaultTransforms()):k(this.defaultTransforms)?this.appliedImageTransforms=Ft(this.defaultTransforms):this.appliedImageTransforms=function(t){var e=Ft({});if(t)switch(t){case 2:e.flip.horizontal=!0;break;case 3:e.rotate=-180;break;case 4:e.flip.vertical=!0;break;case 5:e.rotate=90,e.flip.vertical=!0;break;case 6:e.rotate=90;break;case 7:e.rotate=90,e.flip.horizontal=!0;break;case 8:e.rotate=-90}return e}(o),this.defaultImageTransforms=a(a({},this.appliedImageTransforms),{},{flip:a({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var t=e.$refs.image;t&&t.complete&&(function(t){return Boolean(t.naturalWidth)}(t)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(a(a({},e.getPublicProperties()),{},{positionRestrictions:xt(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var n=e.sizeRestrictions,i=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(a(a({},e.getPublicProperties()),{},{positionRestrictions:xt(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,i),minHeight:Math.max(n.minHeight,i)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,i=void 0!==n&&n,o=e.normalize,r=void 0===o||o;i&&this.enableTransitions();var s=function(t){var e=t.event,n=t.coordinates,i=t.visibleArea,o=t.sizeRestrictions,r=t.getAreaRestrictions,s=t.positionRestrictions,a=t.adjustStencil,l=e.scale,c=e.move,u=v({},i),h=v({},n),f=1,d=1,p=l.factor&&Math.abs(l.factor-1)>.001;u=J(u,{left:c.left||0,top:c.top||0});var m={stencil:{minimum:Math.max(o.minWidth?o.minWidth/h.width:0,o.minHeight?o.minHeight/h.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/h.width:1/0,o.maxHeight?o.maxHeight/h.height:1/0,nt(h,s))},area:{maximum:nt(u,r({visibleArea:u,type:"resize"}))}};l.factor&&p&&(l.factor<1?(d=Math.max(l.factor,m.stencil.minimum))>1&&(d=1):l.factor>1&&(d=Math.min(l.factor,Math.min(m.area.maximum,m.stencil.maximum)))<1&&(d=1)),d&&(u=tt(u,d,l.center));var g=n.left-i.left,y=i.width+i.left-(n.width+n.left),b=n.top-i.top,w=i.height+i.top-(n.height+n.top);return u=ct(u=J(u,it(u,{left:void 0!==s.left?s.left-g*d:void 0,top:void 0!==s.top?s.top-b*d:void 0,bottom:void 0!==s.bottom?s.bottom+w*d:void 0,right:void 0!==s.right?s.right+y*d:void 0})),r({visibleArea:u,type:"move"})),h.width=h.width*d,h.height=h.height*d,h.left=u.left+g*d,h.top=u.top+b*d,h=ct(h,ft(Y(u),s)),l.factor&&p&&a&&(l.factor>1?f=Math.min(m.area.maximum,l.factor)/d:l.factor<1&&(f=Math.max(h.height/u.height,h.width/u.width,l.factor/d)),1!==f&&(u=J(u=ct(u=tt(u,f,l.factor>1?l.center:Q(h)),r({visibleArea:u,type:"move"})),K(it(h,Y(u)))))),{coordinates:h,visibleArea:u}}(a(a({},this.getPublicProperties()),{},{event:r?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),l=s.visibleArea,c=s.coordinates;this.visibleArea=l,this.coordinates=c,this.runAutoZoom("manipulateImage"),this.onChange(),i&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.visibleArea,n=t.type,i=void 0===n?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:i})},getAspectRatio:function(t){var e,n,i=this.stencilProps,o=i.aspectRatio,r=i.minAspectRatio,s=i.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,n=a.maximum}if(x(e)&&(e=x(o)?r:o),x(n)&&(n=x(o)?s:o),!t&&(x(e)||x(n))){var l=this.getStencilSize(),c=l?et(l):null;x(e)&&(e=E(c)?c:void 0),x(n)&&(n=E(c)?c:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return e=(t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)}).boundaries,i=t.aspectRatio,ot(et(o=_(n=t.stencilSize)?n({boundaries:e,aspectRatio:i}):n),i)&&(o=mt({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:i.minimum,maximum:i.maximum}})),(o.width>e.width||o.height>e.height)&&(o=mt({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:et(o),maximum:et(o)}})),o;var t,e,n,i,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return a({},q)},flip:function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).transitions,i=void 0===n||n;if(!this.transitionsActive){i&&this.enableTransitions();var o=a({},this.imageTransforms.flip),r=function(t){var e=t.flip,n=t.previousFlip,i=t.rotate;t.aspectRatio;var o=t.getAreaRestrictions,r=t.coordinates,s=t.visibleArea,a=t.imageSize,l=v({},r),c=v({},s),u=n.horizontal!==e.horizontal,h=n.vertical!==e.vertical;if(u||h){var f=at({left:a.width/2,top:a.height/2},-i),d=at(Q(l),-i),p=at({left:u?f.left-(d.left-f.left):d.left,top:h?f.top-(d.top-f.top):d.top},i);l=J(l,V(p,Q(l))),d=at(Q(c),-i),c=ct(c=J(c,V(p=at({left:u?f.left-(d.left-f.left):d.left,top:h?f.top-(d.top-f.top):d.top},i),Q(c))),o({visibleArea:c,type:"move"}))}return{coordinates:l,visibleArea:c}}({flip:{horizontal:t?!o.horizontal:o.horizontal,vertical:e?!o.vertical:o.vertical},previousFlip:o,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),s=r.visibleArea,l=r.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=s,this.coordinates=l,this.onChange(),i&&this.debouncedDisableTransitions()}},rotate:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).transitions,n=void 0===e||e;if(!this.transitionsActive){n&&this.enableTransitions();var i=a({},this.imageSize);this.appliedImageTransforms.rotate+=t;var o=function(t){var e=t.aspectRatio,n=t.getAreaRestrictions,i=t.coordinates,o=t.visibleArea,r=t.sizeRestrictions,s=t.positionRestrictions,a=t.imageSize,l=t.previousImageSize,c=t.angle,u=v({},i),h=v({},o),f=at(Q(v({left:0,top:0},l)),c);return(u=v(v({},mt({sizeRestrictions:r,aspectRatio:e,width:u.width,height:u.height})),at(Q(u),c))).left-=f.left-a.width/2+u.width/2,u.top-=f.top-a.height/2+u.height/2,h=tt(h,lt(h,n({visibleArea:h,type:"resize"}))),{coordinates:u=ct(u,s),visibleArea:h=ct(h=J(h,V(Q(u),Q(i))),n({visibleArea:h,type:"move"}))}}({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:i,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),r=o.visibleArea,s=o.coordinates,l=this.processAutoZoom("rotateImage",r,s);r=l.visibleArea,s=l.coordinates,this.visibleArea=r,this.coordinates=s,this.onChange(),n&&this.debouncedDisableTransitions()}}}},Jt=P({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"cropper",class:t.classes.cropper},[n("div",{ref:"stretcher",class:t.classes.stretcher}),t._v(" "),n("div",{class:t.classes.boundaries,style:t.boundariesStyle},[n(t.backgroundWrapperComponent,{tag:"component",class:t.classes.cropperWrapper,attrs:{"wheel-resize":t.settings.resizeImage.wheel,"touch-resize":t.settings.resizeImage.touch,"touch-move":t.settings.moveImage.touch,"mouse-move":t.settings.moveImage.mouse},on:{move:t.onManipulateImage,resize:t.onManipulateImage}},[n("div",{class:t.classes.background,style:t.boundariesStyle}),t._v(" "),n("div",{class:t.classes.imageWrapper},[n("img",{ref:"image",class:t.classes.image,style:t.imageStyle,attrs:{crossorigin:t.imageAttributes.crossOrigin,src:t.imageAttributes.src},on:{mousedown:function(t){t.preventDefault()}}})]),t._v(" "),n("div",{class:t.classes.foreground,style:t.boundariesStyle}),t._v(" "),n(t.stencilComponent,t._b({directives:[{name:"show",rawName:"v-show",value:t.imageLoaded,expression:"imageLoaded"}],ref:"stencil",tag:"component",attrs:{image:t.image,coordinates:t.coordinates,"stencil-coordinates":t.stencilCoordinates,transitions:t.transitionsOptions},on:{resize:t.onResize,"resize-end":t.onResizeEnd,move:t.onMove,"move-end":t.onMoveEnd}},"component",t.stencilProps,!1)),t._v(" "),t.canvas?n("canvas",{ref:"canvas",style:{display:"none"}}):t._e(),t._v(" "),t.canvas?n("canvas",{ref:"sourceCanvas",style:{display:"none"}}):t._e()],1)],1)])},staticRenderFns:[]},void 0,Kt,void 0,!1,void 0,!1,void 0,void 0,void 0);o().component("cropper",Jt),o().component("rectangle-stencil",Yt),o().component("circle-stencil",Qt),o().component("simple-handler",At),o().component("simple-line",zt);var te=n(3379),ee=n.n(te),ne=n(9619),ie={insert:"head",singleton:!1};ee()(ne.Z,ie);ne.Z.locals;const oe={components:{Cropper:Jt},props:{width:{type:Number,required:!0},height:{type:Number,required:!0},accessToken:{type:String,required:!0},lang:{type:Object,required:!0},uploadUrl:{type:String,required:!0}},data:function(){return{isDragging:!1,image:null,saveInProgress:!1}},computed:{stencilSize:function(){var t={};return t.width=this.width,t.height=this.height,t},canvas:function(){var t={};return t.maxWidth=this.width,t.maxHeight=this.height,t}},methods:{zoomIn:function(){this.$refs.cropper.zoom(1.2)},zoomOut:function(){this.$refs.cropper.zoom(.8)},dragover:function(t){t.preventDefault(),this.isDragging=!0},dragleave:function(){this.isDragging=!1},drop:function(t){t.preventDefault(),this.$refs.file.files=t.dataTransfer.files,this.onChange(),this.isDragging=!1},onChange:function(){var t=this,e=this.$refs.file.files;if(e&&e[0]){this.image&&this.image.src&&URL.revokeObjectURL(this.image.src);var n=URL.createObjectURL(e[0]),i=new FileReader;i.onload=function(i){t.image={src:n,type:e[0].type}},i.readAsArrayBuffer(e[0])}},saveAvatar:function(){var t=this;this.saveInProgress=!0;var e=this.$refs.cropper.getResult().canvas;if(e){var n=new FormData;n.append("ccm_token",this.accessToken),e.toBlob((function(e){n.append("file",e),fetch(t.uploadUrl,{method:"POST",body:n}).then((function(){window.location.reload()}))}))}}},mounted:function(){}};var re=function(t,e,n,i,o,r,s,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}(oe,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"ccm-account-avatar-cropper"},[e("div",{staticClass:"card"},[e("div",{staticClass:"card-header"},[t._v(t._s(t.lang.header))]),t._v(" "),e("div",{staticClass:"card-body"},[t.image?[e("cropper",{ref:"cropper",attrs:{"stencil-props":{handlers:{},resizable:!1},"stencil-size":t.stencilSize,canvas:t.canvas,"image-restriction":"stencil",src:t.image.src}}),t._v(" "),e("div",{staticClass:"ccm-account-avatar-cropper-controls"},[e("a",{on:{click:t.zoomIn}},[e("svg",{attrs:{width:"24px",height:"24px",viewBox:"0 0 24 24","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"#ffffff"}},[e("path",{attrs:{d:"M8 11h3m3 0h-3m0 0V8m0 3v3M17 17l4 4M3 11a8 8 0 1016 0 8 8 0 00-16 0z",stroke:"#ffffff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),t._v(" "),e("a",{on:{click:t.zoomOut}},[e("svg",{attrs:{width:"24px",height:"24px",viewBox:"0 0 24 24","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"#ffffff"}},[e("path",{attrs:{d:"M17 17l4 4M3 11a8 8 0 1016 0 8 8 0 00-16 0zM8 11h6",stroke:"#ffffff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])])]),t._v(" "),t.image?e("div",{staticClass:"ccm-account-avatar-cropper-save"},[e("button",{staticClass:"btn btn-secondary float-start",on:{click:function(e){t.image=null}}},[t._v(t._s(t.lang.reset))]),t._v(" "),t.saveInProgress?[e("button",{staticClass:"btn btn-primary float-end",attrs:{disabled:""}},[e("span",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status","aria-hidden":"true"}}),t._v("\n "+t._s(t.lang.saveInProgress)+"\n ")])]:e("button",{staticClass:"btn btn-primary float-end",on:{click:t.saveAvatar}},[t._v(t._s(t.lang.save))])],2):t._e()]:[e("div",{class:{"ccm-account-avatar-cropper-drop":!0,"ccm-account-avatar-crop-drop-hover":t.isDragging},on:{dragover:t.dragover,dragleave:t.dragleave,drop:t.drop,click:function(e){return t.$refs.file.click()}}},[e("input",{ref:"file",attrs:{type:"file",accept:"image/*"},on:{change:t.onChange}})]),t._v(" "),e("div",{staticClass:"ccm-account-avatar-cropper-focus"},[e("div",{staticClass:"ccm-account-avatar-cropper-icon"},[e("svg",{attrs:{width:"100%",height:"100%","stroke-width":"1.5",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"#000000"}},[e("path",{attrs:{d:"M3 20.4V3.6a.6.6 0 01.6-.6h16.8a.6.6 0 01.6.6v16.8a.6.6 0 01-.6.6H3.6a.6.6 0 01-.6-.6z",stroke:"#000000","stroke-width":"1.5"}}),e("path",{attrs:{d:"M6 18h12M12 14V6m0 0l3.5 3.5M12 6L8.5 9.5",stroke:"#000000","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),t._v(" "),e("div",{staticClass:"ccm-account-avatar-cropper-text"},[t._v(t._s(t.lang.upload))])])]],2)])])}),[],!1,null,null,null);const se=re.exports;$((function(){window.Concrete.Vue.createContext("frontend",{AvatarCropper:se}),document.querySelectorAll("[data-view=account]").length&&Concrete.Vue.activateContext("frontend",(function(t,e){new t({el:"[data-view=account]",components:e.components})}))}))},8161:(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}!function(t,e){"use strict";function n(t){var n=this;t=t||{},t=e.extend({dataType:"json",type:"post",loader:"standard",error:function(t){n.error(t,n)},complete:function(){n.complete(n)},skipResponseValidation:!1},t),n.options=t,n.execute()}n.prototype={execute:function(){var t=this,n=t.options,i=n.success;n.success=function(e){t.success(e,t,i)},t.before(t),e.ajax(n)},before:function(t){t.options.loader&&e.fn.dialog.showLoader()},errorResponseToString:function(t){return n.renderErrorResponse(t,!0)},error:function(t,e){0!==t.readyState&&(ConcreteEvent.fire("AjaxRequestError",{response:t}),ConcreteAlert.dialog(ccmi18n.error,n.renderErrorResponse(t,!0)))},validateResponse:function(t,e){return t.error?(ConcreteEvent.fire("AjaxRequestError",{response:t}),ConcreteAlert.dialog(ccmi18n.error,n.renderJsonError(t),(function(){e&&e(!1,t)})),!1):(e&&e(!0,t),!0)},success:function(t,e,n){("json"!=e.options.dataType||e.options.skipResponseValidation||e.validateResponse(t))&&n&&n(t)},complete:function(t){t.options.loader&&e.fn.dialog.hideLoader()}},n.renderJsonError=function(t,n){if(!t)return"";var o=function(n,i){return"number"==typeof i&&e.isArray(t.htmlErrorIndexes)&&e.inArray(i,t.htmlErrorIndexes)>=0?n:e("
").text(n).html().replace(/\n/g,"
")},r="";if("object"===i(t.error)&&e.isArray(t.error.trace)){r='

'+o(t.error.message)+"

",r+='

'+ccmi18n.errorDetails+"

",r+='';for(var s,a=0;a";r+="
"+s.file+"("+s.line+"): "+s.class+"->"+s.function+"
"}else e.isArray(t.errors)&&t.errors.length>0&&"string"==typeof t.errors[0]?e.each(t.errors,(function(t,e){r+='

'+o(e,t)+"

"})):"string"==typeof t.error&&""!==t.error&&(r='

'+o(t.error)+"

");return r},n.renderErrorResponse=function(t,e){return n.renderJsonError(t.responseJSON,e)||t.responseText},n.validateResponse=n.prototype.validateResponse,n.errorResponseToString=n.prototype.errorResponseToString,e.concreteAjax=function(t){new n(t)},t.ConcreteAjaxRequest=n}(n.g,jQuery)},4012:()=>{!function(t,e){"use strict";t.Concrete=t.Concrete||{},t.console=t.console||{},t.ConcreteEvent=function(n){var i=e(""),o=!1,r="function"==typeof t.console.group&&"function"==typeof t.console.groupEnd,s="function"==typeof t.console.log;function a(e,n,i){r?(t.console.groupCollapsed(e),i||"function"!=typeof n?t.console.log(n):n(),t.console.groupEnd()):s&&(i||"function"!=typeof n?t.console.log(e,n):(t.console.log('Group: "'+e+'"'),n(),t.console.log('GroupEnd: "'+e+'"')))}function l(t){return t||(t=i),t instanceof e||(t=e(t)),t.length||(t=i),t}var c={debug:function(t){return void 0===t?o:o=!!t},subscribe:function(e,n,i){var r=n,s=new Error("EventStack").stack;return n=function(){o&&a("Handler Fired.",(function(){a("Type",e,!0),a("Handler",r,!0),a("Target",i,!0),a("Bound Stack",s,!0),"function"==typeof t.console.trace?t.console.trace():a("Stack",new Error("EventStack").stack)})),r.apply(this,_(arguments).toArray())},o&&a("Event Subscribed",(function(){a("Type",e,!0),a("Handler",r,!0),a("Target",i,!0),"function"==typeof t.console.trace?t.console.trace():a("Stack",new Error("EventStack").stack)})),e instanceof Array?_(e).each((function(t){c.subscribe(t,n,i)})):(l(i).bind(e.toLowerCase(),n),c)},publish:function(e,n,i){return o&&a("Event Published",(function(){a("Type",e,!0),a("Data",n,!0),a("Target",i,!0),"function"==typeof t.console.trace?t.console.trace():a("Stack",new Error("EventStack").stack)})),e instanceof Array?_(e).each((function(t){c.publish(t,n,i)})):(l(i).trigger(e.toLowerCase(),n),c)},unsubscribe:function(n,i,r){var s;return o&&a("Event Unsubscribed",(function(){a("Type",n,!0),a("Secondary Argument",i,!0),a("Target",r,!0),"function"==typeof t.console.trace?t.console.trace():a("Stack",new Error("EventStack").stack)})),s=["function"==typeof n.toLowerCase?n.toLowerCase():n],void 0!==i&&s.push(i),e.fn.unbind.apply(l(r),s),c}};return c.sub=c.bind=c.watch=c.on=c.subscribe,c.pub=c.fire=c.trigger=c.publish,c.unsub=c.unbind=c.unwatch=c.off=c.unsubscribe,n.event=c,c}(t.Concrete)}(window,jQuery)},5591:()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,n){for(var i=0;i0&&(n.filters=i.filters),$.fn.dialog.open({width:"90%",height:"75%",href:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/file/search",modal:!0,data:n,title:ccmi18n_filemanager.chooseFile,onOpen:function(e){ConcreteEvent.unsubscribe("FileManagerSelectFile"),ConcreteEvent.subscribe("FileManagerSelectFile",(function(e,n){var o=n||{};i.multipleSelection?o.fID=n.fID:o.fID=n.fID[0],$.fn.dialog.closeTop(),t(o)}))}})}},{key:"getFileDetails",value:function(t,e){$.ajax({type:"post",dataType:"json",url:CCM_DISPATCHER_FILENAME+"/ccm/system/file/get_json",data:{fID:t},error:function(t){ConcreteAlert.dialog(ccmi18n.error,t.responseText)},success:function(t){e(t)}})}}],(i=null)&&e(n.prototype,i),o&&e(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}();window.ConcreteFileManager=n},1789:()=>{(function(global,$){"use strict";function onDialogCreate(t){}function onDialogOpen(t){if(1==$(".ui-widget-overlay").length){requestAnimationFrame((function(){$(".ui-widget-overlay").get(0).classList.add("ui-widget-overlay-active")}))}if(t.parent().find(".ui-dialog-titlebar-close").addClass("btn-close btn-close-white"),$.fn.dialog.activateDialogContents(t),t.jqdialog("option","resizable")){var e=$(t.parent()),n=parseInt(e.find(".ui-dialog-buttonpane").css("z-index"));e.find(".ui-resizable-handle").css("z-index",n+1e3)}}function fixDialogButtons(t){var e=t.find(".dialog-buttons").eq(0);if(0!==e.length&&0!==$.trim(e.html()).length){var n=t.parent();0===n.find(".ui-dialog-buttonset").length&&(t.jqdialog("option","buttons",[{}]),n.find(".ui-dialog-buttonset").remove(),e.children().appendTo(n.find(".ui-dialog-buttonpane").empty()))}}$.widget("concrete.dialog",$.ui.dialog,{_allowInteraction:function(t){return!!$(t.target).closest(".ccm-interaction-dialog").length||!!$(t.target).closest(".cke_dialog").length||this._super(t)}}),$.widget.bridge("jqdialog",$.concrete.dialog),$.fn.dialog=function(){switch(arguments.length){case 0:if($(this).is("div"))return void $(this).jqdialog();break;case 1:var t=arguments[0];if($.isPlainObject(t)){var e=t.open||null,n=t.create||null;t.create=function(t){onDialogCreate($(this)),n&&n.call(this)},t.dialogClass="ccm-ui",t.open=function(t,n){onDialogOpen($(this)),e&&e.call(this,t,n)}}return void $.fn.jqdialog.call($(this),t);default:return void $.fn.jqdialog.apply($(this),arguments)}return $(this).each((function(){$(this).unbind("click.make-dialog").bind("click.make-dialog",(function(t){if(t.preventDefault(),!$(this).hasClass("ccm-dialog-launching")){$(this).addClass("ccm-dialog-launching");var e=$(this).attr("href"),n=$(this).attr("dialog-width"),i=$(this).attr("dialog-height"),o=$(this).attr("dialog-title"),r=$(this).attr("dialog-on-open"),s=$(this).attr("dialog-class"),a={modal:!0,href:e,width:n,height:i,title:o,onOpen:r,onDestroy:$(this).attr("dialog-on-destroy"),dialogClass:s,onClose:$(this).attr("dialog-on-close"),onDirectClose:$(this).attr("dialog-on-direct-close"),launcher:$(this)};$.fn.dialog.open(a)}}))}))},$.fn.dialog.close=function(t){t++,$("#ccm-dialog-content"+t).jqdialog("close")},$.fn.dialog.open=function(options){if("undefined"!=typeof ConcreteMenu){var activeMenu=ConcreteMenuManager.getActiveMenu();activeMenu&&activeMenu.hide()}var w,h;"string"==typeof options.width?"auto"==options.width?w="auto":options.width.indexOf("%",0)>0?(w=options.width.replace("%",""),w=$(window).width()*(w/100),w+=50):w=parseInt(options.width)+50:w=options.width?parseInt(options.width)+50:550,"string"==typeof options.height?"auto"==options.height?h="auto":options.height.indexOf("%",0)>0?(h=options.height.replace("%",""),h=$(window).height()*(h/100),h+=100):h=parseInt(options.height)+100:h=options.height?parseInt(options.height)+100:400,"auto"!==h&&h>$(window).height()&&(h=$(window).height()),options.width=w,options.height=h;var defaults={modal:!0,escapeClose:!0,width:w,height:h,type:"GET",dialogClass:"ccm-ui",resizable:!0,create:function(){onDialogCreate($(this))},open:function open(){var $dialog=$(this);onDialogOpen($dialog),void 0!==options.onOpen&&("function"==typeof options.onOpen?options.onOpen($dialog):eval(options.onOpen)),options.launcher&&options.launcher.removeClass("ccm-dialog-launching")},beforeClose:function(){1==$(".ui-dialog:visible").length&&$("body").css("overflow",$("body").attr("data-last-overflow"))},close:function close(ev,u){options.element||$(this).jqdialog("destroy").remove(),void 0!==options.onClose&&("function"==typeof options.onClose?options.onClose($(this)):eval(options.onClose)),void 0===options.onDirectClose||!ev.handleObj||"keydown"!=ev.handleObj.type&&"click"!=ev.handleObj.type||("function"==typeof options.onDirectClose?options.onDirectClose():eval(options.onDirectClose)),void 0!==options.onDestroy&&("function"==typeof options.onDestroy?options.onDestroy():eval(options.onDestroy))}},finalSettings={autoOpen:!1,data:{}};$.extend(finalSettings,defaults,options),finalSettings.element?($(finalSettings.element).jqdialog(finalSettings).jqdialog(),$(finalSettings.element).jqdialog("open")):($.fn.dialog.showLoader(),$.ajax({type:finalSettings.type,url:finalSettings.href,data:finalSettings.data,success:function(t){$.fn.dialog.hideLoader(),$("
").jqdialog(finalSettings).html(t).jqdialog("open")},error:function(t,e,n){$.fn.dialog.hideLoader(),ConcreteAlert.dialog(ccmi18n.error,ConcreteAjaxRequest.renderErrorResponse(t,!0))}}))},$.fn.dialog.activateDialogContents=function(t){setTimeout((function(){if(t.find("button[data-dialog-action=cancel]").on("click",(function(){$.fn.dialog.closeTop()})),t.find("[data-dialog-form]").each((function(){var t=$(this),e={};"progressive"==t.attr("data-dialog-form-processing")&&(e.progressiveOperation=!0,e.progressiveOperationElement="div[data-dialog-form-element=progress-bar]"),t.concreteAjaxForm(e)})),t.find("button[data-dialog-action=submit]").on("click",(function(){t.find("[data-dialog-form]").submit()})),fixDialogButtons(t),t.find(".dialog-launch").dialog(),t.find("[data-vue]").each((function(){$(this).concreteVue({context:$(this).attr("data-vue")})})),t.find(".ccm-dialog-close").on("click",(function(){t.dialog("close")})),[].slice.call(t.find(".launch-tooltip")).map((function(t){return new bootstrap.Tooltip(t,{container:"#ccm-tooltip-holder"})})),t.find(".dialog-help").length>0){t.find(".dialog-help").hide();var e=t.find(".dialog-help").html();ccmi18n.helpPopup?ccmi18n.helpPopup:"Help";var n=$(''),i=$("#ccm-tooltip-holder");n.insertBefore(t.parent().find(".ui-dialog-titlebar-close")),n.popover({content:function(){return e},placement:"bottom",html:!0,container:i,trigger:"click"}),n.on("shown.bs.popover",(function(){var t=function(){n.popover("hide",n),t=$.noop};n.on("hide.bs.popover",(function(e){n.unbind(e),t=$.noop})),$("body").mousedown((function(e){$(e.target).closest(i).length||$(e.target).closest(n).length||($(this).unbind(e),t())}))}))}}),10)},$.fn.dialog.getTop=function(){var t=$(".ui-dialog:visible").length;return $($(".ui-dialog:visible")[t-1]).find(".ui-dialog-content")},$.fn.dialog.replaceTop=function(t){var e=$.fn.dialog.getTop();e.html(t),$.fn.dialog.activateDialogContents(e)},$.fn.dialog.showLoader=function(t){NProgress.start()},$.fn.dialog.hideLoader=function(){NProgress.done()},$.fn.dialog.closeTop=function(){$.fn.dialog.getTop().jqdialog("close")},$.fn.dialog.closeAll=function(){$($(".ui-dialog-content").get().reverse()).jqdialog("close")},$.ui.dialog.prototype._focusTabbable=$.noop})(window,jQuery)},8465:(t,e,n)=>{"use strict";var i={};n.r(i),n.d(i,{VERSION:()=>r,after:()=>je,all:()=>rn,allKeys:()=>wt,any:()=>sn,assign:()=>jt,before:()=>Le,bind:()=>Ee,bindAll:()=>$e,chain:()=>xe,chunk:()=>Bn,clone:()=>Wt,collect:()=>Ke,compact:()=>Rn,compose:()=>Fe,constant:()=>et,contains:()=>an,countBy:()=>kn,create:()=>Nt,debounce:()=>Pe,default:()=>Yn,defaults:()=>Lt,defer:()=>Me,delay:()=>Oe,detect:()=>Qe,difference:()=>In,drop:()=>On,each:()=>Ze,escape:()=>ue,every:()=>rn,extend:()=>Ft,extendOwn:()=>jt,filter:()=>nn,find:()=>Qe,findIndex:()=>Ue,findKey:()=>Ne,findLastIndex:()=>Be,findWhere:()=>Ge,first:()=>zn,flatten:()=>Pn,foldl:()=>tn,foldr:()=>en,forEach:()=>Ze,functions:()=>It,get:()=>Yt,groupBy:()=>_n,has:()=>Vt,head:()=>zn,identity:()=>Qt,include:()=>an,includes:()=>an,indexBy:()=>xn,indexOf:()=>Ye,initial:()=>$n,inject:()=>tn,intersection:()=>Ln,invert:()=>Pt,invoke:()=>ln,isArguments:()=>K,isArray:()=>Q,isArrayBuffer:()=>L,isBoolean:()=>z,isDataView:()=>V,isDate:()=>I,isElement:()=>O,isEmpty:()=>ht,isEqual:()=>bt,isError:()=>F,isFinite:()=>J,isFunction:()=>U,isMap:()=>Tt,isMatch:()=>ft,isNaN:()=>tt,isNull:()=>T,isNumber:()=>P,isObject:()=>A,isRegExp:()=>D,isSet:()=>zt,isString:()=>R,isSymbol:()=>j,isTypedArray:()=>at,isUndefined:()=>$,isWeakMap:()=>$t,isWeakSet:()=>Ot,iteratee:()=>te,keys:()=>ut,last:()=>Mn,lastIndexOf:()=>Ve,map:()=>Ke,mapObject:()=>ne,matcher:()=>Gt,matches:()=>Gt,max:()=>fn,memoize:()=>ze,methods:()=>It,min:()=>pn,mixin:()=>Xn,negate:()=>De,noop:()=>ie,now:()=>ae,object:()=>Wn,omit:()=>Tn,once:()=>He,pairs:()=>Rt,partial:()=>Ce,partition:()=>Sn,pick:()=>An,pluck:()=>cn,property:()=>Zt,propertyOf:()=>oe,random:()=>se,range:()=>Un,reduce:()=>tn,reduceRight:()=>en,reject:()=>on,rest:()=>On,restArguments:()=>C,result:()=>be,sample:()=>vn,select:()=>nn,shuffle:()=>yn,size:()=>Cn,some:()=>sn,sortBy:()=>bn,sortedIndex:()=>qe,tail:()=>On,take:()=>zn,tap:()=>Ut,template:()=>ye,templateSettings:()=>fe,throttle:()=>Re,times:()=>re,toArray:()=>gn,toPath:()=>Bt,transpose:()=>Hn,unescape:()=>he,union:()=>jn,uniq:()=>Fn,unique:()=>Fn,uniqueId:()=>_e,unzip:()=>Hn,values:()=>Mt,where:()=>un,without:()=>Dn,wrap:()=>Ie,zip:()=>Nn});n(4012);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var r="1.13.6",s="object"==("undefined"==typeof self?"undefined":o(self))&&self.self===self&&self||"object"==("undefined"==typeof global?"undefined":o(global))&&global.global===global&&global||Function("return this")()||{},a=Array.prototype,l=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,u=a.push,h=a.slice,f=l.toString,d=l.hasOwnProperty,p="undefined"!=typeof ArrayBuffer,m="undefined"!=typeof DataView,g=Array.isArray,v=Object.keys,y=Object.create,b=p&&ArrayBuffer.isView,w=isNaN,_=isFinite,x=!{toString:null}.propertyIsEnumerable("toString"),k=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],S=Math.pow(2,53)-1;function C(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),i=Array(n),o=0;o=0&&n<=S}}function it(t){return function(e){return null==e?void 0:e[t]}}const ot=it("byteLength"),rt=nt(ot);var st=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const at=p?function(t){return b?b(t)&&!V(t):rt(t)&&st.test(f.call(t))}:et(!1),lt=it("length");function ct(t,e){e=function(t){for(var e={},n=t.length,i=0;i":">",'"':""","'":"'","`":"`"},ue=le(ce),he=le(Pt(ce)),fe=dt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var de=/(.)^/,pe={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},me=/\\|'|\r|\n|\u2028|\u2029/g;function ge(t){return"\\"+pe[t]}var ve=/^\s*(\w|\$)+\s*$/;function ye(t,e,n){!e&&n&&(e=n),e=Lt({},e,dt.templateSettings);var i=RegExp([(e.escape||de).source,(e.interpolate||de).source,(e.evaluate||de).source].join("|")+"|$","g"),o=0,r="__p+='";t.replace(i,(function(e,n,i,s,a){return r+=t.slice(o,a).replace(me,ge),o=a+e.length,n?r+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?r+="'+\n((__t=("+i+"))==null?'':__t)+\n'":s&&(r+="';\n"+s+"\n__p+='"),e})),r+="';\n";var s,a=e.variable;if(a){if(!ve.test(a))throw new Error("variable is not a bare identifier: "+a)}else r="with(obj||{}){\n"+r+"}\n",a="obj";r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";try{s=new Function(a,"_",r)}catch(t){throw t.source=r,t}var l=function(t){return s.call(this,t,dt)};return l.source="function("+a+"){\n"+r+"}",l}function be(t,e,n){var i=(e=qt(e)).length;if(!i)return U(n)?n.call(t):n;for(var o=0;o1)Te(a,e-1,n,i),o=i.length;else for(var l=0,c=a.length;le?(i&&(clearTimeout(i),i=null),a=c,s=t.apply(o,r),i||(o=r=null)):i||!1===n.trailing||(i=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(i),a=0,i=o=r=null},c}function Pe(t,e,n){var i,o,r,s,a,l=function l(){var c=ae()-o;e>c?i=setTimeout(l,e-c):(i=null,n||(s=t.apply(a,r)),i||(r=a=null))},c=C((function(c){return a=this,r=c,o=ae(),i||(i=setTimeout(l,e),n&&(s=t.apply(a,r))),s}));return c.cancel=function(){clearTimeout(i),i=r=a=null},c}function Ie(t,e){return Ce(e,t)}function De(t){return function(){return!t.apply(this,arguments)}}function Fe(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}}function je(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Le(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const He=Ce(Le,2);function Ne(t,e,n){e=ee(e,n);for(var i,o=ut(t),r=0,s=o.length;r0?0:o-1;r>=0&&r0?s=r>=0?r:Math.max(r+a,s):a=r>=0?Math.min(r+1,a):r+a+1;else if(n&&r&&a)return i[r=n(i,o)]===o?r:-1;if(o!=o)return(r=e(h.call(i,s,a),tt))>=0?r+s:-1;for(r=t>0?s:a-1;r>=0&&r0?0:s-1;for(o||(i=e[r?r[a]:a],a+=t);a>=0&&a=3;return e(t,Kt(n,o,4),i,r)}}const tn=Je(1),en=Je(-1);function nn(t,e,n){var i=[];return e=ee(e,n),Ze(t,(function(t,n,o){e(t,n,o)&&i.push(t)})),i}function on(t,e,n){return nn(t,De(ee(e)),n)}function rn(t,e,n){e=ee(e,n);for(var i=!Ae(t)&&ut(t),o=(i||t).length,r=0;r=0}const ln=C((function(t,e,n){var i,o;return U(e)?o=e:(e=qt(e),i=e.slice(0,-1),e=e[e.length-1]),Ke(t,(function(t){var r=o;if(!r){if(i&&i.length&&(t=Xt(t,i)),null==t)return;r=t[e]}return null==r?r:r.apply(t,n)}))}));function cn(t,e){return Ke(t,Zt(e))}function un(t,e){return nn(t,Gt(e))}function hn(t){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(t)}function fn(t,e,n){var i,o,r=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=hn(t[0])&&null!=t)for(var a=0,l=(t=Ae(t)?t:Mt(t)).length;ar&&(r=i);else e=ee(e,n),Ze(t,(function(t,n,i){((o=e(t,n,i))>s||o===-1/0&&r===-1/0)&&(r=t,s=o)}));return r}function dn(t){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(t)}function pn(t,e,n){var i,o,r=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=dn(t[0])&&null!=t)for(var a=0,l=(t=Ae(t)?t:Mt(t)).length;ai||void 0===n)return 1;if(n1&&(i=Kt(i,e[1])),e=wt(t)):(i=En,e=Te(e,!1,!1),t=Object(t));for(var o=0,r=e.length;o1&&(n=e[1])):(e=Ke(Te(e,!1,!1),String),i=function(t,n){return!an(e,n)}),An(t,i,n)}));function $n(t,e,n){return h.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function zn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:$n(t,t.length-e)}function On(t,e,n){return h.call(t,null==e||n?1:e)}function Mn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:On(t,Math.max(0,t.length-e))}function Rn(t){return nn(t,Boolean)}function Pn(t,e){return Te(t,e,!1)}const In=C((function(t,e){return e=Te(e,!0,!0),nn(t,(function(t){return!an(e,t)}))})),Dn=C((function(t,e){return In(t,e)}));function Fn(t,e,n,i){z(e)||(i=n,n=e,e=!1),null!=n&&(n=ee(n,i));for(var o=[],r=[],s=0,a=lt(t);s");e("").appendTo(n).text(t.getName()).click((function(){ConcreteEvent.fire("ConversationMentionSelect",{obj:o,item:t},i)})),n.appendTo(o.dropdown.list)})),o.dropdown.active||(o.dropdown.active=!0,o.dropdown.activeItem=-1,o.dropdown.parent.appendTo(o.$element),o.dropdown.handle.dropdown("toggle")),o.dropdown.activeItem>=0&&o.dropdown.list.children().eq(o.dropdown.activeItem).addClass("active")}},attachSubscriptionBindings:function(){e("a[data-conversation-subscribe]").magnificPopup({type:"ajax",callbacks:{updateStatus:function(t){if("ready"==t.status){var n=e("form[data-conversation-form=subscribe]");e("button").on("click",n,(function(t){t.preventDefault(),t.stopPropagation(),e.ajax({url:n.attr("action"),dataType:"json",success:function(t){t.subscribed?(e("[data-conversation-subscribe=subscribe]").hide(),e("[data-conversation-subscribe=unsubscribe]").show()):(e("[data-conversation-subscribe=unsubscribe]").hide(),e("[data-conversation-subscribe=subscribe]").show()),e.magnificPopup.close()}})}))}},beforeOpen:function(){this.st.mainClass="mfp-zoom-in"}},closeOnContentClick:!0,midClick:!0})},attachBindings:function(){var t=this;t.$element.unbind(".cnv"),t.options.uninitialized&&(t.options.uninitialized=!1,ConcreteEvent.bind("ConversationMention",(function(e,n){t.mentionList(n.items,n.coordinates||!1,n.bindTo||t.$element.get(0))}),t.$element.get(0)),t.dropdown={},t.dropdown.parent=e("
").css({position:"absolute",height:0,width:0}),t.dropdown.active=!1,t.dropdown.handle=e("").appendTo(t.dropdown.parent),t.dropdown.list=e("
    ").addClass("dropdown-menu").appendTo(t.dropdown.parent),t.dropdown.handle.dropdown(),ConcreteEvent.bind("ConversationTextareaKeydownUp",(function(e){-1==t.dropdown.activeItem&&(t.dropdown.activeItem=t.dropdown.list.children().length),t.dropdown.activeItem-=1,t.dropdown.activeItem+=t.dropdown.list.children().length,t.dropdown.activeItem%=t.dropdown.list.children().length,t.dropdown.list.children().filter(".active").removeClass("active").end().eq(t.dropdown.activeItem).addClass("active")}),t.$element.get(0)),ConcreteEvent.bind("ConversationTextareaKeydownDown",(function(e){t.dropdown.activeItem+=1,t.dropdown.activeItem+=t.dropdown.list.children().length,t.dropdown.activeItem%=t.dropdown.list.children().length,t.dropdown.list.children().filter(".active").removeClass("active").end().eq(t.dropdown.activeItem).addClass("active")}),t.$element.get(0)),ConcreteEvent.bind("ConversationTextareaKeydownEnter",(function(e){t.dropdown.list.children().filter(".active").children("a").click()}),t.$element.get(0)),ConcreteEvent.bind("ConversationPostError",(function(t,n){var i=n.form,o=n.messages,r="";e.each(o,(function(t,e){r+=e+"
    "})),i.find("div.ccm-conversation-errors").html(r).show()})),ConcreteEvent.bind("ConversationSubmitForm",(function(t,e){e.form.find("div.ccm-conversation-errors").hide()})));var i=t.options.paginate?1:0,o=""!=t.options.addMessageToken?1:0,r=t.options.addMessageLabel?t.options.addMessageLabel:"";t.$replyholder=t.$element.find("div.ccm-conversation-add-reply"),t.$newmessageform=t.$element.find("div.ccm-conversation-add-new-message form"),t.$deleteholder=t.$element.find("div.ccm-conversation-delete-message"),t.$attachmentdeleteholder=t.$element.find("div.ccm-conversation-delete-attachment"),t.$permalinkholder=t.$element.find("div.ccm-conversation-message-permalink"),t.$messagelist=t.$element.find("div.ccm-conversation-message-list"),t.$messagecnt=t.$element.find(".ccm-conversation-message-count"),t.$postbuttons=t.$element.find("[data-submit=conversation-message]"),t.$sortselect=t.$element.find("select[data-sort=conversation-message-list]"),t.$loadmore=t.$element.find("[data-load-page=conversation-message-list]"),t.$messages=t.$element.find(".ccm-conversation-messages"),t.$messagerating=t.$element.find("span.ccm-conversation-message-rating"),t.$element.on("click.cnv","[data-submit=conversation-message]",(function(n){n.preventDefault(),t.submitForm(e(this))})),t.$element.on("click.cnv","[data-submit=update-conversation-message]",(function(){return t.submitUpdateForm(e(this)),!1})),this.attachSubscriptionBindings();var s=1;t.$element.on("click.cnv","a[data-toggle=conversation-reply]",(function(n){n.preventDefault(),e(".ccm-conversation-attachment-container").each((function(){e(this).is(":visible")&&e(this).toggle()}));var i=t.$replyholder.appendTo(e(this).closest("[data-conversation-message-id]"));return i.attr("data-form","conversation-reply").show(),i.find("[data-submit=conversation-message]").attr("data-post-parent-id",e(this).attr("data-post-parent-id")),i.attr("rel","new-reply"+s),s++,!1})),e(".ccm-conversation-attachment-container").hide(),e(".ccm-conversation-add-new-message .ccm-conversation-attachment-toggle").off("click.cnv").on("click.cnv",(function(t){t.preventDefault(),e(".ccm-conversation-add-reply .ccm-conversation-attachment-container").is(":visible")&&e(".ccm-conversation-add-reply .ccm-conversation-attachment-container").toggle(),e(".ccm-conversation-add-new-message .ccm-conversation-attachment-container").toggle()})),e(".ccm-conversation-add-reply .ccm-conversation-attachment-toggle").off("click.cnv").on("click.cnv",(function(t){t.preventDefault(),e(".ccm-conversation-add-new-message .ccm-conversation-attachment-container").is(":visible")&&e(".ccm-conversation-add-new-message .ccm-conversation-attachment-container").toggle(),e(".ccm-conversation-add-reply .ccm-conversation-attachment-container").toggle()})),t.$element.on("click.cnv","a[data-submit=delete-conversation-message]",(function(){var i=e(this);return t.$deletedialog=t.$deleteholder.clone(),t.$deletedialog.dialog?t.$deletedialog.dialog({modal:!0,dialogClass:"ccm-conversation-dialog",title:t.$deleteholder.attr("data-dialog-title"),buttons:[{text:t.$deleteholder.attr("data-cancel-button-title"),class:"btn pull-left",click:function(){t.$deletedialog.dialog("close")}},{text:t.$deleteholder.attr("data-confirm-button-title"),class:"btn pull-right btn-danger",click:function(){t.deleteMessage(i.attr("data-conversation-message-id"))}}]}):window.confirm(n.Confirm_remove_message)&&t.deleteMessage(i.attr("data-conversation-message-id")),!1})),t.$element.on("click.cnv","a[data-submit=flag-conversation-message]",(function(){var i=e(this);return window.confirm(n.Confirm_mark_as_spam)&&t.flagMessage(i.attr("data-conversation-message-id")),!1})),t.$element.on("click.cnv","a[data-load=edit-conversation-message]",(function(){if(e(".ccm-conversation-edit-message").is(":visible"))return window.alert(n.Warn_currently_editing),!1;var i=e(this);t.editMessage(i.attr("data-conversation-message-id"))})),t.$element.on("change.cnv","select[data-sort=conversation-message-list]",(function(){t.$messagelist.load(CCM_DISPATCHER_FILENAME+"/ccm/frontend/conversations/view_ajax",{cnvID:t.options.cnvID,task:"get_messages",cID:t.options.cID,blockID:t.options.blockID,enablePosting:o,displayMode:t.options.displayMode,itemsPerPage:t.options.itemsPerPage,paginate:i,addMessageLabel:r,orderBy:e(this).val(),enableOrdering:t.options.enableOrdering,displayPostingForm:t.options.displayPostingForm,enableCommentRating:t.options.enableCommentRating,enableTopCommentReviews:t.options.enableTopCommentReviews,displaySocialLinks:t.options.displaySocialLinks,dateFormat:t.options.dateFormat,customDateFormat:t.options.customDateFormat,blockAreaHandle:t.options.blockAreaHandle,attachmentsEnabled:t.options.attachmentsEnabled,attachmentOverridesEnabled:t.options.attachmentOverridesEnabled},(function(n){t.$replyholder.appendTo(t.$element),e(".ccm-conversation-messages .dropdown-toggle").dropdown(),t.attachBindings()}))})),t.$element.on("click.cnv",".image-popover-hover",(function(){e.magnificPopup.open({items:{src:e(this).attr("data-full-image"),type:"image",verticalFit:!0}})})),t.$element.on("click.cnv","[data-load-page=conversation-message-list]",(function(){var n=parseInt(t.$loadmore.attr("data-next-page")),i=parseInt(t.$loadmore.attr("data-total-pages")),s=t.$sortselect.length?t.$sortselect.val():t.options.orderBy,a={cnvID:t.options.cnvID,cID:t.options.cID,blockID:t.options.blockID,itemsPerPage:t.options.itemsPerPage,displayMode:t.options.displayMode,blockAreaHandle:t.options.blockAreaHandle,enablePosting:o,addMessageLabel:r,page:n,orderBy:s,enableCommentRating:t.options.enableCommentRating,enableTopCommentReviews:t.options.enableTopCommentReviews,displaySocialLinks:t.options.displaySocialLinks,dateFormat:t.options.dateFormat,customDateFormat:t.options.customDateFormat,attachmentsEnabled:t.options.attachmentsEnabled,attachmentOverridesEnabled:t.options.attachmentOverridesEnabled};e.ajax({type:"post",data:a,url:CCM_DISPATCHER_FILENAME+"/ccm/frontend/conversations/message_page",success:function(o){t.$messages.append(o),e(".ccm-conversation-messages .dropdown-toggle").dropdown(),n+1>i?t.$loadmore.hide():t.$loadmore.attr("data-next-page",n+1)}})})),t.$element.on("click.cnv",".conversation-rate-message",(function(){var n=e(this).closest("[data-conversation-message-id]").attr("data-conversation-message-id"),i=e(this).attr("data-conversation-rating-type");t.$messagerating.load(CCM_DISPATCHER_FILENAME+"/ccm/frontend/conversations/rate");var o={cnvID:t.options.cnvID,cID:t.options.cID,blockID:t.options.blockID,cnvMessageID:n,cnvRatingTypeHandle:i};e.ajax({type:"post",data:o,url:CCM_DISPATCHER_FILENAME+"/ccm/frontend/conversations/rate",success:function(t){e('span[data-message-rating="'+n+'"]').load(CCM_DISPATCHER_FILENAME+"/ccm/frontend/conversations/get_rating",{cnvMessageID:n})}})})),t.$element.on("click.cnv","a.share-popup",(function(){var t=null!=window.screenLeft?window.screenLeft:window.screen.left,n=null!=window.screenTop?window.screenTop:window.screen.top,i=(window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width)/2-300+t,o=(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height)/2-125+n;return window.open(e(this).attr("href"),"cnvSocialShare","left:"+i+",top:"+o+",height=250,width=600,toolbar=no,status=no"),!1})),t.$element.on("click.cnv","a.share-permalink",(function(){var n=e(this).attr("rel");t.$permalinkdialog=t.$permalinkholder.clone();var i=e("