1
0
Fork 0
pixelfed/public/js/story-compose.js

1 line
69 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{20:function(t,e,n){t.exports=n("spWN")},"3VoG":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"/*!\n * Cropper.js v1.5.6\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2019-10-04T04:33:44.164Z\n */\n\n.cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cropper-container img {\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n}\n\n.cropper-wrap-box,\n.cropper-canvas,\n.cropper-drag-box,\n.cropper-crop-box,\n.cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.cropper-wrap-box,\n.cropper-canvas {\n overflow: hidden;\n}\n\n.cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n}\n\n.cropper-modal {\n background-color: #000;\n opacity: 0.5;\n}\n\n.cropper-view-box {\n display: block;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n overflow: hidden;\n width: 100%;\n}\n\n.cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: 0.5;\n position: absolute;\n}\n\n.cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: calc(100% / 3);\n left: 0;\n top: calc(100% / 3);\n width: 100%;\n}\n\n.cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: calc(100% / 3);\n top: 0;\n width: calc(100% / 3);\n}\n\n.cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: 0.75;\n position: absolute;\n top: 50%;\n width: 0;\n}\n\n.cropper-center::before,\n.cropper-center::after {\n background-color: #eee;\n content: ' ';\n display: block;\n position: absolute;\n}\n\n.cropper-center::before {\n height: 1px;\n left: -3px;\n top: 0;\n width: 7px;\n}\n\n.cropper-center::after {\n height: 7px;\n left: 0;\n top: -3px;\n width: 1px;\n}\n\n.cropper-face,\n.cropper-line,\n.cropper-point {\n display: block;\n height: 100%;\n opacity: 0.1;\n position: absolute;\n width: 100%;\n}\n\n.cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n}\n\n.cropper-line {\n background-color: #39f;\n}\n\n.cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n}\n\n.cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n}\n\n.cropper-point {\n background-color: #39f;\n height: 5px;\n opacity: 0.75;\n width: 5px;\n}\n\n.cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -3px;\n right: -3px;\n top: 50%;\n}\n\n.cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-w {\n cursor: ew-resize;\n left: -3px;\n margin-top: -3px;\n top: 50%;\n}\n\n.cropper-point.point-s {\n bottom: -3px;\n cursor: s-resize;\n left: 50%;\n margin-left: -3px;\n}\n\n.cropper-point.point-ne {\n cursor: nesw-resize;\n right: -3px;\n top: -3px;\n}\n\n.cropper-point.point-nw {\n cursor: nwse-resize;\n left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-sw {\n bottom: -3px;\n cursor: nesw-resize;\n left: -3px;\n}\n\n.cropper-point.point-se {\n bottom: -3px;\n cursor: nwse-resize;\n height: 20px;\n opacity: 1;\n right: -3px;\n width: 20px;\n}\n\n@media (min-width: 768px) {\n .cropper-point.point-se {\n height: 15px;\n width: 15px;\n }\n}\n\n@media (min-width: 992px) {\n .cropper-point.point-se {\n height: 10px;\n width: 10px;\n }\n}\n\n@media (min-width: 1200px) {\n .cropper-point.point-se {\n height: 5px;\n opacity: 0.75;\n width: 5px;\n }\n}\n\n.cropper-point.point-se::before {\n background-color: #39f;\n bottom: -50%;\n content: ' ';\n display: block;\n height: 200%;\n opacity: 0;\n position: absolute;\n right: -50%;\n width: 200%;\n}\n\n.cropper-invisible {\n opacity: 0;\n}\n\n.cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n}\n\n.cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n\n.cropper-hidden {\n display: none !important;\n}\n\n.cropper-move {\n cursor: move;\n}\n\n.cropper-crop {\n cursor: crosshair;\n}\n\n.cropper-disabled .cropper-drag-box,\n.cropper-disabled .cropper-face,\n.cropper-disabled .cropper-line,\n.cropper-disabled .cropper-point {\n cursor: not-allowed;\n}\n",""])},"4Toj":function(t,e,n){var i=n("54Wo");t.exports=function(t,e){var n=i(t,e)/1e3;return n>0?Math.floor(n):Math.ceil(n)}},"54Wo":function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return n.getTime()-r.getTime()}},"6DAA":function(t,e,n){var i=n("kOWh");t.exports=function(){var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],s=["am","pm"],h=["a.m.","p.m."],c={MMM:function(e){return t[e.getMonth()]},MMMM:function(t){return e[t.getMonth()]},dd:function(t){return n[t.getDay()]},ddd:function(t){return r[t.getDay()]},dddd:function(t){return a[t.getDay()]},A:function(t){return t.getHours()/12>=1?o[1]:o[0]},a:function(t){return t.getHours()/12>=1?s[1]:s[0]},aa:function(t){return t.getHours()/12>=1?h[1]:h[0]}};return["M","D","DDD","d","Q","W"].forEach((function(t){c[t+"o"]=function(e,n){return function(t){var e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"}(n[t](e))}})),{formatters:c,formattingTokensRegExp:i(c)}}},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var r,a=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?t:(r=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:i+a.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}},DT56:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return n<r?-1:n>r?1:0}},F809:function(t,e,n){var i=n("yNUO"),r=n("sunR"),a=n("DT56");t.exports=function(t,e){var n=i(t),o=i(e),s=a(n,o),h=Math.abs(r(n,o));return n.setMonth(n.getMonth()-s*h),s*(h-(a(n,o)===-s))}},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(o=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[n].concat(a).concat([r]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},r=0;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(i[a]=!0)}for(r=0;r<t.length;r++){var o=t[r];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),e.push(o))}},e}},"KHd+":function(t,e,n){"use strict";function i(t,e,n,i,r,a,o,s){var h,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),o?(h=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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):r&&(h=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),h)if(c.functional){c._injectStyles=h;var p=c.render;c.render=function(t,e){return h.call(e),p(t,e)}}else{var l=c.beforeCreate;c.beforeCreate=l?[].concat(l,h):[h]}return{exports:t,options:c}}n.d(e,"a",(function(){return i}))},LZbM:function(t,e){t.exports=function(){var t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(e,n,i){var r;return i=i||{},r="string"==typeof t[e]?t[e]:1===n?t[e].one:t[e].other.replace("{{count}}",n),i.addSuffix?i.comparison>0?"in "+r:r+" ago":r}}}},NmtT:function(t,e,n){var i=n("yHON"),r=n("yNUO"),a=n("4Toj"),o=n("F809"),s=n("Us+F");t.exports=function(t,e,n){var h=n||{},c=i(t,e),p=h.locale,l=s.distanceInWords.localize;p&&p.distanceInWords&&p.distanceInWords.localize&&(l=p.distanceInWords.localize);var d,u,f={addSuffix:Boolean(h.addSuffix),comparison:c};c>0?(d=r(t),u=r(e)):(d=r(e),u=r(t));var m,g=a(u,d),v=u.getTimezoneOffset()-d.getTimezoneOffset(),b=Math.round(g/60)-v;if(b<2)return h.includeSeconds?g<5?l("lessThanXSeconds",5,f):g<10?l("lessThanXSeconds",10,f):g<20?l("lessThanXSeconds",20,f):g<40?l("halfAMinute",null,f):l(g<60?"lessThanXMinutes":"xMinutes",1,f):0===b?l("lessThanXMinutes",1,f):l("xMinutes",b,f);if(b<45)return l("xMinutes",b,f);if(b<90)return l("aboutXHours",1,f);if(b<1440)return l("aboutXHours",Math.round(b/60),f);if(b<2520)return l("xDays",1,f);if(b<43200)return l("xDays",Math.round(b/1440),f);if(b<86400)return l("aboutXMonths",m=Math.round(b/43200),f);if((m=o(u,d))<12)return l("xMonths",Math.round(b/43200),f);var w=m%12,x=Math.floor(m/12);return w<3?l("aboutXYears",x,f):w<9?l("overXYears",x,f):l("almostXYears",x+1,f)}},TP5S:function(t,e,n){"use strict";n.r(e);var i=n("hoI+"),r=n("lcPr"),a=n.n(r),o=(n("YQfW"),{components:{VueCropper:a.a,VueTimeago:i.a},props:["profile-id"],data:function(){return{loaded:!1,config:window.App.config,mimes:["image/jpeg","image/png"],page:"landing",pages:["landing","crop","edit","confirm","error","uploading"],uploading:!1,uploadProgress:0,cropper:{aspectRatio:9/16,viewMode:1,zoomable:!0,zoom:null},mediaUrl:null,stories:[],lightboxMedia:!1}},mounted:function(){var t=this;this.mediaWatcher(),axios.get("/api/stories/v0/fetch/"+this.profileId).then((function(e){t.stories=e.data,t.loaded=!0}))},methods:{upload:function(){$('.file-input[name="media"]').trigger("click")},mediaWatcher:function(){var t=this;$(document).on("change","#pf-dz",(function(e){t.triggerUpload()}))},triggerUpload:function(){var t=this;t.uploading=!0;var e=document.querySelector("#pf-dz");t.page="uploading",Array.prototype.forEach.call(e.files,(function(e,n){if(t.media&&t.media.length+n>=t.config.uploader.album_limit)return swal("Error","You can only upload "+t.config.uploader.album_limit+" photos per album","error"),t.uploading=!1,void(t.page=2);var i=e.type;if(-1==$.inArray(i,t.mimes))return swal("Invalid File Type","The file you are trying to add is not a valid mime type. Please upload a "+t.mimes+" only.","error"),t.uploading=!1,void(t.page="error");var r=new FormData;r.append("file",e);var a={onUploadProgress:function(e){var n=Math.floor(100*e.loaded/e.total);t.uploadProgress=n}};axios.post("/api/stories/v0/add",r,a).then((function(e){t.uploadProgress=100,t.uploading=!1,window.location.href="/i/my/story",t.mediaUrl=e.data.media_url})).catch((function(n){t.uploading=!1,e.value=null;var i=n.response.data.message?n.response.data.message:"Something went wrong.";swal("Oops!",i,"warning")})),e.value=null,t.uploadProgress=0}))},expiresTimestamp:function(t){return(t=new Date(1e3*t)).toDateString()+" "+t.toLocaleTimeString()},edit:function(){this.page="edit"},showLightbox:function(t){this.lightboxMedia={url:t.src},this.$refs.lightboxModal.show()},deleteStory:function(t,e){var n=this;1==window.confirm("Are you sure you want to delete this Story?")&&axios.delete("/api/stories/v0/delete/"+t.id).then((function(t){n.stories.splice(e,1),0==n.stories.length&&(window.location.href="/i/stories/new")}))}}}),s=n("KHd+"),h=Object(s.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container mt-2 mt-md-5"},[n("input",{staticClass:"d-none file-input",attrs:{type:"file",id:"pf-dz",name:"media",accept:t.config.mimes}}),t._v(" "),t.loaded?n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6 offset-md-3"},["landing"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(0),t._v(" "),n("div",{staticClass:"flex-fill py-4"},[n("div",{staticClass:"card w-100 shadow-none"},[n("div",{staticClass:"list-group"},[n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.upload()}}},[t._v("Add Photo")]),t._v(" "),t.stories.length?n("a",{staticClass:"list-group-item text-center lead text-decoration-none text-dark",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.edit()}}},[t._v("Edit")]):t._e()])])]),t._v(" "),t._m(1)]):t._e(),t._v(" "),"crop"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"95vh"}},[t._m(2),t._v(" "),n("div",{staticClass:"flex-fill"},[n("div",{staticClass:"card w-100 mt-3"},[n("div",{staticClass:"card-body p-0"},[n("vue-cropper",{ref:"cropper",attrs:{relativeZoom:t.cropper.zoom,aspectRatio:t.cropper.aspectRatio,viewMode:t.cropper.viewMode,zoomable:t.cropper.zoomable,rotatable:!0,src:t.mediaUrl}})],1)])]),t._v(" "),t._m(3)]):t._e(),t._v(" "),"error"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center align-items-center",staticStyle:{height:"90vh"}},[n("p",{staticClass:"h3 mb-0"},[t._v("Oops!")]),t._v(" "),n("p",{staticClass:"text-muted lead"},[t._v("An error occurred, please try again later.")]),t._v(" "),t._m(4)]):t._e(),t._v(" "),"uploading"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center align-items-center",staticStyle:{height:"90vh"}},[100!=t.uploadProgress?n("p",{staticClass:"display-4 mb-0"},[t._v("Uploading "+t._s(t.uploadProgress)+"%")]):n("p",{staticClass:"display-4 mb-0"},[t._v("Publishing Story")])]):t._e(),t._v(" "),"edit"==t.page?n("div",{staticClass:"card card-body bg-transparent border-0 shadow-none d-flex justify-content-center",staticStyle:{height:"90vh"}},[t._m(5),t._v(" "),n("div",{staticClass:"flex-fill py-5"},[n("div",{staticClass:"card w-100 shadow-none",staticStyle:{"max-height":"500px","overflow-y":"auto"}},[n("div",{staticClass:"list-group"},t._l(t.stories,(function(e,i){return n("div",{staticClass:"list-group-item text-center text-dark",attrs:{href:"#"}},[n("div",{staticClass:"media align-items-center"},[n("div",{staticClass:"mr-3 cursor-pointer",on:{click:function(n){return t.showLightbox(e)}}},[n("img",{staticClass:"img-fluid",attrs:{src:e.src,width:"70px",height:"70px"}}),t._v(" "),n("p",{staticClass:"small text-muted text-center mb-0"},[t._v("(expand)")])]),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"mb-0"},[t._v("Expires")]),t._v(" "),n("p",{staticClass:"mb-0 text-muted small"},[n("span",[t._v(t._s(t.expiresTimestamp(e.expires_at)))])])]),t._v(" "),n("div",{staticClass:"float-right"},[n("button",{staticClass:"btn btn-danger btn-sm font-weight-bold text-uppercase",on:{click:function(n){return t.deleteStory(e,i)}}},[t._v("Delete")])])])])})),0)])]),t._v(" "),t._m(6)]):t._e()])]):t._e(),t._v(" "),n("b-modal",{ref:"lightboxModal",attrs:{id:"lightbox","hide-header":"","hide-footer":"",centered:"",size:"lg","body-class":"p-0"}},[t.lightboxMedia?n("div",{staticClass:"w-100 h-100"},[n("img",{staticStyle:{"max-height":"100%","max-width":"100%"},attrs:{src:t.lightboxMedia.url}})]):t._e()])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-center flex-fill"},[n("p",{staticClass:"text-lighter small text-uppercase"},[n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/"}},[t._v("Home")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/i/my/story"}},[t._v("View My Story")]),t._v(" "),n("span",{staticClass:"px-2 text-lighter"},[t._v("|")]),t._v(" "),n("a",{staticClass:"text-muted font-weight-bold",attrs:{href:"/site/help"}},[t._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center pt-5 mb-3 d-flex justify-content-between align-items-center"},[e("div",[e("button",{staticClass:"btn btn-outline-lighter btn-sm py-0 px-md-3"},[e("i",{staticClass:"pr-2 fas fa-chevron-left fa-sm"}),this._v(" Delete")])]),this._v(" "),e("div",{staticClass:"d-flex align-items-center"},[e("img",{staticClass:"d-inline-block mr-2",attrs:{src:"/img/pixelfed-icon-grey.svg",width:"30px",height:"30px"}}),this._v(" "),e("span",{staticClass:"font-weight-bold lead text-lighter"},[this._v("Stories")])]),this._v(" "),e("div",[e("button",{staticClass:"btn btn-outline-success btn-sm py-0 px-md-3"},[this._v("Crop "),e("i",{staticClass:"pl-2 fas fa-chevron-right fa-sm"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill"},[e("p",{staticClass:"text-lighter small text-uppercase pt-2"},[e("a",{staticClass:"text-muted font-weight-bold mb-0",attrs:{href:"/site/help"}},[this._v("Help")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-muted mb-0"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/"}},[this._v("Go back")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center flex-fill mt-5 pt-5"},[e("img",{attrs:{src:"/img/pixelfed-icon-grey.svg",width:"60px",height:"60px"}}),this._v(" "),e("p",{staticClass:"font-weight-bold lead text-lighter mt-1"},[this._v("Stories")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"flex-fill text-center"},[e("a",{staticClass:"btn btn-outline-secondary py-0 px-5 font-weight-bold",attrs:{href:"/i/stories/new"}},[this._v("Go back")])])}],!1,null,"58bef23e",null);e.default=h.exports},"Us+F":function(t,e,n){var i=n("LZbM"),r=n("6DAA");t.exports={distanceInWords:i(),format:r()}},VGX7:function(t,e){t.exports=function(t){var e=new Date(t.getTime()),n=e.getTimezoneOffset();return e.setSeconds(0,0),6e4*n+e.getTime()%6e4}},YQfW:function(t,e,n){var i=n("3VoG");"string"==typeof i&&(i=[[t.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,r);i.locals&&(t.exports=i.locals)},YlT8:function(t,e,n){var i=n("NmtT");t.exports=function(t,e){return i(Date.now(),t,e)}},"aET+":function(t,e,n){var i,r,a={},o=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(t,e){return e?e.querySelector(t):document.querySelector(t)},h=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var i=s.call(this,t,n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}}(),c=null,p=0,l=[],d=n("9tPo");function u(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=a[i.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](i.parts[o]);for(;o<i.parts.length;o++)r.parts.push(w(i.parts[o],e))}else{var s=[];for(o=0;o<i.parts.length;o++)s.push(w(i.parts[o],e));a[i.id]={id:i.id,refs:1,parts:s}}}}function f(t,e){for(var n=[],i={},r=0;r<t.length;r++){var a=t[r],o=e.base?a[0]+e.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};i[o]?i[o].parts.push(s):n.push(i[o]={id:o,parts:[s]})}return n}function m(t,e){var n=h(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i=l[l.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),l.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=h(t.insertAt.before,n);n.insertBefore(e,r)}}function g(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=l.indexOf(t);e>=0&&l.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return b(e,t.attrs),m(t,e),e}function b(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function w(t,e){var n,i,r,a;if(e.transform&&t.css){if(!(a="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=a}if(e.singleton){var o=p++;n=c||(c=v(e)),i=C.bind(null,n,o,!1),r=C.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),m(t,e),e}(e),i=D.bind(null,n,e),r=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),i=M.bind(null,n),r=function(){g(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=f(t,e);return u(n,e),function(t){for(var i=[],r=0;r<n.length;r++){var o=n[r];(s=a[o.id]).refs--,i.push(s)}t&&u(f(t,e),e);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var h=0;h<s.parts.length;h++)s.parts[h]();delete a[s.id]}}}};var x,y=(x=[],function(t,e){return x[t]=e,x.filter(Boolean).join("\n")});function C(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=y(e,r);else{var a=document.createTextNode(r),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(a,o[e]):t.appendChild(a)}}function M(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function D(t,e,n){var i=n.css,r=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||a)&&(i=d(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},"hoI+":function(t,e,n){"use strict";var i=n("YlT8"),r=n.n(i),a=function(t,e,n){var i=n.includeSeconds,a=n.addSuffix;return void 0===a&&(a=!0),r()(t,{locale:e,includeSeconds:i,addSuffix:a})};e.a=function(t,e){if(!t.prototype.$timeago){0;var n={locale:e.locale};t.prototype.$timeago=t.observable?t.observable(n):new t({data:n});var i=function(t){void 0===t&&(t={});var e=t.locales||{};return{name:t.name||"Timeago",props:{datetime:{required:!0},title:{type:[String,Boolean]},locale:{type:String},autoUpdate:{type:[Number,Boolean]},converter:{type:Function},converterOptions:{type:Object}},data:function(){return{timeago:this.getTimeago()}},computed:{localeName:function(){return this.locale||this.$timeago.locale}},mounted:function(){this.startUpdater()},beforeDestroy:function(){this.stopUpdater()},render:function(t){return t("time",{attrs:{datetime:new Date(this.datetime),title:"string"==typeof this.title?this.title:!1===this.title?null:this.timeago}},[this.timeago])},methods:{getTimeago:function(n){return(this.converter||t.converter||a)(n||this.datetime,e[this.locale||this.$timeago.locale],this.converterOptions||{})},convert:function(t){this.timeago=this.getTimeago(t)},startUpdater:function(){var t=this;if(this.autoUpdate){var e=!0===this.autoUpdate?60:this.autoUpdate;this.updater=setInterval((function(){t.convert()}),1e3*e)}},stopUpdater:function(){this.updater&&(clearInterval(this.updater),this.updater=null)}},watch:{autoUpdate:function(t){this.stopUpdater(),t&&this.startUpdater()},datetime:function(){this.convert()},localeName:function(){this.convert()},converter:function(){this.convert()},converterOptions:{handler:function(){this.convert()},deep:!0}}}}(e);t.component(i.name,i)}}},kOWh:function(t,e){var n=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];t.exports=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);var r=n.concat(e).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+r.join("|")+"|.)","g")}},lcPr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n("urRO"),a=(i=r)&&i.__esModule?i:{default:i};var o="undefined"==typeof window?[String,Array]:[String,Array,Element,NodeList];e.default={render:function(t){return t("div",{style:this.containerStyle},[t("img",{ref:"img",attrs:{src:this.src,alt:this.alt||"image",style:"max-width: 100%"},on:this.$listeners,style:this.imgStyle})])},props:{containerStyle:Object,src:{type:String,default:""},alt:String,imgStyle:Object,viewMode:Number,dragMode:String,initialAspectRatio:Number,aspectRatio:Number,data:Object,preview:o,responsive:{type:Boolean,default:!0},restore:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},guides:{type:Boolean,default:!0},center:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},background:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!0},autoCropArea:Number,movable:{type:Boolean,default:!0},rotatable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0},zoomable:{type:Boolean,default:!0},zoomOnTouch:{type:Boolean,default:!0},zoomOnWheel:{type:Boolean,default:!0},wheelZoomRatio:Number,cropBoxMovable:{type:Boolean,default:!0},cropBoxResizable:{type:Boolean,default:!0},toggleDragModeOnDblclick:{type:Boolean,default:!0},minCanvasWidth:Number,minCanvasHeight:Number,minCropBoxWidth:Number,minCropBoxHeight:Number,minContainerWidth:Number,minContainerHeight:Number,ready:Function,cropstart:Function,cropmove:Function,cropend:Function,crop:Function,zoom:Function},mounted:function(){var t=this.$options.props,e=(t.containerStyle,t.src,t.alt,t.imgStyle,function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["containerStyle","src","alt","imgStyle"])),n={};for(var i in e)void 0!==this[i]&&(n[i]=this[i]);this.cropper=new a.default(this.$refs.img,n)},methods:{reset:function(){return this.cropper.reset()},clear:function(){return this.cropper.clear()},initCrop:function(){return this.cropper.crop()},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(t,e)},enable:function(){return this.cropper.enable()},disable:function(){return this.cropper.disable()},destroy:function(){return this.cropper.destroy()},move:function(t,e){return this.cropper.move(t,e)},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.moveTo(t,e)},relativeZoom:function(t,e){return this.cropper.zoom(t,e)},zoomTo:function(t,e){return this.cropper.zoomTo(t,e)},rotate:function(t){return this.cropper.rotate(t)},rotateTo:function(t){return this.cropper.rotateTo(t)},scaleX:function(t){return this.cropper.scaleX(t)},scaleY:function(t){return this.cropper.scaleY(t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.cropper.scale(t,e)},getData:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(t)},setData:function(t){return this.cropper.setData(t)},getContainerData:function(){return this.cropper.getContainerData()},getImageData:function(){return this.cropper.getImageData()},getCanvasData:function(){return this.cropper.getCanvasData()},setCanvasData:function(t){return this.cropper.setCanvasData(t)},getCropBoxData:function(){return this.cropper.getCropBoxData()},setCropBoxData:function(t){return this.cropper.setCropBoxData(t)},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(t)},setAspectRatio:function(t){return this.cropper.setAspectRatio(t)},setDragMode:function(t){return this.cropper.setDragMode(t)}}}},pzWd:function(t,e){t.exports=function(t){return t instanceof Date}},spWN:function(t,e,n){Vue.component("story-compose",n("TP5S").default)},sunR:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t),r=i(e);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}},urRO:function(t,e,n){t.exports=function(){"use strict";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})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(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;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var s="undefined"!=typeof window&&void 0!==window.document,h=s?window:{},c=!!s&&"ontouchstart"in h.document.documentElement,p=!!s&&"PointerEvent"in h,l="".concat("cropper","-crop"),d="".concat("cropper","-disabled"),u="".concat("cropper","-hidden"),f="".concat("cropper","-hide"),m="".concat("cropper","-invisible"),g="".concat("cropper","-modal"),v="".concat("cropper","-move"),b="".concat("cropper","Action"),w="".concat("cropper","Preview"),x=c?"touchstart":"mousedown",y=c?"touchmove":"mousemove",C=c?"touchend touchcancel":"mouseup",M=p?"pointerdown":x,D=p?"pointermove":y,T=p?"pointerup pointercancel":C,B=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,S=/^data:/,A=/^data:image\/jpeg;base64,/,O=/^img|canvas$/i,k={viewMode:0,dragMode:"crop",initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},_=Number.isNaN||h.isNaN;function E(t){return"number"==typeof t&&!_(t)}var N=function(t){return t>0&&t<1/0};function z(t){return void 0===t}function W(e){return"object"===t(e)&&null!==e}var R=Object.prototype.hasOwnProperty;function U(t){if(!W(t))return!1;try{var e=t.constructor,n=e.prototype;return e&&n&&R.call(n,"isPrototypeOf")}catch(t){return!1}}function H(t){return"function"==typeof t}var L=Array.prototype.slice;function X(t){return Array.from?Array.from(t):L.call(t)}function j(t,e){return t&&H(e)&&(Array.isArray(t)||E(t.length)?X(t).forEach((function(n,i){e.call(t,n,i,t)})):W(t)&&Object.keys(t).forEach((function(n){e.call(t,t[n],n,t)}))),t}var Y=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return W(t)&&n.length>0&&n.forEach((function(e){W(e)&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t},I=/\.\d*(?:0|9){12}\d*$/;function $(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return I.test(t)?Math.round(t*e)/e:t}var P=/^width|height|left|top|marginLeft|marginTop$/;function F(t,e){var n=t.style;j(e,(function(t,e){P.test(e)&&E(t)&&(t="".concat(t,"px")),n[e]=t}))}function G(t,e){if(e)if(E(t.length))j(t,(function(t){G(t,e)}));else if(t.classList)t.classList.add(e);else{var n=t.className.trim();n?n.indexOf(e)<0&&(t.className="".concat(n," ").concat(e)):t.className=e}}function Z(t,e){e&&(E(t.length)?j(t,(function(t){Z(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function q(t,e,n){e&&(E(t.length)?j(t,(function(t){q(t,e,n)})):n?G(t,e):Z(t,e))}var V=/([a-z\d])([A-Z])/g;function J(t){return t.replace(V,"$1-$2").toLowerCase()}function Q(t,e){return W(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(J(e)))}function K(t,e,n){W(n)?t[e]=n:t.dataset?t.dataset[e]=n:t.setAttribute("data-".concat(J(e)),n)}var tt=/\s\s*/,et=function(){var t=!1;if(s){var e=!1,n=function(){},i=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});h.addEventListener("test",n,i),h.removeEventListener("test",n,i)}return t}();function nt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(tt).forEach((function(e){if(!et){var a=t.listeners;a&&a[e]&&a[e][n]&&(r=a[e][n],delete a[e][n],0===Object.keys(a[e]).length&&delete a[e],0===Object.keys(a).length&&delete t.listeners)}t.removeEventListener(e,r,i)}))}function it(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(tt).forEach((function(e){if(i.once&&!et){var a=t.listeners,o=void 0===a?{}:a;r=function(){delete o[e][n],t.removeEventListener(e,r,i);for(var a=arguments.length,s=new Array(a),h=0;h<a;h++)s[h]=arguments[h];n.apply(t,s)},o[e]||(o[e]={}),o[e][n]&&t.removeEventListener(e,o[e][n],i),o[e][n]=r,t.listeners=o}t.addEventListener(e,r,i)}))}function rt(t,e,n){var i;return H(Event)&&H(CustomEvent)?i=new CustomEvent(e,{detail:n,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n),t.dispatchEvent(i)}function at(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var ot=h.location,st=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function ht(t){var e=t.match(st);return null!==e&&(e[1]!==ot.protocol||e[2]!==ot.hostname||e[3]!==ot.port)}function ct(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function pt(t){var e=t.rotate,n=t.scaleX,i=t.scaleY,r=t.translateX,a=t.translateY,o=[];E(r)&&0!==r&&o.push("translateX(".concat(r,"px)")),E(a)&&0!==a&&o.push("translateY(".concat(a,"px)")),E(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),E(n)&&1!==n&&o.push("scaleX(".concat(n,")")),E(i)&&1!==i&&o.push("scaleY(".concat(i,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function lt(t,e){var n=t.pageX,i=t.pageY,r={endX:n,endY:i};return e?r:a({startX:n,startY:i},r)}function dt(t){var e=t.aspectRatio,n=t.height,i=t.width,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",a=N(i),o=N(n);if(a&&o){var s=n*e;"contain"===r&&s>i||"cover"===r&&s<i?n=i/e:i=n*e}else a?n=i/e:o&&(i=n*e);return{width:i,height:n}}function ut(t,e,n,i){var r=e.aspectRatio,a=e.naturalWidth,s=e.naturalHeight,h=e.rotate,c=void 0===h?0:h,p=e.scaleX,l=void 0===p?1:p,d=e.scaleY,u=void 0===d?1:d,f=n.aspectRatio,m=n.naturalWidth,g=n.naturalHeight,v=i.fillColor,b=void 0===v?"transparent":v,w=i.imageSmoothingEnabled,x=void 0===w||w,y=i.imageSmoothingQuality,C=void 0===y?"low":y,M=i.maxWidth,D=void 0===M?1/0:M,T=i.maxHeight,B=void 0===T?1/0:T,S=i.minWidth,A=void 0===S?0:S,O=i.minHeight,k=void 0===O?0:O,_=document.createElement("canvas"),E=_.getContext("2d"),N=dt({aspectRatio:f,width:D,height:B}),z=dt({aspectRatio:f,width:A,height:k},"cover"),W=Math.min(N.width,Math.max(z.width,m)),R=Math.min(N.height,Math.max(z.height,g)),U=dt({aspectRatio:r,width:D,height:B}),H=dt({aspectRatio:r,width:A,height:k},"cover"),L=Math.min(U.width,Math.max(H.width,a)),X=Math.min(U.height,Math.max(H.height,s)),j=[-L/2,-X/2,L,X];return _.width=$(W),_.height=$(R),E.fillStyle=b,E.fillRect(0,0,W,R),E.save(),E.translate(W/2,R/2),E.rotate(c*Math.PI/180),E.scale(l,u),E.imageSmoothingEnabled=x,E.imageSmoothingQuality=C,E.drawImage.apply(E,[t].concat(o(j.map((function(t){return Math.floor($(t))}))))),E.restore(),_}var ft=String.fromCharCode,mt=/^data:.*,/;function gt(t){var e,n=new DataView(t);try{var i,r,a;if(255===n.getUint8(0)&&216===n.getUint8(1))for(var o=n.byteLength,s=2;s+1<o;){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){r=s;break}s+=1}if(r){var h=r+10;if("Exif"===function(t,e,n){var i="";n+=e;for(var r=e;r<n;r+=1)i+=ft(t.getUint8(r));return i}(n,r+4,4)){var c=n.getUint16(h);if(((i=18761===c)||19789===c)&&42===n.getUint16(h+2,i)){var p=n.getUint32(h+4,i);p>=8&&(a=h+p)}}}if(a){var l,d,u=n.getUint16(a,i);for(d=0;d<u;d+=1)if(l=a+12*d+2,274===n.getUint16(l,i)){l+=8,e=n.getUint16(l,i),n.setUint16(l,1,i);break}}}catch(t){e=1}return e}var vt={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,n=this.container,i=this.cropper;G(i,u),Z(t,u);var r={width:Math.max(n.offsetWidth,Number(e.minContainerWidth)||200),height:Math.max(n.offsetHeight,Number(e.minContainerHeight)||100)};this.containerData=r,F(i,{width:r.width,height:r.height}),G(t,u),Z(i,u)},initCanvas:function(){var t=this.containerData,e=this.imageData,n=this.options.viewMode,i=Math.abs(e.rotate)%180==90,r=i?e.naturalHeight:e.naturalWidth,a=i?e.naturalWidth:e.naturalHeight,o=r/a,s=t.width,h=t.height;t.height*o>t.width?3===n?s=t.height*o:h=t.width/o:3===n?h=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:r,naturalHeight:a,width:s,height:h};c.left=(t.width-s)/2,c.top=(t.height-h)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=Y({},e),this.initialCanvasData=Y({},c)},limitCanvas:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=n.viewMode,s=r.aspectRatio,h=this.cropped&&a;if(t){var c=Number(n.minCanvasWidth)||0,p=Number(n.minCanvasHeight)||0;o>1?(c=Math.max(c,i.width),p=Math.max(p,i.height),3===o&&(p*s>c?c=p*s:p=c/s)):o>0&&(c?c=Math.max(c,h?a.width:0):p?p=Math.max(p,h?a.height:0):h&&(c=a.width,(p=a.height)*s>c?c=p*s:p=c/s));var l=dt({aspectRatio:s,width:c,height:p});c=l.width,p=l.height,r.minWidth=c,r.minHeight=p,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(o>(h?0:1)){var d=i.width-r.width,u=i.height-r.height;r.minLeft=Math.min(0,d),r.minTop=Math.min(0,u),r.maxLeft=Math.max(0,d),r.maxTop=Math.max(0,u),h&&this.limited&&(r.minLeft=Math.min(a.left,a.left+(a.width-r.width)),r.minTop=Math.min(a.top,a.top+(a.height-r.height)),r.maxLeft=a.left,r.maxTop=a.top,2===o&&(r.width>=i.width&&(r.minLeft=Math.min(0,d),r.maxLeft=Math.max(0,d)),r.height>=i.height&&(r.minTop=Math.min(0,u),r.maxTop=Math.max(0,u))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=i.width,r.maxTop=i.height},renderCanvas:function(t,e){var n=this.canvasData,i=this.imageData;if(e){var r=function(t){var e=t.width,n=t.height,i=t.degree;if(90==(i=Math.abs(i)%180))return{width:n,height:e};var r=i%90*Math.PI/180,a=Math.sin(r),o=Math.cos(r),s=e*o+n*a,h=e*a+n*o;return i>90?{width:h,height:s}:{width:s,height:h}}({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=r.width,o=r.height,s=n.width*(a/n.naturalWidth),h=n.height*(o/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(h-n.height)/2,n.width=s,n.height=h,n.aspectRatio=a/o,n.naturalWidth=a,n.naturalHeight=o,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,F(this.canvas,Y({width:n.width,height:n.height},pt({translateX:n.left,translateY:n.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,n=this.imageData,i=n.naturalWidth*(e.width/e.naturalWidth),r=n.naturalHeight*(e.height/e.naturalHeight);Y(n,{width:i,height:r,left:(e.width-i)/2,top:(e.height-r)/2}),F(this.image,Y({width:n.width,height:n.height},pt(Y({translateX:n.left,translateY:n.top},n)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,n=t.aspectRatio||t.initialAspectRatio,i=Number(t.autoCropArea)||.8,r={width:e.width,height:e.height};n&&(e.height*n>e.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*i),r.height=Math.max(r.minHeight,r.height*i),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=Y({},r)},limitCropBox:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,a=this.cropBoxData,o=this.limited,s=n.aspectRatio;if(t){var h=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,p=o?Math.min(i.width,r.width,r.width+r.left,i.width-r.left):i.width,l=o?Math.min(i.height,r.height,r.height+r.top,i.height-r.top):i.height;h=Math.min(h,i.width),c=Math.min(c,i.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),l*s>p?l=p/s:p=l*s),a.minWidth=Math.min(h,p),a.minHeight=Math.min(c,l),a.maxWidth=p,a.maxHeight=l}e&&(o?(a.minLeft=Math.max(0,r.left),a.minTop=Math.max(0,r.top),a.maxLeft=Math.min(i.width,r.left+r.width)-a.width,a.maxTop=Math.min(i.height,r.top+r.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var t=this.options,e=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,t.movable&&t.cropBoxMovable&&K(this.face,b,n.width>=e.width&&n.height>=e.height?"move":"all"),F(this.cropBox,Y({width:n.width,height:n.height},pt({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),rt(this.element,"crop",this.getData())}},bt={initPreview:function(){var t=this.element,e=this.crossOrigin,n=this.options.preview,i=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",a=document.createElement("img");if(e&&(a.crossOrigin=e),a.src=i,a.alt=r,this.viewBox.appendChild(a),this.viewBoxImage=a,n){var o=n;"string"==typeof n?o=t.ownerDocument.querySelectorAll(n):n.querySelector&&(o=[n]),this.previews=o,j(o,(function(t){var n=document.createElement("img");K(t,w,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(n.crossOrigin=e),n.src=i,n.alt=r,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(n)}))}},resetPreview:function(){j(this.previews,(function(t){var e=Q(t,w);F(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(W(t[e]))try{delete t[e]}catch(n){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(n){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(J(e)))}(t,w)}))},preview:function(){var t=this.imageData,e=this.canvasData,n=this.cropBoxData,i=n.width,r=n.height,a=t.width,o=t.height,s=n.left-e.left-t.left,h=n.top-e.top-t.top;this.cropped&&!this.disabled&&(F(this.viewBoxImage,Y({width:a,height:o},pt(Y({translateX:-s,translateY:-h},t)))),j(this.previews,(function(e){var n=Q(e,w),c=n.width,p=n.height,l=c,d=p,u=1;i&&(d=r*(u=c/i)),r&&d>p&&(l=i*(u=p/r),d=p),F(e,{width:l,height:d}),F(e.getElementsByTagName("img")[0],Y({width:a*u,height:o*u},pt(Y({translateX:-s*u,translateY:-h*u},t))))})))}},wt={bind:function(){var t=this.element,e=this.options,n=this.cropper;H(e.cropstart)&&it(t,"cropstart",e.cropstart),H(e.cropmove)&&it(t,"cropmove",e.cropmove),H(e.cropend)&&it(t,"cropend",e.cropend),H(e.crop)&&it(t,"crop",e.crop),H(e.zoom)&&it(t,"zoom",e.zoom),it(n,M,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&it(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&it(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),it(t.ownerDocument,D,this.onCropMove=this.cropMove.bind(this)),it(t.ownerDocument,T,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&it(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;H(e.cropstart)&&nt(t,"cropstart",e.cropstart),H(e.cropmove)&&nt(t,"cropmove",e.cropmove),H(e.cropend)&&nt(t,"cropend",e.cropend),H(e.crop)&&nt(t,"crop",e.crop),H(e.zoom)&&nt(t,"zoom",e.zoom),nt(n,M,this.onCropStart),e.zoomable&&e.zoomOnWheel&&nt(n,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&nt(n,"dblclick",this.onDblclick),nt(t.ownerDocument,D,this.onCropMove),nt(t.ownerDocument,T,this.onCropEnd),e.responsive&&nt(window,"resize",this.onResize)}},xt={resize:function(){var t=this.options,e=this.container,n=this.containerData,i=Number(t.minContainerWidth)||200,r=Number(t.minContainerHeight)||100;if(!(this.disabled||n.width<=i||n.height<=r)){var a,o,s=e.offsetWidth/n.width;1===s&&e.offsetHeight===n.height||(t.restore&&(a=this.getCanvasData(),o=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(j(a,(function(t,e){a[e]=t*s}))),this.setCropBoxData(j(o,(function(t,e){o[e]=t*s})))))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=l,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?"move":"crop"))},wheel:function(t){var e=this,n=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?i=t.deltaY>0?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=t.detail>0?1:-1),this.zoom(-i*n,t)))},cropStart:function(t){var e=t.buttons,n=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(E(e)&&1!==e||E(n)&&0!==n||t.ctrlKey))){var i,r=this.options,a=this.pointers;t.changedTouches?j(t.changedTouches,(function(t){a[t.identifier]=lt(t)})):a[t.pointerId||0]=lt(t),i=Object.keys(a).length>1&&r.zoomable&&r.zoomOnTouch?"zoom":Q(t.target,b),B.test(i)&&!1!==rt(this.element,"cropstart",{originalEvent:t,action:i})&&(t.preventDefault(),this.action=i,this.cropping=!1,"crop"===i&&(this.cropping=!0,G(this.dragBox,g)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var n=this.pointers;t.preventDefault(),!1!==rt(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?j(t.changedTouches,(function(t){Y(n[t.identifier]||{},lt(t,!0))})):Y(n[t.pointerId||0]||{},lt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?j(t.changedTouches,(function(t){delete n[t.identifier]})):delete n[t.pointerId||0],e&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,q(this.dragBox,g,this.cropped&&this.options.modal)),rt(this.element,"cropend",{originalEvent:t,action:e}))}}},yt={change:function(t){var e,n=this.options,i=this.canvasData,r=this.containerData,o=this.cropBoxData,s=this.pointers,h=this.action,c=n.aspectRatio,p=o.left,l=o.top,d=o.width,f=o.height,m=p+d,g=l+f,v=0,b=0,w=r.width,x=r.height,y=!0;!c&&t.shiftKey&&(c=d&&f?d/f:1),this.limited&&(v=o.minLeft,b=o.minTop,w=v+Math.min(r.width,i.width,i.left+i.width),x=b+Math.min(r.height,i.height,i.top+i.height));var C=s[Object.keys(s)[0]],M={x:C.endX-C.startX,y:C.endY-C.startY},D=function(t){switch(t){case"e":m+M.x>w&&(M.x=w-m);break;case"w":p+M.x<v&&(M.x=v-p);break;case"n":l+M.y<b&&(M.y=b-l);break;case"s":g+M.y>x&&(M.y=x-g)}};switch(h){case"all":p+=M.x,l+=M.y;break;case"e":if(M.x>=0&&(m>=w||c&&(l<=b||g>=x))){y=!1;break}D("e"),(d+=M.x)<0&&(h="w",p-=d=-d),c&&(f=d/c,l+=(o.height-f)/2);break;case"n":if(M.y<=0&&(l<=b||c&&(p<=v||m>=w))){y=!1;break}D("n"),f-=M.y,l+=M.y,f<0&&(h="s",l-=f=-f),c&&(d=f*c,p+=(o.width-d)/2);break;case"w":if(M.x<=0&&(p<=v||c&&(l<=b||g>=x))){y=!1;break}D("w"),d-=M.x,p+=M.x,d<0&&(h="e",p-=d=-d),c&&(f=d/c,l+=(o.height-f)/2);break;case"s":if(M.y>=0&&(g>=x||c&&(p<=v||m>=w))){y=!1;break}D("s"),(f+=M.y)<0&&(h="n",l-=f=-f),c&&(d=f*c,p+=(o.width-d)/2);break;case"ne":if(c){if(M.y<=0&&(l<=b||m>=w)){y=!1;break}D("n"),f-=M.y,l+=M.y,d=f*c}else D("n"),D("e"),M.x>=0?m<w?d+=M.x:M.y<=0&&l<=b&&(y=!1):d+=M.x,M.y<=0?l>b&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);d<0&&f<0?(h="sw",l-=f=-f,p-=d=-d):d<0?(h="nw",p-=d=-d):f<0&&(h="se",l-=f=-f);break;case"nw":if(c){if(M.y<=0&&(l<=b||p<=v)){y=!1;break}D("n"),f-=M.y,l+=M.y,d=f*c,p+=o.width-d}else D("n"),D("w"),M.x<=0?p>v?(d-=M.x,p+=M.x):M.y<=0&&l<=b&&(y=!1):(d-=M.x,p+=M.x),M.y<=0?l>b&&(f-=M.y,l+=M.y):(f-=M.y,l+=M.y);d<0&&f<0?(h="se",l-=f=-f,p-=d=-d):d<0?(h="ne",p-=d=-d):f<0&&(h="sw",l-=f=-f);break;case"sw":if(c){if(M.x<=0&&(p<=v||g>=x)){y=!1;break}D("w"),d-=M.x,p+=M.x,f=d/c}else D("s"),D("w"),M.x<=0?p>v?(d-=M.x,p+=M.x):M.y>=0&&g>=x&&(y=!1):(d-=M.x,p+=M.x),M.y>=0?g<x&&(f+=M.y):f+=M.y;d<0&&f<0?(h="ne",l-=f=-f,p-=d=-d):d<0?(h="se",p-=d=-d):f<0&&(h="nw",l-=f=-f);break;case"se":if(c){if(M.x>=0&&(m>=w||g>=x)){y=!1;break}D("e"),f=(d+=M.x)/c}else D("s"),D("e"),M.x>=0?m<w?d+=M.x:M.y>=0&&g>=x&&(y=!1):d+=M.x,M.y>=0?g<x&&(f+=M.y):f+=M.y;d<0&&f<0?(h="nw",l-=f=-f,p-=d=-d):d<0?(h="sw",p-=d=-d):f<0&&(h="ne",l-=f=-f);break;case"move":this.move(M.x,M.y),y=!1;break;case"zoom":this.zoom(function(t){var e=a({},t),n=[];return j(t,(function(t,i){delete e[i],j(e,(function(e){var i=Math.abs(t.startX-e.startX),r=Math.abs(t.startY-e.startY),a=Math.abs(t.endX-e.endX),o=Math.abs(t.endY-e.endY),s=Math.sqrt(i*i+r*r),h=(Math.sqrt(a*a+o*o)-s)/s;n.push(h)}))})),n.sort((function(t,e){return Math.abs(t)<Math.abs(e)})),n[0]}(s),t),y=!1;break;case"crop":if(!M.x||!M.y){y=!1;break}e=at(this.cropper),p=C.startX-e.left,l=C.startY-e.top,d=o.minWidth,f=o.minHeight,M.x>0?h=M.y>0?"se":"ne":M.x<0&&(p-=d,h=M.y>0?"sw":"nw"),M.y<0&&(l-=f),this.cropped||(Z(this.cropBox,u),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}y&&(o.width=d,o.height=f,o.left=p,o.top=l,this.action=h,this.renderCropBox()),j(s,(function(t){t.startX=t.endX,t.startY=t.endY}))}},Ct={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&G(this.dragBox,g),Z(this.cropBox,u),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Y({},this.initialImageData),this.canvasData=Y({},this.initialCanvasData),this.cropBoxData=Y({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Y(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Z(this.dragBox,g),G(this.cropBox,u)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,j(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Z(this.cropper,d)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,G(this.cropper,d)),this},destroy:function(){var t=this.element;return t.cropper?(t.cropper=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=n.left,r=n.top;return this.moveTo(z(t)?t:i+Number(t),z(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(E(t)&&(n.left=t,i=!0),E(e)&&(n.top=e,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(t,e){var n=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,null,e)},zoomTo:function(t,e,n){var i=this.options,r=this.canvasData,a=r.width,o=r.height,s=r.naturalWidth,h=r.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&i.zoomable){var c=s*t,p=h*t;if(!1===rt(this.element,"zoom",{ratio:t,oldRatio:a/s,originalEvent:n}))return this;if(n){var l=this.pointers,d=at(this.cropper),u=l&&Object.keys(l).length?function(t){var e=0,n=0,i=0;return j(t,(function(t){var r=t.startX,a=t.startY;e+=r,n+=a,i+=1})),{pageX:e/=i,pageY:n/=i}}(l):{pageX:n.pageX,pageY:n.pageY};r.left-=(c-a)*((u.pageX-d.left-r.left)/a),r.top-=(p-o)*((u.pageY-d.top-r.top)/o)}else U(e)&&E(e.x)&&E(e.y)?(r.left-=(c-a)*((e.x-r.left)/a),r.top-=(p-o)*((e.y-r.top)/o)):(r.left-=(c-a)/2,r.top-=(p-o)/2);r.width=c,r.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return E(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,E(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(E(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.imageData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(E(t)&&(n.scaleX=t,i=!0),E(e)&&(n.scaleY=e,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,i=this.imageData,r=this.canvasData,a=this.cropBoxData;if(this.ready&&this.cropped){t={x:a.left-r.left,y:a.top-r.top,width:a.width,height:a.height};var o=i.width/i.naturalWidth;if(j(t,(function(e,n){t[n]=e/o})),e){var s=Math.round(t.y+t.height),h=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=h-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return n.rotatable&&(t.rotate=i.rotate||0),n.scalable&&(t.scaleX=i.scaleX||1,t.scaleY=i.scaleY||1),t},setData:function(t){var e=this.options,n=this.imageData,i=this.canvasData,r={};if(this.ready&&!this.disabled&&U(t)){var a=!1;e.rotatable&&E(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,a=!0),e.scalable&&(E(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,a=!0),E(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=n.width/n.naturalWidth;E(t.x)&&(r.left=t.x*o+i.left),E(t.y)&&(r.top=t.y*o+i.top),E(t.width)&&(r.width=t.width*o),E(t.height)&&(r.height=t.height*o),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?Y({},this.containerData):{}},getImageData:function(){return this.sized?Y({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&j(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){e[n]=t[n]})),e},setCanvasData:function(t){var e=this.canvasData,n=e.aspectRatio;return this.ready&&!this.disabled&&U(t)&&(E(t.left)&&(e.left=t.left),E(t.top)&&(e.top=t.top),E(t.width)?(e.width=t.width,e.height=t.width/n):E(t.height)&&(e.height=t.height,e.width=t.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,n,i=this.cropBoxData,r=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&U(t)&&(E(t.left)&&(i.left=t.left),E(t.top)&&(i.top=t.top),E(t.width)&&t.width!==i.width&&(e=!0,i.width=t.width),E(t.height)&&t.height!==i.height&&(n=!0,i.height=t.height),r&&(e?i.height=i.width/r:n&&(i.width=i.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,n=ut(this.image,this.imageData,e,t);if(!this.cropped)return n;var i=this.getData(),r=i.x,a=i.y,s=i.width,h=i.height,c=n.width/Math.floor(e.naturalWidth);1!==c&&(r*=c,a*=c,s*=c,h*=c);var p=s/h,l=dt({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=dt({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=dt({aspectRatio:p,width:t.width||(1!==c?n.width:s),height:t.height||(1!==c?n.height:h)}),f=u.width,m=u.height;f=Math.min(l.width,Math.max(d.width,f)),m=Math.min(l.height,Math.max(d.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=$(f),g.height=$(m),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,m);var b=t.imageSmoothingEnabled,w=void 0===b||b,x=t.imageSmoothingQuality;v.imageSmoothingEnabled=w,x&&(v.imageSmoothingQuality=x);var y,C,M,D,T,B,S=n.width,A=n.height,O=r,k=a;O<=-s||O>S?(O=0,y=0,M=0,T=0):O<=0?(M=-O,O=0,T=y=Math.min(S,s+O)):O<=S&&(M=0,T=y=Math.min(s,S-O)),y<=0||k<=-h||k>A?(k=0,C=0,D=0,B=0):k<=0?(D=-k,k=0,B=C=Math.min(A,h+k)):k<=A&&(D=0,B=C=Math.min(h,A-k));var _=[O,k,y,C];if(T>0&&B>0){var E=f/s;_.push(M*E,D*E,T*E,B*E)}return v.drawImage.apply(v,[n].concat(o(_.map((function(t){return Math.floor($(t))}))))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||z(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,n=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var r="crop"===t,a=e.movable&&"move"===t;t=r||a?t:"none",e.dragMode=t,K(n,b,t),q(n,l,r),q(n,v,a),e.cropBoxMovable||(K(i,b,t),q(i,l,r),q(i,v,a))}return this}},Mt=h.Cropper,Dt=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e(this,t),!n||!O.test(n.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=n,this.options=Y({},k,U(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var i,r,a;return i=t,a=[{key:"noConflict",value:function(){return window.Cropper=Mt,t}},{key:"setDefaults",value:function(t){Y(k,U(t)&&t)}}],(r=[{key:"init",value:function(){var t,e=this.element,n=e.tagName.toLowerCase();if(!e.cropper){if(e.cropper=this,"img"===n){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===n&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var n=this.element,i=this.options;if(i.rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer)if(S.test(t))A.test(t)?this.read((r=t.replace(mt,""),a=atob(r),o=new ArrayBuffer(a.length),j(s=new Uint8Array(o),(function(t,e){s[e]=a.charCodeAt(e)})),o)):this.clone();else{var r,a,o,s,h=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,this.xhr=h,h.onabort=c,h.onerror=c,h.ontimeout=c,h.onprogress=function(){"image/jpeg"!==h.getResponseHeader("content-type")&&h.abort()},h.onload=function(){e.read(h.response)},h.onloadend=function(){e.reloading=!1,e.xhr=null},i.checkCrossOrigin&&ht(t)&&n.crossOrigin&&(t=ct(t)),h.open("GET",t),h.responseType="arraybuffer",h.withCredentials="use-credentials"===n.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,n=this.imageData,i=gt(t),r=0,a=1,o=1;if(i>1){this.url=function(t,e){for(var n=[],i=new Uint8Array(t);i.length>0;)n.push(ft.apply(null,X(i.subarray(0,8192)))),i=i.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(n.join("")))}(t,"image/jpeg");var s=function(t){var e=0,n=1,i=1;switch(t){case 2:n=-1;break;case 3:e=-180;break;case 4:i=-1;break;case 5:e=90,i=-1;break;case 6:e=90;break;case 7:e=90,n=-1;break;case 8:e=-90}return{rotate:e,scaleX:n,scaleY:i}}(i);r=s.rotate,a=s.scaleX,o=s.scaleY}e.rotatable&&(n.rotate=r),e.scalable&&(n.scaleX=a,n.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,n=t.crossOrigin,i=e;this.options.checkCrossOrigin&&ht(e)&&(n||(n="anonymous"),i=ct(e)),this.crossOrigin=n,this.crossOriginUrl=i;var r=document.createElement("img");n&&(r.crossOrigin=n),r.src=i||e,r.alt=t.alt||"The image to crop",this.image=r,r.onload=this.start.bind(this),r.onerror=this.stop.bind(this),G(r,f),t.parentNode.insertBefore(r,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=h.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(h.navigator.userAgent),i=function(e,n){Y(t.imageData,{naturalWidth:e,naturalHeight:n,aspectRatio:e/n}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||n){var r=document.createElement("img"),a=document.body||document.documentElement;this.sizingImage=r,r.onload=function(){i(r.width,r.height),n||a.removeChild(r)},r.src=e.src,n||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",a.appendChild(r))}else i(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,n=this.image,i=t.parentNode,r=document.createElement("div");r.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var a=r.querySelector(".".concat("cropper","-container")),o=a.querySelector(".".concat("cropper","-canvas")),s=a.querySelector(".".concat("cropper","-drag-box")),h=a.querySelector(".".concat("cropper","-crop-box")),c=h.querySelector(".".concat("cropper","-face"));this.container=i,this.cropper=a,this.canvas=o,this.dragBox=s,this.cropBox=h,this.viewBox=a.querySelector(".".concat("cropper","-view-box")),this.face=c,o.appendChild(n),G(t,u),i.insertBefore(a,t.nextSibling),this.isImg||Z(n,f),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,G(h,u),e.guides||G(h.getElementsByClassName("".concat("cropper","-dashed")),u),e.center||G(h.getElementsByClassName("".concat("cropper","-center")),u),e.background&&G(a,"".concat("cropper","-bg")),e.highlight||G(c,m),e.cropBoxMovable&&(G(c,v),K(c,b,"all")),e.cropBoxResizable||(G(h.getElementsByClassName("".concat("cropper","-line")),u),G(h.getElementsByClassName("".concat("cropper","-point")),u)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),H(e.ready)&&it(t,"ready",e.ready,{once:!0}),rt(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Z(this.element,u))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(i.prototype,r),a&&n(i,a),t}();return Y(Dt.prototype,vt,bt,wt,xt,yt,Ct),Dt}()},yHON:function(t,e,n){var i=n("yNUO");t.exports=function(t,e){var n=i(t).getTime(),r=i(e).getTime();return n>r?-1:n<r?1:0}},yNUO:function(t,e,n){var i=n("VGX7"),r=n("pzWd"),a=/[T ]/,o=/:/,s=/^(\d{2})$/,h=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],c=/^(\d{4})/,p=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],l=/^-(\d{2})$/,d=/^-?(\d{3})$/,u=/^-?(\d{2})-?(\d{2})$/,f=/^-?W(\d{2})$/,m=/^-?W(\d{2})-?(\d{1})$/,g=/^(\d{2}([.,]\d*)?)$/,v=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,b=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,w=/([Z+-].*)$/,x=/^(Z)$/,y=/^([+-])(\d{2})$/,C=/^([+-])(\d{2}):?(\d{2})$/;function M(t,e,n){e=e||0,n=n||0;var i=new Date(0);i.setUTCFullYear(t,0,4);var r=7*e+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}t.exports=function(t,e){if(r(t))return new Date(t.getTime());if("string"!=typeof t)return new Date(t);var n=(e||{}).additionalDigits;n=null==n?2:Number(n);var D=function(t){var e,n={},i=t.split(a);o.test(i[0])?(n.date=null,e=i[0]):(n.date=i[0],e=i[1]);if(e){var r=w.exec(e);r?(n.time=e.replace(r[1],""),n.timezone=r[1]):n.time=e}return n}(t),T=function(t,e){var n,i=h[e],r=p[e];if(n=c.exec(t)||r.exec(t)){var a=n[1];return{year:parseInt(a,10),restDateString:t.slice(a.length)}}if(n=s.exec(t)||i.exec(t)){var o=n[1];return{year:100*parseInt(o,10),restDateString:t.slice(o.length)}}return{year:null}}(D.date,n),B=T.year,S=function(t,e){if(null===e)return null;var n,i,r,a;if(0===t.length)return(i=new Date(0)).setUTCFullYear(e),i;if(n=l.exec(t))return i=new Date(0),r=parseInt(n[1],10)-1,i.setUTCFullYear(e,r),i;if(n=d.exec(t)){i=new Date(0);var o=parseInt(n[1],10);return i.setUTCFullYear(e,0,o),i}if(n=u.exec(t)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return i.setUTCFullYear(e,r,s),i}if(n=f.exec(t))return a=parseInt(n[1],10)-1,M(e,a);if(n=m.exec(t)){a=parseInt(n[1],10)-1;var h=parseInt(n[2],10)-1;return M(e,a,h)}return null}(T.restDateString,B);if(S){var A,O=S.getTime(),k=0;if(D.time&&(k=function(t){var e,n,i;if(e=g.exec(t))return(n=parseFloat(e[1].replace(",",".")))%24*36e5;if(e=v.exec(t))return n=parseInt(e[1],10),i=parseFloat(e[2].replace(",",".")),n%24*36e5+6e4*i;if(e=b.exec(t)){n=parseInt(e[1],10),i=parseInt(e[2],10);var r=parseFloat(e[3].replace(",","."));return n%24*36e5+6e4*i+1e3*r}return null}(D.time)),D.timezone)A=6e4*function(t){var e,n;if(e=x.exec(t))return 0;if(e=y.exec(t))return n=60*parseInt(e[2],10),"+"===e[1]?-n:n;if(e=C.exec(t))return n=60*parseInt(e[2],10)+parseInt(e[3],10),"+"===e[1]?-n:n;return 0}(D.timezone);else{var _=O+k,E=new Date(_);A=i(E);var N=new Date(_);N.setDate(E.getDate()+1);var z=i(N)-i(E);z>0&&(A+=z)}return new Date(O+k+A)}return new Date(t)}}},[[20,0]]]);