shaark/public/js/app.js

1 line
266 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"+fAT":function(t,e,n){var r={"./components/AlbumCard.vue":"idfw","./components/AlbumForm.vue":"nBz4","./components/Background.vue":"iyXs","./components/CheckFeature.vue":"8/rJ","./components/ChestCard.vue":"MX7w","./components/ChestForm.vue":"0O8z","./components/ChestLines.vue":"0TP3","./components/Comment.vue":"G1fO","./components/Comments.vue":"TfHT","./components/Confirm.vue":"cNyC","./components/Flash.vue":"tEIc","./components/LinkCard.vue":"kuJz","./components/LinkForm.vue":"ugYh","./components/Loader.vue":"S4HP","./components/ManageArchives.vue":"K3gU","./components/ManageTags.vue":"NyNk","./components/Modal.vue":"uuIC","./components/PasswordGenerator.vue":"ZTJQ","./components/PurgeLogins.vue":"jPMG","./components/Search.vue":"JX/T","./components/Sharer.vue":"zV0C","./components/StoryCard.vue":"yDsy","./components/StoryForm.vue":"5lKZ","./components/TagLimiter.vue":"/j45","./components/Tags.vue":"4dkW","./components/TempSharing.vue":"FT2k","./components/UpdateNotifier.vue":"ui2e","./components/UserForm.vue":"bVTN","./components/Users.vue":"FOBs"};function i(t){var e=o(t);return n(e)}function o(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}i.keys=function(){return Object.keys(r)},i.resolve=o,t.exports=i,i.id="+fAT"},"/j45":function(t,e,n){"use strict";n.r(e);var r={props:{limit:{type:Number,required:!1,default:10},selector:{type:String,required:!1,default:"a"}},data:function(){return{items:null,count:0,more:!1}},mounted:function(){this.items=$(".items > ".concat(this.selector)),this.count=this.items.length,this.hide()},methods:{show:function(){var t=this;this.more=!0,this.items.each((function(e){e+1>t.limit&&$(t.items[e]).removeClass("d-none")}))},hide:function(){var t=this;this.more=!1,this.items.each((function(e){e+1>t.limit&&$(t.items[e]).addClass("d-none")}))}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.count>0,expression:"count > 0"}]},[n("span",{staticClass:"items"},[t._t("default")],2),t._v(" "),t.count>t.limit&&!1===t.more?n("button",{staticClass:"btn btn-outline-secondary btn-sm mb-1",attrs:{type:"button"},on:{click:t.show}},[n("i",{staticClass:"fas fa-plus"}),t._v(" "+t._s(t.count-t.limit)+"\n ")]):t._e(),t._v(" "),t.count>t.limit&&!0===t.more?n("button",{staticClass:"btn btn-outline-secondary btn-sm mb-1",attrs:{type:"button"},on:{click:t.hide}},[n("i",{staticClass:"fas fa-minus"})]):t._e()])}),[],!1,null,null,null);e.default=o.exports},0:function(t,e,n){n("bUC5"),t.exports=n("pyCd")},"0O8z":function(t,e,n){"use strict";n.r(e);var r=n("1IHE"),i=n("0fPN"),o={mixins:[i.a,r.a],props:{chest:{type:Object,required:!1,default:function(){}}},data:function(){return{form:{title:"",content:[],is_pinned:!1,tags:[]},loading:!1}},mounted:function(){this.chest&&(this.form=this.chest)},methods:{submit:function(t){var e=this;this.loading=!0,axios.request({method:this.chest?"PUT":"POST",url:this.chest?this.chest.url_update:"/api/chest",data:this.form}).then((function(n){switch(e.$toasted.success(e.__("Saved")),t){case"view":window.location=n.data.post.url;break;case"new":window.location="/chest/create";break;case"edit":window.location="/chest/".concat(n.data.post.postable_id,"/edit")}})).catch((function(t){e.loading=!1,e.setFormError(t),e.setHttpError(t),e.toastHttpError(e.__("Can't save"))}))}}},a=n("KHd+"),s=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--chest"},[n("div",{staticClass:"card-body"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"title"}},[t._v(t._s(t.__("Title")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.title,expression:"form.title"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("title")},attrs:{type:"text",id:"title",disabled:t.loading},domProps:{value:t.form.title},on:{input:function(e){e.target.composing||t.$set(t.form,"title",e.target.value)}}}),t._v(" "),t.hasFormError("title")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("title")))]):t._e()]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",[t._v(t._s(t.__("Content")))]),t._v(" "),n("chest-lines",{model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),t._v(" "),n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_pinned,expression:"form.is_pinned"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"is_pinned",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_pinned)?t._i(t.form.is_pinned,null)>-1:t.form.is_pinned},on:{change:function(e){var n=t.form.is_pinned,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_pinned",n.concat([null])):o>-1&&t.$set(t.form,"is_pinned",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_pinned",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_pinned",dusk:"chest-form-pinned"}},[t._v(t._s(t.__("Is pinned?")))])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",[t._v(t._s(t.__("Tags")))]),t._v(" "),n("tags",{model:{value:t.form.tags,callback:function(e){t.$set(t.form,"tags",e)},expression:"form.tags"}})],1)]),t._v(" "),n("div",{staticClass:"card-footer"},[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-primary",attrs:{type:"button",disabled:t.loading,dusk:"chest-form-save"},on:{click:function(e){return e.preventDefault(),t.submit("edit")}}},[t.loading?n("span",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status","aria-hidden":"true"}}):t._e(),t._v("\n "+t._s(t.__("Save"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-primary dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}}),t._v(" "),n("div",{staticClass:"dropdown-menu"},[n("button",{staticClass:"dropdown-item",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.submit("view")}}},[t._v(t._s(t.__("Save & View")))]),t._v(" "),n("button",{staticClass:"dropdown-item",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.submit("new")}}},[t._v(t._s(t.__("Save & New")))])])]),t._v(" "),t.chest?n("a",{staticClass:"btn btn-outline-primary",attrs:{href:t.chest.permalink}},[t._v(t._s(t.__("View")))]):t._e()])])}),[],!1,null,null,null);e.default=s.exports},"0TP3":function(t,e,n){"use strict";n.r(e);var r=n("9B9B"),i={mixins:[n.n(r).a],props:{preview:{type:null|Object,required:!1,default:null}},data:function(){return{lines:[],types:{url:this.__("URL"),text:this.__("Text"),password:this.__("Secret"),code:this.__("Code")},line:{type:"text",name:"",value:""},drag:!1,dragOptions:{animation:200,group:"lines",disabled:!1,ghostClass:"ghost",forceFallback:!0}}},methods:{addLine:function(t){var e=this;this.line.type=t,this.lines.push(this.line),this.line={type:"text",name:"",value:""},this.$nextTick((function(){var t=e.$refs.form.querySelectorAll('.row-line input[name="value"]');t[t.length-1].focus()}))},deleteLine:function(t){this.lines.splice(this.lines.indexOf(t),1)},toggleShowPassword:function(t,e){var n=t.target.parentNode.parentNode.firstChild;n.type="password"===n.type?"text":"password",t.target.innerHTML="password"===n.type?this.__("Show"):this.__("Hide")},setPassword:function(t,e){e.value=t}},watch:{"$attrs.value":function(t){this.lines=t},lines:function(t){this.$emit("input",t)}}},o=n("KHd+"),a=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"chest-lines"},[t.preview?n("section",{ref:"preview",staticClass:"my-3"},t._l(t.preview,(function(e,r){return n("div",{staticClass:"row mb-3"},[n("div",{staticClass:"col-12"},[n("strong",[t._v(t._s(e.name))])]),t._v(" "),n("div",{staticClass:"col-12"},["url"===e.type?n("a",{attrs:{href:e.value,target:"_blank"}},[t._v(t._s(e.value))]):"password"===e.type?n("div",{staticClass:"input-group input-group-sm"},[n("input",{staticClass:"form-control",attrs:{type:"password",autocomplete:"off",readonly:""},domProps:{value:e.value}}),t._v(" "),n("div",{staticClass:"input-group-append"},[n("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:function(e){return t.toggleShowPassword(e,r)}}},[t._v(t._s(t.__("Show")))]),t._v(" "),n("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:function(n){return t.copyToClipboard(n,e.value)}}},[t._v(t._s(t.__("Copy")))])])]):"code"===e.type?n("pre",{staticClass:"border p-2"},[n("code",[t._v(t._s(e.value))])]):n("span",[t._v(t._s(e.value))])])])})),0):n("section",{ref:"form"},[n("draggable",t._b({attrs:{group:"lines",handle:".handle-order"},on:{start:function(e){t.drag=!0},end:function(e){t.drag=!1}},model:{value:t.lines,callback:function(e){t.lines=e},expression:"lines"}},"draggable",t.dragOptions,!1),[n("transition-group",{attrs:{type:"transition",tag:"div",name:t.drag?null:"flip-list"}},t._l(t.lines,(function(e,r){return n("div",{key:"item-"+r,staticClass:"form-group"},[n("div",{staticClass:"row row-line"},[n("div",{staticClass:"col-12 col-md-4"},[n("div",{staticClass:"input-group"},[n("div",{staticClass:"input-group-prepend"},[n("button",{staticClass:"btn btn-outline-secondary dropdown-toggle",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[t._v(t._s(t.types[e.type]))]),t._v(" "),n("div",{staticClass:"dropdown-menu"},t._l(t.types,(function(r,i){return n("a",{staticClass:"dropdown-item",class:{active:i===e.type},on:{click:function(t){t.preventDefault(),e.type=i}}},[t._v(t._s(r))])})),0)]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.name,expression:"item.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.__("Name")},domProps:{value:e.name},on:{input:function(n){n.target.composing||t.$set(e,"name",n.target.value)}}})])]),t._v(" "),n("div",{staticClass:"col-12 col-md-8"},[n("div",{staticClass:"input-group"},["code"===e.type?n("textarea",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"item.value"}],staticClass:"form-control",attrs:{rows:"5",name:"value"},domProps:{value:e.value},on:{input:function(n){n.target.composing||t.$set(e,"value",n.target.value)}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"item.value"}],staticClass:"form-control",attrs:{type:"text",name:"value",autocomplete:"off"},domProps:{value:e.value},on:{input:function(n){n.target.composing||t.$set(e,"value",n.target.value)}}}),t._v(" "),n("div",{staticClass:"input-group-append"},["password"===e.type?n("password-generator",{attrs:{original:e.value},on:{generated:function(n){return t.setPassword(n,e)}}}):t._e(),t._v(" "),n("confirm",{staticClass:"btn btn-outline-secondary",attrs:{tag:"button",text:"<i class='fas fa-trash-alt'></i>","text-confirm":"<i class='fas fa-check'></i>"},on:{confirmed:function(n){return t.deleteLine(e)}}}),t._v(" "),n("button",{staticClass:"btn btn-outline-secondary handle-order",attrs:{type:"button"}},[n("i",{staticClass:"fas fa-arrows-alt"})])],1)])])])])})),0)],1),t._v(" "),n("div",{staticClass:"form-group text-right"},t._l(t.types,(function(e,r){return n("button",{staticClass:"btn btn-outline-secondary mr-1",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.addLine(r)}}},[t._v(t._s(t.__("Add"))+" "+t._s(e))])})),0)],1)])}),[],!1,null,null,null);e.default=a.exports},"0fPN":function(t,e,n){"use strict";e.a={data:function(){return{formErrors:{}}},methods:{setFormError:function(t){this.formErrors=t.response.data.errors},hasFormError:function(t){return this.formErrors.hasOwnProperty(t)},firstFormError:function(t){return this.hasFormError(t)?this.formErrors[t][0]:null},resetFormError:function(){this.formErrors={}}}}},"1IHE":function(t,e,n){"use strict";var r={data:function(){return{httpError:{}}},methods:{setHttpError:function(t){this.httpError=t.response.data.message||null},hasHttpError:function(t){return this.httpError},getHttpError:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.hasHttpError()?this.httpError:t},toastHttpError:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getHttpError(t);this.$toasted.error(e)}}};e.a=r},"1dGX":function(t,e,n){"use strict";e.Any=n("y8fO"),e.Cc=n("p7ys"),e.Cf=n("b9EY"),e.P=n("fKCf"),e.Z=n("T8I8")},"4dkW":function(t,e,n){"use strict";n.r(e);var r={data:function(){return{options:[],loading:!1}},mounted:function(){this.fetch()},methods:{fetch:function(){var t=this;this.loading=!0,axios.get("/api/tags").then((function(e){t.loading=!1,t.options=e.data})).catch((function(e){t.loading=!1,t.$toasted.error(t.__("Can't fetch tags")),console.log(e)}))},select:function(t){this.$attrs.value.push(t),this.$emit("input",this.$attrs.value)},deselect:function(t){this.$attrs.value.splice(this.$attrs.value.indexOf(t),1),this.$emit("input",this.$attrs.value)},create:function(t){this.options.push(t),this.$attrs.value.push(t)}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("multiselect",{attrs:{value:t.$attrs.value,"tag-placeholder":t.__("Create tag"),selectLabel:t.__("Click to select"),deselectLabel:t.__("Click to select"),noOptions:t.__("No tag"),placeholder:t.__("Search or type a tag"),"open-direction":"bottom",options:t.options,multiple:!0,taggable:!0,loading:t.loading,closeOnSelect:!1},on:{tag:t.create,select:t.select,remove:t.deselect}})}),[],!1,null,null,null);e.default=o.exports},"5lKZ":function(t,e,n){"use strict";n.r(e);var r=n("0fPN"),i=n("1IHE"),o={mixins:[r.a,i.a],props:{story:{type:Object,required:!1,default:function(){}}},data:function(){return{form:{title:"",slug:"",content:"",is_private:!1,is_pinned:!1,tags:[]},loading:!1,editor:{minHeight:"300px",language:document.getElementsByTagName("html")[0].getAttribute("lang")||"en",useCommandShortcut:!0,useDefaultHTMLSanitizer:!0,usageStatistics:!1,hideModeSwitch:!0,toolbarItems:["heading","bold","italic","strike","divider","hr","quote","divider","ul","ol","task","indent","outdent","divider","table","image","link","divider","code","codeblock"]}}},mounted:function(){this.story&&(this.form=this.story)},methods:{submit:function(t){var e=this;this.loading=!0,axios.request({method:this.story?"PUT":"POST",url:this.story?this.story.url_update:"/api/story",data:this.form}).then((function(n){switch(e.$toasted.success(e.__("Saved")),t){case"view":window.location=n.data.post.url;break;case"new":window.location="/story/create";break;case"edit":window.location="/story/".concat(n.data.post.postable_id,"/edit")}})).catch((function(t){e.loading=!1,e.setFormError(t),e.setHttpError(t),e.toastHttpError(e.__("Can't save"))}))}},computed:{fullUrl:function(){return"".concat(window.location.origin,"/").concat(this.form.slug)}},watch:{"form.title":function(t){this.form.slug=t.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")}}},a=n("KHd+"),s=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--story"},[n("div",{staticClass:"card-body"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"title"}},[t._v(t._s(t.__("Title")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.title,expression:"form.title"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("title")},attrs:{type:"text",id:"title",disabled:t.loading},domProps:{value:t.form.title},on:{input:function(e){e.target.composing||t.$set(t.form,"title",e.target.value)}}}),t._v(" "),t.hasFormError("title")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("title")))]):t._e(),t._v(" "),n("p",{staticClass:"text-muted"},[n("small",[t._v(t._s(t.fullUrl))])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"content"}},[t._v(t._s(t.__("Content")))]),t._v(" "),n("editor",{attrs:{id:"content",height:"auto",previewStyle:"tab",options:t.editor},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_private,expression:"form.is_private"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"is_private",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_private)?t._i(t.form.is_private,null)>-1:t.form.is_private},on:{change:function(e){var n=t.form.is_private,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_private",n.concat([null])):o>-1&&t.$set(t.form,"is_private",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_private",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_private",dusk:"story-form-private"}},[t._v(t._s(t.__("Is private?")))])])])]),t._v(" "),n("div",{staticClass:"col-12 col-md-6"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_pinned,expression:"form.is_pinned"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"is_pinned",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_pinned)?t._i(t.form.is_pinned,null)>-1:t.form.is_pinned},on:{change:function(e){var n=t.form.is_pinned,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_pinned",n.concat([null])):o>-1&&t.$set(t.form,"is_pinned",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_pinned",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_pinned",dusk:"story-form-pinned"}},[t._v(t._s(t.__("Is pinned?")))])])])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",[t._v(t._s(t.__("Tags")))]),t._v(" "),n("tags",{model:{value:t.form.tags,callback:function(e){t.$set(t.form,"tags",e)},expression:"form.tags"}})],1)]),t._v(" "),n("div",{staticClass:"card-footer"},[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-primary",attrs:{type:"button",disabled:t.loading,dusk:"story-form-save"},on:{click:function(e){return e.preventDefault(),t.submit("edit")}}},[t.loading?n("span",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status","aria-hidden":"true"}}):t._e(),t._v("\n "+t._s(t.__("Save"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-primary dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}}),t._v(" "),n("div",{staticClass:"dropdown-menu"},[n("button",{staticClass:"dropdown-item",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.submit("view")}}},[t._v(t._s(t.__("Save & View")))]),t._v(" "),n("button",{staticClass:"dropdown-item",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.submit("new")}}},[t._v(t._s(t.__("Save & New")))])])]),t._v(" "),t.story?n("a",{staticClass:"btn btn-outline-primary",attrs:{href:t.story.url}},[t._v(t._s(t.__("View")))]):t._e()])])}),[],!1,null,null,null);e.default=s.exports},"8/rJ":function(t,e,n){"use strict";n.r(e);var r={mixins:[n("1IHE").a],props:{type:{type:String,required:!0},text:{type:String,required:!0}},data:function(){return{loading:!1,status:null}},methods:{check:function(){var t=this;this.loading=!0,axios.get("/api/manage/features/".concat(this.type)).then((function(e){t.status=e.data.status,t.clear()})).catch((function(e){t.status="fail",t.setHttpError(e),t.toastHttpError(t.__("Whoops!")),t.clear()}))},clear:function(){var t=this;this.loading=!1,setTimeout((function(){t.status=null}),5e3)}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{class:{"btn-outline-danger":"fail"===t.status,"btn-outline-success":"success"===t.status},attrs:{type:"button",disabled:t.loading},on:{click:t.check}},[t.loading||null!==t.status?"success"===t.status?n("span",[t._v(t._s(t.__("Success")))]):"fail"===t.status?n("span",[t._v(t._s(t.__("Fail")))]):n("span",[n("div",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status"}})]):n("span",[t._v(t._s(t.text))])])}),[],!1,null,null,null);e.default=o.exports},"8oxB":function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var l,c=[],u=!1,d=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!u){var t=s(f);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d<e;)l&&l[d].run();d=-1,e=c.length}l=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new m(t,e)),1!==c.length||u||s(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},"9B9B":function(t,e){t.exports={methods:{copyToClipboard:function(t,e){var n=t.target.innerHTML;t.target.innerHTML=this.__("Copied");setTimeout((function(){t.target.innerHTML=n}),1e3);var r=document.createElement("textarea"),i=r.contentEditable,o=r.readOnly;r.value=e,r.contentEditable=!0,r.readOnly=!1,r.setAttribute("readonly",!1),r.setAttribute("contenteditable",!0),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);var a=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);r.select(),r.setSelectionRange(0,999999),document.execCommand("copy"),document.body.removeChild(r),a&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(a)),r.contentEditable=i,r.readOnly=o}}}},BEtg:function(t,e){t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},FOBs:function(t,e,n){"use strict";n.r(e);var r={data:function(){return{users:[],loading:!1,creating:!1,editing:!1}},mounted:function(){this.fetch()},methods:{fetch:function(){var t=this;this.loading=!0,axios.get("/api/manage/users").then((function(e){t.loading=!1,t.users=e.data.data})).catch((function(e){t.loading=!1,t.$toasted.error(t.__("Unable to load users"))}))},remove:function(t){var e=this;this.loading=!0,axios.delete("/api/manage/users/".concat(t.id)).then((function(t){e.$toasted.success(e.__("Deleted")),e.fetch()})).catch((function(t){"error"===t.response.data.status?e.$toasted.error(t.response.data.message):e.$toasted.error(e.__("Can't delete")),e.loading=!1}))},add:function(){this.creating=!0,this.editing=!1},edit:function(t){this.creating=!1,this.editing=t},formSubmited:function(){this.creating=!1,this.editing=!1,this.fetch()}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card"},[n("div",{staticClass:"card-header d-flex justify-content-between align-items-center"},[n("span",[n("i",{staticClass:"fas fa-users mr-1"}),t._v(" "+t._s(t.__("Users")))]),t._v(" "),n("button",{staticClass:"btn btn-primary btn-sm text-white",on:{click:function(e){return t.add()}}},[t._v(t._s(t.__("Add user")))])]),t._v(" "),n("div",{staticClass:"card-body"},[n("loader",{attrs:{loading:t.loading}}),t._v(" "),t.loading?t._e():n("div",{staticClass:"table-responsive"},[n("table",{staticClass:"table table-borderless table-sm"},[n("thead",[n("tr",[n("th",[t._v(t._s(t.__("Name")))]),t._v(" "),n("th",[t._v(t._s(t.__("E-Mail Address")))]),t._v(" "),n("th",[t._v(t._s(t.__("Is admin?")))]),t._v(" "),n("th",[t._v("#")])])]),t._v(" "),n("tbody",t._l(t.users,(function(e){return n("tr",[n("td",[t._v(t._s(e.name))]),t._v(" "),n("td",[t._v(t._s(e.email))]),t._v(" "),n("td",[t._v(t._s(e.is_admin?t.__("Yes"):t.__("No")))]),t._v(" "),n("td",[n("button",{staticClass:"btn btn-info btn-sm text-white",on:{click:function(n){return t.edit(e)}}},[t._v(t._s(t.__("Edit")))]),t._v(" "),n("confirm",{staticClass:"btn btn-danger btn-sm text-white",attrs:{text:t.__("Delete"),"text-confirm":t.__("Confirm")},on:{confirmed:function(n){return t.remove(e)}}})],1)])})),0)])])],1),t._v(" "),t.creating||t.editing?n("div",{staticClass:"card-footer"},[n("user-form",{attrs:{user:t.editing},on:{submited:function(e){return t.formSubmited()}}})],1):t._e()])}),[],!1,null,null,null);e.default=o.exports},FT2k:function(t,e,n){"use strict";n.r(e);var r=n("1IHE"),i=n("9B9B"),o={mixins:[n.n(i).a,r.a],data:function(){return{loading:!1,open:!1,post:null,shares:[],form:{expiration:"hour"},expirations:[{key:"hour",name:"1 hour"},{key:"hours",name:"12 hours"},{key:"day",name:"1 day"},{key:"days",name:"3 days"},{key:"week",name:"1 week"},{key:"weeks",name:"2 weeks"},{key:"month",name:"1 month"}]}},mounted:function(){var t=this;this.$bus.$on("share",(function(e){t.post=e,t.open=!0,t.get()}))},methods:{get:function(){var t=this;axios.get(this.post.url_share).then((function(e){t.shares=e.data.shares})).catch((function(e){t.setHttpError(e),t.toastHttpError(t.__("Can't fetch shares"))}))},generate:function(){var t=this;this.loading=!0,axios.post(this.post.url_share,{expiration:this.form.expiration}).then((function(e){t.loading=!1,t.shares.unshift(e.data.share),t.$toasted.success(t.__("Link generated"))})).catch((function(e){t.loading=!1,t.setHttpError(e),t.toastHttpError(t.__("Unable to create link for this content"))}))}},watch:{open:function(t){!1===t&&(this.post=null,this.shares=[])}}},a=n("KHd+"),s=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("modal",{attrs:{open:t.open,size:"lg"},on:{closed:function(e){t.open=!1}},scopedSlots:t._u([{key:"header",fn:function(){return[t._v(t._s(t.__("Temp sharing of :title",{title:t.post.title})))]},proxy:!0},{key:"content",fn:function(){return[n("h4",[t._v(t._s(t.__("Create link")))]),t._v(" "),n("p",[t._v(t._s(t.__("Content will be accessible even private until expiration.")))]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"expiration"}},[t._v(t._s(t.__("Link expires in")))]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.form.expiration,expression:"form.expiration"}],staticClass:"form-control custom-select",attrs:{name:"expiration",id:"expiration"},on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,"expiration",e.target.multiple?n:n[0])}}},t._l(t.expirations,(function(e){return n("option",{domProps:{value:e.key}},[t._v(t._s(t.__(e.name)))])})),0)]),t._v(" "),n("div",{staticClass:"form-group"},[n("button",{staticClass:"btn btn-outline-primary",attrs:{type:"button",disabled:t.loading},on:{click:t.generate}},[t.loading?n("span",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status","aria-hidden":"true"}}):t._e(),t._v("\n "+t._s(t.__("Generate"))+"\n ")])]),t._v(" "),n("h4",[t._v(t._s(t.__("Active links")))]),t._v(" "),t.shares.length>0?n("table",{staticClass:"table table-borderless table-sm"},[n("thead",[n("tr",[n("th",{staticClass:"w-75"},[t._v(t._s(t.__("URL")))]),t._v(" "),n("th",{staticClass:"w-25"},[t._v(t._s(t.__("Expiration")))])])]),t._v(" "),n("tbody",t._l(t.shares,(function(e){return n("tr",[n("td",[n("div",{staticClass:"input-group input-group-sm"},[n("input",{staticClass:"form-control",attrs:{type:"text"},domProps:{value:e.url}}),t._v(" "),n("div",{staticClass:"input-group-append"},[n("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:function(n){return t.copyToClipboard(n,e.url)}}},[t._v(t._s(t.__("Copy")))])])])]),t._v(" "),n("td",[t._v(t._s(e.expires_at))])])})),0)]):n("div",{staticClass:"alert alert-info"},[t._v(t._s(t.__("This content is not actually shared")))])]},proxy:!0}])})}),[],!1,null,null,null);e.default=s.exports},G1fO:function(t,e,n){"use strict";n.r(e);var r={props:{comment:{type:Object,required:!0}},computed:{unvisibleComment:function(){return this.isLogged()&&!1===this.comment.is_visible}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"comment"},[n("div",{staticClass:"d-flex justify-content-between"},[n("span",[t.unvisibleComment?n("i",{staticClass:"fas fa-exclamation-triangle mr-1"}):t._e(),t._v(" "),n("strong",[t._v(t._s(t.comment.name))]),t._v(" "),n("small",[t._v(t._s(t.comment.date_formated))])]),t._v(" "),n("span",[t.unvisibleComment?n("confirm",{staticClass:"text-info mr-1",attrs:{tag:"a",text:"<i class='fas fa-user-check fa-fw'></i>","text-confirm":"<i class='fas fa-check fa-fw'></i>"},on:{confirmed:function(e){return t.$bus.$emit("moderate",t.comment)}}}):t._e(),t._v(" "),t.isLogged()?n("confirm",{staticClass:"text-info mr-1",attrs:{tag:"a",text:"<i class='fas fa-trash-alt fa-fw'></i>","text-confirm":"<i class='fas fa-check fa-fw'></i>"},on:{confirmed:function(e){return t.$bus.$emit("delete",t.comment)}}}):t._e(),t._v(" "),n("a",{staticClass:"text-info",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.$bus.$emit("reply",t.comment)}}},[n("i",{staticClass:"fas fa-reply"})])],1)]),t._v(" "),n("p",{staticClass:"mb-0"},[t._v(t._s(t.comment.content))])]),t._v(" "),t._l(t.comment.comments,(function(e){return t.comment.comments.length>0?n("comment",{key:e.id,staticClass:"replies",attrs:{comment:e}}):t._e()}))],2)}),[],!1,null,null,null);e.default=o.exports},GYWy:function(t,e,n){(function(t,r){var i;!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var s,l=2147483647,c=36,u=1,d=26,f=38,p=700,m=72,h=128,_="-",v=/^xn--/,g=/[^\x20-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=c-u,C=Math.floor,T=String.fromCharCode;function I(t){throw new RangeError(y[t])}function w(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function S(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+w((t=t.replace(E,".")).split("."),e).join(".")}function O(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function D(t){return w(t,(function(t){var e="";return t>65535&&(e+=T((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=T(t)})).join("")}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function N(t,e,n){var r=0;for(t=n?C(t/p):t>>1,t+=C(t/e);t>b*d>>1;r+=c)t=C(t/b);return C(r+(b+1)*t/(t+f))}function A(t){var e,n,r,i,o,a,s,f,p,v,g,E=[],y=t.length,b=0,T=h,w=m;for((n=t.lastIndexOf(_))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&I("not-basic"),E.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<y;){for(o=b,a=1,s=c;i>=y&&I("invalid-input"),((f=(g=t.charCodeAt(i++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:c)>=c||f>C((l-b)/a))&&I("overflow"),b+=f*a,!(f<(p=s<=w?u:s>=w+d?d:s-w));s+=c)a>C(l/(v=c-p))&&I("overflow"),a*=v;w=N(b-o,e=E.length+1,0==o),C(b/e)>l-T&&I("overflow"),T+=C(b/e),b%=e,E.splice(b++,0,T)}return D(E)}function P(t){var e,n,r,i,o,a,s,f,p,v,g,E,y,b,w,S=[];for(E=(t=O(t)).length,e=h,n=0,o=m,a=0;a<E;++a)(g=t[a])<128&&S.push(T(g));for(r=i=S.length,i&&S.push(_);r<E;){for(s=l,a=0;a<E;++a)(g=t[a])>=e&&g<s&&(s=g);for(s-e>C((l-n)/(y=r+1))&&I("overflow"),n+=(s-e)*y,e=s,a=0;a<E;++a)if((g=t[a])<e&&++n>l&&I("overflow"),g==e){for(f=n,p=c;!(f<(v=p<=o?u:p>=o+d?d:p-o));p+=c)w=f-v,b=c-v,S.push(T(R(v+w%b,0))),f=C(w/b);S.push(T(R(f,0))),o=N(n,y,r==i),n=0,++r}++n,++e}return S.join("")}s={version:"1.4.1",ucs2:{decode:O,encode:D},decode:A,encode:P,toASCII:function(t){return S(t,(function(t){return g.test(t)?"xn--"+P(t):t}))},toUnicode:function(t){return S(t,(function(t){return v.test(t)?A(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n("YuTi")(t),n("yLpj"))},HHJa:function(t,e){t.exports={methods:{isLogged:function(){return null!==this.user()},user:function(){return window.user||null}}}},"JX/T":function(t,e,n){"use strict";n.r(e);var r={props:{url:{type:String,required:!0}},data:function(){return{query:null,results:{},loading:!1,selected:null,history:[],focused:!1}},mounted:function(){var t=this;this.fetchHistory(),document.addEventListener("keydown",(function(e){-1!==["/"].indexOf(e.key)&&function(t){return"INPUT"!==t.target.tagName&&"TEXTAREA"!==t.target.tagName}(e)&&(e.preventDefault(),e.stopPropagation(),t.$refs.input.focus())}))},methods:{search:function(){var t=this;this.loading=!0,axios.post(this.url,{query:this.query}).then((function(e){t.loading=!1,200===e.status&&(t.results=e.data,t.selected=null,t.addHistory(t.query))})).catch((function(e){t.loading=!1,console.log(e)}))},hide:function(){this.query=null,this.results={},this.selected=null},choose:function(){this.selected&&this.displaySearchHistory&&(this.query=this.selected),this.selected&&this.hasResults&&(window.location=this.selected.url)},move:function(t){this.displaySearchHistory?this.moveIn(this.history,t):this.hasResults?this.moveIn(this.results.posts,t):this.selected=null},moveIn:function(t,e){var n=this.selected?t.indexOf(this.selected):null,r=t.length-1;"down"===e&&(this.selected=null===n||n===r?t[0]:t[n+1]),"up"===e&&(this.selected=null===n||0===n?t[r]:t[n-1])},fetchHistory:function(){var t=localStorage.getItem("searchHistory")||null;if(t)try{this.history=JSON.parse(t)}catch(t){console.log("Unable to parse search history from local storage")}},addHistory:function(t){!1!==this.hasResults&&-1===this.history.indexOf(t)&&(this.history.unshift(t),this.history=this.history.slice(0,5),localStorage.setItem("searchHistory",JSON.stringify(this.history)))}},computed:{hasResults:function(){return this.hasTagsResults||this.hasPostsResults},hasTagsResults:function(){return this.results.hasOwnProperty("tags")&&this.results.tags.length>0},hasPostsResults:function(){return this.results.hasOwnProperty("posts")&&this.results.posts.length>0},displaySearchHistory:function(){return this.history.length>0&&null===this.query&&this.focused},displayNoResultIndicator:function(){return null!==this.query&&this.query.length>=3&&!1===this.loading&&!1===this.hasResults}},watch:{query:_.debounce((function(t){t&&t.length>=3&&this.search(t),0===t.length&&this.hide()}),200)}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{staticClass:"form-inline"},[n("div",{staticClass:"search-input-wrapper"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"input",staticClass:"form-control",attrs:{type:"search",placeholder:t.__("Type / to search")},domProps:{value:t.query},on:{focus:function(e){t.focused=!0},blur:function(e){t.focused=!1},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.stopPropagation(),t.move("down"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.stopPropagation(),t.move("up"))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),e.stopPropagation(),t.choose(e))}],input:function(e){e.target.composing||(t.query=e.target.value)}}}),t._v(" "),t.loading?n("div",{staticClass:"spinner-border spinner-border-sm text-info",attrs:{role:"status"}}):t._e(),t._v(" "),t.displayNoResultIndicator?n("span",{staticClass:"badge badge-info text-white",attrs:{role:"status"}},[t._v("\n "+t._s(t.__("No result"))+"\n ")]):t._e()]),t._v(" "),n("div",{directives:[{name:"on-clickaway",rawName:"v-on-clickaway",value:t.hide,expression:"hide"}],staticClass:"list-group results mt-1",class:{active:t.hasResults||t.displaySearchHistory}},[t._l(t.history,(function(e){return t.displaySearchHistory?n("a",{staticClass:"list-group-item list-group-item-action",class:{active:t.selected===e}},[n("span",[n("i",{staticClass:"fas fa-history fa-fw mr-1"}),t._v(" "+t._s(e))])]):t._e()})),t._v(" "),t.hasTagsResults?n("div",{staticClass:"list-group-item"},[n("div",[n("i",{staticClass:"fas fa-tags"}),t._v(" "+t._s(t.__("Tags")))]),t._v(" "),n("div",t._l(t.results.tags,(function(e){return n("a",{staticClass:"btn btn-primary btn-sm mr-1",attrs:{href:e.url}},[t._v("\n "+t._s(e.name)+"\n ")])})),0)]):t._e(),t._v(" "),t._l(t.results.posts,(function(e,r){return t.hasPostsResults?n("a",{staticClass:"list-group-item list-group-item-action",class:{active:t.selected===e},attrs:{href:e.url}},[n("div",[n("span",[t._v(t._s(e.type)+" —")]),t._v(" "),n("strong",[t._v(t._s(e.title))])]),t._v(" "),e.tags.length>0?n("div",t._l(e.tags,(function(e){return n("span",{staticClass:"badge badge-secondary mr-1"},[t._v(t._s(e))])})),0):t._e()]):t._e()}))],2)])}),[],!1,null,null,null);e.default=o.exports},K3gU:function(t,e,n){"use strict";n.r(e);var r={mixins:[n("1IHE").a],data:function(){return{archives:[],loading:!0}},mounted:function(){this.fetch()},methods:{fetch:function(){var t=this;this.loading=!0,axios.get("/api/manage/archives").then((function(e){t.archives=e.data,t.loading=!1})).catch((function(e){t.setHttpError(e),t.toastHttpError(t.__("Can't fetch archives"))}))},deleteArchive:function(t){var e=this;axios.delete(t.url_archive).then((function(t){e.$toasted.success(t.data.message),e.fetch()})).catch((function(t){e.setHttpError(t),e.toastHttpError(e.__("Whoops!"))}))}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card"},[n("div",{staticClass:"card-header"},[n("i",{staticClass:"fas fa-archive mr-1"}),t._v("\n "+t._s(t.__("Archives"))+"\n ")]),t._v(" "),t.loading?n("div",{staticClass:"card-body"},[n("loader",{attrs:{loading:t.loading}})],1):n("div",{staticClass:"card-body"},[0===t.archives.length?n("div",{staticClass:"alert alert-info"},[t._v("\n "+t._s(t.__("No archive"))+"\n ")]):n("div",{staticClass:"table-responsive"},[n("table",{staticClass:"table table-borderless table-sm"},[n("thead",[n("tr",[n("th",[t._v(t._s(t.__("Link")))]),t._v(" "),n("th",[t._v(t._s(t.__("Actions")))])])]),t._v(" "),n("tbody",t._l(t.archives,(function(e){return n("tr",[n("td",{staticClass:"align-middle"},[-1!==["pdf"].indexOf(e.extension)?n("span",[n("i",{staticClass:"fas fa-file-pdf mr-1"})]):-1!==["mp4","webm","mpeg","avi","mkv"].indexOf(e.extension)?n("span",[n("i",{staticClass:"fas fa-file-video mr-1"})]):-1!==["mp3","wav","flac"].indexOf(e.extension)?n("span",[n("i",{staticClass:"fas fa-file-audio mr-1"})]):n("span",[n("i",{staticClass:"fas fa-file mr-1"})]),t._v(" "),n("a",{attrs:{href:e.permalink}},[t._v("\n "+t._s(e.title.substr(0,40))+"\n "),e.title.lenght>=40?n("span",[t._v("...")]):t._e()]),t._v(" "),n("small",{staticClass:"text-muted"},[t._v(t._s(e.size))])]),t._v(" "),n("td",[n("div",{staticClass:"dropdown"},[n("button",{staticClass:"btn btn-outline-secondary btn-sm dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[t._v("\n "+t._s(t.__("More"))+"\n ")]),t._v(" "),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[n("a",{staticClass:"dropdown-item",attrs:{href:e.url_download}},[n("i",{staticClass:"fas fa-file-download fa-fw mr-1"}),t._v(" "+t._s(t.__("Download"))+"\n ")]),t._v(" "),n("confirm",{staticClass:"dropdown-item",attrs:{text:"<i class='fas fa-trash-alt fa-fw mr-1'></i> "+t.__("Delete"),"text-confirm":"<i class='fas fa-check fa-fw mr-1'></i> "+t.__("Confirm")},on:{confirmed:function(n){return t.deleteArchive(e)}}})],1)])])])})),0)])])])])}),[],!1,null,null,null);e.default=o.exports},"KHd+":function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),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 d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}n.d(e,"a",(function(){return r}))},MX7w:function(t,e,n){"use strict";n.r(e);var r=n("9B9B"),i={mixins:[n.n(r).a],props:{single:{type:Boolean,required:!1,default:!1},chest:{type:Object,required:!0,default:function(){}}},data:function(){return{edit:!1}},methods:{remove:function(){var t=this;axios.delete(this.chest.url_delete).then((function(e){t.$toasted.success(t.__("Deleted")),t.single?window.location="/":window.location.reload()})).catch((function(e){t.$toasted.error(t.__("Can't delete"))}))},copyAll:function(t){var e="";this.chest.content.forEach((function(t){t.name&&(e+="".concat(t.name,": ")),e+="code"===t.type?"\n".concat(t.value,"\n"):"".concat(t.value,"\n")})),this.copyToClipboard(t,e)}}},o=n("KHd+"),a=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--chest mb-4",class:{"card-single":t.single,"card-index":!t.single}},[n("div",{staticClass:"card-body"},[n("h5",{staticClass:"card-title"},[t.chest.is_pinned&&!t.single?n("i",{staticClass:"fas fa-thumbtack fa-sm pr-1"}):t._e(),t._v(" "),n("span",[t._v(t._s(t.__("Chest")))]),t._v(" — "),n("a",{attrs:{href:t.chest.permalink}},[t._v(t._s(t.chest.title))])]),t._v(" "),n("div",{staticClass:"card-content"},[n("chest-lines",{attrs:{preview:t.chest.content}})],1),t._v(" "),t.chest.tags.length>0?n("p",{staticClass:"card-text mt-1"},t._l(t.chest.tags,(function(e){return n("a",{staticClass:"badge badge-secondary mr-1",attrs:{href:"/tag/"+e}},[t._v(t._s(e))])})),0):t._e()]),t._v(" "),n("div",{staticClass:"card-footer d-flex justify-content-between"},[n("span",[t.chest.is_private?n("i",{staticClass:"fas fa-lock pr-2"}):t._e(),t._v(t._s(t.chest.date_formated))]),t._v(" "),n("div",{staticClass:"dropdown"},[n("button",{staticClass:"btn btn-outline-dark btn-sm dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",dusk:"chest-card-more"}},[t._v("\n "+t._s(t.__("More"))+"\n ")]),t._v(" "),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[n("a",{staticClass:"dropdown-item",attrs:{href:t.chest.permalink,dusk:"chest-card-permalink"}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink"))+"\n ")]),t._v(" "),n("button",{staticClass:"dropdown-item",attrs:{type:"button",dusk:"chest-card-copy"},on:{click:t.copyAll}},[n("i",{staticClass:"fas fa-copy fa-fw mr-1"}),t._v(" "+t._s(t.__("Copy all"))+"\n ")]),t._v(" "),t.chest.editable?n("h6",{staticClass:"dropdown-header"},[t._v(t._s(t.__("Manage")))]):t._e(),t._v(" "),t.chest.editable?n("a",{staticClass:"dropdown-item",attrs:{dusk:"chest-card-temp-share"},on:{click:function(e){return t.$bus.$emit("share",t.chest)}}},[n("i",{staticClass:"fas fa-share-square fa-fw mr-1"}),t._v(" "+t._s(t.__("Temp sharing"))+"\n ")]):t._e(),t._v(" "),t.chest.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.chest.url_edit,dusk:"chest-card-edit"}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit"))+"\n ")]):t._e(),t._v(" "),t.chest.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:"<i class='fas fa-trash-alt fa-fw mr-1'></i> "+t.__("Delete"),"text-confirm":"<i class='fas fa-check fa-fw mr-1'></i> "+t.__("Confirm"),dusk:"chest-card-remove"},on:{confirmed:t.remove}}):t._e()],1)])])])}),[],!1,null,null,null);e.default=a.exports},NyNk:function(t,e,n){"use strict";n.r(e);var r={mixins:[n("1IHE").a],data:function(){return{tags:[],loading:!0,editing:null,edit:null}},mounted:function(){this.fetch()},methods:{fetch:function(){var t=this;this.loading=!0,axios.get("/api/manage/tags").then((function(e){t.tags=e.data,t.loading=!1})).catch((function(e){t.setHttpError(e),t.toastHttpError(t.__("Can't fetch tags"))}))},move:function(t,e){var n=this;"none"!==e&&confirm(this.__("All elements tagged :from will be moved to :to. Selected tag will be deleted. Are you sure?",{from:t,to:e}))&&(this.loading=!0,axios.post("/api/manage/tags/".concat(t,"/move/").concat(e)).then((function(r){n.$toasted.success(n.__("Elements tagged :from have been moved to :to.",{from:t,to:e})),n.fetch()})).catch((function(t){n.$toasted.error(n.__("Can't save"))})))},remove:function(t){var e=this;this.loading=!0,axios.delete("/api/manage/tags/".concat(t.name)).then((function(t){e.$toasted.success(e.__("Deleted")),e.fetch()})).catch((function(t){e.$toasted.error(e.__("Can't delete"))}))},rename:function(){var t=this;this.editing.name!==this.edit&&axios.put("/api/manage/tags/".concat(this.editing.name,"/rename/").concat(this.edit)).then((function(e){t.$toasted.success(t.__("Saved")),t.fetch()})).catch((function(e){t.$toasted.error(t.__("Can't save"))})),this.editing=null,this.edit=null}},watch:{editing:function(t){var e=this;null!==t&&this.$nextTick((function(){e.edit=t.name;var n="input#input".concat(t.id);document.querySelector(n).focus()})),this.edit=null}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card"},[n("div",{staticClass:"card-header"},[n("i",{staticClass:"fas fa-tags mr-1"}),t._v("\n "+t._s(t.__("Tags"))+"\n ")]),t._v(" "),t.loading?n("div",{staticClass:"card-body"},[n("loader",{attrs:{loading:t.loading}})],1):n("div",{staticClass:"card-body"},[0===t.tags.length?n("div",{staticClass:"alert alert-info"},[t._v("\n "+t._s(t.__("No tag"))+"\n ")]):n("div",{staticClass:"table-responsive"},[n("table",{staticClass:"table table-borderless table-sm"},[n("thead",[n("tr",[n("th",{staticClass:"w-25"},[t._v(t._s(t.__("Name")))]),t._v(" "),n("th",[t._v(t._s(t.__("Posts")))]),t._v(" "),n("th",{staticClass:"w-50"},[t._v(t._s(t.__("Actions")))])])]),t._v(" "),n("tbody",t._l(t.tags,(function(e){return n("tr",[n("td",{staticClass:"align-middle"},[null!==t.editing&&t.editing.id===e.id?n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.edit,expression:"edit"}],staticClass:"form-control",attrs:{type:"text",id:"input"+e.id},domProps:{value:t.edit},on:{input:function(e){e.target.composing||(t.edit=e.target.value)}}})]):n("div",[n("a",{attrs:{href:"/tag/"+e.name}},[t._v(t._s(e.name))])])]),t._v(" "),n("td",{staticClass:"align-middle"},[t._v(t._s(e.posts_count))]),t._v(" "),n("td",{staticClass:"d-flex justify-content-between"},[null===t.editing||null!==t.editing&&t.editing.id!==e.id?n("button",{staticClass:"btn btn-outline-secondary btn-sm mr-1",attrs:{type:"button",disabled:null!==t.editing&&t.editing.id!==e.id},on:{click:function(n){n.preventDefault(),t.editing=e}}},[n("i",{staticClass:"fas fa-edit"})]):n("button",{staticClass:"btn btn-outline-secondary btn-sm mr-1",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.rename()},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.rename())}}},[n("i",{staticClass:"fas fa-check"})]),t._v(" "),n("select",{staticClass:"form-control custom-select mr-1 w-auto flex-grow-1",attrs:{name:"tag",id:"tag"},on:{change:function(n){return t.move(e.name,n.target.value)}}},[n("option",{attrs:{value:"none"}},[t._v("-- "+t._s(t.__("Move"))+" --")]),t._v(" "),t._l(t.tags,(function(r){return e.name!==r.name?n("option",{domProps:{value:r.name,textContent:t._s(r.name)}}):t._e()}))],2),t._v(" "),n("confirm",{staticClass:"btn btn-danger btn-sm",attrs:{tag:"button",text:t.__("Delete"),"text-confirm":t.__("Confirm")},on:{confirmed:function(n){return t.remove(e)}}})],1)])})),0)])])])])}),[],!1,null,null,null);e.default=o.exports},S4HP:function(t,e,n){"use strict";n.r(e);var r={props:{loading:{type:Boolean,required:!1,default:!1}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this.$createElement,e=this._self._c||t;return this.loading?e("div",{staticClass:"d-flex align-content-center align-items-center"},[e("div",{staticClass:"spinner-grow mr-2",attrs:{role:"status"}}),this._v(" "),e("div",[this._v(this._s(this.__("Loading")))])]):this._e()}),[],!1,null,null,null);e.default=o.exports},T8I8:function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},TfHT:function(t,e,n){"use strict";n.r(e);var r=n("0fPN"),i=n("1IHE");function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={mixins:[r.a,i.a],props:{id:{type:Number,required:!0},allowGuest:{type:Boolean,required:!1,default:!0},captcha:{type:Object,required:!1,default:function(){return null}}},data:function(){return{loading:!0,count:0,comments:[],comment:{comment:null,content:"",name:null,email:null,captcha:null}}},mounted:function(){var t=this;this.fetch(),this.$bus.$on("reply",(function(e){t.comment.comment=e})),this.$bus.$on("moderate",(function(e){t.moderate(e)})),this.$bus.$on("delete",(function(e){t.delete(e)})),this.initFromStorage()},methods:{fetch:function(){var t=this;this.loading=!0,axios.get("/api/comments/".concat(this.id)).then((function(e){t.count=e.data.comments.length||0,t.comments=t.nested(e.data.comments),t.loading=!1})).catch((function(e){t.setHttpError(e),t.toastHttpError(),t.loading=!1}))},submit:function(){var t=this;this.loading=!0,axios.post("/api/comments/".concat(this.id),{name:this.comment.name,email:this.comment.email,content:this.comment.content,reply:this.comment.comment?this.comment.comment.id:null,captcha:this.captcha?this.comment.captcha:null,key:this.captcha?this.captcha.key:null}).then((function(e){t.loading=!1,t.$toasted.success(e.data.message),t.resetFormError(),t.comment.content=null,t.comment.comment=null,t.fetch()})).catch((function(e){t.setFormError(e),t.setHttpError(e),t.toastHttpError(),t.loading=!1}))},moderate:function(t){var e=this;this.loading=!0,axios.post("/api/comments/".concat(this.id,"/moderate/").concat(t.id)).then((function(t){e.loading=!1,e.$toasted.success(t.data.message),e.fetch()})).catch((function(t){e.setHttpError(t),e.toastHttpError(),e.loading=!1}))},delete:function(t){var e=this;this.loading=!0,axios.delete("/api/comments/".concat(this.id,"/").concat(t.id)).then((function(t){e.loading=!1,e.$toasted.success(t.data.message),e.fetch()})).catch((function(t){e.setHttpError(t),e.toastHttpError(),e.loading=!1}))},nested:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"comment_id";return t.filter((function(t){return t[r]===n})).map((function(n){return a({},n,{comments:e.nested(t,n.id)})}))},removeReply:function(){this.comment.comment=null},initFromStorage:function(){var t=JSON.parse(localStorage.getItem("comment"));null!==t&&!1===this.isLogged()&&(this.comment.name=t.name||null,this.comment.email=t.email||null)},commentToStorage:function(){localStorage.setItem("comment",JSON.stringify({name:this.comment.name,email:this.comment.email}))},getRandomId:function(){return Math.floor(Math.random()*Math.floor(999999))}},watch:{"comment.comment":function(t){this.$refs.commentFormContent.focus()},"comment.name":_.debounce((function(t){this.commentToStorage()}),200),"comment.email":_.debounce((function(t){this.commentToStorage()}),200)},computed:{canAddComment:function(){return this.isLogged()||this.allowGuest},canSubmit:function(){var t=this.comment.content&&this.comment.content.length>=3,e=this.comment.captcha&&this.comment.captcha.length>0;return this.isLogged()?!0===t:!0===t&&!0===e}}},c=n("KHd+"),u=Object(c.a)(l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--comments"},[n("div",{staticClass:"card-header d-flex justify-content-between"},[t._v("\n "+t._s(t.__("Comments"))+"\n "),n("span",{staticClass:"d-block badge text-white",class:{"badge-info":t.count>0,"badge-default":0===t.count}},[t._v(t._s(t.count))])]),t._v(" "),n("div",{staticClass:"card-body"},[t.loading?n("loader",{attrs:{loading:t.loading}}):n("div",[0===t.comments.length?n("div",{staticClass:"alert alert-info mb-0"},[t._v(t._s(t.__("No comments")))]):t._e(),t._v(" "),t._l(t.comments,(function(t){return n("comment",{key:t.id,attrs:{comment:t}})}))],2)],1),t._v(" "),t.canAddComment?n("div",{staticClass:"card-footer"},[n("h5",{staticClass:"card-title d-flex justify-content-between flex-wrap"},[t._v("\n "+t._s(t.__("New comment"))+"\n "),t.comment.comment?n("small",[n("i",{staticClass:"fas fa-reply mr-1"}),t._v(" "+t._s(t.__("Replying to :name",{name:t.comment.comment.name}))+"\n ")]):t._e()]),t._v(" "),!1===t.isLogged()?n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.comment.name,expression:"comment.name"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("name")},attrs:{type:"text",placeholder:t.__("Name"),required:""},domProps:{value:t.comment.name},on:{input:function(e){e.target.composing||t.$set(t.comment,"name",e.target.value)}}}),t._v(" "),t.hasFormError("name")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("name")))]):t._e()])]),t._v(" "),n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.comment.email,expression:"comment.email"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("email")},attrs:{type:"email",placeholder:t.__("E-Mail Address"),required:""},domProps:{value:t.comment.email},on:{input:function(e){e.target.composing||t.$set(t.comment,"email",e.target.value)}}}),t._v(" "),t.hasFormError("email")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("email")))]):t._e()])])]):t._e(),t._v(" "),n("div",{staticClass:"form-group"},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.comment.content,expression:"comment.content"}],ref:"commentFormContent",staticClass:"form-control",class:{"is-invalid":t.hasFormError("content")},attrs:{placeholder:t.__("Content"),required:""},domProps:{value:t.comment.content},on:{input:function(e){e.target.composing||t.$set(t.comment,"content",e.target.value)}}}),t._v(" "),t.hasFormError("content")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("content")))]):t._e()]),t._v(" "),n("div",{staticClass:"row"},[t.captcha&&!1===t.isLogged()?n("div",{staticClass:"col-12 col-md-8 mb-1 d-flex"},[n("img",{staticClass:"d-inline-block mr-md-1 mb-1 mb-md-0 mx-auto mx-md-0",staticStyle:{"border-radius":"1rem",width:"150px",height:"40px"},attrs:{src:t.captcha.img,alt:"Captcha"}}),t._v(" "),n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.comment.captcha,expression:"comment.captcha"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("captcha")},attrs:{type:"text",placeholder:t.__("Captcha")},domProps:{value:t.comment.captcha},on:{input:function(e){e.target.composing||t.$set(t.comment,"captcha",e.target.value)}}}),t._v(" "),t.hasFormError("captcha")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("captcha")))]):t._e()])]):t._e(),t._v(" "),n("div",{staticClass:"col-12 col-md-4"},[n("button",{staticClass:"btn btn-primary btn-block",attrs:{type:"button",disabled:t.loading||!1===t.canSubmit},on:{click:function(e){return e.preventDefault(),t.submit(e)}}},[t._v(t._s(t.__("Save")))])])])]):t._e()])}),[],!1,null,null,null);e.default=u.exports},URgk:function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n("YBdB"),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n("yLpj"))},XHP3:function(t,e){t.exports={methods:{__:function(t,e){var n=window.i18n[t]?window.i18n[t]:t;return _.forEach(e,(function(t,e){n=n.replace(":"+e,t)})),n}}}},YBdB:function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,l=1,c={},u=!1,d=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){m(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){m(t.data)},r=function(t){o.port2.postMessage(t)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(t){var e=d.createElement("script");e.onreadystatechange=function(){m(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(m,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&m(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return c[l]=i,r(l),l++},f.clearImmediate=p}function p(t){delete c[t]}function m(t){if(u)setTimeout(m,0,t);else{var e=c[t];if(e){u=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}(e)}finally{p(t),u=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n("yLpj"),n("8oxB"))},YuTi:function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},ZTJQ:function(t,e,n){"use strict";n.r(e);var r={props:{original:{type:String,required:!1,default:""}},methods:{generate:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.alphabet(e),r=n.length,i="";i.length<t;){var o=Math.floor(Math.random()*r);i+=n[o]}this.$emit("generated",i)},alphabet:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return["abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ","1234567890","~!?@#$%&^_*+-=[]€,;:|()[]{}"].slice(0,t?4:3).join("")}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"btn-group",attrs:{role:"group"}},[t._m(0),t._v(" "),n("div",{staticClass:"dropdown-menu"},[n("h6",{staticClass:"dropdown-header"},[t._v(t._s(t.__("Alpha numeric with symbols")))]),t._v(" "),n("button",{staticClass:"dropdown-item",on:{click:function(e){return t.generate(8)}}},[t._v(t._s(t.__(":size chars",{size:8})))]),t._v(" "),n("button",{staticClass:"dropdown-item",on:{click:function(e){return t.generate(16)}}},[t._v(t._s(t.__(":size chars",{size:16})))]),t._v(" "),n("button",{staticClass:"dropdown-item",on:{click:function(e){return t.generate(24)}}},[t._v(t._s(t.__(":size chars",{size:24})))]),t._v(" "),n("h6",{staticClass:"dropdown-header"},[t._v(t._s(t.__("Alpha numeric only")))]),t._v(" "),n("button",{staticClass:"dropdown-item",on:{click:function(e){return t.generate(8,!1)}}},[t._v(t._s(t.__(":size chars",{size:8})))]),t._v(" "),n("button",{staticClass:"dropdown-item",on:{click:function(e){return t.generate(16,!1)}}},[t._v(t._s(t.__(":size chars",{size:16})))]),t._v(" "),n("button",{staticClass:"dropdown-item",on:{click:function(e){return t.generate(24,!1)}}},[t._v(t._s(t.__(":size chars",{size:24})))])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"btn btn-outline-secondary border-right-0 dropdown-toggle",staticStyle:{"border-radius":"0"},attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[e("i",{staticClass:"fas fa-dice pr-1"})])}],!1,null,null,null);e.default=o.exports},b9EY:function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},bUC5:function(t,e,n){"use strict";n.r(e);var r=n("XHP3"),i=n.n(r),o=n("HHJa"),a=n.n(o);function s(t){var e=new t;Object.defineProperties(e,{on:{get:function(){return this.$on.bind(this)}},once:{get:function(){return this.$once.bind(this)}},off:{get:function(){return this.$off.bind(this)}},emit:{get:function(){return this.$emit.bind(this)}}}),Object.defineProperty(t,"bus",{get:function(){return e}}),Object.defineProperty(t.prototype,"$bus",{get:function(){return e}})}"undefined"!=typeof window&&window.Vue&&window.Vue.use(s);var l=s,c=n("pl0M"),u=n.n(c),d=n("jl8+"),f=n.n(d),p=n("VH6O"),m=n.n(p),h=["load","change","stateChange","focus","blur"],_=["insertText","setValue","setMarkdown","setHtml","reset"],v={name:"TuiEditor",props:{previewStyle:{type:String},height:{type:String},value:{type:String},mode:{type:String},options:{type:Object},html:{type:String},visible:{type:Boolean,default:!0}},data:()=>({editor:null}),computed:{editorOptions(){const t=Object.assign({},this.options);return t.initialValue=this.value,t.initialEditType=this.mode,t.height=this.height,t.previewStyle=this.previewStyle,t}},watch:{previewStyle(t){this.editor.changePreviewStyle(t)},value(t,e){t!==e&&t!==this.editor.getValue()&&this.editor.setValue(t)},height(t){this.editor.height(t)},mode(t){this.editor.changeMode(t)},html(t){this.editor.setHtml(t),this.$emit("input",this.editor.getValue())},visible(t){t?this.editor.show():this.editor.hide()}},mounted(){const t={};h.forEach(e=>{t[e]=(...t)=>{this.$emit(e,...t)}});const e=Object.assign(this.editorOptions,{el:this.$refs.tuiEditor,events:t});this.editor=new m.a(e),this.$listeners.input&&this.editor.on("change",()=>{this.$emit("input",this.editor.getValue())})},destroyed(){h.forEach(t=>{this.editor.off(t)}),this.editor.remove()},methods:{invoke(t,...e){let n=null;return this.editor[t]&&(n=this.editor[t](...e),_.indexOf(t)>-1&&this.$emit("input",this.editor.getValue())),n}}},g=n("KHd+"),E=Object(g.a)(v,(function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"tuiEditor"})}),[],!1,null,null,null).exports,y={name:"TuiEditorViewer",props:{height:{type:String},value:{type:String},exts:{type:Array}},data:()=>({editor:null}),watch:{value(t,e){t!==e&&this.editor.setValue(t)}},mounted(){const t={};h.forEach(e=>{t[e]=(...t)=>{this.$emit(e,...t)}}),this.editor=m.a.factory({el:this.$refs.tuiEditorViewer,exts:this.exts,events:t,initialValue:this.value,height:this.height,viewer:!0})},destroyed(){h.forEach(t=>{this.editor.off(t)}),this.editor.remove()},methods:{invoke(t,...e){let n=null;return this.editor[t]&&(n=this.editor[t](...e)),n}}},b=Object(g.a)(y,(function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"tuiEditorViewer"})}),[],!1,null,null,null).exports,C=n("x9sl"),T=n("MQ60"),I=n.n(T),w=n("la7V"),S=n("EaH7");window._=n("LvDl");try{window.Popper=n("8L3F").default,window.$=window.jQuery=n("EVdn"),n("SYky")}catch(t){}window.axios=n("vDqi"),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var O=document.head.querySelector('meta[name="csrf-token"]');O?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=O.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token");var D=document.head.querySelector('meta[name="api-token"]');D&&(window.axios.defaults.headers.common.Authorization="Bearer "+D.content),window.Vue=n("XuX8"),Vue.mixin(i.a),Vue.mixin(a.a),Vue.use(l),Vue.use(u.a,{position:"top-center",duration:5e3}),Vue.component("multiselect",f.a),Vue.component("editor",E),Vue.component("viewer",b),Vue.directive("on-clickaway",C.directive),Vue.component("draggable",I.a),Vue.use(w.default),Vue.use(S.default);var R=n("+fAT");R.keys().map((function(t){return Vue.component(t.split("/").pop().split(".")[0],R(t).default)}));new Vue({el:"#app",data:function(){return{pwa:!1,online:!0,prompt:null}},created:function(){var t=this;this.registerServiceWorker(),window.addEventListener("online",(function(){t.online=!0})),window.addEventListener("offline",(function(){t.online=!1})),window.addEventListener("beforeinstallprompt",(function(e){t.prompt=e}))},methods:{registerServiceWorker:function(){"serviceWorker"in navigator&&(navigator.serviceWorker.controller?this.pwa=!0:navigator.serviceWorker.register("sw.js",{scope:"/"}))},installPwa:function(t){var e=this;this.prompt.prompt(),this.prompt.userChoice.then((function(t){e.prompt=null}))}}})},bVTN:function(t,e,n){"use strict";n.r(e);var r=n("0fPN"),i={mixins:[r.a],props:{user:{type:Object|Boolean,required:!1,default:!1}},data:function(){return{form:{name:"",email:"",is_admin:!1,password:"",password_confirmation:""},loading:!1}},mounted:function(){this.user&&this.setUser(this.user)},methods:{submit:function(){var t=this;this.loading=!0,axios.request({method:this.user?"PUT":"POST",url:this.user?this.user.url_update:"/api/manage/users",data:this.form}).then((function(e){t.$toasted.success(t.__("Saved")),t.user?t.loading=!1:t.form={name:"",email:"",is_admin:!1,password:"",password_confirmation:""},t.resetFormError(),t.$emit("submited")})).catch((function(e){"error"===e.response.data.status?t.$toasted.error(e.response.data.message):t.$toasted.error(t.__("Can't save")),t.setFormError(e),t.loading=!1}))},setUser:function(t){this.form={name:"",email:"",is_admin:!1,password:"",password_confirmation:""},this.resetFormError(),t&&(this.form.name=t.name,this.form.email=t.email,this.form.is_admin=t.is_admin)}},watch:{user:function(t){this.setUser(t)}}},o=n("KHd+"),a=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"row"},[n("div",{staticClass:"col-xs-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"name"}},[t._v(t._s(t.__("Name")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("name")},attrs:{type:"text",id:"name",disabled:t.loading},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}}),t._v(" "),t.hasFormError("name")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("name")))]):t._e()])]),t._v(" "),n("div",{staticClass:"col-xs-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"email"}},[t._v(t._s(t.__("E-Mail Address")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.email,expression:"form.email"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("email")},attrs:{type:"text",id:"email",disabled:t.loading},domProps:{value:t.form.email},on:{input:function(e){e.target.composing||t.$set(t.form,"email",e.target.value)}}}),t._v(" "),t.hasFormError("email")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("email")))]):t._e()])])]),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-xs-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"password"}},[t._v(t._s(t.__("Password")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.password,expression:"form.password"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("password")},attrs:{type:"password",id:"password",disabled:t.loading},domProps:{value:t.form.password},on:{input:function(e){e.target.composing||t.$set(t.form,"password",e.target.value)}}}),t._v(" "),t.hasFormError("password")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("password")))]):t._e()])]),t._v(" "),n("div",{staticClass:"col-xs-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"password_confirmation"}},[t._v(t._s(t.__("Confirm Password")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.password_confirmation,expression:"form.password_confirmation"}],staticClass:"form-control",attrs:{type:"password",id:"password_confirmation",disabled:t.loading},domProps:{value:t.form.password_confirmation},on:{input:function(e){e.target.composing||t.$set(t.form,"password_confirmation",e.target.value)}}})])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_admin,expression:"form.is_admin"}],staticClass:"custom-control-input",class:{"is-invalid":t.hasFormError("is_admin")},attrs:{type:"checkbox",id:"is_admin",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_admin)?t._i(t.form.is_admin,null)>-1:t.form.is_admin},on:{change:function(e){var n=t.form.is_admin,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_admin",n.concat([null])):o>-1&&t.$set(t.form,"is_admin",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_admin",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_admin"}},[t._v(t._s(t.__("Is admin?")))])]),t._v(" "),n("span",{staticClass:"text-muted"},[t._v(t._s(t.__("Admin users can access settings and other users private content")))])]),t._v(" "),n("button",{staticClass:"btn btn-primary",attrs:{disabled:t.loading},on:{click:function(e){return e.preventDefault(),t.submit(e)}}},[t.loading?n("span",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status","aria-hidden":"true"}}):t._e(),t._v("\n "+t._s(t.__("Save"))+"\n ")])])}),[],!1,null,null,null);e.default=a.exports},cNyC:function(t,e,n){"use strict";n.r(e);var r={props:{tag:{type:String,required:!1,default:"a"},text:{type:String,required:!1,default:"Click"},textConfirm:{type:String,required:!1,default:"Confirm"},duration:{type:Number,required:!1,default:500},href:{type:null|String,required:!1,default:null}},data:function(){return{clicked:!1}},methods:{click:function(){var t=this;if(this.clicked)return this.confirmed();this.clicked=!0,setTimeout((function(){t.clicked=!1}),this.duration)},confirmed:function(){this.href&&(window.location=this.href),this.$emit("confirmed")}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.tag,{tag:"component",on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.click(e)}}},[t.clicked?n("span",{domProps:{innerHTML:t._s(t.textConfirm)}}):n("span",{domProps:{innerHTML:t._s(t.text)}})])}),[],!1,null,null,null);e.default=o.exports},fKCf:function(t,e){t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},idfw:function(t,e,n){"use strict";n.r(e);var r={props:{single:{type:Boolean,required:!1,default:!1},album:{type:Object,required:!0,default:function(){}}},methods:{remove:function(){var t=this;axios.delete(this.album.url_delete).then((function(e){t.$toasted.success(t.__("Deleted")),t.single?window.location="/":window.location.reload()})).catch((function(e){t.$toasted.error(t.__("Can't delete"))}))}},computed:{images:function(){if(this.single)return this.album.images;var t=this.album.images.length,e=t>4?4:t;return this.album.images.slice(0,e)},imagesCols:function(){return this.single?{default:4,1e3:3,700:2,400:1}:{default:2}}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--album mb-4",class:{"card-single":t.single,"card-index":!t.single}},[n("div",{staticClass:"card-body"},[n("h5",{staticClass:"card-title"},[t.album.is_pinned&&!t.single?n("i",{staticClass:"fas fa-thumbtack fa-sm pr-1"}):t._e(),t._v(" "),n("span",[t._v(t._s(t.__("Album")))]),t._v(" — "),n("a",{attrs:{href:t.album.permalink}},[t._v(t._s(t.album.title))]),n("br")]),t._v(" "),n("p",{staticClass:"card-content",domProps:{innerHTML:t._s(t.album.content)}}),t._v(" "),t.images?n("masonry",{staticClass:"mb-1",attrs:{cols:t.imagesCols,gutter:5}},t._l(t.images,(function(e){return n("div",{key:e.name},[n("img",{directives:[{name:"img",rawName:"v-img",value:{src:e.url_full,group:t.album.permalink},expression:"{src: image.url_full, group: album.permalink}"}],staticClass:"img-fluid mb-1",attrs:{src:e.url_thumb||e.url_full,alt:e.name}})])})),0):t._e(),t._v(" "),!t.single&&t.album.images.length>4?n("p",{staticClass:"text-right small mb-0"},[n("i",{staticClass:"fas fa-plus mr-1"}),t._v(" "+t._s(t.album.images.length-t.images.length)+"\n ")]):t._e(),t._v(" "),t.album.tags.length>0?n("p",{staticClass:"card-text mt-1"},t._l(t.album.tags,(function(e){return n("a",{staticClass:"badge badge-secondary mr-1",attrs:{href:"/tag/"+e}},[t._v(t._s(e))])})),0):t._e()],1),t._v(" "),n("div",{staticClass:"card-footer d-flex justify-content-between"},[n("span",[t.album.is_private?n("i",{staticClass:"fas fa-lock pr-2"}):t._e(),t._v(t._s(t.album.date_formated))]),t._v(" "),n("div",{staticClass:"dropdown"},[n("button",{staticClass:"btn btn-outline-dark btn-sm dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",dusk:"album-card-more"}},[t._v("\n "+t._s(t.__("More"))+"\n ")]),t._v(" "),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[n("a",{staticClass:"dropdown-item",attrs:{href:t.album.permalink,dusk:"album-card-permalink"}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink"))+"\n ")]),t._v(" "),t.album.url_download?n("a",{staticClass:"dropdown-item",attrs:{href:t.album.url_download,dusk:"album-card-download"}},[n("i",{staticClass:"fas fa-file-download fa-fw mr-1"}),t._v(" "+t._s(t.__("Download"))+"\n ")]):t._e(),t._v(" "),t.album.editable?n("h6",{staticClass:"dropdown-header"},[t._v(t._s(t.__("Manage")))]):t._e(),t._v(" "),t.album.editable?n("a",{staticClass:"dropdown-item",attrs:{dusk:"album-card-temp-share"},on:{click:function(e){return t.$bus.$emit("share",t.album)}}},[n("i",{staticClass:"fas fa-share-square fa-fw mr-1"}),t._v(" "+t._s(t.__("Temp sharing"))+"\n ")]):t._e(),t._v(" "),t.album.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.album.url_edit,dusk:"album-card-edit"}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit"))+"\n ")]):t._e(),t._v(" "),t.album.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:"<i class='fas fa-trash-alt fa-fw mr-1'></i> "+t.__("Delete"),"text-confirm":"<i class='fas fa-check fa-fw mr-1'></i> "+t.__("Confirm"),dusk:"album-card-remove"},on:{confirmed:t.remove}}):t._e()],1)])])])}),[],!1,null,null,null);e.default=o.exports},iyXs:function(t,e,n){"use strict";n.r(e);var r={props:{name:{type:String,required:!0},values:{type:Object,required:!1,default:null}},data:function(){return{type:"image",original:null,gradient:{start:null,end:null,orientation:0},image:{base64:null}}},mounted:function(){this.values&&(this.type=this.values.type,"gradient"===this.type&&(this.gradient.start=this.values.start||null,this.gradient.end=this.values.end||null,this.gradient.orientation=this.values.orientation||90)),this.original=$("body").css("background-image")},methods:{handleFile:function(t){var e=this,n=t.target.files[0],r=new FileReader;!1!==n.type.match("image/*")&&(r.onload=function(){e.image.base64=r.result},r.readAsDataURL(n))},setBackground:function(){"none"===this.type&&$("body").css("background-image",""),"image"===this.type&&$("body").css({"background-image":this.backgroundImage,"background-size":"cover","background-repeat":"no-repeat","background-position":"center center"}),"gradient"===this.type&&$("body").css("background-image",this.backgroundGradient)}},computed:{backgroundGradient:function(){return this.gradient.start&&this.gradient.end?"linear-gradient(".concat(this.gradient.orientation,"deg, ").concat(this.gradient.start," 0%, ").concat(this.gradient.end," 100%)"):null},backgroundImage:function(){return this.image.base64?'url("'.concat(this.image.base64,'")'):null},data:function(){var t=JSON.stringify({type:"none"});return"gradient"===this.type&&this.backgroundGradient&&(t=JSON.stringify({type:"gradient",start:this.gradient.start,end:this.gradient.end,orientation:this.gradient.orientation})),"image"===this.type&&(this.backgroundImage||this.values.file)&&(t=JSON.stringify({type:"image",base64:this.image.base64||null})),t}},watch:{type:function(t){this.setBackground()},backgroundImage:function(t){this.setBackground()},backgroundGradient:function(t){this.setBackground()}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"form-group"},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.type,expression:"type"}],staticClass:"form-control custom-select",attrs:{id:"type"},on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.type=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"none"}},[t._v(t._s(t.__("None")))]),t._v(" "),n("option",{attrs:{value:"image"}},[t._v(t._s(t.__("Image")))]),t._v(" "),n("option",{attrs:{value:"gradient"}},[t._v(t._s(t.__("Gradient")))])])]),t._v(" "),"image"===t.type?n("div",[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-file"},[n("label",{staticClass:"custom-file-label",attrs:{for:"file","data-browse":t.__("Choose")}},[t._v(t._s(t.__("File")))]),t._v(" "),n("input",{staticClass:"custom-file-input",attrs:{type:"file",id:"file",accept:"image/*"},domProps:{value:t.image.name},on:{change:t.handleFile}})])])])])]):t._e(),t._v(" "),"gradient"===t.type?n("div",[n("div",{staticClass:"row"},[n("div",{staticClass:"col-md-4"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"start"}},[t._v(t._s(t.__("Color #:number",{number:1})))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.gradient.start,expression:"gradient.start"}],staticClass:"form-control",attrs:{type:"color",id:"start"},domProps:{value:t.gradient.start},on:{input:function(e){e.target.composing||t.$set(t.gradient,"start",e.target.value)}}})])]),t._v(" "),n("div",{staticClass:"col-md-4"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"end"}},[t._v(t._s(t.__("Color #:number",{number:2})))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.gradient.end,expression:"gradient.end"}],staticClass:"form-control",attrs:{type:"color",id:"end"},domProps:{value:t.gradient.end},on:{input:function(e){e.target.composing||t.$set(t.gradient,"end",e.target.value)}}})])]),t._v(" "),n("div",{staticClass:"col-md-4"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"orientation"}},[t._v(t._s(t.__("Orientation")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.gradient.orientation,expression:"gradient.orientation"}],staticClass:"form-control",attrs:{type:"number",id:"orientation",min:"0",max:"360",step:"5"},domProps:{value:t.gradient.orientation},on:{input:function(e){e.target.composing||t.$set(t.gradient,"orientation",e.target.value)}}})])])])]):t._e(),t._v(" "),n("input",{attrs:{type:"hidden",name:t.name,id:"name"},domProps:{value:t.data}})])}),[],!1,null,null,null);e.default=o.exports},jPMG:function(t,e,n){"use strict";n.r(e);var r={props:{endpoint:{type:String,required:!0}},methods:{purge:function(){var t=this;axios.post(this.endpoint).then((function(e){t.$toasted.success(t.__("Logins history has been purged")),window.location.reload()})).catch((function(e){console.log(e),t.$toasted.error(t.__("Unable to purge logins history"))}))}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)("confirm",{attrs:{text:this.__("Purge"),"text-confirm":this.__("Confirm")},on:{confirmed:this.purge}})}),[],!1,null,null,null);e.default=o.exports},kuJz:function(t,e,n){"use strict";n.r(e);var r={props:{single:{type:Boolean,required:!1,default:!1},link:{type:Object,required:!0,default:function(){}}},methods:{remove:function(){var t=this;axios.delete(this.link.url_delete).then((function(e){t.$toasted.success(t.__("Deleted")),t.single?window.location="/":window.location.reload()})).catch((function(e){t.$toasted.error(t.__("Can't delete"))}))}},computed:{displayUrl:function(){var t=this.link.url;if(t.length>65){var e=t.substr(0,62);return"".concat(e,"...")}return t},waybackUrl:function(){return"https://web.archive.org/web/"+encodeURIComponent(this.link.url)}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--link mb-4",class:{"card-single":t.single,"card-index":!t.single}},[n("div",{staticClass:"card-body"},[n("h5",{staticClass:"card-title"},[t.link.is_pinned&&!t.single?n("i",{staticClass:"fas fa-thumbtack fa-sm pr-1"}):t._e(),t._v(" "),n("span",[t._v(t._s(t.__("Link")))]),t._v(" — "),n("a",{attrs:{href:t.link.permalink}},[t._v(t._s(t.link.title))]),n("br"),t._v(" "),n("a",{staticClass:"small text-muted",attrs:{href:t.link.url}},[t._v(t._s(t.displayUrl))])]),t._v(" "),n("p",{staticClass:"card-content",domProps:{innerHTML:t._s(t.link.content)}}),t._v(" "),t.link.preview?n("div",{staticClass:"card-preview mb-1",domProps:{innerHTML:t._s(t.link.preview)}}):t._e(),t._v(" "),t.link.tags.length>0?n("p",{staticClass:"card-text mt-1"},t._l(t.link.tags,(function(e){return n("a",{staticClass:"badge badge-secondary mr-1",attrs:{href:"/tag/"+e}},[t._v(t._s(e))])})),0):t._e()]),t._v(" "),n("div",{staticClass:"card-footer d-flex justify-content-between"},[n("span",[t.link.is_private?n("i",{staticClass:"fas fa-lock pr-2"}):t._e(),t._v(t._s(t.link.date_formated))]),t._v(" "),n("div",{staticClass:"dropdown"},[n("button",{staticClass:"btn btn-outline-dark btn-sm dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",dusk:"link-card-more"}},[t._v("\n "+t._s(t.__("More"))+"\n ")]),t._v(" "),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[n("a",{staticClass:"dropdown-item",attrs:{href:t.link.permalink,dusk:"link-card-permalink"}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink"))+"\n ")]),t._v(" "),n("a",{staticClass:"dropdown-item",attrs:{href:t.waybackUrl,target:"_blank",dusk:"link-card-archiveorg-link"}},[n("i",{staticClass:"fas fa-history fa-fw mr-1"}),t._v(" "+t._s(t.__("View on archive.org"))+"\n ")]),t._v(" "),t.link.url_download?n("a",{staticClass:"dropdown-item",attrs:{href:t.link.url_download,dusk:"link-card-download-link"}},[n("i",{staticClass:"fas fa-file-download fa-fw mr-1"}),t._v(" "+t._s(t.__("Download"))+"\n ")]):t._e(),t._v(" "),t.link.editable?n("h6",{staticClass:"dropdown-header"},[t._v(t._s(t.__("Manage")))]):t._e(),t._v(" "),t.link.editable?n("a",{staticClass:"dropdown-item",attrs:{dusk:"link-card-temp-share"},on:{click:function(e){return t.$bus.$emit("share",t.link)}}},[n("i",{staticClass:"fas fa-share-square fa-fw mr-1"}),t._v(" "+t._s(t.__("Temp sharing"))+"\n ")]):t._e(),t._v(" "),t.link.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.link.url_edit,dusk:"link-card-edit"}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit"))+"\n ")]):t._e(),t._v(" "),t.link.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:"<i class='fas fa-trash-alt fa-fw mr-1'></i> "+t.__("Delete"),"text-confirm":"<i class='fas fa-check fa-fw mr-1'></i> "+t.__("Confirm"),dusk:"link-card-remove"},on:{confirmed:t.remove}}):t._e()],1)])])])}),[],!1,null,null,null);e.default=o.exports},nBz4:function(t,e,n){"use strict";n.r(e);var r=n("0fPN"),i=n("1IHE"),o=n("FQHZ"),a={components:{FilePond:new(n.n(o).a)},mixins:[r.a,i.a],props:{album:{type:Object,required:!1,default:function(){}}},data:function(){return{form:{title:null,content:null,images:[],uploaded:[],is_private:!1,is_pinned:!1,tags:[]},loading:!1,drag:!1,dragOptions:{animation:200,group:"images",disabled:!1,ghostClass:"ghost",forceFallback:!0}}},mounted:function(){this.album&&(this.form=this.album,this.form.uploaded=[])},methods:{submit:function(t){var e=this;this.loading=!0,axios.request({method:this.album?"PUT":"POST",url:this.album?this.album.url_update:"/api/album",data:this.form}).then((function(n){switch(e.$toasted.success(e.__("Saved")),t){case"view":window.location=n.data.post.url;break;case"new":window.location="/album/create";break;case"edit":window.location="/album/".concat(n.data.post.postable_id,"/edit")}})).catch((function(t){e.loading=!1,e.setFormError(t),e.setHttpError(t),e.toastHttpError(e.__("Can't save"))}))},initUpload:function(){Object(o.setOptions)({server:{url:"/api/album/upload",process:{headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content"),Authorization:"Bearer "+$('meta[name="api-token"]').attr("content")}}}})},handleFileProcess:function(t,e){null===t&&this.form.uploaded.push(e.serverId)},deleteImage:function(t){var e=this.form.images.indexOf(t);-1!==e&&(this.form.images.splice(e,1),this.updateImagesOrder())},startDragging:function(){this.drag=!0},endDragging:function(t){this.drag=!1,this.updateImagesOrder()},updateImagesOrder:function(){for(var t=this.form.images.length-1,e=0;e<=t;e++)this.form.images[e].order=e+1}}},s=n("KHd+"),l=Object(s.a)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--album"},[n("div",{staticClass:"card-body"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"title"}},[t._v(t._s(t.__("Title")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.title,expression:"form.title"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("title")},attrs:{type:"text",id:"title",disabled:t.loading,dusk:"album-form-title"},domProps:{value:t.form.title},on:{input:function(e){e.target.composing||t.$set(t.form,"title",e.target.value)}}}),t._v(" "),t.hasFormError("title")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("title")))]):t._e()]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"content"}},[t._v(t._s(t.__("Content")))]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.content,expression:"form.content"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("content")},attrs:{id:"content",disabled:t.loading,dusk:"album-form-content"},domProps:{value:t.form.content},on:{input:function(e){e.target.composing||t.$set(t.form,"content",e.target.value)}}}),t._v(" "),t.hasFormError("content")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("content")))]):t._e()]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"content"}},[t._v(t._s(t.__("Images")))]),t._v(" "),n("file-pond",{ref:"pond",attrs:{"allow-multiple":!0,"allow-browse":!0,"allow-replace":!1,"allow-revert":!1,"instant-upload":!0,"label-idle":t.__("Drop files or click to choose"),"label-invalid-field":t.__("Invalid file"),"label-file-loading":t.__("Loading"),"label-file-processing":t.__("Loading"),"label-file-load-error":t.__("Fail"),"label-file-processing-error":t.__("Fail"),"label-file-processing-complete":t.__("Success"),"label-tap-to-cancel":t.__("Delete"),"label-tap-to-undo":t.__("Delete")},on:{init:t.initUpload,processfile:t.handleFileProcess}}),t._v(" "),t.form.images?n("div",[n("draggable",t._b({attrs:{group:"images",handle:".handle-order"},on:{start:t.startDragging,end:t.endDragging},model:{value:t.form.images,callback:function(e){t.$set(t.form,"images",e)},expression:"form.images"}},"draggable",t.dragOptions,!1),[n("transition-group",{attrs:{type:"transition",tag:"div",name:t.drag?null:"flip-list"}},t._l(t.form.images,(function(e){return n("figure",{key:"item-"+e.name,staticClass:"figure mr-2"},[n("img",{staticClass:"figure-img img-fluid rounded",staticStyle:{height:"100px"},attrs:{src:e.url_thumb||e.url_full}}),t._v(" "),n("figcaption",{staticClass:"figure-caption d-flex justify-content-center"},[n("button",{staticClass:"btn btn-sm btn-outline-secondary handle-order mr-1",attrs:{type:"button"}},[n("i",{staticClass:"fas fa-arrows-alt"})]),t._v(" "),n("confirm",{staticClass:"btn btn-sm btn-outline-secondary",attrs:{tag:"button",text:"<i class='fas fa-trash-alt'></i>","text-confirm":"<i class='fas fa-check'></i>"},on:{confirmed:function(n){return t.deleteImage(e)}}})],1)])})),0)],1)],1):t._e()],1),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_private,expression:"form.is_private"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"is_private",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_private)?t._i(t.form.is_private,null)>-1:t.form.is_private},on:{change:function(e){var n=t.form.is_private,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_private",n.concat([null])):o>-1&&t.$set(t.form,"is_private",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_private",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_private",dusk:"album-form-private"}},[t._v(t._s(t.__("Is private?")))])])])]),t._v(" "),n("div",{staticClass:"col-12 col-md-6"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_pinned,expression:"form.is_pinned"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"is_pinned",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_pinned)?t._i(t.form.is_pinned,null)>-1:t.form.is_pinned},on:{change:function(e){var n=t.form.is_pinned,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_pinned",n.concat([null])):o>-1&&t.$set(t.form,"is_pinned",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_pinned",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_pinned",dusk:"album-form-pinned"}},[t._v(t._s(t.__("Is pinned?")))])])])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",[t._v(t._s(t.__("Tags")))]),t._v(" "),n("tags",{attrs:{dusk:"link-form-tags"},model:{value:t.form.tags,callback:function(e){t.$set(t.form,"tags",e)},expression:"form.tags"}})],1)]),t._v(" "),n("div",{staticClass:"card-footer d-flex justify-content-between"},[n("div",[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-primary",attrs:{type:"button",disabled:t.loading,dusk:"album-form-save"},on:{click:function(e){return e.preventDefault(),t.submit("edit")}}},[t.loading?n("span",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status","aria-hidden":"true"}}):t._e(),t._v("\n "+t._s(t.__("Save"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-primary dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}}),t._v(" "),n("div",{staticClass:"dropdown-menu"},[n("button",{staticClass:"dropdown-item",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.submit("view")}}},[t._v(t._s(t.__("Save & View")))]),t._v(" "),n("button",{staticClass:"dropdown-item",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.submit("new")}}},[t._v(t._s(t.__("Save & New")))])])]),t._v(" "),t.album?n("a",{staticClass:"btn btn-outline-primary",attrs:{href:t.album.permalink}},[t._v(t._s(t.__("View")))]):t._e()]),t._v(" "),t._t("actions")],2)])}),[],!1,null,null,null);e.default=l.exports},p7ys:function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},pyCd:function(t,e){},tEIc:function(t,e,n){"use strict";n.r(e);var r={props:{message:{type:String,required:!0},type:{type:String,required:!1,default:"success"}},mounted:function(){this.message.length>0&&this.$toasted.show(this.message,{type:this.type})}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,null,null,null);e.default=o.exports},uB4Z:function(t,e,n){!function(e,n){"use strict";function r(t,e,n){this.root=this.currentNode=t,this.nodeType=e,this.filter=n||lt}function i(t){return t.nodeType===x&&!!ut[t.nodeName]}function o(t){switch(t.nodeType){case M:return ft;case x:case B:if(it&&ht.has(t))return ht.get(t);break;default:return dt}var e;return e=function(t,e){for(var n=t.length;n--;)if(!e(t[n]))return!1;return!0}(t.childNodes,a)?ct.test(t.nodeName)?ft:pt:mt,it&&ht.set(t,e),e}function a(t){return o(t)===ft}function s(t){return o(t)===pt}function l(t){return o(t)===mt}function c(t,e){var n=new r(e,G,s);return n.currentNode=t,n}function u(t,e){return(t=c(t,e).previousNode())!==e?t:null}function d(t,e){return(t=c(t,e).nextNode())!==e?t:null}function f(t,e){return!i(t)&&t.nodeType===e.nodeType&&t.nodeName===e.nodeName&&"A"!==t.nodeName&&t.className===e.className&&(!t.style&&!e.style||t.style.cssText===e.style.cssText)}function p(t,e,n){if(t.nodeName!==e)return!1;for(var r in n)if(t.getAttribute(r)!==n[r])return!1;return!0}function m(t,e,n,r){for(;t&&t!==e;){if(p(t,n,r))return t;t=t.parentNode}return null}function h(t,e){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function _(t){var e=t.nodeType;return e===x||e===B?t.childNodes.length:t.length||0}function v(t){var e=t.parentNode;return e&&e.removeChild(t),t}function g(t,e){var n=t.parentNode;n&&n.replaceChild(e,t)}function E(t){for(var e=t.ownerDocument.createDocumentFragment(),n=t.childNodes,r=n?n.length:0;r--;)e.appendChild(t.firstChild);return e}function y(t,e,r,i){var o,a,s,l=t.createElement(e);if(r instanceof Array&&(i=r,r=null),r)for(o in r)r[o]!==n&&l.setAttribute(o,r[o]);if(i)for(a=0,s=i.length;a<s;a+=1)l.appendChild(i[a]);return l}function b(t,e){var n,r,o=e.__squire__,s=t.ownerDocument,l=t;if(t===e&&((r=t.firstChild)&&"BR"!==r.nodeName||(n=o.createDefaultBlock(),r?t.replaceChild(n,r):t.appendChild(n),t=n,n=null)),t.nodeType===M)return l;if(a(t)){for(r=t.firstChild;et&&r&&r.nodeType===M&&!r.data;)t.removeChild(r),r=t.firstChild;r||(et?(n=s.createTextNode(U),o._didAddZWS()):n=s.createTextNode(""))}else if(tt){for(;t.nodeType!==M&&!i(t);){if(!(r=t.firstChild)){n=s.createTextNode("");break}t=r}t.nodeType===M?/^ +$/.test(t.data)&&(t.data=""):i(t)&&t.parentNode.insertBefore(s.createTextNode(""),t)}else if("HR"!==t.nodeName&&!t.querySelector("BR"))for(n=y(s,"BR");(r=t.lastElementChild)&&!a(r);)t=r;if(n)try{t.appendChild(n)}catch(e){o.didError({name:"Squire: fixCursor  "+e,message:"Parent: "+t.nodeName+"/"+t.innerHTML+" appendChild: "+n.nodeName})}return l}function C(t,e){var n,r,i,o,s=t.childNodes,c=t.ownerDocument,u=null,d=e.__squire__._config;for(n=0,r=s.length;n<r;n+=1)!(o="BR"===(i=s[n]).nodeName)&&a(i)?(u||(u=y(c,d.blockTag,d.blockAttributes)),u.appendChild(i),n-=1,r-=1):(o||u)&&(u||(u=y(c,d.blockTag,d.blockAttributes)),b(u,e),o?t.replaceChild(u,i):(t.insertBefore(u,i),n+=1,r+=1),u=null),l(i)&&C(i,e);return u&&t.appendChild(b(u,e)),t}function T(t,e,n,r){var i,o,a,s=t.nodeType;if(s===M&&t!==n)return T(t.parentNode,t.splitText(e),n,r);if(s===x){if("number"==typeof e&&(e=e<t.childNodes.length?t.childNodes[e]:null),t===n)return e;for(i=t.parentNode,o=t.cloneNode(!1);e;)a=e.nextSibling,o.appendChild(e),e=a;return"OL"===t.nodeName&&m(t,r,"BLOCKQUOTE")&&(o.start=(+t.start||1)+t.childNodes.length-1),b(t,r),b(o,r),(a=t.nextSibling)?i.insertBefore(o,a):i.appendChild(o),T(i,o,n,r)}return e}function I(t,e){if(t.nodeType===M&&(t=t.parentNode),t.nodeType===x){var n={startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset};(function t(e,n){for(var r,i,o,s=e.childNodes,l=s.length,c=[];l--;)if(r=s[l],i=l&&s[l-1],l&&a(r)&&f(r,i)&&!ut[r.nodeName])n.startContainer===r&&(n.startContainer=i,n.startOffset+=_(i)),n.endContainer===r&&(n.endContainer=i,n.endOffset+=_(i)),n.startContainer===e&&(n.startOffset>l?n.startOffset-=1:n.startOffset===l&&(n.startContainer=i,n.startOffset=_(i))),n.endContainer===e&&(n.endOffset>l?n.endOffset-=1:n.endOffset===l&&(n.endContainer=i,n.endOffset=_(i))),v(r),r.nodeType===M?i.appendData(r.data):c.push(E(r));else if(r.nodeType===x){for(o=c.length;o--;)r.appendChild(c.pop());t(r,n)}})(t,n),e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset)}}function w(t){var e=t.nodeName;return"TD"===e||"TH"===e||"TR"===e||"TBODY"===e||"THEAD"===e}function S(t,e,n,r){var i,o,a,s=e;if(!w(t)||!w(e)){for(;(i=s.parentNode)&&i!==r&&i.nodeType===x&&1===i.childNodes.length;)s=i;v(s),a=t.childNodes.length,(o=t.lastChild)&&"BR"===o.nodeName&&(t.removeChild(o),a-=1),t.appendChild(E(e)),n.setStart(t,a),n.collapse(!0),I(t,n),X&&(o=t.lastChild)&&"BR"===o.nodeName&&t.removeChild(o)}}function O(t,e){var n,r,i=t.previousSibling,o=t.firstChild,a=t.ownerDocument,s="LI"===t.nodeName;if((!s||o&&/^[OU]L$/.test(o.nodeName))&&!w(t))if(i&&f(i,t)&&i.isContentEditable&&t.isContentEditable){if(!l(i)){if(!s)return;(r=y(a,"DIV")).appendChild(E(i)),i.appendChild(r)}v(t),n=!l(t),i.appendChild(E(t)),n&&C(i,e),o&&O(o,e)}else s&&(i=y(a,"DIV"),t.insertBefore(i,o),b(i,e))}function D(t){this.isShiftDown=t.shiftKey}function R(t,e,n){var r,i;if(t||(t={}),e)for(r in e)!n&&r in t||(i=e[r],t[r]=i&&i.constructor===Object?R(t[r],i,n):i);return t}function N(t,e){t.nodeType===F&&(t=t.body);var n,r=t.ownerDocument,i=r.defaultView;this._win=i,this._doc=r,this._root=t,this._events={},this._isFocused=!1,this._lastSelection=null,nt&&this.addEventListener("beforedeactivate",this.getSelection),this._hasZWS=!1,this._lastAnchorNode=null,this._lastFocusNode=null,this._path="",this._willUpdatePath=!1,"onselectionchange"in r?this.addEventListener("selectionchange",this._updatePathOnEvent):(this.addEventListener("keyup",this._updatePathOnEvent),this.addEventListener("mouseup",this._updatePathOnEvent)),this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0,this._isInUndoState=!1,this._ignoreChange=!1,this._ignoreAllChanges=!1,rt?((n=new MutationObserver(this._docWasChanged.bind(this))).observe(t,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._mutation=n):this.addEventListener("keyup",this._keyUpDetectChange),this._restoreSelection=!1,this.addEventListener("blur",A),this.addEventListener("mousedown",P),this.addEventListener("touchstart",P),this.addEventListener("focus",k),this._awaitingPaste=!1,this.addEventListener(W?"beforecut":"cut",Qt),this.addEventListener("copy",Zt),this.addEventListener("keydown",D),this.addEventListener("keyup",D),this.addEventListener(W?"beforepaste":"paste",Jt),this.addEventListener("drop",te),this.addEventListener(X?"keypress":"keydown",Pt),this._keyHandlers=Object.create(Mt),this.setConfig(e),W&&(i.Text.prototype.splitText=function(t){var e=this.ownerDocument.createTextNode(this.data.slice(t)),n=this.nextSibling,r=this.parentNode,i=this.length-t;return n?r.insertBefore(e,n):r.appendChild(e),i&&this.deleteData(t,i),e}),t.setAttribute("contenteditable","true");try{r.execCommand("enableObjectResizing",!1,"false"),r.execCommand("enableInlineTableEditing",!1,"false")}catch(t){}t.__squire__=this,this.setHTML("")}function A(){this._restoreSelection=!0}function P(){this._restoreSelection=!1}function k(){this._restoreSelection&&this.setSelection(this._lastSelection)}function L(t,e,n){var r,i;for(r=e.firstChild;r;r=i){if(i=r.nextSibling,a(r)){if(r.nodeType===M||"BR"===r.nodeName||"IMG"===r.nodeName){n.appendChild(r);continue}}else if(s(r)){n.appendChild(t.createDefaultBlock([L(t,r,t._doc.createDocumentFragment())]));continue}L(t,r,n)}return n}var x=1,M=3,F=9,B=11,G=1,U="",q=e.defaultView,H=navigator.userAgent,$=/Android/.test(H),V=/iP(?:ad|hone|od)/.test(H),j=/Mac OS X/.test(H),z=/Windows NT/.test(H),Y=/Gecko\//.test(H),W=/Trident\/[456]\./.test(H),X=!!q.opera,K=/Edge\//.test(H),Q=!K&&/WebKit\//.test(H),Z=/Trident\/[4567]\./.test(H),J=j?"meta-":"ctrl-",tt=W||X,et=W||Q,nt=W,rt="undefined"!=typeof MutationObserver,it="undefined"!=typeof WeakMap,ot=/[^ \t\r\n]/,at=Array.prototype.indexOf;Object.create||(Object.create=function(t){var e=function(){};return e.prototype=t,new e});var st={1:1,2:2,3:4,8:128,9:256,11:1024},lt=function(){return!0};r.prototype.nextNode=function(){for(var t,e=this.currentNode,n=this.root,r=this.nodeType,i=this.filter;;){for(t=e.firstChild;!t&&e&&e!==n;)(t=e.nextSibling)||(e=e.parentNode);if(!t)return null;if(st[t.nodeType]&r&&i(t))return this.currentNode=t,t;e=t}},r.prototype.previousNode=function(){for(var t,e=this.currentNode,n=this.root,r=this.nodeType,i=this.filter;;){if(e===n)return null;if(t=e.previousSibling)for(;e=t.lastChild;)t=e;else t=e.parentNode;if(!t)return null;if(st[t.nodeType]&r&&i(t))return this.currentNode=t,t;e=t}},r.prototype.previousPONode=function(){for(var t,e=this.currentNode,n=this.root,r=this.nodeType,i=this.filter;;){for(t=e.lastChild;!t&&e&&e!==n;)(t=e.previousSibling)||(e=e.parentNode);if(!t)return null;if(st[t.nodeType]&r&&i(t))return this.currentNode=t,t;e=t}};var ct=/^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|EL|FN)|EM|FONT|I(?:FRAME|MG|NPUT|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:AMP|MALL|PAN|TR(?:IKE|ONG)|U[BP])?|TIME|U|VAR|WBR)$/,ut={BR:1,HR:1,IFRAME:1,IMG:1,INPUT:1},dt=0,ft=1,pt=2,mt=3,ht=it?new WeakMap:null,_t=function(t,e){for(var n=t.childNodes;e&&t.nodeType===x;)e=(n=(t=n[e-1]).childNodes).length;return t},vt=function(t,e){if(t.nodeType===x){var n=t.childNodes;if(e<n.length)t=n[e];else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}}return t},gt=function(t,e){var n,r,i,o,a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;a.nodeType===M?(r=(n=a.parentNode).childNodes,s===a.length?(s=at.call(r,a)+1,t.collapsed&&(l=n,c=s)):(s&&(o=a.splitText(s),l===a?(c-=s,l=o):l===n&&(c+=1),a=o),s=at.call(r,a)),a=n):r=a.childNodes,s===(i=r.length)?a.appendChild(e):a.insertBefore(e,r[s]),a===l&&(c+=r.length-i),t.setStart(a,s),t.setEnd(l,c)},Et=function(t,e,n){var r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset;e||(e=t.commonAncestorContainer),e.nodeType===M&&(e=e.parentNode);for(var s,l,c,u,d,f=T(o,a,e,n),p=T(r,i,e,n),m=e.ownerDocument.createDocumentFragment();p!==f;)s=p.nextSibling,m.appendChild(p),p=s;return r=e,i=f?at.call(e.childNodes,f):e.childNodes.length,(l=(c=e.childNodes[i])&&c.previousSibling)&&l.nodeType===M&&c.nodeType===M&&(r=l,i=l.length,u=l.data,d=c.data," "===u.charAt(u.length-1)&&" "===d.charAt(0)&&(d=" "+d.slice(1)),l.appendData(d),v(c)),t.setStart(r,i),t.collapse(!0),b(e,n),m},yt=function(t,e){var n,r,i=wt(t,e),o=St(t,e),a=i!==o;return Tt(t),It(t,i,o,e),n=Et(t,null,e),Tt(t),a&&(o=St(t,e),i&&o&&i!==o&&S(i,o,t,e)),i&&b(i,e),(r=e.firstChild)&&"BR"!==r.nodeName?t.collapse(!0):(b(e,e),t.selectNodeContents(e.firstChild)),n},bt=function(t,e,n){var r,i,o,s,c,f,p,h,v,g;for(C(e,n),r=e;r=d(r,n);)b(r,n);if(t.collapsed||yt(t,n),Tt(t),t.collapse(!1),s=m(t.endContainer,n,"BLOCKQUOTE")||n,i=wt(t,n),p=d(e,e),i&&p&&!function(t,e,n){for(;t&&t!==e;){if(n.test(t.nodeName))return t;t=t.parentNode}return null}(p,e,/PRE|TABLE|H[1-6]|OL|UL|BLOCKQUOTE/)){if(It(t,i,i,n),t.collapse(!0),c=t.endContainer,f=t.endOffset,Xt(i,n,!1),a(c)&&(c=(h=T(c,f,u(c,n),n)).parentNode,f=at.call(c.childNodes,h)),f!==_(c))for(o=n.ownerDocument.createDocumentFragment();r=c.childNodes[f];)o.appendChild(r);S(c,p,t,n),f=at.call(c.parentNode.childNodes,c)+1,c=c.parentNode,t.setEnd(c,f)}_(e)&&(It(t,s,s,n),v=(h=T(t.endContainer,t.endOffset,s,n))?h.previousSibling:s.lastChild,s.insertBefore(e,h),h?t.setEndBefore(h):t.setEnd(s,_(s)),i=St(t,n),Tt(t),c=t.endContainer,f=t.endOffset,h&&l(h)&&O(h,n),(h=v&&v.nextSibling)&&l(h)&&O(h,n),t.setEnd(c,f)),o&&(S(i,o,g=t.cloneRange(),n),t.setEnd(g.endContainer,g.endOffset)),Tt(t)},Ct=function(t,e,n){var r=e.ownerDocument.createRange();if(r.selectNode(e),n){var i=t.compareBoundaryPoints(3,r)>-1,o=t.compareBoundaryPoints(1,r)<1;return!i&&!o}var a=t.compareBoundaryPoints(0,r)<1,s=t.compareBoundaryPoints(2,r)>-1;return a&&s},Tt=function(t){for(var e,n=t.startContainer,r=t.startOffset,o=t.endContainer,a=t.endOffset,s=!0;n.nodeType!==M&&(e=n.childNodes[r])&&!i(e);)n=e,r=0;if(a)for(;o.nodeType!==M;){if(!(e=o.childNodes[a-1])||i(e)){if(s&&e&&"BR"===e.nodeName){a-=1,s=!1;continue}break}a=_(o=e)}else for(;o.nodeType!==M&&(e=o.firstChild)&&!i(e);)o=e;t.collapsed?(t.setStart(o,a),t.setEnd(n,r)):(t.setStart(n,r),t.setEnd(o,a))},It=function(t,e,n,r){var i,o=t.startContainer,a=t.startOffset,s=t.endContainer,l=t.endOffset,c=!0;for(e||(e=t.commonAncestorContainer),n||(n=e);!a&&o!==e&&o!==r;)i=o.parentNode,a=at.call(i.childNodes,o),o=i;for(;c&&s.nodeType!==M&&s.childNodes[l]&&"BR"===s.childNodes[l].nodeName&&(l+=1,c=!1),s!==n&&s!==r&&l===_(s);)i=s.parentNode,l=at.call(i.childNodes,s)+1,s=i;t.setStart(o,a),t.setEnd(s,l)},wt=function(t,e){var n,r=t.startContainer;return a(r)?n=u(r,e):r!==e&&s(r)?n=r:n=d(n=_t(r,t.startOffset),e),n&&Ct(t,n,!0)?n:null},St=function(t,e){var n,r,i=t.endContainer;if(a(i))n=u(i,e);else if(i!==e&&s(i))n=i;else{if(!(n=vt(i,t.endOffset))||!h(e,n))for(n=e;r=n.lastChild;)n=r;n=u(n,e)}return n&&Ct(t,n,!0)?n:null},Ot=new r(null,4|G,(function(t){return t.nodeType===M?ot.test(t.data):"IMG"===t.nodeName})),Dt=function(t,e){var n,r=t.startContainer,i=t.startOffset;if(Ot.root=null,r.nodeType===M){if(i)return!1;n=r}else if((n=vt(r,i))&&!h(e,n)&&(n=null),!n&&((n=_t(r,i)).nodeType===M&&n.length))return!1;return Ot.currentNode=n,Ot.root=wt(t,e),!Ot.previousNode()},Rt=function(t,e){var n,r=t.endContainer,i=t.endOffset;if(Ot.root=null,r.nodeType===M){if((n=r.data.length)&&i<n)return!1;Ot.currentNode=r}else Ot.currentNode=_t(r,i);return Ot.root=St(t,e),!Ot.nextNode()},Nt=function(t,e){var n,r=wt(t,e),i=St(t,e);r&&i&&(n=r.parentNode,t.setStart(n,at.call(n.childNodes,r)),n=i.parentNode,t.setEnd(n,at.call(n.childNodes,i)+1))},At={8:"backspace",9:"tab",13:"enter",32:"space",33:"pageup",34:"pagedown",37:"left",39:"right",46:"delete",219:"[",221:"]"},Pt=function(t){var e=t.keyCode,n=At[e],r="",i=this.getSelection();t.defaultPrevented||(n||(n=String.fromCharCode(e).toLowerCase(),/^[A-Za-z0-9]$/.test(n)||(n="")),X&&46===t.which&&(n="."),111<e&&e<124&&(n="f"+(e-111)),"backspace"!==n&&"delete"!==n&&(t.altKey&&(r+="alt-"),t.ctrlKey&&(r+="ctrl-"),t.metaKey&&(r+="meta-")),t.shiftKey&&(r+="shift-"),n=r+n,this._keyHandlers[n]?this._keyHandlers[n](this,t,i):i.collapsed||t.isComposing||t.ctrlKey||t.metaKey||1!==(Z?n:t.key||n).length||(this.saveUndoState(i),yt(i,this._root),this._ensureBottomLine(),this.setSelection(i),this._updatePath(i,!0)))},kt=function(t){return function(e,n){n.preventDefault(),e[t]()}},Lt=function(t,e){return e=e||null,function(n,r){r.preventDefault();var i=n.getSelection();n.hasFormat(t,null,i)?n.changeFormat(null,{tag:t},i):n.changeFormat({tag:t},e,i)}},xt=function(t,e){try{e||(e=t.getSelection());var n,r=e.startContainer;for(r.nodeType===M&&(r=r.parentNode),n=r;a(n)&&(!n.textContent||n.textContent===U);)n=(r=n).parentNode;r!==n&&(e.setStart(n,at.call(n.childNodes,r)),e.collapse(!0),n.removeChild(r),s(n)||(n=u(n,t._root)),b(n,t._root),Tt(e)),r===t._root&&(r=r.firstChild)&&"BR"===r.nodeName&&v(r),t._ensureBottomLine(),t.setSelection(e),t._updatePath(e,!0)}catch(e){t.didError(e)}},Mt={enter:function(t,e,n){var r,i,o,a,s,l=t._root;if(e.preventDefault(),t._recordUndoState(n),pe(n.startContainer,l,t),t._removeZWS(),t._getRangeAndRemoveBookmark(n),n.collapsed||yt(n,l),(r=wt(n,l))&&(i=m(r,l,"PRE")))return Tt(n),o=n.startContainer,a=n.startOffset,o.nodeType!==M&&(o=t._doc.createTextNode(""),i.insertBefore(o,i.firstChild)),e.shiftKey||"\n"!==o.data.charAt(a-1)&&!Dt(n,l)||"\n"!==o.data.charAt(a)&&!Rt(n,l)?(o.insertData(a,"\n"),b(i,l),o.length===a+1?n.setStartAfter(o):n.setStart(o,a+1)):(o.deleteData(a&&a-1,a?2:1),(o=(s=T(o,a&&a-1,l,l)).previousSibling).textContent||v(o),o=t.createDefaultBlock(),s.parentNode.insertBefore(o,s),s.textContent||v(s),n.setStart(o,0)),n.collapse(!0),t.setSelection(n),t._updatePath(n,!0),void t._docWasChanged();if(!r||e.shiftKey||/^T[HD]$/.test(r.nodeName))return(i=m(n.endContainer,l,"A"))&&(i=i.parentNode,It(n,i,i,l),n.collapse(!1)),gt(n,t.createElement("BR")),n.collapse(!1),t.setSelection(n),void t._updatePath(n,!0);if((i=m(r,l,"LI"))&&(r=i),function(t){return!t.textContent&&!t.querySelector("IMG")}(r)){if(m(r,l,"UL")||m(r,l,"OL"))return t.decreaseListLevel(n);if(m(r,l,"BLOCKQUOTE"))return t.modifyBlocks(ue,n)}for(s=le(t,r,n.startContainer,n.startOffset),oe(r),zt(r),b(r,l);s.nodeType===x;){var c,u=s.firstChild;if("A"===s.nodeName&&(!s.textContent||s.textContent===U)){g(s,u=t._doc.createTextNode("")),s=u;break}for(;u&&u.nodeType===M&&!u.data&&(c=u.nextSibling)&&"BR"!==c.nodeName;)v(u),u=c;if(!u||"BR"===u.nodeName||u.nodeType===M&&!X)break;s=u}n=t.createRange(s,0),t.setSelection(n),t._updatePath(n,!0)},"shift-enter":function(t,e,n){return t._keyHandlers.enter(t,e,n)},backspace:function(t,e,n){var r=t._root;if(t._removeZWS(),t.saveUndoState(n),n.collapsed)if(Dt(n,r)){e.preventDefault();var i,o=wt(n,r);if(!o)return;if(C(o.parentNode,r),i=u(o,r)){if(!i.isContentEditable){for(;!i.parentNode.isContentEditable;)i=i.parentNode;return void v(i)}for(S(i,o,n,r),o=i.parentNode;o!==r&&!o.nextSibling;)o=o.parentNode;o!==r&&(o=o.nextSibling)&&O(o,r),t.setSelection(n)}else if(o){if(m(o,r,"UL")||m(o,r,"OL"))return t.decreaseListLevel(n);if(m(o,r,"BLOCKQUOTE"))return t.modifyBlocks(ce,n);t.setSelection(n),t._updatePath(n,!0)}}else t.setSelection(n),setTimeout((function(){xt(t)}),0);else e.preventDefault(),yt(n,r),xt(t,n)},delete:function(t,e,n){var r,i,o,a,s,l,c=t._root;if(t._removeZWS(),t.saveUndoState(n),n.collapsed)if(Rt(n,c)){if(e.preventDefault(),!(r=wt(n,c)))return;if(C(r.parentNode,c),i=d(r,c)){if(!i.isContentEditable){for(;!i.parentNode.isContentEditable;)i=i.parentNode;return void v(i)}for(S(r,i,n,c),i=r.parentNode;i!==c&&!i.nextSibling;)i=i.parentNode;i!==c&&(i=i.nextSibling)&&O(i,c),t.setSelection(n),t._updatePath(n,!0)}}else{if(o=n.cloneRange(),It(n,c,c,c),a=n.endContainer,s=n.endOffset,a.nodeType===x&&(l=a.childNodes[s])&&"IMG"===l.nodeName)return e.preventDefault(),v(l),Tt(n),void xt(t,n);t.setSelection(o),setTimeout((function(){xt(t)}),0)}else e.preventDefault(),yt(n,c),xt(t,n)},tab:function(t,e,n){var r,i,o=t._root;if(t._removeZWS(),n.collapsed&&Dt(n,o))for(r=wt(n,o);i=r.parentNode;){if("UL"===i.nodeName||"OL"===i.nodeName){e.preventDefault(),t.increaseListLevel(n);break}r=i}},"shift-tab":function(t,e,n){var r,i=t._root;t._removeZWS(),n.collapsed&&Dt(n,i)&&((m(r=n.startContainer,i,"UL")||m(r,i,"OL"))&&(e.preventDefault(),t.decreaseListLevel(n)))},space:function(t,e,n){var r,i=t._root;if(t._recordUndoState(n),pe(n.startContainer,i,t),t._getRangeAndRemoveBookmark(n),r=n.endContainer,n.collapsed&&n.endOffset===_(r))do{if("A"===r.nodeName){n.setStartAfter(r);break}}while(!r.nextSibling&&(r=r.parentNode)&&r!==i);n.collapsed||(yt(n,i),t._ensureBottomLine(),t.setSelection(n),t._updatePath(n,!0)),t.setSelection(n)},left:function(t){t._removeZWS()},right:function(t){t._removeZWS()}};j&&Y&&(Mt["meta-left"]=function(t,e){e.preventDefault();var n=ie(t);n&&n.modify&&n.modify("move","backward","lineboundary")},Mt["meta-right"]=function(t,e){e.preventDefault();var n=ie(t);n&&n.modify&&n.modify("move","forward","lineboundary")}),j||(Mt.pageup=function(t){t.moveCursorToStart()},Mt.pagedown=function(t){t.moveCursorToEnd()}),Mt[J+"b"]=Lt("B"),Mt[J+"i"]=Lt("I"),Mt[J+"u"]=Lt("U"),Mt[J+"shift-7"]=Lt("S"),Mt[J+"shift-5"]=Lt("SUB",{tag:"SUP"}),Mt[J+"shift-6"]=Lt("SUP",{tag:"SUB"}),Mt[J+"shift-8"]=kt("makeUnorderedList"),Mt[J+"shift-9"]=kt("makeOrderedList"),Mt[J+"["]=kt("decreaseQuoteLevel"),Mt[J+"]"]=kt("increaseQuoteLevel"),Mt[J+"d"]=kt("toggleCode"),Mt[J+"y"]=kt("redo"),Mt[J+"z"]=kt("undo"),Mt[J+"shift-z"]=kt("redo");var Ft={1:10,2:13,3:16,4:18,5:24,6:32,7:48},Bt={backgroundColor:{regexp:ot,replace:function(t,e,n){return y(t,"SPAN",{class:e.highlight,style:"background-color:"+n})}},color:{regexp:ot,replace:function(t,e,n){return y(t,"SPAN",{class:e.colour,style:"color:"+n})}},fontWeight:{regexp:/^bold|^700/i,replace:function(t){return y(t,"B")}},fontStyle:{regexp:/^italic/i,replace:function(t){return y(t,"I")}},fontFamily:{regexp:ot,replace:function(t,e,n){return y(t,"SPAN",{class:e.fontFamily,style:"font-family:"+n})}},fontSize:{regexp:ot,replace:function(t,e,n){return y(t,"SPAN",{class:e.fontSize,style:"font-size:"+n})}},textDecoration:{regexp:/^underline/i,replace:function(t){return y(t,"U")}}},Gt=function(t){return function(e,n){var r=y(e.ownerDocument,t);return n.replaceChild(r,e),r.appendChild(E(e)),r}},Ut=function(t,e,n){var r,i,o,a,s,l,c=t.style,u=t.ownerDocument;for(r in Bt)i=Bt[r],(o=c[r])&&i.regexp.test(o)&&(l=i.replace(u,n.classNames,o),s||(s=l),a&&a.appendChild(l),a=l,t.style[r]="");return s&&(a.appendChild(E(t)),"SPAN"===t.nodeName?e.replaceChild(s,t):t.appendChild(s)),a||t},qt={P:Ut,SPAN:Ut,STRONG:Gt("B"),EM:Gt("I"),INS:Gt("U"),STRIKE:Gt("S"),FONT:function(t,e,n){var r,i,o,a,s,l=t.face,c=t.size,u=t.color,d=t.ownerDocument,f=n.classNames;return l&&(s=r=y(d,"SPAN",{class:f.fontFamily,style:"font-family:"+l}),a=r),c&&(i=y(d,"SPAN",{class:f.fontSize,style:"font-size:"+Ft[c]+"px"}),s||(s=i),a&&a.appendChild(i),a=i),u&&/^#?([\dA-F]{3}){1,2}$/i.test(u)&&("#"!==u.charAt(0)&&(u="#"+u),o=y(d,"SPAN",{class:f.colour,style:"color:"+u}),s||(s=o),a&&a.appendChild(o),a=o),s||(s=a=y(d,"SPAN")),e.replaceChild(s,t),a.appendChild(E(t)),a},TT:function(t,e,n){var r=y(t.ownerDocument,"SPAN",{class:n.classNames.fontFamily,style:'font-family:menlo,consolas,"courier new",monospace'});return e.replaceChild(r,t),r.appendChild(E(t)),r}},Ht=/^(?:A(?:DDRESS|RTICLE|SIDE|UDIO)|BLOCKQUOTE|CAPTION|D(?:[DLT]|IV)|F(?:IGURE|IGCAPTION|OOTER)|H[1-6]|HEADER|HR|L(?:ABEL|EGEND|I)|O(?:L|UTPUT)|P(?:RE)?|SECTION|T(?:ABLE|BODY|D|FOOT|H|HEAD|R)|COL(?:GROUP)?|UL)$/,$t=/^(?:HEAD|META|STYLE)/,Vt=new r(null,4|G),jt=function t(e,n,r){var i,o,s,l,c,u,d,f,p,m,h,_,v=e.childNodes;for(i=e;a(i);)i=i.parentNode;for(Vt.root=i,o=0,s=v.length;o<s;o+=1)if(c=(l=v[o]).nodeName,u=l.nodeType,d=qt[c],u===x){if(f=l.childNodes.length,d)l=d(l,e,n);else{if($t.test(c)){e.removeChild(l),o-=1,s-=1;continue}if(!Ht.test(c)&&!a(l)){o-=1,s+=f-1,e.replaceChild(E(l),l);continue}}f&&t(l,n,r||"PRE"===c)}else{if(u===M){if(h=l.data,p=!ot.test(h.charAt(0)),m=!ot.test(h.charAt(h.length-1)),r||!p&&!m)continue;if(p){for(Vt.currentNode=l;(_=Vt.previousPONode())&&!("IMG"===(c=_.nodeName)||"#text"===c&&ot.test(_.data));)if(!a(_)){_=null;break}h=h.replace(/^[ \t\r\n]+/g,_?" ":"")}if(m){for(Vt.currentNode=l;(_=Vt.nextNode())&&!("IMG"===c||"#text"===c&&ot.test(_.data));)if(!a(_)){_=null;break}h=h.replace(/[ \t\r\n]+$/g,_?" ":"")}if(h){l.data=h;continue}}e.removeChild(l),o-=1,s-=1}return e},zt=function t(e){for(var n,r=e.childNodes,o=r.length;o--;)(n=r[o]).nodeType!==x||i(n)?n.nodeType!==M||n.data||e.removeChild(n):(t(n),a(n)&&!n.firstChild&&e.removeChild(n))},Yt=function(t){return t.nodeType===x?"BR"===t.nodeName||"IMG"===t.nodeName:ot.test(t.data)},Wt=function(t,e){for(var n,i=t.parentNode;a(i);)i=i.parentNode;return(n=new r(i,4|G,Yt)).currentNode=t,!!n.nextNode()||e&&!n.previousNode()},Xt=function(t,e,n){var r,i,o,s=t.querySelectorAll("BR"),l=[],c=s.length;for(r=0;r<c;r+=1)l[r]=Wt(s[r],n);for(;c--;)(o=(i=s[c]).parentNode)&&(l[c]?a(o)||C(o,e):v(i))},Kt=function(t,e,n,r){var i,o,a=e.ownerDocument.body,s=r.willCutCopy;Xt(e,n,!0),e.setAttribute("style","position:fixed;overflow:hidden;bottom:100%;right:100%;"),a.appendChild(e),i=e.innerHTML,o=e.innerText||e.textContent,s&&(i=s(i)),z&&(o=o.replace(/\r?\n/g,"\r\n")),t.setData("text/html",i),t.setData("text/plain",o),a.removeChild(e)},Qt=function(t){var e,n,r,i,o,a,s=t.clipboardData,l=this.getSelection(),c=this._root,u=this;if(l.collapsed)t.preventDefault();else{if(this.saveUndoState(l),K||V||!s)setTimeout((function(){try{u._ensureBottomLine()}catch(t){u.didError(t)}}),0);else{for(n=(e=wt(l,c))===St(l,c)&&e||c,r=yt(l,c),(i=l.commonAncestorContainer).nodeType===M&&(i=i.parentNode);i&&i!==n;)(o=i.cloneNode(!1)).appendChild(r),r=o,i=i.parentNode;(a=this.createElement("div")).appendChild(r),Kt(s,a,c,this._config),t.preventDefault()}this.setSelection(l)}},Zt=function(t){var e,n,r,i,o,a,s=t.clipboardData,l=this.getSelection(),c=this._root;if(!K&&!V&&s){for(n=(e=wt(l,c))===St(l,c)&&e||c,l=l.cloneRange(),Tt(l),It(l,n,n,c),r=l.cloneContents(),(i=l.commonAncestorContainer).nodeType===M&&(i=i.parentNode);i&&i!==n;)(o=i.cloneNode(!1)).appendChild(r),r=o,i=i.parentNode;(a=this.createElement("div")).appendChild(r),Kt(s,a,c,this._config),t.preventDefault()}},Jt=function(t){var e,n,r,i,o,a=t.clipboardData,s=a&&a.items,l=this.isShiftDown,c=!1,u=!1,d=null,f=this;if(K&&s){for(e=s.length;e--;)!l&&/^image\/.*/.test(s[e].type)&&(u=!0);u||(s=null)}if(s){for(t.preventDefault(),e=s.length;e--;){if(r=(n=s[e]).type,!l&&"text/html"===r)return void n.getAsString((function(t){f.insertHTML(t,!0)}));"text/plain"===r&&(d=n),!l&&/^image\/.*/.test(r)&&(u=!0)}u?(this.fireEvent("dragover",{dataTransfer:a,preventDefault:function(){c=!0}}),c&&this.fireEvent("drop",{dataTransfer:a})):d&&d.getAsString((function(t){f.insertPlainText(t,!0)}))}else{if(i=a&&a.types,!K&&i&&(at.call(i,"text/html")>-1||!Y&&at.call(i,"text/plain")>-1&&at.call(i,"text/rtf")<0))return t.preventDefault(),void(!l&&(o=a.getData("text/html"))?this.insertHTML(o,!0):((o=a.getData("text/plain"))||(o=a.getData("text/uri-list")))&&this.insertPlainText(o,!0));this._awaitingPaste=!0;var p=this._doc.body,m=this.getSelection(),h=m.startContainer,_=m.startOffset,g=m.endContainer,E=m.endOffset,y=this.createElement("DIV",{contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"});p.appendChild(y),m.selectNodeContents(y),this.setSelection(m),setTimeout((function(){try{f._awaitingPaste=!1;for(var t,e,n="",r=y;y=r;)r=y.nextSibling,v(y),(t=y.firstChild)&&t===y.lastChild&&"DIV"===t.nodeName&&(y=t),n+=y.innerHTML;e=f.createRange(h,_,g,E),f.setSelection(e),n&&f.insertHTML(n,!0)}catch(t){f.didError(t)}}),0)}},te=function(t){for(var e=t.dataTransfer.types,n=e.length,r=!1,i=!1;n--;)switch(e[n]){case"text/plain":r=!0;break;case"text/html":i=!0;break;default:return}(i||r)&&this.saveUndoState()},ee=N.prototype,ne=function(t,e,n){var r=n._doc,i=t?DOMPurify.sanitize(t,{ALLOW_UNKNOWN_PROTOCOLS:!0,WHOLE_DOCUMENT:!1,RETURN_DOM:!0,RETURN_DOM_FRAGMENT:!0}):null;return i?r.importNode(i,!0):r.createDocumentFragment()};ee.setConfig=function(t){return(t=R({blockTag:"DIV",blockAttributes:null,tagAttributes:{blockquote:null,ul:null,ol:null,li:null,a:null},classNames:{colour:"colour",fontFamily:"font",fontSize:"size",highlight:"highlight"},leafNodeNames:ut,undo:{documentSizeThreshold:-1,undoLimit:-1},isInsertedHTMLSanitized:!0,isSetHTMLSanitized:!0,sanitizeToDOMFragment:"undefined"!=typeof DOMPurify&&DOMPurify.isSupported?ne:null,willCutCopy:null},t,!0)).blockTag=t.blockTag.toUpperCase(),this._config=t,this},ee.createElement=function(t,e,n){return y(this._doc,t,e,n)},ee.createDefaultBlock=function(t){var e=this._config;return b(this.createElement(e.blockTag,e.blockAttributes,t),this._root)},ee.didError=function(t){console.log(t)},ee.getDocument=function(){return this._doc},ee.getRoot=function(){return this._root},ee.modifyDocument=function(t){var e=this._mutation;e&&(e.takeRecords().length&&this._docWasChanged(),e.disconnect()),this._ignoreAllChanges=!0,t(),this._ignoreAllChanges=!1,e&&(e.observe(this._root,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._ignoreChange=!1)};var re={pathChange:1,select:1,input:1,undoStateChange:1};ee.fireEvent=function(t,e){var n,r,i,o=this._events[t];if(/^(?:focus|blur)/.test(t))if(n=this._root===this._doc.activeElement,"focus"===t){if(!n||this._isFocused)return this;this._isFocused=!0}else{if(n||!this._isFocused)return this;this._isFocused=!1}if(o)for(e||(e={}),e.type!==t&&(e.type=t),r=(o=o.slice()).length;r--;){i=o[r];try{i.handleEvent?i.handleEvent(e):i.call(this,e)}catch(e){e.details="Squire: fireEvent error. Event type: "+t,this.didError(e)}}return this},ee.destroy=function(){var t,e=this._events;for(t in e)this.removeEventListener(t);this._mutation&&this._mutation.disconnect(),delete this._root.__squire__,this._undoIndex=-1,this._undoStack=[],this._undoStackLength=0},ee.handleEvent=function(t){this.fireEvent(t.type,t)},ee.addEventListener=function(t,e){var n=this._events[t],r=this._root;return e?(n||(n=this._events[t]=[],re[t]||("selectionchange"===t&&(r=this._doc),r.addEventListener(t,this,!0))),n.push(e),this):(this.didError({name:"Squire: addEventListener with null or undefined fn",message:"Event type: "+t}),this)},ee.removeEventListener=function(t,e){var n,r=this._events[t],i=this._root;if(r){if(e)for(n=r.length;n--;)r[n]===e&&r.splice(n,1);else r.length=0;r.length||(delete this._events[t],re[t]||("selectionchange"===t&&(i=this._doc),i.removeEventListener(t,this,!0)))}return this},ee.createRange=function(t,e,n,r){if(t instanceof this._win.Range)return t.cloneRange();var i=this._doc.createRange();return i.setStart(t,e),n?i.setEnd(n,r):i.setEnd(t,e),i},ee.getCursorPosition=function(t){if(!t&&!(t=this.getSelection())||!t.getBoundingClientRect)return null;var e,n,r=t.getBoundingClientRect();return r&&!r.top&&(this._ignoreChange=!0,(e=this._doc.createElement("SPAN")).textContent=U,gt(t,e),r=e.getBoundingClientRect(),(n=e.parentNode).removeChild(e),I(n,t)),r},ee._moveCursorTo=function(t){var e=this._root,n=this.createRange(e,t?0:e.childNodes.length);return Tt(n),this.setSelection(n),this},ee.moveCursorToStart=function(){return this._moveCursorTo(!0)},ee.moveCursorToEnd=function(){return this._moveCursorTo(!1)};var ie=function(t){return t._win.getSelection()||null};ee.setSelection=function(t){if(t)if(this._lastSelection=t,this._isFocused)if($&&!this._restoreSelection)A.call(this),this.blur(),this.focus();else{V&&this._win.focus();var e=ie(this);e&&(e.removeAllRanges(),e.addRange(t))}else A.call(this);return this},ee.getSelection=function(){var t,e,n,r,o=ie(this),a=this._root;return this._isFocused&&o&&o.rangeCount&&(e=(t=o.getRangeAt(0).cloneRange()).startContainer,n=t.endContainer,e&&i(e)&&t.setStartBefore(e),n&&i(n)&&t.setEndBefore(n)),t&&h(a,t.commonAncestorContainer)?this._lastSelection=t:h((r=(t=this._lastSelection).commonAncestorContainer).ownerDocument,r)||(t=null),t||(t=this.createRange(a.firstChild,0)),t},ee.getSelectedText=function(){var t=this.getSelection();if(!t||t.collapsed)return"";var e,n=new r(t.commonAncestorContainer,4|G,(function(e){return Ct(t,e,!0)})),i=t.startContainer,o=t.endContainer,s=n.currentNode=i,l="",c=!1;for(n.filter(s)||(s=n.nextNode());s;)s.nodeType===M?(e=s.data)&&/\S/.test(e)&&(s===o&&(e=e.slice(0,t.endOffset)),s===i&&(e=e.slice(t.startOffset)),l+=e,c=!0):("BR"===s.nodeName||c&&!a(s))&&(l+="\n",c=!1),s=n.nextNode();return l},ee.getPath=function(){return this._path};var oe=function(t,e){for(var n,i,o,s=new r(t,4);i=s.nextNode();)for(;(o=i.data.indexOf(U))>-1&&(!e||i.parentNode!==e);){if(1===i.length){do{(n=i.parentNode).removeChild(i),i=n,s.currentNode=n}while(a(i)&&!_(i));break}i.deleteData(o,1)}};ee._didAddZWS=function(){this._hasZWS=!0},ee._removeZWS=function(){this._hasZWS&&(oe(this._root),this._hasZWS=!1)},ee._updatePath=function(t,e){if(t){var n,r=t.startContainer,i=t.endContainer;(e||r!==this._lastAnchorNode||i!==this._lastFocusNode)&&(this._lastAnchorNode=r,this._lastFocusNode=i,n=r&&i?r===i?function t(e,n,r){var i,o,a,s,l,c="";return e&&e!==n&&(c=t(e.parentNode,n,r),e.nodeType===x&&(c+=(c?">":"")+e.nodeName,(i=e.id)&&(c+="#"+i),(o=e.className.trim())&&((a=o.split(/\s\s*/)).sort(),c+=".",c+=a.join(".")),(s=e.dir)&&(c+="[dir="+s+"]"),a&&(l=r.classNames,at.call(a,l.highlight)>-1&&(c+="[backgroundColor="+e.style.backgroundColor.replace(/ /g,"")+"]"),at.call(a,l.colour)>-1&&(c+="[color="+e.style.color.replace(/ /g,"")+"]"),at.call(a,l.fontFamily)>-1&&(c+="[fontFamily="+e.style.fontFamily.replace(/ /g,"")+"]"),at.call(a,l.fontSize)>-1&&(c+="[fontSize="+e.style.fontSize+"]")))),c}(i,this._root,this._config):"(selection)":"",this._path!==n&&(this._path=n,this.fireEvent("pathChange",{path:n}))),this.fireEvent(t.collapsed?"cursor":"select",{range:t})}},ee._updatePathOnEvent=function(t){var e=this;e._isFocused&&!e._willUpdatePath&&(e._willUpdatePath=!0,setTimeout((function(){e._willUpdatePath=!1,e._updatePath(e.getSelection())}),0))},ee.focus=function(){if(Z){try{this._root.setActive()}catch(t){}this.fireEvent("focus")}else this._root.focus();return this},ee.blur=function(){return this._root.blur(),Z&&this.fireEvent("blur"),this};var ae="squire-selection-end";ee._saveRangeToBookmark=function(t){var e,n=this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),r=this.createElement("INPUT",{id:ae,type:"hidden"});gt(t,n),t.collapse(!1),gt(t,r),2&n.compareDocumentPosition(r)&&(n.id=ae,r.id="squire-selection-start",e=n,n=r,r=e),t.setStartAfter(n),t.setEndBefore(r)},ee._getRangeAndRemoveBookmark=function(t){var e=this._root,n=e.querySelector("#squire-selection-start"),r=e.querySelector("#"+ae);if(n&&r){var i=n.parentNode,o=r.parentNode,a=at.call(i.childNodes,n),s=at.call(o.childNodes,r);i===o&&(s-=1),v(n),v(r),t||(t=this._doc.createRange()),t.setStart(i,a),t.setEnd(o,s),I(i,t),i!==o&&I(o,t),t.collapsed&&((i=t.startContainer).nodeType===M&&((o=i.childNodes[t.startOffset])&&o.nodeType===M||(o=i.childNodes[t.startOffset-1]),o&&o.nodeType===M&&(t.setStart(o,0),t.collapse(!0))))}return t||null},ee._keyUpDetectChange=function(t){var e=t.keyCode;t.ctrlKey||t.metaKey||t.altKey||!(e<16||e>20)||!(e<33||e>45)||this._docWasChanged()},ee._docWasChanged=function(){if(it&&(ht=new WeakMap),!this._ignoreAllChanges){if(rt&&this._ignoreChange)return void(this._ignoreChange=!1);this._isInUndoState&&(this._isInUndoState=!1,this.fireEvent("undoStateChange",{canUndo:!0,canRedo:!1})),this.fireEvent("input")}},ee._recordUndoState=function(t,e){if(!this._isInUndoState||e){var n,r=this._undoIndex,i=this._undoStack,o=this._config.undo,a=o.documentSizeThreshold,s=o.undoLimit;e||(r+=1),r<this._undoStackLength&&(i.length=this._undoStackLength=r),t&&this._saveRangeToBookmark(t),n=this._getHTML(),a>-1&&2*n.length>a&&s>-1&&r>s&&(i.splice(0,r-s),r=s,this._undoStackLength=s),i[r]=n,this._undoIndex=r,this._undoStackLength+=1,this._isInUndoState=!0}},ee.saveUndoState=function(t){return t===n&&(t=this.getSelection()),this._recordUndoState(t,this._isInUndoState),this._getRangeAndRemoveBookmark(t),this},ee.undo=function(){if(0!==this._undoIndex||!this._isInUndoState){this._recordUndoState(this.getSelection(),!1),this._undoIndex-=1,this._setHTML(this._undoStack[this._undoIndex]);var t=this._getRangeAndRemoveBookmark();t&&this.setSelection(t),this._isInUndoState=!0,this.fireEvent("undoStateChange",{canUndo:0!==this._undoIndex,canRedo:!0}),this.fireEvent("input")}return this},ee.redo=function(){var t=this._undoIndex,e=this._undoStackLength;if(t+1<e&&this._isInUndoState){this._undoIndex+=1,this._setHTML(this._undoStack[this._undoIndex]);var n=this._getRangeAndRemoveBookmark();n&&this.setSelection(n),this.fireEvent("undoStateChange",{canUndo:!0,canRedo:t+2<e}),this.fireEvent("input")}return this},ee.hasFormat=function(t,e,n){if(t=t.toUpperCase(),e||(e={}),!n&&!(n=this.getSelection()))return!1;!n.collapsed&&n.startContainer.nodeType===M&&n.startOffset===n.startContainer.length&&n.startContainer.nextSibling&&n.setStartBefore(n.startContainer.nextSibling),!n.collapsed&&n.endContainer.nodeType===M&&0===n.endOffset&&n.endContainer.previousSibling&&n.setEndAfter(n.endContainer.previousSibling);var i,o,a=this._root,s=n.commonAncestorContainer;if(m(s,a,t,e))return!0;if(s.nodeType===M)return!1;i=new r(s,4,(function(t){return Ct(n,t,!0)}));for(var l=!1;o=i.nextNode();){if(!m(o,a,t,e))return!1;l=!0}return l},ee.getFontInfo=function(t){var e,r,i,o={color:n,backgroundColor:n,family:n,size:n},a=0;if(!t&&!(t=this.getSelection()))return o;if(e=t.commonAncestorContainer,t.collapsed||e.nodeType===M)for(e.nodeType===M&&(e=e.parentNode);a<4&&e;)(r=e.style)&&(!o.color&&(i=r.color)&&(o.color=i,a+=1),!o.backgroundColor&&(i=r.backgroundColor)&&(o.backgroundColor=i,a+=1),!o.family&&(i=r.fontFamily)&&(o.family=i,a+=1),!o.size&&(i=r.fontSize)&&(o.size=i,a+=1)),e=e.parentNode;return o},ee._addFormat=function(t,e,n){var i,o,s,l,c,u,d,f,p=this._root;if(n.collapsed){for(i=b(this.createElement(t,e),p),gt(n,i),n.setStart(i.firstChild,i.firstChild.length),n.collapse(!0),f=i;a(f);)f=f.parentNode;oe(f,i)}else{if(o=new r(n.commonAncestorContainer,4|G,(function(t){return(t.nodeType===M||"BR"===t.nodeName||"IMG"===t.nodeName)&&Ct(n,t,!0)})),s=n.startContainer,c=n.startOffset,l=n.endContainer,u=n.endOffset,o.currentNode=s,o.filter(s)||(s=o.nextNode(),c=0),!s)return n;do{!m(d=o.currentNode,p,t,e)&&(d===l&&d.length>u&&d.splitText(u),d===s&&c&&(d=d.splitText(c),l===s&&(l=d,u-=c),s=d,c=0),g(d,i=this.createElement(t,e)),i.appendChild(d))}while(o.nextNode());l.nodeType!==M&&(d.nodeType===M?(l=d,u=d.length):(l=d.parentNode,u=1)),n=this.createRange(s,c,l,u)}return n},ee._removeFormat=function(t,e,n,r){this._saveRangeToBookmark(n);var i,o=this._doc;n.collapsed&&(et?(i=o.createTextNode(U),this._didAddZWS()):i=o.createTextNode(""),gt(n,i));for(var s=n.commonAncestorContainer;a(s);)s=s.parentNode;var l=n.startContainer,c=n.startOffset,u=n.endContainer,d=n.endOffset,f=[],m=function(t,e){if(!Ct(n,t,!1)){var r,i,o=t.nodeType===M;if(!Ct(n,t,!0))return void("INPUT"===t.nodeName||o&&!t.data||f.push([e,t]));if(o)t===u&&d!==t.length&&f.push([e,t.splitText(d)]),t===l&&c&&(t.splitText(c),f.push([e,t]));else for(r=t.firstChild;r;r=i)i=r.nextSibling,m(r,e)}},h=Array.prototype.filter.call(s.getElementsByTagName(t),(function(r){return Ct(n,r,!0)&&p(r,t,e)}));return r||h.forEach((function(t){m(t,t)})),f.forEach((function(t){var e=t[0].cloneNode(!1),n=t[1];g(n,e),e.appendChild(n)})),h.forEach((function(t){g(t,E(t))})),this._getRangeAndRemoveBookmark(n),i&&n.collapse(!1),I(s,n),n},ee.changeFormat=function(t,e,n,r){return n||(n=this.getSelection())?(this.saveUndoState(n),e&&(n=this._removeFormat(e.tag.toUpperCase(),e.attributes||{},n,r)),t&&(n=this._addFormat(t.tag.toUpperCase(),t.attributes||{},n)),this.setSelection(n),this._updatePath(n,!0),rt||this._docWasChanged(),this):this};var se={DT:"DD",DD:"DT",LI:"LI",PRE:"PRE"},le=function(t,e,n,r){var i=se[e.nodeName],o=null,a=T(n,r,e.parentNode,t._root),s=t._config;return i||(i=s.blockTag,o=s.blockAttributes),p(a,i,o)||(e=y(a.ownerDocument,i,o),a.dir&&(e.dir=a.dir),g(a,e),e.appendChild(E(a)),a=e),a};ee.forEachBlock=function(t,e,n){if(!n&&!(n=this.getSelection()))return this;e&&this.saveUndoState(n);var r=this._root,i=wt(n,r),o=St(n,r);if(i&&o)do{if(t(i)||i===o)break}while(i=d(i,r));return e&&(this.setSelection(n),this._updatePath(n,!0),rt||this._docWasChanged()),this},ee.modifyBlocks=function(t,e){if(!e&&!(e=this.getSelection()))return this;this._recordUndoState(e,this._isInUndoState);var n,r=this._root;return Nt(e,r),It(e,r,r,r),n=Et(e,r,r),gt(e,t.call(this,n)),e.endOffset<e.endContainer.childNodes.length&&O(e.endContainer.childNodes[e.endOffset],r),O(e.startContainer.childNodes[e.startOffset],r),this._getRangeAndRemoveBookmark(e),this.setSelection(e),this._updatePath(e,!0),rt||this._docWasChanged(),this};var ce=function(t){var e=this._root,n=t.querySelectorAll("blockquote");return Array.prototype.filter.call(n,(function(t){return!m(t.parentNode,e,"BLOCKQUOTE")})).forEach((function(t){g(t,E(t))})),t},ue=function(){return this.createDefaultBlock([this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),this.createElement("INPUT",{id:ae,type:"hidden"})])},de=function(t,e,n){for(var r,i,o,a,s=c(e,t._root),l=t._config.tagAttributes,u=l[n.toLowerCase()],d=l.li;r=s.nextNode();)"LI"===r.parentNode.nodeName&&(r=r.parentNode,s.currentNode=r.lastChild),"LI"!==r.nodeName?(a=t.createElement("LI",d),r.dir&&(a.dir=r.dir),(o=r.previousSibling)&&o.nodeName===n?(o.appendChild(a),v(r)):g(r,t.createElement(n,u,[a])),a.appendChild(E(r)),s.currentNode=a):(i=(r=r.parentNode).nodeName)!==n&&/^[OU]L$/.test(i)&&g(r,t.createElement(n,u,[E(r)]))},fe=function(t,e){for(var n=t.commonAncestorContainer,r=t.startContainer,i=t.endContainer;n&&n!==e&&!/^[OU]L$/.test(n.nodeName);)n=n.parentNode;if(!n||n===e)return null;for(r===n&&(r=r.childNodes[t.startOffset]),i===n&&(i=i.childNodes[t.endOffset]);r&&r.parentNode!==n;)r=r.parentNode;for(;i&&i.parentNode!==n;)i=i.parentNode;return[n,r,i]};ee.increaseListLevel=function(t){if(!t&&!(t=this.getSelection()))return this.focus();var e=this._root,n=fe(t,e);if(!n)return this.focus();var r=n[0],i=n[1],o=n[2];if(!i||i===r.firstChild)return this.focus();this._recordUndoState(t,this._isInUndoState);var a,s,l=r.nodeName,c=i.previousSibling;c.nodeName!==l&&(a=this._config.tagAttributes[l.toLowerCase()],c=this.createElement(l,a),r.insertBefore(c,i));do{s=i===o?null:i.nextSibling,c.appendChild(i)}while(i=s);return(s=c.nextSibling)&&O(s,e),this._getRangeAndRemoveBookmark(t),this.setSelection(t),this._updatePath(t,!0),rt||this._docWasChanged(),this.focus()},ee.decreaseListLevel=function(t){if(!t&&!(t=this.getSelection()))return this.focus();var e=this._root,n=fe(t,e);if(!n)return this.focus();var r=n[0],i=n[1],o=n[2];i||(i=r.firstChild),o||(o=r.lastChild),this._recordUndoState(t,this._isInUndoState);var a,s=r.parentNode,l=o.nextSibling?T(r,o.nextSibling,s,e):r.nextSibling;if(s!==e&&"LI"===s.nodeName){for(s=s.parentNode;l;)a=l.nextSibling,o.appendChild(l),l=a;l=r.parentNode.nextSibling}var c=!/^[OU]L$/.test(s.nodeName);do{a=i===o?null:i.nextSibling,r.removeChild(i),c&&"LI"===i.nodeName&&(i=this.createDefaultBlock([E(i)])),s.insertBefore(i,l)}while(i=a);return r.firstChild||v(r),l&&O(l,e),this._getRangeAndRemoveBookmark(t),this.setSelection(t),this._updatePath(t,!0),rt||this._docWasChanged(),this.focus()},ee._ensureBottomLine=function(){var t=this._root,e=t.lastElementChild;e&&e.nodeName===this._config.blockTag&&s(e)||t.appendChild(this.createDefaultBlock())},ee.setKeyHandler=function(t,e){return this._keyHandlers[t]=e,this},ee._getHTML=function(){return this._root.innerHTML},ee._setHTML=function(t){var e=this._root,n=e;n.innerHTML=t;do{b(n,e)}while(n=d(n,e));this._ignoreChange=!0},ee.getHTML=function(t){var e,n,r,i,o,a,s=[];if(t&&(a=this.getSelection())&&this._saveRangeToBookmark(a),tt)for(n=e=this._root;n=d(n,e);)n.textContent||n.querySelector("BR")||(r=this.createElement("BR"),n.appendChild(r),s.push(r));if(i=this._getHTML().replace(/\u200B/g,""),tt)for(o=s.length;o--;)v(s[o]);return a&&this._getRangeAndRemoveBookmark(a),i},ee.setHTML=function(t){var e,n,r,i=this._config,o=i.isSetHTMLSanitized?i.sanitizeToDOMFragment:null,a=this._root;"function"==typeof o?n=o(t,!1,this):((e=this.createElement("DIV")).innerHTML=t,(n=this._doc.createDocumentFragment()).appendChild(E(e))),jt(n,i),Xt(n,a,!1),C(n,a);for(var s=n;s=d(s,a);)b(s,a);for(this._ignoreChange=!0;r=a.lastChild;)a.removeChild(r);a.appendChild(n),b(a,a),this._undoIndex=-1,this._undoStack.length=0,this._undoStackLength=0,this._isInUndoState=!1;var l=this._getRangeAndRemoveBookmark()||this.createRange(a.firstChild,0);return this.saveUndoState(l),this._lastSelection=l,A.call(this),this._updatePath(l,!0),this},ee.insertElement=function(t,e){if(e||(e=this.getSelection()),e.collapse(!0),a(t))gt(e,t),e.setStartAfter(t);else{for(var n,r=this._root,i=wt(e,r)||r;i!==r&&!i.nextSibling;)i=i.parentNode;i!==r&&(n=T(i.parentNode,i.nextSibling,r,r)),n?r.insertBefore(t,n):(r.appendChild(t),n=this.createDefaultBlock(),r.appendChild(n)),e.setStart(n,0),e.setEnd(n,0),Tt(e)}return this.focus(),this.setSelection(e),this._updatePath(e),rt||this._docWasChanged(),this},ee.insertImage=function(t,e){var n=this.createElement("IMG",R({src:t},e,!0));return this.insertElement(n),n},ee.linkRegExp=/\b((?:(?:ht|f)tps?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))|([\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,}\b)(?:\?[^&?\s]+=[^&?\s]+(?:&[^&?\s]+=[^&?\s]+)*)?/i;var pe=function(t,e,n){var i,o,a,s,l,c,u,d=t.ownerDocument,f=new r(t,4,(function(t){return!m(t,e,"A")})),p=n.linkRegExp,h=n._config.tagAttributes.a;if(p)for(;i=f.nextNode();)for(o=i.data,a=i.parentNode;s=p.exec(o);)c=(l=s.index)+s[0].length,l&&(u=d.createTextNode(o.slice(0,l)),a.insertBefore(u,i)),(u=n.createElement("A",R({href:s[1]?/^(?:ht|f)tps?:/i.test(s[1])?s[1]:"http://"+s[1]:"mailto:"+s[0]},h,!1))).textContent=o.slice(l,c),a.insertBefore(u,i),i.data=o=o.slice(c)};ee.insertHTML=function(t,e){var n,r,i,o,a,s,l,c=this._config,u=c.isInsertedHTMLSanitized?c.sanitizeToDOMFragment:null,f=this.getSelection(),p=this._doc;"function"==typeof u?o=u(t,e,this):(e&&(n=t.indexOf("\x3c!--StartFragment--\x3e"),r=t.lastIndexOf("\x3c!--EndFragment--\x3e"),n>-1&&r>-1&&(t=t.slice(n+20,r))),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(t)&&(t="<TR>"+t+"</TR>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(t)&&(t="<TABLE>"+t+"</TABLE>"),(i=this.createElement("DIV")).innerHTML=t,(o=p.createDocumentFragment()).appendChild(E(i))),this.saveUndoState(f);try{for(a=this._root,s=o,l={fragment:o,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},pe(o,o,this),jt(o,c),Xt(o,a,!1),zt(o),o.normalize();s=d(s,o);)b(s,a);e&&this.fireEvent("willPaste",l),l.defaultPrevented||(bt(f,l.fragment,a),rt||this._docWasChanged(),f.collapse(!1),this._ensureBottomLine()),this.setSelection(f),this._updatePath(f,!0),e&&this.focus()}catch(t){this.didError(t)}return this};var me=function(t){return t.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")};ee.insertPlainText=function(t,e){var n=this.getSelection();if(n.collapsed&&m(n.startContainer,this._root,"PRE")){var r,i,o=n.startContainer,a=n.startOffset;return o&&o.nodeType===M||(r=this._doc.createTextNode(""),o.insertBefore(r,o.childNodes[a]),o=r,a=0),i={text:t,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},e&&this.fireEvent("willPaste",i),i.defaultPrevented||(t=i.text,o.insertData(a,t),n.setStart(o,a+t.length),n.collapse(!0)),this.setSelection(n),this}var s,l,c,u,d=t.split("\n"),f=this._config,p=f.blockTag,h=f.blockAttributes,_="</"+p+">",v="<"+p;for(s in h)v+=" "+s+'="'+me(h[s])+'"';for(v+=">",l=0,c=d.length;l<c;l+=1)u=d[l],u=me(u).replace(/ (?= )/g,"&nbsp;"),d[l]=v+(u||"<BR>")+_;return this.insertHTML(d.join(""),e)};var he=function(t,e,n){return function(){return this[t](e,n),this.focus()}};ee.addStyles=function(t){if(t){var e=this._doc.documentElement.firstChild,n=this.createElement("STYLE",{type:"text/css"});n.appendChild(this._doc.createTextNode(t)),e.appendChild(n)}return this},ee.bold=he("changeFormat",{tag:"B"}),ee.italic=he("changeFormat",{tag:"I"}),ee.underline=he("changeFormat",{tag:"U"}),ee.strikethrough=he("changeFormat",{tag:"S"}),ee.subscript=he("changeFormat",{tag:"SUB"},{tag:"SUP"}),ee.superscript=he("changeFormat",{tag:"SUP"},{tag:"SUB"}),ee.removeBold=he("changeFormat",null,{tag:"B"}),ee.removeItalic=he("changeFormat",null,{tag:"I"}),ee.removeUnderline=he("changeFormat",null,{tag:"U"}),ee.removeStrikethrough=he("changeFormat",null,{tag:"S"}),ee.removeSubscript=he("changeFormat",null,{tag:"SUB"}),ee.removeSuperscript=he("changeFormat",null,{tag:"SUP"}),ee.makeLink=function(t,e){var n=this.getSelection();if(n.collapsed){var r=t.indexOf(":")+1;if(r)for(;"/"===t[r];)r+=1;gt(n,this._doc.createTextNode(t.slice(r)))}return e=R(R({href:t},e,!0),this._config.tagAttributes.a,!1),this.changeFormat({tag:"A",attributes:e},{tag:"A"},n),this.focus()},ee.removeLink=function(){return this.changeFormat(null,{tag:"A"},this.getSelection(),!0),this.focus()},ee.setFontFace=function(t){var e=this._config.classNames.fontFamily;return this.changeFormat(t?{tag:"SPAN",attributes:{class:e,style:"font-family: "+t+", sans-serif;"}}:null,{tag:"SPAN",attributes:{class:e}}),this.focus()},ee.setFontSize=function(t){var e=this._config.classNames.fontSize;return this.changeFormat(t?{tag:"SPAN",attributes:{class:e,style:"font-size: "+("number"==typeof t?t+"px":t)}}:null,{tag:"SPAN",attributes:{class:e}}),this.focus()},ee.setTextColour=function(t){var e=this._config.classNames.colour;return this.changeFormat(t?{tag:"SPAN",attributes:{class:e,style:"color:"+t}}:null,{tag:"SPAN",attributes:{class:e}}),this.focus()},ee.setHighlightColour=function(t){var e=this._config.classNames.highlight;return this.changeFormat(t?{tag:"SPAN",attributes:{class:e,style:"background-color:"+t}}:t,{tag:"SPAN",attributes:{class:e}}),this.focus()},ee.setTextAlignment=function(t){return this.forEachBlock((function(e){var n=e.className.split(/\s+/).filter((function(t){return!!t&&!/^align/.test(t)})).join(" ");t?(e.className=n+" align-"+t,e.style.textAlign=t):(e.className=n,e.style.textAlign="")}),!0),this.focus()},ee.setTextDirection=function(t){return this.forEachBlock((function(e){t?e.dir=t:e.removeAttribute("dir")}),!0),this.focus()};var _e=function(t){for(var e,n=this._root,i=this._doc,o=i.createDocumentFragment(),a=c(t,n);e=a.nextNode();){var s,l,u=e.querySelectorAll("BR"),d=[],f=u.length;for(s=0;s<f;s+=1)d[s]=Wt(u[s],!1);for(;f--;)l=u[f],d[f]?g(l,i.createTextNode("\n")):v(l);for(f=(u=e.querySelectorAll("CODE")).length;f--;)v(u[f]);o.childNodes.length&&o.appendChild(i.createTextNode("\n")),o.appendChild(E(e))}for(a=new r(o,4);e=a.nextNode();)e.data=e.data.replace(/ /g," ");return o.normalize(),b(this.createElement("PRE",this._config.tagAttributes.pre,[o]),n)},ve=function(t){for(var e,n,i,o,a,s,l=this._doc,c=this._root,u=t.querySelectorAll("PRE"),d=u.length;d--;){for(n=new r(e=u[d],4);i=n.nextNode();){for(o=(o=i.data).replace(/ (?= )/g," "),a=l.createDocumentFragment();(s=o.indexOf("\n"))>-1;)a.appendChild(l.createTextNode(o.slice(0,s))),a.appendChild(l.createElement("BR")),o=o.slice(s+1);i.parentNode.insertBefore(a,i),i.data=o}C(e,c),g(e,E(e))}return t};ee.code=function(){var t=this.getSelection();return t.collapsed||l(t.commonAncestorContainer)?this.modifyBlocks(_e,t):this.changeFormat({tag:"CODE",attributes:this._config.tagAttributes.code},null,t),this.focus()},ee.removeCode=function(){var t=this.getSelection();return m(t.commonAncestorContainer,this._root,"PRE")?this.modifyBlocks(ve,t):this.changeFormat(null,{tag:"CODE"},t),this.focus()},ee.toggleCode=function(){return this.hasFormat("PRE")||this.hasFormat("CODE")?this.removeCode():this.code(),this},ee.removeAllFormatting=function(t){if(!t&&!(t=this.getSelection())||t.collapsed)return this;for(var e=this._root,n=t.commonAncestorContainer;n&&!s(n);)n=n.parentNode;if(n||(Nt(t,e),n=e),n.nodeType===M)return this;this.saveUndoState(t),It(t,n,n,e);for(var r,i,o=n.ownerDocument,a=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,d=o.createDocumentFragment(),f=o.createDocumentFragment(),p=T(c,u,n,e),m=T(a,l,n,e);m!==p;)r=m.nextSibling,d.appendChild(m),m=r;return L(this,d,f),f.normalize(),m=f.firstChild,r=f.lastChild,i=n.childNodes,m?(n.insertBefore(f,p),l=at.call(i,m),u=at.call(i,r)+1):u=l=at.call(i,p),t.setStart(n,l),t.setEnd(n,u),I(n,t),Tt(t),this.setSelection(t),this._updatePath(t,!0),this.focus()},ee.increaseQuoteLevel=he("modifyBlocks",(function(t){return this.createElement("BLOCKQUOTE",this._config.tagAttributes.blockquote,[t])})),ee.decreaseQuoteLevel=he("modifyBlocks",ce),ee.makeUnorderedList=he("modifyBlocks",(function(t){return de(this,t,"UL"),t})),ee.makeOrderedList=he("modifyBlocks",(function(t){return de(this,t,"OL"),t})),ee.removeList=he("modifyBlocks",(function(t){var e,n,r,i,o,a=t.querySelectorAll("UL, OL"),l=t.querySelectorAll("LI"),c=this._root;for(e=0,n=a.length;e<n;e+=1)C(i=E(r=a[e]),c),g(r,i);for(e=0,n=l.length;e<n;e+=1)s(o=l[e])?g(o,this.createDefaultBlock([E(o)])):(C(o,c),g(o,E(o)));return t})),N.isInline=a,N.isBlock=s,N.isContainer=l,N.getBlockWalker=c,N.getPreviousBlock=u,N.getNextBlock=d,N.areAlike=f,N.hasTagAttributes=p,N.getNearest=m,N.isOrContains=h,N.detach=v,N.replaceWith=g,N.empty=E,N.getNodeBefore=_t,N.getNodeAfter=vt,N.insertNodeInRange=gt,N.extractContentsOfRange=Et,N.deleteContentsOfRange=yt,N.insertTreeFragmentIntoRange=bt,N.isNodeContainedInRange=Ct,N.moveRangeBoundariesDownTree=Tt,N.moveRangeBoundariesUpTree=It,N.getStartBlockOfRange=wt,N.getEndBlockOfRange=St,N.contentWalker=Ot,N.rangeDoesStartAtBlockBoundary=Dt,N.rangeDoesEndAtBlockBoundary=Rt,N.expandRangeToBlockBoundaries=Nt,N.onPaste=Jt,N.addLinks=pe,N.splitBlock=le,N.startSelectionId="squire-selection-start",N.endSelectionId=ae,t.exports=N}(document)},ugYh:function(t,e,n){"use strict";n.r(e);var r=n("0fPN"),i=n("1IHE"),o={mixins:[r.a,i.a],props:{queryUrl:{type:String,required:!1},link:{type:Object,required:!1,default:function(){}}},data:function(){return{form:{url:null,title:null,content:null,is_private:!1,is_pinned:!1,tags:[]},parsing:!1,loading:!1,archiving:!1,archive:null}},mounted:function(){this.queryUrl&&(this.form.url=this.queryUrl),this.link&&(this.form=this.link)},methods:{parse:function(){var t=this;this.loading=!0,this.parsing=!0,axios.post("/api/link/parse",{url:this.form.url}).then((function(e){t.loading=!1,t.parsing=!1,200===e.status&&(t.form.title=e.data.title,t.form.content=e.data.content)})).catch((function(e){t.loading=!1,t.parsing=!1,t.setFormError(e),t.setHttpError(e),t.toastHttpError(t.__("Unable to parse link"))}))},submit:function(t){var e=this;this.loading=!0,axios.request({method:this.link?"PUT":"POST",url:this.link?this.link.url_update:"/api/link",data:this.form}).then((function(n){switch(e.$toasted.success(e.__("Saved")),t){case"view":window.location=n.data.post.url;break;case"new":window.location="/link/create";break;case"edit":window.location="/link/".concat(n.data.post.postable_id,"/edit")}})).catch((function(t){e.loading=!1,e.setFormError(t),e.setHttpError(t),e.toastHttpError(e.__("Can't save"))}))},openArchive:function(){var t=this;axios.get(this.link.url_archive).then((function(e){t.archive=e.data,t.archiving=!0})).catch((function(e){t.setHttpError(e),t.toastHttpError(t.__("Whoops!"))}))},askArchive:function(t){var e=this;axios.put(this.link.url_archive,{type:t}).then((function(t){e.$toasted.success(t.data.message),e.archiving=!1,e.archive=null})).catch((function(t){e.setHttpError(t),e.toastHttpError(e.__("Whoops!"))}))},deleteArchive:function(){var t=this;axios.delete(this.link.url_archive).then((function(e){t.$toasted.success(e.data.message),t.archiving=!1,t.archive=null})).catch((function(e){t.setHttpError(e),t.toastHttpError(t.__("Whoops!"))}))}},watch:{"form.url":_.debounce((function(t){t&&!this.link&&this.parse(t)}),500)}},a=n("KHd+"),s=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--link"},[n("div",{staticClass:"card-body"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"url"}},[t._v(t._s(t.__("URL")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.url,expression:"form.url"}],ref:"url",staticClass:"form-control",class:{"is-invalid":t.hasFormError("url")},attrs:{type:"text",id:"url",dusk:"link-form-url"},domProps:{value:t.form.url},on:{input:function(e){e.target.composing||t.$set(t.form,"url",e.target.value)}}}),t._v(" "),t.hasFormError("url")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("url")))]):t._e(),t._v(" "),t.parsing?n("small",{staticClass:"form-text text-muted",attrs:{dusk:"link-form-parsing-message"}},[t._v(t._s(t.__("Retrieving URL informations...")))]):t._e()]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"title"}},[t._v(t._s(t.__("Title")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.title,expression:"form.title"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("title")},attrs:{type:"text",id:"title",disabled:t.loading,dusk:"link-form-title"},domProps:{value:t.form.title},on:{input:function(e){e.target.composing||t.$set(t.form,"title",e.target.value)}}}),t._v(" "),t.hasFormError("title")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("title")))]):t._e()]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"content"}},[t._v(t._s(t.__("Content")))]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.content,expression:"form.content"}],staticClass:"form-control",class:{"is-invalid":t.hasFormError("content")},attrs:{id:"content",disabled:t.loading,dusk:"link-form-content"},domProps:{value:t.form.content},on:{input:function(e){e.target.composing||t.$set(t.form,"content",e.target.value)}}}),t._v(" "),t.hasFormError("content")?n("span",{staticClass:"invalid-feedback"},[t._v(t._s(t.firstFormError("content")))]):t._e()]),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_private,expression:"form.is_private"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"is_private",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_private)?t._i(t.form.is_private,null)>-1:t.form.is_private},on:{change:function(e){var n=t.form.is_private,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_private",n.concat([null])):o>-1&&t.$set(t.form,"is_private",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_private",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_private",dusk:"link-form-private"}},[t._v(t._s(t.__("Is private?")))])])])]),t._v(" "),n("div",{staticClass:"col-12 col-md-6"},[n("div",{staticClass:"form-group"},[n("div",{staticClass:"custom-control custom-switch"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.is_pinned,expression:"form.is_pinned"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"is_pinned",disabled:t.loading},domProps:{checked:Array.isArray(t.form.is_pinned)?t._i(t.form.is_pinned,null)>-1:t.form.is_pinned},on:{change:function(e){var n=t.form.is_pinned,r=e.target,i=!!r.checked;if(Array.isArray(n)){var o=t._i(n,null);r.checked?o<0&&t.$set(t.form,"is_pinned",n.concat([null])):o>-1&&t.$set(t.form,"is_pinned",n.slice(0,o).concat(n.slice(o+1)))}else t.$set(t.form,"is_pinned",i)}}}),t._v(" "),n("label",{staticClass:"custom-control-label",attrs:{for:"is_pinned",dusk:"link-form-pinned"}},[t._v(t._s(t.__("Is pinned?")))])])])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",[t._v(t._s(t.__("Tags")))]),t._v(" "),n("tags",{attrs:{dusk:"link-form-tags"},model:{value:t.form.tags,callback:function(e){t.$set(t.form,"tags",e)},expression:"form.tags"}})],1)]),t._v(" "),n("div",{staticClass:"card-footer d-flex justify-content-between"},[n("div",[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn btn-primary",attrs:{type:"button",disabled:t.loading,dusk:"link-form-save"},on:{click:function(e){return e.preventDefault(),t.submit("edit")}}},[t.loading?n("span",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status","aria-hidden":"true"}}):t._e(),t._v("\n "+t._s(t.__("Save"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-primary dropdown-toggle dropdown-toggle-split",attrs:{type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",dusk:"link-form-save-dropdown"}}),t._v(" "),n("div",{staticClass:"dropdown-menu"},[n("button",{staticClass:"dropdown-item",attrs:{type:"button",dusk:"link-form-save-view"},on:{click:function(e){return e.preventDefault(),t.submit("view")}}},[t._v(t._s(t.__("Save & View")))]),t._v(" "),n("button",{staticClass:"dropdown-item",attrs:{type:"button",dusk:"link-form-save-new"},on:{click:function(e){return e.preventDefault(),t.submit("new")}}},[t._v(t._s(t.__("Save & New")))])])]),t._v(" "),t.link?n("button",{staticClass:"btn btn-outline-primary",attrs:{type:"button"},on:{click:t.openArchive}},[t._v(t._s(t.__("Archive")))]):t._e(),t._v(" "),t.link?n("a",{staticClass:"btn btn-outline-primary",attrs:{href:t.link.permalink}},[t._v(t._s(t.__("View")))]):t._e()]),t._v(" "),t._t("actions")],2),t._v(" "),n("modal",{attrs:{open:t.archiving,size:"lg"},on:{closed:function(e){t.archiving=!1}},scopedSlots:t._u([{key:"header",fn:function(){return[t._v(t._s(t.__("Archive")))]},proxy:!0},{key:"content",fn:function(){return[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-md-6"},[n("h4",[t._v(t._s(t.__("Current archive")))]),t._v(" "),t.archive.download?n("p",[n("a",{staticClass:"btn btn-sm btn-primary text-white btn-block",attrs:{href:t.link.url_download}},[t._v(t._s(t.__("Download")))]),t._v(" "),n("confirm",{staticClass:"btn btn-sm btn-danger text-white btn-block",attrs:{text:t.__("Delete"),"text-confirm":t.__("Confirm")},on:{confirmed:t.deleteArchive}})],1):n("div",{staticClass:"alert alert-info"},[t._v("\n "+t._s(t.__("Archive does not exist"))+"\n ")])]),t._v(" "),n("div",{staticClass:"col-12 col-md-6"},[n("h4",[t._v(t._s(t.__("New archive")))]),t._v(" "),t.archive.providers.length>0?n("p",[-1!==t.archive.providers.indexOf("media")?n("button",{staticClass:"btn btn-sm btn-primary btn-block",attrs:{name:"type"},on:{click:function(e){return t.askArchive("media")}}},[t._v(t._s(t.__("Archive as Media")))]):t._e(),t._v(" "),-1!==t.archive.providers.indexOf("pdf")?n("button",{staticClass:"btn btn-sm btn-primary btn-block",attrs:{name:"type"},on:{click:function(e){return t.askArchive("pdf")}}},[t._v(t._s(t.__("Archive as PDF")))]):t._e()]):n("div",{staticClass:"alert alert-info"},[t._v("\n "+t._s(t.__("No provider found to archive this link"))+"\n ")])])])]},proxy:!0}])})],1)}),[],!1,null,null,null);e.default=s.exports},ui2e:function(t,e,n){"use strict";n.r(e);var r={props:{version:{type:Object,required:!0}},data:function(){return{open:!1}},mounted:function(){this.shouldShowNotification()&&this.notify()},methods:{notify:function(){var t=this;this.$toasted.info(this.__("New version :version available",{version:this.version.id}),{position:"bottom-right",action:[{text:this.__("View"),onClick:function(e,n){n.goAway(0),t.open=!0}},{text:this.__("Hide"),onClick:function(e,n){n.goAway(0),t.dismiss()}}]})},dismiss:function(){localStorage.setItem("hideNotifierUntil",this.getTimestamp()+600)},shouldShowNotification:function(){if(null===this.version||!1===this.version.is_new)return!1;var t=localStorage.getItem("hideNotifierUntil")||null;return!(t&&t>this.getTimestamp())},getTimestamp:function(){return Date.now()/1e3|0}},computed:{hasNewVersion:function(){return this.version&&this.version.is_new}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.hasNewVersion?n("modal",{attrs:{open:t.open,size:"lg"},on:{closed:function(e){t.open=!1}},scopedSlots:t._u([{key:"header",fn:function(){return[n("span",{staticClass:"badge badge-success"},[t._v("New")]),t._v(" "+t._s(t.version.id)+"\n ")]},proxy:!0},{key:"content",fn:function(){return[n("div",{domProps:{innerHTML:t._s(t.version.changelog)}})]},proxy:!0},{key:"footer",fn:function(){return[n("a",{staticClass:"btn btn-primary",attrs:{href:t.version.link,target:"_blank"}},[n("i",{staticClass:"fas fa-external-link-square-alt mr-1"}),t._v(" "+t._s(t.__("View"))+"\n ")])]},proxy:!0}],null,!1,481153869)}):t._e()],1)}),[],!1,null,null,null);e.default=o.exports},uuIC:function(t,e,n){"use strict";n.r(e);var r={props:{open:{type:Boolean,required:!1,default:!1},id:{type:String,required:!1,default:"modal"},size:{type:String,required:!1,default:""}},methods:{createModal:function(){var t=this;this.$nextTick((function(){var e=$("#".concat(t.id));e.modal({keyboard:!1,show:!0}),e.on("hidden.bs.modal",(function(e){t.deleteModal()})),t.$emit("opened")}))},deleteModal:function(){$("#".concat(this.id)).modal("dispose"),$("div.modal-backdrop").remove(),$("body.modal-open").removeClass("modal-open"),this.$emit("closed")}},watch:{open:function(t){!0===t?this.createModal():this.deleteModal()}},computed:{hasHeader:function(){return this.$slots.hasOwnProperty("header")},hasFooter:function(){return this.$slots.hasOwnProperty("footer")}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.open?n("div",{staticClass:"modal fade",attrs:{id:t.id,role:"dialog"}},[n("div",{staticClass:"modal-dialog modal-dialog-centered",class:{"modal-lg":"lg"===t.size,"modal-xl":"xl"===t.size,"modal-sm":"sm"===t.size},attrs:{role:"document"}},[n("div",{staticClass:"modal-content",class:{"border-0":!t.hasHeader&&!t.hasFooter}},[t.hasHeader?n("div",{staticClass:"modal-header"},[n("h5",{staticClass:"modal-title"},[t._t("header")],2),t._v(" "),t._m(0)]):t._e(),t._v(" "),n("div",{staticClass:"modal-body",class:{"p-0":!t.hasHeader&&!t.hasFooter}},[t._t("content")],2),t._v(" "),t.hasFooter?n("div",{staticClass:"modal-footer"},[t._t("footer")],2):t._e()])])]):t._e()}),[function(){var t=this.$createElement,e=this._self._c||t;return e("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[e("i",{staticClass:"fas fa-times"})])}],!1,null,null,null);e.default=o.exports},wGJR:function(t,e,n){!function(t){"use strict";var e,n,r=function(t){return t instanceof HTMLElement},i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=Object.assign({},t),i=[],o=[],a=function(){return Object.assign({},r)},s=function(){var t=[].concat(i);return i.length=0,t},l=function(){var t=[].concat(o);o.length=0,t.forEach((function(t){var e=t.type,n=t.data;c(e,n)}))},c=function(t,e,n){n?o.push({type:t,data:e}):(p[t]&&p[t](e),i.push({type:t,data:e}))},u=function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return f[t]?(e=f)[t].apply(e,r):null},d={getState:a,processActionQueue:s,processDispatchQueue:l,dispatch:c,query:u},f={};e.forEach((function(t){f=Object.assign({},t(r),{},f)}));var p={};return n.forEach((function(t){p=Object.assign({},t(c,u,r),{},p)})),d},o=function(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])},a=function(t){var e={};return o(t,(function(n){!function(t,e,n){"function"!=typeof n?Object.defineProperty(t,e,Object.assign({},n)):t[e]=n}(e,n,t[n])})),e},s=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null===n)return t.getAttribute(e)||t.hasAttribute(e);t.setAttribute(e,n)},l="http://www.w3.org/2000/svg",c=["svg","path"],u=function(t){return c.includes(t)},d=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"==typeof e&&(n=e,e=null);var r=u(t)?document.createElementNS(l,t):document.createElement(t);return e&&(u(t)?s(r,"class",e):r.className=e),o(n,(function(t,e){s(r,t,e)})),r},f=function(t){return function(e,n){void 0!==n&&t.children[n]?t.insertBefore(e,t.children[n]):t.appendChild(e)}},p=function(t,e){return function(t,n){return void 0!==n?e.splice(n,0,t):e.push(t),t}},m=function(t,e){return function(n){return e.splice(e.indexOf(n),1),n.element.parentNode&&t.removeChild(n.element),n}},h=function(t,e,n,r){var i=n[0]||t.left,o=n[1]||t.top,a=i+t.width,s=o+t.height*(r[1]||1),l={element:Object.assign({},t),inner:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},outer:{left:i,top:o,right:a,bottom:s}};return e.filter((function(t){return!t.isRectIgnored()})).map((function(t){return t.rect})).forEach((function(t){_(l.inner,Object.assign({},t.inner)),_(l.outer,Object.assign({},t.outer))})),v(l.inner),l.outer.bottom+=l.element.marginBottom,l.outer.right+=l.element.marginRight,v(l.outer),l},_=function(t,e){e.top+=t.top,e.right+=t.left,e.bottom+=t.top,e.left+=t.left,e.bottom>t.bottom&&(t.bottom=e.bottom),e.right>t.right&&(t.right=e.right)},v=function(t){t.width=t.right-t.left,t.height=t.bottom-t.top},g=function(t){return"number"==typeof t},E=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001;return Math.abs(t-e)<r&&Math.abs(n)<r},y=function(t){return t<.5?2*t*t:(4-2*t)*t-1},b={spring:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.stiffness,n=void 0===e?.5:e,r=t.damping,i=void 0===r?.75:r,o=t.mass,s=void 0===o?10:o,l=null,c=null,u=0,d=!1,f=function(){if(!d){if(!g(l)||!g(c))return d=!0,void(u=0);E(c+=u+=-(c-l)*n/s,l,u*=i)?(c=l,u=0,d=!0,m.onupdate(c),m.oncomplete(c)):m.onupdate(c)}},p=function(t){if(g(t)&&!g(c)&&(c=t),null===l&&(l=t,c=t),c===(l=t)||void 0===l)return d=!0,u=0,m.onupdate(c),void m.oncomplete(c);d=!1},m=a({interpolate:f,target:{set:p,get:function(){return l}},resting:{get:function(){return d}},onupdate:function(t){},oncomplete:function(t){}});return m},tween:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.duration,i=void 0===r?500:r,o=n.easing,s=void 0===o?y:o,l=n.delay,c=void 0===l?0:l,u=null,d=!0,f=!1,p=null,m=function(n){d||null===p||(null===u&&(u=n),n-u<c||((t=n-u-c)<i?(e=t/i,h.onupdate((t>=0?s(f?1-e:e):0)*p)):(t=1,e=f?0:1,h.onupdate(e*p),h.oncomplete(e*p),d=!0)))},h=a({interpolate:m,target:{get:function(){return f?0:p},set:function(t){if(null===p)return p=t,h.onupdate(t),void h.oncomplete(t);t<p?(p=1,f=!0):(f=!1,p=t),d=!1,u=null}},resting:{get:function(){return d}},onupdate:function(t){},oncomplete:function(t){}});return h}},C=function(t,e,n){var r=t[e]&&"object"==typeof t[e][n]?t[e][n]:t[e]||t,i="string"==typeof r?r:r.type,o="object"==typeof r?Object.assign({},r):{};return b[i]?b[i](o):null},T=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(e=Array.isArray(e)?e:[e]).forEach((function(e){t.forEach((function(t){var i=t,o=function(){return n[t]},a=function(e){return n[t]=e};"object"==typeof t&&(i=t.key,o=t.getter||o,a=t.setter||a),e[i]&&!r||(e[i]={get:o,set:a})}))}))},I=function(t){return null!=t},w={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},S=function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!0;for(var n in e)if(e[n]!==t[n])return!0;return!1},O=function(t,e){var n=e.opacity,r=e.perspective,i=e.translateX,o=e.translateY,a=e.scaleX,s=e.scaleY,l=e.rotateX,c=e.rotateY,u=e.rotateZ,d=e.originX,f=e.originY,p=e.width,m=e.height,h="",_="";(I(d)||I(f))&&(_+="transform-origin: "+(d||0)+"px "+(f||0)+"px;"),I(r)&&(h+="perspective("+r+"px) "),(I(i)||I(o))&&(h+="translate3d("+(i||0)+"px, "+(o||0)+"px, 0) "),(I(a)||I(s))&&(h+="scale3d("+(I(a)?a:1)+", "+(I(s)?s:1)+", 1) "),I(u)&&(h+="rotateZ("+u+"rad) "),I(l)&&(h+="rotateX("+l+"rad) "),I(c)&&(h+="rotateY("+c+"rad) "),h.length&&(_+="transform:"+h+";"),I(n)&&(_+="opacity:"+n+";",0===n&&(_+="visibility:hidden;"),n<1&&(_+="pointer-events:none;")),I(m)&&(_+="height:"+m+"px;"),I(p)&&(_+="width:"+p+"px;");var v=t.elementCurrentStyle||"";_.length===v.length&&_===v||(t.style.cssText=_,t.elementCurrentStyle=_)},D={styles:function(t){var e=t.mixinConfig,n=t.viewProps,r=t.viewInternalAPI,i=t.viewExternalAPI,o=t.view,a=Object.assign({},n),s={};T(e,[r,i],n);var l=function(){return o.rect?h(o.rect,o.childViews,[n.translateX||0,n.translateY||0],[n.scaleX||0,n.scaleY||0]):null};return r.rect={get:l},i.rect={get:l},e.forEach((function(t){n[t]=void 0===a[t]?w[t]:a[t]})),{write:function(){if(S(s,n))return O(o.element,n),Object.assign(s,Object.assign({},n)),!0},destroy:function(){}}},listeners:function(t){t.mixinConfig,t.viewProps,t.viewInternalAPI;var e,n=t.viewExternalAPI,r=(t.viewState,t.view),i=[],o=(e=r.element,function(t,n){e.addEventListener(t,n)}),a=function(t){return function(e,n){t.removeEventListener(e,n)}}(r.element);return n.on=function(t,e){i.push({type:t,fn:e}),o(t,e)},n.off=function(t,e){i.splice(i.findIndex((function(n){return n.type===t&&n.fn===e})),1),a(t,e)},{write:function(){return!0},destroy:function(){i.forEach((function(t){a(t.type,t.fn)}))}}},animations:function(t){var e=t.mixinConfig,n=t.viewProps,r=t.viewInternalAPI,i=t.viewExternalAPI,a=(t.viewState,Object.assign({},n)),s=[];return o(e,(function(t,e){var o=C(e);o&&(o.onupdate=function(e){n[t]=e},o.target=a[t],T([{key:t,setter:function(t){o.target!==t&&(o.target=t)},getter:function(){return n[t]}}],[r,i],n,!0),s.push(o))})),{write:function(t){var e=!0;return s.forEach((function(n){n.resting||(e=!1),n.interpolate(t)})),e},destroy:function(){}}},apis:function(t){var e=t.mixinConfig,n=t.viewProps,r=t.viewExternalAPI;T(e,r,n)}},R=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.layoutCalculated||(t.paddingTop=parseInt(n.paddingTop,10)||0,t.marginTop=parseInt(n.marginTop,10)||0,t.marginRight=parseInt(n.marginRight,10)||0,t.marginBottom=parseInt(n.marginBottom,10)||0,t.marginLeft=parseInt(n.marginLeft,10)||0,e.layoutCalculated=!0),t.left=e.offsetLeft||0,t.top=e.offsetTop||0,t.width=e.offsetWidth||0,t.height=e.offsetHeight||0,t.right=t.left+t.width,t.bottom=t.top+t.height,t.scrollTop=e.scrollTop,t.hidden=null===e.offsetParent,t},N=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.tag,n=void 0===e?"div":e,r=t.name,i=void 0===r?null:r,o=t.attributes,s=void 0===o?{}:o,l=t.read,c=void 0===l?function(){}:l,u=t.write,_=void 0===u?function(){}:u,v=t.create,g=void 0===v?function(){}:v,E=t.destroy,y=void 0===E?function(){}:E,b=t.filterFrameActionsForChild,C=void 0===b?function(t,e){return e}:b,T=t.didCreateView,I=void 0===T?function(){}:T,w=t.didWriteView,S=void 0===w?function(){}:w,O=t.ignoreRect,N=void 0!==O&&O,A=t.ignoreRectUpdate,P=void 0!==A&&A,k=t.mixins,L=void 0===k?[]:k;return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=d(n,"filepond--"+i,s),o=window.getComputedStyle(r,null),l=R(),u=null,v=!1,E=[],b=[],T={},w={},O=[_],A=[c],k=[y],x=function(){return r},M=function(){return E.concat()},F=function(){return T},B=function(t){return function(e,n){return e(t,n)}},G=function(){return u||(u=h(l,E,[0,0],[1,1]))},U=function(){return o},q=function(){u=null,E.forEach((function(t){return t._read()})),!(P&&l.width&&l.height)&&R(l,r,o);var t={root:W,props:e,rect:l};A.forEach((function(e){return e(t)}))},H=function(t,n,r){var i=0===n.length;return O.forEach((function(o){!1===o({props:e,root:W,actions:n,timestamp:t,shouldOptimize:r})&&(i=!1)})),b.forEach((function(e){!1===e.write(t)&&(i=!1)})),E.filter((function(t){return!!t.element.parentNode})).forEach((function(e){e._write(t,C(e,n),r)||(i=!1)})),E.forEach((function(e,o){e.element.parentNode||(W.appendChild(e.element,o),e._read(),e._write(t,C(e,n),r),i=!1)})),v=i,S({props:e,root:W,actions:n,timestamp:t}),i},$=function(){b.forEach((function(t){return t.destroy()})),k.forEach((function(t){t({root:W,props:e})})),E.forEach((function(t){return t._destroy()}))},V={element:{get:x},style:{get:U},childViews:{get:M}},j=Object.assign({},V,{rect:{get:G},ref:{get:F},is:function(t){return i===t},appendChild:f(r),createChildView:B(t),linkView:function(t){return E.push(t),t},unlinkView:function(t){E.splice(E.indexOf(t),1)},appendChildView:p(0,E),removeChildView:m(r,E),registerWriter:function(t){return O.push(t)},registerReader:function(t){return A.push(t)},registerDestroyer:function(t){return k.push(t)},invalidateLayout:function(){return r.layoutCalculated=!1},dispatch:t.dispatch,query:t.query}),z={element:{get:x},childViews:{get:M},rect:{get:G},resting:{get:function(){return v}},isRectIgnored:function(){return N},_read:q,_write:H,_destroy:$},Y=Object.assign({},V,{rect:{get:function(){return l}}});Object.keys(L).sort((function(t,e){return"styles"===t?1:"styles"===e?-1:0})).forEach((function(t){var n=D[t]({mixinConfig:L[t],viewProps:e,viewState:w,viewInternalAPI:j,viewExternalAPI:z,view:a(Y)});n&&b.push(n)}));var W=a(j);g({root:W,props:e});var X=r.children.length;return E.forEach((function(t,e){W.appendChild(t.element,X+e)})),I(W),a(z)}},A=function(t,e){return function(n){var r=n.root,i=n.props,o=n.actions,a=void 0===o?[]:o,s=n.timestamp,l=n.shouldOptimize;a.filter((function(e){return t[e.type]})).forEach((function(e){return t[e.type]({root:r,props:i,action:e.data,timestamp:s,shouldOptimize:l})})),e&&e({root:r,props:i,actions:a,timestamp:s,shouldOptimize:l})}},P=function(t,e){return e.parentNode.insertBefore(t,e)},k=function(t,e){return e.parentNode.insertBefore(t,e.nextSibling)},L=function(t){return Array.isArray(t)},x=function(t){return null==t},M=function(t){return t.trim()},F=function(t){return""+t},B=function(t){return"boolean"==typeof t},G=function(t){return B(t)?t:"true"===t},U=function(t){return"string"==typeof t},q=function(t){return g(t)?t:U(t)?F(t).replace(/[a-z]+/gi,""):0},H=function(t){return parseInt(q(t),10)},$=function(t){return parseFloat(q(t))},V=function(t){return g(t)&&isFinite(t)&&Math.floor(t)===t},j=function(t){if(V(t))return t;var e=F(t).trim();return/MB$/i.test(e)?(e=e.replace(/MB$i/,"").trim(),1e3*H(e)*1e3):/KB/i.test(e)?(e=e.replace(/KB$i/,"").trim(),1e3*H(e)):H(e)},z=function(t){return"function"==typeof t},Y={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},W=function(t,e,n,r,i){if(null===e)return null;if("function"==typeof e)return e;var o={url:"GET"===n||"PATCH"===n?"?"+t+"=":"",method:n,headers:i,withCredentials:!1,timeout:r,onload:null,ondata:null,onerror:null};if(U(e))return o.url=e,o;if(Object.assign(o,e),U(o.headers)){var a=o.headers.split(/:(.+)/);o.headers={header:a[0],value:a[1]}}return o.withCredentials=G(o.withCredentials),o},X=function(t){return"object"==typeof t&&null!==t},K=function(t){return L(t)?"array":function(t){return null===t}(t)?"null":V(t)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(t)?"bytes":function(t){return X(t)&&U(t.url)&&X(t.process)&&X(t.revert)&&X(t.restore)&&X(t.fetch)}(t)?"api":typeof t},Q={array:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return x(t)?[]:L(t)?t:F(t).split(e).map(M).filter((function(t){return t.length}))},boolean:G,int:function(t){return"bytes"===K(t)?j(t):H(t)},number:$,float:$,bytes:j,string:function(t){return z(t)?t:F(t)},function:function(t){return function(t){for(var e=self,n=t.split("."),r=null;r=n.shift();)if(!(e=e[r]))return null;return e}(t)},serverapi:function(t){return(n={}).url=U(e=t)?e:e.url||"",n.timeout=e.timeout?parseInt(e.timeout,10):0,n.headers=e.headers?e.headers:{},o(Y,(function(t){n[t]=W(t,e[t],Y[t],n.timeout,n.headers)})),n.remove=e.remove||null,delete n.headers,n;var e,n},object:function(t){try{return JSON.parse(t.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'))}catch(t){return null}}},Z=function(t,e,n){if(t===e)return t;var r,i=K(t);if(i!==n){var o=(r=t,Q[n](r));if(i=K(o),null===o)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"';t=o}return t},J=function(t){var e={};return o(t,(function(n){var r,i,o,a=t[n];e[n]=(r=a[0],i=a[1],o=r,{enumerable:!0,get:function(){return o},set:function(t){o=Z(t,r,i)}})})),a(e)},tt=function(t){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:J(t)}},et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return t.split(/(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join(e)},nt=function(t,e){var n={};return o(e,(function(e){n[e]={get:function(){return t.getState().options[e]},set:function(n){t.dispatch("SET_"+et(e,"_").toUpperCase(),{value:n})}}})),n},rt=function(t){return function(e,n,r){var i={};return o(t,(function(t){var n=et(t,"_").toUpperCase();i["SET_"+n]=function(i){try{r.options[t]=i.value}catch(t){}e("DID_SET_"+n,{value:r.options[t]})}})),i}},it=function(t){return function(e){var n={};return o(t,(function(t){n["GET_"+et(t,"_").toUpperCase()]=function(n){return e.options[t]}})),n}},ot=1,at=2,st=3,lt=4,ct=5,ut=function(){return Math.random().toString(36).substr(2,9)},dt=function(t,e){return t.splice(e,1)},ft=function(){var t=[],e=function(e,n){dt(t,t.findIndex((function(t){return t.event===e&&(t.cb===n||!n)})))};return{fire:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.filter((function(t){return t.event===e})).map((function(t){return t.cb})).forEach((function(t){setTimeout((function(){t.apply(void 0,r)}),0)}))},on:function(e,n){t.push({event:e,cb:n})},onOnce:function(n,r){t.push({event:n,cb:function(){e(n,r),r.apply(void 0,arguments)}})},off:e}},pt=function(t,e,n){Object.getOwnPropertyNames(t).filter((function(t){return!n.includes(t)})).forEach((function(n){return Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))},mt=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],ht=function(t){var e={};return pt(t,e,mt),e},_t=function(t){t.forEach((function(e,n){e.released&&dt(t,n)}))},vt={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},gt={INPUT:1,LIMBO:2,LOCAL:3},Et=function(t){return/[^0-9]+/.exec(t)},yt=function(){return Et(1.1.toLocaleString())[0]},bt={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},Ct=[],Tt=function(t,e,n){return new Promise((function(r,i){var o=Ct.filter((function(e){return e.key===t})).map((function(t){return t.cb}));if(0!==o.length){var a=o.shift();o.reduce((function(t,e){return t.then((function(t){return e(t,n)}))}),a(e,n)).then((function(t){return r(t)})).catch((function(t){return i(t)}))}else r(e)}))},It=function(t,e,n){return Ct.filter((function(e){return e.key===t})).map((function(t){return t.cb(e,n)}))},wt=function(t,e){return Ct.push({key:t,cb:e})},St=function(){return Object.assign({},Ot)},Ot={id:[null,bt.STRING],name:["filepond",bt.STRING],disabled:[!1,bt.BOOLEAN],className:[null,bt.STRING],required:[!1,bt.BOOLEAN],captureMethod:[null,bt.STRING],allowDrop:[!0,bt.BOOLEAN],allowBrowse:[!0,bt.BOOLEAN],allowPaste:[!0,bt.BOOLEAN],allowMultiple:[!1,bt.BOOLEAN],allowReplace:[!0,bt.BOOLEAN],allowRevert:[!0,bt.BOOLEAN],forceRevert:[!1,bt.BOOLEAN],maxFiles:[null,bt.INT],checkValidity:[!1,bt.BOOLEAN],itemInsertLocationFreedom:[!0,bt.BOOLEAN],itemInsertLocation:["before",bt.STRING],itemInsertInterval:[75,bt.INT],dropOnPage:[!1,bt.BOOLEAN],dropOnElement:[!0,bt.BOOLEAN],dropValidation:[!1,bt.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],bt.ARRAY],instantUpload:[!0,bt.BOOLEAN],maxParallelUploads:[2,bt.INT],chunkUploads:[!1,bt.BOOLEAN],chunkForce:[!1,bt.BOOLEAN],chunkSize:[5e6,bt.INT],chunkRetryDelays:[[500,1e3,3e3],bt.Array],server:[null,bt.SERVER_API],labelDecimalSeparator:[yt(),bt.STRING],labelThousandsSeparator:[(e=yt(),n=1e3.toLocaleString(),n!==1e3.toString()?Et(n)[0]:"."===e?",":"."),bt.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',bt.STRING],labelInvalidField:["Field contains invalid files",bt.STRING],labelFileWaitingForSize:["Waiting for size",bt.STRING],labelFileSizeNotAvailable:["Size not available",bt.STRING],labelFileCountSingular:["file in list",bt.STRING],labelFileCountPlural:["files in list",bt.STRING],labelFileLoading:["Loading",bt.STRING],labelFileAdded:["Added",bt.STRING],labelFileLoadError:["Error during load",bt.STRING],labelFileRemoved:["Removed",bt.STRING],labelFileRemoveError:["Error during remove",bt.STRING],labelFileProcessing:["Uploading",bt.STRING],labelFileProcessingComplete:["Upload complete",bt.STRING],labelFileProcessingAborted:["Upload cancelled",bt.STRING],labelFileProcessingError:["Error during upload",bt.STRING],labelFileProcessingRevertError:["Error during revert",bt.STRING],labelTapToCancel:["tap to cancel",bt.STRING],labelTapToRetry:["tap to retry",bt.STRING],labelTapToUndo:["tap to undo",bt.STRING],labelButtonRemoveItem:["Remove",bt.STRING],labelButtonAbortItemLoad:["Abort",bt.STRING],labelButtonRetryItemLoad:["Retry",bt.STRING],labelButtonAbortItemProcessing:["Cancel",bt.STRING],labelButtonUndoItemProcessing:["Undo",bt.STRING],labelButtonRetryItemProcessing:["Retry",bt.STRING],labelButtonProcessItem:["Upload",bt.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',bt.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',bt.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',bt.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',bt.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',bt.STRING],oninit:[null,bt.FUNCTION],onwarning:[null,bt.FUNCTION],onerror:[null,bt.FUNCTION],onactivatefile:[null,bt.FUNCTION],onaddfilestart:[null,bt.FUNCTION],onaddfileprogress:[null,bt.FUNCTION],onaddfile:[null,bt.FUNCTION],onprocessfilestart:[null,bt.FUNCTION],onprocessfileprogress:[null,bt.FUNCTION],onprocessfileabort:[null,bt.FUNCTION],onprocessfilerevert:[null,bt.FUNCTION],onprocessfile:[null,bt.FUNCTION],onprocessfiles:[null,bt.FUNCTION],onremovefile:[null,bt.FUNCTION],onpreparefile:[null,bt.FUNCTION],onupdatefiles:[null,bt.FUNCTION],beforeDropFile:[null,bt.FUNCTION],beforeAddFile:[null,bt.FUNCTION],beforeRemoveFile:[null,bt.FUNCTION],stylePanelLayout:[null,bt.STRING],stylePanelAspectRatio:[null,bt.STRING],styleItemPanelAspectRatio:[null,bt.STRING],styleButtonRemoveItemPosition:["left",bt.STRING],styleButtonProcessItemPosition:["right",bt.STRING],styleLoadIndicatorPosition:["right",bt.STRING],styleProgressIndicatorPosition:["right",bt.STRING],files:[[],bt.ARRAY]},Dt=function(t,e){return x(e)?t[0]||null:V(e)?t[e]||null:("object"==typeof e&&(e=e.id),t.find((function(t){return t.id===e}))||null)},Rt=function(t){if(x(t))return t;if(/:/.test(t)){var e=t.split(":");return e[1]/e[0]}return parseFloat(t)},Nt=function(t){return t.filter((function(t){return!t.archived}))},At={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},Pt=[vt.LOAD_ERROR,vt.PROCESSING_ERROR,vt.PROCESSING_REVERT_ERROR],kt=[vt.LOADING,vt.PROCESSING,vt.PROCESSING_QUEUED,vt.INIT],Lt=[vt.PROCESSING_COMPLETE],xt=function(t){return Pt.includes(t.status)},Mt=function(t){return kt.includes(t.status)},Ft=function(t){return Lt.includes(t.status)},Bt=function(t){return{GET_STATUS:function(){var e=Nt(t.items),n=At.EMPTY,r=At.ERROR,i=At.BUSY,o=At.IDLE,a=At.READY;return 0===e.length?n:e.some(xt)?r:e.some(Mt)?i:e.some(Ft)?a:o},GET_ITEM:function(e){return Dt(t.items,e)},GET_ACTIVE_ITEM:function(e){return Dt(Nt(t.items),e)},GET_ACTIVE_ITEMS:function(){return Nt(t.items)},GET_ITEMS:function(){return t.items},GET_ITEM_NAME:function(e){var n=Dt(t.items,e);return n?n.filename:null},GET_ITEM_SIZE:function(e){var n=Dt(t.items,e);return n?n.fileSize:null},GET_STYLES:function(){return Object.keys(t.options).filter((function(t){return/^style/.test(t)})).map((function(e){return{name:e,value:t.options[e]}}))},GET_PANEL_ASPECT_RATIO:function(){return/circle/.test(t.options.stylePanelLayout)?1:Rt(t.options.stylePanelAspectRatio)},GET_ITEM_PANEL_ASPECT_RATIO:function(){return t.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function(e){return Nt(t.items).filter((function(t){return t.status===e}))},GET_TOTAL_ITEMS:function(){return Nt(t.items).length},IS_ASYNC:function(){return X(t.options.server)&&(X(t.options.server.process)||z(t.options.server.process))}}},Gt=function(t,e,n){return x(e)?null:void 0===n?(t.push(e),e):(r=n,i=0,o=t.length,function(t,e,n){t.splice(e,0,n)}(t,n=Math.max(Math.min(o,r),i),e),e);var r,i,o},Ut=function(t){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(t)},qt=function(t){return t.split("/").pop().split("?").shift()},Ht=function(t){return t.split(".").pop()},$t=function(t){if("string"!=typeof t)return"";var e=t.split("/").pop();return/svg/.test(e)?"svg":/zip|compressed/.test(e)?"zip":/plain/.test(e)?"txt":/msword/.test(e)?"doc":/[a-z]+/.test(e)?"jpeg"===e?"jpg":e:""},Vt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(e+t).slice(-e.length)},jt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return t.getFullYear()+"-"+Vt(t.getMonth()+1,"00")+"-"+Vt(t.getDate(),"00")+"_"+Vt(t.getHours(),"00")+"-"+Vt(t.getMinutes(),"00")+"-"+Vt(t.getSeconds(),"00")},zt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i="string"==typeof n?t.slice(0,t.size,n):t.slice(0,t.size,t.type);return i.lastModifiedDate=new Date,U(e)||(e=jt()),e&&null===r&&Ht(e)?i.name=e:(r=r||$t(i.type),i.name=e+(r?"."+r:"")),i},Yt=function(t,e){var n=window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(n){var r=new n;return r.append(t),r.getBlob(e)}return new Blob([t],{type:e})},Wt=function(t){return(/^data:(.+);/.exec(t)||[])[1]||null},Xt=function(t){var e=Wt(t);return function(t,e){for(var n=new ArrayBuffer(t.length),r=new Uint8Array(n),i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return Yt(n,e)}(function(t){return atob(function(t){return t.split(",")[1].replace(/\s/g,"")}(t))}(t),e)},Kt=function(t){if(!/^content-disposition:/i.test(t))return null;var e=t.split(/filename=|filename\*=.+''/).splice(1).map((function(t){return t.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(t){return t.length}));return e.length?decodeURI(e[e.length-1]):null},Qt=function(t){if(/content-length:/i.test(t)){var e=t.match(/[0-9]+/)[0];return e?parseInt(e,10):null}return null},Zt=function(t){return/x-content-transfer-id:/i.test(t)&&(t.split(":")[1]||"").trim()||null},Jt=function(t){var e={source:null,name:null,size:null},n=t.split("\n"),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,c=Kt(l);if(c)e.name=c;else{var u=Qt(l);if(u)e.size=u;else{var d=Zt(l);d&&(e.source=d)}}}}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return e},te=function(t){var e={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},n=function(n){t?(e.timestamp=Date.now(),e.request=t(n,(function(t){e.duration=Date.now()-e.timestamp,e.complete=!0,t instanceof Blob&&(t=zt(t,t.name||qt(n))),r.fire("load",t instanceof Blob?t:t.body)}),(function(t){r.fire("error","string"==typeof t?{type:"error",code:0,body:t}:t)}),(function(t,n,i){i&&(e.size=i),e.duration=Date.now()-e.timestamp,t?(e.progress=n/i,r.fire("progress",e.progress)):e.progress=null}),(function(){r.fire("abort")}),(function(t){var n=Jt("string"==typeof t?t:t.headers);r.fire("meta",{size:e.size||n.size,filename:n.name,source:n.source})}))):r.fire("error",{type:"error",body:"Can't load URL",code:400})},r=Object.assign({},ft(),{setSource:function(t){return e.source=t},getProgress:function(){return e.progress},abort:function(){e.request&&e.request.abort&&e.request.abort()},load:function(){var t,i,o=e.source;r.fire("init",o),o instanceof File?r.fire("load",o):o instanceof Blob?r.fire("load",zt(o,o.name)):Ut(o)?r.fire("load",zt(Xt(o),t,null,i)):n(o)}});return r},ee=function(t){return/GET|HEAD/.test(t)},ne=function(t,e,n){var r={onheaders:function(){},onprogress:function(){},onload:function(){},ontimeout:function(){},onerror:function(){},onabort:function(){},abort:function(){i=!0,a.abort()}},i=!1,o=!1;n=Object.assign({method:"POST",headers:{},withCredentials:!1},n),e=encodeURI(e),ee(n.method)&&t&&(e=""+e+encodeURIComponent("string"==typeof t?t:JSON.stringify(t)));var a=new XMLHttpRequest;return(ee(n.method)?a:a.upload).onprogress=function(t){i||r.onprogress(t.lengthComputable,t.loaded,t.total)},a.onreadystatechange=function(){a.readyState<2||4===a.readyState&&0===a.status||o||(o=!0,r.onheaders(a))},a.onload=function(){a.status>=200&&a.status<300?r.onload(a):r.onerror(a)},a.onerror=function(){return r.onerror(a)},a.onabort=function(){i=!0,r.onabort()},a.ontimeout=function(){return r.ontimeout(a)},a.open(n.method,e,!0),V(n.timeout)&&(a.timeout=n.timeout),Object.keys(n.headers).forEach((function(t){var e=unescape(encodeURIComponent(n.headers[t]));a.setRequestHeader(t,e)})),n.responseType&&(a.responseType=n.responseType),n.withCredentials&&(a.withCredentials=!0),a.send(t),r},re=function(t,e,n,r){return{type:t,code:e,body:n,headers:r}},ie=function(t){return function(e){t(re("error",0,"Timeout",e.getAllResponseHeaders()))}},oe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if("function"==typeof e)return e;if(!e||!U(e.url))return null;var n=e.onload||function(t){return t},r=e.onerror||function(t){return null};return function(i,o,a,s,l,c){var u=ne(i,t+e.url,Object.assign({},e,{responseType:"blob"}));return u.onload=function(t){var e=t.getAllResponseHeaders(),r=Jt(e).name||qt(i);o(re("load",t.status,zt(n(t.response),r),e))},u.onerror=function(t){a(re("error",t.status,r(t.response)||t.statusText,t.getAllResponseHeaders()))},u.onheaders=function(t){c(re("headers",t.status,null,t.getAllResponseHeaders()))},u.ontimeout=ie(a),u.onprogress=s,u.onabort=l,u}};function ae(t){this.wrapped=t}function se(t){var e,n;function r(e,n){try{var o=t[e](n),a=o.value,s=a instanceof ae;Promise.resolve(s?a.wrapped:a).then((function(t){s?r("next",t):i(o.done?"return":"normal",t)}),(function(t){r("throw",t)}))}catch(t){i("throw",t)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,i){return new Promise((function(o,a){var s={key:t,arg:i,resolve:o,reject:a,next:null};n?n=n.next=s:(e=n=s,r(t,i))}))},"function"!=typeof t.return&&(this.return=void 0)}function le(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)||ce(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function ce(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}"function"==typeof Symbol&&Symbol.asyncIterator&&(se.prototype[Symbol.asyncIterator]=function(){return this}),se.prototype.next=function(t){return this._invoke("next",t)},se.prototype.throw=function(t){return this._invoke("throw",t)},se.prototype.return=function(t){return this._invoke("return",t)};var ue=0,de=1,fe=2,pe=3,me=4,he=function(t,e,n,r,i,o,a,s,l,c,u){for(var d=[],f=u.chunkTransferId,p=u.chunkServer,m=u.chunkSize,h=u.chunkRetryDelays,_={serverId:f,aborted:!1},v=e.ondata||function(t){return t},g=e.onload||function(t,e){return"HEAD"===e?t.getResponseHeader("Upload-Offset"):t.response},E=e.onerror||function(t){return null},y=Math.floor(r.size/m),b=0;b<=y;b++){var C=b*m,T=r.slice(C,C+m,"application/offset+octet-stream");d[b]={index:b,size:T.size,offset:C,data:T,file:r,progress:0,retries:le(h),status:ue,error:null,request:null,timeout:null}}var I,w,S,O,D=function(t){return t.status===ue||t.status===pe},R=function(e){if(!_.aborted)if(e=e||d.find(D)){e.status=fe,e.progress=null;var n=p.ondata||function(t){return t},i=p.onerror||function(t){return null},s=t+p.url+_.serverId,c="function"==typeof p.headers?p.headers(e):Object.assign({},p.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":e.offset,"Upload-Length":r.size,"Upload-Name":r.name}),u=e.request=ne(n(e.data),s,Object.assign({},p,{headers:c}));u.onload=function(){e.status=de,e.request=null,P()},u.onprogress=function(t,n,r){e.progress=t?n:null,A()},u.onerror=function(t){e.status=pe,e.request=null,e.error=i(t.response)||t.statusText,N(e)||a(re("error",t.status,i(t.response)||t.statusText,t.getAllResponseHeaders()))},u.ontimeout=function(t){e.status=pe,e.request=null,N(e)||ie(a)(t)},u.onabort=function(){e.status=ue,e.request=null,l()}}else d.every((function(t){return t.status===de}))&&o(_.serverId)},N=function(t){return 0!==t.retries.length&&(t.status=me,clearTimeout(t.timeout),t.timeout=setTimeout((function(){R(t)}),t.retries.shift()),!0)},A=function(){var t=d.reduce((function(t,e){return null===t||null===e.progress?null:t+e.progress}),0);if(null===t)return s(!1,0,0);var e=d.reduce((function(t,e){return t+e.size}),0);s(!0,t,e)},P=function(){d.filter((function(t){return t.status===fe})).length>=1||R()};return _.serverId?(I=function(t){_.aborted||(d.filter((function(e){return e.offset<t})).forEach((function(t){t.status=de,t.progress=t.size})),P())},w=t+p.url+_.serverId,S={headers:"function"==typeof e.headers?e.headers(_.serverId):Object.assign({},e.headers),method:"HEAD"},(O=ne(null,w,S)).onload=function(t){return I(g(t,S.method))},O.onerror=function(t){return a(re("error",t.status,E(t.response)||t.statusText,t.getAllResponseHeaders()))},O.ontimeout=ie(a)):function(o){var s=new FormData;X(i)&&s.append(n,JSON.stringify(i));var l="function"==typeof e.headers?e.headers(r,i):Object.assign({},e.headers,{"Upload-Length":r.size}),c=Object.assign({},e,{headers:l}),u=ne(v(s),t+e.url,c);u.onload=function(t){return o(g(t,c.method))},u.onerror=function(t){return a(re("error",t.status,E(t.response)||t.statusText,t.getAllResponseHeaders()))},u.ontimeout=ie(a)}((function(t){_.aborted||(c(t),_.serverId=t,P())})),{abort:function(){_.aborted=!0,d.forEach((function(t){clearTimeout(t.timeout),t.request&&t.request.abort()}))}}},_e=function(t,e,n,r){return function(i,o,a,s,l,c,u){if(i){var d=r.chunkUploads,f=d&&i.size>r.chunkSize,p=d&&(f||r.chunkForce);if(i instanceof Blob&&p)return he(t,e,n,i,o,a,s,l,c,u,r);var m=e.ondata||function(t){return t},h=e.onload||function(t){return t},_=e.onerror||function(t){return null},v=new FormData;X(o)&&v.append(n,JSON.stringify(o)),(i instanceof Blob?[{name:null,file:i}]:i).forEach((function(t){v.append(n,t.file,null===t.name?t.file.name:""+t.name+t.file.name)}));var g=ne(m(v),t+e.url,e);return g.onload=function(t){a(re("load",t.status,h(t.response),t.getAllResponseHeaders()))},g.onerror=function(t){s(re("error",t.status,_(t.response)||t.statusText,t.getAllResponseHeaders()))},g.ontimeout=ie(s),g.onprogress=l,g.onabort=c,g}}},ve=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if("function"==typeof e)return e;if(!e||!U(e.url))return function(t,e){return e()};var n=e.onload||function(t){return t},r=e.onerror||function(t){return null};return function(i,o,a){var s=ne(i,t+e.url,e);return s.onload=function(t){o(re("load",t.status,n(t.response),t.getAllResponseHeaders()))},s.onerror=function(t){a(re("error",t.status,r(t.response)||t.statusText,t.getAllResponseHeaders()))},s.ontimeout=ie(a),s}},ge=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t+Math.random()*(e-t)},Ee=function(t){var e={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},n=function(){e.request&&(e.perceivedPerformanceUpdater.clear(),e.request.abort(),e.complete=!0)},r=Object.assign({},ft(),{process:function(n,i){var o=function(){0!==e.duration&&null!==e.progress&&r.fire("progress",r.getProgress())},a=function(){e.complete=!0,r.fire("load-perceived",e.response.body)};r.fire("start"),e.timestamp=Date.now(),e.perceivedPerformanceUpdater=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]?arguments[3]:25),r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,i=null,o=Date.now(),a=function a(){var s=Date.now()-o,l=ge(n,r);s+l>e&&(l=s+l-e);var c=s/e;c>=1?t(1):(t(c),i=setTimeout(a,l))};return a(),{clear:function(){clearTimeout(i)}}}((function(t){e.perceivedProgress=t,e.perceivedDuration=Date.now()-e.timestamp,o(),e.response&&1===e.perceivedProgress&&!e.complete&&a()}),ge(750,1500)),e.request=t(n,i,(function(t){e.response=X(t)?t:{type:"load",code:200,body:""+t,headers:{}},e.duration=Date.now()-e.timestamp,e.progress=1,r.fire("load",e.response.body),1===e.perceivedProgress&&a()}),(function(t){e.perceivedPerformanceUpdater.clear(),r.fire("error",X(t)?t:{type:"error",code:0,body:""+t})}),(function(t,n,r){e.duration=Date.now()-e.timestamp,e.progress=t?n/r:null,o()}),(function(){e.perceivedPerformanceUpdater.clear(),r.fire("abort",e.response?e.response.body:null)}),(function(t){r.fire("transfer",t)}))},abort:n,getProgress:function(){return e.progress?Math.min(e.progress,e.perceivedProgress):null},getDuration:function(){return Math.min(e.duration,e.perceivedDuration)},reset:function(){n(),e.complete=!1,e.perceivedProgress=0,e.progress=0,e.timestamp=null,e.perceivedDuration=0,e.duration=0,e.request=null,e.response=null}});return r},ye=function(t){return t.substr(0,t.lastIndexOf("."))||t},be=function(t){var e=[t.name,t.size,t.type];return t instanceof Blob||Ut(t)?e[0]=t.name||jt():Ut(t)?(e[1]=t.length,e[2]=Wt(t)):U(t)&&(e[0]=qt(t),e[1]=0,e[2]="application/octet-stream"),{name:e[0],size:e[1],type:e[2]}},Ce=function(t){return!!(t instanceof File||t instanceof Blob&&t.name)},Te=function t(e){if(!X(e))return e;var n=L(e)?[]:{};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];n[r]=i&&X(i)?t(i):i}return n},Ie=function(t,e){var n=function(t,e){return x(e)?0:U(e)?t.findIndex((function(t){return t.id===e})):-1}(t,e);if(!(n<0))return t[n]||null},we=function(t,e,n,r,i,o){var a=ne(null,t,{method:"GET",responseType:"blob"});return a.onload=function(n){var r=n.getAllResponseHeaders(),i=Jt(r).name||qt(t);e(re("load",n.status,zt(n.response,i),r))},a.onerror=function(t){n(re("error",t.status,t.statusText,t.getAllResponseHeaders()))},a.onheaders=function(t){o(re("headers",t.status,null,t.getAllResponseHeaders()))},a.ontimeout=ie(n),a.onprogress=r,a.onabort=i,a},Se=function(t){return 0===t.indexOf("//")&&(t=location.protocol+t),t.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]},Oe=function(t){return function(){return z(t)?t.apply(void 0,arguments):t}},De=function(t,e){clearTimeout(e.listUpdateTimeout),e.listUpdateTimeout=setTimeout((function(){t("DID_UPDATE_ITEMS",{items:Nt(e.items)})}),0)},Re=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new Promise((function(e){if(!t)return e(!0);var r=t.apply(void 0,n);return null==r?e(!0):"boolean"==typeof r?e(r):void("function"==typeof r.then&&r.then(e))}))},Ne=function(t,e){t.items.sort((function(t,n){return e(ht(t),ht(n))}))},Ae=function(t,e){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.query,i=n.success,o=void 0===i?function(){}:i,a=n.failure,s=void 0===a?function(){}:a,l=Dt(t.items,r);l?e(l,o,s):s({error:re("error",0,"Item not found"),file:null})}},Pe=function(t,e,n){return{ABORT_ALL:function(){Nt(n.items).forEach((function(t){t.freeze(),t.abortLoad(),t.abortProcessing()}))},DID_SET_FILES:function(e){var r=e.value,i=(void 0===r?[]:r).map((function(t){return{source:t.source?t.source:t,options:t.options}})),o=Nt(n.items);o.forEach((function(e){i.find((function(t){return t.source===e.source||t.source===e.file}))||t("REMOVE_ITEM",{query:e})})),o=Nt(n.items),i.forEach((function(e,n){o.find((function(t){return t.source===e.source||t.file===e.source}))||t("ADD_ITEM",Object.assign({},e,{interactionMethod:ct,index:n}))}))},DID_UPDATE_ITEM_METADATA:function(r){var i=r.id;clearTimeout(n.itemUpdateTimeout),n.itemUpdateTimeout=setTimeout((function(){var r=Ie(n.items,i);if(e("IS_ASYNC")){var o,a=function(){setTimeout((function(){t("REQUEST_ITEM_PROCESSING",{query:i})}),32)};return r.status===vt.PROCESSING_COMPLETE?(o=n.options.instantUpload,void r.revert(ve(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(o?a:function(){}).catch((function(){}))):r.status===vt.PROCESSING?function(t){r.abortProcessing().then(t?a:function(){})}(n.options.instantUpload):void(n.options.instantUpload&&a())}Tt("SHOULD_PREPARE_OUTPUT",!1,{item:r,query:e}).then((function(e){e&&t("REQUEST_PREPARE_OUTPUT",{query:i,item:r,ready:function(e){t("DID_PREPARE_OUTPUT",{id:i,file:e})}},!0)}))}),0)},SORT:function(t){var e=t.compare;Ne(n,e)},ADD_ITEMS:function(n){var r=n.items,i=n.index,o=n.interactionMethod,a=n.success,s=void 0===a?function(){}:a,l=n.failure,c=void 0===l?function(){}:l,u=i;if(-1===i||void 0===i){var d=e("GET_ITEM_INSERT_LOCATION"),f=e("GET_TOTAL_ITEMS");u="before"===d?0:f}var p=e("GET_IGNORED_FILES"),m=r.filter((function(t){return Ce(t)?!p.includes(t.name.toLowerCase()):!x(t)})).map((function(e){return new Promise((function(n,r){t("ADD_ITEM",{interactionMethod:o,source:e.source||e,success:n,failure:r,index:u++,options:e.options||{}})}))}));Promise.all(m).then(s).catch(c)},ADD_ITEM:function(r){var i=r.source,o=r.index,s=void 0===o?-1:o,l=r.interactionMethod,c=r.success,u=void 0===c?function(){}:c,d=r.failure,f=void 0===d?function(){}:d,p=r.options,m=void 0===p?{}:p;if(x(i))f({error:re("error",0,"No source"),file:null});else if(!Ce(i)||!n.options.ignoredFiles.includes(i.name.toLowerCase())){if(!function(t){var e=Nt(t.items).length;if(!t.options.allowMultiple)return 0===e;var n=t.options.maxFiles;return null===n||e<n}(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var h=re("warning",0,"Max files");return t("DID_THROW_MAX_FILES",{source:i,error:h}),void f({error:h,file:null})}var _=Nt(n.items)[0];if(_.status===vt.PROCESSING_COMPLETE||_.status===vt.PROCESSING_REVERT_ERROR){var v=e("GET_FORCE_REVERT");if(_.revert(ve(n.options.server.url,n.options.server.revert),v).then((function(){v&&t("ADD_ITEM",{source:i,index:s,interactionMethod:l,success:u,failure:f,options:m})})).catch((function(){})),v)return}t("REMOVE_ITEM",{query:_.id})}var g="local"===m.type?gt.LOCAL:"limbo"===m.type?gt.LIMBO:gt.INPUT,E=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=ut(),i={archived:!1,frozen:!1,released:!1,source:null,file:n,serverFileReference:e,transferId:null,processingAborted:!1,status:e?vt.PROCESSING_COMPLETE:vt.INIT,activeLoader:null,activeProcessor:null},o=null,s={},l=function(t){return i.status=t},c=function(t){if(!i.released&&!i.frozen){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];T.fire.apply(T,[t].concat(n))}},u=function(){return Ht(i.file.name)},d=function(){return i.file.type},f=function(){return i.file.size},p=function(){return i.file},m=function(e,n,r){i.source=e,i.file?c("load-skip"):(i.file=be(e),n.on("init",(function(){c("load-init")})),n.on("meta",(function(e){i.file.size=e.size,i.file.filename=e.filename,e.source&&(t=gt.LIMBO,i.serverFileReference=e.source,i.status=vt.PROCESSING_COMPLETE),c("load-meta")})),n.on("progress",(function(t){l(vt.LOADING),c("load-progress",t)})),n.on("error",(function(t){l(vt.LOAD_ERROR),c("load-request-error",t)})),n.on("abort",(function(){l(vt.INIT),c("load-abort")})),n.on("load",(function(e){i.activeLoader=null;var n=function(e){i.file=Ce(e)?e:i.file,t===gt.LIMBO&&i.serverFileReference?l(vt.PROCESSING_COMPLETE):l(vt.IDLE),c("load")};i.serverFileReference?n(e):r(e,n,(function(t){i.file=e,c("load-meta"),l(vt.LOAD_ERROR),c("load-file-error",t)}))})),n.setSource(e),i.activeLoader=n,n.load())},h=function(){i.activeLoader&&i.activeLoader.load()},_=function(){i.activeLoader?i.activeLoader.abort():(l(vt.INIT),c("load-abort"))},v=function t(e,n){if(i.processingAborted)i.processingAborted=!1;else if(l(vt.PROCESSING),o=null,i.file instanceof Blob){e.on("load",(function(t){i.transferId=null,i.serverFileReference=t})),e.on("transfer",(function(t){i.transferId=t})),e.on("load-perceived",(function(t){i.activeProcessor=null,i.transferId=null,i.serverFileReference=t,l(vt.PROCESSING_COMPLETE),c("process-complete",t)})),e.on("start",(function(){c("process-start")})),e.on("error",(function(t){i.activeProcessor=null,l(vt.PROCESSING_ERROR),c("process-error",t)})),e.on("abort",(function(t){i.activeProcessor=null,i.transferId=null,i.serverFileReference=t,l(vt.IDLE),c("process-abort"),o&&o()})),e.on("progress",(function(t){c("process-progress",t)}));var r=console.error;n(i.file,(function(t){i.archived||e.process(t,Object.assign({},s))}),r),i.activeProcessor=e}else T.on("load",(function(){t(e,n)}))},g=function(){i.processingAborted=!1,l(vt.PROCESSING_QUEUED)},E=function(){return new Promise((function(t){if(!i.activeProcessor)return i.processingAborted=!0,l(vt.IDLE),c("process-abort"),void t();o=function(){t()},i.activeProcessor.abort()}))},y=function(t,e){return new Promise((function(n,r){null!==i.serverFileReference?(t(i.serverFileReference,(function(){i.serverFileReference=null,n()}),(function(t){e?(l(vt.PROCESSING_REVERT_ERROR),c("process-revert-error"),r(t)):n()})),l(vt.IDLE),c("process-revert")):n()}))},b=function(t,e,n){var r=t.split("."),i=r[0],o=r.pop(),a=s;r.forEach((function(t){return a=a[t]})),JSON.stringify(a[o])!==JSON.stringify(e)&&(a[o]=e,n||c("metadata-update",{key:i,value:s[i]}))},C=function(t){return Te(t?s[t]:s)},T=Object.assign({id:{get:function(){return r}},origin:{get:function(){return t}},serverId:{get:function(){return i.serverFileReference}},transferId:{get:function(){return i.transferId}},status:{get:function(){return i.status}},filename:{get:function(){return i.file.name}},filenameWithoutExtension:{get:function(){return ye(i.file.name)}},fileExtension:{get:u},fileType:{get:d},fileSize:{get:f},file:{get:p},source:{get:function(){return i.source}},getMetadata:C,setMetadata:function(t,e,n){if(X(t)){var r=t;return Object.keys(r).forEach((function(t){b(t,r[t],e)})),t}return b(t,e,n),e},extend:function(t,e){return I[t]=e},abortLoad:_,retryLoad:h,requestProcessing:g,abortProcessing:E,load:m,process:v,revert:y},ft(),{freeze:function(){return i.frozen=!0},release:function(){return i.released=!0},released:{get:function(){return i.released}},archive:function(){return i.archived=!0},archived:{get:function(){return i.archived}}}),I=a(T);return I}(g,g===gt.INPUT?null:i,m.file);Object.keys(m.metadata||{}).forEach((function(t){E.setMetadata(t,m.metadata[t])})),It("DID_CREATE_ITEM",E,{query:e,dispatch:t});var y=e("GET_ITEM_INSERT_LOCATION");n.options.itemInsertLocationFreedom||(s="before"===y?-1:n.items.length),Gt(n.items,E,s),z(y)&&i&&Ne(n,y);var b=E.id;E.on("load-init",(function(){t("DID_START_ITEM_LOAD",{id:b})})),E.on("load-meta",(function(){t("DID_UPDATE_ITEM_META",{id:b})})),E.on("load-progress",(function(e){t("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:b,progress:e})})),E.on("load-request-error",(function(e){var r=Oe(n.options.labelFileLoadError)(e);if(e.code>=400&&e.code<500)return t("DID_THROW_ITEM_INVALID",{id:b,error:e,status:{main:r,sub:e.code+" ("+e.body+")"}}),void f({error:e,file:ht(E)});t("DID_THROW_ITEM_LOAD_ERROR",{id:b,error:e,status:{main:r,sub:n.options.labelTapToRetry}})})),E.on("load-file-error",(function(e){t("DID_THROW_ITEM_INVALID",{id:b,error:e.status,status:e.status}),f({error:e.status,file:ht(E)})})),E.on("load-abort",(function(){t("REMOVE_ITEM",{query:b})})),E.on("load-skip",(function(){t("COMPLETE_LOAD_ITEM",{query:b,item:E,data:{source:i,success:u}})})),E.on("load",(function(){var r=function(r){r?(E.on("metadata-update",(function(e){t("DID_UPDATE_ITEM_METADATA",{id:b,change:e})})),Tt("SHOULD_PREPARE_OUTPUT",!1,{item:E,query:e}).then((function(e){var r=function(){t("COMPLETE_LOAD_ITEM",{query:b,item:E,data:{source:i,success:u}}),De(t,n)};e?t("REQUEST_PREPARE_OUTPUT",{query:b,item:E,ready:function(e){t("DID_PREPARE_OUTPUT",{id:b,file:e}),r()}},!0):r()}))):t("REMOVE_ITEM",{query:b})};Tt("DID_LOAD_ITEM",E,{query:e,dispatch:t}).then((function(){Re(e("GET_BEFORE_ADD_FILE"),ht(E)).then(r)})).catch((function(){r(!1)}))})),E.on("process-start",(function(){t("DID_START_ITEM_PROCESSING",{id:b})})),E.on("process-progress",(function(e){t("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:b,progress:e})})),E.on("process-error",(function(e){t("DID_THROW_ITEM_PROCESSING_ERROR",{id:b,error:e,status:{main:Oe(n.options.labelFileProcessingError)(e),sub:n.options.labelTapToRetry}})})),E.on("process-revert-error",(function(e){t("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:b,error:e,status:{main:Oe(n.options.labelFileProcessingRevertError)(e),sub:n.options.labelTapToRetry}})})),E.on("process-complete",(function(e){t("DID_COMPLETE_ITEM_PROCESSING",{id:b,error:null,serverFileReference:e})})),E.on("process-abort",(function(){t("DID_ABORT_ITEM_PROCESSING",{id:b})})),E.on("process-revert",(function(){t("DID_REVERT_ITEM_PROCESSING",{id:b})})),t("DID_ADD_ITEM",{id:b,index:s,interactionMethod:l}),De(t,n);var C=n.options.server||{},T=C.url,I=C.load,w=C.restore,S=C.fetch;E.load(i,te(g===gt.INPUT?U(i)&&function(t){return(t.indexOf(":")>-1||t.indexOf("//")>-1)&&Se(location.href)!==Se(t)}(i)?oe(T,S):we:oe(T,g===gt.LIMBO?w:I)),(function(t,n,r){Tt("LOAD_FILE",t,{query:e}).then(n).catch(r)}))}},REQUEST_PREPARE_OUTPUT:function(t){var n=t.item,r=t.ready;n.archived||Tt("PREPARE_OUTPUT",n.file,{query:e,item:n}).then((function(t){Tt("COMPLETE_PREPARE_OUTPUT",t,{query:e,item:n}).then((function(t){n.archived||r(t)}))}))},COMPLETE_LOAD_ITEM:function(r){var i=r.item,o=r.data,a=o.success,s=o.source,l=e("GET_ITEM_INSERT_LOCATION");z(l)&&s&&Ne(n,l),t("DID_LOAD_ITEM",{id:i.id,error:null,serverFileReference:i.origin===gt.INPUT?null:s}),a(ht(i)),i.origin!==gt.LOCAL?i.origin!==gt.LIMBO?e("IS_ASYNC")&&n.options.instantUpload&&t("REQUEST_ITEM_PROCESSING",{query:i.id}):t("DID_COMPLETE_ITEM_PROCESSING",{id:i.id,error:null,serverFileReference:s}):t("DID_LOAD_LOCAL_ITEM",{id:i.id})},RETRY_ITEM_LOAD:Ae(n,(function(t){t.retryLoad()})),REQUEST_ITEM_PROCESSING:Ae(n,(function(r,i,o){if(r.status===vt.IDLE||r.status===vt.PROCESSING_ERROR)r.status!==vt.PROCESSING_QUEUED&&(r.requestProcessing(),t("DID_REQUEST_ITEM_PROCESSING",{id:r.id}),t("PROCESS_ITEM",{query:r,success:i,failure:o},!0));else{var a=function(){setTimeout((function(){t("REQUEST_ITEM_PROCESSING",{query:r,success:i,failure:o})}),32)};r.status===vt.PROCESSING_COMPLETE||r.status===vt.PROCESSING_REVERT_ERROR?r.revert(ve(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(a).catch((function(){})):r.status===vt.PROCESSING&&r.abortProcessing().then(a)}})),PROCESS_ITEM:Ae(n,(function(r,i,o){var a=e("GET_MAX_PARALLEL_UPLOADS");if(e("GET_ITEMS_BY_STATUS",vt.PROCESSING).length!==a){if(r.status!==vt.PROCESSING){var s=function e(){var r=n.processingQueue.shift();if(r){var i=r.id,o=r.success,a=r.failure,s=Dt(n.items,i);s&&!s.archived?t("PROCESS_ITEM",{query:i,success:o,failure:a},!0):e()}};r.onOnce("process-complete",(function(){i(ht(r)),s(),e("GET_ITEMS_BY_STATUS",vt.PROCESSING_COMPLETE).length===n.items.length&&t("DID_COMPLETE_ITEM_PROCESSING_ALL")})),r.onOnce("process-error",(function(t){o({error:t,file:ht(r)}),s()}));var l=n.options;r.process(Ee(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return"function"==typeof e?function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return e.apply(void 0,[n].concat(i,[r]))}:e&&U(e.url)?_e(t,e,n,r):null}(l.server.url,l.server.process,l.name,{chunkTransferId:r.transferId,chunkServer:l.server.patch,chunkUploads:l.chunkUploads,chunkForce:l.chunkForce,chunkSize:l.chunkSize,chunkRetryDelays:l.chunkRetryDelays})),(function(n,i,o){Tt("PREPARE_OUTPUT",n,{query:e,item:r}).then((function(e){t("DID_PREPARE_OUTPUT",{id:r.id,file:e}),i(e)})).catch(o)}))}}else n.processingQueue.push({id:r.id,success:i,failure:o})})),RETRY_ITEM_PROCESSING:Ae(n,(function(e){t("REQUEST_ITEM_PROCESSING",{query:e})})),REQUEST_REMOVE_ITEM:Ae(n,(function(n){Re(e("GET_BEFORE_REMOVE_FILE"),ht(n)).then((function(e){e&&t("REMOVE_ITEM",{query:n})}))})),RELEASE_ITEM:Ae(n,(function(t){t.release()})),REMOVE_ITEM:Ae(n,(function(e,r){var i=function(){var i=e.id;Ie(n.items,i).archive(),t("DID_REMOVE_ITEM",{error:null,id:i,item:e}),De(t,n),r(ht(e))},o=n.options.server;e.origin===gt.LOCAL&&o&&z(o.remove)?(t("DID_START_ITEM_REMOVE",{id:e.id}),o.remove(e.source,(function(){return i()}),(function(r){t("DID_THROW_ITEM_REMOVE_ERROR",{id:e.id,error:re("error",0,r,null),status:{main:Oe(n.options.labelFileRemoveError)(r),sub:n.options.labelTapToRetry}})}))):i()})),ABORT_ITEM_LOAD:Ae(n,(function(t){t.abortLoad()})),ABORT_ITEM_PROCESSING:Ae(n,(function(e){e.serverId?t("REVERT_ITEM_PROCESSING",{id:e.id}):e.abortProcessing().then((function(){n.options.instantUpload&&t("REMOVE_ITEM",{query:e.id})}))})),REQUEST_REVERT_ITEM_PROCESSING:Ae(n,(function(r){if(n.options.instantUpload){var i=function(e){e&&t("REVERT_ITEM_PROCESSING",{query:r})},o=e("GET_BEFORE_REMOVE_FILE");if(!o)return i(!0);var a=o(ht(r));return null==a?i(!0):"boolean"==typeof a?i(a):void("function"==typeof a.then&&a.then(i))}t("REVERT_ITEM_PROCESSING",{query:r})})),REVERT_ITEM_PROCESSING:Ae(n,(function(r){r.revert(ve(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then((function(){(n.options.instantUpload||function(t){return!Ce(t.file)}(r))&&t("REMOVE_ITEM",{query:r.id})})).catch((function(){}))})),SET_OPTIONS:function(e){var n=e.options;o(n,(function(e,n){t("SET_"+et(e,"_").toUpperCase(),{value:n})}))}}},ke=function(t){return document.createElement(t)},Le=function(t,e){var n=t.childNodes[0];n?e!==n.nodeValue&&(n.nodeValue=e):(n=document.createTextNode(e),t.appendChild(n))},xe=function(t,e,n,r){var i=(r%360-90)*Math.PI/180;return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}},Me=function(t,e,n,r,i){var o=1;return i>r&&i-r<=.5&&(o=0),r>i&&r-i>=.5&&(o=0),function(t,e,n,r,i,o){var a=xe(t,e,n,i),s=xe(t,e,n,r);return["M",a.x,a.y,"A",n,n,0,o,0,s.x,s.y].join(" ")}(t,e,n,360*Math.min(.9999,r),360*Math.min(.9999,i),o)},Fe=N({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:function(t){var e=t.root,n=t.props;n.spin=!1,n.progress=0,n.opacity=0;var r=d("svg");e.ref.path=d("path",{"stroke-width":2,"stroke-linecap":"round"}),r.appendChild(e.ref.path),e.ref.svg=r,e.appendChild(r)},write:function(t){var e=t.root,n=t.props;if(0!==n.opacity){n.align&&(e.element.dataset.align=n.align);var r=parseInt(s(e.ref.path,"stroke-width"),10),i=.5*e.rect.element.width,o=0,a=0;n.spin?(o=0,a=.5):(o=0,a=n.progress);var l=Me(i,i,i-r,o,a);s(e.ref.path,"d",l),s(e.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)}},mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),Be=N({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:function(t){var e=t.root,n=t.props;e.element.innerHTML=(n.icon||"")+"<span>"+n.label+"</span>",n.isDisabled=!1},write:function(t){var e=t.root,n=t.props,r=n.isDisabled,i=e.query("GET_DISABLED")||0===n.opacity;i&&!r?(n.isDisabled=!0,s(e.element,"disabled","disabled")):!i&&r&&(n.isDisabled=!1,e.element.removeAttribute("disabled"))}}),Ge=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".";return(t=Math.round(Math.abs(t)))<1e3?t+" bytes":t<qe?Math.floor(t/Ue)+" KB":t<He?$e(t/qe,1,e)+" MB":$e(t/He,2,e)+" GB"},Ue=1e3,qe=1e6,He=1e9,$e=function(t,e,n){return t.toFixed(e).split(".").filter((function(t){return"0"!==t})).join(n)},Ve=function(t){var e=t.root,n=t.props;Le(e.ref.fileSize,Ge(e.query("GET_ITEM_SIZE",n.id))),Le(e.ref.fileName,e.query("GET_ITEM_NAME",n.id))},je=function(t){var e=t.root,n=t.props;V(e.query("GET_ITEM_SIZE",n.id))||Le(e.ref.fileSize,e.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},ze=N({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:A({DID_LOAD_ITEM:Ve,DID_UPDATE_ITEM_META:Ve,DID_THROW_ITEM_LOAD_ERROR:je,DID_THROW_ITEM_INVALID:je}),didCreateView:function(t){It("CREATE_VIEW",Object.assign({},t,{view:t}))},create:function(t){var e=t.root,n=t.props,r=ke("span");r.className="filepond--file-info-main",s(r,"aria-hidden","true"),e.appendChild(r),e.ref.fileName=r;var i=ke("span");i.className="filepond--file-info-sub",e.appendChild(i),e.ref.fileSize=i,Le(i,e.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),Le(r,e.query("GET_ITEM_NAME",n.id))},mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),Ye=function(t){return Math.round(100*t)},We=function(t){var e=t.root,n=t.action,r=null===n.progress?e.query("GET_LABEL_FILE_LOADING"):e.query("GET_LABEL_FILE_LOADING")+" "+Ye(n.progress)+"%";Le(e.ref.main,r),Le(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},Xe=function(t){var e=t.root;Le(e.ref.main,""),Le(e.ref.sub,"")},Ke=function(t){var e=t.root,n=t.action;Le(e.ref.main,n.status.main),Le(e.ref.sub,n.status.sub)},Qe=N({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:A({DID_LOAD_ITEM:Xe,DID_REVERT_ITEM_PROCESSING:Xe,DID_REQUEST_ITEM_PROCESSING:function(t){var e=t.root;Le(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING")),Le(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},DID_ABORT_ITEM_PROCESSING:function(t){var e=t.root;Le(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_ABORTED")),Le(e.ref.sub,e.query("GET_LABEL_TAP_TO_RETRY"))},DID_COMPLETE_ITEM_PROCESSING:function(t){var e=t.root;Le(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),Le(e.ref.sub,e.query("GET_LABEL_TAP_TO_UNDO"))},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(t){var e=t.root,n=t.action,r=null===n.progress?e.query("GET_LABEL_FILE_PROCESSING"):e.query("GET_LABEL_FILE_PROCESSING")+" "+Ye(n.progress)+"%";Le(e.ref.main,r),Le(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},DID_UPDATE_ITEM_LOAD_PROGRESS:We,DID_THROW_ITEM_LOAD_ERROR:Ke,DID_THROW_ITEM_INVALID:Ke,DID_THROW_ITEM_PROCESSING_ERROR:Ke,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Ke,DID_THROW_ITEM_REMOVE_ERROR:Ke}),didCreateView:function(t){It("CREATE_VIEW",Object.assign({},t,{view:t}))},create:function(t){var e=t.root,n=(t.props,ke("span"));n.className="filepond--file-status-main",e.appendChild(n),e.ref.main=n;var r=ke("span");r.className="filepond--file-status-sub",e.appendChild(r),e.ref.sub=r,We({root:e,action:{progress:null}})},mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),Ze={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},Je=[];o(Ze,(function(t){Je.push(t)}));var tn,en=function(t){var e=t.ref.buttonRemoveItem.rect.element;return e.hidden?null:e.width+e.left},nn=function(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.height/4)},rn=function(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.left/2)},on=function(t){return t.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")},an={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:function(t){return t.query("GET_STYLE_LOAD_INDICATOR_POSITION")}},processProgressIndicator:{opacity:0,align:function(t){return t.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},sn={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:en},status:{translateX:en}},ln={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},cn={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:en},status:{translateX:en,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:en},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:on},info:{translateX:en},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:on},buttonRemoveItem:{opacity:1},info:{translateX:en},status:{opacity:1,translateX:en}},DID_LOAD_ITEM:sn,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:en},status:{translateX:en}},DID_START_ITEM_PROCESSING:ln,DID_REQUEST_ITEM_PROCESSING:ln,DID_UPDATE_ITEM_PROCESS_PROGRESS:ln,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:en}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:en},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:sn},un=N({create:function(t){var e=t.root;e.element.innerHTML=e.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),dn=A({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function(t){var e=t.root,n=t.action;e.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function(t){var e=t.root,n=t.action;e.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function(t){var e=t.root,n=t.action;e.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function(t){var e=t.root;e.ref.processProgressIndicator.spin=!0,e.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function(t){var e=t.root;e.ref.loadProgressIndicator.spin=!0,e.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function(t){var e=t.root;e.ref.processProgressIndicator.spin=!0,e.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function(t){var e=t.root,n=t.action;e.ref.loadProgressIndicator.spin=!1,e.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(t){var e=t.root,n=t.action;e.ref.processProgressIndicator.spin=!1,e.ref.processProgressIndicator.progress=n.progress}}),fn=N({create:function(t){var e=t.root,n=t.props.id,r=e.query("GET_ALLOW_REVERT"),i=e.query("GET_INSTANT_UPLOAD"),a=e.query("IS_ASYNC"),s=a?Je.concat():Je.filter((function(t){return!/Process/.test(t)}));if(a&&!r){s.splice(-1,1);var l=cn.DID_COMPLETE_ITEM_PROCESSING;l.info.translateX=rn,l.info.translateY=nn,l.status.translateY=nn,l.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}i&&r&&(Ze.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",Ze.RevertItemProcessing.icon="GET_ICON_REMOVE"),o(Ze,(function(t,r){var i=e.createChildView(Be,{label:e.query(r.label),icon:e.query(r.icon),opacity:0});s.includes(t)&&e.appendChildView(i),i.element.dataset.align=e.query("GET_STYLE_"+r.align),i.element.classList.add(r.className),i.on("click",(function(t){t.stopPropagation(),e.dispatch(r.action,{query:n})})),e.ref["button"+t]=i})),e.ref.info=e.appendChildView(e.createChildView(ze,{id:n})),e.ref.status=e.appendChildView(e.createChildView(Qe,{id:n})),e.ref.processingCompleteIndicator=e.appendChildView(e.createChildView(un)),e.ref.processingCompleteIndicator.element.dataset.align=e.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION");var c=e.appendChildView(e.createChildView(Fe,{opacity:0,align:e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));c.element.classList.add("filepond--load-indicator"),e.ref.loadProgressIndicator=c;var u=e.appendChildView(e.createChildView(Fe,{opacity:0,align:e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));u.element.classList.add("filepond--process-indicator"),e.ref.processProgressIndicator=u,e.ref.activeStyles=[]},write:function(t){var e=t.root,n=t.actions,r=t.props;dn({root:e,actions:n,props:r});var i=n.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return cn[t.type]}));if(i){e.ref.activeStyles=[];var a=cn[i.type];o(an,(function(t,n){var r=e.ref[t];o(n,(function(n,i){var o=a[t]&&void 0!==a[t][n]?a[t][n]:i;e.ref.activeStyles.push({control:r,key:n,value:o})}))}))}e.ref.activeStyles.forEach((function(t){var n=t.control,r=t.key,i=t.value;n[r]="function"==typeof i?i(e):i}))},didCreateView:function(t){It("CREATE_VIEW",Object.assign({},t,{view:t}))},name:"file"}),pn=N({create:function(t){var e=t.root,n=t.props;e.ref.fileName=ke("legend"),e.appendChild(e.ref.fileName),e.ref.file=e.appendChildView(e.createChildView(fn,{id:n.id}));var r=ke("input");r.type="hidden",r.name=e.query("GET_NAME"),r.disabled=e.query("GET_DISABLED"),e.ref.data=r,e.appendChild(r)},ignoreRect:!0,write:A({DID_SET_DISABLED:function(t){var e=t.root;e.ref.data.disabled=e.query("GET_DISABLED")},DID_LOAD_ITEM:function(t){var e=t.root,n=t.action,r=t.props;e.ref.data.value=n.serverFileReference,Le(e.ref.fileName,e.query("GET_ITEM_NAME",r.id))},DID_REMOVE_ITEM:function(t){t.root.ref.data.removeAttribute("value")},DID_COMPLETE_ITEM_PROCESSING:function(t){var e=t.root,n=t.action;e.ref.data.value=n.serverFileReference},DID_REVERT_ITEM_PROCESSING:function(t){t.root.ref.data.removeAttribute("value")}}),didCreateView:function(t){It("CREATE_VIEW",Object.assign({},t,{view:t}))},tag:"fieldset",name:"file-wrapper"}),mn={type:"spring",damping:.6,mass:7},hn=function(t,e,n){var r=N({name:"panel-"+e.name+" filepond--"+n,mixins:e.mixins,ignoreRectUpdate:!0}),i=t.createChildView(r,e.props);t.ref[e.name]=t.appendChildView(i)},_n=N({name:"panel",write:function(t){var e=t.root,n=t.props;if(null!==e.ref.scalable&&n.scalable===e.ref.scalable||(e.ref.scalable=!B(n.scalable)||n.scalable,e.element.dataset.scalable=e.ref.scalable),n.height){var r=e.ref.top.rect.element,i=e.ref.bottom.rect.element,o=Math.max(r.height+i.height,n.height);e.ref.center.translateY=r.height,e.ref.center.scaleY=(o-r.height-i.height)/100,e.ref.bottom.translateY=o-i.height}},create:function(t){var e=t.root,n=t.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:mn},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:mn},styles:["translateY"]}}].forEach((function(t){hn(e,t,n.name)})),e.element.classList.add("filepond--"+n.name),e.ref.scalable=null},ignoreRect:!0,mixins:{apis:["height","scalable"]}}),vn={type:"spring",stiffness:.75,damping:.45,mass:10},gn={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy",DID_REQUEST_ITEM_PROCESSING:"busy",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},En=A({DID_UPDATE_PANEL_HEIGHT:function(t){var e=t.root,n=t.action.height;e.height=n}}),yn=N({create:function(t){var e=t.root,n=t.props;e.ref.handleClick=function(){return e.dispatch("DID_ACTIVATE_ITEM",{id:n.id})},e.element.id="filepond--item-"+n.id,e.element.addEventListener("click",e.ref.handleClick),e.ref.container=e.appendChildView(e.createChildView(pn,{id:n.id})),e.ref.panel=e.appendChildView(e.createChildView(_n,{name:"item-panel"})),e.ref.panel.height=null,n.markedForRemoval=!1},write:function(t){var e=t.root,n=t.actions,r=t.props,i=t.shouldOptimize,o=n.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return gn[t.type]}));o&&o.type!==r.currentState&&(r.currentState=o.type,e.element.dataset.filepondItemState=gn[r.currentState]||"");var a=e.query("GET_ITEM_PANEL_ASPECT_RATIO")||e.query("GET_PANEL_ASPECT_RATIO");a?i||(e.height=e.rect.element.width*a):(En({root:e,actions:n,props:r}),!e.height&&e.ref.container.rect.element.height>0&&(e.height=e.ref.container.rect.element.height)),i&&(e.ref.panel.height=null),e.ref.panel.height=e.height},destroy:function(t){var e=t.root,n=t.props;e.element.removeEventListener("click",e.ref.handleClick),e.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:"spring",scaleY:"spring",translateX:vn,translateY:vn,opacity:{type:"tween",duration:150}}}}),bn=function(t,e){if(e){var n=t.rect.element.width,r=t.childViews,i=r.length,o=null;if(0===i||e.top<r[0].rect.element.top)return-1;var a=r[0].rect.element,s=a.marginLeft+a.marginRight,l=a.width+s,c=Math.round(n/l);if(1===c){for(var u=0;u<i;u++){var d=r[u],f=d.rect.outer.top+.5*d.rect.element.height;if(e.top<f)return u}return i}for(var p=a.marginTop+a.marginBottom,m=a.height+p,h=0;h<i;h++){var _=h%c*l,v=Math.floor(h/c)*m,g=v-a.marginTop,E=_+l,y=v+m+a.marginBottom;if(e.top<y&&e.top>g){if(e.left<E)return h;o=h!==i-1?h:null}}return null!==o?o:i}},Cn=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;t.translateX=e,t.translateY=n,Date.now()>t.spawnDate&&(0===t.opacity&&Tn(t,e,n,r,i),t.scaleX=1,t.scaleY=1,t.opacity=1)},Tn=function(t,e,n,r,i){t.interactionMethod===ct?(t.translateX=null,t.translateX=e,t.translateY=null,t.translateY=n):t.interactionMethod===at?(t.translateX=null,t.translateX=e-20*r,t.translateY=null,t.translateY=n-10*i,t.scaleX=.8,t.scaleY=.8):t.interactionMethod===st?(t.translateY=null,t.translateY=n-30):t.interactionMethod===ot&&(t.translateX=null,t.translateX=e-30,t.translateY=null)},In=A({DID_ADD_ITEM:function(t){var e=t.root,n=t.action,r=n.id,i=n.index,o=n.interactionMethod;e.ref.addIndex=i;var a=Date.now(),s=a,l=1;if(o!==ct){l=0;var c=e.query("GET_ITEM_INSERT_INTERVAL"),u=a-e.ref.lastItemSpanwDate;s=u<c?a+(c-u):a}e.ref.lastItemSpanwDate=s,e.appendChildView(e.createChildView(yn,{spawnDate:s,id:r,opacity:l,interactionMethod:o}),i)},DID_REMOVE_ITEM:function(t){var e=t.root,n=t.action.id,r=e.childViews.find((function(t){return t.id===n}));r&&(r.scaleX=.9,r.scaleY=.9,r.opacity=0,r.markedForRemoval=!0)}}),wn=N({create:function(t){var e=t.root;s(e.element,"role","list"),e.ref.lastItemSpanwDate=Date.now()},write:function(t){var e=t.root,n=t.props,r=t.actions,i=t.shouldOptimize;In({root:e,props:n,actions:r});var o=n.dragCoordinates,a=o?bn(e,o):null,s=e.rect.element.width,l=e.childViews.filter((function(t){return t.rect.element.height})),c=e.query("GET_ACTIVE_ITEMS").map((function(t){return l.find((function(e){return e.id===t.id}))})).filter((function(t){return t})),u=e.ref.addIndex||null;e.ref.addIndex=null;var d=0,f=0,p=0;if(0!==c.length){var m=c[0].rect.element,h=m.marginTop+m.marginBottom,_=m.marginLeft+m.marginRight,v=m.width+_,g=m.height+h,E=Math.round(s/v);if(1===E){var y=0,b=0;c.forEach((function(t,e){if(a){var n=e-a;b=-2===n?.25*-h:-1===n?.75*-h:0===n?.75*h:1===n?.25*h:0}i&&(t.translateX=null,t.translateY=null),t.markedForRemoval||Cn(t,0,y+b);var r=(t.rect.element.height+h)*(t.markedForRemoval?t.opacity:1);y+=r}))}else{var C=0,T=0;c.forEach((function(t,e){e===a&&(d=1),e===u&&(p+=1),t.markedForRemoval&&t.opacity<.5&&(f-=1);var n=e+p+d+f,r=n%E,o=Math.floor(n/E),s=r*v,l=o*g,c=Math.sign(s-C),m=Math.sign(l-T);C=s,T=l,t.markedForRemoval||(i&&(t.translateX=null,t.translateY=null),Cn(t,s,l,c,m))}))}}},tag:"ul",name:"list",didWriteView:function(t){var e=t.root;e.childViews.filter((function(t){return t.markedForRemoval&&0===t.opacity&&t.resting})).forEach((function(t){t._destroy(),e.removeChildView(t)}))},filterFrameActionsForChild:function(t,e){return e.filter((function(e){return!e.data||!e.data.id||t.id===e.data.id}))},mixins:{apis:["dragCoordinates"]}}),Sn=A({DID_DRAG:function(t){var e=t.root,n=t.props,r=t.action;e.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(n.dragCoordinates={left:r.position.scopeLeft-e.ref.list.rect.element.left,top:r.position.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},DID_END_DRAG:function(t){t.props.dragCoordinates=null}}),On=N({create:function(t){var e=t.root,n=t.props;e.ref.list=e.appendChildView(e.createChildView(wn)),n.dragCoordinates=null,n.overflowing=!1},write:function(t){var e=t.root,n=t.props,r=t.actions;if(Sn({root:e,props:n,actions:r}),e.ref.list.dragCoordinates=n.dragCoordinates,n.overflowing&&!n.overflow&&(n.overflowing=!1,e.element.dataset.state="",e.height=null),n.overflow){var i=Math.round(n.overflow);i!==e.height&&(n.overflowing=!0,e.element.dataset.state="overflow",e.height=i)}},name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),Dn=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";n?s(t,e,r):t.removeAttribute(e)},Rn=function(t){var e=t.root,n=(t.action,e.query("GET_DISABLED")),r=e.query("GET_ALLOW_BROWSE"),i=n||!r;Dn(e.element,"disabled",i)},Nn=function(t){var e=t.root,n=e.element;e.query("GET_TOTAL_ITEMS")>0?(Dn(n,"required",!1),Dn(n,"name",!1)):(Dn(n,"name",!0,e.query("GET_NAME")),e.query("GET_CHECK_VALIDITY")&&n.setCustomValidity(""),e.query("GET_REQUIRED")&&Dn(n,"required",!0))},An=N({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:function(t){var e=t.root,n=t.props;e.element.id="filepond--browser-"+n.id,s(e.element,"name",e.query("GET_NAME")),s(e.element,"aria-controls","filepond--assistant-"+n.id),s(e.element,"aria-labelledby","filepond--drop-label-"+n.id),e.ref.handleChange=function(t){if(e.element.value){var r=Array.from(e.element.files);setTimeout((function(){n.onload(r),function(t){if(t&&""!==t.value){try{t.value=""}catch(t){}if(t.value){var e=ke("form"),n=t.parentNode,r=t.nextSibling;e.appendChild(t),e.reset(),r?n.insertBefore(t,r):n.appendChild(t)}}}(e.element)}),250)}},e.element.addEventListener("change",e.ref.handleChange)},destroy:function(t){var e=t.root;e.element.removeEventListener("change",e.ref.handleChange)},write:A({DID_LOAD_ITEM:Nn,DID_REMOVE_ITEM:Nn,DID_THROW_ITEM_INVALID:function(t){var e=t.root;e.query("GET_CHECK_VALIDITY")&&e.element.setCustomValidity(e.query("GET_LABEL_INVALID_FIELD"))},DID_SET_DISABLED:Rn,DID_SET_ALLOW_BROWSE:Rn,DID_SET_ALLOW_MULTIPLE:function(t){var e=t.root,n=t.action;Dn(e.element,"multiple",n.value)},DID_SET_ACCEPTED_FILE_TYPES:function(t){var e=t.root,n=t.action;Dn(e.element,"accept",!!n.value,n.value?n.value.join(","):"")},DID_SET_CAPTURE_METHOD:function(t){var e=t.root,n=t.action;Dn(e.element,"capture",!!n.value,!0===n.value?"":n.value)},DID_SET_REQUIRED:function(t){var e=t.root;t.action.value?0===e.query("GET_TOTAL_ITEMS")&&Dn(e.element,"required",!0):Dn(e.element,"required",!1)}})}),Pn=13,kn=32,Ln=function(t,e){t.innerHTML=e;var n=t.querySelector(".filepond--label-action");return n&&s(n,"tabindex","0"),e},xn=N({name:"drop-label",ignoreRect:!0,create:function(t){var e=t.root,n=t.props,r=ke("label");s(r,"for","filepond--browser-"+n.id),s(r,"id","filepond--drop-label-"+n.id),s(r,"aria-hidden","true"),e.ref.handleKeyDown=function(t){(t.keyCode===Pn||t.keyCode===kn)&&(t.preventDefault(),e.ref.label.click())},e.ref.handleClick=function(t){t.target===r||r.contains(t.target)||e.ref.label.click()},r.addEventListener("keydown",e.ref.handleKeyDown),e.element.addEventListener("click",e.ref.handleClick),Ln(r,n.caption),e.appendChild(r),e.ref.label=r},destroy:function(t){var e=t.root;e.ref.label.addEventListener("keydown",e.ref.handleKeyDown),e.element.removeEventListener("click",e.ref.handleClick)},write:A({DID_SET_LABEL_IDLE:function(t){var e=t.root,n=t.action;Ln(e.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),Mn=N({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),Fn=A({DID_DRAG:function(t){var e=t.root,n=t.action;e.ref.blob?(e.ref.blob.translateX=n.position.scopeLeft,e.ref.blob.translateY=n.position.scopeTop,e.ref.blob.scaleX=1,e.ref.blob.scaleY=1,e.ref.blob.opacity=1):function(t){var e=t.root,n=.5*e.rect.element.width,r=.5*e.rect.element.height;e.ref.blob=e.appendChildView(e.createChildView(Mn,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:r}))}({root:e})},DID_DROP:function(t){var e=t.root;e.ref.blob&&(e.ref.blob.scaleX=2.5,e.ref.blob.scaleY=2.5,e.ref.blob.opacity=0)},DID_END_DRAG:function(t){var e=t.root;e.ref.blob&&(e.ref.blob.opacity=0)}}),Bn=N({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:function(t){var e=t.root,n=t.props,r=t.actions;Fn({root:e,props:n,actions:r});var i=e.ref.blob;0===r.length&&i&&0===i.opacity&&(e.removeChildView(i),e.ref.blob=null)}}),Gn=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],Un=["css","csv","html","txt"],qn={zip:"zip|compressed",epub:"application/epub+zip"},Hn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t=t.toLowerCase(),Gn.includes(t)?"image/"+("jpg"===t?"jpeg":"svg"===t?"svg+xml":t):Un.includes(t)?"text/"+t:qn[t]||null},$n=function(t){return new Promise((function(e,n){var r=Jn(t);if(r.length&&!Vn(t))return e(r);jn(t).then(e)}))},Vn=function(t){return!!t.files&&t.files.length>0},jn=function(t){return new Promise((function(e,n){var r=(t.items?Array.from(t.items):[]).filter((function(t){return zn(t)})).map((function(t){return Yn(t)}));r.length?Promise.all(r).then((function(t){var n=[];t.forEach((function(t){n.push.apply(n,t)})),e(n.filter((function(t){return t})))})).catch(console.error):e(t.files?Array.from(t.files):[])}))},zn=function(t){if(Qn(t)){var e=Zn(t);if(e)return e.isFile||e.isDirectory}return"file"===t.kind},Yn=function(t){return new Promise((function(e,n){Kn(t)?Wn(Zn(t)).then(e).catch(n):e([t.getAsFile()])}))},Wn=function(t){return new Promise((function(e,n){var r=[],i=0,o=0,a=function(){0===o&&0===i&&e(r)};!function t(e){i++;var s=e.createReader();!function e(){s.readEntries((function(n){if(0===n.length)return i--,void a();n.forEach((function(e){e.isDirectory?t(e):(o++,e.file((function(t){r.push(Xn(t)),o--,a()})))})),e()}),n)}()}(t)}))},Xn=function(t){if(t.type.length)return t;var e=t.lastModifiedDate,n=t.name;return(t=t.slice(0,t.size,Hn(Ht(t.name)))).name=n,t.lastModifiedDate=e,t},Kn=function(t){return Qn(t)&&(Zn(t)||{}).isDirectory},Qn=function(t){return"webkitGetAsEntry"in t},Zn=function(t){return t.webkitGetAsEntry()},Jn=function(t){var e=[];try{if((e=er(t)).length)return e;e=tr(t)}catch(t){}return e},tr=function(t){var e=t.getData("url");return"string"==typeof e&&e.length?[e]:[]},er=function(t){var e=t.getData("text/html");if("string"==typeof e&&e.length){var n=e.match(/src\s*=\s*"(.+?)"/);if(n)return[n[1]]}return[]},nr=[],rr=function(t){return{pageLeft:t.pageX,pageTop:t.pageY,scopeLeft:t.offsetX||t.layerX,scopeTop:t.offsetY||t.layerY}},ir=function(t){var e=nr.find((function(e){return e.element===t}));if(e)return e;var n=or(t);return nr.push(n),n},or=function(t){var e=[],n={dragenter:cr,dragover:ur,dragleave:fr,drop:dr},r={};o(n,(function(n,i){r[n]=i(t,e),t.addEventListener(n,r[n],!1)}));var i={element:t,addListener:function(a){return e.push(a),function(){e.splice(e.indexOf(a),1),0===e.length&&(nr.splice(nr.indexOf(i),1),o(n,(function(e){t.removeEventListener(e,r[e],!1)})))}}};return i},ar=function(t,e){var n,r=function(t,e){return"elementFromPoint"in t||(t=document),t.elementFromPoint(e.x,e.y)}("getRootNode"in(n=e)?n.getRootNode():document,{x:t.pageX-window.pageXOffset,y:t.pageY-window.pageYOffset});return r===e||e.contains(r)},sr=null,lr=function(t,e){try{t.dropEffect=e}catch(t){}},cr=function(t,e){return function(t){t.preventDefault(),sr=t.target,e.forEach((function(e){var n=e.element,r=e.onenter;ar(t,n)&&(e.state="enter",r(rr(t)))}))}},ur=function(t,e){return function(t){t.preventDefault();var n=t.dataTransfer;$n(n).then((function(r){var i=!1;e.some((function(e){var o=e.filterElement,a=e.element,s=e.onenter,l=e.onexit,c=e.ondrag,u=e.allowdrop;lr(n,"copy");var d=u(r);if(d)if(ar(t,a)){if(i=!0,null===e.state)return e.state="enter",void s(rr(t));if(e.state="over",o&&!d)return void lr(n,"none");c(rr(t))}else o&&!i&&lr(n,"none"),e.state&&(e.state=null,l(rr(t)));else lr(n,"none")}))}))}},dr=function(t,e){return function(t){t.preventDefault();var n=t.dataTransfer;$n(n).then((function(n){e.forEach((function(e){var r=e.filterElement,i=e.element,o=e.ondrop,a=e.onexit,s=e.allowdrop;if(e.state=null,!r||ar(t,i))return s(n)?void o(rr(t),n):a(rr(t))}))}))}},fr=function(t,e){return function(t){sr===t.target&&e.forEach((function(e){var n=e.onexit;e.state=null,n(rr(t))}))}},pr=function(t,e,n){t.classList.add("filepond--hopper");var r=n.catchesDropsOnPage,i=n.requiresDropOnElement,o=n.filterItems,a=void 0===o?function(t){return t}:o,s=function(t,e,n){var r=ir(e),i={element:t,filterElement:n,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return i.destroy=r.addListener(i),i}(t,r?document.documentElement:t,i),l="",c="";s.allowdrop=function(t){return e(a(t))},s.ondrop=function(t,n){var r=a(n);e(r)?(c="drag-drop",u.onload(r,t)):u.ondragend(t)},s.ondrag=function(t){u.ondrag(t)},s.onenter=function(t){c="drag-over",u.ondragstart(t)},s.onexit=function(t){c="drag-exit",u.ondragend(t)};var u={updateHopperState:function(){l!==c&&(t.dataset.hopperState=c,l=c)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){s.destroy()}};return u},mr=!1,hr=[],_r=function(t){$n(t.clipboardData).then((function(t){t.length&&hr.forEach((function(e){return e(t)}))}))},vr=function(){var t=function(t){e.onload(t)},e={destroy:function(){var e;e=t,dt(hr,hr.indexOf(e)),0===hr.length&&(document.removeEventListener("paste",_r),mr=!1)},onload:function(){}};return function(t){hr.includes(t)||(hr.push(t),mr||(mr=!0,document.addEventListener("paste",_r)))}(t),e},gr=null,Er=null,yr=[],br=function(t,e){t.element.textContent=e},Cr=function(t,e,n){var r=t.query("GET_TOTAL_ITEMS");br(t,n+" "+e+", "+r+" "+(1===r?t.query("GET_LABEL_FILE_COUNT_SINGULAR"):t.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(Er),Er=setTimeout((function(){!function(t){t.element.textContent=""}(t)}),1500)},Tr=function(t){return t.element.parentNode.contains(document.activeElement)},Ir=function(t){var e=t.root,n=t.action,r=e.query("GET_ITEM",n.id).filename,i=e.query("GET_LABEL_FILE_PROCESSING_ABORTED");br(e,r+" "+i)},wr=function(t){var e=t.root,n=t.action,r=e.query("GET_ITEM",n.id).filename;br(e,n.status.main+" "+r+" "+n.status.sub)},Sr=N({create:function(t){var e=t.root,n=t.props;e.element.id="filepond--assistant-"+n.id,s(e.element,"role","status"),s(e.element,"aria-live","polite"),s(e.element,"aria-relevant","additions")},ignoreRect:!0,ignoreRectUpdate:!0,write:A({DID_LOAD_ITEM:function(t){var e=t.root,n=t.action;if(Tr(e)){e.element.textContent="";var r=e.query("GET_ITEM",n.id);yr.push(r.filename),clearTimeout(gr),gr=setTimeout((function(){Cr(e,yr.join(", "),e.query("GET_LABEL_FILE_ADDED")),yr.length=0}),750)}},DID_REMOVE_ITEM:function(t){var e=t.root,n=t.action;if(Tr(e)){var r=n.item;Cr(e,r.filename,e.query("GET_LABEL_FILE_REMOVED"))}},DID_COMPLETE_ITEM_PROCESSING:function(t){var e=t.root,n=t.action,r=e.query("GET_ITEM",n.id).filename,i=e.query("GET_LABEL_FILE_PROCESSING_COMPLETE");br(e,r+" "+i)},DID_ABORT_ITEM_PROCESSING:Ir,DID_REVERT_ITEM_PROCESSING:Ir,DID_THROW_ITEM_REMOVE_ERROR:wr,DID_THROW_ITEM_LOAD_ERROR:wr,DID_THROW_ITEM_INVALID:wr,DID_THROW_ITEM_PROCESSING_ERROR:wr}),tag:"span",name:"assistant"}),Or=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return t.replace(new RegExp(e+".","g"),(function(t){return t.charAt(1).toUpperCase()}))},Dr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Date.now(),i=null;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];clearTimeout(i);var l=Date.now()-r,c=function(){r=Date.now(),t.apply(void 0,a)};l<e?n||(i=setTimeout(c,e-l)):c()}},Rr=function(t){var e=t.ref.list.childViews[0].childViews[0];return e?{top:e.rect.element.marginTop,bottom:e.rect.element.marginBottom}:{top:0,bottom:0}},Nr=function(t){var e=0,n=0,r=t.ref.list,i=r.childViews[0],o=i.childViews;if(0===o.length)return{visual:e,bounds:n};var a=i.rect.element.width,s=bn(i,r.dragCoordinates),l=o[0].rect.element,c=l.marginTop+l.marginBottom,u=l.marginLeft+l.marginRight,d=l.width+u,f=l.height+c,p=void 0!==s&&s>=0?1:0,m=o.find((function(t){return t.markedForRemoval&&t.opacity<.45}))?-1:0,h=o.length+p+m,_=Math.round(a/d);return 1===_?o.forEach((function(t){var r=t.rect.element.height+c;n+=r,e+=r*t.opacity})):(n=Math.ceil(h/_)*f,e=n),{visual:e,bounds:n}},Ar=function(t){var e=t.ref.measureHeight||null;return{cappedHeight:parseInt(t.style.maxHeight,10)||null,fixedHeight:0===e?null:e}},Pr=function(t,e){var n=t.query("GET_ALLOW_REPLACE"),r=t.query("GET_ALLOW_MULTIPLE"),i=t.query("GET_TOTAL_ITEMS"),o=t.query("GET_MAX_FILES"),a=e.length;return!r&&a>1||!!(V(o=r?o:n?o:1)&&i+a>o)&&(t.dispatch("DID_THROW_MAX_FILES",{source:e,error:re("warning",0,"Max files")}),!0)},kr=function(t,e){var n=t.childViews[0];return bn(n,{left:e.scopeLeft-n.rect.element.left,top:e.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})},Lr=function(t){var e=t.query("GET_ALLOW_DROP"),n=t.query("GET_DISABLED"),r=e&&!n;if(r&&!t.ref.hopper){var i=pr(t.element,(function(e){if(Pr(t,e))return!1;var n=t.query("GET_BEFORE_DROP_FILE")||function(){return!0};return!t.query("GET_DROP_VALIDATION")||e.every((function(e){return It("ALLOW_HOPPER_ITEM",e,{query:t.query}).every((function(t){return!0===t}))&&n(e)}))}),{filterItems:function(e){var n=t.query("GET_IGNORED_FILES");return e.filter((function(t){return!Ce(t)||!n.includes(t.name.toLowerCase())}))},catchesDropsOnPage:t.query("GET_DROP_ON_PAGE"),requiresDropOnElement:t.query("GET_DROP_ON_ELEMENT")});i.onload=function(e,n){t.dispatch("ADD_ITEMS",{items:e,index:kr(t.ref.list,n),interactionMethod:at}),t.dispatch("DID_DROP",{position:n}),t.dispatch("DID_END_DRAG",{position:n})},i.ondragstart=function(e){t.dispatch("DID_START_DRAG",{position:e})},i.ondrag=Dr((function(e){t.dispatch("DID_DRAG",{position:e})})),i.ondragend=function(e){t.dispatch("DID_END_DRAG",{position:e})},t.ref.hopper=i,t.ref.drip=t.appendChildView(t.createChildView(Bn))}else!r&&t.ref.hopper&&(t.ref.hopper.destroy(),t.ref.hopper=null,t.removeChildView(t.ref.drip))},xr=function(t,e){var n=t.query("GET_ALLOW_BROWSE"),r=t.query("GET_DISABLED"),i=n&&!r;i&&!t.ref.browser?t.ref.browser=t.appendChildView(t.createChildView(An,Object.assign({},e,{onload:function(e){if(Pr(t,e))return!1;t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:st})}})),0):!i&&t.ref.browser&&(t.removeChildView(t.ref.browser),t.ref.browser=null)},Mr=function(t){var e=t.query("GET_ALLOW_PASTE"),n=t.query("GET_DISABLED"),r=e&&!n;r&&!t.ref.paster?(t.ref.paster=vr(),t.ref.paster.onload=function(e){t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:lt})}):!r&&t.ref.paster&&(t.ref.paster.destroy(),t.ref.paster=null)},Fr=A({DID_SET_ALLOW_BROWSE:function(t){var e=t.root,n=t.props;xr(e,n)},DID_SET_ALLOW_DROP:function(t){var e=t.root;Lr(e)},DID_SET_ALLOW_PASTE:function(t){var e=t.root;Mr(e)},DID_SET_DISABLED:function(t){var e=t.root,n=t.props;Lr(e),Mr(e),xr(e,n),e.query("GET_DISABLED")?e.element.dataset.disabled="disabled":e.element.removeAttribute("data-disabled")}}),Br=N({name:"root",read:function(t){var e=t.root;e.ref.measure&&(e.ref.measureHeight=e.ref.measure.offsetHeight)},create:function(t){var e=t.root,n=t.props,r=e.query("GET_ID");r&&(e.element.id=r);var i=e.query("GET_CLASS_NAME");i&&i.split(" ").forEach((function(t){e.element.classList.add(t)})),e.ref.label=e.appendChildView(e.createChildView(xn,Object.assign({},n,{translateY:null,caption:e.query("GET_LABEL_IDLE")}))),e.ref.list=e.appendChildView(e.createChildView(On,{translateY:null})),e.ref.panel=e.appendChildView(e.createChildView(_n,{name:"panel-root"})),e.ref.assistant=e.appendChildView(e.createChildView(Sr,Object.assign({},n))),e.ref.measure=ke("div"),e.ref.measure.style.height="100%",e.element.appendChild(e.ref.measure),e.ref.bounds=null,e.query("GET_STYLES").filter((function(t){return!x(t.value)})).map((function(t){var n=t.name,r=t.value;e.element.dataset[n]=r})),e.ref.widthPrevious=null,e.ref.widthUpdated=Dr((function(){e.ref.updateHistory=[],e.dispatch("DID_RESIZE_ROOT")}),250),e.ref.previousAspectRatio=null,e.ref.updateHistory=[]},write:function(t){var e=t.root,n=t.props,r=t.actions;if(Fr({root:e,props:n,actions:r}),r.filter((function(t){return/^DID_SET_STYLE_/.test(t.type)})).filter((function(t){return!x(t.data.value)})).map((function(t){var n=t.type,r=t.data,i=Or(n.substr(8).toLowerCase(),"_");e.element.dataset[i]=r.value,e.invalidateLayout()})),!e.rect.element.hidden){e.rect.element.width!==e.ref.widthPrevious&&(e.ref.widthPrevious=e.rect.element.width,e.ref.widthUpdated());var i=e.ref.bounds;i||(i=e.ref.bounds=Ar(e),e.element.removeChild(e.ref.measure),e.ref.measure=null);var o=e.ref,a=o.hopper,s=o.label,l=o.list,c=o.panel;a&&a.updateHopperState();var u=e.query("GET_PANEL_ASPECT_RATIO"),d=e.query("GET_ALLOW_MULTIPLE"),f=e.query("GET_TOTAL_ITEMS"),p=f===(d?e.query("GET_MAX_FILES")||1e6:1),m=r.find((function(t){return"DID_ADD_ITEM"===t.type}));if(p&&m){var h=m.data.interactionMethod;s.opacity=0,d?s.translateY=-40:h===ot?s.translateX=40:s.translateY=h===st?40:30}else p||(s.opacity=1,s.translateX=0,s.translateY=0);var _=Rr(e),v=Nr(e),g=s.rect.element.height,E=!d||p?0:g,y=p?l.rect.element.marginTop:0,b=0===f?0:l.rect.element.marginBottom,C=E+y+v.visual+b,T=E+y+v.bounds+b;if(l.translateY=Math.max(0,E-l.rect.element.marginTop)-_.top,u){var I=e.rect.element.width,w=I*u;u!==e.ref.previousAspectRatio&&(e.ref.previousAspectRatio=u,e.ref.updateHistory=[]);var S=e.ref.updateHistory;if(S.push(I),S.length>4)for(var O=S.length,D=O-10,R=0,N=O;N>=D;N--)if(S[N]===S[N-2]&&R++,R>=2)return;c.scalable=!1,c.height=w;var A=w-E-(b-_.bottom)-(p?y:0);v.visual>A?l.overflow=A:l.overflow=null,e.height=w}else if(i.fixedHeight){c.scalable=!1;var P=i.fixedHeight-E-(b-_.bottom)-(p?y:0);v.visual>P?l.overflow=P:l.overflow=null}else if(i.cappedHeight){var k=C>=i.cappedHeight,L=Math.min(i.cappedHeight,C);c.scalable=!0,c.height=k?L:L-_.top-_.bottom;var M=L-E-(b-_.bottom)-(p?y:0);C>i.cappedHeight&&v.visual>M?l.overflow=M:l.overflow=null,e.height=Math.min(i.cappedHeight,T-_.top-_.bottom)}else{var F=f>0?_.top+_.bottom:0;c.scalable=!0,c.height=Math.max(g,C-F),e.height=Math.max(g,T-F)}}},destroy:function(t){var e=t.root;e.ref.paster&&e.ref.paster.destroy(),e.ref.hopper&&e.ref.hopper.destroy()},mixins:{styles:["height"]}}),Gr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=null,n=St(),r=i(tt(n),[Bt,it(n)],[Pe,rt(n)]);r.dispatch("SET_OPTIONS",{options:t});var o=function(){document.hidden||r.dispatch("KICK")};document.addEventListener("visibilitychange",o);var s=null,l=!1,c=!1,u=null,d=null,f=function(){l||(l=!0),clearTimeout(s),s=setTimeout((function(){l=!1,u=null,d=null,c&&(c=!1,r.dispatch("DID_STOP_RESIZE"))}),500)};window.addEventListener("resize",f);var p=Br(r,{id:ut()}),m=!1,h=!1,_={_read:function(){l&&(d=window.innerWidth,u||(u=d),c||d===u||(r.dispatch("DID_START_RESIZE"),c=!0)),h&&m&&(m=null===p.element.offsetParent),m||(p._read(),h=p.rect.element.hidden)},_write:function(t){var e=r.processActionQueue().filter((function(t){return!/^SET_/.test(t.type)}));m&&!e.length||(b(e),m=p._write(t,e,c),_t(r.query("GET_ITEMS")),m&&r.processDispatchQueue())}},v=function(t){return function(e){var n={type:t};if(!e)return n;if(e.hasOwnProperty("error")&&(n.error=e.error?Object.assign({},e.error):null),e.status&&(n.status=Object.assign({},e.status)),e.file&&(n.output=e.file),e.source)n.file=e.source;else if(e.item||e.id){var i=e.item?e.item:r.query("GET_ITEM",e.id);n.file=i?ht(i):null}return e.items&&(n.items=e.items.map(ht)),/progress/.test(t)&&(n.progress=e.progress),n}},E={DID_DESTROY:v("destroy"),DID_INIT:v("init"),DID_THROW_MAX_FILES:v("warning"),DID_START_ITEM_LOAD:v("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:v("addfileprogress"),DID_LOAD_ITEM:v("addfile"),DID_THROW_ITEM_INVALID:[v("error"),v("addfile")],DID_THROW_ITEM_LOAD_ERROR:[v("error"),v("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[v("error"),v("removefile")],DID_PREPARE_OUTPUT:v("preparefile"),DID_START_ITEM_PROCESSING:v("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:v("processfileprogress"),DID_ABORT_ITEM_PROCESSING:v("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:v("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:v("processfiles"),DID_REVERT_ITEM_PROCESSING:v("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[v("error"),v("processfile")],DID_REMOVE_ITEM:v("removefile"),DID_UPDATE_ITEMS:v("updatefiles"),DID_ACTIVATE_ITEM:v("activatefile")},y=function(t){var e=Object.assign({pond:A},t);delete e.type,p.element.dispatchEvent(new CustomEvent("FilePond:"+t.type,{detail:e,bubbles:!0,cancelable:!0,composed:!0}));var n=[];t.hasOwnProperty("error")&&n.push(t.error),t.hasOwnProperty("file")&&n.push(t.file);var i=["type","error","file"];Object.keys(t).filter((function(t){return!i.includes(t)})).forEach((function(e){return n.push(t[e])})),A.fire.apply(A,[t.type].concat(n));var o=r.query("GET_ON"+t.type.toUpperCase());o&&o.apply(void 0,n)},b=function(t){t.length&&t.forEach((function(t){if(E[t.type]){var e=E[t.type];(Array.isArray(e)?e:[e]).forEach((function(e){setTimeout((function(){y(e(t.data))}),0)}))}}))},C=function(t){return r.dispatch("SET_OPTIONS",{options:t})},T=function(t){return r.query("GET_ACTIVE_ITEM",t)},I=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){S([{source:t,options:e}],{index:e.index}).then((function(t){return n(t&&t[0])})).catch(r)}))},w=function(t){return r.dispatch("REMOVE_ITEM",{query:t}),null===r.query("GET_ACTIVE_ITEM",t)},S=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Promise((function(t,n){var i=[],o={};if(L(e[0]))i.push.apply(i,e[0]),Object.assign(o,e[1]||{});else{var a=e[e.length-1];"object"!=typeof a||a instanceof Blob||Object.assign(o,e.pop()),i.push.apply(i,e)}r.dispatch("ADD_ITEMS",{items:i,index:o.index,interactionMethod:ot,success:t,failure:n})}))},O=function(){return r.query("GET_ACTIVE_ITEMS")},D=function(t){return new Promise((function(e,n){r.dispatch("REQUEST_ITEM_PROCESSING",{query:t,success:function(t){e(t)},failure:function(t){n(t)}})}))},R=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Array.isArray(e[0])?e[0]:e;if(!r.length){var i=O().filter((function(t){return!(t.status===vt.IDLE&&t.origin===gt.LOCAL)&&t.status!==vt.PROCESSING&&t.status!==vt.PROCESSING_COMPLETE&&t.status!==vt.PROCESSING_REVERT_ERROR}));return Promise.all(i.map(D))}return Promise.all(r.map(D))},N=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Array.isArray(e[0])?e[0]:e,i=O();if(!r.length)return Promise.all(i.map(w));var o=r.map((function(t){return g(t)?i[t]?i[t].id:null:t})).filter((function(t){return t}));return o.map(w)},A=Object.assign({},ft(),{},_,{},nt(r,n),{setOptions:C,addFile:I,addFiles:S,getFile:T,processFile:D,removeFile:w,getFiles:O,processFiles:R,removeFiles:N,sort:function(t){return r.dispatch("SORT",{compare:t})},browse:function(){var t=p.element.querySelector("input[type=file]");t&&t.click()},destroy:function(){A.fire("destroy",p.element),r.dispatch("ABORT_ALL"),p._destroy(),window.removeEventListener("resize",f),document.removeEventListener("visibilitychange",o),r.dispatch("DID_DESTROY")},insertBefore:function(t){return P(p.element,t)},insertAfter:function(t){return k(p.element,t)},appendTo:function(t){return t.appendChild(p.element)},replaceElement:function(t){P(p.element,t),t.parentNode.removeChild(t),e=t},restoreElement:function(){e&&(k(e,p.element),p.element.parentNode.removeChild(p.element),e=null)},isAttachedTo:function(t){return p.element===t||e===t},element:{get:function(){return p.element}},status:{get:function(){return r.query("GET_STATUS")}}});return r.dispatch("DID_INIT"),a(A)},Ur=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};o(St(),(function(t,n){e[t]=n[0]}));var n=Gr(Object.assign({},e,{},t));return n},qr=function(t){return Or(t.replace(/^data-/,""))},Hr=function t(e,n){o(n,(function(n,r){o(e,(function(t,i){var o=new RegExp(n);if(o.test(t)&&(delete e[t],!1!==r))if(U(r))e[r]=i;else{var a,s=r.group;X(r)&&!e[s]&&(e[s]={}),e[s][(a=t.replace(o,""),a.charAt(0).toLowerCase()+a.slice(1))]=i}})),r.mapping&&t(e[r.group],r.mapping)}))},$r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];o(t.attributes,(function(e){n.push(t.attributes[e])}));var r=n.filter((function(t){return t.name})).reduce((function(e,n){var r=s(t,n.name);return e[qr(n.name)]=r===n.name||r,e}),{});return Hr(r,e),r},Vr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};It("SET_ATTRIBUTE_TO_OPTION_MAP",n);var r=Object.assign({},e),i=$r("FIELDSET"===t.nodeName?t.querySelector("input[type=file]"):t,n);Object.keys(i).forEach((function(t){X(i[t])?(X(r[t])||(r[t]={}),Object.assign(r[t],i[t])):r[t]=i[t]})),r.files=(e.files||[]).concat(Array.from(t.querySelectorAll("input:not([type=file])")).map((function(t){return{source:t.value,options:{type:t.dataset.type}}})));var o=Ur(r);return t.files&&Array.from(t.files).forEach((function(t){o.addFile(t)})),o.replaceElement(t),o},jr=function(){return r(arguments.length<=0?void 0:arguments[0])?Vr.apply(void 0,arguments):Ur.apply(void 0,arguments)},zr=["fire","_read","_write"],Yr=function(t){var e={};return pt(t,e,zr),e},Wr=function(t,e){return t.replace(/(?:{([a-zA-Z]+)})/g,(function(t,n){return e[n]}))},Xr=function(t){var e=new Blob(["(",t.toString(),")()"],{type:"application/javascript"}),n=URL.createObjectURL(e),r=new Worker(n);return{transfer:function(t,e){},post:function(t,e,n){var i=ut();r.onmessage=function(t){t.data.id===i&&e(t.data.message)},r.postMessage({id:i,message:t},n)},terminate:function(){r.terminate(),URL.revokeObjectURL(n)}}},Kr=function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){e(r)},r.onerror=function(t){n(t)},r.src=t}))},Qr=function(t,e){var n=t.slice(0,t.size,t.type);return n.lastModifiedDate=t.lastModifiedDate,n.name=e,n},Zr=function(t){return Qr(t,t.name)},Jr=[],ti=function(t){if(!Jr.includes(t)){Jr.push(t);var e,n=t({addFilter:wt,utils:{Type:bt,forin:o,isString:U,isFile:Ce,toNaturalFileSize:Ge,replaceInString:Wr,getExtensionFromFilename:Ht,getFilenameWithoutExtension:ye,guesstimateMimeType:Hn,getFileFromBlob:zt,getFilenameFromURL:qt,createRoute:A,createWorker:Xr,createView:N,createItemAPI:ht,loadImage:Kr,copyFile:Zr,renameFile:Qr,createBlob:Yt,applyFilterChain:Tt,text:Le,getNumericAspectRatioFromString:Rt},views:{fileActionButton:Be}});e=n.options,Object.assign(Ot,e)}},ei=(tn="undefined"!=typeof window&&void 0!==window.document&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"slice"in Blob.prototype&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window,function(){return tn}),ni={apps:[]},ri=function(){};if(t.Status={},t.FileStatus={},t.FileOrigin={},t.OptionTypes={},t.create=ri,t.destroy=ri,t.parse=ri,t.find=ri,t.registerPlugin=ri,t.getOptions=ri,t.setOptions=ri,ei()){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,r="__framePainter";if(window[r])return window[r].readers.push(t),void window[r].writers.push(e);window[r]={readers:[t],writers:[e]};var i=window[r],o=1e3/n,a=null,s=null,l=null,c=null,u=function(){document.hidden?(l=function(){return window.setTimeout((function(){return d(performance.now())}),o)},c=function(){return window.clearTimeout(s)}):(l=function(){return window.requestAnimationFrame(d)},c=function(){return window.cancelAnimationFrame(s)})};document.addEventListener("visibilitychange",(function(){c&&c(),u(),d(performance.now())}));var d=function t(e){s=l(t),a||(a=e);var n=e-a;n<=o||(a=e-n%o,i.readers.forEach((function(t){return t()})),i.writers.forEach((function(t){return t(e)})))};u(),d(performance.now())}((function(){ni.apps.forEach((function(t){return t._read()}))}),(function(t){ni.apps.forEach((function(e){return e._write(t)}))}));var ii=function e(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:ei,create:t.create,destroy:t.destroy,parse:t.parse,find:t.find,registerPlugin:t.registerPlugin,setOptions:t.setOptions}})),document.removeEventListener("DOMContentLoaded",e)};"loading"!==document.readyState?setTimeout((function(){return ii()}),0):document.addEventListener("DOMContentLoaded",ii);var oi=function(){return o(St(),(function(e,n){t.OptionTypes[e]=n[1]}))};t.Status=Object.assign({},At),t.FileOrigin=Object.assign({},gt),t.FileStatus=Object.assign({},vt),t.OptionTypes={},oi(),t.create=function(){var e=jr.apply(void 0,arguments);return e.on("destroy",t.destroy),ni.apps.push(e),Yr(e)},t.destroy=function(t){var e=ni.apps.findIndex((function(e){return e.isAttachedTo(t)}));return e>=0&&(ni.apps.splice(e,1)[0].restoreElement(),!0)},t.parse=function(e){return Array.from(e.querySelectorAll(".filepond")).filter((function(t){return!ni.apps.find((function(e){return e.isAttachedTo(t)}))})).map((function(e){return t.create(e)}))},t.find=function(t){var e=ni.apps.find((function(e){return e.isAttachedTo(t)}));return e?Yr(e):null},t.registerPlugin=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(ti),oi()},t.getOptions=function(){var t={};return o(St(),(function(e,n){t[e]=n[0]})),t},t.setOptions=function(e){return X(e)&&(ni.apps.forEach((function(t){t.setOptions(e)})),function(t){o(t,(function(t,e){Ot[t]&&(Ot[t][0]=Z(e,Ot[t][0],Ot[t][1]))}))}(e)),t.getOptions()}}t.supported=ei,Object.defineProperty(t,"__esModule",{value:!0})}(e)},y8fO:function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},yDsy:function(t,e,n){"use strict";n.r(e);var r={props:{single:{type:Boolean,required:!1,default:!1},story:{type:Object,required:!0,default:function(){}}},methods:{remove:function(){var t=this;axios.delete(this.story.url_delete).then((function(e){t.$toasted.success(t.__("Deleted")),t.single?window.location="/":window.location.reload()})).catch((function(e){console.log(e),t.$toasted.error(t.__("Can't delete"))}))}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card card--story mb-4",class:{"card-single":t.single,"card-index":!t.single}},[n("div",{staticClass:"card-body"},[n("h5",{staticClass:"card-title"},[t.story.is_pinned&&!t.single?n("i",{staticClass:"fas fa-thumbtack fa-sm pr-1"}):t._e(),t._v(" "),n("span",[t._v(t._s(t.__("Story")))]),t._v(" — "),n("a",{attrs:{href:t.story.url}},[t._v(t._s(t.story.title))])]),t._v(" "),n("div",{staticClass:"card-content"},[n("viewer",{attrs:{value:t.story.content}})],1),t._v(" "),t.story.tags.length>0?n("p",{staticClass:"card-text mt-1"},t._l(t.story.tags,(function(e){return n("a",{staticClass:"badge badge-secondary mr-1",attrs:{href:"/tag/"+e}},[t._v(t._s(e))])})),0):t._e()]),t._v(" "),n("div",{staticClass:"card-footer d-flex justify-content-between"},[n("span",[t.story.is_private?n("i",{staticClass:"fas fa-lock pr-2"}):t._e(),t._v(t._s(t.story.date_formated))]),t._v(" "),n("div",{staticClass:"dropdown"},[n("button",{staticClass:"btn btn-outline-dark btn-sm dropdown-toggle",attrs:{type:"button",id:"dropdownMenuButton","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",dusk:"story-card-more"}},[t._v("\n "+t._s(t.__("More"))+"\n ")]),t._v(" "),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuButton"}},[n("a",{staticClass:"dropdown-item",attrs:{href:t.story.url,dusk:"story-card-permalink"}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink"))+"\n ")]),t._v(" "),t.story.editable?n("h6",{staticClass:"dropdown-header"},[t._v(t._s(t.__("Manage")))]):t._e(),t._v(" "),t.story.editable?n("a",{staticClass:"dropdown-item",attrs:{dusk:"story-card-temp-share"},on:{click:function(e){return t.$bus.$emit("share",t.story)}}},[n("i",{staticClass:"fas fa-share-square fa-fw mr-1"}),t._v(" "+t._s(t.__("Temp sharing"))+"\n ")]):t._e(),t._v(" "),t.story.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.story.url_edit,dusk:"story-card-edit"}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit"))+"\n ")]):t._e(),t._v(" "),t.story.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:"<i class='fas fa-trash-alt fa-fw mr-1'></i> "+t.__("Delete"),"text-confirm":"<i class='fas fa-check fa-fw mr-1'></i> "+t.__("Confirm"),dusk:"story-card-remove"},on:{confirmed:t.remove}}):t._e()],1)])])])}),[],!1,null,null,null);e.default=o.exports},yLpj:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},zV0C:function(t,e,n){"use strict";n.r(e);var r={props:{url:{type:String,required:!0}},data:function(){return{name:"Shaare",width:600,height:390}},mounted:function(){},computed:{options:function(){return"menubar=no,height=".concat(this.height,",width=").concat(this.width,",toolbar=no,scrollbars=no,status=no,dialog=1")},script:function(){return"javascript:(function(){var url=location.href; window.open('".concat(this.url,"?url=' + encodeURIComponent(url), '_blank', '").concat(this.options,"');})();")}}},i=n("KHd+"),o=Object(i.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"card"},[n("div",{staticClass:"card-body"},[n("h5",{staticClass:"card-title"},[t._v(t._s(t.__("Rapid share")))]),t._v(" "),n("p",{staticClass:"card-text"},[t._v(t._s(t.__("Configure your rapid share button and drag it to your bookmarks menu.")))]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"name"}},[t._v(t._s(t.__("Name")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],staticClass:"form-control",attrs:{type:"text",id:"name",maxlength:"40"},domProps:{value:t.name},on:{input:function(e){e.target.composing||(t.name=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"width"}},[t._v(t._s(t.__("Width")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.width,expression:"width"}],staticClass:"form-control",attrs:{type:"number",id:"width"},domProps:{value:t.width},on:{input:function(e){e.target.composing||(t.width=e.target.value)}}})])]),t._v(" "),n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:"height"}},[t._v(t._s(t.__("Height")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.height,expression:"height"}],staticClass:"form-control",attrs:{type:"number",id:"height"},domProps:{value:t.height},on:{input:function(e){e.target.composing||(t.height=e.target.value)}}})])])]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",[t._v(t._s(t.__("Share button")))]),n("br"),t._v(" "),n("a",{staticClass:"btn btn-outline-primary",attrs:{href:t.script},domProps:{textContent:t._s(t.name)}})])])])}),[],!1,null,null,null);e.default=o.exports}},[[0,1,2]]]);