diff --git a/app/Http/Controllers/Api/ChestController.php b/app/Http/Controllers/Api/ChestController.php index 60033c5..dabdfb3 100644 --- a/app/Http/Controllers/Api/ChestController.php +++ b/app/Http/Controllers/Api/ChestController.php @@ -27,6 +27,7 @@ class ChestController extends Controller ])->toArray()); $post = new Post(['is_private' => true, 'user_id' => $request->user()->id]); + $post->is_pinned = $data; $post->postable()->associate($chest)->save(); if ($data['tags']) { @@ -47,6 +48,7 @@ class ChestController extends Controller $data = collect($request->validated()); $chest->fill($data->only('title', 'content')->toArray()); + $chest->post->is_pinned = $data->get('is_pinned', $chest->post->is_pinned); if ($data['tags']) { $chest->post->syncTags($data['tags']); diff --git a/app/Http/Controllers/Api/LinkController.php b/app/Http/Controllers/Api/LinkController.php index 6cba72e..0505574 100644 --- a/app/Http/Controllers/Api/LinkController.php +++ b/app/Http/Controllers/Api/LinkController.php @@ -58,7 +58,8 @@ class LinkController extends Controller $link->updatePreview(); $post = new Post(); - $post->is_private = $data->get('is_private', 0); + $post->is_pinned = $data; + $post->is_private = $data; $post->user_id = $request->user()->id; $post->postable()->associate($link)->save(); @@ -83,6 +84,7 @@ class LinkController extends Controller $link->fill($data->only('title', 'content', 'url')->toArray()); $link->updatePreview(); + $link->post->is_pinned = $data->get('is_pinned', $link->post->is_pinned); $link->post->is_private = $data->get('is_private', $link->post->is_private); $link->post->save(); diff --git a/app/Http/Controllers/Api/StoryController.php b/app/Http/Controllers/Api/StoryController.php index 2d6af0e..92dfe10 100644 --- a/app/Http/Controllers/Api/StoryController.php +++ b/app/Http/Controllers/Api/StoryController.php @@ -28,7 +28,8 @@ class StoryController extends Controller ])->toArray()); $post = new Post(); - $post->is_private = $data->get('is_private', 0); + $post->is_pinned = $data; + $post->is_private = $data; $post->user_id = $request->user()->id; $post->postable()->associate($story)->save(); @@ -50,6 +51,7 @@ class StoryController extends Controller $data = collect($request->validated()); $story->fill($data->only('title', 'slug', 'content')->toArray()); + $story->post->is_pinned = $data->get('is_pinned', $story->post->is_pinned); $story->post->is_private = $data->get('is_private', $story->post->is_private); if ($data['tags']) { diff --git a/app/Http/Controllers/BrowseController.php b/app/Http/Controllers/BrowseController.php index 7656b62..2907bc4 100644 --- a/app/Http/Controllers/BrowseController.php +++ b/app/Http/Controllers/BrowseController.php @@ -22,6 +22,7 @@ class BrowseController extends Controller } $posts = $posts->withPrivate($request) + ->pinnedFirst() ->latest() ->paginate(20); @@ -87,6 +88,7 @@ class BrowseController extends Controller $tag = Tag::named($tag)->firstOrFail(); $posts = Post::withPrivate($request) + ->pinnedFirst() ->with('postable', 'tags') ->withAllTags($tag) ->paginate(20); diff --git a/app/Http/Requests/StoreChestRequest.php b/app/Http/Requests/StoreChestRequest.php index a302048..da99bd6 100644 --- a/app/Http/Requests/StoreChestRequest.php +++ b/app/Http/Requests/StoreChestRequest.php @@ -22,6 +22,9 @@ class StoreChestRequest extends FormRequest 'content' => [ 'array', ], + 'is_pinned' => [ + 'nullable', + ], 'tags' => [ 'nullable', 'array', diff --git a/app/Http/Requests/StoreLinkRequest.php b/app/Http/Requests/StoreLinkRequest.php index 666feab..ee105a7 100644 --- a/app/Http/Requests/StoreLinkRequest.php +++ b/app/Http/Requests/StoreLinkRequest.php @@ -30,6 +30,9 @@ class StoreLinkRequest extends FormRequest 'is_private' => [ 'nullable', ], + 'is_pinned' => [ + 'nullable', + ], 'tags' => [ 'nullable', 'array', diff --git a/app/Http/Requests/StoreStoryRequest.php b/app/Http/Requests/StoreStoryRequest.php index e0e0665..4137b9d 100644 --- a/app/Http/Requests/StoreStoryRequest.php +++ b/app/Http/Requests/StoreStoryRequest.php @@ -37,6 +37,9 @@ class StoreStoryRequest extends FormRequest 'is_private' => [ 'nullable', ], + 'is_pinned' => [ + 'nullable', + ], 'tags' => [ 'nullable', 'array', diff --git a/app/Http/Resources/ChestResource.php b/app/Http/Resources/ChestResource.php index 62ec5d7..683ac10 100644 --- a/app/Http/Resources/ChestResource.php +++ b/app/Http/Resources/ChestResource.php @@ -15,6 +15,7 @@ class ChestResource extends JsonResource 'url' => $this->permalink, 'permalink' => $this->permalink, 'is_private' => true, + 'is_pinned' => $this->post->is_pinned, 'date_formated' => $this->created_at->diffForHumans(), 'tags' => $this->post->tags->pluck('name')->toArray(), $this->mergeWhen(Auth::check(), [ diff --git a/app/Http/Resources/LinkResource.php b/app/Http/Resources/LinkResource.php index e9d4bc0..80d0e7e 100644 --- a/app/Http/Resources/LinkResource.php +++ b/app/Http/Resources/LinkResource.php @@ -15,6 +15,7 @@ class LinkResource extends JsonResource 'url' => $this->url, 'permalink' => $this->permalink, 'is_private' => $this->post->is_private, + 'is_pinned' => $this->post->is_pinned, 'preview' => $this->preview, 'date_formated' => $this->created_at->diffForHumans(), 'tags' => $this->post->tags->pluck('name')->toArray(), diff --git a/app/Http/Resources/PostResource.php b/app/Http/Resources/PostResource.php index bbf8009..13ca8c5 100644 --- a/app/Http/Resources/PostResource.php +++ b/app/Http/Resources/PostResource.php @@ -39,6 +39,7 @@ class PostResource extends JsonResource 'postable_id' => $this->postable->id, 'tags' => $this->tags->pluck('name')->toArray(), 'is_private' => $this->is_private, + 'is_pinned' => $this->is_pinned, 'created_at' => $this->created_at, ]); } diff --git a/app/Http/Resources/StoryResource.php b/app/Http/Resources/StoryResource.php index 9effdb8..72ad7cd 100644 --- a/app/Http/Resources/StoryResource.php +++ b/app/Http/Resources/StoryResource.php @@ -15,6 +15,7 @@ class StoryResource extends JsonResource 'content' => $this->content, 'url' => $this->url, 'is_private' => $this->post->is_private, + 'is_pinned' => $this->post->is_pinned, 'date_formated' => $this->created_at->diffForHumans(), 'tags' => $this->post->tags->pluck('name')->toArray(), $this->mergeWhen(Auth::check(), [ diff --git a/app/Post.php b/app/Post.php index c6d1df0..645e884 100644 --- a/app/Post.php +++ b/app/Post.php @@ -9,9 +9,11 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Http\Request; +use Illuminate\Support\Collection; use Laravel\Scout\Searchable; /** + * @method Builder|Post pinnedFirst() * @method Builder|Post withPrivate(bool|User|Request $private) * @method Builder|Post withoutChests() */ @@ -24,10 +26,12 @@ class Post extends Model 'postable_type', 'postable_id', 'is_private', + 'is_pinned', 'user_id', 'created_at', ]; protected $casts = [ + 'is_pinned' => 'bool', 'is_private' => 'bool', ]; @@ -51,6 +55,24 @@ class Post extends Model return $this->created_at->diffForHumans(); } + public function setIsPinnedAttribute($value): void + { + if ($value instanceof Collection) { + $value = (bool)$value->get('is_pinned', false); + } + + $this->attributes['is_pinned'] = $value; + } + + public function setIsPrivateAttribute($value): void + { + if ($value instanceof Collection) { + $value = (bool)$value->get('is_private', false); + } + + $this->attributes['is_private'] = $value; + } + public function scopeWithPrivate(Builder $query, $user = null): Builder { if ($user instanceof Request) { @@ -74,6 +96,11 @@ class Post extends Model return $query; } + public function scopePinnedFirst(Builder $query): Builder + { + return $query->orderByDesc('is_pinned'); + } + public function scopeWithoutChests(Builder $query): Builder { return $query->where('postable_type', '!=', Chest::class); diff --git a/changelog.md b/changelog.md index 61b3c37..a2becc2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +# Unreleased + +⚠️ Run migrations when updating + +## Added + +- Pinned posts + # 1.2.20 ⚠️ Run migrations when updating diff --git a/database/factories/PostFactory.php b/database/factories/PostFactory.php index ef289a5..5705bdd 100644 --- a/database/factories/PostFactory.php +++ b/database/factories/PostFactory.php @@ -10,6 +10,7 @@ use Faker\Generator as Faker; $factory->define(Post::class, function (Faker $faker) { return [ 'is_private' => 0, + 'is_pinned' => 0, 'user_id' => 1, ]; }); diff --git a/database/migrations/2019_10_22_190000_add_is_pinned_to_posts_table.php b/database/migrations/2019_10_22_190000_add_is_pinned_to_posts_table.php new file mode 100644 index 0000000..dce98c6 --- /dev/null +++ b/database/migrations/2019_10_22_190000_add_is_pinned_to_posts_table.php @@ -0,0 +1,22 @@ +boolean('is_pinned')->index()->default(false)->after('is_private'); + }); + } + + public function down() + { + Schema::table('posts', function (Blueprint $table) { + $table->dropColumn('is_pinned'); + }); + } +} diff --git a/public/js/app.js b/public/js/app.js index fa40d98..a512f54 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"+fAT":function(t,e,n){var r={"./components/ChestCard.vue":"MX7w","./components/ChestForm.vue":"0O8z","./components/ChestLines.vue":"0TP3","./components/Confirm.vue":"cNyC","./components/Flash.vue":"tEIc","./components/LinkCard.vue":"kuJz","./components/LinkForm.vue":"ugYh","./components/Loader.vue":"S4HP","./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/Tags.vue":"4dkW","./components/TempSharing.vue":"FT2k","./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"},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:[],tags:[]},loading:!1}},mounted:function(){this.chest&&(this.form=this.chest)},methods:{submit:function(){var t=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(e){t.chest?(t.$toasted.success(t.__("Chest updated"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.loading=!1):(t.$toasted.success(t.__("Chest created"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.reset())}).catch(function(e){t.loading=!1,t.setFormError(e),t.setHttpError(e),t.toastHttpError(t.__("Unable to save chest"))})},reset:function(){this.loading=!1,this.form={title:"",content:[],tags:[]},this.resetFormError()}}},s=n("KHd+"),a=Object(s.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("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("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 ")]),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=a.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("z6Vu"),n("KHd+")),s=Object(o.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[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:"","text-confirm":""},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=s.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("bIMO"),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,tags:[]},loading:!1,editor:{minHeight:"300px",language:"fr_FR",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(){var t=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(e){t.story?(t.$toasted.success(t.__("Story updated"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.loading=!1):(t.$toasted.success(t.__("Story created"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.reset())}).catch(function(e){t.loading=!1,t.setFormError(e),t.setHttpError(e),t.toastHttpError(t.__("Unable to save story"))})},reset:function(){this.loading=!1,this.form={title:"",slug:"",content:"",is_private:!1,tags:[]},this.resetFormError()}},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,"")}}},s=n("KHd+"),a=Object(s.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",previewStyle:"vertical",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:"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"}},[t._v(t._s(t.__("Private story?")))])])]),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("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 ")]),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=a.exports},"8oxB":function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(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:s}catch(t){r=s}}();var l,c=[],u=!1,d=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&h())}function h(){if(!u){var t=a(f);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d1)for(var n=1;n0&&document.getSelection().getRangeAt(0);r.select(),r.setSelectionRange(0,999999),document.execCommand("copy"),document.body.removeChild(r),s&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(s)),r.contentEditable=i,r.readOnly=o}}}},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var i,o=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},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(n){e.$toasted.success(e.__("User :name has been deleted",{name:t.name})),e.fetch()}).catch(function(t){"error"===t.response.data.status?e.$toasted.error(t.response.data.message):e.$toasted.error(e.__("Unable to delete user")),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"},[t._v("\n "+t._s(t.__("Users"))+"\n "),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=[])}}},s=n("KHd+"),a=Object(s.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=a.exports},GYWy:function(t,e,n){(function(t,r){var i;!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,l=2147483647,c=36,u=1,d=26,f=38,h=700,p=72,m=128,v="-",_=/^xn--/,g=/[^\x20-\x7E]/,C=/[\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,w=Math.floor,E=String.fromCharCode;function x(t){throw new RangeError(y[t])}function S(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function k(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+S((t=t.replace(C,".")).split("."),e).join(".")}function N(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=E((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=E(t)}).join("")}function D(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function F(t,e,n){var r=0;for(t=n?w(t/h):t>>1,t+=w(t/e);t>b*d>>1;r+=c)t=w(t/b);return w(r+(b+1)*t/(t+f))}function A(t){var e,n,r,i,o,s,a,f,h,_,g,C=[],y=t.length,b=0,E=m,S=p;for((n=t.lastIndexOf(v))<0&&(n=0),r=0;r=128&&x("not-basic"),C.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=y&&x("invalid-input"),((f=(g=t.charCodeAt(i++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:c)>=c||f>w((l-b)/s))&&x("overflow"),b+=f*s,!(f<(h=a<=S?u:a>=S+d?d:a-S));a+=c)s>w(l/(_=c-h))&&x("overflow"),s*=_;S=F(b-o,e=C.length+1,0==o),w(b/e)>l-E&&x("overflow"),E+=w(b/e),b%=e,C.splice(b++,0,E)}return T(C)}function O(t){var e,n,r,i,o,s,a,f,h,_,g,C,y,b,S,k=[];for(C=(t=N(t)).length,e=m,n=0,o=p,s=0;s=e&&gw((l-n)/(y=r+1))&&x("overflow"),n+=(a-e)*y,e=a,s=0;sl&&x("overflow"),g==e){for(f=n,h=c;!(f<(_=h<=o?u:h>=o+d?d:h-o));h+=c)S=f-_,b=c-_,k.push(E(D(_+S%b,0))),f=w(S/b);k.push(E(D(f,0))),o=F(n,y,r==i),n=0,++r}++n,++e}return k.join("")}a={version:"1.4.1",ucs2:{decode:N,encode:T},decode:A,encode:O,toASCII:function(t){return k(t,function(t){return g.test(t)?"xn--"+O(t):t})},toUnicode:function(t){return k(t,function(t){return _.test(t)?A(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return a}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n("YuTi")(t),n("yLpj"))},Hgwo:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.flip-list-move {\n transition: transform 0.5s;\n}\n.no-move {\n transition: transform 0s;\n}\n.ghost {\n opacity: 0.5;\n background: #c8ebfb;\n}\n",""])},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(o).concat([i]).join("\n")}var s;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i0},hasPostsResults:function(){return this.results.hasOwnProperty("posts")&&this.results.posts.length>0}},watch:{query:_.debounce(function(t){t&&t.length>=3&&this.search(t)},200)}},i=(n("y2TL"),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 position-relative mb-0"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"input",staticClass:"form-control w-100",attrs:{type:"search",placeholder:t.__("Type / to search")},domProps:{value:t.query},on:{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.redirect(e))}],input:function(e){e.target.composing||(t.query=e.target.value)}}}),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.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 t.hasTagsResults?n("a",{staticClass:"btn btn-primary btn-sm mr-1",attrs:{href:e.url}},[t._v("\n "+t._s(e.name)+"\n ")]):t._e()}),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},"KHd+":function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){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),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):i&&(l=a?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={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.__("Chest :name has been deleted",{name:t.chest.title})),t.single?window.location="/":window.location.reload()}).catch(function(e){t.$toasted.error(t.__("Unable to delete chest"))})}}},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--chest mb-4",class:{"card-single":t.single,"card-index":!t.single}},[n("div",{staticClass:"card-body"},[n("h5",{staticClass:"card-title"},[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"}},[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}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink")))]),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",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")))]):t._e(),t._v(" "),t.chest.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.chest.url_edit}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit")))]):t._e(),t._v(" "),t.chest.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Delete"),"text-confirm":" "+t.__("Confirm")},on:{confirmed:t.remove}}):t._e()],1)])])])},[],!1,null,null,null);e.default=o.exports},NyNk:function(t,e,n){"use strict";n.r(e);var r={mixins:[n("1IHE").a],data:function(){return{tags:[],loading:!0}},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){console.log(t)}))},remove:function(t){var e=this;this.loading=!0,axios.delete("/api/manage/tags/".concat(t.name)).then(function(n){e.$toasted.success(e.__("Tag :name has been deleted",{name:t.name})),e.fetch()}).catch(function(t){console.log(t)})}}},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"},[t._v(t._s(t.__("Tags")))]),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("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",{staticClass:"w-25"},[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"},[n("a",{attrs:{href:e.url}},[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"},[n("select",{staticClass:"form-control 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]/},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"))},VmmN:function(t,e,n){var r=n("Hgwo");"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,i);r.locals&&(t.exports=r.locals)},VuFy:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,".results {\n z-index: 500;\n position: absolute;\n top: 40px;\n width: calc(100% - 2rem);\n display: none;\n}\n.results.active {\n display: block;\n}\n.results .list-group-item {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n}\n.results .list-group-item div:first-child > span {\n text-transform: uppercase;\n}",""])},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,s,a,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(){p(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){p(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(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n0&&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.length0&&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",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},"aET+":function(t,e,n){var r,i,o={},s=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),a=function(t,e){return e?e.querySelector(t):document.querySelector(t)},l=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var r=a.call(this,t,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),c=null,u=0,d=[],f=n("9tPo");function h(t,e){for(var n=0;n=0&&d.splice(e,1)}function _(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return g(e,t.attrs),m(t,e),e}function g(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function C(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var s=u++;n=c||(c=_(e)),r=w.bind(null,n,s,!1),i=w.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),m(t,e),e}(e),r=x.bind(null,n,e),i=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=_(e),r=E.bind(null,n),i=function(){v(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=p(t,e);return h(n,e),function(t){for(var r=[],i=0;i({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 f.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),p.indexOf(t)>-1&&this.$emit("input",this.editor.getValue())),n}}},v=n("KHd+"),_=Object(v.a)(m,function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"tuiEditor"})},[],!1,null,null,null).exports,g={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=f.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}}},C=Object(v.a)(g,function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"tuiEditorViewer"})},[],!1,null,null,null).exports,y=n("x9sl"),b=n("MQ60"),w=n.n(b);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 E=document.head.querySelector('meta[name="csrf-token"]');E?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=E.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token");var x=document.head.querySelector('meta[name="api-token"]');x&&(window.axios.defaults.headers.common.Authorization="Bearer "+x.content),window.Vue=n("XuX8"),Vue.mixin(i.a),Vue.use(s),Vue.use(l.a,{position:"top-center",duration:5e3}),Vue.component("multiselect",u.a),Vue.component("editor",_),Vue.component("viewer",C),Vue.directive("on-clickaway",y.directive),Vue.component("draggable",w.a);var S=n("+fAT");S.keys().map(function(t){return Vue.component(t.split("/").pop().split(".")[0],S(t).default)});new Vue({el:"#app"})},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.user?(t.$toasted.success(t.__("User updated")),t.loading=!1):(t.$toasted.success(t.__("User created")),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.__("Unable to save user")),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+"),s=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=s.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]/},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},kXRC:function(t,e,n){var r=n("qMx3");"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,i);r.locals&&(t.exports=r.locals)},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.__("Link :name has been deleted",{name:t.link.title})),t.single?window.location="/":window.location.reload()}).catch(function(e){t.$toasted.error(t.__("Unable to delete link"))})},preview:function(){var t=this;axios.put(this.link.url_preview).then(function(e){t.$toasted.success(t.__("Link preview has been updated")),window.location.reload()}).catch(function(e){t.$toasted.error(t.__("Unable to update link preview"))})}},computed:{displayUrl:function(){var t=this.link.url;if(t.length>65){var e=t.substr(0,62);return"".concat(e,"...")}return t}}},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"},[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"}},[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}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink")))]),t._v(" "),t.link.url_download?n("a",{staticClass:"dropdown-item",attrs:{href:t.link.url_download}},[n("i",{staticClass:"fas fa-file-download fa-fw mr-1"}),t._v(" "+t._s(t.__("Download archive")))]):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:{href:t.link.url_archive}},[n("i",{staticClass:"fas fa-archive fa-fw mr-1"}),t._v(" "+t._s(t.__("Manage archive")))]):t._e(),t._v(" "),t.link.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Update preview"),"text-confirm":" "+t.__("Confirm")},on:{confirmed:t.preview}}):t._e(),t._v(" "),t.link.editable?n("a",{staticClass:"dropdown-item",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")))]):t._e(),t._v(" "),t.link.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.link.url_edit}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit")))]):t._e(),t._v(" "),t.link.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Delete"),"text-confirm":" "+t.__("Confirm")},on:{confirmed:t.remove}}):t._e()],1)])])])},[],!1,null,null,null);e.default=o.exports},p7ys:function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},pyCd:function(t,e){},qMx3:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,".multiselect__tags {\n border-color: #ced4da;\n border-radius: 0;\n}\n.multiselect__tags .multiselect__tag {\n margin-bottom: 0;\n}",""])},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===P&&!!ut[t.nodeName]}function o(t){switch(t.nodeType){case R:return ft;case P:case I:if(it&&mt.has(t))return mt.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,s)?ct.test(t.nodeName)?ft:ht:pt,it&&mt.set(t,e),e}function s(t){return o(t)===ft}function a(t){return o(t)===ht}function l(t){return o(t)===pt}function c(t,e){var n=new r(e,$,a);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 h(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 p(t,e,n,r){for(;t&&t!==e;){if(h(t,n,r))return t;t=t.parentNode}return null}function m(t,e){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function v(t){var e=t.nodeType;return e===P||e===I?t.childNodes.length:t.length||0}function _(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 C(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,s,a,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(s=0,a=i.length;sl?n.startOffset-=1:n.startOffset===l&&(n.startContainer=i,n.startOffset=v(i))),n.endContainer===e&&(n.endOffset>l?n.endOffset-=1:n.endOffset===l&&(n.endContainer=i,n.endOffset=v(i))),_(r),r.nodeType===R?i.appendData(r.data):c.push(C(r));else if(r.nodeType===P){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 S(t){var e=t.nodeName;return"TD"===e||"TH"===e||"TR"===e||"TBODY"===e||"THEAD"===e}function k(t,e,n,r){var i,o,s,a=e;if(!S(t)||!S(e)){for(;(i=a.parentNode)&&i!==r&&i.nodeType===P&&1===i.childNodes.length;)a=i;_(a),s=t.childNodes.length,(o=t.lastChild)&&"BR"===o.nodeName&&(t.removeChild(o),s-=1),t.appendChild(C(e)),n.setStart(t,s),n.collapse(!0),x(t,n),Z&&(o=t.lastChild)&&"BR"===o.nodeName&&t.removeChild(o)}}function N(t,e){var n,r,i=t.previousSibling,o=t.firstChild,s=t.ownerDocument,a="LI"===t.nodeName;if((!a||o&&/^[OU]L$/.test(o.nodeName))&&!S(t))if(i&&f(i,t)&&i.isContentEditable&&t.isContentEditable){if(!l(i)){if(!a)return;(r=y(s,"DIV")).appendChild(C(i)),i.appendChild(r)}_(t),n=!l(t),i.appendChild(C(t)),n&&w(i,e),o&&N(o,e)}else a&&(i=y(s,"DIV"),t.insertBefore(i,o),b(i,e))}function T(t){this.isShiftDown=t.shiftKey}function D(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?D(t[r],i,n):i);return t}function F(t,e){t.nodeType===U&&(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",O),this.addEventListener("touchstart",O),this.addEventListener("focus",B),this._awaitingPaste=!1,this.addEventListener(G?"beforecut":"cut",Xt),this.addEventListener("copy",Qt),this.addEventListener("keydown",T),this.addEventListener("keyup",T),this.addEventListener(G?"beforepaste":"paste",Jt),this.addEventListener("drop",te),this.addEventListener(Z?"keypress":"keydown",Ot),this._keyHandlers=Object.create(Rt),this.setConfig(e),G&&(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 O(){this._restoreSelection=!1}function B(){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,s(r)){if(r.nodeType===R||"BR"===r.nodeName||"IMG"===r.nodeName){n.appendChild(r);continue}}else if(a(r)){n.appendChild(t.createDefaultBlock([L(t,r,t._doc.createDocumentFragment())]));continue}L(t,r,n)}return n}var P=1,R=3,U=9,I=11,$=1,M="​",H=e.defaultView,j=navigator.userAgent,q=/Android/.test(j),z=/iP(?:ad|hone|od)/.test(j),K=/Mac OS X/.test(j),V=/Windows NT/.test(j),W=/Gecko\//.test(j),G=/Trident\/[456]\./.test(j),Z=!!H.opera,Y=/Edge\//.test(j),X=!Y&&/WebKit\//.test(j),Q=/Trident\/[4567]\./.test(j),J=K?"meta-":"ctrl-",tt=G||Z,et=G||X,nt=G,rt="undefined"!=typeof MutationObserver,it="undefined"!=typeof WeakMap,ot=/[^ \t\r\n]/,st=Array.prototype.indexOf;Object.create||(Object.create=function(t){var e=function(){};return e.prototype=t,new e});var at={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(at[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(at[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(at[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,ht=2,pt=3,mt=it?new WeakMap:null,vt=function(t,e){for(var n=t.childNodes;e&&t.nodeType===P;)e=(n=(t=n[e-1]).childNodes).length;return t},_t=function(t,e){if(t.nodeType===P){var n=t.childNodes;if(e-1,o=t.compareBoundaryPoints(1,r)<1;return!i&&!o}var s=t.compareBoundaryPoints(0,r)<1,a=t.compareBoundaryPoints(2,r)>-1;return s&&a},Et=function(t){for(var e,n=t.startContainer,r=t.startOffset,o=t.endContainer,s=t.endOffset,a=!0;n.nodeType!==R&&(e=n.childNodes[r])&&!i(e);)n=e,r=0;if(s)for(;o.nodeType!==R;){if(!(e=o.childNodes[s-1])||i(e)){if(a&&e&&"BR"===e.nodeName){s-=1,a=!1;continue}break}s=v(o=e)}else for(;o.nodeType!==R&&(e=o.firstChild)&&!i(e);)o=e;t.collapsed?(t.setStart(o,s),t.setEnd(n,r)):(t.setStart(n,r),t.setEnd(o,s))},xt=function(t,e,n,r){var i,o=t.startContainer,s=t.startOffset,a=t.endContainer,l=t.endOffset,c=!0;for(e||(e=t.commonAncestorContainer),n||(n=e);!s&&o!==e&&o!==r;)i=o.parentNode,s=st.call(i.childNodes,o),o=i;for(;c&&a.nodeType!==R&&a.childNodes[l]&&"BR"===a.childNodes[l].nodeName&&(l+=1,c=!1),a!==n&&a!==r&&l===v(a);)i=a.parentNode,l=st.call(i.childNodes,a)+1,a=i;t.setStart(o,s),t.setEnd(a,l)},St=function(t,e){var n,r=t.startContainer;return s(r)?n=u(r,e):r!==e&&a(r)?n=r:n=d(n=vt(r,t.startOffset),e),n&&wt(t,n,!0)?n:null},kt=function(t,e){var n,r,i=t.endContainer;if(s(i))n=u(i,e);else if(i!==e&&a(i))n=i;else{if(!(n=_t(i,t.endOffset))||!m(e,n))for(n=e;r=n.lastChild;)n=r;n=u(n,e)}return n&&wt(t,n,!0)?n:null},Nt=new r(null,4|$,function(t){return t.nodeType===R?ot.test(t.data):"IMG"===t.nodeName}),Tt=function(t,e){var n,r=t.startContainer,i=t.startOffset;if(Nt.root=null,r.nodeType===R){if(i)return!1;n=r}else if((n=_t(r,i))&&!m(e,n)&&(n=null),!n&&((n=vt(r,i)).nodeType===R&&n.length))return!1;return Nt.currentNode=n,Nt.root=St(t,e),!Nt.previousNode()},Dt=function(t,e){var n,r=t.endContainer,i=t.endOffset;if(Nt.root=null,r.nodeType===R){if((n=r.data.length)&&i-1||!W&&st.call(i,"text/plain")>-1&&st.call(i,"text/rtf")<0))return t.preventDefault(),void(!l&&(o=s.getData("text/html"))?this.insertHTML(o,!0):((o=s.getData("text/plain"))||(o=s.getData("text/uri-list")))&&this.insertPlainText(o,!0));this._awaitingPaste=!0;var h=this._doc.body,p=this.getSelection(),m=p.startContainer,v=p.startOffset,g=p.endContainer,C=p.endOffset,y=this.createElement("DIV",{contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"});h.appendChild(y),p.selectNodeContents(y),this.setSelection(p),setTimeout(function(){try{f._awaitingPaste=!1;for(var t,e,n="",r=y;y=r;)r=y.nextSibling,_(y),(t=y.firstChild)&&t===y.lastChild&&"DIV"===t.nodeName&&(y=t),n+=y.innerHTML;e=f.createRange(m,v,g,C),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=F.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=D({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=M,gt(t,e),r=e.getBoundingClientRect(),(n=e.parentNode).removeChild(e),x(n,t)),r},ee._moveCursorTo=function(t){var e=this._root,n=this.createRange(e,t?0:e.childNodes.length);return Et(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(q&&!this._restoreSelection)A.call(this),this.blur(),this.focus();else{z&&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),s=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&&m(s,t.commonAncestorContainer)?this._lastSelection=t:m((r=(t=this._lastSelection).commonAncestorContainer).ownerDocument,r)||(t=null),t||(t=this.createRange(s.firstChild,0)),t},ee.getSelectedText=function(){var t=this.getSelection();if(!t||t.collapsed)return"";var e,n=new r(t.commonAncestorContainer,4|$,function(e){return wt(t,e,!0)}),i=t.startContainer,o=t.endContainer,a=n.currentNode=i,l="",c=!1;for(n.filter(a)||(a=n.nextNode());a;)a.nodeType===R?(e=a.data)&&/\S/.test(e)&&(a===o&&(e=e.slice(0,t.endOffset)),a===i&&(e=e.slice(t.startOffset)),l+=e,c=!0):("BR"===a.nodeName||c&&!s(a))&&(l+="\n",c=!1),a=n.nextNode();return l},ee.getPath=function(){return this._path};var oe=function(t,e){for(var n,i,o,a=new r(t,4);i=a.nextNode();)for(;(o=i.data.indexOf(M))>-1&&(!e||i.parentNode!==e);){if(1===i.length){do{(n=i.parentNode).removeChild(i),i=n,a.currentNode=n}while(s(i)&&!v(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,s,a,l,c="";return e&&e!==n&&(c=t(e.parentNode,n,r),e.nodeType===P&&(c+=(c?">":"")+e.nodeName,(i=e.id)&&(c+="#"+i),(o=e.className.trim())&&((s=o.split(/\s\s*/)).sort(),c+=".",c+=s.join(".")),(a=e.dir)&&(c+="[dir="+a+"]"),s&&(l=r.classNames,st.call(s,l.highlight)>-1&&(c+="[backgroundColor="+e.style.backgroundColor.replace(/ /g,"")+"]"),st.call(s,l.colour)>-1&&(c+="[color="+e.style.color.replace(/ /g,"")+"]"),st.call(s,l.fontFamily)>-1&&(c+="[fontFamily="+e.style.fontFamily.replace(/ /g,"")+"]"),st.call(s,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(Q){try{this._root.setActive()}catch(t){}this.fireEvent("focus")}else this._root.focus();return this},ee.blur=function(){return this._root.blur(),Q&&this.fireEvent("blur"),this};var se="squire-selection-end";ee._saveRangeToBookmark=function(t){var e,n=this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),r=this.createElement("INPUT",{id:se,type:"hidden"});gt(t,n),t.collapse(!1),gt(t,r),2&n.compareDocumentPosition(r)&&(n.id=se,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("#"+se);if(n&&r){var i=n.parentNode,o=r.parentNode,s=st.call(i.childNodes,n),a=st.call(o.childNodes,r);i===o&&(a-=1),_(n),_(r),t||(t=this._doc.createRange()),t.setStart(i,s),t.setEnd(o,a),x(i,t),i!==o&&x(o,t),t.collapsed&&((i=t.startContainer).nodeType===R&&((o=i.childNodes[t.startOffset])&&o.nodeType===R||(o=i.childNodes[t.startOffset-1]),o&&o.nodeType===R&&(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&&(mt=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,s=o.documentSizeThreshold,a=o.undoLimit;e||(r+=1),r-1&&2*n.length>s&&a>-1&&r>a&&(i.splice(0,r-a),r=a,this._undoStackLength=a),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+1u&&d.splitText(u),d===a&&c&&(d=d.splitText(c),l===a&&(l=d,u-=c),a=d,c=0),g(d,i=this.createElement(t,e)),i.appendChild(d))}while(o.nextNode());l.nodeType!==R&&(d.nodeType===R?(l=d,u=d.length):(l=d.parentNode,u=1)),n=this.createRange(a,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(M),this._didAddZWS()):i=o.createTextNode(""),gt(n,i));for(var a=n.commonAncestorContainer;s(a);)a=a.parentNode;var l=n.startContainer,c=n.startOffset,u=n.endContainer,d=n.endOffset,f=[],p=function(t,e){if(!wt(n,t,!1)){var r,i,o=t.nodeType===R;if(!wt(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,p(r,e)}},m=Array.prototype.filter.call(a.getElementsByTagName(t),function(r){return wt(n,r,!0)&&h(r,t,e)});return r||m.forEach(function(t){p(t,t)}),f.forEach(function(t){var e=t[0].cloneNode(!1),n=t[1];g(n,e),e.appendChild(n)}),m.forEach(function(t){g(t,C(t))}),this._getRangeAndRemoveBookmark(n),i&&n.collapse(!1),x(a,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 ae={DT:"DD",DD:"DT",LI:"LI",PRE:"PRE"},le=function(t,e,n,r){var i=ae[e.nodeName],o=null,s=E(n,r,e.parentNode,t._root),a=t._config;return i||(i=a.blockTag,o=a.blockAttributes),h(s,i,o)||(e=y(s.ownerDocument,i,o),s.dir&&(e.dir=s.dir),g(s,e),e.appendChild(C(s)),s=e),s};ee.forEachBlock=function(t,e,n){if(!n&&!(n=this.getSelection()))return this;e&&this.saveUndoState(n);var r=this._root,i=St(n,r),o=kt(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 Ft(e,r),xt(e,r,r,r),n=Ct(e,r,r),gt(e,t.call(this,n)),e.endOffset]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))|([\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,}\b)(?:\?[^&?\s]+=[^&?\s]+(?:&[^&?\s]+=[^&?\s]+)*)?/i;var he=function(t,e,n){var i,o,s,a,l,c,u,d=t.ownerDocument,f=new r(t,4,function(t){return!p(t,e,"A")}),h=n.linkRegExp,m=n._config.tagAttributes.a;if(h)for(;i=f.nextNode();)for(o=i.data,s=i.parentNode;a=h.exec(o);)c=(l=a.index)+a[0].length,l&&(u=d.createTextNode(o.slice(0,l)),s.insertBefore(u,i)),(u=n.createElement("A",D({href:a[1]?/^(?:ht|f)tps?:/i.test(a[1])?a[1]:"http://"+a[1]:"mailto:"+a[0]},m,!1))).textContent=o.slice(l,c),s.insertBefore(u,i),i.data=o=o.slice(c)};ee.insertHTML=function(t,e){var n,r,i,o,s,a,l,c=this._config,u=c.isInsertedHTMLSanitized?c.sanitizeToDOMFragment:null,f=this.getSelection(),h=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=""+t+""),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(t)&&(t=""+t+"
"),(i=this.createElement("DIV")).innerHTML=t,(o=h.createDocumentFragment()).appendChild(C(i))),this.saveUndoState(f);try{for(s=this._root,a=o,l={fragment:o,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},he(o,o,this),Kt(o,c),Zt(o,s,!1),Vt(o),o.normalize();a=d(a,o);)b(a,s);e&&this.fireEvent("willPaste",l),l.defaultPrevented||(bt(f,l.fragment,s),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 pe=function(t){return t.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")};ee.insertPlainText=function(t,e){var n=this.getSelection();if(n.collapsed&&p(n.startContainer,this._root,"PRE")){var r,i,o=n.startContainer,s=n.startOffset;return o&&o.nodeType===R||(r=this._doc.createTextNode(""),o.insertBefore(r,o.childNodes[s]),o=r,s=0),i={text:t,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},e&&this.fireEvent("willPaste",i),i.defaultPrevented||(t=i.text,o.insertData(s,t),n.setStart(o,s+t.length),n.collapse(!0)),this.setSelection(n),this}var a,l,c,u,d=t.split("\n"),f=this._config,h=f.blockTag,m=f.blockAttributes,v="",_="<"+h;for(a in m)_+=" "+a+'="'+pe(m[a])+'"';for(_+=">",l=0,c=d.length;l")+v;return this.insertHTML(d.join(""),e)};var me=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=me("changeFormat",{tag:"B"}),ee.italic=me("changeFormat",{tag:"I"}),ee.underline=me("changeFormat",{tag:"U"}),ee.strikethrough=me("changeFormat",{tag:"S"}),ee.subscript=me("changeFormat",{tag:"SUB"},{tag:"SUP"}),ee.superscript=me("changeFormat",{tag:"SUP"},{tag:"SUB"}),ee.removeBold=me("changeFormat",null,{tag:"B"}),ee.removeItalic=me("changeFormat",null,{tag:"I"}),ee.removeUnderline=me("changeFormat",null,{tag:"U"}),ee.removeStrikethrough=me("changeFormat",null,{tag:"S"}),ee.removeSubscript=me("changeFormat",null,{tag:"SUB"}),ee.removeSuperscript=me("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=D(D({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 ve=function(t){for(var e,n=this._root,i=this._doc,o=i.createDocumentFragment(),s=c(t,n);e=s.nextNode();){var a,l,u=e.querySelectorAll("BR"),d=[],f=u.length;for(a=0;a-1;)s.appendChild(l.createTextNode(o.slice(0,a))),s.appendChild(l.createElement("BR")),o=o.slice(a+1);i.parentNode.insertBefore(s,i),i.data=o}w(e,c),g(e,C(e))}return t};ee.code=function(){var t=this.getSelection();return t.collapsed||l(t.commonAncestorContainer)?this.modifyBlocks(ve,t):this.changeFormat({tag:"CODE",attributes:this._config.tagAttributes.code},null,t),this.focus()},ee.removeCode=function(){var t=this.getSelection();return p(t.commonAncestorContainer,this._root,"PRE")?this.modifyBlocks(_e,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&&!a(n);)n=n.parentNode;if(n||(Ft(t,e),n=e),n.nodeType===R)return this;this.saveUndoState(t),xt(t,n,n,e);for(var r,i,o=n.ownerDocument,s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,d=o.createDocumentFragment(),f=o.createDocumentFragment(),h=E(c,u,n,e),p=E(s,l,n,e);p!==h;)r=p.nextSibling,d.appendChild(p),p=r;return L(this,d,f),f.normalize(),p=f.firstChild,r=f.lastChild,i=n.childNodes,p?(n.insertBefore(f,h),l=st.call(i,p),u=st.call(i,r)+1):u=l=st.call(i,h),t.setStart(n,l),t.setEnd(n,u),x(n,t),Et(t),this.setSelection(t),this._updatePath(t,!0),this.focus()},ee.increaseQuoteLevel=me("modifyBlocks",function(t){return this.createElement("BLOCKQUOTE",this._config.tagAttributes.blockquote,[t])}),ee.decreaseQuoteLevel=me("modifyBlocks",ce),ee.makeUnorderedList=me("modifyBlocks",function(t){return de(this,t,"UL"),t}),ee.makeOrderedList=me("modifyBlocks",function(t){return de(this,t,"OL"),t}),ee.removeList=me("modifyBlocks",function(t){var e,n,r,i,o,s=t.querySelectorAll("UL, OL"),l=t.querySelectorAll("LI"),c=this._root;for(e=0,n=s.length;e0&&void 0!==arguments[0]&&arguments[0];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){t.link?(t.$toasted.success(t.__("Link updated"),{action:{text:t.__("Show"),href:n.data.post.url}}),t.loading=!1):(t.$toasted.success(t.__("Link created"),{action:{text:t.__("Show"),href:n.data.post.url}}),t.reset()),!0===e&&(window.location="/link/archive/".concat(n.data.post.postable_id))}).catch(function(e){t.loading=!1,t.setFormError(e),t.setHttpError(e),t.toastHttpError(t.__("Unable to save link"))})},reset:function(){this.loading=!1,this.parsing=!1,this.form={url:null,title:null,content:null,is_private:!1,tags:[]},this.resetFormError()},newTag:function(t){this.tags.push(t),this.form.tags.push(t)}},watch:{"form.url":_.debounce(function(t){t&&!this.link&&this.parse(t)},500)}},s=n("KHd+"),a=Object(s.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:"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.__("Private link?")))])])]),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("button",{staticClass:"btn btn-primary",attrs:{disabled:t.loading,dusk:"link-form-save"},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 ")]),t._v(" "),n("button",{staticClass:"btn btn-outline-primary",attrs:{disabled:t.loading},on:{click:function(e){return e.preventDefault(),t.submit(!0)}}},[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 then archive"))+"\n ")]),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)])},[],!1,null,null,null);e.default=a.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:""}},data:function(){return{show:!1}},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.show=!1,t.deleteModal()}),t.$emit("opened")})},deleteModal:function(){$("#".concat(this.id)).modal("dispose"),this.$emit("closed")}},watch:{open:function(t){this.show=t},show: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.show?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("span",{attrs:{"aria-hidden":"true"}},[this._v("×")])])}],!1,null,null,null);e.default=o.exports},y2TL:function(t,e,n){"use strict";var r=n("IYry");n.n(r).a},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.__("Story :name has been deleted",{name:t.story.title})),t.single?window.location="/":window.location.reload()}).catch(function(e){console.log(e),t.$toasted.error(t.__("Unable to delete story"))})}}},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"},[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"}},[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}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink")))]),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",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")))]):t._e(),t._v(" "),t.story.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.story.url_edit}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit")))]):t._e(),t._v(" "),t.story.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Delete"),"text-confirm":" "+t.__("Confirm")},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},z6Vu:function(t,e,n){"use strict";var r=n("VmmN");n.n(r).a},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]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"+fAT":function(t,e,n){var r={"./components/ChestCard.vue":"MX7w","./components/ChestForm.vue":"0O8z","./components/ChestLines.vue":"0TP3","./components/Confirm.vue":"cNyC","./components/Flash.vue":"tEIc","./components/LinkCard.vue":"kuJz","./components/LinkForm.vue":"ugYh","./components/Loader.vue":"S4HP","./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/Tags.vue":"4dkW","./components/TempSharing.vue":"FT2k","./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"},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(){var t=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(e){t.chest?(t.$toasted.success(t.__("Chest updated"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.loading=!1):(t.$toasted.success(t.__("Chest created"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.reset())}).catch(function(e){t.loading=!1,t.setFormError(e),t.setHttpError(e),t.toastHttpError(t.__("Unable to save chest"))})},reset:function(){this.loading=!1,this.form={title:"",content:[],is_pinned:!1,tags:[]},this.resetFormError()}}},s=n("KHd+"),a=Object(s.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("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 ")]),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=a.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("z6Vu"),n("KHd+")),s=Object(o.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[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:"","text-confirm":""},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=s.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("bIMO"),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:"fr_FR",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(){var t=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(e){t.story?(t.$toasted.success(t.__("Story updated"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.loading=!1):(t.$toasted.success(t.__("Story created"),{action:{text:t.__("Show"),href:e.data.post.url}}),t.reset())}).catch(function(e){t.loading=!1,t.setFormError(e),t.setHttpError(e),t.toastHttpError(t.__("Unable to save story"))})},reset:function(){this.loading=!1,this.form={title:"",slug:"",content:"",is_private:!1,is_pinned:!1,tags:[]},this.resetFormError()}},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,"")}}},s=n("KHd+"),a=Object(s.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",previewStyle:"vertical",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:"link-form-private"}},[t._v(t._s(t.__("Private link?")))])])])]),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",{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("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 ")]),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=a.exports},"8oxB":function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(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:s}catch(t){r=s}}();var l,c=[],u=!1,d=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&h())}function h(){if(!u){var t=a(f);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d1)for(var n=1;n0&&document.getSelection().getRangeAt(0);r.select(),r.setSelectionRange(0,999999),document.execCommand("copy"),document.body.removeChild(r),s&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(s)),r.contentEditable=i,r.readOnly=o}}}},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var i,o=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},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(n){e.$toasted.success(e.__("User :name has been deleted",{name:t.name})),e.fetch()}).catch(function(t){"error"===t.response.data.status?e.$toasted.error(t.response.data.message):e.$toasted.error(e.__("Unable to delete user")),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"},[t._v("\n "+t._s(t.__("Users"))+"\n "),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=[])}}},s=n("KHd+"),a=Object(s.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=a.exports},GYWy:function(t,e,n){(function(t,r){var i;!function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,l=2147483647,c=36,u=1,d=26,f=38,h=700,p=72,m=128,_="-",v=/^xn--/,g=/[^\x20-\x7E]/,C=/[\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,w=Math.floor,E=String.fromCharCode;function x(t){throw new RangeError(y[t])}function k(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+k((t=t.replace(C,".")).split("."),e).join(".")}function N(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=E((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=E(t)}).join("")}function D(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function F(t,e,n){var r=0;for(t=n?w(t/h):t>>1,t+=w(t/e);t>b*d>>1;r+=c)t=w(t/b);return w(r+(b+1)*t/(t+f))}function A(t){var e,n,r,i,o,s,a,f,h,v,g,C=[],y=t.length,b=0,E=m,k=p;for((n=t.lastIndexOf(_))<0&&(n=0),r=0;r=128&&x("not-basic"),C.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=y&&x("invalid-input"),((f=(g=t.charCodeAt(i++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:c)>=c||f>w((l-b)/s))&&x("overflow"),b+=f*s,!(f<(h=a<=k?u:a>=k+d?d:a-k));a+=c)s>w(l/(v=c-h))&&x("overflow"),s*=v;k=F(b-o,e=C.length+1,0==o),w(b/e)>l-E&&x("overflow"),E+=w(b/e),b%=e,C.splice(b++,0,E)}return T(C)}function O(t){var e,n,r,i,o,s,a,f,h,v,g,C,y,b,k,S=[];for(C=(t=N(t)).length,e=m,n=0,o=p,s=0;s=e&&gw((l-n)/(y=r+1))&&x("overflow"),n+=(a-e)*y,e=a,s=0;sl&&x("overflow"),g==e){for(f=n,h=c;!(f<(v=h<=o?u:h>=o+d?d:h-o));h+=c)k=f-v,b=c-v,S.push(E(D(v+k%b,0))),f=w(k/b);S.push(E(D(f,0))),o=F(n,y,r==i),n=0,++r}++n,++e}return S.join("")}a={version:"1.4.1",ucs2:{decode:N,encode:T},decode:A,encode:O,toASCII:function(t){return S(t,function(t){return g.test(t)?"xn--"+O(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 a}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n("YuTi")(t),n("yLpj"))},Hgwo:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.flip-list-move {\n transition: transform 0.5s;\n}\n.no-move {\n transition: transform 0s;\n}\n.ghost {\n opacity: 0.5;\n background: #c8ebfb;\n}\n",""])},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(o).concat([i]).join("\n")}var s;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i0},hasPostsResults:function(){return this.results.hasOwnProperty("posts")&&this.results.posts.length>0}},watch:{query:_.debounce(function(t){t&&t.length>=3&&this.search(t)},200)}},i=(n("y2TL"),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 position-relative mb-0"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"input",staticClass:"form-control w-100",attrs:{type:"search",placeholder:t.__("Type / to search")},domProps:{value:t.query},on:{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.redirect(e))}],input:function(e){e.target.composing||(t.query=e.target.value)}}}),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.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 t.hasTagsResults?n("a",{staticClass:"btn btn-primary btn-sm mr-1",attrs:{href:e.url}},[t._v("\n "+t._s(e.name)+"\n ")]):t._e()}),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},"KHd+":function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){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),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):i&&(l=a?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={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.__("Chest :name has been deleted",{name:t.chest.title})),t.single?window.location="/":window.location.reload()}).catch(function(e){t.$toasted.error(t.__("Unable to delete chest"))})}}},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--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"}},[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}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink")))]),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",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")))]):t._e(),t._v(" "),t.chest.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.chest.url_edit}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit")))]):t._e(),t._v(" "),t.chest.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Delete"),"text-confirm":" "+t.__("Confirm")},on:{confirmed:t.remove}}):t._e()],1)])])])},[],!1,null,null,null);e.default=o.exports},NyNk:function(t,e,n){"use strict";n.r(e);var r={mixins:[n("1IHE").a],data:function(){return{tags:[],loading:!0}},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){console.log(t)}))},remove:function(t){var e=this;this.loading=!0,axios.delete("/api/manage/tags/".concat(t.name)).then(function(n){e.$toasted.success(e.__("Tag :name has been deleted",{name:t.name})),e.fetch()}).catch(function(t){console.log(t)})}}},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"},[t._v(t._s(t.__("Tags")))]),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("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",{staticClass:"w-25"},[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"},[n("a",{attrs:{href:e.url}},[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"},[n("select",{staticClass:"form-control 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]/},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"))},VmmN:function(t,e,n){var r=n("Hgwo");"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,i);r.locals&&(t.exports=r.locals)},VuFy:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,".results {\n z-index: 500;\n position: absolute;\n top: 40px;\n width: calc(100% - 2rem);\n display: none;\n}\n.results.active {\n display: block;\n}\n.results .list-group-item {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n}\n.results .list-group-item div:first-child > span {\n text-transform: uppercase;\n}",""])},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,s,a,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(){p(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){p(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(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n0&&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.length0&&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",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},"aET+":function(t,e,n){var r,i,o={},s=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),a=function(t,e){return e?e.querySelector(t):document.querySelector(t)},l=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var r=a.call(this,t,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),c=null,u=0,d=[],f=n("9tPo");function h(t,e){for(var n=0;n=0&&d.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return g(e,t.attrs),m(t,e),e}function g(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function C(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var s=u++;n=c||(c=v(e)),r=w.bind(null,n,s,!1),i=w.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),m(t,e),e}(e),r=x.bind(null,n,e),i=function(){_(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=E.bind(null,n),i=function(){_(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=p(t,e);return h(n,e),function(t){for(var r=[],i=0;i({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 f.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),p.indexOf(t)>-1&&this.$emit("input",this.editor.getValue())),n}}},_=n("KHd+"),v=Object(_.a)(m,function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"tuiEditor"})},[],!1,null,null,null).exports,g={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=f.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}}},C=Object(_.a)(g,function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"tuiEditorViewer"})},[],!1,null,null,null).exports,y=n("x9sl"),b=n("MQ60"),w=n.n(b);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 E=document.head.querySelector('meta[name="csrf-token"]');E?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=E.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token");var x=document.head.querySelector('meta[name="api-token"]');x&&(window.axios.defaults.headers.common.Authorization="Bearer "+x.content),window.Vue=n("XuX8"),Vue.mixin(i.a),Vue.use(s),Vue.use(l.a,{position:"top-center",duration:5e3}),Vue.component("multiselect",u.a),Vue.component("editor",v),Vue.component("viewer",C),Vue.directive("on-clickaway",y.directive),Vue.component("draggable",w.a);var k=n("+fAT");k.keys().map(function(t){return Vue.component(t.split("/").pop().split(".")[0],k(t).default)});new Vue({el:"#app"})},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.user?(t.$toasted.success(t.__("User updated")),t.loading=!1):(t.$toasted.success(t.__("User created")),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.__("Unable to save user")),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+"),s=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=s.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]/},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},kXRC:function(t,e,n){var r=n("qMx3");"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,i);r.locals&&(t.exports=r.locals)},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.__("Link :name has been deleted",{name:t.link.title})),t.single?window.location="/":window.location.reload()}).catch(function(e){t.$toasted.error(t.__("Unable to delete link"))})},preview:function(){var t=this;axios.put(this.link.url_preview).then(function(e){t.$toasted.success(t.__("Link preview has been updated")),window.location.reload()}).catch(function(e){t.$toasted.error(t.__("Unable to update link preview"))})}},computed:{displayUrl:function(){var t=this.link.url;if(t.length>65){var e=t.substr(0,62);return"".concat(e,"...")}return t}}},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"}},[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}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink")))]),t._v(" "),t.link.url_download?n("a",{staticClass:"dropdown-item",attrs:{href:t.link.url_download}},[n("i",{staticClass:"fas fa-file-download fa-fw mr-1"}),t._v(" "+t._s(t.__("Download archive")))]):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:{href:t.link.url_archive}},[n("i",{staticClass:"fas fa-archive fa-fw mr-1"}),t._v(" "+t._s(t.__("Manage archive")))]):t._e(),t._v(" "),t.link.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Update preview"),"text-confirm":" "+t.__("Confirm")},on:{confirmed:t.preview}}):t._e(),t._v(" "),t.link.editable?n("a",{staticClass:"dropdown-item",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")))]):t._e(),t._v(" "),t.link.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.link.url_edit}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit")))]):t._e(),t._v(" "),t.link.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Delete"),"text-confirm":" "+t.__("Confirm")},on:{confirmed:t.remove}}):t._e()],1)])])])},[],!1,null,null,null);e.default=o.exports},p7ys:function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},pyCd:function(t,e){},qMx3:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,".multiselect__tags {\n border-color: #ced4da;\n border-radius: 0;\n}\n.multiselect__tags .multiselect__tag {\n margin-bottom: 0;\n}",""])},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===P&&!!ut[t.nodeName]}function o(t){switch(t.nodeType){case R:return ft;case P:case $:if(it&&mt.has(t))return mt.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,s)?ct.test(t.nodeName)?ft:ht:pt,it&&mt.set(t,e),e}function s(t){return o(t)===ft}function a(t){return o(t)===ht}function l(t){return o(t)===pt}function c(t,e){var n=new r(e,I,a);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 h(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 p(t,e,n,r){for(;t&&t!==e;){if(h(t,n,r))return t;t=t.parentNode}return null}function m(t,e){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function _(t){var e=t.nodeType;return e===P||e===$?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 C(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,s,a,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(s=0,a=i.length;sl?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===R?i.appendData(r.data):c.push(C(r));else if(r.nodeType===P){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 k(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,s,a=e;if(!k(t)||!k(e)){for(;(i=a.parentNode)&&i!==r&&i.nodeType===P&&1===i.childNodes.length;)a=i;v(a),s=t.childNodes.length,(o=t.lastChild)&&"BR"===o.nodeName&&(t.removeChild(o),s-=1),t.appendChild(C(e)),n.setStart(t,s),n.collapse(!0),x(t,n),Z&&(o=t.lastChild)&&"BR"===o.nodeName&&t.removeChild(o)}}function N(t,e){var n,r,i=t.previousSibling,o=t.firstChild,s=t.ownerDocument,a="LI"===t.nodeName;if((!a||o&&/^[OU]L$/.test(o.nodeName))&&!k(t))if(i&&f(i,t)&&i.isContentEditable&&t.isContentEditable){if(!l(i)){if(!a)return;(r=y(s,"DIV")).appendChild(C(i)),i.appendChild(r)}v(t),n=!l(t),i.appendChild(C(t)),n&&w(i,e),o&&N(o,e)}else a&&(i=y(s,"DIV"),t.insertBefore(i,o),b(i,e))}function T(t){this.isShiftDown=t.shiftKey}function D(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?D(t[r],i,n):i);return t}function F(t,e){t.nodeType===U&&(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",O),this.addEventListener("touchstart",O),this.addEventListener("focus",B),this._awaitingPaste=!1,this.addEventListener(G?"beforecut":"cut",Xt),this.addEventListener("copy",Qt),this.addEventListener("keydown",T),this.addEventListener("keyup",T),this.addEventListener(G?"beforepaste":"paste",Jt),this.addEventListener("drop",te),this.addEventListener(Z?"keypress":"keydown",Ot),this._keyHandlers=Object.create(Rt),this.setConfig(e),G&&(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 O(){this._restoreSelection=!1}function B(){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,s(r)){if(r.nodeType===R||"BR"===r.nodeName||"IMG"===r.nodeName){n.appendChild(r);continue}}else if(a(r)){n.appendChild(t.createDefaultBlock([L(t,r,t._doc.createDocumentFragment())]));continue}L(t,r,n)}return n}var P=1,R=3,U=9,$=11,I=1,M="​",H=e.defaultView,j=navigator.userAgent,q=/Android/.test(j),z=/iP(?:ad|hone|od)/.test(j),K=/Mac OS X/.test(j),V=/Windows NT/.test(j),W=/Gecko\//.test(j),G=/Trident\/[456]\./.test(j),Z=!!H.opera,Y=/Edge\//.test(j),X=!Y&&/WebKit\//.test(j),Q=/Trident\/[4567]\./.test(j),J=K?"meta-":"ctrl-",tt=G||Z,et=G||X,nt=G,rt="undefined"!=typeof MutationObserver,it="undefined"!=typeof WeakMap,ot=/[^ \t\r\n]/,st=Array.prototype.indexOf;Object.create||(Object.create=function(t){var e=function(){};return e.prototype=t,new e});var at={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(at[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(at[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(at[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,ht=2,pt=3,mt=it?new WeakMap:null,_t=function(t,e){for(var n=t.childNodes;e&&t.nodeType===P;)e=(n=(t=n[e-1]).childNodes).length;return t},vt=function(t,e){if(t.nodeType===P){var n=t.childNodes;if(e-1,o=t.compareBoundaryPoints(1,r)<1;return!i&&!o}var s=t.compareBoundaryPoints(0,r)<1,a=t.compareBoundaryPoints(2,r)>-1;return s&&a},Et=function(t){for(var e,n=t.startContainer,r=t.startOffset,o=t.endContainer,s=t.endOffset,a=!0;n.nodeType!==R&&(e=n.childNodes[r])&&!i(e);)n=e,r=0;if(s)for(;o.nodeType!==R;){if(!(e=o.childNodes[s-1])||i(e)){if(a&&e&&"BR"===e.nodeName){s-=1,a=!1;continue}break}s=_(o=e)}else for(;o.nodeType!==R&&(e=o.firstChild)&&!i(e);)o=e;t.collapsed?(t.setStart(o,s),t.setEnd(n,r)):(t.setStart(n,r),t.setEnd(o,s))},xt=function(t,e,n,r){var i,o=t.startContainer,s=t.startOffset,a=t.endContainer,l=t.endOffset,c=!0;for(e||(e=t.commonAncestorContainer),n||(n=e);!s&&o!==e&&o!==r;)i=o.parentNode,s=st.call(i.childNodes,o),o=i;for(;c&&a.nodeType!==R&&a.childNodes[l]&&"BR"===a.childNodes[l].nodeName&&(l+=1,c=!1),a!==n&&a!==r&&l===_(a);)i=a.parentNode,l=st.call(i.childNodes,a)+1,a=i;t.setStart(o,s),t.setEnd(a,l)},kt=function(t,e){var n,r=t.startContainer;return s(r)?n=u(r,e):r!==e&&a(r)?n=r:n=d(n=_t(r,t.startOffset),e),n&&wt(t,n,!0)?n:null},St=function(t,e){var n,r,i=t.endContainer;if(s(i))n=u(i,e);else if(i!==e&&a(i))n=i;else{if(!(n=vt(i,t.endOffset))||!m(e,n))for(n=e;r=n.lastChild;)n=r;n=u(n,e)}return n&&wt(t,n,!0)?n:null},Nt=new r(null,4|I,function(t){return t.nodeType===R?ot.test(t.data):"IMG"===t.nodeName}),Tt=function(t,e){var n,r=t.startContainer,i=t.startOffset;if(Nt.root=null,r.nodeType===R){if(i)return!1;n=r}else if((n=vt(r,i))&&!m(e,n)&&(n=null),!n&&((n=_t(r,i)).nodeType===R&&n.length))return!1;return Nt.currentNode=n,Nt.root=kt(t,e),!Nt.previousNode()},Dt=function(t,e){var n,r=t.endContainer,i=t.endOffset;if(Nt.root=null,r.nodeType===R){if((n=r.data.length)&&i-1||!W&&st.call(i,"text/plain")>-1&&st.call(i,"text/rtf")<0))return t.preventDefault(),void(!l&&(o=s.getData("text/html"))?this.insertHTML(o,!0):((o=s.getData("text/plain"))||(o=s.getData("text/uri-list")))&&this.insertPlainText(o,!0));this._awaitingPaste=!0;var h=this._doc.body,p=this.getSelection(),m=p.startContainer,_=p.startOffset,g=p.endContainer,C=p.endOffset,y=this.createElement("DIV",{contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"});h.appendChild(y),p.selectNodeContents(y),this.setSelection(p),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(m,_,g,C),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=F.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=D({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=M,gt(t,e),r=e.getBoundingClientRect(),(n=e.parentNode).removeChild(e),x(n,t)),r},ee._moveCursorTo=function(t){var e=this._root,n=this.createRange(e,t?0:e.childNodes.length);return Et(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(q&&!this._restoreSelection)A.call(this),this.blur(),this.focus();else{z&&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),s=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&&m(s,t.commonAncestorContainer)?this._lastSelection=t:m((r=(t=this._lastSelection).commonAncestorContainer).ownerDocument,r)||(t=null),t||(t=this.createRange(s.firstChild,0)),t},ee.getSelectedText=function(){var t=this.getSelection();if(!t||t.collapsed)return"";var e,n=new r(t.commonAncestorContainer,4|I,function(e){return wt(t,e,!0)}),i=t.startContainer,o=t.endContainer,a=n.currentNode=i,l="",c=!1;for(n.filter(a)||(a=n.nextNode());a;)a.nodeType===R?(e=a.data)&&/\S/.test(e)&&(a===o&&(e=e.slice(0,t.endOffset)),a===i&&(e=e.slice(t.startOffset)),l+=e,c=!0):("BR"===a.nodeName||c&&!s(a))&&(l+="\n",c=!1),a=n.nextNode();return l},ee.getPath=function(){return this._path};var oe=function(t,e){for(var n,i,o,a=new r(t,4);i=a.nextNode();)for(;(o=i.data.indexOf(M))>-1&&(!e||i.parentNode!==e);){if(1===i.length){do{(n=i.parentNode).removeChild(i),i=n,a.currentNode=n}while(s(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,s,a,l,c="";return e&&e!==n&&(c=t(e.parentNode,n,r),e.nodeType===P&&(c+=(c?">":"")+e.nodeName,(i=e.id)&&(c+="#"+i),(o=e.className.trim())&&((s=o.split(/\s\s*/)).sort(),c+=".",c+=s.join(".")),(a=e.dir)&&(c+="[dir="+a+"]"),s&&(l=r.classNames,st.call(s,l.highlight)>-1&&(c+="[backgroundColor="+e.style.backgroundColor.replace(/ /g,"")+"]"),st.call(s,l.colour)>-1&&(c+="[color="+e.style.color.replace(/ /g,"")+"]"),st.call(s,l.fontFamily)>-1&&(c+="[fontFamily="+e.style.fontFamily.replace(/ /g,"")+"]"),st.call(s,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(Q){try{this._root.setActive()}catch(t){}this.fireEvent("focus")}else this._root.focus();return this},ee.blur=function(){return this._root.blur(),Q&&this.fireEvent("blur"),this};var se="squire-selection-end";ee._saveRangeToBookmark=function(t){var e,n=this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),r=this.createElement("INPUT",{id:se,type:"hidden"});gt(t,n),t.collapse(!1),gt(t,r),2&n.compareDocumentPosition(r)&&(n.id=se,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("#"+se);if(n&&r){var i=n.parentNode,o=r.parentNode,s=st.call(i.childNodes,n),a=st.call(o.childNodes,r);i===o&&(a-=1),v(n),v(r),t||(t=this._doc.createRange()),t.setStart(i,s),t.setEnd(o,a),x(i,t),i!==o&&x(o,t),t.collapsed&&((i=t.startContainer).nodeType===R&&((o=i.childNodes[t.startOffset])&&o.nodeType===R||(o=i.childNodes[t.startOffset-1]),o&&o.nodeType===R&&(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&&(mt=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,s=o.documentSizeThreshold,a=o.undoLimit;e||(r+=1),r-1&&2*n.length>s&&a>-1&&r>a&&(i.splice(0,r-a),r=a,this._undoStackLength=a),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+1u&&d.splitText(u),d===a&&c&&(d=d.splitText(c),l===a&&(l=d,u-=c),a=d,c=0),g(d,i=this.createElement(t,e)),i.appendChild(d))}while(o.nextNode());l.nodeType!==R&&(d.nodeType===R?(l=d,u=d.length):(l=d.parentNode,u=1)),n=this.createRange(a,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(M),this._didAddZWS()):i=o.createTextNode(""),gt(n,i));for(var a=n.commonAncestorContainer;s(a);)a=a.parentNode;var l=n.startContainer,c=n.startOffset,u=n.endContainer,d=n.endOffset,f=[],p=function(t,e){if(!wt(n,t,!1)){var r,i,o=t.nodeType===R;if(!wt(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,p(r,e)}},m=Array.prototype.filter.call(a.getElementsByTagName(t),function(r){return wt(n,r,!0)&&h(r,t,e)});return r||m.forEach(function(t){p(t,t)}),f.forEach(function(t){var e=t[0].cloneNode(!1),n=t[1];g(n,e),e.appendChild(n)}),m.forEach(function(t){g(t,C(t))}),this._getRangeAndRemoveBookmark(n),i&&n.collapse(!1),x(a,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 ae={DT:"DD",DD:"DT",LI:"LI",PRE:"PRE"},le=function(t,e,n,r){var i=ae[e.nodeName],o=null,s=E(n,r,e.parentNode,t._root),a=t._config;return i||(i=a.blockTag,o=a.blockAttributes),h(s,i,o)||(e=y(s.ownerDocument,i,o),s.dir&&(e.dir=s.dir),g(s,e),e.appendChild(C(s)),s=e),s};ee.forEachBlock=function(t,e,n){if(!n&&!(n=this.getSelection()))return this;e&&this.saveUndoState(n);var r=this._root,i=kt(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 Ft(e,r),xt(e,r,r,r),n=Ct(e,r,r),gt(e,t.call(this,n)),e.endOffset]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))|([\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,}\b)(?:\?[^&?\s]+=[^&?\s]+(?:&[^&?\s]+=[^&?\s]+)*)?/i;var he=function(t,e,n){var i,o,s,a,l,c,u,d=t.ownerDocument,f=new r(t,4,function(t){return!p(t,e,"A")}),h=n.linkRegExp,m=n._config.tagAttributes.a;if(h)for(;i=f.nextNode();)for(o=i.data,s=i.parentNode;a=h.exec(o);)c=(l=a.index)+a[0].length,l&&(u=d.createTextNode(o.slice(0,l)),s.insertBefore(u,i)),(u=n.createElement("A",D({href:a[1]?/^(?:ht|f)tps?:/i.test(a[1])?a[1]:"http://"+a[1]:"mailto:"+a[0]},m,!1))).textContent=o.slice(l,c),s.insertBefore(u,i),i.data=o=o.slice(c)};ee.insertHTML=function(t,e){var n,r,i,o,s,a,l,c=this._config,u=c.isInsertedHTMLSanitized?c.sanitizeToDOMFragment:null,f=this.getSelection(),h=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=""+t+""),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(t)&&(t=""+t+"
"),(i=this.createElement("DIV")).innerHTML=t,(o=h.createDocumentFragment()).appendChild(C(i))),this.saveUndoState(f);try{for(s=this._root,a=o,l={fragment:o,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},he(o,o,this),Kt(o,c),Zt(o,s,!1),Vt(o),o.normalize();a=d(a,o);)b(a,s);e&&this.fireEvent("willPaste",l),l.defaultPrevented||(bt(f,l.fragment,s),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 pe=function(t){return t.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")};ee.insertPlainText=function(t,e){var n=this.getSelection();if(n.collapsed&&p(n.startContainer,this._root,"PRE")){var r,i,o=n.startContainer,s=n.startOffset;return o&&o.nodeType===R||(r=this._doc.createTextNode(""),o.insertBefore(r,o.childNodes[s]),o=r,s=0),i={text:t,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},e&&this.fireEvent("willPaste",i),i.defaultPrevented||(t=i.text,o.insertData(s,t),n.setStart(o,s+t.length),n.collapse(!0)),this.setSelection(n),this}var a,l,c,u,d=t.split("\n"),f=this._config,h=f.blockTag,m=f.blockAttributes,_="",v="<"+h;for(a in m)v+=" "+a+'="'+pe(m[a])+'"';for(v+=">",l=0,c=d.length;l")+_;return this.insertHTML(d.join(""),e)};var me=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=me("changeFormat",{tag:"B"}),ee.italic=me("changeFormat",{tag:"I"}),ee.underline=me("changeFormat",{tag:"U"}),ee.strikethrough=me("changeFormat",{tag:"S"}),ee.subscript=me("changeFormat",{tag:"SUB"},{tag:"SUP"}),ee.superscript=me("changeFormat",{tag:"SUP"},{tag:"SUB"}),ee.removeBold=me("changeFormat",null,{tag:"B"}),ee.removeItalic=me("changeFormat",null,{tag:"I"}),ee.removeUnderline=me("changeFormat",null,{tag:"U"}),ee.removeStrikethrough=me("changeFormat",null,{tag:"S"}),ee.removeSubscript=me("changeFormat",null,{tag:"SUB"}),ee.removeSuperscript=me("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=D(D({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(),s=c(t,n);e=s.nextNode();){var a,l,u=e.querySelectorAll("BR"),d=[],f=u.length;for(a=0;a-1;)s.appendChild(l.createTextNode(o.slice(0,a))),s.appendChild(l.createElement("BR")),o=o.slice(a+1);i.parentNode.insertBefore(s,i),i.data=o}w(e,c),g(e,C(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 p(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&&!a(n);)n=n.parentNode;if(n||(Ft(t,e),n=e),n.nodeType===R)return this;this.saveUndoState(t),xt(t,n,n,e);for(var r,i,o=n.ownerDocument,s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,d=o.createDocumentFragment(),f=o.createDocumentFragment(),h=E(c,u,n,e),p=E(s,l,n,e);p!==h;)r=p.nextSibling,d.appendChild(p),p=r;return L(this,d,f),f.normalize(),p=f.firstChild,r=f.lastChild,i=n.childNodes,p?(n.insertBefore(f,h),l=st.call(i,p),u=st.call(i,r)+1):u=l=st.call(i,h),t.setStart(n,l),t.setEnd(n,u),x(n,t),Et(t),this.setSelection(t),this._updatePath(t,!0),this.focus()},ee.increaseQuoteLevel=me("modifyBlocks",function(t){return this.createElement("BLOCKQUOTE",this._config.tagAttributes.blockquote,[t])}),ee.decreaseQuoteLevel=me("modifyBlocks",ce),ee.makeUnorderedList=me("modifyBlocks",function(t){return de(this,t,"UL"),t}),ee.makeOrderedList=me("modifyBlocks",function(t){return de(this,t,"OL"),t}),ee.removeList=me("modifyBlocks",function(t){var e,n,r,i,o,s=t.querySelectorAll("UL, OL"),l=t.querySelectorAll("LI"),c=this._root;for(e=0,n=s.length;e0&&void 0!==arguments[0]&&arguments[0];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){t.link?(t.$toasted.success(t.__("Link updated"),{action:{text:t.__("Show"),href:n.data.post.url}}),t.loading=!1):(t.$toasted.success(t.__("Link created"),{action:{text:t.__("Show"),href:n.data.post.url}}),t.reset()),!0===e&&(window.location="/link/archive/".concat(n.data.post.postable_id))}).catch(function(e){t.loading=!1,t.setFormError(e),t.setHttpError(e),t.toastHttpError(t.__("Unable to save link"))})},reset:function(){this.loading=!1,this.parsing=!1,this.form={url:null,title:null,content:null,is_private:!1,is_pinned:!1,tags:[]},this.resetFormError()},newTag:function(t){this.tags.push(t),this.form.tags.push(t)}},watch:{"form.url":_.debounce(function(t){t&&!this.link&&this.parse(t)},500)}},s=n("KHd+"),a=Object(s.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.__("Private link?")))])])])]),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("button",{staticClass:"btn btn-primary",attrs:{disabled:t.loading,dusk:"link-form-save"},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 ")]),t._v(" "),n("button",{staticClass:"btn btn-outline-primary",attrs:{disabled:t.loading},on:{click:function(e){return e.preventDefault(),t.submit(!0)}}},[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 then archive"))+"\n ")]),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)])},[],!1,null,null,null);e.default=a.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:""}},data:function(){return{show:!1}},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.show=!1,t.deleteModal()}),t.$emit("opened")})},deleteModal:function(){$("#".concat(this.id)).modal("dispose"),this.$emit("closed")}},watch:{open:function(t){this.show=t},show: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.show?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("span",{attrs:{"aria-hidden":"true"}},[this._v("×")])])}],!1,null,null,null);e.default=o.exports},y2TL:function(t,e,n){"use strict";var r=n("IYry");n.n(r).a},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.__("Story :name has been deleted",{name:t.story.title})),t.single?window.location="/":window.location.reload()}).catch(function(e){console.log(e),t.$toasted.error(t.__("Unable to delete story"))})}}},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"}},[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}},[n("i",{staticClass:"fas fa-link fa-fw mr-1"}),t._v(" "+t._s(t.__("Permalink")))]),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",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")))]):t._e(),t._v(" "),t.story.editable?n("a",{staticClass:"dropdown-item",attrs:{href:t.story.url_edit}},[n("i",{staticClass:"fas fa-pen-alt fa-fw mr-1"}),t._v(" "+t._s(t.__("Edit")))]):t._e(),t._v(" "),t.story.editable?n("confirm",{staticClass:"dropdown-item",attrs:{text:" "+t.__("Delete"),"text-confirm":" "+t.__("Confirm")},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},z6Vu:function(t,e,n){"use strict";var r=n("VmmN");n.n(r).a},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]]]); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index eec7dc0..58f3002 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,5 @@ { - "/js/app.js": "/js/app.js?id=e7b948d4deb0a01e7e9e", + "/js/app.js": "/js/app.js?id=a9868a4cd1f7c234776c", "/css/app.css": "/css/app.css?id=076c4b4fab9ab74f3edc", "/js/manifest.js": "/js/manifest.js?id=3c768977c2574a34506e", "/js/vendor.js": "/js/vendor.js?id=24c264fe7e2a39bcb572" diff --git a/resources/js/components/ChestCard.vue b/resources/js/components/ChestCard.vue index 14e8375..c3ff7e0 100644 --- a/resources/js/components/ChestCard.vue +++ b/resources/js/components/ChestCard.vue @@ -2,6 +2,7 @@
+ {{ __('Chest') }}{{ chest.title }}
diff --git a/resources/js/components/ChestForm.vue b/resources/js/components/ChestForm.vue index 6c62214..13cebed 100644 --- a/resources/js/components/ChestForm.vue +++ b/resources/js/components/ChestForm.vue @@ -12,6 +12,13 @@
+
+
+ + +
+
+
@@ -33,6 +40,7 @@ let defaultChest = function () { return { title: '', content: [], + is_pinned: false, tags: [], }; }; diff --git a/resources/js/components/LinkCard.vue b/resources/js/components/LinkCard.vue index e3f0a30..e6a1fa0 100644 --- a/resources/js/components/LinkCard.vue +++ b/resources/js/components/LinkCard.vue @@ -2,6 +2,7 @@