From cfd120fb81aa0b3f1cc1b9de8b3e4f5580f7b352 Mon Sep 17 00:00:00 2001 From: Espiridion Larosa Date: Sat, 30 May 2020 00:32:36 +0800 Subject: [PATCH] fix issue #256 --- public/app.js | 68211 ++++++++++++++++++++- resources/js/screens/posts/edit.vue | 3 + src/Http/Controllers/PostsController.php | 2 +- 3 files changed, 68214 insertions(+), 2 deletions(-) diff --git a/public/app.js b/public/app.js index df5e742f..9afe7b2c 100644 --- a/public/app.js +++ b/public/app.js @@ -1 +1,68210 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}({"/PdW":function(t,e,n){"use strict";n.r(e);var r={components:{"seo-modal":n("Xi5v").a},data:function(){return{file:null,entry:null,ready:!1,id:this.$route.params.id||"new",uploadProgress:0,uploading:!1,seoModalShown:!1,croppieModalShown:!1,theme:"light",form:{errors:[],working:!1,id:"",name:"",slug:"",email:"",bio:"I am who I'm meant to be, this is me.",avatar:"",password:"",meta:{meta_description:"",opengraph_title:"",opengraph_description:"",opengraph_image:"",opengraph_image_width:"",opengraph_image_height:"",twitter_title:"",twitter_description:"",twitter_image:"",theme:"light"}}}},mounted:function(){document.title="Author — Wink.",this.loadEntry()},watch:{"form.slug":function(t){var e=this;this.debouncer(function(){e.form.slug=e.slugify(t)})},"form.name":function(t){var e=this;this.debouncer(function(){e.form.slug||(e.form.slug=e.slugify(t))})},$route:function(){this.id=this.$route.params.id,this.loadEntry()}},methods:{loadEntry:function(){var t=this;this.ready=!1,this.http().get("/api/team/"+this.id).then(function(e){t.entry=e.data.entry,t.form.id=e.data.entry.id,"new"!=t.id&&(t.form.name=e.data.entry.name,t.form.slug=e.data.entry.slug,t.form.email=e.data.entry.email,t.form.bio=e.data.entry.bio,t.form.avatar=e.data.entry.avatar,t.form.meta={meta_description:e.data.entry.meta.meta_description||"",opengraph_title:e.data.entry.meta.opengraph_title||"",opengraph_description:e.data.entry.meta.opengraph_description||"",opengraph_image:e.data.entry.meta.opengraph_image||"",opengraph_image_width:e.data.entry.meta.opengraph_image_width||"",opengraph_image_height:e.data.entry.meta.opengraph_image_height||"",twitter_title:e.data.entry.meta.twitter_title||"",twitter_description:e.data.entry.meta.twitter_description||"",twitter_image:e.data.entry.meta.twitter_image||"",theme:e.data.entry.meta.theme||"light"},t.theme=e.data.entry.meta.theme||"light"),t.ready=!0}).catch(function(e){t.ready=!0})},save:function(){var t=this;this.form.working=!0,this.form.errors=[],this.http().post("/api/team/"+this.id,this.form).then(function(e){t.form.working=!1,t.notifySuccess("Saved!",2e3),"new"==t.id&&(t.id=t.form.id,t.$router.push({name:"team-edit",params:{id:t.form.id}})),t.Wink.author.id!=t.entry.id||t.theme==t.form.meta.theme&&t.avatar==t.form.avatar||location.reload()}).catch(function(e){t.form.errors=e.response.data.errors,t.form.working=!1})},deleteAuthor:function(){var t=this;this.alertConfirm("Are you sure you want to delete this author?",function(){t.http().delete("/api/team/"+t.id).then(function(e){t.$router.push({name:"team"})}).catch(function(e){t.alertError(e.response.data.message)})})},loadSelectedImage:function(t){var e=t.target.files[0];this.file=e,this.croppieModal()},seoModal:function(){this.seoModalShown=!0},closeSeoModal:function(t){var e=t.content;this.seoModalShown=!1,this.form.meta=e},croppieModal:function(){this.croppieModalShown=!0},closeCroppieModal:function(t){var e=t.image;this.croppieModalShown=!1,this.form.avatar=e},cancelCroppieModal:function(){this.croppieModalShown=!1}}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("page-header",[t.ready&&t.entry?n("div",{staticClass:"flex items-center",attrs:{slot:"right-side"},slot:"right-side"},[n("button",{directives:[{name:"loading",rawName:"v-loading",value:t.form.working,expression:"form.working"}],staticClass:"py-1 px-2 btn-primary text-sm mr-6",on:{click:t.save}},[t._v("Save")]),t._v(" "),n("dropdown",{staticClass:"relative"},[n("button",{staticClass:"focus:outline-none text-light hover:text-primary h-8",attrs:{slot:"trigger"},slot:"trigger"},[n("svg",{staticClass:"w-4 h-4 fill-current mt-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z"}})])]),t._v(" "),n("div",{staticClass:"dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2",attrs:{slot:"content"},slot:"content"},[n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.seoModal(e)}}},[t._v("\n SEO & Social\n ")]),t._v(" "),"new"!=t.id?n("a",{staticClass:"no-underline text-red w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.deleteAuthor(e)}}},[t._v("Delete")]):t._e()])])],1):t._e()]),t._v(" "),n("div",{staticClass:"container"},[t.ready?t._e():n("preloader"),t._v(" "),t.ready&&!t.entry?n("h2",{staticClass:"text-center font-normal"},[t._v("\n 404 — Author not found\n ")]):t._e(),t._v(" "),t.ready&&t.entry?n("div",{staticClass:"lg:w-2/3 mx-auto"},["new"!=t.id&&t.Wink.author.id!=t.entry.id?n("h1",{staticClass:"font-semibold text-3xl mb-10"},[t._v("Edit Author")]):t._e(),t._v(" "),"new"==t.id&&t.Wink.author.id!=t.entry.id?n("h1",{staticClass:"font-semibold text-3xl mb-10"},[t._v("New Author")]):t._e(),t._v(" "),t.Wink.author.id==t.entry.id?n("h1",{staticClass:"font-semibold text-3xl mb-10"},[t._v("Your Profile")]):t._e(),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"name"}},[t._v("Name")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"input",attrs:{type:"text",placeholder:"Give me a name",id:"name"},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors.name}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"slug"}},[t._v("Slug")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.slug,expression:"form.slug"}],staticClass:"input",attrs:{type:"text",placeholder:"and-a-slug-please",id:"slug"},domProps:{value:t.form.slug},on:{input:function(e){e.target.composing||t.$set(t.form,"slug",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors.slug}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"theme"}},[t._v("Theme")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.form.meta.theme,expression:"form.meta.theme"}],staticClass:"input",attrs:{id:"theme"},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.meta,"theme",e.target.multiple?n:n[0])}}},[n("option",{attrs:{value:"light"}},[t._v("Light")]),t._v(" "),n("option",{attrs:{value:"dark"}},[t._v("Dark")])]),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors["meta.theme"]}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"email"}},[t._v("Email")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.email,expression:"form.email"}],staticClass:"input",attrs:{type:"email",placeholder:"email@example.com",id:"email"},domProps:{value:t.form.email},on:{input:function(e){e.target.composing||t.$set(t.form,"email",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors.email}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"password"}},[t._v("Password")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.password,expression:"form.password"}],staticClass:"input",attrs:{type:"password",placeholder:"*****",id:"password"},domProps:{value:t.form.password},on:{input:function(e){e.target.composing||t.$set(t.form,"password",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors.password}})],1),t._v(" "),n("div",{staticClass:"input-group mb-5"},[n("label",{staticClass:"input-label mb-4",attrs:{for:"slug"}},[t._v("Bio")]),t._v(" "),n("mini-editor",{model:{value:t.form.bio,callback:function(e){t.$set(t.form,"bio",e)},expression:"form.bio"}}),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors.bio}})],1),t._v(" "),t.uploading?n("div",[n("preloader")],1):t._e(),t._v(" "),t.uploading?t._e():n("div",{staticClass:"flex items-center"},[n("div",{staticClass:"w-16 h-16 rounded-full bg-cover",style:{backgroundImage:"url("+t.form.avatar+")"}}),t._v(" "),n("input",{staticClass:"hidden",attrs:{type:"file",id:"author_avatar",accept:"image/*"},on:{change:t.loadSelectedImage}}),t._v(" "),n("label",{staticClass:"ml-5 cursor-pointer underline",attrs:{for:"author_avatar"}},[t._v("Upload an avatar")])])]):t._e()],1),t._v(" "),t.seoModalShown?n("seo-modal",{attrs:{input:t.form.meta},on:{close:t.closeSeoModal}}):t._e(),t._v(" "),t.croppieModalShown?n("cropper-modal",{attrs:{image:t.file,viewport:{width:200,height:200},boundary:{width:200,height:200}},on:{close:t.closeCroppieModal,cancel:t.cancelCroppieModal}}):t._e()],1)},[],!1,null,null,null);i.options.__file="edit.vue";e.default=i.exports},0:function(t,e,n){n("bUC5"),n("I3XB"),t.exports=n("U7GE")},"1Hzp":function(t,e,n){"use strict";var r=n("LgeT");n.n(r).a},"2SVd":function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},"2cWy":function(t,e,n){"use strict";var r=n("MLK3");n.n(r).a},"3uFf":function(t,e,n){var r=n("pXQQ");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},"45tn":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\nselect[data-v-72930e8c] {\n width: auto;\n}\n",""])},"49sm":function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},"5oMp":function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},"7pT1":function(t,e,n){"use strict";n.r(e);var r={computed:{hideLogoOnSmallScreens:function(){return this.$slots["left-side"]}}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"border-b border-very-light mb-10"},[n("div",{staticClass:"container"},[n("div",{staticClass:"flex items-center py-2"},[n("div",{staticClass:"flex items-center mr-auto h-8"},[n("h3",{staticClass:"mr-5 font-semibold font-serif",class:{hidden:t.hideLogoOnSmallScreens,"sm:block":t.hideLogoOnSmallScreens}},[n("router-link",{staticClass:"no-underline text-text-color",attrs:{to:"/"}},[n("span",{staticClass:"text-light"},[t._v("W")]),t._v("ink.\n ")])],1),t._v(" "),t._t("left-side")],2),t._v(" "),n("div",{staticClass:"flex items-center"},[t._t("right-side"),t._v(" "),n("dropdown",{staticClass:"relative ml-6"},[n("button",{staticClass:"focus:outline-none",attrs:{slot:"trigger",type:"button"},slot:"trigger"},[n("img",{staticClass:"rounded-full w-8 h-8",attrs:{src:t.Wink.author.avatar,title:t.Wink.author.name}})]),t._v(" "),n("div",{staticClass:"dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2",attrs:{slot:"content"},slot:"content"},[n("router-link",{staticClass:"no-underline text-text-color font-sans hover:text-primary w-full block py-2 px-4 border-b border-very-light",attrs:{to:{name:"team-edit",params:{id:t.Wink.author.id}}}},[t._v("\n Profile\n ")]),t._v(" "),n("router-link",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{to:"/posts"}},[t._v("\n Posts\n ")]),t._v(" "),n("router-link",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{to:"/pages"}},[t._v("\n Pages\n ")]),t._v(" "),n("router-link",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{to:"/tags"}},[t._v("\n Tags\n ")]),t._v(" "),n("router-link",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{to:"/team"}},[t._v("\n Team\n ")]),t._v(" "),n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4 border-t border-very-light",attrs:{href:"/"+t.Wink.path+"/logout"}},[t._v("\n Log out\n ")])],1)])],2)])])])},[],!1,null,null,null);i.options.__file="PageHeader.vue";e.default=i.exports},"8JPK":function(t,e){function n(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1)for(var n=1;n0?n("div",[t._l(t.entries,function(e){return n("div",{key:e.id,staticClass:"border-t border-very-light flex items-center py-5"},[n("div",{attrs:{title:e.name}},[n("h2",{staticClass:"text-xl font-semibold mb-3"},[n("router-link",{staticClass:"no-underline text-text-color",attrs:{to:{name:"team-edit",params:{id:e.id}}}},[t._v("\n "+t._s(t.truncate(e.name,68))+"\n ")])],1),t._v(" "),n("small",{staticClass:"text-light"},[n("span",[t._v(t._s(e.email))]),t._v("\n — Created "+t._s(t.timeAgo(e.created_at))+"\n ")])]),t._v(" "),n("div",{staticClass:"ml-auto text-light mr-8"},[t._v("\n "+t._s(e.posts_count)+" Post(s)\n ")]),t._v(" "),n("router-link",{staticClass:"no-underline hidden lg:block",attrs:{to:{name:"team-edit",params:{id:e.id}}}},[n("div",{staticClass:"w-16 h-16 rounded-full bg-cover",style:{backgroundImage:"url("+e.avatar+")"}})])],1)}),t._v(" "),t.hasMoreEntries?n("div",[n("div",{staticClass:"py-8 uppercase",attrs:{colspan:"100"}},[t.loadingMoreEntries?t._e():n("a",{staticClass:"no-underline text-primary",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.loadOlderEntries(e)}}},[t._v("Load more authors")]),t._v(" "),t.loadingMoreEntries?n("span",[t._v("Loading...")]):t._e()])]):t._e()],2):t._e()],1)],1)},[],!1,null,null,null);l.options.__file="index.vue";e.default=l.exports},"9rSQ":function(t,e,n){"use strict";var r=n("xTJ+");function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=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 o,i=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},Am8b:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n#notificationBody {\n z-index: 99999;\n position: fixed;\n bottom: 20px;\n right: 10px;\n}\n",""])},CdPK:function(t,e){t.exports={bind:function(t,e,n){if("function"!=typeof e.value){var r=n.context.name;"[Vue-click-outside:] provided expression '".concat(e.expression,"' is not a function, but has to be");r&&"Found in component '".concat(r,"'")}var o=e.modifiers.bubble,i=function(n){(o||!t.contains(n.target)&&t!==n.target)&&e.value(n)};t.__vueClickOutside__=i,document.addEventListener("click",i)},unbind:function(t,e){document.removeEventListener("click",t.__vueClickOutside__),t.__vueClickOutside__=null}}},"CfG/":function(t,e,n){t.exports=n("h+Kf")},CgaS:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("MLWZ"),i=n("9rSQ"),a=n("UnBK"),s=n("SntB");function l(t){this.defaults=t,this.interceptors={request:new i,response:new i}}l.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[a,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},l.prototype.getUri=function(t){return t=s(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(t){l.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}}),r.forEach(["post","put","patch"],function(t){l.prototype[t]=function(e,n,o){return this.request(r.merge(o||{},{method:t,url:e,data:n}))}}),t.exports=l},DFmy:function(t,e,n){"use strict";n.r(e);var r={},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"flex flex-col items-center justify-center text-light"},[e("svg",{staticClass:"spin fill-current w-10",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[e("path",{attrs:{d:"M10 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0-6a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}})])])},[],!1,null,null,null);i.options.__file="Preloader.vue";e.default=i.exports},DfZB:function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},Dt6l:function(t,e,n){"use strict";n.r(e);var r={props:["type","message","autoClose","confirmationProceed","confirmationCancel"],data:function(){return{timeout:null}},mounted:function(){var t=this;this.autoClose&&(this.timeout=setTimeout(function(){t.close()},this.autoClose))},methods:{close:function(){clearTimeout(this.timeout),this.$root.alert.type=null,this.$root.alert.autoClose=!1,this.$root.alert.message="",this.$root.alert.confirmationProceed=null,this.$root.alert.confirmationCancel=null},confirm:function(){this.confirmationProceed(),this.close()},cancel:function(){this.confirmationCancel&&this.confirmationCancel(),this.close()}}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.$root.alert.type,expression:"$root.alert.type"}],attrs:{id:"alert"}},[n("div",{staticClass:"dialog rounded"},[n("div",{staticClass:"text-center mb-4"},["confirmation"==t.type?n("svg",{staticClass:"fill-red",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm2-13c0 .28-.21.8-.42 1L10 9.58c-.57.58-1 1.6-1 2.42v1h2v-1c0-.29.21-.8.42-1L13 9.42c.57-.58 1-1.6 1-2.42a4 4 0 1 0-8 0h2a2 2 0 1 1 4 0zm-3 8v2h2v-2H9z"}})]):t._e(),t._v(" "),"success"==t.type?n("svg",{staticClass:"fill-green",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM6.7 9.29L9 11.6l4.3-4.3 1.4 1.42L9 14.4l-3.7-3.7 1.4-1.42z"}})]):t._e(),t._v(" "),"error"==t.type?n("svg",{staticClass:"fill-rd",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm1.41-1.41A8 8 0 1 0 15.66 4.34 8 8 0 0 0 4.34 15.66zm9.9-8.49L11.41 10l2.83 2.83-1.41 1.41L10 11.41l-2.83 2.83-1.41-1.41L8.59 10 5.76 7.17l1.41-1.41L10 8.59l2.83-2.83 1.41 1.41z"}})]):t._e(),t._v(" "),n("p",{staticClass:"mt-3 mb-0"},[t._v(t._s(t.message))])]),t._v(" "),n("div",{staticClass:"flex items-center justify-center"},["error"==t.type?n("button",{staticClass:"btn-primary btn-sm",on:{click:t.close}},[t._v("\n Ok\n ")]):t._e(),t._v(" "),"success"!=t.type||t.$root.alert.autoClose?t._e():n("button",{staticClass:"btn-primary btn-sm",on:{click:t.close}},[t._v("\n Ok\n ")]),t._v(" "),"confirmation"==t.type?n("button",{staticClass:"btn-primary btn-sm",on:{click:t.confirm}},[t._v("\n Yes\n ")]):t._e(),t._v(" "),"confirmation"==t.type?n("button",{staticClass:"btn-light btn-sm ml-1",on:{click:t.cancel}},[t._v("\n No\n ")]):t._e()])])])},[],!1,null,null,null);i.options.__file="Alert.vue";e.default=i.exports},Gjge:function(t,e,n){"use strict";var r=n("hyyH");n.n(r).a},Gpoh:function(t,e,n){"use strict";n.r(e);var r={data:function(){return{}},created:function(){document.body.classList.add("overflow-hidden")},destroyed:function(){document.body.classList.remove("overflow-hidden")},methods:{}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this.$createElement;return(this._self._c||t)("transition",{attrs:{name:"modal"}},[this._t("default")],2)},[],!1,null,null,null);i.options.__file="FullscreenModal.vue";e.default=i.exports},H7XF:function(t,e,n){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){for(var e,n=u(t),r=n[0],a=n[1],s=new i(function(t,e,n){return 3*(e+n)/4-n}(0,r,a)),l=0,c=a>0?r-4:r,f=0;f>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===a&&(e=o[t.charCodeAt(f)]<<2|o[t.charCodeAt(f+1)]>>4,s[l++]=255&e);1===a&&(e=o[t.charCodeAt(f)]<<10|o[t.charCodeAt(f+1)]<<4|o[t.charCodeAt(f+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var o,i,a=[],s=e;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},HHlM:function(t,e,n){"use strict";n.r(e);var r={props:["type","message","autoClose"],data:function(){return{timeout:null}},mounted:function(){var t=this;this.timeout=setTimeout(function(){t.close()},this.autoClose)},methods:{close:function(){clearTimeout(this.timeout),this.$root.notification.type=null,this.$root.notification.autoClose=!1,this.$root.notification.message=""}}},o=(n("ScBg"),n("KHd+")),i=Object(o.a)(r,function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"text-contrast bg-green px-8 py-4 rounded-lg",attrs:{id:"notificationBody"}},[this._v("\n "+this._s(this.message)+"\n")])},[],!1,null,null,null);i.options.__file="Notification.vue";e.default=i.exports},HSkj:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},HSsa:function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r0?n("div",[t._l(t.entries,function(e){return n("div",{key:e.id,staticClass:"border-t border-very-light flex items-center"},[n("div",{staticClass:"py-4",attrs:{title:e.title}},[n("h2",{staticClass:"text-xl font-semibold mb-3"},[n("router-link",{staticClass:"no-underline text-text-color",attrs:{to:{name:"post-edit",params:{id:e.id}}}},[t._v("\n "+t._s(t.truncate(e.title,68))+"\n ")])],1),t._v(" "),n("p",{staticClass:"mb-3"},[t._v(t._s(t.truncate(e.body.replace(/(<([^>]+)>)/gi,""),100)))]),t._v(" "),n("small",{staticClass:"text-light"},[e.published&&!t.dateInTheFuture(e.publish_date)?n("span",[t._v("Published "+t._s(t.timeAgo(e.publish_date)))]):t._e(),t._v(" "),e.published&&t.dateInTheFuture(e.publish_date)?n("span",{staticClass:"text-green"},[t._v("Scheduled "+t._s(t.timeAgo(e.publish_date)))]):t._e(),t._v(" "),e.published?t._e():n("span",{staticClass:"text-red"},[t._v("Draft")]),t._v("\n — Updated "+t._s(t.timeAgo(e.updated_at))+"\n "),e.tags.length?n("span",[t._v("— Tags: "+t._s(t.formatTags(e.tags)))]):t._e()])]),t._v(" "),n("router-link",{staticClass:"no-underline ml-auto hidden lg:block",attrs:{to:{name:"post-edit",params:{id:e.id}}}},[e.featured_image?n("div",{staticClass:"w-16 h-16 rounded-full bg-cover",style:{backgroundImage:"url("+e.featured_image+")"}}):n("div",{staticClass:"w-16 h-16 rounded-full bg-light flex items-center justify-center text-4xl text-contrast"},[n("svg",{staticClass:"fill-current w-8",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M0 6c0-1.1.9-2 2-2h3l2-2h6l2 2h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm10 10a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0-2a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"}})])])])],1)}),t._v(" "),t.hasMoreEntries?n("div",[n("div",{staticClass:"py-8 uppercase",attrs:{colspan:"100"}},[t.loadingMoreEntries?t._e():n("a",{staticClass:"no-underline text-primary",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.loadOlderEntries(e)}}},[t._v("Load more posts")]),t._v(" "),t.loadingMoreEntries?n("span",[t._v("Loading...")]):t._e()])]):t._e()],2):t._e()],1)],1)},[],!1,null,null,null);l.options.__file="index.vue";e.default=l.exports},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 o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(i).concat([o]).join("\n")}var a;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={},o=0;o=200&&t<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){l.headers[t]={}}),r.forEach(["post","put","patch"],function(t){l.headers[t]=r.merge(i)}),t.exports=l}).call(this,n("8oxB"))},JVM6:function(t,e){t.exports=' '},JmSe:function(t,e,n){"use strict";n.r(e);var r={components:{"seo-modal":n("Xi5v").a},data:function(){return{ready:!1,entry:null,status:"",id:this.$route.params.id||"new",saveKeyboardShortcut:null,errors:[],settingsModalShown:!1,seoModalShown:!1,form:{errors:[],id:"",title:"Page Title",slug:"",body:"",meta:{meta_description:"",opengraph_title:"",opengraph_description:"",opengraph_image:"",opengraph_image_width:"",opengraph_image_height:"",twitter_title:"",twitter_description:"",twitter_image:""}}}},watch:{"form.slug":function(t){var e=this;this.debouncer(function(){e.form.slug=e.slugify(t)})},"form.title":function(t){var e=this;this.debouncer(function(){e.form.slug||(e.form.slug=e.slugify(t))})},"$route.params.id":function(){this.id=this.$route.params.id}},mounted:function(){var t=this;document.title="Edit Page — Wink.",this.http().get("/api/pages/"+this.id).then(function(e){t.entry=_.cloneDeep(e.data.entry),t.fillForm(e.data.entry),t.registerSaveKeyboardShortcut(),t.ready=!0}).catch(function(e){t.ready=!0})},destroyed:function(){document.removeEventListener("keydown",this.saveKeyboardShortcut)},methods:{registerSaveKeyboardShortcut:function(){var t=this;this.saveKeyboardShortcut=function(e){(e.ctrlKey||e.metaKey)&&83==e.which&&(e.preventDefault(),t.save())},document.addEventListener("keydown",this.saveKeyboardShortcut)},fillForm:function(t){var e=this;this.form.id=t.id,"new"!=this.id&&(this.form.title=t.title,this.form.slug=t.slug,this.form.body=t.body,this.form.meta={meta_description:t.meta.meta_description||"",opengraph_title:t.meta.opengraph_title||"",opengraph_description:t.meta.opengraph_description||"",opengraph_image:t.meta.opengraph_image||"",opengraph_image_width:t.meta.opengraph_image_width||"",opengraph_image_height:t.meta.opengraph_image_height||"",twitter_title:t.meta.twitter_title||"",twitter_description:t.meta.twitter_description||"",twitter_image:t.meta.twitter_image||""}),setTimeout(function(){e.$watch("form",_.debounce(function(){return e.save()},1e3),{deep:!0})},1e3)},settingsModal:function(){this.settingsModalShown=!0},closeSettingsModal:function(){this.settingsModalShown=!1},seoModal:function(){this.seoModalShown=!0},closeSeoModal:function(t){var e=t.content;this.seoModalShown=!1,this.form.meta=e},deletePage:function(){var t=this;this.alertConfirm("Are you sure you want to delete this page?",function(){t.settingsModalShown=!1,t.http().delete("/api/pages/"+t.id,t.form).then(function(e){t.$router.push({name:"pages"})})})},save:function(){var t=this;this.errors=[],this.status="Saving...",this.http().post("/api/pages/"+this.id,this.form).then(function(e){t.status="","new"==t.id&&t.$router.push({name:"page-edit",params:{id:t.form.id}})}).catch(function(e){t.errors=e.response.data.errors,t.settingsModalShown=!0,t.form.working=!1})}}},o=(n("2cWy"),n("KHd+")),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("page-header",[n("div",{attrs:{slot:"left-side"},slot:"left-side"},[t.status||"new"!=t.id?t._e():n("span",{staticClass:"font-semibold"},[t._v("New")]),t._v(" "),t.status||"new"==t.id?t._e():n("span",{staticClass:"font-semibold"},[t._v("Saved")]),t._v(" "),n("span",[t._v(t._s(t.status))])]),t._v(" "),t.ready&&t.entry?n("div",{staticClass:"flex items-center",attrs:{slot:"right-side"},slot:"right-side"},[n("button",{directives:[{name:"loading",rawName:"v-loading",value:t.status,expression:"status"}],staticClass:"py-1 px-2 btn-primary text-sm mr-6",on:{click:t.save}},[t._v("Save")]),t._v(" "),n("dropdown",{staticClass:"relative"},[n("button",{staticClass:"focus:outline-none text-light hover:text-primary h-8",attrs:{slot:"trigger"},slot:"trigger"},[n("svg",{staticClass:"w-4 h-4 fill-current mt-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z"}})])]),t._v(" "),n("div",{staticClass:"dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2",attrs:{slot:"content"},slot:"content"},[n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.settingsModal(e)}}},[t._v("\n General Settings\n ")]),t._v(" "),n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.seoModal(e)}}},[t._v("\n SEO & Social\n ")]),t._v(" "),"new"!=t.id?n("a",{staticClass:"no-underline text-red w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.deletePage(e)}}},[t._v("Delete")]):t._e()])])],1):t._e()]),t._v(" "),n("div",{staticClass:"container"},[t.ready?t._e():n("preloader"),t._v(" "),t.ready&&!t.entry?n("h2",{staticClass:"text-center font-normal"},[t._v("\n 404 — Page not found\n ")]):t._e(),t._v(" "),t.ready&&t.entry?n("div",{staticClass:"lg:w-3/4 mx-auto"},[n("textarea-autosize",{staticClass:"text-3xl font-semibold w-full focus:outline-none mb-10",attrs:{placeholder:"Type something here..."},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}}),t._v(" "),n("editor",{attrs:{"post-id":t.id},model:{value:t.form.body,callback:function(e){t.$set(t.form,"body",e)},expression:"form.body"}})],1):t._e()],1),t._v(" "),t.settingsModalShown?n("modal",{on:{close:function(e){t.settingsModalShown=!1}}},[n("div",{staticClass:"input-group pt-0"},[n("label",{staticClass:"input-label"},[t._v("Slug")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.slug,expression:"form.slug"}],staticClass:"input",attrs:{type:"text",placeholder:"Give me a slug",id:"slug"},domProps:{value:t.form.slug},on:{input:function(e){e.target.composing||t.$set(t.form,"slug",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.errors.slug}})],1),t._v(" "),n("div",{staticClass:"mt-10"},[n("button",{staticClass:"btn-sm btn-primary",on:{click:function(e){t.settingsModalShown=!1}}},[t._v("Done")])])]):t._e(),t._v(" "),t.seoModalShown?n("seo-modal",{attrs:{input:t.form.meta},on:{close:t.closeSeoModal}}):t._e()],1)},[],!1,null,"14ffb196",null);i.options.__file="edit.vue";e.default=i.exports},"KHd+":function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,s){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},KRzE:function(t,e,n){var r=n("wNkb");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},Kui3:function(t,e,n){"use strict";n.r(e);var r=n("LvDl"),o=n.n(r),i={props:["postId","currentImageUrl","currentCaption"],data:function(){return{imageUrl:"",caption:"",imagePickerKey:"",uploadProgress:0,uploading:!1,modalShown:!1}},mounted:function(){var t=this;this.$parent.$on("openingFeaturedImageUploader",function(e){t.imageUrl=t.currentImageUrl,t.caption=t.currentCaption,t.modalShown=!0})},methods:{saveImage:function(){this.$emit("changed",{url:this.imageUrl,caption:this.caption}),this.close()},close:function(){this.imagePickerKey=o.a.uniqueId(),this.modalShown=!1},updateImage:function(t){var e=t.url,n=t.caption;this.imageUrl=e,this.caption=n,this.uploading=!1},updateProgress:function(t){var e=t.progress;this.uploadProgress=e}}},a=(n("Gjge"),n("KHd+")),s=Object(a.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.modalShown?n("modal",{on:{close:t.close}},[n("h2",{staticClass:"font-semibold mb-5"},[t._v("Featured Image")]),t._v(" "),t.uploading?n("preloader"):t._e(),t._v(" "),t.imageUrl&&!t.uploading?n("div",[n("img",{staticClass:"max-w-full",attrs:{src:t.imageUrl}}),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label"},[t._v("Caption")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.caption,expression:"caption"}],ref:"caption",staticClass:"input",attrs:{rows:"2",placeholder:"Add caption to the image"},domProps:{value:t.caption},on:{input:function(e){e.target.composing||(t.caption=e.target.value)}}})])]):t._e(),t._v(" "),n("image-picker",{key:t.imagePickerKey,staticClass:"mt-5",on:{changed:t.updateImage,progressing:t.updateProgress,uploading:function(e){t.uploading=!0}}}),t._v(" "),n("button",{staticClass:"btn-sm btn-primary mt-10",on:{click:t.saveImage}},[t._v("Save Image")]),t._v(" "),n("button",{staticClass:"btn-sm btn-light mt-10",on:{click:t.close}},[t._v("Cancel")])],1):t._e()},[],!1,null,null,null);s.options.__file="FeaturedImageUploader.vue";var l=s.exports,u=n("Xi5v"),c={props:{value:{type:String,default:""}},data:function(){return{content:""}},watch:{content:function(t){this.$emit("input",t)}},mounted:function(){this.content=this.value,this.$nextTick(function(){var t=document.getElementById("markdown-editor");t.style.height=Math.min(t.scrollHeight,2e3)+"px",t&&(t.style.height=Math.min(t.scrollHeight,2e3)+"px",t.oninput=function(){t.style.height="",t.style.height=Math.min(t.scrollHeight,2e3)+"px"})})},methods:{}},f=Object(a.a)(c,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.content,expression:"content"}],staticClass:"w-full outline-none resize-none text-sm leading-loose font-mono",attrs:{id:"markdown-editor",spellcheck:"false",cols:"30",rows:"10",placeholder:"Start writing *now*"},domProps:{value:t.content},on:{input:function(e){e.target.composing||(t.content=e.target.value)}}})])},[],!1,null,null,null);f.options.__file="MarkdownEditor.vue";var p={components:{MarkdownEditor:f.exports,"featured-image-uploader":l,"seo-modal":u.a},data:function(){return{ready:!1,entry:null,currentTab:"post",tags:[],authors:[],status:"",saveKeyboardShortcut:null,settingsModalShown:!1,publishingModalShown:!1,seoModalShown:!1,id:this.$route.params.id||"new",errors:[],postBodyWatcher:null,form:{id:"",title:"Draft",slug:"",excerpt:"",tags:[],author_id:"",featured_image:"",featured_image_caption:"",body:"",published:!1,markdown:null,publish_date:"",meta:{meta_description:"",opengraph_title:"",opengraph_description:"",opengraph_image:"",opengraph_image_width:"",opengraph_image_height:"",twitter_title:"",twitter_description:"",twitter_image:""}}}},watch:{"form.slug":function(t){var e=this;this.debouncer(function(){e.form.slug=e.slugify(t)})},"form.featured_image":function(){this.save()},"form.published":function(t){this.postBodyWatcher&&this.postBodyWatcher(),t||this.watchBodyChangesAndSave()},"$route.params.id":function(){this.id=this.$route.params.id}},mounted:function(){var t=this;document.title="Edit Post — Wink.",this.loadResources(),this.http().get("/api/posts/"+this.id).then(function(e){t.entry=_.cloneDeep(e.data.entry),t.fillForm(e.data.entry),t.ready=!0,t.registerSaveKeyboardShortcut()}).catch(function(e){t.ready=!0})},computed:{postPreviewLink:function(){return this.Wink.preview_path.replace("{postSlug}",this.form.slug)}},destroyed:function(){document.removeEventListener("keydown",this.saveKeyboardShortcut)},methods:{registerSaveKeyboardShortcut:function(){var t=this;this.saveKeyboardShortcut=function(e){(e.ctrlKey||e.metaKey)&&83==e.which&&(e.preventDefault(),t.save())},document.addEventListener("keydown",this.saveKeyboardShortcut)},fillForm:function(t){this.form.id=t.id,this.form.publish_date=t.publish_date,this.form.slug="draft-"+this.form.id,"new"!=this.id&&(this.form.title=t.title,this.form.slug=t.slug,this.form.excerpt=t.excerpt,this.form.body=t.body,this.form.published=t.published,this.form.markdown=t.markdown,this.form.tags=t.tags||"",this.form.author_id=t.author_id||"",this.form.featured_image=t.featured_image,this.form.featured_image_caption=t.featured_image_caption,this.form.meta={meta_description:t.meta.meta_description||"",opengraph_title:t.meta.opengraph_title||"",opengraph_description:t.meta.opengraph_description||"",opengraph_image:t.meta.opengraph_image||"",opengraph_image_width:t.meta.opengraph_image_width||"",opengraph_image_height:t.meta.opengraph_image_height||"",twitter_title:t.meta.twitter_title||"",twitter_description:t.meta.twitter_description||"",twitter_image:t.meta.twitter_image||""}),this.form.published||this.watchBodyChangesAndSave()},watchBodyChangesAndSave:function(){var t=this;setTimeout(function(){t.postBodyWatcher=t.$watch("form.body",_.debounce(function(){return t.save()},1e3),{deep:!0})},1e3)},loadResources:function(){var t=this;this.http().get("/api/tags").then(function(e){t.tags=e.data.data}),this.http().get("/api/team").then(function(e){t.authors=e.data.data,!t.form.author_id&&t.authors&&(t.form.author_id=t.Wink.author.id)})},updatePostBody:function(t){this.form.body=t.body},updateTitle:function(t){this.form.title=t},settingsModal:function(){this.settingsModalShown=!0},closeSettingsModal:function(){this.settingsModalShown=!1,this.save()},seoModal:function(){this.seoModalShown=!0},publishingModal:function(){this.publishingModalShown=!0},featuredImageModal:function(){this.$emit("openingFeaturedImageUploader")},featuredImageChanged:function(t){var e=t.url,n=t.caption;this.form.featured_image=e,this.form.featured_image_caption=n},closeSeoModal:function(t){var e=t.content;this.seoModalShown=!1,this.form.meta=e,this.save()},deletePost:function(){var t=this;this.alertConfirm("Are you sure you want to delete this post?",function(){t.settingsModalShown=!1,t.http().delete("/api/posts/"+t.id,t.form).then(function(e){t.$router.push({name:"posts"})})})},publishPost:function(){this.form.published=!0,this.save(),this.publishingModalShown=!1,this.notifySuccess("Post Published!",2e3)},unpublishPost:function(){this.form.published=!1,this.save(),this.publishingModalShown=!1,this.notifySuccess("Post was converted to a draft!",2e3)},save:function(){var t=this;this.status||(this.errors=[],this.status="Saving...","Draft"==this.form.title||this.form.slug&&!this.form.slug.startsWith("draft-")||(this.form.slug=this.slugify(this.form.title)),this.http().post("/api/posts/"+this.id,this.form).then(function(e){t.status="","new"==t.id&&t.$router.push({name:"post-edit",params:{id:t.form.id}})}).catch(function(e){t.status="",t.errors=e.response.data.errors,t.settingsModalShown=!0}))}}},d=(n("vKmt"),Object(a.a)(p,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("page-header",[n("div",{attrs:{slot:"left-side"},slot:"left-side"},[t.ready&&t.entry?n("div",[!t.status&&t.form.published?n("span",{staticClass:"font-semibold"},[t._v("Published")]):t._e(),t._v(" "),t.status||t.form.published?t._e():n("span",{staticClass:"font-semibold"},[t._v("Draft")]),t._v(" "),t.status?n("span",[t._v(t._s(t.status))]):t._e()]):t._e()]),t._v(" "),t.ready&&t.entry?n("div",{staticClass:"flex items-center",attrs:{slot:"right-side"},slot:"right-side"},[t.form.published?t._e():n("button",{staticClass:"py-1 px-2 btn-primary text-sm mr-6",on:{click:t.publishingModal}},[t._v("Publish")]),t._v(" "),t.form.published?n("button",{staticClass:"py-1 px-2 btn-primary text-sm mr-6",on:{click:t.publishingModal}},[t._v("Update")]):t._e(),t._v(" "),"new"!=t.id?n("a",{staticClass:"block focus:outline-none text-light hover:text-primary mr-6",attrs:{href:t.postPreviewLink,target:"_blank",title:"Preview Post"}},[n("svg",{staticClass:"w-4 h-4 fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M.2 10a11 11 0 0 1 19.6 0A11 11 0 0 1 .2 10zm9.8 4a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-2a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}})])]):t._e(),t._v(" "),n("dropdown",{staticClass:"relative"},[n("button",{staticClass:"focus:outline-none text-light hover:text-primary h-8",attrs:{slot:"trigger",title:"Settings"},slot:"trigger"},[n("svg",{staticClass:"w-4 h-4 fill-current mt-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z"}})])]),t._v(" "),n("div",{staticClass:"dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2",attrs:{slot:"content"},slot:"content"},[n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.settingsModal(e)}}},[t._v("\n General Settings\n ")]),t._v(" "),n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.featuredImageModal(e)}}},[t._v("\n Featured Image\n ")]),t._v(" "),n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.seoModal(e)}}},[t._v("\n SEO & Social\n ")]),t._v(" "),"new"!=t.id?n("a",{staticClass:"no-underline text-red w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.deletePost(e)}}},[t._v("Delete")]):t._e()])])],1):t._e()]),t._v(" "),n("div",{staticClass:"container"},[t.ready?t._e():n("preloader"),t._v(" "),t.ready&&!t.entry?n("h2",{staticClass:"text-center font-normal"},[t._v("\n 404 — Post not found\n ")]):t._e(),t._v(" "),t.ready&&t.entry?n("div",{staticClass:"lg:w-3/4 mx-auto"},[n("textarea-autosize",{staticClass:"text-3xl font-semibold w-full focus:outline-none mb-10",attrs:{placeholder:"Type something here..."},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}}),t._v(" "),null==t.form.markdown?n("div",[n("button",{staticClass:"w-full mb-5 hover:bg-lighter text-text-color block bg-very-light px-3 py-5 rounded",on:{click:function(e){t.form.markdown=!1}}},[t._v("\n I want a rich text editor\n ")]),t._v(" "),n("button",{staticClass:"w-full mb-5 hover:bg-lighter text-text-color block bg-very-light px-3 py-5 rounded",on:{click:function(e){t.form.markdown=!0}}},[t._v("\n I will write markdown\n ")])]):t._e(),t._v(" "),0==t.form.markdown?n("editor",{attrs:{"post-id":t.id},model:{value:t.form.body,callback:function(e){t.$set(t.form,"body",e)},expression:"form.body"}}):t._e(),t._v(" "),1==t.form.markdown?n("markdown-editor",{model:{value:t.form.body,callback:function(e){t.$set(t.form,"body",e)},expression:"form.body"}}):t._e()],1):t._e()],1),t._v(" "),t.settingsModalShown?n("modal",{on:{close:t.closeSettingsModal}},[n("div",{staticClass:"input-group pt-0"},[n("label",{staticClass:"input-label",attrs:{for:"slug"}},[t._v("Slug")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.slug,expression:"form.slug"}],staticClass:"input",attrs:{type:"text",placeholder:"Give me a slug",id:"slug"},domProps:{value:t.form.slug},on:{input:function(e){e.target.composing||t.$set(t.form,"slug",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.errors.slug}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"author_id"}},[t._v("Author")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.form.author_id,expression:"form.author_id"}],staticClass:"input",attrs:{name:"author_id",id:"author_id"},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,"author_id",e.target.multiple?n:n[0])}}},t._l(t.authors,function(e){return n("option",{domProps:{value:e.id}},[t._v(t._s(e.name))])}),0),t._v(" "),n("form-errors",{attrs:{errors:t.errors.author_id}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label mb-4",attrs:{for:"tag_ids"}},[t._v("Tags")]),t._v(" "),n("multiselect",{attrs:{options:t.tags,"option-id":"id","option-text":"name"},model:{value:t.form.tags,callback:function(e){t.$set(t.form,"tags",e)},expression:"form.tags"}}),t._v(" "),n("form-errors",{attrs:{errors:t.errors.tags}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"excerpt"}},[t._v("Excerpt")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.excerpt,expression:"form.excerpt"}],staticClass:"input",attrs:{placeholder:"What's this post about?",id:"excerpt"},domProps:{value:t.form.excerpt},on:{input:function(e){e.target.composing||t.$set(t.form,"excerpt",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.errors.excerpt}})],1),t._v(" "),n("div",{staticClass:"mt-10"},[n("button",{staticClass:"btn-sm btn-primary",on:{click:t.closeSettingsModal}},[t._v("Done")])])]):t._e(),t._v(" "),t.publishingModalShown?n("modal",{on:{close:function(e){t.publishingModalShown=!1}}},["Draft"==t.form.title||!t.form.slug||t.form.slug.startsWith("draft-")?n("div",{staticClass:"mb-10 text-red"},[t._v("\n Make sure your post has a friendly title and slug.\n ")]):t._e(),t._v(" "),n("div",{staticClass:"input-group pt-0"},[n("label",{staticClass:"input-label"},[t._v("Publish Date (M/D/Y H:M) UTC")]),t._v(" "),n("date-time-picker",{model:{value:t.form.publish_date,callback:function(e){t.$set(t.form,"publish_date",e)},expression:"form.publish_date"}}),t._v(" "),n("form-errors",{attrs:{errors:t.errors.publish_date}})],1),t._v(" "),n("div",{staticClass:"mt-10"},[t.form.published?t._e():n("button",{directives:[{name:"loading",rawName:"v-loading",value:t.status,expression:"status"}],staticClass:"btn-sm btn-primary",on:{click:t.publishPost}},[t._v("Publish this post")]),t._v(" "),t.form.published?n("button",{directives:[{name:"loading",rawName:"v-loading",value:t.status,expression:"status"}],staticClass:"btn-sm btn-primary",on:{click:t.publishPost}},[t._v("Update Post")]):t._e(),t._v(" "),t.form.published?n("button",{directives:[{name:"loading",rawName:"v-loading",value:t.status,expression:"status"}],staticClass:"btn-sm ml-1 btn-light",on:{click:t.unpublishPost}},[t._v("Convert to draft")]):t._e(),t._v(" "),n("button",{staticClass:"btn-sm ml-1 btn-light",on:{click:function(e){t.publishingModalShown=!1}}},[t._v("Cancel")])])]):t._e(),t._v(" "),t.seoModalShown?n("seo-modal",{attrs:{input:t.form.meta},on:{close:t.closeSeoModal}}):t._e(),t._v(" "),n("featured-image-uploader",{attrs:{"post-id":this.form.id,"current-image-url":t.form.featured_image,"current-caption":t.form.featured_image_caption},on:{changed:t.featuredImageChanged}})],1)},[],!1,null,"14d10470",null));d.options.__file="edit.vue";e.default=d.exports},LYNF:function(t,e,n){"use strict";var r=n("OH9c");t.exports=function(t,e,n,o,i){var a=new Error(t);return r(a,e,n,o,i)}},LgeT:function(t,e,n){var r=n("RiWH");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},Lmem:function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},LvDl:function(t,e,n){(function(t,r){var o;(function(){var i,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",u="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",p=1,d=2,h=4,v=1,m=2,y=1,g=2,_=4,b=8,w=16,x=32,k=64,O=128,E=256,C=512,A=30,S="...",T=800,N=16,j=1,P=2,M=1/0,L=9007199254740991,I=1.7976931348623157e308,R=NaN,D=4294967295,q=D-1,B=D>>>1,U=[["ary",O],["bind",y],["bindKey",g],["curry",b],["curryRight",w],["flip",C],["partial",x],["partialRight",k],["rearg",E]],$="[object Arguments]",F="[object Array]",z="[object AsyncFunction]",H="[object Boolean]",Y="[object Date]",W="[object DOMException]",K="[object Error]",V="[object Function]",Z="[object GeneratorFunction]",G="[object Map]",X="[object Number]",J="[object Null]",Q="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",ot="[object Symbol]",it="[object Undefined]",at="[object WeakMap]",st="[object WeakSet]",lt="[object ArrayBuffer]",ut="[object DataView]",ct="[object Float32Array]",ft="[object Float64Array]",pt="[object Int8Array]",dt="[object Int16Array]",ht="[object Int32Array]",vt="[object Uint8Array]",mt="[object Uint8ClampedArray]",yt="[object Uint16Array]",gt="[object Uint32Array]",_t=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xt=/&(?:amp|lt|gt|quot|#39);/g,kt=/[&<>"']/g,Ot=RegExp(xt.source),Et=RegExp(kt.source),Ct=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,St=/<%=([\s\S]+?)%>/g,Tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nt=/^\w*$/,jt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pt=/[\\^$.*+?()[\]{}|]/g,Mt=RegExp(Pt.source),Lt=/^\s+|\s+$/g,It=/^\s+/,Rt=/\s+$/,Dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qt=/\{\n\/\* \[wrapped with (.+)\] \*/,Bt=/,? & /,Ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$t=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,Ht=/^[-+]0x[0-9a-f]+$/i,Yt=/^0b[01]+$/i,Wt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Vt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Gt=/($^)/,Xt=/['\n\r\u2028\u2029\\]/g,Jt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Qt+"]",ne="["+Jt+"]",re="\\d+",oe="[\\u2700-\\u27bf]",ie="[a-z\\xdf-\\xf6\\xf8-\\xff]",ae="[^\\ud800-\\udfff"+Qt+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",le="[^\\ud800-\\udfff]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ce="[\\ud800-\\udbff][\\udc00-\\udfff]",fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",pe="(?:"+ie+"|"+ae+")",de="(?:"+fe+"|"+ae+")",he="(?:"+ne+"|"+se+")"+"?",ve="[\\ufe0e\\ufe0f]?"+he+("(?:\\u200d(?:"+[le,ue,ce].join("|")+")[\\ufe0e\\ufe0f]?"+he+")*"),me="(?:"+[oe,ue,ce].join("|")+")"+ve,ye="(?:"+[le+ne+"?",ne,ue,ce,te].join("|")+")",ge=RegExp("['’]","g"),_e=RegExp(ne,"g"),be=RegExp(se+"(?="+se+")|"+ye+ve,"g"),we=RegExp([fe+"?"+ie+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,fe,"$"].join("|")+")",de+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,fe+pe,"$"].join("|")+")",fe+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,me].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+Jt+"\\ufe0e\\ufe0f]"),ke=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Oe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ee=-1,Ce={};Ce[ct]=Ce[ft]=Ce[pt]=Ce[dt]=Ce[ht]=Ce[vt]=Ce[mt]=Ce[yt]=Ce[gt]=!0,Ce[$]=Ce[F]=Ce[lt]=Ce[H]=Ce[ut]=Ce[Y]=Ce[K]=Ce[V]=Ce[G]=Ce[X]=Ce[Q]=Ce[et]=Ce[nt]=Ce[rt]=Ce[at]=!1;var Ae={};Ae[$]=Ae[F]=Ae[lt]=Ae[ut]=Ae[H]=Ae[Y]=Ae[ct]=Ae[ft]=Ae[pt]=Ae[dt]=Ae[ht]=Ae[G]=Ae[X]=Ae[Q]=Ae[et]=Ae[nt]=Ae[rt]=Ae[ot]=Ae[vt]=Ae[mt]=Ae[yt]=Ae[gt]=!0,Ae[K]=Ae[V]=Ae[at]=!1;var Se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Te=parseFloat,Ne=parseInt,je="object"==typeof t&&t&&t.Object===Object&&t,Pe="object"==typeof self&&self&&self.Object===Object&&self,Me=je||Pe||Function("return this")(),Le=e&&!e.nodeType&&e,Ie=Le&&"object"==typeof r&&r&&!r.nodeType&&r,Re=Ie&&Ie.exports===Le,De=Re&&je.process,qe=function(){try{var t=Ie&&Ie.require&&Ie.require("util").types;return t||De&&De.binding&&De.binding("util")}catch(t){}}(),Be=qe&&qe.isArrayBuffer,Ue=qe&&qe.isDate,$e=qe&&qe.isMap,Fe=qe&&qe.isRegExp,ze=qe&&qe.isSet,He=qe&&qe.isTypedArray;function Ye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function We(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o-1}function Je(t,e,n){for(var r=-1,o=null==t?0:t.length;++r-1;);return n}function wn(t,e){for(var n=t.length;n--&&ln(e,t[n],0)>-1;);return n}var xn=dn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),kn=dn({"&":"&","<":"<",">":">",'"':""","'":"'"});function On(t){return"\\"+Se[t]}function En(t){return xe.test(t)}function Cn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function An(t,e){return function(n){return t(e(n))}}function Sn(t,e){for(var n=-1,r=t.length,o=0,i=[];++n",""":'"',"'":"'"});var Ln=function t(e){var n,r=(e=null==e?Me:Ln.defaults(Me.Object(),e,Ln.pick(Me,Oe))).Array,o=e.Date,Jt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,oe=e.TypeError,ie=r.prototype,ae=Qt.prototype,se=ee.prototype,le=e["__core-js_shared__"],ue=ae.toString,ce=se.hasOwnProperty,fe=0,pe=(n=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",de=se.toString,he=ue.call(ee),ve=Me._,me=ne("^"+ue.call(ce).replace(Pt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=Re?e.Buffer:i,be=e.Symbol,xe=e.Uint8Array,Se=ye?ye.allocUnsafe:i,je=An(ee.getPrototypeOf,ee),Pe=ee.create,Le=se.propertyIsEnumerable,Ie=ie.splice,De=be?be.isConcatSpreadable:i,qe=be?be.iterator:i,on=be?be.toStringTag:i,dn=function(){try{var t=Bi(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),In=e.clearTimeout!==Me.clearTimeout&&e.clearTimeout,Rn=o&&o.now!==Me.Date.now&&o.now,Dn=e.setTimeout!==Me.setTimeout&&e.setTimeout,qn=te.ceil,Bn=te.floor,Un=ee.getOwnPropertySymbols,$n=ye?ye.isBuffer:i,Fn=e.isFinite,zn=ie.join,Hn=An(ee.keys,ee),Yn=te.max,Wn=te.min,Kn=o.now,Vn=e.parseInt,Zn=te.random,Gn=ie.reverse,Xn=Bi(e,"DataView"),Jn=Bi(e,"Map"),Qn=Bi(e,"Promise"),tr=Bi(e,"Set"),er=Bi(e,"WeakMap"),nr=Bi(ee,"create"),rr=er&&new er,or={},ir=fa(Xn),ar=fa(Jn),sr=fa(Qn),lr=fa(tr),ur=fa(er),cr=be?be.prototype:i,fr=cr?cr.valueOf:i,pr=cr?cr.toString:i;function dr(t){if(Ss(t)&&!ys(t)&&!(t instanceof yr)){if(t instanceof mr)return t;if(ce.call(t,"__wrapped__"))return pa(t)}return new mr(t)}var hr=function(){function t(){}return function(e){if(!As(e))return{};if(Pe)return Pe(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function vr(){}function mr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function yr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function gr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Ir(t,e,n,r,o,a){var s,l=e&p,u=e&d,c=e&h;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!As(t))return t;var f=ys(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return ri(t,s)}else{var v=Fi(t),m=v==V||v==Z;if(ws(t))return Xo(t,l);if(v==Q||v==$||m&&!o){if(s=u||m?{}:Hi(t),!l)return u?function(t,e){return oi(t,$i(t),e)}(t,function(t,e){return t&&oi(e,il(e),t)}(s,t)):function(t,e){return oi(t,Ui(t),e)}(t,jr(s,t))}else{if(!Ae[v])return o?t:{};s=function(t,e,n){var r,o,i,a=t.constructor;switch(e){case lt:return Jo(t);case H:case Y:return new a(+t);case ut:return function(t,e){var n=e?Jo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case ct:case ft:case pt:case dt:case ht:case vt:case mt:case yt:case gt:return Qo(t,n);case G:return new a;case X:case rt:return new a(t);case et:return(i=new(o=t).constructor(o.source,zt.exec(o))).lastIndex=o.lastIndex,i;case nt:return new a;case ot:return r=t,fr?ee(fr.call(r)):{}}}(t,v,l)}}a||(a=new xr);var y=a.get(t);if(y)return y;a.set(t,s),Ms(t)?t.forEach(function(r){s.add(Ir(r,e,n,r,t,a))}):Ts(t)&&t.forEach(function(r,o){s.set(o,Ir(r,e,n,o,t,a))});var g=f?i:(c?u?Pi:ji:u?il:ol)(t);return Ke(g||t,function(r,o){g&&(r=t[o=r]),Sr(s,o,Ir(r,e,n,o,t,a))}),s}function Rr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function Dr(t,e,n){if("function"!=typeof t)throw new oe(l);return oa(function(){t.apply(i,n)},e)}function qr(t,e,n,r){var o=-1,i=Xe,s=!0,l=t.length,u=[],c=e.length;if(!l)return u;n&&(e=Qe(e,yn(n))),r?(i=Je,s=!1):e.length>=a&&(i=_n,s=!1,e=new wr(e));t:for(;++o-1},_r.prototype.set=function(t,e){var n=this.__data__,r=Tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},br.prototype.clear=function(){this.size=0,this.__data__={hash:new gr,map:new(Jn||_r),string:new gr}},br.prototype.delete=function(t){var e=Di(this,t).delete(t);return this.size-=e?1:0,e},br.prototype.get=function(t){return Di(this,t).get(t)},br.prototype.has=function(t){return Di(this,t).has(t)},br.prototype.set=function(t,e){var n=Di(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},wr.prototype.add=wr.prototype.push=function(t){return this.__data__.set(t,u),this},wr.prototype.has=function(t){return this.__data__.has(t)},xr.prototype.clear=function(){this.__data__=new _r,this.size=0},xr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},xr.prototype.get=function(t){return this.__data__.get(t)},xr.prototype.has=function(t){return this.__data__.has(t)},xr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof _r){var r=n.__data__;if(!Jn||r.length0&&n(s)?e>1?Hr(s,e-1,n,r,o):tn(o,s):r||(o[o.length]=s)}return o}var Yr=li(),Wr=li(!0);function Kr(t,e){return t&&Yr(t,e,ol)}function Vr(t,e){return t&&Wr(t,e,ol)}function Zr(t,e){return Ge(e,function(e){return Os(t[e])})}function Gr(t,e){for(var n=0,r=(e=Ko(e,t)).length;null!=t&&ne}function to(t,e){return null!=t&&ce.call(t,e)}function eo(t,e){return null!=t&&e in ee(t)}function no(t,e,n){for(var o=n?Je:Xe,a=t[0].length,s=t.length,l=s,u=r(s),c=1/0,f=[];l--;){var p=t[l];l&&e&&(p=Qe(p,yn(e))),c=Wn(p.length,c),u[l]=!n&&(e||a>=120&&p.length>=120)?new wr(l&&p):i}p=t[0];var d=-1,h=u[0];t:for(;++d=s)return l;var u=n[r];return l*("desc"==u?-1:1)}}return t.index-e.index}(t,e,n)})}function _o(t,e,n){for(var r=-1,o=e.length,i={};++r-1;)s!==t&&Ie.call(s,l,1),Ie.call(t,l,1);return t}function wo(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;Wi(o)?Ie.call(t,o,1):Bo(t,o)}}return t}function xo(t,e){return t+Bn(Zn()*(e-t+1))}function ko(t,e){var n="";if(!t||e<1||e>L)return n;do{e%2&&(n+=t),(e=Bn(e/2))&&(t+=t)}while(e);return n}function Oo(t,e){return ia(ta(t,e,Nl),t+"")}function Eo(t){return Or(dl(t))}function Co(t,e){var n=dl(t);return la(n,Lr(e,0,n.length))}function Ao(t,e,n,r){if(!As(t))return t;for(var o=-1,a=(e=Ko(e,t)).length,s=a-1,l=t;null!=l&&++oi?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=r(i);++o>>1,a=t[i];null!==a&&!Is(a)&&(n?a<=e:a=a){var c=e?null:ki(t);if(c)return Tn(c);s=!1,o=_n,u=new wr}else u=e?[]:l;t:for(;++r=r?t:jo(t,e,n)}var Go=In||function(t){return Me.clearTimeout(t)};function Xo(t,e){if(e)return t.slice();var n=t.length,r=Se?Se(n):new t.constructor(n);return t.copy(r),r}function Jo(t){var e=new t.constructor(t.byteLength);return new xe(e).set(new xe(t)),e}function Qo(t,e){var n=e?Jo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ti(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=Is(t),s=e!==i,l=null===e,u=e==e,c=Is(e);if(!l&&!c&&!a&&t>e||a&&s&&u&&!l&&!c||r&&s&&u||!n&&u||!o)return 1;if(!r&&!a&&!c&&t1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&Ki(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=ee(e);++r-1?o[a?e[s]:s]:i}}function di(t){return Ni(function(e){var n=e.length,r=n,o=mr.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new oe(l);if(o&&!s&&"wrapper"==Li(a))var s=new mr([],!0)}for(r=s?r:n;++r1&&b.reverse(),p&&cl))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var f=-1,p=!0,d=n&m?new wr:i;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Dt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ke(U,function(n){var r="_."+n[0];e&n[1]&&!Xe(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(qt);return e?e[1].split(Bt):[]}(r),n)))}function sa(t){var e=0,n=0;return function(){var r=Kn(),o=N-(r-n);if(n=r,o>0){if(++e>=T)return arguments[0]}else e=0;return t.apply(i,arguments)}}function la(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,Pa(t,n)});function Ba(t){var e=dr(t);return e.__chain__=!0,e}function Ua(t,e){return e(t)}var $a=Ni(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return Mr(e,t)};return!(e>1||this.__actions__.length)&&r instanceof yr&&Wi(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Ua,args:[o],thisArg:i}),new mr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(i),t})):this.thru(o)});var Fa=ii(function(t,e,n){ce.call(t,n)?++t[n]:Pr(t,n,1)});var za=pi(ma),Ha=pi(ya);function Ya(t,e){return(ys(t)?Ke:Br)(t,Ri(e,3))}function Wa(t,e){return(ys(t)?Ve:Ur)(t,Ri(e,3))}var Ka=ii(function(t,e,n){ce.call(t,n)?t[n].push(e):Pr(t,n,[e])});var Va=Oo(function(t,e,n){var o=-1,i="function"==typeof e,a=_s(t)?r(t.length):[];return Br(t,function(t){a[++o]=i?Ye(e,t,n):ro(t,e,n)}),a}),Za=ii(function(t,e,n){Pr(t,n,e)});function Ga(t,e){return(ys(t)?Qe:po)(t,Ri(e,3))}var Xa=ii(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Ja=Oo(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Ki(t,e[0],e[1])?e=[]:n>2&&Ki(e[0],e[1],e[2])&&(e=[e[0]]),go(t,Hr(e,1),[])}),Qa=Rn||function(){return Me.Date.now()};function ts(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ei(t,O,i,i,i,i,e)}function es(t,e){var n;if("function"!=typeof e)throw new oe(l);return t=$s(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var ns=Oo(function(t,e,n){var r=y;if(n.length){var o=Sn(n,Ii(ns));r|=x}return Ei(t,r,e,n,o)}),rs=Oo(function(t,e,n){var r=y|g;if(n.length){var o=Sn(n,Ii(rs));r|=x}return Ei(e,r,t,n,o)});function os(t,e,n){var r,o,a,s,u,c,f=0,p=!1,d=!1,h=!0;if("function"!=typeof t)throw new oe(l);function v(e){var n=r,a=o;return r=o=i,f=e,s=t.apply(a,n)}function m(t){var n=t-c;return c===i||n>=e||n<0||d&&t-f>=a}function y(){var t=Qa();if(m(t))return g(t);u=oa(y,function(t){var n=e-(t-c);return d?Wn(n,a-(t-f)):n}(t))}function g(t){return u=i,h&&r?v(t):(r=o=i,s)}function _(){var t=Qa(),n=m(t);if(r=arguments,o=this,c=t,n){if(u===i)return function(t){return f=t,u=oa(y,e),p?v(t):s}(c);if(d)return Go(u),u=oa(y,e),v(c)}return u===i&&(u=oa(y,e)),s}return e=zs(e)||0,As(n)&&(p=!!n.leading,a=(d="maxWait"in n)?Yn(zs(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h),_.cancel=function(){u!==i&&Go(u),f=0,r=c=o=u=i},_.flush=function(){return u===i?s:g(Qa())},_}var is=Oo(function(t,e){return Dr(t,1,e)}),as=Oo(function(t,e,n){return Dr(t,zs(e)||0,n)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new oe(l);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(ss.Cache||br),n}function ls(t){if("function"!=typeof t)throw new oe(l);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=br;var us=Vo(function(t,e){var n=(e=1==e.length&&ys(e[0])?Qe(e[0],yn(Ri())):Qe(Hr(e,1),yn(Ri()))).length;return Oo(function(r){for(var o=-1,i=Wn(r.length,n);++o=e}),ms=oo(function(){return arguments}())?oo:function(t){return Ss(t)&&ce.call(t,"callee")&&!Le.call(t,"callee")},ys=r.isArray,gs=Be?yn(Be):function(t){return Ss(t)&&Jr(t)==lt};function _s(t){return null!=t&&Cs(t.length)&&!Os(t)}function bs(t){return Ss(t)&&_s(t)}var ws=$n||zl,xs=Ue?yn(Ue):function(t){return Ss(t)&&Jr(t)==Y};function ks(t){if(!Ss(t))return!1;var e=Jr(t);return e==K||e==W||"string"==typeof t.message&&"string"==typeof t.name&&!js(t)}function Os(t){if(!As(t))return!1;var e=Jr(t);return e==V||e==Z||e==z||e==tt}function Es(t){return"number"==typeof t&&t==$s(t)}function Cs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=L}function As(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ss(t){return null!=t&&"object"==typeof t}var Ts=$e?yn($e):function(t){return Ss(t)&&Fi(t)==G};function Ns(t){return"number"==typeof t||Ss(t)&&Jr(t)==X}function js(t){if(!Ss(t)||Jr(t)!=Q)return!1;var e=je(t);if(null===e)return!0;var n=ce.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ue.call(n)==he}var Ps=Fe?yn(Fe):function(t){return Ss(t)&&Jr(t)==et};var Ms=ze?yn(ze):function(t){return Ss(t)&&Fi(t)==nt};function Ls(t){return"string"==typeof t||!ys(t)&&Ss(t)&&Jr(t)==rt}function Is(t){return"symbol"==typeof t||Ss(t)&&Jr(t)==ot}var Rs=He?yn(He):function(t){return Ss(t)&&Cs(t.length)&&!!Ce[Jr(t)]};var Ds=bi(fo),qs=bi(function(t,e){return t<=e});function Bs(t){if(!t)return[];if(_s(t))return Ls(t)?Pn(t):ri(t);if(qe&&t[qe])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[qe]());var e=Fi(t);return(e==G?Cn:e==nt?Tn:dl)(t)}function Us(t){return t?(t=zs(t))===M||t===-M?(t<0?-1:1)*I:t==t?t:0:0===t?t:0}function $s(t){var e=Us(t),n=e%1;return e==e?n?e-n:e:0}function Fs(t){return t?Lr($s(t),0,D):0}function zs(t){if("number"==typeof t)return t;if(Is(t))return R;if(As(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=As(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Lt,"");var n=Yt.test(t);return n||Kt.test(t)?Ne(t.slice(2),n?2:8):Ht.test(t)?R:+t}function Hs(t){return oi(t,il(t))}function Ys(t){return null==t?"":Do(t)}var Ws=ai(function(t,e){if(Xi(e)||_s(e))oi(e,ol(e),t);else for(var n in e)ce.call(e,n)&&Sr(t,n,e[n])}),Ks=ai(function(t,e){oi(e,il(e),t)}),Vs=ai(function(t,e,n,r){oi(e,il(e),t,r)}),Zs=ai(function(t,e,n,r){oi(e,ol(e),t,r)}),Gs=Ni(Mr);var Xs=Oo(function(t,e){t=ee(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&Ki(e[0],e[1],o)&&(r=1);++n1),e}),oi(t,Pi(t),n),r&&(n=Ir(n,p|d|h,Si));for(var o=e.length;o--;)Bo(n,e[o]);return n});var ul=Ni(function(t,e){return null==t?{}:function(t,e){return _o(t,e,function(e,n){return tl(t,n)})}(t,e)});function cl(t,e){if(null==t)return{};var n=Qe(Pi(t),function(t){return[t]});return e=Ri(e),_o(t,n,function(t,n){return e(t,n[0])})}var fl=Oi(ol),pl=Oi(il);function dl(t){return null==t?[]:gn(t,ol(t))}var hl=ci(function(t,e,n){return e=e.toLowerCase(),t+(n?vl(e):e)});function vl(t){return kl(Ys(t).toLowerCase())}function ml(t){return(t=Ys(t))&&t.replace(Zt,xn).replace(_e,"")}var yl=ci(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),gl=ci(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),_l=ui("toLowerCase");var bl=ci(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var wl=ci(function(t,e,n){return t+(n?" ":"")+kl(e)});var xl=ci(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),kl=ui("toUpperCase");function Ol(t,e,n){return t=Ys(t),(e=n?i:e)===i?function(t){return ke.test(t)}(t)?function(t){return t.match(we)||[]}(t):function(t){return t.match(Ut)||[]}(t):t.match(e)||[]}var El=Oo(function(t,e){try{return Ye(t,i,e)}catch(t){return ks(t)?t:new Jt(t)}}),Cl=Ni(function(t,e){return Ke(e,function(e){e=ca(e),Pr(t,e,ns(t[e],t))}),t});function Al(t){return function(){return t}}var Sl=di(),Tl=di(!0);function Nl(t){return t}function jl(t){return lo("function"==typeof t?t:Ir(t,p))}var Pl=Oo(function(t,e){return function(n){return ro(n,t,e)}}),Ml=Oo(function(t,e){return function(n){return ro(t,n,e)}});function Ll(t,e,n){var r=ol(e),o=Zr(e,r);null!=n||As(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=Zr(e,ol(e)));var i=!(As(n)&&"chain"in n&&!n.chain),a=Os(t);return Ke(o,function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=ri(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function Il(){}var Rl=yi(Qe),Dl=yi(Ze),ql=yi(rn);function Bl(t){return Vi(t)?pn(ca(t)):function(t){return function(e){return Gr(e,t)}}(t)}var Ul=_i(),$l=_i(!0);function Fl(){return[]}function zl(){return!1}var Hl=mi(function(t,e){return t+e},0),Yl=xi("ceil"),Wl=mi(function(t,e){return t/e},1),Kl=xi("floor");var Vl,Zl=mi(function(t,e){return t*e},1),Gl=xi("round"),Xl=mi(function(t,e){return t-e},0);return dr.after=function(t,e){if("function"!=typeof e)throw new oe(l);return t=$s(t),function(){if(--t<1)return e.apply(this,arguments)}},dr.ary=ts,dr.assign=Ws,dr.assignIn=Ks,dr.assignInWith=Vs,dr.assignWith=Zs,dr.at=Gs,dr.before=es,dr.bind=ns,dr.bindAll=Cl,dr.bindKey=rs,dr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ys(t)?t:[t]},dr.chain=Ba,dr.chunk=function(t,e,n){e=(n?Ki(t,e,n):e===i)?1:Yn($s(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,l=r(qn(o/e));ao?0:o+n),(r=r===i||r>o?o:$s(r))<0&&(r+=o),r=n>r?0:Fs(r);n>>0)?(t=Ys(t))&&("string"==typeof e||null!=e&&!Ps(e))&&!(e=Do(e))&&En(t)?Zo(Pn(t),0,n):t.split(e,n):[]},dr.spread=function(t,e){if("function"!=typeof t)throw new oe(l);return e=null==e?0:Yn($s(e),0),Oo(function(n){var r=n[e],o=Zo(n,0,e);return r&&tn(o,r),Ye(t,this,o)})},dr.tail=function(t){var e=null==t?0:t.length;return e?jo(t,1,e):[]},dr.take=function(t,e,n){return t&&t.length?jo(t,0,(e=n||e===i?1:$s(e))<0?0:e):[]},dr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?jo(t,(e=r-(e=n||e===i?1:$s(e)))<0?0:e,r):[]},dr.takeRightWhile=function(t,e){return t&&t.length?$o(t,Ri(e,3),!1,!0):[]},dr.takeWhile=function(t,e){return t&&t.length?$o(t,Ri(e,3)):[]},dr.tap=function(t,e){return e(t),t},dr.throttle=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new oe(l);return As(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),os(t,e,{leading:r,maxWait:e,trailing:o})},dr.thru=Ua,dr.toArray=Bs,dr.toPairs=fl,dr.toPairsIn=pl,dr.toPath=function(t){return ys(t)?Qe(t,ca):Is(t)?[t]:ri(ua(Ys(t)))},dr.toPlainObject=Hs,dr.transform=function(t,e,n){var r=ys(t),o=r||ws(t)||Rs(t);if(e=Ri(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:As(t)&&Os(i)?hr(je(t)):{}}return(o?Ke:Kr)(t,function(t,r,o){return e(n,t,r,o)}),n},dr.unary=function(t){return ts(t,1)},dr.union=Sa,dr.unionBy=Ta,dr.unionWith=Na,dr.uniq=function(t){return t&&t.length?qo(t):[]},dr.uniqBy=function(t,e){return t&&t.length?qo(t,Ri(e,2)):[]},dr.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?qo(t,i,e):[]},dr.unset=function(t,e){return null==t||Bo(t,e)},dr.unzip=ja,dr.unzipWith=Pa,dr.update=function(t,e,n){return null==t?t:Uo(t,e,Wo(n))},dr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:Uo(t,e,Wo(n),r)},dr.values=dl,dr.valuesIn=function(t){return null==t?[]:gn(t,il(t))},dr.without=Ma,dr.words=Ol,dr.wrap=function(t,e){return cs(Wo(e),t)},dr.xor=La,dr.xorBy=Ia,dr.xorWith=Ra,dr.zip=Da,dr.zipObject=function(t,e){return Ho(t||[],e||[],Sr)},dr.zipObjectDeep=function(t,e){return Ho(t||[],e||[],Ao)},dr.zipWith=qa,dr.entries=fl,dr.entriesIn=pl,dr.extend=Ks,dr.extendWith=Vs,Ll(dr,dr),dr.add=Hl,dr.attempt=El,dr.camelCase=hl,dr.capitalize=vl,dr.ceil=Yl,dr.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=zs(n))==n?n:0),e!==i&&(e=(e=zs(e))==e?e:0),Lr(zs(t),e,n)},dr.clone=function(t){return Ir(t,h)},dr.cloneDeep=function(t){return Ir(t,p|h)},dr.cloneDeepWith=function(t,e){return Ir(t,p|h,e="function"==typeof e?e:i)},dr.cloneWith=function(t,e){return Ir(t,h,e="function"==typeof e?e:i)},dr.conformsTo=function(t,e){return null==e||Rr(t,e,ol(e))},dr.deburr=ml,dr.defaultTo=function(t,e){return null==t||t!=t?e:t},dr.divide=Wl,dr.endsWith=function(t,e,n){t=Ys(t),e=Do(e);var r=t.length,o=n=n===i?r:Lr($s(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},dr.eq=ds,dr.escape=function(t){return(t=Ys(t))&&Et.test(t)?t.replace(kt,kn):t},dr.escapeRegExp=function(t){return(t=Ys(t))&&Mt.test(t)?t.replace(Pt,"\\$&"):t},dr.every=function(t,e,n){var r=ys(t)?Ze:$r;return n&&Ki(t,e,n)&&(e=i),r(t,Ri(e,3))},dr.find=za,dr.findIndex=ma,dr.findKey=function(t,e){return an(t,Ri(e,3),Kr)},dr.findLast=Ha,dr.findLastIndex=ya,dr.findLastKey=function(t,e){return an(t,Ri(e,3),Vr)},dr.floor=Kl,dr.forEach=Ya,dr.forEachRight=Wa,dr.forIn=function(t,e){return null==t?t:Yr(t,Ri(e,3),il)},dr.forInRight=function(t,e){return null==t?t:Wr(t,Ri(e,3),il)},dr.forOwn=function(t,e){return t&&Kr(t,Ri(e,3))},dr.forOwnRight=function(t,e){return t&&Vr(t,Ri(e,3))},dr.get=Qs,dr.gt=hs,dr.gte=vs,dr.has=function(t,e){return null!=t&&zi(t,e,to)},dr.hasIn=tl,dr.head=_a,dr.identity=Nl,dr.includes=function(t,e,n,r){t=_s(t)?t:dl(t),n=n&&!r?$s(n):0;var o=t.length;return n<0&&(n=Yn(o+n,0)),Ls(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&ln(t,e,n)>-1},dr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:$s(n);return o<0&&(o=Yn(r+o,0)),ln(t,e,o)},dr.inRange=function(t,e,n){return e=Us(e),n===i?(n=e,e=0):n=Us(n),function(t,e,n){return t>=Wn(e,n)&&t=-L&&t<=L},dr.isSet=Ms,dr.isString=Ls,dr.isSymbol=Is,dr.isTypedArray=Rs,dr.isUndefined=function(t){return t===i},dr.isWeakMap=function(t){return Ss(t)&&Fi(t)==at},dr.isWeakSet=function(t){return Ss(t)&&Jr(t)==st},dr.join=function(t,e){return null==t?"":zn.call(t,e)},dr.kebabCase=yl,dr.last=ka,dr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=$s(n))<0?Yn(r+o,0):Wn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):sn(t,cn,o,!0)},dr.lowerCase=gl,dr.lowerFirst=_l,dr.lt=Ds,dr.lte=qs,dr.max=function(t){return t&&t.length?Fr(t,Nl,Qr):i},dr.maxBy=function(t,e){return t&&t.length?Fr(t,Ri(e,2),Qr):i},dr.mean=function(t){return fn(t,Nl)},dr.meanBy=function(t,e){return fn(t,Ri(e,2))},dr.min=function(t){return t&&t.length?Fr(t,Nl,fo):i},dr.minBy=function(t,e){return t&&t.length?Fr(t,Ri(e,2),fo):i},dr.stubArray=Fl,dr.stubFalse=zl,dr.stubObject=function(){return{}},dr.stubString=function(){return""},dr.stubTrue=function(){return!0},dr.multiply=Zl,dr.nth=function(t,e){return t&&t.length?yo(t,$s(e)):i},dr.noConflict=function(){return Me._===this&&(Me._=ve),this},dr.noop=Il,dr.now=Qa,dr.pad=function(t,e,n){t=Ys(t);var r=(e=$s(e))?jn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return gi(Bn(o),n)+t+gi(qn(o),n)},dr.padEnd=function(t,e,n){t=Ys(t);var r=(e=$s(e))?jn(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var o=Zn();return Wn(t+o*(e-t+Te("1e-"+((o+"").length-1))),e)}return xo(t,e)},dr.reduce=function(t,e,n){var r=ys(t)?en:hn,o=arguments.length<3;return r(t,Ri(e,4),n,o,Br)},dr.reduceRight=function(t,e,n){var r=ys(t)?nn:hn,o=arguments.length<3;return r(t,Ri(e,4),n,o,Ur)},dr.repeat=function(t,e,n){return e=(n?Ki(t,e,n):e===i)?1:$s(e),ko(Ys(t),e)},dr.replace=function(){var t=arguments,e=Ys(t[0]);return t.length<3?e:e.replace(t[1],t[2])},dr.result=function(t,e,n){var r=-1,o=(e=Ko(e,t)).length;for(o||(o=1,t=i);++rL)return[];var n=D,r=Wn(t,D);e=Ri(e),t-=D;for(var o=mn(r,e);++n=a)return t;var l=n-jn(r);if(l<1)return r;var u=s?Zo(s,0,l).join(""):t.slice(0,l);if(o===i)return u+r;if(s&&(l+=u.length-l),Ps(o)){if(t.slice(l).search(o)){var c,f=u;for(o.global||(o=ne(o.source,Ys(zt.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var p=c.index;u=u.slice(0,p===i?l:p)}}else if(t.indexOf(Do(o),l)!=l){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},dr.unescape=function(t){return(t=Ys(t))&&Ot.test(t)?t.replace(xt,Mn):t},dr.uniqueId=function(t){var e=++fe;return Ys(t)+e},dr.upperCase=xl,dr.upperFirst=kl,dr.each=Ya,dr.eachRight=Wa,dr.first=_a,Ll(dr,(Vl={},Kr(dr,function(t,e){ce.call(dr.prototype,e)||(Vl[e]=t)}),Vl),{chain:!1}),dr.VERSION="4.17.13",Ke(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){dr[t].placeholder=dr}),Ke(["drop","take"],function(t,e){yr.prototype[t]=function(n){n=n===i?1:Yn($s(n),0);var r=this.__filtered__&&!e?new yr(this):this.clone();return r.__filtered__?r.__takeCount__=Wn(n,r.__takeCount__):r.__views__.push({size:Wn(n,D),type:t+(r.__dir__<0?"Right":"")}),r},yr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ke(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==j||3==n;yr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ri(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Ke(["head","last"],function(t,e){var n="take"+(e?"Right":"");yr.prototype[t]=function(){return this[n](1).value()[0]}}),Ke(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");yr.prototype[t]=function(){return this.__filtered__?new yr(this):this[n](1)}}),yr.prototype.compact=function(){return this.filter(Nl)},yr.prototype.find=function(t){return this.filter(t).head()},yr.prototype.findLast=function(t){return this.reverse().find(t)},yr.prototype.invokeMap=Oo(function(t,e){return"function"==typeof t?new yr(this):this.map(function(n){return ro(n,t,e)})}),yr.prototype.reject=function(t){return this.filter(ls(Ri(t)))},yr.prototype.slice=function(t,e){t=$s(t);var n=this;return n.__filtered__&&(t>0||e<0)?new yr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=$s(e))<0?n.dropRight(-e):n.take(e-t)),n)},yr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},yr.prototype.toArray=function(){return this.take(D)},Kr(yr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=dr[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(dr.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,l=e instanceof yr,u=s[0],c=l||ys(e),f=function(t){var e=o.apply(dr,tn([t],s));return r&&p?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var p=this.__chain__,d=!!this.__actions__.length,h=a&&!p,v=l&&!d;if(!a&&c){e=v?e:new yr(this);var m=t.apply(e,s);return m.__actions__.push({func:Ua,args:[f],thisArg:i}),new mr(m,p)}return h&&v?t.apply(this,s):(m=this.thru(f),h?r?m.value()[0]:m.value():m)})}),Ke(["pop","push","shift","sort","splice","unshift"],function(t){var e=ie[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);dr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(ys(o)?o:[],t)}return this[n](function(n){return e.apply(ys(n)?n:[],t)})}}),Kr(yr.prototype,function(t,e){var n=dr[e];if(n){var r=n.name+"";ce.call(or,r)||(or[r]=[]),or[r].push({name:e,func:n})}}),or[hi(i,g).name]=[{name:"wrapper",func:i}],yr.prototype.clone=function(){var t=new yr(this.__wrapped__);return t.__actions__=ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ri(this.__views__),t},yr.prototype.reverse=function(){if(this.__filtered__){var t=new yr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},yr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ys(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},dr.prototype.plant=function(t){for(var e,n=this;n instanceof vr;){var r=pa(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},dr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof yr){var e=t;return this.__actions__.length&&(e=new yr(this)),(e=e.reverse()).__actions__.push({func:Ua,args:[Aa],thisArg:i}),new mr(e,this.__chain__)}return this.thru(Aa)},dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=function(){return Fo(this.__wrapped__,this.__actions__)},dr.prototype.first=dr.prototype.head,qe&&(dr.prototype[qe]=function(){return this}),dr}();Me._=Ln,(o=function(){return Ln}.call(e,n,e,r))===i||(r.exports=o)}).call(this)}).call(this,n("yLpj"),n("YuTi")(t))},MLK3:function(t,e,n){var r=n("HSkj");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},MLWZ:function(t,e,n){"use strict";var r=n("xTJ+");function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var a=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(o(e)+"="+o(t))}))}),i=a.join("&")}if(i){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},OH9c:function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},OTTw:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},PK9q:function(t,e,n){var r=n("45tn");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},PMEa:function(t,e,n){"use strict";n.r(e);var r={components:{"seo-modal":n("Xi5v").a},data:function(){return{entry:null,ready:!1,id:this.$route.params.id||"new",seoModalShown:!1,form:{errors:[],working:!1,id:"",name:"",slug:"",meta:{meta_description:"",opengraph_title:"",opengraph_description:"",opengraph_image:"",opengraph_image_width:"",opengraph_image_height:"",twitter_title:"",twitter_description:"",twitter_image:""}}}},mounted:function(){var t=this;document.title="Tag — Wink.",this.http().get("/api/tags/"+this.id).then(function(e){t.entry=e.data.entry,t.form.id=e.data.entry.id,"new"!=t.id&&(t.form.name=e.data.entry.name,t.form.slug=e.data.entry.slug,t.form.meta={meta_description:e.data.entry.meta.meta_description||"",opengraph_title:e.data.entry.meta.opengraph_title||"",opengraph_description:e.data.entry.meta.opengraph_description||"",opengraph_image:e.data.entry.meta.opengraph_image||"",opengraph_image_width:e.data.entry.meta.opengraph_image_width||"",opengraph_image_height:e.data.entry.meta.opengraph_image_height||"",twitter_title:e.data.entry.meta.twitter_title||"",twitter_description:e.data.entry.meta.twitter_description||"",twitter_image:e.data.entry.meta.twitter_image||""}),t.ready=!0}).catch(function(e){t.ready=!0})},watch:{"form.slug":function(t){var e=this;this.debouncer(function(){e.form.slug=e.slugify(t)})},"form.name":function(t){var e=this;this.debouncer(function(){e.form.slug||(e.form.slug=e.slugify(t))})}},methods:{deleteTag:function(){var t=this;this.alertConfirm("Are you sure you want to delete this tag?",function(){t.http().delete("/api/tags/"+t.id,t.form).then(function(e){t.$router.push({name:"tags"})})})},save:function(){var t=this;this.form.working=!0,this.form.errors=[],this.http().post("/api/tags/"+this.id,this.form).then(function(e){t.form.working=!1,t.notifySuccess("Saved!",2e3)}).catch(function(e){t.form.errors=e.response.data.errors,t.form.working=!1})},seoModal:function(){this.seoModalShown=!0},closeSeoModal:function(t){var e=t.content;this.seoModalShown=!1,this.form.meta=e}}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("page-header",[t.ready&&t.entry?n("div",{staticClass:"flex items-center",attrs:{slot:"right-side"},slot:"right-side"},[n("button",{directives:[{name:"loading",rawName:"v-loading",value:t.form.working,expression:"form.working"}],staticClass:"py-1 px-2 btn-primary text-sm mr-6",on:{click:t.save}},[t._v("Save")]),t._v(" "),n("dropdown",{staticClass:"relative"},[n("button",{staticClass:"focus:outline-none text-light hover:text-primary h-8",attrs:{slot:"trigger"},slot:"trigger"},[n("svg",{staticClass:"w-4 h-4 fill-current mt-1",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z"}})])]),t._v(" "),n("div",{staticClass:"dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2",attrs:{slot:"content"},slot:"content"},[n("a",{staticClass:"no-underline text-text-color hover:text-primary w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.seoModal(e)}}},[t._v("\n SEO & Social\n ")]),t._v(" "),"new"!=t.id?n("a",{staticClass:"no-underline text-red w-full block py-2 px-4",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.deleteTag(e)}}},[t._v("Delete")]):t._e()])])],1):t._e()]),t._v(" "),n("div",{staticClass:"container"},[t.ready?t._e():n("preloader"),t._v(" "),t.ready&&!t.entry?n("h2",{staticClass:"text-center font-normal"},[t._v("\n 404 — Tag not found\n ")]):t._e(),t._v(" "),t.ready&&t.entry?n("div",{staticClass:"lg:w-2/3 mx-auto"},["new"!=t.id?n("h1",{staticClass:"font-semibold text-3xl mb-10"},[t._v("Edit Tag")]):n("h1",{staticClass:"font-semibold text-3xl mb-10"},[t._v("New Tag")]),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"name"}},[t._v("Tag Name")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"input",attrs:{type:"text",placeholder:"Give me a name",id:"name"},domProps:{value:t.form.name},on:{input:function(e){e.target.composing||t.$set(t.form,"name",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors.name}})],1),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"name"}},[t._v("Tag Slug")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.slug,expression:"form.slug"}],staticClass:"input",attrs:{type:"text",placeholder:"and-a-slug-please",id:"slug"},domProps:{value:t.form.slug},on:{input:function(e){e.target.composing||t.$set(t.form,"slug",e.target.value)}}}),t._v(" "),n("form-errors",{attrs:{errors:t.form.errors.slug}})],1)]):t._e()],1),t._v(" "),t.seoModalShown?n("seo-modal",{attrs:{input:t.form.meta},on:{close:t.closeSeoModal}}):t._e()],1)},[],!1,null,null,null);i.options.__file="edit.vue";e.default=i.exports},Pqzy:function(t,e,n){"use strict";n.r(e);var r=n("8JPK"),o=n.n(r),i=n("myLK"),a={mixins:[o.a],components:{filters:i.a},data:function(){return{baseURL:"/api/pages",entries:[],hasMoreEntries:!1,nextPageUrl:null,loadingMoreEntries:!1,ready:!1,searchQuery:""}},mounted:function(){document.title="Pages — Wink.",this.loadEntries()}},s=n("KHd+"),l=Object(s.a)(a,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("page-header",[n("template",{slot:"right-side"},[n("router-link",{staticClass:"py-1 px-2 btn-primary text-sm",attrs:{to:{name:"page-new"}}},[t._v("\n New Page\n ")])],1)],2),t._v(" "),n("div",{staticClass:"container"},[n("div",{staticClass:"mb-10 flex items-center"},[n("h1",{staticClass:"inline font-semibold text-3xl mr-auto"},[t._v("Pages")]),t._v(" "),n("filters",{attrs:{"is-filtered":t.isFiltered},on:{showing:t.focusSearchInput}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.searchQuery,expression:"searchQuery"}],ref:"searchInput",staticClass:"input mt-0 w-full",attrs:{type:"text",placeholder:"Search..."},domProps:{value:t.searchQuery},on:{input:function(e){e.target.composing||(t.searchQuery=e.target.value)}}})])],1),t._v(" "),t.ready?t._e():n("preloader"),t._v(" "),t.ready&&0==t.entries.length&&!t.isFiltered?n("div",[t._v("\n No pages were found, start by\n "),n("router-link",{staticClass:"no-underline text-primary hover:text-primary-dark",attrs:{to:{name:"page-new"}}},[t._v("writing your first page")]),t._v("\n .\n ")],1):t._e(),t._v(" "),t.ready&&0==t.entries.length&&t.isFiltered?n("div",[t._v("\n No pages matched the given search.\n ")]):t._e(),t._v(" "),t.ready&&t.entries.length>0?n("div",[t._l(t.entries,function(e){return n("div",{key:e.id,staticClass:"border-t border-very-light flex items-center"},[n("div",{staticClass:"py-4",attrs:{title:e.title}},[n("h2",{staticClass:"text-xl font-semibold mb-3"},[n("router-link",{staticClass:"no-underline text-text-color",attrs:{to:{name:"page-edit",params:{id:e.id}}}},[t._v("\n "+t._s(t.truncate(e.title,68))+"\n ")])],1),t._v(" "),n("p",{staticClass:"mb-3"},[t._v(t._s(t.truncate(e.body.replace(/(<([^>]+)>)/gi,""),100)))]),t._v(" "),n("small",{staticClass:"text-light"},[t._v("\n Updated "+t._s(t.timeAgo(e.updated_at))+"\n — Created "+t._s(t.timeAgo(e.created_at))+"\n ")])])])}),t._v(" "),t.hasMoreEntries?n("div",[n("div",{staticClass:"py-8 uppercase",attrs:{colspan:"100"}},[t.loadingMoreEntries?t._e():n("a",{staticClass:"no-underline text-primary",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.loadOlderEntries(e)}}},[t._v("Load more pages")]),t._v(" "),t.loadingMoreEntries?n("span",[t._v("Loading...")]):t._e()])]):t._e()],2):t._e()],1)],1)},[],!1,null,null,null);l.options.__file="index.vue";e.default=l.exports},RiWH:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},"Rn+g":function(t,e,n){"use strict";var r=n("LYNF");t.exports=function(t,e,n){var o=n.config.validateStatus;!o||o(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},ScBg:function(t,e,n){"use strict";var r=n("mvjY");n.n(r).a},SntB:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e){e=e||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(i,function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(a,function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])});var s=o.concat(i).concat(a),l=Object.keys(e).filter(function(t){return-1===s.indexOf(t)});return r.forEach(l,function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},U7GE:function(t,e){},URgk:function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.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"))},UnBK:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("xAGQ"),i=n("Lmem"),a=n("JEQr");function s(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return s(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||a.adapter)(t).then(function(e){return s(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(s(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},V5G8:function(t,e,n){var r;"undefined"!=typeof self&&self,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e){var n=this;return e="[Parchment] "+e,(n=t.call(this,e)||this).message=e,n.name=n.constructor.name,n}return o(e,t),e}(Error);e.ParchmentError=i;var a,s={},l={},u={},c={};function f(t,e){var n;if(void 0===e&&(e=a.ANY),"string"==typeof t)n=c[t]||s[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=c.text;else if("number"==typeof t)t&a.LEVEL&a.BLOCK?n=c.block:t&a.LEVEL&a.INLINE&&(n=c.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=l[r[o]])break;n=n||u[t.tagName]}return null==n?null:e&a.LEVEL&n.scope&&e&a.TYPE&n.scope?n:null}e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(a=e.Scope||(e.Scope={})),e.create=function(t,e){var n=f(t);if(null==n)throw new i("Unable to create "+t+" blot");var r=n,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e);return new r(o,e)},e.find=function t(n,r){return void 0===r&&(r=!1),null==n?null:null!=n[e.DATA_KEY]?n[e.DATA_KEY].blot:r?t(n.parentNode,r):null},e.query=f,e.register=function t(){for(var e=[],n=0;n1)return e.map(function(e){return t(e)});var r=e[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new i("Invalid definition");if("abstract"===r.blotName)throw new i("Cannot register abstract class");c[r.blotName||r.attrName]=r,"string"==typeof r.keyName?s[r.keyName]=r:(null!=r.className&&(l[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map(function(t){return t.toUpperCase()}):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach(function(t){null!=u[t]&&null!=r.className||(u[t]=r)})));return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var o=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|o:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,function(t){return t.name})},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),a=n(5),s=n(0),l=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach(function(t){t.attach()})},e.prototype.build=function(){var t=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(e){try{var n=u(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof s.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,a){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=a}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var a=null==n?s.create("text",e):s.create(e,n);this.appendChild(a)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new s.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=s.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],a=[[this,t]];return o instanceof e?a.concat(o.path(i,n)):(null!=o&&a.push([o,i]),a)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,r=[],o=[];t.forEach(function(t){t.target===n.domNode&&"childList"===t.type&&(r.push.apply(r,t.addedNodes),o.push.apply(o,t.removedNodes))}),o.forEach(function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=s.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}}),r.filter(function(t){return t.parentNode==n.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var e=null;null!=t.nextSibling&&(e=s.find(t.nextSibling));var r=u(t);r.next==e&&null!=r.next||(null!=r.parent&&r.parent.removeChild(n),n.insertBefore(r,e||void 0))})},e}(a.default);function u(t){var e=s.find(t);if(null==e)try{e=s.create(t)}catch(n){e=s.create(s.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),a=n(6),s=n(2),l=n(0),u=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new a.default(n.domNode),n}return o(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=l.query(t);n instanceof i.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some(function(t){return t.target===r.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(s.default);e.default=u},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(5),a=n(0),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);i.wrap(a),a.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=n(7),i=n(8),a=n(0),s=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),s=i.default.keys(this.domNode);e.concat(n).concat(s).forEach(function(e){var n=a.query(e,a.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){i(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(i(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(1).default);e.default=a},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[i(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[i(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[i(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(1).default);e.default=a},function(t,e,n){t.exports=n(10)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=n(3),i=n(4),a=n(12),s=n(13),l=n(14),u=n(15),c=n(16),f=n(1),p=n(7),d=n(8),h=n(6),v=n(0),m={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:c.default,Attributor:{Attribute:f.default,Class:p.default,Style:d.default,Store:h.default}};e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+l-t)):n(r,0,Math.min(l,t+e-a)),a+=l}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=n(0),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},l=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,s),n.attach(),n}return o(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var o=[].slice.call(this.observer.takeRecords());o.length>0;)e.push(o.pop());for(var s=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[a.DATA_KEY].mutations&&(t.domNode[a.DATA_KEY].mutations=[]),e&&s(t.parent))},l=function(t){null!=t.domNode[a.DATA_KEY]&&null!=t.domNode[a.DATA_KEY].mutations&&(t instanceof i.default&&t.children.forEach(l),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(t){var e=a.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(s(a.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=a.find(t,!1);s(e,!1),e instanceof i.default&&e.children.forEach(function(t){s(t,!1)})})):"attributes"===t.type&&s(e.prev)),s(e))}),this.children.forEach(l),o=(u=[].slice.call(this.observer.takeRecords())).slice();o.length>0;)e.push(o.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map(function(t){var e=a.find(t.target,!0);return null==e?null:null==e.domNode[a.DATA_KEY].mutations?(e.domNode[a.DATA_KEY].mutations=[t],e):(e.domNode[a.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==r&&null!=t.domNode[a.DATA_KEY]&&t.update(t.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="DIV",e}(i.default);e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),a=n(0);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){null!=this.formats()[r]||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var o=this.next;o instanceof e&&o.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,o.formats())&&(o.moveChildren(this),o.remove())},e.blotName="inline",e.scope=a.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),a=n(0),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){var r=a.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=a.query(r,a.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=a.query(n,a.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),i=a.create(n,r);o.parent.insertBefore(i,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="P",e}(i.default);e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(4).default);e.default=i},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),a=n(0),s=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return o(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=a.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=s}])},t.exports=r()},VeV2:function(t,e){t.exports={bind:function(t,e,n){var r=t;n.context.$watch(e.expression||"saving",function(t){t?r.setAttribute("disabled",!0):r.removeAttribute("disabled")})}}},Xi5v:function(t,e,n){"use strict";n("LvDl");var r={props:["input"],data:function(){return{facebookImageUploading:!1,twitterImageUploading:!1,form:{meta_description:"",opengraph_title:"",opengraph_description:"",opengraph_image:"",opengraph_image_width:"",opengraph_image_height:"",twitter_title:"",twitter_description:"",twitter_image:""}}},mounted:function(){this.form=this.input},methods:{close:function(){this.$emit("close",{content:this.form})},updateFacebookImage:function(t){var e=this,n=t.url,r=new Image;this.form.opengraph_image=n,r.src=n,r.onload=function(t){e.form.opengraph_image_height=t.target.height,e.form.opengraph_image_width=t.target.width},this.facebookImageUploading=!1},updateTwitterImage:function(t){var e=t.url;this.form.twitter_image=e,this.twitterImageUploading=!1}}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("modal",{on:{close:t.close}},[n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"meta_description"}},[t._v("\n Meta description\n ")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.meta_description,expression:"form.meta_description"}],staticClass:"input",attrs:{placeholder:"Meta description",id:"meta_description"},domProps:{value:t.form.meta_description},on:{input:function(e){e.target.composing||t.$set(t.form,"meta_description",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"opengraph_title"}},[t._v("\n Facebook Card Title\n ")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.opengraph_title,expression:"form.opengraph_title"}],staticClass:"input",attrs:{type:"text",placeholder:"Title in Facebook Card",id:"opengraph_title"},domProps:{value:t.form.opengraph_title},on:{input:function(e){e.target.composing||t.$set(t.form,"opengraph_title",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"opengraph_description"}},[t._v("\n Facebook Card Description\n ")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.opengraph_description,expression:"form.opengraph_description"}],staticClass:"input",attrs:{placeholder:"Description in Facebook Card",id:"opengraph_description"},domProps:{value:t.form.opengraph_description},on:{input:function(e){e.target.composing||t.$set(t.form,"opengraph_description",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"input-group py-4"},[n("div",{staticClass:"flex items-center justify-between"},[n("div",[n("label",{staticClass:"input-label"},[t._v("\n Facebook Card Image\n ")]),t._v(" "),n("image-picker",{staticClass:"mt-4 mb-1",on:{changed:t.updateFacebookImage,uploading:function(e){t.facebookImageUploading=!0}}})],1),t._v(" "),t.facebookImageUploading?n("preloader"):t._e(),t._v(" "),t.facebookImageUploading?t._e():n("div",[t.form.opengraph_image?t._e():n("div",{staticClass:"w-16 h-16 rounded-full bg-light flex items-center justify-center text-4xl text-contrast"},[n("svg",{staticClass:"fill-current w-8",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M0 6c0-1.1.9-2 2-2h3l2-2h6l2 2h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm10 10a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0-2a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"}})])]),t._v(" "),t.form.opengraph_image?n("div",{staticClass:"w-16 h-16 rounded-full bg-cover",style:{backgroundImage:"url("+t.form.opengraph_image+")"}}):t._e()]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.opengraph_image_width,expression:"form.opengraph_image_width"}],attrs:{type:"hidden"},domProps:{value:t.form.opengraph_image_width},on:{input:function(e){e.target.composing||t.$set(t.form,"opengraph_image_width",e.target.value)}}}),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.opengraph_image_height,expression:"form.opengraph_image_height"}],attrs:{type:"hidden"},domProps:{value:t.form.opengraph_image_height},on:{input:function(e){e.target.composing||t.$set(t.form,"opengraph_image_height",e.target.value)}}})],1)]),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"twitter_title"}},[t._v("\n Twitter Card Title\n ")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.form.twitter_title,expression:"form.twitter_title"}],staticClass:"input",attrs:{type:"text",placeholder:"Title in Twitter Card",id:"twitter_title"},domProps:{value:t.form.twitter_title},on:{input:function(e){e.target.composing||t.$set(t.form,"twitter_title",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label",attrs:{for:"twitter_description"}},[t._v("\n Twitter Card Description\n ")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.twitter_description,expression:"form.twitter_description"}],staticClass:"input",attrs:{placeholder:"Description in Twitter Card",id:"twitter_description"},domProps:{value:t.form.twitter_description},on:{input:function(e){e.target.composing||t.$set(t.form,"twitter_description",e.target.value)}}})]),t._v(" "),n("div",{staticClass:"input-group py-4"},[n("div",{staticClass:"flex items-center justify-between"},[n("div",[n("label",{staticClass:"input-label"},[t._v("\n Twitter Card Image\n ")]),t._v(" "),n("image-picker",{staticClass:"mt-4 mb-1",on:{changed:t.updateTwitterImage,uploading:function(e){t.twitterImageUploading=!0}}})],1),t._v(" "),t.twitterImageUploading?n("preloader"):t._e(),t._v(" "),t.twitterImageUploading?t._e():n("div",[t.form.twitter_image?t._e():n("div",{staticClass:"w-16 h-16 rounded-full bg-light flex items-center justify-center text-4xl text-contrast"},[n("svg",{staticClass:"fill-current w-8",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M0 6c0-1.1.9-2 2-2h3l2-2h6l2 2h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm10 10a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0-2a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"}})])]),t._v(" "),t.form.twitter_image?n("div",{staticClass:"w-16 h-16 rounded-full bg-cover",style:{backgroundImage:"url("+t.form.twitter_image+")"}}):t._e()])],1)]),t._v(" "),n("div",{staticClass:"mt-10"},[n("button",{staticClass:"btn-sm btn-primary",on:{click:t.close}},[t._v("Done")])])])},[],!1,null,null,null);i.options.__file="SEOModal.vue";e.a=i.exports},XuX8:function(t,e,n){"use strict";(function(e,n){var r=Object.freeze({});function o(t){return null==t}function i(t){return null!=t}function a(t){return!0===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function l(t){return null!==t&&"object"==typeof t}var u=Object.prototype.toString;function c(t){return"[object Object]"===u.call(t)}function f(t){return"[object RegExp]"===u.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function b(t,e){return _.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,k=w(function(t){return t.replace(x,function(t,e){return e?e.toUpperCase():""})}),O=w(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),E=/\B([A-Z])/g,C=w(function(t){return t.replace(E,"-$1").toLowerCase()});var A=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function S(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function T(t,e){for(var n in e)t[n]=e[n];return t}function N(t){for(var e={},n=0;n0,X=V&&V.indexOf("edge/")>0,J=(V&&V.indexOf("android"),V&&/iphone|ipad|ipod|ios/.test(V)||"ios"===K),Q=(V&&/chrome\/\d+/.test(V),{}.watch),tt=!1;if(Y)try{var et={};Object.defineProperty(et,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,et)}catch(t){}var nt=function(){return void 0===z&&(z=!Y&&!W&&void 0!==e&&(e.process&&"server"===e.process.env.VUE_ENV)),z},rt=Y&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ot(t){return"function"==typeof t&&/native code/.test(t.toString())}var it,at="undefined"!=typeof Symbol&&ot(Symbol)&&"undefined"!=typeof Reflect&&ot(Reflect.ownKeys);it="undefined"!=typeof Set&&ot(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var st=j,lt=0,ut=function(){this.id=lt++,this.subs=[]};ut.prototype.addSub=function(t){this.subs.push(t)},ut.prototype.removeSub=function(t){g(this.subs,t)},ut.prototype.depend=function(){ut.target&&ut.target.addDep(this)},ut.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(i&&!b(o,"default"))a=!1;else if(""===a||a===C(t)){var l=Bt(String,o.type);(l<0||s0&&(le((u=t(u,(n||"")+"_"+l))[0])&&le(f)&&(r[c]=mt(f.text+u[0].text),u.shift()),r.push.apply(r,u)):s(u)?le(f)?r[c]=mt(f.text+u):""!==u&&r.push(mt(u)):le(u)&&le(f)?r[c]=mt(f.text+u.text):(a(e._isVList)&&i(u.tag)&&o(u.key)&&i(n)&&(u.key="__vlist"+n+"_"+l+"__"),r.push(u)));return r}(t):void 0}function le(t){return i(t)&&i(t.text)&&!1===t.isComment}function ue(t,e){return(t.__esModule||at&&"Module"===t[Symbol.toStringTag])&&(t=t.default),l(t)?e.extend(t):t}function ce(t){return t.isComment&&t.asyncFactory}function fe(t){if(Array.isArray(t))for(var e=0;eTe&&Oe[n].id>t.id;)n--;Oe.splice(n+1,0,t)}else Oe.push(t);Ae||(Ae=!0,Jt(Ne))}}(this)},Pe.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){Ut(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},Pe.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Pe.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},Pe.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var Me={enumerable:!0,configurable:!0,get:j,set:j};function Le(t,e,n){Me.get=function(){return this[e][n]},Me.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Me)}function Ie(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},o=t.$options._propKeys=[];t.$parent&&xt(!1);var i=function(i){o.push(i);var a=Rt(i,e,n,t);Et(r,i,a),i in t||Le(t,"_props",i)};for(var a in e)i(a);xt(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?j:A(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;c(e=t._data="function"==typeof e?function(t,e){ft();try{return t.call(e,e)}catch(t){return Ut(t,e,"data()"),{}}finally{pt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,o=(t.$options.methods,n.length);for(;o--;){var i=n[o];0,r&&b(r,i)||(a=void 0,36!==(a=(i+"").charCodeAt(0))&&95!==a&&Le(t,"_data",i))}var a;Ot(e,!0)}(t):Ot(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=nt();for(var o in e){var i=e[o],a="function"==typeof i?i:i.get;0,r||(n[o]=new Pe(t,a||j,j,Re)),o in t||De(t,o,i)}}(t,e.computed),e.watch&&e.watch!==Q&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var o=0;o=0||n.indexOf(t[o])<0)&&r.push(t[o]);return r}return t}function hn(t){this._init(t)}function vn(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=t.name||n.options.name;var a=function(t){this._init(t)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=e++,a.options=Lt(n.options,t),a.super=n,a.options.props&&function(t){var e=t.options.props;for(var n in e)Le(t.prototype,"_props",n)}(a),a.options.computed&&function(t){var e=t.options.computed;for(var n in e)De(t.prototype,n,e[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,q.forEach(function(t){a[t]=n[t]}),i&&(a.options.components[i]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=T({},a.options),o[r]=a,a}}function mn(t){return t&&(t.Ctor.options.name||t.tag)}function yn(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function gn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var a=n[i];if(a){var s=mn(a.componentOptions);s&&!e(s)&&_n(n,i,r,o)}}}function _n(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,g(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=fn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Lt(pn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ve(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=me(e._renderChildren,o),t.$scopedSlots=r,t._c=function(e,n,r,o){return cn(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return cn(t,e,n,r,o,!0)};var i=n&&n.data;Et(t,"$attrs",i&&i.attrs||r,null,!0),Et(t,"$listeners",e._parentListeners||r,null,!0)}(e),ke(e,"beforeCreate"),function(t){var e=$e(t.$options.inject,t);e&&(xt(!1),Object.keys(e).forEach(function(n){Et(t,n,e[n])}),xt(!0))}(e),Ie(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),ke(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(hn),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Ct,t.prototype.$delete=At,t.prototype.$watch=function(t,e,n){if(c(e))return Ue(this,t,e,n);(n=n||{}).user=!0;var r=new Pe(this,t,e,n);if(n.immediate)try{e.call(this,r.value)}catch(t){Ut(t,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(hn),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var o=0,i=t.length;o1?S(e):e;for(var n=S(arguments,1),r=0,o=e.length;rparseInt(this.max)&&_n(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:st,extend:T,mergeOptions:Lt,defineReactive:Et},t.set=Ct,t.delete=At,t.nextTick=Jt,t.options=Object.create(null),q.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,T(t.options.components,wn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=S(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Lt(this.options,t),this}}(t),vn(t),function(t){q.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}(t)}(hn),Object.defineProperty(hn.prototype,"$isServer",{get:nt}),Object.defineProperty(hn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(hn,"FunctionalRenderContext",{value:tn}),hn.version="2.5.21";var xn=v("style,class"),kn=v("input,textarea,option,select,progress"),On=function(t,e,n){return"value"===n&&kn(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},En=v("contenteditable,draggable,spellcheck"),Cn=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),An="http://www.w3.org/1999/xlink",Sn=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Tn=function(t){return Sn(t)?t.slice(6,t.length):""},Nn=function(t){return null==t||!1===t};function jn(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Pn(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=Pn(e,n.data));return function(t,e){if(i(t)||i(e))return Mn(t,Ln(e));return""}(e.staticClass,e.class)}function Pn(t,e){return{staticClass:Mn(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Mn(t,e){return t?e?t+" "+e:t:e||""}function Ln(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r-1?ir(t,e,n):Cn(e)?Nn(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):En(e)?t.setAttribute(e,Nn(n)||"false"===n?"false":"true"):Sn(e)?Nn(n)?t.removeAttributeNS(An,Tn(e)):t.setAttributeNS(An,e,n):ir(t,e,n)}function ir(t,e,n){if(Nn(n))t.removeAttribute(e);else{if(Z&&!G&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)&&"placeholder"===e&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var ar={create:rr,update:rr};function sr(t,e){var n=e.elm,r=e.data,a=t.data;if(!(o(r.staticClass)&&o(r.class)&&(o(a)||o(a.staticClass)&&o(a.class)))){var s=jn(e),l=n._transitionClasses;i(l)&&(s=Mn(s,Ln(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var lr,ur,cr,fr,pr,dr,hr={create:sr,update:sr},vr=/[\w).+\-_$\]]/;function mr(t){var e,n,r,o,i,a=!1,s=!1,l=!1,u=!1,c=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(v=t.charAt(h));h--);v&&vr.test(v)||(u=!0)}}else void 0===o?(d=r+1,o=t.slice(0,r).trim()):m();function m(){(i||(i=[])).push(t.slice(d,r).trim()),d=r+1}if(void 0===o?o=t.slice(0,r).trim():0!==d&&m(),i)for(r=0;r-1?{exp:t.slice(0,fr),key:'"'+t.slice(fr+1)+'"'}:{exp:t,key:null};ur=t,fr=pr=dr=0;for(;!Nr();)jr(cr=Tr())?Mr(cr):91===cr&&Pr(cr);return{exp:t.slice(0,pr),key:t.slice(pr+1,dr)}}(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function Tr(){return ur.charCodeAt(++fr)}function Nr(){return fr>=lr}function jr(t){return 34===t||39===t}function Pr(t){var e=1;for(pr=fr;!Nr();)if(jr(t=Tr()))Mr(t);else if(91===t&&e++,93===t&&e--,0===e){dr=fr;break}}function Mr(t){for(var e=t;!Nr()&&(t=Tr())!==e;);}var Lr,Ir="__r",Rr="__c";function Dr(t,e,n){var r=Lr;return function o(){null!==e.apply(null,arguments)&&Br(t,o,n,r)}}function qr(t,e,n,r){var o;e=(o=e)._withTask||(o._withTask=function(){Vt=!0;try{return o.apply(null,arguments)}finally{Vt=!1}}),Lr.addEventListener(t,e,tt?{capture:n,passive:r}:n)}function Br(t,e,n,r){(r||Lr).removeEventListener(t,e._withTask||e,n)}function Ur(t,e){if(!o(t.data.on)||!o(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Lr=e.elm,function(t){if(i(t[Ir])){var e=Z?"change":"input";t[e]=[].concat(t[Ir],t[e]||[]),delete t[Ir]}i(t[Rr])&&(t.change=[].concat(t[Rr],t.change||[]),delete t[Rr])}(n),oe(n,r,qr,Br,Dr,e.context),Lr=void 0}}var $r={create:Ur,update:Ur};function Fr(t,e){if(!o(t.data.domProps)||!o(e.data.domProps)){var n,r,a=e.elm,s=t.data.domProps||{},l=e.data.domProps||{};for(n in i(l.__ob__)&&(l=e.data.domProps=T({},l)),s)o(l[n])&&(a[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n){a._value=r;var u=o(r)?"":String(r);zr(a,u)&&(a.value=u)}else a[n]=r}}}function zr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.lazy)return!1;if(r.number)return h(n)!==h(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Hr={create:Fr,update:Fr},Yr=w(function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach(function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e});function Wr(t){var e=Kr(t.style);return t.staticStyle?T(t.staticStyle,e):e}function Kr(t){return Array.isArray(t)?N(t):"string"==typeof t?Yr(t):t}var Vr,Zr=/^--/,Gr=/\s*!important$/,Xr=function(t,e,n){if(Zr.test(e))t.style.setProperty(e,n);else if(Gr.test(n))t.style.setProperty(e,n.replace(Gr,""),"important");else{var r=Qr(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(no).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function oo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(no).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function io(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&T(e,ao(t.name||"v")),T(e,t),e}return"string"==typeof t?ao(t):void 0}}var ao=w(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),so=Y&&!G,lo="transition",uo="animation",co="transition",fo="transitionend",po="animation",ho="animationend";so&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(co="WebkitTransition",fo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(po="WebkitAnimation",ho="webkitAnimationEnd"));var vo=Y?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function mo(t){vo(function(){vo(t)})}function yo(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),ro(t,e))}function go(t,e){t._transitionClasses&&g(t._transitionClasses,e),oo(t,e)}function _o(t,e,n){var r=wo(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===lo?fo:ho,l=0,u=function(){t.removeEventListener(s,c),n()},c=function(e){e.target===t&&++l>=a&&u()};setTimeout(function(){l0&&(n=lo,c=a,f=i.length):e===uo?u>0&&(n=uo,c=u,f=l.length):f=(n=(c=Math.max(a,u))>0?a>u?lo:uo:null)?n===lo?i.length:l.length:0,{type:n,timeout:c,propCount:f,hasTransform:n===lo&&bo.test(r[co+"Property"])}}function xo(t,e){for(;t.length1}function So(t,e){!0!==e.data.show&&Oo(e)}var To=function(t){var e,n,r={},l=t.modules,u=t.nodeOps;for(e=0;eh?_(t,o(n[y+1])?null:n[y+1].elm,n,d,y,r):d>y&&w(0,e,p,h)}(p,v,y,n,c):i(y)?(i(t.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,n)):i(v)?w(0,v,0,v.length-1):i(t.text)&&u.setTextContent(p,""):t.text!==e.text&&u.setTextContent(p,e.text),i(h)&&i(d=h.hook)&&i(d=d.postpatch)&&d(t,e)}}}function E(t,e,n){if(a(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==i&&(a.selected=i);else if(L(Lo(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function Mo(t,e){return e.every(function(e){return!L(e,t)})}function Lo(t){return"_value"in t?t._value:t.value}function Io(t){t.target.composing=!0}function Ro(t){t.target.composing&&(t.target.composing=!1,Do(t.target,"input"))}function Do(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function qo(t){return!t.componentInstance||t.data&&t.data.transition?t:qo(t.componentInstance._vnode)}var Bo={model:No,show:{bind:function(t,e,n){var r=e.value,o=(n=qo(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,Oo(n,function(){t.style.display=i})):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=qo(n)).data&&n.data.transition?(n.data.show=!0,r?Oo(n,function(){t.style.display=t.__vOriginalDisplay}):Eo(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},Uo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function $o(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?$o(fe(e.children)):t}function Fo(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var i in o)e[k(i)]=o[i];return e}function zo(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Ho=function(t){return t.tag||ce(t)},Yo=function(t){return"show"===t.name},Wo={name:"transition",props:Uo,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Ho)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=$o(o);if(!i)return o;if(this._leaving)return zo(t,o);var a="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?a+"comment":a+i.tag:s(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var l=(i.data||(i.data={})).transition=Fo(this),u=this._vnode,c=$o(u);if(i.data.directives&&i.data.directives.some(Yo)&&(i.data.show=!0),c&&c.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,c)&&!ce(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var f=c.data.transition=T({},l);if("out-in"===r)return this._leaving=!0,ie(f,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),zo(t,o);if("in-out"===r){if(ce(i))return u;var p,d=function(){p()};ie(l,"afterEnter",d),ie(l,"enterCancelled",d),ie(f,"delayLeave",function(t){p=t})}}return o}}},Ko=T({tag:String,moveClass:String},Uo);function Vo(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Zo(t){t.data.newPos=t.elm.getBoundingClientRect()}function Go(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}delete Ko.mode;var Xo={Transition:Wo,TransitionGroup:{props:Ko,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=be(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=Fo(this),s=0;s-1?Un[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Un[t]=/HTMLUnknownElement/.test(e.toString())},T(hn.options.directives,Bo),T(hn.options.components,Xo),hn.prototype.__patch__=Y?To:j,hn.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=vt),ke(t,"beforeMount"),r=function(){t._update(t._render(),n)},new Pe(t,r,j,{before:function(){t._isMounted&&!t._isDestroyed&&ke(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,ke(t,"mounted")),t}(this,t=t&&Y?Fn(t):void 0,e)},Y&&setTimeout(function(){U.devtools&&rt&&rt.emit("init",hn)},0);var Jo=/\{\{((?:.|\r?\n)+?)\}\}/g,Qo=/[-.*+?^${}()|[\]\/\\]/g,ti=w(function(t){var e=t[0].replace(Qo,"\\$&"),n=t[1].replace(Qo,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")});var ei={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var n=Cr(t,"class");n&&(t.staticClass=JSON.stringify(n));var r=Er(t,"class",!1);r&&(t.classBinding=r)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}};var ni,ri={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var n=Cr(t,"style");n&&(t.staticStyle=JSON.stringify(Yr(n)));var r=Er(t,"style",!1);r&&(t.styleBinding=r)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},oi=function(t){return(ni=ni||document.createElement("div")).innerHTML=t,ni.textContent},ii=v("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),ai=v("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),si=v("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),li=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ui="[a-zA-Z_][\\w\\-\\.]*",ci="((?:"+ui+"\\:)?"+ui+")",fi=new RegExp("^<"+ci),pi=/^\s*(\/?)>/,di=new RegExp("^<\\/"+ci+"[^>]*>"),hi=/^]+>/i,vi=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},bi=/&(?:lt|gt|quot|amp);/g,wi=/&(?:lt|gt|quot|amp|#10|#9);/g,xi=v("pre,textarea",!0),ki=function(t,e){return t&&xi(t)&&"\n"===e[0]};function Oi(t,e){var n=e?wi:bi;return t.replace(n,function(t){return _i[t]})}var Ei,Ci,Ai,Si,Ti,Ni,ji,Pi,Mi=/^@|^v-on:/,Li=/^v-|^@|^:/,Ii=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Ri=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Di=/^\(|\)$/g,qi=/:(.*)$/,Bi=/^:|^v-bind:/,Ui=/\.[^.]+/g,$i=w(oi);function Fi(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:Vi(e),parent:n,children:[]}}function zi(t,e){Ei=e.warn||gr,Ni=e.isPreTag||P,ji=e.mustUseProp||P,Pi=e.getTagNamespace||P,Ai=_r(e.modules,"transformNode"),Si=_r(e.modules,"preTransformNode"),Ti=_r(e.modules,"postTransformNode"),Ci=e.delimiters;var n,r,o=[],i=!1!==e.preserveWhitespace,a=!1,s=!1;function l(t){t.pre&&(a=!1),Ni(t.tag)&&(s=!1);for(var n=0;n]*>)","i")),p=t.replace(f,function(t,n,r){return u=r.length,yi(c)||"noscript"===c||(n=n.replace(//g,"$1").replace(//g,"$1")),ki(c,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});l+=t.length-p.length,t=p,C(c,l-u,l)}else{var d=t.indexOf("<");if(0===d){if(vi.test(t)){var h=t.indexOf("--\x3e");if(h>=0){e.shouldKeepComment&&e.comment(t.substring(4,h)),k(h+3);continue}}if(mi.test(t)){var v=t.indexOf("]>");if(v>=0){k(v+2);continue}}var m=t.match(hi);if(m){k(m[0].length);continue}var y=t.match(di);if(y){var g=l;k(y[0].length),C(y[1],g,l);continue}var _=O();if(_){E(_),ki(_.tagName,t)&&k(1);continue}}var b=void 0,w=void 0,x=void 0;if(d>=0){for(w=t.slice(d);!(di.test(w)||fi.test(w)||vi.test(w)||mi.test(w)||(x=w.indexOf("<",1))<0);)d+=x,w=t.slice(d);b=t.substring(0,d),k(d)}d<0&&(b=t,t=""),e.chars&&b&&e.chars(b)}if(t===n){e.chars&&e.chars(t);break}}function k(e){l+=e,t=t.substring(e)}function O(){var e=t.match(fi);if(e){var n,r,o={tagName:e[1],attrs:[],start:l};for(k(e[0].length);!(n=t.match(pi))&&(r=t.match(li));)k(r[0].length),o.attrs.push(r);if(n)return o.unarySlash=n[1],k(n[0].length),o.end=l,o}}function E(t){var n=t.tagName,l=t.unarySlash;i&&("p"===r&&si(n)&&C(r),s(n)&&r===n&&C(n));for(var u=a(n)||!!l,c=t.attrs.length,f=new Array(c),p=0;p=0&&o[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=o.length-1;u>=a;u--)e.end&&e.end(o[u].tag,n,i);o.length=a,r=a&&o[a-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,i):"p"===s&&(e.start&&e.start(t,[],!1,n,i),e.end&&e.end(t,n,i))}C()}(t,{warn:Ei,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,start:function(t,i,u){var c=r&&r.ns||Pi(t);Z&&"svg"===c&&(i=function(t){for(var e=[],n=0;nl&&(s.push(i=t.slice(l,o)),a.push(JSON.stringify(i)));var u=mr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),l=o+r[0].length}return l-1"+("true"===i?":("+e+")":":_q("+e+","+i+")")),Or(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+o+")":o)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Sr(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Sr(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Sr(e,"$$c")+"}",null,!0)}(t,r,o);else if("input"===i&&"radio"===a)!function(t,e,n){var r=n&&n.number,o=Er(t,"value")||"null";br(t,"checked","_q("+e+","+(o=r?"_n("+o+")":o)+")"),Or(t,"change",Sr(e,o),null,!0)}(t,r,o);else if("input"===i||"textarea"===i)!function(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,a=o.number,s=o.trim,l=!i&&"range"!==r,u=i?"change":"range"===r?Ir:"input",c="$event.target.value";s&&(c="$event.target.value.trim()"),a&&(c="_n("+c+")");var f=Sr(e,c);l&&(f="if($event.target.composing)return;"+f),br(t,"value","("+e+")"),Or(t,u,f,null,!0),(s||a)&&Or(t,"blur","$forceUpdate()")}(t,r,o);else if(!U.isReservedTag(i))return Ar(t,r,o),!1;return!0},text:function(t,e){e.value&&br(t,"textContent","_s("+e.value+")")},html:function(t,e){e.value&&br(t,"innerHTML","_s("+e.value+")")}},isPreTag:function(t){return"pre"===t},isUnaryTag:ii,mustUseProp:On,canBeLeftOpenTag:ai,isReservedTag:qn,getTagNamespace:Bn,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(Ji)},na=w(function(t){return v("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(t?","+t:""))});function ra(t,e){t&&(Qi=na(e.staticKeys||""),ta=e.isReservedTag||P,function t(e){e.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!ta(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Qi)))}(e);if(1===e.type){if(!ta(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var n=0,r=e.children.length;n|^function\s*\(/,ia=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,aa={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},sa={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},la=function(t){return"if("+t+")return null;"},ua={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:la("$event.target !== $event.currentTarget"),ctrl:la("!$event.ctrlKey"),shift:la("!$event.shiftKey"),alt:la("!$event.altKey"),meta:la("!$event.metaKey"),left:la("'button' in $event && $event.button !== 0"),middle:la("'button' in $event && $event.button !== 1"),right:la("'button' in $event && $event.button !== 2")};function ca(t,e){var n=e?"nativeOn:{":"on:{";for(var r in t)n+='"'+r+'":'+fa(r,t[r])+",";return n.slice(0,-1)+"}"}function fa(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return fa(t,e)}).join(",")+"]";var n=ia.test(e.value),r=oa.test(e.value);if(e.modifiers){var o="",i="",a=[];for(var s in e.modifiers)if(ua[s])i+=ua[s],aa[s]&&a.push(s);else if("exact"===s){var l=e.modifiers;i+=la(["ctrl","shift","alt","meta"].filter(function(t){return!l[t]}).map(function(t){return"$event."+t+"Key"}).join("||"))}else a.push(s);return a.length&&(o+=function(t){return"if(!('button' in $event)&&"+t.map(pa).join("&&")+")return null;"}(a)),i&&(o+=i),"function($event){"+o+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function pa(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=aa[t],r=sa[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var da={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}},cloak:j},ha=function(t){this.options=t,this.warn=t.warn||gr,this.transforms=_r(t.modules,"transformCode"),this.dataGenFns=_r(t.modules,"genData"),this.directives=T(T({},da),t.directives);var e=t.isReservedTag||P;this.maybeComponent=function(t){return!(e(t.tag)&&!t.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function va(t,e){var n=new ha(e);return{render:"with(this){return "+(t?ma(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function ma(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return ya(t,e);if(t.once&&!t.onceProcessed)return ga(t,e);if(t.for&&!t.forProcessed)return function(t,e,n,r){var o=t.for,i=t.alias,a=t.iterator1?","+t.iterator1:"",s=t.iterator2?","+t.iterator2:"";0;return t.forProcessed=!0,(r||"_l")+"(("+o+"),function("+i+a+s+"){return "+(n||ma)(t,e)+"})"}(t,e);if(t.if&&!t.ifProcessed)return _a(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=xa(t,e),o="_t("+n+(r?","+r:""),i=t.attrs&&"{"+t.attrs.map(function(t){return k(t.name)+":"+t.value}).join(",")+"}",a=t.attrsMap["v-bind"];!i&&!a||r||(o+=",null");i&&(o+=","+i);a&&(o+=(i?"":",null")+","+a);return o+")"}(t,e);var n;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:xa(e,n,!0);return"_c("+t+","+ba(e,n)+(r?","+r:"")+")"}(t.component,t,e);else{var r;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=ba(t,e));var o=t.inlineTemplate?null:xa(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(o?","+o:"")+")"}for(var i=0;i':'
',Na.innerHTML.indexOf(" ")>0}var La=!!Y&&Ma(!1),Ia=!!Y&&Ma(!0),Ra=w(function(t){var e=Fn(t);return e&&e.innerHTML}),Da=hn.prototype.$mount;hn.prototype.$mount=function(t,e){if((t=t&&Fn(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ra(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(r){0;var o=Pa(r,{shouldDecodeNewlines:La,shouldDecodeNewlinesForHref:Ia,delimiters:n.delimiters,comments:n.comments},this),i=o.render,a=o.staticRenderFns;n.render=i,n.staticRenderFns=a}}return Da.call(this,t,e)},hn.compile=Pa,t.exports=hn}).call(this,n("yLpj"),n("URgk").setImmediate)},YBdB:function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,o,i,a,s,l=1,u={},c=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){h(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?((i=new MessageChannel).port1.onmessage=function(t){h(t.data)},r=function(t){i.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(t){var e=f.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):r=function(t){setTimeout(h,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&h(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0&&c.splice(e,1)}function m(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 y(e,t.attrs),h(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var a=u++;n=l||(l=m(e)),r=w.bind(null,n,a,!1),o=w.bind(null,n,a,!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",y(e,t.attrs),h(t,e),e}(e),r=function(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),o=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=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 o()}}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=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:70;return a.a.truncate(t,{length:e,separator:/,? +/})},debouncer:a.a.debounce(function(t){return t()},500),slugify:function(t){return t.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-")},http:function(){var t=l.a.create();return t.defaults.baseURL="/"+Wink.path,t.interceptors.response.use(function(t){return t},function(t){switch(t.response.status){case 500:f.$emit("httpError",t.response.data.message);break;case 401:window.location.href="/"+Wink.path+"/logout"}return Promise.reject(t)}),t},alertError:function(t){this.$root.alert.type="error",this.$root.alert.autoClose=!1,this.$root.alert.message=t},alertConfirm:function(t,e,n){this.$root.alert.type="confirmation",this.$root.alert.autoClose=!1,this.$root.alert.message=t,this.$root.alert.confirmationProceed=e,this.$root.alert.confirmationCancel=n},notifySuccess:function(t,e){this.$root.notification.type="success",this.$root.notification.autoClose=e,this.$root.notification.message=t}}},d=[{path:"/",redirect:"/posts"},{path:"/posts",name:"posts",component:n("HfvJ").default},{path:"/posts/new",name:"post-new",component:n("Kui3").default},{path:"/posts/:id",name:"post-edit",component:n("Kui3").default},{path:"/tags",name:"tags",component:n("xOYe").default},{path:"/tags/new",name:"tag-new",component:n("PMEa").default},{path:"/tags/:id",name:"tag-edit",component:n("PMEa").default},{path:"/team",name:"team",component:n("9GH7").default},{path:"/team/new",name:"team-new",component:n("/PdW").default},{path:"/team/:id",name:"team-edit",component:n("/PdW").default},{path:"/pages",name:"pages",component:n("Pqzy").default},{path:"/pages/new",name:"page-new",component:n("JmSe").default},{path:"/pages/:id",name:"page-edit",component:n("JmSe").default},{path:"*",name:"catch-all",component:n("nabw").default}];function h(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}var v={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,o=e.parent,i=e.data;i.routerView=!0;for(var a=o.$createElement,s=n.name,l=o.$route,u=o._routerViewCache||(o._routerViewCache={}),c=0,f=!1;o&&o._routerRoot!==o;)o.$vnode&&o.$vnode.data.routerView&&c++,o._inactive&&(f=!0),o=o.$parent;if(i.routerViewDepth=c,f)return a(u[s],i,r);var p=l.matched[c];if(!p)return u[s]=null,a();var d=u[s]=p.components[s];i.registerRouteInstance=function(t,e){var n=p.instances[s];(e&&n!==t||!e&&n===t)&&(p.instances[s]=e)},(i.hook||(i.hook={})).prepatch=function(t,e){p.instances[s]=e.componentInstance};var h=i.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}(l,p.props&&p.props[s]);if(h){h=i.props=function(t,e){for(var n in e)t[n]=e[n];return t}({},h);var v=i.attrs=i.attrs||{};for(var m in h)d.props&&m in d.props||(v[m]=h[m],delete h[m])}return a(d,i,r)}};var m=/[!'()*]/g,y=function(t){return"%"+t.charCodeAt(0).toString(16)},g=/%2C/g,_=function(t){return encodeURIComponent(t).replace(m,y).replace(g,",")},b=decodeURIComponent;function w(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=b(n.shift()),o=n.length>0?b(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),e):e}function x(t){var e=t?Object.keys(t).map(function(e){var n=t[e];if(void 0===n)return"";if(null===n)return _(e);if(Array.isArray(n)){var r=[];return n.forEach(function(t){void 0!==t&&(null===t?r.push(_(e)):r.push(_(e)+"="+_(t)))}),r.join("&")}return _(e)+"="+_(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var k=/\/?$/;function O(t,e,n,r){var o=r&&r.options.stringifyQuery,i=e.query||{};try{i=E(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:S(e,o),matched:t?A(t):[]};return n&&(a.redirectedFrom=S(n,o)),Object.freeze(a)}function E(t){if(Array.isArray(t))return t.map(E);if(t&&"object"==typeof t){var e={};for(var n in t)e[n]=E(t[n]);return e}return t}var C=O(null,{path:"/"});function A(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function S(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var o=t.hash;return void 0===o&&(o=""),(n||"/")+(e||x)(r)+o}function T(t,e){return e===C?t===e:!!e&&(t.path&&e.path?t.path.replace(k,"")===e.path.replace(k,"")&&t.hash===e.hash&&N(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&N(t.query,e.query)&&N(t.params,e.params)))}function N(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(n){var r=t[n],o=e[n];return"object"==typeof r&&"object"==typeof o?N(r,o):String(r)===String(o)})}var j,P=[String,Object],M=[String,Array],L={name:"router-link",props:{to:{type:P,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:M,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),i=o.location,a=o.route,s=o.href,l={},u=n.options.linkActiveClass,c=n.options.linkExactActiveClass,f=null==u?"router-link-active":u,p=null==c?"router-link-exact-active":c,d=null==this.activeClass?f:this.activeClass,h=null==this.exactActiveClass?p:this.exactActiveClass,v=i.path?O(null,i,null,n):a;l[h]=T(r,v),l[d]=this.exact?l[h]:function(t,e){return 0===t.path.replace(k,"/").indexOf(e.path.replace(k,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,v);var m=function(t){I(t)&&(e.replace?n.replace(i):n.push(i))},y={click:I};Array.isArray(this.event)?this.event.forEach(function(t){y[t]=m}):y[this.event]=m;var g={class:l};if("a"===this.tag)g.on=y,g.attrs={href:s};else{var _=function t(e){if(e)for(var n,r=0;r=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(o.path||""),l=e&&e.path||"/",u=s.path?D(s.path,l,n||o.append):l,c=function(t,e,n){void 0===e&&(e={});var r,o=n||w;try{r=o(t||"")}catch(t){r={}}for(var i in e)r[i]=e[i];return r}(s.query,o.query,r&&r.options.parseQuery),f=o.hash||s.hash;return f&&"#"!==f.charAt(0)&&(f="#"+f),{_normalized:!0,path:u,query:c,hash:f}}function at(t,e){for(var n in e)t[n]=e[n];return t}function st(t,e){var n=rt(t),r=n.pathList,o=n.pathMap,i=n.nameMap;function a(t,n,a){var s=it(t,n,!1,e),u=s.name;if(u){var c=i[u];if(!c)return l(null,s);var f=c.regex.keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof s.params&&(s.params={}),n&&"object"==typeof n.params)for(var p in n.params)!(p in s.params)&&f.indexOf(p)>-1&&(s.params[p]=n.params[p]);if(c)return s.path=nt(c.path,s.params),l(c,s,a)}else if(s.path){s.params={};for(var d=0;d=t.length?n():t[o]?e(t[o],function(){r(o+1)}):r(o+1)};r(0)}function Ct(t){return function(e,n,r){var o=!1,i=0,a=null;At(t,function(t,e,n,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var l,u=Nt(function(e){var o;((o=e).__esModule||Tt&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:j.extend(e),n.components[s]=e,--i<=0&&r()}),c=Nt(function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=h(t)?t:new Error(e),r(a))});try{l=t(u,c)}catch(t){c(t)}if(l)if("function"==typeof l.then)l.then(u,c);else{var f=l.component;f&&"function"==typeof f.then&&f.then(u,c)}}}),o||r()}}function At(t,e){return St(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function St(t){return Array.prototype.concat.apply([],t)}var Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Nt(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var jt=function(t,e){this.router=t,this.base=function(t){if(!t)if(R){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=C,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function Pt(t,e,n,r){var o=At(t,function(t,r,o,i){var a=function(t,e){"function"!=typeof t&&(t=j.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map(function(t){return n(t,r,o,i)}):n(a,r,o,i)});return St(r?o.reverse():o)}function Mt(t,e){if(e)return function(){return t.apply(e,arguments)}}jt.prototype.listen=function(t){this.cb=t},jt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},jt.prototype.onError=function(t){this.errorCbs.push(t)},jt.prototype.transitionTo=function(t,e,n){var r=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){r.updateRoute(o),e&&e(o),r.ensureURL(),r.ready||(r.ready=!0,r.readyCbs.forEach(function(t){t(o)}))},function(t){n&&n(t),t&&!r.ready&&(r.ready=!0,r.readyErrorCbs.forEach(function(e){e(t)}))})},jt.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current,i=function(t){h(t)&&(r.errorCbs.length?r.errorCbs.forEach(function(e){e(t)}):console.error(t)),n&&n(t)};if(T(t,o)&&t.matched.length===o.matched.length)return this.ensureURL(),i();var a=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n=0?e.slice(0,n):e)+"#"+t}function Ut(t){gt?kt(Bt(t)):window.location.hash=t}function $t(t){gt?Ot(Bt(t)):window.location.replace(Bt(t))}var Ft=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)},n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){e.index=n,e.updateRoute(r)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(jt),zt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=st(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!gt&&!1!==t.fallback,this.fallback&&(e="hash"),R||(e="abstract"),this.mode=e,e){case"history":this.history=new Lt(this,t.base);break;case"hash":this.history=new Rt(this,t.base,this.fallback);break;case"abstract":this.history=new Ft(this,t.base);break;default:0}},Ht={currentRoute:{configurable:!0}};function Yt(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}zt.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},Ht.currentRoute.get=function(){return this.history&&this.history.current},zt.prototype.init=function(t){var e=this;if(this.apps.push(t),!this.app){this.app=t;var n=this.history;if(n instanceof Lt)n.transitionTo(n.getCurrentLocation());else if(n instanceof Rt){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},zt.prototype.beforeEach=function(t){return Yt(this.beforeHooks,t)},zt.prototype.beforeResolve=function(t){return Yt(this.resolveHooks,t)},zt.prototype.afterEach=function(t){return Yt(this.afterHooks,t)},zt.prototype.onReady=function(t,e){this.history.onReady(t,e)},zt.prototype.onError=function(t){this.history.onError(t)},zt.prototype.push=function(t,e,n){this.history.push(t,e,n)},zt.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},zt.prototype.go=function(t){this.history.go(t)},zt.prototype.back=function(){this.go(-1)},zt.prototype.forward=function(){this.go(1)},zt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},zt.prototype.resolve=function(t,e,n){var r=it(t,e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?q(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}},zt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==C&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(zt.prototype,Ht),zt.install=function t(e){if(!t.installed||j!==e){t.installed=!0,j=e;var n=function(t){return void 0!==t},r=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("router-view",v),e.component("router-link",L);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},zt.version="3.0.1",R&&window.Vue&&window.Vue.use(zt);var Wt=zt,Kt=n("gC7p"),Vt=n("CfG/"),Zt=n.n(Vt);n("3uFf");o.a.use(Wt),o.a.use(Kt.default),o.a.use(Zt.a);var Gt=new Wt({routes:d,mode:"history",base:"/"+Wink.path});o.a.component("page-header",n("7pT1").default),o.a.component("preloader",n("DFmy").default),o.a.component("alert",n("Dt6l").default),o.a.component("dropdown",n("sFPw").default),o.a.component("modal",n("uuIC").default),o.a.component("fullscreen-modal",n("Gpoh").default),o.a.component("notification",n("HHlM").default),o.a.component("mini-editor",n("ZmfK").default),o.a.component("editor",n("qWph").default),o.a.component("form-errors",n("uU4Q").default),o.a.component("image-picker",n("y9D6").default),o.a.component("cropper-modal",n("8a3M").default),o.a.component("date-time-picker",n("q67R").default),o.a.component("multiselect",n("xZEP").default),o.a.directive("loading",n("VeV2")),o.a.directive("click-outside",n("CdPK")),o.a.mixin(p),new o.a({el:"#wink",router:Gt,data:function(){return{alert:{type:null,autoClose:0,message:"",confirmationProceed:null,confirmationCancel:null},notification:{type:null,autoClose:0,message:""}}},mounted:function(){var t=this;f.$on("httpError",function(e){return t.alertError(e)})},methods:{}})},d3j6:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},eTuZ:function(t,e,n){var r=n("j2ln");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},endd:function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},eqyj:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},g7np:function(t,e,n){"use strict";var r=n("2SVd"),o=n("5oMp");t.exports=function(t,e){return t&&!r(e)?o(t,e):e}},gC7p:function(t,e,n){"use strict";var r=n("pweE"),o=n.n(r);e.default=o.a},"h+Kf":function(t,e,n){(function(e,n){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1);n(6);var o={install:function(t,e){var n=t.extend({render:function(t){return t("div",{class:this.customClass,ref:"croppieContainer",id:"croppieContainer"})},props:{boundary:Object,customClass:String,enableExif:Boolean,enableOrientation:{type:Boolean,default:!0},enableResize:{type:Boolean,default:!0},enableZoom:{type:Boolean,default:!0},enforceBoundary:{type:Boolean,default:!0},mouseWheelZoom:{type:Boolean,default:!0},showZoomer:{type:Boolean,default:!0},viewport:{type:Object,default:function(){return{width:200,height:200,type:"square"}}}},mounted:function(){this.initCroppie()},data:function(){return{croppie:null}},methods:{initCroppie:function(){var t=this,e=this.$refs.croppieContainer,n={enableExif:this.enableExif,enableOrientation:this.enableOrientation,enableZoom:this.enableZoom,enableResize:this.enableResize,enforceBoundary:this.enforceBoundary,mouseWheelZoom:this.mouseWheelZoom,viewport:this.viewport,showZoomer:this.showZoomer};this.boundary&&(n.boundary=this.boundary),e.addEventListener("update",function(e){t.$emit("update",e.detail)}),this.croppie=new r.Croppie(e,n)},bind:function(t){return this.croppie.bind(t)},destroy:function(){this.croppie.destroy()},get:function(t){if(!t)return this.croppie.get();t(this.croppie.get())},rotate:function(t){this.croppie.rotate(t)},setZoom:function(t){this.croppie.setZoom(t)},result:function(t,e){var n=this;return t||(t={type:"base64"}),this.croppie.result(t).then(function(t){return e?e(t):n.$emit("result",t),t})},refresh:function(){this.croppie.destroy(),this.initCroppie()}}});t.component("vue-croppie",n)}};e.default=o},function(t,e,n){(function(n){var r,o,i;o=[e],void 0===(i="function"==typeof(r=function(e){"function"!=typeof Promise&&function(e){function r(t,e){return function(){t.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],c(t,r(a,this),r(s,this))}function i(t){var e=this;return null===this._state?void this._deferreds.push(t):void p(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})}function a(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void c(r(e,t),r(a,this),r(s,this))}this._state=!0,this._value=t,l.call(this)}catch(t){s.call(this,t)}}function s(t){this._state=!1,this._value=t,l.call(this)}function l(){for(var t=0,e=this._deferreds.length;e>t;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function u(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function c(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}}var f=setTimeout,p="function"==typeof n&&n||function(t){f(t,1)},d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=this;return new o(function(r,o){i.call(n,new u(t,e,r,o))})},o.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new o(function(e,n){function r(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(t){r(i,t)},n)}t[i]=a,0==--o&&e(t)}catch(t){n(t)}}if(0===t.length)return e([]);for(var o=t.length,i=0;ir;r++)t[r].then(e,n)})},o._setImmediateFn=function(t){p=t},void 0!==t&&t.exports?t.exports=o:e.Promise||(e.Promise=o)}(this),"function"!=typeof window.CustomEvent&&function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}t.prototype=window.Event.prototype,window.CustomEvent=t}(),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,e,n){for(var r=atob(this.toDataURL(e,n).split(",")[1]),o=r.length,i=new Uint8Array(o),a=0;a=5){var i=n;n=r,r=i}return{width:n,height:r}}o=c("transform"),r=c("transformOrigin"),i=c("userSelect");var _={translate3d:{suffix:", 0px"},translate:{suffix:""}},b=function(t,e,n){this.x=parseFloat(t),this.y=parseFloat(e),this.scale=parseFloat(n)};b.parse=function(t){return t.style?b.parse(t.style[o]):t.indexOf("matrix")>-1||t.indexOf("none")>-1?b.fromMatrix(t):b.fromString(t)},b.fromMatrix=function(t){var e=t.substring(7).split(",");return e.length&&"none"!==t||(e=[1,0,0,1,0,0]),new b(y(e[4]),y(e[5]),parseFloat(e[0]))},b.fromString=function(t){var e=t.split(") "),n=e[0].substring(V.globals.translate.length+1).split(","),r=e.length>1?e[1].substring(6):1,o=n.length>1?n[0]:0,i=n.length>1?n[1]:0;return new b(o,i,r)},b.prototype.toString=function(){var t=_[V.globals.translate].suffix||"";return V.globals.translate+"("+this.x+"px, "+this.y+"px"+t+") scale("+this.scale+")"};var w=function(t){if(!t||!t.style[r])return this.x=0,void(this.y=0);var e=t.style[r].split(" ");this.x=parseFloat(e[0]),this.y=parseFloat(e[1])};function x(t){return t.exifdata?t.exifdata.Orientation:1}function k(t,e,n){var r=e.width,o=e.height,i=t.getContext("2d");switch(t.width=e.width,t.height=e.height,i.save(),n){case 2:i.translate(r,0),i.scale(-1,1);break;case 3:i.translate(r,o),i.rotate(180*Math.PI/180);break;case 4:i.translate(0,o),i.scale(1,-1);break;case 5:t.width=o,t.height=r,i.rotate(90*Math.PI/180),i.scale(1,-1);break;case 6:t.width=o,t.height=r,i.rotate(90*Math.PI/180),i.translate(0,-o);break;case 7:t.width=o,t.height=r,i.rotate(-90*Math.PI/180),i.translate(-r,o),i.scale(1,-1);break;case 8:t.width=o,t.height=r,i.translate(0,r),i.rotate(-90*Math.PI/180)}i.drawImage(e,0,0,r,o),i.restore()}function O(){var t,e,n,r,a,s=this.options.viewport.type?"cr-vp-"+this.options.viewport.type:null;this.options.useCanvas=this.options.enableOrientation||E.call(this),this.data={},this.elements={},t=this.elements.boundary=document.createElement("div"),e=this.elements.viewport=document.createElement("div"),this.elements.img=document.createElement("img"),n=this.elements.overlay=document.createElement("div"),this.options.useCanvas?(this.elements.canvas=document.createElement("canvas"),this.elements.preview=this.elements.canvas):this.elements.preview=this.elements.img,v(t,"cr-boundary"),t.setAttribute("aria-dropeffect","none"),r=this.options.boundary.width,a=this.options.boundary.height,h(t,{width:r+(isNaN(r)?"":"px"),height:a+(isNaN(a)?"":"px")}),v(e,"cr-viewport"),s&&v(e,s),h(e,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),e.setAttribute("tabindex",0),v(this.elements.preview,"cr-image"),m(this.elements.preview,{alt:"preview","aria-grabbed":"false"}),v(n,"cr-overlay"),this.element.appendChild(t),t.appendChild(this.elements.preview),t.appendChild(e),t.appendChild(n),v(this.element,"croppie-container"),this.options.customClass&&v(this.element,this.options.customClass),function(){var t,e,n,r,a,s=this,l=!1;function u(t,e){var n=s.elements.preview.getBoundingClientRect(),o=a.y+e,i=a.x+t;s.options.enforceBoundary?(r.top>n.top+e&&r.bottomn.left+t&&r.right1){var m=r.touches[0],y=r.touches[1],g=Math.sqrt((m.pageX-y.pageX)*(m.pageX-y.pageX)+(m.pageY-y.pageY)*(m.pageY-y.pageY));n||(n=g/s._currentZoom);var _=g/n;return C.call(s,_),void d(s.elements.zoomer)}u(f,p),v[o]=a.toString(),h(s.elements.preview,v),T.call(s),e=l,t=i}function v(){c(l=!1),window.removeEventListener("mousemove",p),window.removeEventListener("touchmove",p),window.removeEventListener("mouseup",v),window.removeEventListener("touchend",v),document.body.style[i]="",S.call(s),I.call(s),n=0}s.elements.overlay.addEventListener("mousedown",f),s.elements.viewport.addEventListener("keydown",function(t){var e=37,l=38,c=39,f=40;if(!t.shiftKey||t.keyCode!=l&&t.keyCode!=f){if(s.options.enableKeyMovement&&t.keyCode>=37&&t.keyCode<=40){t.preventDefault();var p=function(t){switch(t){case e:return[1,0];case l:return[0,1];case c:return[-1,0];case f:return[0,-1]}}(t.keyCode);a=b.parse(s.elements.preview),document.body.style[i]="none",r=s.elements.viewport.getBoundingClientRect(),function(t){var e=t[0],r=t[1],l={};u(e,r),l[o]=a.toString(),h(s.elements.preview,l),T.call(s),document.body.style[i]="",S.call(s),I.call(s),n=0}(p)}}else{var d=0;d=t.keyCode==l?parseFloat(s.elements.zoomer.value,10)+parseFloat(s.elements.zoomer.step,10):parseFloat(s.elements.zoomer.value,10)-parseFloat(s.elements.zoomer.step,10),s.setZoom(d)}}),s.elements.overlay.addEventListener("touchstart",f)}.call(this),this.options.enableZoom&&function(){var t=this,e=t.elements.zoomerWrap=document.createElement("div"),n=t.elements.zoomer=document.createElement("input");function r(){A.call(t,{value:parseFloat(n.value),origin:new w(t.elements.preview),viewportRect:t.elements.viewport.getBoundingClientRect(),transform:b.parse(t.elements.preview)})}function o(e){var n,o;if("ctrl"===t.options.mouseWheelZoom&&1!=e.ctrlKey)return 0;n=e.wheelDelta?e.wheelDelta/1200:e.deltaY?e.deltaY/1060:e.detail?e.detail/-60:0,o=t._currentZoom+n*t._currentZoom,e.preventDefault(),C.call(t,o),r.call(t)}v(e,"cr-slider-wrap"),v(n,"cr-slider"),n.type="range",n.step="0.0001",n.value=1,n.style.display=t.options.showZoomer?"":"none",n.setAttribute("aria-label","zoom"),t.element.appendChild(e),e.appendChild(n),t._currentZoom=1,t.elements.zoomer.addEventListener("input",r),t.elements.zoomer.addEventListener("change",r),t.options.mouseWheelZoom&&(t.elements.boundary.addEventListener("mousewheel",o),t.elements.boundary.addEventListener("DOMMouseScroll",o))}.call(this),this.options.enableResize&&function(){var t,e,n,r,o,a,s,l=this,u=document.createElement("div"),c=!1,f=50;function p(a){if((void 0===a.button||0===a.button)&&(a.preventDefault(),!c)){var s=l.elements.overlay.getBoundingClientRect();if(c=!0,e=a.pageX,n=a.pageY,t=-1!==a.currentTarget.className.indexOf("vertical")?"v":"h",r=s.width,o=s.height,a.touches){var u=a.touches[0];e=u.pageX,n=u.pageY}window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",m),window.addEventListener("touchend",m),document.body.style[i]="none"}}function d(i){var a=i.pageX,s=i.pageY;if(i.preventDefault(),i.touches){var c=i.touches[0];a=c.pageX,s=c.pageY}var p=a-e,d=s-n,v=l.options.viewport.height+d,m=l.options.viewport.width+p;"v"===t&&v>=f&&v<=o?(h(u,{height:v+"px"}),l.options.boundary.height+=d,h(l.elements.boundary,{height:l.options.boundary.height+"px"}),l.options.viewport.height+=d,h(l.elements.viewport,{height:l.options.viewport.height+"px"})):"h"===t&&m>=f&&m<=r&&(h(u,{width:m+"px"}),l.options.boundary.width+=p,h(l.elements.boundary,{width:l.options.boundary.width+"px"}),l.options.viewport.width+=p,h(l.elements.viewport,{width:l.options.viewport.width+"px"})),T.call(l),q.call(l),S.call(l),I.call(l),n=s,e=a}function m(){c=!1,window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m),document.body.style[i]=""}v(u,"cr-resizer"),h(u,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),this.options.resizeControls.height&&(v(a=document.createElement("div"),"cr-resizer-vertical"),u.appendChild(a)),this.options.resizeControls.width&&(v(s=document.createElement("div"),"cr-resizer-horisontal"),u.appendChild(s)),a&&(a.addEventListener("mousedown",p),a.addEventListener("touchstart",p)),s&&(s.addEventListener("mousedown",p),s.addEventListener("touchstart",p)),this.elements.boundary.appendChild(u)}.call(this)}function E(){return this.options.enableExif&&window.EXIF}function C(t){if(this.options.enableZoom){var e=this.elements.zoomer,n=$(t,4);e.value=Math.max(e.min,Math.min(e.max,n))}}function A(t){var e=this,n=t?t.transform:b.parse(e.elements.preview),i=t?t.viewportRect:e.elements.viewport.getBoundingClientRect(),a=t?t.origin:new w(e.elements.preview);function s(){var t={};t[o]=n.toString(),t[r]=a.toString(),h(e.elements.preview,t)}if(e._currentZoom=t?t.value:e._currentZoom,n.scale=e._currentZoom,e.elements.zoomer.setAttribute("aria-valuenow",e._currentZoom),s(),e.options.enforceBoundary){var l=function(t){var e=this._currentZoom,n=t.width,r=t.height,o=this.elements.boundary.clientWidth/2,i=this.elements.boundary.clientHeight/2,a=this.elements.preview.getBoundingClientRect(),s=a.width,l=a.height,u=n/2,c=r/2,f=-1*(u/e-o),p=-1*(c/e-i),d=1/e*u,h=1/e*c;return{translate:{maxX:f,minX:f-(s*(1/e)-n*(1/e)),maxY:p,minY:p-(l*(1/e)-r*(1/e))},origin:{maxX:s*(1/e)-d,minX:d,maxY:l*(1/e)-h,minY:h}}}.call(e,i),u=l.translate,c=l.origin;n.x>=u.maxX&&(a.x=c.minX,n.x=u.maxX),n.x<=u.minX&&(a.x=c.maxX,n.x=u.minX),n.y>=u.maxY&&(a.y=c.minY,n.y=u.maxY),n.y<=u.minY&&(a.y=c.maxY,n.y=u.minY)}s(),L.call(e),I.call(e)}function S(){var t=this._currentZoom,e=this.elements.preview.getBoundingClientRect(),n=this.elements.viewport.getBoundingClientRect(),i=b.parse(this.elements.preview.style[o]),a=new w(this.elements.preview),s=n.top-e.top+n.height/2,l=n.left-e.left+n.width/2,u={},c={};u.y=s/t,u.x=l/t,c.y=(u.y-a.y)*(1-t),c.x=(u.x-a.x)*(1-t),i.x-=c.x,i.y-=c.y;var f={};f[r]=u.x+"px "+u.y+"px",f[o]=i.toString(),h(this.elements.preview,f)}function T(){if(this.elements){var t=this.elements.boundary.getBoundingClientRect(),e=this.elements.preview.getBoundingClientRect();h(this.elements.overlay,{width:e.width+"px",height:e.height+"px",top:e.top-t.top+"px",left:e.left-t.left+"px"})}}w.prototype.toString=function(){return this.x+"px "+this.y+"px"};var N,j,P,M,L=(N=T,j=500,function(){var t=this,e=arguments,n=P&&!M;clearTimeout(M),M=setTimeout(function(){M=null,P||N.apply(t,e)},j),n&&N.apply(t,e)});function I(){var t,e=this.get();R.call(this)&&(this.options.update.call(this,e),this.$&&"undefined"==typeof Prototype?this.$(this.element).trigger("update.croppie",e):(window.CustomEvent?t=new CustomEvent("update",{detail:e}):(t=document.createEvent("CustomEvent")).initCustomEvent("update",!0,!0,e),this.element.dispatchEvent(t)))}function R(){return this.elements.preview.offsetHeight>0&&this.elements.preview.offsetWidth>0}function D(){var t={},e=this.elements.preview,n=null,i=new b(0,0,1),a=new w,s=R.call(this);s&&!this.data.bound&&(this.data.bound=!0,t[o]=i.toString(),t[r]=a.toString(),t.opacity=1,h(e,t),n=this.elements.preview.getBoundingClientRect(),this._originalImageWidth=n.width,this._originalImageHeight=n.height,this.data.orientation=x(this.elements.img),this.options.enableZoom?q.call(this,!0):this._currentZoom=1,i.scale=this._currentZoom,t[o]=i.toString(),h(e,t),this.data.points.length?function(t){if(4!=t.length)throw"Croppie - Invalid number of points supplied: "+t;var e=t[2]-t[0],n=this.elements.viewport.getBoundingClientRect(),i=this.elements.boundary.getBoundingClientRect(),a={left:n.left-i.left,top:n.top-i.top},s=n.width/e,l=t[1],u=t[0],c=-1*t[1]+a.top,f=-1*t[0]+a.left,p={};p[r]=u+"px "+l+"px",p[o]=new b(f,c,s).toString(),h(this.elements.preview,p),C.call(this,s),this._currentZoom=s}.call(this,this.data.points):function(){var t=this.elements.preview.getBoundingClientRect(),e=this.elements.viewport.getBoundingClientRect(),n=this.elements.boundary.getBoundingClientRect(),r=e.left-n.left,i=e.top-n.top,a=r-(t.width-e.width)/2,s=i-(t.height-e.height)/2,l=new b(a,s,this._currentZoom);h(this.elements.preview,o,l.toString())}.call(this),S.call(this),T.call(this))}function q(t){var e,n,r,o,i=0,a=this.options.maxZoom||1.5,s=this.elements.zoomer,l=parseFloat(s.value),u=this.elements.boundary.getBoundingClientRect(),c=g(this.elements.img,this.data.orientation),f=this.elements.viewport.getBoundingClientRect();this.options.enforceBoundary&&(r=f.width/c.width,o=f.height/c.height,i=Math.max(r,o)),i>=a&&(a=i+1),s.min=$(i,4),s.max=$(a,4),!t&&(ls.max)?C.call(this,lu?(o=i.height,r=o*u):(r=i.width,o=i.height/u);var f=(i.width-r)/2,p=(i.height-o)/2,d=f+r,h=p+o;a.data.points=[f,p,d,h]}a.data.points=s.map(function(t){return parseFloat(t)}),a.options.useCanvas&&function(t){var e=this.elements.canvas,n=this.elements.img,r=e.getContext("2d"),o=E.call(this),t=this.options.enableOrientation&&t;if(r.clearRect(0,0,e.width,e.height),e.width=n.width,e.height=n.height,o&&!t){var i=x(n);k(e,n,y(i||0))}else t&&k(e,n,t)}.call(a,t.orientation||1),D.call(a),I.call(a),e&&e()}).catch(function(t){console.error("Croppie:"+t)})}function $(t,e){return parseFloat(t).toFixed(e||0)}function F(){var t=this.elements.preview.getBoundingClientRect(),e=this.elements.viewport.getBoundingClientRect(),n=e.left-t.left,r=e.top-t.top,o=(e.width-this.elements.viewport.offsetWidth)/2,i=(e.height-this.elements.viewport.offsetHeight)/2,a=n+this.elements.viewport.offsetWidth+o,s=r+this.elements.viewport.offsetHeight+i,l=this._currentZoom;(l===1/0||isNaN(l))&&(l=1);var u=this.options.enforceBoundary?0:Number.NEGATIVE_INFINITY;return n=Math.max(u,n/l),r=Math.max(u,r/l),a=Math.max(u,a/l),s=Math.max(u,s/l),{points:[$(n),$(r),$(a),$(s)],zoom:l,orientation:this.data.orientation}}var z={type:"canvas",format:"png",quality:1},H=["jpeg","webp","png"];function Y(t){var e=this,n=F.call(e),r=f(p(z),p(t)),o="string"==typeof t?t:r.type||"base64",i=r.size||"viewport",a=r.format,s=r.quality,l=r.backgroundColor,u="boolean"==typeof r.circle?r.circle:"circle"===e.options.viewport.type,c=e.elements.viewport.getBoundingClientRect(),d=c.width/c.height;return"viewport"===i?(n.outputWidth=c.width,n.outputHeight=c.height):"object"==typeof i&&(i.width&&i.height?(n.outputWidth=i.width,n.outputHeight=i.height):i.width?(n.outputWidth=i.width,n.outputHeight=i.width/d):i.height&&(n.outputWidth=i.height*d,n.outputHeight=i.height)),H.indexOf(a)>-1&&(n.format="image/"+a,n.quality=s),n.circle=u,n.url=e.data.url,n.backgroundColor=l,new Promise(function(t,r){switch(o.toLowerCase()){case"rawcanvas":t(B.call(e,n));break;case"canvas":case"base64":t(function(t){return B.call(this,t).toDataURL(t.format,t.quality)}.call(e,n));break;case"blob":(function(t){var e=this;return new Promise(function(n,r){B.call(e,t).toBlob(function(t){n(t)},t.format,t.quality)})}).call(e,n).then(t);break;default:t(function(t){var e=t.points,n=document.createElement("div"),r=document.createElement("img"),o=e[2]-e[0],i=e[3]-e[1];return v(n,"croppie-result"),n.appendChild(r),h(r,{left:-1*e[0]+"px",top:-1*e[1]+"px"}),r.src=t.url,h(n,{width:o+"px",height:i+"px"}),n}.call(e,n))}})}function W(t){if(!this.options.useCanvas||!this.options.enableOrientation)throw"Croppie: Cannot rotate without enableOrientation && EXIF.js included";var e=this.elements.canvas;this.data.orientation=function(t,e){var n=l.indexOf(t)>-1?l:u,r=n.indexOf(t),o=e/90%n.length;return n[(n.length+r+o%n.length)%n.length]}(this.data.orientation,t),k(e,this.elements.img,this.data.orientation),q.call(this),A.call(this),copy=null}if(window.jQuery){var K=window.jQuery;K.fn.croppie=function(t){var e=typeof t;if("string"===e){var n=Array.prototype.slice.call(arguments,1),r=K(this).data("croppie");return"get"===t?r.get():"result"===t?r.result.apply(r,n):"bind"===t?r.bind.apply(r,n):this.each(function(){var e=K(this).data("croppie");if(e){var r=e[t];if(!K.isFunction(r))throw"Croppie "+t+" method not found";r.apply(e,n),"destroy"===t&&K(this).removeData("croppie")}})}return this.each(function(){var e=new V(this,t);e.$=K,K(this).data("croppie",e)})}}function V(t,e){if(t.className.indexOf("croppie-container")>-1)throw new Error("Croppie: Can't initialize croppie more than once");if(this.element=t,this.options=f(p(V.defaults),e),"img"===this.element.tagName.toLowerCase()){var n=this.element;v(n,"cr-original-image"),m(n,{"aria-hidden":"true",alt:""});var r=document.createElement("div");this.element.parentNode.appendChild(r),r.appendChild(n),this.element=r,this.options.url=this.options.url||n.src}if(O.call(this),this.options.url){var o={url:this.options.url,points:this.options.points};delete this.options.url,delete this.options.points,U.call(this,o)}}V.defaults={viewport:{width:100,height:100,type:"square"},boundary:{},orientationControls:{enabled:!0,leftClass:"",rightClass:""},resizeControls:{width:!0,height:!0},customClass:"",showZoomer:!0,enableZoom:!0,enableResize:!1,mouseWheelZoom:!0,enableExif:!1,enforceBoundary:!0,enableOrientation:!1,enableKeyMovement:!0,update:function(){}},V.globals={translate:"translate3d"},f(V.prototype,{bind:function(t,e){return U.call(this,t,e)},get:function(){var t=F.call(this),e=t.points;return this.options.relative&&(e[0]/=this.elements.img.naturalWidth/100,e[1]/=this.elements.img.naturalHeight/100,e[2]/=this.elements.img.naturalWidth/100,e[3]/=this.elements.img.naturalHeight/100),t},result:function(t){return Y.call(this,t)},refresh:function(){return function(){D.call(this)}.call(this)},setZoom:function(t){C.call(this,t),d(this.elements.zoomer)},rotate:function(t){W.call(this,t)},destroy:function(){return function(){var t,e;this.element.removeChild(this.elements.boundary),t=this.element,e="croppie-container",t.classList?t.classList.remove(e):t.className=t.className.replace(e,""),this.options.enableZoom&&this.element.removeChild(this.elements.zoomerWrap),delete this.elements}.call(this)}}),e.Croppie=window.Croppie=V})?r.apply(e,o):r)||(t.exports=i)}).call(e,n(2).setImmediate)},function(t,r,o){var i=Function.prototype.apply;function a(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new a(i.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new a(i.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t&&t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},o(3),r.setImmediate=e,r.clearImmediate=n},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,o,i,a,s,l=1,u={},c=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){h(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?((i=new MessageChannel).port1.onmessage=function(t){h(t.data)},r=function(t){i.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(t){var e=f.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):r=function(t){setTimeout(h,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&h(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n=0&&c.splice(e,1)}function m(t){var e=document.createElement("style");return t.attrs.type="text/css",y(e,t.attrs),h(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var a=u++;n=l||(l=m(e)),r=w.bind(null,n,a,!1),o=w.bind(null,n,a,!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 t.attrs.type="text/css",t.attrs.rel="stylesheet",y(e,t.attrs),h(t,e),e}(e),r=function(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),o=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=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 o()}}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||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o>1,c=-7,f=n?o-1:0,p=n?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=p,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=u}return(d?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,l,u=8*i-o-1,c=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+f>=1?p/l:p*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*l-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+d]=255&s,d+=h,s/=256,o-=8);for(a=a<0;t[n+d]=255&a,d+=h,a/=256,u-=8);t[n+d-h]|=128*v}},kzlf:function(t,e,n){(function(e){var n;"undefined"!=typeof self&&self,n=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=109)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),o=n(18),i=n(19),a=n(45),s=n(46),l=n(47),u=n(48),c=n(49),f=n(12),p=n(32),d=n(33),h=n(31),v=n(1),m={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:c.default,Attributor:{Attribute:f.default,Class:p.default,Style:d.default,Store:h.default}};e.default=m},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e){var n=this;return e="[Parchment] "+e,(n=t.call(this,e)||this).message=e,n.name=n.constructor.name,n}return o(e,t),e}(Error);e.ParchmentError=i;var a,s={},l={},u={},c={};function f(t,e){var n;if(void 0===e&&(e=a.ANY),"string"==typeof t)n=c[t]||s[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=c.text;else if("number"==typeof t)t&a.LEVEL&a.BLOCK?n=c.block:t&a.LEVEL&a.INLINE&&(n=c.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=l[r[o]])break;n=n||u[t.tagName]}return null==n?null:e&a.LEVEL&n.scope&&e&a.TYPE&n.scope?n:null}e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(a=e.Scope||(e.Scope={})),e.create=function(t,e){var n=f(t);if(null==n)throw new i("Unable to create "+t+" blot");var r=n,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e);return new r(o,e)},e.find=function t(n,r){return void 0===r&&(r=!1),null==n?null:null!=n[e.DATA_KEY]?n[e.DATA_KEY].blot:r?t(n.parentNode,r):null},e.query=f,e.register=function t(){for(var e=[],n=0;n1)return e.map(function(e){return t(e)});var r=e[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new i("Invalid definition");if("abstract"===r.blotName)throw new i("Cannot register abstract class");c[r.blotName||r.attrName]=r,"string"==typeof r.keyName?s[r.keyName]=r:(null!=r.className&&(l[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map(function(t){return t.toUpperCase()}):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach(function(t){null!=u[t]&&null!=r.className||(u[t]=r)})));return r}},function(t,e,n){var r=n(51),o=n(11),i=n(3),a=n(20),s=String.fromCharCode(0),l=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};l.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},l.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},l.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},l.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},l.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},l.prototype.filter=function(t){return this.ops.filter(t)},l.prototype.forEach=function(t){this.ops.forEach(t)},l.prototype.map=function(t){return this.ops.map(t)},l.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){(t(r)?e:n).push(r)}),[e,n]},l.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},l.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+a.length(e):e.delete?t-e.delete:t},0)},l.prototype.length=function(){return this.reduce(function(t,e){return t+a.length(e)},0)},l.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=a.iterator(this.ops),o=0;o0&&n.next(i.retain-s)}for(var u=new l(r);e.hasNext()||n.hasNext();)if("insert"===n.peekType())u.push(n.next());else if("delete"===e.peekType())u.push(e.next());else{var c=Math.min(e.peekLength(),n.peekLength()),f=e.next(c),p=n.next(c);if("number"==typeof p.retain){var d={};"number"==typeof f.retain?d.retain=c:d.insert=f.insert;var h=a.attributes.compose(f.attributes,p.attributes,"number"==typeof f.retain);if(h&&(d.attributes=h),u.push(d),!n.hasNext()&&o(u.ops[u.ops.length-1],d)){var v=new l(e.rest());return u.concat(v).chop()}}else"number"==typeof p.delete&&"number"==typeof f.retain&&u.push(p)}return u.chop()},l.prototype.concat=function(t){var e=new l(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},l.prototype.diff=function(t,e){if(this.ops===t.ops)return new l;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")}),i=new l,u=r(n[0],n[1],e),c=a.iterator(this.ops),f=a.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var s=c.next(n),l=f.next(n);o(s.insert,l.insert)?i.retain(n,a.attributes.diff(s.attributes,l.attributes)):i.push(l).delete(n)}e-=n}}),i.chop()},l.prototype.eachLine=function(t,e){e=e||"\n";for(var n=a.iterator(this.ops),r=new l,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),s=a.length(i)-n.peekLength(),u="string"==typeof i.insert?i.insert.indexOf(e,s)-s:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new l}}r.length()>0&&t(r,{},o)},l.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=a.iterator(this.ops),r=a.iterator(t.ops),o=new l;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),s=n.next(i),u=r.next(i);if(s.delete)continue;u.delete?o.push(u):o.retain(i,a.attributes.transform(s.attributes,u.attributes,e))}else o.retain(a.length(n.next()));return o.chop()},l.prototype.transformPosition=function(t,e){e=!!e;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var i=o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},i}}]),e}();function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,i.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:y(t.parent,e))}m.blotName="block",m.tagName="P",m.defaultChild="break",m.allowedChildren=[u.default,s.default.Embed,c.default],e.bubbleFormats=y,e.BlockEmbed=v,e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=b(e,r),this.container=this.options.container,null==this.container)return g.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new l.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new p.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(l.default.events.EDITOR_CHANGE,function(t){t===l.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(l.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;w.call(n,function(){return n.editor.update(null,e,o)},t)});var i=this.clipboard.convert("
"+o+"


");this.setContents(i),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return i(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),h.default.level(t)}},{key:"find",value:function(t){return t.__quill||c.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&g.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||g.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?c.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),i(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;(t=document.createElement("div")).classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,i=x(t,e,n),a=o(i,4);return t=a[0],e=a[1],n=a[3],w.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;return w.call(this,function(){var r=n.getSelection(!0),o=new a.default;if(null==r)return o;if(c.default.query(t,c.default.Scope.BLOCK))o=n.editor.formatLine(r.index,r.length,y({},t,e));else{if(0===r.length)return n.selection.format(t,e),o;o=n.editor.formatText(r.index,r.length,y({},t,e))}return n.setSelection(r,l.default.sources.SILENT),o},r)}},{key:"formatLine",value:function(t,e,n,r,i){var a,s=this,l=x(t,e,n,r,i),u=o(l,4);return t=u[0],e=u[1],a=u[2],i=u[3],w.call(this,function(){return s.editor.formatLine(t,e,a)},i,t,0)}},{key:"formatText",value:function(t,e,n,r,i){var a,s=this,l=x(t,e,n,r,i),u=o(l,4);return t=u[0],e=u[1],a=u[2],i=u[3],w.call(this,function(){return s.editor.formatText(t,e,a)},i,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=x(t,e),r=o(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=x(t,e),r=o(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return w.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,i){var a,s=this,l=x(t,0,n,r,i),u=o(l,4);return t=u[0],a=u[2],i=u[3],w.call(this,function(){return s.editor.insertText(t,e,a)},i,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,i=x(t,e,n),a=o(i,4);return t=a[0],e=a[1],n=a[3],w.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return w.call(this,function(){t=new a.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1)),r.compose(o)},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var i=x(e,n,r),a=o(i,4);e=a[0],n=a[1],r=a[3],this.selection.setRange(new f.Range(e,n),r),r!==l.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API,n=(new a.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return w.call(this,function(){return t=new a.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();function b(t,e){if((e=(0,d.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e)).theme&&e.theme!==_.DEFAULTS.theme){if(e.theme=_.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=v.default;var n=(0,d.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach(function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach(function(e){!0===t.modules[e]&&(t.modules[e]={})})});var r=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce(function(t,e){var n=_.import("modules/"+e);return null==n?g.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t},{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,d.default)(!0,{},_.DEFAULTS,{modules:r},n,e),["bounds","container","scrollingContainer"].forEach(function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce(function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t},{}),e}function w(t,e,n,r){if(this.options.strict&&!this.isEnabled()&&e===l.default.sources.USER)return new a.default;var o=null==n?null:this.getSelection(),i=this.editor.delta,s=t();if(null!=o&&(!0===n&&(n=o.index),null==r?o=k(o,s,e):0!==r&&(o=k(o,n,r,e)),this.setSelection(o,l.default.sources.SILENT)),s.length()>0){var u,c,f=[l.default.events.TEXT_CHANGE,s,i,e];if((u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(f)),e!==l.default.sources.SILENT)(c=this.emitter).emit.apply(c,f)}return s}function x(t,e,n,o,i){var a={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(i=o,o=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(i=o,o=n,n=e,e=0),"object"===(void 0===n?"undefined":r(n))?(a=n,i=o):"string"==typeof n&&(null!=o?a[n]=o:i=n),[t,e,a,i=i||l.default.sources.API]}function k(t,e,n,r){if(null==t)return null;var i=void 0,s=void 0;if(e instanceof a.default){var u=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r!==l.default.sources.USER)}),c=o(u,2);i=c[0],s=c[1]}else{var p=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),d=o(p,2);i=d[0],s=d[1]}return new f.Range(i,s-i)}_.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},_.events=l.default.events,_.sources=l.default.sources,_.version="1.3.7",_.imports={delta:a.default,parchment:c.default,"core/module":u.default,"core/theme":v.default},e.expandConfig=b,e.overload=x,e.default=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.quill=e,this.options=n};r.DEFAULTS={},e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=["error","warn","log","info"],o="warn";function i(t){if(r.indexOf(t)<=r.indexOf(o)){for(var e,n=arguments.length,i=Array(n>1?n-1:0),a=1;a=0;u--)if(f[u]!=p[u])return!1;for(u=f.length-1;u>=0;u--)if(c=f[u],!a(t[c],e[c],n))return!1;return typeof t==typeof e}(t,e,n))};function s(t){return null==t}function l(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var o=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|o:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,function(t){return t.name})},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function t(t,e){for(var n=0;n=t+n)){var a=this.newlineIndex(t,!0)+1,l=i-a+1,u=this.isolate(a,l),c=u.next;u.format(r,o),c instanceof e&&c.formatAt(0,t-a+n-l,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var o=this.descendant(c.default,t),i=r(o,2),a=i[0],s=i[1];a.insertAt(s,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(s.default.create("text","\n")),i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=s.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof s.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}();m.blotName="code-block",m.tagName="PRE",m.TAB=" ",e.Code=v,e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;n=i&&!d.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,d);var h=e.scroll.line(t),v=o(h,2),y=v[0],g=v[1],_=(0,m.default)({},(0,f.bubbleFormats)(y));if(y instanceof p.default){var b=y.descendant(l.default.Leaf,g),w=o(b,1)[0];_=(0,m.default)(_,(0,f.bubbleFormats)(w))}c=s.default.attributes.diff(_,c)||{}}else if("object"===r(a.insert)){var x=Object.keys(a.insert)[0];if(null==x)return t;e.scroll.insertAt(t,x,a.insert[x])}i+=u}return Object.keys(c).forEach(function(n){e.scroll.formatAt(t,u,n,c[n])}),t+u},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new a.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var i=n.scroll.lines(t,Math.max(e,1)),a=e;i.forEach(function(e){var i=e.length();if(e instanceof u.default){var s=t-e.offset(n.scroll),l=e.newlineIndex(s+a)-s+1;e.formatAt(s,l,o,r[o])}else e.format(o,r[o]);a-=i})}}),this.scroll.optimize(),this.update((new a.default).retain(t).retain(e,(0,h.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new a.default).retain(t).retain(e,(0,h.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new a.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=o(t,1)[0];e instanceof p.default?n.push(e):e instanceof l.default.Leaf&&r.push(e)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(l.default.Leaf,t,e));var i=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,f.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=b((0,f.bubbleFormats)(n),e)}return e});return m.default.apply(m.default,i)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new a.default).retain(t).insert(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new a.default).retain(t).insert(e,(0,h.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===p.default.blotName&&(!(t.children.length>1)&&t.children.head instanceof d.default)}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),i=o(r,2),s=i[0],l=i[1],c=0,f=new a.default;null!=s&&(c=s instanceof u.default?s.newlineIndex(l)-l+1:s.length()-l,f=s.delta().slice(l,l+c-1).insert("\n"));var p=this.getContents(t,e+c).diff((new a.default).insert(n).concat(f)),d=(new a.default).retain(t).concat(p);return this.applyDelta(d)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(g)&&l.default.find(e[0].target)){var o=l.default.find(e[0].target),i=(0,f.bubbleFormats)(o),s=o.offset(this.scroll),u=e[0].oldValue.replace(c.default.CONTENTS,""),p=(new a.default).insert(u),d=(new a.default).insert(o.value());t=(new a.default).retain(s).concat(p.diff(d,n)).reduce(function(t,e){return e.insert?t.insert(e.insert,i):t.push(e)},new a.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,v.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();function b(t,e){return Object.keys(e).reduce(function(n,r){return null==t[r]?n:(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]],n)},{})}e.default=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;f(this,t),this.index=e,this.length=n},h=function(){function t(e,n){var r=this;f(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=i.default.create("cursor",this),this.lastRange=this.savedRange=new d(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,l.default.sources.USER),1)}),this.emitter.on(l.default.events.EDITOR_CHANGE,function(t,e){t===l.default.events.TEXT_CHANGE&&e.length()>0&&r.update(l.default.sources.SILENT)}),this.emitter.on(l.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(l.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}}),this.emitter.on(l.default.events.SCROLL_OPTIMIZE,function(t,e){if(e.range){var n=e.range,o=n.startNode,i=n.startOffset,a=n.endNode,s=n.endOffset;r.setNativeRange(o,i,a,s)}}),this.update(l.default.sources.SILENT)}return o(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=!0}),this.root.addEventListener("compositionend",function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(l.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!i.default.query(t,i.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=i.default.find(n.start.node,!1);if(null==r)return;if(r instanceof i.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var o=void 0,i=this.scroll.leaf(t),a=r(i,2),s=a[0],l=a[1];if(null==s)return null;var u=s.position(l,!0),c=r(u,2);o=c[0],l=c[1];var f=document.createRange();if(e>0){f.setStart(o,l);var p=this.scroll.leaf(t+e),d=r(p,2);if(s=d[0],l=d[1],null==s)return null;var h=s.position(l,!0),v=r(h,2);return o=v[0],l=v[1],f.setEnd(o,l),f.getBoundingClientRect()}var m="left",y=void 0;return o instanceof Text?(l0&&(m="right")),{bottom:y.top+y.height,height:y.height,left:y[m],right:y[m],top:y.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return p.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var o=n.map(function(t){var n=r(t,2),o=n[0],a=n[1],s=i.default.find(o,!0),l=s.offset(e.scroll);return 0===a?l:s instanceof i.default.Container?l+s.length():l+s.index(o,a)}),a=Math.min(Math.max.apply(Math,c(o)),this.scroll.length()-1),s=Math.min.apply(Math,[a].concat(c(o)));return new d(s,a-s)}},{key:"normalizeNative",value:function(t){if(!v(this.root,t.startContainer)||!t.collapsed&&!v(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;n=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],o=[],i=this.scroll.length();return n.forEach(function(t,n){t=Math.min(i-1,t);var a,s=e.scroll.leaf(t),l=r(s,2),u=l[0],c=l[1],f=u.position(c,0!==n),p=r(f,2);a=p[0],c=p[1],o.push(a,c)}),o.length<2&&(o=o.concat(o)),o}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var o=this.scroll.length()-1,i=this.scroll.line(Math.min(e.index,o)),a=r(i,1)[0],s=a;if(e.length>0){var l=this.scroll.line(Math.min(e.index+e.length,o));s=r(l,1)[0]}if(null!=a&&null!=s){var u=t.getBoundingClientRect();n.topu.bottom&&(t.scrollTop+=n.bottom-u.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(p.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||o||t!==a.startContainer||e!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(t,e),s.setEnd(n,r),i.removeAllRanges(),i.addRange(s)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"==typeof e&&(n=e,e=!1),p.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,c(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.lastRange,n=this.getRange(),o=r(n,2),i=o[0],u=o[1];if(this.lastRange=i,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,s.default)(e,this.lastRange)){var c;!this.composing&&null!=u&&u.native.collapsed&&u.start.node!==this.cursor.textNode&&this.cursor.restore();var f,p=[l.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(e),t];if((c=this.emitter).emit.apply(c,[l.default.events.EDITOR_CHANGE].concat(p)),t!==l.default.sources.SILENT)(f=this.emitter).emit.apply(f,p)}}}]),t}();function v(t,e){try{e.parentNode}catch(t){return!1}return e instanceof Text&&(e=e.parentNode),t.contains(e)}e.Range=d,e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){var t;return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t},e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=s},function(t,e,n){var r=n(11),o=n(3),i={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=o(!0,{},e);for(var i in n||(r=Object.keys(r).reduce(function(t,e){return null!=r[e]&&(t[e]=r[e]),t},{})),t)void 0!==t[i]&&void 0===e[i]&&(r[i]=t[i]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,o){return r(t[o],e[o])||(n[o]=void 0===e[o]?null:e[o]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new a(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};function a(t){this.ops=t,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=i.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?i.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t.exports=i},function(t,n){var r=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,o;try{n=Map}catch(t){n=function(){}}try{r=Set}catch(t){r=function(){}}try{o=Promise}catch(t){o=function(){}}function i(a,l,u,c,f){"object"==typeof l&&(u=l.depth,c=l.prototype,f=l.includeNonEnumerable,l=l.circular);var p=[],d=[],h=void 0!==e;return void 0===l&&(l=!0),void 0===u&&(u=1/0),function a(u,v){if(null===u)return null;if(0===v)return u;var m,y;if("object"!=typeof u)return u;if(t(u,n))m=new n;else if(t(u,r))m=new r;else if(t(u,o))m=new o(function(t,e){u.then(function(e){t(a(e,v-1))},function(t){e(a(t,v-1))})});else if(i.__isArray(u))m=[];else if(i.__isRegExp(u))m=new RegExp(u.source,s(u)),u.lastIndex&&(m.lastIndex=u.lastIndex);else if(i.__isDate(u))m=new Date(u.getTime());else{if(h&&e.isBuffer(u))return m=e.allocUnsafe?e.allocUnsafe(u.length):new e(u.length),u.copy(m),m;t(u,Error)?m=Object.create(u):void 0===c?(y=Object.getPrototypeOf(u),m=Object.create(y)):(m=Object.create(c),y=c)}if(l){var g=p.indexOf(u);if(-1!=g)return d[g];p.push(u),d.push(m)}for(var _ in t(u,n)&&u.forEach(function(t,e){var n=a(e,v-1),r=a(t,v-1);m.set(n,r)}),t(u,r)&&u.forEach(function(t){var e=a(t,v-1);m.add(e)}),u){var b;y&&(b=Object.getOwnPropertyDescriptor(y,_)),b&&null==b.set||(m[_]=a(u[_],v-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(u);for(_=0;_0){if(s instanceof l.BlockEmbed||d instanceof l.BlockEmbed)return void this.optimize();if(s instanceof f.default){var h=s.newlineIndex(s.length(),!0);if(h>-1&&(s=s.split(h+1))===d)return void this.optimize()}else if(d instanceof f.default){var v=d.newlineIndex(0);v>-1&&d.split(v+1)}var m=d.children.head instanceof c.default?null:d.children.head;s.moveChildren(d,m),s.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var o=a.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var s=a.default.create(n,r);this.appendChild(s)}else i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(t),t=r}i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(h,t)}},{key:"lines",value:function(){return function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){h(e)?o.push(e):e instanceof a.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=s.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,t),i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,t)}}}]),e}();v.blotName="scroll",v.className="ql-editor",v.tagName="DIV",v.defaultChild="block",v.allowedChildren=[u.default,l.BlockEmbed,p.default],e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=A(t);if(null==r||null==r.key)return y.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,l.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var i=n.which||n.keyCode,a=(t.bindings[i]||[]).filter(function(t){return e.match(n,t)});if(0!==a.length){var l=t.quill.getSelection();if(null!=l&&t.quill.hasFocus()){var u=t.quill.getLine(l.index),c=o(u,2),p=c[0],d=c[1],h=t.quill.getLeaf(l.index),v=o(h,2),m=v[0],y=v[1],g=0===l.length?[m,y]:t.quill.getLeaf(l.index+l.length),_=o(g,2),b=_[0],w=_[1],x=m instanceof f.default.Text?m.value().slice(0,y):"",k=b instanceof f.default.Text?b.value().slice(w):"",O={collapsed:0===l.length,empty:0===l.length&&p.length()<=1,format:t.quill.getFormat(l),offset:d,prefix:x,suffix:k};a.some(function(e){if(null!=e.collapsed&&e.collapsed!==O.collapsed)return!1;if(null!=e.empty&&e.empty!==O.empty)return!1;if(null!=e.offset&&e.offset!==O.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==O.format[t]}))return!1}else if("object"===r(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=O.format[t]:!1===e.format[t]?null==O.format[t]:(0,s.default)(e.format[t],O.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(O.prefix))&&(!(null!=e.suffix&&!e.suffix.test(O.suffix))&&!0!==e.handler.call(t,l,O))})&&n.preventDefault()}}}})}}]),e}();function b(t,e){var n,r=t===_.keys.LEFT?"prefix":"suffix";return m(n={key:t,shiftKey:e,altKey:null},r,/^$/),m(n,"handler",function(n){var r=n.index;t===_.keys.RIGHT&&(r+=n.length+1);var i=this.quill.getLeaf(r);return!(o(i,1)[0]instanceof f.default.Embed)||(t===_.keys.LEFT?e?this.quill.setSelection(n.index-1,n.length+1,p.default.sources.USER):this.quill.setSelection(n.index-1,p.default.sources.USER):e?this.quill.setSelection(n.index,n.length+1,p.default.sources.USER):this.quill.setSelection(n.index+n.length+1,p.default.sources.USER),!1)}),n}function w(t,e){if(!(0===t.index||this.quill.getLength()<=1)){var n=this.quill.getLine(t.index),r=o(n,1)[0],i={};if(0===e.offset){var a=this.quill.getLine(t.index-1),s=o(a,1)[0];if(null!=s&&s.length()>1){var l=r.formats(),u=this.quill.getFormat(t.index-1,1);i=c.default.attributes.diff(l,u)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,p.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-f,f,i,p.default.sources.USER),this.quill.focus()}}function x(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},i=0,a=this.quill.getLine(t.index),s=o(a,1)[0];if(e.offset>=s.length()-1){var l=this.quill.getLine(t.index+1),u=o(l,1)[0];if(u){var f=s.formats(),d=this.quill.getFormat(t.index,1);r=c.default.attributes.diff(f,d)||{},i=u.length()}}this.quill.deleteText(t.index,n,p.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+i-1,n,r,p.default.sources.USER)}}function k(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),o=e[e.length-1].formats();n=c.default.attributes.diff(o,r)||{}}this.quill.deleteText(t,p.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,p.default.sources.USER),this.quill.setSelection(t.index,p.default.sources.SILENT),this.quill.focus()}function O(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return f.default.query(n,f.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,p.default.sources.USER),this.quill.setSelection(t.index+1,p.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],p.default.sources.USER))})}function E(t){return{key:_.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=f.default.query("code-block"),r=e.index,i=e.length,a=this.quill.scroll.descendant(n,r),s=o(a,2),l=s[0],u=s[1];if(null!=l){var c=this.quill.getIndex(l),d=l.newlineIndex(u,!0)+1,h=l.newlineIndex(c+u+i),v=l.domNode.textContent.slice(d,h).split("\n");u=0,v.forEach(function(e,o){t?(l.insertAt(d+u,n.TAB),u+=n.TAB.length,0===o?r+=n.TAB.length:i+=n.TAB.length):e.startsWith(n.TAB)&&(l.deleteAt(d+u,n.TAB.length),u-=n.TAB.length,0===o?r-=n.TAB.length:i-=n.TAB.length),u+=e.length+1}),this.quill.update(p.default.sources.USER),this.quill.setSelection(r,i,p.default.sources.SILENT)}}}}function C(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],p.default.sources.USER)}}}function A(t){if("string"==typeof t||"number"==typeof t)return A({key:t});if("object"===(void 0===t?"undefined":r(t))&&(t=(0,a.default)(t,!1)),"string"==typeof t.key)if(null!=_.keys[t.key.toUpperCase()])t.key=_.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[g]=t.shortKey,delete t.shortKey),t}_.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},_.DEFAULTS={bindings:{bold:C("bold"),italic:C("italic"),underline:C("underline"),indent:{key:_.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",p.default.sources.USER)}},outdent:{key:_.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",p.default.sources.USER)}},"outdent backspace":{key:_.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",p.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,p.default.sources.USER)}},"indent code-block":E(!0),"outdent code-block":E(!1),"remove tab":{key:_.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,p.default.sources.USER)}},tab:{key:_.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new u.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,p.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,p.default.sources.SILENT)}},"list empty enter":{key:_.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,p.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,p.default.sources.USER)}},"checklist enter":{key:_.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=o(e,2),r=n[0],i=n[1],a=(0,l.default)({},r.formats(),{list:"checked"}),s=(new u.default).retain(t.index).insert("\n",a).retain(r.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,p.default.sources.USER),this.quill.setSelection(t.index+1,p.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:_.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=o(n,2),i=r[0],a=r[1],s=(new u.default).retain(t.index).insert("\n",e.format).retain(i.length()-a-1).retain(1,{header:null});this.quill.updateContents(s,p.default.sources.USER),this.quill.setSelection(t.index+1,p.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),i=o(r,2),a=i[0],s=i[1];if(s>n)return!0;var l=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(t.index," ",p.default.sources.USER),this.quill.history.cutoff();var c=(new u.default).retain(t.index-s).delete(n+1).retain(a.length()-2-s).retain(1,{list:l});this.quill.updateContents(c,p.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,p.default.sources.SILENT)}},"code exit":{key:_.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=o(e,2),r=n[0],i=n[1],a=(new u.default).retain(t.index+r.length()-i-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,p.default.sources.USER)}},"embed left":b(_.keys.LEFT,!1),"embed left shift":b(_.keys.LEFT,!0),"embed right":b(_.keys.RIGHT,!1),"embed right shift":b(_.keys.RIGHT,!0)}},e.default=_,e.SHORTKEY=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n-1}l.blotName="link",l.tagName="A",l.SANITIZED_URL="about:blank",l.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=l,e.sanitize=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":r(Event))){var o=document.createEvent("Event");o.initEvent("change",!0,!0),this.select.dispatchEvent(o)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=y(n(0)),o=y(n(5)),i=n(4),a=y(i),s=y(n(16)),l=y(n(25)),u=y(n(24)),c=y(n(35)),f=y(n(6)),p=y(n(22)),d=y(n(7)),h=y(n(55)),v=y(n(42)),m=y(n(23));function y(t){return t&&t.__esModule?t:{default:t}}o.default.register({"blots/block":a.default,"blots/block/embed":i.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":u.default,"blots/embed":c.default,"blots/inline":f.default,"blots/scroll":p.default,"blots/text":d.default,"modules/clipboard":h.default,"modules/history":v.default,"modules/keyboard":m.default}),r.default.register(a.default,s.default,u.default,f.default,p.default,d.default),e.default=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);i.wrap(a),a.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),o=n(32),i=n(33),a=n(1),s=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),s=i.default.keys(this.domNode);e.concat(n).concat(s).forEach(function(e){var n=a.query(e,a.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){i(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(i(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function i(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[i(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[i(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[i(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}();function u(t){var e=t.reduce(function(t,e){return t+=e.delete||0},0),n=t.length()-e;return function(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some(function(t){return null!=o.default.query(t,o.default.Scope.BLOCK)}))}(t)&&(n-=1),n}l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=l,e.getLastChangeIndex=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,a.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,a.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=function(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(e)return(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0";if(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/";return t}(t);case"formula":if(!t)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,a.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",a.default.sources.USER),this.quill.setSelection(r+2,a.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}();function O(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}e.BaseTooltip=k,e.default=x},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+l-t)):n(r,0,Math.min(l,t+e-a)),a+=l}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(17),a=n(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},l=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,s),n.attach(),n}return o(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var o=[].slice.call(this.observer.takeRecords());o.length>0;)e.push(o.pop());for(var s=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[a.DATA_KEY].mutations&&(t.domNode[a.DATA_KEY].mutations=[]),e&&s(t.parent))},l=function(t){null!=t.domNode[a.DATA_KEY]&&null!=t.domNode[a.DATA_KEY].mutations&&(t instanceof i.default&&t.children.forEach(l),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(t){var e=a.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(s(a.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=a.find(t,!1);s(e,!1),e instanceof i.default&&e.children.forEach(function(t){s(t,!1)})})):"attributes"===t.type&&s(e.prev)),s(e))}),this.children.forEach(l),o=(u=[].slice.call(this.observer.takeRecords())).slice();o.length>0;)e.push(o.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map(function(t){var e=a.find(t.target,!0);return null==e?null:null==e.domNode[a.DATA_KEY].mutations?(e.domNode[a.DATA_KEY].mutations=[t],e):(e.domNode[a.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==r&&null!=t.domNode[a.DATA_KEY]&&t.update(t.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="DIV",e}(i.default);e.default=l},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),a=n(1);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){null!=this.formats()[r]||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var o=this.next;o instanceof e&&o.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,o.formats())&&(o.moveChildren(this),o.remove())},e.blotName="inline",e.scope=a.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),a=n(1),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){var r=a.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=a.query(r,a.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=a.query(n,a.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),i=a.create(n,r);o.parent.insertBefore(i,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="P",e}(i.default);e.default=s},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(19).default);e.default=i},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(19),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return o(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=a.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=a.Scope.INLINE_BLOT,e}(i.default);e.default=s},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:o.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;ie.length?t:e,f=t.length>e.length?e:t,p=c.indexOf(f);if(-1!=p)return u=[[r,c.substring(0,p)],[o,f],[r,c.substring(p+f.length)]],t.length>e.length&&(u[0][0]=u[2][0]=n),u;if(1==f.length)return[[n,t],[r,e]];var d=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length=t.length?[r,o,i,a,f]:null}var i,a,u,c,f,p=o(n,r,Math.ceil(n.length/4)),d=o(n,r,Math.ceil(n.length/2));if(!p&&!d)return null;i=d?p&&p[4].length>d[4].length?p:d:p;t.length>e.length?(a=i[0],u=i[1],c=i[2],f=i[3]):(c=i[0],f=i[1],a=i[2],u=i[3]);var h=i[4];return[a,u,c,f,h]}(t,e);if(d){var h=d[0],v=d[1],m=d[2],y=d[3],g=d[4],_=i(h,m),b=i(v,y);return _.concat([[o,g]],b)}return function(t,e){for(var o=t.length,i=e.length,s=Math.ceil((o+i)/2),l=s,u=2*s,c=new Array(u),f=new Array(u),p=0;po)m+=2;else if(x>i)v+=2;else if(h){var k=l+d-b;if(k>=0&&k=O)return a(t,e,A,x)}}}for(var E=-_+y;E<=_-g;E+=2){for(var k=l+E,C=(O=E==-_||E!=_&&f[k-1]o)g+=2;else if(C>i)y+=2;else if(!h){var w=l+d-E;if(w>=0&&w=(O=o-O))return a(t,e,A,x)}}}}return[[n,t],[r,e]]}(t,e)}(t=t.substring(0,t.length-f),e=e.substring(0,e.length-f));return p&&h.unshift([o,p]),d&&h.push([o,d]),function t(e){e.push([o,""]);var i=0;var a=0;var u=0;var c="";var f="";var p;for(;i1?(0!==a&&0!==u&&(0!==(p=s(f,c))&&(i-a-u>0&&e[i-a-u-1][0]==o?e[i-a-u-1][1]+=f.substring(0,p):(e.splice(0,0,[o,f.substring(0,p)]),i++),f=f.substring(p),c=c.substring(p)),0!==(p=l(f,c))&&(e[i][1]=f.substring(f.length-p)+e[i][1],f=f.substring(0,f.length-p),c=c.substring(0,c.length-p))),0===a?e.splice(i-u,a+u,[r,f]):0===u?e.splice(i-a,a+u,[n,c]):e.splice(i-a-u,a+u,[n,c],[r,f]),i=i-a-u+(a?1:0)+(u?1:0)+1):0!==i&&e[i-1][0]==o?(e[i-1][1]+=e[i][1],e.splice(i,1)):i++,u=0,a=0,c="",f=""}""===e[e.length-1][1]&&e.pop();var d=!1;i=1;for(;i0&&i.splice(a+2,0,[l[0],u]),c(i,a,3)}return t}(h,u)),h=function(t){for(var e=!1,i=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},a=2;a=55296&&s.charCodeAt(s.length-1)<=56319)&&t[a-1][0]===n&&i(t[a-1][1])&&t[a][0]===r&&i(t[a][1])&&(e=!0,t[a-1][1]=t[a-2][1].slice(-1)+t[a-1][1],t[a][1]=t[a-2][1].slice(-1)+t[a][1],t[a-2][1]=t[a-2][1].slice(0,-1));var s;if(!e)return t;for(var l=[],a=0;a0&&l.push(t[a]);return l}(h)}function a(t,e,n,r){var o=t.substring(0,n),a=e.substring(0,r),s=t.substring(n),l=e.substring(r),u=i(o,a),c=i(s,l);return u.concat(c)}function s(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n=0&&r>=e-1;r--)if(r+1=700)&&(n.bold=!0);Object.keys(n).length>0&&(e=A(e,n));parseFloat(r.textIndent||0)>0&&(e=(new s.default).insert("\t").concat(e));return e}],["li",function(t,e){var n=l.default.query(t);if(null==n||"list-item"!==n.blotName||!T(e,"\n"))return e;var r=-1,o=t.parentNode;for(;!o.classList.contains("ql-clipboard");)"list"===(l.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?e:e.compose((new s.default).retain(e.length()-1).retain(1,{indent:r}))}],["b",j.bind(j,"bold")],["i",j.bind(j,"italic")],["style",function(){return new s.default}]],O=[p.AlignAttribute,m.DirectionAttribute].reduce(function(t,e){return t[e.keyName]=e,t},{}),E=[p.AlignStyle,d.BackgroundStyle,v.ColorStyle,m.DirectionStyle,y.FontStyle,g.SizeStyle].reduce(function(t,e){return t[e.keyName]=e,t},{}),C=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],k.concat(r.options.matchers).forEach(function(t){var e=o(t,2),i=e[0],a=e[1];(n.matchVisual||a!==I)&&r.addMatcher(i,a)}),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,f.default),i(e,[{key:"addMatcher",value:function(t,e){this.matchers.push([t,e])}},{key:"convert",value:function(t){if("string"==typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[h.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new s.default).insert(n,b({},h.default.blotName,e[h.default.blotName]))}var r=this.prepareMatching(),i=o(r,2),a=i[0],l=i[1],u=function t(e,n,r){return e.nodeType===e.TEXT_NODE?r.reduce(function(t,n){return n(e,t)},new s.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],function(o,i){var a=t(i,n,r);return i.nodeType===e.ELEMENT_NODE&&(a=n.reduce(function(t,e){return e(i,t)},a),a=(i[x]||[]).reduce(function(t,e){return e(i,t)},a)),o.concat(a)},new s.default):new s.default}(this.container,a,l);return T(u,"\n")&&null==u.ops[u.ops.length-1].attributes&&(u=u.compose((new s.default).retain(u.length()-1).delete(1))),w.log("convert",this.container.innerHTML,u),this.container.innerHTML="",u}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,u.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new s.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),u.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new s.default).retain(n.index),o=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(u.default.sources.SILENT),setTimeout(function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,u.default.sources.USER),e.quill.setSelection(r.length()-n.length,u.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=o,e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach(function(r){var i=o(r,2),a=i[0],s=i[1];switch(a){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:e.push(s);break;default:[].forEach.call(t.container.querySelectorAll(a),function(t){t[x]=t[x]||[],t[x].push(s)})}}),[e,n]}}]),e}();function A(t,e,n){return"object"===(void 0===e?"undefined":r(e))?Object.keys(e).reduce(function(t,n){return A(t,n,e[n])},t):t.reduce(function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,a.default)({},b({},e,n),r.attributes))},new s.default)}function S(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};return t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function T(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function j(t,e,n){return A(n,t,!0)}function P(t,e){var n=l.default.Attributor.Attribute.keys(t),r=l.default.Attributor.Class.keys(t),o=l.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=l.default.query(e,l.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(null==(n=O[e])||n.attrName!==e&&n.keyName!==e||(i[n.attrName]=n.value(t)||void 0),null==(n=E[e])||n.attrName!==e&&n.keyName!==e||(n=E[e],i[n.attrName]=n.value(t)||void 0))}),Object.keys(i).length>0&&(e=A(e,i)),e}function M(t,e){var n=l.default.query(t);if(null==n)return e;if(n.prototype instanceof l.default.Embed){var r={},o=n.value(t);null!=o&&(r[n.blotName]=o,e=(new s.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=A(e,n.blotName,n.formats(t)));return e}function L(t,e){return T(e,"\n")||(N(t)||e.length()>0&&t.nextSibling&&N(t.nextSibling))&&e.insert("\n"),e}function I(t,e){if(N(t)&&null!=t.nextElementSibling&&!T(e,"\n\n")){var n=t.offsetHeight+parseFloat(S(t).marginTop)+parseFloat(S(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function R(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!S(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&N(t.parentNode)||null!=t.previousSibling&&N(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&N(t.parentNode)||null!=t.nextSibling&&N(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}C.DEFAULTS={matchers:[],matchVisual:!0},e.default=C,e.matchAttributor=P,e.matchBlot=M,e.matchNewline=L,e.matchSpacing=I,e.matchText=R},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;nr.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.leftr.bottom){var a=o.bottom-o.top,s=t.bottom-t.top+a;this.root.style.top=n-s+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=I(n(29)),o=n(36),i=n(38),a=n(64),s=I(n(65)),l=I(n(66)),u=n(67),c=I(u),f=n(37),p=n(26),d=n(39),h=n(40),v=I(n(56)),m=I(n(68)),y=I(n(27)),g=I(n(69)),_=I(n(70)),b=I(n(71)),w=I(n(72)),x=I(n(73)),k=n(13),O=I(k),E=I(n(74)),C=I(n(75)),A=I(n(57)),S=I(n(41)),T=I(n(28)),N=I(n(59)),j=I(n(60)),P=I(n(61)),M=I(n(108)),L=I(n(62));function I(t){return t&&t.__esModule?t:{default:t}}r.default.register({"attributors/attribute/direction":i.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":f.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":i.DirectionClass,"attributors/class/font":d.FontClass,"attributors/class/size":h.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":f.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":i.DirectionStyle,"attributors/style/font":d.FontStyle,"attributors/style/size":h.SizeStyle},!0),r.default.register({"formats/align":o.AlignClass,"formats/direction":i.DirectionClass,"formats/indent":a.IndentClass,"formats/background":f.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":d.FontClass,"formats/size":h.SizeClass,"formats/blockquote":s.default,"formats/code-block":O.default,"formats/header":l.default,"formats/list":c.default,"formats/bold":v.default,"formats/code":k.Code,"formats/italic":m.default,"formats/link":y.default,"formats/script":g.default,"formats/strike":_.default,"formats/underline":b.default,"formats/image":w.default,"formats/video":x.default,"formats/list/item":u.ListItem,"modules/formula":E.default,"modules/syntax":C.default,"modules/toolbar":A.default,"themes/bubble":M.default,"themes/snow":L.default,"ui/icons":S.default,"ui/picker":T.default,"ui/icon-picker":j.default,"ui/color-picker":N.default,"ui/tooltip":P.default},!0),e.default=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var r,o=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return t={},e=this.statics.blotName,n=this.statics.formats(this.domNode),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var t,e,n}},{key:"insertBefore",value:function(t,n){if(t instanceof p)o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),i=this.split(r);i.parent.insertBefore(t,i)}}},{key:"optimize",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=i.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}();d.blotName="list",d.scope=i.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[p],e.ListItem=p,e.default=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(56),i=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,i.default),e}();a.blotName="italic",a.tagName=["EM","I"],e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return u.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,l.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}();c.blotName="image",c.tagName="IMG",e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=i(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return u.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return l.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}();c.blotName="video",c.className="ql-video",c.tagName="IFRAME",e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var r=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}();p.className="ql-syntax";var d=new o.default.Attributor.Class("token","hljs",{scope:o.default.Scope.INLINE}),h=function(t){function e(t,n){u(this,e);var r=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var o=null;return r.quill.on(i.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(o),o=setTimeout(function(){r.highlight(),o=null},r.options.interval)}),r.highlight(),r}return f(e,a.default),r(e,null,[{key:"register",value:function(){i.default.register(d,!0),i.default.register(p,!0)}}]),r(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(i.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(p).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(i.default.sources.SILENT),null!=e&&this.quill.setSelection(e,i.default.sources.SILENT)}}}]),e}();h.DEFAULTS={highlight:null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value},interval:1e3},e.CodeBlock=p,e.CodeToken=d,e.default=h},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var r=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},o=function(){function t(t,e){for(var n=0;n0&&o===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var i=r.quill.getLines(e.index,e.length);if(1===i.length)r.position(r.quill.getBounds(e));else{var s=i[i.length-1],l=r.quill.getIndex(s),c=Math.min(s.length()-1,e.index+e.length-l),f=r.quill.getBounds(new u.Range(l,c));r.position(f)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return h(e,s.BaseTooltip),o(e,[{key:"listen",value:function(){var t=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),o=this.root.querySelector(".ql-tooltip-arrow");if(o.style.marginLeft="",0===n)return n;o.style.marginLeft=-1*n-o.offsetWidth/2+"px"}}]),e}();y.TEMPLATE=['','
','','',"
"].join(""),e.BubbleTooltip=y,e.default=m},function(t,e,n){t.exports=n(63)}]).default},t.exports=n()}).call(this,n("tjlA").Buffer)},mvjY:function(t,e,n){var r=n("Am8b");"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(r,o);r.locals&&(t.exports=r.locals)},myLK:function(t,e,n){"use strict";var r={props:["isFiltered"]},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("dropdown",{staticClass:"relative ml-4",on:{showing:function(e){t.$emit("showing")}}},[n("button",{staticClass:"focus:outline-none text-light hover:text-primary h-8",attrs:{slot:"trigger"},slot:"trigger"},[t.isFiltered?n("span",{staticClass:"block rounded-full pulse bg-red absolute w-3 h-3 pin-t pin-r opacity-75"}):t._e(),t._v(" "),n("svg",{staticClass:"w-4 h-4 fill-current",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"}})])]),t._v(" "),n("div",{staticClass:"dropdown-content w-64 pin-r p-3",attrs:{slot:"content"},slot:"content"},[t._t("default")],2)])},[],!1,null,null,null);i.options.__file="FilterDropdown.vue";e.a=i.exports},nabw:function(t,e,n){"use strict";n.r(e);var r={data:function(){return{}},mounted:function(){document.title="404 — Wink."},methods:{}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("page-header"),this._v(" "),this._m(0)],1)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"container"},[e("div",{staticClass:"row justify-content-center"},[e("div",{staticClass:"col-lg-10"},[e("div",{staticClass:"card"},[e("h2",{staticClass:"mb-5 text-center"},[this._v("404 — Not found")]),this._v(" "),e("p",{staticClass:"text-center"},[this._v("The page you're looking for couldn't be found!")])])])])])}],!1,null,null,null);i.options.__file="404.vue";e.default=i.exports},oI7Q:function(t,e,n){"use strict";var r=n("eTuZ");n.n(r).a},pXQQ:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,".croppie-container {\n width: 100%;\n height: 100%;\n}\n\n.croppie-container .cr-image {\n z-index: -1;\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: 0 0;\n max-height: none;\n max-width: none;\n}\n\n.croppie-container .cr-boundary {\n position: relative;\n overflow: hidden;\n margin: 0 auto;\n z-index: 1;\n width: 100%;\n height: 100%;\n}\n\n.croppie-container .cr-viewport,\n.croppie-container .cr-resizer {\n position: absolute;\n border: 2px solid #fff;\n margin: auto;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5);\n z-index: 0;\n}\n\n.croppie-container .cr-resizer {\n z-index: 2;\n box-shadow: none;\n pointer-events: none;\n}\n\n.croppie-container .cr-resizer-vertical,\n.croppie-container .cr-resizer-horisontal {\n position: absolute;\n pointer-events: all;\n}\n\n.croppie-container .cr-resizer-vertical::after,\n.croppie-container .cr-resizer-horisontal::after {\n display: block;\n position: absolute;\n box-sizing: border-box;\n border: 1px solid black;\n background: #fff;\n width: 10px;\n height: 10px;\n content: '';\n}\n\n.croppie-container .cr-resizer-vertical {\n bottom: -5px;\n cursor: row-resize;\n width: 100%;\n height: 10px;\n}\n\n.croppie-container .cr-resizer-vertical::after {\n left: 50%;\n margin-left: -5px;\n}\n\n.croppie-container .cr-resizer-horisontal {\n right: -5px;\n cursor: col-resize;\n width: 10px;\n height: 100%;\n}\n\n.croppie-container .cr-resizer-horisontal::after {\n top: 50%;\n margin-top: -5px;\n}\n\n.croppie-container .cr-original-image {\n display: none;\n}\n\n.croppie-container .cr-vp-circle {\n border-radius: 50%;\n}\n\n.croppie-container .cr-overlay {\n z-index: 1;\n position: absolute;\n cursor: move;\n touch-action: none;\n}\n\n.croppie-container .cr-slider-wrap {\n width: 75%;\n margin: 15px auto;\n text-align: center;\n}\n\n.croppie-result {\n position: relative;\n overflow: hidden;\n}\n\n.croppie-result img {\n position: absolute;\n}\n\n.croppie-container .cr-image,\n.croppie-container .cr-overlay,\n.croppie-container .cr-viewport {\n -webkit-transform: translateZ(0);\n -moz-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n/*************************************/\n/***** STYLING RANGE INPUT ***********/\n/*************************************/\n/*http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */\n/*************************************/\n\n.cr-slider {\n -webkit-appearance: none;\n/*removes default webkit styles*/\n\t/*border: 1px solid white; *//*fix for FF unable to apply focus style bug */\n width: 300px;\n/*required for proper track sizing in FF*/\n max-width: 100%;\n padding-top: 8px;\n padding-bottom: 8px;\n background-color: transparent;\n}\n\n.cr-slider::-webkit-slider-runnable-track {\n width: 100%;\n height: 3px;\n background: rgba(0, 0, 0, 0.5);\n border: 0;\n border-radius: 3px;\n}\n\n.cr-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n border: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #ddd;\n margin-top: -6px;\n}\n\n.cr-slider:focus {\n outline: none;\n}\n/*\n.cr-slider:focus::-webkit-slider-runnable-track {\nbackground: #ccc;\n}\n*/\n\n.cr-slider::-moz-range-track {\n width: 100%;\n height: 3px;\n background: rgba(0, 0, 0, 0.5);\n border: 0;\n border-radius: 3px;\n}\n\n.cr-slider::-moz-range-thumb {\n border: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #ddd;\n margin-top: -6px;\n}\n\n/*hide the outline behind the border*/\n.cr-slider:-moz-focusring {\n outline: 1px solid white;\n outline-offset: -1px;\n}\n\n.cr-slider::-ms-track {\n width: 100%;\n height: 5px;\n background: transparent;\n/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */\n\tborder-color: transparent;/*leave room for the larger thumb to overflow with a transparent border */\n\tborder-width: 6px 0;\n\tcolor: transparent;/*remove default tick marks*/\n}\n.cr-slider::-ms-fill-lower {\n\tbackground: rgba(0, 0, 0, 0.5);\n\tborder-radius: 10px;\n}\n.cr-slider::-ms-fill-upper {\n\tbackground: rgba(0, 0, 0, 0.5);\n\tborder-radius: 10px;\n}\n.cr-slider::-ms-thumb {\n\tborder: none;\n\theight: 16px;\n\twidth: 16px;\n\tborder-radius: 50%;\n\tbackground: #ddd;\n\tmargin-top:1px;\n}\n.cr-slider:focus::-ms-fill-lower {\n\tbackground: rgba(0, 0, 0, 0.5);\n}\n.cr-slider:focus::-ms-fill-upper {\n\tbackground: rgba(0, 0, 0, 0.5);\n}\n/*******************************************/\n\n/***********************************/\n/* Rotation Tools */\n/***********************************/\n.cr-rotate-controls {\n\tposition: absolute;\n\tbottom: 5px;\n\tleft: 5px;\n\tz-index: 1;\n}\n.cr-rotate-controls button {\n\tborder: 0;\n\tbackground: none;\n}\n.cr-rotate-controls i:before {\n\tdisplay: inline-block;\n\tfont-style: normal;\n\tfont-weight: 900;\n\tfont-size: 22px;\n}\n.cr-rotate-l i:before {\n\tcontent: '\\21BA';\n}\n.cr-rotate-r i:before {\n\tcontent: '\\21BB';\n}\n",""])},pweE:function(t,e,n){(function(e){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,n){var r=n(3)(n(2),n(4),null,null);t.exports=r.exports},function(t,n,r){"use strict";function o(t){t.component("textarea-autosize",a.a)}Object.defineProperty(n,"__esModule",{value:!0}),n.install=o;var i=r(0),a=r.n(i);r.d(n,"TextareaAutosize",function(){return a.a});var s={version:"1.0.4",install:o};n.default=s;var l=null;"undefined"!=typeof window?l=window.Vue:void 0!==e&&(l=e.Vue),l&&l.use(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"TextareaAutosize",created:function(){this.updateVal()},mounted:function(){this.resize()},props:{value:{type:[String,Number],default:""},autosize:{type:Boolean,default:!0},minHeight:{type:[Number],default:null},maxHeight:{type:[Number],default:null},important:{type:[Boolean,Array],default:!1}},data:function(){return{val:null,maxHeightScroll:!1}},computed:{computedStyles:function(){var t={};return this.autosize&&(t.resize=this.isResizeImportant?"none !important":"none",this.maxHeightScroll||(t.overflow=this.isOverflowImportant?"hidden !important":"hidden")),t},isResizeImportant:function(){var t=this.important;return!0===t||Array.isArray(t)&&t.includes("resize")},isOverflowImportant:function(){var t=this.important;return!0===t||Array.isArray(t)&&t.includes("overflow")},isHeightImportant:function(){var t=this.important;return!0===t||Array.isArray(t)&&t.includes("height")}},methods:{updateVal:function(){this.val=this.value},resize:function(){var t=this.isHeightImportant?"important":void 0;this.$el.style.setProperty("height","auto",t);var e=this.$el.scrollHeight+1;this.minHeight&&(e=ethis.maxHeight?(e=this.maxHeight,this.maxHeightScroll=!0):this.maxHeightScroll=!1);var n=e+"px";return this.$el.style.setProperty("height",n,t),this}},watch:{value:function(){this.updateVal()},val:function(t){this.$nextTick(this.resize),this.$emit("input",t)}}}},function(t,e){t.exports=function(t,e,n,r){var o,i=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(o=t,i=t.default);var s="function"==typeof i?i.options:i;if(e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns),n&&(s._scopeId=n),r){var l=s.computed||(s.computed={});Object.keys(r).forEach(function(t){var e=r[t];l[t]=function(){return e}})}return{esModule:o,exports:i,options:s}}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("textarea",{directives:[{name:"model",rawName:"v-model",value:t.val,expression:"val"}],style:t.computedStyles,domProps:{value:t.val},on:{focus:t.resize,input:function(e){e.target.composing||(t.val=e.target.value)}}})},staticRenderFns:[]}}])}).call(this,n("yLpj"))},q67R:function(t,e,n){"use strict";n.r(e);n("LvDl");var r=n("wd/R"),o=n.n(r),i={props:["value"],data:function(){return{dateComponents:{day:"",month:"",year:"",hour:"",minute:""},result:""}},mounted:function(){this.buildComponents(this.value)},watch:{value:function(t){this.buildComponents(t)},dateComponents:{handler:function(){this.result=this.dateComponents.year+"-"+this.dateComponents.month+"-"+this.dateComponents.day+" "+this.dateComponents.hour+":"+this.dateComponents.minute+":00",this.$emit("input",this.result)},deep:!0}},computed:{},methods:{buildComponents:function(t){var e=o()(t+" Z").utc();this.dateComponents={month:e.format("MM"),day:e.format("DD"),year:e.format("YYYY"),hour:e.format("HH"),minute:e.format("mm")}}}},a=(n("bKMg"),n("KHd+")),s=Object(a.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"d-flex flex-row"},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.dateComponents.month,expression:"dateComponents.month"}],staticClass:"input pr-2",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.dateComponents,"month",e.target.multiple?n:n[0])}}},t._l(Array.from({length:12},function(t,e){return String(e+1).padStart(2,"0")}),function(e){return n("option",{domProps:{value:e}},[t._v(t._s(e))])}),0),t._v(" "),n("span",{staticClass:"px-1"},[t._v("/")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.dateComponents.day,expression:"dateComponents.day"}],staticClass:"input px-2",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.dateComponents,"day",e.target.multiple?n:n[0])}}},t._l(Array.from({length:31},function(t,e){return String(e+1).padStart(2,"0")}),function(e){return n("option",{domProps:{value:e}},[t._v(t._s(e))])}),0),t._v(" "),n("span",{staticClass:"px-1"},[t._v("/")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.dateComponents.year,expression:"dateComponents.year"}],staticClass:"input px-2",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.dateComponents,"year",e.target.multiple?n:n[0])}}},t._l(Array.from({length:15},function(t,e){return e+(new Date).getFullYear()-10}),function(e){return n("option",{domProps:{value:e}},[t._v(t._s(e))])}),0),t._v(" "),n("span",{staticClass:"pl-5"}),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.dateComponents.hour,expression:"dateComponents.hour"}],staticClass:"input px-2",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.dateComponents,"hour",e.target.multiple?n:n[0])}}},t._l(Array.from({length:24},function(t,e){return String(e).padStart(2,"0")}),function(e){return n("option",{domProps:{value:e}},[t._v(t._s(e))])}),0),t._v(" "),n("span",{staticClass:"px-1"},[t._v(":")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.dateComponents.minute,expression:"dateComponents.minute"}],staticClass:"input pl-2",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.dateComponents,"minute",e.target.multiple?n:n[0])}}},t._l(Array.from({length:60},function(t,e){return String(e).padStart(2,"0")}),function(e){return n("option",{domProps:{value:e}},[t._v(t._s(e))])}),0)])])},[],!1,null,"72930e8c",null);s.options.__file="DateTimePicker.vue";e.default=s.exports},qWph:function(t,e,n){"use strict";n.r(e);n("LvDl");var r=n("kzlf"),o=n.n(r),i={props:["postId"],data:function(){return{existingBlot:null,imageUrl:null,layout:"default",caption:"",imagePickerKey:"",uploadProgress:0,uploading:!1,modalShown:!1}},mounted:function(){var t=this;this.layouts=[{id:"test",name:"Test"}],this.$parent.$on("openingImageUploader",function(e){e&&(t.caption=e.caption,t.imageUrl=e.url,t.layout=e.layout||"default",t.existingBlot=e.existingBlot),t.modalShown=!0})},methods:{close:function(){this.modalShown=!1,this.imagePickerKey=_.uniqueId(),this.existingBlot=null,this.imageUrl=null,this.layout="default",this.caption=""},updateImage:function(t){var e=t.url,n=t.caption;this.imageUrl=e,this.caption=n,this.uploading=!1},applyImage:function(){if(!this.imageUrl)return this.alertError("Please select an image.");this.$emit("updated",{url:this.imageUrl,caption:this.caption,existingBlot:this.existingBlot,layout:this.layout}),this.close()},updateProgress:function(t){var e=t.progress;this.uploadProgress=e}}},a=(n("v1Jv"),n("KHd+")),s=Object(a.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.modalShown?n("modal",{on:{close:t.close}},[n("h2",{staticClass:"font-semibold mb-5"},[t._v("Add Image")]),t._v(" "),t.uploading?n("preloader"):t._e(),t._v(" "),t.imageUrl&&!t.uploading?n("div",[n("img",{staticClass:"max-w-full",attrs:{src:t.imageUrl}}),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label"},[t._v("Caption")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.caption,expression:"caption"}],ref:"caption",staticClass:"input",attrs:{rows:"2",placeholder:"Add caption to the image"},domProps:{value:t.caption},on:{input:function(e){e.target.composing||(t.caption=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"input-group"},[n("label",{staticClass:"input-label"},[t._v("Layout")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.layout,expression:"layout"}],staticClass:"input",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.layout=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"default"}},[t._v("Default")]),t._v(" "),n("option",{attrs:{value:"wide"}},[t._v("Wide Image")])])])]):t._e(),t._v(" "),t.imageUrl?t._e():n("image-picker",{key:t.imagePickerKey,staticClass:"mt-5",on:{changed:t.updateImage,progressing:t.updateProgress,uploading:function(e){t.uploading=!0}}}),t._v(" "),n("button",{staticClass:"btn-sm btn-primary mt-10",on:{click:t.applyImage}},[t._v("Apply")]),t._v(" "),n("button",{staticClass:"btn-sm btn-light mt-10",on:{click:t.close}},[t._v("Cancel")])],1):t._e()},[],!1,null,null,null);s.options.__file="ImageUploader.vue";var l=s.exports,u={props:["postId"],data:function(){return{existingBlot:null,content:"",modalShown:!1}},mounted:function(){var t=this;this.$parent.$on("openingHTMLEmbedder",function(e){e&&(t.content=e.content,t.existingBlot=e.existingBlot),t.modalShown=!0,t.$nextTick(function(){return t.$refs.content.focus()})})},methods:{close:function(){this.modalShown=!1,this.content="",this.existingBlot=null},applyHTML:function(){this.$emit("adding",{content:this.content,existingBlot:this.existingBlot}),this.close()}}},c=(n("1Hzp"),Object(a.a)(u,function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.modalShown?n("modal",{on:{close:t.close}},[n("h2",{staticClass:"font-semibold mb-5"},[t._v("Embed HTML")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.content,expression:"content"}],ref:"content",staticClass:"input",attrs:{cols:"30",rows:"10",placeholder:"Paste your HTML here"},domProps:{value:t.content},on:{input:function(e){e.target.composing||(t.content=e.target.value)}}}),t._v(" "),n("button",{staticClass:"btn-sm btn-primary mt-10",on:{click:t.applyHTML}},[t._v("Apply")]),t._v(" "),n("button",{staticClass:"btn-sm btn-light mt-10",on:{click:t.close}},[t._v("Cancel")])]):t._e()},[],!1,null,null,null));c.options.__file="HTMLEmbedder.vue";var f=c.exports;function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;this.$emit("openingHTMLEmbedder",t)},openImageUploader:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.$emit("openingImageUploader",t)},applyImage:function(t){var e=t.url,n=t.caption,r=t.existingBlot,i={url:e,caption:n,layout:t.layout};if(r)return r.replaceWith("captioned-image",i);var a=this.editor.getSelection(!0);this.editor.insertEmbed(a.index,"captioned-image",i,o.a.sources.USER),this.editor.setSelection(a.index+1,o.a.sources.SILENT)},addDivider:function(){var t=this.editor.getSelection(!0);this.editor.insertText(t.index,"\n",o.a.sources.USER),this.editor.insertEmbed(t.index+1,"divider",!0,o.a.sources.USER),this.editor.setSelection(t.index+2,o.a.sources.SILENT)},applyHTML:function(t){var e=t.content,n=t.existingBlot,r={content:e},i=this.editor.getSelection(!0);if(n)return n.replaceWith("html",r);this.editor.insertEmbed(i.index,"html",r,o.a.sources.USER),this.editor.setSelection(i.index+1,o.a.sources.SILENT)}}},at=Object(a.a)(it,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{position:"relative"}},[n("div",{attrs:{id:"sidebar-controls"}},[n("button",{staticClass:"rounded-full w-8 h-8 border border-light text-light hover:bg-light hover:text-contrast text-center",attrs:{id:"show-controls"},on:{click:t.showSideControls}},[t._v("+")]),t._v(" "),n("div",{staticClass:"controls hidden pl-4 bg-contrast"},[n("button",{on:{click:function(e){t.openImageUploader()}}},[n("svg",{staticClass:"fill-current w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M0 4c0-1.1.9-2 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm11 9l-3-3-6 6h16l-5-5-2 2zm4-4a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}})])]),t._v(" "),n("button",{on:{click:function(e){t.openingHTMLEmbedder()}}},[n("svg",{staticClass:"fill-current w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M.7 9.3l4.8-4.8 1.4 1.42L2.84 10l4.07 4.07-1.41 1.42L0 10l.7-.7zm18.6 1.4l.7-.7-5.49-5.49-1.4 1.42L17.16 10l-4.07 4.07 1.41 1.42 4.78-4.78z"}})])]),t._v(" "),n("button",{on:{click:t.addDivider}},[n("svg",{staticClass:"fill-current w-3",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M4 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm6 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm6 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}})])])])]),t._v(" "),n("div",{ref:"editor"}),t._v(" "),n("image-uploader",{attrs:{"post-id":"postId"},on:{updated:t.applyImage}}),t._v(" "),n("html-embedder",{attrs:{"post-id":"postId"},on:{adding:t.applyHTML}})],1)},[],!1,null,null,null);at.options.__file="Editor.vue";e.default=at.exports},sFPw:function(t,e,n){"use strict";n.r(e);var r={data:function(){return{shouldShowContent:!1}},watch:{shouldShowContent:function(t){t&&this.$emit("showing")}},methods:{toggle:function(){this.shouldShowContent=!this.shouldShowContent},hide:function(){this.shouldShowContent=!1}}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hide,expression:"hide"}]},[n("div",{on:{click:function(e){return e.preventDefault(),t.toggle(e)}}},[t._t("trigger")],2),t._v(" "),t.shouldShowContent?t._t("content"):t._e()],2)},[],!1,null,null,null);i.options.__file="DropDown.vue";e.default=i.exports},tQ2B:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("Rn+g"),i=n("MLWZ"),a=n("g7np"),s=n("w0Vi"),l=n("OTTw"),u=n("LYNF");t.exports=function(t){return new Promise(function(e,c){var f=t.data,p=t.headers;r.isFormData(f)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(t.auth){var h=t.auth.username||"",v=t.auth.password||"";p.Authorization="Basic "+btoa(h+":"+v)}var m=a(t.baseURL,t.url);if(d.open(t.method.toUpperCase(),i(m,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?s(d.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:t,request:d};o(e,c,r),d=null}},d.onabort=function(){d&&(c(u("Request aborted",t,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",t,null,d)),d=null},d.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),c(u(e,t,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var y=n("eqyj"),g=(t.withCredentials||l(m))&&t.xsrfCookieName?y.read(t.xsrfCookieName):void 0;g&&(p[t.xsrfHeaderName]=g)}if("setRequestHeader"in d&&r.forEach(p,function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete p[e]:d.setRequestHeader(e,t)}),r.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){d&&(d.abort(),c(t),d=null)}),void 0===f&&(f=null),d.send(f)})}},tjlA:function(t,e,n){"use strict";(function(t){var r=n("H7XF"),o=n("kVK+"),i=n("49sm");function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,o);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,o){var i,a=1,s=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var c=-1;for(i=n;is&&(n=s-l),i=n;i>=0;i--){for(var f=!0,p=0;po&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function O(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[o+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=f}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return A(this,e,n);case"latin1":case"binary":return S(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,r,o){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(i,a),u=this.slice(r,o),c=t.slice(e,n),f=0;fo)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return g(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return x(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function A(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;or)&&(n=r);for(var o="",i=e;in)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,o,i){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function M(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o>>8*(r?o:1-o)}function L(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o>>8*(r?o:3-o)&255}function I(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(t,e,n,r,i){return i||I(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function D(t,e,n,r,i){return i||I(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(o*=256);)r+=this[t+--e]*o;return r},l.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||j(t,e,this.length);for(var r=this[t],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||j(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||j(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||j(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||j(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||j(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);P(this,t,e,n,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);P(this,t,e,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return R(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return R(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--o)t[o+e]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function $(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,r){for(var o=0;o=e.length||o>=t.length);++o)e[o+n]=t[o];return o}}).call(this,n("yLpj"))},uU4Q:function(t,e,n){"use strict";n.r(e);var r={components:{},props:["errors"],data:function(){return{}},mounted:function(){},methods:{}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mt-2 text-sm"},t._l(t.errors,function(e){return n("span",{staticClass:"text-red block"},[t._v(t._s(e))])}),0)},[],!1,null,null,null);i.options.__file="FormErrors.vue";e.default=i.exports},uuIC:function(t,e,n){"use strict";n.r(e);var r={data:function(){return{}},created:function(){document.addEventListener("keydown",this.handleEscape),document.body.classList.add("overflow-hidden")},destroyed:function(){document.removeEventListener("keydown",this.handleEscape),document.body.classList.remove("overflow-hidden")},methods:{handleEscape:function(t){t.stopPropagation(),27==t.keyCode&&this.close()},close:function(){this.$emit("close")},handleClicks:function(t){t.target.classList.contains("modal-mask")&&this.close()}}},o=n("KHd+"),i=Object(o.a)(r,function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"modal"}},[e("div",{staticClass:"z-50 fixed pin overflow-y-scroll modal-mask",on:{click:this.handleClicks}},[e("div",{staticClass:"bg-contrast relative rounded shadow-lg max-w-md mx-auto my-10 p-5 modal-container"},[this._t("default")],2)])])},[],!1,null,null,null);i.options.__file="Modal.vue";e.default=i.exports},v1Jv:function(t,e,n){"use strict";var r=n("KRzE");n.n(r).a},vDqi:function(t,e,n){t.exports=n("zuR4")},vKmt:function(t,e,n){"use strict";var r=n("98nw");n.n(r).a},w0Vi:function(t,e,n){"use strict";var r=n("xTJ+"),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,a={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(a[e]&&o.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}}),a):a}},wMS7:function(t,e,n){t.exports=function(){"use strict";var t=Object.hasOwnProperty,e=Object.setPrototypeOf,n=Object.isFrozen,r=Object.keys,o=Object.freeze,i=Object.seal,a="undefined"!=typeof Reflect&&Reflect,s=a.apply,l=a.construct;s||(s=function(t,e,n){return t.apply(e,n)}),o||(o=function(t){return t}),i||(i=function(t){return t}),l||(l=function(t,e){return new(Function.prototype.bind.apply(t,[null].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1?n-1:0),o=1;o/gm),q=i(/^data-[\-\w.\u00B7-\uFFFF]/),B=i(/^aria-[\-\w]+$/),U=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=i(/^(?:\w+script|data):/i),F=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function H(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:Y(),n=function(e){return t(e)};if(n.version="2.0.11",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;var i=e.document,a=!1,s=e.document,l=e.DocumentFragment,k=e.HTMLTemplateElement,O=e.Node,K=e.NodeFilter,V=e.NamedNodeMap,Z=void 0===V?e.NamedNodeMap||e.MozNamedAttrMap:V,G=e.Text,X=e.Comment,J=e.DOMParser,Q=e.trustedTypes;if("function"==typeof k){var tt=s.createElement("template");tt.content&&tt.content.ownerDocument&&(s=tt.content.ownerDocument)}var et=W(Q,i),nt=et?et.createHTML(""):"",rt=s,ot=rt.implementation,it=rt.createNodeIterator,at=rt.getElementsByTagName,st=rt.createDocumentFragment,lt=i.importNode,ut={};n.isSupported=ot&&void 0!==ot.createHTMLDocument&&9!==s.documentMode;var ct=R,ft=D,pt=q,dt=B,ht=$,vt=F,mt=U,yt=null,gt=E({},[].concat(H(A),H(S),H(T),H(N),H(j))),_t=null,bt=E({},[].concat(H(P),H(M),H(L),H(I))),wt=null,xt=null,kt=!0,Ot=!0,Et=!1,Ct=!1,At=!1,St=!1,Tt=!1,Nt=!1,jt=!1,Pt=!1,Mt=!1,Lt=!1,It=!0,Rt=!0,Dt=!1,qt={},Bt=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ut=null,$t=E({},["audio","video","img","source","image","track"]),Ft=null,zt=E({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ht=null,Yt=s.createElement("form"),Wt=function(t){Ht&&Ht===t||(t&&"object"===(void 0===t?"undefined":z(t))||(t={}),yt="ALLOWED_TAGS"in t?E({},t.ALLOWED_TAGS):gt,_t="ALLOWED_ATTR"in t?E({},t.ALLOWED_ATTR):bt,Ft="ADD_URI_SAFE_ATTR"in t?E(C(zt),t.ADD_URI_SAFE_ATTR):zt,Ut="ADD_DATA_URI_TAGS"in t?E(C($t),t.ADD_DATA_URI_TAGS):$t,wt="FORBID_TAGS"in t?E({},t.FORBID_TAGS):{},xt="FORBID_ATTR"in t?E({},t.FORBID_ATTR):{},qt="USE_PROFILES"in t&&t.USE_PROFILES,kt=!1!==t.ALLOW_ARIA_ATTR,Ot=!1!==t.ALLOW_DATA_ATTR,Et=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ct=t.SAFE_FOR_JQUERY||!1,At=t.SAFE_FOR_TEMPLATES||!1,St=t.WHOLE_DOCUMENT||!1,jt=t.RETURN_DOM||!1,Pt=t.RETURN_DOM_FRAGMENT||!1,Mt=t.RETURN_DOM_IMPORT||!1,Lt=t.RETURN_TRUSTED_TYPE||!1,Nt=t.FORCE_BODY||!1,It=!1!==t.SANITIZE_DOM,Rt=!1!==t.KEEP_CONTENT,Dt=t.IN_PLACE||!1,mt=t.ALLOWED_URI_REGEXP||mt,At&&(Ot=!1),Pt&&(jt=!0),qt&&(yt=E({},[].concat(H(j))),_t=[],!0===qt.html&&(E(yt,A),E(_t,P)),!0===qt.svg&&(E(yt,S),E(_t,M),E(_t,I)),!0===qt.svgFilters&&(E(yt,T),E(_t,M),E(_t,I)),!0===qt.mathMl&&(E(yt,N),E(_t,L),E(_t,I))),t.ADD_TAGS&&(yt===gt&&(yt=C(yt)),E(yt,t.ADD_TAGS)),t.ADD_ATTR&&(_t===bt&&(_t=C(_t)),E(_t,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&E(Ft,t.ADD_URI_SAFE_ATTR),Rt&&(yt["#text"]=!0),St&&E(yt,["html","head","body"]),yt.table&&(E(yt,["tbody"]),delete wt.tbody),o&&o(t),Ht=t)},Kt=function(t){d(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){t.outerHTML=nt}},Vt=function(t,e){try{d(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){d(n.removed,{attribute:null,from:e})}e.removeAttribute(t)},Zt=function(t){var e=void 0,n=void 0;if(Nt)t=""+t;else{var r=m(t,/^[\r\n\t ]+/);n=r&&r[0]}var o=et?et.createHTML(t):t;try{e=(new J).parseFromString(o,"text/html")}catch(t){}if(a&&E(wt,["title"]),!e||!e.documentElement){var i=e=ot.createHTMLDocument(""),l=i.body;l.parentNode.removeChild(l.parentNode.firstElementChild),l.outerHTML=o}return t&&n&&e.body.insertBefore(s.createTextNode(n),e.body.childNodes[0]||null),at.call(e,St?"html":"body")[0]};n.isSupported&&function(){try{var t=Zt("</title><img>");b(/<\/title/,t.querySelector("title").innerHTML)&&(a=!0)}catch(t){}}();var Gt=function(t){return it.call(t.ownerDocument||t,t,K.SHOW_ELEMENT|K.SHOW_COMMENT|K.SHOW_TEXT,function(){return K.FILTER_ACCEPT},!1)},Xt=function(t){return"object"===(void 0===O?"undefined":z(O))?t instanceof O:t&&"object"===(void 0===t?"undefined":z(t))&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Jt=function(t,e,r){ut[t]&&u(ut[t],function(t){t.call(n,e,r,Ht)})},Qt=function(t){var e,r=void 0;if(Jt("beforeSanitizeElements",t,null),!((e=t)instanceof G||e instanceof X||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof Z&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI))return Kt(t),!0;var o=v(t.nodeName);if(Jt("uponSanitizeElement",t,{tagName:o,allowedTags:yt}),("svg"===o||"math"===o)&&0!==t.querySelectorAll("p, br").length)return Kt(t),!0;if(!yt[o]||wt[o]){if(Rt&&!Bt[o]&&"function"==typeof t.insertAdjacentHTML)try{var i=t.innerHTML;t.insertAdjacentHTML("AfterEnd",et?et.createHTML(i):i)}catch(t){}return Kt(t),!0}return"noscript"===o&&b(/<\/noscript/i,t.innerHTML)?(Kt(t),!0):"noembed"===o&&b(/<\/noembed/i,t.innerHTML)?(Kt(t),!0):(!Ct||t.firstElementChild||t.content&&t.content.firstElementChild||!b(/</g,t.textContent)||(d(n.removed,{element:t.cloneNode()}),t.innerHTML?t.innerHTML=y(t.innerHTML,/</g,"<"):t.innerHTML=y(t.textContent,/</g,"<")),At&&3===t.nodeType&&(r=t.textContent,r=y(r,ct," "),r=y(r,ft," "),t.textContent!==r&&(d(n.removed,{element:t.cloneNode()}),t.textContent=r)),Jt("afterSanitizeElements",t,null),!1)},te=function(t,e,n){if(It&&("id"===e||"name"===e)&&(n in s||n in Yt))return!1;if(Ot&&b(pt,e));else if(kt&&b(dt,e));else{if(!_t[e]||xt[e])return!1;if(Ft[e]);else if(b(mt,y(n,vt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==g(n,"data:")||!Ut[t])if(Et&&!b(ht,y(n,vt,"")));else if(n)return!1}return!0},ee=function(t){var e=void 0,o=void 0,i=void 0,a=void 0,s=void 0;Jt("beforeSanitizeAttributes",t,null);var l=t.attributes;if(l){var u={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_t};for(s=l.length;s--;){var d=e=l[s],m=d.name,g=d.namespaceURI;if(o=_(e.value),i=v(m),u.attrName=i,u.attrValue=o,u.keepAttr=!0,u.forceKeepAttr=void 0,Jt("uponSanitizeAttribute",t,u),o=u.attrValue,!u.forceKeepAttr){if("name"===i&&"IMG"===t.nodeName&&l.id)a=l.id,l=h(l,[]),Vt("id",t),Vt(m,t),c(l,a)>s&&t.setAttribute("id",a.value);else{if("INPUT"===t.nodeName&&"type"===i&&"file"===o&&u.keepAttr&&(_t[i]||!xt[i]))continue;"id"===m&&t.setAttribute(m,""),Vt(m,t)}if(u.keepAttr)if(Ct&&b(/\/>/i,o))Vt(m,t);else if(b(/svg|math/i,t.namespaceURI)&&b(w("</("+f(r(Bt),"|")+")","i"),o))Vt(m,t);else{At&&(o=y(o,ct," "),o=y(o,ft," "));var x=t.nodeName.toLowerCase();if(te(x,i,o))try{g?t.setAttributeNS(g,m,o):t.setAttribute(m,o),p(n.removed)}catch(t){}}}}Jt("afterSanitizeAttributes",t,null)}},ne=function t(e){var n=void 0,r=Gt(e);for(Jt("beforeSanitizeShadowDOM",e,null);n=r.nextNode();)Jt("uponSanitizeShadowNode",n,null),Qt(n)||(n.content instanceof l&&t(n.content),ee(n));Jt("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(t,r){var o=void 0,a=void 0,s=void 0,u=void 0,c=void 0;if(t||(t="\x3c!--\x3e"),"string"!=typeof t&&!Xt(t)){if("function"!=typeof t.toString)throw x("toString is not a function");if("string"!=typeof(t=t.toString()))throw x("dirty is not a string, aborting")}if(!n.isSupported){if("object"===z(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof t)return e.toStaticHTML(t);if(Xt(t))return e.toStaticHTML(t.outerHTML)}return t}if(Tt||Wt(r),n.removed=[],"string"==typeof t&&(Dt=!1),Dt);else if(t instanceof O)o=Zt("\x3c!--\x3e"),1===(a=o.ownerDocument.importNode(t,!0)).nodeType&&"BODY"===a.nodeName?o=a:"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!jt&&!At&&!St&&Lt&&-1===t.indexOf("<"))return et?et.createHTML(t):t;if(!(o=Zt(t)))return jt?null:nt}o&&Nt&&Kt(o.firstChild);for(var f=Gt(Dt?t:o);s=f.nextNode();)3===s.nodeType&&s===u||Qt(s)||(s.content instanceof l&&ne(s.content),ee(s),u=s);if(u=null,Dt)return t;if(jt){if(Pt)for(c=st.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return Mt&&(c=lt.call(i,c,!0)),c}var p=St?o.outerHTML:o.innerHTML;return At&&(p=y(p,ct," "),p=y(p,ft," ")),et&&Lt?et.createHTML(p):p},n.setConfig=function(t){Wt(t),Tt=!0},n.clearConfig=function(){Ht=null,Tt=!1},n.isValidAttribute=function(t,e,n){Ht||Wt({});var r=v(t),o=v(e);return te(r,o,n)},n.addHook=function(t,e){"function"==typeof e&&(ut[t]=ut[t]||[],d(ut[t],e))},n.removeHook=function(t){ut[t]&&p(ut[t])},n.removeHooks=function(t){ut[t]&&(ut[t]=[])},n.removeAllHooks=function(){ut={}},n}()}()},wNkb:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},"wd/R":function(t,e,n){(function(t){t.exports=function(){"use strict";var e,n;function r(){return e.apply(null,arguments)}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function i(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t){return void 0===t}function s(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,r=[];for(n=0;n<t.length;++n)r.push(e(t[n],n));return r}function c(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function f(t,e){for(var n in e)c(e,n)&&(t[n]=e[n]);return c(e,"toString")&&(t.toString=e.toString),c(e,"valueOf")&&(t.valueOf=e.valueOf),t}function p(t,e,n,r){return Se(t,e,n,r,!0).utc()}function d(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),t._pf}function h(t){if(null==t._isValid){var e=d(t),r=n.call(e.parsedDateParts,function(t){return null!=t}),o=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&r);if(t._strict&&(o=o&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return o;t._isValid=o}return t._isValid}function v(t){var e=p(NaN);return null!=t?f(d(e),t):d(e).userInvalidated=!0,e}n=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};var m=r.momentProperties=[];function y(t,e){var n,r,o;if(a(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),a(e._i)||(t._i=e._i),a(e._f)||(t._f=e._f),a(e._l)||(t._l=e._l),a(e._strict)||(t._strict=e._strict),a(e._tzm)||(t._tzm=e._tzm),a(e._isUTC)||(t._isUTC=e._isUTC),a(e._offset)||(t._offset=e._offset),a(e._pf)||(t._pf=d(e)),a(e._locale)||(t._locale=e._locale),m.length>0)for(n=0;n<m.length;n++)r=m[n],a(o=e[r])||(t[r]=o);return t}var g=!1;function _(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===g&&(g=!0,r.updateOffset(this),g=!1)}function b(t){return t instanceof _||null!=t&&null!=t._isAMomentObject}function w(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function x(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=w(e)),n}function k(t,e,n){var r,o=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),a=0;for(r=0;r<o;r++)(n&&t[r]!==e[r]||!n&&x(t[r])!==x(e[r]))&&a++;return a+i}function O(t){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function E(t,e){var n=!0;return f(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,t),n){for(var o,i=[],a=0;a<arguments.length;a++){if(o="","object"==typeof arguments[a]){for(var s in o+="\n["+a+"] ",arguments[0])o+=s+": "+arguments[0][s]+", ";o=o.slice(0,-2)}else o=arguments[a];i.push(o)}O(t+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),n=!1}return e.apply(this,arguments)},e)}var C,A={};function S(t,e){null!=r.deprecationHandler&&r.deprecationHandler(t,e),A[t]||(O(e),A[t]=!0)}function T(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function N(t,e){var n,r=f({},t);for(n in e)c(e,n)&&(i(t[n])&&i(e[n])?(r[n]={},f(r[n],t[n]),f(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);for(n in t)c(t,n)&&!c(e,n)&&i(t[n])&&(r[n]=f({},r[n]));return r}function j(t){null!=t&&this.set(t)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,C=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)c(t,e)&&n.push(e);return n};var P={};function M(t,e){var n=t.toLowerCase();P[n]=P[n+"s"]=P[e]=t}function L(t){return"string"==typeof t?P[t]||P[t.toLowerCase()]:void 0}function I(t){var e,n,r={};for(n in t)c(t,n)&&(e=L(n))&&(r[e]=t[n]);return r}var R={};function D(t,e){R[t]=e}function q(t,e,n){var r=""+Math.abs(t),o=e-r.length,i=t>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var B=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,U=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,$={},F={};function z(t,e,n,r){var o=r;"string"==typeof r&&(o=function(){return this[r]()}),t&&(F[t]=o),e&&(F[e[0]]=function(){return q(o.apply(this,arguments),e[1],e[2])}),n&&(F[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function H(t,e){return t.isValid()?(e=Y(e,t.localeData()),$[e]=$[e]||function(t){var e,n,r,o=t.match(B);for(e=0,n=o.length;e<n;e++)F[o[e]]?o[e]=F[o[e]]:o[e]=(r=o[e]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(e){var r,i="";for(r=0;r<n;r++)i+=T(o[r])?o[r].call(e,t):o[r];return i}}(e),$[e](t)):t.localeData().invalidDate()}function Y(t,e){var n=5;function r(t){return e.longDateFormat(t)||t}for(U.lastIndex=0;n>=0&&U.test(t);)t=t.replace(U,r),U.lastIndex=0,n-=1;return t}var W=/\d/,K=/\d\d/,V=/\d{3}/,Z=/\d{4}/,G=/[+-]?\d{6}/,X=/\d\d?/,J=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,tt=/\d{1,3}/,et=/\d{1,4}/,nt=/[+-]?\d{1,6}/,rt=/\d+/,ot=/[+-]?\d+/,it=/Z|[+-]\d\d:?\d\d/gi,at=/Z|[+-]\d\d(?::?\d\d)?/gi,st=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,lt={};function ut(t,e,n){lt[t]=T(e)?e:function(t,r){return t&&n?n:e}}function ct(t,e){return c(lt,t)?lt[t](e._strict,e._locale):new RegExp(ft(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,o){return e||n||r||o})))}function ft(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var pt={};function dt(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),s(e)&&(r=function(t,n){n[e]=x(t)}),n=0;n<t.length;n++)pt[t[n]]=r}function ht(t,e){dt(t,function(t,n,r,o){r._w=r._w||{},e(t,r._w,r,o)})}function vt(t,e,n){null!=e&&c(pt,t)&&pt[t](e,n._a,n,t)}var mt=0,yt=1,gt=2,_t=3,bt=4,wt=5,xt=6,kt=7,Ot=8;function Et(t){return Ct(t)?366:365}function Ct(t){return t%4==0&&t%100!=0||t%400==0}z("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),z(0,["YY",2],0,function(){return this.year()%100}),z(0,["YYYY",4],0,"year"),z(0,["YYYYY",5],0,"year"),z(0,["YYYYYY",6,!0],0,"year"),M("year","y"),D("year",1),ut("Y",ot),ut("YY",X,K),ut("YYYY",et,Z),ut("YYYYY",nt,G),ut("YYYYYY",nt,G),dt(["YYYYY","YYYYYY"],mt),dt("YYYY",function(t,e){e[mt]=2===t.length?r.parseTwoDigitYear(t):x(t)}),dt("YY",function(t,e){e[mt]=r.parseTwoDigitYear(t)}),dt("Y",function(t,e){e[mt]=parseInt(t,10)}),r.parseTwoDigitYear=function(t){return x(t)+(x(t)>68?1900:2e3)};var At,St=Tt("FullYear",!0);function Tt(t,e){return function(n){return null!=n?(jt(this,t,n),r.updateOffset(this,e),this):Nt(this,t)}}function Nt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function jt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&Ct(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),Pt(n,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function Pt(t,e){if(isNaN(t)||isNaN(e))return NaN;var n,r=(e%(n=12)+n)%n;return t+=(e-r)/12,1===r?Ct(t)?29:28:31-r%7%2}At=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},z("M",["MM",2],"Mo",function(){return this.month()+1}),z("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),z("MMMM",0,0,function(t){return this.localeData().months(this,t)}),M("month","M"),D("month",8),ut("M",X),ut("MM",X,K),ut("MMM",function(t,e){return e.monthsShortRegex(t)}),ut("MMMM",function(t,e){return e.monthsRegex(t)}),dt(["M","MM"],function(t,e){e[yt]=x(t)-1}),dt(["MMM","MMMM"],function(t,e,n,r){var o=n._locale.monthsParse(t,r,n._strict);null!=o?e[yt]=o:d(n).invalidMonth=t});var Mt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Lt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),It="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Rt(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=x(e);else if(!s(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),Pt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function Dt(t){return null!=t?(Rt(this,t),r.updateOffset(this,!0),this):Nt(this,"Month")}var qt=st,Bt=st;function Ut(){function t(t,e){return e.length-t.length}var e,n,r=[],o=[],i=[];for(e=0;e<12;e++)n=p([2e3,e]),r.push(this.monthsShort(n,"")),o.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(t),o.sort(t),i.sort(t),e=0;e<12;e++)r[e]=ft(r[e]),o[e]=ft(o[e]);for(e=0;e<24;e++)i[e]=ft(i[e]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function $t(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function Ft(t,e,n){var r=7+e-n,o=(7+$t(t,0,r).getUTCDay()-e)%7;return-o+r-1}function zt(t,e,n,r,o){var i,a,s=(7+n-r)%7,l=Ft(t,r,o),u=1+7*(e-1)+s+l;return u<=0?a=Et(i=t-1)+u:u>Et(t)?(i=t+1,a=u-Et(t)):(i=t,a=u),{year:i,dayOfYear:a}}function Ht(t,e,n){var r,o,i=Ft(t.year(),e,n),a=Math.floor((t.dayOfYear()-i-1)/7)+1;return a<1?(o=t.year()-1,r=a+Yt(o,e,n)):a>Yt(t.year(),e,n)?(r=a-Yt(t.year(),e,n),o=t.year()+1):(o=t.year(),r=a),{week:r,year:o}}function Yt(t,e,n){var r=Ft(t,e,n),o=Ft(t+1,e,n);return(Et(t)-r+o)/7}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),M("week","w"),M("isoWeek","W"),D("week",5),D("isoWeek",5),ut("w",X),ut("ww",X,K),ut("W",X),ut("WW",X,K),ht(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=x(t)}),z("d",0,"do","day"),z("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),z("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),z("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),M("day","d"),M("weekday","e"),M("isoWeekday","E"),D("day",11),D("weekday",11),D("isoWeekday",11),ut("d",X),ut("e",X),ut("E",X),ut("dd",function(t,e){return e.weekdaysMinRegex(t)}),ut("ddd",function(t,e){return e.weekdaysShortRegex(t)}),ut("dddd",function(t,e){return e.weekdaysRegex(t)}),ht(["dd","ddd","dddd"],function(t,e,n,r){var o=n._locale.weekdaysParse(t,r,n._strict);null!=o?e.d=o:d(n).invalidWeekday=t}),ht(["d","e","E"],function(t,e,n,r){e[r]=x(t)});var Wt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Vt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Zt=st,Gt=st,Xt=st;function Jt(){function t(t,e){return e.length-t.length}var e,n,r,o,i,a=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),r=this.weekdaysMin(n,""),o=this.weekdaysShort(n,""),i=this.weekdays(n,""),a.push(r),s.push(o),l.push(i),u.push(r),u.push(o),u.push(i);for(a.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ft(s[e]),l[e]=ft(l[e]),u[e]=ft(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qt(){return this.hours()%12||12}function te(t,e){z(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function ee(t,e){return e._meridiemParse}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,Qt),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+Qt.apply(this)+q(this.minutes(),2)}),z("hmmss",0,0,function(){return""+Qt.apply(this)+q(this.minutes(),2)+q(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+q(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+q(this.minutes(),2)+q(this.seconds(),2)}),te("a",!0),te("A",!1),M("hour","h"),D("hour",13),ut("a",ee),ut("A",ee),ut("H",X),ut("h",X),ut("k",X),ut("HH",X,K),ut("hh",X,K),ut("kk",X,K),ut("hmm",J),ut("hmmss",Q),ut("Hmm",J),ut("Hmmss",Q),dt(["H","HH"],_t),dt(["k","kk"],function(t,e,n){var r=x(t);e[_t]=24===r?0:r}),dt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),dt(["h","hh"],function(t,e,n){e[_t]=x(t),d(n).bigHour=!0}),dt("hmm",function(t,e,n){var r=t.length-2;e[_t]=x(t.substr(0,r)),e[bt]=x(t.substr(r)),d(n).bigHour=!0}),dt("hmmss",function(t,e,n){var r=t.length-4,o=t.length-2;e[_t]=x(t.substr(0,r)),e[bt]=x(t.substr(r,2)),e[wt]=x(t.substr(o)),d(n).bigHour=!0}),dt("Hmm",function(t,e,n){var r=t.length-2;e[_t]=x(t.substr(0,r)),e[bt]=x(t.substr(r))}),dt("Hmmss",function(t,e,n){var r=t.length-4,o=t.length-2;e[_t]=x(t.substr(0,r)),e[bt]=x(t.substr(r,2)),e[wt]=x(t.substr(o))});var ne,re=Tt("Hours",!0),oe={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Lt,monthsShort:It,week:{dow:0,doy:6},weekdays:Wt,weekdaysMin:Vt,weekdaysShort:Kt,meridiemParse:/[ap]\.?m?\.?/i},ie={},ae={};function se(t){return t?t.toLowerCase().replace("_","-"):t}function le(e){var n=null;if(!ie[e]&&void 0!==t&&t&&t.exports)try{n=ne._abbr,!function(){var t=new Error("Cannot find module 'undefined'");throw t.code="MODULE_NOT_FOUND",t}(),ue(n)}catch(t){}return ie[e]}function ue(t,e){var n;return t&&((n=a(e)?fe(t):ce(t,e))?ne=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ne._abbr}function ce(t,e){if(null!==e){var n,r=oe;if(e.abbr=t,null!=ie[t])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ie[t]._config;else if(null!=e.parentLocale)if(null!=ie[e.parentLocale])r=ie[e.parentLocale]._config;else{if(null==(n=le(e.parentLocale)))return ae[e.parentLocale]||(ae[e.parentLocale]=[]),ae[e.parentLocale].push({name:t,config:e}),null;r=n._config}return ie[t]=new j(N(r,e)),ae[t]&&ae[t].forEach(function(t){ce(t.name,t.config)}),ue(t),ie[t]}return delete ie[t],null}function fe(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ne;if(!o(t)){if(e=le(t))return e;t=[t]}return function(t){for(var e,n,r,o,i=0;i<t.length;){for(o=se(t[i]).split("-"),e=o.length,n=(n=se(t[i+1]))?n.split("-"):null;e>0;){if(r=le(o.slice(0,e).join("-")))return r;if(n&&n.length>=e&&k(o,n,!0)>=e-1)break;e--}i++}return ne}(t)}function pe(t){var e,n=t._a;return n&&-2===d(t).overflow&&(e=n[yt]<0||n[yt]>11?yt:n[gt]<1||n[gt]>Pt(n[mt],n[yt])?gt:n[_t]<0||n[_t]>24||24===n[_t]&&(0!==n[bt]||0!==n[wt]||0!==n[xt])?_t:n[bt]<0||n[bt]>59?bt:n[wt]<0||n[wt]>59?wt:n[xt]<0||n[xt]>999?xt:-1,d(t)._overflowDayOfYear&&(e<mt||e>gt)&&(e=gt),d(t)._overflowWeeks&&-1===e&&(e=kt),d(t)._overflowWeekday&&-1===e&&(e=Ot),d(t).overflow=e),t}function de(t,e,n){return null!=t?t:null!=e?e:n}function he(t){var e,n,o,i,a,s=[];if(!t._d){for(o=function(t){var e=new Date(r.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[gt]&&null==t._a[yt]&&function(t){var e,n,r,o,i,a,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)i=1,a=4,n=de(e.GG,t._a[mt],Ht(Te(),1,4).year),r=de(e.W,1),((o=de(e.E,1))<1||o>7)&&(l=!0);else{i=t._locale._week.dow,a=t._locale._week.doy;var u=Ht(Te(),i,a);n=de(e.gg,t._a[mt],u.year),r=de(e.w,u.week),null!=e.d?((o=e.d)<0||o>6)&&(l=!0):null!=e.e?(o=e.e+i,(e.e<0||e.e>6)&&(l=!0)):o=i}r<1||r>Yt(n,i,a)?d(t)._overflowWeeks=!0:null!=l?d(t)._overflowWeekday=!0:(s=zt(n,r,o,i,a),t._a[mt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(a=de(t._a[mt],o[mt]),(t._dayOfYear>Et(a)||0===t._dayOfYear)&&(d(t)._overflowDayOfYear=!0),n=$t(a,0,t._dayOfYear),t._a[yt]=n.getUTCMonth(),t._a[gt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=o[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[_t]&&0===t._a[bt]&&0===t._a[wt]&&0===t._a[xt]&&(t._nextDay=!0,t._a[_t]=0),t._d=(t._useUTC?$t:function(t,e,n,r,o,i,a){var s=new Date(t,e,n,r,o,i,a);return t<100&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}).apply(null,s),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[_t]=24),t._w&&void 0!==t._w.d&&t._w.d!==i&&(d(t).weekdayMismatch=!0)}}var ve=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,me=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ye=/Z|[+-]\d\d(?::?\d\d)?/,ge=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],_e=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],be=/^\/?Date\((\-?\d+)/i;function we(t){var e,n,r,o,i,a,s=t._i,l=ve.exec(s)||me.exec(s);if(l){for(d(t).iso=!0,e=0,n=ge.length;e<n;e++)if(ge[e][1].exec(l[1])){o=ge[e][0],r=!1!==ge[e][2];break}if(null==o)return void(t._isValid=!1);if(l[3]){for(e=0,n=_e.length;e<n;e++)if(_e[e][1].exec(l[3])){i=(l[2]||" ")+_e[e][0];break}if(null==i)return void(t._isValid=!1)}if(!r&&null!=i)return void(t._isValid=!1);if(l[4]){if(!ye.exec(l[4]))return void(t._isValid=!1);a="Z"}t._f=o+(i||"")+(a||""),Ce(t)}else t._isValid=!1}var xe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function ke(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}var Oe={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ee(t){var e,n,r,o,i,a,s,l=xe.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(l){var u=(e=l[4],n=l[3],r=l[2],o=l[5],i=l[6],a=l[7],s=[ke(e),It.indexOf(n),parseInt(r,10),parseInt(o,10),parseInt(i,10)],a&&s.push(parseInt(a,10)),s);if(!function(t,e,n){if(t){var r=Kt.indexOf(t),o=new Date(e[0],e[1],e[2]).getDay();if(r!==o)return d(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}(l[1],u,t))return;t._a=u,t._tzm=function(t,e,n){if(t)return Oe[t];if(e)return 0;var r=parseInt(n,10),o=r%100,i=(r-o)/100;return 60*i+o}(l[8],l[9],l[10]),t._d=$t.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),d(t).rfc2822=!0}else t._isValid=!1}function Ce(t){if(t._f!==r.ISO_8601)if(t._f!==r.RFC_2822){t._a=[],d(t).empty=!0;var e,n,o,i,a,s=""+t._i,l=s.length,u=0;for(o=Y(t._f,t._locale).match(B)||[],e=0;e<o.length;e++)i=o[e],(n=(s.match(ct(i,t))||[])[0])&&((a=s.substr(0,s.indexOf(n))).length>0&&d(t).unusedInput.push(a),s=s.slice(s.indexOf(n)+n.length),u+=n.length),F[i]?(n?d(t).empty=!1:d(t).unusedTokens.push(i),vt(i,n,t)):t._strict&&!n&&d(t).unusedTokens.push(i);d(t).charsLeftOver=l-u,s.length>0&&d(t).unusedInput.push(s),t._a[_t]<=12&&!0===d(t).bigHour&&t._a[_t]>0&&(d(t).bigHour=void 0),d(t).parsedDateParts=t._a.slice(0),d(t).meridiem=t._meridiem,t._a[_t]=(c=t._locale,f=t._a[_t],null==(p=t._meridiem)?f:null!=c.meridiemHour?c.meridiemHour(f,p):null!=c.isPM?((h=c.isPM(p))&&f<12&&(f+=12),h||12!==f||(f=0),f):f),he(t),pe(t)}else Ee(t);else we(t);var c,f,p,h}function Ae(t){var e=t._i,n=t._f;return t._locale=t._locale||fe(t._l),null===e||void 0===n&&""===e?v({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),b(e)?new _(pe(e)):(l(e)?t._d=e:o(n)?function(t){var e,n,r,o,i;if(0===t._f.length)return d(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;o<t._f.length;o++)i=0,e=y({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[o],Ce(e),h(e)&&(i+=d(e).charsLeftOver,i+=10*d(e).unusedTokens.length,d(e).score=i,(null==r||i<r)&&(r=i,n=e));f(t,n||e)}(t):n?Ce(t):function(t){var e=t._i;a(e)?t._d=new Date(r.now()):l(e)?t._d=new Date(e.valueOf()):"string"==typeof e?function(t){var e=be.exec(t._i);null===e?(we(t),!1===t._isValid&&(delete t._isValid,Ee(t),!1===t._isValid&&(delete t._isValid,r.createFromInputFallback(t)))):t._d=new Date(+e[1])}(t):o(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),he(t)):i(e)?function(t){if(!t._d){var e=I(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),he(t)}}(t):s(e)?t._d=new Date(e):r.createFromInputFallback(t)}(t),h(t)||(t._d=null),t))}function Se(t,e,n,r,a){var s,l={};return!0!==n&&!1!==n||(r=n,n=void 0),(i(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||o(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=n,l._i=t,l._f=e,l._strict=r,(s=new _(pe(Ae(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Te(t,e,n,r){return Se(t,e,n,r,!1)}r.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var Ne=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Te.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:v()}),je=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Te.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:v()});function Pe(t,e){var n,r;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Te();for(n=e[0],r=1;r<e.length;++r)e[r].isValid()&&!e[r][t](n)||(n=e[r]);return n}var Me=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Le(t){var e=I(t),n=e.year||0,r=e.quarter||0,o=e.month||0,i=e.week||0,a=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===At.call(Me,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var n=!1,r=0;r<Me.length;++r)if(t[Me[r]]){if(n)return!1;parseFloat(t[Me[r]])!==x(t[Me[r]])&&(n=!0)}return!0}(e),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+a+7*i,this._months=+o+3*r+12*n,this._data={},this._locale=fe(),this._bubble()}function Ie(t){return t instanceof Le}function Re(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function De(t,e){z(t,0,0,function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+q(~~(t/60),2)+e+q(~~t%60,2)})}De("Z",":"),De("ZZ",""),ut("Z",at),ut("ZZ",at),dt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Be(at,t)});var qe=/([\+\-]|\d\d)/gi;function Be(t,e){var n=(e||"").match(t);if(null===n)return null;var r=n[n.length-1]||[],o=(r+"").match(qe)||["-",0,0],i=60*o[1]+x(o[2]);return 0===i?0:"+"===o[0]?i:-i}function Ue(t,e){var n,o;return e._isUTC?(n=e.clone(),o=(b(t)||l(t)?t.valueOf():Te(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),r.updateOffset(n,!1),n):Te(t).local()}function $e(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Fe(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var ze=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,He=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ye(t,e){var n,r,o,i,a,l,u=t,f=null;return Ie(t)?u={ms:t._milliseconds,d:t._days,M:t._months}:s(t)?(u={},e?u[e]=t:u.milliseconds=t):(f=ze.exec(t))?(n="-"===f[1]?-1:1,u={y:0,d:x(f[gt])*n,h:x(f[_t])*n,m:x(f[bt])*n,s:x(f[wt])*n,ms:x(Re(1e3*f[xt]))*n}):(f=He.exec(t))?(n="-"===f[1]?-1:(f[1],1),u={y:We(f[2],n),M:We(f[3],n),w:We(f[4],n),d:We(f[5],n),h:We(f[6],n),m:We(f[7],n),s:We(f[8],n)}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(i=Te(u.from),a=Te(u.to),o=i.isValid()&&a.isValid()?(a=Ue(a,i),i.isBefore(a)?l=Ke(i,a):((l=Ke(a,i)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(u={}).ms=o.milliseconds,u.M=o.months),r=new Le(u),Ie(t)&&c(t,"_locale")&&(r._locale=t._locale),r}function We(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ke(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Ve(t,e){return function(n,r){var o;return null===r||isNaN(+r)||(S(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),Ze(this,Ye(n="string"==typeof n?+n:n,r),t),this}}function Ze(t,e,n,o){var i=e._milliseconds,a=Re(e._days),s=Re(e._months);t.isValid()&&(o=null==o||o,s&&Rt(t,Nt(t,"Month")+s*n),a&&jt(t,"Date",Nt(t,"Date")+a*n),i&&t._d.setTime(t._d.valueOf()+i*n),o&&r.updateOffset(t,a||s))}Ye.fn=Le.prototype,Ye.invalid=function(){return Ye(NaN)};var Ge=Ve(1,"add"),Xe=Ve(-1,"subtract");function Je(t,e){var n,r,o=12*(e.year()-t.year())+(e.month()-t.month()),i=t.clone().add(o,"months");return e-i<0?(n=t.clone().add(o-1,"months"),r=(e-i)/(i-n)):(n=t.clone().add(o+1,"months"),r=(e-i)/(n-i)),-(o+r)||0}function Qe(t){var e;return void 0===t?this._locale._abbr:(null!=(e=fe(t))&&(this._locale=e),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var tn=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});function en(){return this._locale}function nn(t,e){z(0,[t,t.length],0,e)}function rn(t,e,n,r,o){var i;return null==t?Ht(this,r,o).year:(i=Yt(t,r,o),e>i&&(e=i),function(t,e,n,r,o){var i=zt(t,e,n,r,o),a=$t(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,t,e,n,r,o))}z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),nn("gggg","weekYear"),nn("ggggg","weekYear"),nn("GGGG","isoWeekYear"),nn("GGGGG","isoWeekYear"),M("weekYear","gg"),M("isoWeekYear","GG"),D("weekYear",1),D("isoWeekYear",1),ut("G",ot),ut("g",ot),ut("GG",X,K),ut("gg",X,K),ut("GGGG",et,Z),ut("gggg",et,Z),ut("GGGGG",nt,G),ut("ggggg",nt,G),ht(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=x(t)}),ht(["gg","GG"],function(t,e,n,o){e[o]=r.parseTwoDigitYear(t)}),z("Q",0,"Qo","quarter"),M("quarter","Q"),D("quarter",7),ut("Q",W),dt("Q",function(t,e){e[yt]=3*(x(t)-1)}),z("D",["DD",2],"Do","date"),M("date","D"),D("date",9),ut("D",X),ut("DD",X,K),ut("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),dt(["D","DD"],gt),dt("Do",function(t,e){e[gt]=x(t.match(X)[0])});var on=Tt("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),M("dayOfYear","DDD"),D("dayOfYear",4),ut("DDD",tt),ut("DDDD",V),dt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=x(t)}),z("m",["mm",2],0,"minute"),M("minute","m"),D("minute",14),ut("m",X),ut("mm",X,K),dt(["m","mm"],bt);var an=Tt("Minutes",!1);z("s",["ss",2],0,"second"),M("second","s"),D("second",15),ut("s",X),ut("ss",X,K),dt(["s","ss"],wt);var sn,ln=Tt("Seconds",!1);for(z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),M("millisecond","ms"),D("millisecond",16),ut("S",tt,W),ut("SS",tt,K),ut("SSS",tt,V),sn="SSSS";sn.length<=9;sn+="S")ut(sn,rt);function un(t,e){e[xt]=x(1e3*("0."+t))}for(sn="S";sn.length<=9;sn+="S")dt(sn,un);var cn=Tt("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var fn=_.prototype;function pn(t){return t}fn.add=Ge,fn.calendar=function(t,e){var n=t||Te(),o=Ue(n,this).startOf("day"),i=r.calendarFormat(this,o)||"sameElse",a=e&&(T(e[i])?e[i].call(this,n):e[i]);return this.format(a||this.localeData().calendar(i,this,Te(n)))},fn.clone=function(){return new _(this)},fn.diff=function(t,e,n){var r,o,i;if(!this.isValid())return NaN;if(!(r=Ue(t,this)).isValid())return NaN;switch(o=6e4*(r.utcOffset()-this.utcOffset()),e=L(e)){case"year":i=Je(this,r)/12;break;case"month":i=Je(this,r);break;case"quarter":i=Je(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-o)/864e5;break;case"week":i=(this-r-o)/6048e5;break;default:i=this-r}return n?i:w(i)},fn.endOf=function(t){return void 0===(t=L(t))||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))},fn.format=function(t){t||(t=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var e=H(this,t);return this.localeData().postformat(e)},fn.from=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Te(t).isValid())?Ye({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},fn.fromNow=function(t){return this.from(Te(),t)},fn.to=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Te(t).isValid())?Ye({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},fn.toNow=function(t){return this.to(Te(),t)},fn.get=function(t){return T(this[t=L(t)])?this[t]():this},fn.invalidAt=function(){return d(this).overflow},fn.isAfter=function(t,e){var n=b(t)?t:Te(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=L(a(e)?"millisecond":e))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())},fn.isBefore=function(t,e){var n=b(t)?t:Te(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=L(a(e)?"millisecond":e))?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())},fn.isBetween=function(t,e,n,r){return("("===(r=r||"()")[0]?this.isAfter(t,n):!this.isBefore(t,n))&&(")"===r[1]?this.isBefore(e,n):!this.isAfter(e,n))},fn.isSame=function(t,e){var n,r=b(t)?t:Te(t);return!(!this.isValid()||!r.isValid())&&("millisecond"===(e=L(e||"millisecond"))?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))},fn.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},fn.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},fn.isValid=function(){return h(this)},fn.lang=tn,fn.locale=Qe,fn.localeData=en,fn.max=je,fn.min=Ne,fn.parsingFlags=function(){return f({},d(this))},fn.set=function(t,e){if("object"==typeof t)for(var n=function(t){var e=[];for(var n in t)e.push({unit:n,priority:R[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}(t=I(t)),r=0;r<n.length;r++)this[n[r].unit](t[n[r].unit]);else if(T(this[t=L(t)]))return this[t](e);return this},fn.startOf=function(t){switch(t=L(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},fn.subtract=Xe,fn.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},fn.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},fn.toDate=function(){return new Date(this.valueOf())},fn.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?H(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",H(n,"Z")):H(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},fn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=e+'[")]';return this.format(n+r+"-MM-DD[T]HH:mm:ss.SSS"+o)},fn.toJSON=function(){return this.isValid()?this.toISOString():null},fn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},fn.unix=function(){return Math.floor(this.valueOf()/1e3)},fn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},fn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},fn.year=St,fn.isLeapYear=function(){return Ct(this.year())},fn.weekYear=function(t){return rn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},fn.isoWeekYear=function(t){return rn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},fn.quarter=fn.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},fn.month=Dt,fn.daysInMonth=function(){return Pt(this.year(),this.month())},fn.week=fn.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},fn.isoWeek=fn.isoWeeks=function(t){var e=Ht(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},fn.weeksInYear=function(){var t=this.localeData()._week;return Yt(this.year(),t.dow,t.doy)},fn.isoWeeksInYear=function(){return Yt(this.year(),1,4)},fn.date=on,fn.day=fn.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},fn.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},fn.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},fn.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},fn.hour=fn.hours=re,fn.minute=fn.minutes=an,fn.second=fn.seconds=ln,fn.millisecond=fn.milliseconds=cn,fn.utcOffset=function(t,e,n){var o,i=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Be(at,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(o=$e(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),i!==t&&(!e||this._changeInProgress?Ze(this,Ye(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:$e(this)},fn.utc=function(t){return this.utcOffset(0,t)},fn.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract($e(this),"m")),this},fn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Be(it,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},fn.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Te(t).utcOffset():0,(this.utcOffset()-t)%60==0)},fn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},fn.isLocal=function(){return!!this.isValid()&&!this._isUTC},fn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},fn.isUtc=Fe,fn.isUTC=Fe,fn.zoneAbbr=function(){return this._isUTC?"UTC":""},fn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},fn.dates=E("dates accessor is deprecated. Use date instead.",on),fn.months=E("months accessor is deprecated. Use month instead",Dt),fn.years=E("years accessor is deprecated. Use year instead",St),fn.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),fn.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!a(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),(t=Ae(t))._a){var e=t._isUTC?p(t._a):Te(t._a);this._isDSTShifted=this.isValid()&&k(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var dn=j.prototype;function hn(t,e,n,r){var o=fe(),i=p().set(r,e);return o[n](i,t)}function vn(t,e,n){if(s(t)&&(e=t,t=void 0),t=t||"",null!=e)return hn(t,e,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=hn(t,r,n,"month");return o}function mn(t,e,n,r){"boolean"==typeof t?(s(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,s(e)&&(n=e,e=void 0),e=e||"");var o,i=fe(),a=t?i._week.dow:0;if(null!=n)return hn(e,(n+a)%7,r,"day");var l=[];for(o=0;o<7;o++)l[o]=hn(e,(o+a)%7,r,"day");return l}dn.calendar=function(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return T(r)?r.call(e,n):r},dn.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},dn.invalidDate=function(){return this._invalidDate},dn.ordinal=function(t){return this._ordinal.replace("%d",t)},dn.preparse=pn,dn.postformat=pn,dn.relativeTime=function(t,e,n,r){var o=this._relativeTime[n];return T(o)?o(t,e,n,r):o.replace(/%d/i,t)},dn.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return T(n)?n(e):n.replace(/%s/i,e)},dn.set=function(t){var e,n;for(n in t)T(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},dn.months=function(t,e){return t?o(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Mt).test(e)?"format":"standalone"][t.month()]:o(this._months)?this._months:this._months.standalone},dn.monthsShort=function(t,e){return t?o(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Mt.test(e)?"format":"standalone"][t.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},dn.monthsParse=function(t,e,n){var r,o,i;if(this._monthsParseExact)return function(t,e,n){var r,o,i,a=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(o=At.call(this._shortMonthsParse,a))?o:null:-1!==(o=At.call(this._longMonthsParse,a))?o:null:"MMM"===e?-1!==(o=At.call(this._shortMonthsParse,a))?o:-1!==(o=At.call(this._longMonthsParse,a))?o:null:-1!==(o=At.call(this._longMonthsParse,a))?o:-1!==(o=At.call(this._shortMonthsParse,a))?o:null}.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(o=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}},dn.monthsRegex=function(t){return this._monthsParseExact?(c(this,"_monthsRegex")||Ut.call(this),t?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Bt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},dn.monthsShortRegex=function(t){return this._monthsParseExact?(c(this,"_monthsRegex")||Ut.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=qt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},dn.week=function(t){return Ht(t,this._week.dow,this._week.doy).week},dn.firstDayOfYear=function(){return this._week.doy},dn.firstDayOfWeek=function(){return this._week.dow},dn.weekdays=function(t,e){return t?o(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},dn.weekdaysMin=function(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin},dn.weekdaysShort=function(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort},dn.weekdaysParse=function(t,e,n){var r,o,i;if(this._weekdaysParseExact)return function(t,e,n){var r,o,i,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(o=At.call(this._weekdaysParse,a))?o:null:"ddd"===e?-1!==(o=At.call(this._shortWeekdaysParse,a))?o:null:-1!==(o=At.call(this._minWeekdaysParse,a))?o:null:"dddd"===e?-1!==(o=At.call(this._weekdaysParse,a))?o:-1!==(o=At.call(this._shortWeekdaysParse,a))?o:-1!==(o=At.call(this._minWeekdaysParse,a))?o:null:"ddd"===e?-1!==(o=At.call(this._shortWeekdaysParse,a))?o:-1!==(o=At.call(this._weekdaysParse,a))?o:-1!==(o=At.call(this._minWeekdaysParse,a))?o:null:-1!==(o=At.call(this._minWeekdaysParse,a))?o:-1!==(o=At.call(this._weekdaysParse,a))?o:-1!==(o=At.call(this._shortWeekdaysParse,a))?o:null}.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}},dn.weekdaysRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=Zt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},dn.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Gt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},dn.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Jt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},dn.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},dn.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},ue("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===x(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),r.lang=E("moment.lang is deprecated. Use moment.locale instead.",ue),r.langData=E("moment.langData is deprecated. Use moment.localeData instead.",fe);var yn=Math.abs;function gn(t,e,n,r){var o=Ye(e,n);return t._milliseconds+=r*o._milliseconds,t._days+=r*o._days,t._months+=r*o._months,t._bubble()}function _n(t){return t<0?Math.floor(t):Math.ceil(t)}function bn(t){return 4800*t/146097}function wn(t){return 146097*t/4800}function xn(t){return function(){return this.as(t)}}var kn=xn("ms"),On=xn("s"),En=xn("m"),Cn=xn("h"),An=xn("d"),Sn=xn("w"),Tn=xn("M"),Nn=xn("y");function jn(t){return function(){return this.isValid()?this._data[t]:NaN}}var Pn=jn("milliseconds"),Mn=jn("seconds"),Ln=jn("minutes"),In=jn("hours"),Rn=jn("days"),Dn=jn("months"),qn=jn("years"),Bn=Math.round,Un={ss:44,s:45,m:45,h:22,d:26,M:11},$n=Math.abs;function Fn(t){return(t>0)-(t<0)||+t}function zn(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n=$n(this._milliseconds)/1e3,r=$n(this._days),o=$n(this._months);t=w(n/60),e=w(t/60),n%=60,t%=60;var i=w(o/12),a=o%=12,s=r,l=e,u=t,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",f=this.asSeconds();if(!f)return"P0D";var p=f<0?"-":"",d=Fn(this._months)!==Fn(f)?"-":"",h=Fn(this._days)!==Fn(f)?"-":"",v=Fn(this._milliseconds)!==Fn(f)?"-":"";return p+"P"+(i?d+i+"Y":"")+(a?d+a+"M":"")+(s?h+s+"D":"")+(l||u||c?"T":"")+(l?v+l+"H":"")+(u?v+u+"M":"")+(c?v+c+"S":"")}var Hn=Le.prototype;return Hn.isValid=function(){return this._isValid},Hn.abs=function(){var t=this._data;return this._milliseconds=yn(this._milliseconds),this._days=yn(this._days),this._months=yn(this._months),t.milliseconds=yn(t.milliseconds),t.seconds=yn(t.seconds),t.minutes=yn(t.minutes),t.hours=yn(t.hours),t.months=yn(t.months),t.years=yn(t.years),this},Hn.add=function(t,e){return gn(this,t,e,1)},Hn.subtract=function(t,e){return gn(this,t,e,-1)},Hn.as=function(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if("month"===(t=L(t))||"year"===t)return e=this._days+r/864e5,n=this._months+bn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(wn(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}},Hn.asMilliseconds=kn,Hn.asSeconds=On,Hn.asMinutes=En,Hn.asHours=Cn,Hn.asDays=An,Hn.asWeeks=Sn,Hn.asMonths=Tn,Hn.asYears=Nn,Hn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*x(this._months/12):NaN},Hn._bubble=function(){var t,e,n,r,o,i=this._milliseconds,a=this._days,s=this._months,l=this._data;return i>=0&&a>=0&&s>=0||i<=0&&a<=0&&s<=0||(i+=864e5*_n(wn(s)+a),a=0,s=0),l.milliseconds=i%1e3,t=w(i/1e3),l.seconds=t%60,e=w(t/60),l.minutes=e%60,n=w(e/60),l.hours=n%24,a+=w(n/24),o=w(bn(a)),s+=o,a-=_n(wn(o)),r=w(s/12),s%=12,l.days=a,l.months=s,l.years=r,this},Hn.clone=function(){return Ye(this)},Hn.get=function(t){return t=L(t),this.isValid()?this[t+"s"]():NaN},Hn.milliseconds=Pn,Hn.seconds=Mn,Hn.minutes=Ln,Hn.hours=In,Hn.days=Rn,Hn.weeks=function(){return w(this.days()/7)},Hn.months=Dn,Hn.years=qn,Hn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=function(t,e,n){var r=Ye(t).abs(),o=Bn(r.as("s")),i=Bn(r.as("m")),a=Bn(r.as("h")),s=Bn(r.as("d")),l=Bn(r.as("M")),u=Bn(r.as("y")),c=o<=Un.ss&&["s",o]||o<Un.s&&["ss",o]||i<=1&&["m"]||i<Un.m&&["mm",i]||a<=1&&["h"]||a<Un.h&&["hh",a]||s<=1&&["d"]||s<Un.d&&["dd",s]||l<=1&&["M"]||l<Un.M&&["MM",l]||u<=1&&["y"]||["yy",u];return c[2]=e,c[3]=+t>0,c[4]=n,function(t,e,n,r,o){return o.relativeTime(e||1,!!n,t,r)}.apply(null,c)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},Hn.toISOString=zn,Hn.toString=zn,Hn.toJSON=zn,Hn.locale=Qe,Hn.localeData=en,Hn.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",zn),Hn.lang=tn,z("X",0,0,"unix"),z("x",0,0,"valueOf"),ut("x",ot),ut("X",/[+-]?\d+(\.\d{1,3})?/),dt("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),dt("x",function(t,e,n){n._d=new Date(x(t))}),r.version="2.22.2",e=Te,r.fn=fn,r.min=function(){return Pe("isBefore",[].slice.call(arguments,0))},r.max=function(){return Pe("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=p,r.unix=function(t){return Te(1e3*t)},r.months=function(t,e){return vn(t,e,"months")},r.isDate=l,r.locale=ue,r.invalid=v,r.duration=Ye,r.isMoment=b,r.weekdays=function(t,e,n){return mn(t,e,n,"weekdays")},r.parseZone=function(){return Te.apply(null,arguments).parseZone()},r.localeData=fe,r.isDuration=Ie,r.monthsShort=function(t,e){return vn(t,e,"monthsShort")},r.weekdaysMin=function(t,e,n){return mn(t,e,n,"weekdaysMin")},r.defineLocale=ce,r.updateLocale=function(t,e){if(null!=e){var n,r,o=oe;null!=(r=le(t))&&(o=r._config),e=N(o,e),(n=new j(e)).parentLocale=ie[t],ie[t]=n,ue(t)}else null!=ie[t]&&(null!=ie[t].parentLocale?ie[t]=ie[t].parentLocale:null!=ie[t]&&delete ie[t]);return ie[t]},r.locales=function(){return C(ie)},r.weekdaysShort=function(t,e,n){return mn(t,e,n,"weekdaysShort")},r.normalizeUnits=L,r.relativeTimeRounding=function(t){return void 0===t?Bn:"function"==typeof t&&(Bn=t,!0)},r.relativeTimeThreshold=function(t,e){return void 0!==Un[t]&&(void 0===e?Un[t]:(Un[t]=e,"s"===t&&(Un.ss=e-1),!0))},r.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=fn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},r}()}).call(this,n("YuTi")(t))},wdHX:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},xAGQ:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},xOYe:function(t,e,n){"use strict";n.r(e);var r=n("8JPK"),o=n.n(r),i=n("myLK"),a={mixins:[o.a],components:{filters:i.a},data:function(){return{baseURL:"/api/tags",entries:[],hasMoreEntries:!1,nextPageUrl:null,loadingMoreEntries:!1,ready:!1,searchQuery:""}},mounted:function(){document.title="Tags — Wink.",this.loadEntries()}},s=n("KHd+"),l=Object(s.a)(a,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("page-header",[n("div",{attrs:{slot:"right-side"},slot:"right-side"},[n("router-link",{staticClass:"py-1 px-2 btn-primary text-sm",attrs:{to:{name:"tag-new"}}},[t._v("\n New Tag\n ")])],1)]),t._v(" "),n("div",{staticClass:"container"},[n("div",{staticClass:"mb-10 flex items-center"},[n("h1",{staticClass:"inline font-semibold text-3xl mr-auto"},[t._v("Tags")]),t._v(" "),n("filters",{attrs:{"is-filtered":t.isFiltered},on:{showing:t.focusSearchInput}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.searchQuery,expression:"searchQuery"}],ref:"searchInput",staticClass:"input mt-0 w-full",attrs:{type:"text",placeholder:"Search..."},domProps:{value:t.searchQuery},on:{input:function(e){e.target.composing||(t.searchQuery=e.target.value)}}})])],1),t._v(" "),t.ready?t._e():n("preloader"),t._v(" "),t.ready&&0==t.entries.length&&!t.isFiltered?n("div",[n("p",[t._v("No tags were found, start by\n "),n("router-link",{staticClass:"no-underline text-primary hover:text-primary-dark",attrs:{to:{name:"tag-new"}}},[t._v("adding some tags")]),t._v("\n .\n ")],1)]):t._e(),t._v(" "),t.ready&&0==t.entries.length&&t.isFiltered?n("div",[t._v("\n No tags matched the given search.\n ")]):t._e(),t._v(" "),t.ready&&t.entries.length>0?n("div",[t._l(t.entries,function(e){return n("div",{key:e.id,staticClass:"border-t border-very-light flex items-center"},[n("div",{staticClass:"py-4",attrs:{title:e.title}},[n("h2",{staticClass:"text-xl font-semibold"},[n("router-link",{staticClass:"no-underline text-text-color",attrs:{to:{name:"tag-edit",params:{id:e.id}}}},[t._v("\n "+t._s(t.truncate(e.name,80))+"\n ")])],1)]),t._v(" "),n("div",{staticClass:"ml-auto text-light mr-8"},[t._v("\n "+t._s(e.posts_count)+" Post(s)\n ")]),t._v(" "),n("div",[t._v(t._s(t.timeAgo(e.created_at)))])])}),t._v(" "),t.hasMoreEntries?n("tr",[n("td",{staticClass:"text-center py-3",attrs:{colspan:"100"}},[n("small",[t.loadingMoreEntries?t._e():n("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.loadOlderEntries(e)}}},[t._v("Load Older Tags")])]),t._v(" "),t.loadingMoreEntries?n("small",[t._v("Loading...")]):t._e()])]):t._e()],2):t._e()],1)],1)},[],!1,null,null,null);l.options.__file="index.vue";e.default=l.exports},"xTJ+":function(t,e,n){"use strict";var r=n("HSsa"),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function a(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function l(t){return"[object Function]"===o.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:l,isStream:function(t){return s(t)&&l(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)u(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)u(arguments[r],n);return e},extend:function(t,e,n){return u(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},xZEP:function(t,e,n){"use strict";n.r(e);var r=n("LvDl"),o=n.n(r),i=(n("wd/R"),{props:["value","options","optionId","optionText"],data:function(){return{searchTerm:"",selectedOptionIndex:0,focused:!1,newOptions:[]}},mounted:function(){this.$refs.input.style.width=this.value.length?"25px":"108px",this.$refs.input.placeholder=this.value.length?"":"Add tags"},watch:{value:function(t){this.$refs.input.style.width=this.value.length?"25px":"108px",this.$refs.input.placeholder=this.value.length?"":"Add tags"},searchTerm:function(t){var e=12*t.length;this.$refs.input.style.width=e>25?e+"px":"25px"},matches:function(t){var e=this;this.selectedOptionIndex=o.a.find(t,function(t){return"addNew"==t[e.optionId]})?1:0}},computed:{matches:function(){var t=this,e=o.a.union(this.options,this.newOptions);if(this.searchTerm){var n=o.a.reject(e,function(e){return o.a.find(t.value,{id:e.id})||-1==e[t.optionText].toLowerCase().indexOf(t.searchTerm.toLowerCase())}),r={};return r[this.optionText]="Add new",r[this.optionId]="addNew",n.unshift(r),n}return o.a.reject(e,function(e){return o.a.find(t.value,{id:e.id})})}},methods:{selectOption:function(t){var e=this.value||[];if(!o.a.includes(e,t.id)){if("addNew"==t[this.optionId])return this.addNewOption();this.searchTerm="",e.push(t),this.$emit("input",e)}},removeOption:function(t){var e=this.value||[];e=o.a.reject(e,{id:t.id}),this.$emit("input",e)},backspaceAction:function(){if(!this.searchTerm){var t=this.value||[];t.pop(),this.$emit("input",t),this.selectedOptionIndex=0}},selectNextOption:function(){this.matches.length&&this.selectedOptionIndex+1!=this.matches.length&&(this.selectedOptionIndex=this.selectedOptionIndex+1)},selectPreviousOption:function(){this.matches.length&&0!==this.selectedOptionIndex&&(this.selectedOptionIndex=this.selectedOptionIndex-1)},addSelectedOption:function(){if(!this.matches[this.selectedOptionIndex])return this.addNewOption();this.selectOption(this.matches[this.selectedOptionIndex]),this.selectedOptionIndex=0},addNewOption:function(){var t=this,e=this.value||[],n={};o.a.find(o.a.union(this.options,this.newOptions),function(e){return e.name.toLowerCase()==t.searchTerm.toLowerCase()})?this.searchTerm="":(n[this.optionText]=this.searchTerm,n[this.optionId]=o.a.uniqueId(),e.push(n),this.newOptions.push(n),this.searchTerm="",this.$emit("input",e))},activate:function(){this.focused=!0,this.$refs.input.focus()},deactivate:function(){this.focused=!1}}}),a=n("KHd+"),s=Object(a.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.deactivate,expression:"deactivate"}],staticClass:"multiselect relative z-50",class:{active:t.focused},on:{click:t.activate}},[n("div",{staticClass:"multiselect_options"},[t._l(t.value,function(e){return n("span",{staticClass:"bg-light hover:bg-red rounded cursor-pointer text-sm text-contrast font-semibold px-1 mr-1",on:{click:function(n){t.removeOption(e)}}},[t._v(t._s(e[t.optionText]))])}),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.searchTerm,expression:"searchTerm"}],ref:"input",staticClass:"focus:outline-none bg-transparent text-text-color",attrs:{type:"text"},domProps:{value:t.searchTerm},on:{keydown:[function(e){return"button"in e||8===e.keyCode?t.backspaceAction(e):null},function(e){return"button"in e||40===e.keyCode?t.selectNextOption(e):null},function(e){return"button"in e||38===e.keyCode?t.selectPreviousOption(e):null},function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.addSelectedOption(e):null}],input:function(e){e.target.composing||(t.searchTerm=e.target.value)}}})],2),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.focused,expression:"focused"}],staticClass:"multiselect_dropdown absolute w-full"},[t.matches.length?t._e():n("button",{staticClass:"text-text-color"},[t._v("Add new tag...")]),t._v(" "),t._l(t.matches,function(e,r){return n("button",{class:{selected:t.selectedOptionIndex==r},attrs:{value:e[t.optionId]},on:{click:function(n){t.selectOption(e)}}},[t._v(t._s(e[t.optionText])+"\n ")])})],2)])},[],!1,null,null,null);s.options.__file="MultiSelect.vue";e.default=s.exports},y9D6:function(t,e,n){"use strict";n.r(e);var r=n("vDqi"),o=n.n(r),i={props:[],data:function(){return{file:null,imageUrl:"",uploadProgress:100,selectedUnsplashImage:null,unsplashModalShown:!1,unsplashSearchTerm:"",unsplashPage:1,searchingUnsplash:!0,unsplashImages:[],cropperModalShown:!1}},mounted:function(){},watch:{unsplashSearchTerm:function(){var t=this;this.debouncer(function(){t.getImagesFromUnsplash()})}},methods:{getImagesFromUnsplash:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(!Wink.unsplash_key)return this.alertError("Please configure your Unsplash API Key.");this.unsplashPage=e,this.searchingUnsplash=!0,o.a.get("https://api.unsplash.com/search/photos?client_id="+Wink.unsplash_key+"&orientation=landscape&per_page=19&query="+this.unsplashSearchTerm+"&page="+e).then(function(e){t.unsplashImages=e.data.results,t.searchingUnsplash=!1}).catch(function(e){e.response.data.errors;t.searchingUnsplash=!1})},loadSelectedImage:function(t){this.file=t.target.files[0],this.showCropperModal()},openUnsplashModal:function(){var t=this;this.unsplashSearchTerm="sunny",this.unsplashModalShown=!0,this.$nextTick(function(){t.$refs.unsplashSearch.focus()})},closeUnplashModalAndInsertImage:function(){this.$emit("changed",{url:this.selectedUnsplashImage.urls.regular,caption:'Photo by <a href="'+this.selectedUnsplashImage.user.links.html+'">'+this.selectedUnsplashImage.user.name+'</a> on <a href="https://unsplash.com">Unsplash</a>'}),this.closeUnsplashModal()},closeUnsplashModal:function(){this.unsplashSearchTerm="",this.unsplashModalShown=!1,this.selectedUnsplashImage=null},showCropperModal:function(){this.cropperModalShown=!0},closeCropperModal:function(t){var e=t.image;this.cropperModalShown=!1,this.imageUrl=e,this.$emit("changed",{url:e,caption:""})},cancelCropperModal:function(){this.cropperModalShown=!1}}},a=n("KHd+"),s=Object(a.a)(i,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("input",{staticClass:"hidden",attrs:{type:"file",id:"imageUpload"+t._uid,accept:"image/*"},on:{change:t.loadSelectedImage}}),t._v(" "),n("div",{staticClass:"mb-0"},[t._v("\n Please "),n("label",{staticClass:"cursor-pointer underline",attrs:{for:"imageUpload"+t._uid}},[t._v("upload")]),t._v(" an image\n "),t.Wink.unsplash_key?n("span",[t._v("or")]):t._e(),t._v(" "),t.Wink.unsplash_key?n("a",{staticClass:"text-text-color",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.openUnsplashModal(e)}}},[t._v("search Unsplash")]):t._e()]),t._v(" "),t.unsplashModalShown?n("fullscreen-modal",[n("div",{staticClass:"bg-contrast z-50 fixed pin overflow-y-scroll"},[n("div",{staticClass:"container py-20"},[n("div",{staticClass:"flex items-center"},[n("h2",{staticClass:"mr-auto"},[t._v("Search Unsplash")]),t._v(" "),t.selectedUnsplashImage?n("button",{staticClass:"btn-primary mr-4",on:{click:t.closeUnplashModalAndInsertImage}},[t._v("Choose Selected Image")]):t._e(),t._v(" "),n("button",{staticClass:"btn-light",on:{click:t.closeUnsplashModal}},[t._v("Cancel")])]),t._v(" "),t.Wink.unsplash_key?n("input",{directives:[{name:"model",rawName:"v-model",value:t.unsplashSearchTerm,expression:"unsplashSearchTerm"}],ref:"unsplashSearch",staticClass:"my-10 border-b border-very-light focus:outline-none w-full",attrs:{type:"text",placeholder:"search Unsplash"},domProps:{value:t.unsplashSearchTerm},on:{input:function(e){e.target.composing||(t.unsplashSearchTerm=e.target.value)}}}):t._e(),t._v(" "),t.searchingUnsplash?n("preloader",{staticClass:"mt-10"}):t._e(),t._v(" "),!t.searchingUnsplash&&t.unsplashImages.length?n("div",{staticClass:"flex flex-wrap mt-5"},[t._l(t.unsplashImages,function(e){return n("div",{staticClass:"w-1/4 p-1 cursor-pointer",on:{click:function(n){t.selectedUnsplashImage=e}}},[n("div",{staticClass:"h-48 w-full bg-cover border-primary",class:{"border-4":t.selectedUnsplashImage&&t.selectedUnsplashImage.id==e.id},style:{backgroundImage:"url("+e.urls.thumb+")"}})])}),t._v(" "),19==t.unsplashImages.length?n("div",{staticClass:"w-1/4 p-1"},[n("div",{staticClass:"bg-primary text-center flex items-center justify-center h-full"},[n("button",{staticClass:"text-contrast hover:underline",on:{click:function(e){t.getImagesFromUnsplash(t.unsplashPage+1)}}},[t._v("More >>")])])]):t._e()],2):t._e(),t._v(" "),t.searchingUnsplash||t.unsplashImages.length?t._e():n("div",[n("h4",{staticClass:"text-center"},[t._v("We couldn't find any matches.")])])],1)])]):t._e(),t._v(" "),t.cropperModalShown?n("cropper-modal",{attrs:{image:t.file,viewport:{width:600,height:400},boundary:{width:600,height:400}},on:{close:t.closeCropperModal,cancel:t.cancelCropperModal}}):t._e()],1)},[],!1,null,null,null);s.options.__file="ImagePicker.vue";e.default=s.exports},yK9s:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},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},zuR4:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("HSsa"),i=n("CgaS"),a=n("SntB");function s(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var l=s(n("JEQr"));l.Axios=i,l.create=function(t){return s(a(l.defaults,t))},l.Cancel=n("endd"),l.CancelToken=n("jfS+"),l.isCancel=n("Lmem"),l.all=function(t){return Promise.all(t)},l.spread=n("DfZB"),t.exports=l,t.exports.default=l}}); \ No newline at end of file +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/axios/index.js": +/*!*************************************!*\ + !*** ./node_modules/axios/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); + +/***/ }), + +/***/ "./node_modules/axios/lib/adapters/xhr.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/adapters/xhr.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + // Listen for ready state + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); + + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (config.withCredentials) { + request.withCredentials = true; + } + + // Add responseType to request if needed + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. + // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. + if (config.responseType !== 'json') { + throw e; + } + } + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (requestData === undefined) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/axios.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/axios.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(utils.merge(defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/Cancel.js": +/*!*************************************************!*\ + !*** ./node_modules/axios/lib/cancel/Cancel.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/CancelToken.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./node_modules/axios/lib/cancel/isCancel.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/cancel/isCancel.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/Axios.js": +/*!**********************************************!*\ + !*** ./node_modules/axios/lib/core/Axios.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js"); +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = utils.merge({ + url: arguments[0] + }, arguments[1]); + } + + config = utils.merge(defaults, {method: 'get'}, this.defaults, config); + config.method = config.method.toLowerCase(); + + // Hook up interceptors middleware + var chain = [dispatchRequest, undefined]; + var promise = Promise.resolve(config); + + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected); + }); + + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(utils.merge(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/InterceptorManager.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/createError.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/core/createError.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/dispatchRequest.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); +var isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Support baseURL config + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData( + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers || {} + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData( + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData( + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/enhanceError.js": +/*!*****************************************************!*\ + !*** ./node_modules/axios/lib/core/enhanceError.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + error.request = request; + error.response = response; + return error; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/settle.js": +/*!***********************************************!*\ + !*** ./node_modules/axios/lib/core/settle.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + // Note: status is not exposed by XDomainRequest + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/core/transformData.js": +/*!******************************************************!*\ + !*** ./node_modules/axios/lib/core/transformData.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/defaults.js": +/*!********************************************!*\ + !*** ./node_modules/axios/lib/defaults.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); + } + return adapter; +} + +var defaults = { + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return JSON.stringify(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) { /* Ignore */ } + } + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/bind.js": +/*!************************************************!*\ + !*** ./node_modules/axios/lib/helpers/bind.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/buildURL.js": +/*!****************************************************!*\ + !*** ./node_modules/axios/lib/helpers/buildURL.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/combineURLs.js": +/*!*******************************************************!*\ + !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/cookies.js": +/*!***************************************************!*\ + !*** ./node_modules/axios/lib/helpers/cookies.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!*********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!***********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": +/*!***************************************************************!*\ + !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": +/*!********************************************************!*\ + !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/helpers/spread.js": +/*!**************************************************!*\ + !*** ./node_modules/axios/lib/helpers/spread.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./node_modules/axios/lib/utils.js": +/*!*****************************************!*\ + !*** ./node_modules/axios/lib/utils.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); +var isBuffer = __webpack_require__(/*! is-buffer */ "./node_modules/axios/node_modules/is-buffer/index.js"); + +/*global toString:true*/ + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim +}; + + +/***/ }), + +/***/ "./node_modules/axios/node_modules/is-buffer/index.js": +/*!************************************************************!*\ + !*** ./node_modules/axios/node_modules/is-buffer/index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh <https://feross.org> + * @license MIT + */ + +module.exports = function isBuffer (obj) { + return obj != null && obj.constructor != null && + typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Alert.vue?vue&type=script&lang=js&": +/*!****************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Alert.vue?vue&type=script&lang=js& ***! + \****************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['type', 'message', 'autoClose', 'confirmationProceed', 'confirmationCancel'], + data: function data() { + return { + timeout: null + }; + }, + mounted: function mounted() { + var _this = this; + + if (this.autoClose) { + this.timeout = setTimeout(function () { + _this.close(); + }, this.autoClose); + } + }, + methods: { + /** + * Close the alert. + */ + close: function close() { + clearTimeout(this.timeout); + this.$root.alert.type = null; + this.$root.alert.autoClose = false; + this.$root.alert.message = ''; + this.$root.alert.confirmationProceed = null; + this.$root.alert.confirmationCancel = null; + }, + + /** + * Confirm and close the alert. + */ + confirm: function confirm() { + this.confirmationProceed(); + this.close(); + }, + + /** + * Cancel and close the alert. + */ + cancel: function cancel() { + if (this.confirmationCancel) { + this.confirmationCancel(); + } + + this.close(); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CropperModal.vue?vue&type=script&lang=js&": +/*!***********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CropperModal.vue?vue&type=script&lang=js& ***! + \***********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['image', 'viewport', 'boundary'], + data: function data() { + return { + finalImage: null, + uploadProgress: 0, + uploading: false, + size: 'original' + }; + }, + mounted: function mounted() { + this.readImage(this.image); + }, + methods: { + /** + * Close after cropping. + */ + saveCroppedImageAndClose: function saveCroppedImageAndClose() { + this.$emit('close', { + image: this.finalImage + }); + }, + + /** + * Cancel cropping. + */ + cancel: function cancel() { + this.$emit('cancel'); + }, + + /** + * Crop the image. + */ + crop: function crop() { + var _this = this; + + this.$refs.croppieRef.result({ + type: 'canvas', + format: 'png', + quality: 1, + size: this.size + }, function (output) { + _this.uploadSelectedImage(output); + }); + }, + + /** + * Read the given image file. + */ + readImage: function readImage(image) { + var _this2 = this; + + var reader = new FileReader(); + + reader.onload = function (e) { + _this2.$refs.croppieRef.bind({ + url: e.target.result, + zoom: 0 + }); + }; + + reader.readAsDataURL(image); + }, + + /** + * Upload the orginal image. + */ + uploadOriginalImage: function uploadOriginalImage() { + var _this3 = this; + + var file = this.image; + var formData = new FormData(); + formData.append('image', file, file.name); + this.$emit('uploading'); + this.uploading = true; + this.http().post('/api/uploads', formData, { + onUploadProgress: function onUploadProgress(progressEvent) { + _this3.uploadProgress = Math.round(progressEvent.loaded * 100 / progressEvent.total); + } + }).then(function (response) { + _this3.finalImage = response.data.url; + _this3.uploading = false; + + _this3.saveCroppedImageAndClose(); + }).catch(function (error) { + console.log(error); + }); + }, + + /** + * Upload the selected image. + */ + uploadSelectedImage: function uploadSelectedImage(base64) { + var _this4 = this; + + var formData = new FormData(); + fetch(base64).then(function (res) { + return res.blob(); + }).then(function (blob) { + var file = new File([blob], "filename.jpeg"); + formData.append('image', file, file.name); + _this4.uploading = true; + + _this4.http().post('/api/uploads', formData, { + onUploadProgress: function onUploadProgress(progressEvent) { + _this4.uploadProgress = Math.round(progressEvent.loaded * 100 / progressEvent.total); + } + }).then(function (response) { + _this4.finalImage = response.data.url; + _this4.uploading = false; + + _this4.saveCroppedImageAndClose(); + }).catch(function (error) {// + }); + }); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=script&lang=js&": +/*!*************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/DateTimePicker.vue?vue&type=script&lang=js& ***! + \*************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['value'], + data: function data() { + return { + dateComponents: { + day: '', + month: '', + year: '', + hour: '', + minute: '' + }, + result: '' + }; + }, + mounted: function mounted() { + this.buildComponents(this.value); + }, + watch: { + value: function value(val) { + this.buildComponents(val); + }, + dateComponents: { + handler: function handler() { + this.result = this.dateComponents.year + '-' + this.dateComponents.month + '-' + this.dateComponents.day + ' ' + this.dateComponents.hour + ':' + this.dateComponents.minute + ':00'; + this.$emit('input', this.result); + }, + deep: true + } + }, + computed: {}, + methods: { + buildComponents: function buildComponents(val) { + var date = moment__WEBPACK_IMPORTED_MODULE_1___default()(val + ' Z').utc(); + this.dateComponents = { + month: date.format('MM'), + day: date.format('DD'), + year: date.format('YYYY'), + hour: date.format('HH'), + minute: date.format('mm') + }; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DropDown.vue?vue&type=script&lang=js&": +/*!*******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/DropDown.vue?vue&type=script&lang=js& ***! + \*******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return { + shouldShowContent: false + }; + }, + watch: { + shouldShowContent: function shouldShowContent(val) { + if (val) { + this.$emit('showing'); + } + } + }, + methods: { + toggle: function toggle() { + this.shouldShowContent = !this.shouldShowContent; + }, + hide: function hide() { + this.shouldShowContent = false; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Editor.vue?vue&type=script&lang=js&": +/*!*****************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Editor.vue?vue&type=script&lang=js& ***! + \*****************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! quill */ "./node_modules/quill/dist/quill.js"); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(quill__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _editorComponents_ImageUploader_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editorComponents/ImageUploader.vue */ "./resources/js/components/editorComponents/ImageUploader.vue"); +/* harmony import */ var _editorComponents_HTMLEmbedder_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editorComponents/HTMLEmbedder.vue */ "./resources/js/components/editorComponents/HTMLEmbedder.vue"); +/* harmony import */ var _editorComponents_WinkImageBlot_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editorComponents/WinkImageBlot.js */ "./resources/js/components/editorComponents/WinkImageBlot.js"); +/* harmony import */ var _editorComponents_WinkDividerBlot_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editorComponents/WinkDividerBlot.js */ "./resources/js/components/editorComponents/WinkDividerBlot.js"); +/* harmony import */ var _editorComponents_HTMLBlot_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editorComponents/HTMLBlot.js */ "./resources/js/components/editorComponents/HTMLBlot.js"); +/* harmony import */ var _editorComponents_WinkClipboard_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editorComponents/WinkClipboard.js */ "./resources/js/components/editorComponents/WinkClipboard.js"); +/* harmony import */ var _editorComponents_WinkLink_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./editorComponents/WinkLink.js */ "./resources/js/components/editorComponents/WinkLink.js"); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! parchment */ "./node_modules/parchment/dist/parchment.js"); +/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(parchment__WEBPACK_IMPORTED_MODULE_9__); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + + + + + + + + + + +/* harmony default export */ __webpack_exports__["default"] = ({ + components: { + 'image-uploader': _editorComponents_ImageUploader_vue__WEBPACK_IMPORTED_MODULE_2__["default"], + 'html-embedder': _editorComponents_HTMLEmbedder_vue__WEBPACK_IMPORTED_MODULE_3__["default"] + }, + props: { + value: { + type: String, + default: '' + }, + postId: { + type: String + } + }, + data: function data() { + return { + editor: null, + editorBody: this.body + }; + }, + mounted: function mounted() { + this.editor = this.createEditor(); + this.handleEditorValue(); + this.handleClicksInsideEditor(); + this.initSideControls(); // This can be used to auto focus the editor and show the sidebar controls + // we need to detect if the editor is empty and should be autofocused + // this.editor.focus(); + // + // let sidebarControls = document.getElementById('sidebar-controls'); + // + // sidebarControls.classList.remove('active'); + // + // sidebarControls.style.display = 'block'; + // + // sidebarControls.style.left = -50 + 'px'; + // sidebarControls.style.top = -2 + 'px'; + }, + methods: { + /** + * Create an instance of the editor. + */ + createEditor: function createEditor() { + var icons; + quill__WEBPACK_IMPORTED_MODULE_1___default.a.register(_editorComponents_WinkImageBlot_js__WEBPACK_IMPORTED_MODULE_4__["default"], true); + quill__WEBPACK_IMPORTED_MODULE_1___default.a.register(_editorComponents_WinkDividerBlot_js__WEBPACK_IMPORTED_MODULE_5__["default"], true); + quill__WEBPACK_IMPORTED_MODULE_1___default.a.register(_editorComponents_HTMLBlot_js__WEBPACK_IMPORTED_MODULE_6__["default"], true); + quill__WEBPACK_IMPORTED_MODULE_1___default.a.register(_editorComponents_WinkLink_js__WEBPACK_IMPORTED_MODULE_8__["default"], true); + quill__WEBPACK_IMPORTED_MODULE_1___default.a.register('modules/clipboard', _editorComponents_WinkClipboard_js__WEBPACK_IMPORTED_MODULE_7__["default"], true); + icons = quill__WEBPACK_IMPORTED_MODULE_1___default.a.import('ui/icons'); + icons.header[3] = __webpack_require__(/*! html-loader!quill/assets/icons/header-3.svg */ "./node_modules/html-loader/index.js!./node_modules/quill/assets/icons/header-3.svg"); + return new quill__WEBPACK_IMPORTED_MODULE_1___default.a(this.$refs.editor, { + modules: { + syntax: true, + toolbar: [['bold', 'italic', 'underline', 'strike', 'code'], [{ + 'header': '2' + }, { + 'header': '3' + }], [{ + 'list': 'ordered' + }, { + 'list': 'bullet' + }, 'link'], ['blockquote', 'code-block']] + }, + theme: 'bubble', + scrollingContainer: 'html, body', + placeholder: "Starting writing now..." + }); + }, + + /** + * Handle the editor value. + */ + handleEditorValue: function handleEditorValue() { + var _this = this; + + this.editor.root.innerHTML = this.value; + this.editor.on('text-change', function () { + _this.$emit('input', _this.editor.getText() ? _this.editor.root.innerHTML : ''); + }); + }, + + /** + * Handle click events inside the editor. + */ + handleClicksInsideEditor: function handleClicksInsideEditor() { + var _this2 = this; + + this.editor.root.addEventListener('click', function (ev) { + var blot = parchment__WEBPACK_IMPORTED_MODULE_9___default.a.find(ev.target, true); + + if (blot instanceof _editorComponents_WinkImageBlot_js__WEBPACK_IMPORTED_MODULE_4__["default"]) { + var values = blot.value(blot.domNode)['captioned-image']; + values.existingBlot = blot; + + _this2.openImageUploader(values); + } + + if (blot instanceof _editorComponents_HTMLBlot_js__WEBPACK_IMPORTED_MODULE_6__["default"]) { + var values = blot.value(blot.domNode)['html']; + values.existingBlot = blot; + + _this2.openingHTMLEmbedder(values); + } + }); + }, + + /** + * Init the side controls. + */ + initSideControls: function initSideControls() { + var _this3 = this; + + var Block = quill__WEBPACK_IMPORTED_MODULE_1___default.a.import('blots/block'); + this.editor.on(quill__WEBPACK_IMPORTED_MODULE_1___default.a.events.EDITOR_CHANGE, function (eventType, range) { + var sidebarControls = document.getElementById('sidebar-controls'); + if (eventType !== quill__WEBPACK_IMPORTED_MODULE_1___default.a.events.SELECTION_CHANGE) return; + if (range == null) return; + + if (range.length === 0) { + var _this3$editor$scroll$ = _this3.editor.scroll.descendant(Block, range.index), + _this3$editor$scroll$2 = _slicedToArray(_this3$editor$scroll$, 2), + block = _this3$editor$scroll$2[0], + offset = _this3$editor$scroll$2[1]; + + if (block != null && block.domNode.firstChild instanceof HTMLBRElement) { + var lineBounds = _this3.editor.getBounds(range); + + sidebarControls.classList.remove('active'); + sidebarControls.style.display = 'block'; + sidebarControls.style.left = lineBounds.left - 50 + 'px'; + sidebarControls.style.top = lineBounds.top - 2 + 'px'; + } else { + sidebarControls.style.display = 'none'; + sidebarControls.classList.remove('active'); + } + } else { + sidebarControls.style.display = 'none'; + sidebarControls.classList.remove('active'); + } + }); + }, + + /** + * Show the side controls. + */ + showSideControls: function showSideControls() { + document.getElementById('sidebar-controls').classList.toggle('active'); + this.editor.focus(); + }, + openingHTMLEmbedder: function openingHTMLEmbedder() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + this.$emit('openingHTMLEmbedder', data); + }, + openImageUploader: function openImageUploader() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + this.$emit('openingImageUploader', data); + }, + + /** + * Add a new captioned image to the content. + */ + applyImage: function applyImage(_ref) { + var url = _ref.url, + caption = _ref.caption, + existingBlot = _ref.existingBlot, + layout = _ref.layout; + var values = { + url: url, + caption: caption, + layout: layout + }; + + if (existingBlot) { + return existingBlot.replaceWith('captioned-image', values); + } + + var range = this.editor.getSelection(true); + this.editor.insertEmbed(range.index, 'captioned-image', values, quill__WEBPACK_IMPORTED_MODULE_1___default.a.sources.USER); + this.editor.setSelection(range.index + 1, quill__WEBPACK_IMPORTED_MODULE_1___default.a.sources.SILENT); + }, + + /** + * Add a divider to the content. + */ + addDivider: function addDivider() { + var range = this.editor.getSelection(true); + this.editor.insertText(range.index, '\n', quill__WEBPACK_IMPORTED_MODULE_1___default.a.sources.USER); + this.editor.insertEmbed(range.index + 1, 'divider', true, quill__WEBPACK_IMPORTED_MODULE_1___default.a.sources.USER); + this.editor.setSelection(range.index + 2, quill__WEBPACK_IMPORTED_MODULE_1___default.a.sources.SILENT); + }, + + /** + * Add a new HTML blot to the content. + */ + applyHTML: function applyHTML(_ref2) { + var content = _ref2.content, + existingBlot = _ref2.existingBlot; + var values = { + content: content + }; + var range = this.editor.getSelection(true); + + if (existingBlot) { + return existingBlot.replaceWith('html', values); + } + + this.editor.insertEmbed(range.index, 'html', values, quill__WEBPACK_IMPORTED_MODULE_1___default.a.sources.USER); + this.editor.setSelection(range.index + 1, quill__WEBPACK_IMPORTED_MODULE_1___default.a.sources.SILENT); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FormErrors.vue?vue&type=script&lang=js&": +/*!*********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/FormErrors.vue?vue&type=script&lang=js& ***! + \*********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + components: {}, + props: ['errors'], + data: function data() { + return {}; + }, + mounted: function mounted() {}, + methods: {} +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FullscreenModal.vue?vue&type=script&lang=js&": +/*!**************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/FullscreenModal.vue?vue&type=script&lang=js& ***! + \**************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return {}; + }, + created: function created() { + document.body.classList.add('overflow-hidden'); + }, + destroyed: function destroyed() { + document.body.classList.remove('overflow-hidden'); + }, + methods: {} +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ImagePicker.vue?vue&type=script&lang=js&": +/*!**********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ImagePicker.vue?vue&type=script&lang=js& ***! + \**********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__); + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: [], + data: function data() { + return { + file: null, + imageUrl: '', + uploadProgress: 100, + selectedUnsplashImage: null, + unsplashModalShown: false, + unsplashSearchTerm: '', + unsplashPage: 1, + searchingUnsplash: true, + unsplashImages: [], + cropperModalShown: false + }; + }, + mounted: function mounted() {}, + watch: { + unsplashSearchTerm: function unsplashSearchTerm() { + var _this = this; + + this.debouncer(function () { + _this.getImagesFromUnsplash(); + }); + } + }, + methods: { + getImagesFromUnsplash: function getImagesFromUnsplash() { + var _this2 = this; + + var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + + if (!Wink.unsplash_key) { + return this.alertError('Please configure your Unsplash API Key.'); + } + + this.unsplashPage = page; + this.searchingUnsplash = true; + axios__WEBPACK_IMPORTED_MODULE_0___default.a.get('https://api.unsplash.com/search/photos?client_id=' + Wink.unsplash_key + '&orientation=landscape&per_page=19' + '&query=' + this.unsplashSearchTerm + '&page=' + page).then(function (response) { + _this2.unsplashImages = response.data.results; + _this2.searchingUnsplash = false; + }).catch(function (error) { + var errors = error.response.data.errors; + _this2.searchingUnsplash = false; + }); + }, + + /** + * Load the selected image into the Cropper. + */ + loadSelectedImage: function loadSelectedImage(event) { + this.file = event.target.files[0]; + this.showCropperModal(); + }, + + /** + * Open unsplash modal. + */ + openUnsplashModal: function openUnsplashModal() { + var _this3 = this; + + this.unsplashSearchTerm = 'sunny'; + this.unsplashModalShown = true; + this.$nextTick(function () { + _this3.$refs.unsplashSearch.focus(); + }); + }, + + /** + * Select an unsplash Image. + */ + closeUnplashModalAndInsertImage: function closeUnplashModalAndInsertImage() { + this.$emit('changed', { + url: this.selectedUnsplashImage.urls.regular, + caption: 'Photo by <a href="' + this.selectedUnsplashImage.user.links.html + '">' + this.selectedUnsplashImage.user.name + '</a> on <a href="https://unsplash.com">Unsplash</a>' + }); + this.closeUnsplashModal(); + }, + + /** + * Close unsplash modal. + */ + closeUnsplashModal: function closeUnsplashModal() { + this.unsplashSearchTerm = ''; + this.unsplashModalShown = false; + this.selectedUnsplashImage = null; + }, + + /** + * Open the cropper modal. + */ + showCropperModal: function showCropperModal() { + this.cropperModalShown = true; + }, + + /** + * Close the cropper modal. + */ + closeCropperModal: function closeCropperModal(_ref) { + var image = _ref.image; + this.cropperModalShown = false; + this.imageUrl = image; + this.$emit('changed', { + url: image, + caption: '' + }); + }, + + /** + * Close and Cancel the cropper modal. + */ + cancelCropperModal: function cancelCropperModal() { + this.cropperModalShown = false; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MarkdownEditor.vue?vue&type=script&lang=js&": +/*!*************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MarkdownEditor.vue?vue&type=script&lang=js& ***! + \*************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: { + value: { + type: String, + default: '' + } + }, + data: function data() { + return { + content: '' + }; + }, + watch: { + content: function content(val) { + this.$emit('input', val); + } + }, + mounted: function mounted() { + this.content = this.value; + this.$nextTick(function () { + var textarea = document.getElementById("markdown-editor"); + var heightLimit = 2000; + textarea.style.height = Math.min(textarea.scrollHeight, heightLimit) + "px"; + + if (textarea) { + textarea.style.height = Math.min(textarea.scrollHeight, heightLimit) + "px"; + + textarea.oninput = function () { + textarea.style.height = ""; + textarea.style.height = Math.min(textarea.scrollHeight, heightLimit) + "px"; + }; + } + }); + }, + methods: {} +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=script&lang=js&": +/*!*********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MiniEditor.vue?vue&type=script&lang=js& ***! + \*********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! quill */ "./node_modules/quill/dist/quill.js"); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(quill__WEBPACK_IMPORTED_MODULE_1__); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + components: {}, + props: { + value: { + type: String, + default: '' + } + }, + data: function data() { + return { + editor: null, + editorBody: this.body + }; + }, + mounted: function mounted() { + this.editor = this.createEditor(); + this.handleEditorValue(); + }, + + /** + * Clean after the component is destroyed. + */ + destroyed: function destroyed() {}, + methods: { + /** + * Create an instance of the editor. + */ + createEditor: function createEditor() { + return new quill__WEBPACK_IMPORTED_MODULE_1___default.a(this.$refs.editor, { + modules: { + syntax: true, + toolbar: [['bold', 'italic', 'underline', 'strike', 'link']] + }, + theme: 'bubble', + scrollingContainer: 'html, body' + }); + }, + + /** + * Handle the editor value. + */ + handleEditorValue: function handleEditorValue() { + var _this = this; + + this.editor.root.innerHTML = this.value || 'Write something...'; + this.editor.on('text-change', function () { + _this.$emit('input', _this.editor.getText() ? _this.editor.root.innerHTML : ''); + }); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Modal.vue?vue&type=script&lang=js&": +/*!****************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Modal.vue?vue&type=script&lang=js& ***! + \****************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + data: function data() { + return {}; + }, + created: function created() { + document.addEventListener('keydown', this.handleEscape); + document.body.classList.add('overflow-hidden'); + }, + destroyed: function destroyed() { + document.removeEventListener('keydown', this.handleEscape); + document.body.classList.remove('overflow-hidden'); + }, + methods: { + handleEscape: function handleEscape(e) { + e.stopPropagation(); + + if (e.keyCode == 27) { + this.close(); + } + }, + + /** + * Close the modal. + */ + close: function close() { + this.$emit('close'); + }, + + /** + * Handle a click on the modal. + */ + handleClicks: function handleClicks(e) { + if (e.target.classList.contains('modal-mask')) { + this.close(); + } + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MultiSelect.vue?vue&type=script&lang=js&": +/*!**********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MultiSelect.vue?vue&type=script&lang=js& ***! + \**********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['value', 'options', 'optionId', 'optionText'], + data: function data() { + return { + searchTerm: '', + selectedOptionIndex: 0, + focused: false, + newOptions: [] + }; + }, + mounted: function mounted() { + this.$refs.input.style.width = this.value.length ? '25px' : '108px'; + this.$refs.input.placeholder = this.value.length ? '' : 'Add tags'; + }, + watch: { + value: function value(val) { + this.$refs.input.style.width = this.value.length ? '25px' : '108px'; + this.$refs.input.placeholder = this.value.length ? '' : 'Add tags'; + }, + searchTerm: function searchTerm(val) { + var width = val.length * 12; + this.$refs.input.style.width = width > 25 ? width + 'px' : '25px'; + }, + matches: function matches(val) { + var _this = this; + + this.selectedOptionIndex = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.find(val, function (option) { + return option[_this.optionId] == 'addNew'; + }) ? 1 : 0; + } + }, + computed: { + matches: function matches() { + var _this2 = this; + + var options = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.union(this.options, this.newOptions); + + if (!this.searchTerm) { + return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.reject(options, function (option) { + return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.find(_this2.value, { + id: option.id + }); + }); + } else { + var matches = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.reject(options, function (option) { + return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.find(_this2.value, { + id: option.id + }) || option[_this2.optionText].toLowerCase().indexOf(_this2.searchTerm.toLowerCase()) == -1; + }); + + var addNewOption = {}; + addNewOption[this.optionText] = 'Add new'; + addNewOption[this.optionId] = 'addNew'; + matches.unshift(addNewOption); + return matches; + } + } + }, + methods: { + /** + * Select the given option. + */ + selectOption: function selectOption(option) { + var values = this.value || []; + if (lodash__WEBPACK_IMPORTED_MODULE_0___default.a.includes(values, option.id)) return; + + if (option[this.optionId] == 'addNew') { + return this.addNewOption(); + } + + this.searchTerm = ''; + values.push(option); + this.$emit('input', values); + }, + + /** + * Remove the given option. + */ + removeOption: function removeOption(option) { + var values = this.value || []; + values = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.reject(values, { + id: option.id + }); + this.$emit('input', values); + }, + + /** + * Backspace was hit. + */ + backspaceAction: function backspaceAction() { + if (this.searchTerm) return; + var values = this.value || []; + values.pop(); + this.$emit('input', values); + this.selectedOptionIndex = 0; + }, + + /** + * Select the next option. + */ + selectNextOption: function selectNextOption() { + if (!this.matches.length) return; + if (this.selectedOptionIndex + 1 == this.matches.length) return; + this.selectedOptionIndex = this.selectedOptionIndex + 1; + }, + + /** + * Select the previous option. + */ + selectPreviousOption: function selectPreviousOption() { + if (!this.matches.length) return; + if (this.selectedOptionIndex === 0) return; + this.selectedOptionIndex = this.selectedOptionIndex - 1; + }, + + /** + * Add the selected option to the list. + */ + addSelectedOption: function addSelectedOption() { + if (!this.matches[this.selectedOptionIndex]) { + return this.addNewOption(); + } + + this.selectOption(this.matches[this.selectedOptionIndex]); + this.selectedOptionIndex = 0; + }, + + /** + * Add a brand new option. + */ + addNewOption: function addNewOption() { + var _this3 = this; + + var values = this.value || []; + var option = {}; + + var existingOption = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.find(lodash__WEBPACK_IMPORTED_MODULE_0___default.a.union(this.options, this.newOptions), function (option) { + return option.name.toLowerCase() == _this3.searchTerm.toLowerCase(); + }); + + if (existingOption) { + this.searchTerm = ''; + return; + } + + option[this.optionText] = this.searchTerm; + option[this.optionId] = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.uniqueId(); + values.push(option); + this.newOptions.push(option); + this.searchTerm = ''; + this.$emit('input', values); + }, + + /** + * Activate the field. + */ + activate: function activate() { + this.focused = true; + this.$refs.input.focus(); + }, + + /** + * Deactivate the field. + */ + deactivate: function deactivate() { + this.focused = false; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=script&lang=js&": +/*!***********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Notification.vue?vue&type=script&lang=js& ***! + \***********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['type', 'message', 'autoClose'], + data: function data() { + return { + timeout: null + }; + }, + mounted: function mounted() { + var _this = this; + + this.timeout = setTimeout(function () { + _this.close(); + }, this.autoClose); + }, + methods: { + /** + * Close the notification. + */ + close: function close() { + clearTimeout(this.timeout); + this.$root.notification.type = null; + this.$root.notification.autoClose = false; + this.$root.notification.message = ''; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/PageHeader.vue?vue&type=script&lang=js&": +/*!*********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/PageHeader.vue?vue&type=script&lang=js& ***! + \*********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + computed: { + hideLogoOnSmallScreens: function hideLogoOnSmallScreens() { + return this.$slots['left-side']; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/SEOModal.vue?vue&type=script&lang=js&": +/*!*******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/SEOModal.vue?vue&type=script&lang=js& ***! + \*******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['input'], + data: function data() { + return { + facebookImageUploading: false, + twitterImageUploading: false, + form: { + meta_description: '', + opengraph_title: '', + opengraph_description: '', + opengraph_image: '', + opengraph_image_width: '', + opengraph_image_height: '', + twitter_title: '', + twitter_description: '', + twitter_image: '' + } + }; + }, + mounted: function mounted() { + this.form = this.input; + }, + methods: { + close: function close() { + this.$emit('close', { + content: this.form + }); + }, + + /** + * Update the selected opengraph image. + */ + updateFacebookImage: function updateFacebookImage(_ref) { + var _this = this; + + var url = _ref.url; + var img = new Image(); + this.form.opengraph_image = url; + img.src = url; + + img.onload = function (e) { + _this.form.opengraph_image_height = e.target.height; + _this.form.opengraph_image_width = e.target.width; + }; + + this.facebookImageUploading = false; + }, + + /** + * Update the selected twitter image. + */ + updateTwitterImage: function updateTwitterImage(_ref2) { + var url = _ref2.url; + this.form.twitter_image = url; + this.twitterImageUploading = false; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=script&lang=js&": +/*!****************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=script&lang=js& ***! + \****************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['postId'], + data: function data() { + return { + existingBlot: null, + content: '', + modalShown: false + }; + }, + mounted: function mounted() { + var _this = this; + + this.$parent.$on('openingHTMLEmbedder', function (data) { + if (data) { + _this.content = data.content; + _this.existingBlot = data.existingBlot; + } + + _this.modalShown = true; + + _this.$nextTick(function () { + return _this.$refs.content.focus(); + }); + }); + }, + methods: { + close: function close() { + this.modalShown = false; + this.content = ''; + this.existingBlot = null; + }, + applyHTML: function applyHTML() { + this.$emit('adding', { + content: this.content, + existingBlot: this.existingBlot + }); + this.close(); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=script&lang=js&": +/*!*****************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=script&lang=js& ***! + \*****************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['postId'], + data: function data() { + return { + existingBlot: null, + imageUrl: null, + layout: 'default', + caption: '', + imagePickerKey: '', + uploadProgress: 0, + uploading: false, + modalShown: false + }; + }, + mounted: function mounted() { + var _this = this; + + this.layouts = [{ + id: 'test', + name: 'Test' + }]; + this.$parent.$on('openingImageUploader', function (data) { + if (data) { + _this.caption = data.caption; + _this.imageUrl = data.url; + _this.layout = data.layout || 'default'; + _this.existingBlot = data.existingBlot; + } + + _this.modalShown = true; + }); + }, + methods: { + close: function close() { + this.modalShown = false; + this.imagePickerKey = _.uniqueId(); + this.existingBlot = null; + this.imageUrl = null; + this.layout = 'default'; + this.caption = ''; + }, + updateImage: function updateImage(_ref) { + var url = _ref.url, + caption = _ref.caption; + this.imageUrl = url; + this.caption = caption; + this.uploading = false; + }, + applyImage: function applyImage() { + if (!this.imageUrl) { + return this.alertError('Please select an image.'); + } + + this.$emit('updated', { + url: this.imageUrl, + caption: this.caption, + existingBlot: this.existingBlot, + layout: this.layout + }); + this.close(); + }, + updateProgress: function updateProgress(_ref2) { + var progress = _ref2.progress; + this.uploadProgress = progress; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/FilterDropdown.vue?vue&type=script&lang=js&": +/*!***********************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/partials/FilterDropdown.vue?vue&type=script&lang=js& ***! + \***********************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['isFiltered'] +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/Preloader.vue?vue&type=script&lang=js&": +/*!******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/partials/Preloader.vue?vue&type=script&lang=js& ***! + \******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/404.vue?vue&type=script&lang=js&": +/*!***********************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/404.vue?vue&type=script&lang=js& ***! + \***********************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ({ + /** + * The component's data. + */ + data: function data() { + return {}; + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + document.title = "404 — Wink."; + }, + methods: {} +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=script&lang=js&": +/*!******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/pages/edit.vue?vue&type=script&lang=js& ***! + \******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _components_SEOModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../components/SEOModal */ "./resources/js/components/SEOModal.vue"); + +/* harmony default export */ __webpack_exports__["default"] = ({ + components: { + 'seo-modal': _components_SEOModal__WEBPACK_IMPORTED_MODULE_0__["default"] + }, + data: function data() { + return { + ready: false, + entry: null, + status: '', + id: this.$route.params.id || 'new', + saveKeyboardShortcut: null, + errors: [], + settingsModalShown: false, + seoModalShown: false, + form: { + errors: [], + id: '', + title: 'Page Title', + slug: '', + body: '', + meta: { + meta_description: '', + opengraph_title: '', + opengraph_description: '', + opengraph_image: '', + opengraph_image_width: '', + opengraph_image_height: '', + twitter_title: '', + twitter_description: '', + twitter_image: '' + } + } + }; + }, + watch: { + 'form.slug': function formSlug(val) { + var _this = this; + + this.debouncer(function () { + _this.form.slug = _this.slugify(val); + }); + }, + 'form.title': function formTitle(val) { + var _this2 = this; + + this.debouncer(function () { + if (_this2.form.slug) return; + _this2.form.slug = _this2.slugify(val); + }); + }, + '$route.params.id': function $routeParamsId() { + this.id = this.$route.params.id; + } + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + var _this3 = this; + + document.title = "Edit Page — Wink."; + this.http().get('/api/pages/' + this.id).then(function (response) { + _this3.entry = _.cloneDeep(response.data.entry); + + _this3.fillForm(response.data.entry); + + _this3.registerSaveKeyboardShortcut(); + + _this3.ready = true; + }).catch(function (error) { + _this3.ready = true; + }); + }, + + /** + * Clean after the component is destroyed. + */ + destroyed: function destroyed() { + document.removeEventListener('keydown', this.saveKeyboardShortcut); + }, + methods: { + registerSaveKeyboardShortcut: function registerSaveKeyboardShortcut() { + var _this4 = this; + + this.saveKeyboardShortcut = function (event) { + if ((event.ctrlKey || event.metaKey) && event.which == 83) { + event.preventDefault(); + + _this4.save(); + } + }; + + document.addEventListener('keydown', this.saveKeyboardShortcut); + }, + fillForm: function fillForm(data) { + var _this5 = this; + + this.form.id = data.id; + + if (this.id != 'new') { + this.form.title = data.title; + this.form.slug = data.slug; + this.form.body = data.body; + this.form.meta = { + meta_description: data.meta.meta_description || '', + opengraph_title: data.meta.opengraph_title || '', + opengraph_description: data.meta.opengraph_description || '', + opengraph_image: data.meta.opengraph_image || '', + opengraph_image_width: data.meta.opengraph_image_width || '', + opengraph_image_height: data.meta.opengraph_image_height || '', + twitter_title: data.meta.twitter_title || '', + twitter_description: data.meta.twitter_description || '', + twitter_image: data.meta.twitter_image || '' + }; + } + + setTimeout(function () { + _this5.$watch('form', _.debounce(function () { + return _this5.save(); + }, 1000), { + deep: true + }); + }, 1000); + }, + + /** + * Open the settings modal. + */ + settingsModal: function settingsModal() { + this.settingsModalShown = true; + }, + + /** + * Close the settings modal. + */ + closeSettingsModal: function closeSettingsModal() { + this.settingsModalShown = false; + }, + + /** + * Open the SEO & Social modal. + */ + seoModal: function seoModal() { + this.seoModalShown = true; + }, + + /** + * Close the SEO modal. + */ + closeSeoModal: function closeSeoModal(_ref) { + var content = _ref.content; + this.seoModalShown = false; + this.form.meta = content; + }, + + /** + * Delete the page. + */ + deletePage: function deletePage() { + var _this6 = this; + + this.alertConfirm("Are you sure you want to delete this page?", function () { + _this6.settingsModalShown = false; + + _this6.http().delete('/api/pages/' + _this6.id, _this6.form).then(function (response) { + _this6.$router.push({ + name: 'pages' + }); + }); + }); + }, + + /** + * Save the page. + */ + save: function save() { + var _this7 = this; + + this.errors = []; + this.status = 'Saving...'; + this.http().post('/api/pages/' + this.id, this.form).then(function (response) { + _this7.status = ''; + + if (_this7.id == 'new') { + _this7.$router.push({ + name: 'page-edit', + params: { + id: _this7.form.id + } + }); + } + }).catch(function (error) { + _this7.errors = error.response.data.errors; + _this7.settingsModalShown = true; + _this7.form.working = false; + }); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/index.vue?vue&type=script&lang=js&": +/*!*******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/pages/index.vue?vue&type=script&lang=js& ***! + \*******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loadsEntries */ "./resources/js/screens/loadsEntries.js"); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_loadsEntries__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../partials/FilterDropdown.vue */ "./resources/js/partials/FilterDropdown.vue"); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + mixins: [_loadsEntries__WEBPACK_IMPORTED_MODULE_0___default.a], + components: { + 'filters': _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__["default"] + }, + + /** + * The component's data. + */ + data: function data() { + return { + baseURL: '/api/pages', + entries: [], + hasMoreEntries: false, + nextPageUrl: null, + loadingMoreEntries: false, + ready: false, + searchQuery: '' + }; + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + document.title = "Pages — Wink."; + this.loadEntries(); + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=script&lang=js&": +/*!***********************************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=script&lang=js& ***! + \***********************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); + +/* harmony default export */ __webpack_exports__["default"] = ({ + props: ['postId', 'currentImageUrl', 'currentCaption'], + data: function data() { + return { + imageUrl: '', + caption: '', + imagePickerKey: '', + uploadProgress: 0, + uploading: false, + modalShown: false + }; + }, + mounted: function mounted() { + var _this = this; + + this.$parent.$on('openingFeaturedImageUploader', function (data) { + _this.imageUrl = _this.currentImageUrl; + _this.caption = _this.currentCaption; + _this.modalShown = true; + }); + }, + methods: { + /** + * Save the image. + */ + saveImage: function saveImage() { + this.$emit('changed', { + url: this.imageUrl, + caption: this.caption + }); + this.close(); + }, + + /** + * Close the modal. + */ + close: function close() { + this.imagePickerKey = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.uniqueId(); + this.modalShown = false; + }, + + /** + * Update the selected image. + */ + updateImage: function updateImage(_ref) { + var url = _ref.url, + caption = _ref.caption; + this.imageUrl = url; + this.caption = caption; + this.uploading = false; + }, + + /** + * Update the upload progress. + */ + updateProgress: function updateProgress(_ref2) { + var progress = _ref2.progress; + this.uploadProgress = progress; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=script&lang=js&": +/*!******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/edit.vue?vue&type=script&lang=js& ***! + \******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _FeaturedImageUploader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FeaturedImageUploader */ "./resources/js/screens/posts/FeaturedImageUploader.vue"); +/* harmony import */ var _components_SEOModal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../components/SEOModal */ "./resources/js/components/SEOModal.vue"); +/* harmony import */ var _components_MarkdownEditor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../components/MarkdownEditor */ "./resources/js/components/MarkdownEditor.vue"); + + + +/* harmony default export */ __webpack_exports__["default"] = ({ + components: { + MarkdownEditor: _components_MarkdownEditor__WEBPACK_IMPORTED_MODULE_2__["default"], + 'featured-image-uploader': _FeaturedImageUploader__WEBPACK_IMPORTED_MODULE_0__["default"], + 'seo-modal': _components_SEOModal__WEBPACK_IMPORTED_MODULE_1__["default"] + }, + data: function data() { + return { + ready: false, + entry: null, + currentTab: 'post', + tags: [], + authors: [], + status: '', + saveKeyboardShortcut: null, + settingsModalShown: false, + publishingModalShown: false, + seoModalShown: false, + id: this.$route.params.id || 'new', + errors: [], + postBodyWatcher: null, + form: { + id: '', + title: 'Draft', + slug: '', + excerpt: '', + tags: [], + author_id: '', + featured_image: '', + featured_image_caption: '', + body: '', + published: false, + markdown: null, + publish_date: '', + meta: { + meta_description: '', + opengraph_title: '', + opengraph_description: '', + opengraph_image: '', + opengraph_image_width: '', + opengraph_image_height: '', + twitter_title: '', + twitter_description: '', + twitter_image: '' + } + } + }; + }, + watch: { + 'form.slug': function formSlug(val) { + var _this = this; + + this.debouncer(function () { + _this.form.slug = _this.slugify(val); + }); + }, + 'form.featured_image': function formFeatured_image() { + this.save(); + }, + 'form.published': function formPublished(val) { + if (this.postBodyWatcher) { + this.postBodyWatcher(); + } + + if (!val) { + this.watchBodyChangesAndSave(); + } + }, + '$route.params.id': function $routeParamsId() { + this.id = this.$route.params.id; + } + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + var _this2 = this; + + document.title = "Edit Post — Wink."; + this.loadResources(); + this.http().get('/api/posts/' + this.id).then(function (response) { + _this2.entry = _.cloneDeep(response.data.entry); + + _this2.fillForm(response.data.entry); + + _this2.ready = true; + + _this2.registerSaveKeyboardShortcut(); + }).catch(function (error) { + _this2.ready = true; + }); + }, + computed: { + postPreviewLink: function postPreviewLink() { + return this.Wink.preview_path.replace('{postSlug}', this.form.slug); + } + }, + + /** + * Clean after the component is destroyed. + */ + destroyed: function destroyed() { + document.removeEventListener('keydown', this.saveKeyboardShortcut); + }, + methods: { + registerSaveKeyboardShortcut: function registerSaveKeyboardShortcut() { + var _this3 = this; + + this.saveKeyboardShortcut = function (event) { + if ((event.ctrlKey || event.metaKey) && event.which == 83) { + event.preventDefault(); + + _this3.save(); + } + }; + + document.addEventListener('keydown', this.saveKeyboardShortcut); + }, + + /** + * Fill the form. + */ + fillForm: function fillForm(data) { + this.form.id = data.id; + this.form.publish_date = data.publish_date; + this.form.slug = 'draft-' + this.form.id; + + if (this.id != 'new') { + this.form.title = data.title; + this.form.slug = data.slug; + this.form.excerpt = data.excerpt; + this.form.body = data.body; + this.form.published = data.published; + this.form.markdown = data.markdown; + this.form.tags = data.tags || ''; + this.form.author_id = data.author_id || ''; + this.form.featured_image = data.featured_image; + this.form.featured_image_caption = data.featured_image_caption; + this.form.meta = { + meta_description: data.meta.meta_description || '', + opengraph_title: data.meta.opengraph_title || '', + opengraph_description: data.meta.opengraph_description || '', + opengraph_image: data.meta.opengraph_image || '', + opengraph_image_width: data.meta.opengraph_image_width || '', + opengraph_image_height: data.meta.opengraph_image_height || '', + twitter_title: data.meta.twitter_title || '', + twitter_description: data.meta.twitter_description || '', + twitter_image: data.meta.twitter_image || '' + }; + } + + if (!this.form.published) { + this.watchBodyChangesAndSave(); + } + }, + + /** + * Watch changes and save the post. + */ + watchBodyChangesAndSave: function watchBodyChangesAndSave() { + var _this4 = this; + + setTimeout(function () { + _this4.postBodyWatcher = _this4.$watch('form.body', _.debounce(function () { + return _this4.save(); + }, 1000), { + deep: true + }); + }, 1000); + }, + + /** + * Load the resources needed for the screen. + */ + loadResources: function loadResources() { + var _this5 = this; + + this.http().get('/api/tags').then(function (response) { + _this5.tags = response.data.data; + }); + this.http().get('/api/team').then(function (response) { + _this5.authors = response.data.data; + + if (!_this5.form.author_id && _this5.authors) { + _this5.form.author_id = _this5.Wink.author.id; + } + }); + }, + + /** + * Listen to changes in the post body. + */ + updatePostBody: function updatePostBody(data) { + this.form.body = data.body; + }, + + /** + * Update the post title. + */ + updateTitle: function updateTitle(val) { + this.form.title = val; + }, + + /** + * Open the settings modal. + */ + settingsModal: function settingsModal() { + this.settingsModalShown = true; + }, + + /** + * Close the Settings modal. + */ + closeSettingsModal: function closeSettingsModal() { + this.settingsModalShown = false; + this.save(); + }, + + /** + * Open the SEO & Social modal. + */ + seoModal: function seoModal() { + this.seoModalShown = true; + }, + + /** + * Open the publishing modal. + */ + publishingModal: function publishingModal() { + this.publishingModalShown = true; + }, + + /** + * Open the featured image modal. + */ + featuredImageModal: function featuredImageModal() { + this.$emit('openingFeaturedImageUploader'); + }, + + /** + * Handle the change event of featured images. + */ + featuredImageChanged: function featuredImageChanged(_ref) { + var url = _ref.url, + caption = _ref.caption; + this.form.featured_image = url; + this.form.featured_image_caption = caption; + }, + + /** + * Close the SEO modal. + */ + closeSeoModal: function closeSeoModal(_ref2) { + var content = _ref2.content; + this.seoModalShown = false; + this.form.meta = content; + this.save(); + }, + + /** + * Delete the post. + */ + deletePost: function deletePost() { + var _this6 = this; + + this.alertConfirm("Are you sure you want to delete this post?", function () { + _this6.settingsModalShown = false; + + _this6.http().delete('/api/posts/' + _this6.id, _this6.form).then(function (response) { + _this6.$router.push({ + name: 'posts' + }); + }); + }); + }, + + /** + * Publish the post. + */ + publishPost: function publishPost() { + this.form.published = true; + this.save(); + this.publishingModalShown = false; + this.notifySuccess('Post Published!', 2000); + }, + + /** + * Un-publish the post. + */ + unpublishPost: function unpublishPost() { + this.form.published = false; + this.save(); + this.publishingModalShown = false; + this.notifySuccess('Post was converted to a draft!', 2000); + }, + + /** + * Save the post. + */ + save: function save() { + var _this7 = this; + + if (this.status) return; + this.errors = []; + this.status = 'Saving...'; + + if (this.form.title != 'Draft' && (!this.form.slug || this.form.slug.startsWith('draft-'))) { + this.form.slug = this.slugify(this.form.title); + } + + this.http().post('/api/posts/' + this.id, this.form).then(function (response) { + _this7.status = ''; // Refresh to updated tags + + _this7.form.tags = response.data.entry.tags; + + if (_this7.id == 'new') { + _this7.$router.push({ + name: 'post-edit', + params: { + id: _this7.form.id + } + }); + } + }).catch(function (error) { + _this7.status = ''; + _this7.errors = error.response.data.errors; + _this7.settingsModalShown = true; + }); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/index.vue?vue&type=script&lang=js&": +/*!*******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/index.vue?vue&type=script&lang=js& ***! + \*******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loadsEntries */ "./resources/js/screens/loadsEntries.js"); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_loadsEntries__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../partials/FilterDropdown.vue */ "./resources/js/partials/FilterDropdown.vue"); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + mixins: [_loadsEntries__WEBPACK_IMPORTED_MODULE_0___default.a], + components: { + 'filters': _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__["default"] + }, + + /** + * The component's data. + */ + data: function data() { + return { + baseURL: '/api/posts', + tags: [], + authors: [], + entries: [], + hasMoreEntries: false, + nextPageUrl: null, + loadingMoreEntries: false, + ready: false, + searchQuery: '', + filters: { + status: '', + author_id: '', + tag_id: '' + } + }; + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + document.title = "Posts — Wink."; + this.loadEntries(); + this.loadResources(); + this.watchFiltersChanges(); + }, + methods: { + /** + * Load the resources needed for the screen. + */ + loadResources: function loadResources() { + var _this = this; + + this.http().get('/api/tags').then(function (response) { + _this.tags = response.data.data; + }); + this.http().get('/api/team').then(function (response) { + _this.authors = response.data.data; + }); + }, + + /** + * Format the given tags for display. + */ + formatTags: function formatTags(tags) { + return _.chain(tags).map('name').join(', ').value(); + }, + + /** + * Clear the filters. + */ + clearFilters: function clearFilters() { + var _this2 = this; + + this.searchQuery = ''; + Object.keys(this.filters).forEach(function (filter) { + return _this2.filters[filter] = ''; + }); + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/edit.vue?vue&type=script&lang=js&": +/*!*****************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/tags/edit.vue?vue&type=script&lang=js& ***! + \*****************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _components_SEOModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../components/SEOModal */ "./resources/js/components/SEOModal.vue"); + +/* harmony default export */ __webpack_exports__["default"] = ({ + components: { + 'seo-modal': _components_SEOModal__WEBPACK_IMPORTED_MODULE_0__["default"] + }, + data: function data() { + return { + entry: null, + ready: false, + id: this.$route.params.id || 'new', + seoModalShown: false, + form: { + errors: [], + working: false, + id: '', + name: '', + slug: '', + meta: { + meta_description: '', + opengraph_title: '', + opengraph_description: '', + opengraph_image: '', + opengraph_image_width: '', + opengraph_image_height: '', + twitter_title: '', + twitter_description: '', + twitter_image: '' + } + } + }; + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + var _this = this; + + document.title = "Tag — Wink."; + this.http().get('/api/tags/' + this.id).then(function (response) { + _this.entry = response.data.entry; + _this.form.id = response.data.entry.id; + + if (_this.id != 'new') { + _this.form.name = response.data.entry.name; + _this.form.slug = response.data.entry.slug; + _this.form.meta = { + meta_description: response.data.entry.meta.meta_description || '', + opengraph_title: response.data.entry.meta.opengraph_title || '', + opengraph_description: response.data.entry.meta.opengraph_description || '', + opengraph_image: response.data.entry.meta.opengraph_image || '', + opengraph_image_width: response.data.entry.meta.opengraph_image_width || '', + opengraph_image_height: response.data.entry.meta.opengraph_image_height || '', + twitter_title: response.data.entry.meta.twitter_title || '', + twitter_description: response.data.entry.meta.twitter_description || '', + twitter_image: response.data.entry.meta.twitter_image || '' + }; + } + + _this.ready = true; + }).catch(function (error) { + _this.ready = true; + }); + }, + watch: { + 'form.slug': function formSlug(val) { + var _this2 = this; + + this.debouncer(function () { + _this2.form.slug = _this2.slugify(val); + }); + }, + 'form.name': function formName(val) { + var _this3 = this; + + this.debouncer(function () { + if (_this3.form.slug) return; + _this3.form.slug = _this3.slugify(val); + }); + } + }, + methods: { + /** + * Delete the tag. + */ + deleteTag: function deleteTag() { + var _this4 = this; + + this.alertConfirm("Are you sure you want to delete this tag?", function () { + _this4.http().delete('/api/tags/' + _this4.id, _this4.form).then(function (response) { + _this4.$router.push({ + name: 'tags' + }); + }); + }); + }, + + /** + * Save the tag. + */ + save: function save() { + var _this5 = this; + + this.form.working = true; + this.form.errors = []; + this.http().post('/api/tags/' + this.id, this.form).then(function (response) { + _this5.form.working = false; + + _this5.notifySuccess('Saved!', 2000); + }).catch(function (error) { + _this5.form.errors = error.response.data.errors; + _this5.form.working = false; + }); + }, + + /** + * Open the SEO & Social modal. + */ + seoModal: function seoModal() { + this.seoModalShown = true; + }, + + /** + * Close the SEO modal. + */ + closeSeoModal: function closeSeoModal(_ref) { + var content = _ref.content; + this.seoModalShown = false; + this.form.meta = content; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/index.vue?vue&type=script&lang=js&": +/*!******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/tags/index.vue?vue&type=script&lang=js& ***! + \******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loadsEntries */ "./resources/js/screens/loadsEntries.js"); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_loadsEntries__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../partials/FilterDropdown.vue */ "./resources/js/partials/FilterDropdown.vue"); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + mixins: [_loadsEntries__WEBPACK_IMPORTED_MODULE_0___default.a], + components: { + 'filters': _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__["default"] + }, + + /** + * The component's data. + */ + data: function data() { + return { + baseURL: '/api/tags', + entries: [], + hasMoreEntries: false, + nextPageUrl: null, + loadingMoreEntries: false, + ready: false, + searchQuery: '' + }; + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + document.title = "Tags — Wink."; + this.loadEntries(); + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/edit.vue?vue&type=script&lang=js&": +/*!*****************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/team/edit.vue?vue&type=script&lang=js& ***! + \*****************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _components_SEOModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../components/SEOModal */ "./resources/js/components/SEOModal.vue"); + +/* harmony default export */ __webpack_exports__["default"] = ({ + components: { + 'seo-modal': _components_SEOModal__WEBPACK_IMPORTED_MODULE_0__["default"] + }, + data: function data() { + return { + file: null, + entry: null, + ready: false, + id: this.$route.params.id || 'new', + uploadProgress: 0, + uploading: false, + seoModalShown: false, + croppieModalShown: false, + theme: 'light', + form: { + errors: [], + working: false, + id: '', + name: '', + slug: '', + email: '', + bio: 'I am who I\'m meant to be, this is me.', + avatar: '', + password: '', + meta: { + meta_description: '', + opengraph_title: '', + opengraph_description: '', + opengraph_image: '', + opengraph_image_width: '', + opengraph_image_height: '', + twitter_title: '', + twitter_description: '', + twitter_image: '', + theme: 'light' + } + } + }; + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + document.title = "Author — Wink."; + this.loadEntry(); + }, + watch: { + 'form.slug': function formSlug(val) { + var _this = this; + + this.debouncer(function () { + _this.form.slug = _this.slugify(val); + }); + }, + 'form.name': function formName(val) { + var _this2 = this; + + this.debouncer(function () { + if (_this2.form.slug) return; + _this2.form.slug = _this2.slugify(val); + }); + }, + '$route': function $route() { + this.id = this.$route.params.id; + this.loadEntry(); + } + }, + methods: { + loadEntry: function loadEntry() { + var _this3 = this; + + this.ready = false; + this.http().get('/api/team/' + this.id).then(function (response) { + _this3.entry = response.data.entry; + _this3.form.id = response.data.entry.id; + + if (_this3.id != 'new') { + _this3.form.name = response.data.entry.name; + _this3.form.slug = response.data.entry.slug; + _this3.form.email = response.data.entry.email; + _this3.form.bio = response.data.entry.bio; + _this3.form.avatar = response.data.entry.avatar; + _this3.form.meta = { + meta_description: response.data.entry.meta.meta_description || '', + opengraph_title: response.data.entry.meta.opengraph_title || '', + opengraph_description: response.data.entry.meta.opengraph_description || '', + opengraph_image: response.data.entry.meta.opengraph_image || '', + opengraph_image_width: response.data.entry.meta.opengraph_image_width || '', + opengraph_image_height: response.data.entry.meta.opengraph_image_height || '', + twitter_title: response.data.entry.meta.twitter_title || '', + twitter_description: response.data.entry.meta.twitter_description || '', + twitter_image: response.data.entry.meta.twitter_image || '', + theme: response.data.entry.meta.theme || 'light' + }; + _this3.theme = response.data.entry.meta.theme || 'light'; + } + + _this3.ready = true; + }).catch(function (error) { + _this3.ready = true; + }); + }, + + /** + * Save the post. + */ + save: function save() { + var _this4 = this; + + this.form.working = true; + this.form.errors = []; + this.http().post('/api/team/' + this.id, this.form).then(function (response) { + _this4.form.working = false; + + _this4.notifySuccess('Saved!', 2000); + + if (_this4.id == 'new') { + _this4.id = _this4.form.id; + + _this4.$router.push({ + name: 'team-edit', + params: { + id: _this4.form.id + } + }); + } + + if (_this4.Wink.author.id == _this4.entry.id && (_this4.theme != _this4.form.meta.theme || _this4.avatar != _this4.form.avatar)) { + location.reload(); + } + }).catch(function (error) { + _this4.form.errors = error.response.data.errors; + _this4.form.working = false; + }); + }, + deleteAuthor: function deleteAuthor() { + var _this5 = this; + + this.alertConfirm("Are you sure you want to delete this author?", function () { + _this5.http().delete('/api/team/' + _this5.id).then(function (response) { + _this5.$router.push({ + name: 'team' + }); + }).catch(function (error) { + _this5.alertError(error.response.data.message); + }); + }); + }, + + /** + * Load the selected image into Croppie. + */ + loadSelectedImage: function loadSelectedImage(event) { + var file = event.target.files[0]; + this.file = file; + this.croppieModal(); + }, + + /** + * Open the SEO & Social modal. + */ + seoModal: function seoModal() { + this.seoModalShown = true; + }, + + /** + * Close the SEO modal. + */ + closeSeoModal: function closeSeoModal(_ref) { + var content = _ref.content; + this.seoModalShown = false; + this.form.meta = content; + }, + + /** + * Open Croppie modal. + */ + croppieModal: function croppieModal() { + this.croppieModalShown = true; + }, + + /** + * Close the Croppie modal. + */ + closeCroppieModal: function closeCroppieModal(_ref2) { + var image = _ref2.image; + this.croppieModalShown = false; + this.form.avatar = image; + }, + + /** + * Close and Cancel the Croppie modal. + */ + cancelCroppieModal: function cancelCroppieModal() { + this.croppieModalShown = false; + } + } +}); + +/***/ }), + +/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/index.vue?vue&type=script&lang=js&": +/*!******************************************************************************************************************************************************************!*\ + !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/team/index.vue?vue&type=script&lang=js& ***! + \******************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loadsEntries */ "./resources/js/screens/loadsEntries.js"); +/* harmony import */ var _loadsEntries__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_loadsEntries__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../partials/FilterDropdown.vue */ "./resources/js/partials/FilterDropdown.vue"); + + +/* harmony default export */ __webpack_exports__["default"] = ({ + mixins: [_loadsEntries__WEBPACK_IMPORTED_MODULE_0___default.a], + components: { + 'filters': _partials_FilterDropdown_vue__WEBPACK_IMPORTED_MODULE_1__["default"] + }, + + /** + * The component's data. + */ + data: function data() { + return { + baseURL: '/api/team', + entries: [], + hasMoreEntries: false, + nextPageUrl: null, + loadingMoreEntries: false, + ready: false, + searchQuery: '' + }; + }, + + /** + * Prepare the component. + */ + mounted: function mounted() { + document.title = "Team — Wink."; + this.loadEntries(); + } +}); + +/***/ }), + +/***/ "./node_modules/base64-js/index.js": +/*!*****************************************!*\ + !*** ./node_modules/base64-js/index.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function getLens (b64) { + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + for (var i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk( + uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) + )) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} + + +/***/ }), + +/***/ "./node_modules/buffer/index.js": +/*!**************************************!*\ + !*** ./node_modules/buffer/index.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> + * @license MIT + */ +/* eslint-disable no-proto */ + + + +var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js") +var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js") +var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js") + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() + +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} + +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } + + return that +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } + + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) +} + +Buffer.poolSize = 8192 // not used by this implementation + +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} + +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } + + return fromObject(that, value) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} + +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} + +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) + + var actual = that.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } + + return that +} + +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer + + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } + + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} + +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) + + if (that.length === 0) { + return that + } + + obj.copy(that, 0, 0, len) + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} + +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '<Buffer ' + str + '>' +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/croppie/croppie.css": +/*!******************************************!*\ + !*** ./node_modules/croppie/croppie.css ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../css-loader??ref--7-1!../postcss-loader/src??ref--7-2!./croppie.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/croppie/croppie.css"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/croppie/croppie.js": +/*!*****************************************!*\ + !*** ./node_modules/croppie/croppie.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(setImmediate) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/************************* + * Croppie + * Copyright 2018 + * Foliotek + * Version: 2.6.3 + *************************/ +(function (root, factory) { + if (true) { + // AMD. Register as an anonymous module. + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(typeof self !== 'undefined' ? self : this, function () { + + /* Polyfills */ + if (typeof Promise !== 'function') { + /*! promise-polyfill 3.1.0 */ + !function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void k(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"===typeof a||"function"===typeof a)){var c=a.then;if("function"===typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"===typeof a?a:null,this.onRejected="function"===typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=setTimeout,k="function"===typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"===typeof g||"function"===typeof g)){var h=g.then;if("function"===typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&"object"===typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a}, true&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this); + } + + if ( typeof window.CustomEvent !== "function" ) { + (function(){ + function CustomEvent ( event, params ) { + params = params || { bubbles: false, cancelable: false, detail: undefined }; + var evt = document.createEvent( 'CustomEvent' ); + evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); + return evt; + } + CustomEvent.prototype = window.Event.prototype; + window.CustomEvent = CustomEvent; + }()); + } + + if (!HTMLCanvasElement.prototype.toBlob) { + Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', { + value: function (callback, type, quality) { + var binStr = atob( this.toDataURL(type, quality).split(',')[1] ), + len = binStr.length, + arr = new Uint8Array(len); + + for (var i=0; i<len; i++ ) { + arr[i] = binStr.charCodeAt(i); + } + + callback( new Blob( [arr], {type: type || 'image/png'} ) ); + } + }); + } + /* End Polyfills */ + + var cssPrefixes = ['Webkit', 'Moz', 'ms'], + emptyStyles = document.createElement('div').style, + EXIF_NORM = [1,8,3,6], + EXIF_FLIP = [2,7,4,5], + CSS_TRANS_ORG, + CSS_TRANSFORM, + CSS_USERSELECT; + + function vendorPrefix(prop) { + if (prop in emptyStyles) { + return prop; + } + + var capProp = prop[0].toUpperCase() + prop.slice(1), + i = cssPrefixes.length; + + while (i--) { + prop = cssPrefixes[i] + capProp; + if (prop in emptyStyles) { + return prop; + } + } + } + + CSS_TRANSFORM = vendorPrefix('transform'); + CSS_TRANS_ORG = vendorPrefix('transformOrigin'); + CSS_USERSELECT = vendorPrefix('userSelect'); + + function getExifOffset(ornt, rotate) { + var arr = EXIF_NORM.indexOf(ornt) > -1 ? EXIF_NORM : EXIF_FLIP, + index = arr.indexOf(ornt), + offset = (rotate / 90) % arr.length;// 180 = 2%4 = 2 shift exif by 2 indexes + + return arr[(arr.length + index + (offset % arr.length)) % arr.length]; + } + + // Credits to : Andrew Dupont - http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/ + function deepExtend(destination, source) { + destination = destination || {}; + for (var property in source) { + if (source[property] && source[property].constructor && source[property].constructor === Object) { + destination[property] = destination[property] || {}; + deepExtend(destination[property], source[property]); + } else { + destination[property] = source[property]; + } + } + return destination; + } + + function clone(object) { + return deepExtend({}, object); + } + + function debounce(func, wait, immediate) { + var timeout; + return function () { + var context = this, args = arguments; + var later = function () { + timeout = null; + if (!immediate) func.apply(context, args); + }; + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) func.apply(context, args); + }; + } + + function dispatchChange(element) { + if ("createEvent" in document) { + var evt = document.createEvent("HTMLEvents"); + evt.initEvent("change", false, true); + element.dispatchEvent(evt); + } + else { + element.fireEvent("onchange"); + } + } + + //http://jsperf.com/vanilla-css + function css(el, styles, val) { + if (typeof (styles) === 'string') { + var tmp = styles; + styles = {}; + styles[tmp] = val; + } + + for (var prop in styles) { + el.style[prop] = styles[prop]; + } + } + + function addClass(el, c) { + if (el.classList) { + el.classList.add(c); + } + else { + el.className += ' ' + c; + } + } + + function removeClass(el, c) { + if (el.classList) { + el.classList.remove(c); + } + else { + el.className = el.className.replace(c, ''); + } + } + + function setAttributes(el, attrs) { + for (var key in attrs) { + el.setAttribute(key, attrs[key]); + } + } + + function num(v) { + return parseInt(v, 10); + } + + /* Utilities */ + function loadImage(src, doExif) { + var img = new Image(); + img.style.opacity = '0'; + return new Promise(function (resolve, reject) { + function _resolve() { + img.style.opacity = '1'; + setTimeout(function () { + resolve(img); + }, 1); + } + + img.removeAttribute('crossOrigin'); + if (src.match(/^https?:\/\/|^\/\//)) { + img.setAttribute('crossOrigin', 'anonymous'); + } + + img.onload = function () { + if (doExif) { + EXIF.getData(img, function () { + _resolve(); + }); + } + else { + _resolve(); + } + }; + img.onerror = function (ev) { + img.style.opacity = 1; + setTimeout(function () { + reject(ev); + }, 1); + }; + img.src = src; + }); + } + + function naturalImageDimensions(img, ornt) { + var w = img.naturalWidth; + var h = img.naturalHeight; + var orient = ornt || getExifOrientation(img); + if (orient && orient >= 5) { + var x= w; + w = h; + h = x; + } + return { width: w, height: h }; + } + + /* CSS Transform Prototype */ + var TRANSLATE_OPTS = { + 'translate3d': { + suffix: ', 0px' + }, + 'translate': { + suffix: '' + } + }; + var Transform = function (x, y, scale) { + this.x = parseFloat(x); + this.y = parseFloat(y); + this.scale = parseFloat(scale); + }; + + Transform.parse = function (v) { + if (v.style) { + return Transform.parse(v.style[CSS_TRANSFORM]); + } + else if (v.indexOf('matrix') > -1 || v.indexOf('none') > -1) { + return Transform.fromMatrix(v); + } + else { + return Transform.fromString(v); + } + }; + + Transform.fromMatrix = function (v) { + var vals = v.substring(7).split(','); + if (!vals.length || v === 'none') { + vals = [1, 0, 0, 1, 0, 0]; + } + + return new Transform(num(vals[4]), num(vals[5]), parseFloat(vals[0])); + }; + + Transform.fromString = function (v) { + var values = v.split(') '), + translate = values[0].substring(Croppie.globals.translate.length + 1).split(','), + scale = values.length > 1 ? values[1].substring(6) : 1, + x = translate.length > 1 ? translate[0] : 0, + y = translate.length > 1 ? translate[1] : 0; + + return new Transform(x, y, scale); + }; + + Transform.prototype.toString = function () { + var suffix = TRANSLATE_OPTS[Croppie.globals.translate].suffix || ''; + return Croppie.globals.translate + '(' + this.x + 'px, ' + this.y + 'px' + suffix + ') scale(' + this.scale + ')'; + }; + + var TransformOrigin = function (el) { + if (!el || !el.style[CSS_TRANS_ORG]) { + this.x = 0; + this.y = 0; + return; + } + var css = el.style[CSS_TRANS_ORG].split(' '); + this.x = parseFloat(css[0]); + this.y = parseFloat(css[1]); + }; + + TransformOrigin.prototype.toString = function () { + return this.x + 'px ' + this.y + 'px'; + }; + + function getExifOrientation (img) { + return img.exifdata && img.exifdata.Orientation ? num(img.exifdata.Orientation) : 1; + } + + function drawCanvas(canvas, img, orientation) { + var width = img.width, + height = img.height, + ctx = canvas.getContext('2d'); + + canvas.width = img.width; + canvas.height = img.height; + + ctx.save(); + switch (orientation) { + case 2: + ctx.translate(width, 0); + ctx.scale(-1, 1); + break; + + case 3: + ctx.translate(width, height); + ctx.rotate(180*Math.PI/180); + break; + + case 4: + ctx.translate(0, height); + ctx.scale(1, -1); + break; + + case 5: + canvas.width = height; + canvas.height = width; + ctx.rotate(90*Math.PI/180); + ctx.scale(1, -1); + break; + + case 6: + canvas.width = height; + canvas.height = width; + ctx.rotate(90*Math.PI/180); + ctx.translate(0, -height); + break; + + case 7: + canvas.width = height; + canvas.height = width; + ctx.rotate(-90*Math.PI/180); + ctx.translate(-width, height); + ctx.scale(1, -1); + break; + + case 8: + canvas.width = height; + canvas.height = width; + ctx.translate(0, width); + ctx.rotate(-90*Math.PI/180); + break; + } + ctx.drawImage(img, 0,0, width, height); + ctx.restore(); + } + + /* Private Methods */ + function _create() { + var self = this, + contClass = 'croppie-container', + customViewportClass = self.options.viewport.type ? 'cr-vp-' + self.options.viewport.type : null, + boundary, img, viewport, overlay, bw, bh; + + self.options.useCanvas = self.options.enableOrientation || _hasExif.call(self); + // Properties on class + self.data = {}; + self.elements = {}; + + boundary = self.elements.boundary = document.createElement('div'); + viewport = self.elements.viewport = document.createElement('div'); + img = self.elements.img = document.createElement('img'); + overlay = self.elements.overlay = document.createElement('div'); + + if (self.options.useCanvas) { + self.elements.canvas = document.createElement('canvas'); + self.elements.preview = self.elements.canvas; + } + else { + self.elements.preview = img; + } + + addClass(boundary, 'cr-boundary'); + boundary.setAttribute('aria-dropeffect', 'none'); + bw = self.options.boundary.width; + bh = self.options.boundary.height; + css(boundary, { + width: (bw + (isNaN(bw) ? '' : 'px')), + height: (bh + (isNaN(bh) ? '' : 'px')) + }); + + addClass(viewport, 'cr-viewport'); + if (customViewportClass) { + addClass(viewport, customViewportClass); + } + css(viewport, { + width: self.options.viewport.width + 'px', + height: self.options.viewport.height + 'px' + }); + viewport.setAttribute('tabindex', 0); + + addClass(self.elements.preview, 'cr-image'); + setAttributes(self.elements.preview, { 'alt': 'preview', 'aria-grabbed': 'false' }); + addClass(overlay, 'cr-overlay'); + + self.element.appendChild(boundary); + boundary.appendChild(self.elements.preview); + boundary.appendChild(viewport); + boundary.appendChild(overlay); + + addClass(self.element, contClass); + if (self.options.customClass) { + addClass(self.element, self.options.customClass); + } + + _initDraggable.call(this); + + if (self.options.enableZoom) { + _initializeZoom.call(self); + } + + // if (self.options.enableOrientation) { + // _initRotationControls.call(self); + // } + + if (self.options.enableResize) { + _initializeResize.call(self); + } + } + + // function _initRotationControls () { + // var self = this, + // wrap, btnLeft, btnRight, iLeft, iRight; + + // wrap = document.createElement('div'); + // self.elements.orientationBtnLeft = btnLeft = document.createElement('button'); + // self.elements.orientationBtnRight = btnRight = document.createElement('button'); + + // wrap.appendChild(btnLeft); + // wrap.appendChild(btnRight); + + // iLeft = document.createElement('i'); + // iRight = document.createElement('i'); + // btnLeft.appendChild(iLeft); + // btnRight.appendChild(iRight); + + // addClass(wrap, 'cr-rotate-controls'); + // addClass(btnLeft, 'cr-rotate-l'); + // addClass(btnRight, 'cr-rotate-r'); + + // self.elements.boundary.appendChild(wrap); + + // btnLeft.addEventListener('click', function () { + // self.rotate(-90); + // }); + // btnRight.addEventListener('click', function () { + // self.rotate(90); + // }); + // } + + function _hasExif() { + return this.options.enableExif && window.EXIF; + } + + function _initializeResize () { + var self = this; + var wrap = document.createElement('div'); + var isDragging = false; + var direction; + var originalX; + var originalY; + var minSize = 50; + var maxWidth; + var maxHeight; + var vr; + var hr; + + addClass(wrap, 'cr-resizer'); + css(wrap, { + width: this.options.viewport.width + 'px', + height: this.options.viewport.height + 'px' + }); + + if (this.options.resizeControls.height) { + vr = document.createElement('div'); + addClass(vr, 'cr-resizer-vertical'); + wrap.appendChild(vr); + } + + if (this.options.resizeControls.width) { + hr = document.createElement('div'); + addClass(hr, 'cr-resizer-horisontal'); + wrap.appendChild(hr); + } + + function mouseDown(ev) { + if (ev.button !== undefined && ev.button !== 0) return; + + ev.preventDefault(); + if (isDragging) { + return; + } + + var overlayRect = self.elements.overlay.getBoundingClientRect(); + + isDragging = true; + originalX = ev.pageX; + originalY = ev.pageY; + direction = ev.currentTarget.className.indexOf('vertical') !== -1 ? 'v' : 'h'; + maxWidth = overlayRect.width; + maxHeight = overlayRect.height; + + if (ev.touches) { + var touches = ev.touches[0]; + originalX = touches.pageX; + originalY = touches.pageY; + } + + window.addEventListener('mousemove', mouseMove); + window.addEventListener('touchmove', mouseMove); + window.addEventListener('mouseup', mouseUp); + window.addEventListener('touchend', mouseUp); + document.body.style[CSS_USERSELECT] = 'none'; + } + + function mouseMove(ev) { + var pageX = ev.pageX; + var pageY = ev.pageY; + + ev.preventDefault(); + + if (ev.touches) { + var touches = ev.touches[0]; + pageX = touches.pageX; + pageY = touches.pageY; + } + + var deltaX = pageX - originalX; + var deltaY = pageY - originalY; + var newHeight = self.options.viewport.height + deltaY; + var newWidth = self.options.viewport.width + deltaX; + + if (direction === 'v' && newHeight >= minSize && newHeight <= maxHeight) { + css(wrap, { + height: newHeight + 'px' + }); + + self.options.boundary.height += deltaY; + css(self.elements.boundary, { + height: self.options.boundary.height + 'px' + }); + + self.options.viewport.height += deltaY; + css(self.elements.viewport, { + height: self.options.viewport.height + 'px' + }); + } + else if (direction === 'h' && newWidth >= minSize && newWidth <= maxWidth) { + css(wrap, { + width: newWidth + 'px' + }); + + self.options.boundary.width += deltaX; + css(self.elements.boundary, { + width: self.options.boundary.width + 'px' + }); + + self.options.viewport.width += deltaX; + css(self.elements.viewport, { + width: self.options.viewport.width + 'px' + }); + } + + _updateOverlay.call(self); + _updateZoomLimits.call(self); + _updateCenterPoint.call(self); + _triggerUpdate.call(self); + originalY = pageY; + originalX = pageX; + } + + function mouseUp() { + isDragging = false; + window.removeEventListener('mousemove', mouseMove); + window.removeEventListener('touchmove', mouseMove); + window.removeEventListener('mouseup', mouseUp); + window.removeEventListener('touchend', mouseUp); + document.body.style[CSS_USERSELECT] = ''; + } + + if (vr) { + vr.addEventListener('mousedown', mouseDown); + vr.addEventListener('touchstart', mouseDown); + } + + if (hr) { + hr.addEventListener('mousedown', mouseDown); + hr.addEventListener('touchstart', mouseDown); + } + + this.elements.boundary.appendChild(wrap); + } + + function _setZoomerVal(v) { + if (this.options.enableZoom) { + var z = this.elements.zoomer, + val = fix(v, 4); + + z.value = Math.max(parseFloat(z.min), Math.min(parseFloat(z.max), val)).toString(); + } + } + + function _initializeZoom() { + var self = this, + wrap = self.elements.zoomerWrap = document.createElement('div'), + zoomer = self.elements.zoomer = document.createElement('input'); + + addClass(wrap, 'cr-slider-wrap'); + addClass(zoomer, 'cr-slider'); + zoomer.type = 'range'; + zoomer.step = '0.0001'; + zoomer.value = '1'; + zoomer.style.display = self.options.showZoomer ? '' : 'none'; + zoomer.setAttribute('aria-label', 'zoom'); + + self.element.appendChild(wrap); + wrap.appendChild(zoomer); + + self._currentZoom = 1; + + function change() { + _onZoom.call(self, { + value: parseFloat(zoomer.value), + origin: new TransformOrigin(self.elements.preview), + viewportRect: self.elements.viewport.getBoundingClientRect(), + transform: Transform.parse(self.elements.preview) + }); + } + + function scroll(ev) { + var delta, targetZoom; + + if(self.options.mouseWheelZoom === 'ctrl' && ev.ctrlKey !== true){ + return 0; + } else if (ev.wheelDelta) { + delta = ev.wheelDelta / 1200; //wheelDelta min: -120 max: 120 // max x 10 x 2 + } else if (ev.deltaY) { + delta = ev.deltaY / 1060; //deltaY min: -53 max: 53 // max x 10 x 2 + } else if (ev.detail) { + delta = ev.detail / -60; //delta min: -3 max: 3 // max x 10 x 2 + } else { + delta = 0; + } + + targetZoom = self._currentZoom + (delta * self._currentZoom); + + ev.preventDefault(); + _setZoomerVal.call(self, targetZoom); + change.call(self); + } + + self.elements.zoomer.addEventListener('input', change);// this is being fired twice on keypress + self.elements.zoomer.addEventListener('change', change); + + if (self.options.mouseWheelZoom) { + self.elements.boundary.addEventListener('mousewheel', scroll); + self.elements.boundary.addEventListener('DOMMouseScroll', scroll); + } + } + + function _onZoom(ui) { + var self = this, + transform = ui ? ui.transform : Transform.parse(self.elements.preview), + vpRect = ui ? ui.viewportRect : self.elements.viewport.getBoundingClientRect(), + origin = ui ? ui.origin : new TransformOrigin(self.elements.preview); + + function applyCss() { + var transCss = {}; + transCss[CSS_TRANSFORM] = transform.toString(); + transCss[CSS_TRANS_ORG] = origin.toString(); + css(self.elements.preview, transCss); + } + + self._currentZoom = ui ? ui.value : self._currentZoom; + transform.scale = self._currentZoom; + self.elements.zoomer.setAttribute('aria-valuenow', self._currentZoom); + applyCss(); + + if (self.options.enforceBoundary) { + var boundaries = _getVirtualBoundaries.call(self, vpRect), + transBoundaries = boundaries.translate, + oBoundaries = boundaries.origin; + + if (transform.x >= transBoundaries.maxX) { + origin.x = oBoundaries.minX; + transform.x = transBoundaries.maxX; + } + + if (transform.x <= transBoundaries.minX) { + origin.x = oBoundaries.maxX; + transform.x = transBoundaries.minX; + } + + if (transform.y >= transBoundaries.maxY) { + origin.y = oBoundaries.minY; + transform.y = transBoundaries.maxY; + } + + if (transform.y <= transBoundaries.minY) { + origin.y = oBoundaries.maxY; + transform.y = transBoundaries.minY; + } + } + applyCss(); + _debouncedOverlay.call(self); + _triggerUpdate.call(self); + } + + function _getVirtualBoundaries(viewport) { + var self = this, + scale = self._currentZoom, + vpWidth = viewport.width, + vpHeight = viewport.height, + centerFromBoundaryX = self.elements.boundary.clientWidth / 2, + centerFromBoundaryY = self.elements.boundary.clientHeight / 2, + imgRect = self.elements.preview.getBoundingClientRect(), + curImgWidth = imgRect.width, + curImgHeight = imgRect.height, + halfWidth = vpWidth / 2, + halfHeight = vpHeight / 2; + + var maxX = ((halfWidth / scale) - centerFromBoundaryX) * -1; + var minX = maxX - ((curImgWidth * (1 / scale)) - (vpWidth * (1 / scale))); + + var maxY = ((halfHeight / scale) - centerFromBoundaryY) * -1; + var minY = maxY - ((curImgHeight * (1 / scale)) - (vpHeight * (1 / scale))); + + var originMinX = (1 / scale) * halfWidth; + var originMaxX = (curImgWidth * (1 / scale)) - originMinX; + + var originMinY = (1 / scale) * halfHeight; + var originMaxY = (curImgHeight * (1 / scale)) - originMinY; + + return { + translate: { + maxX: maxX, + minX: minX, + maxY: maxY, + minY: minY + }, + origin: { + maxX: originMaxX, + minX: originMinX, + maxY: originMaxY, + minY: originMinY + } + }; + } + + function _updateCenterPoint(rotate) { + var self = this, + scale = self._currentZoom, + data = self.elements.preview.getBoundingClientRect(), + vpData = self.elements.viewport.getBoundingClientRect(), + transform = Transform.parse(self.elements.preview.style[CSS_TRANSFORM]), + pc = new TransformOrigin(self.elements.preview), + top = (vpData.top - data.top) + (vpData.height / 2), + left = (vpData.left - data.left) + (vpData.width / 2), + center = {}, + adj = {}; + + if (rotate) { + var cx = pc.x; + var cy = pc.y; + var tx = transform.x; + var ty = transform.y; + + center.y = cx; + center.x = cy; + transform.y = tx; + transform.x = ty; + } + else { + center.y = top / scale; + center.x = left / scale; + + adj.y = (center.y - pc.y) * (1 - scale); + adj.x = (center.x - pc.x) * (1 - scale); + + transform.x -= adj.x; + transform.y -= adj.y; + } + + var newCss = {}; + newCss[CSS_TRANS_ORG] = center.x + 'px ' + center.y + 'px'; + newCss[CSS_TRANSFORM] = transform.toString(); + css(self.elements.preview, newCss); + } + + function _initDraggable() { + var self = this, + isDragging = false, + originalX, + originalY, + originalDistance, + vpRect, + transform; + + function assignTransformCoordinates(deltaX, deltaY) { + var imgRect = self.elements.preview.getBoundingClientRect(), + top = transform.y + deltaY, + left = transform.x + deltaX; + + if (self.options.enforceBoundary) { + if (vpRect.top > imgRect.top + deltaY && vpRect.bottom < imgRect.bottom + deltaY) { + transform.y = top; + } + + if (vpRect.left > imgRect.left + deltaX && vpRect.right < imgRect.right + deltaX) { + transform.x = left; + } + } + else { + transform.y = top; + transform.x = left; + } + } + + function toggleGrabState(isDragging) { + self.elements.preview.setAttribute('aria-grabbed', isDragging); + self.elements.boundary.setAttribute('aria-dropeffect', isDragging? 'move': 'none'); + } + + function keyDown(ev) { + var LEFT_ARROW = 37, + UP_ARROW = 38, + RIGHT_ARROW = 39, + DOWN_ARROW = 40; + + if (ev.shiftKey && (ev.keyCode === UP_ARROW || ev.keyCode === DOWN_ARROW)) { + var zoom; + if (ev.keyCode === UP_ARROW) { + zoom = parseFloat(self.elements.zoomer.value) + parseFloat(self.elements.zoomer.step) + } + else { + zoom = parseFloat(self.elements.zoomer.value) - parseFloat(self.elements.zoomer.step) + } + self.setZoom(zoom); + } + else if (self.options.enableKeyMovement && (ev.keyCode >= 37 && ev.keyCode <= 40)) { + ev.preventDefault(); + var movement = parseKeyDown(ev.keyCode); + + transform = Transform.parse(self.elements.preview); + document.body.style[CSS_USERSELECT] = 'none'; + vpRect = self.elements.viewport.getBoundingClientRect(); + keyMove(movement); + } + + function parseKeyDown(key) { + switch (key) { + case LEFT_ARROW: + return [1, 0]; + case UP_ARROW: + return [0, 1]; + case RIGHT_ARROW: + return [-1, 0]; + case DOWN_ARROW: + return [0, -1]; + } + } + } + + function keyMove(movement) { + var deltaX = movement[0], + deltaY = movement[1], + newCss = {}; + + assignTransformCoordinates(deltaX, deltaY); + + newCss[CSS_TRANSFORM] = transform.toString(); + css(self.elements.preview, newCss); + _updateOverlay.call(self); + document.body.style[CSS_USERSELECT] = ''; + _updateCenterPoint.call(self); + _triggerUpdate.call(self); + originalDistance = 0; + } + + function mouseDown(ev) { + if (ev.button !== undefined && ev.button !== 0) return; + + ev.preventDefault(); + if (isDragging) return; + isDragging = true; + originalX = ev.pageX; + originalY = ev.pageY; + + if (ev.touches) { + var touches = ev.touches[0]; + originalX = touches.pageX; + originalY = touches.pageY; + } + toggleGrabState(isDragging); + transform = Transform.parse(self.elements.preview); + window.addEventListener('mousemove', mouseMove); + window.addEventListener('touchmove', mouseMove); + window.addEventListener('mouseup', mouseUp); + window.addEventListener('touchend', mouseUp); + document.body.style[CSS_USERSELECT] = 'none'; + vpRect = self.elements.viewport.getBoundingClientRect(); + } + + function mouseMove(ev) { + ev.preventDefault(); + var pageX = ev.pageX, + pageY = ev.pageY; + + if (ev.touches) { + var touches = ev.touches[0]; + pageX = touches.pageX; + pageY = touches.pageY; + } + + var deltaX = pageX - originalX, + deltaY = pageY - originalY, + newCss = {}; + + if (ev.type === 'touchmove') { + if (ev.touches.length > 1) { + var touch1 = ev.touches[0]; + var touch2 = ev.touches[1]; + var dist = Math.sqrt((touch1.pageX - touch2.pageX) * (touch1.pageX - touch2.pageX) + (touch1.pageY - touch2.pageY) * (touch1.pageY - touch2.pageY)); + + if (!originalDistance) { + originalDistance = dist / self._currentZoom; + } + + var scale = dist / originalDistance; + + _setZoomerVal.call(self, scale); + dispatchChange(self.elements.zoomer); + return; + } + } + + assignTransformCoordinates(deltaX, deltaY); + + newCss[CSS_TRANSFORM] = transform.toString(); + css(self.elements.preview, newCss); + _updateOverlay.call(self); + originalY = pageY; + originalX = pageX; + } + + function mouseUp() { + isDragging = false; + toggleGrabState(isDragging); + window.removeEventListener('mousemove', mouseMove); + window.removeEventListener('touchmove', mouseMove); + window.removeEventListener('mouseup', mouseUp); + window.removeEventListener('touchend', mouseUp); + document.body.style[CSS_USERSELECT] = ''; + _updateCenterPoint.call(self); + _triggerUpdate.call(self); + originalDistance = 0; + } + + self.elements.overlay.addEventListener('mousedown', mouseDown); + self.elements.viewport.addEventListener('keydown', keyDown); + self.elements.overlay.addEventListener('touchstart', mouseDown); + } + + function _updateOverlay() { + if (!this.elements) return; // since this is debounced, it can be fired after destroy + var self = this, + boundRect = self.elements.boundary.getBoundingClientRect(), + imgData = self.elements.preview.getBoundingClientRect(); + + css(self.elements.overlay, { + width: imgData.width + 'px', + height: imgData.height + 'px', + top: (imgData.top - boundRect.top) + 'px', + left: (imgData.left - boundRect.left) + 'px' + }); + } + var _debouncedOverlay = debounce(_updateOverlay, 500); + + function _triggerUpdate() { + var self = this, + data = self.get(); + + if (!_isVisible.call(self)) { + return; + } + + self.options.update.call(self, data); + if (self.$ && typeof Prototype === 'undefined') { + self.$(self.element).trigger('update.croppie', data); + } + else { + var ev; + if (window.CustomEvent) { + ev = new CustomEvent('update', { detail: data }); + } else { + ev = document.createEvent('CustomEvent'); + ev.initCustomEvent('update', true, true, data); + } + + self.element.dispatchEvent(ev); + } + } + + function _isVisible() { + return this.elements.preview.offsetHeight > 0 && this.elements.preview.offsetWidth > 0; + } + + function _updatePropertiesFromImage() { + var self = this, + initialZoom = 1, + cssReset = {}, + img = self.elements.preview, + imgData, + transformReset = new Transform(0, 0, initialZoom), + originReset = new TransformOrigin(), + isVisible = _isVisible.call(self); + + if (!isVisible || self.data.bound) {// if the croppie isn't visible or it doesn't need binding + return; + } + + self.data.bound = true; + cssReset[CSS_TRANSFORM] = transformReset.toString(); + cssReset[CSS_TRANS_ORG] = originReset.toString(); + cssReset['opacity'] = 1; + css(img, cssReset); + + imgData = self.elements.preview.getBoundingClientRect(); + + self._originalImageWidth = imgData.width; + self._originalImageHeight = imgData.height; + self.data.orientation = getExifOrientation(self.elements.img); + + if (self.options.enableZoom) { + _updateZoomLimits.call(self, true); + } + else { + self._currentZoom = initialZoom; + } + + transformReset.scale = self._currentZoom; + cssReset[CSS_TRANSFORM] = transformReset.toString(); + css(img, cssReset); + + if (self.data.points.length) { + _bindPoints.call(self, self.data.points); + } + else { + _centerImage.call(self); + } + + _updateCenterPoint.call(self); + _updateOverlay.call(self); + } + + function _updateZoomLimits (initial) { + var self = this, + minZoom = Math.max(self.options.minZoom, 0) || 0, + maxZoom = self.options.maxZoom || 1.5, + initialZoom, + defaultInitialZoom, + zoomer = self.elements.zoomer, + scale = parseFloat(zoomer.value), + boundaryData = self.elements.boundary.getBoundingClientRect(), + imgData = naturalImageDimensions(self.elements.img, self.data.orientation), + vpData = self.elements.viewport.getBoundingClientRect(), + minW, + minH; + if (self.options.enforceBoundary) { + minW = vpData.width / imgData.width; + minH = vpData.height / imgData.height; + minZoom = Math.max(minW, minH); + } + + if (minZoom >= maxZoom) { + maxZoom = minZoom + 1; + } + + zoomer.min = fix(minZoom, 4); + zoomer.max = fix(maxZoom, 4); + + if (!initial && (scale < zoomer.min || scale > zoomer.max)) { + _setZoomerVal.call(self, scale < zoomer.min ? zoomer.min : zoomer.max); + } + else if (initial) { + defaultInitialZoom = Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height)); + initialZoom = self.data.boundZoom !== null ? self.data.boundZoom : defaultInitialZoom; + _setZoomerVal.call(self, initialZoom); + } + + dispatchChange(zoomer); + } + + function _bindPoints(points) { + if (points.length !== 4) { + throw "Croppie - Invalid number of points supplied: " + points; + } + var self = this, + pointsWidth = points[2] - points[0], + // pointsHeight = points[3] - points[1], + vpData = self.elements.viewport.getBoundingClientRect(), + boundRect = self.elements.boundary.getBoundingClientRect(), + vpOffset = { + left: vpData.left - boundRect.left, + top: vpData.top - boundRect.top + }, + scale = vpData.width / pointsWidth, + originTop = points[1], + originLeft = points[0], + transformTop = (-1 * points[1]) + vpOffset.top, + transformLeft = (-1 * points[0]) + vpOffset.left, + newCss = {}; + + newCss[CSS_TRANS_ORG] = originLeft + 'px ' + originTop + 'px'; + newCss[CSS_TRANSFORM] = new Transform(transformLeft, transformTop, scale).toString(); + css(self.elements.preview, newCss); + + _setZoomerVal.call(self, scale); + self._currentZoom = scale; + } + + function _centerImage() { + var self = this, + imgDim = self.elements.preview.getBoundingClientRect(), + vpDim = self.elements.viewport.getBoundingClientRect(), + boundDim = self.elements.boundary.getBoundingClientRect(), + vpLeft = vpDim.left - boundDim.left, + vpTop = vpDim.top - boundDim.top, + w = vpLeft - ((imgDim.width - vpDim.width) / 2), + h = vpTop - ((imgDim.height - vpDim.height) / 2), + transform = new Transform(w, h, self._currentZoom); + + css(self.elements.preview, CSS_TRANSFORM, transform.toString()); + } + + function _transferImageToCanvas(customOrientation) { + var self = this, + canvas = self.elements.canvas, + img = self.elements.img, + ctx = canvas.getContext('2d'); + + ctx.clearRect(0, 0, canvas.width, canvas.height); + canvas.width = img.width; + canvas.height = img.height; + + var orientation = self.options.enableOrientation && customOrientation || getExifOrientation(img); + drawCanvas(canvas, img, orientation); + } + + function _getCanvas(data) { + var self = this, + points = data.points, + left = num(points[0]), + top = num(points[1]), + right = num(points[2]), + bottom = num(points[3]), + width = right-left, + height = bottom-top, + circle = data.circle, + canvas = document.createElement('canvas'), + ctx = canvas.getContext('2d'), + startX = 0, + startY = 0, + canvasWidth = data.outputWidth || width, + canvasHeight = data.outputHeight || height; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + if (data.backgroundColor) { + ctx.fillStyle = data.backgroundColor; + ctx.fillRect(0, 0, canvasWidth, canvasHeight); + } + + // By default assume we're going to draw the entire + // source image onto the destination canvas. + sx = left; + sy = top; + sWidth = width; + sHeight = height; + dx = 0; + dy = 0; + dWidth = canvasWidth; + dHeight = canvasHeight; + + // + // Do not go outside of the original image's bounds along the x-axis. + // Handle translations when projecting onto the destination canvas. + // + + // The smallest possible source x-position is 0. + if (left < 0) { + sx = 0; + dx = (Math.abs(left) / width) * canvasWidth; + } + + // The largest possible source width is the original image's width. + if (sWidth + sx > self._originalImageWidth) { + sWidth = self._originalImageWidth - sx; + dWidth = (sWidth / width) * canvasWidth; + } + + // + // Do not go outside of the original image's bounds along the y-axis. + // + + // The smallest possible source y-position is 0. + if (top < 0) { + sy = 0; + dy = (Math.abs(top) / height) * canvasHeight; + } + + // The largest possible source height is the original image's height. + if (sHeight + sy > self._originalImageHeight) { + sHeight = self._originalImageHeight - sy; + dHeight = (sHeight / height) * canvasHeight; + } + + // console.table({ left, right, top, bottom, canvasWidth, canvasHeight, width, height, startX, startY, circle, sx, sy, dx, dy, sWidth, sHeight, dWidth, dHeight }); + + ctx.drawImage(this.elements.preview, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight); + if (circle) { + ctx.fillStyle = '#fff'; + ctx.globalCompositeOperation = 'destination-in'; + ctx.beginPath(); + ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2, true); + ctx.closePath(); + ctx.fill(); + } + return canvas; + } + + function _getHtmlResult(data) { + var points = data.points, + div = document.createElement('div'), + img = document.createElement('img'), + width = points[2] - points[0], + height = points[3] - points[1]; + + addClass(div, 'croppie-result'); + div.appendChild(img); + css(img, { + left: (-1 * points[0]) + 'px', + top: (-1 * points[1]) + 'px' + }); + img.src = data.url; + css(div, { + width: width + 'px', + height: height + 'px' + }); + + return div; + } + + function _getBase64Result(data) { + return _getCanvas.call(this, data).toDataURL(data.format, data.quality); + } + + function _getBlobResult(data) { + var self = this; + return new Promise(function (resolve) { + _getCanvas.call(self, data).toBlob(function (blob) { + resolve(blob); + }, data.format, data.quality); + }); + } + + function _replaceImage(img) { + if (this.elements.img.parentNode) { + Array.prototype.forEach.call(this.elements.img.classList, function(c) { img.classList.add(c); }); + this.elements.img.parentNode.replaceChild(img, this.elements.img); + this.elements.preview = img; // if the img is attached to the DOM, they're not using the canvas + } + this.elements.img = img; + } + + function _bind(options, cb) { + var self = this, + url, + points = [], + zoom = null, + hasExif = _hasExif.call(self); + + if (typeof (options) === 'string') { + url = options; + options = {}; + } + else if (Array.isArray(options)) { + points = options.slice(); + } + else if (typeof (options) === 'undefined' && self.data.url) { //refreshing + _updatePropertiesFromImage.call(self); + _triggerUpdate.call(self); + return null; + } + else { + url = options.url; + points = options.points || []; + zoom = typeof(options.zoom) === 'undefined' ? null : options.zoom; + } + + self.data.bound = false; + self.data.url = url || self.data.url; + self.data.boundZoom = zoom; + + return loadImage(url, hasExif).then(function (img) { + _replaceImage.call(self, img); + if (!points.length) { + var natDim = naturalImageDimensions(img); + var rect = self.elements.viewport.getBoundingClientRect(); + var aspectRatio = rect.width / rect.height; + var imgAspectRatio = natDim.width / natDim.height; + var width, height; + + if (imgAspectRatio > aspectRatio) { + height = natDim.height; + width = height * aspectRatio; + } + else { + width = natDim.width; + height = natDim.height / aspectRatio; + } + + var x0 = (natDim.width - width) / 2; + var y0 = (natDim.height - height) / 2; + var x1 = x0 + width; + var y1 = y0 + height; + self.data.points = [x0, y0, x1, y1]; + } + else if (self.options.relative) { + points = [ + points[0] * img.naturalWidth / 100, + points[1] * img.naturalHeight / 100, + points[2] * img.naturalWidth / 100, + points[3] * img.naturalHeight / 100 + ]; + } + + self.data.points = points.map(function (p) { + return parseFloat(p); + }); + if (self.options.useCanvas) { + _transferImageToCanvas.call(self, options.orientation); + } + _updatePropertiesFromImage.call(self); + _triggerUpdate.call(self); + cb && cb(); + }); + } + + function fix(v, decimalPoints) { + return parseFloat(v).toFixed(decimalPoints || 0); + } + + function _get() { + var self = this, + imgData = self.elements.preview.getBoundingClientRect(), + vpData = self.elements.viewport.getBoundingClientRect(), + x1 = vpData.left - imgData.left, + y1 = vpData.top - imgData.top, + widthDiff = (vpData.width - self.elements.viewport.offsetWidth) / 2, //border + heightDiff = (vpData.height - self.elements.viewport.offsetHeight) / 2, + x2 = x1 + self.elements.viewport.offsetWidth + widthDiff, + y2 = y1 + self.elements.viewport.offsetHeight + heightDiff, + scale = self._currentZoom; + + if (scale === Infinity || isNaN(scale)) { + scale = 1; + } + + var max = self.options.enforceBoundary ? 0 : Number.NEGATIVE_INFINITY; + x1 = Math.max(max, x1 / scale); + y1 = Math.max(max, y1 / scale); + x2 = Math.max(max, x2 / scale); + y2 = Math.max(max, y2 / scale); + + return { + points: [fix(x1), fix(y1), fix(x2), fix(y2)], + zoom: scale, + orientation: self.data.orientation + }; + } + + var RESULT_DEFAULTS = { + type: 'canvas', + format: 'png', + quality: 1 + }, + RESULT_FORMATS = ['jpeg', 'webp', 'png']; + + function _result(options) { + var self = this, + data = _get.call(self), + opts = deepExtend(clone(RESULT_DEFAULTS), clone(options)), + resultType = (typeof (options) === 'string' ? options : (opts.type || 'base64')), + size = opts.size || 'viewport', + format = opts.format, + quality = opts.quality, + backgroundColor = opts.backgroundColor, + circle = typeof opts.circle === 'boolean' ? opts.circle : (self.options.viewport.type === 'circle'), + vpRect = self.elements.viewport.getBoundingClientRect(), + ratio = vpRect.width / vpRect.height, + prom; + + if (size === 'viewport') { + data.outputWidth = vpRect.width; + data.outputHeight = vpRect.height; + } else if (typeof size === 'object') { + if (size.width && size.height) { + data.outputWidth = size.width; + data.outputHeight = size.height; + } else if (size.width) { + data.outputWidth = size.width; + data.outputHeight = size.width / ratio; + } else if (size.height) { + data.outputWidth = size.height * ratio; + data.outputHeight = size.height; + } + } + + if (RESULT_FORMATS.indexOf(format) > -1) { + data.format = 'image/' + format; + data.quality = quality; + } + + data.circle = circle; + data.url = self.data.url; + data.backgroundColor = backgroundColor; + + prom = new Promise(function (resolve) { + switch(resultType.toLowerCase()) + { + case 'rawcanvas': + resolve(_getCanvas.call(self, data)); + break; + case 'canvas': + case 'base64': + resolve(_getBase64Result.call(self, data)); + break; + case 'blob': + _getBlobResult.call(self, data).then(resolve); + break; + default: + resolve(_getHtmlResult.call(self, data)); + break; + } + }); + return prom; + } + + function _refresh() { + _updatePropertiesFromImage.call(this); + } + + function _rotate(deg) { + if (!this.options.useCanvas || !this.options.enableOrientation) { + throw 'Croppie: Cannot rotate without enableOrientation && EXIF.js included'; + } + + var self = this, + canvas = self.elements.canvas; + + self.data.orientation = getExifOffset(self.data.orientation, deg); + drawCanvas(canvas, self.elements.img, self.data.orientation); + _updateCenterPoint.call(self, true); + _updateZoomLimits.call(self); + } + + function _destroy() { + var self = this; + self.element.removeChild(self.elements.boundary); + removeClass(self.element, 'croppie-container'); + if (self.options.enableZoom) { + self.element.removeChild(self.elements.zoomerWrap); + } + delete self.elements; + } + + if (window.jQuery) { + var $ = window.jQuery; + $.fn.croppie = function (opts) { + var ot = typeof opts; + + if (ot === 'string') { + var args = Array.prototype.slice.call(arguments, 1); + var singleInst = $(this).data('croppie'); + + if (opts === 'get') { + return singleInst.get(); + } + else if (opts === 'result') { + return singleInst.result.apply(singleInst, args); + } + else if (opts === 'bind') { + return singleInst.bind.apply(singleInst, args); + } + + return this.each(function () { + var i = $(this).data('croppie'); + if (!i) return; + + var method = i[opts]; + if ($.isFunction(method)) { + method.apply(i, args); + if (opts === 'destroy') { + $(this).removeData('croppie'); + } + } + else { + throw 'Croppie ' + opts + ' method not found'; + } + }); + } + else { + return this.each(function () { + var i = new Croppie(this, opts); + i.$ = $; + $(this).data('croppie', i); + }); + } + }; + } + + function Croppie(element, opts) { + if (element.className.indexOf('croppie-container') > -1) { + throw new Error("Croppie: Can't initialize croppie more than once"); + } + this.element = element; + this.options = deepExtend(clone(Croppie.defaults), opts); + + if (this.element.tagName.toLowerCase() === 'img') { + var origImage = this.element; + addClass(origImage, 'cr-original-image'); + setAttributes(origImage, {'aria-hidden' : 'true', 'alt' : '' }); + var replacementDiv = document.createElement('div'); + this.element.parentNode.appendChild(replacementDiv); + replacementDiv.appendChild(origImage); + this.element = replacementDiv; + this.options.url = this.options.url || origImage.src; + } + + _create.call(this); + if (this.options.url) { + var bindOpts = { + url: this.options.url, + points: this.options.points + }; + delete this.options['url']; + delete this.options['points']; + _bind.call(this, bindOpts); + } + } + + Croppie.defaults = { + viewport: { + width: 100, + height: 100, + type: 'square' + }, + boundary: { }, + orientationControls: { + enabled: true, + leftClass: '', + rightClass: '' + }, + resizeControls: { + width: true, + height: true + }, + customClass: '', + showZoomer: true, + enableZoom: true, + enableResize: false, + mouseWheelZoom: true, + enableExif: false, + enforceBoundary: true, + enableOrientation: false, + enableKeyMovement: true, + update: function () { } + }; + + Croppie.globals = { + translate: 'translate3d' + }; + + deepExtend(Croppie.prototype, { + bind: function (options, cb) { + return _bind.call(this, options, cb); + }, + get: function () { + var data = _get.call(this); + var points = data.points; + if (this.options.relative) { + points[0] /= this.elements.img.naturalWidth / 100; + points[1] /= this.elements.img.naturalHeight / 100; + points[2] /= this.elements.img.naturalWidth / 100; + points[3] /= this.elements.img.naturalHeight / 100; + } + return data; + }, + result: function (type) { + return _result.call(this, type); + }, + refresh: function () { + return _refresh.call(this); + }, + setZoom: function (v) { + _setZoomerVal.call(this, v); + dispatchChange(this.elements.zoomer); + }, + rotate: function (deg) { + _rotate.call(this, deg); + }, + destroy: function () { + return _destroy.call(this); + } + }); + return Croppie; +})); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate)) + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/croppie/croppie.css": +/*!**************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/src??ref--7-2!./node_modules/croppie/croppie.css ***! + \**************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, ".croppie-container {\n width: 100%;\n height: 100%;\n}\n\n.croppie-container .cr-image {\n z-index: -1;\n position: absolute;\n top: 0;\n left: 0;\n transform-origin: 0 0;\n max-height: none;\n max-width: none;\n}\n\n.croppie-container .cr-boundary {\n position: relative;\n overflow: hidden;\n margin: 0 auto;\n z-index: 1;\n width: 100%;\n height: 100%;\n}\n\n.croppie-container .cr-viewport,\n.croppie-container .cr-resizer {\n position: absolute;\n border: 2px solid #fff;\n margin: auto;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5);\n z-index: 0;\n}\n\n.croppie-container .cr-resizer {\n z-index: 2;\n box-shadow: none;\n pointer-events: none;\n}\n\n.croppie-container .cr-resizer-vertical,\n.croppie-container .cr-resizer-horisontal {\n position: absolute;\n pointer-events: all;\n}\n\n.croppie-container .cr-resizer-vertical::after,\n.croppie-container .cr-resizer-horisontal::after {\n display: block;\n position: absolute;\n box-sizing: border-box;\n border: 1px solid black;\n background: #fff;\n width: 10px;\n height: 10px;\n content: '';\n}\n\n.croppie-container .cr-resizer-vertical {\n bottom: -5px;\n cursor: row-resize;\n width: 100%;\n height: 10px;\n}\n\n.croppie-container .cr-resizer-vertical::after {\n left: 50%;\n margin-left: -5px;\n}\n\n.croppie-container .cr-resizer-horisontal {\n right: -5px;\n cursor: col-resize;\n width: 10px;\n height: 100%;\n}\n\n.croppie-container .cr-resizer-horisontal::after {\n top: 50%;\n margin-top: -5px;\n}\n\n.croppie-container .cr-original-image {\n display: none;\n}\n\n.croppie-container .cr-vp-circle {\n border-radius: 50%;\n}\n\n.croppie-container .cr-overlay {\n z-index: 1;\n position: absolute;\n cursor: move;\n touch-action: none;\n}\n\n.croppie-container .cr-slider-wrap {\n width: 75%;\n margin: 15px auto;\n text-align: center;\n}\n\n.croppie-result {\n position: relative;\n overflow: hidden;\n}\n\n.croppie-result img {\n position: absolute;\n}\n\n.croppie-container .cr-image,\n.croppie-container .cr-overlay,\n.croppie-container .cr-viewport {\n -webkit-transform: translateZ(0);\n -moz-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n/*************************************/\n/***** STYLING RANGE INPUT ***********/\n/*************************************/\n/*http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */\n/*************************************/\n\n.cr-slider {\n -webkit-appearance: none;\n/*removes default webkit styles*/\n\t/*border: 1px solid white; *//*fix for FF unable to apply focus style bug */\n width: 300px;\n/*required for proper track sizing in FF*/\n max-width: 100%;\n padding-top: 8px;\n padding-bottom: 8px;\n background-color: transparent;\n}\n\n.cr-slider::-webkit-slider-runnable-track {\n width: 100%;\n height: 3px;\n background: rgba(0, 0, 0, 0.5);\n border: 0;\n border-radius: 3px;\n}\n\n.cr-slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n border: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #ddd;\n margin-top: -6px;\n}\n\n.cr-slider:focus {\n outline: none;\n}\n/*\n.cr-slider:focus::-webkit-slider-runnable-track {\nbackground: #ccc;\n}\n*/\n\n.cr-slider::-moz-range-track {\n width: 100%;\n height: 3px;\n background: rgba(0, 0, 0, 0.5);\n border: 0;\n border-radius: 3px;\n}\n\n.cr-slider::-moz-range-thumb {\n border: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #ddd;\n margin-top: -6px;\n}\n\n/*hide the outline behind the border*/\n.cr-slider:-moz-focusring {\n outline: 1px solid white;\n outline-offset: -1px;\n}\n\n.cr-slider::-ms-track {\n width: 100%;\n height: 5px;\n background: transparent;\n/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */\n\tborder-color: transparent;/*leave room for the larger thumb to overflow with a transparent border */\n\tborder-width: 6px 0;\n\tcolor: transparent;/*remove default tick marks*/\n}\n.cr-slider::-ms-fill-lower {\n\tbackground: rgba(0, 0, 0, 0.5);\n\tborder-radius: 10px;\n}\n.cr-slider::-ms-fill-upper {\n\tbackground: rgba(0, 0, 0, 0.5);\n\tborder-radius: 10px;\n}\n.cr-slider::-ms-thumb {\n\tborder: none;\n\theight: 16px;\n\twidth: 16px;\n\tborder-radius: 50%;\n\tbackground: #ddd;\n\tmargin-top:1px;\n}\n.cr-slider:focus::-ms-fill-lower {\n\tbackground: rgba(0, 0, 0, 0.5);\n}\n.cr-slider:focus::-ms-fill-upper {\n\tbackground: rgba(0, 0, 0, 0.5);\n}\n/*******************************************/\n\n/***********************************/\n/* Rotation Tools */\n/***********************************/\n.cr-rotate-controls {\n\tposition: absolute;\n\tbottom: 5px;\n\tleft: 5px;\n\tz-index: 1;\n}\n.cr-rotate-controls button {\n\tborder: 0;\n\tbackground: none;\n}\n.cr-rotate-controls i:before {\n\tdisplay: inline-block;\n\tfont-style: normal;\n\tfont-weight: 900;\n\tfont-size: 22px;\n}\n.cr-rotate-l i:before {\n\tcontent: '\\21BA';\n}\n.cr-rotate-r i:before {\n\tcontent: '\\21BB';\n}\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css&": +/*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css& ***! + \********************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\nselect[data-v-412102b4] {\n width: auto;\n}\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css&": +/*!****************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css& ***! + \****************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\n.ql-container[data-v-04fe0f4f] {\n font-size: inherit;\n}\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css&": +/*!******************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css& ***! + \******************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\n#notificationBody {\n z-index: 99999;\n position: fixed;\n bottom: 20px;\n right: 10px;\n}\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css&": +/*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css& ***! + \***********************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css&": +/*!************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css& ***! + \************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css&": +/*!*************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css& ***! + \*************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css&": +/*!******************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css& ***! + \******************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css&": +/*!*************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css& ***! + \*************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]); + +// exports + + +/***/ }), + +/***/ "./node_modules/css-loader/lib/css-base.js": +/*!*************************************************!*\ + !*** ./node_modules/css-loader/lib/css-base.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; +}; + +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); + + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} + +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + + return '/*# ' + data + ' */'; +} + + +/***/ }), + +/***/ "./node_modules/dompurify/dist/purify.js": +/*!***********************************************!*\ + !*** ./node_modules/dompurify/dist/purify.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */ + +(function (global, factory) { + true ? module.exports = factory() : + undefined; +}(this, function () { 'use strict'; + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + var hasOwnProperty = Object.hasOwnProperty, + setPrototypeOf = Object.setPrototypeOf, + isFrozen = Object.isFrozen, + objectKeys = Object.keys; + var freeze = Object.freeze, + seal = Object.seal; // eslint-disable-line import/no-mutable-exports + + var _ref = typeof Reflect !== 'undefined' && Reflect, + apply = _ref.apply, + construct = _ref.construct; + + if (!apply) { + apply = function apply(fun, thisValue, args) { + return fun.apply(thisValue, args); + }; + } + + if (!freeze) { + freeze = function freeze(x) { + return x; + }; + } + + if (!seal) { + seal = function seal(x) { + return x; + }; + } + + if (!construct) { + construct = function construct(Func, args) { + return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))(); + }; + } + + var arrayForEach = unapply(Array.prototype.forEach); + var arrayIndexOf = unapply(Array.prototype.indexOf); + var arrayJoin = unapply(Array.prototype.join); + var arrayPop = unapply(Array.prototype.pop); + var arrayPush = unapply(Array.prototype.push); + var arraySlice = unapply(Array.prototype.slice); + + var stringToLowerCase = unapply(String.prototype.toLowerCase); + var stringMatch = unapply(String.prototype.match); + var stringReplace = unapply(String.prototype.replace); + var stringIndexOf = unapply(String.prototype.indexOf); + var stringTrim = unapply(String.prototype.trim); + + var regExpTest = unapply(RegExp.prototype.test); + var regExpCreate = unconstruct(RegExp); + + var typeErrorCreate = unconstruct(TypeError); + + function unapply(func) { + return function (thisArg) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return apply(func, thisArg, args); + }; + } + + function unconstruct(func) { + return function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return construct(func, args); + }; + } + + /* Add properties to a lookup table */ + function addToSet(set, array) { + if (setPrototypeOf) { + // Make 'in' and truthy checks like Boolean(set.constructor) + // independent of any properties defined on Object.prototype. + // Prevent prototype setters from intercepting set as a this value. + setPrototypeOf(set, null); + } + + var l = array.length; + while (l--) { + var element = array[l]; + if (typeof element === 'string') { + var lcElement = stringToLowerCase(element); + if (lcElement !== element) { + // Config presets (e.g. tags.js, attrs.js) are immutable. + if (!isFrozen(array)) { + array[l] = lcElement; + } + + element = lcElement; + } + } + + set[element] = true; + } + + return set; + } + + /* Shallow clone an object */ + function clone(object) { + var newObject = {}; + + var property = void 0; + for (property in object) { + if (apply(hasOwnProperty, object, [property])) { + newObject[property] = object[property]; + } + } + + return newObject; + } + + var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); + + // SVG + var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'audio', 'canvas', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'video', 'view', 'vkern']); + + var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); + + var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']); + + var text = freeze(['#text']); + + var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns']); + + var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); + + var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']); + + var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); + + // eslint-disable-next-line unicorn/better-regex + var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode + var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm); + var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape + var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape + var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape + ); + var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); + var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g // eslint-disable-line no-control-regex + ); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + var getGlobal = function getGlobal() { + return typeof window === 'undefined' ? null : window; + }; + + /** + * Creates a no-op policy for internal use only. + * Don't export this function outside this module! + * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory. + * @param {Document} document The document object (to determine policy name suffix) + * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types + * are not supported). + */ + var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) { + if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') { + return null; + } + + // Allow the callers to control the unique policy name + // by adding a data-tt-policy-suffix to the script element with the DOMPurify. + // Policy creation with duplicate names throws in Trusted Types. + var suffix = null; + var ATTR_NAME = 'data-tt-policy-suffix'; + if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) { + suffix = document.currentScript.getAttribute(ATTR_NAME); + } + + var policyName = 'dompurify' + (suffix ? '#' + suffix : ''); + + try { + return trustedTypes.createPolicy(policyName, { + createHTML: function createHTML(html$$1) { + return html$$1; + } + }); + } catch (_) { + // Policy creation failed (most likely another DOMPurify script has + // already run). Skip creating the policy, as this will only cause errors + // if TT are enforced. + console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); + return null; + } + }; + + function createDOMPurify() { + var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); + + var DOMPurify = function DOMPurify(root) { + return createDOMPurify(root); + }; + + /** + * Version label, exposed for easier checks + * if DOMPurify is up to date or not + */ + DOMPurify.version = '2.0.11'; + + /** + * Array of elements that DOMPurify removed during sanitation. + * Empty if nothing was removed. + */ + DOMPurify.removed = []; + + if (!window || !window.document || window.document.nodeType !== 9) { + // Not running in a browser, provide a factory function + // so that you can pass your own Window + DOMPurify.isSupported = false; + + return DOMPurify; + } + + var originalDocument = window.document; + var removeTitle = false; + + var document = window.document; + var DocumentFragment = window.DocumentFragment, + HTMLTemplateElement = window.HTMLTemplateElement, + Node = window.Node, + NodeFilter = window.NodeFilter, + _window$NamedNodeMap = window.NamedNodeMap, + NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap, + Text = window.Text, + Comment = window.Comment, + DOMParser = window.DOMParser, + trustedTypes = window.trustedTypes; + + // As per issue #47, the web-components registry is inherited by a + // new document created via createHTMLDocument. As per the spec + // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) + // a new empty registry is used when creating a template contents owner + // document, so we use that as our parent document to ensure nothing + // is inherited. + + if (typeof HTMLTemplateElement === 'function') { + var template = document.createElement('template'); + if (template.content && template.content.ownerDocument) { + document = template.content.ownerDocument; + } + } + + var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument); + var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : ''; + + var _document = document, + implementation = _document.implementation, + createNodeIterator = _document.createNodeIterator, + getElementsByTagName = _document.getElementsByTagName, + createDocumentFragment = _document.createDocumentFragment; + var importNode = originalDocument.importNode; + + + var hooks = {}; + + /** + * Expose whether this browser supports running the full DOMPurify. + */ + DOMPurify.isSupported = implementation && typeof implementation.createHTMLDocument !== 'undefined' && document.documentMode !== 9; + + var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR, + ERB_EXPR$$1 = ERB_EXPR, + DATA_ATTR$$1 = DATA_ATTR, + ARIA_ATTR$$1 = ARIA_ATTR, + IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA, + ATTR_WHITESPACE$$1 = ATTR_WHITESPACE; + var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI; + + /** + * We consider the elements and attributes below to be safe. Ideally + * don't add any new ones but feel free to remove unwanted ones. + */ + + /* allowed element names */ + + var ALLOWED_TAGS = null; + var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text))); + + /* Allowed attribute names */ + var ALLOWED_ATTR = null; + var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml))); + + /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ + var FORBID_TAGS = null; + + /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ + var FORBID_ATTR = null; + + /* Decide if ARIA attributes are okay */ + var ALLOW_ARIA_ATTR = true; + + /* Decide if custom data attributes are okay */ + var ALLOW_DATA_ATTR = true; + + /* Decide if unknown protocols are okay */ + var ALLOW_UNKNOWN_PROTOCOLS = false; + + /* Output should be safe for jQuery's $() factory? */ + var SAFE_FOR_JQUERY = false; + + /* Output should be safe for common template engines. + * This means, DOMPurify removes data attributes, mustaches and ERB + */ + var SAFE_FOR_TEMPLATES = false; + + /* Decide if document with <html>... should be returned */ + var WHOLE_DOCUMENT = false; + + /* Track whether config is already set on this instance of DOMPurify. */ + var SET_CONFIG = false; + + /* Decide if all elements (e.g. style, script) must be children of + * document.body. By default, browsers might move them to document.head */ + var FORCE_BODY = false; + + /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported). + * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead + */ + var RETURN_DOM = false; + + /* Decide if a DOM `DocumentFragment` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported) */ + var RETURN_DOM_FRAGMENT = false; + + /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM + * `Node` is imported into the current `Document`. If this flag is not enabled the + * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by + * DOMPurify. */ + var RETURN_DOM_IMPORT = false; + + /* Try to return a Trusted Type object instead of a string, retrun a string in + * case Trusted Types are not supported */ + var RETURN_TRUSTED_TYPE = false; + + /* Output should be free from DOM clobbering attacks? */ + var SANITIZE_DOM = true; + + /* Keep element content when removing element? */ + var KEEP_CONTENT = true; + + /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead + * of importing it into a new Document and returning a sanitized copy */ + var IN_PLACE = false; + + /* Allow usage of profiles like html, svg and mathMl */ + var USE_PROFILES = {}; + + /* Tags to ignore content of when KEEP_CONTENT is true */ + var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); + + /* Tags that are safe for data: URIs */ + var DATA_URI_TAGS = null; + var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); + + /* Attributes safe for values like "javascript:" */ + var URI_SAFE_ATTRIBUTES = null; + var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']); + + /* Keep a reference to config to pass to hooks */ + var CONFIG = null; + + /* Ideally, do not touch anything below this line */ + /* ______________________________________________ */ + + var formElement = document.createElement('form'); + + /** + * _parseConfig + * + * @param {Object} cfg optional config literal + */ + // eslint-disable-next-line complexity + var _parseConfig = function _parseConfig(cfg) { + if (CONFIG && CONFIG === cfg) { + return; + } + + /* Shield configuration object from tampering */ + if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') { + cfg = {}; + } + + /* Set configuration parameters */ + ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS; + ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR; + URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES; + DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS; + FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {}; + FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {}; + USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false; + ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true + ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true + ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false + SAFE_FOR_JQUERY = cfg.SAFE_FOR_JQUERY || false; // Default false + SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false + WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false + RETURN_DOM = cfg.RETURN_DOM || false; // Default false + RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false + RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT || false; // Default false + RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false + FORCE_BODY = cfg.FORCE_BODY || false; // Default false + SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true + KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true + IN_PLACE = cfg.IN_PLACE || false; // Default false + IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1; + if (SAFE_FOR_TEMPLATES) { + ALLOW_DATA_ATTR = false; + } + + if (RETURN_DOM_FRAGMENT) { + RETURN_DOM = true; + } + + /* Parse profile info */ + if (USE_PROFILES) { + ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text))); + ALLOWED_ATTR = []; + if (USE_PROFILES.html === true) { + addToSet(ALLOWED_TAGS, html); + addToSet(ALLOWED_ATTR, html$1); + } + + if (USE_PROFILES.svg === true) { + addToSet(ALLOWED_TAGS, svg); + addToSet(ALLOWED_ATTR, svg$1); + addToSet(ALLOWED_ATTR, xml); + } + + if (USE_PROFILES.svgFilters === true) { + addToSet(ALLOWED_TAGS, svgFilters); + addToSet(ALLOWED_ATTR, svg$1); + addToSet(ALLOWED_ATTR, xml); + } + + if (USE_PROFILES.mathMl === true) { + addToSet(ALLOWED_TAGS, mathMl); + addToSet(ALLOWED_ATTR, mathMl$1); + addToSet(ALLOWED_ATTR, xml); + } + } + + /* Merge configuration parameters */ + if (cfg.ADD_TAGS) { + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { + ALLOWED_TAGS = clone(ALLOWED_TAGS); + } + + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS); + } + + if (cfg.ADD_ATTR) { + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { + ALLOWED_ATTR = clone(ALLOWED_ATTR); + } + + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR); + } + + if (cfg.ADD_URI_SAFE_ATTR) { + addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR); + } + + /* Add #text in case KEEP_CONTENT is set to true */ + if (KEEP_CONTENT) { + ALLOWED_TAGS['#text'] = true; + } + + /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ + if (WHOLE_DOCUMENT) { + addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); + } + + /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ + if (ALLOWED_TAGS.table) { + addToSet(ALLOWED_TAGS, ['tbody']); + delete FORBID_TAGS.tbody; + } + + // Prevent further manipulation of configuration. + // Not available in IE8, Safari 5, etc. + if (freeze) { + freeze(cfg); + } + + CONFIG = cfg; + }; + + /** + * _forceRemove + * + * @param {Node} node a DOM node + */ + var _forceRemove = function _forceRemove(node) { + arrayPush(DOMPurify.removed, { element: node }); + try { + // eslint-disable-next-line unicorn/prefer-node-remove + node.parentNode.removeChild(node); + } catch (_) { + node.outerHTML = emptyHTML; + } + }; + + /** + * _removeAttribute + * + * @param {String} name an Attribute name + * @param {Node} node a DOM node + */ + var _removeAttribute = function _removeAttribute(name, node) { + try { + arrayPush(DOMPurify.removed, { + attribute: node.getAttributeNode(name), + from: node + }); + } catch (_) { + arrayPush(DOMPurify.removed, { + attribute: null, + from: node + }); + } + + node.removeAttribute(name); + }; + + /** + * _initDocument + * + * @param {String} dirty a string of dirty markup + * @return {Document} a DOM, filled with the dirty markup + */ + var _initDocument = function _initDocument(dirty) { + /* Create a HTML document */ + var doc = void 0; + var leadingWhitespace = void 0; + + if (FORCE_BODY) { + dirty = '<remove></remove>' + dirty; + } else { + /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ + var matches = stringMatch(dirty, /^[\r\n\t ]+/); + leadingWhitespace = matches && matches[0]; + } + + var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; + /* Use the DOMParser API by default, fallback later if needs be */ + try { + doc = new DOMParser().parseFromString(dirtyPayload, 'text/html'); + } catch (_) {} + + /* Remove title to fix a mXSS bug in older MS Edge */ + if (removeTitle) { + addToSet(FORBID_TAGS, ['title']); + } + + /* Use createHTMLDocument in case DOMParser is not available */ + if (!doc || !doc.documentElement) { + doc = implementation.createHTMLDocument(''); + var _doc = doc, + body = _doc.body; + + body.parentNode.removeChild(body.parentNode.firstElementChild); + body.outerHTML = dirtyPayload; + } + + if (dirty && leadingWhitespace) { + doc.body.insertBefore(document.createTextNode(leadingWhitespace), doc.body.childNodes[0] || null); + } + + /* Work on whole document or just its body */ + return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; + }; + + /* Here we test for a broken feature in Edge that might cause mXSS */ + if (DOMPurify.isSupported) { + (function () { + try { + var doc = _initDocument('<x/><title></title><img>'); + if (regExpTest(/<\/title/, doc.querySelector('title').innerHTML)) { + removeTitle = true; + } + } catch (_) {} + })(); + } + + /** + * _createIterator + * + * @param {Document} root document/fragment to create iterator for + * @return {Iterator} iterator instance + */ + var _createIterator = function _createIterator(root) { + return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, function () { + return NodeFilter.FILTER_ACCEPT; + }, false); + }; + + /** + * _isClobbered + * + * @param {Node} elm element to check for clobbering attacks + * @return {Boolean} true if clobbered, false if safe + */ + var _isClobbered = function _isClobbered(elm) { + if (elm instanceof Text || elm instanceof Comment) { + return false; + } + + if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string') { + return true; + } + + return false; + }; + + /** + * _isNode + * + * @param {Node} obj object to check whether it's a DOM node + * @return {Boolean} true is object is a DOM node + */ + var _isNode = function _isNode(object) { + return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'; + }; + + /** + * _executeHook + * Execute user configurable hooks + * + * @param {String} entryPoint Name of the hook's entry point + * @param {Node} currentNode node to work on with the hook + * @param {Object} data additional hook parameters + */ + var _executeHook = function _executeHook(entryPoint, currentNode, data) { + if (!hooks[entryPoint]) { + return; + } + + arrayForEach(hooks[entryPoint], function (hook) { + hook.call(DOMPurify, currentNode, data, CONFIG); + }); + }; + + /** + * _sanitizeElements + * + * @protect nodeName + * @protect textContent + * @protect removeChild + * + * @param {Node} currentNode to check for permission to exist + * @return {Boolean} true if node was killed, false if left alive + */ + // eslint-disable-next-line complexity + var _sanitizeElements = function _sanitizeElements(currentNode) { + var content = void 0; + + /* Execute a hook if present */ + _executeHook('beforeSanitizeElements', currentNode, null); + + /* Check if element is clobbered or can clobber */ + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + return true; + } + + /* Now let's check the element's type and name */ + var tagName = stringToLowerCase(currentNode.nodeName); + + /* Execute a hook if present */ + _executeHook('uponSanitizeElement', currentNode, { + tagName: tagName, + allowedTags: ALLOWED_TAGS + }); + + /* Take care of an mXSS pattern using p, br inside svg, math */ + if ((tagName === 'svg' || tagName === 'math') && currentNode.querySelectorAll('p, br').length !== 0) { + _forceRemove(currentNode); + return true; + } + + /* Remove element if anything forbids its presence */ + if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { + /* Keep content except for black-listed elements */ + if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && typeof currentNode.insertAdjacentHTML === 'function') { + try { + var htmlToInsert = currentNode.innerHTML; + currentNode.insertAdjacentHTML('AfterEnd', trustedTypesPolicy ? trustedTypesPolicy.createHTML(htmlToInsert) : htmlToInsert); + } catch (_) {} + } + + _forceRemove(currentNode); + return true; + } + + /* Remove in case a noscript/noembed XSS is suspected */ + if (tagName === 'noscript' && regExpTest(/<\/noscript/i, currentNode.innerHTML)) { + _forceRemove(currentNode); + return true; + } + + if (tagName === 'noembed' && regExpTest(/<\/noembed/i, currentNode.innerHTML)) { + _forceRemove(currentNode); + return true; + } + + /* Convert markup to cover jQuery behavior */ + if (SAFE_FOR_JQUERY && !currentNode.firstElementChild && (!currentNode.content || !currentNode.content.firstElementChild) && regExpTest(/</g, currentNode.textContent)) { + arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() }); + if (currentNode.innerHTML) { + currentNode.innerHTML = stringReplace(currentNode.innerHTML, /</g, '<'); + } else { + currentNode.innerHTML = stringReplace(currentNode.textContent, /</g, '<'); + } + } + + /* Sanitize element content to be template-safe */ + if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) { + /* Get the element's text content */ + content = currentNode.textContent; + content = stringReplace(content, MUSTACHE_EXPR$$1, ' '); + content = stringReplace(content, ERB_EXPR$$1, ' '); + if (currentNode.textContent !== content) { + arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() }); + currentNode.textContent = content; + } + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeElements', currentNode, null); + + return false; + }; + + /** + * _isValidAttribute + * + * @param {string} lcTag Lowercase tag name of containing element. + * @param {string} lcName Lowercase attribute name. + * @param {string} value Attribute value. + * @return {Boolean} Returns true if `value` is valid, otherwise false. + */ + // eslint-disable-next-line complexity + var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) { + /* Make sure attribute cannot clobber */ + if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) { + return false; + } + + /* Allow valid data-* attributes: At least one character after "-" + (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) + XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804) + We don't need to check the value; it's always URI safe. */ + if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) { + return false; + + /* Check value is safe. First, is attr inert? If so, is safe */ + } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else { + return false; + } + + return true; + }; + + /** + * _sanitizeAttributes + * + * @protect attributes + * @protect nodeName + * @protect removeAttribute + * @protect setAttribute + * + * @param {Node} currentNode to sanitize + */ + // eslint-disable-next-line complexity + var _sanitizeAttributes = function _sanitizeAttributes(currentNode) { + var attr = void 0; + var value = void 0; + var lcName = void 0; + var idAttr = void 0; + var l = void 0; + /* Execute a hook if present */ + _executeHook('beforeSanitizeAttributes', currentNode, null); + + var attributes = currentNode.attributes; + + /* Check if we have attributes; if not we might have a text node */ + + if (!attributes) { + return; + } + + var hookEvent = { + attrName: '', + attrValue: '', + keepAttr: true, + allowedAttributes: ALLOWED_ATTR + }; + l = attributes.length; + + /* Go backwards over all attributes; safely remove bad ones */ + while (l--) { + attr = attributes[l]; + var _attr = attr, + name = _attr.name, + namespaceURI = _attr.namespaceURI; + + value = stringTrim(attr.value); + lcName = stringToLowerCase(name); + + /* Execute a hook if present */ + hookEvent.attrName = lcName; + hookEvent.attrValue = value; + hookEvent.keepAttr = true; + hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set + _executeHook('uponSanitizeAttribute', currentNode, hookEvent); + value = hookEvent.attrValue; + /* Did the hooks approve of the attribute? */ + if (hookEvent.forceKeepAttr) { + continue; + } + + /* Remove attribute */ + // Safari (iOS + Mac), last tested v8.0.5, crashes if you try to + // remove a "name" attribute from an <img> tag that has an "id" + // attribute at the time. + if (lcName === 'name' && currentNode.nodeName === 'IMG' && attributes.id) { + idAttr = attributes.id; + attributes = arraySlice(attributes, []); + _removeAttribute('id', currentNode); + _removeAttribute(name, currentNode); + if (arrayIndexOf(attributes, idAttr) > l) { + currentNode.setAttribute('id', idAttr.value); + } + } else if ( + // This works around a bug in Safari, where input[type=file] + // cannot be dynamically set after type has been removed + currentNode.nodeName === 'INPUT' && lcName === 'type' && value === 'file' && hookEvent.keepAttr && (ALLOWED_ATTR[lcName] || !FORBID_ATTR[lcName])) { + continue; + } else { + // This avoids a crash in Safari v9.0 with double-ids. + // The trick is to first set the id to be empty and then to + // remove the attribute + if (name === 'id') { + currentNode.setAttribute(name, ''); + } + + _removeAttribute(name, currentNode); + } + + /* Did the hooks approve of the attribute? */ + if (!hookEvent.keepAttr) { + continue; + } + + /* Work around a security issue in jQuery 3.0 */ + if (SAFE_FOR_JQUERY && regExpTest(/\/>/i, value)) { + _removeAttribute(name, currentNode); + continue; + } + + /* Take care of an mXSS pattern using namespace switches */ + if (regExpTest(/svg|math/i, currentNode.namespaceURI) && regExpTest(regExpCreate('</(' + arrayJoin(objectKeys(FORBID_CONTENTS), '|') + ')', 'i'), value)) { + _removeAttribute(name, currentNode); + continue; + } + + /* Sanitize attribute content to be template-safe */ + if (SAFE_FOR_TEMPLATES) { + value = stringReplace(value, MUSTACHE_EXPR$$1, ' '); + value = stringReplace(value, ERB_EXPR$$1, ' '); + } + + /* Is `value` valid for this attribute? */ + var lcTag = currentNode.nodeName.toLowerCase(); + if (!_isValidAttribute(lcTag, lcName, value)) { + continue; + } + + /* Handle invalid data-* attribute set by try-catching it */ + try { + if (namespaceURI) { + currentNode.setAttributeNS(namespaceURI, name, value); + } else { + /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */ + currentNode.setAttribute(name, value); + } + + arrayPop(DOMPurify.removed); + } catch (_) {} + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeAttributes', currentNode, null); + }; + + /** + * _sanitizeShadowDOM + * + * @param {DocumentFragment} fragment to iterate over recursively + */ + var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) { + var shadowNode = void 0; + var shadowIterator = _createIterator(fragment); + + /* Execute a hook if present */ + _executeHook('beforeSanitizeShadowDOM', fragment, null); + + while (shadowNode = shadowIterator.nextNode()) { + /* Execute a hook if present */ + _executeHook('uponSanitizeShadowNode', shadowNode, null); + + /* Sanitize tags and elements */ + if (_sanitizeElements(shadowNode)) { + continue; + } + + /* Deep shadow DOM detected */ + if (shadowNode.content instanceof DocumentFragment) { + _sanitizeShadowDOM(shadowNode.content); + } + + /* Check attributes, sanitize if necessary */ + _sanitizeAttributes(shadowNode); + } + + /* Execute a hook if present */ + _executeHook('afterSanitizeShadowDOM', fragment, null); + }; + + /** + * Sanitize + * Public method providing core sanitation functionality + * + * @param {String|Node} dirty string or DOM node + * @param {Object} configuration object + */ + // eslint-disable-next-line complexity + DOMPurify.sanitize = function (dirty, cfg) { + var body = void 0; + var importedNode = void 0; + var currentNode = void 0; + var oldNode = void 0; + var returnNode = void 0; + /* Make sure we have a string to sanitize. + DO NOT return early, as this will return the wrong type if + the user has requested a DOM object rather than a string */ + if (!dirty) { + dirty = '<!-->'; + } + + /* Stringify, in case dirty is an object */ + if (typeof dirty !== 'string' && !_isNode(dirty)) { + // eslint-disable-next-line no-negated-condition + if (typeof dirty.toString !== 'function') { + throw typeErrorCreate('toString is not a function'); + } else { + dirty = dirty.toString(); + if (typeof dirty !== 'string') { + throw typeErrorCreate('dirty is not a string, aborting'); + } + } + } + + /* Check we can run. Otherwise fall back or ignore */ + if (!DOMPurify.isSupported) { + if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') { + if (typeof dirty === 'string') { + return window.toStaticHTML(dirty); + } + + if (_isNode(dirty)) { + return window.toStaticHTML(dirty.outerHTML); + } + } + + return dirty; + } + + /* Assign config vars */ + if (!SET_CONFIG) { + _parseConfig(cfg); + } + + /* Clean up removed elements */ + DOMPurify.removed = []; + + /* Check if dirty is correctly typed for IN_PLACE */ + if (typeof dirty === 'string') { + IN_PLACE = false; + } + + if (IN_PLACE) ; else if (dirty instanceof Node) { + /* If dirty is a DOM element, append to an empty document to avoid + elements being stripped by the parser */ + body = _initDocument('<!-->'); + importedNode = body.ownerDocument.importNode(dirty, true); + if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') { + /* Node is already a body, use as is */ + body = importedNode; + } else if (importedNode.nodeName === 'HTML') { + body = importedNode; + } else { + // eslint-disable-next-line unicorn/prefer-node-append + body.appendChild(importedNode); + } + } else { + /* Exit directly if we have nothing to do */ + if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && RETURN_TRUSTED_TYPE && + // eslint-disable-next-line unicorn/prefer-includes + dirty.indexOf('<') === -1) { + return trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; + } + + /* Initialize the document to work on */ + body = _initDocument(dirty); + + /* Check we have a DOM node from the data */ + if (!body) { + return RETURN_DOM ? null : emptyHTML; + } + } + + /* Remove first element node (ours) if FORCE_BODY is set */ + if (body && FORCE_BODY) { + _forceRemove(body.firstChild); + } + + /* Get node iterator */ + var nodeIterator = _createIterator(IN_PLACE ? dirty : body); + + /* Now start iterating over the created document */ + while (currentNode = nodeIterator.nextNode()) { + /* Fix IE's strange behavior with manipulated textNodes #89 */ + if (currentNode.nodeType === 3 && currentNode === oldNode) { + continue; + } + + /* Sanitize tags and elements */ + if (_sanitizeElements(currentNode)) { + continue; + } + + /* Shadow DOM detected, sanitize it */ + if (currentNode.content instanceof DocumentFragment) { + _sanitizeShadowDOM(currentNode.content); + } + + /* Check attributes, sanitize if necessary */ + _sanitizeAttributes(currentNode); + + oldNode = currentNode; + } + + oldNode = null; + + /* If we sanitized `dirty` in-place, return it. */ + if (IN_PLACE) { + return dirty; + } + + /* Return sanitized string or DOM */ + if (RETURN_DOM) { + if (RETURN_DOM_FRAGMENT) { + returnNode = createDocumentFragment.call(body.ownerDocument); + + while (body.firstChild) { + // eslint-disable-next-line unicorn/prefer-node-append + returnNode.appendChild(body.firstChild); + } + } else { + returnNode = body; + } + + if (RETURN_DOM_IMPORT) { + /* + AdoptNode() is not used because internal state is not reset + (e.g. the past names map of a HTMLFormElement), this is safe + in theory but we would rather not risk another attack vector. + The state that is cloned by importNode() is explicitly defined + by the specs. + */ + returnNode = importNode.call(originalDocument, returnNode, true); + } + + return returnNode; + } + + var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; + + /* Sanitize final string template-safe */ + if (SAFE_FOR_TEMPLATES) { + serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' '); + serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' '); + } + + return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; + }; + + /** + * Public method to set the configuration once + * setConfig + * + * @param {Object} cfg configuration object + */ + DOMPurify.setConfig = function (cfg) { + _parseConfig(cfg); + SET_CONFIG = true; + }; + + /** + * Public method to remove the configuration + * clearConfig + * + */ + DOMPurify.clearConfig = function () { + CONFIG = null; + SET_CONFIG = false; + }; + + /** + * Public method to check if an attribute value is valid. + * Uses last set config, if any. Otherwise, uses config defaults. + * isValidAttribute + * + * @param {string} tag Tag name of containing element. + * @param {string} attr Attribute name. + * @param {string} value Attribute value. + * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false. + */ + DOMPurify.isValidAttribute = function (tag, attr, value) { + /* Initialize shared config vars if necessary. */ + if (!CONFIG) { + _parseConfig({}); + } + + var lcTag = stringToLowerCase(tag); + var lcName = stringToLowerCase(attr); + return _isValidAttribute(lcTag, lcName, value); + }; + + /** + * AddHook + * Public method to add DOMPurify hooks + * + * @param {String} entryPoint entry point for the hook to add + * @param {Function} hookFunction function to execute + */ + DOMPurify.addHook = function (entryPoint, hookFunction) { + if (typeof hookFunction !== 'function') { + return; + } + + hooks[entryPoint] = hooks[entryPoint] || []; + arrayPush(hooks[entryPoint], hookFunction); + }; + + /** + * RemoveHook + * Public method to remove a DOMPurify hook at a given entryPoint + * (pops it from the stack of hooks if more are present) + * + * @param {String} entryPoint entry point for the hook to remove + */ + DOMPurify.removeHook = function (entryPoint) { + if (hooks[entryPoint]) { + arrayPop(hooks[entryPoint]); + } + }; + + /** + * RemoveHooks + * Public method to remove all DOMPurify hooks at a given entryPoint + * + * @param {String} entryPoint entry point for the hooks to remove + */ + DOMPurify.removeHooks = function (entryPoint) { + if (hooks[entryPoint]) { + hooks[entryPoint] = []; + } + }; + + /** + * RemoveAllHooks + * Public method to remove all DOMPurify hooks + * + */ + DOMPurify.removeAllHooks = function () { + hooks = {}; + }; + + return DOMPurify; + } + + var purify = createDOMPurify(); + + return purify; + +})); +//# sourceMappingURL=purify.js.map + + +/***/ }), + +/***/ "./node_modules/html-loader/index.js!./node_modules/quill/assets/icons/header-3.svg": +/*!*********************************************************************************!*\ + !*** ./node_modules/html-loader!./node_modules/quill/assets/icons/header-3.svg ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = "<svg viewBox=\"0 0 18 18\">\n <path class=\"ql-fill\" d=\"M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z\"/>\n</svg>"; + +/***/ }), + +/***/ "./node_modules/ieee754/index.js": +/*!***************************************!*\ + !*** ./node_modules/ieee754/index.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + + +/***/ }), + +/***/ "./node_modules/isarray/index.js": +/*!***************************************!*\ + !*** ./node_modules/isarray/index.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + +/***/ }), + +/***/ "./node_modules/lodash/lodash.js": +/*!***************************************!*\ + !*** ./node_modules/lodash/lodash.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** + * @license + * Lodash <https://lodash.com/> + * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> + * Released under MIT license <https://lodash.com/license> + * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.13'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = true && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '<p>' + func(text) + '</p>'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '<p>fred, barney, & pebbles</p>' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement('<body>'); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<b><%- value %></b>'); + * compiled({ 'value': '<script>' }); + * // => '<b><script></b>' + * + * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. + * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); + * compiled({ 'users': ['fred', 'barney'] }); + * // => '<li>fred</li><li>barney</li>' + * + * // Use the internal `print` function in "evaluate" delimiters. + * var compiled = _.template('<% print("hello " + user); %>!'); + * compiled({ 'user': 'barney' }); + * // => 'hello barney!' + * + * // Use the ES template literal delimiter as an "interpolate" delimiter. + * // Disable support by replacing the "interpolate" delimiter. + * var compiled = _.template('hello ${ user }!'); + * compiled({ 'user': 'pebbles' }); + * // => 'hello pebbles!' + * + * // Use backslashes to treat delimiters as plain text. + * var compiled = _.template('<%= "\\<%- value %\\>" %>'); + * compiled({ 'value': 'ignored' }); + * // => '<%- value %>' + * + * // Use the `imports` option to import `jQuery` as `jq`. + * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; + * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); + * compiled({ 'users': ['fred', 'barney'] }); + * // => '<li>fred</li><li>barney</li>' + * + * // Use the `sourceURL` option to specify a custom sourceURL for the template. + * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); + * compiled(data); + * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. + * + * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. + * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); + * compiled.source; + * // => function(data) { + * // var __t, __p = ''; + * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; + * // return __p; + * // } + * + * // Use custom template delimiters. + * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; + * var compiled = _.template('hello {{ user }}!'); + * compiled({ 'user': 'mustache' }); + * // => 'hello mustache!' + * + * // Use the `source` property to inline compiled templates for meaningful + * // line numbers in error messages and stack traces. + * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ + * var JST = {\ + * "main": ' + _.template(mainText).source + '\ + * };\ + * '); + */ + function template(string, options, guard) { + // Based on John Resig's `tmpl` implementation + // (http://ejohn.org/blog/javascript-micro-templating/) + // and Laura Doktorova's doT.js (https://github.com/olado/doT). + var settings = lodash.templateSettings; + + if (guard && isIterateeCall(string, options, guard)) { + options = undefined; + } + string = toString(string); + options = assignInWith({}, options, settings, customDefaultsAssignIn); + + var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), + importsKeys = keys(imports), + importsValues = baseValues(imports, importsKeys); + + var isEscaping, + isEvaluating, + index = 0, + interpolate = options.interpolate || reNoMatch, + source = "__p += '"; + + // Compile the regexp to match each delimiter. + var reDelimiters = RegExp( + (options.escape || reNoMatch).source + '|' + + interpolate.source + '|' + + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + + (options.evaluate || reNoMatch).source + '|$' + , 'g'); + + // Use a sourceURL for easier debugging. + // The sourceURL gets injected into the source that's eval-ed, so be careful + // with lookup (in case of e.g. prototype pollution), and strip newlines if any. + // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection. + var sourceURL = '//# sourceURL=' + + (hasOwnProperty.call(options, 'sourceURL') + ? (options.sourceURL + '').replace(/[\r\n]/g, ' ') + : ('lodash.templateSources[' + (++templateCounter) + ']') + ) + '\n'; + + string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { + interpolateValue || (interpolateValue = esTemplateValue); + + // Escape characters that can't be included in string literals. + source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); + + // Replace delimiters with snippets. + if (escapeValue) { + isEscaping = true; + source += "' +\n__e(" + escapeValue + ") +\n'"; + } + if (evaluateValue) { + isEvaluating = true; + source += "';\n" + evaluateValue + ";\n__p += '"; + } + if (interpolateValue) { + source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; + } + index = offset + match.length; + + // The JS engine embedded in Adobe products needs `match` returned in + // order to produce the correct `offset` value. + return match; + }); + + source += "';\n"; + + // If `variable` is not specified wrap a with-statement around the generated + // code to add the data object to the top of the scope chain. + // Like with sourceURL, we take care to not check the option's prototype, + // as this configuration is a code injection vector. + var variable = hasOwnProperty.call(options, 'variable') && options.variable; + if (!variable) { + source = 'with (obj) {\n' + source + '\n}\n'; + } + // Cleanup code by stripping empty strings. + source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) + .replace(reEmptyStringMiddle, '$1') + .replace(reEmptyStringTrailing, '$1;'); + + // Frame code as the function body. + source = 'function(' + (variable || 'obj') + ') {\n' + + (variable + ? '' + : 'obj || (obj = {});\n' + ) + + "var __t, __p = ''" + + (isEscaping + ? ', __e = _.escape' + : '' + ) + + (isEvaluating + ? ', __j = Array.prototype.join;\n' + + "function print() { __p += __j.call(arguments, '') }\n" + : ';\n' + ) + + source + + 'return __p\n}'; + + var result = attempt(function() { + return Function(importsKeys, sourceURL + 'return ' + source) + .apply(undefined, importsValues); + }); + + // Provide the compiled function's source by its `toString` method or + // the `source` property as a convenience for inlining compiled templates. + result.source = source; + if (isError(result)) { + throw result; + } + return result; + } + + /** + * Converts `string`, as a whole, to lower case just like + * [String#toLowerCase](https://mdn.io/toLowerCase). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.toLower('--Foo-Bar--'); + * // => '--foo-bar--' + * + * _.toLower('fooBar'); + * // => 'foobar' + * + * _.toLower('__FOO_BAR__'); + * // => '__foo_bar__' + */ + function toLower(value) { + return toString(value).toLowerCase(); + } + + /** + * Converts `string`, as a whole, to upper case just like + * [String#toUpperCase](https://mdn.io/toUpperCase). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the upper cased string. + * @example + * + * _.toUpper('--foo-bar--'); + * // => '--FOO-BAR--' + * + * _.toUpper('fooBar'); + * // => 'FOOBAR' + * + * _.toUpper('__foo_bar__'); + * // => '__FOO_BAR__' + */ + function toUpper(value) { + return toString(value).toUpperCase(); + } + + /** + * Removes leading and trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trim(' abc '); + * // => 'abc' + * + * _.trim('-_-abc-_-', '_-'); + * // => 'abc' + * + * _.map([' foo ', ' bar '], _.trim); + * // => ['foo', 'bar'] + */ + function trim(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrim, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + chrSymbols = stringToArray(chars), + start = charsStartIndex(strSymbols, chrSymbols), + end = charsEndIndex(strSymbols, chrSymbols) + 1; + + return castSlice(strSymbols, start, end).join(''); + } + + /** + * Removes trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimEnd(' abc '); + * // => ' abc' + * + * _.trimEnd('-_-abc-_-', '_-'); + * // => '-_-abc' + */ + function trimEnd(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimEnd, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + + return castSlice(strSymbols, 0, end).join(''); + } + + /** + * Removes leading whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trimStart(' abc '); + * // => 'abc ' + * + * _.trimStart('-_-abc-_-', '_-'); + * // => 'abc-_-' + */ + function trimStart(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrimStart, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + start = charsStartIndex(strSymbols, stringToArray(chars)); + + return castSlice(strSymbols, start).join(''); + } + + /** + * Truncates `string` if it's longer than the given maximum string length. + * The last characters of the truncated string are replaced with the omission + * string which defaults to "...". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to truncate. + * @param {Object} [options={}] The options object. + * @param {number} [options.length=30] The maximum string length. + * @param {string} [options.omission='...'] The string to indicate text is omitted. + * @param {RegExp|string} [options.separator] The separator pattern to truncate to. + * @returns {string} Returns the truncated string. + * @example + * + * _.truncate('hi-diddly-ho there, neighborino'); + * // => 'hi-diddly-ho there, neighbo...' + * + * _.truncate('hi-diddly-ho there, neighborino', { + * 'length': 24, + * 'separator': ' ' + * }); + * // => 'hi-diddly-ho there,...' + * + * _.truncate('hi-diddly-ho there, neighborino', { + * 'length': 24, + * 'separator': /,? +/ + * }); + * // => 'hi-diddly-ho there...' + * + * _.truncate('hi-diddly-ho there, neighborino', { + * 'omission': ' [...]' + * }); + * // => 'hi-diddly-ho there, neig [...]' + */ + function truncate(string, options) { + var length = DEFAULT_TRUNC_LENGTH, + omission = DEFAULT_TRUNC_OMISSION; + + if (isObject(options)) { + var separator = 'separator' in options ? options.separator : separator; + length = 'length' in options ? toInteger(options.length) : length; + omission = 'omission' in options ? baseToString(options.omission) : omission; + } + string = toString(string); + + var strLength = string.length; + if (hasUnicode(string)) { + var strSymbols = stringToArray(string); + strLength = strSymbols.length; + } + if (length >= strLength) { + return string; + } + var end = length - stringSize(omission); + if (end < 1) { + return omission; + } + var result = strSymbols + ? castSlice(strSymbols, 0, end).join('') + : string.slice(0, end); + + if (separator === undefined) { + return result + omission; + } + if (strSymbols) { + end += (result.length - end); + } + if (isRegExp(separator)) { + if (string.slice(end).search(separator)) { + var match, + substring = result; + + if (!separator.global) { + separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); + } + separator.lastIndex = 0; + while ((match = separator.exec(substring))) { + var newEnd = match.index; + } + result = result.slice(0, newEnd === undefined ? end : newEnd); + } + } else if (string.indexOf(baseToString(separator), end) != end) { + var index = result.lastIndexOf(separator); + if (index > -1) { + result = result.slice(0, index); + } + } + return result + omission; + } + + /** + * The inverse of `_.escape`; this method converts the HTML entities + * `&`, `<`, `>`, `"`, and `'` in `string` to + * their corresponding characters. + * + * **Note:** No other HTML entities are unescaped. To unescape additional + * HTML entities use a third-party library like [_he_](https://mths.be/he). + * + * @static + * @memberOf _ + * @since 0.6.0 + * @category String + * @param {string} [string=''] The string to unescape. + * @returns {string} Returns the unescaped string. + * @example + * + * _.unescape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function unescape(string) { + string = toString(string); + return (string && reHasEscapedHtml.test(string)) + ? string.replace(reEscapedHtml, unescapeHtmlChar) + : string; + } + + /** + * Converts `string`, as space separated words, to upper case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the upper cased string. + * @example + * + * _.upperCase('--foo-bar'); + * // => 'FOO BAR' + * + * _.upperCase('fooBar'); + * // => 'FOO BAR' + * + * _.upperCase('__foo_bar__'); + * // => 'FOO BAR' + */ + var upperCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toUpperCase(); + }); + + /** + * Converts the first character of `string` to upper case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.upperFirst('fred'); + * // => 'Fred' + * + * _.upperFirst('FRED'); + * // => 'FRED' + */ + var upperFirst = createCaseFirst('toUpperCase'); + + /** + * Splits `string` into an array of its words. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {RegExp|string} [pattern] The pattern to match words. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the words of `string`. + * @example + * + * _.words('fred, barney, & pebbles'); + * // => ['fred', 'barney', 'pebbles'] + * + * _.words('fred, barney, & pebbles', /[^, ]+/g); + * // => ['fred', 'barney', '&', 'pebbles'] + */ + function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? undefined : pattern; + + if (pattern === undefined) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + return string.match(pattern) || []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the `func` result or error object. + * @example + * + * // Avoid throwing errors for invalid selectors. + * var elements = _.attempt(function(selector) { + * return document.querySelectorAll(selector); + * }, '>_>'); + * + * if (_.isError(elements)) { + * elements = []; + * } + */ + var attempt = baseRest(function(func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } + }); + + /** + * Binds methods of an object to the object itself, overwriting the existing + * method. + * + * **Note:** This method doesn't set the "length" property of bound functions. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} methodNames The object method names to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'click': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); + * // => Logs 'clicked docs' when clicked. + */ + var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { + key = toKey(key); + baseAssignValue(object, key, bind(object[key], object)); + }); + return object; + }); + + /** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ + function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, + toIteratee = getIteratee(); + + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + + return baseRest(function(args) { + var index = -1; + while (++index < length) { + var pair = pairs[index]; + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } + }); + } + + /** + * Creates a function that invokes the predicate properties of `source` with + * the corresponding property values of a given object, returning `true` if + * all predicates return truthy, else `false`. + * + * **Note:** The created function is equivalent to `_.conformsTo` with + * `source` partially applied. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } + * ]; + * + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] + */ + function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); + } + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + /** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 + */ + function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; + } + + /** + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flowRight + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow([_.add, square]); + * addSquare(1, 2); + * // => 9 + */ + var flow = createFlow(); + + /** + * This method is like `_.flow` except that it creates a function that + * invokes the given functions from right to left. + * + * @static + * @since 3.0.0 + * @memberOf _ + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flow + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight([square, _.add]); + * addSquare(1, 2); + * // => 9 + */ + var flowRight = createFlow(true); + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ + function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); + } + + /** + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; + * + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + */ + function matches(source) { + return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); + } + + /** + * Creates a function that performs a partial deep comparison between the + * value at `path` of a given object to `srcValue`, returning `true` if the + * object value is equivalent, else `false`. + * + * **Note:** Partial comparisons will match empty array and empty object + * `srcValue` values against any array or object value, respectively. See + * `_.isEqual` for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; + * + * _.find(objects, _.matchesProperty('a', 4)); + * // => { 'a': 4, 'b': 5, 'c': 6 } + */ + function matchesProperty(path, srcValue) { + return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); + } + + /** + * Creates a function that invokes the method at `path` of a given object. + * Any additional arguments are provided to the invoked method. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Util + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {Function} Returns the new invoker function. + * @example + * + * var objects = [ + * { 'a': { 'b': _.constant(2) } }, + * { 'a': { 'b': _.constant(1) } } + * ]; + * + * _.map(objects, _.method('a.b')); + * // => [2, 1] + * + * _.map(objects, _.method(['a', 'b'])); + * // => [2, 1] + */ + var method = baseRest(function(path, args) { + return function(object) { + return baseInvoke(object, path, args); + }; + }); + + /** + * The opposite of `_.method`; this method creates a function that invokes + * the method at a given path of `object`. Any additional arguments are + * provided to the invoked method. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Util + * @param {Object} object The object to query. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {Function} Returns the new invoker function. + * @example + * + * var array = _.times(3, _.constant), + * object = { 'a': array, 'b': array, 'c': array }; + * + * _.map(['a[2]', 'c[0]'], _.methodOf(object)); + * // => [2, 0] + * + * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); + * // => [2, 0] + */ + var methodOf = baseRest(function(object, args) { + return function(path) { + return baseInvoke(object, path, args); + }; + }); + + /** + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. + * @example + * + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); + * } + * + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] + * + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] + */ + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && + !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + + arrayEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + + return object; + } + + /** + * Reverts the `_` variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + return this; + } + + /** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ + function noop() { + // No operation performed. + } + + /** + * Creates a function that gets the argument at index `n`. If `n` is negative, + * the nth argument from the end is returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {number} [n=0] The index of the argument to return. + * @returns {Function} Returns the new pass-thru function. + * @example + * + * var func = _.nthArg(1); + * func('a', 'b', 'c', 'd'); + * // => 'b' + * + * var func = _.nthArg(-2); + * func('a', 'b', 'c', 'd'); + * // => 'c' + */ + function nthArg(n) { + n = toInteger(n); + return baseRest(function(args) { + return baseNth(args, n); + }); + } + + /** + * Creates a function that invokes `iteratees` with the arguments it receives + * and returns their results. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to invoke. + * @returns {Function} Returns the new function. + * @example + * + * var func = _.over([Math.max, Math.min]); + * + * func(1, 2, 3, 4); + * // => [4, 1] + */ + var over = createOver(arrayMap); + + /** + * Creates a function that checks if **all** of the `predicates` return + * truthy when invoked with the arguments it receives. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. + * @returns {Function} Returns the new function. + * @example + * + * var func = _.overEvery([Boolean, isFinite]); + * + * func('1'); + * // => true + * + * func(null); + * // => false + * + * func(NaN); + * // => false + */ + var overEvery = createOver(arrayEvery); + + /** + * Creates a function that checks if **any** of the `predicates` return + * truthy when invoked with the arguments it receives. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. + * @returns {Function} Returns the new function. + * @example + * + * var func = _.overSome([Boolean, isFinite]); + * + * func('1'); + * // => true + * + * func(null); + * // => true + * + * func(NaN); + * // => false + */ + var overSome = createOver(arraySome); + + /** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + } + + /** + * The opposite of `_.property`; this method creates a function that returns + * the value at a given path of `object`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + * @example + * + * var array = [0, 1, 2], + * object = { 'a': array, 'b': array, 'c': array }; + * + * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); + * // => [2, 0] + * + * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); + * // => [2, 0] + */ + function propertyOf(object) { + return function(path) { + return object == null ? undefined : baseGet(object, path); + }; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to, but not including, `end`. A step of `-1` is used if a negative + * `start` is specified without an `end` or `step`. If `end` is not specified, + * it's set to `start` with `start` then set to `0`. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the range of numbers. + * @see _.inRange, _.rangeRight + * @example + * + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(-4); + * // => [0, -1, -2, -3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */ + var range = createRange(); + + /** + * This method is like `_.range` except that it populates values in + * descending order. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the range of numbers. + * @see _.inRange, _.range + * @example + * + * _.rangeRight(4); + * // => [3, 2, 1, 0] + * + * _.rangeRight(-4); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 5); + * // => [4, 3, 2, 1] + * + * _.rangeRight(0, 20, 5); + * // => [15, 10, 5, 0] + * + * _.rangeRight(0, -4, -1); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 4, 0); + * // => [1, 1, 1] + * + * _.rangeRight(0); + * // => [] + */ + var rangeRight = createRange(true); + + /** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ + function stubArray() { + return []; + } + + /** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ + function stubFalse() { + return false; + } + + /** + * This method returns a new empty object. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Object} Returns the new empty object. + * @example + * + * var objects = _.times(2, _.stubObject); + * + * console.log(objects); + * // => [{}, {}] + * + * console.log(objects[0] === objects[1]); + * // => false + */ + function stubObject() { + return {}; + } + + /** + * This method returns an empty string. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {string} Returns the empty string. + * @example + * + * _.times(2, _.stubString); + * // => ['', ''] + */ + function stubString() { + return ''; + } + + /** + * This method returns `true`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `true`. + * @example + * + * _.times(2, _.stubTrue); + * // => [true, true] + */ + function stubTrue() { + return true; + } + + /** + * Invokes the iteratee `n` times, returning an array of the results of + * each invocation. The iteratee is invoked with one argument; (index). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of results. + * @example + * + * _.times(3, String); + * // => ['0', '1', '2'] + * + * _.times(4, _.constant(0)); + * // => [0, 0, 0, 0] + */ + function times(n, iteratee) { + n = toInteger(n); + if (n < 1 || n > MAX_SAFE_INTEGER) { + return []; + } + var index = MAX_ARRAY_LENGTH, + length = nativeMin(n, MAX_ARRAY_LENGTH); + + iteratee = getIteratee(iteratee); + n -= MAX_ARRAY_LENGTH; + + var result = baseTimes(length, iteratee); + while (++index < n) { + iteratee(index); + } + return result; + } + + /** + * Converts `value` to a property path array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + */ + function toPath(value) { + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); + } + + /** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + /*------------------------------------------------------------------------*/ + + /** + * Adds two numbers. + * + * @static + * @memberOf _ + * @since 3.4.0 + * @category Math + * @param {number} augend The first number in an addition. + * @param {number} addend The second number in an addition. + * @returns {number} Returns the total. + * @example + * + * _.add(6, 4); + * // => 10 + */ + var add = createMathOperation(function(augend, addend) { + return augend + addend; + }, 0); + + /** + * Computes `number` rounded up to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round up. + * @param {number} [precision=0] The precision to round up to. + * @returns {number} Returns the rounded up number. + * @example + * + * _.ceil(4.006); + * // => 5 + * + * _.ceil(6.004, 2); + * // => 6.01 + * + * _.ceil(6040, -2); + * // => 6100 + */ + var ceil = createRound('ceil'); + + /** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ + var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; + }, 1); + + /** + * Computes `number` rounded down to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round down. + * @param {number} [precision=0] The precision to round down to. + * @returns {number} Returns the rounded down number. + * @example + * + * _.floor(4.006); + * // => 4 + * + * _.floor(0.046, 2); + * // => 0.04 + * + * _.floor(4060, -2); + * // => 4000 + */ + var floor = createRound('floor'); + + /** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ + function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; + } + + /** + * This method is like `_.max` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {*} Returns the maximum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.maxBy(objects, function(o) { return o.n; }); + * // => { 'n': 2 } + * + * // The `_.property` iteratee shorthand. + * _.maxBy(objects, 'n'); + * // => { 'n': 2 } + */ + function maxBy(array, iteratee) { + return (array && array.length) + ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) + : undefined; + } + + /** + * Computes the mean of the values in `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Math + * @param {Array} array The array to iterate over. + * @returns {number} Returns the mean. + * @example + * + * _.mean([4, 2, 8, 6]); + * // => 5 + */ + function mean(array) { + return baseMean(array, identity); + } + + /** + * This method is like `_.mean` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be averaged. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the mean. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.meanBy(objects, function(o) { return o.n; }); + * // => 5 + * + * // The `_.property` iteratee shorthand. + * _.meanBy(objects, 'n'); + * // => 5 + */ + function meanBy(array, iteratee) { + return baseMean(array, getIteratee(iteratee, 2)); + } + + /** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */ + function min(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseLt) + : undefined; + } + + /** + * This method is like `_.min` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {*} Returns the minimum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.minBy(objects, function(o) { return o.n; }); + * // => { 'n': 1 } + * + * // The `_.property` iteratee shorthand. + * _.minBy(objects, 'n'); + * // => { 'n': 1 } + */ + function minBy(array, iteratee) { + return (array && array.length) + ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) + : undefined; + } + + /** + * Multiply two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} multiplier The first number in a multiplication. + * @param {number} multiplicand The second number in a multiplication. + * @returns {number} Returns the product. + * @example + * + * _.multiply(6, 4); + * // => 24 + */ + var multiply = createMathOperation(function(multiplier, multiplicand) { + return multiplier * multiplicand; + }, 1); + + /** + * Computes `number` rounded to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round. + * @param {number} [precision=0] The precision to round to. + * @returns {number} Returns the rounded number. + * @example + * + * _.round(4.006); + * // => 4 + * + * _.round(4.006, 2); + * // => 4.01 + * + * _.round(4060, -2); + * // => 4100 + */ + var round = createRound('round'); + + /** + * Subtract two numbers. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Math + * @param {number} minuend The first number in a subtraction. + * @param {number} subtrahend The second number in a subtraction. + * @returns {number} Returns the difference. + * @example + * + * _.subtract(6, 4); + * // => 2 + */ + var subtract = createMathOperation(function(minuend, subtrahend) { + return minuend - subtrahend; + }, 0); + + /** + * Computes the sum of the values in `array`. + * + * @static + * @memberOf _ + * @since 3.4.0 + * @category Math + * @param {Array} array The array to iterate over. + * @returns {number} Returns the sum. + * @example + * + * _.sum([4, 2, 8, 6]); + * // => 20 + */ + function sum(array) { + return (array && array.length) + ? baseSum(array, identity) + : 0; + } + + /** + * This method is like `_.sum` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be summed. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the sum. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.sumBy(objects, function(o) { return o.n; }); + * // => 20 + * + * // The `_.property` iteratee shorthand. + * _.sumBy(objects, 'n'); + * // => 20 + */ + function sumBy(array, iteratee) { + return (array && array.length) + ? baseSum(array, getIteratee(iteratee, 2)) + : 0; + } + + /*------------------------------------------------------------------------*/ + + // Add methods that return wrapped values in chain sequences. + lodash.after = after; + lodash.ary = ary; + lodash.assign = assign; + lodash.assignIn = assignIn; + lodash.assignInWith = assignInWith; + lodash.assignWith = assignWith; + lodash.at = at; + lodash.before = before; + lodash.bind = bind; + lodash.bindAll = bindAll; + lodash.bindKey = bindKey; + lodash.castArray = castArray; + lodash.chain = chain; + lodash.chunk = chunk; + lodash.compact = compact; + lodash.concat = concat; + lodash.cond = cond; + lodash.conforms = conforms; + lodash.constant = constant; + lodash.countBy = countBy; + lodash.create = create; + lodash.curry = curry; + lodash.curryRight = curryRight; + lodash.debounce = debounce; + lodash.defaults = defaults; + lodash.defaultsDeep = defaultsDeep; + lodash.defer = defer; + lodash.delay = delay; + lodash.difference = difference; + lodash.differenceBy = differenceBy; + lodash.differenceWith = differenceWith; + lodash.drop = drop; + lodash.dropRight = dropRight; + lodash.dropRightWhile = dropRightWhile; + lodash.dropWhile = dropWhile; + lodash.fill = fill; + lodash.filter = filter; + lodash.flatMap = flatMap; + lodash.flatMapDeep = flatMapDeep; + lodash.flatMapDepth = flatMapDepth; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.flattenDepth = flattenDepth; + lodash.flip = flip; + lodash.flow = flow; + lodash.flowRight = flowRight; + lodash.fromPairs = fromPairs; + lodash.functions = functions; + lodash.functionsIn = functionsIn; + lodash.groupBy = groupBy; + lodash.initial = initial; + lodash.intersection = intersection; + lodash.intersectionBy = intersectionBy; + lodash.intersectionWith = intersectionWith; + lodash.invert = invert; + lodash.invertBy = invertBy; + lodash.invokeMap = invokeMap; + lodash.iteratee = iteratee; + lodash.keyBy = keyBy; + lodash.keys = keys; + lodash.keysIn = keysIn; + lodash.map = map; + lodash.mapKeys = mapKeys; + lodash.mapValues = mapValues; + lodash.matches = matches; + lodash.matchesProperty = matchesProperty; + lodash.memoize = memoize; + lodash.merge = merge; + lodash.mergeWith = mergeWith; + lodash.method = method; + lodash.methodOf = methodOf; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.nthArg = nthArg; + lodash.omit = omit; + lodash.omitBy = omitBy; + lodash.once = once; + lodash.orderBy = orderBy; + lodash.over = over; + lodash.overArgs = overArgs; + lodash.overEvery = overEvery; + lodash.overSome = overSome; + lodash.partial = partial; + lodash.partialRight = partialRight; + lodash.partition = partition; + lodash.pick = pick; + lodash.pickBy = pickBy; + lodash.property = property; + lodash.propertyOf = propertyOf; + lodash.pull = pull; + lodash.pullAll = pullAll; + lodash.pullAllBy = pullAllBy; + lodash.pullAllWith = pullAllWith; + lodash.pullAt = pullAt; + lodash.range = range; + lodash.rangeRight = rangeRight; + lodash.rearg = rearg; + lodash.reject = reject; + lodash.remove = remove; + lodash.rest = rest; + lodash.reverse = reverse; + lodash.sampleSize = sampleSize; + lodash.set = set; + lodash.setWith = setWith; + lodash.shuffle = shuffle; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.sortedUniq = sortedUniq; + lodash.sortedUniqBy = sortedUniqBy; + lodash.split = split; + lodash.spread = spread; + lodash.tail = tail; + lodash.take = take; + lodash.takeRight = takeRight; + lodash.takeRightWhile = takeRightWhile; + lodash.takeWhile = takeWhile; + lodash.tap = tap; + lodash.throttle = throttle; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.toPairs = toPairs; + lodash.toPairsIn = toPairsIn; + lodash.toPath = toPath; + lodash.toPlainObject = toPlainObject; + lodash.transform = transform; + lodash.unary = unary; + lodash.union = union; + lodash.unionBy = unionBy; + lodash.unionWith = unionWith; + lodash.uniq = uniq; + lodash.uniqBy = uniqBy; + lodash.uniqWith = uniqWith; + lodash.unset = unset; + lodash.unzip = unzip; + lodash.unzipWith = unzipWith; + lodash.update = update; + lodash.updateWith = updateWith; + lodash.values = values; + lodash.valuesIn = valuesIn; + lodash.without = without; + lodash.words = words; + lodash.wrap = wrap; + lodash.xor = xor; + lodash.xorBy = xorBy; + lodash.xorWith = xorWith; + lodash.zip = zip; + lodash.zipObject = zipObject; + lodash.zipObjectDeep = zipObjectDeep; + lodash.zipWith = zipWith; + + // Add aliases. + lodash.entries = toPairs; + lodash.entriesIn = toPairsIn; + lodash.extend = assignIn; + lodash.extendWith = assignInWith; + + // Add methods to `lodash.prototype`. + mixin(lodash, lodash); + + /*------------------------------------------------------------------------*/ + + // Add methods that return unwrapped values in chain sequences. + lodash.add = add; + lodash.attempt = attempt; + lodash.camelCase = camelCase; + lodash.capitalize = capitalize; + lodash.ceil = ceil; + lodash.clamp = clamp; + lodash.clone = clone; + lodash.cloneDeep = cloneDeep; + lodash.cloneDeepWith = cloneDeepWith; + lodash.cloneWith = cloneWith; + lodash.conformsTo = conformsTo; + lodash.deburr = deburr; + lodash.defaultTo = defaultTo; + lodash.divide = divide; + lodash.endsWith = endsWith; + lodash.eq = eq; + lodash.escape = escape; + lodash.escapeRegExp = escapeRegExp; + lodash.every = every; + lodash.find = find; + lodash.findIndex = findIndex; + lodash.findKey = findKey; + lodash.findLast = findLast; + lodash.findLastIndex = findLastIndex; + lodash.findLastKey = findLastKey; + lodash.floor = floor; + lodash.forEach = forEach; + lodash.forEachRight = forEachRight; + lodash.forIn = forIn; + lodash.forInRight = forInRight; + lodash.forOwn = forOwn; + lodash.forOwnRight = forOwnRight; + lodash.get = get; + lodash.gt = gt; + lodash.gte = gte; + lodash.has = has; + lodash.hasIn = hasIn; + lodash.head = head; + lodash.identity = identity; + lodash.includes = includes; + lodash.indexOf = indexOf; + lodash.inRange = inRange; + lodash.invoke = invoke; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isArrayBuffer = isArrayBuffer; + lodash.isArrayLike = isArrayLike; + lodash.isArrayLikeObject = isArrayLikeObject; + lodash.isBoolean = isBoolean; + lodash.isBuffer = isBuffer; + lodash.isDate = isDate; + lodash.isElement = isElement; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isEqualWith = isEqualWith; + lodash.isError = isError; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isInteger = isInteger; + lodash.isLength = isLength; + lodash.isMap = isMap; + lodash.isMatch = isMatch; + lodash.isMatchWith = isMatchWith; + lodash.isNaN = isNaN; + lodash.isNative = isNative; + lodash.isNil = isNil; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isObjectLike = isObjectLike; + lodash.isPlainObject = isPlainObject; + lodash.isRegExp = isRegExp; + lodash.isSafeInteger = isSafeInteger; + lodash.isSet = isSet; + lodash.isString = isString; + lodash.isSymbol = isSymbol; + lodash.isTypedArray = isTypedArray; + lodash.isUndefined = isUndefined; + lodash.isWeakMap = isWeakMap; + lodash.isWeakSet = isWeakSet; + lodash.join = join; + lodash.kebabCase = kebabCase; + lodash.last = last; + lodash.lastIndexOf = lastIndexOf; + lodash.lowerCase = lowerCase; + lodash.lowerFirst = lowerFirst; + lodash.lt = lt; + lodash.lte = lte; + lodash.max = max; + lodash.maxBy = maxBy; + lodash.mean = mean; + lodash.meanBy = meanBy; + lodash.min = min; + lodash.minBy = minBy; + lodash.stubArray = stubArray; + lodash.stubFalse = stubFalse; + lodash.stubObject = stubObject; + lodash.stubString = stubString; + lodash.stubTrue = stubTrue; + lodash.multiply = multiply; + lodash.nth = nth; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.now = now; + lodash.pad = pad; + lodash.padEnd = padEnd; + lodash.padStart = padStart; + lodash.parseInt = parseInt; + lodash.random = random; + lodash.reduce = reduce; + lodash.reduceRight = reduceRight; + lodash.repeat = repeat; + lodash.replace = replace; + lodash.result = result; + lodash.round = round; + lodash.runInContext = runInContext; + lodash.sample = sample; + lodash.size = size; + lodash.snakeCase = snakeCase; + lodash.some = some; + lodash.sortedIndex = sortedIndex; + lodash.sortedIndexBy = sortedIndexBy; + lodash.sortedIndexOf = sortedIndexOf; + lodash.sortedLastIndex = sortedLastIndex; + lodash.sortedLastIndexBy = sortedLastIndexBy; + lodash.sortedLastIndexOf = sortedLastIndexOf; + lodash.startCase = startCase; + lodash.startsWith = startsWith; + lodash.subtract = subtract; + lodash.sum = sum; + lodash.sumBy = sumBy; + lodash.template = template; + lodash.times = times; + lodash.toFinite = toFinite; + lodash.toInteger = toInteger; + lodash.toLength = toLength; + lodash.toLower = toLower; + lodash.toNumber = toNumber; + lodash.toSafeInteger = toSafeInteger; + lodash.toString = toString; + lodash.toUpper = toUpper; + lodash.trim = trim; + lodash.trimEnd = trimEnd; + lodash.trimStart = trimStart; + lodash.truncate = truncate; + lodash.unescape = unescape; + lodash.uniqueId = uniqueId; + lodash.upperCase = upperCase; + lodash.upperFirst = upperFirst; + + // Add aliases. + lodash.each = forEach; + lodash.eachRight = forEachRight; + lodash.first = head; + + mixin(lodash, (function() { + var source = {}; + baseForOwn(lodash, function(func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }()), { 'chain': false }); + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + // Assign default placeholders. + arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { + lodash[methodName].placeholder = lodash; + }); + + // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. + arrayEach(['drop', 'take'], function(methodName, index) { + LazyWrapper.prototype[methodName] = function(n) { + n = n === undefined ? 1 : nativeMax(toInteger(n), 0); + + var result = (this.__filtered__ && !index) + ? new LazyWrapper(this) + : this.clone(); + + if (result.__filtered__) { + result.__takeCount__ = nativeMin(n, result.__takeCount__); + } else { + result.__views__.push({ + 'size': nativeMin(n, MAX_ARRAY_LENGTH), + 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') + }); + } + return result; + }; + + LazyWrapper.prototype[methodName + 'Right'] = function(n) { + return this.reverse()[methodName](n).reverse(); + }; + }); + + // Add `LazyWrapper` methods that accept an `iteratee` value. + arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { + var type = index + 1, + isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; + + LazyWrapper.prototype[methodName] = function(iteratee) { + var result = this.clone(); + result.__iteratees__.push({ + 'iteratee': getIteratee(iteratee, 3), + 'type': type + }); + result.__filtered__ = result.__filtered__ || isFilter; + return result; + }; + }); + + // Add `LazyWrapper` methods for `_.head` and `_.last`. + arrayEach(['head', 'last'], function(methodName, index) { + var takeName = 'take' + (index ? 'Right' : ''); + + LazyWrapper.prototype[methodName] = function() { + return this[takeName](1).value()[0]; + }; + }); + + // Add `LazyWrapper` methods for `_.initial` and `_.tail`. + arrayEach(['initial', 'tail'], function(methodName, index) { + var dropName = 'drop' + (index ? '' : 'Right'); + + LazyWrapper.prototype[methodName] = function() { + return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); + }; + }); + + LazyWrapper.prototype.compact = function() { + return this.filter(identity); + }; + + LazyWrapper.prototype.find = function(predicate) { + return this.filter(predicate).head(); + }; + + LazyWrapper.prototype.findLast = function(predicate) { + return this.reverse().find(predicate); + }; + + LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { + if (typeof path == 'function') { + return new LazyWrapper(this); + } + return this.map(function(value) { + return baseInvoke(value, path, args); + }); + }); + + LazyWrapper.prototype.reject = function(predicate) { + return this.filter(negate(getIteratee(predicate))); + }; + + LazyWrapper.prototype.slice = function(start, end) { + start = toInteger(start); + + var result = this; + if (result.__filtered__ && (start > 0 || end < 0)) { + return new LazyWrapper(result); + } + if (start < 0) { + result = result.takeRight(-start); + } else if (start) { + result = result.drop(start); + } + if (end !== undefined) { + end = toInteger(end); + result = end < 0 ? result.dropRight(-end) : result.take(end - start); + } + return result; + }; + + LazyWrapper.prototype.takeRightWhile = function(predicate) { + return this.reverse().takeWhile(predicate).reverse(); + }; + + LazyWrapper.prototype.toArray = function() { + return this.take(MAX_ARRAY_LENGTH); + }; + + // Add `LazyWrapper` methods to `lodash.prototype`. + baseForOwn(LazyWrapper.prototype, function(func, methodName) { + var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), + isTaker = /^(?:head|last)$/.test(methodName), + lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], + retUnwrapped = isTaker || /^find/.test(methodName); + + if (!lodashFunc) { + return; + } + lodash.prototype[methodName] = function() { + var value = this.__wrapped__, + args = isTaker ? [1] : arguments, + isLazy = value instanceof LazyWrapper, + iteratee = args[0], + useLazy = isLazy || isArray(value); + + var interceptor = function(value) { + var result = lodashFunc.apply(lodash, arrayPush([value], args)); + return (isTaker && chainAll) ? result[0] : result; + }; + + if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { + // Avoid lazy use if the iteratee has a "length" value other than `1`. + isLazy = useLazy = false; + } + var chainAll = this.__chain__, + isHybrid = !!this.__actions__.length, + isUnwrapped = retUnwrapped && !chainAll, + onlyLazy = isLazy && !isHybrid; + + if (!retUnwrapped && useLazy) { + value = onlyLazy ? value : new LazyWrapper(this); + var result = func.apply(value, args); + result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); + return new LodashWrapper(result, chainAll); + } + if (isUnwrapped && onlyLazy) { + return func.apply(this, args); + } + result = this.thru(interceptor); + return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; + }; + }); + + // Add `Array` methods to `lodash.prototype`. + arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + var func = arrayProto[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|shift)$/.test(methodName); + + lodash.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + return this[chainName](function(value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + + // Map minified method names to their real names. + baseForOwn(LazyWrapper.prototype, function(func, methodName) { + var lodashFunc = lodash[methodName]; + if (lodashFunc) { + var key = lodashFunc.name + ''; + if (!hasOwnProperty.call(realNames, key)) { + realNames[key] = []; + } + realNames[key].push({ 'name': methodName, 'func': lodashFunc }); + } + }); + + realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ + 'name': 'wrapper', + 'func': undefined + }]; + + // Add methods to `LazyWrapper`. + LazyWrapper.prototype.clone = lazyClone; + LazyWrapper.prototype.reverse = lazyReverse; + LazyWrapper.prototype.value = lazyValue; + + // Add chain sequence methods to the `lodash` wrapper. + lodash.prototype.at = wrapperAt; + lodash.prototype.chain = wrapperChain; + lodash.prototype.commit = wrapperCommit; + lodash.prototype.next = wrapperNext; + lodash.prototype.plant = wrapperPlant; + lodash.prototype.reverse = wrapperReverse; + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + + // Add lazy aliases. + lodash.prototype.first = lodash.prototype.head; + + if (symIterator) { + lodash.prototype[symIterator] = wrapperToIterator; + } + return lodash; + }); + + /*--------------------------------------------------------------------------*/ + + // Export lodash. + var _ = runInContext(); + + // Some AMD build optimizers, like r.js, check for condition patterns like: + if (true) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = _; + + // Define as an anonymous module so, through path mapping, it can be + // referenced as the "underscore" module. + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { + return _; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } + // Check for `exports` after `define` in case a build optimizer adds it. + else {} +}.call(this)); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/moment/moment.js": +/*!***************************************!*\ + !*** ./node_modules/moment/moment.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js + +;(function (global, factory) { + true ? module.exports = factory() : + undefined +}(this, (function () { 'use strict'; + + var hookCallback; + + function hooks () { + return hookCallback.apply(null, arguments); + } + + // This is done to register the method called with moment() + // without creating circular dependencies. + function setHookCallback (callback) { + hookCallback = callback; + } + + function isArray(input) { + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; + } + + function isObject(input) { + // IE8 will treat undefined and null as object if it wasn't for + // input != null + return input != null && Object.prototype.toString.call(input) === '[object Object]'; + } + + function isObjectEmpty(obj) { + if (Object.getOwnPropertyNames) { + return (Object.getOwnPropertyNames(obj).length === 0); + } else { + var k; + for (k in obj) { + if (obj.hasOwnProperty(k)) { + return false; + } + } + return true; + } + } + + function isUndefined(input) { + return input === void 0; + } + + function isNumber(input) { + return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; + } + + function isDate(input) { + return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; + } + + function map(arr, fn) { + var res = [], i; + for (i = 0; i < arr.length; ++i) { + res.push(fn(arr[i], i)); + } + return res; + } + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; + } + } + + if (hasOwnProp(b, 'toString')) { + a.toString = b.toString; + } + + if (hasOwnProp(b, 'valueOf')) { + a.valueOf = b.valueOf; + } + + return a; + } + + function createUTC (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, true).utc(); + } + + function defaultParsingFlags() { + // We need to deep clone this object. + return { + empty : false, + unusedTokens : [], + unusedInput : [], + overflow : -2, + charsLeftOver : 0, + nullInput : false, + invalidMonth : null, + invalidFormat : false, + userInvalidated : false, + iso : false, + parsedDateParts : [], + meridiem : null, + rfc2822 : false, + weekdayMismatch : false + }; + } + + function getParsingFlags(m) { + if (m._pf == null) { + m._pf = defaultParsingFlags(); + } + return m._pf; + } + + var some; + if (Array.prototype.some) { + some = Array.prototype.some; + } else { + some = function (fun) { + var t = Object(this); + var len = t.length >>> 0; + + for (var i = 0; i < len; i++) { + if (i in t && fun.call(this, t[i], i, t)) { + return true; + } + } + + return false; + }; + } + + function isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + var parsedParts = some.call(flags.parsedDateParts, function (i) { + return i != null; + }); + var isNowValid = !isNaN(m._d.getTime()) && + flags.overflow < 0 && + !flags.empty && + !flags.invalidMonth && + !flags.invalidWeekday && + !flags.weekdayMismatch && + !flags.nullInput && + !flags.invalidFormat && + !flags.userInvalidated && + (!flags.meridiem || (flags.meridiem && parsedParts)); + + if (m._strict) { + isNowValid = isNowValid && + flags.charsLeftOver === 0 && + flags.unusedTokens.length === 0 && + flags.bigHour === undefined; + } + + if (Object.isFrozen == null || !Object.isFrozen(m)) { + m._isValid = isNowValid; + } + else { + return isNowValid; + } + } + return m._isValid; + } + + function createInvalid (flags) { + var m = createUTC(NaN); + if (flags != null) { + extend(getParsingFlags(m), flags); + } + else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. + var momentProperties = hooks.momentProperties = []; + + function copyConfig(to, from) { + var i, prop, val; + + if (!isUndefined(from._isAMomentObject)) { + to._isAMomentObject = from._isAMomentObject; + } + if (!isUndefined(from._i)) { + to._i = from._i; + } + if (!isUndefined(from._f)) { + to._f = from._f; + } + if (!isUndefined(from._l)) { + to._l = from._l; + } + if (!isUndefined(from._strict)) { + to._strict = from._strict; + } + if (!isUndefined(from._tzm)) { + to._tzm = from._tzm; + } + if (!isUndefined(from._isUTC)) { + to._isUTC = from._isUTC; + } + if (!isUndefined(from._offset)) { + to._offset = from._offset; + } + if (!isUndefined(from._pf)) { + to._pf = getParsingFlags(from); + } + if (!isUndefined(from._locale)) { + to._locale = from._locale; + } + + if (momentProperties.length > 0) { + for (i = 0; i < momentProperties.length; i++) { + prop = momentProperties[i]; + val = from[prop]; + if (!isUndefined(val)) { + to[prop] = val; + } + } + } + + return to; + } + + var updateInProgress = false; + + // Moment prototype object + function Moment(config) { + copyConfig(this, config); + this._d = new Date(config._d != null ? config._d.getTime() : NaN); + if (!this.isValid()) { + this._d = new Date(NaN); + } + // Prevent infinite loop in case updateOffset creates new moment + // objects. + if (updateInProgress === false) { + updateInProgress = true; + hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment (obj) { + return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); + } + + function absFloor (number) { + if (number < 0) { + // -0 -> 0 + return Math.ceil(number) || 0; + } else { + return Math.floor(number); + } + } + + function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, + value = 0; + + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + + return value; + } + + // compare two arrays, return the number of differences + function compareArrays(array1, array2, dontConvert) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + for (i = 0; i < len; i++) { + if ((dontConvert && array1[i] !== array2[i]) || + (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { + diffs++; + } + } + return diffs + lengthDiff; + } + + function warn(msg) { + if (hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(null, msg); + } + if (firstTime) { + var args = []; + var arg; + for (var i = 0; i < arguments.length; i++) { + arg = ''; + if (typeof arguments[i] === 'object') { + arg += '\n[' + i + '] '; + for (var key in arguments[0]) { + arg += key + ': ' + arguments[0][key] + ', '; + } + arg = arg.slice(0, -2); // Remove trailing comma and space + } else { + arg = arguments[i]; + } + args.push(arg); + } + warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(name, msg); + } + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + hooks.suppressDeprecationWarnings = false; + hooks.deprecationHandler = null; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. + // TODO: Remove "ordinalParse" fallback in next major release. + this._dayOfMonthOrdinalParseLenient = new RegExp( + (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + + '|' + (/\d{1,2}/).source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + for (prop in parentConfig) { + if (hasOwnProp(parentConfig, prop) && + !hasOwnProp(childConfig, prop) && + isObject(parentConfig[prop])) { + // make sure changes to properties don't modify parent config + res[prop] = extend({}, res[prop]); + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } + } + + var keys; + + if (Object.keys) { + keys = Object.keys; + } else { + keys = function (obj) { + var i, res = []; + for (i in obj) { + if (hasOwnProp(obj, i)) { + res.push(i); + } + } + return res; + }; + } + + var defaultCalendar = { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }; + + function calendar (key, mom, now) { + var output = this._calendar[key] || this._calendar['sameElse']; + return isFunction(output) ? output.call(mom, now) : output; + } + + var defaultLongDateFormat = { + LTS : 'h:mm:ss A', + LT : 'h:mm A', + L : 'MM/DD/YYYY', + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' + }; + + function longDateFormat (key) { + var format = this._longDateFormat[key], + formatUpper = this._longDateFormat[key.toUpperCase()]; + + if (format || !formatUpper) { + return format; + } + + this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { + return val.slice(1); + }); + + return this._longDateFormat[key]; + } + + var defaultInvalidDate = 'Invalid date'; + + function invalidDate () { + return this._invalidDate; + } + + var defaultOrdinal = '%d'; + var defaultDayOfMonthOrdinalParse = /\d{1,2}/; + + function ordinal (number) { + return this._ordinal.replace('%d', number); + } + + var defaultRelativeTime = { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + ss : '%d seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }; + + function relativeTime (number, withoutSuffix, string, isFuture) { + var output = this._relativeTime[string]; + return (isFunction(output)) ? + output(number, withoutSuffix, string, isFuture) : + output.replace(/%d/i, number); + } + + function pastFuture (diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return isFunction(format) ? format(output) : format.replace(/%s/i, output); + } + + var aliases = {}; + + function addUnitAlias (unit, shorthand) { + var lowerCase = unit.toLowerCase(); + aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; + } + + function normalizeUnits(units) { + return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; + } + + function normalizeObjectUnits(inputObject) { + var normalizedInput = {}, + normalizedProp, + prop; + + for (prop in inputObject) { + if (hasOwnProp(inputObject, prop)) { + normalizedProp = normalizeUnits(prop); + if (normalizedProp) { + normalizedInput[normalizedProp] = inputObject[prop]; + } + } + } + + return normalizedInput; + } + + var priorities = {}; + + function addUnitPriority(unit, priority) { + priorities[unit] = priority; + } + + function getPrioritizedUnits(unitsObj) { + var units = []; + for (var u in unitsObj) { + units.push({unit: u, priority: priorities[u]}); + } + units.sort(function (a, b) { + return a.priority - b.priority; + }); + return units; + } + + function zeroFill(number, targetLength, forceSign) { + var absNumber = '' + Math.abs(number), + zerosToFill = targetLength - absNumber.length, + sign = number >= 0; + return (sign ? (forceSign ? '+' : '') : '-') + + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; + } + + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + + var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; + + var formatFunctions = {}; + + var formatTokenFunctions = {}; + + // token: 'M' + // padded: ['MM', 2] + // ordinal: 'Mo' + // callback: function () { this.month() + 1 } + function addFormatToken (token, padded, ordinal, callback) { + var func = callback; + if (typeof callback === 'string') { + func = function () { + return this[callback](); + }; + } + if (token) { + formatTokenFunctions[token] = func; + } + if (padded) { + formatTokenFunctions[padded[0]] = function () { + return zeroFill(func.apply(this, arguments), padded[1], padded[2]); + }; + } + if (ordinal) { + formatTokenFunctions[ordinal] = function () { + return this.localeData().ordinal(func.apply(this, arguments), token); + }; + } + } + + function removeFormattingTokens(input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|\]$/g, ''); + } + return input.replace(/\\/g, ''); + } + + function makeFormatFunction(format) { + var array = format.match(formattingTokens), i, length; + + for (i = 0, length = array.length; i < length; i++) { + if (formatTokenFunctions[array[i]]) { + array[i] = formatTokenFunctions[array[i]]; + } else { + array[i] = removeFormattingTokens(array[i]); + } + } + + return function (mom) { + var output = '', i; + for (i = 0; i < length; i++) { + output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; + } + return output; + }; + } + + // format date using native date object + function formatMoment(m, format) { + if (!m.isValid()) { + return m.localeData().invalidDate(); + } + + format = expandFormat(format, m.localeData()); + formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); + + return formatFunctions[format](m); + } + + function expandFormat(format, locale) { + var i = 5; + + function replaceLongDateFormatTokens(input) { + return locale.longDateFormat(input) || input; + } + + localFormattingTokens.lastIndex = 0; + while (i >= 0 && localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + localFormattingTokens.lastIndex = 0; + i -= 1; + } + + return format; + } + + var match1 = /\d/; // 0 - 9 + var match2 = /\d\d/; // 00 - 99 + var match3 = /\d{3}/; // 000 - 999 + var match4 = /\d{4}/; // 0000 - 9999 + var match6 = /[+-]?\d{6}/; // -999999 - 999999 + var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 + var match1to3 = /\d{1,3}/; // 0 - 999 + var match1to4 = /\d{1,4}/; // 0 - 9999 + var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 + + var matchUnsigned = /\d+/; // 0 - inf + var matchSigned = /[+-]?\d+/; // -inf - inf + + var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z + + var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 + + // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months + var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i; + + var regexes = {}; + + function addRegexToken (token, regex, strictRegex) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { + return (isStrict && strictRegex) ? strictRegex : regex; + }; + } + + function getParseRegexForToken (token, config) { + if (!hasOwnProp(regexes, token)) { + return new RegExp(unescapeFormat(token)); + } + + return regexes[token](config._strict, config._locale); + } + + // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript + function unescapeFormat(s) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + + var tokens = {}; + + function addParseToken (token, callback) { + var i, func = callback; + if (typeof token === 'string') { + token = [token]; + } + if (isNumber(callback)) { + func = function (input, array) { + array[callback] = toInt(input); + }; + } + for (i = 0; i < token.length; i++) { + tokens[token[i]] = func; + } + } + + function addWeekParseToken (token, callback) { + addParseToken(token, function (input, array, config, token) { + config._w = config._w || {}; + callback(input, config._w, config, token); + }); + } + + function addTimeToArrayFromToken(token, input, config) { + if (input != null && hasOwnProp(tokens, token)) { + tokens[token](input, config._a, config, token); + } + } + + var YEAR = 0; + var MONTH = 1; + var DATE = 2; + var HOUR = 3; + var MINUTE = 4; + var SECOND = 5; + var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; + + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + + addFormatToken(0, ['YY', 2], 0, function () { + return this.year() % 100; + }); + + addFormatToken(0, ['YYYY', 4], 0, 'year'); + addFormatToken(0, ['YYYYY', 5], 0, 'year'); + addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); + + // ALIASES + + addUnitAlias('year', 'y'); + + // PRIORITIES + + addUnitPriority('year', 1); + + // PARSING + + addRegexToken('Y', matchSigned); + addRegexToken('YY', match1to2, match2); + addRegexToken('YYYY', match1to4, match4); + addRegexToken('YYYYY', match1to6, match6); + addRegexToken('YYYYYY', match1to6, match6); + + addParseToken(['YYYYY', 'YYYYYY'], YEAR); + addParseToken('YYYY', function (input, array) { + array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = hooks.parseTwoDigitYear(input); + }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); + + // HELPERS + + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + + function isLeapYear(year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + } + + // HOOKS + + hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; + + // MOMENTS + + var getSetYear = makeGetSet('FullYear', true); + + function getIsLeapYear () { + return isLeapYear(this.year()); + } + + function makeGetSet (unit, keepTime) { + return function (value) { + if (value != null) { + set$1(this, unit, value); + hooks.updateOffset(this, keepTime); + return this; + } else { + return get(this, unit); + } + }; + } + + function get (mom, unit) { + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function set$1 (mom, unit, value) { + if (mom.isValid() && !isNaN(value)) { + if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); + } + else { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + } + } + + // MOMENTS + + function stringGet (units) { + units = normalizeUnits(units); + if (isFunction(this[units])) { + return this[units](); + } + return this; + } + + + function stringSet (units, value) { + if (typeof units === 'object') { + units = normalizeObjectUnits(units); + var prioritized = getPrioritizedUnits(units); + for (var i = 0; i < prioritized.length; i++) { + this[prioritized[i].unit](units[prioritized[i].unit]); + } + } else { + units = normalizeUnits(units); + if (isFunction(this[units])) { + return this[units](value); + } + } + return this; + } + + function mod(n, x) { + return ((n % x) + x) % x; + } + + var indexOf; + + if (Array.prototype.indexOf) { + indexOf = Array.prototype.indexOf; + } else { + indexOf = function (o) { + // I know + var i; + for (i = 0; i < this.length; ++i) { + if (this[i] === o) { + return i; + } + } + return -1; + }; + } + + function daysInMonth(year, month) { + if (isNaN(year) || isNaN(month)) { + return NaN; + } + var modMonth = mod(month, 12); + year += (month - modMonth) / 12; + return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2); + } + + // FORMATTING + + addFormatToken('M', ['MM', 2], 'Mo', function () { + return this.month() + 1; + }); + + addFormatToken('MMM', 0, 0, function (format) { + return this.localeData().monthsShort(this, format); + }); + + addFormatToken('MMMM', 0, 0, function (format) { + return this.localeData().months(this, format); + }); + + // ALIASES + + addUnitAlias('month', 'M'); + + // PRIORITY + + addUnitPriority('month', 8); + + // PARSING + + addRegexToken('M', match1to2); + addRegexToken('MM', match1to2, match2); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); + + addParseToken(['M', 'MM'], function (input, array) { + array[MONTH] = toInt(input) - 1; + }); + + addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { + var month = config._locale.monthsParse(input, token, config._strict); + // if we didn't find a month name, mark the date as invalid. + if (month != null) { + array[MONTH] = month; + } else { + getParsingFlags(config).invalidMonth = input; + } + }); + + // LOCALES + + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/; + var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); + function localeMonths (m, format) { + if (!m) { + return isArray(this._months) ? this._months : + this._months['standalone']; + } + return isArray(this._months) ? this._months[m.month()] : + this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; + } + + var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); + function localeMonthsShort (m, format) { + if (!m) { + return isArray(this._monthsShort) ? this._monthsShort : + this._monthsShort['standalone']; + } + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + function handleStrictParse(monthName, format, strict) { + var i, ii, mom, llc = monthName.toLocaleLowerCase(); + if (!this._monthsParse) { + // this is not used + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + for (i = 0; i < 12; ++i) { + mom = createUTC([2000, i]); + this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); + this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } + } + + function localeMonthsParse (monthName, format, strict) { + var i, mom, regex; + + if (this._monthsParseExact) { + return handleStrictParse.call(this, monthName, format, strict); + } + + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + } + + // TODO: add sorting + // Sorting makes sure if one month (or abbr) is a prefix of another + // see sorting in computeMonthsParse + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = createUTC([2000, i]); + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); + this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); + } + if (!strict && !this._monthsParse[i]) { + regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); + this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { + return i; + } + } + } + + // MOMENTS + + function setMonth (mom, value) { + var dayOfMonth; + + if (!mom.isValid()) { + // No op + return mom; + } + + if (typeof value === 'string') { + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (!isNumber(value)) { + return mom; + } + } + } + + dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); + mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); + return mom; + } + + function getSetMonth (value) { + if (value != null) { + setMonth(this, value); + hooks.updateOffset(this, true); + return this; + } else { + return get(this, 'Month'); + } + } + + function getDaysInMonth () { + return daysInMonth(this.year(), this.month()); + } + + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + if (!hasOwnProp(this, '_monthsShortRegex')) { + this._monthsShortRegex = defaultMonthsShortRegex; + } + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + if (!hasOwnProp(this, '_monthsRegex')) { + this._monthsRegex = defaultMonthsRegex; + } + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + } + for (i = 0; i < 24; i++) { + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + } + + function createDate (y, m, d, h, M, s, ms) { + // can't just apply() to create a date: + // https://stackoverflow.com/q/181348 + var date = new Date(y, m, d, h, M, s, ms); + + // the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { + date.setFullYear(y); + } + return date; + } + + function createUTCDate (y) { + var date = new Date(Date.UTC.apply(null, arguments)); + + // the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); + } + return date; + } + + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + + return -fwdlw + fwd - 1; + } + + // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; + } + + return { + year: resYear, + dayOfYear: resDayOfYear + }; + } + + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; + + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; + } + + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PRIORITIES + + addUnitPriority('week', 5); + addUnitPriority('isoWeek', 5); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 6th is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + + addFormatToken('d', 0, 'do', 'day'); + + addFormatToken('dd', 0, 0, function (format) { + return this.localeData().weekdaysMin(this, format); + }); + + addFormatToken('ddd', 0, 0, function (format) { + return this.localeData().weekdaysShort(this, format); + }); + + addFormatToken('dddd', 0, 0, function (format) { + return this.localeData().weekdays(this, format); + }); + + addFormatToken('e', 0, 0, 'weekday'); + addFormatToken('E', 0, 0, 'isoWeekday'); + + // ALIASES + + addUnitAlias('day', 'd'); + addUnitAlias('weekday', 'e'); + addUnitAlias('isoWeekday', 'E'); + + // PRIORITY + addUnitPriority('day', 11); + addUnitPriority('weekday', 11); + addUnitPriority('isoWeekday', 11); + + // PARSING + + addRegexToken('d', match1to2); + addRegexToken('e', match1to2); + addRegexToken('E', match1to2); + addRegexToken('dd', function (isStrict, locale) { + return locale.weekdaysMinRegex(isStrict); + }); + addRegexToken('ddd', function (isStrict, locale) { + return locale.weekdaysShortRegex(isStrict); + }); + addRegexToken('dddd', function (isStrict, locale) { + return locale.weekdaysRegex(isStrict); + }); + + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); + // if we didn't get a weekday name, mark the date as invalid + if (weekday != null) { + week.d = weekday; + } else { + getParsingFlags(config).invalidWeekday = input; + } + }); + + addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { + week[token] = toInt(input); + }); + + // HELPERS + + function parseWeekday(input, locale) { + if (typeof input !== 'string') { + return input; + } + + if (!isNaN(input)) { + return parseInt(input, 10); + } + + input = locale.weekdaysParse(input); + if (typeof input === 'number') { + return input; + } + + return null; + } + + function parseIsoWeekday(input, locale) { + if (typeof input === 'string') { + return locale.weekdaysParse(input) % 7 || 7; + } + return isNaN(input) ? null : input; + } + + // LOCALES + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + function localeWeekdays (m, format) { + if (!m) { + return isArray(this._weekdays) ? this._weekdays : + this._weekdays['standalone']; + } + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + function localeWeekdaysShort (m) { + return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort; + } + + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + function localeWeekdaysMin (m) { + return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin; + } + + function handleStrictParse$1(weekdayName, format, strict) { + var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._shortWeekdaysParse = []; + this._minWeekdaysParse = []; + + for (i = 0; i < 7; ++i) { + mom = createUTC([2000, 1]).day(i); + this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); + this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); + this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } + } + + function localeWeekdaysParse (weekdayName, format, strict) { + var i, mom, regex; + + if (this._weekdaysParseExact) { + return handleStrictParse$1.call(this, weekdayName, format, strict); + } + + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } + + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + + mom = createUTC([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i'); + } + if (!this._weekdaysParse[i]) { + regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); + this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { + return i; + } + } + } + + // MOMENTS + + function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + if (input != null) { + input = parseWeekday(input, this.localeData()); + return this.add(input - day, 'd'); + } else { + return day; + } + } + + function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, 'd'); + } + + function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + + // behaves the same as moment#day except + // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) + // as a setter, sunday should belong to the previous week. + + if (input != null) { + var weekday = parseIsoWeekday(input, this.localeData()); + return this.day(this.day() % 7 ? weekday : weekday - 7); + } else { + return this.day() || 7; + } + } + + var defaultWeekdaysRegex = matchWord; + function weekdaysRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysStrictRegex; + } else { + return this._weekdaysRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysRegex')) { + this._weekdaysRegex = defaultWeekdaysRegex; + } + return this._weekdaysStrictRegex && isStrict ? + this._weekdaysStrictRegex : this._weekdaysRegex; + } + } + + var defaultWeekdaysShortRegex = matchWord; + function weekdaysShortRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysShortStrictRegex; + } else { + return this._weekdaysShortRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysShortRegex')) { + this._weekdaysShortRegex = defaultWeekdaysShortRegex; + } + return this._weekdaysShortStrictRegex && isStrict ? + this._weekdaysShortStrictRegex : this._weekdaysShortRegex; + } + } + + var defaultWeekdaysMinRegex = matchWord; + function weekdaysMinRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysMinStrictRegex; + } else { + return this._weekdaysMinRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysMinRegex')) { + this._weekdaysMinRegex = defaultWeekdaysMinRegex; + } + return this._weekdaysMinStrictRegex && isStrict ? + this._weekdaysMinStrictRegex : this._weekdaysMinRegex; + } + } + + + function computeWeekdaysParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], + i, mom, minp, shortp, longp; + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + mom = createUTC([2000, 1]).day(i); + minp = this.weekdaysMin(mom, ''); + shortp = this.weekdaysShort(mom, ''); + longp = this.weekdays(mom, ''); + minPieces.push(minp); + shortPieces.push(shortp); + longPieces.push(longp); + mixedPieces.push(minp); + mixedPieces.push(shortp); + mixedPieces.push(longp); + } + // Sorting makes sure if one weekday (or abbr) is a prefix of another it + // will match the longer piece. + minPieces.sort(cmpLenRev); + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 7; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._weekdaysShortRegex = this._weekdaysRegex; + this._weekdaysMinRegex = this._weekdaysRegex; + + this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); + } + + // FORMATTING + + function hFormat() { + return this.hours() % 12 || 12; + } + + function kFormat() { + return this.hours() || 24; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + addFormatToken('k', ['kk', 2], 0, kFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + function meridiem (token, lowercase) { + addFormatToken(token, 0, 0, function () { + return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); + }); + } + + meridiem('a', true); + meridiem('A', false); + + // ALIASES + + addUnitAlias('hour', 'h'); + + // PRIORITY + addUnitPriority('hour', 13); + + // PARSING + + function matchMeridiem (isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('k', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + addRegexToken('kk', match1to2, match2); + + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + + addParseToken(['H', 'HH'], HOUR); + addParseToken(['k', 'kk'], function (input, array, config) { + var kInput = toInt(input); + array[HOUR] = kInput === 24 ? 0 : kInput; + }); + addParseToken(['a', 'A'], function (input, array, config) { + config._isPm = config._locale.isPM(input); + config._meridiem = input; + }); + addParseToken(['h', 'hh'], function (input, array, config) { + array[HOUR] = toInt(input); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); + + // LOCALES + + function localeIsPM (input) { + // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays + // Using charAt should be more compatible. + return ((input + '').toLowerCase().charAt(0) === 'p'); + } + + var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; + function localeMeridiem (hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; + } + } + + + // MOMENTS + + // Setting the hour should keep the time, because the user explicitly + // specified which hour they want. So trying to maintain the same hour (in + // a new timezone) makes sense. Adding/subtracting hours does not follow + // this rule. + var getSetHour = makeGetSet('Hours', true); + + var baseConfig = { + calendar: defaultCalendar, + longDateFormat: defaultLongDateFormat, + invalidDate: defaultInvalidDate, + ordinal: defaultOrdinal, + dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, + relativeTime: defaultRelativeTime, + + months: defaultLocaleMonths, + monthsShort: defaultLocaleMonthsShort, + + week: defaultLocaleWeek, + + weekdays: defaultLocaleWeekdays, + weekdaysMin: defaultLocaleWeekdaysMin, + weekdaysShort: defaultLocaleWeekdaysShort, + + meridiemParse: defaultLocaleMeridiemParse + }; + + // internal storage for locale config files + var locales = {}; + var localeFamilies = {}; + var globalLocale; + + function normalizeLocale(key) { + return key ? key.toLowerCase().replace('_', '-') : key; + } + + // pick the locale from the array + // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each + // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root + function chooseLocale(names) { + var i = 0, j, next, locale, split; + + while (i < names.length) { + split = normalizeLocale(names[i]).split('-'); + j = split.length; + next = normalizeLocale(names[i + 1]); + next = next ? next.split('-') : null; + while (j > 0) { + locale = loadLocale(split.slice(0, j).join('-')); + if (locale) { + return locale; + } + if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { + //the next array item is better than a shallower substring of this one + break; + } + j--; + } + i++; + } + return globalLocale; + } + + function loadLocale(name) { + var oldLocale = null; + // TODO: Find a better way to register and load all the locales in Node + if (!locales[name] && (typeof module !== 'undefined') && + module && module.exports) { + try { + oldLocale = globalLocale._abbr; + var aliasedRequire = require; + !(function webpackMissingModule() { var e = new Error("Cannot find module 'undefined'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); + getSetGlobalLocale(oldLocale); + } catch (e) {} + } + return locales[name]; + } + + // This function will load locale and then set the global locale. If + // no arguments are passed in, it will simply return the current global + // locale key. + function getSetGlobalLocale (key, values) { + var data; + if (key) { + if (isUndefined(values)) { + data = getLocale(key); + } + else { + data = defineLocale(key, values); + } + + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; + } + else { + if ((typeof console !== 'undefined') && console.warn) { + //warn user if arguments are passed but the locale could not be set + console.warn('Locale ' + key + ' not found. Did you forget to load it?'); + } + } + } + + return globalLocale._abbr; + } + + function defineLocale (name, config) { + if (config !== null) { + var locale, parentConfig = baseConfig; + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale ' + + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); + parentConfig = locales[name]._config; + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + parentConfig = locales[config.parentLocale]._config; + } else { + locale = loadLocale(config.parentLocale); + if (locale != null) { + parentConfig = locale._config; + } else { + if (!localeFamilies[config.parentLocale]) { + localeFamilies[config.parentLocale] = []; + } + localeFamilies[config.parentLocale].push({ + name: name, + config: config + }); + return null; + } + } + } + locales[name] = new Locale(mergeConfigs(parentConfig, config)); + + if (localeFamilies[name]) { + localeFamilies[name].forEach(function (x) { + defineLocale(x.name, x.config); + }); + } + + // backwards compat for now: also set the locale + // make sure we set the locale AFTER all child locales have been + // created, so we won't end up with the child locale set. + getSetGlobalLocale(name); + + + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; + } + } + + function updateLocale(name, config) { + if (config != null) { + var locale, tmpLocale, parentConfig = baseConfig; + // MERGE + tmpLocale = loadLocale(name); + if (tmpLocale != null) { + parentConfig = tmpLocale._config; + } + config = mergeConfigs(parentConfig, config); + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + + // returns locale data + function getLocale (key) { + var locale; + + if (key && key._locale && key._locale._abbr) { + key = key._locale._abbr; + } + + if (!key) { + return globalLocale; + } + + if (!isArray(key)) { + //short-circuit everything else + locale = loadLocale(key); + if (locale) { + return locale; + } + key = [key]; + } + + return chooseLocale(key); + } + + function listLocales() { + return keys(locales); + } + + function checkOverflow (m) { + var overflow; + var a = m._a; + + if (a && getParsingFlags(m).overflow === -2) { + overflow = + a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : + a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : + a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : + a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : + a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : + a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : + -1; + + if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { + overflow = DATE; + } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } + + getParsingFlags(m).overflow = overflow; + } + + return m; + } + + // Pick the first defined of two or three arguments. + function defaults(a, b, c) { + if (a != null) { + return a; + } + if (b != null) { + return b; + } + return c; + } + + function currentDateArray(config) { + // hooks is actually the exported moment object + var nowValue = new Date(hooks.now()); + if (config._useUTC) { + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; + } + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; + } + + // convert an array to a date. + // the array should mirror the parameters below + // note: all values past the year are optional and will default to the lowest possible value. + // [year, month, day , hour, minute, second, millisecond] + function configFromArray (config) { + var i, date, input = [], currentDate, expectedWeekday, yearToUse; + + if (config._d) { + return; + } + + currentDate = currentDateArray(config); + + //compute day of the year from weeks and weekdays + if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { + dayOfYearFromWeekInfo(config); + } + + //if the day of the year is set, figure out what it is + if (config._dayOfYear != null) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { + getParsingFlags(config)._overflowDayOfYear = true; + } + + date = createUTCDate(yearToUse, 0, config._dayOfYear); + config._a[MONTH] = date.getUTCMonth(); + config._a[DATE] = date.getUTCDate(); + } + + // Default to current date. + // * if no year, month, day of month are given, default to today + // * if day of month is given, default month and year + // * if month is given, default only year + // * if year is given, don't default anything + for (i = 0; i < 3 && config._a[i] == null; ++i) { + config._a[i] = input[i] = currentDate[i]; + } + + // Zero out whatever was not defaulted, including time + for (; i < 7; i++) { + config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; + } + + // Check for 24:00:00.000 + if (config._a[HOUR] === 24 && + config._a[MINUTE] === 0 && + config._a[SECOND] === 0 && + config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } + + config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); + + // Apply timezone offset from input. The actual utcOffset can be changed + // with parseZone. + if (config._tzm != null) { + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + } + + if (config._nextDay) { + config._a[HOUR] = 24; + } + + // check for mismatching day of week + if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { + getParsingFlags(config).weekdayMismatch = true; + } + } + + function dayOfYearFromWeekInfo(config) { + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; + + w = config._w; + if (w.GG != null || w.W != null || w.E != null) { + dow = 1; + doy = 4; + + // TODO: We need to take the current isoWeekYear, but that depends on + // how we interpret now (local, utc, fixed offset). So create + // a now version of current config (take local/utc/offset flags, and + // create now). + weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); + week = defaults(w.W, 1); + weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } + } else { + dow = config._locale._week.dow; + doy = config._locale._week.doy; + + var curWeek = weekOfYear(createLocal(), dow, doy); + + weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); + + // Default to current week. + week = defaults(w.w, curWeek.week); + + if (w.d != null) { + // weekday -- low day numbers are considered next week + weekday = w.d; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; + } + } else if (w.e != null) { + // local weekday -- counting starts from beginning of week + weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + // default to beginning of week + weekday = dow; + } + } + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + } + + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; + + var isoDates = [ + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] + ]; + + // iso time formats and regexes + var isoTimes = [ + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] + ]; + + var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; + + // date from iso format + function configFromISO(config) { + var i, l, + string = config._i, + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; + + if (match) { + getParsingFlags(config).iso = true; + + for (i = 0, l = isoDates.length; i < l; i++) { + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; + break; + } + } + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; + } + } + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; + } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); + configFromStringAndFormat(config); + } else { + config._isValid = false; + } + } + + // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; + + function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = [ + untruncateYear(yearStr), + defaultLocaleMonthsShort.indexOf(monthStr), + parseInt(dayStr, 10), + parseInt(hourStr, 10), + parseInt(minuteStr, 10) + ]; + + if (secondStr) { + result.push(parseInt(secondStr, 10)); + } + + return result; + } + + function untruncateYear(yearStr) { + var year = parseInt(yearStr, 10); + if (year <= 49) { + return 2000 + year; + } else if (year <= 999) { + return 1900 + year; + } + return year; + } + + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + + function checkWeekday(weekdayStr, parsedInput, config) { + if (weekdayStr) { + // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. + var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), + weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); + if (weekdayProvided !== weekdayActual) { + getParsingFlags(config).weekdayMismatch = true; + config._isValid = false; + return false; + } + } + return true; + } + + var obsOffsets = { + UT: 0, + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + + function calculateOffset(obsOffset, militaryOffset, numOffset) { + if (obsOffset) { + return obsOffsets[obsOffset]; + } else if (militaryOffset) { + // the only allowed military tz is Z + return 0; + } else { + var hm = parseInt(numOffset, 10); + var m = hm % 100, h = (hm - m) / 100; + return h * 60 + m; + } + } + + // date and time from ref 2822 format + function configFromRFC2822(config) { + var match = rfc2822.exec(preprocessRFC2822(config._i)); + if (match) { + var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); + if (!checkWeekday(match[1], parsedArray, config)) { + return; + } + + config._a = parsedArray; + config._tzm = calculateOffset(match[8], match[9], match[10]); + + config._d = createUTCDate.apply(null, config._a); + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + + getParsingFlags(config).rfc2822 = true; + } else { + config._isValid = false; + } + } + + // date from iso format or fallback + function configFromString(config) { + var matched = aspNetJsonRegex.exec(config._i); + + if (matched !== null) { + config._d = new Date(+matched[1]); + return; + } + + configFromISO(config); + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } + + configFromRFC2822(config); + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } + + // Final attempt, use Input Fallback + hooks.createFromInputFallback(config); + } + + hooks.createFromInputFallback = deprecate( + 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + + 'discouraged and will be removed in an upcoming major release. Please refer to ' + + 'http://momentjs.com/guides/#/warnings/js-date/ for more info.', + function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + } + ); + + // constant that refers to the ISO standard + hooks.ISO_8601 = function () {}; + + // constant that refers to the RFC 2822 form + hooks.RFC_2822 = function () {}; + + // date from string and format string + function configFromStringAndFormat(config) { + // TODO: Move this to another part of the creation flow to prevent circular deps + if (config._f === hooks.ISO_8601) { + configFromISO(config); + return; + } + if (config._f === hooks.RFC_2822) { + configFromRFC2822(config); + return; + } + config._a = []; + getParsingFlags(config).empty = true; + + // This array is used to make a Date, either with `new Date` or `Date.UTC` + var string = '' + config._i, + i, parsedInput, tokens, token, skipped, + stringLength = string.length, + totalParsedInputLength = 0; + + tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; + + for (i = 0; i < tokens.length; i++) { + token = tokens[i]; + parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); + if (parsedInput) { + skipped = string.substr(0, string.indexOf(parsedInput)); + if (skipped.length > 0) { + getParsingFlags(config).unusedInput.push(skipped); + } + string = string.slice(string.indexOf(parsedInput) + parsedInput.length); + totalParsedInputLength += parsedInput.length; + } + // don't parse if it's not a known token + if (formatTokenFunctions[token]) { + if (parsedInput) { + getParsingFlags(config).empty = false; + } + else { + getParsingFlags(config).unusedTokens.push(token); + } + addTimeToArrayFromToken(token, parsedInput, config); + } + else if (config._strict && !parsedInput) { + getParsingFlags(config).unusedTokens.push(token); + } + } + + // add remaining unparsed input length to the string + getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; + if (string.length > 0) { + getParsingFlags(config).unusedInput.push(string); + } + + // clear _12h flag if hour is <= 12 + if (config._a[HOUR] <= 12 && + getParsingFlags(config).bigHour === true && + config._a[HOUR] > 0) { + getParsingFlags(config).bigHour = undefined; + } + + getParsingFlags(config).parsedDateParts = config._a.slice(0); + getParsingFlags(config).meridiem = config._meridiem; + // handle meridiem + config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); + + configFromArray(config); + checkOverflow(config); + } + + + function meridiemFixWrap (locale, hour, meridiem) { + var isPm; + + if (meridiem == null) { + // nothing to do + return hour; + } + if (locale.meridiemHour != null) { + return locale.meridiemHour(hour, meridiem); + } else if (locale.isPM != null) { + // Fallback + isPm = locale.isPM(meridiem); + if (isPm && hour < 12) { + hour += 12; + } + if (!isPm && hour === 12) { + hour = 0; + } + return hour; + } else { + // this is not supposed to happen + return hour; + } + } + + // date from string and array of format strings + function configFromStringAndArray(config) { + var tempConfig, + bestMoment, + + scoreToBeat, + i, + currentScore; + + if (config._f.length === 0) { + getParsingFlags(config).invalidFormat = true; + config._d = new Date(NaN); + return; + } + + for (i = 0; i < config._f.length; i++) { + currentScore = 0; + tempConfig = copyConfig({}, config); + if (config._useUTC != null) { + tempConfig._useUTC = config._useUTC; + } + tempConfig._f = config._f[i]; + configFromStringAndFormat(tempConfig); + + if (!isValid(tempConfig)) { + continue; + } + + // if there is any input that was not parsed add a penalty for that format + currentScore += getParsingFlags(tempConfig).charsLeftOver; + + //or tokens + currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; + + getParsingFlags(tempConfig).score = currentScore; + + if (scoreToBeat == null || currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + } + } + + extend(config, bestMoment || tempConfig); + } + + function configFromObject(config) { + if (config._d) { + return; + } + + var i = normalizeObjectUnits(config._i); + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); + + configFromArray(config); + } + + function createFromConfig (config) { + var res = new Moment(checkOverflow(prepareConfig(config))); + if (res._nextDay) { + // Adding is smart enough around DST + res.add(1, 'd'); + res._nextDay = undefined; + } + + return res; + } + + function prepareConfig (config) { + var input = config._i, + format = config._f; + + config._locale = config._locale || getLocale(config._l); + + if (input === null || (format === undefined && input === '')) { + return createInvalid({nullInput: true}); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isDate(input)) { + config._d = input; + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else { + configFromInput(config); + } + + if (!isValid(config)) { + config._d = null; + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + if (isUndefined(input)) { + config._d = new Date(hooks.now()); + } else if (isDate(input)) { + config._d = new Date(input.valueOf()); + } else if (typeof input === 'string') { + configFromString(config); + } else if (isArray(input)) { + config._a = map(input.slice(0), function (obj) { + return parseInt(obj, 10); + }); + configFromArray(config); + } else if (isObject(input)) { + configFromObject(config); + } else if (isNumber(input)) { + // from milliseconds + config._d = new Date(input); + } else { + hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC (input, format, locale, strict, isUTC) { + var c = {}; + + if (locale === true || locale === false) { + strict = locale; + locale = undefined; + } + + if ((isObject(input) && isObjectEmpty(input)) || + (isArray(input) && input.length === 0)) { + input = undefined; + } + // object construction must be done this way. + // https://github.com/moment/moment/issues/1423 + c._isAMomentObject = true; + c._useUTC = c._isUTC = isUTC; + c._l = locale; + c._i = input; + c._f = format; + c._strict = strict; + + return createFromConfig(c); + } + + function createLocal (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate( + 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', + function () { + var other = createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return createInvalid(); + } + } + ); + + var prototypeMax = deprecate( + 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', + function () { + var other = createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return createInvalid(); + } + } + ); + + // Pick a moment m from moments so that m[fn](other) is true for all + // other. This relies on the function fn to be transitive. + // + // moments should either be an array of moment objects or an array, whose + // first element is an array of moment objects. + function pickBy(fn, moments) { + var res, i; + if (moments.length === 1 && isArray(moments[0])) { + moments = moments[0]; + } + if (!moments.length) { + return createLocal(); + } + res = moments[0]; + for (i = 1; i < moments.length; ++i) { + if (!moments[i].isValid() || moments[i][fn](res)) { + res = moments[i]; + } + } + return res; + } + + // TODO: Use [].sort instead? + function min () { + var args = [].slice.call(arguments, 0); + + return pickBy('isBefore', args); + } + + function max () { + var args = [].slice.call(arguments, 0); + + return pickBy('isAfter', args); + } + + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + + var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; + + function isDurationValid(m) { + for (var key in m) { + if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { + return false; + } + } + + var unitHasDecimal = false; + for (var i = 0; i < ordering.length; ++i) { + if (m[ordering[i]]) { + if (unitHasDecimal) { + return false; // only allow non-integers for smallest unit + } + if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { + unitHasDecimal = true; + } + } + } + + return true; + } + + function isValid$1() { + return this._isValid; + } + + function createInvalid$1() { + return createDuration(NaN); + } + + function Duration (duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || normalizedInput.isoWeek || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + + this._isValid = isDurationValid(normalizedInput); + + // representation for dateAddRemove + this._milliseconds = +milliseconds + + seconds * 1e3 + // 1000 + minutes * 6e4 + // 1000 * 60 + hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 + // Because of dateAddRemove treats 24 hours as different from a + // day when working around DST, we need to store them separately + this._days = +days + + weeks * 7; + // It is impossible to translate months into days without knowing + // which months you are are talking about, so we have to store + // it separately. + this._months = +months + + quarters * 3 + + years * 12; + + this._data = {}; + + this._locale = getLocale(); + + this._bubble(); + } + + function isDuration (obj) { + return obj instanceof Duration; + } + + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + + // FORMATTING + + function offset (token, separator) { + addFormatToken(token, 0, 0, function () { + var offset = this.utcOffset(); + var sign = '+'; + if (offset < 0) { + offset = -offset; + sign = '-'; + } + return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); + }); + } + + offset('Z', ':'); + offset('ZZ', ''); + + // PARSING + + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); + addParseToken(['Z', 'ZZ'], function (input, array, config) { + config._useUTC = true; + config._tzm = offsetFromString(matchShortOffset, input); + }); + + // HELPERS + + // timezone chunker + // '+10:00' > ['10', '00'] + // '-1530' > ['-15', '30'] + var chunkOffset = /([\+\-]|\d\d)/gi; + + function offsetFromString(matcher, string) { + var matches = (string || '').match(matcher); + + if (matches === null) { + return null; + } + + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); + + return minutes === 0 ? + 0 : + parts[0] === '+' ? minutes : -minutes; + } + + // Return a moment from input, that is local/utc/zone equivalent to model. + function cloneWithOffset(input, model) { + var res, diff; + if (model._isUTC) { + res = model.clone(); + diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); + // Use low-level api, because this fn is low-level api. + res._d.setTime(res._d.valueOf() + diff); + hooks.updateOffset(res, false); + return res; + } else { + return createLocal(input).local(); + } + } + + function getDateOffset (m) { + // On Firefox.24 Date#getTimezoneOffset returns a floating point. + // https://github.com/moment/moment/pull/1871 + return -Math.round(m._d.getTimezoneOffset() / 15) * 15; + } + + // HOOKS + + // This function will be called whenever a moment is mutated. + // It is intended to keep the offset in sync with the timezone. + hooks.updateOffset = function () {}; + + // MOMENTS + + // keepLocalTime = true means only change the timezone, without + // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> + // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset + // +0200, so we adjust the time as needed, to be valid. + // + // Keeping the time actually adds/subtracts (one hour) + // from the actual represented time. That is why we call updateOffset + // a second time. In case it wants us to change the offset again + // _changeInProgress == true case, then we have to adjust, because + // there is no such time in the given timezone. + function getSetOffset (input, keepLocalTime, keepMinutes) { + var offset = this._offset || 0, + localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } + if (input != null) { + if (typeof input === 'string') { + input = offsetFromString(matchShortOffset, input); + if (input === null) { + return this; + } + } else if (Math.abs(input) < 16 && !keepMinutes) { + input = input * 60; + } + if (!this._isUTC && keepLocalTime) { + localAdjust = getDateOffset(this); + } + this._offset = input; + this._isUTC = true; + if (localAdjust != null) { + this.add(localAdjust, 'm'); + } + if (offset !== input) { + if (!keepLocalTime || this._changeInProgress) { + addSubtract(this, createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + hooks.updateOffset(this, true); + this._changeInProgress = null; + } + } + return this; + } else { + return this._isUTC ? offset : getDateOffset(this); + } + } + + function getSetZone (input, keepLocalTime) { + if (input != null) { + if (typeof input !== 'string') { + input = -input; + } + + this.utcOffset(input, keepLocalTime); + + return this; + } else { + return -this.utcOffset(); + } + } + + function setOffsetToUTC (keepLocalTime) { + return this.utcOffset(0, keepLocalTime); + } + + function setOffsetToLocal (keepLocalTime) { + if (this._isUTC) { + this.utcOffset(0, keepLocalTime); + this._isUTC = false; + + if (keepLocalTime) { + this.subtract(getDateOffset(this), 'm'); + } + } + return this; + } + + function setOffsetToParsedOffset () { + if (this._tzm != null) { + this.utcOffset(this._tzm, false, true); + } else if (typeof this._i === 'string') { + var tZone = offsetFromString(matchOffset, this._i); + if (tZone != null) { + this.utcOffset(tZone); + } + else { + this.utcOffset(0, true); + } + } + return this; + } + + function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } + input = input ? createLocal(input).utcOffset() : 0; + + return (this.utcOffset() - input) % 60 === 0; + } + + function isDaylightSavingTime () { + return ( + this.utcOffset() > this.clone().month(0).utcOffset() || + this.utcOffset() > this.clone().month(5).utcOffset() + ); + } + + function isDaylightSavingTimeShifted () { + if (!isUndefined(this._isDSTShifted)) { + return this._isDSTShifted; + } + + var c = {}; + + copyConfig(c, this); + c = prepareConfig(c); + + if (c._a) { + var other = c._isUTC ? createUTC(c._a) : createLocal(c._a); + this._isDSTShifted = this.isValid() && + compareArrays(c._a, other.toArray()) > 0; + } else { + this._isDSTShifted = false; + } + + return this._isDSTShifted; + } + + function isLocal () { + return this.isValid() ? !this._isUTC : false; + } + + function isUtcOffset () { + return this.isValid() ? this._isUTC : false; + } + + function isUtc () { + return this.isValid() ? this._isUTC && this._offset === 0 : false; + } + + // ASP.NET json date format regex + var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; + + // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html + // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; + + function createDuration (input, key) { + var duration = input, + // matching against regexp is expensive, do it on demand + match = null, + sign, + ret, + diffRes; + + if (isDuration(input)) { + duration = { + ms : input._milliseconds, + d : input._days, + M : input._months + }; + } else if (isNumber(input)) { + duration = {}; + if (key) { + duration[key] = input; + } else { + duration.milliseconds = input; + } + } else if (!!(match = aspNetRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : 0, + d : toInt(match[DATE]) * sign, + h : toInt(match[HOUR]) * sign, + m : toInt(match[MINUTE]) * sign, + s : toInt(match[SECOND]) * sign, + ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match + }; + } else if (!!(match = isoRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : parseIso(match[2], sign), + M : parseIso(match[3], sign), + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) + }; + } else if (duration == null) {// checks for null or undefined + duration = {}; + } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { + diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); + + duration = {}; + duration.ms = diffRes.milliseconds; + duration.M = diffRes.months; + } + + ret = new Duration(duration); + + if (isDuration(input) && hasOwnProp(input, '_locale')) { + ret._locale = input._locale; + } + + return ret; + } + + createDuration.fn = Duration.prototype; + createDuration.invalid = createInvalid$1; + + function parseIso (inp, sign) { + // We'd normally use ~~inp for this, but unfortunately it also + // converts floats to ints. + // inp may be undefined, so careful calling replace on it. + var res = inp && parseFloat(inp.replace(',', '.')); + // apply sign while we're at it + return (isNaN(res) ? 0 : res) * sign; + } + + function positiveMomentsDifference(base, other) { + var res = {milliseconds: 0, months: 0}; + + res.months = other.month() - base.month() + + (other.year() - base.year()) * 12; + if (base.clone().add(res.months, 'M').isAfter(other)) { + --res.months; + } + + res.milliseconds = +other - +(base.clone().add(res.months, 'M')); + + return res; + } + + function momentsDifference(base, other) { + var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + + other = cloneWithOffset(other, base); + if (base.isBefore(other)) { + res = positiveMomentsDifference(base, other); + } else { + res = positiveMomentsDifference(other, base); + res.milliseconds = -res.milliseconds; + res.months = -res.months; + } + + return res; + } + + // TODO: remove 'name' arg after deprecation is removed + function createAdder(direction, name) { + return function (val, period) { + var dur, tmp; + //invert the arguments, but complain about it + if (period !== null && !isNaN(+period)) { + deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); + tmp = val; val = period; period = tmp; + } + + val = typeof val === 'string' ? +val : val; + dur = createDuration(val, period); + addSubtract(this, dur, direction); + return this; + }; + } + + function addSubtract (mom, duration, isAdding, updateOffset) { + var milliseconds = duration._milliseconds, + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + // No op + return; + } + + updateOffset = updateOffset == null ? true : updateOffset; + + if (months) { + setMonth(mom, get(mom, 'Month') + months * isAdding); + } + if (days) { + set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); + } + if (milliseconds) { + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); + } + if (updateOffset) { + hooks.updateOffset(mom, days || months); + } + } + + var add = createAdder(1, 'add'); + var subtract = createAdder(-1, 'subtract'); + + function getCalendarFormat(myMoment, now) { + var diff = myMoment.diff(now, 'days', true); + return diff < -6 ? 'sameElse' : + diff < -1 ? 'lastWeek' : + diff < 0 ? 'lastDay' : + diff < 1 ? 'sameDay' : + diff < 2 ? 'nextDay' : + diff < 7 ? 'nextWeek' : 'sameElse'; + } + + function calendar$1 (time, formats) { + // We want to compare the start of today, vs this. + // Getting start-of-today depends on whether we're local/utc/offset or not. + var now = time || createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + format = hooks.calendarFormat(this, sod) || 'sameElse'; + + var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, createLocal(now))); + } + + function clone () { + return new Moment(this); + } + + function isAfter (input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units) || 'millisecond'; + if (units === 'millisecond') { + return this.valueOf() > localInput.valueOf(); + } else { + return localInput.valueOf() < this.clone().startOf(units).valueOf(); + } + } + + function isBefore (input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units) || 'millisecond'; + if (units === 'millisecond') { + return this.valueOf() < localInput.valueOf(); + } else { + return this.clone().endOf(units).valueOf() < localInput.valueOf(); + } + } + + function isBetween (from, to, units, inclusivity) { + var localFrom = isMoment(from) ? from : createLocal(from), + localTo = isMoment(to) ? to : createLocal(to); + if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { + return false; + } + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && + (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); + } + + function isSame (input, units) { + var localInput = isMoment(input) ? input : createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units) || 'millisecond'; + if (units === 'millisecond') { + return this.valueOf() === localInput.valueOf(); + } else { + inputMs = localInput.valueOf(); + return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); + } + } + + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input, units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input, units); + } + + function diff (input, units, asFloat) { + var that, + zoneDelta, + output; + + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + + units = normalizeUnits(units); + + switch (units) { + case 'year': output = monthDiff(this, that) / 12; break; + case 'month': output = monthDiff(this, that); break; + case 'quarter': output = monthDiff(this, that) / 3; break; + case 'second': output = (this - that) / 1e3; break; // 1000 + case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 + case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 + case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst + case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst + default: output = this - that; + } + + return asFloat ? output : absFloor(output); + } + + function monthDiff (a, b) { + // difference in months + var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), + // b is in (anchor - 1 month, anchor + 1 month) + anchor = a.clone().add(wholeMonthDiff, 'months'), + anchor2, adjust; + + if (b - anchor < 0) { + anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor - anchor2); + } else { + anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor2 - anchor); + } + + //check for negative zero, return zero if negative zero + return -(wholeMonthDiff + adjust) || 0; + } + + hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; + + function toString () { + return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); + } + + function toISOString(keepOffset) { + if (!this.isValid()) { + return null; + } + var utc = keepOffset !== true; + var m = utc ? this.clone().utc() : this; + if (m.year() < 0 || m.year() > 9999) { + return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + if (isFunction(Date.prototype.toISOString)) { + // native implementation is ~50x faster, use it when we can + if (utc) { + return this.toDate().toISOString(); + } else { + return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z')); + } + } + return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + + /** + * Return a human readable representation of a moment that can + * also be evaluated to get a new moment which is the same + * + * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects + */ + function inspect () { + if (!this.isValid()) { + return 'moment.invalid(/* ' + this._i + ' */)'; + } + var func = 'moment'; + var zone = ''; + if (!this.isLocal()) { + func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; + zone = 'Z'; + } + var prefix = '[' + func + '("]'; + var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; + var datetime = '-MM-DD[T]HH:mm:ss.SSS'; + var suffix = zone + '[")]'; + + return this.format(prefix + year + datetime + suffix); + } + + function format (inputString) { + if (!inputString) { + inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; + } + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } + + function from (time, withoutSuffix) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + createLocal(time).isValid())) { + return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function fromNow (withoutSuffix) { + return this.from(createLocal(), withoutSuffix); + } + + function to (time, withoutSuffix) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + createLocal(time).isValid())) { + return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function toNow (withoutSuffix) { + return this.to(createLocal(), withoutSuffix); + } + + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. + function locale (key) { + var newLocaleData; + + if (key === undefined) { + return this._locale._abbr; + } else { + newLocaleData = getLocale(key); + if (newLocaleData != null) { + this._locale = newLocaleData; + } + return this; + } + } + + var lang = deprecate( + 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', + function (key) { + if (key === undefined) { + return this.localeData(); + } else { + return this.locale(key); + } + } + ); + + function localeData () { + return this._locale; + } + + function startOf (units) { + units = normalizeUnits(units); + // the following switch intentionally omits break keywords + // to utilize falling through the cases. + switch (units) { + case 'year': + this.month(0); + /* falls through */ + case 'quarter': + case 'month': + this.date(1); + /* falls through */ + case 'week': + case 'isoWeek': + case 'day': + case 'date': + this.hours(0); + /* falls through */ + case 'hour': + this.minutes(0); + /* falls through */ + case 'minute': + this.seconds(0); + /* falls through */ + case 'second': + this.milliseconds(0); + } + + // weeks are a special case + if (units === 'week') { + this.weekday(0); + } + if (units === 'isoWeek') { + this.isoWeekday(1); + } + + // quarters are also special + if (units === 'quarter') { + this.month(Math.floor(this.month() / 3) * 3); + } + + return this; + } + + function endOf (units) { + units = normalizeUnits(units); + if (units === undefined || units === 'millisecond') { + return this; + } + + // 'date' is an alias for 'day', so it should be considered as such. + if (units === 'date') { + units = 'day'; + } + + return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); + } + + function valueOf () { + return this._d.valueOf() - ((this._offset || 0) * 60000); + } + + function unix () { + return Math.floor(this.valueOf() / 1000); + } + + function toDate () { + return new Date(this.valueOf()); + } + + function toArray () { + var m = this; + return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; + } + + function toObject () { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; + } + + function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; + } + + function isValid$2 () { + return isValid(this); + } + + function parsingFlags () { + return extend({}, getParsingFlags(this)); + } + + function invalidAt () { + return getParsingFlags(this).overflow; + } + + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + + addFormatToken(0, ['gg', 2], 0, function () { + return this.weekYear() % 100; + }); + + addFormatToken(0, ['GG', 2], 0, function () { + return this.isoWeekYear() % 100; + }); + + function addWeekYearFormatToken (token, getter) { + addFormatToken(0, [token, token.length], 0, getter); + } + + addWeekYearFormatToken('gggg', 'weekYear'); + addWeekYearFormatToken('ggggg', 'weekYear'); + addWeekYearFormatToken('GGGG', 'isoWeekYear'); + addWeekYearFormatToken('GGGGG', 'isoWeekYear'); + + // ALIASES + + addUnitAlias('weekYear', 'gg'); + addUnitAlias('isoWeekYear', 'GG'); + + // PRIORITY + + addUnitPriority('weekYear', 1); + addUnitPriority('isoWeekYear', 1); + + + // PARSING + + addRegexToken('G', matchSigned); + addRegexToken('g', matchSigned); + addRegexToken('GG', match1to2, match2); + addRegexToken('gg', match1to2, match2); + addRegexToken('GGGG', match1to4, match4); + addRegexToken('gggg', match1to4, match4); + addRegexToken('GGGGG', match1to6, match6); + addRegexToken('ggggg', match1to6, match6); + + addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { + week[token.substr(0, 2)] = toInt(input); + }); + + addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { + week[token] = hooks.parseTwoDigitYear(input); + }); + + // MOMENTS + + function getSetWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); + } + + function getSetISOWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); + } + + function getISOWeeksInYear () { + return weeksInYear(this.year(), 1, 4); + } + + function getWeeksInYear () { + var weekInfo = this.localeData()._week; + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); + + // ALIASES + + addUnitAlias('quarter', 'Q'); + + // PRIORITY + + addUnitPriority('quarter', 7); + + // PARSING + + addRegexToken('Q', match1); + addParseToken('Q', function (input, array) { + array[MONTH] = (toInt(input) - 1) * 3; + }); + + // MOMENTS + + function getSetQuarter (input) { + return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); + } + + // FORMATTING + + addFormatToken('D', ['DD', 2], 'Do', 'date'); + + // ALIASES + + addUnitAlias('date', 'D'); + + // PRIORITY + addUnitPriority('date', 9); + + // PARSING + + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + // TODO: Remove "ordinalParse" fallback in next major release. + return isStrict ? + (locale._dayOfMonthOrdinalParse || locale._ordinalParse) : + locale._dayOfMonthOrdinalParseLenient; + }); + + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0]); + }); + + // MOMENTS + + var getSetDayOfMonth = makeGetSet('Date', true); + + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PRIORITY + addUnitPriority('dayOfYear', 4); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + addFormatToken('m', ['mm', 2], 0, 'minute'); + + // ALIASES + + addUnitAlias('minute', 'm'); + + // PRIORITY + + addUnitPriority('minute', 14); + + // PARSING + + addRegexToken('m', match1to2); + addRegexToken('mm', match1to2, match2); + addParseToken(['m', 'mm'], MINUTE); + + // MOMENTS + + var getSetMinute = makeGetSet('Minutes', false); + + // FORMATTING + + addFormatToken('s', ['ss', 2], 0, 'second'); + + // ALIASES + + addUnitAlias('second', 's'); + + // PRIORITY + + addUnitPriority('second', 15); + + // PARSING + + addRegexToken('s', match1to2); + addRegexToken('ss', match1to2, match2); + addParseToken(['s', 'ss'], SECOND); + + // MOMENTS + + var getSetSecond = makeGetSet('Seconds', false); + + // FORMATTING + + addFormatToken('S', 0, 0, function () { + return ~~(this.millisecond() / 100); + }); + + addFormatToken(0, ['SS', 2], 0, function () { + return ~~(this.millisecond() / 10); + }); + + addFormatToken(0, ['SSS', 3], 0, 'millisecond'); + addFormatToken(0, ['SSSS', 4], 0, function () { + return this.millisecond() * 10; + }); + addFormatToken(0, ['SSSSS', 5], 0, function () { + return this.millisecond() * 100; + }); + addFormatToken(0, ['SSSSSS', 6], 0, function () { + return this.millisecond() * 1000; + }); + addFormatToken(0, ['SSSSSSS', 7], 0, function () { + return this.millisecond() * 10000; + }); + addFormatToken(0, ['SSSSSSSS', 8], 0, function () { + return this.millisecond() * 100000; + }); + addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { + return this.millisecond() * 1000000; + }); + + + // ALIASES + + addUnitAlias('millisecond', 'ms'); + + // PRIORITY + + addUnitPriority('millisecond', 16); + + // PARSING + + addRegexToken('S', match1to3, match1); + addRegexToken('SS', match1to3, match2); + addRegexToken('SSS', match1to3, match3); + + var token; + for (token = 'SSSS'; token.length <= 9; token += 'S') { + addRegexToken(token, matchUnsigned); + } + + function parseMs(input, array) { + array[MILLISECOND] = toInt(('0.' + input) * 1000); + } + + for (token = 'S'; token.length <= 9; token += 'S') { + addParseToken(token, parseMs); + } + // MOMENTS + + var getSetMillisecond = makeGetSet('Milliseconds', false); + + // FORMATTING + + addFormatToken('z', 0, 0, 'zoneAbbr'); + addFormatToken('zz', 0, 0, 'zoneName'); + + // MOMENTS + + function getZoneAbbr () { + return this._isUTC ? 'UTC' : ''; + } + + function getZoneName () { + return this._isUTC ? 'Coordinated Universal Time' : ''; + } + + var proto = Moment.prototype; + + proto.add = add; + proto.calendar = calendar$1; + proto.clone = clone; + proto.diff = diff; + proto.endOf = endOf; + proto.format = format; + proto.from = from; + proto.fromNow = fromNow; + proto.to = to; + proto.toNow = toNow; + proto.get = stringGet; + proto.invalidAt = invalidAt; + proto.isAfter = isAfter; + proto.isBefore = isBefore; + proto.isBetween = isBetween; + proto.isSame = isSame; + proto.isSameOrAfter = isSameOrAfter; + proto.isSameOrBefore = isSameOrBefore; + proto.isValid = isValid$2; + proto.lang = lang; + proto.locale = locale; + proto.localeData = localeData; + proto.max = prototypeMax; + proto.min = prototypeMin; + proto.parsingFlags = parsingFlags; + proto.set = stringSet; + proto.startOf = startOf; + proto.subtract = subtract; + proto.toArray = toArray; + proto.toObject = toObject; + proto.toDate = toDate; + proto.toISOString = toISOString; + proto.inspect = inspect; + proto.toJSON = toJSON; + proto.toString = toString; + proto.unix = unix; + proto.valueOf = valueOf; + proto.creationData = creationData; + proto.year = getSetYear; + proto.isLeapYear = getIsLeapYear; + proto.weekYear = getSetWeekYear; + proto.isoWeekYear = getSetISOWeekYear; + proto.quarter = proto.quarters = getSetQuarter; + proto.month = getSetMonth; + proto.daysInMonth = getDaysInMonth; + proto.week = proto.weeks = getSetWeek; + proto.isoWeek = proto.isoWeeks = getSetISOWeek; + proto.weeksInYear = getWeeksInYear; + proto.isoWeeksInYear = getISOWeeksInYear; + proto.date = getSetDayOfMonth; + proto.day = proto.days = getSetDayOfWeek; + proto.weekday = getSetLocaleDayOfWeek; + proto.isoWeekday = getSetISODayOfWeek; + proto.dayOfYear = getSetDayOfYear; + proto.hour = proto.hours = getSetHour; + proto.minute = proto.minutes = getSetMinute; + proto.second = proto.seconds = getSetSecond; + proto.millisecond = proto.milliseconds = getSetMillisecond; + proto.utcOffset = getSetOffset; + proto.utc = setOffsetToUTC; + proto.local = setOffsetToLocal; + proto.parseZone = setOffsetToParsedOffset; + proto.hasAlignedHourOffset = hasAlignedHourOffset; + proto.isDST = isDaylightSavingTime; + proto.isLocal = isLocal; + proto.isUtcOffset = isUtcOffset; + proto.isUtc = isUtc; + proto.isUTC = isUtc; + proto.zoneAbbr = getZoneAbbr; + proto.zoneName = getZoneName; + proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); + proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); + + function createUnix (input) { + return createLocal(input * 1000); + } + + function createInZone () { + return createLocal.apply(null, arguments).parseZone(); + } + + function preParsePostFormat (string) { + return string; + } + + var proto$1 = Locale.prototype; + + proto$1.calendar = calendar; + proto$1.longDateFormat = longDateFormat; + proto$1.invalidDate = invalidDate; + proto$1.ordinal = ordinal; + proto$1.preparse = preParsePostFormat; + proto$1.postformat = preParsePostFormat; + proto$1.relativeTime = relativeTime; + proto$1.pastFuture = pastFuture; + proto$1.set = set; + + proto$1.months = localeMonths; + proto$1.monthsShort = localeMonthsShort; + proto$1.monthsParse = localeMonthsParse; + proto$1.monthsRegex = monthsRegex; + proto$1.monthsShortRegex = monthsShortRegex; + proto$1.week = localeWeek; + proto$1.firstDayOfYear = localeFirstDayOfYear; + proto$1.firstDayOfWeek = localeFirstDayOfWeek; + + proto$1.weekdays = localeWeekdays; + proto$1.weekdaysMin = localeWeekdaysMin; + proto$1.weekdaysShort = localeWeekdaysShort; + proto$1.weekdaysParse = localeWeekdaysParse; + + proto$1.weekdaysRegex = weekdaysRegex; + proto$1.weekdaysShortRegex = weekdaysShortRegex; + proto$1.weekdaysMinRegex = weekdaysMinRegex; + + proto$1.isPM = localeIsPM; + proto$1.meridiem = localeMeridiem; + + function get$1 (format, index, field, setter) { + var locale = getLocale(); + var utc = createUTC().set(setter, index); + return locale[field](utc, format); + } + + function listMonthsImpl (format, index, field) { + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return get$1(format, index, field, 'month'); + } + + var i; + var out = []; + for (i = 0; i < 12; i++) { + out[i] = get$1(format, i, field, 'month'); + } + return out; + } + + // () + // (5) + // (fmt, 5) + // (fmt) + // (true) + // (true, 5) + // (true, fmt, 5) + // (true, fmt) + function listWeekdaysImpl (localeSorted, format, index, field) { + if (typeof localeSorted === 'boolean') { + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; + + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } + + var locale = getLocale(), + shift = localeSorted ? locale._week.dow : 0; + + if (index != null) { + return get$1(format, (index + shift) % 7, field, 'day'); + } + + var i; + var out = []; + for (i = 0; i < 7; i++) { + out[i] = get$1(format, (i + shift) % 7, field, 'day'); + } + return out; + } + + function listMonths (format, index) { + return listMonthsImpl(format, index, 'months'); + } + + function listMonthsShort (format, index) { + return listMonthsImpl(format, index, 'monthsShort'); + } + + function listWeekdays (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + } + + function listWeekdaysShort (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); + } + + function listWeekdaysMin (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); + } + + getSetGlobalLocale('en', { + dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, + ordinal : function (number) { + var b = number % 10, + output = (toInt(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + } + }); + + // Side effect imports + + hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); + hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); + + var mathAbs = Math.abs; + + function abs () { + var data = this._data; + + this._milliseconds = mathAbs(this._milliseconds); + this._days = mathAbs(this._days); + this._months = mathAbs(this._months); + + data.milliseconds = mathAbs(data.milliseconds); + data.seconds = mathAbs(data.seconds); + data.minutes = mathAbs(data.minutes); + data.hours = mathAbs(data.hours); + data.months = mathAbs(data.months); + data.years = mathAbs(data.years); + + return this; + } + + function addSubtract$1 (duration, input, value, direction) { + var other = createDuration(input, value); + + duration._milliseconds += direction * other._milliseconds; + duration._days += direction * other._days; + duration._months += direction * other._months; + + return duration._bubble(); + } + + // supports only 2.0-style add(1, 's') or add(duration) + function add$1 (input, value) { + return addSubtract$1(this, input, value, 1); + } + + // supports only 2.0-style subtract(1, 's') or subtract(duration) + function subtract$1 (input, value) { + return addSubtract$1(this, input, value, -1); + } + + function absCeil (number) { + if (number < 0) { + return Math.floor(number); + } else { + return Math.ceil(number); + } + } + + function bubble () { + var milliseconds = this._milliseconds; + var days = this._days; + var months = this._months; + var data = this._data; + var seconds, minutes, hours, years, monthsFromDays; + + // if we have a mix of positive and negative values, bubble down first + // check: https://github.com/moment/moment/issues/2166 + if (!((milliseconds >= 0 && days >= 0 && months >= 0) || + (milliseconds <= 0 && days <= 0 && months <= 0))) { + milliseconds += absCeil(monthsToDays(months) + days) * 864e5; + days = 0; + months = 0; + } + + // The following code bubbles up values, see the tests for + // examples of what that means. + data.milliseconds = milliseconds % 1000; + + seconds = absFloor(milliseconds / 1000); + data.seconds = seconds % 60; + + minutes = absFloor(seconds / 60); + data.minutes = minutes % 60; + + hours = absFloor(minutes / 60); + data.hours = hours % 24; + + days += absFloor(hours / 24); + + // convert days to months + monthsFromDays = absFloor(daysToMonths(days)); + months += monthsFromDays; + days -= absCeil(monthsToDays(monthsFromDays)); + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + data.days = days; + data.months = months; + data.years = years; + + return this; + } + + function daysToMonths (days) { + // 400 years have 146097 days (taking into account leap year rules) + // 400 years have 12 months === 4800 + return days * 4800 / 146097; + } + + function monthsToDays (months) { + // the reverse of daysToMonths + return months * 146097 / 4800; + } + + function as (units) { + if (!this.isValid()) { + return NaN; + } + var days; + var months; + var milliseconds = this._milliseconds; + + units = normalizeUnits(units); + + if (units === 'month' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + return units === 'month' ? months : months / 12; + } else { + // handle milliseconds separately because of floating point math errors (issue #1867) + days = this._days + Math.round(monthsToDays(this._months)); + switch (units) { + case 'week' : return days / 7 + milliseconds / 6048e5; + case 'day' : return days + milliseconds / 864e5; + case 'hour' : return days * 24 + milliseconds / 36e5; + case 'minute' : return days * 1440 + milliseconds / 6e4; + case 'second' : return days * 86400 + milliseconds / 1000; + // Math.floor prevents floating point math errors here + case 'millisecond': return Math.floor(days * 864e5) + milliseconds; + default: throw new Error('Unknown unit ' + units); + } + } + } + + // TODO: Use this.as('ms')? + function valueOf$1 () { + if (!this.isValid()) { + return NaN; + } + return ( + this._milliseconds + + this._days * 864e5 + + (this._months % 12) * 2592e6 + + toInt(this._months / 12) * 31536e6 + ); + } + + function makeAs (alias) { + return function () { + return this.as(alias); + }; + } + + var asMilliseconds = makeAs('ms'); + var asSeconds = makeAs('s'); + var asMinutes = makeAs('m'); + var asHours = makeAs('h'); + var asDays = makeAs('d'); + var asWeeks = makeAs('w'); + var asMonths = makeAs('M'); + var asYears = makeAs('y'); + + function clone$1 () { + return createDuration(this); + } + + function get$2 (units) { + units = normalizeUnits(units); + return this.isValid() ? this[units + 's']() : NaN; + } + + function makeGetter(name) { + return function () { + return this.isValid() ? this._data[name] : NaN; + }; + } + + var milliseconds = makeGetter('milliseconds'); + var seconds = makeGetter('seconds'); + var minutes = makeGetter('minutes'); + var hours = makeGetter('hours'); + var days = makeGetter('days'); + var months = makeGetter('months'); + var years = makeGetter('years'); + + function weeks () { + return absFloor(this.days() / 7); + } + + var round = Math.round; + var thresholds = { + ss: 44, // a few seconds to seconds + s : 45, // seconds to minute + m : 45, // minutes to hour + h : 22, // hours to day + d : 26, // days to month + M : 11 // months to year + }; + + // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize + function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { + return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); + } + + function relativeTime$1 (posNegDuration, withoutSuffix, locale) { + var duration = createDuration(posNegDuration).abs(); + var seconds = round(duration.as('s')); + var minutes = round(duration.as('m')); + var hours = round(duration.as('h')); + var days = round(duration.as('d')); + var months = round(duration.as('M')); + var years = round(duration.as('y')); + + var a = seconds <= thresholds.ss && ['s', seconds] || + seconds < thresholds.s && ['ss', seconds] || + minutes <= 1 && ['m'] || + minutes < thresholds.m && ['mm', minutes] || + hours <= 1 && ['h'] || + hours < thresholds.h && ['hh', hours] || + days <= 1 && ['d'] || + days < thresholds.d && ['dd', days] || + months <= 1 && ['M'] || + months < thresholds.M && ['MM', months] || + years <= 1 && ['y'] || ['yy', years]; + + a[2] = withoutSuffix; + a[3] = +posNegDuration > 0; + a[4] = locale; + return substituteTimeAgo.apply(null, a); + } + + // This function allows you to set the rounding function for relative time strings + function getSetRelativeTimeRounding (roundingFunction) { + if (roundingFunction === undefined) { + return round; + } + if (typeof(roundingFunction) === 'function') { + round = roundingFunction; + return true; + } + return false; + } + + // This function allows you to set a threshold for relative time strings + function getSetRelativeTimeThreshold (threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + if (limit === undefined) { + return thresholds[threshold]; + } + thresholds[threshold] = limit; + if (threshold === 's') { + thresholds.ss = limit - 1; + } + return true; + } + + function humanize (withSuffix) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var locale = this.localeData(); + var output = relativeTime$1(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var abs$1 = Math.abs; + + function sign(x) { + return ((x > 0) - (x < 0)) || +x; + } + + function toISOString$1() { + // for ISO strings we do not use the normal bubbling rules: + // * milliseconds bubble up until they become hours + // * days do not bubble at all + // * months bubble up until they become years + // This is because there is no context-free conversion between hours and days + // (think of clock changes) + // and also not between days and months (28-31 days per month) + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var seconds = abs$1(this._milliseconds) / 1000; + var days = abs$1(this._days); + var months = abs$1(this._months); + var minutes, hours, years; + + // 3600 seconds -> 60 minutes -> 1 hour + minutes = absFloor(seconds / 60); + hours = absFloor(minutes / 60); + seconds %= 60; + minutes %= 60; + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + + // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js + var Y = years; + var M = months; + var D = days; + var h = hours; + var m = minutes; + var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; + var total = this.asSeconds(); + + if (!total) { + // this is the same as C#'s (Noda) and python (isodate)... + // but not other JS (goog.date) + return 'P0D'; + } + + var totalSign = total < 0 ? '-' : ''; + var ymSign = sign(this._months) !== sign(total) ? '-' : ''; + var daysSign = sign(this._days) !== sign(total) ? '-' : ''; + var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; + + return totalSign + 'P' + + (Y ? ymSign + Y + 'Y' : '') + + (M ? ymSign + M + 'M' : '') + + (D ? daysSign + D + 'D' : '') + + ((h || m || s) ? 'T' : '') + + (h ? hmsSign + h + 'H' : '') + + (m ? hmsSign + m + 'M' : '') + + (s ? hmsSign + s + 'S' : ''); + } + + var proto$2 = Duration.prototype; + + proto$2.isValid = isValid$1; + proto$2.abs = abs; + proto$2.add = add$1; + proto$2.subtract = subtract$1; + proto$2.as = as; + proto$2.asMilliseconds = asMilliseconds; + proto$2.asSeconds = asSeconds; + proto$2.asMinutes = asMinutes; + proto$2.asHours = asHours; + proto$2.asDays = asDays; + proto$2.asWeeks = asWeeks; + proto$2.asMonths = asMonths; + proto$2.asYears = asYears; + proto$2.valueOf = valueOf$1; + proto$2._bubble = bubble; + proto$2.clone = clone$1; + proto$2.get = get$2; + proto$2.milliseconds = milliseconds; + proto$2.seconds = seconds; + proto$2.minutes = minutes; + proto$2.hours = hours; + proto$2.days = days; + proto$2.weeks = weeks; + proto$2.months = months; + proto$2.years = years; + proto$2.humanize = humanize; + proto$2.toISOString = toISOString$1; + proto$2.toString = toISOString$1; + proto$2.toJSON = toISOString$1; + proto$2.locale = locale; + proto$2.localeData = localeData; + + proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); + proto$2.lang = lang; + + // Side effect imports + + // FORMATTING + + addFormatToken('X', 0, 0, 'unix'); + addFormatToken('x', 0, 0, 'valueOf'); + + // PARSING + + addRegexToken('x', matchSigned); + addRegexToken('X', matchTimestamp); + addParseToken('X', function (input, array, config) { + config._d = new Date(parseFloat(input, 10) * 1000); + }); + addParseToken('x', function (input, array, config) { + config._d = new Date(toInt(input)); + }); + + // Side effect imports + + + hooks.version = '2.23.0'; + + setHookCallback(createLocal); + + hooks.fn = proto; + hooks.min = min; + hooks.max = max; + hooks.now = now; + hooks.utc = createUTC; + hooks.unix = createUnix; + hooks.months = listMonths; + hooks.isDate = isDate; + hooks.locale = getSetGlobalLocale; + hooks.invalid = createInvalid; + hooks.duration = createDuration; + hooks.isMoment = isMoment; + hooks.weekdays = listWeekdays; + hooks.parseZone = createInZone; + hooks.localeData = getLocale; + hooks.isDuration = isDuration; + hooks.monthsShort = listMonthsShort; + hooks.weekdaysMin = listWeekdaysMin; + hooks.defineLocale = defineLocale; + hooks.updateLocale = updateLocale; + hooks.locales = listLocales; + hooks.weekdaysShort = listWeekdaysShort; + hooks.normalizeUnits = normalizeUnits; + hooks.relativeTimeRounding = getSetRelativeTimeRounding; + hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; + hooks.calendarFormat = getCalendarFormat; + hooks.prototype = proto; + + // currently HTML5 input type only supports 24-hour formats + hooks.HTML5_FMT = { + DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" /> + DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" /> + DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" /> + DATE: 'YYYY-MM-DD', // <input type="date" /> + TIME: 'HH:mm', // <input type="time" /> + TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" /> + TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" /> + WEEK: 'GGGG-[W]WW', // <input type="week" /> + MONTH: 'YYYY-MM' // <input type="month" /> + }; + + return hooks; + +}))); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/parchment/dist/parchment.js": +/*!**************************************************!*\ + !*** ./node_modules/parchment/dist/parchment.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +(function webpackUniversalModuleDefinition(root, factory) { + if(true) + module.exports = factory(); + else {} +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 9); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(0); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(11); +var shadow_1 = __webpack_require__(5); +var Registry = __webpack_require__(0); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(1); +var store_1 = __webpack_require__(6); +var container_1 = __webpack_require__(2); +var Registry = __webpack_require__(0); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(5); +var Registry = __webpack_require__(0); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(0); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent_1 = Registry.create(this.statics.scope); + blot.wrap(parent_1); + parent_1.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.domNode.parentNode != parentBlot.domNode || + this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(1); +var class_1 = __webpack_require__(7); +var style_1 = __webpack_require__(8); +var Registry = __webpack_require__(0); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(1); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(1); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(10); + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(2); +var format_1 = __webpack_require__(3); +var leaf_1 = __webpack_require__(4); +var scroll_1 = __webpack_require__(12); +var inline_1 = __webpack_require__(13); +var block_1 = __webpack_require__(14); +var embed_1 = __webpack_require__(15); +var text_1 = __webpack_require__(16); +var attributor_1 = __webpack_require__(1); +var class_1 = __webpack_require__(7); +var style_1 = __webpack_require__(8); +var store_1 = __webpack_require__(6); +var Registry = __webpack_require__(0); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length_1 = cur.length(); + if (index < length_1 || + (inclusive && index === length_1 && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length_1; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(2); +var Registry = __webpack_require__(0); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + if (blot == null || + blot === _this || + //@ts-ignore + blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(3); +var Registry = __webpack_require__(0); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(3); +var Registry = __webpack_require__(0); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(4); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(4); +var Registry = __webpack_require__(0); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; + + +/***/ }) +/******/ ]); +}); +//# sourceMappingURL=parchment.js.map + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), + +/***/ "./node_modules/quill/dist/quill.js": +/*!******************************************!*\ + !*** ./node_modules/quill/dist/quill.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {/*! + * Quill Editor v1.3.7 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(true) + module.exports = factory(); + else {} +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 109); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var format_1 = __webpack_require__(18); +var leaf_1 = __webpack_require__(19); +var scroll_1 = __webpack_require__(45); +var inline_1 = __webpack_require__(46); +var block_1 = __webpack_require__(47); +var embed_1 = __webpack_require__(48); +var text_1 = __webpack_require__(49); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var store_1 = __webpack_require__(31); +var Registry = __webpack_require__(1); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +var diff = __webpack_require__(51); +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); +var op = __webpack_require__(20); + + +var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + +var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } +}; + + +Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); +}; + +Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; +}; + +Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; +}; + +Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); +}; + +Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); +}; + +Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); +}; + +Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; +}; + +Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); +}; + +Delta.prototype.changeLength = function () { + return this.reduce(function (length, elem) { + if (elem.insert) { + return length + op.length(elem); + } else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); +}; + +Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); +}; + +Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); +}; + + +Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var ops = []; + var firstOther = otherIter.peek(); + if (firstOther != null && typeof firstOther.retain === 'number' && firstOther.attributes == null) { + var firstLeft = firstOther.retain; + while (thisIter.peekType() === 'insert' && thisIter.peekLength() <= firstLeft) { + firstLeft -= thisIter.peekLength(); + ops.push(thisIter.next()); + } + if (firstOther.retain - firstLeft > 0) { + otherIter.next(firstOther.retain - firstLeft); + } + } + var delta = new Delta(ops); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + + // Optimization if rest of other is just retain + if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) { + var rest = new Delta(thisIter.rest()); + return delta.concat(rest).chop(); + } + + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); +}; + +Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; +}; + +Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); +}; + +Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + var i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var index = typeof thisOp.insert === 'string' ? + thisOp.insert.indexOf(newline, start) - start : -1; + if (index < 0) { + line.push(iter.next()); + } else if (index > 0) { + line.push(iter.next(index)); + } else { + if (predicate(line, iter.next(1).attributes || {}, i) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } +}; + +Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); +}; + +Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; +}; + + +module.exports = Delta; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; +var defineProperty = Object.defineProperty; +var gOPD = Object.getOwnPropertyDescriptor; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target +var setProperty = function setProperty(target, options) { + if (defineProperty && options.name === '__proto__') { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } +}; + +// Return undefined instead of __proto__ if '__proto__' is not an own property +var getProperty = function getProperty(obj, name) { + if (name === '__proto__') { + if (!hasOwn.call(obj, name)) { + return void 0; + } else if (gOPD) { + // In early versions of node, obj['__proto__'] is buggy when obj has + // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. + return gOPD(obj, name).value; + } + } + + return obj[name]; +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = getProperty(target, name); + copy = getProperty(options, name); + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + setProperty(target, { name: name, newValue: copy }); + } + } + } + } + } + + // Return the modified object + return target; +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var NEWLINE_LENGTH = 1; + +var BlockEmbed = function (_Parchment$Embed) { + _inherits(BlockEmbed, _Parchment$Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; +}(_parchment2.default.Embed); + +BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements + + +var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; +}(_parchment2.default.Block); + +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = 'break'; +Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; + +function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); +} + +exports.bubbleFormats = bubbleFormats; +exports.BlockEmbed = BlockEmbed; +exports.default = Block; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.overload = exports.expandConfig = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(50); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _editor = __webpack_require__(14); + +var _editor2 = _interopRequireDefault(_editor); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _selection = __webpack_require__(15); + +var _selection2 = _interopRequireDefault(_selection); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill'); + +var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'find', + value: function find(node) { + return node.__quill || _parchment2.default.find(node); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } else if (path.startsWith('modules') && typeof target.register === 'function') { + target.register(); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.container.__quill = this; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.root.setAttribute('data-gramm', false); + this.scrollingContainer = this.options.scrollingContainer || this.root; + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('<div class=\'ql-editor\' style="white-space: normal;">' + html + '<p><br></p></div>'); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + }, { + key: 'focus', + value: function focus() { + var scrollTop = this.scrollingContainer.scrollTop; + this.selection.focus(); + this.scrollingContainer.scrollTop = scrollTop; + this.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var bounds = void 0; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } else { + bounds = this.selection.getBounds(index.index, index.length); + } + var containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width + }; + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getIndex', + value: function getIndex(blot) { + return blot.offset(this.scroll); + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getLeaf', + value: function getLeaf(index) { + return this.scroll.leaf(index); + } + }, { + key: 'getLine', + value: function getLine(index) { + return this.scroll.line(index); + } + }, { + key: 'getLines', + value: function getLines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } else { + return this.scroll.lines(index, length); + } + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + this.selection.scrollIntoView(this.scrollingContainer); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + if (source !== _emitter4.default.sources.SILENT) { + this.selection.scrollIntoView(this.scrollingContainer); + } + } + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; +}(); + +Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + scrollingContainer: null, + strict: true, + theme: 'default' +}; +Quill.events = _emitter4.default.events; +Quill.sources = _emitter4.default.sources; +// eslint-disable-next-line no-undef +Quill.version = false ? undefined : "1.3.7"; + +Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default +}; + +function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; +} + +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; +} + +function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; +} + +function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source !== _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); +} + +exports.expandConfig = expandConfig; +exports.overload = overload; +exports.default = Quill; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; +}(_parchment2.default.Inline); + +Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = ['cursor', 'inline', // Must be lower +'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher +]; + +exports.default = Inline; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; +}(_parchment2.default.Text); + +exports.default = TextBlot; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _eventemitter = __webpack_require__(54); + +var _eventemitter2 = _interopRequireDefault(_eventemitter); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:events'); + +var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; + +EVENTS.forEach(function (eventName) { + document.addEventListener(eventName, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { + // TODO use WeakMap + if (node.__quill && node.__quill.emitter) { + var _node$__quill$emitter; + + (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); + } + }); + }); +}); + +var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.listeners = {}; + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }, { + key: 'handleDOM', + value: function handleDOM(event) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + (this.listeners[event.type] || []).forEach(function (_ref) { + var node = _ref.node, + handler = _ref.handler; + + if (event.target === node || node.contains(event.target)) { + handler.apply(undefined, [event].concat(args)); + } + }); + } + }, { + key: 'listenDOM', + value: function listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node: node, handler: handler }); + } + }]); + + return Emitter; +}(_eventemitter2.default); + +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' +}; + +exports.default = Emitter; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; +}; + +Module.DEFAULTS = {}; + +exports.default = Module; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var levels = ['error', 'warn', 'log', 'info']; +var level = 'warn'; + +function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + var _console; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } +} + +function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} + +debug.level = namespace.level = function (newLevel) { + level = newLevel; +}; + +exports.default = namespace; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var pSlice = Array.prototype.slice; +var objectKeys = __webpack_require__(52); +var isArguments = __webpack_require__(53); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Code = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; +}(_inline2.default); + +Code.blotName = 'code'; +Code.tagName = 'CODE'; + +var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(context); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; +}(_block2.default); + +CodeBlock.blotName = 'code-block'; +CodeBlock.tagName = 'PRE'; +CodeBlock.TAB = ' '; + +exports.Code = Code; +exports.default = CodeBlock; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ASCII = /^[ -~]*$/; + +var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batchStart(); + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batchEnd(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var block = this.scroll.children.head; + if (block.statics.blotName !== _block2.default.blotName) return false; + if (block.children.length > 1) return false; + return block.children.head instanceof _break2.default; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(this.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + this.delta = oldDelta.compose(change); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; +}(); + +function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); +} + +function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); +} + +exports.default = Editor; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Range = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill:selection'); + +var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; +}; + +var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, function () { + if (!_this.mouseDown) { + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); + } + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + if (!_this.hasFocus()) return; + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { + if (context.range) { + var _context$range = context.range, + startNode = _context$range.startNode, + startOffset = _context$range.startOffset, + endNode = _context$range.endNode, + endOffset = _context$range.endOffset; + + _this.setNativeRange(startNode, startOffset, endNode, endOffset); + } + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'handleComposition', + value: function handleComposition() { + var _this2 = this; + + this.root.addEventListener('compositionstart', function () { + _this2.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this2.composing = false; + if (_this2.cursor.parent) { + var range = _this2.cursor.restore(); + if (!range) return; + setTimeout(function () { + _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + }, { + key: 'handleDragging', + value: function handleDragging() { + var _this3 = this; + + this.emitter.listenDOM('mousedown', document.body, function () { + _this3.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, function () { + _this3.mouseDown = false; + _this3.update(_emitter4.default.sources.USER); + }); + } + }, { + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + this.root.focus(); + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0 + }; + } + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + var range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var normalized = this.getNativeRange(); + if (normalized == null) return [null, null]; + var range = this.normalizedToRange(normalized); + return [range, normalized]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'normalizedToRange', + value: function normalizedToRange(range) { + var _this4 = this; + + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this4.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); + var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); + return new Range(start, end - start); + } + }, { + key: 'normalizeNative', + value: function normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + return range; + } + }, { + key: 'rangeToNative', + value: function rangeToNative(range) { + var _this5 = this; + + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = this.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this5.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + return args; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView(scrollingContainer) { + var range = this.lastRange; + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + var limit = this.scroll.length() - 1; + + var _scroll$line = this.scroll.line(Math.min(range.index, limit)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + first = _scroll$line2[0]; + + var last = first; + if (range.length > 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); + + var _scroll$line4 = _slicedToArray(_scroll$line3, 1); + + last = _scroll$line4[0]; + } + if (first == null || last == null) return; + var scrollBounds = scrollingContainer.getBoundingClientRect(); + if (bounds.top < scrollBounds.top) { + scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; + } else if (bounds.bottom > scrollBounds.bottom) { + scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var native = (this.getNativeRange() || {}).native; + if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { + + if (startNode.tagName == "BR") { + startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); + startNode = startNode.parentNode; + } + if (endNode.tagName == "BR") { + endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); + endNode = endNode.parentNode; + } + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + var args = this.rangeToNative(range); + this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var oldRange = this.lastRange; + + var _getRange = this.getRange(), + _getRange2 = _slicedToArray(_getRange, 2), + lastRange = _getRange2[0], + nativeRange = _getRange2[1]; + + this.lastRange = lastRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; +}(); + +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); +} + +exports.Range = Range; +exports.default = Selection; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Break = function (_Parchment$Embed) { + _inherits(Break, _Parchment$Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; +}(_parchment2.default.Embed); + +Break.blotName = 'break'; +Break.tagName = 'BR'; + +exports.default = Break; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(44); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var store_1 = __webpack_require__(31); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + var _a; + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); + + +var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } +}; + + +function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; +}; + +Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; +}; + +Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } +}; + +Iterator.prototype.peek = function () { + return this.ops[this.index]; +}; + +Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } +}; + +Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; +}; + +Iterator.prototype.rest = function () { + if (!this.hasNext()) { + return []; + } else if (this.offset === 0) { + return this.ops.slice(this.index); + } else { + var offset = this.offset; + var index = this.index; + var next = this.next(); + var rest = this.ops.slice(this.index); + this.offset = offset; + this.index = index; + return [next].concat(rest); + } +}; + + +module.exports = lib; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var clone = (function() { +'use strict'; + +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + if (Buffer.allocUnsafe) { + // Node.js >= 4.5.0 + child = Buffer.allocUnsafe(parent.length); + } else { + // Older Node.js versions + child = new Buffer(parent.length); + } + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; +} + +var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + // Some reason fixes composition issues with character languages in Windows/Chrome, Safari + _this.domNode.addEventListener('DOMNodeInserted', function () {}); + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'batchStart', + value: function batchStart() { + this.batch = true; + } + }, { + key: 'batchEnd', + value: function batchEnd() { + this.batch = false; + this.optimize(); + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0) { + if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { + this.optimize(); + return; + } + if (first instanceof _code2.default) { + var newlineIndex = first.newlineIndex(first.length(), true); + if (newlineIndex > -1) { + first = first.split(newlineIndex + 1); + if (first === last) { + this.optimize(); + return; + } + } + } else if (last instanceof _code2.default) { + var _newlineIndex = last.newlineIndex(0); + if (_newlineIndex > -1) { + last.split(_newlineIndex + 1); + } + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; +}(_parchment2.default.Scroll); + +Scroll.blotName = 'scroll'; +Scroll.className = 'ql-editor'; +Scroll.tagName = 'DIV'; +Scroll.defaultChild = 'block'; +Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + +exports.default = Scroll; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SHORTKEY = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:keyboard'); + +var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { + return; + } + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + if (/Firefox/i.test(navigator.userAgent)) { + // Need to handle delete and backspace for Firefox in the general case #1171 + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); + } else { + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); + } + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$getLine = _this2.quill.getLine(range.index), + _quill$getLine2 = _slicedToArray(_quill$getLine, 2), + line = _quill$getLine2[0], + offset = _quill$getLine2[1]; + + var _quill$getLeaf = _this2.quill.getLeaf(range.index), + _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), + leafStart = _quill$getLeaf2[0], + offsetStart = _quill$getLeaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; +}(_module2.default); + +Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 +}; + +Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + shiftKey: null, + metaKey: null, + ctrlKey: null, + altKey: null, + format: ['indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range) { + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'checklist enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: { list: 'checked' }, + handler: function handler(range) { + var _quill$getLine3 = this.quill.getLine(range.index), + _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), + line = _quill$getLine4[0], + offset = _quill$getLine4[1]; + + var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); + var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range, context) { + var _quill$getLine5 = this.quill.getLine(range.index), + _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), + line = _quill$getLine6[0], + offset = _quill$getLine6[1]; + + var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, + handler: function handler(range, context) { + var length = context.prefix.length; + + var _quill$getLine7 = this.quill.getLine(range.index), + _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), + line = _quill$getLine8[0], + offset = _quill$getLine8[1]; + + if (offset > length) return true; + var value = void 0; + switch (context.prefix.trim()) { + case '[]':case '[ ]': + value = 'unchecked'; + break; + case '[x]': + value = 'checked'; + break; + case '-':case '*': + value = 'bullet'; + break; + default: + value = 'ordered'; + } + this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + }, + 'code exit': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['code-block'], + prefix: /\n\n$/, + suffix: /^\s+$/, + handler: function handler(range) { + var _quill$getLine9 = this.quill.getLine(range.index), + _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), + line = _quill$getLine10[0], + offset = _quill$getLine10[1]; + + var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); + this.quill.updateContents(delta, _quill2.default.sources.USER); + } + }, + 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), + 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), + 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), + 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) + } +}; + +function makeEmbedArrowHandler(key, shiftKey) { + var _ref3; + + var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; + return _ref3 = { + key: key, + shiftKey: shiftKey, + altKey: null + }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { + var index = range.index; + if (key === Keyboard.keys.RIGHT) { + index += range.length + 1; + } + + var _quill$getLeaf3 = this.quill.getLeaf(index), + _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), + leaf = _quill$getLeaf4[0]; + + if (!(leaf instanceof _parchment2.default.Embed)) return true; + if (key === Keyboard.keys.LEFT) { + if (shiftKey) { + this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); + } + } else { + if (shiftKey) { + this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); + } + } + return false; + }), _ref3; +} + +function handleBackspace(range, context) { + if (range.index === 0 || this.quill.getLength() <= 1) return; + + var _quill$getLine11 = this.quill.getLine(range.index), + _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), + line = _quill$getLine12[0]; + + var formats = {}; + if (context.offset === 0) { + var _quill$getLine13 = this.quill.getLine(range.index - 1), + _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), + prev = _quill$getLine14[0]; + + if (prev != null && prev.length() > 1) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + } + // Check for astral symbols + var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; + this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); + } + this.quill.focus(); +} + +function handleDelete(range, context) { + // Check for astral symbols + var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; + if (range.index >= this.quill.getLength() - length) return; + var formats = {}, + nextLength = 0; + + var _quill$getLine15 = this.quill.getLine(range.index), + _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), + line = _quill$getLine16[0]; + + if (context.offset >= line.length() - 1) { + var _quill$getLine17 = this.quill.getLine(range.index + 1), + _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), + next = _quill$getLine18[0]; + + if (next) { + var curFormats = line.formats(); + var nextFormats = this.quill.getFormat(range.index, 1); + formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; + nextLength = next.length(); + } + } + this.quill.deleteText(range.index, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); + } +} + +function handleDeleteRange(range) { + var lines = this.quill.getLines(range); + var formats = {}; + if (lines.length > 1) { + var firstFormats = lines[0].formats(); + var lastFormats = lines[lines.length - 1].formats(); + formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; + } + this.quill.deleteText(range, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); + } + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.focus(); +} + +function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + // Earlier scroll.deleteAt might have messed up our selection, + // so insertText's built in selection preservation is not reliable + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.focus(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); +} + +function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollIndex = this.quill.getIndex(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollIndex + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; +} + +function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; +} + +function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + if (binding.shortKey) { + binding[SHORTKEY] = binding.shortKey; + delete binding.shortKey; + } + return binding; +} + +exports.default = Keyboard; +exports.SHORTKEY = SHORTKEY; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Cursor = function (_Parchment$Embed) { + _inherits(Cursor, _Parchment$Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + if (this.selection.composing || this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start != null) { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + return { + startNode: restoreText, + startOffset: start, + endNode: restoreText, + endOffset: end + }; + } + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this2.textNode; + })) { + var range = this.restore(); + if (range) context.range = range; + } + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; +}(_parchment2.default.Embed); + +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + +exports.default = Cursor; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); + + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; +}(_parchment2.default.Container); + +Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + +exports.default = Container; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); + + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); + + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } + + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); + + return ColorAttributor; +}(_parchment2.default.Attributor.Style); + +var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE +}); +var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.ColorAttributor = ColorAttributor; +exports.ColorClass = ColorClass; +exports.ColorStyle = ColorStyle; + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sanitize = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Link = function (_Inline) { + _inherits(Link, _Inline); + + function Link() { + _classCallCheck(this, Link); + + return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); + } + + _createClass(Link, [{ + key: 'format', + value: function format(name, value) { + if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); + value = this.constructor.sanitize(value); + this.domNode.setAttribute('href', value); + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); + value = this.sanitize(value); + node.setAttribute('href', value); + node.setAttribute('rel', 'noopener noreferrer'); + node.setAttribute('target', '_blank'); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return domNode.getAttribute('href'); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; + } + }]); + + return Link; +}(_inline2.default); + +Link.blotName = 'link'; +Link.tagName = 'A'; +Link.SANITIZED_URL = 'about:blank'; +Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel']; + +function _sanitize(url, protocols) { + var anchor = document.createElement('a'); + anchor.href = url; + var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); + return protocols.indexOf(protocol) > -1; +} + +exports.default = Link; +exports.sanitize = _sanitize; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +var _dropdown = __webpack_require__(107); + +var _dropdown2 = _interopRequireDefault(_dropdown); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var optionsCounter = 0; + +function toggleAriaAttribute(element, attribute) { + element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true')); +} + +var Picker = function () { + function Picker(select) { + var _this = this; + + _classCallCheck(this, Picker); + + this.select = select; + this.container = document.createElement('span'); + this.buildPicker(); + this.select.style.display = 'none'; + this.select.parentNode.insertBefore(this.container, this.select); + + this.label.addEventListener('mousedown', function () { + _this.togglePicker(); + }); + this.label.addEventListener('keydown', function (event) { + switch (event.keyCode) { + // Allows the "Enter" key to open the picker + case _keyboard2.default.keys.ENTER: + _this.togglePicker(); + break; + + // Allows the "Escape" key to close the picker + case _keyboard2.default.keys.ESCAPE: + _this.escape(); + event.preventDefault(); + break; + default: + } + }); + this.select.addEventListener('change', this.update.bind(this)); + } + + _createClass(Picker, [{ + key: 'togglePicker', + value: function togglePicker() { + this.container.classList.toggle('ql-expanded'); + // Toggle aria-expanded and aria-hidden to make the picker accessible + toggleAriaAttribute(this.label, 'aria-expanded'); + toggleAriaAttribute(this.options, 'aria-hidden'); + } + }, { + key: 'buildItem', + value: function buildItem(option) { + var _this2 = this; + + var item = document.createElement('span'); + item.tabIndex = '0'; + item.setAttribute('role', 'button'); + + item.classList.add('ql-picker-item'); + if (option.hasAttribute('value')) { + item.setAttribute('data-value', option.getAttribute('value')); + } + if (option.textContent) { + item.setAttribute('data-label', option.textContent); + } + item.addEventListener('click', function () { + _this2.selectItem(item, true); + }); + item.addEventListener('keydown', function (event) { + switch (event.keyCode) { + // Allows the "Enter" key to select an item + case _keyboard2.default.keys.ENTER: + _this2.selectItem(item, true); + event.preventDefault(); + break; + + // Allows the "Escape" key to close the picker + case _keyboard2.default.keys.ESCAPE: + _this2.escape(); + event.preventDefault(); + break; + default: + } + }); + + return item; + } + }, { + key: 'buildLabel', + value: function buildLabel() { + var label = document.createElement('span'); + label.classList.add('ql-picker-label'); + label.innerHTML = _dropdown2.default; + label.tabIndex = '0'; + label.setAttribute('role', 'button'); + label.setAttribute('aria-expanded', 'false'); + this.container.appendChild(label); + return label; + } + }, { + key: 'buildOptions', + value: function buildOptions() { + var _this3 = this; + + var options = document.createElement('span'); + options.classList.add('ql-picker-options'); + + // Don't want screen readers to read this until options are visible + options.setAttribute('aria-hidden', 'true'); + options.tabIndex = '-1'; + + // Need a unique id for aria-controls + options.id = 'ql-picker-options-' + optionsCounter; + optionsCounter += 1; + this.label.setAttribute('aria-controls', options.id); + + this.options = options; + + [].slice.call(this.select.options).forEach(function (option) { + var item = _this3.buildItem(option); + options.appendChild(item); + if (option.selected === true) { + _this3.selectItem(item); + } + }); + this.container.appendChild(options); + } + }, { + key: 'buildPicker', + value: function buildPicker() { + var _this4 = this; + + [].slice.call(this.select.attributes).forEach(function (item) { + _this4.container.setAttribute(item.name, item.value); + }); + this.container.classList.add('ql-picker'); + this.label = this.buildLabel(); + this.buildOptions(); + } + }, { + key: 'escape', + value: function escape() { + var _this5 = this; + + // Close menu and return focus to trigger label + this.close(); + // Need setTimeout for accessibility to ensure that the browser executes + // focus on the next process thread and after any DOM content changes + setTimeout(function () { + return _this5.label.focus(); + }, 1); + } + }, { + key: 'close', + value: function close() { + this.container.classList.remove('ql-expanded'); + this.label.setAttribute('aria-expanded', 'false'); + this.options.setAttribute('aria-hidden', 'true'); + } + }, { + key: 'selectItem', + value: function selectItem(item) { + var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var selected = this.container.querySelector('.ql-selected'); + if (item === selected) return; + if (selected != null) { + selected.classList.remove('ql-selected'); + } + if (item == null) return; + item.classList.add('ql-selected'); + this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); + if (item.hasAttribute('data-value')) { + this.label.setAttribute('data-value', item.getAttribute('data-value')); + } else { + this.label.removeAttribute('data-value'); + } + if (item.hasAttribute('data-label')) { + this.label.setAttribute('data-label', item.getAttribute('data-label')); + } else { + this.label.removeAttribute('data-label'); + } + if (trigger) { + if (typeof Event === 'function') { + this.select.dispatchEvent(new Event('change')); + } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { + // IE11 + var event = document.createEvent('Event'); + event.initEvent('change', true, true); + this.select.dispatchEvent(event); + } + this.close(); + } + } + }, { + key: 'update', + value: function update() { + var option = void 0; + if (this.select.selectedIndex > -1) { + var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex]; + option = this.select.options[this.select.selectedIndex]; + this.selectItem(item); + } else { + this.selectItem(null); + } + var isActive = option != null && option !== this.select.querySelector('option[selected]'); + this.label.classList.toggle('ql-active', isActive); + } + }]); + + return Picker; +}(); + +exports.default = Picker; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +var _cursor = __webpack_require__(24); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _scroll = __webpack_require__(22); + +var _scroll2 = _interopRequireDefault(_scroll); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _clipboard = __webpack_require__(55); + +var _clipboard2 = _interopRequireDefault(_clipboard); + +var _history = __webpack_require__(42); + +var _history2 = _interopRequireDefault(_history); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, + + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default +}); + +_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); + +exports.default = _quill2.default; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent = Registry.create(this.statics.scope); + blot.wrap(parent); + parent.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.domNode.parentNode != parentBlot.domNode || + this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(32); +var style_1 = __webpack_require__(33); +var Registry = __webpack_require__(1); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; +}(); + +Theme.DEFAULTS = { + modules: {} +}; +Theme.themes = { + 'default': Theme +}; + +exports.default = Theme; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var GUARD_TEXT = '\uFEFF'; + +var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed(node) { + _classCallCheck(this, Embed); + + var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); + + _this.contentNode = document.createElement('span'); + _this.contentNode.setAttribute('contenteditable', false); + [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { + _this.contentNode.appendChild(childNode); + }); + _this.leftGuard = document.createTextNode(GUARD_TEXT); + _this.rightGuard = document.createTextNode(GUARD_TEXT); + _this.domNode.appendChild(_this.leftGuard); + _this.domNode.appendChild(_this.contentNode); + _this.domNode.appendChild(_this.rightGuard); + return _this; + } + + _createClass(Embed, [{ + key: 'index', + value: function index(node, offset) { + if (node === this.leftGuard) return 0; + if (node === this.rightGuard) return 1; + return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'restore', + value: function restore(node) { + var range = void 0, + textNode = void 0; + var text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text2.default) { + var prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } else if (node === this.rightGuard) { + if (this.next instanceof _text2.default) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } + node.data = GUARD_TEXT; + return range; + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { + var range = _this2.restore(mutation.target); + if (range) context.range = range; + } + }); + } + }]); + + return Embed; +}(_parchment2.default.Embed); + +exports.default = Embed; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] +}; + +var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); +var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); +var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + +exports.AlignAttribute = AlignAttribute; +exports.AlignClass = AlignClass; +exports.AlignStyle = AlignStyle; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BackgroundStyle = exports.BackgroundClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _color = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE +}); +var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.BackgroundClass = BackgroundClass; +exports.BackgroundStyle = BackgroundStyle; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] +}; + +var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); +var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); +var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + +exports.DirectionAttribute = DirectionAttribute; +exports.DirectionClass = DirectionClass; +exports.DirectionStyle = DirectionStyle; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontClass = exports.FontStyle = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] +}; + +var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); + +var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); + + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); + + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + + return FontStyleAttributor; +}(_parchment2.default.Attributor.Style); + +var FontStyle = new FontStyleAttributor('font', 'font-family', config); + +exports.FontStyle = FontStyle; +exports.FontClass = FontClass; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SizeStyle = exports.SizeClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] +}); +var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] +}); + +exports.SizeClass = SizeClass; +exports.SizeStyle = SizeStyle; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + 'align': { + '': __webpack_require__(76), + 'center': __webpack_require__(77), + 'right': __webpack_require__(78), + 'justify': __webpack_require__(79) + }, + 'background': __webpack_require__(80), + 'blockquote': __webpack_require__(81), + 'bold': __webpack_require__(82), + 'clean': __webpack_require__(83), + 'code': __webpack_require__(58), + 'code-block': __webpack_require__(58), + 'color': __webpack_require__(84), + 'direction': { + '': __webpack_require__(85), + 'rtl': __webpack_require__(86) + }, + 'float': { + 'center': __webpack_require__(87), + 'full': __webpack_require__(88), + 'left': __webpack_require__(89), + 'right': __webpack_require__(90) + }, + 'formula': __webpack_require__(91), + 'header': { + '1': __webpack_require__(92), + '2': __webpack_require__(93) + }, + 'italic': __webpack_require__(94), + 'image': __webpack_require__(95), + 'indent': { + '+1': __webpack_require__(96), + '-1': __webpack_require__(97) + }, + 'link': __webpack_require__(98), + 'list': { + 'ordered': __webpack_require__(99), + 'bullet': __webpack_require__(100), + 'check': __webpack_require__(101) + }, + 'script': { + 'sub': __webpack_require__(102), + 'super': __webpack_require__(103) + }, + 'strike': __webpack_require__(104), + 'underline': __webpack_require__(105), + 'video': __webpack_require__(106) +}; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLastChangeIndex = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.stack[dest].push(delta); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'cutoff', + value: function cutoff() { + this.lastRecorded = 0; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; +}(_module2.default); + +History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false +}; + +function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; +} + +function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; +} + +exports.default = History; +exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BaseTooltip = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _keyboard = __webpack_require__(23); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +var _theme = __webpack_require__(34); + +var _theme2 = _interopRequireDefault(_theme); + +var _colorPicker = __webpack_require__(59); + +var _colorPicker2 = _interopRequireDefault(_colorPicker); + +var _iconPicker = __webpack_require__(60); + +var _iconPicker2 = _interopRequireDefault(_iconPicker); + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +var _tooltip = __webpack_require__(61); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ALIGNS = [false, 'center', 'right', 'justify']; + +var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"]; + +var FONTS = [false, 'serif', 'monospace']; + +var HEADERS = ['1', '2', '3', false]; + +var SIZES = ['small', false, 'large', 'huge']; + +var BaseTheme = function (_Theme) { + _inherits(BaseTheme, _Theme); + + function BaseTheme(quill, options) { + _classCallCheck(this, BaseTheme); + + var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); + + var listener = function listener(e) { + if (!document.body.contains(quill.root)) { + return document.body.removeEventListener('click', listener); + } + if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { + _this.tooltip.hide(); + } + if (_this.pickers != null) { + _this.pickers.forEach(function (picker) { + if (!picker.container.contains(e.target)) { + picker.close(); + } + }); + } + }; + quill.emitter.listenDOM('click', document.body, listener); + return _this; + } + + _createClass(BaseTheme, [{ + key: 'addModule', + value: function addModule(name) { + var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); + if (name === 'toolbar') { + this.extendToolbar(module); + } + return module; + } + }, { + key: 'buildButtons', + value: function buildButtons(buttons, icons) { + buttons.forEach(function (button) { + var className = button.getAttribute('class') || ''; + className.split(/\s+/).forEach(function (name) { + if (!name.startsWith('ql-')) return; + name = name.slice('ql-'.length); + if (icons[name] == null) return; + if (name === 'direction') { + button.innerHTML = icons[name][''] + icons[name]['rtl']; + } else if (typeof icons[name] === 'string') { + button.innerHTML = icons[name]; + } else { + var value = button.value || ''; + if (value != null && icons[name][value]) { + button.innerHTML = icons[name][value]; + } + } + }); + }); + } + }, { + key: 'buildPickers', + value: function buildPickers(selects, icons) { + var _this2 = this; + + this.pickers = selects.map(function (select) { + if (select.classList.contains('ql-align')) { + if (select.querySelector('option') == null) { + fillSelect(select, ALIGNS); + } + return new _iconPicker2.default(select, icons.align); + } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { + var format = select.classList.contains('ql-background') ? 'background' : 'color'; + if (select.querySelector('option') == null) { + fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); + } + return new _colorPicker2.default(select, icons[format]); + } else { + if (select.querySelector('option') == null) { + if (select.classList.contains('ql-font')) { + fillSelect(select, FONTS); + } else if (select.classList.contains('ql-header')) { + fillSelect(select, HEADERS); + } else if (select.classList.contains('ql-size')) { + fillSelect(select, SIZES); + } + } + return new _picker2.default(select); + } + }); + var update = function update() { + _this2.pickers.forEach(function (picker) { + picker.update(); + }); + }; + this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update); + } + }]); + + return BaseTheme; +}(_theme2.default); + +BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + formula: function formula() { + this.quill.theme.tooltip.edit('formula'); + }, + image: function image() { + var _this3 = this; + + var fileInput = this.container.querySelector('input.ql-image[type=file]'); + if (fileInput == null) { + fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); + fileInput.classList.add('ql-image'); + fileInput.addEventListener('change', function () { + if (fileInput.files != null && fileInput.files[0] != null) { + var reader = new FileReader(); + reader.onload = function (e) { + var range = _this3.quill.getSelection(true); + _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); + _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT); + fileInput.value = ""; + }; + reader.readAsDataURL(fileInput.files[0]); + } + }); + this.container.appendChild(fileInput); + } + fileInput.click(); + }, + video: function video() { + this.quill.theme.tooltip.edit('video'); + } + } + } + } +}); + +var BaseTooltip = function (_Tooltip) { + _inherits(BaseTooltip, _Tooltip); + + function BaseTooltip(quill, boundsContainer) { + _classCallCheck(this, BaseTooltip); + + var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); + + _this4.textbox = _this4.root.querySelector('input[type="text"]'); + _this4.listen(); + return _this4; + } + + _createClass(BaseTooltip, [{ + key: 'listen', + value: function listen() { + var _this5 = this; + + this.textbox.addEventListener('keydown', function (event) { + if (_keyboard2.default.match(event, 'enter')) { + _this5.save(); + event.preventDefault(); + } else if (_keyboard2.default.match(event, 'escape')) { + _this5.cancel(); + event.preventDefault(); + } + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.hide(); + } + }, { + key: 'edit', + value: function edit() { + var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; + var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + this.root.classList.remove('ql-hidden'); + this.root.classList.add('ql-editing'); + if (preview != null) { + this.textbox.value = preview; + } else if (mode !== this.root.getAttribute('data-mode')) { + this.textbox.value = ''; + } + this.position(this.quill.getBounds(this.quill.selection.savedRange)); + this.textbox.select(); + this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); + this.root.setAttribute('data-mode', mode); + } + }, { + key: 'restoreFocus', + value: function restoreFocus() { + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.quill.focus(); + this.quill.scrollingContainer.scrollTop = scrollTop; + } + }, { + key: 'save', + value: function save() { + var value = this.textbox.value; + switch (this.root.getAttribute('data-mode')) { + case 'link': + { + var scrollTop = this.quill.root.scrollTop; + if (this.linkRange) { + this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); + delete this.linkRange; + } else { + this.restoreFocus(); + this.quill.format('link', value, _emitter2.default.sources.USER); + } + this.quill.root.scrollTop = scrollTop; + break; + } + case 'video': + { + value = extractVideoUrl(value); + } // eslint-disable-next-line no-fallthrough + case 'formula': + { + if (!value) break; + var range = this.quill.getSelection(true); + if (range != null) { + var index = range.index + range.length; + this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); + if (this.root.getAttribute('data-mode') === 'formula') { + this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); + } + this.quill.setSelection(index + 2, _emitter2.default.sources.USER); + } + break; + } + default: + } + this.textbox.value = ''; + this.hide(); + } + }]); + + return BaseTooltip; +}(_tooltip2.default); + +function extractVideoUrl(url) { + var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); + if (match) { + return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0'; + } + if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) { + // eslint-disable-line no-cond-assign + return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/'; + } + return url; +} + +function fillSelect(select, values) { + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + values.forEach(function (value) { + var option = document.createElement('option'); + if (value === defaultValue) { + option.setAttribute('selected', 'selected'); + } else { + option.setAttribute('value', value); + } + select.appendChild(option); + }); +} + +exports.BaseTooltip = BaseTooltip; +exports.default = BaseTheme; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length = cur.length(); + if (index < length || + (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + if (blot == null || + blot === _this || + //@ts-ignore + blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var Registry = __webpack_require__(1); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elem = document.createElement('div'); +elem.classList.toggle('test-class', false); +if (elem.classList.contains('test-class')) { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; +} + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); +} + +document.addEventListener("DOMContentLoaded", function () { + // Disable resizing in Firefox + document.execCommand("enableObjectResizing", false, false); + // Disable automatic linkifying in IE11 + document.execCommand("autoUrlDetect", false, false); +}); + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; + + +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + commonlength = diff_commonSuffix(text1, text2); + var commonsuffix = text1.substring(text1.length - commonlength); + text1 = text1.substring(0, text1.length - commonlength); + text2 = text2.substring(0, text2.length - commonlength); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + diffs = fix_emoji(diffs); + return diffs; +}; + + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +}; + + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + k2start += 2; + } else if (!front) { + var k1_offset = v_offset + delta - k2; + if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) { + var x1 = v1[k1_offset]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; +}; + + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +}; + + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.<string>} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.<string>} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + text2_a = hm[0]; + text2_b = hm[1]; + text1_a = hm[2]; + text1_b = hm[3]; + } + var mid_common = hm[4]; + return [text1_a, text1_b, text2_a, text2_b, mid_common]; +}; + + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ +function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + switch (diffs[pointer][0]) { + case DIFF_INSERT: + count_insert++; + text_insert += diffs[pointer][1]; + pointer++; + break; + case DIFF_DELETE: + count_delete++; + text_delete += diffs[pointer][1]; + pointer++; + break; + case DIFF_EQUAL: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (commonlength !== 0) { + diffs[pointer][1] = text_insert.substring(text_insert.length - + commonlength) + diffs[pointer][1]; + text_insert = text_insert.substring(0, text_insert.length - + commonlength); + text_delete = text_delete.substring(0, text_delete.length - + commonlength); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + diffs[pointer][1] = diffs[pointer - 1][1] + + diffs[pointer][1].substring(0, diffs[pointer][1].length - + diffs[pointer - 1][1].length); + diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; + diffs.splice(pointer - 1, 1); + changes = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + diffs[pointer - 1][1] += diffs[pointer + 1][1]; + diffs[pointer][1] = + diffs[pointer][1].substring(diffs[pointer + 1][1].length) + + diffs[pointer + 1][1]; + diffs.splice(pointer + 1, 1); + changes = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; + + +var diff = diff_main; +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + +/* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ +function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') +} + +/* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ +function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } +} + +/* + * Check diff did not split surrogate pairs. + * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] + * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' + * + * @param {Array} diffs Array of diff tuples + * @return {Array} Array of diff tuples + */ +function fix_emoji (diffs) { + var compact = false; + var starts_with_pair_end = function(str) { + return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; + } + var ends_with_pair_start = function(str) { + return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; + } + for (var i = 2; i < diffs.length; i += 1) { + if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && + diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && + diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { + compact = true; + + diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; + diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; + + diffs[i-2][1] = diffs[i-2][1].slice(0, -1); + } + } + if (!compact) { + return diffs; + } + var fixed_diffs = []; + for (var i = 0; i < diffs.length; i += 1) { + if (diffs[i][1].length > 0) { + fixed_diffs.push(diffs[i]); + } + } + return fixed_diffs; +} + +/* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ +function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; +} + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend2 = __webpack_require__(3); + +var _extend3 = _interopRequireDefault(_extend2); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _align = __webpack_require__(36); + +var _background = __webpack_require__(37); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _color = __webpack_require__(26); + +var _direction = __webpack_require__(38); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:clipboard'); + +var DOM_KEY = '__ql-matcher'; + +var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + +var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + selector = _ref2[0], + matcher = _ref2[1]; + + if (!options.matchVisual && matcher === matchSpacing) return; + _this.addMatcher(selector, matcher); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + if (typeof html === 'string') { + this.container.innerHTML = html.replace(/\>\r?\n +\</g, '><'); // Remove spaces between tags + return this.convert(); + } + var formats = this.quill.getFormat(this.quill.selection.savedRange.index); + if (formats[_code2.default.blotName]) { + var text = this.container.innerText; + this.container.innerHTML = ''; + return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); + } + + var _prepareMatching = this.prepareMatching(), + _prepareMatching2 = _slicedToArray(_prepareMatching, 2), + elementMatchers = _prepareMatching2[0], + textMatchers = _prepareMatching2[1]; + + var delta = traverse(this.container, elementMatchers, textMatchers); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + this.quill.setContents(this.convert(index), html); + this.quill.setSelection(0, _quill2.default.sources.SILENT); + } else { + var paste = this.convert(html); + this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this2 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index); + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.container.focus(); + this.quill.selection.update(_quill2.default.sources.SILENT); + setTimeout(function () { + delta = delta.concat(_this2.convert()).delete(range.length); + _this2.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + _this2.quill.scrollingContainer.scrollTop = scrollTop; + _this2.quill.focus(); + }, 1); + } + }, { + key: 'prepareMatching', + value: function prepareMatching() { + var _this3 = this; + + var elementMatchers = [], + textMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + return [elementMatchers, textMatchers]; + } + }]); + + return Clipboard; +}(_module2.default); + +Clipboard.DEFAULTS = { + matchers: [], + matchVisual: true +}; + +function applyFormat(delta, format, value) { + if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { + return Object.keys(format).reduce(function (delta, key) { + return applyFormat(delta, key, format[key]); + }, delta); + } else { + return delta.reduce(function (delta, op) { + if (op.attributes && op.attributes[format]) { + return delta.push(op); + } else { + return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); + } + }, new _quillDelta2.default()); + } +} + +function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); +} + +function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; +} + +function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; +} + +function traverse(node, elementMatchers, textMatchers) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode, elementMatchers, textMatchers); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } +} + +function matchAlias(format, node, delta) { + return applyFormat(delta, format, true); +} + +function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + formats[attr.attrName] = attr.value(node) || undefined; + } + attr = STYLE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node) || undefined; + } + }); + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + return delta; +} + +function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + delta = applyFormat(delta, match.blotName, match.formats(node)); + } + return delta; +} + +function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; +} + +function matchIgnore() { + return new _quillDelta2.default(); +} + +function matchIndent(node, delta) { + var match = _parchment2.default.query(node); + if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { + return delta; + } + var indent = -1, + parent = node.parentNode; + while (!parent.classList.contains('ql-clipboard')) { + if ((_parchment2.default.query(parent) || {}).blotName === 'list') { + indent += 1; + } + parent = parent.parentNode; + } + if (indent <= 0) return delta; + return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); +} + +function matchNewline(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { + delta.insert('\n'); + } + } + return delta; +} + +function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; +} + +function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { + formats.italic = true; + } + if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; +} + +function matchText(node, delta) { + var text = node.data; + // Word represents empty line with <o:p> </o:p> + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { + return delta; + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); +} + +exports.default = Clipboard; +exports.matchAttributor = matchAttributor; +exports.matchBlot = matchBlot; +exports.matchNewline = matchNewline; +exports.matchSpacing = matchSpacing; +exports.matchText = matchText; + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Bold = function (_Inline) { + _inherits(Bold, _Inline); + + function Bold() { + _classCallCheck(this, Bold); + + return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); + } + + _createClass(Bold, [{ + key: 'optimize', + value: function optimize(context) { + _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context); + if (this.domNode.tagName !== this.statics.tagName[0]) { + this.replaceWith(this.statics.blotName); + } + } + }], [{ + key: 'create', + value: function create() { + return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return Bold; +}(_inline2.default); + +Bold.blotName = 'bold'; +Bold.tagName = ['STRONG', 'B']; + +exports.default = Bold; + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addControls = exports.default = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:toolbar'); + +var Toolbar = function (_Module) { + _inherits(Toolbar, _Module); + + function Toolbar(quill, options) { + _classCallCheck(this, Toolbar); + + var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); + + if (Array.isArray(_this.options.container)) { + var container = document.createElement('div'); + addControls(container, _this.options.container); + quill.container.parentNode.insertBefore(container, quill.container); + _this.container = container; + } else if (typeof _this.options.container === 'string') { + _this.container = document.querySelector(_this.options.container); + } else { + _this.container = _this.options.container; + } + if (!(_this.container instanceof HTMLElement)) { + var _ret; + + return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); + } + _this.container.classList.add('ql-toolbar'); + _this.controls = []; + _this.handlers = {}; + Object.keys(_this.options.handlers).forEach(function (format) { + _this.addHandler(format, _this.options.handlers[format]); + }); + [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { + _this.attach(input); + }); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { + if (type === _quill2.default.events.SELECTION_CHANGE) { + _this.update(range); + } + }); + _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + var _this$quill$selection = _this.quill.selection.getRange(), + _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), + range = _this$quill$selection2[0]; // quill.getSelection triggers update + + + _this.update(range); + }); + return _this; + } + + _createClass(Toolbar, [{ + key: 'addHandler', + value: function addHandler(format, handler) { + this.handlers[format] = handler; + } + }, { + key: 'attach', + value: function attach(input) { + var _this2 = this; + + var format = [].find.call(input.classList, function (className) { + return className.indexOf('ql-') === 0; + }); + if (!format) return; + format = format.slice('ql-'.length); + if (input.tagName === 'BUTTON') { + input.setAttribute('type', 'button'); + } + if (this.handlers[format] == null) { + if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { + debug.warn('ignoring attaching to disabled format', format, input); + return; + } + if (_parchment2.default.query(format) == null) { + debug.warn('ignoring attaching to nonexistent format', format, input); + return; + } + } + var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; + input.addEventListener(eventName, function (e) { + var value = void 0; + if (input.tagName === 'SELECT') { + if (input.selectedIndex < 0) return; + var selected = input.options[input.selectedIndex]; + if (selected.hasAttribute('selected')) { + value = false; + } else { + value = selected.value || false; + } + } else { + if (input.classList.contains('ql-active')) { + value = false; + } else { + value = input.value || !input.hasAttribute('value'); + } + e.preventDefault(); + } + _this2.quill.focus(); + + var _quill$selection$getR = _this2.quill.selection.getRange(), + _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), + range = _quill$selection$getR2[0]; + + if (_this2.handlers[format] != null) { + _this2.handlers[format].call(_this2, value); + } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { + value = prompt('Enter ' + format); + if (!value) return; + _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); + } else { + _this2.quill.format(format, value, _quill2.default.sources.USER); + } + _this2.update(range); + }); + // TODO use weakmap + this.controls.push([format, input]); + } + }, { + key: 'update', + value: function update(range) { + var formats = range == null ? {} : this.quill.getFormat(range); + this.controls.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + format = _pair[0], + input = _pair[1]; + + if (input.tagName === 'SELECT') { + var option = void 0; + if (range == null) { + option = null; + } else if (formats[format] == null) { + option = input.querySelector('option[selected]'); + } else if (!Array.isArray(formats[format])) { + var value = formats[format]; + if (typeof value === 'string') { + value = value.replace(/\"/g, '\\"'); + } + option = input.querySelector('option[value="' + value + '"]'); + } + if (option == null) { + input.value = ''; // TODO make configurable? + input.selectedIndex = -1; + } else { + option.selected = true; + } + } else { + if (range == null) { + input.classList.remove('ql-active'); + } else if (input.hasAttribute('value')) { + // both being null should match (default values) + // '1' should match with 1 (headers) + var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); + input.classList.toggle('ql-active', isActive); + } else { + input.classList.toggle('ql-active', formats[format] != null); + } + } + }); + } + }]); + + return Toolbar; +}(_module2.default); + +Toolbar.DEFAULTS = {}; + +function addButton(container, format, value) { + var input = document.createElement('button'); + input.setAttribute('type', 'button'); + input.classList.add('ql-' + format); + if (value != null) { + input.value = value; + } + container.appendChild(input); +} + +function addControls(container, groups) { + if (!Array.isArray(groups[0])) { + groups = [groups]; + } + groups.forEach(function (controls) { + var group = document.createElement('span'); + group.classList.add('ql-formats'); + controls.forEach(function (control) { + if (typeof control === 'string') { + addButton(group, control); + } else { + var format = Object.keys(control)[0]; + var value = control[format]; + if (Array.isArray(value)) { + addSelect(group, format, value); + } else { + addButton(group, format, value); + } + } + }); + container.appendChild(group); + }); +} + +function addSelect(container, format, values) { + var input = document.createElement('select'); + input.classList.add('ql-' + format); + values.forEach(function (value) { + var option = document.createElement('option'); + if (value !== false) { + option.setAttribute('value', value); + } else { + option.setAttribute('selected', 'selected'); + } + input.appendChild(option); + }); + container.appendChild(input); +} + +Toolbar.DEFAULTS = { + container: null, + handlers: { + clean: function clean() { + var _this3 = this; + + var range = this.quill.getSelection(); + if (range == null) return; + if (range.length == 0) { + var formats = this.quill.getFormat(); + Object.keys(formats).forEach(function (name) { + // Clean functionality in existing apps only clean inline formats + if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { + _this3.quill.format(name, false); + } + }); + } else { + this.quill.removeFormat(range, _quill2.default.sources.USER); + } + }, + direction: function direction(value) { + var align = this.quill.getFormat()['align']; + if (value === 'rtl' && align == null) { + this.quill.format('align', 'right', _quill2.default.sources.USER); + } else if (!value && align === 'right') { + this.quill.format('align', false, _quill2.default.sources.USER); + } + this.quill.format('direction', value, _quill2.default.sources.USER); + }, + indent: function indent(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + var indent = parseInt(formats.indent || 0); + if (value === '+1' || value === '-1') { + var modifier = value === '+1' ? 1 : -1; + if (formats.direction === 'rtl') modifier *= -1; + this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); + } + }, + link: function link(value) { + if (value === true) { + value = prompt('Enter link URL:'); + } + this.quill.format('link', value, _quill2.default.sources.USER); + }, + list: function list(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + if (value === 'check') { + if (formats['list'] === 'checked' || formats['list'] === 'unchecked') { + this.quill.format('list', false, _quill2.default.sources.USER); + } else { + this.quill.format('list', 'unchecked', _quill2.default.sources.USER); + } + } else { + this.quill.format('list', value, _quill2.default.sources.USER); + } + } + } +}; + +exports.default = Toolbar; +exports.addControls = addControls; + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <polyline class=\"ql-even ql-stroke\" points=\"5 7 3 9 5 11\"></polyline> <polyline class=\"ql-even ql-stroke\" points=\"13 7 15 9 13 11\"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>"; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorPicker = function (_Picker) { + _inherits(ColorPicker, _Picker); + + function ColorPicker(select, label) { + _classCallCheck(this, ColorPicker); + + var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); + + _this.label.innerHTML = label; + _this.container.classList.add('ql-color-picker'); + [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { + item.classList.add('ql-primary'); + }); + return _this; + } + + _createClass(ColorPicker, [{ + key: 'buildItem', + value: function buildItem(option) { + var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); + item.style.backgroundColor = option.getAttribute('value') || ''; + return item; + } + }, { + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); + var colorLabel = this.label.querySelector('.ql-color-label'); + var value = item ? item.getAttribute('data-value') || '' : ''; + if (colorLabel) { + if (colorLabel.tagName === 'line') { + colorLabel.style.stroke = value; + } else { + colorLabel.style.fill = value; + } + } + } + }]); + + return ColorPicker; +}(_picker2.default); + +exports.default = ColorPicker; + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var IconPicker = function (_Picker) { + _inherits(IconPicker, _Picker); + + function IconPicker(select, icons) { + _classCallCheck(this, IconPicker); + + var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); + + _this.container.classList.add('ql-icon-picker'); + [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { + item.innerHTML = icons[item.getAttribute('data-value') || '']; + }); + _this.defaultItem = _this.container.querySelector('.ql-selected'); + _this.selectItem(_this.defaultItem); + return _this; + } + + _createClass(IconPicker, [{ + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); + item = item || this.defaultItem; + this.label.innerHTML = item.innerHTML; + } + }]); + + return IconPicker; +}(_picker2.default); + +exports.default = IconPicker; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Tooltip = function () { + function Tooltip(quill, boundsContainer) { + var _this = this; + + _classCallCheck(this, Tooltip); + + this.quill = quill; + this.boundsContainer = boundsContainer || document.body; + this.root = quill.addContainer('ql-tooltip'); + this.root.innerHTML = this.constructor.TEMPLATE; + if (this.quill.root === this.quill.scrollingContainer) { + this.quill.root.addEventListener('scroll', function () { + _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px'; + }); + } + this.hide(); + } + + _createClass(Tooltip, [{ + key: 'hide', + value: function hide() { + this.root.classList.add('ql-hidden'); + } + }, { + key: 'position', + value: function position(reference) { + var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; + // root.scrollTop should be 0 if scrollContainer !== root + var top = reference.bottom + this.quill.root.scrollTop; + this.root.style.left = left + 'px'; + this.root.style.top = top + 'px'; + this.root.classList.remove('ql-flip'); + var containerBounds = this.boundsContainer.getBoundingClientRect(); + var rootBounds = this.root.getBoundingClientRect(); + var shift = 0; + if (rootBounds.right > containerBounds.right) { + shift = containerBounds.right - rootBounds.right; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.left < containerBounds.left) { + shift = containerBounds.left - rootBounds.left; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.bottom > containerBounds.bottom) { + var height = rootBounds.bottom - rootBounds.top; + var verticalShift = reference.bottom - reference.top + height; + this.root.style.top = top - verticalShift + 'px'; + this.root.classList.add('ql-flip'); + } + return shift; + } + }, { + key: 'show', + value: function show() { + this.root.classList.remove('ql-editing'); + this.root.classList.remove('ql-hidden'); + } + }]); + + return Tooltip; +}(); + +exports.default = Tooltip; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _base = __webpack_require__(43); + +var _base2 = _interopRequireDefault(_base); + +var _link = __webpack_require__(27); + +var _link2 = _interopRequireDefault(_link); + +var _selection = __webpack_require__(15); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; + +var SnowTheme = function (_BaseTheme) { + _inherits(SnowTheme, _BaseTheme); + + function SnowTheme(quill, options) { + _classCallCheck(this, SnowTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-snow'); + return _this; + } + + _createClass(SnowTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + toolbar.container.classList.add('ql-snow'); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + this.tooltip = new SnowTooltip(this.quill, this.options.bounds); + if (toolbar.container.querySelector('.ql-link')) { + this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { + toolbar.handlers['link'].call(toolbar, !context.format.link); + }); + } + } + }]); + + return SnowTheme; +}(_base2.default); + +SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (value) { + var range = this.quill.getSelection(); + if (range == null || range.length == 0) return; + var preview = this.quill.getText(range); + if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { + preview = 'mailto:' + preview; + } + var tooltip = this.quill.theme.tooltip; + tooltip.edit('link', preview); + } else { + this.quill.format('link', false); + } + } + } + } + } +}); + +var SnowTooltip = function (_BaseTooltip) { + _inherits(SnowTooltip, _BaseTooltip); + + function SnowTooltip(quill, bounds) { + _classCallCheck(this, SnowTooltip); + + var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); + + _this2.preview = _this2.root.querySelector('a.ql-preview'); + return _this2; + } + + _createClass(SnowTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('a.ql-action').addEventListener('click', function (event) { + if (_this3.root.classList.contains('ql-editing')) { + _this3.save(); + } else { + _this3.edit('link', _this3.preview.textContent); + } + event.preventDefault(); + }); + this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { + if (_this3.linkRange != null) { + var range = _this3.linkRange; + _this3.restoreFocus(); + _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER); + delete _this3.linkRange; + } + event.preventDefault(); + _this3.hide(); + }); + this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) { + if (range == null) return; + if (range.length === 0 && source === _emitter2.default.sources.USER) { + var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + link = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (link != null) { + _this3.linkRange = new _selection.Range(range.index - offset, link.length()); + var preview = _link2.default.formats(link.domNode); + _this3.preview.textContent = preview; + _this3.preview.setAttribute('href', preview); + _this3.show(); + _this3.position(_this3.quill.getBounds(_this3.linkRange)); + return; + } + } else { + delete _this3.linkRange; + } + _this3.hide(); + }); + } + }, { + key: 'show', + value: function show() { + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); + this.root.removeAttribute('data-mode'); + } + }]); + + return SnowTooltip; +}(_base.BaseTooltip); + +SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join(''); + +exports.default = SnowTheme; + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _core = __webpack_require__(29); + +var _core2 = _interopRequireDefault(_core); + +var _align = __webpack_require__(36); + +var _direction = __webpack_require__(38); + +var _indent = __webpack_require__(64); + +var _blockquote = __webpack_require__(65); + +var _blockquote2 = _interopRequireDefault(_blockquote); + +var _header = __webpack_require__(66); + +var _header2 = _interopRequireDefault(_header); + +var _list = __webpack_require__(67); + +var _list2 = _interopRequireDefault(_list); + +var _background = __webpack_require__(37); + +var _color = __webpack_require__(26); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +var _bold = __webpack_require__(56); + +var _bold2 = _interopRequireDefault(_bold); + +var _italic = __webpack_require__(68); + +var _italic2 = _interopRequireDefault(_italic); + +var _link = __webpack_require__(27); + +var _link2 = _interopRequireDefault(_link); + +var _script = __webpack_require__(69); + +var _script2 = _interopRequireDefault(_script); + +var _strike = __webpack_require__(70); + +var _strike2 = _interopRequireDefault(_strike); + +var _underline = __webpack_require__(71); + +var _underline2 = _interopRequireDefault(_underline); + +var _image = __webpack_require__(72); + +var _image2 = _interopRequireDefault(_image); + +var _video = __webpack_require__(73); + +var _video2 = _interopRequireDefault(_video); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _formula = __webpack_require__(74); + +var _formula2 = _interopRequireDefault(_formula); + +var _syntax = __webpack_require__(75); + +var _syntax2 = _interopRequireDefault(_syntax); + +var _toolbar = __webpack_require__(57); + +var _toolbar2 = _interopRequireDefault(_toolbar); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +var _picker = __webpack_require__(28); + +var _picker2 = _interopRequireDefault(_picker); + +var _colorPicker = __webpack_require__(59); + +var _colorPicker2 = _interopRequireDefault(_colorPicker); + +var _iconPicker = __webpack_require__(60); + +var _iconPicker2 = _interopRequireDefault(_iconPicker); + +var _tooltip = __webpack_require__(61); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +var _bubble = __webpack_require__(108); + +var _bubble2 = _interopRequireDefault(_bubble); + +var _snow = __webpack_require__(62); + +var _snow2 = _interopRequireDefault(_snow); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_core2.default.register({ + 'attributors/attribute/direction': _direction.DirectionAttribute, + + 'attributors/class/align': _align.AlignClass, + 'attributors/class/background': _background.BackgroundClass, + 'attributors/class/color': _color.ColorClass, + 'attributors/class/direction': _direction.DirectionClass, + 'attributors/class/font': _font.FontClass, + 'attributors/class/size': _size.SizeClass, + + 'attributors/style/align': _align.AlignStyle, + 'attributors/style/background': _background.BackgroundStyle, + 'attributors/style/color': _color.ColorStyle, + 'attributors/style/direction': _direction.DirectionStyle, + 'attributors/style/font': _font.FontStyle, + 'attributors/style/size': _size.SizeStyle +}, true); + +_core2.default.register({ + 'formats/align': _align.AlignClass, + 'formats/direction': _direction.DirectionClass, + 'formats/indent': _indent.IndentClass, + + 'formats/background': _background.BackgroundStyle, + 'formats/color': _color.ColorStyle, + 'formats/font': _font.FontClass, + 'formats/size': _size.SizeClass, + + 'formats/blockquote': _blockquote2.default, + 'formats/code-block': _code2.default, + 'formats/header': _header2.default, + 'formats/list': _list2.default, + + 'formats/bold': _bold2.default, + 'formats/code': _code.Code, + 'formats/italic': _italic2.default, + 'formats/link': _link2.default, + 'formats/script': _script2.default, + 'formats/strike': _strike2.default, + 'formats/underline': _underline2.default, + + 'formats/image': _image2.default, + 'formats/video': _video2.default, + + 'formats/list/item': _list.ListItem, + + 'modules/formula': _formula2.default, + 'modules/syntax': _syntax2.default, + 'modules/toolbar': _toolbar2.default, + + 'themes/bubble': _bubble2.default, + 'themes/snow': _snow2.default, + + 'ui/icons': _icons2.default, + 'ui/picker': _picker2.default, + 'ui/icon-picker': _iconPicker2.default, + 'ui/color-picker': _colorPicker2.default, + 'ui/tooltip': _tooltip2.default +}, true); + +exports.default = _core2.default; + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndentClass = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var IdentAttributor = function (_Parchment$Attributor) { + _inherits(IdentAttributor, _Parchment$Attributor); + + function IdentAttributor() { + _classCallCheck(this, IdentAttributor); + + return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); + } + + _createClass(IdentAttributor, [{ + key: 'add', + value: function add(node, value) { + if (value === '+1' || value === '-1') { + var indent = this.value(node) || 0; + value = value === '+1' ? indent + 1 : indent - 1; + } + if (value === 0) { + this.remove(node); + return true; + } else { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); + } + } + }, { + key: 'canAdd', + value: function canAdd(node, value) { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value)); + } + }, { + key: 'value', + value: function value(node) { + return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN + } + }]); + + return IdentAttributor; +}(_parchment2.default.Attributor.Class); + +var IndentClass = new IdentAttributor('indent', 'ql-indent', { + scope: _parchment2.default.Scope.BLOCK, + whitelist: [1, 2, 3, 4, 5, 6, 7, 8] +}); + +exports.IndentClass = IndentClass; + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Blockquote = function (_Block) { + _inherits(Blockquote, _Block); + + function Blockquote() { + _classCallCheck(this, Blockquote); + + return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); + } + + return Blockquote; +}(_block2.default); + +Blockquote.blotName = 'blockquote'; +Blockquote.tagName = 'blockquote'; + +exports.default = Blockquote; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Header = function (_Block) { + _inherits(Header, _Block); + + function Header() { + _classCallCheck(this, Header); + + return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); + } + + _createClass(Header, null, [{ + key: 'formats', + value: function formats(domNode) { + return this.tagName.indexOf(domNode.tagName) + 1; + } + }]); + + return Header; +}(_block2.default); + +Header.blotName = 'header'; +Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; + +exports.default = Header; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.ListItem = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _container = __webpack_require__(25); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ListItem = function (_Block) { + _inherits(ListItem, _Block); + + function ListItem() { + _classCallCheck(this, ListItem); + + return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); + } + + _createClass(ListItem, [{ + key: 'format', + value: function format(name, value) { + if (name === List.blotName && !value) { + this.replaceWith(_parchment2.default.create(this.statics.scope)); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); + } + } + }, { + key: 'remove', + value: function remove() { + if (this.prev == null && this.next == null) { + this.parent.remove(); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); + } + } + }, { + key: 'replaceWith', + value: function replaceWith(name, value) { + this.parent.isolate(this.offset(this.parent), this.length()); + if (name === this.parent.statics.blotName) { + this.parent.replaceWith(name, value); + return this; + } else { + this.parent.unwrap(); + return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); + } + } + }], [{ + key: 'formats', + value: function formats(domNode) { + return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); + } + }]); + + return ListItem; +}(_block2.default); + +ListItem.blotName = 'list-item'; +ListItem.tagName = 'LI'; + +var List = function (_Container) { + _inherits(List, _Container); + + _createClass(List, null, [{ + key: 'create', + value: function create(value) { + var tagName = value === 'ordered' ? 'OL' : 'UL'; + var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName); + if (value === 'checked' || value === 'unchecked') { + node.setAttribute('data-checked', value === 'checked'); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'OL') return 'ordered'; + if (domNode.tagName === 'UL') { + if (domNode.hasAttribute('data-checked')) { + return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; + } else { + return 'bullet'; + } + } + return undefined; + } + }]); + + function List(domNode) { + _classCallCheck(this, List); + + var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode)); + + var listEventHandler = function listEventHandler(e) { + if (e.target.parentNode !== domNode) return; + var format = _this2.statics.formats(domNode); + var blot = _parchment2.default.find(e.target); + if (format === 'checked') { + blot.format('list', 'unchecked'); + } else if (format === 'unchecked') { + blot.format('list', 'checked'); + } + }; + + domNode.addEventListener('touchstart', listEventHandler); + domNode.addEventListener('mousedown', listEventHandler); + return _this2; + } + + _createClass(List, [{ + key: 'format', + value: function format(name, value) { + if (this.children.length > 0) { + this.children.tail.format(name, value); + } + } + }, { + key: 'formats', + value: function formats() { + // We don't inherit from FormatBlot + return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot instanceof ListItem) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); + } else { + var index = ref == null ? this.length() : ref.offset(this); + var after = this.split(index); + after.parent.insertBefore(blot, after); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + if (target.statics.blotName !== this.statics.blotName) { + var item = _parchment2.default.create(this.statics.defaultChild); + target.moveChildren(item); + this.appendChild(item); + } + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); + } + }]); + + return List; +}(_container2.default); + +List.blotName = 'list'; +List.scope = _parchment2.default.Scope.BLOCK_BLOT; +List.tagName = ['OL', 'UL']; +List.defaultChild = 'list-item'; +List.allowedChildren = [ListItem]; + +exports.ListItem = ListItem; +exports.default = List; + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _bold = __webpack_require__(56); + +var _bold2 = _interopRequireDefault(_bold); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Italic = function (_Bold) { + _inherits(Italic, _Bold); + + function Italic() { + _classCallCheck(this, Italic); + + return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); + } + + return Italic; +}(_bold2.default); + +Italic.blotName = 'italic'; +Italic.tagName = ['EM', 'I']; + +exports.default = Italic; + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Script = function (_Inline) { + _inherits(Script, _Inline); + + function Script() { + _classCallCheck(this, Script); + + return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); + } + + _createClass(Script, null, [{ + key: 'create', + value: function create(value) { + if (value === 'super') { + return document.createElement('sup'); + } else if (value === 'sub') { + return document.createElement('sub'); + } else { + return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); + } + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'SUB') return 'sub'; + if (domNode.tagName === 'SUP') return 'super'; + return undefined; + } + }]); + + return Script; +}(_inline2.default); + +Script.blotName = 'script'; +Script.tagName = ['SUB', 'SUP']; + +exports.default = Script; + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Strike = function (_Inline) { + _inherits(Strike, _Inline); + + function Strike() { + _classCallCheck(this, Strike); + + return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); + } + + return Strike; +}(_inline2.default); + +Strike.blotName = 'strike'; +Strike.tagName = 'S'; + +exports.default = Strike; + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Underline = function (_Inline) { + _inherits(Underline, _Inline); + + function Underline() { + _classCallCheck(this, Underline); + + return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); + } + + return Underline; +}(_inline2.default); + +Underline.blotName = 'underline'; +Underline.tagName = 'U'; + +exports.default = Underline; + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _link = __webpack_require__(27); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['alt', 'height', 'width']; + +var Image = function (_Parchment$Embed) { + _inherits(Image, _Parchment$Embed); + + function Image() { + _classCallCheck(this, Image); + + return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); + } + + _createClass(Image, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); + if (typeof value === 'string') { + node.setAttribute('src', this.sanitize(value)); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'match', + value: function match(url) { + return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) + ); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Image; +}(_parchment2.default.Embed); + +Image.blotName = 'image'; +Image.tagName = 'IMG'; + +exports.default = Image; + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _block = __webpack_require__(4); + +var _link = __webpack_require__(27); + +var _link2 = _interopRequireDefault(_link); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['height', 'width']; + +var Video = function (_BlockEmbed) { + _inherits(Video, _BlockEmbed); + + function Video() { + _classCallCheck(this, Video); + + return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); + } + + _createClass(Video, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); + node.setAttribute('frameborder', '0'); + node.setAttribute('allowfullscreen', true); + node.setAttribute('src', this.sanitize(value)); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _link2.default.sanitize(url); + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Video; +}(_block.BlockEmbed); + +Video.blotName = 'video'; +Video.className = 'ql-video'; +Video.tagName = 'IFRAME'; + +exports.default = Video; + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.FormulaBlot = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var FormulaBlot = function (_Embed) { + _inherits(FormulaBlot, _Embed); + + function FormulaBlot() { + _classCallCheck(this, FormulaBlot); + + return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); + } + + _createClass(FormulaBlot, null, [{ + key: 'create', + value: function create(value) { + var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); + if (typeof value === 'string') { + window.katex.render(value, node, { + throwOnError: false, + errorColor: '#f00' + }); + node.setAttribute('data-value', value); + } + return node; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('data-value'); + } + }]); + + return FormulaBlot; +}(_embed2.default); + +FormulaBlot.blotName = 'formula'; +FormulaBlot.className = 'ql-formula'; +FormulaBlot.tagName = 'SPAN'; + +var Formula = function (_Module) { + _inherits(Formula, _Module); + + _createClass(Formula, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(FormulaBlot, true); + } + }]); + + function Formula() { + _classCallCheck(this, Formula); + + var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this)); + + if (window.katex == null) { + throw new Error('Formula module requires KaTeX.'); + } + return _this2; + } + + return Formula; +}(_module2.default); + +exports.FormulaBlot = FormulaBlot; +exports.default = Formula; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.CodeToken = exports.CodeBlock = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var SyntaxCodeBlock = function (_CodeBlock) { + _inherits(SyntaxCodeBlock, _CodeBlock); + + function SyntaxCodeBlock() { + _classCallCheck(this, SyntaxCodeBlock); + + return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); + } + + _createClass(SyntaxCodeBlock, [{ + key: 'replaceWith', + value: function replaceWith(block) { + this.domNode.textContent = this.domNode.textContent; + this.attach(); + _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); + } + }, { + key: 'highlight', + value: function highlight(_highlight) { + var text = this.domNode.textContent; + if (this.cachedText !== text) { + if (text.trim().length > 0 || this.cachedText == null) { + this.domNode.innerHTML = _highlight(text); + this.domNode.normalize(); + this.attach(); + } + this.cachedText = text; + } + } + }]); + + return SyntaxCodeBlock; +}(_code2.default); + +SyntaxCodeBlock.className = 'ql-syntax'; + +var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { + scope: _parchment2.default.Scope.INLINE +}); + +var Syntax = function (_Module) { + _inherits(Syntax, _Module); + + _createClass(Syntax, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(CodeToken, true); + _quill2.default.register(SyntaxCodeBlock, true); + } + }]); + + function Syntax(quill, options) { + _classCallCheck(this, Syntax); + + var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); + + if (typeof _this2.options.highlight !== 'function') { + throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); + } + var timer = null; + _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + clearTimeout(timer); + timer = setTimeout(function () { + _this2.highlight(); + timer = null; + }, _this2.options.interval); + }); + _this2.highlight(); + return _this2; + } + + _createClass(Syntax, [{ + key: 'highlight', + value: function highlight() { + var _this3 = this; + + if (this.quill.selection.composing) return; + this.quill.update(_quill2.default.sources.USER); + var range = this.quill.getSelection(); + this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { + code.highlight(_this3.options.highlight); + }); + this.quill.update(_quill2.default.sources.SILENT); + if (range != null) { + this.quill.setSelection(range, _quill2.default.sources.SILENT); + } + } + }]); + + return Syntax; +}(_module2.default); + +Syntax.DEFAULTS = { + highlight: function () { + if (window.hljs == null) return null; + return function (text) { + var result = window.hljs.highlightAuto(text); + return result.value; + }; + }(), + interval: 1000 +}; + +exports.CodeBlock = SyntaxCodeBlock; +exports.CodeToken = CodeToken; +exports.default = Syntax; + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>"; + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>"; + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>"; + +/***/ }), +/* 79 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>"; + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <g class=\"ql-fill ql-color-label\"> <polygon points=\"6 6.868 6 6 5 6 5 7 5.942 7 6 6.868\"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points=\"6.817 5 6 5 6 6 6.38 6 6.817 5\"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points=\"4 11.439 4 11 3 11 3 12 3.755 12 4 11.439\"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points=\"4.63 10 4 10 4 11 4.192 11 4.63 10\"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points=\"13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174\"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points=\"12 6.868 12 6 11.62 6 12 6.868\"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points=\"12.933 9 13 9 13 8 12.495 8 12.933 9\"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points=\"5.5 13 9 5 12.5 13\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>"; + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=\"ql-fill ql-stroke\" height=3 width=3 x=4 y=5></rect> <rect class=\"ql-fill ql-stroke\" height=3 width=3 x=11 y=5></rect> <path class=\"ql-even ql-fill ql-stroke\" d=M7,8c0,4.031-3,5-3,5></path> <path class=\"ql-even ql-fill ql-stroke\" d=M14,8c0,4.031-3,5-3,5></path> </svg>"; + +/***/ }), +/* 82 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>"; + +/***/ }), +/* 83 */ +/***/ (function(module, exports) { + +module.exports = "<svg class=\"\" viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>"; + +/***/ }), +/* 84 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=\"ql-color-label ql-stroke ql-transparent\" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points=\"5.5 11 9 3 12.5 11\"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>"; + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=\"ql-stroke ql-fill\" points=\"3 11 5 9 3 7 3 11\"></polygon> <line class=\"ql-stroke ql-fill\" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>"; + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=\"ql-stroke ql-fill\" points=\"15 12 13 10 15 8 15 12\"></polygon> <line class=\"ql-stroke ql-fill\" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>"; + +/***/ }), +/* 87 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>"; + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>"; + +/***/ }), +/* 89 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>"; + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform=\"translate(24 18) rotate(-180)\"/> </svg>"; + +/***/ }), +/* 91 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>"; + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewBox=\"0 0 18 18\"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>"; + +/***/ }), +/* 93 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewBox=\"0 0 18 18\"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>"; + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>"; + +/***/ }), +/* 95 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class=\"ql-even ql-fill\" points=\"5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12\"></polyline> </svg>"; + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=\"ql-fill ql-stroke\" points=\"3 7 3 11 5 9 3 7\"></polyline> </svg>"; + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\"5 7 5 11 3 9 5 7\"></polyline> </svg>"; + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class=\"ql-even ql-stroke\" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class=\"ql-even ql-stroke\" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>"; + +/***/ }), +/* 99 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class=\"ql-stroke ql-thin\" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class=\"ql-stroke ql-thin\" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class=\"ql-stroke ql-thin\" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>"; + +/***/ }), +/* 100 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>"; + +/***/ }), +/* 101 */ +/***/ (function(module, exports) { + +module.exports = "<svg class=\"\" viewbox=\"0 0 18 18\"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points=\"3 4 4 5 6 3\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points=\"3 14 4 15 6 13\"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points=\"3 9 4 10 6 8\"></polyline> </svg>"; + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>"; + +/***/ }), +/* 103 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>"; + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <line class=\"ql-stroke ql-thin\" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>"; + +/***/ }), +/* 105 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>"; + +/***/ }), +/* 106 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>"; + +/***/ }), +/* 107 */ +/***/ (function(module, exports) { + +module.exports = "<svg viewbox=\"0 0 18 18\"> <polygon class=ql-stroke points=\"7 11 9 13 11 11 7 11\"></polygon> <polygon class=ql-stroke points=\"7 7 9 5 11 7 7 7\"></polygon> </svg>"; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BubbleTooltip = undefined; + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _base = __webpack_require__(43); + +var _base2 = _interopRequireDefault(_base); + +var _selection = __webpack_require__(15); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; + +var BubbleTheme = function (_BaseTheme) { + _inherits(BubbleTheme, _BaseTheme); + + function BubbleTheme(quill, options) { + _classCallCheck(this, BubbleTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-bubble'); + return _this; + } + + _createClass(BubbleTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); + this.tooltip.root.appendChild(toolbar.container); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + } + }]); + + return BubbleTheme; +}(_base2.default); + +BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (!value) { + this.quill.format('link', false); + } else { + this.quill.theme.tooltip.edit(); + } + } + } + } + } +}); + +var BubbleTooltip = function (_BaseTooltip) { + _inherits(BubbleTooltip, _BaseTooltip); + + function BubbleTooltip(quill, bounds) { + _classCallCheck(this, BubbleTooltip); + + var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); + + _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) { + if (type !== _emitter2.default.events.SELECTION_CHANGE) return; + if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) { + _this2.show(); + // Lock our width so we will expand beyond our offsetParent boundaries + _this2.root.style.left = '0px'; + _this2.root.style.width = ''; + _this2.root.style.width = _this2.root.offsetWidth + 'px'; + var lines = _this2.quill.getLines(range.index, range.length); + if (lines.length === 1) { + _this2.position(_this2.quill.getBounds(range)); + } else { + var lastLine = lines[lines.length - 1]; + var index = _this2.quill.getIndex(lastLine); + var length = Math.min(lastLine.length() - 1, range.index + range.length - index); + var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); + _this2.position(_bounds); + } + } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { + _this2.hide(); + } + }); + return _this2; + } + + _createClass(BubbleTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('.ql-close').addEventListener('click', function () { + _this3.root.classList.remove('ql-editing'); + }); + this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { + // Let selection be restored by toolbar handlers before repositioning + setTimeout(function () { + if (_this3.root.classList.contains('ql-hidden')) return; + var range = _this3.quill.getSelection(); + if (range != null) { + _this3.position(_this3.quill.getBounds(range)); + } + }, 1); + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.show(); + } + }, { + key: 'position', + value: function position(reference) { + var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); + var arrow = this.root.querySelector('.ql-tooltip-arrow'); + arrow.style.marginLeft = ''; + if (shift === 0) return shift; + arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; + } + }]); + + return BubbleTooltip; +}(_base.BaseTooltip); + +BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', '</div>'].join(''); + +exports.BubbleTooltip = BubbleTooltip; +exports.default = BubbleTheme; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(63); + + +/***/ }) +/******/ ])["default"]; +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer)) + +/***/ }), + +/***/ "./node_modules/setimmediate/setImmediate.js": +/*!***************************************************!*\ + !*** ./node_modules/setimmediate/setImmediate.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { + "use strict"; + + if (global.setImmediate) { + return; + } + + var nextHandle = 1; // Spec says greater than zero + var tasksByHandle = {}; + var currentlyRunningATask = false; + var doc = global.document; + var registerImmediate; + + function setImmediate(callback) { + // Callback can either be a function or a string + if (typeof callback !== "function") { + callback = new Function("" + callback); + } + // Copy function arguments + var args = new Array(arguments.length - 1); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i + 1]; + } + // Store and register the task + var task = { callback: callback, args: args }; + tasksByHandle[nextHandle] = task; + registerImmediate(nextHandle); + return nextHandle++; + } + + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + + function run(task) { + var callback = task.callback; + var args = task.args; + switch (args.length) { + case 0: + callback(); + break; + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(undefined, args); + break; + } + } + + function runIfPresent(handle) { + // From the spec: "Wait until any invocations of this algorithm started before this one have completed." + // So if we're currently running a task, we'll need to delay this invocation. + if (currentlyRunningATask) { + // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a + // "too much recursion" error. + setTimeout(runIfPresent, 0, handle); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + run(task); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + + function installNextTickImplementation() { + registerImmediate = function(handle) { + process.nextTick(function () { runIfPresent(handle); }); + }; + } + + function canUsePostMessage() { + // The test against `importScripts` prevents this implementation from being installed inside a web worker, + // where `global.postMessage` means something completely different and can't be used for this purpose. + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage("", "*"); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + + function installPostMessageImplementation() { + // Installs an event handler on `global` for the `message` event: see + // * https://developer.mozilla.org/en/DOM/window.postMessage + // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages + + var messagePrefix = "setImmediate$" + Math.random() + "$"; + var onGlobalMessage = function(event) { + if (event.source === global && + typeof event.data === "string" && + event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + + if (global.addEventListener) { + global.addEventListener("message", onGlobalMessage, false); + } else { + global.attachEvent("onmessage", onGlobalMessage); + } + + registerImmediate = function(handle) { + global.postMessage(messagePrefix + handle, "*"); + }; + } + + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + + registerImmediate = function(handle) { + channel.port2.postMessage(handle); + }; + } + + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + registerImmediate = function(handle) { + // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted + // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. + var script = doc.createElement("script"); + script.onreadystatechange = function () { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + }; + } + + function installSetTimeoutImplementation() { + registerImmediate = function(handle) { + setTimeout(runIfPresent, 0, handle); + }; + } + + // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. + var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); + attachTo = attachTo && attachTo.setTimeout ? attachTo : global; + + // Don't get fooled by e.g. browserify environments. + if ({}.toString.call(global.process) === "[object process]") { + // For Node.js before 0.9 + installNextTickImplementation(); + + } else if (canUsePostMessage()) { + // For non-IE10 modern browsers + installPostMessageImplementation(); + + } else if (global.MessageChannel) { + // For web workers, where supported + installMessageChannelImplementation(); + + } else if (doc && "onreadystatechange" in doc.createElement("script")) { + // For IE 6–8 + installReadyStateChangeImplementation(); + + } else { + // For older browsers + installSetTimeoutImplementation(); + } + + attachTo.setImmediate = setImmediate; + attachTo.clearImmediate = clearImmediate; +}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"))) + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css&": +/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css& ***! + \************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--7-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--7-2!../../../node_modules/vue-loader/lib??vue-loader-options!./DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css&": +/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css& ***! + \********************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--7-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--7-2!../../../node_modules/vue-loader/lib??vue-loader-options!./MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css&": +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css& ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--7-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--7-2!../../../node_modules/vue-loader/lib??vue-loader-options!./Notification.vue?vue&type=style&index=0&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css&": +/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css& ***! + \***************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./HTMLEmbedder.vue?vue&type=style&index=0&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css&": +/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css& ***! + \****************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./ImageUploader.vue?vue&type=style&index=0&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css&": +/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css& ***! + \*****************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css&": +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css& ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./FeaturedImageUploader.vue?vue&type=style&index=0&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css&": +/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/style-loader!./node_modules/css-loader??ref--7-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css& ***! + \*****************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + + +var content = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css&"); + +if(typeof content === 'string') content = [[module.i, content, '']]; + +var transform; +var insertInto; + + + +var options = {"hmr":true} + +options.transform = transform +options.insertInto = undefined; + +var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); + +if(content.locals) module.exports = content.locals; + +if(false) {} + +/***/ }), + +/***/ "./node_modules/style-loader/lib/addStyles.js": +/*!****************************************************!*\ + !*** ./node_modules/style-loader/lib/addStyles.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var stylesInDom = {}; + +var memoize = function (fn) { + var memo; + + return function () { + if (typeof memo === "undefined") memo = fn.apply(this, arguments); + return memo; + }; +}; + +var isOldIE = memoize(function () { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + return window && document && document.all && !window.atob; +}); + +var getTarget = function (target, parent) { + if (parent){ + return parent.querySelector(target); + } + return document.querySelector(target); +}; + +var getElement = (function (fn) { + var memo = {}; + + return function(target, parent) { + // If passing function in options, then use it for resolve "head" element. + // Useful for Shadow Root style i.e + // { + // insertInto: function () { return document.querySelector("#foo").shadowRoot } + // } + if (typeof target === 'function') { + return target(); + } + if (typeof memo[target] === "undefined") { + var styleTarget = getTarget.call(this, target, parent); + // Special case to return head of iframe instead of iframe itself + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch(e) { + styleTarget = null; + } + } + memo[target] = styleTarget; + } + return memo[target] + }; +})(); + +var singleton = null; +var singletonCounter = 0; +var stylesInsertedAtTop = []; + +var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js"); + +module.exports = function(list, options) { + if (typeof DEBUG !== "undefined" && DEBUG) { + if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); + } + + options = options || {}; + + options.attrs = typeof options.attrs === "object" ? options.attrs : {}; + + // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> + // tags it will allow on a page + if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE(); + + // By default, add <style> tags to the <head> element + if (!options.insertInto) options.insertInto = "head"; + + // By default, add <style> tags to the bottom of the target + if (!options.insertAt) options.insertAt = "bottom"; + + var styles = listToStyles(list, options); + + addStylesToDom(styles, options); + + return function update (newList) { + var mayRemove = []; + + for (var i = 0; i < styles.length; i++) { + var item = styles[i]; + var domStyle = stylesInDom[item.id]; + + domStyle.refs--; + mayRemove.push(domStyle); + } + + if(newList) { + var newStyles = listToStyles(newList, options); + addStylesToDom(newStyles, options); + } + + for (var i = 0; i < mayRemove.length; i++) { + var domStyle = mayRemove[i]; + + if(domStyle.refs === 0) { + for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); + + delete stylesInDom[domStyle.id]; + } + } + }; +}; + +function addStylesToDom (styles, options) { + for (var i = 0; i < styles.length; i++) { + var item = styles[i]; + var domStyle = stylesInDom[item.id]; + + if(domStyle) { + domStyle.refs++; + + for(var j = 0; j < domStyle.parts.length; j++) { + domStyle.parts[j](item.parts[j]); + } + + for(; j < item.parts.length; j++) { + domStyle.parts.push(addStyle(item.parts[j], options)); + } + } else { + var parts = []; + + for(var j = 0; j < item.parts.length; j++) { + parts.push(addStyle(item.parts[j], options)); + } + + stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; + } + } +} + +function listToStyles (list, options) { + var styles = []; + var newStyles = {}; + + for (var i = 0; i < list.length; i++) { + var item = list[i]; + var id = options.base ? item[0] + options.base : item[0]; + var css = item[1]; + var media = item[2]; + var sourceMap = item[3]; + var part = {css: css, media: media, sourceMap: sourceMap}; + + if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]}); + else newStyles[id].parts.push(part); + } + + return styles; +} + +function insertStyleElement (options, style) { + var target = getElement(options.insertInto) + + if (!target) { + throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid."); + } + + var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1]; + + if (options.insertAt === "top") { + if (!lastStyleElementInsertedAtTop) { + target.insertBefore(style, target.firstChild); + } else if (lastStyleElementInsertedAtTop.nextSibling) { + target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling); + } else { + target.appendChild(style); + } + stylesInsertedAtTop.push(style); + } else if (options.insertAt === "bottom") { + target.appendChild(style); + } else if (typeof options.insertAt === "object" && options.insertAt.before) { + var nextSibling = getElement(options.insertAt.before, target); + target.insertBefore(style, nextSibling); + } else { + throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n"); + } +} + +function removeStyleElement (style) { + if (style.parentNode === null) return false; + style.parentNode.removeChild(style); + + var idx = stylesInsertedAtTop.indexOf(style); + if(idx >= 0) { + stylesInsertedAtTop.splice(idx, 1); + } +} + +function createStyleElement (options) { + var style = document.createElement("style"); + + if(options.attrs.type === undefined) { + options.attrs.type = "text/css"; + } + + if(options.attrs.nonce === undefined) { + var nonce = getNonce(); + if (nonce) { + options.attrs.nonce = nonce; + } + } + + addAttrs(style, options.attrs); + insertStyleElement(options, style); + + return style; +} + +function createLinkElement (options) { + var link = document.createElement("link"); + + if(options.attrs.type === undefined) { + options.attrs.type = "text/css"; + } + options.attrs.rel = "stylesheet"; + + addAttrs(link, options.attrs); + insertStyleElement(options, link); + + return link; +} + +function addAttrs (el, attrs) { + Object.keys(attrs).forEach(function (key) { + el.setAttribute(key, attrs[key]); + }); +} + +function getNonce() { + if (false) {} + + return __webpack_require__.nc; +} + +function addStyle (obj, options) { + var style, update, remove, result; + + // If a transform function was defined, run it on the css + if (options.transform && obj.css) { + result = typeof options.transform === 'function' + ? options.transform(obj.css) + : options.transform.default(obj.css); + + if (result) { + // If transform returns a value, use that instead of the original css. + // This allows running runtime transformations on the css. + obj.css = result; + } else { + // If the transform function returns a falsy value, don't add this css. + // This allows conditional loading of css + return function() { + // noop + }; + } + } + + if (options.singleton) { + var styleIndex = singletonCounter++; + + style = singleton || (singleton = createStyleElement(options)); + + update = applyToSingletonTag.bind(null, style, styleIndex, false); + remove = applyToSingletonTag.bind(null, style, styleIndex, true); + + } else if ( + obj.sourceMap && + typeof URL === "function" && + typeof URL.createObjectURL === "function" && + typeof URL.revokeObjectURL === "function" && + typeof Blob === "function" && + typeof btoa === "function" + ) { + style = createLinkElement(options); + update = updateLink.bind(null, style, options); + remove = function () { + removeStyleElement(style); + + if(style.href) URL.revokeObjectURL(style.href); + }; + } else { + style = createStyleElement(options); + update = applyToTag.bind(null, style); + remove = function () { + removeStyleElement(style); + }; + } + + update(obj); + + return function updateStyle (newObj) { + if (newObj) { + if ( + newObj.css === obj.css && + newObj.media === obj.media && + newObj.sourceMap === obj.sourceMap + ) { + return; + } + + update(obj = newObj); + } else { + remove(); + } + }; +} + +var replaceText = (function () { + var textStore = []; + + return function (index, replacement) { + textStore[index] = replacement; + + return textStore.filter(Boolean).join('\n'); + }; +})(); + +function applyToSingletonTag (style, index, remove, obj) { + var css = remove ? "" : obj.css; + + if (style.styleSheet) { + style.styleSheet.cssText = replaceText(index, css); + } else { + var cssNode = document.createTextNode(css); + var childNodes = style.childNodes; + + if (childNodes[index]) style.removeChild(childNodes[index]); + + if (childNodes.length) { + style.insertBefore(cssNode, childNodes[index]); + } else { + style.appendChild(cssNode); + } + } +} + +function applyToTag (style, obj) { + var css = obj.css; + var media = obj.media; + + if(media) { + style.setAttribute("media", media) + } + + if(style.styleSheet) { + style.styleSheet.cssText = css; + } else { + while(style.firstChild) { + style.removeChild(style.firstChild); + } + + style.appendChild(document.createTextNode(css)); + } +} + +function updateLink (link, options, obj) { + var css = obj.css; + var sourceMap = obj.sourceMap; + + /* + If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled + and there is no publicPath defined then lets turn convertToAbsoluteUrls + on by default. Otherwise default to the convertToAbsoluteUrls option + directly + */ + var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap; + + if (options.convertToAbsoluteUrls || autoFixUrls) { + css = fixUrls(css); + } + + if (sourceMap) { + // http://stackoverflow.com/a/26603875 + css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; + } + + var blob = new Blob([css], { type: "text/css" }); + + var oldSrc = link.href; + + link.href = URL.createObjectURL(blob); + + if(oldSrc) URL.revokeObjectURL(oldSrc); +} + + +/***/ }), + +/***/ "./node_modules/style-loader/lib/urls.js": +/*!***********************************************!*\ + !*** ./node_modules/style-loader/lib/urls.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + + +/** + * When source maps are enabled, `style-loader` uses a link element with a data-uri to + * embed the css on the page. This breaks all relative urls because now they are relative to a + * bundle instead of the current page. + * + * One solution is to only use full urls, but that may be impossible. + * + * Instead, this function "fixes" the relative urls to be absolute according to the current page location. + * + * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command. + * + */ + +module.exports = function (css) { + // get current location + var location = typeof window !== "undefined" && window.location; + + if (!location) { + throw new Error("fixUrls requires window.location"); + } + + // blank or null? + if (!css || typeof css !== "string") { + return css; + } + + var baseUrl = location.protocol + "//" + location.host; + var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/"); + + // convert each url(...) + /* + This regular expression is just a way to recursively match brackets within + a string. + + /url\s*\( = Match on the word "url" with any whitespace after it and then a parens + ( = Start a capturing group + (?: = Start a non-capturing group + [^)(] = Match anything that isn't a parentheses + | = OR + \( = Match a start parentheses + (?: = Start another non-capturing groups + [^)(]+ = Match anything that isn't a parentheses + | = OR + \( = Match a start parentheses + [^)(]* = Match anything that isn't a parentheses + \) = Match a end parentheses + ) = End Group + *\) = Match anything and then a close parens + ) = Close non-capturing group + * = Match anything + ) = Close capturing group + \) = Match a close parens + + /gi = Get all matches, not the first. Be case insensitive. + */ + var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) { + // strip quotes (if they exist) + var unquotedOrigUrl = origUrl + .trim() + .replace(/^"(.*)"$/, function(o, $1){ return $1; }) + .replace(/^'(.*)'$/, function(o, $1){ return $1; }); + + // already a full url? no change + if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) { + return fullMatch; + } + + // convert the url to a full url + var newUrl; + + if (unquotedOrigUrl.indexOf("//") === 0) { + //TODO: should we add protocol? + newUrl = unquotedOrigUrl; + } else if (unquotedOrigUrl.indexOf("/") === 0) { + // path should be relative to the base url + newUrl = baseUrl + unquotedOrigUrl; // already starts with '/' + } else { + // path should be relative to current directory + newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './' + } + + // send back the fixed url(...) + return "url(" + JSON.stringify(newUrl) + ")"; + }); + + // send back the fixed css + return fixedCss; +}; + + +/***/ }), + +/***/ "./node_modules/timers-browserify/main.js": +/*!************************************************!*\ + !*** ./node_modules/timers-browserify/main.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) || + (typeof self !== "undefined" && self) || + window; +var apply = Function.prototype.apply; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { + if (timeout) { + timeout.close(); + } +}; + +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; +} +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(scope, this._id); +}; + +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; + +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; + +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } +}; + +// setimmediate attaches itself to the global object +__webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js"); +// On some exotic environments, it's not clear which object `setimmediate` was +// able to install onto. Search each possibility in the same order as the +// `setimmediate` library. +exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || + (typeof global !== "undefined" && global.setImmediate) || + (this && this.setImmediate); +exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || + (typeof global !== "undefined" && global.clearImmediate) || + (this && this.clearImmediate); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/vue-croppie/dist/vue-croppie.es.js": +/*!*********************************************************!*\ + !*** ./node_modules/vue-croppie/dist/vue-croppie.es.js ***! + \*********************************************************/ +/*! exports provided: default, VueCroppieComponent */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VueCroppieComponent", function() { return VueCroppieComponent; }); +/* harmony import */ var croppie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! croppie */ "./node_modules/croppie/croppie.js"); +/* harmony import */ var croppie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(croppie__WEBPACK_IMPORTED_MODULE_0__); + + +var VueCroppieComponent = { + name: 'VueCroppie', + render: function render(h) { + return h('div', { + class: this.customClass, + ref: 'croppieContainer', + id: 'croppieContainer' + }); + }, + props: { + boundary: Object, + customClass: String, + enableExif: Boolean, + enableOrientation: { + type: Boolean, + default: true + }, + enableResize: { + type: Boolean, + default: true + }, + enableZoom: { + type: Boolean, + default: true + }, + enforceBoundary: { + type: Boolean, + default: true + }, + mouseWheelZoom: { + type: [Boolean, String], + default: true + }, + showZoomer: { + type: Boolean, + default: true + }, + croppieInitialized: { + type: Function, + default: function _default() {} + }, + viewport: { + type: Object, + default: function _default() { + return { + width: 200, + height: 200, + type: 'square' + }; + } + }, + minZoom: Number, + maxZoom: Number + }, + mounted: function mounted() { + this.initCroppie(); + }, + data: function data() { + return { + croppie: null + }; + }, + methods: { + initCroppie: function initCroppie() { + var _this = this; + + var el = this.$refs.croppieContainer; + var options = { + enableExif: this.enableExif, + enableOrientation: this.enableOrientation, + enableZoom: this.enableZoom, + enableResize: this.enableResize, + enforceBoundary: this.enforceBoundary, + mouseWheelZoom: this.mouseWheelZoom, + viewport: this.viewport, + showZoomer: this.showZoomer, + minZoom: this.minZoom, + maxZoom: this.maxZoom + }; + + if (this.boundary) { + options.boundary = this.boundary; + } + + el.addEventListener('update', function (ev) { + _this.$emit('update', ev.detail); + }); + this.croppie = new croppie__WEBPACK_IMPORTED_MODULE_0___default.a(el, options); + this.croppieInitialized(); + }, + bind: function bind(options) { + return this.croppie.bind(options); + }, + destroy: function destroy() { + this.croppie.destroy(); + }, + get: function get(cb) { + if (cb) { + cb(this.croppie.get()); + } else { + return this.croppie.get(); + } + }, + rotate: function rotate(angle) { + this.croppie.rotate(angle); + }, + setZoom: function setZoom(value) { + this.croppie.setZoom(value); + }, + result: function result(options, cb) { + var _this2 = this; + + if (!options) options = { + type: 'base64' + }; + return this.croppie.result(options).then(function (output) { + if (!cb) { + _this2.$emit('result', output); + } else { + cb(output); + } + + return output; + }); + }, + refresh: function refresh() { + this.croppie.destroy(); + this.initCroppie(); + } + } +}; + +var VueCroppie = { + install: function install(Vue, options) { + Vue.component(VueCroppieComponent.name, VueCroppieComponent); + } +}; + +if (window && window.Vue) { + Vue.use(VueCroppie); +} + +/* harmony default export */ __webpack_exports__["default"] = (VueCroppie); + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Alert.vue?vue&type=template&id=7b2bf401&": +/*!********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Alert.vue?vue&type=template&id=7b2bf401& ***! + \********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { + directives: [ + { + name: "show", + rawName: "v-show", + value: _vm.$root.alert.type, + expression: "$root.alert.type" + } + ], + attrs: { id: "alert" } + }, + [ + _c("div", { staticClass: "dialog rounded" }, [ + _c("div", { staticClass: "text-center mb-4" }, [ + _vm.type == "confirmation" + ? _c( + "svg", + { + staticClass: "fill-red", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm2-13c0 .28-.21.8-.42 1L10 9.58c-.57.58-1 1.6-1 2.42v1h2v-1c0-.29.21-.8.42-1L13 9.42c.57-.58 1-1.6 1-2.42a4 4 0 1 0-8 0h2a2 2 0 1 1 4 0zm-3 8v2h2v-2H9z" + } + }) + ] + ) + : _vm._e(), + _vm._v(" "), + _vm.type == "success" + ? _c( + "svg", + { + staticClass: "fill-green", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM6.7 9.29L9 11.6l4.3-4.3 1.4 1.42L9 14.4l-3.7-3.7 1.4-1.42z" + } + }) + ] + ) + : _vm._e(), + _vm._v(" "), + _vm.type == "error" + ? _c( + "svg", + { + staticClass: "fill-rd", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm1.41-1.41A8 8 0 1 0 15.66 4.34 8 8 0 0 0 4.34 15.66zm9.9-8.49L11.41 10l2.83 2.83-1.41 1.41L10 11.41l-2.83 2.83-1.41-1.41L8.59 10 5.76 7.17l1.41-1.41L10 8.59l2.83-2.83 1.41 1.41z" + } + }) + ] + ) + : _vm._e(), + _vm._v(" "), + _c("p", { staticClass: "mt-3 mb-0" }, [_vm._v(_vm._s(_vm.message))]) + ]), + _vm._v(" "), + _c("div", { staticClass: "flex items-center justify-center" }, [ + _vm.type == "error" + ? _c( + "button", + { staticClass: "btn-primary btn-sm", on: { click: _vm.close } }, + [_vm._v("\n Ok\n ")] + ) + : _vm._e(), + _vm._v(" "), + _vm.type == "success" && !_vm.$root.alert.autoClose + ? _c( + "button", + { staticClass: "btn-primary btn-sm", on: { click: _vm.close } }, + [_vm._v("\n Ok\n ")] + ) + : _vm._e(), + _vm._v(" "), + _vm.type == "confirmation" + ? _c( + "button", + { + staticClass: "btn-primary btn-sm", + on: { click: _vm.confirm } + }, + [_vm._v("\n Yes\n ")] + ) + : _vm._e(), + _vm._v(" "), + _vm.type == "confirmation" + ? _c( + "button", + { + staticClass: "btn-light btn-sm ml-1", + on: { click: _vm.cancel } + }, + [_vm._v("\n No\n ")] + ) + : _vm._e() + ]) + ]) + ] + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CropperModal.vue?vue&type=template&id=6055dbea&": +/*!***************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CropperModal.vue?vue&type=template&id=6055dbea& ***! + \***************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("modal", { on: { close: _vm.cancel } }, [ + _vm.uploading + ? _c( + "div", + { + staticClass: + "absolute pin bg-black-shade z-50 flex items-center justify-center" + }, + [_c("preloader", { staticClass: "text-green" })], + 1 + ) + : _vm._e(), + _vm._v(" "), + _c( + "div", + { style: { height: _vm.viewport } }, + [ + _c("vue-croppie", { + ref: "croppieRef", + attrs: { + enableOrientation: true, + viewport: _vm.viewport, + boundary: _vm.boundary, + enableResize: true + } + }) + ], + 1 + ), + _vm._v(" "), + _c("div", { staticClass: "mt-10 flex align-center" }, [ + _c( + "button", + { + staticClass: "btn-sm ml-1 btn-light mr-auto", + on: { + click: function($event) { + _vm.cancel() + } + } + }, + [_vm._v("Cancel")] + ), + _vm._v(" "), + _c( + "button", + { + staticClass: "btn-sm btn-primary mr-2", + on: { + click: function($event) { + _vm.crop() + } + } + }, + [_vm._v("Crop Image")] + ), + _vm._v(" "), + _c( + "button", + { + staticClass: "btn-sm btn-primary", + on: { + click: function($event) { + _vm.uploadOriginalImage() + } + } + }, + [_vm._v("Use Original")] + ) + ]) + ]) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true&": +/*!*****************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true& ***! + \*****************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", [ + _c("div", { staticClass: "d-flex flex-row" }, [ + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.dateComponents.month, + expression: "dateComponents.month" + } + ], + staticClass: "input pr-2", + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.dateComponents, + "month", + $event.target.multiple ? $$selectedVal : $$selectedVal[0] + ) + } + } + }, + _vm._l( + Array.from({ length: 12 }, function(_, i) { + return String(i + 1).padStart(2, "0") + }), + function(value) { + return _c("option", { domProps: { value: value } }, [ + _vm._v(_vm._s(value)) + ]) + } + ), + 0 + ), + _vm._v(" "), + _c("span", { staticClass: "px-1" }, [_vm._v("/")]), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.dateComponents.day, + expression: "dateComponents.day" + } + ], + staticClass: "input px-2", + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.dateComponents, + "day", + $event.target.multiple ? $$selectedVal : $$selectedVal[0] + ) + } + } + }, + _vm._l( + Array.from({ length: 31 }, function(_, i) { + return String(i + 1).padStart(2, "0") + }), + function(value) { + return _c("option", { domProps: { value: value } }, [ + _vm._v(_vm._s(value)) + ]) + } + ), + 0 + ), + _vm._v(" "), + _c("span", { staticClass: "px-1" }, [_vm._v("/")]), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.dateComponents.year, + expression: "dateComponents.year" + } + ], + staticClass: "input px-2", + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.dateComponents, + "year", + $event.target.multiple ? $$selectedVal : $$selectedVal[0] + ) + } + } + }, + _vm._l( + Array.from({ length: 15 }, function(_, i) { + return i + new Date().getFullYear() - 10 + }), + function(value) { + return _c("option", { domProps: { value: value } }, [ + _vm._v(_vm._s(value)) + ]) + } + ), + 0 + ), + _vm._v(" "), + _c("span", { staticClass: "pl-5" }), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.dateComponents.hour, + expression: "dateComponents.hour" + } + ], + staticClass: "input px-2", + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.dateComponents, + "hour", + $event.target.multiple ? $$selectedVal : $$selectedVal[0] + ) + } + } + }, + _vm._l( + Array.from({ length: 24 }, function(_, i) { + return String(i).padStart(2, "0") + }), + function(value) { + return _c("option", { domProps: { value: value } }, [ + _vm._v(_vm._s(value)) + ]) + } + ), + 0 + ), + _vm._v(" "), + _c("span", { staticClass: "px-1" }, [_vm._v(":")]), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.dateComponents.minute, + expression: "dateComponents.minute" + } + ], + staticClass: "input pl-2", + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.dateComponents, + "minute", + $event.target.multiple ? $$selectedVal : $$selectedVal[0] + ) + } + } + }, + _vm._l( + Array.from({ length: 60 }, function(_, i) { + return String(i).padStart(2, "0") + }), + function(value) { + return _c("option", { domProps: { value: value } }, [ + _vm._v(_vm._s(value)) + ]) + } + ), + 0 + ) + ]) + ]) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DropDown.vue?vue&type=template&id=e7c365c8&": +/*!***********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/DropDown.vue?vue&type=template&id=e7c365c8& ***! + \***********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { + directives: [ + { + name: "click-outside", + rawName: "v-click-outside", + value: _vm.hide, + expression: "hide" + } + ] + }, + [ + _c( + "div", + { + on: { + click: function($event) { + $event.preventDefault() + return _vm.toggle($event) + } + } + }, + [_vm._t("trigger")], + 2 + ), + _vm._v(" "), + _vm.shouldShowContent ? _vm._t("content") : _vm._e() + ], + 2 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Editor.vue?vue&type=template&id=1dbb5118&": +/*!*********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Editor.vue?vue&type=template&id=1dbb5118& ***! + \*********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { staticStyle: { position: "relative" } }, + [ + _c("div", { attrs: { id: "sidebar-controls" } }, [ + _c( + "button", + { + staticClass: + "rounded-full w-8 h-8 border border-light text-light hover:bg-light hover:text-contrast text-center", + attrs: { id: "show-controls" }, + on: { click: _vm.showSideControls } + }, + [_vm._v("+")] + ), + _vm._v(" "), + _c("div", { staticClass: "controls hidden pl-4 bg-contrast" }, [ + _c( + "button", + { + on: { + click: function($event) { + _vm.openImageUploader() + } + } + }, + [ + _c( + "svg", + { + staticClass: "fill-current w-3", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M0 4c0-1.1.9-2 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm11 9l-3-3-6 6h16l-5-5-2 2zm4-4a2 2 0 1 0 0-4 2 2 0 0 0 0 4z" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c( + "button", + { + on: { + click: function($event) { + _vm.openingHTMLEmbedder() + } + } + }, + [ + _c( + "svg", + { + staticClass: "fill-current w-3", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M.7 9.3l4.8-4.8 1.4 1.42L2.84 10l4.07 4.07-1.41 1.42L0 10l.7-.7zm18.6 1.4l.7-.7-5.49-5.49-1.4 1.42L17.16 10l-4.07 4.07 1.41 1.42 4.78-4.78z" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c("button", { on: { click: _vm.addDivider } }, [ + _c( + "svg", + { + staticClass: "fill-current w-3", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M4 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm6 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm6 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" + } + }) + ] + ) + ]) + ]) + ]), + _vm._v(" "), + _c("div", { ref: "editor" }), + _vm._v(" "), + _c("image-uploader", { + attrs: { "post-id": "postId" }, + on: { updated: _vm.applyImage } + }), + _vm._v(" "), + _c("html-embedder", { + attrs: { "post-id": "postId" }, + on: { adding: _vm.applyHTML } + }) + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FormErrors.vue?vue&type=template&id=bea19b0c&": +/*!*************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/FormErrors.vue?vue&type=template&id=bea19b0c& ***! + \*************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { staticClass: "mt-2 text-sm" }, + _vm._l(_vm.errors, function(error) { + return _c("span", { staticClass: "text-red block" }, [ + _vm._v(_vm._s(error)) + ]) + }), + 0 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FullscreenModal.vue?vue&type=template&id=4d8b8f17&": +/*!******************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/FullscreenModal.vue?vue&type=template&id=4d8b8f17& ***! + \******************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("transition", { attrs: { name: "modal" } }, [_vm._t("default")], 2) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ImagePicker.vue?vue&type=template&id=497ddc2e&": +/*!**************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ImagePicker.vue?vue&type=template&id=497ddc2e& ***! + \**************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c("input", { + staticClass: "hidden", + attrs: { + type: "file", + id: "imageUpload" + _vm._uid, + accept: "image/*" + }, + on: { change: _vm.loadSelectedImage } + }), + _vm._v(" "), + _c("div", { staticClass: "mb-0" }, [ + _vm._v("\n Please "), + _c( + "label", + { + staticClass: "cursor-pointer underline", + attrs: { for: "imageUpload" + _vm._uid } + }, + [_vm._v("upload")] + ), + _vm._v(" an image\n "), + _vm.Wink.unsplash_key ? _c("span", [_vm._v("or")]) : _vm._e(), + _vm._v(" "), + _vm.Wink.unsplash_key + ? _c( + "a", + { + staticClass: "text-text-color", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.openUnsplashModal($event) + } + } + }, + [_vm._v("search Unsplash")] + ) + : _vm._e() + ]), + _vm._v(" "), + _vm.unsplashModalShown + ? _c("fullscreen-modal", [ + _c( + "div", + { staticClass: "bg-contrast z-50 fixed pin overflow-y-scroll" }, + [ + _c( + "div", + { staticClass: "container py-20" }, + [ + _c("div", { staticClass: "flex items-center" }, [ + _c("h2", { staticClass: "mr-auto" }, [ + _vm._v("Search Unsplash") + ]), + _vm._v(" "), + _vm.selectedUnsplashImage + ? _c( + "button", + { + staticClass: "btn-primary mr-4", + on: { click: _vm.closeUnplashModalAndInsertImage } + }, + [_vm._v("Choose Selected Image")] + ) + : _vm._e(), + _vm._v(" "), + _c( + "button", + { + staticClass: "btn-light", + on: { click: _vm.closeUnsplashModal } + }, + [_vm._v("Cancel")] + ) + ]), + _vm._v(" "), + _vm.Wink.unsplash_key + ? _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.unsplashSearchTerm, + expression: "unsplashSearchTerm" + } + ], + ref: "unsplashSearch", + staticClass: + "my-10 border-b border-very-light focus:outline-none w-full", + attrs: { + type: "text", + placeholder: "search Unsplash" + }, + domProps: { value: _vm.unsplashSearchTerm }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.unsplashSearchTerm = $event.target.value + } + } + }) + : _vm._e(), + _vm._v(" "), + _vm.searchingUnsplash + ? _c("preloader", { staticClass: "mt-10" }) + : _vm._e(), + _vm._v(" "), + !_vm.searchingUnsplash && _vm.unsplashImages.length + ? _c( + "div", + { staticClass: "flex flex-wrap mt-5" }, + [ + _vm._l(_vm.unsplashImages, function(image) { + return _c( + "div", + { + staticClass: "w-1/4 p-1 cursor-pointer", + on: { + click: function($event) { + _vm.selectedUnsplashImage = image + } + } + }, + [ + _c("div", { + staticClass: + "h-48 w-full bg-cover border-primary", + class: { + "border-4": + _vm.selectedUnsplashImage && + _vm.selectedUnsplashImage.id == image.id + }, + style: { + backgroundImage: + "url(" + image.urls.thumb + ")" + } + }) + ] + ) + }), + _vm._v(" "), + _vm.unsplashImages.length == 19 + ? _c("div", { staticClass: "w-1/4 p-1" }, [ + _c( + "div", + { + staticClass: + "bg-primary text-center flex items-center justify-center h-full" + }, + [ + _c( + "button", + { + staticClass: + "text-contrast hover:underline", + on: { + click: function($event) { + _vm.getImagesFromUnsplash( + _vm.unsplashPage + 1 + ) + } + } + }, + [_vm._v("More >>")] + ) + ] + ) + ]) + : _vm._e() + ], + 2 + ) + : _vm._e(), + _vm._v(" "), + !_vm.searchingUnsplash && !_vm.unsplashImages.length + ? _c("div", [ + _c("h4", { staticClass: "text-center" }, [ + _vm._v("We couldn't find any matches.") + ]) + ]) + : _vm._e() + ], + 1 + ) + ] + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.cropperModalShown + ? _c("cropper-modal", { + attrs: { + image: _vm.file, + viewport: { width: 600, height: 400 }, + boundary: { width: 600, height: 400 } + }, + on: { close: _vm.closeCropperModal, cancel: _vm.cancelCropperModal } + }) + : _vm._e() + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MarkdownEditor.vue?vue&type=template&id=8fc46f32&": +/*!*****************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MarkdownEditor.vue?vue&type=template&id=8fc46f32& ***! + \*****************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", [ + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.content, + expression: "content" + } + ], + staticClass: + "w-full outline-none resize-none text-sm leading-loose font-mono", + attrs: { + id: "markdown-editor", + spellcheck: "false", + cols: "30", + rows: "10", + placeholder: "Start writing *now*" + }, + domProps: { value: _vm.content }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.content = $event.target.value + } + } + }) + ]) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true&": +/*!*************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true& ***! + \*************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { staticClass: "relative" }, [_c("div", { ref: "editor" })]) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&": +/*!********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2& ***! + \********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("transition", { attrs: { name: "modal" } }, [ + _c( + "div", + { + staticClass: "z-50 fixed pin overflow-y-scroll modal-mask", + on: { click: _vm.handleClicks } + }, + [ + _c( + "div", + { + staticClass: + "bg-contrast relative rounded shadow-lg max-w-md mx-auto my-10 p-5 modal-container" + }, + [_vm._t("default")], + 2 + ) + ] + ) + ]) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MultiSelect.vue?vue&type=template&id=add4e00c&": +/*!**************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/MultiSelect.vue?vue&type=template&id=add4e00c& ***! + \**************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { + directives: [ + { + name: "click-outside", + rawName: "v-click-outside", + value: _vm.deactivate, + expression: "deactivate" + } + ], + staticClass: "multiselect relative z-50", + class: { active: _vm.focused }, + on: { click: _vm.activate } + }, + [ + _c( + "div", + { staticClass: "multiselect_options" }, + [ + _vm._l(_vm.value, function(option) { + return _c( + "span", + { + staticClass: + "bg-light hover:bg-red rounded cursor-pointer text-sm text-contrast font-semibold px-1 mr-1", + on: { + click: function($event) { + _vm.removeOption(option) + } + } + }, + [_vm._v(_vm._s(option[_vm.optionText]))] + ) + }), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.searchTerm, + expression: "searchTerm" + } + ], + ref: "input", + staticClass: "focus:outline-none bg-transparent text-text-color", + attrs: { type: "text" }, + domProps: { value: _vm.searchTerm }, + on: { + keydown: [ + function($event) { + if (!("button" in $event) && $event.keyCode !== 8) { + return null + } + return _vm.backspaceAction($event) + }, + function($event) { + if (!("button" in $event) && $event.keyCode !== 40) { + return null + } + return _vm.selectNextOption($event) + }, + function($event) { + if (!("button" in $event) && $event.keyCode !== 38) { + return null + } + return _vm.selectPreviousOption($event) + }, + function($event) { + if ( + !("button" in $event) && + _vm._k($event.keyCode, "enter", 13, $event.key, "Enter") + ) { + return null + } + return _vm.addSelectedOption($event) + } + ], + input: function($event) { + if ($event.target.composing) { + return + } + _vm.searchTerm = $event.target.value + } + } + }) + ], + 2 + ), + _vm._v(" "), + _c( + "div", + { + directives: [ + { + name: "show", + rawName: "v-show", + value: _vm.focused, + expression: "focused" + } + ], + staticClass: "multiselect_dropdown absolute w-full" + }, + [ + !_vm.matches.length + ? _c("button", { staticClass: "text-text-color" }, [ + _vm._v("Add new tag...") + ]) + : _vm._e(), + _vm._v(" "), + _vm._l(_vm.matches, function(match, index) { + return _c( + "button", + { + class: { selected: _vm.selectedOptionIndex == index }, + attrs: { value: match[_vm.optionId] }, + on: { + click: function($event) { + _vm.selectOption(match) + } + } + }, + [_vm._v(_vm._s(match[_vm.optionText]) + "\n ")] + ) + }) + ], + 2 + ) + ] + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=template&id=6a4ce154&": +/*!***************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Notification.vue?vue&type=template&id=6a4ce154& ***! + \***************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { + staticClass: "text-contrast bg-green px-8 py-4 rounded-lg", + attrs: { id: "notificationBody" } + }, + [_vm._v("\n " + _vm._s(_vm.message) + "\n")] + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/PageHeader.vue?vue&type=template&id=7fb418a7&": +/*!*************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/PageHeader.vue?vue&type=template&id=7fb418a7& ***! + \*************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { staticClass: "border-b border-very-light mb-10" }, [ + _c("div", { staticClass: "container" }, [ + _c("div", { staticClass: "flex items-center py-2" }, [ + _c( + "div", + { staticClass: "flex items-center mr-auto h-8" }, + [ + _c( + "h3", + { + staticClass: "mr-5 font-semibold font-serif", + class: { + hidden: _vm.hideLogoOnSmallScreens, + "sm:block": _vm.hideLogoOnSmallScreens + } + }, + [ + _c( + "router-link", + { + staticClass: "no-underline text-text-color", + attrs: { to: "/" } + }, + [ + _c("span", { staticClass: "text-light" }, [_vm._v("W")]), + _vm._v("ink.\n ") + ] + ) + ], + 1 + ), + _vm._v(" "), + _vm._t("left-side") + ], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "flex items-center" }, + [ + _vm._t("right-side"), + _vm._v(" "), + _c("dropdown", { staticClass: "relative ml-6" }, [ + _c( + "button", + { + staticClass: "focus:outline-none", + attrs: { slot: "trigger", type: "button" }, + slot: "trigger" + }, + [ + _c("img", { + staticClass: "rounded-full w-8 h-8", + attrs: { + src: _vm.Wink.author.avatar, + title: _vm.Wink.author.name + } + }) + ] + ), + _vm._v(" "), + _c( + "div", + { + staticClass: + "dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2", + attrs: { slot: "content" }, + slot: "content" + }, + [ + _c( + "router-link", + { + staticClass: + "no-underline text-text-color font-sans hover:text-primary w-full block py-2 px-4 border-b border-very-light", + attrs: { + to: { + name: "team-edit", + params: { id: _vm.Wink.author.id } + } + } + }, + [ + _vm._v( + "\n Profile\n " + ) + ] + ), + _vm._v(" "), + _c( + "router-link", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { to: "/posts" } + }, + [ + _vm._v( + "\n Posts\n " + ) + ] + ), + _vm._v(" "), + _c( + "router-link", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { to: "/pages" } + }, + [ + _vm._v( + "\n Pages\n " + ) + ] + ), + _vm._v(" "), + _c( + "router-link", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { to: "/tags" } + }, + [ + _vm._v( + "\n Tags\n " + ) + ] + ), + _vm._v(" "), + _c( + "router-link", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { to: "/team" } + }, + [ + _vm._v( + "\n Team\n " + ) + ] + ), + _vm._v(" "), + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4 border-t border-very-light", + attrs: { href: "/" + _vm.Wink.path + "/logout" } + }, + [ + _vm._v( + "\n Log out\n " + ) + ] + ) + ], + 1 + ) + ]) + ], + 2 + ) + ]) + ]) + ]) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/SEOModal.vue?vue&type=template&id=0c1171bb&": +/*!***********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/SEOModal.vue?vue&type=template&id=0c1171bb& ***! + \***********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("modal", { on: { close: _vm.close } }, [ + _c("div", { staticClass: "input-group" }, [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "meta_description" } }, + [_vm._v("\n Meta description\n ")] + ), + _vm._v(" "), + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.meta_description, + expression: "form.meta_description" + } + ], + staticClass: "input", + attrs: { placeholder: "Meta description", id: "meta_description" }, + domProps: { value: _vm.form.meta_description }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "meta_description", $event.target.value) + } + } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "input-group" }, [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "opengraph_title" } }, + [_vm._v("\n Facebook Card Title\n ")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.opengraph_title, + expression: "form.opengraph_title" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "Title in Facebook Card", + id: "opengraph_title" + }, + domProps: { value: _vm.form.opengraph_title }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "opengraph_title", $event.target.value) + } + } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "input-group" }, [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "opengraph_description" } }, + [_vm._v("\n Facebook Card Description\n ")] + ), + _vm._v(" "), + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.opengraph_description, + expression: "form.opengraph_description" + } + ], + staticClass: "input", + attrs: { + placeholder: "Description in Facebook Card", + id: "opengraph_description" + }, + domProps: { value: _vm.form.opengraph_description }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "opengraph_description", $event.target.value) + } + } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "input-group py-4" }, [ + _c( + "div", + { staticClass: "flex items-center justify-between" }, + [ + _c( + "div", + [ + _c("label", { staticClass: "input-label" }, [ + _vm._v( + "\n Facebook Card Image\n " + ) + ]), + _vm._v(" "), + _c("image-picker", { + staticClass: "mt-4 mb-1", + on: { + changed: _vm.updateFacebookImage, + uploading: function($event) { + _vm.facebookImageUploading = true + } + } + }) + ], + 1 + ), + _vm._v(" "), + _vm.facebookImageUploading ? _c("preloader") : _vm._e(), + _vm._v(" "), + !_vm.facebookImageUploading + ? _c("div", [ + !_vm.form.opengraph_image + ? _c( + "div", + { + staticClass: + "w-16 h-16 rounded-full bg-light flex items-center justify-center text-4xl text-contrast" + }, + [ + _c( + "svg", + { + staticClass: "fill-current w-8", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M0 6c0-1.1.9-2 2-2h3l2-2h6l2 2h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm10 10a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0-2a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" + } + }) + ] + ) + ] + ) + : _vm._e(), + _vm._v(" "), + _vm.form.opengraph_image + ? _c("div", { + staticClass: "w-16 h-16 rounded-full bg-cover", + style: { + backgroundImage: "url(" + _vm.form.opengraph_image + ")" + } + }) + : _vm._e() + ]) + : _vm._e(), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.opengraph_image_width, + expression: "form.opengraph_image_width" + } + ], + attrs: { type: "hidden" }, + domProps: { value: _vm.form.opengraph_image_width }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "opengraph_image_width", $event.target.value) + } + } + }), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.opengraph_image_height, + expression: "form.opengraph_image_height" + } + ], + attrs: { type: "hidden" }, + domProps: { value: _vm.form.opengraph_image_height }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set( + _vm.form, + "opengraph_image_height", + $event.target.value + ) + } + } + }) + ], + 1 + ) + ]), + _vm._v(" "), + _c("div", { staticClass: "input-group" }, [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "twitter_title" } }, + [_vm._v("\n Twitter Card Title\n ")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.twitter_title, + expression: "form.twitter_title" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "Title in Twitter Card", + id: "twitter_title" + }, + domProps: { value: _vm.form.twitter_title }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "twitter_title", $event.target.value) + } + } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "input-group" }, [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "twitter_description" } }, + [_vm._v("\n Twitter Card Description\n ")] + ), + _vm._v(" "), + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.twitter_description, + expression: "form.twitter_description" + } + ], + staticClass: "input", + attrs: { + placeholder: "Description in Twitter Card", + id: "twitter_description" + }, + domProps: { value: _vm.form.twitter_description }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "twitter_description", $event.target.value) + } + } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "input-group py-4" }, [ + _c( + "div", + { staticClass: "flex items-center justify-between" }, + [ + _c( + "div", + [ + _c("label", { staticClass: "input-label" }, [ + _vm._v( + "\n Twitter Card Image\n " + ) + ]), + _vm._v(" "), + _c("image-picker", { + staticClass: "mt-4 mb-1", + on: { + changed: _vm.updateTwitterImage, + uploading: function($event) { + _vm.twitterImageUploading = true + } + } + }) + ], + 1 + ), + _vm._v(" "), + _vm.twitterImageUploading ? _c("preloader") : _vm._e(), + _vm._v(" "), + !_vm.twitterImageUploading + ? _c("div", [ + !_vm.form.twitter_image + ? _c( + "div", + { + staticClass: + "w-16 h-16 rounded-full bg-light flex items-center justify-center text-4xl text-contrast" + }, + [ + _c( + "svg", + { + staticClass: "fill-current w-8", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M0 6c0-1.1.9-2 2-2h3l2-2h6l2 2h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm10 10a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0-2a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" + } + }) + ] + ) + ] + ) + : _vm._e(), + _vm._v(" "), + _vm.form.twitter_image + ? _c("div", { + staticClass: "w-16 h-16 rounded-full bg-cover", + style: { + backgroundImage: "url(" + _vm.form.twitter_image + ")" + } + }) + : _vm._e() + ]) + : _vm._e() + ], + 1 + ) + ]), + _vm._v(" "), + _c("div", { staticClass: "mt-10" }, [ + _c( + "button", + { staticClass: "btn-sm btn-primary", on: { click: _vm.close } }, + [_vm._v("Done")] + ) + ]) + ]) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=template&id=9e471858&": +/*!********************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=template&id=9e471858& ***! + \********************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _vm.modalShown + ? _c("modal", { on: { close: _vm.close } }, [ + _c("h2", { staticClass: "font-semibold mb-5" }, [_vm._v("Embed HTML")]), + _vm._v(" "), + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.content, + expression: "content" + } + ], + ref: "content", + staticClass: "input", + attrs: { + cols: "30", + rows: "10", + placeholder: "Paste your HTML here" + }, + domProps: { value: _vm.content }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.content = $event.target.value + } + } + }), + _vm._v(" "), + _c( + "button", + { + staticClass: "btn-sm btn-primary mt-10", + on: { click: _vm.applyHTML } + }, + [_vm._v("Apply")] + ), + _vm._v(" "), + _c( + "button", + { staticClass: "btn-sm btn-light mt-10", on: { click: _vm.close } }, + [_vm._v("Cancel")] + ) + ]) + : _vm._e() +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=template&id=6435daa8&": +/*!*********************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=template&id=6435daa8& ***! + \*********************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _vm.modalShown + ? _c( + "modal", + { on: { close: _vm.close } }, + [ + _c("h2", { staticClass: "font-semibold mb-5" }, [ + _vm._v("Add Image") + ]), + _vm._v(" "), + _vm.uploading ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.imageUrl && !_vm.uploading + ? _c("div", [ + _c("img", { + staticClass: "max-w-full", + attrs: { src: _vm.imageUrl } + }), + _vm._v(" "), + _c("div", { staticClass: "input-group" }, [ + _c("label", { staticClass: "input-label" }, [ + _vm._v("Caption") + ]), + _vm._v(" "), + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.caption, + expression: "caption" + } + ], + ref: "caption", + staticClass: "input", + attrs: { + rows: "2", + placeholder: "Add caption to the image" + }, + domProps: { value: _vm.caption }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.caption = $event.target.value + } + } + }) + ]), + _vm._v(" "), + _c("div", { staticClass: "input-group" }, [ + _c("label", { staticClass: "input-label" }, [ + _vm._v("Layout") + ]), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.layout, + expression: "layout" + } + ], + staticClass: "input", + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.layout = $event.target.multiple + ? $$selectedVal + : $$selectedVal[0] + } + } + }, + [ + _c("option", { attrs: { value: "default" } }, [ + _vm._v("Default") + ]), + _vm._v(" "), + _c("option", { attrs: { value: "wide" } }, [ + _vm._v("Wide Image") + ]) + ] + ) + ]) + ]) + : _vm._e(), + _vm._v(" "), + !_vm.imageUrl + ? _c("image-picker", { + key: _vm.imagePickerKey, + staticClass: "mt-5", + on: { + changed: _vm.updateImage, + progressing: _vm.updateProgress, + uploading: function($event) { + _vm.uploading = true + } + } + }) + : _vm._e(), + _vm._v(" "), + _c( + "button", + { + staticClass: "btn-sm btn-primary mt-10", + on: { click: _vm.applyImage } + }, + [_vm._v("Apply")] + ), + _vm._v(" "), + _c( + "button", + { staticClass: "btn-sm btn-light mt-10", on: { click: _vm.close } }, + [_vm._v("Cancel")] + ) + ], + 1 + ) + : _vm._e() +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/FilterDropdown.vue?vue&type=template&id=33389b58&": +/*!***************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/partials/FilterDropdown.vue?vue&type=template&id=33389b58& ***! + \***************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "dropdown", + { + staticClass: "relative ml-4", + on: { + showing: function($event) { + _vm.$emit("showing") + } + } + }, + [ + _c( + "button", + { + staticClass: "focus:outline-none text-light hover:text-primary h-8", + attrs: { slot: "trigger" }, + slot: "trigger" + }, + [ + _vm.isFiltered + ? _c("span", { + staticClass: + "block rounded-full pulse bg-red absolute w-3 h-3 pin-t pin-r opacity-75" + }) + : _vm._e(), + _vm._v(" "), + _c( + "svg", + { + staticClass: "w-4 h-4 fill-current", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c( + "div", + { + staticClass: "dropdown-content w-64 pin-r p-3", + attrs: { slot: "content" }, + slot: "content" + }, + [_vm._t("default")], + 2 + ) + ] + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/Preloader.vue?vue&type=template&id=37734fd2&": +/*!**********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/partials/Preloader.vue?vue&type=template&id=37734fd2& ***! + \**********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + { staticClass: "flex flex-col items-center justify-center text-light" }, + [ + _c( + "svg", + { + staticClass: "spin fill-current w-10", + attrs: { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20" } + }, + [ + _c("path", { + attrs: { + d: + "M10 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0-6a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" + } + }) + ] + ) + ] + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/404.vue?vue&type=template&id=148d4cbc&": +/*!***************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/404.vue?vue&type=template&id=148d4cbc& ***! + \***************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", [_c("page-header"), _vm._v(" "), _vm._m(0)], 1) +} +var staticRenderFns = [ + function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { staticClass: "container" }, [ + _c("div", { staticClass: "row justify-content-center" }, [ + _c("div", { staticClass: "col-lg-10" }, [ + _c("div", { staticClass: "card" }, [ + _c("h2", { staticClass: "mb-5 text-center" }, [ + _vm._v("404 — Not found") + ]), + _vm._v(" "), + _c("p", { staticClass: "text-center" }, [ + _vm._v("The page you're looking for couldn't be found!") + ]) + ]) + ]) + ]) + ]) + } +] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=template&id=1451210a&scoped=true&": +/*!**********************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/pages/edit.vue?vue&type=template&id=1451210a&scoped=true& ***! + \**********************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c("page-header", [ + _c("div", { attrs: { slot: "left-side" }, slot: "left-side" }, [ + !_vm.status && _vm.id == "new" + ? _c("span", { staticClass: "font-semibold" }, [_vm._v("New")]) + : _vm._e(), + _vm._v(" "), + !_vm.status && _vm.id != "new" + ? _c("span", { staticClass: "font-semibold" }, [_vm._v("Saved")]) + : _vm._e(), + _vm._v(" "), + _c("span", [_vm._v(_vm._s(_vm.status))]) + ]), + _vm._v(" "), + _vm.ready && _vm.entry + ? _c( + "div", + { + staticClass: "flex items-center", + attrs: { slot: "right-side" }, + slot: "right-side" + }, + [ + _c( + "button", + { + directives: [ + { + name: "loading", + rawName: "v-loading", + value: _vm.status, + expression: "status" + } + ], + staticClass: "py-1 px-2 btn-primary text-sm mr-6", + on: { click: _vm.save } + }, + [_vm._v("Save")] + ), + _vm._v(" "), + _c("dropdown", { staticClass: "relative" }, [ + _c( + "button", + { + staticClass: + "focus:outline-none text-light hover:text-primary h-8", + attrs: { slot: "trigger" }, + slot: "trigger" + }, + [ + _c( + "svg", + { + staticClass: "w-4 h-4 fill-current mt-1", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c( + "div", + { + staticClass: + "dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2", + attrs: { slot: "content" }, + slot: "content" + }, + [ + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.settingsModal($event) + } + } + }, + [ + _vm._v( + "\n General Settings\n " + ) + ] + ), + _vm._v(" "), + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.seoModal($event) + } + } + }, + [ + _vm._v( + "\n SEO & Social\n " + ) + ] + ), + _vm._v(" "), + _vm.id != "new" + ? _c( + "a", + { + staticClass: + "no-underline text-red w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.deletePage($event) + } + } + }, + [_vm._v("Delete")] + ) + : _vm._e() + ] + ) + ]) + ], + 1 + ) + : _vm._e() + ]), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && !_vm.entry + ? _c("h2", { staticClass: "text-center font-normal" }, [ + _vm._v("\n 404 — Page not found\n ") + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entry + ? _c( + "div", + { staticClass: "lg:w-3/4 mx-auto" }, + [ + _c("textarea-autosize", { + staticClass: + "text-3xl font-semibold w-full focus:outline-none mb-10", + attrs: { placeholder: "Type something here..." }, + model: { + value: _vm.form.title, + callback: function($$v) { + _vm.$set(_vm.form, "title", $$v) + }, + expression: "form.title" + } + }), + _vm._v(" "), + _c("editor", { + attrs: { "post-id": _vm.id }, + model: { + value: _vm.form.body, + callback: function($$v) { + _vm.$set(_vm.form, "body", $$v) + }, + expression: "form.body" + } + }) + ], + 1 + ) + : _vm._e() + ], + 1 + ), + _vm._v(" "), + _vm.settingsModalShown + ? _c( + "modal", + { + on: { + close: function($event) { + _vm.settingsModalShown = false + } + } + }, + [ + _c( + "div", + { staticClass: "input-group pt-0" }, + [ + _c("label", { staticClass: "input-label" }, [_vm._v("Slug")]), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.slug, + expression: "form.slug" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "Give me a slug", + id: "slug" + }, + domProps: { value: _vm.form.slug }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "slug", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { attrs: { errors: _vm.errors.slug } }) + ], + 1 + ), + _vm._v(" "), + _c("div", { staticClass: "mt-10" }, [ + _c( + "button", + { + staticClass: "btn-sm btn-primary", + on: { + click: function($event) { + _vm.settingsModalShown = false + } + } + }, + [_vm._v("Done")] + ) + ]) + ] + ) + : _vm._e(), + _vm._v(" "), + _vm.seoModalShown + ? _c("seo-modal", { + attrs: { input: _vm.form.meta }, + on: { close: _vm.closeSeoModal } + }) + : _vm._e() + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/index.vue?vue&type=template&id=06ce39b1&": +/*!***********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/pages/index.vue?vue&type=template&id=06ce39b1& ***! + \***********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c( + "page-header", + [ + _c( + "template", + { slot: "right-side" }, + [ + _c( + "router-link", + { + staticClass: "py-1 px-2 btn-primary text-sm", + attrs: { to: { name: "page-new" } } + }, + [_vm._v("\n New Page\n ")] + ) + ], + 1 + ) + ], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + _c( + "div", + { staticClass: "mb-10 flex items-center" }, + [ + _c( + "h1", + { staticClass: "inline font-semibold text-3xl mr-auto" }, + [_vm._v("Pages")] + ), + _vm._v(" "), + _c( + "filters", + { + attrs: { "is-filtered": _vm.isFiltered }, + on: { showing: _vm.focusSearchInput } + }, + [ + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.searchQuery, + expression: "searchQuery" + } + ], + ref: "searchInput", + staticClass: "input mt-0 w-full", + attrs: { type: "text", placeholder: "Search..." }, + domProps: { value: _vm.searchQuery }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.searchQuery = $event.target.value + } + } + }) + ] + ) + ], + 1 + ), + _vm._v(" "), + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && !_vm.isFiltered + ? _c( + "div", + [ + _vm._v( + "\n No pages were found, start by\n " + ), + _c( + "router-link", + { + staticClass: + "no-underline text-primary hover:text-primary-dark", + attrs: { to: { name: "page-new" } } + }, + [_vm._v("writing your first page")] + ), + _vm._v("\n .\n ") + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && _vm.isFiltered + ? _c("div", [ + _vm._v( + "\n No pages matched the given search.\n " + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length > 0 + ? _c( + "div", + [ + _vm._l(_vm.entries, function(entry) { + return _c( + "div", + { + key: entry.id, + staticClass: + "border-t border-very-light flex items-center" + }, + [ + _c( + "div", + { + staticClass: "py-4", + attrs: { title: entry.title } + }, + [ + _c( + "h2", + { staticClass: "text-xl font-semibold mb-3" }, + [ + _c( + "router-link", + { + staticClass: "no-underline text-text-color", + attrs: { + to: { + name: "page-edit", + params: { id: entry.id } + } + } + }, + [ + _vm._v( + "\n " + + _vm._s(_vm.truncate(entry.title, 68)) + + "\n " + ) + ] + ) + ], + 1 + ), + _vm._v(" "), + _c("p", { staticClass: "mb-3" }, [ + _vm._v( + _vm._s( + _vm.truncate( + entry.body.replace(/(<([^>]+)>)/gi, ""), + 100 + ) + ) + ) + ]), + _vm._v(" "), + _c("small", { staticClass: "text-light" }, [ + _vm._v( + "\n Updated " + + _vm._s(_vm.timeAgo(entry.updated_at)) + + "\n — Created " + + _vm._s(_vm.timeAgo(entry.created_at)) + + "\n " + ) + ]) + ] + ) + ] + ) + }), + _vm._v(" "), + _vm.hasMoreEntries + ? _c("div", [ + _c( + "div", + { + staticClass: "py-8 uppercase", + attrs: { colspan: "100" } + }, + [ + !_vm.loadingMoreEntries + ? _c( + "a", + { + staticClass: "no-underline text-primary", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.loadOlderEntries($event) + } + } + }, + [_vm._v("Load more pages")] + ) + : _vm._e(), + _vm._v(" "), + _vm.loadingMoreEntries + ? _c("span", [_vm._v("Loading...")]) + : _vm._e() + ] + ) + ]) + : _vm._e() + ], + 2 + ) + : _vm._e() + ], + 1 + ) + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9&": +/*!***************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9& ***! + \***************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _vm.modalShown + ? _c( + "modal", + { on: { close: _vm.close } }, + [ + _c("h2", { staticClass: "font-semibold mb-5" }, [ + _vm._v("Featured Image") + ]), + _vm._v(" "), + _vm.uploading ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.imageUrl && !_vm.uploading + ? _c("div", [ + _c("img", { + staticClass: "max-w-full", + attrs: { src: _vm.imageUrl } + }), + _vm._v(" "), + _c("div", { staticClass: "input-group" }, [ + _c("label", { staticClass: "input-label" }, [ + _vm._v("Caption") + ]), + _vm._v(" "), + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.caption, + expression: "caption" + } + ], + ref: "caption", + staticClass: "input", + attrs: { + rows: "2", + placeholder: "Add caption to the image" + }, + domProps: { value: _vm.caption }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.caption = $event.target.value + } + } + }) + ]) + ]) + : _vm._e(), + _vm._v(" "), + _c("image-picker", { + key: _vm.imagePickerKey, + staticClass: "mt-5", + on: { + changed: _vm.updateImage, + progressing: _vm.updateProgress, + uploading: function($event) { + _vm.uploading = true + } + } + }), + _vm._v(" "), + _c( + "button", + { + staticClass: "btn-sm btn-primary mt-10", + on: { click: _vm.saveImage } + }, + [_vm._v("Save Image")] + ), + _vm._v(" "), + _c( + "button", + { staticClass: "btn-sm btn-light mt-10", on: { click: _vm.close } }, + [_vm._v("Cancel")] + ) + ], + 1 + ) + : _vm._e() +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=template&id=16bc044c&scoped=true&": +/*!**********************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/edit.vue?vue&type=template&id=16bc044c&scoped=true& ***! + \**********************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c("page-header", [ + _c("div", { attrs: { slot: "left-side" }, slot: "left-side" }, [ + _vm.ready && _vm.entry + ? _c("div", [ + !_vm.status && _vm.form.published + ? _c("span", { staticClass: "font-semibold" }, [ + _vm._v("Published") + ]) + : _vm._e(), + _vm._v(" "), + !_vm.status && !_vm.form.published + ? _c("span", { staticClass: "font-semibold" }, [ + _vm._v("Draft") + ]) + : _vm._e(), + _vm._v(" "), + _vm.status ? _c("span", [_vm._v(_vm._s(_vm.status))]) : _vm._e() + ]) + : _vm._e() + ]), + _vm._v(" "), + _vm.ready && _vm.entry + ? _c( + "div", + { + staticClass: "flex items-center", + attrs: { slot: "right-side" }, + slot: "right-side" + }, + [ + !_vm.form.published + ? _c( + "button", + { + staticClass: "py-1 px-2 btn-primary text-sm mr-6", + on: { click: _vm.publishingModal } + }, + [_vm._v("Publish")] + ) + : _vm._e(), + _vm._v(" "), + _vm.form.published + ? _c( + "button", + { + staticClass: "py-1 px-2 btn-primary text-sm mr-6", + on: { click: _vm.publishingModal } + }, + [_vm._v("Update")] + ) + : _vm._e(), + _vm._v(" "), + _vm.id != "new" + ? _c( + "a", + { + staticClass: + "block focus:outline-none text-light hover:text-primary mr-6", + attrs: { + href: _vm.postPreviewLink, + target: "_blank", + title: "Preview Post" + } + }, + [ + _c( + "svg", + { + staticClass: "w-4 h-4 fill-current", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M.2 10a11 11 0 0 1 19.6 0A11 11 0 0 1 .2 10zm9.8 4a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-2a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" + } + }) + ] + ) + ] + ) + : _vm._e(), + _vm._v(" "), + _c("dropdown", { staticClass: "relative" }, [ + _c( + "button", + { + staticClass: + "focus:outline-none text-light hover:text-primary h-8", + attrs: { slot: "trigger", title: "Settings" }, + slot: "trigger" + }, + [ + _c( + "svg", + { + staticClass: "w-4 h-4 fill-current mt-1", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c( + "div", + { + staticClass: + "dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2", + attrs: { slot: "content" }, + slot: "content" + }, + [ + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.settingsModal($event) + } + } + }, + [ + _vm._v( + "\n General Settings\n " + ) + ] + ), + _vm._v(" "), + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.featuredImageModal($event) + } + } + }, + [ + _vm._v( + "\n Featured Image\n " + ) + ] + ), + _vm._v(" "), + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.seoModal($event) + } + } + }, + [ + _vm._v( + "\n SEO & Social\n " + ) + ] + ), + _vm._v(" "), + _vm.id != "new" + ? _c( + "a", + { + staticClass: + "no-underline text-red w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.deletePost($event) + } + } + }, + [_vm._v("Delete")] + ) + : _vm._e() + ] + ) + ]) + ], + 1 + ) + : _vm._e() + ]), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && !_vm.entry + ? _c("h2", { staticClass: "text-center font-normal" }, [ + _vm._v("\n 404 — Post not found\n ") + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entry + ? _c( + "div", + { staticClass: "lg:w-3/4 mx-auto" }, + [ + _c("textarea-autosize", { + staticClass: + "text-3xl font-semibold w-full focus:outline-none mb-10", + attrs: { placeholder: "Type something here..." }, + model: { + value: _vm.form.title, + callback: function($$v) { + _vm.$set(_vm.form, "title", $$v) + }, + expression: "form.title" + } + }), + _vm._v(" "), + _vm.form.markdown == null + ? _c("div", [ + _c( + "button", + { + staticClass: + "w-full mb-5 hover:bg-lighter text-text-color block bg-very-light px-3 py-5 rounded", + on: { + click: function($event) { + _vm.form.markdown = false + } + } + }, + [ + _vm._v( + "\n I want a rich text editor\n " + ) + ] + ), + _vm._v(" "), + _c( + "button", + { + staticClass: + "w-full mb-5 hover:bg-lighter text-text-color block bg-very-light px-3 py-5 rounded", + on: { + click: function($event) { + _vm.form.markdown = true + } + } + }, + [ + _vm._v( + "\n I will write markdown\n " + ) + ] + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.form.markdown == false + ? _c("editor", { + attrs: { "post-id": _vm.id }, + model: { + value: _vm.form.body, + callback: function($$v) { + _vm.$set(_vm.form, "body", $$v) + }, + expression: "form.body" + } + }) + : _vm._e(), + _vm._v(" "), + _vm.form.markdown == true + ? _c("markdown-editor", { + model: { + value: _vm.form.body, + callback: function($$v) { + _vm.$set(_vm.form, "body", $$v) + }, + expression: "form.body" + } + }) + : _vm._e() + ], + 1 + ) + : _vm._e() + ], + 1 + ), + _vm._v(" "), + _vm.settingsModalShown + ? _c("modal", { on: { close: _vm.closeSettingsModal } }, [ + _c( + "div", + { staticClass: "input-group pt-0" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "slug" } }, + [_vm._v("Slug")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.slug, + expression: "form.slug" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "Give me a slug", + id: "slug" + }, + domProps: { value: _vm.form.slug }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "slug", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { attrs: { errors: _vm.errors.slug } }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "author_id" } }, + [_vm._v("Author")] + ), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.author_id, + expression: "form.author_id" + } + ], + staticClass: "input", + attrs: { name: "author_id", id: "author_id" }, + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.form, + "author_id", + $event.target.multiple + ? $$selectedVal + : $$selectedVal[0] + ) + } + } + }, + _vm._l(_vm.authors, function(author) { + return _c("option", { domProps: { value: author.id } }, [ + _vm._v(_vm._s(author.name)) + ]) + }), + 0 + ), + _vm._v(" "), + _c("form-errors", { attrs: { errors: _vm.errors.author_id } }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { + staticClass: "input-label mb-4", + attrs: { for: "tag_ids" } + }, + [_vm._v("Tags")] + ), + _vm._v(" "), + _c("multiselect", { + attrs: { + options: _vm.tags, + "option-id": "id", + "option-text": "name" + }, + model: { + value: _vm.form.tags, + callback: function($$v) { + _vm.$set(_vm.form, "tags", $$v) + }, + expression: "form.tags" + } + }), + _vm._v(" "), + _c("form-errors", { attrs: { errors: _vm.errors.tags } }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "excerpt" } }, + [_vm._v("Excerpt")] + ), + _vm._v(" "), + _c("textarea", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.excerpt, + expression: "form.excerpt" + } + ], + staticClass: "input", + attrs: { + placeholder: "What's this post about?", + id: "excerpt" + }, + domProps: { value: _vm.form.excerpt }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "excerpt", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { attrs: { errors: _vm.errors.excerpt } }) + ], + 1 + ), + _vm._v(" "), + _c("div", { staticClass: "mt-10" }, [ + _c( + "button", + { + staticClass: "btn-sm btn-primary", + on: { click: _vm.closeSettingsModal } + }, + [_vm._v("Done")] + ) + ]) + ]) + : _vm._e(), + _vm._v(" "), + _vm.publishingModalShown + ? _c( + "modal", + { + on: { + close: function($event) { + _vm.publishingModalShown = false + } + } + }, + [ + _vm.form.title == "Draft" || + !_vm.form.slug || + _vm.form.slug.startsWith("draft-") + ? _c("div", { staticClass: "mb-10 text-red" }, [ + _vm._v( + "\n Make sure your post has a friendly title and slug.\n " + ) + ]) + : _vm._e(), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group pt-0" }, + [ + _c("label", { staticClass: "input-label" }, [ + _vm._v("Publish Date (M/D/Y H:M) UTC") + ]), + _vm._v(" "), + _c("date-time-picker", { + model: { + value: _vm.form.publish_date, + callback: function($$v) { + _vm.$set(_vm.form, "publish_date", $$v) + }, + expression: "form.publish_date" + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.errors.publish_date } + }) + ], + 1 + ), + _vm._v(" "), + _c("div", { staticClass: "mt-10" }, [ + !_vm.form.published + ? _c( + "button", + { + directives: [ + { + name: "loading", + rawName: "v-loading", + value: _vm.status, + expression: "status" + } + ], + staticClass: "btn-sm btn-primary", + on: { click: _vm.publishPost } + }, + [_vm._v("Publish this post")] + ) + : _vm._e(), + _vm._v(" "), + _vm.form.published + ? _c( + "button", + { + directives: [ + { + name: "loading", + rawName: "v-loading", + value: _vm.status, + expression: "status" + } + ], + staticClass: "btn-sm btn-primary", + on: { click: _vm.publishPost } + }, + [_vm._v("Update Post")] + ) + : _vm._e(), + _vm._v(" "), + _vm.form.published + ? _c( + "button", + { + directives: [ + { + name: "loading", + rawName: "v-loading", + value: _vm.status, + expression: "status" + } + ], + staticClass: "btn-sm ml-1 btn-light", + on: { click: _vm.unpublishPost } + }, + [_vm._v("Convert to draft")] + ) + : _vm._e(), + _vm._v(" "), + _c( + "button", + { + staticClass: "btn-sm ml-1 btn-light", + on: { + click: function($event) { + _vm.publishingModalShown = false + } + } + }, + [_vm._v("Cancel")] + ) + ]) + ] + ) + : _vm._e(), + _vm._v(" "), + _vm.seoModalShown + ? _c("seo-modal", { + attrs: { input: _vm.form.meta }, + on: { close: _vm.closeSeoModal } + }) + : _vm._e(), + _vm._v(" "), + _c("featured-image-uploader", { + attrs: { + "post-id": this.form.id, + "current-image-url": _vm.form.featured_image, + "current-caption": _vm.form.featured_image_caption + }, + on: { changed: _vm.featuredImageChanged } + }) + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/index.vue?vue&type=template&id=027c3f00&": +/*!***********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/posts/index.vue?vue&type=template&id=027c3f00& ***! + \***********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c( + "page-header", + [ + _c( + "template", + { slot: "right-side" }, + [ + _c( + "router-link", + { + staticClass: "py-1 px-2 btn-primary text-sm", + attrs: { to: { name: "post-new" } } + }, + [_vm._v("\n New Post\n ")] + ) + ], + 1 + ) + ], + 2 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + _c( + "div", + { staticClass: "mb-10 flex items-center" }, + [ + _c( + "h1", + { staticClass: "inline font-semibold text-3xl mr-auto" }, + [_vm._v("Posts")] + ), + _vm._v(" "), + _c( + "filters", + { + staticClass: "text-sm", + attrs: { "is-filtered": _vm.isFiltered }, + on: { showing: _vm.focusSearchInput } + }, + [ + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.searchQuery, + expression: "searchQuery" + } + ], + ref: "searchInput", + staticClass: + "input mt-0 w-full pb-2 border-b border-very-light", + attrs: { type: "text", placeholder: "Search..." }, + domProps: { value: _vm.searchQuery }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.searchQuery = $event.target.value + } + } + }), + _vm._v(" "), + _c( + "div", + { staticClass: "flex items-center justify-between mt-5" }, + [ + _c("span", [_vm._v("Status")]), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.filters.status, + expression: "filters.status" + } + ], + staticClass: + "border border-lighter rounded w-3/5 focus:outline-none appearance-none py-1 px-3", + attrs: { name: "status" }, + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.filters, + "status", + $event.target.multiple + ? $$selectedVal + : $$selectedVal[0] + ) + } + } + }, + [ + _c("option", { attrs: { value: "" } }, [ + _vm._v("All") + ]), + _vm._v(" "), + _c("option", { attrs: { value: "live" } }, [ + _vm._v("Live") + ]), + _vm._v(" "), + _c("option", { attrs: { value: "published" } }, [ + _vm._v("Published") + ]), + _vm._v(" "), + _c("option", { attrs: { value: "scheduled" } }, [ + _vm._v("Scheduled") + ]), + _vm._v(" "), + _c("option", { attrs: { value: "draft" } }, [ + _vm._v("Draft") + ]) + ] + ) + ] + ), + _vm._v(" "), + _c( + "div", + { staticClass: "flex items-center justify-between mt-3" }, + [ + _c("span", [_vm._v("Author")]), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.filters.author_id, + expression: "filters.author_id" + } + ], + staticClass: + "border border-lighter rounded w-3/5 focus:outline-none appearance-none py-1 px-3", + attrs: { name: "author" }, + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.filters, + "author_id", + $event.target.multiple + ? $$selectedVal + : $$selectedVal[0] + ) + } + } + }, + [ + _c("option", { attrs: { value: "" } }, [ + _vm._v("All") + ]), + _vm._v(" "), + _vm._l(_vm.authors, function(author) { + return _c( + "option", + { domProps: { value: author.id } }, + [_vm._v(_vm._s(author.name))] + ) + }) + ], + 2 + ) + ] + ), + _vm._v(" "), + _c( + "div", + { staticClass: "flex items-center justify-between mt-3" }, + [ + _c("span", [_vm._v("Tag")]), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.filters.tag_id, + expression: "filters.tag_id" + } + ], + staticClass: + "border border-lighter rounded w-3/5 focus:outline-none appearance-none py-1 px-3", + attrs: { name: "tag" }, + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.filters, + "tag_id", + $event.target.multiple + ? $$selectedVal + : $$selectedVal[0] + ) + } + } + }, + [ + _c("option", { attrs: { value: "" } }, [ + _vm._v("All") + ]), + _vm._v(" "), + _vm._l(_vm.tags, function(tag) { + return _c( + "option", + { domProps: { value: tag.id } }, + [_vm._v(_vm._s(tag.name))] + ) + }) + ], + 2 + ) + ] + ), + _vm._v(" "), + _vm.isFiltered + ? _c( + "button", + { + staticClass: "btn-sm btn-light w-full mt-5", + on: { + click: function($event) { + $event.preventDefault() + return _vm.clearFilters($event) + } + } + }, + [_vm._v("Reset\n ")] + ) + : _vm._e() + ] + ) + ], + 1 + ), + _vm._v(" "), + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && !_vm.isFiltered + ? _c( + "div", + [ + _vm._v( + "\n No posts were found, start by\n " + ), + _c( + "router-link", + { + staticClass: + "no-underline text-primary hover:text-primary-dark", + attrs: { to: { name: "post-new" } } + }, + [_vm._v("writing your first post")] + ), + _vm._v("\n .\n ") + ], + 1 + ) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && _vm.isFiltered + ? _c("div", [ + _vm._v( + "\n No posts matched the given search.\n " + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length > 0 + ? _c( + "div", + [ + _vm._l(_vm.entries, function(entry) { + return _c( + "div", + { + key: entry.id, + staticClass: + "border-t border-very-light flex items-center" + }, + [ + _c( + "div", + { + staticClass: "py-4", + attrs: { title: entry.title } + }, + [ + _c( + "h2", + { staticClass: "text-xl font-semibold mb-3" }, + [ + _c( + "router-link", + { + staticClass: "no-underline text-text-color", + attrs: { + to: { + name: "post-edit", + params: { id: entry.id } + } + } + }, + [ + _vm._v( + "\n " + + _vm._s(_vm.truncate(entry.title, 68)) + + "\n " + ) + ] + ) + ], + 1 + ), + _vm._v(" "), + _c("p", { staticClass: "mb-3" }, [ + _vm._v( + _vm._s( + _vm.truncate( + entry.body.replace(/(<([^>]+)>)/gi, ""), + 100 + ) + ) + ) + ]), + _vm._v(" "), + _c("small", { staticClass: "text-light" }, [ + entry.published && + !_vm.dateInTheFuture(entry.publish_date) + ? _c("span", [ + _vm._v( + "Published " + + _vm._s(_vm.timeAgo(entry.publish_date)) + ) + ]) + : _vm._e(), + _vm._v(" "), + entry.published && + _vm.dateInTheFuture(entry.publish_date) + ? _c("span", { staticClass: "text-green" }, [ + _vm._v( + "Scheduled " + + _vm._s(_vm.timeAgo(entry.publish_date)) + ) + ]) + : _vm._e(), + _vm._v(" "), + !entry.published + ? _c("span", { staticClass: "text-red" }, [ + _vm._v("Draft") + ]) + : _vm._e(), + _vm._v( + "\n — Updated " + + _vm._s(_vm.timeAgo(entry.updated_at)) + + "\n " + ), + entry.tags.length + ? _c("span", [ + _vm._v( + "— Tags: " + + _vm._s(_vm.formatTags(entry.tags)) + ) + ]) + : _vm._e() + ]) + ] + ), + _vm._v(" "), + _c( + "router-link", + { + staticClass: "no-underline ml-auto hidden lg:block", + attrs: { + to: { + name: "post-edit", + params: { id: entry.id } + } + } + }, + [ + entry.featured_image + ? _c("div", { + staticClass: + "w-16 h-16 rounded-full bg-cover", + style: { + backgroundImage: + "url(" + entry.featured_image + ")" + } + }) + : _c( + "div", + { + staticClass: + "w-16 h-16 rounded-full bg-light flex items-center justify-center text-4xl text-contrast" + }, + [ + _c( + "svg", + { + staticClass: "fill-current w-8", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M0 6c0-1.1.9-2 2-2h3l2-2h6l2 2h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm10 10a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0-2a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" + } + }) + ] + ) + ] + ) + ] + ) + ], + 1 + ) + }), + _vm._v(" "), + _vm.hasMoreEntries + ? _c("div", [ + _c( + "div", + { + staticClass: "py-8 uppercase", + attrs: { colspan: "100" } + }, + [ + !_vm.loadingMoreEntries + ? _c( + "a", + { + staticClass: "no-underline text-primary", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.loadOlderEntries($event) + } + } + }, + [_vm._v("Load more posts")] + ) + : _vm._e(), + _vm._v(" "), + _vm.loadingMoreEntries + ? _c("span", [_vm._v("Loading...")]) + : _vm._e() + ] + ) + ]) + : _vm._e() + ], + 2 + ) + : _vm._e() + ], + 1 + ) + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/edit.vue?vue&type=template&id=0e13d92a&": +/*!*********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/tags/edit.vue?vue&type=template&id=0e13d92a& ***! + \*********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c("page-header", [ + _vm.ready && _vm.entry + ? _c( + "div", + { + staticClass: "flex items-center", + attrs: { slot: "right-side" }, + slot: "right-side" + }, + [ + _c( + "button", + { + directives: [ + { + name: "loading", + rawName: "v-loading", + value: _vm.form.working, + expression: "form.working" + } + ], + staticClass: "py-1 px-2 btn-primary text-sm mr-6", + on: { click: _vm.save } + }, + [_vm._v("Save")] + ), + _vm._v(" "), + _c("dropdown", { staticClass: "relative" }, [ + _c( + "button", + { + staticClass: + "focus:outline-none text-light hover:text-primary h-8", + attrs: { slot: "trigger" }, + slot: "trigger" + }, + [ + _c( + "svg", + { + staticClass: "w-4 h-4 fill-current mt-1", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c( + "div", + { + staticClass: + "dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2", + attrs: { slot: "content" }, + slot: "content" + }, + [ + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.seoModal($event) + } + } + }, + [ + _vm._v( + "\n SEO & Social\n " + ) + ] + ), + _vm._v(" "), + _vm.id != "new" + ? _c( + "a", + { + staticClass: + "no-underline text-red w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.deleteTag($event) + } + } + }, + [_vm._v("Delete")] + ) + : _vm._e() + ] + ) + ]) + ], + 1 + ) + : _vm._e() + ]), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && !_vm.entry + ? _c("h2", { staticClass: "text-center font-normal" }, [ + _vm._v("\n 404 — Tag not found\n ") + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entry + ? _c("div", { staticClass: "lg:w-2/3 mx-auto" }, [ + _vm.id != "new" + ? _c("h1", { staticClass: "font-semibold text-3xl mb-10" }, [ + _vm._v("Edit Tag") + ]) + : _c("h1", { staticClass: "font-semibold text-3xl mb-10" }, [ + _vm._v("New Tag") + ]), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "name" } }, + [_vm._v("Tag Name")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.name, + expression: "form.name" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "Give me a name", + id: "name" + }, + domProps: { value: _vm.form.name }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "name", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors.name } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "name" } }, + [_vm._v("Tag Slug")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.slug, + expression: "form.slug" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "and-a-slug-please", + id: "slug" + }, + domProps: { value: _vm.form.slug }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "slug", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors.slug } + }) + ], + 1 + ) + ]) + : _vm._e() + ], + 1 + ), + _vm._v(" "), + _vm.seoModalShown + ? _c("seo-modal", { + attrs: { input: _vm.form.meta }, + on: { close: _vm.closeSeoModal } + }) + : _vm._e() + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/index.vue?vue&type=template&id=13c1f43c&": +/*!**********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/tags/index.vue?vue&type=template&id=13c1f43c& ***! + \**********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c("page-header", [ + _c( + "div", + { attrs: { slot: "right-side" }, slot: "right-side" }, + [ + _c( + "router-link", + { + staticClass: "py-1 px-2 btn-primary text-sm", + attrs: { to: { name: "tag-new" } } + }, + [_vm._v("\n New Tag\n ")] + ) + ], + 1 + ) + ]), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + _c( + "div", + { staticClass: "mb-10 flex items-center" }, + [ + _c( + "h1", + { staticClass: "inline font-semibold text-3xl mr-auto" }, + [_vm._v("Tags")] + ), + _vm._v(" "), + _c( + "filters", + { + attrs: { "is-filtered": _vm.isFiltered }, + on: { showing: _vm.focusSearchInput } + }, + [ + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.searchQuery, + expression: "searchQuery" + } + ], + ref: "searchInput", + staticClass: "input mt-0 w-full", + attrs: { type: "text", placeholder: "Search..." }, + domProps: { value: _vm.searchQuery }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.searchQuery = $event.target.value + } + } + }) + ] + ) + ], + 1 + ), + _vm._v(" "), + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && !_vm.isFiltered + ? _c("div", [ + _c( + "p", + [ + _vm._v("No tags were found, start by\n "), + _c( + "router-link", + { + staticClass: + "no-underline text-primary hover:text-primary-dark", + attrs: { to: { name: "tag-new" } } + }, + [_vm._v("adding some tags")] + ), + _vm._v("\n .\n ") + ], + 1 + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && _vm.isFiltered + ? _c("div", [ + _vm._v( + "\n No tags matched the given search.\n " + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length > 0 + ? _c( + "div", + [ + _vm._l(_vm.entries, function(entry) { + return _c( + "div", + { + key: entry.id, + staticClass: + "border-t border-very-light flex items-center" + }, + [ + _c( + "div", + { + staticClass: "py-4", + attrs: { title: entry.title } + }, + [ + _c( + "h2", + { staticClass: "text-xl font-semibold" }, + [ + _c( + "router-link", + { + staticClass: "no-underline text-text-color", + attrs: { + to: { + name: "tag-edit", + params: { id: entry.id } + } + } + }, + [ + _vm._v( + "\n " + + _vm._s(_vm.truncate(entry.name, 80)) + + "\n " + ) + ] + ) + ], + 1 + ) + ] + ), + _vm._v(" "), + _c("div", { staticClass: "ml-auto text-light mr-8" }, [ + _vm._v( + "\n " + + _vm._s(entry.posts_count) + + " Post(s)\n " + ) + ]), + _vm._v(" "), + _c("div", [ + _vm._v(_vm._s(_vm.timeAgo(entry.created_at))) + ]) + ] + ) + }), + _vm._v(" "), + _vm.hasMoreEntries + ? _c("tr", [ + _c( + "td", + { + staticClass: "text-center py-3", + attrs: { colspan: "100" } + }, + [ + _c("small", [ + !_vm.loadingMoreEntries + ? _c( + "a", + { + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.loadOlderEntries($event) + } + } + }, + [_vm._v("Load Older Tags")] + ) + : _vm._e() + ]), + _vm._v(" "), + _vm.loadingMoreEntries + ? _c("small", [_vm._v("Loading...")]) + : _vm._e() + ] + ) + ]) + : _vm._e() + ], + 2 + ) + : _vm._e() + ], + 1 + ) + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/edit.vue?vue&type=template&id=1474d134&": +/*!*********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/team/edit.vue?vue&type=template&id=1474d134& ***! + \*********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c("page-header", [ + _vm.ready && _vm.entry + ? _c( + "div", + { + staticClass: "flex items-center", + attrs: { slot: "right-side" }, + slot: "right-side" + }, + [ + _c( + "button", + { + directives: [ + { + name: "loading", + rawName: "v-loading", + value: _vm.form.working, + expression: "form.working" + } + ], + staticClass: "py-1 px-2 btn-primary text-sm mr-6", + on: { click: _vm.save } + }, + [_vm._v("Save")] + ), + _vm._v(" "), + _c("dropdown", { staticClass: "relative" }, [ + _c( + "button", + { + staticClass: + "focus:outline-none text-light hover:text-primary h-8", + attrs: { slot: "trigger" }, + slot: "trigger" + }, + [ + _c( + "svg", + { + staticClass: "w-4 h-4 fill-current mt-1", + attrs: { + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20" + } + }, + [ + _c("path", { + attrs: { + d: + "M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z" + } + }) + ] + ) + ] + ), + _vm._v(" "), + _c( + "div", + { + staticClass: + "dropdown-content pin-r min-w-dropdown mt-1 text-sm py-2", + attrs: { slot: "content" }, + slot: "content" + }, + [ + _c( + "a", + { + staticClass: + "no-underline text-text-color hover:text-primary w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.seoModal($event) + } + } + }, + [ + _vm._v( + "\n SEO & Social\n " + ) + ] + ), + _vm._v(" "), + _vm.id != "new" + ? _c( + "a", + { + staticClass: + "no-underline text-red w-full block py-2 px-4", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.deleteAuthor($event) + } + } + }, + [_vm._v("Delete")] + ) + : _vm._e() + ] + ) + ]) + ], + 1 + ) + : _vm._e() + ]), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && !_vm.entry + ? _c("h2", { staticClass: "text-center font-normal" }, [ + _vm._v("\n 404 — Author not found\n ") + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entry + ? _c("div", { staticClass: "lg:w-2/3 mx-auto" }, [ + _vm.id != "new" && _vm.Wink.author.id != _vm.entry.id + ? _c("h1", { staticClass: "font-semibold text-3xl mb-10" }, [ + _vm._v("Edit Author") + ]) + : _vm._e(), + _vm._v(" "), + _vm.id == "new" && _vm.Wink.author.id != _vm.entry.id + ? _c("h1", { staticClass: "font-semibold text-3xl mb-10" }, [ + _vm._v("New Author") + ]) + : _vm._e(), + _vm._v(" "), + _vm.Wink.author.id == _vm.entry.id + ? _c("h1", { staticClass: "font-semibold text-3xl mb-10" }, [ + _vm._v("Your Profile") + ]) + : _vm._e(), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "name" } }, + [_vm._v("Name")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.name, + expression: "form.name" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "Give me a name", + id: "name" + }, + domProps: { value: _vm.form.name }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "name", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors.name } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "slug" } }, + [_vm._v("Slug")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.slug, + expression: "form.slug" + } + ], + staticClass: "input", + attrs: { + type: "text", + placeholder: "and-a-slug-please", + id: "slug" + }, + domProps: { value: _vm.form.slug }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "slug", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors.slug } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "theme" } }, + [_vm._v("Theme")] + ), + _vm._v(" "), + _c( + "select", + { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.meta.theme, + expression: "form.meta.theme" + } + ], + staticClass: "input", + attrs: { id: "theme" }, + on: { + change: function($event) { + var $$selectedVal = Array.prototype.filter + .call($event.target.options, function(o) { + return o.selected + }) + .map(function(o) { + var val = "_value" in o ? o._value : o.value + return val + }) + _vm.$set( + _vm.form.meta, + "theme", + $event.target.multiple + ? $$selectedVal + : $$selectedVal[0] + ) + } + } + }, + [ + _c("option", { attrs: { value: "light" } }, [ + _vm._v("Light") + ]), + _vm._v(" "), + _c("option", { attrs: { value: "dark" } }, [ + _vm._v("Dark") + ]) + ] + ), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors["meta.theme"] } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { staticClass: "input-label", attrs: { for: "email" } }, + [_vm._v("Email")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.email, + expression: "form.email" + } + ], + staticClass: "input", + attrs: { + type: "email", + placeholder: "email@example.com", + id: "email" + }, + domProps: { value: _vm.form.email }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "email", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors.email } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group" }, + [ + _c( + "label", + { + staticClass: "input-label", + attrs: { for: "password" } + }, + [_vm._v("Password")] + ), + _vm._v(" "), + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.form.password, + expression: "form.password" + } + ], + staticClass: "input", + attrs: { + type: "password", + placeholder: "*****", + id: "password" + }, + domProps: { value: _vm.form.password }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.$set(_vm.form, "password", $event.target.value) + } + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors.password } + }) + ], + 1 + ), + _vm._v(" "), + _c( + "div", + { staticClass: "input-group mb-5" }, + [ + _c( + "label", + { + staticClass: "input-label mb-4", + attrs: { for: "slug" } + }, + [_vm._v("Bio")] + ), + _vm._v(" "), + _c("mini-editor", { + model: { + value: _vm.form.bio, + callback: function($$v) { + _vm.$set(_vm.form, "bio", $$v) + }, + expression: "form.bio" + } + }), + _vm._v(" "), + _c("form-errors", { + attrs: { errors: _vm.form.errors.bio } + }) + ], + 1 + ), + _vm._v(" "), + _vm.uploading ? _c("div", [_c("preloader")], 1) : _vm._e(), + _vm._v(" "), + !_vm.uploading + ? _c("div", { staticClass: "flex items-center" }, [ + _c("div", { + staticClass: "w-16 h-16 rounded-full bg-cover", + style: { + backgroundImage: "url(" + _vm.form.avatar + ")" + } + }), + _vm._v(" "), + _c("input", { + staticClass: "hidden", + attrs: { + type: "file", + id: "author_avatar", + accept: "image/*" + }, + on: { change: _vm.loadSelectedImage } + }), + _vm._v(" "), + _c( + "label", + { + staticClass: "ml-5 cursor-pointer underline", + attrs: { for: "author_avatar" } + }, + [_vm._v("Upload an avatar")] + ) + ]) + : _vm._e() + ]) + : _vm._e() + ], + 1 + ), + _vm._v(" "), + _vm.seoModalShown + ? _c("seo-modal", { + attrs: { input: _vm.form.meta }, + on: { close: _vm.closeSeoModal } + }) + : _vm._e(), + _vm._v(" "), + _vm.croppieModalShown + ? _c("cropper-modal", { + attrs: { + image: _vm.file, + viewport: { width: 200, height: 200 }, + boundary: { width: 200, height: 200 } + }, + on: { close: _vm.closeCroppieModal, cancel: _vm.cancelCroppieModal } + }) + : _vm._e() + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/index.vue?vue&type=template&id=04a50f26&": +/*!**********************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/screens/team/index.vue?vue&type=template&id=04a50f26& ***! + \**********************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c( + "div", + [ + _c("page-header", [ + _c( + "div", + { attrs: { slot: "right-side" }, slot: "right-side" }, + [ + _c( + "router-link", + { + staticClass: "py-1 px-2 btn-primary text-sm", + attrs: { to: { name: "team-new" } } + }, + [_vm._v("\n New Author\n ")] + ) + ], + 1 + ) + ]), + _vm._v(" "), + _c( + "div", + { staticClass: "container" }, + [ + _c( + "div", + { staticClass: "mb-10 flex items-center" }, + [ + _c( + "h1", + { staticClass: "inline font-semibold text-3xl mr-auto" }, + [_vm._v("Team")] + ), + _vm._v(" "), + _c( + "filters", + { + attrs: { "is-filtered": _vm.isFiltered }, + on: { showing: _vm.focusSearchInput } + }, + [ + _c("input", { + directives: [ + { + name: "model", + rawName: "v-model", + value: _vm.searchQuery, + expression: "searchQuery" + } + ], + ref: "searchInput", + staticClass: "input mt-0 w-full", + attrs: { type: "text", placeholder: "Search..." }, + domProps: { value: _vm.searchQuery }, + on: { + input: function($event) { + if ($event.target.composing) { + return + } + _vm.searchQuery = $event.target.value + } + } + }) + ] + ) + ], + 1 + ), + _vm._v(" "), + !_vm.ready ? _c("preloader") : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && !_vm.isFiltered + ? _c("div", [ + _c( + "p", + [ + _vm._v("No authors were found, start by\n "), + _c( + "router-link", + { + staticClass: + "no-underline text-primary hover:text-primary-dark", + attrs: { to: { name: "team-new" } } + }, + [_vm._v("adding an author")] + ), + _vm._v("\n .\n ") + ], + 1 + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length == 0 && _vm.isFiltered + ? _c("div", [ + _vm._v( + "\n No authors matched the given search.\n " + ) + ]) + : _vm._e(), + _vm._v(" "), + _vm.ready && _vm.entries.length > 0 + ? _c( + "div", + [ + _vm._l(_vm.entries, function(entry) { + return _c( + "div", + { + key: entry.id, + staticClass: + "border-t border-very-light flex items-center py-5" + }, + [ + _c("div", { attrs: { title: entry.name } }, [ + _c( + "h2", + { staticClass: "text-xl font-semibold mb-3" }, + [ + _c( + "router-link", + { + staticClass: "no-underline text-text-color", + attrs: { + to: { + name: "team-edit", + params: { id: entry.id } + } + } + }, + [ + _vm._v( + "\n " + + _vm._s(_vm.truncate(entry.name, 68)) + + "\n " + ) + ] + ) + ], + 1 + ), + _vm._v(" "), + _c("small", { staticClass: "text-light" }, [ + _c("span", [_vm._v(_vm._s(entry.email))]), + _vm._v( + "\n — Created " + + _vm._s(_vm.timeAgo(entry.created_at)) + + "\n " + ) + ]) + ]), + _vm._v(" "), + _c("div", { staticClass: "ml-auto text-light mr-8" }, [ + _vm._v( + "\n " + + _vm._s(entry.posts_count) + + " Post(s)\n " + ) + ]), + _vm._v(" "), + _c( + "router-link", + { + staticClass: "no-underline hidden lg:block", + attrs: { + to: { + name: "team-edit", + params: { id: entry.id } + } + } + }, + [ + _c("div", { + staticClass: "w-16 h-16 rounded-full bg-cover", + style: { + backgroundImage: "url(" + entry.avatar + ")" + } + }) + ] + ) + ], + 1 + ) + }), + _vm._v(" "), + _vm.hasMoreEntries + ? _c("div", [ + _c( + "div", + { + staticClass: "py-8 uppercase", + attrs: { colspan: "100" } + }, + [ + !_vm.loadingMoreEntries + ? _c( + "a", + { + staticClass: "no-underline text-primary", + attrs: { href: "#" }, + on: { + click: function($event) { + $event.preventDefault() + return _vm.loadOlderEntries($event) + } + } + }, + [_vm._v("Load more authors")] + ) + : _vm._e(), + _vm._v(" "), + _vm.loadingMoreEntries + ? _c("span", [_vm._v("Loading...")]) + : _vm._e() + ] + ) + ]) + : _vm._e() + ], + 2 + ) + : _vm._e() + ], + 1 + ) + ], + 1 + ) +} +var staticRenderFns = [] +render._withStripped = true + + + +/***/ }), + +/***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js": +/*!********************************************************************!*\ + !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; }); +/* globals __VUE_SSR_CONTEXT__ */ + +// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). +// This module is a runtime utility for cleaner component module output and will +// be included in the final webpack user bundle. + +function normalizeComponent ( + scriptExports, + render, + staticRenderFns, + functionalTemplate, + injectStyles, + scopeId, + moduleIdentifier, /* server only */ + shadowMode /* vue-cli only */ +) { + // Vue.extend constructor export interop + var options = typeof scriptExports === 'function' + ? scriptExports.options + : scriptExports + + // render functions + if (render) { + options.render = render + options.staticRenderFns = staticRenderFns + options._compiled = true + } + + // functional template + if (functionalTemplate) { + options.functional = true + } + + // scopedId + if (scopeId) { + options._scopeId = 'data-v-' + scopeId + } + + var hook + if (moduleIdentifier) { // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__ + } + // inject component styles + if (injectStyles) { + injectStyles.call(this, context) + } + // register component module identifier for async chunk inferrence + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier) + } + } + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook + } else if (injectStyles) { + hook = shadowMode + ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } + : injectStyles + } + + if (hook) { + if (options.functional) { + // for template-only hot-reload because in that case the render fn doesn't + // go through the normalizer + options._injectStyles = hook + // register for functioal component in vue file + var originalRender = options.render + options.render = function renderWithStyleInjection (h, context) { + hook.call(context) + return originalRender(h, context) + } + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate + options.beforeCreate = existing + ? [].concat(existing, hook) + : [hook] + } + } + + return { + exports: scriptExports, + options: options + } +} + + +/***/ }), + +/***/ "./node_modules/vue-router/dist/vue-router.esm.js": +/*!********************************************************!*\ + !*** ./node_modules/vue-router/dist/vue-router.esm.js ***! + \********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/*! + * vue-router v3.0.2 + * (c) 2018 Evan You + * @license MIT + */ +/* */ + +function assert (condition, message) { + if (!condition) { + throw new Error(("[vue-router] " + message)) + } +} + +function warn (condition, message) { + if ( true && !condition) { + typeof console !== 'undefined' && console.warn(("[vue-router] " + message)); + } +} + +function isError (err) { + return Object.prototype.toString.call(err).indexOf('Error') > -1 +} + +function extend (a, b) { + for (var key in b) { + a[key] = b[key]; + } + return a +} + +var View = { + name: 'RouterView', + functional: true, + props: { + name: { + type: String, + default: 'default' + } + }, + render: function render (_, ref) { + var props = ref.props; + var children = ref.children; + var parent = ref.parent; + var data = ref.data; + + // used by devtools to display a router-view badge + data.routerView = true; + + // directly use parent context's createElement() function + // so that components rendered by router-view can resolve named slots + var h = parent.$createElement; + var name = props.name; + var route = parent.$route; + var cache = parent._routerViewCache || (parent._routerViewCache = {}); + + // determine current view depth, also check to see if the tree + // has been toggled inactive but kept-alive. + var depth = 0; + var inactive = false; + while (parent && parent._routerRoot !== parent) { + if (parent.$vnode && parent.$vnode.data.routerView) { + depth++; + } + if (parent._inactive) { + inactive = true; + } + parent = parent.$parent; + } + data.routerViewDepth = depth; + + // render previous view if the tree is inactive and kept-alive + if (inactive) { + return h(cache[name], data, children) + } + + var matched = route.matched[depth]; + // render empty node if no matched route + if (!matched) { + cache[name] = null; + return h() + } + + var component = cache[name] = matched.components[name]; + + // attach instance registration hook + // this will be called in the instance's injected lifecycle hooks + data.registerRouteInstance = function (vm, val) { + // val could be undefined for unregistration + var current = matched.instances[name]; + if ( + (val && current !== vm) || + (!val && current === vm) + ) { + matched.instances[name] = val; + } + } + + // also register instance in prepatch hook + // in case the same component instance is reused across different routes + ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) { + matched.instances[name] = vnode.componentInstance; + }; + + // resolve props + var propsToPass = data.props = resolveProps(route, matched.props && matched.props[name]); + if (propsToPass) { + // clone to prevent mutation + propsToPass = data.props = extend({}, propsToPass); + // pass non-declared props as attrs + var attrs = data.attrs = data.attrs || {}; + for (var key in propsToPass) { + if (!component.props || !(key in component.props)) { + attrs[key] = propsToPass[key]; + delete propsToPass[key]; + } + } + } + + return h(component, data, children) + } +} + +function resolveProps (route, config) { + switch (typeof config) { + case 'undefined': + return + case 'object': + return config + case 'function': + return config(route) + case 'boolean': + return config ? route.params : undefined + default: + if (true) { + warn( + false, + "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " + + "expecting an object, function or boolean." + ); + } + } +} + +/* */ + +var encodeReserveRE = /[!'()*]/g; +var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); }; +var commaRE = /%2C/g; + +// fixed encodeURIComponent which is more conformant to RFC3986: +// - escapes [!'()*] +// - preserve commas +var encode = function (str) { return encodeURIComponent(str) + .replace(encodeReserveRE, encodeReserveReplacer) + .replace(commaRE, ','); }; + +var decode = decodeURIComponent; + +function resolveQuery ( + query, + extraQuery, + _parseQuery +) { + if ( extraQuery === void 0 ) extraQuery = {}; + + var parse = _parseQuery || parseQuery; + var parsedQuery; + try { + parsedQuery = parse(query || ''); + } catch (e) { + true && warn(false, e.message); + parsedQuery = {}; + } + for (var key in extraQuery) { + parsedQuery[key] = extraQuery[key]; + } + return parsedQuery +} + +function parseQuery (query) { + var res = {}; + + query = query.trim().replace(/^(\?|#|&)/, ''); + + if (!query) { + return res + } + + query.split('&').forEach(function (param) { + var parts = param.replace(/\+/g, ' ').split('='); + var key = decode(parts.shift()); + var val = parts.length > 0 + ? decode(parts.join('=')) + : null; + + if (res[key] === undefined) { + res[key] = val; + } else if (Array.isArray(res[key])) { + res[key].push(val); + } else { + res[key] = [res[key], val]; + } + }); + + return res +} + +function stringifyQuery (obj) { + var res = obj ? Object.keys(obj).map(function (key) { + var val = obj[key]; + + if (val === undefined) { + return '' + } + + if (val === null) { + return encode(key) + } + + if (Array.isArray(val)) { + var result = []; + val.forEach(function (val2) { + if (val2 === undefined) { + return + } + if (val2 === null) { + result.push(encode(key)); + } else { + result.push(encode(key) + '=' + encode(val2)); + } + }); + return result.join('&') + } + + return encode(key) + '=' + encode(val) + }).filter(function (x) { return x.length > 0; }).join('&') : null; + return res ? ("?" + res) : '' +} + +/* */ + +var trailingSlashRE = /\/?$/; + +function createRoute ( + record, + location, + redirectedFrom, + router +) { + var stringifyQuery$$1 = router && router.options.stringifyQuery; + + var query = location.query || {}; + try { + query = clone(query); + } catch (e) {} + + var route = { + name: location.name || (record && record.name), + meta: (record && record.meta) || {}, + path: location.path || '/', + hash: location.hash || '', + query: query, + params: location.params || {}, + fullPath: getFullPath(location, stringifyQuery$$1), + matched: record ? formatMatch(record) : [] + }; + if (redirectedFrom) { + route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery$$1); + } + return Object.freeze(route) +} + +function clone (value) { + if (Array.isArray(value)) { + return value.map(clone) + } else if (value && typeof value === 'object') { + var res = {}; + for (var key in value) { + res[key] = clone(value[key]); + } + return res + } else { + return value + } +} + +// the starting route that represents the initial state +var START = createRoute(null, { + path: '/' +}); + +function formatMatch (record) { + var res = []; + while (record) { + res.unshift(record); + record = record.parent; + } + return res +} + +function getFullPath ( + ref, + _stringifyQuery +) { + var path = ref.path; + var query = ref.query; if ( query === void 0 ) query = {}; + var hash = ref.hash; if ( hash === void 0 ) hash = ''; + + var stringify = _stringifyQuery || stringifyQuery; + return (path || '/') + stringify(query) + hash +} + +function isSameRoute (a, b) { + if (b === START) { + return a === b + } else if (!b) { + return false + } else if (a.path && b.path) { + return ( + a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && + a.hash === b.hash && + isObjectEqual(a.query, b.query) + ) + } else if (a.name && b.name) { + return ( + a.name === b.name && + a.hash === b.hash && + isObjectEqual(a.query, b.query) && + isObjectEqual(a.params, b.params) + ) + } else { + return false + } +} + +function isObjectEqual (a, b) { + if ( a === void 0 ) a = {}; + if ( b === void 0 ) b = {}; + + // handle null value #1566 + if (!a || !b) { return a === b } + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + if (aKeys.length !== bKeys.length) { + return false + } + return aKeys.every(function (key) { + var aVal = a[key]; + var bVal = b[key]; + // check nested equality + if (typeof aVal === 'object' && typeof bVal === 'object') { + return isObjectEqual(aVal, bVal) + } + return String(aVal) === String(bVal) + }) +} + +function isIncludedRoute (current, target) { + return ( + current.path.replace(trailingSlashRE, '/').indexOf( + target.path.replace(trailingSlashRE, '/') + ) === 0 && + (!target.hash || current.hash === target.hash) && + queryIncludes(current.query, target.query) + ) +} + +function queryIncludes (current, target) { + for (var key in target) { + if (!(key in current)) { + return false + } + } + return true +} + +/* */ + +// work around weird flow bug +var toTypes = [String, Object]; +var eventTypes = [String, Array]; + +var Link = { + name: 'RouterLink', + props: { + to: { + type: toTypes, + required: true + }, + tag: { + type: String, + default: 'a' + }, + exact: Boolean, + append: Boolean, + replace: Boolean, + activeClass: String, + exactActiveClass: String, + event: { + type: eventTypes, + default: 'click' + } + }, + render: function render (h) { + var this$1 = this; + + var router = this.$router; + var current = this.$route; + var ref = router.resolve(this.to, current, this.append); + var location = ref.location; + var route = ref.route; + var href = ref.href; + + var classes = {}; + var globalActiveClass = router.options.linkActiveClass; + var globalExactActiveClass = router.options.linkExactActiveClass; + // Support global empty active class + var activeClassFallback = globalActiveClass == null + ? 'router-link-active' + : globalActiveClass; + var exactActiveClassFallback = globalExactActiveClass == null + ? 'router-link-exact-active' + : globalExactActiveClass; + var activeClass = this.activeClass == null + ? activeClassFallback + : this.activeClass; + var exactActiveClass = this.exactActiveClass == null + ? exactActiveClassFallback + : this.exactActiveClass; + var compareTarget = location.path + ? createRoute(null, location, null, router) + : route; + + classes[exactActiveClass] = isSameRoute(current, compareTarget); + classes[activeClass] = this.exact + ? classes[exactActiveClass] + : isIncludedRoute(current, compareTarget); + + var handler = function (e) { + if (guardEvent(e)) { + if (this$1.replace) { + router.replace(location); + } else { + router.push(location); + } + } + }; + + var on = { click: guardEvent }; + if (Array.isArray(this.event)) { + this.event.forEach(function (e) { on[e] = handler; }); + } else { + on[this.event] = handler; + } + + var data = { + class: classes + }; + + if (this.tag === 'a') { + data.on = on; + data.attrs = { href: href }; + } else { + // find the first <a> child and apply listener and href + var a = findAnchor(this.$slots.default); + if (a) { + // in case the <a> is a static node + a.isStatic = false; + var aData = a.data = extend({}, a.data); + aData.on = on; + var aAttrs = a.data.attrs = extend({}, a.data.attrs); + aAttrs.href = href; + } else { + // doesn't have <a> child, apply listener to self + data.on = on; + } + } + + return h(this.tag, data, this.$slots.default) + } +} + +function guardEvent (e) { + // don't redirect with control keys + if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return } + // don't redirect when preventDefault called + if (e.defaultPrevented) { return } + // don't redirect on right click + if (e.button !== undefined && e.button !== 0) { return } + // don't redirect if `target="_blank"` + if (e.currentTarget && e.currentTarget.getAttribute) { + var target = e.currentTarget.getAttribute('target'); + if (/\b_blank\b/i.test(target)) { return } + } + // this may be a Weex event which doesn't have this method + if (e.preventDefault) { + e.preventDefault(); + } + return true +} + +function findAnchor (children) { + if (children) { + var child; + for (var i = 0; i < children.length; i++) { + child = children[i]; + if (child.tag === 'a') { + return child + } + if (child.children && (child = findAnchor(child.children))) { + return child + } + } + } +} + +var _Vue; + +function install (Vue) { + if (install.installed && _Vue === Vue) { return } + install.installed = true; + + _Vue = Vue; + + var isDef = function (v) { return v !== undefined; }; + + var registerInstance = function (vm, callVal) { + var i = vm.$options._parentVnode; + if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) { + i(vm, callVal); + } + }; + + Vue.mixin({ + beforeCreate: function beforeCreate () { + if (isDef(this.$options.router)) { + this._routerRoot = this; + this._router = this.$options.router; + this._router.init(this); + Vue.util.defineReactive(this, '_route', this._router.history.current); + } else { + this._routerRoot = (this.$parent && this.$parent._routerRoot) || this; + } + registerInstance(this, this); + }, + destroyed: function destroyed () { + registerInstance(this); + } + }); + + Object.defineProperty(Vue.prototype, '$router', { + get: function get () { return this._routerRoot._router } + }); + + Object.defineProperty(Vue.prototype, '$route', { + get: function get () { return this._routerRoot._route } + }); + + Vue.component('RouterView', View); + Vue.component('RouterLink', Link); + + var strats = Vue.config.optionMergeStrategies; + // use the same hook merging strategy for route hooks + strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created; +} + +/* */ + +var inBrowser = typeof window !== 'undefined'; + +/* */ + +function resolvePath ( + relative, + base, + append +) { + var firstChar = relative.charAt(0); + if (firstChar === '/') { + return relative + } + + if (firstChar === '?' || firstChar === '#') { + return base + relative + } + + var stack = base.split('/'); + + // remove trailing segment if: + // - not appending + // - appending to trailing slash (last segment is empty) + if (!append || !stack[stack.length - 1]) { + stack.pop(); + } + + // resolve relative path + var segments = relative.replace(/^\//, '').split('/'); + for (var i = 0; i < segments.length; i++) { + var segment = segments[i]; + if (segment === '..') { + stack.pop(); + } else if (segment !== '.') { + stack.push(segment); + } + } + + // ensure leading slash + if (stack[0] !== '') { + stack.unshift(''); + } + + return stack.join('/') +} + +function parsePath (path) { + var hash = ''; + var query = ''; + + var hashIndex = path.indexOf('#'); + if (hashIndex >= 0) { + hash = path.slice(hashIndex); + path = path.slice(0, hashIndex); + } + + var queryIndex = path.indexOf('?'); + if (queryIndex >= 0) { + query = path.slice(queryIndex + 1); + path = path.slice(0, queryIndex); + } + + return { + path: path, + query: query, + hash: hash + } +} + +function cleanPath (path) { + return path.replace(/\/\//g, '/') +} + +var isarray = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +/** + * Expose `pathToRegexp`. + */ +var pathToRegexp_1 = pathToRegexp; +var parse_1 = parse; +var compile_1 = compile; +var tokensToFunction_1 = tokensToFunction; +var tokensToRegExp_1 = tokensToRegExp; + +/** + * The main path matching regexp utility. + * + * @type {RegExp} + */ +var PATH_REGEXP = new RegExp([ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' +].join('|'), 'g'); + +/** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ +function parse (str, options) { + var tokens = []; + var key = 0; + var index = 0; + var path = ''; + var defaultDelimiter = options && options.delimiter || '/'; + var res; + + while ((res = PATH_REGEXP.exec(str)) != null) { + var m = res[0]; + var escaped = res[1]; + var offset = res.index; + path += str.slice(index, offset); + index = offset + m.length; + + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1]; + continue + } + + var next = str[index]; + var prefix = res[2]; + var name = res[3]; + var capture = res[4]; + var group = res[5]; + var modifier = res[6]; + var asterisk = res[7]; + + // Push the current path onto the tokens. + if (path) { + tokens.push(path); + path = ''; + } + + var partial = prefix != null && next != null && next !== prefix; + var repeat = modifier === '+' || modifier === '*'; + var optional = modifier === '?' || modifier === '*'; + var delimiter = res[2] || defaultDelimiter; + var pattern = capture || group; + + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter: delimiter, + optional: optional, + repeat: repeat, + partial: partial, + asterisk: !!asterisk, + pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') + }); + } + + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index); + } + + // If the path exists, push it onto the end. + if (path) { + tokens.push(path); + } + + return tokens +} + +/** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ +function compile (str, options) { + return tokensToFunction(parse(str, options)) +} + +/** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ +function encodeURIComponentPretty (str) { + return encodeURI(str).replace(/[\/?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +/** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ +function encodeAsterisk (str) { + return encodeURI(str).replace(/[?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction (tokens) { + // Compile all the tokens into regexps. + var matches = new Array(tokens.length); + + // Compile all the patterns before compilation. + for (var i = 0; i < tokens.length; i++) { + if (typeof tokens[i] === 'object') { + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$'); + } + } + + return function (obj, opts) { + var path = ''; + var data = obj || {}; + var options = opts || {}; + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + + if (typeof token === 'string') { + path += token; + + continue + } + + var value = data[token.name]; + var segment; + + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix; + } + + continue + } else { + throw new TypeError('Expected "' + token.name + '" to be defined') + } + } + + if (isarray(value)) { + if (!token.repeat) { + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') + } + + if (value.length === 0) { + if (token.optional) { + continue + } else { + throw new TypeError('Expected "' + token.name + '" to not be empty') + } + } + + for (var j = 0; j < value.length; j++) { + segment = encode(value[j]); + + if (!matches[i].test(segment)) { + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + } + + path += (j === 0 ? token.prefix : token.delimiter) + segment; + } + + continue + } + + segment = token.asterisk ? encodeAsterisk(value) : encode(value); + + if (!matches[i].test(segment)) { + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') + } + + path += token.prefix + segment; + } + + return path + } +} + +/** + * Escape a regular expression string. + * + * @param {string} str + * @return {string} + */ +function escapeString (str) { + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') +} + +/** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {string} group + * @return {string} + */ +function escapeGroup (group) { + return group.replace(/([=!:$\/()])/g, '\\$1') +} + +/** + * Attach the keys as a property of the regexp. + * + * @param {!RegExp} re + * @param {Array} keys + * @return {!RegExp} + */ +function attachKeys (re, keys) { + re.keys = keys; + return re +} + +/** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {string} + */ +function flags (options) { + return options.sensitive ? '' : 'i' +} + +/** + * Pull out keys from a regexp. + * + * @param {!RegExp} path + * @param {!Array} keys + * @return {!RegExp} + */ +function regexpToRegexp (path, keys) { + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g); + + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: null, + delimiter: null, + optional: false, + repeat: false, + partial: false, + asterisk: false, + pattern: null + }); + } + } + + return attachKeys(path, keys) +} + +/** + * Transform an array into a regexp. + * + * @param {!Array} path + * @param {Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function arrayToRegexp (path, keys, options) { + var parts = []; + + for (var i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source); + } + + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); + + return attachKeys(regexp, keys) +} + +/** + * Create a path regexp from string input. + * + * @param {string} path + * @param {!Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function stringToRegexp (path, keys, options) { + return tokensToRegExp(parse(path, options), keys, options) +} + +/** + * Expose a function for taking tokens and returning a RegExp. + * + * @param {!Array} tokens + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function tokensToRegExp (tokens, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + var strict = options.strict; + var end = options.end !== false; + var route = ''; + + // Iterate over the tokens and create our regexp string. + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + + if (typeof token === 'string') { + route += escapeString(token); + } else { + var prefix = escapeString(token.prefix); + var capture = '(?:' + token.pattern + ')'; + + keys.push(token); + + if (token.repeat) { + capture += '(?:' + prefix + capture + ')*'; + } + + if (token.optional) { + if (!token.partial) { + capture = '(?:' + prefix + '(' + capture + '))?'; + } else { + capture = prefix + '(' + capture + ')?'; + } + } else { + capture = prefix + '(' + capture + ')'; + } + + route += capture; + } + } + + var delimiter = escapeString(options.delimiter || '/'); + var endsWithDelimiter = route.slice(-delimiter.length) === delimiter; + + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'; + } + + if (end) { + route += '$'; + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'; + } + + return attachKeys(new RegExp('^' + route, flags(options)), keys) +} + +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(string|RegExp|Array)} path + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function pathToRegexp (path, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + if (path instanceof RegExp) { + return regexpToRegexp(path, /** @type {!Array} */ (keys)) + } + + if (isarray(path)) { + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + } + + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) +} +pathToRegexp_1.parse = parse_1; +pathToRegexp_1.compile = compile_1; +pathToRegexp_1.tokensToFunction = tokensToFunction_1; +pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; + +/* */ + +// $flow-disable-line +var regexpCompileCache = Object.create(null); + +function fillParams ( + path, + params, + routeMsg +) { + try { + var filler = + regexpCompileCache[path] || + (regexpCompileCache[path] = pathToRegexp_1.compile(path)); + return filler(params || {}, { pretty: true }) + } catch (e) { + if (true) { + warn(false, ("missing param for " + routeMsg + ": " + (e.message))); + } + return '' + } +} + +/* */ + +function createRouteMap ( + routes, + oldPathList, + oldPathMap, + oldNameMap +) { + // the path list is used to control path matching priority + var pathList = oldPathList || []; + // $flow-disable-line + var pathMap = oldPathMap || Object.create(null); + // $flow-disable-line + var nameMap = oldNameMap || Object.create(null); + + routes.forEach(function (route) { + addRouteRecord(pathList, pathMap, nameMap, route); + }); + + // ensure wildcard routes are always at the end + for (var i = 0, l = pathList.length; i < l; i++) { + if (pathList[i] === '*') { + pathList.push(pathList.splice(i, 1)[0]); + l--; + i--; + } + } + + return { + pathList: pathList, + pathMap: pathMap, + nameMap: nameMap + } +} + +function addRouteRecord ( + pathList, + pathMap, + nameMap, + route, + parent, + matchAs +) { + var path = route.path; + var name = route.name; + if (true) { + assert(path != null, "\"path\" is required in a route configuration."); + assert( + typeof route.component !== 'string', + "route config \"component\" for path: " + (String(path || name)) + " cannot be a " + + "string id. Use an actual component instead." + ); + } + + var pathToRegexpOptions = route.pathToRegexpOptions || {}; + var normalizedPath = normalizePath( + path, + parent, + pathToRegexpOptions.strict + ); + + if (typeof route.caseSensitive === 'boolean') { + pathToRegexpOptions.sensitive = route.caseSensitive; + } + + var record = { + path: normalizedPath, + regex: compileRouteRegex(normalizedPath, pathToRegexpOptions), + components: route.components || { default: route.component }, + instances: {}, + name: name, + parent: parent, + matchAs: matchAs, + redirect: route.redirect, + beforeEnter: route.beforeEnter, + meta: route.meta || {}, + props: route.props == null + ? {} + : route.components + ? route.props + : { default: route.props } + }; + + if (route.children) { + // Warn if route is named, does not redirect and has a default child route. + // If users navigate to this route by name, the default child will + // not be rendered (GH Issue #629) + if (true) { + if (route.name && !route.redirect && route.children.some(function (child) { return /^\/?$/.test(child.path); })) { + warn( + false, + "Named Route '" + (route.name) + "' has a default child route. " + + "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " + + "the default child route will not be rendered. Remove the name from " + + "this route and use the name of the default child route for named " + + "links instead." + ); + } + } + route.children.forEach(function (child) { + var childMatchAs = matchAs + ? cleanPath((matchAs + "/" + (child.path))) + : undefined; + addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs); + }); + } + + if (route.alias !== undefined) { + var aliases = Array.isArray(route.alias) + ? route.alias + : [route.alias]; + + aliases.forEach(function (alias) { + var aliasRoute = { + path: alias, + children: route.children + }; + addRouteRecord( + pathList, + pathMap, + nameMap, + aliasRoute, + parent, + record.path || '/' // matchAs + ); + }); + } + + if (!pathMap[record.path]) { + pathList.push(record.path); + pathMap[record.path] = record; + } + + if (name) { + if (!nameMap[name]) { + nameMap[name] = record; + } else if ( true && !matchAs) { + warn( + false, + "Duplicate named routes definition: " + + "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }" + ); + } + } +} + +function compileRouteRegex (path, pathToRegexpOptions) { + var regex = pathToRegexp_1(path, [], pathToRegexpOptions); + if (true) { + var keys = Object.create(null); + regex.keys.forEach(function (key) { + warn(!keys[key.name], ("Duplicate param keys in route with path: \"" + path + "\"")); + keys[key.name] = true; + }); + } + return regex +} + +function normalizePath (path, parent, strict) { + if (!strict) { path = path.replace(/\/$/, ''); } + if (path[0] === '/') { return path } + if (parent == null) { return path } + return cleanPath(((parent.path) + "/" + path)) +} + +/* */ + +function normalizeLocation ( + raw, + current, + append, + router +) { + var next = typeof raw === 'string' ? { path: raw } : raw; + // named target + if (next.name || next._normalized) { + return next + } + + // relative params + if (!next.path && next.params && current) { + next = extend({}, next); + next._normalized = true; + var params = extend(extend({}, current.params), next.params); + if (current.name) { + next.name = current.name; + next.params = params; + } else if (current.matched.length) { + var rawPath = current.matched[current.matched.length - 1].path; + next.path = fillParams(rawPath, params, ("path " + (current.path))); + } else if (true) { + warn(false, "relative params navigation requires a current route."); + } + return next + } + + var parsedPath = parsePath(next.path || ''); + var basePath = (current && current.path) || '/'; + var path = parsedPath.path + ? resolvePath(parsedPath.path, basePath, append || next.append) + : basePath; + + var query = resolveQuery( + parsedPath.query, + next.query, + router && router.options.parseQuery + ); + + var hash = next.hash || parsedPath.hash; + if (hash && hash.charAt(0) !== '#') { + hash = "#" + hash; + } + + return { + _normalized: true, + path: path, + query: query, + hash: hash + } +} + +/* */ + + + +function createMatcher ( + routes, + router +) { + var ref = createRouteMap(routes); + var pathList = ref.pathList; + var pathMap = ref.pathMap; + var nameMap = ref.nameMap; + + function addRoutes (routes) { + createRouteMap(routes, pathList, pathMap, nameMap); + } + + function match ( + raw, + currentRoute, + redirectedFrom + ) { + var location = normalizeLocation(raw, currentRoute, false, router); + var name = location.name; + + if (name) { + var record = nameMap[name]; + if (true) { + warn(record, ("Route with name '" + name + "' does not exist")); + } + if (!record) { return _createRoute(null, location) } + var paramNames = record.regex.keys + .filter(function (key) { return !key.optional; }) + .map(function (key) { return key.name; }); + + if (typeof location.params !== 'object') { + location.params = {}; + } + + if (currentRoute && typeof currentRoute.params === 'object') { + for (var key in currentRoute.params) { + if (!(key in location.params) && paramNames.indexOf(key) > -1) { + location.params[key] = currentRoute.params[key]; + } + } + } + + if (record) { + location.path = fillParams(record.path, location.params, ("named route \"" + name + "\"")); + return _createRoute(record, location, redirectedFrom) + } + } else if (location.path) { + location.params = {}; + for (var i = 0; i < pathList.length; i++) { + var path = pathList[i]; + var record$1 = pathMap[path]; + if (matchRoute(record$1.regex, location.path, location.params)) { + return _createRoute(record$1, location, redirectedFrom) + } + } + } + // no match + return _createRoute(null, location) + } + + function redirect ( + record, + location + ) { + var originalRedirect = record.redirect; + var redirect = typeof originalRedirect === 'function' + ? originalRedirect(createRoute(record, location, null, router)) + : originalRedirect; + + if (typeof redirect === 'string') { + redirect = { path: redirect }; + } + + if (!redirect || typeof redirect !== 'object') { + if (true) { + warn( + false, ("invalid redirect option: " + (JSON.stringify(redirect))) + ); + } + return _createRoute(null, location) + } + + var re = redirect; + var name = re.name; + var path = re.path; + var query = location.query; + var hash = location.hash; + var params = location.params; + query = re.hasOwnProperty('query') ? re.query : query; + hash = re.hasOwnProperty('hash') ? re.hash : hash; + params = re.hasOwnProperty('params') ? re.params : params; + + if (name) { + // resolved named direct + var targetRecord = nameMap[name]; + if (true) { + assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found.")); + } + return match({ + _normalized: true, + name: name, + query: query, + hash: hash, + params: params + }, undefined, location) + } else if (path) { + // 1. resolve relative redirect + var rawPath = resolveRecordPath(path, record); + // 2. resolve params + var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\"")); + // 3. rematch with existing query and hash + return match({ + _normalized: true, + path: resolvedPath, + query: query, + hash: hash + }, undefined, location) + } else { + if (true) { + warn(false, ("invalid redirect option: " + (JSON.stringify(redirect)))); + } + return _createRoute(null, location) + } + } + + function alias ( + record, + location, + matchAs + ) { + var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\"")); + var aliasedMatch = match({ + _normalized: true, + path: aliasedPath + }); + if (aliasedMatch) { + var matched = aliasedMatch.matched; + var aliasedRecord = matched[matched.length - 1]; + location.params = aliasedMatch.params; + return _createRoute(aliasedRecord, location) + } + return _createRoute(null, location) + } + + function _createRoute ( + record, + location, + redirectedFrom + ) { + if (record && record.redirect) { + return redirect(record, redirectedFrom || location) + } + if (record && record.matchAs) { + return alias(record, location, record.matchAs) + } + return createRoute(record, location, redirectedFrom, router) + } + + return { + match: match, + addRoutes: addRoutes + } +} + +function matchRoute ( + regex, + path, + params +) { + var m = path.match(regex); + + if (!m) { + return false + } else if (!params) { + return true + } + + for (var i = 1, len = m.length; i < len; ++i) { + var key = regex.keys[i - 1]; + var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]; + if (key) { + // Fix #1994: using * with props: true generates a param named 0 + params[key.name || 'pathMatch'] = val; + } + } + + return true +} + +function resolveRecordPath (path, record) { + return resolvePath(path, record.parent ? record.parent.path : '/', true) +} + +/* */ + +var positionStore = Object.create(null); + +function setupScroll () { + // Fix for #1585 for Firefox + // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 + window.history.replaceState({ key: getStateKey() }, '', window.location.href.replace(window.location.origin, '')); + window.addEventListener('popstate', function (e) { + saveScrollPosition(); + if (e.state && e.state.key) { + setStateKey(e.state.key); + } + }); +} + +function handleScroll ( + router, + to, + from, + isPop +) { + if (!router.app) { + return + } + + var behavior = router.options.scrollBehavior; + if (!behavior) { + return + } + + if (true) { + assert(typeof behavior === 'function', "scrollBehavior must be a function"); + } + + // wait until re-render finishes before scrolling + router.app.$nextTick(function () { + var position = getScrollPosition(); + var shouldScroll = behavior.call(router, to, from, isPop ? position : null); + + if (!shouldScroll) { + return + } + + if (typeof shouldScroll.then === 'function') { + shouldScroll.then(function (shouldScroll) { + scrollToPosition((shouldScroll), position); + }).catch(function (err) { + if (true) { + assert(false, err.toString()); + } + }); + } else { + scrollToPosition(shouldScroll, position); + } + }); +} + +function saveScrollPosition () { + var key = getStateKey(); + if (key) { + positionStore[key] = { + x: window.pageXOffset, + y: window.pageYOffset + }; + } +} + +function getScrollPosition () { + var key = getStateKey(); + if (key) { + return positionStore[key] + } +} + +function getElementPosition (el, offset) { + var docEl = document.documentElement; + var docRect = docEl.getBoundingClientRect(); + var elRect = el.getBoundingClientRect(); + return { + x: elRect.left - docRect.left - offset.x, + y: elRect.top - docRect.top - offset.y + } +} + +function isValidPosition (obj) { + return isNumber(obj.x) || isNumber(obj.y) +} + +function normalizePosition (obj) { + return { + x: isNumber(obj.x) ? obj.x : window.pageXOffset, + y: isNumber(obj.y) ? obj.y : window.pageYOffset + } +} + +function normalizeOffset (obj) { + return { + x: isNumber(obj.x) ? obj.x : 0, + y: isNumber(obj.y) ? obj.y : 0 + } +} + +function isNumber (v) { + return typeof v === 'number' +} + +function scrollToPosition (shouldScroll, position) { + var isObject = typeof shouldScroll === 'object'; + if (isObject && typeof shouldScroll.selector === 'string') { + var el = document.querySelector(shouldScroll.selector); + if (el) { + var offset = shouldScroll.offset && typeof shouldScroll.offset === 'object' ? shouldScroll.offset : {}; + offset = normalizeOffset(offset); + position = getElementPosition(el, offset); + } else if (isValidPosition(shouldScroll)) { + position = normalizePosition(shouldScroll); + } + } else if (isObject && isValidPosition(shouldScroll)) { + position = normalizePosition(shouldScroll); + } + + if (position) { + window.scrollTo(position.x, position.y); + } +} + +/* */ + +var supportsPushState = inBrowser && (function () { + var ua = window.navigator.userAgent; + + if ( + (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && + ua.indexOf('Mobile Safari') !== -1 && + ua.indexOf('Chrome') === -1 && + ua.indexOf('Windows Phone') === -1 + ) { + return false + } + + return window.history && 'pushState' in window.history +})(); + +// use User Timing api (if present) for more accurate key precision +var Time = inBrowser && window.performance && window.performance.now + ? window.performance + : Date; + +var _key = genKey(); + +function genKey () { + return Time.now().toFixed(3) +} + +function getStateKey () { + return _key +} + +function setStateKey (key) { + _key = key; +} + +function pushState (url, replace) { + saveScrollPosition(); + // try...catch the pushState call to get around Safari + // DOM Exception 18 where it limits to 100 pushState calls + var history = window.history; + try { + if (replace) { + history.replaceState({ key: _key }, '', url); + } else { + _key = genKey(); + history.pushState({ key: _key }, '', url); + } + } catch (e) { + window.location[replace ? 'replace' : 'assign'](url); + } +} + +function replaceState (url) { + pushState(url, true); +} + +/* */ + +function runQueue (queue, fn, cb) { + var step = function (index) { + if (index >= queue.length) { + cb(); + } else { + if (queue[index]) { + fn(queue[index], function () { + step(index + 1); + }); + } else { + step(index + 1); + } + } + }; + step(0); +} + +/* */ + +function resolveAsyncComponents (matched) { + return function (to, from, next) { + var hasAsync = false; + var pending = 0; + var error = null; + + flatMapComponents(matched, function (def, _, match, key) { + // if it's a function and doesn't have cid attached, + // assume it's an async component resolve function. + // we are not using Vue's default async resolving mechanism because + // we want to halt the navigation until the incoming component has been + // resolved. + if (typeof def === 'function' && def.cid === undefined) { + hasAsync = true; + pending++; + + var resolve = once(function (resolvedDef) { + if (isESModule(resolvedDef)) { + resolvedDef = resolvedDef.default; + } + // save resolved on async factory in case it's used elsewhere + def.resolved = typeof resolvedDef === 'function' + ? resolvedDef + : _Vue.extend(resolvedDef); + match.components[key] = resolvedDef; + pending--; + if (pending <= 0) { + next(); + } + }); + + var reject = once(function (reason) { + var msg = "Failed to resolve async component " + key + ": " + reason; + true && warn(false, msg); + if (!error) { + error = isError(reason) + ? reason + : new Error(msg); + next(error); + } + }); + + var res; + try { + res = def(resolve, reject); + } catch (e) { + reject(e); + } + if (res) { + if (typeof res.then === 'function') { + res.then(resolve, reject); + } else { + // new syntax in Vue 2.3 + var comp = res.component; + if (comp && typeof comp.then === 'function') { + comp.then(resolve, reject); + } + } + } + } + }); + + if (!hasAsync) { next(); } + } +} + +function flatMapComponents ( + matched, + fn +) { + return flatten(matched.map(function (m) { + return Object.keys(m.components).map(function (key) { return fn( + m.components[key], + m.instances[key], + m, key + ); }) + })) +} + +function flatten (arr) { + return Array.prototype.concat.apply([], arr) +} + +var hasSymbol = + typeof Symbol === 'function' && + typeof Symbol.toStringTag === 'symbol'; + +function isESModule (obj) { + return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module') +} + +// in Webpack 2, require.ensure now also returns a Promise +// so the resolve/reject functions may get called an extra time +// if the user uses an arrow function shorthand that happens to +// return that Promise. +function once (fn) { + var called = false; + return function () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + if (called) { return } + called = true; + return fn.apply(this, args) + } +} + +/* */ + +var History = function History (router, base) { + this.router = router; + this.base = normalizeBase(base); + // start with a route object that stands for "nowhere" + this.current = START; + this.pending = null; + this.ready = false; + this.readyCbs = []; + this.readyErrorCbs = []; + this.errorCbs = []; +}; + +History.prototype.listen = function listen (cb) { + this.cb = cb; +}; + +History.prototype.onReady = function onReady (cb, errorCb) { + if (this.ready) { + cb(); + } else { + this.readyCbs.push(cb); + if (errorCb) { + this.readyErrorCbs.push(errorCb); + } + } +}; + +History.prototype.onError = function onError (errorCb) { + this.errorCbs.push(errorCb); +}; + +History.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) { + var this$1 = this; + + var route = this.router.match(location, this.current); + this.confirmTransition(route, function () { + this$1.updateRoute(route); + onComplete && onComplete(route); + this$1.ensureURL(); + + // fire ready cbs once + if (!this$1.ready) { + this$1.ready = true; + this$1.readyCbs.forEach(function (cb) { cb(route); }); + } + }, function (err) { + if (onAbort) { + onAbort(err); + } + if (err && !this$1.ready) { + this$1.ready = true; + this$1.readyErrorCbs.forEach(function (cb) { cb(err); }); + } + }); +}; + +History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) { + var this$1 = this; + + var current = this.current; + var abort = function (err) { + if (isError(err)) { + if (this$1.errorCbs.length) { + this$1.errorCbs.forEach(function (cb) { cb(err); }); + } else { + warn(false, 'uncaught error during route navigation:'); + console.error(err); + } + } + onAbort && onAbort(err); + }; + if ( + isSameRoute(route, current) && + // in the case the route map has been dynamically appended to + route.matched.length === current.matched.length + ) { + this.ensureURL(); + return abort() + } + + var ref = resolveQueue(this.current.matched, route.matched); + var updated = ref.updated; + var deactivated = ref.deactivated; + var activated = ref.activated; + + var queue = [].concat( + // in-component leave guards + extractLeaveGuards(deactivated), + // global before hooks + this.router.beforeHooks, + // in-component update hooks + extractUpdateHooks(updated), + // in-config enter guards + activated.map(function (m) { return m.beforeEnter; }), + // async components + resolveAsyncComponents(activated) + ); + + this.pending = route; + var iterator = function (hook, next) { + if (this$1.pending !== route) { + return abort() + } + try { + hook(route, current, function (to) { + if (to === false || isError(to)) { + // next(false) -> abort navigation, ensure current URL + this$1.ensureURL(true); + abort(to); + } else if ( + typeof to === 'string' || + (typeof to === 'object' && ( + typeof to.path === 'string' || + typeof to.name === 'string' + )) + ) { + // next('/') or next({ path: '/' }) -> redirect + abort(); + if (typeof to === 'object' && to.replace) { + this$1.replace(to); + } else { + this$1.push(to); + } + } else { + // confirm transition and pass on the value + next(to); + } + }); + } catch (e) { + abort(e); + } + }; + + runQueue(queue, iterator, function () { + var postEnterCbs = []; + var isValid = function () { return this$1.current === route; }; + // wait until async components are resolved before + // extracting in-component enter guards + var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid); + var queue = enterGuards.concat(this$1.router.resolveHooks); + runQueue(queue, iterator, function () { + if (this$1.pending !== route) { + return abort() + } + this$1.pending = null; + onComplete(route); + if (this$1.router.app) { + this$1.router.app.$nextTick(function () { + postEnterCbs.forEach(function (cb) { cb(); }); + }); + } + }); + }); +}; + +History.prototype.updateRoute = function updateRoute (route) { + var prev = this.current; + this.current = route; + this.cb && this.cb(route); + this.router.afterHooks.forEach(function (hook) { + hook && hook(route, prev); + }); +}; + +function normalizeBase (base) { + if (!base) { + if (inBrowser) { + // respect <base> tag + var baseEl = document.querySelector('base'); + base = (baseEl && baseEl.getAttribute('href')) || '/'; + // strip full URL origin + base = base.replace(/^https?:\/\/[^\/]+/, ''); + } else { + base = '/'; + } + } + // make sure there's the starting slash + if (base.charAt(0) !== '/') { + base = '/' + base; + } + // remove trailing slash + return base.replace(/\/$/, '') +} + +function resolveQueue ( + current, + next +) { + var i; + var max = Math.max(current.length, next.length); + for (i = 0; i < max; i++) { + if (current[i] !== next[i]) { + break + } + } + return { + updated: next.slice(0, i), + activated: next.slice(i), + deactivated: current.slice(i) + } +} + +function extractGuards ( + records, + name, + bind, + reverse +) { + var guards = flatMapComponents(records, function (def, instance, match, key) { + var guard = extractGuard(def, name); + if (guard) { + return Array.isArray(guard) + ? guard.map(function (guard) { return bind(guard, instance, match, key); }) + : bind(guard, instance, match, key) + } + }); + return flatten(reverse ? guards.reverse() : guards) +} + +function extractGuard ( + def, + key +) { + if (typeof def !== 'function') { + // extend now so that global mixins are applied. + def = _Vue.extend(def); + } + return def.options[key] +} + +function extractLeaveGuards (deactivated) { + return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true) +} + +function extractUpdateHooks (updated) { + return extractGuards(updated, 'beforeRouteUpdate', bindGuard) +} + +function bindGuard (guard, instance) { + if (instance) { + return function boundRouteGuard () { + return guard.apply(instance, arguments) + } + } +} + +function extractEnterGuards ( + activated, + cbs, + isValid +) { + return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) { + return bindEnterGuard(guard, match, key, cbs, isValid) + }) +} + +function bindEnterGuard ( + guard, + match, + key, + cbs, + isValid +) { + return function routeEnterGuard (to, from, next) { + return guard(to, from, function (cb) { + next(cb); + if (typeof cb === 'function') { + cbs.push(function () { + // #750 + // if a router-view is wrapped with an out-in transition, + // the instance may not have been registered at this time. + // we will need to poll for registration until current route + // is no longer valid. + poll(cb, match.instances, key, isValid); + }); + } + }) + } +} + +function poll ( + cb, // somehow flow cannot infer this is a function + instances, + key, + isValid +) { + if ( + instances[key] && + !instances[key]._isBeingDestroyed // do not reuse being destroyed instance + ) { + cb(instances[key]); + } else if (isValid()) { + setTimeout(function () { + poll(cb, instances, key, isValid); + }, 16); + } +} + +/* */ + +var HTML5History = (function (History$$1) { + function HTML5History (router, base) { + var this$1 = this; + + History$$1.call(this, router, base); + + var expectScroll = router.options.scrollBehavior; + var supportsScroll = supportsPushState && expectScroll; + + if (supportsScroll) { + setupScroll(); + } + + var initLocation = getLocation(this.base); + window.addEventListener('popstate', function (e) { + var current = this$1.current; + + // Avoiding first `popstate` event dispatched in some browsers but first + // history route not updated since async guard at the same time. + var location = getLocation(this$1.base); + if (this$1.current === START && location === initLocation) { + return + } + + this$1.transitionTo(location, function (route) { + if (supportsScroll) { + handleScroll(router, route, current, true); + } + }); + }); + } + + if ( History$$1 ) HTML5History.__proto__ = History$$1; + HTML5History.prototype = Object.create( History$$1 && History$$1.prototype ); + HTML5History.prototype.constructor = HTML5History; + + HTML5History.prototype.go = function go (n) { + window.history.go(n); + }; + + HTML5History.prototype.push = function push (location, onComplete, onAbort) { + var this$1 = this; + + var ref = this; + var fromRoute = ref.current; + this.transitionTo(location, function (route) { + pushState(cleanPath(this$1.base + route.fullPath)); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, onAbort); + }; + + HTML5History.prototype.replace = function replace (location, onComplete, onAbort) { + var this$1 = this; + + var ref = this; + var fromRoute = ref.current; + this.transitionTo(location, function (route) { + replaceState(cleanPath(this$1.base + route.fullPath)); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, onAbort); + }; + + HTML5History.prototype.ensureURL = function ensureURL (push) { + if (getLocation(this.base) !== this.current.fullPath) { + var current = cleanPath(this.base + this.current.fullPath); + push ? pushState(current) : replaceState(current); + } + }; + + HTML5History.prototype.getCurrentLocation = function getCurrentLocation () { + return getLocation(this.base) + }; + + return HTML5History; +}(History)); + +function getLocation (base) { + var path = decodeURI(window.location.pathname); + if (base && path.indexOf(base) === 0) { + path = path.slice(base.length); + } + return (path || '/') + window.location.search + window.location.hash +} + +/* */ + +var HashHistory = (function (History$$1) { + function HashHistory (router, base, fallback) { + History$$1.call(this, router, base); + // check history fallback deeplinking + if (fallback && checkFallback(this.base)) { + return + } + ensureSlash(); + } + + if ( History$$1 ) HashHistory.__proto__ = History$$1; + HashHistory.prototype = Object.create( History$$1 && History$$1.prototype ); + HashHistory.prototype.constructor = HashHistory; + + // this is delayed until the app mounts + // to avoid the hashchange listener being fired too early + HashHistory.prototype.setupListeners = function setupListeners () { + var this$1 = this; + + var router = this.router; + var expectScroll = router.options.scrollBehavior; + var supportsScroll = supportsPushState && expectScroll; + + if (supportsScroll) { + setupScroll(); + } + + window.addEventListener(supportsPushState ? 'popstate' : 'hashchange', function () { + var current = this$1.current; + if (!ensureSlash()) { + return + } + this$1.transitionTo(getHash(), function (route) { + if (supportsScroll) { + handleScroll(this$1.router, route, current, true); + } + if (!supportsPushState) { + replaceHash(route.fullPath); + } + }); + }); + }; + + HashHistory.prototype.push = function push (location, onComplete, onAbort) { + var this$1 = this; + + var ref = this; + var fromRoute = ref.current; + this.transitionTo(location, function (route) { + pushHash(route.fullPath); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, onAbort); + }; + + HashHistory.prototype.replace = function replace (location, onComplete, onAbort) { + var this$1 = this; + + var ref = this; + var fromRoute = ref.current; + this.transitionTo(location, function (route) { + replaceHash(route.fullPath); + handleScroll(this$1.router, route, fromRoute, false); + onComplete && onComplete(route); + }, onAbort); + }; + + HashHistory.prototype.go = function go (n) { + window.history.go(n); + }; + + HashHistory.prototype.ensureURL = function ensureURL (push) { + var current = this.current.fullPath; + if (getHash() !== current) { + push ? pushHash(current) : replaceHash(current); + } + }; + + HashHistory.prototype.getCurrentLocation = function getCurrentLocation () { + return getHash() + }; + + return HashHistory; +}(History)); + +function checkFallback (base) { + var location = getLocation(base); + if (!/^\/#/.test(location)) { + window.location.replace( + cleanPath(base + '/#' + location) + ); + return true + } +} + +function ensureSlash () { + var path = getHash(); + if (path.charAt(0) === '/') { + return true + } + replaceHash('/' + path); + return false +} + +function getHash () { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = window.location.href; + var index = href.indexOf('#'); + return index === -1 ? '' : decodeURI(href.slice(index + 1)) +} + +function getUrl (path) { + var href = window.location.href; + var i = href.indexOf('#'); + var base = i >= 0 ? href.slice(0, i) : href; + return (base + "#" + path) +} + +function pushHash (path) { + if (supportsPushState) { + pushState(getUrl(path)); + } else { + window.location.hash = path; + } +} + +function replaceHash (path) { + if (supportsPushState) { + replaceState(getUrl(path)); + } else { + window.location.replace(getUrl(path)); + } +} + +/* */ + +var AbstractHistory = (function (History$$1) { + function AbstractHistory (router, base) { + History$$1.call(this, router, base); + this.stack = []; + this.index = -1; + } + + if ( History$$1 ) AbstractHistory.__proto__ = History$$1; + AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype ); + AbstractHistory.prototype.constructor = AbstractHistory; + + AbstractHistory.prototype.push = function push (location, onComplete, onAbort) { + var this$1 = this; + + this.transitionTo(location, function (route) { + this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route); + this$1.index++; + onComplete && onComplete(route); + }, onAbort); + }; + + AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) { + var this$1 = this; + + this.transitionTo(location, function (route) { + this$1.stack = this$1.stack.slice(0, this$1.index).concat(route); + onComplete && onComplete(route); + }, onAbort); + }; + + AbstractHistory.prototype.go = function go (n) { + var this$1 = this; + + var targetIndex = this.index + n; + if (targetIndex < 0 || targetIndex >= this.stack.length) { + return + } + var route = this.stack[targetIndex]; + this.confirmTransition(route, function () { + this$1.index = targetIndex; + this$1.updateRoute(route); + }); + }; + + AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () { + var current = this.stack[this.stack.length - 1]; + return current ? current.fullPath : '/' + }; + + AbstractHistory.prototype.ensureURL = function ensureURL () { + // noop + }; + + return AbstractHistory; +}(History)); + +/* */ + + + +var VueRouter = function VueRouter (options) { + if ( options === void 0 ) options = {}; + + this.app = null; + this.apps = []; + this.options = options; + this.beforeHooks = []; + this.resolveHooks = []; + this.afterHooks = []; + this.matcher = createMatcher(options.routes || [], this); + + var mode = options.mode || 'hash'; + this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false; + if (this.fallback) { + mode = 'hash'; + } + if (!inBrowser) { + mode = 'abstract'; + } + this.mode = mode; + + switch (mode) { + case 'history': + this.history = new HTML5History(this, options.base); + break + case 'hash': + this.history = new HashHistory(this, options.base, this.fallback); + break + case 'abstract': + this.history = new AbstractHistory(this, options.base); + break + default: + if (true) { + assert(false, ("invalid mode: " + mode)); + } + } +}; + +var prototypeAccessors = { currentRoute: { configurable: true } }; + +VueRouter.prototype.match = function match ( + raw, + current, + redirectedFrom +) { + return this.matcher.match(raw, current, redirectedFrom) +}; + +prototypeAccessors.currentRoute.get = function () { + return this.history && this.history.current +}; + +VueRouter.prototype.init = function init (app /* Vue component instance */) { + var this$1 = this; + + true && assert( + install.installed, + "not installed. Make sure to call `Vue.use(VueRouter)` " + + "before creating root instance." + ); + + this.apps.push(app); + + // main app already initialized. + if (this.app) { + return + } + + this.app = app; + + var history = this.history; + + if (history instanceof HTML5History) { + history.transitionTo(history.getCurrentLocation()); + } else if (history instanceof HashHistory) { + var setupHashListener = function () { + history.setupListeners(); + }; + history.transitionTo( + history.getCurrentLocation(), + setupHashListener, + setupHashListener + ); + } + + history.listen(function (route) { + this$1.apps.forEach(function (app) { + app._route = route; + }); + }); +}; + +VueRouter.prototype.beforeEach = function beforeEach (fn) { + return registerHook(this.beforeHooks, fn) +}; + +VueRouter.prototype.beforeResolve = function beforeResolve (fn) { + return registerHook(this.resolveHooks, fn) +}; + +VueRouter.prototype.afterEach = function afterEach (fn) { + return registerHook(this.afterHooks, fn) +}; + +VueRouter.prototype.onReady = function onReady (cb, errorCb) { + this.history.onReady(cb, errorCb); +}; + +VueRouter.prototype.onError = function onError (errorCb) { + this.history.onError(errorCb); +}; + +VueRouter.prototype.push = function push (location, onComplete, onAbort) { + this.history.push(location, onComplete, onAbort); +}; + +VueRouter.prototype.replace = function replace (location, onComplete, onAbort) { + this.history.replace(location, onComplete, onAbort); +}; + +VueRouter.prototype.go = function go (n) { + this.history.go(n); +}; + +VueRouter.prototype.back = function back () { + this.go(-1); +}; + +VueRouter.prototype.forward = function forward () { + this.go(1); +}; + +VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) { + var route = to + ? to.matched + ? to + : this.resolve(to).route + : this.currentRoute; + if (!route) { + return [] + } + return [].concat.apply([], route.matched.map(function (m) { + return Object.keys(m.components).map(function (key) { + return m.components[key] + }) + })) +}; + +VueRouter.prototype.resolve = function resolve ( + to, + current, + append +) { + var location = normalizeLocation( + to, + current || this.history.current, + append, + this + ); + var route = this.match(location, current); + var fullPath = route.redirectedFrom || route.fullPath; + var base = this.history.base; + var href = createHref(base, fullPath, this.mode); + return { + location: location, + route: route, + href: href, + // for backwards compat + normalizedTo: location, + resolved: route + } +}; + +VueRouter.prototype.addRoutes = function addRoutes (routes) { + this.matcher.addRoutes(routes); + if (this.history.current !== START) { + this.history.transitionTo(this.history.getCurrentLocation()); + } +}; + +Object.defineProperties( VueRouter.prototype, prototypeAccessors ); + +function registerHook (list, fn) { + list.push(fn); + return function () { + var i = list.indexOf(fn); + if (i > -1) { list.splice(i, 1); } + } +} + +function createHref (base, fullPath, mode) { + var path = mode === 'hash' ? '#' + fullPath : fullPath; + return base ? cleanPath(base + '/' + path) : path +} + +VueRouter.install = install; +VueRouter.version = '3.0.2'; + +if (inBrowser && window.Vue) { + window.Vue.use(VueRouter); +} + +/* harmony default export */ __webpack_exports__["default"] = (VueRouter); + + +/***/ }), + +/***/ "./node_modules/vue-textarea-autosize/dist/vue-textarea-autosize.common.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/vue-textarea-autosize/dist/vue-textarea-autosize.common.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {module.exports=function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(module,exports,__webpack_require__){var Component=__webpack_require__(3)(__webpack_require__(2),__webpack_require__(4),null,null);module.exports=Component.exports},function(module,__webpack_exports__,__webpack_require__){"use strict";function install(Vue){Vue.component("textarea-autosize",__WEBPACK_IMPORTED_MODULE_0__components_TextareaAutosize_vue___default.a)}Object.defineProperty(__webpack_exports__,"__esModule",{value:!0}),__webpack_exports__.install=install;var __WEBPACK_IMPORTED_MODULE_0__components_TextareaAutosize_vue__=__webpack_require__(0),__WEBPACK_IMPORTED_MODULE_0__components_TextareaAutosize_vue___default=__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__components_TextareaAutosize_vue__);__webpack_require__.d(__webpack_exports__,"TextareaAutosize",function(){return __WEBPACK_IMPORTED_MODULE_0__components_TextareaAutosize_vue___default.a});var plugin={version:"1.0.4",install:install};__webpack_exports__.default=plugin;var GlobalVue=null;"undefined"!=typeof window?GlobalVue=window.Vue:"undefined"!=typeof global&&(GlobalVue=global.Vue),GlobalVue&&GlobalVue.use(plugin)},function(module,__webpack_exports__,__webpack_require__){"use strict";Object.defineProperty(__webpack_exports__,"__esModule",{value:!0}),__webpack_exports__.default={name:"TextareaAutosize",created:function(){this.updateVal()},mounted:function(){this.resize()},props:{value:{type:[String,Number],default:""},autosize:{type:Boolean,default:!0},minHeight:{type:[Number],default:null},maxHeight:{type:[Number],default:null},important:{type:[Boolean,Array],default:!1}},data:function(){return{val:null,maxHeightScroll:!1}},computed:{computedStyles:function(){var objStyles={};return this.autosize&&(objStyles.resize=this.isResizeImportant?"none !important":"none",this.maxHeightScroll||(objStyles.overflow=this.isOverflowImportant?"hidden !important":"hidden")),objStyles},isResizeImportant:function(){var imp=this.important;return!0===imp||Array.isArray(imp)&&imp.includes("resize")},isOverflowImportant:function(){var imp=this.important;return!0===imp||Array.isArray(imp)&&imp.includes("overflow")},isHeightImportant:function(){var imp=this.important;return!0===imp||Array.isArray(imp)&&imp.includes("height")}},methods:{updateVal:function(){this.val=this.value},resize:function(){var important=this.isHeightImportant?"important":void 0;this.$el.style.setProperty("height","auto",important);var contentHeight=this.$el.scrollHeight+1;this.minHeight&&(contentHeight=contentHeight<this.minHeight?this.minHeight:contentHeight),this.maxHeight&&(contentHeight>this.maxHeight?(contentHeight=this.maxHeight,this.maxHeightScroll=!0):this.maxHeightScroll=!1);var heightVal=contentHeight+"px";return this.$el.style.setProperty("height",heightVal,important),this}},watch:{value:function(){this.updateVal()},val:function(_val){this.$nextTick(this.resize),this.$emit("input",_val)}}}},function(module,exports){module.exports=function(rawScriptExports,compiledTemplate,scopeId,cssModules){var esModule,scriptExports=rawScriptExports=rawScriptExports||{},type=typeof rawScriptExports.default;"object"!==type&&"function"!==type||(esModule=rawScriptExports,scriptExports=rawScriptExports.default);var options="function"==typeof scriptExports?scriptExports.options:scriptExports;if(compiledTemplate&&(options.render=compiledTemplate.render,options.staticRenderFns=compiledTemplate.staticRenderFns),scopeId&&(options._scopeId=scopeId),cssModules){var computed=options.computed||(options.computed={});Object.keys(cssModules).forEach(function(key){var module=cssModules[key];computed[key]=function(){return module}})}return{esModule:esModule,exports:scriptExports,options:options}}},function(module,exports){module.exports={render:function(){var _vm=this,_h=_vm.$createElement;return(_vm._self._c||_h)("textarea",{directives:[{name:"model",rawName:"v-model",value:_vm.val,expression:"val"}],style:_vm.computedStyles,domProps:{value:_vm.val},on:{focus:_vm.resize,input:function($event){$event.target.composing||(_vm.val=$event.target.value)}}})},staticRenderFns:[]}}]); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/vue-textarea-autosize/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/vue-textarea-autosize/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _dist_vue_textarea_autosize_common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dist/vue-textarea-autosize.common.js */ "./node_modules/vue-textarea-autosize/dist/vue-textarea-autosize.common.js"); +/* harmony import */ var _dist_vue_textarea_autosize_common_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dist_vue_textarea_autosize_common_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _dist_vue_textarea_autosize_common_js__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _dist_vue_textarea_autosize_common_js__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + +/* harmony default export */ __webpack_exports__["default"] = (_dist_vue_textarea_autosize_common_js__WEBPACK_IMPORTED_MODULE_0___default.a); + + + +/***/ }), + +/***/ "./node_modules/vue/dist/vue.common.js": +/*!*********************************************!*\ + !*** ./node_modules/vue/dist/vue.common.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! + * Vue.js v2.5.21 + * (c) 2014-2018 Evan You + * Released under the MIT License. + */ + + +/* */ + +var emptyObject = Object.freeze({}); + +// These helpers produce better VM code in JS engines due to their +// explicitness and function inlining. +function isUndef (v) { + return v === undefined || v === null +} + +function isDef (v) { + return v !== undefined && v !== null +} + +function isTrue (v) { + return v === true +} + +function isFalse (v) { + return v === false +} + +/** + * Check if value is primitive. + */ +function isPrimitive (value) { + return ( + typeof value === 'string' || + typeof value === 'number' || + // $flow-disable-line + typeof value === 'symbol' || + typeof value === 'boolean' + ) +} + +/** + * Quick object check - this is primarily used to tell + * Objects from primitive values when we know the value + * is a JSON-compliant type. + */ +function isObject (obj) { + return obj !== null && typeof obj === 'object' +} + +/** + * Get the raw type string of a value, e.g., [object Object]. + */ +var _toString = Object.prototype.toString; + +function toRawType (value) { + return _toString.call(value).slice(8, -1) +} + +/** + * Strict object type check. Only returns true + * for plain JavaScript objects. + */ +function isPlainObject (obj) { + return _toString.call(obj) === '[object Object]' +} + +function isRegExp (v) { + return _toString.call(v) === '[object RegExp]' +} + +/** + * Check if val is a valid array index. + */ +function isValidArrayIndex (val) { + var n = parseFloat(String(val)); + return n >= 0 && Math.floor(n) === n && isFinite(val) +} + +/** + * Convert a value to a string that is actually rendered. + */ +function toString (val) { + return val == null + ? '' + : typeof val === 'object' + ? JSON.stringify(val, null, 2) + : String(val) +} + +/** + * Convert an input value to a number for persistence. + * If the conversion fails, return original string. + */ +function toNumber (val) { + var n = parseFloat(val); + return isNaN(n) ? val : n +} + +/** + * Make a map and return a function for checking if a key + * is in that map. + */ +function makeMap ( + str, + expectsLowerCase +) { + var map = Object.create(null); + var list = str.split(','); + for (var i = 0; i < list.length; i++) { + map[list[i]] = true; + } + return expectsLowerCase + ? function (val) { return map[val.toLowerCase()]; } + : function (val) { return map[val]; } +} + +/** + * Check if a tag is a built-in tag. + */ +var isBuiltInTag = makeMap('slot,component', true); + +/** + * Check if an attribute is a reserved attribute. + */ +var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); + +/** + * Remove an item from an array. + */ +function remove (arr, item) { + if (arr.length) { + var index = arr.indexOf(item); + if (index > -1) { + return arr.splice(index, 1) + } + } +} + +/** + * Check whether an object has the property. + */ +var hasOwnProperty = Object.prototype.hasOwnProperty; +function hasOwn (obj, key) { + return hasOwnProperty.call(obj, key) +} + +/** + * Create a cached version of a pure function. + */ +function cached (fn) { + var cache = Object.create(null); + return (function cachedFn (str) { + var hit = cache[str]; + return hit || (cache[str] = fn(str)) + }) +} + +/** + * Camelize a hyphen-delimited string. + */ +var camelizeRE = /-(\w)/g; +var camelize = cached(function (str) { + return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) +}); + +/** + * Capitalize a string. + */ +var capitalize = cached(function (str) { + return str.charAt(0).toUpperCase() + str.slice(1) +}); + +/** + * Hyphenate a camelCase string. + */ +var hyphenateRE = /\B([A-Z])/g; +var hyphenate = cached(function (str) { + return str.replace(hyphenateRE, '-$1').toLowerCase() +}); + +/** + * Simple bind polyfill for environments that do not support it, + * e.g., PhantomJS 1.x. Technically, we don't need this anymore + * since native bind is now performant enough in most browsers. + * But removing it would mean breaking code that was able to run in + * PhantomJS 1.x, so this must be kept for backward compatibility. + */ + +/* istanbul ignore next */ +function polyfillBind (fn, ctx) { + function boundFn (a) { + var l = arguments.length; + return l + ? l > 1 + ? fn.apply(ctx, arguments) + : fn.call(ctx, a) + : fn.call(ctx) + } + + boundFn._length = fn.length; + return boundFn +} + +function nativeBind (fn, ctx) { + return fn.bind(ctx) +} + +var bind = Function.prototype.bind + ? nativeBind + : polyfillBind; + +/** + * Convert an Array-like object to a real Array. + */ +function toArray (list, start) { + start = start || 0; + var i = list.length - start; + var ret = new Array(i); + while (i--) { + ret[i] = list[i + start]; + } + return ret +} + +/** + * Mix properties into target object. + */ +function extend (to, _from) { + for (var key in _from) { + to[key] = _from[key]; + } + return to +} + +/** + * Merge an Array of Objects into a single Object. + */ +function toObject (arr) { + var res = {}; + for (var i = 0; i < arr.length; i++) { + if (arr[i]) { + extend(res, arr[i]); + } + } + return res +} + +/* eslint-disable no-unused-vars */ + +/** + * Perform no operation. + * Stubbing args to make Flow happy without leaving useless transpiled code + * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). + */ +function noop (a, b, c) {} + +/** + * Always return false. + */ +var no = function (a, b, c) { return false; }; + +/* eslint-enable no-unused-vars */ + +/** + * Return the same value. + */ +var identity = function (_) { return _; }; + +/** + * Generate a string containing static keys from compiler modules. + */ +function genStaticKeys (modules) { + return modules.reduce(function (keys, m) { + return keys.concat(m.staticKeys || []) + }, []).join(',') +} + +/** + * Check if two values are loosely equal - that is, + * if they are plain objects, do they have the same shape? + */ +function looseEqual (a, b) { + if (a === b) { return true } + var isObjectA = isObject(a); + var isObjectB = isObject(b); + if (isObjectA && isObjectB) { + try { + var isArrayA = Array.isArray(a); + var isArrayB = Array.isArray(b); + if (isArrayA && isArrayB) { + return a.length === b.length && a.every(function (e, i) { + return looseEqual(e, b[i]) + }) + } else if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime() + } else if (!isArrayA && !isArrayB) { + var keysA = Object.keys(a); + var keysB = Object.keys(b); + return keysA.length === keysB.length && keysA.every(function (key) { + return looseEqual(a[key], b[key]) + }) + } else { + /* istanbul ignore next */ + return false + } + } catch (e) { + /* istanbul ignore next */ + return false + } + } else if (!isObjectA && !isObjectB) { + return String(a) === String(b) + } else { + return false + } +} + +/** + * Return the first index at which a loosely equal value can be + * found in the array (if value is a plain object, the array must + * contain an object of the same shape), or -1 if it is not present. + */ +function looseIndexOf (arr, val) { + for (var i = 0; i < arr.length; i++) { + if (looseEqual(arr[i], val)) { return i } + } + return -1 +} + +/** + * Ensure a function is called only once. + */ +function once (fn) { + var called = false; + return function () { + if (!called) { + called = true; + fn.apply(this, arguments); + } + } +} + +var SSR_ATTR = 'data-server-rendered'; + +var ASSET_TYPES = [ + 'component', + 'directive', + 'filter' +]; + +var LIFECYCLE_HOOKS = [ + 'beforeCreate', + 'created', + 'beforeMount', + 'mounted', + 'beforeUpdate', + 'updated', + 'beforeDestroy', + 'destroyed', + 'activated', + 'deactivated', + 'errorCaptured' +]; + +/* */ + + + +var config = ({ + /** + * Option merge strategies (used in core/util/options) + */ + // $flow-disable-line + optionMergeStrategies: Object.create(null), + + /** + * Whether to suppress warnings. + */ + silent: false, + + /** + * Show production mode tip message on boot? + */ + productionTip: "development" !== 'production', + + /** + * Whether to enable devtools + */ + devtools: "development" !== 'production', + + /** + * Whether to record perf + */ + performance: false, + + /** + * Error handler for watcher errors + */ + errorHandler: null, + + /** + * Warn handler for watcher warns + */ + warnHandler: null, + + /** + * Ignore certain custom elements + */ + ignoredElements: [], + + /** + * Custom user key aliases for v-on + */ + // $flow-disable-line + keyCodes: Object.create(null), + + /** + * Check if a tag is reserved so that it cannot be registered as a + * component. This is platform-dependent and may be overwritten. + */ + isReservedTag: no, + + /** + * Check if an attribute is reserved so that it cannot be used as a component + * prop. This is platform-dependent and may be overwritten. + */ + isReservedAttr: no, + + /** + * Check if a tag is an unknown element. + * Platform-dependent. + */ + isUnknownElement: no, + + /** + * Get the namespace of an element + */ + getTagNamespace: noop, + + /** + * Parse the real tag name for the specific platform. + */ + parsePlatformTagName: identity, + + /** + * Check if an attribute must be bound using property, e.g. value + * Platform-dependent. + */ + mustUseProp: no, + + /** + * Perform updates asynchronously. Intended to be used by Vue Test Utils + * This will significantly reduce performance if set to false. + */ + async: true, + + /** + * Exposed for legacy reasons + */ + _lifecycleHooks: LIFECYCLE_HOOKS +}); + +/* */ + +/** + * Check if a string starts with $ or _ + */ +function isReserved (str) { + var c = (str + '').charCodeAt(0); + return c === 0x24 || c === 0x5F +} + +/** + * Define a property. + */ +function def (obj, key, val, enumerable) { + Object.defineProperty(obj, key, { + value: val, + enumerable: !!enumerable, + writable: true, + configurable: true + }); +} + +/** + * Parse simple path. + */ +var bailRE = /[^\w.$]/; +function parsePath (path) { + if (bailRE.test(path)) { + return + } + var segments = path.split('.'); + return function (obj) { + for (var i = 0; i < segments.length; i++) { + if (!obj) { return } + obj = obj[segments[i]]; + } + return obj + } +} + +/* */ + +// can we use __proto__? +var hasProto = '__proto__' in {}; + +// Browser environment sniffing +var inBrowser = typeof window !== 'undefined'; +var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; +var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); +var UA = inBrowser && window.navigator.userAgent.toLowerCase(); +var isIE = UA && /msie|trident/.test(UA); +var isIE9 = UA && UA.indexOf('msie 9.0') > 0; +var isEdge = UA && UA.indexOf('edge/') > 0; +var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); +var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); +var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; + +// Firefox has a "watch" function on Object.prototype... +var nativeWatch = ({}).watch; + +var supportsPassive = false; +if (inBrowser) { + try { + var opts = {}; + Object.defineProperty(opts, 'passive', ({ + get: function get () { + /* istanbul ignore next */ + supportsPassive = true; + } + })); // https://github.com/facebook/flow/issues/285 + window.addEventListener('test-passive', null, opts); + } catch (e) {} +} + +// this needs to be lazy-evaled because vue may be required before +// vue-server-renderer can set VUE_ENV +var _isServer; +var isServerRendering = function () { + if (_isServer === undefined) { + /* istanbul ignore if */ + if (!inBrowser && !inWeex && typeof global !== 'undefined') { + // detect presence of vue-server-renderer and avoid + // Webpack shimming the process + _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; + } else { + _isServer = false; + } + } + return _isServer +}; + +// detect devtools +var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; + +/* istanbul ignore next */ +function isNative (Ctor) { + return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) +} + +var hasSymbol = + typeof Symbol !== 'undefined' && isNative(Symbol) && + typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); + +var _Set; +/* istanbul ignore if */ // $flow-disable-line +if (typeof Set !== 'undefined' && isNative(Set)) { + // use native Set when available. + _Set = Set; +} else { + // a non-standard Set polyfill that only works with primitive keys. + _Set = /*@__PURE__*/(function () { + function Set () { + this.set = Object.create(null); + } + Set.prototype.has = function has (key) { + return this.set[key] === true + }; + Set.prototype.add = function add (key) { + this.set[key] = true; + }; + Set.prototype.clear = function clear () { + this.set = Object.create(null); + }; + + return Set; + }()); +} + +/* */ + +var warn = noop; +var tip = noop; +var generateComponentTrace = (noop); // work around flow check +var formatComponentName = (noop); + +if (true) { + var hasConsole = typeof console !== 'undefined'; + var classifyRE = /(?:^|[-_])(\w)/g; + var classify = function (str) { return str + .replace(classifyRE, function (c) { return c.toUpperCase(); }) + .replace(/[-_]/g, ''); }; + + warn = function (msg, vm) { + var trace = vm ? generateComponentTrace(vm) : ''; + + if (config.warnHandler) { + config.warnHandler.call(null, msg, vm, trace); + } else if (hasConsole && (!config.silent)) { + console.error(("[Vue warn]: " + msg + trace)); + } + }; + + tip = function (msg, vm) { + if (hasConsole && (!config.silent)) { + console.warn("[Vue tip]: " + msg + ( + vm ? generateComponentTrace(vm) : '' + )); + } + }; + + formatComponentName = function (vm, includeFile) { + if (vm.$root === vm) { + return '<Root>' + } + var options = typeof vm === 'function' && vm.cid != null + ? vm.options + : vm._isVue + ? vm.$options || vm.constructor.options + : vm || {}; + var name = options.name || options._componentTag; + var file = options.__file; + if (!name && file) { + var match = file.match(/([^/\\]+)\.vue$/); + name = match && match[1]; + } + + return ( + (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") + + (file && includeFile !== false ? (" at " + file) : '') + ) + }; + + var repeat = function (str, n) { + var res = ''; + while (n) { + if (n % 2 === 1) { res += str; } + if (n > 1) { str += str; } + n >>= 1; + } + return res + }; + + generateComponentTrace = function (vm) { + if (vm._isVue && vm.$parent) { + var tree = []; + var currentRecursiveSequence = 0; + while (vm) { + if (tree.length > 0) { + var last = tree[tree.length - 1]; + if (last.constructor === vm.constructor) { + currentRecursiveSequence++; + vm = vm.$parent; + continue + } else if (currentRecursiveSequence > 0) { + tree[tree.length - 1] = [last, currentRecursiveSequence]; + currentRecursiveSequence = 0; + } + } + tree.push(vm); + vm = vm.$parent; + } + return '\n\nfound in\n\n' + tree + .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) + ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") + : formatComponentName(vm))); }) + .join('\n') + } else { + return ("\n\n(found in " + (formatComponentName(vm)) + ")") + } + }; +} + +/* */ + +var uid = 0; + +/** + * A dep is an observable that can have multiple + * directives subscribing to it. + */ +var Dep = function Dep () { + this.id = uid++; + this.subs = []; +}; + +Dep.prototype.addSub = function addSub (sub) { + this.subs.push(sub); +}; + +Dep.prototype.removeSub = function removeSub (sub) { + remove(this.subs, sub); +}; + +Dep.prototype.depend = function depend () { + if (Dep.target) { + Dep.target.addDep(this); + } +}; + +Dep.prototype.notify = function notify () { + // stabilize the subscriber list first + var subs = this.subs.slice(); + if ( true && !config.async) { + // subs aren't sorted in scheduler if not running async + // we need to sort them now to make sure they fire in correct + // order + subs.sort(function (a, b) { return a.id - b.id; }); + } + for (var i = 0, l = subs.length; i < l; i++) { + subs[i].update(); + } +}; + +// the current target watcher being evaluated. +// this is globally unique because there could be only one +// watcher being evaluated at any time. +Dep.target = null; +var targetStack = []; + +function pushTarget (target) { + targetStack.push(target); + Dep.target = target; +} + +function popTarget () { + targetStack.pop(); + Dep.target = targetStack[targetStack.length - 1]; +} + +/* */ + +var VNode = function VNode ( + tag, + data, + children, + text, + elm, + context, + componentOptions, + asyncFactory +) { + this.tag = tag; + this.data = data; + this.children = children; + this.text = text; + this.elm = elm; + this.ns = undefined; + this.context = context; + this.fnContext = undefined; + this.fnOptions = undefined; + this.fnScopeId = undefined; + this.key = data && data.key; + this.componentOptions = componentOptions; + this.componentInstance = undefined; + this.parent = undefined; + this.raw = false; + this.isStatic = false; + this.isRootInsert = true; + this.isComment = false; + this.isCloned = false; + this.isOnce = false; + this.asyncFactory = asyncFactory; + this.asyncMeta = undefined; + this.isAsyncPlaceholder = false; +}; + +var prototypeAccessors = { child: { configurable: true } }; + +// DEPRECATED: alias for componentInstance for backwards compat. +/* istanbul ignore next */ +prototypeAccessors.child.get = function () { + return this.componentInstance +}; + +Object.defineProperties( VNode.prototype, prototypeAccessors ); + +var createEmptyVNode = function (text) { + if ( text === void 0 ) text = ''; + + var node = new VNode(); + node.text = text; + node.isComment = true; + return node +}; + +function createTextVNode (val) { + return new VNode(undefined, undefined, undefined, String(val)) +} + +// optimized shallow clone +// used for static nodes and slot nodes because they may be reused across +// multiple renders, cloning them avoids errors when DOM manipulations rely +// on their elm reference. +function cloneVNode (vnode) { + var cloned = new VNode( + vnode.tag, + vnode.data, + // #7975 + // clone children array to avoid mutating original in case of cloning + // a child. + vnode.children && vnode.children.slice(), + vnode.text, + vnode.elm, + vnode.context, + vnode.componentOptions, + vnode.asyncFactory + ); + cloned.ns = vnode.ns; + cloned.isStatic = vnode.isStatic; + cloned.key = vnode.key; + cloned.isComment = vnode.isComment; + cloned.fnContext = vnode.fnContext; + cloned.fnOptions = vnode.fnOptions; + cloned.fnScopeId = vnode.fnScopeId; + cloned.asyncMeta = vnode.asyncMeta; + cloned.isCloned = true; + return cloned +} + +/* + * not type checking this file because flow doesn't play well with + * dynamically accessing methods on Array prototype + */ + +var arrayProto = Array.prototype; +var arrayMethods = Object.create(arrayProto); + +var methodsToPatch = [ + 'push', + 'pop', + 'shift', + 'unshift', + 'splice', + 'sort', + 'reverse' +]; + +/** + * Intercept mutating methods and emit events + */ +methodsToPatch.forEach(function (method) { + // cache original method + var original = arrayProto[method]; + def(arrayMethods, method, function mutator () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + var result = original.apply(this, args); + var ob = this.__ob__; + var inserted; + switch (method) { + case 'push': + case 'unshift': + inserted = args; + break + case 'splice': + inserted = args.slice(2); + break + } + if (inserted) { ob.observeArray(inserted); } + // notify change + ob.dep.notify(); + return result + }); +}); + +/* */ + +var arrayKeys = Object.getOwnPropertyNames(arrayMethods); + +/** + * In some cases we may want to disable observation inside a component's + * update computation. + */ +var shouldObserve = true; + +function toggleObserving (value) { + shouldObserve = value; +} + +/** + * Observer class that is attached to each observed + * object. Once attached, the observer converts the target + * object's property keys into getter/setters that + * collect dependencies and dispatch updates. + */ +var Observer = function Observer (value) { + this.value = value; + this.dep = new Dep(); + this.vmCount = 0; + def(value, '__ob__', this); + if (Array.isArray(value)) { + if (hasProto) { + protoAugment(value, arrayMethods); + } else { + copyAugment(value, arrayMethods, arrayKeys); + } + this.observeArray(value); + } else { + this.walk(value); + } +}; + +/** + * Walk through all properties and convert them into + * getter/setters. This method should only be called when + * value type is Object. + */ +Observer.prototype.walk = function walk (obj) { + var keys = Object.keys(obj); + for (var i = 0; i < keys.length; i++) { + defineReactive$$1(obj, keys[i]); + } +}; + +/** + * Observe a list of Array items. + */ +Observer.prototype.observeArray = function observeArray (items) { + for (var i = 0, l = items.length; i < l; i++) { + observe(items[i]); + } +}; + +// helpers + +/** + * Augment a target Object or Array by intercepting + * the prototype chain using __proto__ + */ +function protoAugment (target, src) { + /* eslint-disable no-proto */ + target.__proto__ = src; + /* eslint-enable no-proto */ +} + +/** + * Augment a target Object or Array by defining + * hidden properties. + */ +/* istanbul ignore next */ +function copyAugment (target, src, keys) { + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + def(target, key, src[key]); + } +} + +/** + * Attempt to create an observer instance for a value, + * returns the new observer if successfully observed, + * or the existing observer if the value already has one. + */ +function observe (value, asRootData) { + if (!isObject(value) || value instanceof VNode) { + return + } + var ob; + if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { + ob = value.__ob__; + } else if ( + shouldObserve && + !isServerRendering() && + (Array.isArray(value) || isPlainObject(value)) && + Object.isExtensible(value) && + !value._isVue + ) { + ob = new Observer(value); + } + if (asRootData && ob) { + ob.vmCount++; + } + return ob +} + +/** + * Define a reactive property on an Object. + */ +function defineReactive$$1 ( + obj, + key, + val, + customSetter, + shallow +) { + var dep = new Dep(); + + var property = Object.getOwnPropertyDescriptor(obj, key); + if (property && property.configurable === false) { + return + } + + // cater for pre-defined getter/setters + var getter = property && property.get; + var setter = property && property.set; + if ((!getter || setter) && arguments.length === 2) { + val = obj[key]; + } + + var childOb = !shallow && observe(val); + Object.defineProperty(obj, key, { + enumerable: true, + configurable: true, + get: function reactiveGetter () { + var value = getter ? getter.call(obj) : val; + if (Dep.target) { + dep.depend(); + if (childOb) { + childOb.dep.depend(); + if (Array.isArray(value)) { + dependArray(value); + } + } + } + return value + }, + set: function reactiveSetter (newVal) { + var value = getter ? getter.call(obj) : val; + /* eslint-disable no-self-compare */ + if (newVal === value || (newVal !== newVal && value !== value)) { + return + } + /* eslint-enable no-self-compare */ + if ( true && customSetter) { + customSetter(); + } + // #7981: for accessor properties without setter + if (getter && !setter) { return } + if (setter) { + setter.call(obj, newVal); + } else { + val = newVal; + } + childOb = !shallow && observe(newVal); + dep.notify(); + } + }); +} + +/** + * Set a property on an object. Adds the new property and + * triggers change notification if the property doesn't + * already exist. + */ +function set (target, key, val) { + if ( true && + (isUndef(target) || isPrimitive(target)) + ) { + warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.length = Math.max(target.length, key); + target.splice(key, 1, val); + return val + } + if (key in target && !(key in Object.prototype)) { + target[key] = val; + return val + } + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + true && warn( + 'Avoid adding reactive properties to a Vue instance or its root $data ' + + 'at runtime - declare it upfront in the data option.' + ); + return val + } + if (!ob) { + target[key] = val; + return val + } + defineReactive$$1(ob.value, key, val); + ob.dep.notify(); + return val +} + +/** + * Delete a property and trigger change if necessary. + */ +function del (target, key) { + if ( true && + (isUndef(target) || isPrimitive(target)) + ) { + warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.splice(key, 1); + return + } + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + true && warn( + 'Avoid deleting properties on a Vue instance or its root $data ' + + '- just set it to null.' + ); + return + } + if (!hasOwn(target, key)) { + return + } + delete target[key]; + if (!ob) { + return + } + ob.dep.notify(); +} + +/** + * Collect dependencies on array elements when the array is touched, since + * we cannot intercept array element access like property getters. + */ +function dependArray (value) { + for (var e = (void 0), i = 0, l = value.length; i < l; i++) { + e = value[i]; + e && e.__ob__ && e.__ob__.dep.depend(); + if (Array.isArray(e)) { + dependArray(e); + } + } +} + +/* */ + +/** + * Option overwriting strategies are functions that handle + * how to merge a parent option value and a child option + * value into the final value. + */ +var strats = config.optionMergeStrategies; + +/** + * Options with restrictions + */ +if (true) { + strats.el = strats.propsData = function (parent, child, vm, key) { + if (!vm) { + warn( + "option \"" + key + "\" can only be used during instance " + + 'creation with the `new` keyword.' + ); + } + return defaultStrat(parent, child) + }; +} + +/** + * Helper that recursively merges two data objects together. + */ +function mergeData (to, from) { + if (!from) { return to } + var key, toVal, fromVal; + var keys = Object.keys(from); + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + toVal = to[key]; + fromVal = from[key]; + if (!hasOwn(to, key)) { + set(to, key, fromVal); + } else if ( + toVal !== fromVal && + isPlainObject(toVal) && + isPlainObject(fromVal) + ) { + mergeData(toVal, fromVal); + } + } + return to +} + +/** + * Data + */ +function mergeDataOrFn ( + parentVal, + childVal, + vm +) { + if (!vm) { + // in a Vue.extend merge, both should be functions + if (!childVal) { + return parentVal + } + if (!parentVal) { + return childVal + } + // when parentVal & childVal are both present, + // we need to return a function that returns the + // merged result of both functions... no need to + // check if parentVal is a function here because + // it has to be a function to pass previous merges. + return function mergedDataFn () { + return mergeData( + typeof childVal === 'function' ? childVal.call(this, this) : childVal, + typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal + ) + } + } else { + return function mergedInstanceDataFn () { + // instance merge + var instanceData = typeof childVal === 'function' + ? childVal.call(vm, vm) + : childVal; + var defaultData = typeof parentVal === 'function' + ? parentVal.call(vm, vm) + : parentVal; + if (instanceData) { + return mergeData(instanceData, defaultData) + } else { + return defaultData + } + } + } +} + +strats.data = function ( + parentVal, + childVal, + vm +) { + if (!vm) { + if (childVal && typeof childVal !== 'function') { + true && warn( + 'The "data" option should be a function ' + + 'that returns a per-instance value in component ' + + 'definitions.', + vm + ); + + return parentVal + } + return mergeDataOrFn(parentVal, childVal) + } + + return mergeDataOrFn(parentVal, childVal, vm) +}; + +/** + * Hooks and props are merged as arrays. + */ +function mergeHook ( + parentVal, + childVal +) { + return childVal + ? parentVal + ? parentVal.concat(childVal) + : Array.isArray(childVal) + ? childVal + : [childVal] + : parentVal +} + +LIFECYCLE_HOOKS.forEach(function (hook) { + strats[hook] = mergeHook; +}); + +/** + * Assets + * + * When a vm is present (instance creation), we need to do + * a three-way merge between constructor options, instance + * options and parent options. + */ +function mergeAssets ( + parentVal, + childVal, + vm, + key +) { + var res = Object.create(parentVal || null); + if (childVal) { + true && assertObjectType(key, childVal, vm); + return extend(res, childVal) + } else { + return res + } +} + +ASSET_TYPES.forEach(function (type) { + strats[type + 's'] = mergeAssets; +}); + +/** + * Watchers. + * + * Watchers hashes should not overwrite one + * another, so we merge them as arrays. + */ +strats.watch = function ( + parentVal, + childVal, + vm, + key +) { + // work around Firefox's Object.prototype.watch... + if (parentVal === nativeWatch) { parentVal = undefined; } + if (childVal === nativeWatch) { childVal = undefined; } + /* istanbul ignore if */ + if (!childVal) { return Object.create(parentVal || null) } + if (true) { + assertObjectType(key, childVal, vm); + } + if (!parentVal) { return childVal } + var ret = {}; + extend(ret, parentVal); + for (var key$1 in childVal) { + var parent = ret[key$1]; + var child = childVal[key$1]; + if (parent && !Array.isArray(parent)) { + parent = [parent]; + } + ret[key$1] = parent + ? parent.concat(child) + : Array.isArray(child) ? child : [child]; + } + return ret +}; + +/** + * Other object hashes. + */ +strats.props = +strats.methods = +strats.inject = +strats.computed = function ( + parentVal, + childVal, + vm, + key +) { + if (childVal && "development" !== 'production') { + assertObjectType(key, childVal, vm); + } + if (!parentVal) { return childVal } + var ret = Object.create(null); + extend(ret, parentVal); + if (childVal) { extend(ret, childVal); } + return ret +}; +strats.provide = mergeDataOrFn; + +/** + * Default strategy. + */ +var defaultStrat = function (parentVal, childVal) { + return childVal === undefined + ? parentVal + : childVal +}; + +/** + * Validate component names + */ +function checkComponents (options) { + for (var key in options.components) { + validateComponentName(key); + } +} + +function validateComponentName (name) { + if (!/^[a-zA-Z][\w-]*$/.test(name)) { + warn( + 'Invalid component name: "' + name + '". Component names ' + + 'can only contain alphanumeric characters and the hyphen, ' + + 'and must start with a letter.' + ); + } + if (isBuiltInTag(name) || config.isReservedTag(name)) { + warn( + 'Do not use built-in or reserved HTML elements as component ' + + 'id: ' + name + ); + } +} + +/** + * Ensure all props option syntax are normalized into the + * Object-based format. + */ +function normalizeProps (options, vm) { + var props = options.props; + if (!props) { return } + var res = {}; + var i, val, name; + if (Array.isArray(props)) { + i = props.length; + while (i--) { + val = props[i]; + if (typeof val === 'string') { + name = camelize(val); + res[name] = { type: null }; + } else if (true) { + warn('props must be strings when using array syntax.'); + } + } + } else if (isPlainObject(props)) { + for (var key in props) { + val = props[key]; + name = camelize(key); + res[name] = isPlainObject(val) + ? val + : { type: val }; + } + } else if (true) { + warn( + "Invalid value for option \"props\": expected an Array or an Object, " + + "but got " + (toRawType(props)) + ".", + vm + ); + } + options.props = res; +} + +/** + * Normalize all injections into Object-based format + */ +function normalizeInject (options, vm) { + var inject = options.inject; + if (!inject) { return } + var normalized = options.inject = {}; + if (Array.isArray(inject)) { + for (var i = 0; i < inject.length; i++) { + normalized[inject[i]] = { from: inject[i] }; + } + } else if (isPlainObject(inject)) { + for (var key in inject) { + var val = inject[key]; + normalized[key] = isPlainObject(val) + ? extend({ from: key }, val) + : { from: val }; + } + } else if (true) { + warn( + "Invalid value for option \"inject\": expected an Array or an Object, " + + "but got " + (toRawType(inject)) + ".", + vm + ); + } +} + +/** + * Normalize raw function directives into object format. + */ +function normalizeDirectives (options) { + var dirs = options.directives; + if (dirs) { + for (var key in dirs) { + var def = dirs[key]; + if (typeof def === 'function') { + dirs[key] = { bind: def, update: def }; + } + } + } +} + +function assertObjectType (name, value, vm) { + if (!isPlainObject(value)) { + warn( + "Invalid value for option \"" + name + "\": expected an Object, " + + "but got " + (toRawType(value)) + ".", + vm + ); + } +} + +/** + * Merge two option objects into a new one. + * Core utility used in both instantiation and inheritance. + */ +function mergeOptions ( + parent, + child, + vm +) { + if (true) { + checkComponents(child); + } + + if (typeof child === 'function') { + child = child.options; + } + + normalizeProps(child, vm); + normalizeInject(child, vm); + normalizeDirectives(child); + + // Apply extends and mixins on the child options, + // but only if it is a raw options object that isn't + // the result of another mergeOptions call. + // Only merged options has the _base property. + if (!child._base) { + if (child.extends) { + parent = mergeOptions(parent, child.extends, vm); + } + if (child.mixins) { + for (var i = 0, l = child.mixins.length; i < l; i++) { + parent = mergeOptions(parent, child.mixins[i], vm); + } + } + } + + var options = {}; + var key; + for (key in parent) { + mergeField(key); + } + for (key in child) { + if (!hasOwn(parent, key)) { + mergeField(key); + } + } + function mergeField (key) { + var strat = strats[key] || defaultStrat; + options[key] = strat(parent[key], child[key], vm, key); + } + return options +} + +/** + * Resolve an asset. + * This function is used because child instances need access + * to assets defined in its ancestor chain. + */ +function resolveAsset ( + options, + type, + id, + warnMissing +) { + /* istanbul ignore if */ + if (typeof id !== 'string') { + return + } + var assets = options[type]; + // check local registration variations first + if (hasOwn(assets, id)) { return assets[id] } + var camelizedId = camelize(id); + if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } + var PascalCaseId = capitalize(camelizedId); + if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } + // fallback to prototype chain + var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; + if ( true && warnMissing && !res) { + warn( + 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, + options + ); + } + return res +} + +/* */ + + + +function validateProp ( + key, + propOptions, + propsData, + vm +) { + var prop = propOptions[key]; + var absent = !hasOwn(propsData, key); + var value = propsData[key]; + // boolean casting + var booleanIndex = getTypeIndex(Boolean, prop.type); + if (booleanIndex > -1) { + if (absent && !hasOwn(prop, 'default')) { + value = false; + } else if (value === '' || value === hyphenate(key)) { + // only cast empty string / same name to boolean if + // boolean has higher priority + var stringIndex = getTypeIndex(String, prop.type); + if (stringIndex < 0 || booleanIndex < stringIndex) { + value = true; + } + } + } + // check default value + if (value === undefined) { + value = getPropDefaultValue(vm, prop, key); + // since the default value is a fresh copy, + // make sure to observe it. + var prevShouldObserve = shouldObserve; + toggleObserving(true); + observe(value); + toggleObserving(prevShouldObserve); + } + if ( + true + ) { + assertProp(prop, key, value, vm, absent); + } + return value +} + +/** + * Get the default value of a prop. + */ +function getPropDefaultValue (vm, prop, key) { + // no default, return undefined + if (!hasOwn(prop, 'default')) { + return undefined + } + var def = prop.default; + // warn against non-factory defaults for Object & Array + if ( true && isObject(def)) { + warn( + 'Invalid default value for prop "' + key + '": ' + + 'Props with type Object/Array must use a factory function ' + + 'to return the default value.', + vm + ); + } + // the raw prop value was also undefined from previous render, + // return previous default value to avoid unnecessary watcher trigger + if (vm && vm.$options.propsData && + vm.$options.propsData[key] === undefined && + vm._props[key] !== undefined + ) { + return vm._props[key] + } + // call factory function for non-Function types + // a value is Function if its prototype is function even across different execution context + return typeof def === 'function' && getType(prop.type) !== 'Function' + ? def.call(vm) + : def +} + +/** + * Assert whether a prop is valid. + */ +function assertProp ( + prop, + name, + value, + vm, + absent +) { + if (prop.required && absent) { + warn( + 'Missing required prop: "' + name + '"', + vm + ); + return + } + if (value == null && !prop.required) { + return + } + var type = prop.type; + var valid = !type || type === true; + var expectedTypes = []; + if (type) { + if (!Array.isArray(type)) { + type = [type]; + } + for (var i = 0; i < type.length && !valid; i++) { + var assertedType = assertType(value, type[i]); + expectedTypes.push(assertedType.expectedType || ''); + valid = assertedType.valid; + } + } + + if (!valid) { + warn( + getInvalidTypeMessage(name, value, expectedTypes), + vm + ); + return + } + var validator = prop.validator; + if (validator) { + if (!validator(value)) { + warn( + 'Invalid prop: custom validator check failed for prop "' + name + '".', + vm + ); + } + } +} + +var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; + +function assertType (value, type) { + var valid; + var expectedType = getType(type); + if (simpleCheckRE.test(expectedType)) { + var t = typeof value; + valid = t === expectedType.toLowerCase(); + // for primitive wrapper objects + if (!valid && t === 'object') { + valid = value instanceof type; + } + } else if (expectedType === 'Object') { + valid = isPlainObject(value); + } else if (expectedType === 'Array') { + valid = Array.isArray(value); + } else { + valid = value instanceof type; + } + return { + valid: valid, + expectedType: expectedType + } +} + +/** + * Use function string name to check built-in types, + * because a simple equality check will fail when running + * across different vms / iframes. + */ +function getType (fn) { + var match = fn && fn.toString().match(/^\s*function (\w+)/); + return match ? match[1] : '' +} + +function isSameType (a, b) { + return getType(a) === getType(b) +} + +function getTypeIndex (type, expectedTypes) { + if (!Array.isArray(expectedTypes)) { + return isSameType(expectedTypes, type) ? 0 : -1 + } + for (var i = 0, len = expectedTypes.length; i < len; i++) { + if (isSameType(expectedTypes[i], type)) { + return i + } + } + return -1 +} + +function getInvalidTypeMessage (name, value, expectedTypes) { + var message = "Invalid prop: type check failed for prop \"" + name + "\"." + + " Expected " + (expectedTypes.map(capitalize).join(', ')); + var expectedType = expectedTypes[0]; + var receivedType = toRawType(value); + var expectedValue = styleValue(value, expectedType); + var receivedValue = styleValue(value, receivedType); + // check if we need to specify expected value + if (expectedTypes.length === 1 && + isExplicable(expectedType) && + !isBoolean(expectedType, receivedType)) { + message += " with value " + expectedValue; + } + message += ", got " + receivedType + " "; + // check if we need to specify received value + if (isExplicable(receivedType)) { + message += "with value " + receivedValue + "."; + } + return message +} + +function styleValue (value, type) { + if (type === 'String') { + return ("\"" + value + "\"") + } else if (type === 'Number') { + return ("" + (Number(value))) + } else { + return ("" + value) + } +} + +function isExplicable (value) { + var explicitTypes = ['string', 'number', 'boolean']; + return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; }) +} + +function isBoolean () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) +} + +/* */ + +function handleError (err, vm, info) { + if (vm) { + var cur = vm; + while ((cur = cur.$parent)) { + var hooks = cur.$options.errorCaptured; + if (hooks) { + for (var i = 0; i < hooks.length; i++) { + try { + var capture = hooks[i].call(cur, err, vm, info) === false; + if (capture) { return } + } catch (e) { + globalHandleError(e, cur, 'errorCaptured hook'); + } + } + } + } + } + globalHandleError(err, vm, info); +} + +function globalHandleError (err, vm, info) { + if (config.errorHandler) { + try { + return config.errorHandler.call(null, err, vm, info) + } catch (e) { + logError(e, null, 'config.errorHandler'); + } + } + logError(err, vm, info); +} + +function logError (err, vm, info) { + if (true) { + warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); + } + /* istanbul ignore else */ + if ((inBrowser || inWeex) && typeof console !== 'undefined') { + console.error(err); + } else { + throw err + } +} + +/* */ + +var callbacks = []; +var pending = false; + +function flushCallbacks () { + pending = false; + var copies = callbacks.slice(0); + callbacks.length = 0; + for (var i = 0; i < copies.length; i++) { + copies[i](); + } +} + +// Here we have async deferring wrappers using both microtasks and (macro) tasks. +// In < 2.4 we used microtasks everywhere, but there are some scenarios where +// microtasks have too high a priority and fire in between supposedly +// sequential events (e.g. #4521, #6690) or even between bubbling of the same +// event (#6566). However, using (macro) tasks everywhere also has subtle problems +// when state is changed right before repaint (e.g. #6813, out-in transitions). +// Here we use microtask by default, but expose a way to force (macro) task when +// needed (e.g. in event handlers attached by v-on). +var microTimerFunc; +var macroTimerFunc; +var useMacroTask = false; + +// Determine (macro) task defer implementation. +// Technically setImmediate should be the ideal choice, but it's only available +// in IE. The only polyfill that consistently queues the callback after all DOM +// events triggered in the same loop is by using MessageChannel. +/* istanbul ignore if */ +if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { + macroTimerFunc = function () { + setImmediate(flushCallbacks); + }; +} else if (typeof MessageChannel !== 'undefined' && ( + isNative(MessageChannel) || + // PhantomJS + MessageChannel.toString() === '[object MessageChannelConstructor]' +)) { + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = flushCallbacks; + macroTimerFunc = function () { + port.postMessage(1); + }; +} else { + /* istanbul ignore next */ + macroTimerFunc = function () { + setTimeout(flushCallbacks, 0); + }; +} + +// Determine microtask defer implementation. +/* istanbul ignore next, $flow-disable-line */ +if (typeof Promise !== 'undefined' && isNative(Promise)) { + var p = Promise.resolve(); + microTimerFunc = function () { + p.then(flushCallbacks); + // in problematic UIWebViews, Promise.then doesn't completely break, but + // it can get stuck in a weird state where callbacks are pushed into the + // microtask queue but the queue isn't being flushed, until the browser + // needs to do some other work, e.g. handle a timer. Therefore we can + // "force" the microtask queue to be flushed by adding an empty timer. + if (isIOS) { setTimeout(noop); } + }; +} else { + // fallback to macro + microTimerFunc = macroTimerFunc; +} + +/** + * Wrap a function so that if any code inside triggers state change, + * the changes are queued using a (macro) task instead of a microtask. + */ +function withMacroTask (fn) { + return fn._withTask || (fn._withTask = function () { + useMacroTask = true; + try { + return fn.apply(null, arguments) + } finally { + useMacroTask = false; + } + }) +} + +function nextTick (cb, ctx) { + var _resolve; + callbacks.push(function () { + if (cb) { + try { + cb.call(ctx); + } catch (e) { + handleError(e, ctx, 'nextTick'); + } + } else if (_resolve) { + _resolve(ctx); + } + }); + if (!pending) { + pending = true; + if (useMacroTask) { + macroTimerFunc(); + } else { + microTimerFunc(); + } + } + // $flow-disable-line + if (!cb && typeof Promise !== 'undefined') { + return new Promise(function (resolve) { + _resolve = resolve; + }) + } +} + +/* */ + +var mark; +var measure; + +if (true) { + var perf = inBrowser && window.performance; + /* istanbul ignore if */ + if ( + perf && + perf.mark && + perf.measure && + perf.clearMarks && + perf.clearMeasures + ) { + mark = function (tag) { return perf.mark(tag); }; + measure = function (name, startTag, endTag) { + perf.measure(name, startTag, endTag); + perf.clearMarks(startTag); + perf.clearMarks(endTag); + perf.clearMeasures(name); + }; + } +} + +/* not type checking this file because flow doesn't play well with Proxy */ + +var initProxy; + +if (true) { + var allowedGlobals = makeMap( + 'Infinity,undefined,NaN,isFinite,isNaN,' + + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + + 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + + 'require' // for Webpack/Browserify + ); + + var warnNonPresent = function (target, key) { + warn( + "Property or method \"" + key + "\" is not defined on the instance but " + + 'referenced during render. Make sure that this property is reactive, ' + + 'either in the data option, or for class-based components, by ' + + 'initializing the property. ' + + 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', + target + ); + }; + + var warnReservedPrefix = function (target, key) { + warn( + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + + 'prevent conflicts with Vue internals' + + 'See: https://vuejs.org/v2/api/#data', + target + ); + }; + + var hasProxy = + typeof Proxy !== 'undefined' && isNative(Proxy); + + if (hasProxy) { + var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); + config.keyCodes = new Proxy(config.keyCodes, { + set: function set (target, key, value) { + if (isBuiltInModifier(key)) { + warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); + return false + } else { + target[key] = value; + return true + } + } + }); + } + + var hasHandler = { + has: function has (target, key) { + var has = key in target; + var isAllowed = allowedGlobals(key) || + (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); + if (!has && !isAllowed) { + if (key in target.$data) { warnReservedPrefix(target, key); } + else { warnNonPresent(target, key); } + } + return has || !isAllowed + } + }; + + var getHandler = { + get: function get (target, key) { + if (typeof key === 'string' && !(key in target)) { + if (key in target.$data) { warnReservedPrefix(target, key); } + else { warnNonPresent(target, key); } + } + return target[key] + } + }; + + initProxy = function initProxy (vm) { + if (hasProxy) { + // determine which proxy handler to use + var options = vm.$options; + var handlers = options.render && options.render._withStripped + ? getHandler + : hasHandler; + vm._renderProxy = new Proxy(vm, handlers); + } else { + vm._renderProxy = vm; + } + }; +} + +/* */ + +var seenObjects = new _Set(); + +/** + * Recursively traverse an object to evoke all converted + * getters, so that every nested property inside the object + * is collected as a "deep" dependency. + */ +function traverse (val) { + _traverse(val, seenObjects); + seenObjects.clear(); +} + +function _traverse (val, seen) { + var i, keys; + var isA = Array.isArray(val); + if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { + return + } + if (val.__ob__) { + var depId = val.__ob__.dep.id; + if (seen.has(depId)) { + return + } + seen.add(depId); + } + if (isA) { + i = val.length; + while (i--) { _traverse(val[i], seen); } + } else { + keys = Object.keys(val); + i = keys.length; + while (i--) { _traverse(val[keys[i]], seen); } + } +} + +/* */ + +var normalizeEvent = cached(function (name) { + var passive = name.charAt(0) === '&'; + name = passive ? name.slice(1) : name; + var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first + name = once$$1 ? name.slice(1) : name; + var capture = name.charAt(0) === '!'; + name = capture ? name.slice(1) : name; + return { + name: name, + once: once$$1, + capture: capture, + passive: passive + } +}); + +function createFnInvoker (fns) { + function invoker () { + var arguments$1 = arguments; + + var fns = invoker.fns; + if (Array.isArray(fns)) { + var cloned = fns.slice(); + for (var i = 0; i < cloned.length; i++) { + cloned[i].apply(null, arguments$1); + } + } else { + // return handler return value for single handlers + return fns.apply(null, arguments) + } + } + invoker.fns = fns; + return invoker +} + +function updateListeners ( + on, + oldOn, + add, + remove$$1, + createOnceHandler, + vm +) { + var name, def$$1, cur, old, event; + for (name in on) { + def$$1 = cur = on[name]; + old = oldOn[name]; + event = normalizeEvent(name); + if (isUndef(cur)) { + true && warn( + "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), + vm + ); + } else if (isUndef(old)) { + if (isUndef(cur.fns)) { + cur = on[name] = createFnInvoker(cur); + } + if (isTrue(event.once)) { + cur = on[name] = createOnceHandler(event.name, cur, event.capture); + } + add(event.name, cur, event.capture, event.passive, event.params); + } else if (cur !== old) { + old.fns = cur; + on[name] = old; + } + } + for (name in oldOn) { + if (isUndef(on[name])) { + event = normalizeEvent(name); + remove$$1(event.name, oldOn[name], event.capture); + } + } +} + +/* */ + +function mergeVNodeHook (def, hookKey, hook) { + if (def instanceof VNode) { + def = def.data.hook || (def.data.hook = {}); + } + var invoker; + var oldHook = def[hookKey]; + + function wrappedHook () { + hook.apply(this, arguments); + // important: remove merged hook to ensure it's called only once + // and prevent memory leak + remove(invoker.fns, wrappedHook); + } + + if (isUndef(oldHook)) { + // no existing hook + invoker = createFnInvoker([wrappedHook]); + } else { + /* istanbul ignore if */ + if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { + // already a merged invoker + invoker = oldHook; + invoker.fns.push(wrappedHook); + } else { + // existing plain hook + invoker = createFnInvoker([oldHook, wrappedHook]); + } + } + + invoker.merged = true; + def[hookKey] = invoker; +} + +/* */ + +function extractPropsFromVNodeData ( + data, + Ctor, + tag +) { + // we are only extracting raw values here. + // validation and default values are handled in the child + // component itself. + var propOptions = Ctor.options.props; + if (isUndef(propOptions)) { + return + } + var res = {}; + var attrs = data.attrs; + var props = data.props; + if (isDef(attrs) || isDef(props)) { + for (var key in propOptions) { + var altKey = hyphenate(key); + if (true) { + var keyInLowerCase = key.toLowerCase(); + if ( + key !== keyInLowerCase && + attrs && hasOwn(attrs, keyInLowerCase) + ) { + tip( + "Prop \"" + keyInLowerCase + "\" is passed to component " + + (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + + " \"" + key + "\". " + + "Note that HTML attributes are case-insensitive and camelCased " + + "props need to use their kebab-case equivalents when using in-DOM " + + "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." + ); + } + } + checkProp(res, props, key, altKey, true) || + checkProp(res, attrs, key, altKey, false); + } + } + return res +} + +function checkProp ( + res, + hash, + key, + altKey, + preserve +) { + if (isDef(hash)) { + if (hasOwn(hash, key)) { + res[key] = hash[key]; + if (!preserve) { + delete hash[key]; + } + return true + } else if (hasOwn(hash, altKey)) { + res[key] = hash[altKey]; + if (!preserve) { + delete hash[altKey]; + } + return true + } + } + return false +} + +/* */ + +// The template compiler attempts to minimize the need for normalization by +// statically analyzing the template at compile time. +// +// For plain HTML markup, normalization can be completely skipped because the +// generated render function is guaranteed to return Array<VNode>. There are +// two cases where extra normalization is needed: + +// 1. When the children contains components - because a functional component +// may return an Array instead of a single root. In this case, just a simple +// normalization is needed - if any child is an Array, we flatten the whole +// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep +// because functional components already normalize their own children. +function simpleNormalizeChildren (children) { + for (var i = 0; i < children.length; i++) { + if (Array.isArray(children[i])) { + return Array.prototype.concat.apply([], children) + } + } + return children +} + +// 2. When the children contains constructs that always generated nested Arrays, +// e.g. <template>, <slot>, v-for, or when the children is provided by user +// with hand-written render functions / JSX. In such cases a full normalization +// is needed to cater to all possible types of children values. +function normalizeChildren (children) { + return isPrimitive(children) + ? [createTextVNode(children)] + : Array.isArray(children) + ? normalizeArrayChildren(children) + : undefined +} + +function isTextNode (node) { + return isDef(node) && isDef(node.text) && isFalse(node.isComment) +} + +function normalizeArrayChildren (children, nestedIndex) { + var res = []; + var i, c, lastIndex, last; + for (i = 0; i < children.length; i++) { + c = children[i]; + if (isUndef(c) || typeof c === 'boolean') { continue } + lastIndex = res.length - 1; + last = res[lastIndex]; + // nested + if (Array.isArray(c)) { + if (c.length > 0) { + c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)); + // merge adjacent text nodes + if (isTextNode(c[0]) && isTextNode(last)) { + res[lastIndex] = createTextVNode(last.text + (c[0]).text); + c.shift(); + } + res.push.apply(res, c); + } + } else if (isPrimitive(c)) { + if (isTextNode(last)) { + // merge adjacent text nodes + // this is necessary for SSR hydration because text nodes are + // essentially merged when rendered to HTML strings + res[lastIndex] = createTextVNode(last.text + c); + } else if (c !== '') { + // convert primitive to vnode + res.push(createTextVNode(c)); + } + } else { + if (isTextNode(c) && isTextNode(last)) { + // merge adjacent text nodes + res[lastIndex] = createTextVNode(last.text + c.text); + } else { + // default key for nested array children (likely generated by v-for) + if (isTrue(children._isVList) && + isDef(c.tag) && + isUndef(c.key) && + isDef(nestedIndex)) { + c.key = "__vlist" + nestedIndex + "_" + i + "__"; + } + res.push(c); + } + } + } + return res +} + +/* */ + +function ensureCtor (comp, base) { + if ( + comp.__esModule || + (hasSymbol && comp[Symbol.toStringTag] === 'Module') + ) { + comp = comp.default; + } + return isObject(comp) + ? base.extend(comp) + : comp +} + +function createAsyncPlaceholder ( + factory, + data, + context, + children, + tag +) { + var node = createEmptyVNode(); + node.asyncFactory = factory; + node.asyncMeta = { data: data, context: context, children: children, tag: tag }; + return node +} + +function resolveAsyncComponent ( + factory, + baseCtor, + context +) { + if (isTrue(factory.error) && isDef(factory.errorComp)) { + return factory.errorComp + } + + if (isDef(factory.resolved)) { + return factory.resolved + } + + if (isTrue(factory.loading) && isDef(factory.loadingComp)) { + return factory.loadingComp + } + + if (isDef(factory.contexts)) { + // already pending + factory.contexts.push(context); + } else { + var contexts = factory.contexts = [context]; + var sync = true; + + var forceRender = function (renderCompleted) { + for (var i = 0, l = contexts.length; i < l; i++) { + contexts[i].$forceUpdate(); + } + + if (renderCompleted) { + contexts.length = 0; + } + }; + + var resolve = once(function (res) { + // cache resolved + factory.resolved = ensureCtor(res, baseCtor); + // invoke callbacks only if this is not a synchronous resolve + // (async resolves are shimmed as synchronous during SSR) + if (!sync) { + forceRender(true); + } + }); + + var reject = once(function (reason) { + true && warn( + "Failed to resolve async component: " + (String(factory)) + + (reason ? ("\nReason: " + reason) : '') + ); + if (isDef(factory.errorComp)) { + factory.error = true; + forceRender(true); + } + }); + + var res = factory(resolve, reject); + + if (isObject(res)) { + if (typeof res.then === 'function') { + // () => Promise + if (isUndef(factory.resolved)) { + res.then(resolve, reject); + } + } else if (isDef(res.component) && typeof res.component.then === 'function') { + res.component.then(resolve, reject); + + if (isDef(res.error)) { + factory.errorComp = ensureCtor(res.error, baseCtor); + } + + if (isDef(res.loading)) { + factory.loadingComp = ensureCtor(res.loading, baseCtor); + if (res.delay === 0) { + factory.loading = true; + } else { + setTimeout(function () { + if (isUndef(factory.resolved) && isUndef(factory.error)) { + factory.loading = true; + forceRender(false); + } + }, res.delay || 200); + } + } + + if (isDef(res.timeout)) { + setTimeout(function () { + if (isUndef(factory.resolved)) { + reject( + true + ? ("timeout (" + (res.timeout) + "ms)") + : undefined + ); + } + }, res.timeout); + } + } + } + + sync = false; + // return in case resolved synchronously + return factory.loading + ? factory.loadingComp + : factory.resolved + } +} + +/* */ + +function isAsyncPlaceholder (node) { + return node.isComment && node.asyncFactory +} + +/* */ + +function getFirstComponentChild (children) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + var c = children[i]; + if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { + return c + } + } + } +} + +/* */ + +/* */ + +function initEvents (vm) { + vm._events = Object.create(null); + vm._hasHookEvent = false; + // init parent attached events + var listeners = vm.$options._parentListeners; + if (listeners) { + updateComponentListeners(vm, listeners); + } +} + +var target; + +function add (event, fn) { + target.$on(event, fn); +} + +function remove$1 (event, fn) { + target.$off(event, fn); +} + +function createOnceHandler (event, fn) { + var _target = target; + return function onceHandler () { + var res = fn.apply(null, arguments); + if (res !== null) { + _target.$off(event, onceHandler); + } + } +} + +function updateComponentListeners ( + vm, + listeners, + oldListeners +) { + target = vm; + updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm); + target = undefined; +} + +function eventsMixin (Vue) { + var hookRE = /^hook:/; + Vue.prototype.$on = function (event, fn) { + var vm = this; + if (Array.isArray(event)) { + for (var i = 0, l = event.length; i < l; i++) { + vm.$on(event[i], fn); + } + } else { + (vm._events[event] || (vm._events[event] = [])).push(fn); + // optimize hook:event cost by using a boolean flag marked at registration + // instead of a hash lookup + if (hookRE.test(event)) { + vm._hasHookEvent = true; + } + } + return vm + }; + + Vue.prototype.$once = function (event, fn) { + var vm = this; + function on () { + vm.$off(event, on); + fn.apply(vm, arguments); + } + on.fn = fn; + vm.$on(event, on); + return vm + }; + + Vue.prototype.$off = function (event, fn) { + var vm = this; + // all + if (!arguments.length) { + vm._events = Object.create(null); + return vm + } + // array of events + if (Array.isArray(event)) { + for (var i = 0, l = event.length; i < l; i++) { + vm.$off(event[i], fn); + } + return vm + } + // specific event + var cbs = vm._events[event]; + if (!cbs) { + return vm + } + if (!fn) { + vm._events[event] = null; + return vm + } + if (fn) { + // specific handler + var cb; + var i$1 = cbs.length; + while (i$1--) { + cb = cbs[i$1]; + if (cb === fn || cb.fn === fn) { + cbs.splice(i$1, 1); + break + } + } + } + return vm + }; + + Vue.prototype.$emit = function (event) { + var vm = this; + if (true) { + var lowerCaseEvent = event.toLowerCase(); + if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { + tip( + "Event \"" + lowerCaseEvent + "\" is emitted in component " + + (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " + + "Note that HTML attributes are case-insensitive and you cannot use " + + "v-on to listen to camelCase events when using in-DOM templates. " + + "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"." + ); + } + } + var cbs = vm._events[event]; + if (cbs) { + cbs = cbs.length > 1 ? toArray(cbs) : cbs; + var args = toArray(arguments, 1); + for (var i = 0, l = cbs.length; i < l; i++) { + try { + cbs[i].apply(vm, args); + } catch (e) { + handleError(e, vm, ("event handler for \"" + event + "\"")); + } + } + } + return vm + }; +} + +/* */ + + + +/** + * Runtime helper for resolving raw children VNodes into a slot object. + */ +function resolveSlots ( + children, + context +) { + var slots = {}; + if (!children) { + return slots + } + for (var i = 0, l = children.length; i < l; i++) { + var child = children[i]; + var data = child.data; + // remove slot attribute if the node is resolved as a Vue slot node + if (data && data.attrs && data.attrs.slot) { + delete data.attrs.slot; + } + // named slots should only be respected if the vnode was rendered in the + // same context. + if ((child.context === context || child.fnContext === context) && + data && data.slot != null + ) { + var name = data.slot; + var slot = (slots[name] || (slots[name] = [])); + if (child.tag === 'template') { + slot.push.apply(slot, child.children || []); + } else { + slot.push(child); + } + } else { + (slots.default || (slots.default = [])).push(child); + } + } + // ignore slots that contains only whitespace + for (var name$1 in slots) { + if (slots[name$1].every(isWhitespace)) { + delete slots[name$1]; + } + } + return slots +} + +function isWhitespace (node) { + return (node.isComment && !node.asyncFactory) || node.text === ' ' +} + +function resolveScopedSlots ( + fns, // see flow/vnode + res +) { + res = res || {}; + for (var i = 0; i < fns.length; i++) { + if (Array.isArray(fns[i])) { + resolveScopedSlots(fns[i], res); + } else { + res[fns[i].key] = fns[i].fn; + } + } + return res +} + +/* */ + +var activeInstance = null; +var isUpdatingChildComponent = false; + +function setActiveInstance(vm) { + var prevActiveInstance = activeInstance; + activeInstance = vm; + return function () { + activeInstance = prevActiveInstance; + } +} + +function initLifecycle (vm) { + var options = vm.$options; + + // locate first non-abstract parent + var parent = options.parent; + if (parent && !options.abstract) { + while (parent.$options.abstract && parent.$parent) { + parent = parent.$parent; + } + parent.$children.push(vm); + } + + vm.$parent = parent; + vm.$root = parent ? parent.$root : vm; + + vm.$children = []; + vm.$refs = {}; + + vm._watcher = null; + vm._inactive = null; + vm._directInactive = false; + vm._isMounted = false; + vm._isDestroyed = false; + vm._isBeingDestroyed = false; +} + +function lifecycleMixin (Vue) { + Vue.prototype._update = function (vnode, hydrating) { + var vm = this; + var prevEl = vm.$el; + var prevVnode = vm._vnode; + var restoreActiveInstance = setActiveInstance(vm); + vm._vnode = vnode; + // Vue.prototype.__patch__ is injected in entry points + // based on the rendering backend used. + if (!prevVnode) { + // initial render + vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */); + } else { + // updates + vm.$el = vm.__patch__(prevVnode, vnode); + } + restoreActiveInstance(); + // update __vue__ reference + if (prevEl) { + prevEl.__vue__ = null; + } + if (vm.$el) { + vm.$el.__vue__ = vm; + } + // if parent is an HOC, update its $el as well + if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { + vm.$parent.$el = vm.$el; + } + // updated hook is called by the scheduler to ensure that children are + // updated in a parent's updated hook. + }; + + Vue.prototype.$forceUpdate = function () { + var vm = this; + if (vm._watcher) { + vm._watcher.update(); + } + }; + + Vue.prototype.$destroy = function () { + var vm = this; + if (vm._isBeingDestroyed) { + return + } + callHook(vm, 'beforeDestroy'); + vm._isBeingDestroyed = true; + // remove self from parent + var parent = vm.$parent; + if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { + remove(parent.$children, vm); + } + // teardown watchers + if (vm._watcher) { + vm._watcher.teardown(); + } + var i = vm._watchers.length; + while (i--) { + vm._watchers[i].teardown(); + } + // remove reference from data ob + // frozen object may not have observer. + if (vm._data.__ob__) { + vm._data.__ob__.vmCount--; + } + // call the last hook... + vm._isDestroyed = true; + // invoke destroy hooks on current rendered tree + vm.__patch__(vm._vnode, null); + // fire destroyed hook + callHook(vm, 'destroyed'); + // turn off all instance listeners. + vm.$off(); + // remove __vue__ reference + if (vm.$el) { + vm.$el.__vue__ = null; + } + // release circular reference (#6759) + if (vm.$vnode) { + vm.$vnode.parent = null; + } + }; +} + +function mountComponent ( + vm, + el, + hydrating +) { + vm.$el = el; + if (!vm.$options.render) { + vm.$options.render = createEmptyVNode; + if (true) { + /* istanbul ignore if */ + if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || + vm.$options.el || el) { + warn( + 'You are using the runtime-only build of Vue where the template ' + + 'compiler is not available. Either pre-compile the templates into ' + + 'render functions, or use the compiler-included build.', + vm + ); + } else { + warn( + 'Failed to mount component: template or render function not defined.', + vm + ); + } + } + } + callHook(vm, 'beforeMount'); + + var updateComponent; + /* istanbul ignore if */ + if ( true && config.performance && mark) { + updateComponent = function () { + var name = vm._name; + var id = vm._uid; + var startTag = "vue-perf-start:" + id; + var endTag = "vue-perf-end:" + id; + + mark(startTag); + var vnode = vm._render(); + mark(endTag); + measure(("vue " + name + " render"), startTag, endTag); + + mark(startTag); + vm._update(vnode, hydrating); + mark(endTag); + measure(("vue " + name + " patch"), startTag, endTag); + }; + } else { + updateComponent = function () { + vm._update(vm._render(), hydrating); + }; + } + + // we set this to vm._watcher inside the watcher's constructor + // since the watcher's initial patch may call $forceUpdate (e.g. inside child + // component's mounted hook), which relies on vm._watcher being already defined + new Watcher(vm, updateComponent, noop, { + before: function before () { + if (vm._isMounted && !vm._isDestroyed) { + callHook(vm, 'beforeUpdate'); + } + } + }, true /* isRenderWatcher */); + hydrating = false; + + // manually mounted instance, call mounted on self + // mounted is called for render-created child components in its inserted hook + if (vm.$vnode == null) { + vm._isMounted = true; + callHook(vm, 'mounted'); + } + return vm +} + +function updateChildComponent ( + vm, + propsData, + listeners, + parentVnode, + renderChildren +) { + if (true) { + isUpdatingChildComponent = true; + } + + // determine whether component has slot children + // we need to do this before overwriting $options._renderChildren + var hasChildren = !!( + renderChildren || // has new static slots + vm.$options._renderChildren || // has old static slots + parentVnode.data.scopedSlots || // has new scoped slots + vm.$scopedSlots !== emptyObject // has old scoped slots + ); + + vm.$options._parentVnode = parentVnode; + vm.$vnode = parentVnode; // update vm's placeholder node without re-render + + if (vm._vnode) { // update child tree's parent + vm._vnode.parent = parentVnode; + } + vm.$options._renderChildren = renderChildren; + + // update $attrs and $listeners hash + // these are also reactive so they may trigger child update if the child + // used them during render + vm.$attrs = parentVnode.data.attrs || emptyObject; + vm.$listeners = listeners || emptyObject; + + // update props + if (propsData && vm.$options.props) { + toggleObserving(false); + var props = vm._props; + var propKeys = vm.$options._propKeys || []; + for (var i = 0; i < propKeys.length; i++) { + var key = propKeys[i]; + var propOptions = vm.$options.props; // wtf flow? + props[key] = validateProp(key, propOptions, propsData, vm); + } + toggleObserving(true); + // keep a copy of raw propsData + vm.$options.propsData = propsData; + } + + // update listeners + listeners = listeners || emptyObject; + var oldListeners = vm.$options._parentListeners; + vm.$options._parentListeners = listeners; + updateComponentListeners(vm, listeners, oldListeners); + + // resolve slots + force update if has children + if (hasChildren) { + vm.$slots = resolveSlots(renderChildren, parentVnode.context); + vm.$forceUpdate(); + } + + if (true) { + isUpdatingChildComponent = false; + } +} + +function isInInactiveTree (vm) { + while (vm && (vm = vm.$parent)) { + if (vm._inactive) { return true } + } + return false +} + +function activateChildComponent (vm, direct) { + if (direct) { + vm._directInactive = false; + if (isInInactiveTree(vm)) { + return + } + } else if (vm._directInactive) { + return + } + if (vm._inactive || vm._inactive === null) { + vm._inactive = false; + for (var i = 0; i < vm.$children.length; i++) { + activateChildComponent(vm.$children[i]); + } + callHook(vm, 'activated'); + } +} + +function deactivateChildComponent (vm, direct) { + if (direct) { + vm._directInactive = true; + if (isInInactiveTree(vm)) { + return + } + } + if (!vm._inactive) { + vm._inactive = true; + for (var i = 0; i < vm.$children.length; i++) { + deactivateChildComponent(vm.$children[i]); + } + callHook(vm, 'deactivated'); + } +} + +function callHook (vm, hook) { + // #7573 disable dep collection when invoking lifecycle hooks + pushTarget(); + var handlers = vm.$options[hook]; + if (handlers) { + for (var i = 0, j = handlers.length; i < j; i++) { + try { + handlers[i].call(vm); + } catch (e) { + handleError(e, vm, (hook + " hook")); + } + } + } + if (vm._hasHookEvent) { + vm.$emit('hook:' + hook); + } + popTarget(); +} + +/* */ + +var MAX_UPDATE_COUNT = 100; + +var queue = []; +var activatedChildren = []; +var has = {}; +var circular = {}; +var waiting = false; +var flushing = false; +var index = 0; + +/** + * Reset the scheduler's state. + */ +function resetSchedulerState () { + index = queue.length = activatedChildren.length = 0; + has = {}; + if (true) { + circular = {}; + } + waiting = flushing = false; +} + +/** + * Flush both queues and run the watchers. + */ +function flushSchedulerQueue () { + flushing = true; + var watcher, id; + + // Sort queue before flush. + // This ensures that: + // 1. Components are updated from parent to child. (because parent is always + // created before the child) + // 2. A component's user watchers are run before its render watcher (because + // user watchers are created before the render watcher) + // 3. If a component is destroyed during a parent component's watcher run, + // its watchers can be skipped. + queue.sort(function (a, b) { return a.id - b.id; }); + + // do not cache length because more watchers might be pushed + // as we run existing watchers + for (index = 0; index < queue.length; index++) { + watcher = queue[index]; + if (watcher.before) { + watcher.before(); + } + id = watcher.id; + has[id] = null; + watcher.run(); + // in dev build, check and stop circular updates. + if ( true && has[id] != null) { + circular[id] = (circular[id] || 0) + 1; + if (circular[id] > MAX_UPDATE_COUNT) { + warn( + 'You may have an infinite update loop ' + ( + watcher.user + ? ("in watcher with expression \"" + (watcher.expression) + "\"") + : "in a component render function." + ), + watcher.vm + ); + break + } + } + } + + // keep copies of post queues before resetting state + var activatedQueue = activatedChildren.slice(); + var updatedQueue = queue.slice(); + + resetSchedulerState(); + + // call component updated and activated hooks + callActivatedHooks(activatedQueue); + callUpdatedHooks(updatedQueue); + + // devtool hook + /* istanbul ignore if */ + if (devtools && config.devtools) { + devtools.emit('flush'); + } +} + +function callUpdatedHooks (queue) { + var i = queue.length; + while (i--) { + var watcher = queue[i]; + var vm = watcher.vm; + if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) { + callHook(vm, 'updated'); + } + } +} + +/** + * Queue a kept-alive component that was activated during patch. + * The queue will be processed after the entire tree has been patched. + */ +function queueActivatedComponent (vm) { + // setting _inactive to false here so that a render function can + // rely on checking whether it's in an inactive tree (e.g. router-view) + vm._inactive = false; + activatedChildren.push(vm); +} + +function callActivatedHooks (queue) { + for (var i = 0; i < queue.length; i++) { + queue[i]._inactive = true; + activateChildComponent(queue[i], true /* true */); + } +} + +/** + * Push a watcher into the watcher queue. + * Jobs with duplicate IDs will be skipped unless it's + * pushed when the queue is being flushed. + */ +function queueWatcher (watcher) { + var id = watcher.id; + if (has[id] == null) { + has[id] = true; + if (!flushing) { + queue.push(watcher); + } else { + // if already flushing, splice the watcher based on its id + // if already past its id, it will be run next immediately. + var i = queue.length - 1; + while (i > index && queue[i].id > watcher.id) { + i--; + } + queue.splice(i + 1, 0, watcher); + } + // queue the flush + if (!waiting) { + waiting = true; + + if ( true && !config.async) { + flushSchedulerQueue(); + return + } + nextTick(flushSchedulerQueue); + } + } +} + +/* */ + + + +var uid$1 = 0; + +/** + * A watcher parses an expression, collects dependencies, + * and fires callback when the expression value changes. + * This is used for both the $watch() api and directives. + */ +var Watcher = function Watcher ( + vm, + expOrFn, + cb, + options, + isRenderWatcher +) { + this.vm = vm; + if (isRenderWatcher) { + vm._watcher = this; + } + vm._watchers.push(this); + // options + if (options) { + this.deep = !!options.deep; + this.user = !!options.user; + this.lazy = !!options.lazy; + this.sync = !!options.sync; + this.before = options.before; + } else { + this.deep = this.user = this.lazy = this.sync = false; + } + this.cb = cb; + this.id = ++uid$1; // uid for batching + this.active = true; + this.dirty = this.lazy; // for lazy watchers + this.deps = []; + this.newDeps = []; + this.depIds = new _Set(); + this.newDepIds = new _Set(); + this.expression = true + ? expOrFn.toString() + : undefined; + // parse expression for getter + if (typeof expOrFn === 'function') { + this.getter = expOrFn; + } else { + this.getter = parsePath(expOrFn); + if (!this.getter) { + this.getter = noop; + true && warn( + "Failed watching path: \"" + expOrFn + "\" " + + 'Watcher only accepts simple dot-delimited paths. ' + + 'For full control, use a function instead.', + vm + ); + } + } + this.value = this.lazy + ? undefined + : this.get(); +}; + +/** + * Evaluate the getter, and re-collect dependencies. + */ +Watcher.prototype.get = function get () { + pushTarget(this); + var value; + var vm = this.vm; + try { + value = this.getter.call(vm, vm); + } catch (e) { + if (this.user) { + handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); + } else { + throw e + } + } finally { + // "touch" every property so they are all tracked as + // dependencies for deep watching + if (this.deep) { + traverse(value); + } + popTarget(); + this.cleanupDeps(); + } + return value +}; + +/** + * Add a dependency to this directive. + */ +Watcher.prototype.addDep = function addDep (dep) { + var id = dep.id; + if (!this.newDepIds.has(id)) { + this.newDepIds.add(id); + this.newDeps.push(dep); + if (!this.depIds.has(id)) { + dep.addSub(this); + } + } +}; + +/** + * Clean up for dependency collection. + */ +Watcher.prototype.cleanupDeps = function cleanupDeps () { + var i = this.deps.length; + while (i--) { + var dep = this.deps[i]; + if (!this.newDepIds.has(dep.id)) { + dep.removeSub(this); + } + } + var tmp = this.depIds; + this.depIds = this.newDepIds; + this.newDepIds = tmp; + this.newDepIds.clear(); + tmp = this.deps; + this.deps = this.newDeps; + this.newDeps = tmp; + this.newDeps.length = 0; +}; + +/** + * Subscriber interface. + * Will be called when a dependency changes. + */ +Watcher.prototype.update = function update () { + /* istanbul ignore else */ + if (this.lazy) { + this.dirty = true; + } else if (this.sync) { + this.run(); + } else { + queueWatcher(this); + } +}; + +/** + * Scheduler job interface. + * Will be called by the scheduler. + */ +Watcher.prototype.run = function run () { + if (this.active) { + var value = this.get(); + if ( + value !== this.value || + // Deep watchers and watchers on Object/Arrays should fire even + // when the value is the same, because the value may + // have mutated. + isObject(value) || + this.deep + ) { + // set new value + var oldValue = this.value; + this.value = value; + if (this.user) { + try { + this.cb.call(this.vm, value, oldValue); + } catch (e) { + handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\"")); + } + } else { + this.cb.call(this.vm, value, oldValue); + } + } + } +}; + +/** + * Evaluate the value of the watcher. + * This only gets called for lazy watchers. + */ +Watcher.prototype.evaluate = function evaluate () { + this.value = this.get(); + this.dirty = false; +}; + +/** + * Depend on all deps collected by this watcher. + */ +Watcher.prototype.depend = function depend () { + var i = this.deps.length; + while (i--) { + this.deps[i].depend(); + } +}; + +/** + * Remove self from all dependencies' subscriber list. + */ +Watcher.prototype.teardown = function teardown () { + if (this.active) { + // remove self from vm's watcher list + // this is a somewhat expensive operation so we skip it + // if the vm is being destroyed. + if (!this.vm._isBeingDestroyed) { + remove(this.vm._watchers, this); + } + var i = this.deps.length; + while (i--) { + this.deps[i].removeSub(this); + } + this.active = false; + } +}; + +/* */ + +var sharedPropertyDefinition = { + enumerable: true, + configurable: true, + get: noop, + set: noop +}; + +function proxy (target, sourceKey, key) { + sharedPropertyDefinition.get = function proxyGetter () { + return this[sourceKey][key] + }; + sharedPropertyDefinition.set = function proxySetter (val) { + this[sourceKey][key] = val; + }; + Object.defineProperty(target, key, sharedPropertyDefinition); +} + +function initState (vm) { + vm._watchers = []; + var opts = vm.$options; + if (opts.props) { initProps(vm, opts.props); } + if (opts.methods) { initMethods(vm, opts.methods); } + if (opts.data) { + initData(vm); + } else { + observe(vm._data = {}, true /* asRootData */); + } + if (opts.computed) { initComputed(vm, opts.computed); } + if (opts.watch && opts.watch !== nativeWatch) { + initWatch(vm, opts.watch); + } +} + +function initProps (vm, propsOptions) { + var propsData = vm.$options.propsData || {}; + var props = vm._props = {}; + // cache prop keys so that future props updates can iterate using Array + // instead of dynamic object key enumeration. + var keys = vm.$options._propKeys = []; + var isRoot = !vm.$parent; + // root instance props should be converted + if (!isRoot) { + toggleObserving(false); + } + var loop = function ( key ) { + keys.push(key); + var value = validateProp(key, propsOptions, propsData, vm); + /* istanbul ignore else */ + if (true) { + var hyphenatedKey = hyphenate(key); + if (isReservedAttribute(hyphenatedKey) || + config.isReservedAttr(hyphenatedKey)) { + warn( + ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), + vm + ); + } + defineReactive$$1(props, key, value, function () { + if (!isRoot && !isUpdatingChildComponent) { + warn( + "Avoid mutating a prop directly since the value will be " + + "overwritten whenever the parent component re-renders. " + + "Instead, use a data or computed property based on the prop's " + + "value. Prop being mutated: \"" + key + "\"", + vm + ); + } + }); + } else {} + // static props are already proxied on the component's prototype + // during Vue.extend(). We only need to proxy props defined at + // instantiation here. + if (!(key in vm)) { + proxy(vm, "_props", key); + } + }; + + for (var key in propsOptions) loop( key ); + toggleObserving(true); +} + +function initData (vm) { + var data = vm.$options.data; + data = vm._data = typeof data === 'function' + ? getData(data, vm) + : data || {}; + if (!isPlainObject(data)) { + data = {}; + true && warn( + 'data functions should return an object:\n' + + 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', + vm + ); + } + // proxy data on instance + var keys = Object.keys(data); + var props = vm.$options.props; + var methods = vm.$options.methods; + var i = keys.length; + while (i--) { + var key = keys[i]; + if (true) { + if (methods && hasOwn(methods, key)) { + warn( + ("Method \"" + key + "\" has already been defined as a data property."), + vm + ); + } + } + if (props && hasOwn(props, key)) { + true && warn( + "The data property \"" + key + "\" is already declared as a prop. " + + "Use prop default value instead.", + vm + ); + } else if (!isReserved(key)) { + proxy(vm, "_data", key); + } + } + // observe data + observe(data, true /* asRootData */); +} + +function getData (data, vm) { + // #7573 disable dep collection when invoking data getters + pushTarget(); + try { + return data.call(vm, vm) + } catch (e) { + handleError(e, vm, "data()"); + return {} + } finally { + popTarget(); + } +} + +var computedWatcherOptions = { lazy: true }; + +function initComputed (vm, computed) { + // $flow-disable-line + var watchers = vm._computedWatchers = Object.create(null); + // computed properties are just getters during SSR + var isSSR = isServerRendering(); + + for (var key in computed) { + var userDef = computed[key]; + var getter = typeof userDef === 'function' ? userDef : userDef.get; + if ( true && getter == null) { + warn( + ("Getter is missing for computed property \"" + key + "\"."), + vm + ); + } + + if (!isSSR) { + // create internal watcher for the computed property. + watchers[key] = new Watcher( + vm, + getter || noop, + noop, + computedWatcherOptions + ); + } + + // component-defined computed properties are already defined on the + // component prototype. We only need to define computed properties defined + // at instantiation here. + if (!(key in vm)) { + defineComputed(vm, key, userDef); + } else if (true) { + if (key in vm.$data) { + warn(("The computed property \"" + key + "\" is already defined in data."), vm); + } else if (vm.$options.props && key in vm.$options.props) { + warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); + } + } + } +} + +function defineComputed ( + target, + key, + userDef +) { + var shouldCache = !isServerRendering(); + if (typeof userDef === 'function') { + sharedPropertyDefinition.get = shouldCache + ? createComputedGetter(key) + : createGetterInvoker(userDef); + sharedPropertyDefinition.set = noop; + } else { + sharedPropertyDefinition.get = userDef.get + ? shouldCache && userDef.cache !== false + ? createComputedGetter(key) + : createGetterInvoker(userDef.get) + : noop; + sharedPropertyDefinition.set = userDef.set || noop; + } + if ( true && + sharedPropertyDefinition.set === noop) { + sharedPropertyDefinition.set = function () { + warn( + ("Computed property \"" + key + "\" was assigned to but it has no setter."), + this + ); + }; + } + Object.defineProperty(target, key, sharedPropertyDefinition); +} + +function createComputedGetter (key) { + return function computedGetter () { + var watcher = this._computedWatchers && this._computedWatchers[key]; + if (watcher) { + if (watcher.dirty) { + watcher.evaluate(); + } + if (Dep.target) { + watcher.depend(); + } + return watcher.value + } + } +} + +function createGetterInvoker(fn) { + return function computedGetter () { + return fn.call(this, this) + } +} + +function initMethods (vm, methods) { + var props = vm.$options.props; + for (var key in methods) { + if (true) { + if (typeof methods[key] !== 'function') { + warn( + "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + + "Did you reference the function correctly?", + vm + ); + } + if (props && hasOwn(props, key)) { + warn( + ("Method \"" + key + "\" has already been defined as a prop."), + vm + ); + } + if ((key in vm) && isReserved(key)) { + warn( + "Method \"" + key + "\" conflicts with an existing Vue instance method. " + + "Avoid defining component methods that start with _ or $." + ); + } + } + vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); + } +} + +function initWatch (vm, watch) { + for (var key in watch) { + var handler = watch[key]; + if (Array.isArray(handler)) { + for (var i = 0; i < handler.length; i++) { + createWatcher(vm, key, handler[i]); + } + } else { + createWatcher(vm, key, handler); + } + } +} + +function createWatcher ( + vm, + expOrFn, + handler, + options +) { + if (isPlainObject(handler)) { + options = handler; + handler = handler.handler; + } + if (typeof handler === 'string') { + handler = vm[handler]; + } + return vm.$watch(expOrFn, handler, options) +} + +function stateMixin (Vue) { + // flow somehow has problems with directly declared definition object + // when using Object.defineProperty, so we have to procedurally build up + // the object here. + var dataDef = {}; + dataDef.get = function () { return this._data }; + var propsDef = {}; + propsDef.get = function () { return this._props }; + if (true) { + dataDef.set = function () { + warn( + 'Avoid replacing instance root $data. ' + + 'Use nested data properties instead.', + this + ); + }; + propsDef.set = function () { + warn("$props is readonly.", this); + }; + } + Object.defineProperty(Vue.prototype, '$data', dataDef); + Object.defineProperty(Vue.prototype, '$props', propsDef); + + Vue.prototype.$set = set; + Vue.prototype.$delete = del; + + Vue.prototype.$watch = function ( + expOrFn, + cb, + options + ) { + var vm = this; + if (isPlainObject(cb)) { + return createWatcher(vm, expOrFn, cb, options) + } + options = options || {}; + options.user = true; + var watcher = new Watcher(vm, expOrFn, cb, options); + if (options.immediate) { + try { + cb.call(vm, watcher.value); + } catch (error) { + handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\"")); + } + } + return function unwatchFn () { + watcher.teardown(); + } + }; +} + +/* */ + +function initProvide (vm) { + var provide = vm.$options.provide; + if (provide) { + vm._provided = typeof provide === 'function' + ? provide.call(vm) + : provide; + } +} + +function initInjections (vm) { + var result = resolveInject(vm.$options.inject, vm); + if (result) { + toggleObserving(false); + Object.keys(result).forEach(function (key) { + /* istanbul ignore else */ + if (true) { + defineReactive$$1(vm, key, result[key], function () { + warn( + "Avoid mutating an injected value directly since the changes will be " + + "overwritten whenever the provided component re-renders. " + + "injection being mutated: \"" + key + "\"", + vm + ); + }); + } else {} + }); + toggleObserving(true); + } +} + +function resolveInject (inject, vm) { + if (inject) { + // inject is :any because flow is not smart enough to figure out cached + var result = Object.create(null); + var keys = hasSymbol + ? Reflect.ownKeys(inject).filter(function (key) { + /* istanbul ignore next */ + return Object.getOwnPropertyDescriptor(inject, key).enumerable + }) + : Object.keys(inject); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var provideKey = inject[key].from; + var source = vm; + while (source) { + if (source._provided && hasOwn(source._provided, provideKey)) { + result[key] = source._provided[provideKey]; + break + } + source = source.$parent; + } + if (!source) { + if ('default' in inject[key]) { + var provideDefault = inject[key].default; + result[key] = typeof provideDefault === 'function' + ? provideDefault.call(vm) + : provideDefault; + } else if (true) { + warn(("Injection \"" + key + "\" not found"), vm); + } + } + } + return result + } +} + +/* */ + +/** + * Runtime helper for rendering v-for lists. + */ +function renderList ( + val, + render +) { + var ret, i, l, keys, key; + if (Array.isArray(val) || typeof val === 'string') { + ret = new Array(val.length); + for (i = 0, l = val.length; i < l; i++) { + ret[i] = render(val[i], i); + } + } else if (typeof val === 'number') { + ret = new Array(val); + for (i = 0; i < val; i++) { + ret[i] = render(i + 1, i); + } + } else if (isObject(val)) { + keys = Object.keys(val); + ret = new Array(keys.length); + for (i = 0, l = keys.length; i < l; i++) { + key = keys[i]; + ret[i] = render(val[key], key, i); + } + } + if (!isDef(ret)) { + ret = []; + } + (ret)._isVList = true; + return ret +} + +/* */ + +/** + * Runtime helper for rendering <slot> + */ +function renderSlot ( + name, + fallback, + props, + bindObject +) { + var scopedSlotFn = this.$scopedSlots[name]; + var nodes; + if (scopedSlotFn) { // scoped slot + props = props || {}; + if (bindObject) { + if ( true && !isObject(bindObject)) { + warn( + 'slot v-bind without argument expects an Object', + this + ); + } + props = extend(extend({}, bindObject), props); + } + nodes = scopedSlotFn(props) || fallback; + } else { + nodes = this.$slots[name] || fallback; + } + + var target = props && props.slot; + if (target) { + return this.$createElement('template', { slot: target }, nodes) + } else { + return nodes + } +} + +/* */ + +/** + * Runtime helper for resolving filters + */ +function resolveFilter (id) { + return resolveAsset(this.$options, 'filters', id, true) || identity +} + +/* */ + +function isKeyNotMatch (expect, actual) { + if (Array.isArray(expect)) { + return expect.indexOf(actual) === -1 + } else { + return expect !== actual + } +} + +/** + * Runtime helper for checking keyCodes from config. + * exposed as Vue.prototype._k + * passing in eventKeyName as last argument separately for backwards compat + */ +function checkKeyCodes ( + eventKeyCode, + key, + builtInKeyCode, + eventKeyName, + builtInKeyName +) { + var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; + if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { + return isKeyNotMatch(builtInKeyName, eventKeyName) + } else if (mappedKeyCode) { + return isKeyNotMatch(mappedKeyCode, eventKeyCode) + } else if (eventKeyName) { + return hyphenate(eventKeyName) !== key + } +} + +/* */ + +/** + * Runtime helper for merging v-bind="object" into a VNode's data. + */ +function bindObjectProps ( + data, + tag, + value, + asProp, + isSync +) { + if (value) { + if (!isObject(value)) { + true && warn( + 'v-bind without argument expects an Object or Array value', + this + ); + } else { + if (Array.isArray(value)) { + value = toObject(value); + } + var hash; + var loop = function ( key ) { + if ( + key === 'class' || + key === 'style' || + isReservedAttribute(key) + ) { + hash = data; + } else { + var type = data.attrs && data.attrs.type; + hash = asProp || config.mustUseProp(tag, type, key) + ? data.domProps || (data.domProps = {}) + : data.attrs || (data.attrs = {}); + } + var camelizedKey = camelize(key); + if (!(key in hash) && !(camelizedKey in hash)) { + hash[key] = value[key]; + + if (isSync) { + var on = data.on || (data.on = {}); + on[("update:" + camelizedKey)] = function ($event) { + value[key] = $event; + }; + } + } + }; + + for (var key in value) loop( key ); + } + } + return data +} + +/* */ + +/** + * Runtime helper for rendering static trees. + */ +function renderStatic ( + index, + isInFor +) { + var cached = this._staticTrees || (this._staticTrees = []); + var tree = cached[index]; + // if has already-rendered static tree and not inside v-for, + // we can reuse the same tree. + if (tree && !isInFor) { + return tree + } + // otherwise, render a fresh tree. + tree = cached[index] = this.$options.staticRenderFns[index].call( + this._renderProxy, + null, + this // for render fns generated for functional component templates + ); + markStatic(tree, ("__static__" + index), false); + return tree +} + +/** + * Runtime helper for v-once. + * Effectively it means marking the node as static with a unique key. + */ +function markOnce ( + tree, + index, + key +) { + markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); + return tree +} + +function markStatic ( + tree, + key, + isOnce +) { + if (Array.isArray(tree)) { + for (var i = 0; i < tree.length; i++) { + if (tree[i] && typeof tree[i] !== 'string') { + markStaticNode(tree[i], (key + "_" + i), isOnce); + } + } + } else { + markStaticNode(tree, key, isOnce); + } +} + +function markStaticNode (node, key, isOnce) { + node.isStatic = true; + node.key = key; + node.isOnce = isOnce; +} + +/* */ + +function bindObjectListeners (data, value) { + if (value) { + if (!isPlainObject(value)) { + true && warn( + 'v-on without argument expects an Object value', + this + ); + } else { + var on = data.on = data.on ? extend({}, data.on) : {}; + for (var key in value) { + var existing = on[key]; + var ours = value[key]; + on[key] = existing ? [].concat(existing, ours) : ours; + } + } + } + return data +} + +/* */ + +function installRenderHelpers (target) { + target._o = markOnce; + target._n = toNumber; + target._s = toString; + target._l = renderList; + target._t = renderSlot; + target._q = looseEqual; + target._i = looseIndexOf; + target._m = renderStatic; + target._f = resolveFilter; + target._k = checkKeyCodes; + target._b = bindObjectProps; + target._v = createTextVNode; + target._e = createEmptyVNode; + target._u = resolveScopedSlots; + target._g = bindObjectListeners; +} + +/* */ + +function FunctionalRenderContext ( + data, + props, + children, + parent, + Ctor +) { + var options = Ctor.options; + // ensure the createElement function in functional components + // gets a unique context - this is necessary for correct named slot check + var contextVm; + if (hasOwn(parent, '_uid')) { + contextVm = Object.create(parent); + // $flow-disable-line + contextVm._original = parent; + } else { + // the context vm passed in is a functional context as well. + // in this case we want to make sure we are able to get a hold to the + // real context instance. + contextVm = parent; + // $flow-disable-line + parent = parent._original; + } + var isCompiled = isTrue(options._compiled); + var needNormalization = !isCompiled; + + this.data = data; + this.props = props; + this.children = children; + this.parent = parent; + this.listeners = data.on || emptyObject; + this.injections = resolveInject(options.inject, parent); + this.slots = function () { return resolveSlots(children, parent); }; + + // support for compiled functional template + if (isCompiled) { + // exposing $options for renderStatic() + this.$options = options; + // pre-resolve slots for renderSlot() + this.$slots = this.slots(); + this.$scopedSlots = data.scopedSlots || emptyObject; + } + + if (options._scopeId) { + this._c = function (a, b, c, d) { + var vnode = createElement(contextVm, a, b, c, d, needNormalization); + if (vnode && !Array.isArray(vnode)) { + vnode.fnScopeId = options._scopeId; + vnode.fnContext = parent; + } + return vnode + }; + } else { + this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; + } +} + +installRenderHelpers(FunctionalRenderContext.prototype); + +function createFunctionalComponent ( + Ctor, + propsData, + data, + contextVm, + children +) { + var options = Ctor.options; + var props = {}; + var propOptions = options.props; + if (isDef(propOptions)) { + for (var key in propOptions) { + props[key] = validateProp(key, propOptions, propsData || emptyObject); + } + } else { + if (isDef(data.attrs)) { mergeProps(props, data.attrs); } + if (isDef(data.props)) { mergeProps(props, data.props); } + } + + var renderContext = new FunctionalRenderContext( + data, + props, + children, + contextVm, + Ctor + ); + + var vnode = options.render.call(null, renderContext._c, renderContext); + + if (vnode instanceof VNode) { + return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext) + } else if (Array.isArray(vnode)) { + var vnodes = normalizeChildren(vnode) || []; + var res = new Array(vnodes.length); + for (var i = 0; i < vnodes.length; i++) { + res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext); + } + return res + } +} + +function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) { + // #7817 clone node before setting fnContext, otherwise if the node is reused + // (e.g. it was from a cached normal slot) the fnContext causes named slots + // that should not be matched to match. + var clone = cloneVNode(vnode); + clone.fnContext = contextVm; + clone.fnOptions = options; + if (true) { + (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext; + } + if (data.slot) { + (clone.data || (clone.data = {})).slot = data.slot; + } + return clone +} + +function mergeProps (to, from) { + for (var key in from) { + to[camelize(key)] = from[key]; + } +} + +/* */ + +/* */ + +/* */ + +/* */ + +// inline hooks to be invoked on component VNodes during patch +var componentVNodeHooks = { + init: function init (vnode, hydrating) { + if ( + vnode.componentInstance && + !vnode.componentInstance._isDestroyed && + vnode.data.keepAlive + ) { + // kept-alive components, treat as a patch + var mountedNode = vnode; // work around flow + componentVNodeHooks.prepatch(mountedNode, mountedNode); + } else { + var child = vnode.componentInstance = createComponentInstanceForVnode( + vnode, + activeInstance + ); + child.$mount(hydrating ? vnode.elm : undefined, hydrating); + } + }, + + prepatch: function prepatch (oldVnode, vnode) { + var options = vnode.componentOptions; + var child = vnode.componentInstance = oldVnode.componentInstance; + updateChildComponent( + child, + options.propsData, // updated props + options.listeners, // updated listeners + vnode, // new parent vnode + options.children // new children + ); + }, + + insert: function insert (vnode) { + var context = vnode.context; + var componentInstance = vnode.componentInstance; + if (!componentInstance._isMounted) { + componentInstance._isMounted = true; + callHook(componentInstance, 'mounted'); + } + if (vnode.data.keepAlive) { + if (context._isMounted) { + // vue-router#1212 + // During updates, a kept-alive component's child components may + // change, so directly walking the tree here may call activated hooks + // on incorrect children. Instead we push them into a queue which will + // be processed after the whole patch process ended. + queueActivatedComponent(componentInstance); + } else { + activateChildComponent(componentInstance, true /* direct */); + } + } + }, + + destroy: function destroy (vnode) { + var componentInstance = vnode.componentInstance; + if (!componentInstance._isDestroyed) { + if (!vnode.data.keepAlive) { + componentInstance.$destroy(); + } else { + deactivateChildComponent(componentInstance, true /* direct */); + } + } + } +}; + +var hooksToMerge = Object.keys(componentVNodeHooks); + +function createComponent ( + Ctor, + data, + context, + children, + tag +) { + if (isUndef(Ctor)) { + return + } + + var baseCtor = context.$options._base; + + // plain options object: turn it into a constructor + if (isObject(Ctor)) { + Ctor = baseCtor.extend(Ctor); + } + + // if at this stage it's not a constructor or an async component factory, + // reject. + if (typeof Ctor !== 'function') { + if (true) { + warn(("Invalid Component definition: " + (String(Ctor))), context); + } + return + } + + // async component + var asyncFactory; + if (isUndef(Ctor.cid)) { + asyncFactory = Ctor; + Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context); + if (Ctor === undefined) { + // return a placeholder node for async component, which is rendered + // as a comment node but preserves all the raw information for the node. + // the information will be used for async server-rendering and hydration. + return createAsyncPlaceholder( + asyncFactory, + data, + context, + children, + tag + ) + } + } + + data = data || {}; + + // resolve constructor options in case global mixins are applied after + // component constructor creation + resolveConstructorOptions(Ctor); + + // transform component v-model data into props & events + if (isDef(data.model)) { + transformModel(Ctor.options, data); + } + + // extract props + var propsData = extractPropsFromVNodeData(data, Ctor, tag); + + // functional component + if (isTrue(Ctor.options.functional)) { + return createFunctionalComponent(Ctor, propsData, data, context, children) + } + + // extract listeners, since these needs to be treated as + // child component listeners instead of DOM listeners + var listeners = data.on; + // replace with listeners with .native modifier + // so it gets processed during parent component patch. + data.on = data.nativeOn; + + if (isTrue(Ctor.options.abstract)) { + // abstract components do not keep anything + // other than props & listeners & slot + + // work around flow + var slot = data.slot; + data = {}; + if (slot) { + data.slot = slot; + } + } + + // install component management hooks onto the placeholder node + installComponentHooks(data); + + // return a placeholder vnode + var name = Ctor.options.name || tag; + var vnode = new VNode( + ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')), + data, undefined, undefined, undefined, context, + { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, + asyncFactory + ); + + return vnode +} + +function createComponentInstanceForVnode ( + vnode, // we know it's MountedComponentVNode but flow doesn't + parent // activeInstance in lifecycle state +) { + var options = { + _isComponent: true, + _parentVnode: vnode, + parent: parent + }; + // check inline-template render functions + var inlineTemplate = vnode.data.inlineTemplate; + if (isDef(inlineTemplate)) { + options.render = inlineTemplate.render; + options.staticRenderFns = inlineTemplate.staticRenderFns; + } + return new vnode.componentOptions.Ctor(options) +} + +function installComponentHooks (data) { + var hooks = data.hook || (data.hook = {}); + for (var i = 0; i < hooksToMerge.length; i++) { + var key = hooksToMerge[i]; + var existing = hooks[key]; + var toMerge = componentVNodeHooks[key]; + if (existing !== toMerge && !(existing && existing._merged)) { + hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge; + } + } +} + +function mergeHook$1 (f1, f2) { + var merged = function (a, b) { + // flow complains about extra args which is why we use any + f1(a, b); + f2(a, b); + }; + merged._merged = true; + return merged +} + +// transform component v-model info (value and callback) into +// prop and event handler respectively. +function transformModel (options, data) { + var prop = (options.model && options.model.prop) || 'value'; + var event = (options.model && options.model.event) || 'input' + ;(data.props || (data.props = {}))[prop] = data.model.value; + var on = data.on || (data.on = {}); + var existing = on[event]; + var callback = data.model.callback; + if (isDef(existing)) { + if ( + Array.isArray(existing) + ? existing.indexOf(callback) === -1 + : existing !== callback + ) { + on[event] = [callback].concat(existing); + } + } else { + on[event] = callback; + } +} + +/* */ + +var SIMPLE_NORMALIZE = 1; +var ALWAYS_NORMALIZE = 2; + +// wrapper function for providing a more flexible interface +// without getting yelled at by flow +function createElement ( + context, + tag, + data, + children, + normalizationType, + alwaysNormalize +) { + if (Array.isArray(data) || isPrimitive(data)) { + normalizationType = children; + children = data; + data = undefined; + } + if (isTrue(alwaysNormalize)) { + normalizationType = ALWAYS_NORMALIZE; + } + return _createElement(context, tag, data, children, normalizationType) +} + +function _createElement ( + context, + tag, + data, + children, + normalizationType +) { + if (isDef(data) && isDef((data).__ob__)) { + true && warn( + "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + + 'Always create fresh vnode data objects in each render!', + context + ); + return createEmptyVNode() + } + // object syntax in v-bind + if (isDef(data) && isDef(data.is)) { + tag = data.is; + } + if (!tag) { + // in case of component :is set to falsy value + return createEmptyVNode() + } + // warn against non-primitive key + if ( true && + isDef(data) && isDef(data.key) && !isPrimitive(data.key) + ) { + { + warn( + 'Avoid using non-primitive value as key, ' + + 'use string/number value instead.', + context + ); + } + } + // support single function children as default scoped slot + if (Array.isArray(children) && + typeof children[0] === 'function' + ) { + data = data || {}; + data.scopedSlots = { default: children[0] }; + children.length = 0; + } + if (normalizationType === ALWAYS_NORMALIZE) { + children = normalizeChildren(children); + } else if (normalizationType === SIMPLE_NORMALIZE) { + children = simpleNormalizeChildren(children); + } + var vnode, ns; + if (typeof tag === 'string') { + var Ctor; + ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); + if (config.isReservedTag(tag)) { + // platform built-in elements + vnode = new VNode( + config.parsePlatformTagName(tag), data, children, + undefined, undefined, context + ); + } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { + // component + vnode = createComponent(Ctor, data, context, children, tag); + } else { + // unknown or unlisted namespaced elements + // check at runtime because it may get assigned a namespace when its + // parent normalizes children + vnode = new VNode( + tag, data, children, + undefined, undefined, context + ); + } + } else { + // direct component options / constructor + vnode = createComponent(tag, data, context, children); + } + if (Array.isArray(vnode)) { + return vnode + } else if (isDef(vnode)) { + if (isDef(ns)) { applyNS(vnode, ns); } + if (isDef(data)) { registerDeepBindings(data); } + return vnode + } else { + return createEmptyVNode() + } +} + +function applyNS (vnode, ns, force) { + vnode.ns = ns; + if (vnode.tag === 'foreignObject') { + // use default namespace inside foreignObject + ns = undefined; + force = true; + } + if (isDef(vnode.children)) { + for (var i = 0, l = vnode.children.length; i < l; i++) { + var child = vnode.children[i]; + if (isDef(child.tag) && ( + isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { + applyNS(child, ns, force); + } + } + } +} + +// ref #5318 +// necessary to ensure parent re-render when deep bindings like :style and +// :class are used on slot nodes +function registerDeepBindings (data) { + if (isObject(data.style)) { + traverse(data.style); + } + if (isObject(data.class)) { + traverse(data.class); + } +} + +/* */ + +function initRender (vm) { + vm._vnode = null; // the root of the child tree + vm._staticTrees = null; // v-once cached trees + var options = vm.$options; + var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree + var renderContext = parentVnode && parentVnode.context; + vm.$slots = resolveSlots(options._renderChildren, renderContext); + vm.$scopedSlots = emptyObject; + // bind the createElement fn to this instance + // so that we get proper render context inside it. + // args order: tag, data, children, normalizationType, alwaysNormalize + // internal version is used by render functions compiled from templates + vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; + // normalization is always applied for the public version, used in + // user-written render functions. + vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; + + // $attrs & $listeners are exposed for easier HOC creation. + // they need to be reactive so that HOCs using them are always updated + var parentData = parentVnode && parentVnode.data; + + /* istanbul ignore else */ + if (true) { + defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { + !isUpdatingChildComponent && warn("$attrs is readonly.", vm); + }, true); + defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () { + !isUpdatingChildComponent && warn("$listeners is readonly.", vm); + }, true); + } else {} +} + +function renderMixin (Vue) { + // install runtime convenience helpers + installRenderHelpers(Vue.prototype); + + Vue.prototype.$nextTick = function (fn) { + return nextTick(fn, this) + }; + + Vue.prototype._render = function () { + var vm = this; + var ref = vm.$options; + var render = ref.render; + var _parentVnode = ref._parentVnode; + + if (_parentVnode) { + vm.$scopedSlots = _parentVnode.data.scopedSlots || emptyObject; + } + + // set parent vnode. this allows render functions to have access + // to the data on the placeholder node. + vm.$vnode = _parentVnode; + // render self + var vnode; + try { + vnode = render.call(vm._renderProxy, vm.$createElement); + } catch (e) { + handleError(e, vm, "render"); + // return error render result, + // or previous vnode to prevent render error causing blank component + /* istanbul ignore else */ + if ( true && vm.$options.renderError) { + try { + vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); + } catch (e) { + handleError(e, vm, "renderError"); + vnode = vm._vnode; + } + } else { + vnode = vm._vnode; + } + } + // return empty vnode in case the render function errored out + if (!(vnode instanceof VNode)) { + if ( true && Array.isArray(vnode)) { + warn( + 'Multiple root nodes returned from render function. Render function ' + + 'should return a single root node.', + vm + ); + } + vnode = createEmptyVNode(); + } + // set parent + vnode.parent = _parentVnode; + return vnode + }; +} + +/* */ + +var uid$3 = 0; + +function initMixin (Vue) { + Vue.prototype._init = function (options) { + var vm = this; + // a uid + vm._uid = uid$3++; + + var startTag, endTag; + /* istanbul ignore if */ + if ( true && config.performance && mark) { + startTag = "vue-perf-start:" + (vm._uid); + endTag = "vue-perf-end:" + (vm._uid); + mark(startTag); + } + + // a flag to avoid this being observed + vm._isVue = true; + // merge options + if (options && options._isComponent) { + // optimize internal component instantiation + // since dynamic options merging is pretty slow, and none of the + // internal component options needs special treatment. + initInternalComponent(vm, options); + } else { + vm.$options = mergeOptions( + resolveConstructorOptions(vm.constructor), + options || {}, + vm + ); + } + /* istanbul ignore else */ + if (true) { + initProxy(vm); + } else {} + // expose real self + vm._self = vm; + initLifecycle(vm); + initEvents(vm); + initRender(vm); + callHook(vm, 'beforeCreate'); + initInjections(vm); // resolve injections before data/props + initState(vm); + initProvide(vm); // resolve provide after data/props + callHook(vm, 'created'); + + /* istanbul ignore if */ + if ( true && config.performance && mark) { + vm._name = formatComponentName(vm, false); + mark(endTag); + measure(("vue " + (vm._name) + " init"), startTag, endTag); + } + + if (vm.$options.el) { + vm.$mount(vm.$options.el); + } + }; +} + +function initInternalComponent (vm, options) { + var opts = vm.$options = Object.create(vm.constructor.options); + // doing this because it's faster than dynamic enumeration. + var parentVnode = options._parentVnode; + opts.parent = options.parent; + opts._parentVnode = parentVnode; + + var vnodeComponentOptions = parentVnode.componentOptions; + opts.propsData = vnodeComponentOptions.propsData; + opts._parentListeners = vnodeComponentOptions.listeners; + opts._renderChildren = vnodeComponentOptions.children; + opts._componentTag = vnodeComponentOptions.tag; + + if (options.render) { + opts.render = options.render; + opts.staticRenderFns = options.staticRenderFns; + } +} + +function resolveConstructorOptions (Ctor) { + var options = Ctor.options; + if (Ctor.super) { + var superOptions = resolveConstructorOptions(Ctor.super); + var cachedSuperOptions = Ctor.superOptions; + if (superOptions !== cachedSuperOptions) { + // super option changed, + // need to resolve new options. + Ctor.superOptions = superOptions; + // check if there are any late-modified/attached options (#4976) + var modifiedOptions = resolveModifiedOptions(Ctor); + // update base extend options + if (modifiedOptions) { + extend(Ctor.extendOptions, modifiedOptions); + } + options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions); + if (options.name) { + options.components[options.name] = Ctor; + } + } + } + return options +} + +function resolveModifiedOptions (Ctor) { + var modified; + var latest = Ctor.options; + var extended = Ctor.extendOptions; + var sealed = Ctor.sealedOptions; + for (var key in latest) { + if (latest[key] !== sealed[key]) { + if (!modified) { modified = {}; } + modified[key] = dedupe(latest[key], extended[key], sealed[key]); + } + } + return modified +} + +function dedupe (latest, extended, sealed) { + // compare latest and sealed to ensure lifecycle hooks won't be duplicated + // between merges + if (Array.isArray(latest)) { + var res = []; + sealed = Array.isArray(sealed) ? sealed : [sealed]; + extended = Array.isArray(extended) ? extended : [extended]; + for (var i = 0; i < latest.length; i++) { + // push original options and not sealed options to exclude duplicated options + if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) { + res.push(latest[i]); + } + } + return res + } else { + return latest + } +} + +function Vue (options) { + if ( true && + !(this instanceof Vue) + ) { + warn('Vue is a constructor and should be called with the `new` keyword'); + } + this._init(options); +} + +initMixin(Vue); +stateMixin(Vue); +eventsMixin(Vue); +lifecycleMixin(Vue); +renderMixin(Vue); + +/* */ + +function initUse (Vue) { + Vue.use = function (plugin) { + var installedPlugins = (this._installedPlugins || (this._installedPlugins = [])); + if (installedPlugins.indexOf(plugin) > -1) { + return this + } + + // additional parameters + var args = toArray(arguments, 1); + args.unshift(this); + if (typeof plugin.install === 'function') { + plugin.install.apply(plugin, args); + } else if (typeof plugin === 'function') { + plugin.apply(null, args); + } + installedPlugins.push(plugin); + return this + }; +} + +/* */ + +function initMixin$1 (Vue) { + Vue.mixin = function (mixin) { + this.options = mergeOptions(this.options, mixin); + return this + }; +} + +/* */ + +function initExtend (Vue) { + /** + * Each instance constructor, including Vue, has a unique + * cid. This enables us to create wrapped "child + * constructors" for prototypal inheritance and cache them. + */ + Vue.cid = 0; + var cid = 1; + + /** + * Class inheritance + */ + Vue.extend = function (extendOptions) { + extendOptions = extendOptions || {}; + var Super = this; + var SuperId = Super.cid; + var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); + if (cachedCtors[SuperId]) { + return cachedCtors[SuperId] + } + + var name = extendOptions.name || Super.options.name; + if ( true && name) { + validateComponentName(name); + } + + var Sub = function VueComponent (options) { + this._init(options); + }; + Sub.prototype = Object.create(Super.prototype); + Sub.prototype.constructor = Sub; + Sub.cid = cid++; + Sub.options = mergeOptions( + Super.options, + extendOptions + ); + Sub['super'] = Super; + + // For props and computed properties, we define the proxy getters on + // the Vue instances at extension time, on the extended prototype. This + // avoids Object.defineProperty calls for each instance created. + if (Sub.options.props) { + initProps$1(Sub); + } + if (Sub.options.computed) { + initComputed$1(Sub); + } + + // allow further extension/mixin/plugin usage + Sub.extend = Super.extend; + Sub.mixin = Super.mixin; + Sub.use = Super.use; + + // create asset registers, so extended classes + // can have their private assets too. + ASSET_TYPES.forEach(function (type) { + Sub[type] = Super[type]; + }); + // enable recursive self-lookup + if (name) { + Sub.options.components[name] = Sub; + } + + // keep a reference to the super options at extension time. + // later at instantiation we can check if Super's options have + // been updated. + Sub.superOptions = Super.options; + Sub.extendOptions = extendOptions; + Sub.sealedOptions = extend({}, Sub.options); + + // cache constructor + cachedCtors[SuperId] = Sub; + return Sub + }; +} + +function initProps$1 (Comp) { + var props = Comp.options.props; + for (var key in props) { + proxy(Comp.prototype, "_props", key); + } +} + +function initComputed$1 (Comp) { + var computed = Comp.options.computed; + for (var key in computed) { + defineComputed(Comp.prototype, key, computed[key]); + } +} + +/* */ + +function initAssetRegisters (Vue) { + /** + * Create asset registration methods. + */ + ASSET_TYPES.forEach(function (type) { + Vue[type] = function ( + id, + definition + ) { + if (!definition) { + return this.options[type + 's'][id] + } else { + /* istanbul ignore if */ + if ( true && type === 'component') { + validateComponentName(id); + } + if (type === 'component' && isPlainObject(definition)) { + definition.name = definition.name || id; + definition = this.options._base.extend(definition); + } + if (type === 'directive' && typeof definition === 'function') { + definition = { bind: definition, update: definition }; + } + this.options[type + 's'][id] = definition; + return definition + } + }; + }); +} + +/* */ + + + +function getComponentName (opts) { + return opts && (opts.Ctor.options.name || opts.tag) +} + +function matches (pattern, name) { + if (Array.isArray(pattern)) { + return pattern.indexOf(name) > -1 + } else if (typeof pattern === 'string') { + return pattern.split(',').indexOf(name) > -1 + } else if (isRegExp(pattern)) { + return pattern.test(name) + } + /* istanbul ignore next */ + return false +} + +function pruneCache (keepAliveInstance, filter) { + var cache = keepAliveInstance.cache; + var keys = keepAliveInstance.keys; + var _vnode = keepAliveInstance._vnode; + for (var key in cache) { + var cachedNode = cache[key]; + if (cachedNode) { + var name = getComponentName(cachedNode.componentOptions); + if (name && !filter(name)) { + pruneCacheEntry(cache, key, keys, _vnode); + } + } + } +} + +function pruneCacheEntry ( + cache, + key, + keys, + current +) { + var cached$$1 = cache[key]; + if (cached$$1 && (!current || cached$$1.tag !== current.tag)) { + cached$$1.componentInstance.$destroy(); + } + cache[key] = null; + remove(keys, key); +} + +var patternTypes = [String, RegExp, Array]; + +var KeepAlive = { + name: 'keep-alive', + abstract: true, + + props: { + include: patternTypes, + exclude: patternTypes, + max: [String, Number] + }, + + created: function created () { + this.cache = Object.create(null); + this.keys = []; + }, + + destroyed: function destroyed () { + for (var key in this.cache) { + pruneCacheEntry(this.cache, key, this.keys); + } + }, + + mounted: function mounted () { + var this$1 = this; + + this.$watch('include', function (val) { + pruneCache(this$1, function (name) { return matches(val, name); }); + }); + this.$watch('exclude', function (val) { + pruneCache(this$1, function (name) { return !matches(val, name); }); + }); + }, + + render: function render () { + var slot = this.$slots.default; + var vnode = getFirstComponentChild(slot); + var componentOptions = vnode && vnode.componentOptions; + if (componentOptions) { + // check pattern + var name = getComponentName(componentOptions); + var ref = this; + var include = ref.include; + var exclude = ref.exclude; + if ( + // not included + (include && (!name || !matches(include, name))) || + // excluded + (exclude && name && matches(exclude, name)) + ) { + return vnode + } + + var ref$1 = this; + var cache = ref$1.cache; + var keys = ref$1.keys; + var key = vnode.key == null + // same constructor may get registered as different local components + // so cid alone is not enough (#3269) + ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '') + : vnode.key; + if (cache[key]) { + vnode.componentInstance = cache[key].componentInstance; + // make current key freshest + remove(keys, key); + keys.push(key); + } else { + cache[key] = vnode; + keys.push(key); + // prune oldest entry + if (this.max && keys.length > parseInt(this.max)) { + pruneCacheEntry(cache, keys[0], keys, this._vnode); + } + } + + vnode.data.keepAlive = true; + } + return vnode || (slot && slot[0]) + } +}; + +var builtInComponents = { + KeepAlive: KeepAlive +}; + +/* */ + +function initGlobalAPI (Vue) { + // config + var configDef = {}; + configDef.get = function () { return config; }; + if (true) { + configDef.set = function () { + warn( + 'Do not replace the Vue.config object, set individual fields instead.' + ); + }; + } + Object.defineProperty(Vue, 'config', configDef); + + // exposed util methods. + // NOTE: these are not considered part of the public API - avoid relying on + // them unless you are aware of the risk. + Vue.util = { + warn: warn, + extend: extend, + mergeOptions: mergeOptions, + defineReactive: defineReactive$$1 + }; + + Vue.set = set; + Vue.delete = del; + Vue.nextTick = nextTick; + + Vue.options = Object.create(null); + ASSET_TYPES.forEach(function (type) { + Vue.options[type + 's'] = Object.create(null); + }); + + // this is used to identify the "base" constructor to extend all plain-object + // components with in Weex's multi-instance scenarios. + Vue.options._base = Vue; + + extend(Vue.options.components, builtInComponents); + + initUse(Vue); + initMixin$1(Vue); + initExtend(Vue); + initAssetRegisters(Vue); +} + +initGlobalAPI(Vue); + +Object.defineProperty(Vue.prototype, '$isServer', { + get: isServerRendering +}); + +Object.defineProperty(Vue.prototype, '$ssrContext', { + get: function get () { + /* istanbul ignore next */ + return this.$vnode && this.$vnode.ssrContext + } +}); + +// expose FunctionalRenderContext for ssr runtime helper installation +Object.defineProperty(Vue, 'FunctionalRenderContext', { + value: FunctionalRenderContext +}); + +Vue.version = '2.5.21'; + +/* */ + +// these are reserved for web because they are directly compiled away +// during template compilation +var isReservedAttr = makeMap('style,class'); + +// attributes that should be using props for binding +var acceptValue = makeMap('input,textarea,option,select,progress'); +var mustUseProp = function (tag, type, attr) { + return ( + (attr === 'value' && acceptValue(tag)) && type !== 'button' || + (attr === 'selected' && tag === 'option') || + (attr === 'checked' && tag === 'input') || + (attr === 'muted' && tag === 'video') + ) +}; + +var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'); + +var isBooleanAttr = makeMap( + 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + + 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + + 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + + 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + + 'required,reversed,scoped,seamless,selected,sortable,translate,' + + 'truespeed,typemustmatch,visible' +); + +var xlinkNS = 'http://www.w3.org/1999/xlink'; + +var isXlink = function (name) { + return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink' +}; + +var getXlinkProp = function (name) { + return isXlink(name) ? name.slice(6, name.length) : '' +}; + +var isFalsyAttrValue = function (val) { + return val == null || val === false +}; + +/* */ + +function genClassForVnode (vnode) { + var data = vnode.data; + var parentNode = vnode; + var childNode = vnode; + while (isDef(childNode.componentInstance)) { + childNode = childNode.componentInstance._vnode; + if (childNode && childNode.data) { + data = mergeClassData(childNode.data, data); + } + } + while (isDef(parentNode = parentNode.parent)) { + if (parentNode && parentNode.data) { + data = mergeClassData(data, parentNode.data); + } + } + return renderClass(data.staticClass, data.class) +} + +function mergeClassData (child, parent) { + return { + staticClass: concat(child.staticClass, parent.staticClass), + class: isDef(child.class) + ? [child.class, parent.class] + : parent.class + } +} + +function renderClass ( + staticClass, + dynamicClass +) { + if (isDef(staticClass) || isDef(dynamicClass)) { + return concat(staticClass, stringifyClass(dynamicClass)) + } + /* istanbul ignore next */ + return '' +} + +function concat (a, b) { + return a ? b ? (a + ' ' + b) : a : (b || '') +} + +function stringifyClass (value) { + if (Array.isArray(value)) { + return stringifyArray(value) + } + if (isObject(value)) { + return stringifyObject(value) + } + if (typeof value === 'string') { + return value + } + /* istanbul ignore next */ + return '' +} + +function stringifyArray (value) { + var res = ''; + var stringified; + for (var i = 0, l = value.length; i < l; i++) { + if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') { + if (res) { res += ' '; } + res += stringified; + } + } + return res +} + +function stringifyObject (value) { + var res = ''; + for (var key in value) { + if (value[key]) { + if (res) { res += ' '; } + res += key; + } + } + return res +} + +/* */ + +var namespaceMap = { + svg: 'http://www.w3.org/2000/svg', + math: 'http://www.w3.org/1998/Math/MathML' +}; + +var isHTMLTag = makeMap( + 'html,body,base,head,link,meta,style,title,' + + 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + + 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + + 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + + 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + + 'embed,object,param,source,canvas,script,noscript,del,ins,' + + 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + + 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + + 'output,progress,select,textarea,' + + 'details,dialog,menu,menuitem,summary,' + + 'content,element,shadow,template,blockquote,iframe,tfoot' +); + +// this map is intentionally selective, only covering SVG elements that may +// contain child elements. +var isSVG = makeMap( + 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + + 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', + true +); + +var isPreTag = function (tag) { return tag === 'pre'; }; + +var isReservedTag = function (tag) { + return isHTMLTag(tag) || isSVG(tag) +}; + +function getTagNamespace (tag) { + if (isSVG(tag)) { + return 'svg' + } + // basic support for MathML + // note it doesn't support other MathML elements being component roots + if (tag === 'math') { + return 'math' + } +} + +var unknownElementCache = Object.create(null); +function isUnknownElement (tag) { + /* istanbul ignore if */ + if (!inBrowser) { + return true + } + if (isReservedTag(tag)) { + return false + } + tag = tag.toLowerCase(); + /* istanbul ignore if */ + if (unknownElementCache[tag] != null) { + return unknownElementCache[tag] + } + var el = document.createElement(tag); + if (tag.indexOf('-') > -1) { + // http://stackoverflow.com/a/28210364/1070244 + return (unknownElementCache[tag] = ( + el.constructor === window.HTMLUnknownElement || + el.constructor === window.HTMLElement + )) + } else { + return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString())) + } +} + +var isTextInputType = makeMap('text,number,password,search,email,tel,url'); + +/* */ + +/** + * Query an element selector if it's not an element already. + */ +function query (el) { + if (typeof el === 'string') { + var selected = document.querySelector(el); + if (!selected) { + true && warn( + 'Cannot find element: ' + el + ); + return document.createElement('div') + } + return selected + } else { + return el + } +} + +/* */ + +function createElement$1 (tagName, vnode) { + var elm = document.createElement(tagName); + if (tagName !== 'select') { + return elm + } + // false or null will remove the attribute but undefined will not + if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) { + elm.setAttribute('multiple', 'multiple'); + } + return elm +} + +function createElementNS (namespace, tagName) { + return document.createElementNS(namespaceMap[namespace], tagName) +} + +function createTextNode (text) { + return document.createTextNode(text) +} + +function createComment (text) { + return document.createComment(text) +} + +function insertBefore (parentNode, newNode, referenceNode) { + parentNode.insertBefore(newNode, referenceNode); +} + +function removeChild (node, child) { + node.removeChild(child); +} + +function appendChild (node, child) { + node.appendChild(child); +} + +function parentNode (node) { + return node.parentNode +} + +function nextSibling (node) { + return node.nextSibling +} + +function tagName (node) { + return node.tagName +} + +function setTextContent (node, text) { + node.textContent = text; +} + +function setStyleScope (node, scopeId) { + node.setAttribute(scopeId, ''); +} + +var nodeOps = /*#__PURE__*/Object.freeze({ + createElement: createElement$1, + createElementNS: createElementNS, + createTextNode: createTextNode, + createComment: createComment, + insertBefore: insertBefore, + removeChild: removeChild, + appendChild: appendChild, + parentNode: parentNode, + nextSibling: nextSibling, + tagName: tagName, + setTextContent: setTextContent, + setStyleScope: setStyleScope +}); + +/* */ + +var ref = { + create: function create (_, vnode) { + registerRef(vnode); + }, + update: function update (oldVnode, vnode) { + if (oldVnode.data.ref !== vnode.data.ref) { + registerRef(oldVnode, true); + registerRef(vnode); + } + }, + destroy: function destroy (vnode) { + registerRef(vnode, true); + } +}; + +function registerRef (vnode, isRemoval) { + var key = vnode.data.ref; + if (!isDef(key)) { return } + + var vm = vnode.context; + var ref = vnode.componentInstance || vnode.elm; + var refs = vm.$refs; + if (isRemoval) { + if (Array.isArray(refs[key])) { + remove(refs[key], ref); + } else if (refs[key] === ref) { + refs[key] = undefined; + } + } else { + if (vnode.data.refInFor) { + if (!Array.isArray(refs[key])) { + refs[key] = [ref]; + } else if (refs[key].indexOf(ref) < 0) { + // $flow-disable-line + refs[key].push(ref); + } + } else { + refs[key] = ref; + } + } +} + +/** + * Virtual DOM patching algorithm based on Snabbdom by + * Simon Friis Vindum (@paldepind) + * Licensed under the MIT License + * https://github.com/paldepind/snabbdom/blob/master/LICENSE + * + * modified by Evan You (@yyx990803) + * + * Not type-checking this because this file is perf-critical and the cost + * of making flow understand it is not worth it. + */ + +var emptyNode = new VNode('', {}, []); + +var hooks = ['create', 'activate', 'update', 'remove', 'destroy']; + +function sameVnode (a, b) { + return ( + a.key === b.key && ( + ( + a.tag === b.tag && + a.isComment === b.isComment && + isDef(a.data) === isDef(b.data) && + sameInputType(a, b) + ) || ( + isTrue(a.isAsyncPlaceholder) && + a.asyncFactory === b.asyncFactory && + isUndef(b.asyncFactory.error) + ) + ) + ) +} + +function sameInputType (a, b) { + if (a.tag !== 'input') { return true } + var i; + var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type; + var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type; + return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB) +} + +function createKeyToOldIdx (children, beginIdx, endIdx) { + var i, key; + var map = {}; + for (i = beginIdx; i <= endIdx; ++i) { + key = children[i].key; + if (isDef(key)) { map[key] = i; } + } + return map +} + +function createPatchFunction (backend) { + var i, j; + var cbs = {}; + + var modules = backend.modules; + var nodeOps = backend.nodeOps; + + for (i = 0; i < hooks.length; ++i) { + cbs[hooks[i]] = []; + for (j = 0; j < modules.length; ++j) { + if (isDef(modules[j][hooks[i]])) { + cbs[hooks[i]].push(modules[j][hooks[i]]); + } + } + } + + function emptyNodeAt (elm) { + return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm) + } + + function createRmCb (childElm, listeners) { + function remove$$1 () { + if (--remove$$1.listeners === 0) { + removeNode(childElm); + } + } + remove$$1.listeners = listeners; + return remove$$1 + } + + function removeNode (el) { + var parent = nodeOps.parentNode(el); + // element may have already been removed due to v-html / v-text + if (isDef(parent)) { + nodeOps.removeChild(parent, el); + } + } + + function isUnknownElement$$1 (vnode, inVPre) { + return ( + !inVPre && + !vnode.ns && + !( + config.ignoredElements.length && + config.ignoredElements.some(function (ignore) { + return isRegExp(ignore) + ? ignore.test(vnode.tag) + : ignore === vnode.tag + }) + ) && + config.isUnknownElement(vnode.tag) + ) + } + + var creatingElmInVPre = 0; + + function createElm ( + vnode, + insertedVnodeQueue, + parentElm, + refElm, + nested, + ownerArray, + index + ) { + if (isDef(vnode.elm) && isDef(ownerArray)) { + // This vnode was used in a previous render! + // now it's used as a new node, overwriting its elm would cause + // potential patch errors down the road when it's used as an insertion + // reference node. Instead, we clone the node on-demand before creating + // associated DOM element for it. + vnode = ownerArray[index] = cloneVNode(vnode); + } + + vnode.isRootInsert = !nested; // for transition enter check + if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) { + return + } + + var data = vnode.data; + var children = vnode.children; + var tag = vnode.tag; + if (isDef(tag)) { + if (true) { + if (data && data.pre) { + creatingElmInVPre++; + } + if (isUnknownElement$$1(vnode, creatingElmInVPre)) { + warn( + 'Unknown custom element: <' + tag + '> - did you ' + + 'register the component correctly? For recursive components, ' + + 'make sure to provide the "name" option.', + vnode.context + ); + } + } + + vnode.elm = vnode.ns + ? nodeOps.createElementNS(vnode.ns, tag) + : nodeOps.createElement(tag, vnode); + setScope(vnode); + + /* istanbul ignore if */ + { + createChildren(vnode, children, insertedVnodeQueue); + if (isDef(data)) { + invokeCreateHooks(vnode, insertedVnodeQueue); + } + insert(parentElm, vnode.elm, refElm); + } + + if ( true && data && data.pre) { + creatingElmInVPre--; + } + } else if (isTrue(vnode.isComment)) { + vnode.elm = nodeOps.createComment(vnode.text); + insert(parentElm, vnode.elm, refElm); + } else { + vnode.elm = nodeOps.createTextNode(vnode.text); + insert(parentElm, vnode.elm, refElm); + } + } + + function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) { + var i = vnode.data; + if (isDef(i)) { + var isReactivated = isDef(vnode.componentInstance) && i.keepAlive; + if (isDef(i = i.hook) && isDef(i = i.init)) { + i(vnode, false /* hydrating */); + } + // after calling the init hook, if the vnode is a child component + // it should've created a child instance and mounted it. the child + // component also has set the placeholder vnode's elm. + // in that case we can just return the element and be done. + if (isDef(vnode.componentInstance)) { + initComponent(vnode, insertedVnodeQueue); + insert(parentElm, vnode.elm, refElm); + if (isTrue(isReactivated)) { + reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm); + } + return true + } + } + } + + function initComponent (vnode, insertedVnodeQueue) { + if (isDef(vnode.data.pendingInsert)) { + insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert); + vnode.data.pendingInsert = null; + } + vnode.elm = vnode.componentInstance.$el; + if (isPatchable(vnode)) { + invokeCreateHooks(vnode, insertedVnodeQueue); + setScope(vnode); + } else { + // empty component root. + // skip all element-related modules except for ref (#3455) + registerRef(vnode); + // make sure to invoke the insert hook + insertedVnodeQueue.push(vnode); + } + } + + function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) { + var i; + // hack for #4339: a reactivated component with inner transition + // does not trigger because the inner node's created hooks are not called + // again. It's not ideal to involve module-specific logic in here but + // there doesn't seem to be a better way to do it. + var innerNode = vnode; + while (innerNode.componentInstance) { + innerNode = innerNode.componentInstance._vnode; + if (isDef(i = innerNode.data) && isDef(i = i.transition)) { + for (i = 0; i < cbs.activate.length; ++i) { + cbs.activate[i](emptyNode, innerNode); + } + insertedVnodeQueue.push(innerNode); + break + } + } + // unlike a newly created component, + // a reactivated keep-alive component doesn't insert itself + insert(parentElm, vnode.elm, refElm); + } + + function insert (parent, elm, ref$$1) { + if (isDef(parent)) { + if (isDef(ref$$1)) { + if (nodeOps.parentNode(ref$$1) === parent) { + nodeOps.insertBefore(parent, elm, ref$$1); + } + } else { + nodeOps.appendChild(parent, elm); + } + } + } + + function createChildren (vnode, children, insertedVnodeQueue) { + if (Array.isArray(children)) { + if (true) { + checkDuplicateKeys(children); + } + for (var i = 0; i < children.length; ++i) { + createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i); + } + } else if (isPrimitive(vnode.text)) { + nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text))); + } + } + + function isPatchable (vnode) { + while (vnode.componentInstance) { + vnode = vnode.componentInstance._vnode; + } + return isDef(vnode.tag) + } + + function invokeCreateHooks (vnode, insertedVnodeQueue) { + for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { + cbs.create[i$1](emptyNode, vnode); + } + i = vnode.data.hook; // Reuse variable + if (isDef(i)) { + if (isDef(i.create)) { i.create(emptyNode, vnode); } + if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); } + } + } + + // set scope id attribute for scoped CSS. + // this is implemented as a special case to avoid the overhead + // of going through the normal attribute patching process. + function setScope (vnode) { + var i; + if (isDef(i = vnode.fnScopeId)) { + nodeOps.setStyleScope(vnode.elm, i); + } else { + var ancestor = vnode; + while (ancestor) { + if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { + nodeOps.setStyleScope(vnode.elm, i); + } + ancestor = ancestor.parent; + } + } + // for slot content they should also get the scopeId from the host instance. + if (isDef(i = activeInstance) && + i !== vnode.context && + i !== vnode.fnContext && + isDef(i = i.$options._scopeId) + ) { + nodeOps.setStyleScope(vnode.elm, i); + } + } + + function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) { + for (; startIdx <= endIdx; ++startIdx) { + createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx); + } + } + + function invokeDestroyHook (vnode) { + var i, j; + var data = vnode.data; + if (isDef(data)) { + if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); } + for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); } + } + if (isDef(i = vnode.children)) { + for (j = 0; j < vnode.children.length; ++j) { + invokeDestroyHook(vnode.children[j]); + } + } + } + + function removeVnodes (parentElm, vnodes, startIdx, endIdx) { + for (; startIdx <= endIdx; ++startIdx) { + var ch = vnodes[startIdx]; + if (isDef(ch)) { + if (isDef(ch.tag)) { + removeAndInvokeRemoveHook(ch); + invokeDestroyHook(ch); + } else { // Text node + removeNode(ch.elm); + } + } + } + } + + function removeAndInvokeRemoveHook (vnode, rm) { + if (isDef(rm) || isDef(vnode.data)) { + var i; + var listeners = cbs.remove.length + 1; + if (isDef(rm)) { + // we have a recursively passed down rm callback + // increase the listeners count + rm.listeners += listeners; + } else { + // directly removing + rm = createRmCb(vnode.elm, listeners); + } + // recursively invoke hooks on child component root node + if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { + removeAndInvokeRemoveHook(i, rm); + } + for (i = 0; i < cbs.remove.length; ++i) { + cbs.remove[i](vnode, rm); + } + if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) { + i(vnode, rm); + } else { + rm(); + } + } else { + removeNode(vnode.elm); + } + } + + function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) { + var oldStartIdx = 0; + var newStartIdx = 0; + var oldEndIdx = oldCh.length - 1; + var oldStartVnode = oldCh[0]; + var oldEndVnode = oldCh[oldEndIdx]; + var newEndIdx = newCh.length - 1; + var newStartVnode = newCh[0]; + var newEndVnode = newCh[newEndIdx]; + var oldKeyToIdx, idxInOld, vnodeToMove, refElm; + + // removeOnly is a special flag used only by <transition-group> + // to ensure removed elements stay in correct relative positions + // during leaving transitions + var canMove = !removeOnly; + + if (true) { + checkDuplicateKeys(newCh); + } + + while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { + if (isUndef(oldStartVnode)) { + oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left + } else if (isUndef(oldEndVnode)) { + oldEndVnode = oldCh[--oldEndIdx]; + } else if (sameVnode(oldStartVnode, newStartVnode)) { + patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); + oldStartVnode = oldCh[++oldStartIdx]; + newStartVnode = newCh[++newStartIdx]; + } else if (sameVnode(oldEndVnode, newEndVnode)) { + patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); + oldEndVnode = oldCh[--oldEndIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right + patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); + canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm)); + oldStartVnode = oldCh[++oldStartIdx]; + newEndVnode = newCh[--newEndIdx]; + } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left + patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); + canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); + oldEndVnode = oldCh[--oldEndIdx]; + newStartVnode = newCh[++newStartIdx]; + } else { + if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); } + idxInOld = isDef(newStartVnode.key) + ? oldKeyToIdx[newStartVnode.key] + : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx); + if (isUndef(idxInOld)) { // New element + createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); + } else { + vnodeToMove = oldCh[idxInOld]; + if (sameVnode(vnodeToMove, newStartVnode)) { + patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); + oldCh[idxInOld] = undefined; + canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm); + } else { + // same key but different element. treat as new element + createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); + } + } + newStartVnode = newCh[++newStartIdx]; + } + } + if (oldStartIdx > oldEndIdx) { + refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; + addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); + } else if (newStartIdx > newEndIdx) { + removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + } + } + + function checkDuplicateKeys (children) { + var seenKeys = {}; + for (var i = 0; i < children.length; i++) { + var vnode = children[i]; + var key = vnode.key; + if (isDef(key)) { + if (seenKeys[key]) { + warn( + ("Duplicate keys detected: '" + key + "'. This may cause an update error."), + vnode.context + ); + } else { + seenKeys[key] = true; + } + } + } + } + + function findIdxInOld (node, oldCh, start, end) { + for (var i = start; i < end; i++) { + var c = oldCh[i]; + if (isDef(c) && sameVnode(node, c)) { return i } + } + } + + function patchVnode ( + oldVnode, + vnode, + insertedVnodeQueue, + ownerArray, + index, + removeOnly + ) { + if (oldVnode === vnode) { + return + } + + if (isDef(vnode.elm) && isDef(ownerArray)) { + // clone reused vnode + vnode = ownerArray[index] = cloneVNode(vnode); + } + + var elm = vnode.elm = oldVnode.elm; + + if (isTrue(oldVnode.isAsyncPlaceholder)) { + if (isDef(vnode.asyncFactory.resolved)) { + hydrate(oldVnode.elm, vnode, insertedVnodeQueue); + } else { + vnode.isAsyncPlaceholder = true; + } + return + } + + // reuse element for static trees. + // note we only do this if the vnode is cloned - + // if the new node is not cloned it means the render functions have been + // reset by the hot-reload-api and we need to do a proper re-render. + if (isTrue(vnode.isStatic) && + isTrue(oldVnode.isStatic) && + vnode.key === oldVnode.key && + (isTrue(vnode.isCloned) || isTrue(vnode.isOnce)) + ) { + vnode.componentInstance = oldVnode.componentInstance; + return + } + + var i; + var data = vnode.data; + if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) { + i(oldVnode, vnode); + } + + var oldCh = oldVnode.children; + var ch = vnode.children; + if (isDef(data) && isPatchable(vnode)) { + for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); } + if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); } + } + if (isUndef(vnode.text)) { + if (isDef(oldCh) && isDef(ch)) { + if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); } + } else if (isDef(ch)) { + if (true) { + checkDuplicateKeys(ch); + } + if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } + addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); + } else if (isDef(oldCh)) { + removeVnodes(elm, oldCh, 0, oldCh.length - 1); + } else if (isDef(oldVnode.text)) { + nodeOps.setTextContent(elm, ''); + } + } else if (oldVnode.text !== vnode.text) { + nodeOps.setTextContent(elm, vnode.text); + } + if (isDef(data)) { + if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); } + } + } + + function invokeInsertHook (vnode, queue, initial) { + // delay insert hooks for component root nodes, invoke them after the + // element is really inserted + if (isTrue(initial) && isDef(vnode.parent)) { + vnode.parent.data.pendingInsert = queue; + } else { + for (var i = 0; i < queue.length; ++i) { + queue[i].data.hook.insert(queue[i]); + } + } + } + + var hydrationBailed = false; + // list of modules that can skip create hook during hydration because they + // are already rendered on the client or has no need for initialization + // Note: style is excluded because it relies on initial clone for future + // deep updates (#7063). + var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); + + // Note: this is a browser-only function so we can assume elms are DOM nodes. + function hydrate (elm, vnode, insertedVnodeQueue, inVPre) { + var i; + var tag = vnode.tag; + var data = vnode.data; + var children = vnode.children; + inVPre = inVPre || (data && data.pre); + vnode.elm = elm; + + if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) { + vnode.isAsyncPlaceholder = true; + return true + } + // assert node match + if (true) { + if (!assertNodeMatch(elm, vnode, inVPre)) { + return false + } + } + if (isDef(data)) { + if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); } + if (isDef(i = vnode.componentInstance)) { + // child component. it should have hydrated its own tree. + initComponent(vnode, insertedVnodeQueue); + return true + } + } + if (isDef(tag)) { + if (isDef(children)) { + // empty element, allow client to pick up and populate children + if (!elm.hasChildNodes()) { + createChildren(vnode, children, insertedVnodeQueue); + } else { + // v-html and domProps: innerHTML + if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) { + if (i !== elm.innerHTML) { + /* istanbul ignore if */ + if ( true && + typeof console !== 'undefined' && + !hydrationBailed + ) { + hydrationBailed = true; + console.warn('Parent: ', elm); + console.warn('server innerHTML: ', i); + console.warn('client innerHTML: ', elm.innerHTML); + } + return false + } + } else { + // iterate and compare children lists + var childrenMatch = true; + var childNode = elm.firstChild; + for (var i$1 = 0; i$1 < children.length; i$1++) { + if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) { + childrenMatch = false; + break + } + childNode = childNode.nextSibling; + } + // if childNode is not null, it means the actual childNodes list is + // longer than the virtual children list. + if (!childrenMatch || childNode) { + /* istanbul ignore if */ + if ( true && + typeof console !== 'undefined' && + !hydrationBailed + ) { + hydrationBailed = true; + console.warn('Parent: ', elm); + console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children); + } + return false + } + } + } + } + if (isDef(data)) { + var fullInvoke = false; + for (var key in data) { + if (!isRenderedModule(key)) { + fullInvoke = true; + invokeCreateHooks(vnode, insertedVnodeQueue); + break + } + } + if (!fullInvoke && data['class']) { + // ensure collecting deps for deep class bindings for future updates + traverse(data['class']); + } + } + } else if (elm.data !== vnode.text) { + elm.data = vnode.text; + } + return true + } + + function assertNodeMatch (node, vnode, inVPre) { + if (isDef(vnode.tag)) { + return vnode.tag.indexOf('vue-component') === 0 || ( + !isUnknownElement$$1(vnode, inVPre) && + vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase()) + ) + } else { + return node.nodeType === (vnode.isComment ? 8 : 3) + } + } + + return function patch (oldVnode, vnode, hydrating, removeOnly) { + if (isUndef(vnode)) { + if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); } + return + } + + var isInitialPatch = false; + var insertedVnodeQueue = []; + + if (isUndef(oldVnode)) { + // empty mount (likely as component), create new root element + isInitialPatch = true; + createElm(vnode, insertedVnodeQueue); + } else { + var isRealElement = isDef(oldVnode.nodeType); + if (!isRealElement && sameVnode(oldVnode, vnode)) { + // patch existing root node + patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly); + } else { + if (isRealElement) { + // mounting to a real element + // check if this is server-rendered content and if we can perform + // a successful hydration. + if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) { + oldVnode.removeAttribute(SSR_ATTR); + hydrating = true; + } + if (isTrue(hydrating)) { + if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { + invokeInsertHook(vnode, insertedVnodeQueue, true); + return oldVnode + } else if (true) { + warn( + 'The client-side rendered virtual DOM tree is not matching ' + + 'server-rendered content. This is likely caused by incorrect ' + + 'HTML markup, for example nesting block-level elements inside ' + + '<p>, or missing <tbody>. Bailing hydration and performing ' + + 'full client-side render.' + ); + } + } + // either not server-rendered, or hydration failed. + // create an empty node and replace it + oldVnode = emptyNodeAt(oldVnode); + } + + // replacing existing element + var oldElm = oldVnode.elm; + var parentElm = nodeOps.parentNode(oldElm); + + // create new node + createElm( + vnode, + insertedVnodeQueue, + // extremely rare edge case: do not insert if old element is in a + // leaving transition. Only happens when combining transition + + // keep-alive + HOCs. (#4590) + oldElm._leaveCb ? null : parentElm, + nodeOps.nextSibling(oldElm) + ); + + // update parent placeholder node element, recursively + if (isDef(vnode.parent)) { + var ancestor = vnode.parent; + var patchable = isPatchable(vnode); + while (ancestor) { + for (var i = 0; i < cbs.destroy.length; ++i) { + cbs.destroy[i](ancestor); + } + ancestor.elm = vnode.elm; + if (patchable) { + for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { + cbs.create[i$1](emptyNode, ancestor); + } + // #6513 + // invoke insert hooks that may have been merged by create hooks. + // e.g. for directives that uses the "inserted" hook. + var insert = ancestor.data.hook.insert; + if (insert.merged) { + // start at index 1 to avoid re-invoking component mounted hook + for (var i$2 = 1; i$2 < insert.fns.length; i$2++) { + insert.fns[i$2](); + } + } + } else { + registerRef(ancestor); + } + ancestor = ancestor.parent; + } + } + + // destroy old node + if (isDef(parentElm)) { + removeVnodes(parentElm, [oldVnode], 0, 0); + } else if (isDef(oldVnode.tag)) { + invokeDestroyHook(oldVnode); + } + } + } + + invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); + return vnode.elm + } +} + +/* */ + +var directives = { + create: updateDirectives, + update: updateDirectives, + destroy: function unbindDirectives (vnode) { + updateDirectives(vnode, emptyNode); + } +}; + +function updateDirectives (oldVnode, vnode) { + if (oldVnode.data.directives || vnode.data.directives) { + _update(oldVnode, vnode); + } +} + +function _update (oldVnode, vnode) { + var isCreate = oldVnode === emptyNode; + var isDestroy = vnode === emptyNode; + var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); + var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); + + var dirsWithInsert = []; + var dirsWithPostpatch = []; + + var key, oldDir, dir; + for (key in newDirs) { + oldDir = oldDirs[key]; + dir = newDirs[key]; + if (!oldDir) { + // new directive, bind + callHook$1(dir, 'bind', vnode, oldVnode); + if (dir.def && dir.def.inserted) { + dirsWithInsert.push(dir); + } + } else { + // existing directive, update + dir.oldValue = oldDir.value; + callHook$1(dir, 'update', vnode, oldVnode); + if (dir.def && dir.def.componentUpdated) { + dirsWithPostpatch.push(dir); + } + } + } + + if (dirsWithInsert.length) { + var callInsert = function () { + for (var i = 0; i < dirsWithInsert.length; i++) { + callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); + } + }; + if (isCreate) { + mergeVNodeHook(vnode, 'insert', callInsert); + } else { + callInsert(); + } + } + + if (dirsWithPostpatch.length) { + mergeVNodeHook(vnode, 'postpatch', function () { + for (var i = 0; i < dirsWithPostpatch.length; i++) { + callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); + } + }); + } + + if (!isCreate) { + for (key in oldDirs) { + if (!newDirs[key]) { + // no longer present, unbind + callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy); + } + } + } +} + +var emptyModifiers = Object.create(null); + +function normalizeDirectives$1 ( + dirs, + vm +) { + var res = Object.create(null); + if (!dirs) { + // $flow-disable-line + return res + } + var i, dir; + for (i = 0; i < dirs.length; i++) { + dir = dirs[i]; + if (!dir.modifiers) { + // $flow-disable-line + dir.modifiers = emptyModifiers; + } + res[getRawDirName(dir)] = dir; + dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); + } + // $flow-disable-line + return res +} + +function getRawDirName (dir) { + return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) +} + +function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) { + var fn = dir.def && dir.def[hook]; + if (fn) { + try { + fn(vnode.elm, dir, vnode, oldVnode, isDestroy); + } catch (e) { + handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook")); + } + } +} + +var baseModules = [ + ref, + directives +]; + +/* */ + +function updateAttrs (oldVnode, vnode) { + var opts = vnode.componentOptions; + if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) { + return + } + if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) { + return + } + var key, cur, old; + var elm = vnode.elm; + var oldAttrs = oldVnode.data.attrs || {}; + var attrs = vnode.data.attrs || {}; + // clone observed objects, as the user probably wants to mutate it + if (isDef(attrs.__ob__)) { + attrs = vnode.data.attrs = extend({}, attrs); + } + + for (key in attrs) { + cur = attrs[key]; + old = oldAttrs[key]; + if (old !== cur) { + setAttr(elm, key, cur); + } + } + // #4391: in IE9, setting type can reset value for input[type=radio] + // #6666: IE/Edge forces progress value down to 1 before setting a max + /* istanbul ignore if */ + if ((isIE || isEdge) && attrs.value !== oldAttrs.value) { + setAttr(elm, 'value', attrs.value); + } + for (key in oldAttrs) { + if (isUndef(attrs[key])) { + if (isXlink(key)) { + elm.removeAttributeNS(xlinkNS, getXlinkProp(key)); + } else if (!isEnumeratedAttr(key)) { + elm.removeAttribute(key); + } + } + } +} + +function setAttr (el, key, value) { + if (el.tagName.indexOf('-') > -1) { + baseSetAttr(el, key, value); + } else if (isBooleanAttr(key)) { + // set attribute for blank value + // e.g. <option disabled>Select one</option> + if (isFalsyAttrValue(value)) { + el.removeAttribute(key); + } else { + // technically allowfullscreen is a boolean attribute for <iframe>, + // but Flash expects a value of "true" when used on <embed> tag + value = key === 'allowfullscreen' && el.tagName === 'EMBED' + ? 'true' + : key; + el.setAttribute(key, value); + } + } else if (isEnumeratedAttr(key)) { + el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true'); + } else if (isXlink(key)) { + if (isFalsyAttrValue(value)) { + el.removeAttributeNS(xlinkNS, getXlinkProp(key)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + baseSetAttr(el, key, value); + } +} + +function baseSetAttr (el, key, value) { + if (isFalsyAttrValue(value)) { + el.removeAttribute(key); + } else { + // #7138: IE10 & 11 fires input event when setting placeholder on + // <textarea>... block the first input event and remove the blocker + // immediately. + /* istanbul ignore if */ + if ( + isIE && !isIE9 && + (el.tagName === 'TEXTAREA' || el.tagName === 'INPUT') && + key === 'placeholder' && !el.__ieph + ) { + var blocker = function (e) { + e.stopImmediatePropagation(); + el.removeEventListener('input', blocker); + }; + el.addEventListener('input', blocker); + // $flow-disable-line + el.__ieph = true; /* IE placeholder patched */ + } + el.setAttribute(key, value); + } +} + +var attrs = { + create: updateAttrs, + update: updateAttrs +}; + +/* */ + +function updateClass (oldVnode, vnode) { + var el = vnode.elm; + var data = vnode.data; + var oldData = oldVnode.data; + if ( + isUndef(data.staticClass) && + isUndef(data.class) && ( + isUndef(oldData) || ( + isUndef(oldData.staticClass) && + isUndef(oldData.class) + ) + ) + ) { + return + } + + var cls = genClassForVnode(vnode); + + // handle transition classes + var transitionClass = el._transitionClasses; + if (isDef(transitionClass)) { + cls = concat(cls, stringifyClass(transitionClass)); + } + + // set the class + if (cls !== el._prevClass) { + el.setAttribute('class', cls); + el._prevClass = cls; + } +} + +var klass = { + create: updateClass, + update: updateClass +}; + +/* */ + +var validDivisionCharRE = /[\w).+\-_$\]]/; + +function parseFilters (exp) { + var inSingle = false; + var inDouble = false; + var inTemplateString = false; + var inRegex = false; + var curly = 0; + var square = 0; + var paren = 0; + var lastFilterIndex = 0; + var c, prev, i, expression, filters; + + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 0x27 && prev !== 0x5C) { inSingle = false; } + } else if (inDouble) { + if (c === 0x22 && prev !== 0x5C) { inDouble = false; } + } else if (inTemplateString) { + if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; } + } else if (inRegex) { + if (c === 0x2f && prev !== 0x5C) { inRegex = false; } + } else if ( + c === 0x7C && // pipe + exp.charCodeAt(i + 1) !== 0x7C && + exp.charCodeAt(i - 1) !== 0x7C && + !curly && !square && !paren + ) { + if (expression === undefined) { + // first filter, end of expression + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 0x22: inDouble = true; break // " + case 0x27: inSingle = true; break // ' + case 0x60: inTemplateString = true; break // ` + case 0x28: paren++; break // ( + case 0x29: paren--; break // ) + case 0x5B: square++; break // [ + case 0x5D: square--; break // ] + case 0x7B: curly++; break // { + case 0x7D: curly--; break // } + } + if (c === 0x2f) { // / + var j = i - 1; + var p = (void 0); + // find first non-whitespace prev char + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== ' ') { break } + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } + } + + if (expression === undefined) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); + } + + function pushFilter () { + (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; + } + + if (filters) { + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i]); + } + } + + return expression +} + +function wrapFilter (exp, filter) { + var i = filter.indexOf('('); + if (i < 0) { + // _f: resolveFilter + return ("_f(\"" + filter + "\")(" + exp + ")") + } else { + var name = filter.slice(0, i); + var args = filter.slice(i + 1); + return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args)) + } +} + +/* */ + +function baseWarn (msg) { + console.error(("[Vue compiler]: " + msg)); +} + +function pluckModuleFunction ( + modules, + key +) { + return modules + ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) + : [] +} + +function addProp (el, name, value) { + (el.props || (el.props = [])).push({ name: name, value: value }); + el.plain = false; +} + +function addAttr (el, name, value) { + (el.attrs || (el.attrs = [])).push({ name: name, value: value }); + el.plain = false; +} + +// add a raw attr (use this in preTransforms) +function addRawAttr (el, name, value) { + el.attrsMap[name] = value; + el.attrsList.push({ name: name, value: value }); +} + +function addDirective ( + el, + name, + rawName, + value, + arg, + modifiers +) { + (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers }); + el.plain = false; +} + +function addHandler ( + el, + name, + value, + modifiers, + important, + warn +) { + modifiers = modifiers || emptyObject; + // warn prevent and passive modifier + /* istanbul ignore if */ + if ( + true && warn && + modifiers.prevent && modifiers.passive + ) { + warn( + 'passive and prevent can\'t be used together. ' + + 'Passive handler can\'t prevent default event.' + ); + } + + // normalize click.right and click.middle since they don't actually fire + // this is technically browser-specific, but at least for now browsers are + // the only target envs that have right/middle clicks. + if (name === 'click') { + if (modifiers.right) { + name = 'contextmenu'; + delete modifiers.right; + } else if (modifiers.middle) { + name = 'mouseup'; + } + } + + // check capture modifier + if (modifiers.capture) { + delete modifiers.capture; + name = '!' + name; // mark the event as captured + } + if (modifiers.once) { + delete modifiers.once; + name = '~' + name; // mark the event as once + } + /* istanbul ignore if */ + if (modifiers.passive) { + delete modifiers.passive; + name = '&' + name; // mark the event as passive + } + + var events; + if (modifiers.native) { + delete modifiers.native; + events = el.nativeEvents || (el.nativeEvents = {}); + } else { + events = el.events || (el.events = {}); + } + + var newHandler = { + value: value.trim() + }; + if (modifiers !== emptyObject) { + newHandler.modifiers = modifiers; + } + + var handlers = events[name]; + /* istanbul ignore if */ + if (Array.isArray(handlers)) { + important ? handlers.unshift(newHandler) : handlers.push(newHandler); + } else if (handlers) { + events[name] = important ? [newHandler, handlers] : [handlers, newHandler]; + } else { + events[name] = newHandler; + } + + el.plain = false; +} + +function getBindingAttr ( + el, + name, + getStatic +) { + var dynamicValue = + getAndRemoveAttr(el, ':' + name) || + getAndRemoveAttr(el, 'v-bind:' + name); + if (dynamicValue != null) { + return parseFilters(dynamicValue) + } else if (getStatic !== false) { + var staticValue = getAndRemoveAttr(el, name); + if (staticValue != null) { + return JSON.stringify(staticValue) + } + } +} + +// note: this only removes the attr from the Array (attrsList) so that it +// doesn't get processed by processAttrs. +// By default it does NOT remove it from the map (attrsMap) because the map is +// needed during codegen. +function getAndRemoveAttr ( + el, + name, + removeFromMap +) { + var val; + if ((val = el.attrsMap[name]) != null) { + var list = el.attrsList; + for (var i = 0, l = list.length; i < l; i++) { + if (list[i].name === name) { + list.splice(i, 1); + break + } + } + } + if (removeFromMap) { + delete el.attrsMap[name]; + } + return val +} + +/* */ + +/** + * Cross-platform code generation for component v-model + */ +function genComponentModel ( + el, + value, + modifiers +) { + var ref = modifiers || {}; + var number = ref.number; + var trim = ref.trim; + + var baseValueExpression = '$$v'; + var valueExpression = baseValueExpression; + if (trim) { + valueExpression = + "(typeof " + baseValueExpression + " === 'string'" + + "? " + baseValueExpression + ".trim()" + + ": " + baseValueExpression + ")"; + } + if (number) { + valueExpression = "_n(" + valueExpression + ")"; + } + var assignment = genAssignmentCode(value, valueExpression); + + el.model = { + value: ("(" + value + ")"), + expression: JSON.stringify(value), + callback: ("function (" + baseValueExpression + ") {" + assignment + "}") + }; +} + +/** + * Cross-platform codegen helper for generating v-model value assignment code. + */ +function genAssignmentCode ( + value, + assignment +) { + var res = parseModel(value); + if (res.key === null) { + return (value + "=" + assignment) + } else { + return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")") + } +} + +/** + * Parse a v-model expression into a base path and a final key segment. + * Handles both dot-path and possible square brackets. + * + * Possible cases: + * + * - test + * - test[key] + * - test[test1[key]] + * - test["a"][key] + * - xxx.test[a[a].test1[key]] + * - test.xxx.a["asa"][test1[key]] + * + */ + +var len, str, chr, index$1, expressionPos, expressionEndPos; + + + +function parseModel (val) { + // Fix https://github.com/vuejs/vue/pull/7730 + // allow v-model="obj.val " (trailing whitespace) + val = val.trim(); + len = val.length; + + if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { + index$1 = val.lastIndexOf('.'); + if (index$1 > -1) { + return { + exp: val.slice(0, index$1), + key: '"' + val.slice(index$1 + 1) + '"' + } + } else { + return { + exp: val, + key: null + } + } + } + + str = val; + index$1 = expressionPos = expressionEndPos = 0; + + while (!eof()) { + chr = next(); + /* istanbul ignore if */ + if (isStringStart(chr)) { + parseString(chr); + } else if (chr === 0x5B) { + parseBracket(chr); + } + } + + return { + exp: val.slice(0, expressionPos), + key: val.slice(expressionPos + 1, expressionEndPos) + } +} + +function next () { + return str.charCodeAt(++index$1) +} + +function eof () { + return index$1 >= len +} + +function isStringStart (chr) { + return chr === 0x22 || chr === 0x27 +} + +function parseBracket (chr) { + var inBracket = 1; + expressionPos = index$1; + while (!eof()) { + chr = next(); + if (isStringStart(chr)) { + parseString(chr); + continue + } + if (chr === 0x5B) { inBracket++; } + if (chr === 0x5D) { inBracket--; } + if (inBracket === 0) { + expressionEndPos = index$1; + break + } + } +} + +function parseString (chr) { + var stringQuote = chr; + while (!eof()) { + chr = next(); + if (chr === stringQuote) { + break + } + } +} + +/* */ + +var warn$1; + +// in some cases, the event used has to be determined at runtime +// so we used some reserved tokens during compile. +var RANGE_TOKEN = '__r'; +var CHECKBOX_RADIO_TOKEN = '__c'; + +function model ( + el, + dir, + _warn +) { + warn$1 = _warn; + var value = dir.value; + var modifiers = dir.modifiers; + var tag = el.tag; + var type = el.attrsMap.type; + + if (true) { + // inputs with type="file" are read only and setting the input's + // value will throw an error. + if (tag === 'input' && type === 'file') { + warn$1( + "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" + + "File inputs are read only. Use a v-on:change listener instead." + ); + } + } + + if (el.component) { + genComponentModel(el, value, modifiers); + // component v-model doesn't need extra runtime + return false + } else if (tag === 'select') { + genSelect(el, value, modifiers); + } else if (tag === 'input' && type === 'checkbox') { + genCheckboxModel(el, value, modifiers); + } else if (tag === 'input' && type === 'radio') { + genRadioModel(el, value, modifiers); + } else if (tag === 'input' || tag === 'textarea') { + genDefaultModel(el, value, modifiers); + } else if (!config.isReservedTag(tag)) { + genComponentModel(el, value, modifiers); + // component v-model doesn't need extra runtime + return false + } else if (true) { + warn$1( + "<" + (el.tag) + " v-model=\"" + value + "\">: " + + "v-model is not supported on this element type. " + + 'If you are working with contenteditable, it\'s recommended to ' + + 'wrap a library dedicated for that purpose inside a custom component.' + ); + } + + // ensure runtime directive metadata + return true +} + +function genCheckboxModel ( + el, + value, + modifiers +) { + var number = modifiers && modifiers.number; + var valueBinding = getBindingAttr(el, 'value') || 'null'; + var trueValueBinding = getBindingAttr(el, 'true-value') || 'true'; + var falseValueBinding = getBindingAttr(el, 'false-value') || 'false'; + addProp(el, 'checked', + "Array.isArray(" + value + ")" + + "?_i(" + value + "," + valueBinding + ")>-1" + ( + trueValueBinding === 'true' + ? (":(" + value + ")") + : (":_q(" + value + "," + trueValueBinding + ")") + ) + ); + addHandler(el, 'change', + "var $$a=" + value + "," + + '$$el=$event.target,' + + "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + + 'if(Array.isArray($$a)){' + + "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + + '$$i=_i($$a,$$v);' + + "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" + + "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" + + "}else{" + (genAssignmentCode(value, '$$c')) + "}", + null, true + ); +} + +function genRadioModel ( + el, + value, + modifiers +) { + var number = modifiers && modifiers.number; + var valueBinding = getBindingAttr(el, 'value') || 'null'; + valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; + addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); + addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true); +} + +function genSelect ( + el, + value, + modifiers +) { + var number = modifiers && modifiers.number; + var selectedVal = "Array.prototype.filter" + + ".call($event.target.options,function(o){return o.selected})" + + ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + + "return " + (number ? '_n(val)' : 'val') + "})"; + + var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'; + var code = "var $$selectedVal = " + selectedVal + ";"; + code = code + " " + (genAssignmentCode(value, assignment)); + addHandler(el, 'change', code, null, true); +} + +function genDefaultModel ( + el, + value, + modifiers +) { + var type = el.attrsMap.type; + + // warn if v-bind:value conflicts with v-model + // except for inputs with v-bind:type + if (true) { + var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value']; + var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; + if (value$1 && !typeBinding) { + var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'; + warn$1( + binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " + + 'because the latter already expands to a value binding internally' + ); + } + } + + var ref = modifiers || {}; + var lazy = ref.lazy; + var number = ref.number; + var trim = ref.trim; + var needCompositionGuard = !lazy && type !== 'range'; + var event = lazy + ? 'change' + : type === 'range' + ? RANGE_TOKEN + : 'input'; + + var valueExpression = '$event.target.value'; + if (trim) { + valueExpression = "$event.target.value.trim()"; + } + if (number) { + valueExpression = "_n(" + valueExpression + ")"; + } + + var code = genAssignmentCode(value, valueExpression); + if (needCompositionGuard) { + code = "if($event.target.composing)return;" + code; + } + + addProp(el, 'value', ("(" + value + ")")); + addHandler(el, event, code, null, true); + if (trim || number) { + addHandler(el, 'blur', '$forceUpdate()'); + } +} + +/* */ + +// normalize v-model event tokens that can only be determined at runtime. +// it's important to place the event as the first in the array because +// the whole point is ensuring the v-model callback gets called before +// user-attached handlers. +function normalizeEvents (on) { + /* istanbul ignore if */ + if (isDef(on[RANGE_TOKEN])) { + // IE input[type=range] only supports `change` event + var event = isIE ? 'change' : 'input'; + on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); + delete on[RANGE_TOKEN]; + } + // This was originally intended to fix #4521 but no longer necessary + // after 2.5. Keeping it for backwards compat with generated code from < 2.4 + /* istanbul ignore if */ + if (isDef(on[CHECKBOX_RADIO_TOKEN])) { + on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []); + delete on[CHECKBOX_RADIO_TOKEN]; + } +} + +var target$1; + +function createOnceHandler$1 (event, handler, capture) { + var _target = target$1; // save current target element in closure + return function onceHandler () { + var res = handler.apply(null, arguments); + if (res !== null) { + remove$2(event, onceHandler, capture, _target); + } + } +} + +function add$1 ( + event, + handler, + capture, + passive +) { + handler = withMacroTask(handler); + target$1.addEventListener( + event, + handler, + supportsPassive + ? { capture: capture, passive: passive } + : capture + ); +} + +function remove$2 ( + event, + handler, + capture, + _target +) { + (_target || target$1).removeEventListener( + event, + handler._withTask || handler, + capture + ); +} + +function updateDOMListeners (oldVnode, vnode) { + if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) { + return + } + var on = vnode.data.on || {}; + var oldOn = oldVnode.data.on || {}; + target$1 = vnode.elm; + normalizeEvents(on); + updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context); + target$1 = undefined; +} + +var events = { + create: updateDOMListeners, + update: updateDOMListeners +}; + +/* */ + +function updateDOMProps (oldVnode, vnode) { + if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) { + return + } + var key, cur; + var elm = vnode.elm; + var oldProps = oldVnode.data.domProps || {}; + var props = vnode.data.domProps || {}; + // clone observed objects, as the user probably wants to mutate it + if (isDef(props.__ob__)) { + props = vnode.data.domProps = extend({}, props); + } + + for (key in oldProps) { + if (isUndef(props[key])) { + elm[key] = ''; + } + } + for (key in props) { + cur = props[key]; + // ignore children if the node has textContent or innerHTML, + // as these will throw away existing DOM nodes and cause removal errors + // on subsequent patches (#3360) + if (key === 'textContent' || key === 'innerHTML') { + if (vnode.children) { vnode.children.length = 0; } + if (cur === oldProps[key]) { continue } + // #6601 work around Chrome version <= 55 bug where single textNode + // replaced by innerHTML/textContent retains its parentNode property + if (elm.childNodes.length === 1) { + elm.removeChild(elm.childNodes[0]); + } + } + + if (key === 'value') { + // store value as _value as well since + // non-string values will be stringified + elm._value = cur; + // avoid resetting cursor position when value is the same + var strCur = isUndef(cur) ? '' : String(cur); + if (shouldUpdateValue(elm, strCur)) { + elm.value = strCur; + } + } else { + elm[key] = cur; + } + } +} + +// check platforms/web/util/attrs.js acceptValue + + +function shouldUpdateValue (elm, checkVal) { + return (!elm.composing && ( + elm.tagName === 'OPTION' || + isNotInFocusAndDirty(elm, checkVal) || + isDirtyWithModifiers(elm, checkVal) + )) +} + +function isNotInFocusAndDirty (elm, checkVal) { + // return true when textbox (.number and .trim) loses focus and its value is + // not equal to the updated value + var notInFocus = true; + // #6157 + // work around IE bug when accessing document.activeElement in an iframe + try { notInFocus = document.activeElement !== elm; } catch (e) {} + return notInFocus && elm.value !== checkVal +} + +function isDirtyWithModifiers (elm, newVal) { + var value = elm.value; + var modifiers = elm._vModifiers; // injected by v-model runtime + if (isDef(modifiers)) { + if (modifiers.lazy) { + // inputs with lazy should only be updated when not in focus + return false + } + if (modifiers.number) { + return toNumber(value) !== toNumber(newVal) + } + if (modifiers.trim) { + return value.trim() !== newVal.trim() + } + } + return value !== newVal +} + +var domProps = { + create: updateDOMProps, + update: updateDOMProps +}; + +/* */ + +var parseStyleText = cached(function (cssText) { + var res = {}; + var listDelimiter = /;(?![^(]*\))/g; + var propertyDelimiter = /:(.+)/; + cssText.split(listDelimiter).forEach(function (item) { + if (item) { + var tmp = item.split(propertyDelimiter); + tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); + } + }); + return res +}); + +// merge static and dynamic style data on the same vnode +function normalizeStyleData (data) { + var style = normalizeStyleBinding(data.style); + // static style is pre-processed into an object during compilation + // and is always a fresh object, so it's safe to merge into it + return data.staticStyle + ? extend(data.staticStyle, style) + : style +} + +// normalize possible array / string values into Object +function normalizeStyleBinding (bindingStyle) { + if (Array.isArray(bindingStyle)) { + return toObject(bindingStyle) + } + if (typeof bindingStyle === 'string') { + return parseStyleText(bindingStyle) + } + return bindingStyle +} + +/** + * parent component style should be after child's + * so that parent component's style could override it + */ +function getStyle (vnode, checkChild) { + var res = {}; + var styleData; + + if (checkChild) { + var childNode = vnode; + while (childNode.componentInstance) { + childNode = childNode.componentInstance._vnode; + if ( + childNode && childNode.data && + (styleData = normalizeStyleData(childNode.data)) + ) { + extend(res, styleData); + } + } + } + + if ((styleData = normalizeStyleData(vnode.data))) { + extend(res, styleData); + } + + var parentNode = vnode; + while ((parentNode = parentNode.parent)) { + if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { + extend(res, styleData); + } + } + return res +} + +/* */ + +var cssVarRE = /^--/; +var importantRE = /\s*!important$/; +var setProp = function (el, name, val) { + /* istanbul ignore if */ + if (cssVarRE.test(name)) { + el.style.setProperty(name, val); + } else if (importantRE.test(val)) { + el.style.setProperty(name, val.replace(importantRE, ''), 'important'); + } else { + var normalizedName = normalize(name); + if (Array.isArray(val)) { + // Support values array created by autoprefixer, e.g. + // {display: ["-webkit-box", "-ms-flexbox", "flex"]} + // Set them one by one, and the browser will only set those it can recognize + for (var i = 0, len = val.length; i < len; i++) { + el.style[normalizedName] = val[i]; + } + } else { + el.style[normalizedName] = val; + } + } +}; + +var vendorNames = ['Webkit', 'Moz', 'ms']; + +var emptyStyle; +var normalize = cached(function (prop) { + emptyStyle = emptyStyle || document.createElement('div').style; + prop = camelize(prop); + if (prop !== 'filter' && (prop in emptyStyle)) { + return prop + } + var capName = prop.charAt(0).toUpperCase() + prop.slice(1); + for (var i = 0; i < vendorNames.length; i++) { + var name = vendorNames[i] + capName; + if (name in emptyStyle) { + return name + } + } +}); + +function updateStyle (oldVnode, vnode) { + var data = vnode.data; + var oldData = oldVnode.data; + + if (isUndef(data.staticStyle) && isUndef(data.style) && + isUndef(oldData.staticStyle) && isUndef(oldData.style) + ) { + return + } + + var cur, name; + var el = vnode.elm; + var oldStaticStyle = oldData.staticStyle; + var oldStyleBinding = oldData.normalizedStyle || oldData.style || {}; + + // if static style exists, stylebinding already merged into it when doing normalizeStyleData + var oldStyle = oldStaticStyle || oldStyleBinding; + + var style = normalizeStyleBinding(vnode.data.style) || {}; + + // store normalized style under a different key for next diff + // make sure to clone it if it's reactive, since the user likely wants + // to mutate it. + vnode.data.normalizedStyle = isDef(style.__ob__) + ? extend({}, style) + : style; + + var newStyle = getStyle(vnode, true); + + for (name in oldStyle) { + if (isUndef(newStyle[name])) { + setProp(el, name, ''); + } + } + for (name in newStyle) { + cur = newStyle[name]; + if (cur !== oldStyle[name]) { + // ie9 setting to null has no effect, must use empty string + setProp(el, name, cur == null ? '' : cur); + } + } +} + +var style = { + create: updateStyle, + update: updateStyle +}; + +/* */ + +var whitespaceRE = /\s+/; + +/** + * Add class with compatibility for SVG since classList is not supported on + * SVG elements in IE + */ +function addClass (el, cls) { + /* istanbul ignore if */ + if (!cls || !(cls = cls.trim())) { + return + } + + /* istanbul ignore else */ + if (el.classList) { + if (cls.indexOf(' ') > -1) { + cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); }); + } else { + el.classList.add(cls); + } + } else { + var cur = " " + (el.getAttribute('class') || '') + " "; + if (cur.indexOf(' ' + cls + ' ') < 0) { + el.setAttribute('class', (cur + cls).trim()); + } + } +} + +/** + * Remove class with compatibility for SVG since classList is not supported on + * SVG elements in IE + */ +function removeClass (el, cls) { + /* istanbul ignore if */ + if (!cls || !(cls = cls.trim())) { + return + } + + /* istanbul ignore else */ + if (el.classList) { + if (cls.indexOf(' ') > -1) { + cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); }); + } else { + el.classList.remove(cls); + } + if (!el.classList.length) { + el.removeAttribute('class'); + } + } else { + var cur = " " + (el.getAttribute('class') || '') + " "; + var tar = ' ' + cls + ' '; + while (cur.indexOf(tar) >= 0) { + cur = cur.replace(tar, ' '); + } + cur = cur.trim(); + if (cur) { + el.setAttribute('class', cur); + } else { + el.removeAttribute('class'); + } + } +} + +/* */ + +function resolveTransition (def$$1) { + if (!def$$1) { + return + } + /* istanbul ignore else */ + if (typeof def$$1 === 'object') { + var res = {}; + if (def$$1.css !== false) { + extend(res, autoCssTransition(def$$1.name || 'v')); + } + extend(res, def$$1); + return res + } else if (typeof def$$1 === 'string') { + return autoCssTransition(def$$1) + } +} + +var autoCssTransition = cached(function (name) { + return { + enterClass: (name + "-enter"), + enterToClass: (name + "-enter-to"), + enterActiveClass: (name + "-enter-active"), + leaveClass: (name + "-leave"), + leaveToClass: (name + "-leave-to"), + leaveActiveClass: (name + "-leave-active") + } +}); + +var hasTransition = inBrowser && !isIE9; +var TRANSITION = 'transition'; +var ANIMATION = 'animation'; + +// Transition property/event sniffing +var transitionProp = 'transition'; +var transitionEndEvent = 'transitionend'; +var animationProp = 'animation'; +var animationEndEvent = 'animationend'; +if (hasTransition) { + /* istanbul ignore if */ + if (window.ontransitionend === undefined && + window.onwebkittransitionend !== undefined + ) { + transitionProp = 'WebkitTransition'; + transitionEndEvent = 'webkitTransitionEnd'; + } + if (window.onanimationend === undefined && + window.onwebkitanimationend !== undefined + ) { + animationProp = 'WebkitAnimation'; + animationEndEvent = 'webkitAnimationEnd'; + } +} + +// binding to window is necessary to make hot reload work in IE in strict mode +var raf = inBrowser + ? window.requestAnimationFrame + ? window.requestAnimationFrame.bind(window) + : setTimeout + : /* istanbul ignore next */ function (fn) { return fn(); }; + +function nextFrame (fn) { + raf(function () { + raf(fn); + }); +} + +function addTransitionClass (el, cls) { + var transitionClasses = el._transitionClasses || (el._transitionClasses = []); + if (transitionClasses.indexOf(cls) < 0) { + transitionClasses.push(cls); + addClass(el, cls); + } +} + +function removeTransitionClass (el, cls) { + if (el._transitionClasses) { + remove(el._transitionClasses, cls); + } + removeClass(el, cls); +} + +function whenTransitionEnds ( + el, + expectedType, + cb +) { + var ref = getTransitionInfo(el, expectedType); + var type = ref.type; + var timeout = ref.timeout; + var propCount = ref.propCount; + if (!type) { return cb() } + var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; + var ended = 0; + var end = function () { + el.removeEventListener(event, onEnd); + cb(); + }; + var onEnd = function (e) { + if (e.target === el) { + if (++ended >= propCount) { + end(); + } + } + }; + setTimeout(function () { + if (ended < propCount) { + end(); + } + }, timeout + 1); + el.addEventListener(event, onEnd); +} + +var transformRE = /\b(transform|all)(,|$)/; + +function getTransitionInfo (el, expectedType) { + var styles = window.getComputedStyle(el); + // JSDOM may return undefined for transition properties + var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', '); + var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', '); + var transitionTimeout = getTimeout(transitionDelays, transitionDurations); + var animationDelays = (styles[animationProp + 'Delay'] || '').split(', '); + var animationDurations = (styles[animationProp + 'Duration'] || '').split(', '); + var animationTimeout = getTimeout(animationDelays, animationDurations); + + var type; + var timeout = 0; + var propCount = 0; + /* istanbul ignore if */ + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; + } + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; + } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 + ? transitionTimeout > animationTimeout + ? TRANSITION + : ANIMATION + : null; + propCount = type + ? type === TRANSITION + ? transitionDurations.length + : animationDurations.length + : 0; + } + var hasTransform = + type === TRANSITION && + transformRE.test(styles[transitionProp + 'Property']); + return { + type: type, + timeout: timeout, + propCount: propCount, + hasTransform: hasTransform + } +} + +function getTimeout (delays, durations) { + /* istanbul ignore next */ + while (delays.length < durations.length) { + delays = delays.concat(delays); + } + + return Math.max.apply(null, durations.map(function (d, i) { + return toMs(d) + toMs(delays[i]) + })) +} + +// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers +// in a locale-dependent way, using a comma instead of a dot. +// If comma is not replaced with a dot, the input will be rounded down (i.e. acting +// as a floor function) causing unexpected behaviors +function toMs (s) { + return Number(s.slice(0, -1).replace(',', '.')) * 1000 +} + +/* */ + +function enter (vnode, toggleDisplay) { + var el = vnode.elm; + + // call leave callback now + if (isDef(el._leaveCb)) { + el._leaveCb.cancelled = true; + el._leaveCb(); + } + + var data = resolveTransition(vnode.data.transition); + if (isUndef(data)) { + return + } + + /* istanbul ignore if */ + if (isDef(el._enterCb) || el.nodeType !== 1) { + return + } + + var css = data.css; + var type = data.type; + var enterClass = data.enterClass; + var enterToClass = data.enterToClass; + var enterActiveClass = data.enterActiveClass; + var appearClass = data.appearClass; + var appearToClass = data.appearToClass; + var appearActiveClass = data.appearActiveClass; + var beforeEnter = data.beforeEnter; + var enter = data.enter; + var afterEnter = data.afterEnter; + var enterCancelled = data.enterCancelled; + var beforeAppear = data.beforeAppear; + var appear = data.appear; + var afterAppear = data.afterAppear; + var appearCancelled = data.appearCancelled; + var duration = data.duration; + + // activeInstance will always be the <transition> component managing this + // transition. One edge case to check is when the <transition> is placed + // as the root node of a child component. In that case we need to check + // <transition>'s parent for appear check. + var context = activeInstance; + var transitionNode = activeInstance.$vnode; + while (transitionNode && transitionNode.parent) { + transitionNode = transitionNode.parent; + context = transitionNode.context; + } + + var isAppear = !context._isMounted || !vnode.isRootInsert; + + if (isAppear && !appear && appear !== '') { + return + } + + var startClass = isAppear && appearClass + ? appearClass + : enterClass; + var activeClass = isAppear && appearActiveClass + ? appearActiveClass + : enterActiveClass; + var toClass = isAppear && appearToClass + ? appearToClass + : enterToClass; + + var beforeEnterHook = isAppear + ? (beforeAppear || beforeEnter) + : beforeEnter; + var enterHook = isAppear + ? (typeof appear === 'function' ? appear : enter) + : enter; + var afterEnterHook = isAppear + ? (afterAppear || afterEnter) + : afterEnter; + var enterCancelledHook = isAppear + ? (appearCancelled || enterCancelled) + : enterCancelled; + + var explicitEnterDuration = toNumber( + isObject(duration) + ? duration.enter + : duration + ); + + if ( true && explicitEnterDuration != null) { + checkDuration(explicitEnterDuration, 'enter', vnode); + } + + var expectsCSS = css !== false && !isIE9; + var userWantsControl = getHookArgumentsLength(enterHook); + + var cb = el._enterCb = once(function () { + if (expectsCSS) { + removeTransitionClass(el, toClass); + removeTransitionClass(el, activeClass); + } + if (cb.cancelled) { + if (expectsCSS) { + removeTransitionClass(el, startClass); + } + enterCancelledHook && enterCancelledHook(el); + } else { + afterEnterHook && afterEnterHook(el); + } + el._enterCb = null; + }); + + if (!vnode.data.show) { + // remove pending leave element on enter by injecting an insert hook + mergeVNodeHook(vnode, 'insert', function () { + var parent = el.parentNode; + var pendingNode = parent && parent._pending && parent._pending[vnode.key]; + if (pendingNode && + pendingNode.tag === vnode.tag && + pendingNode.elm._leaveCb + ) { + pendingNode.elm._leaveCb(); + } + enterHook && enterHook(el, cb); + }); + } + + // start enter transition + beforeEnterHook && beforeEnterHook(el); + if (expectsCSS) { + addTransitionClass(el, startClass); + addTransitionClass(el, activeClass); + nextFrame(function () { + removeTransitionClass(el, startClass); + if (!cb.cancelled) { + addTransitionClass(el, toClass); + if (!userWantsControl) { + if (isValidDuration(explicitEnterDuration)) { + setTimeout(cb, explicitEnterDuration); + } else { + whenTransitionEnds(el, type, cb); + } + } + } + }); + } + + if (vnode.data.show) { + toggleDisplay && toggleDisplay(); + enterHook && enterHook(el, cb); + } + + if (!expectsCSS && !userWantsControl) { + cb(); + } +} + +function leave (vnode, rm) { + var el = vnode.elm; + + // call enter callback now + if (isDef(el._enterCb)) { + el._enterCb.cancelled = true; + el._enterCb(); + } + + var data = resolveTransition(vnode.data.transition); + if (isUndef(data) || el.nodeType !== 1) { + return rm() + } + + /* istanbul ignore if */ + if (isDef(el._leaveCb)) { + return + } + + var css = data.css; + var type = data.type; + var leaveClass = data.leaveClass; + var leaveToClass = data.leaveToClass; + var leaveActiveClass = data.leaveActiveClass; + var beforeLeave = data.beforeLeave; + var leave = data.leave; + var afterLeave = data.afterLeave; + var leaveCancelled = data.leaveCancelled; + var delayLeave = data.delayLeave; + var duration = data.duration; + + var expectsCSS = css !== false && !isIE9; + var userWantsControl = getHookArgumentsLength(leave); + + var explicitLeaveDuration = toNumber( + isObject(duration) + ? duration.leave + : duration + ); + + if ( true && isDef(explicitLeaveDuration)) { + checkDuration(explicitLeaveDuration, 'leave', vnode); + } + + var cb = el._leaveCb = once(function () { + if (el.parentNode && el.parentNode._pending) { + el.parentNode._pending[vnode.key] = null; + } + if (expectsCSS) { + removeTransitionClass(el, leaveToClass); + removeTransitionClass(el, leaveActiveClass); + } + if (cb.cancelled) { + if (expectsCSS) { + removeTransitionClass(el, leaveClass); + } + leaveCancelled && leaveCancelled(el); + } else { + rm(); + afterLeave && afterLeave(el); + } + el._leaveCb = null; + }); + + if (delayLeave) { + delayLeave(performLeave); + } else { + performLeave(); + } + + function performLeave () { + // the delayed leave may have already been cancelled + if (cb.cancelled) { + return + } + // record leaving element + if (!vnode.data.show && el.parentNode) { + (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode; + } + beforeLeave && beforeLeave(el); + if (expectsCSS) { + addTransitionClass(el, leaveClass); + addTransitionClass(el, leaveActiveClass); + nextFrame(function () { + removeTransitionClass(el, leaveClass); + if (!cb.cancelled) { + addTransitionClass(el, leaveToClass); + if (!userWantsControl) { + if (isValidDuration(explicitLeaveDuration)) { + setTimeout(cb, explicitLeaveDuration); + } else { + whenTransitionEnds(el, type, cb); + } + } + } + }); + } + leave && leave(el, cb); + if (!expectsCSS && !userWantsControl) { + cb(); + } + } +} + +// only used in dev mode +function checkDuration (val, name, vnode) { + if (typeof val !== 'number') { + warn( + "<transition> explicit " + name + " duration is not a valid number - " + + "got " + (JSON.stringify(val)) + ".", + vnode.context + ); + } else if (isNaN(val)) { + warn( + "<transition> explicit " + name + " duration is NaN - " + + 'the duration expression might be incorrect.', + vnode.context + ); + } +} + +function isValidDuration (val) { + return typeof val === 'number' && !isNaN(val) +} + +/** + * Normalize a transition hook's argument length. The hook may be: + * - a merged hook (invoker) with the original in .fns + * - a wrapped component method (check ._length) + * - a plain function (.length) + */ +function getHookArgumentsLength (fn) { + if (isUndef(fn)) { + return false + } + var invokerFns = fn.fns; + if (isDef(invokerFns)) { + // invoker + return getHookArgumentsLength( + Array.isArray(invokerFns) + ? invokerFns[0] + : invokerFns + ) + } else { + return (fn._length || fn.length) > 1 + } +} + +function _enter (_, vnode) { + if (vnode.data.show !== true) { + enter(vnode); + } +} + +var transition = inBrowser ? { + create: _enter, + activate: _enter, + remove: function remove$$1 (vnode, rm) { + /* istanbul ignore else */ + if (vnode.data.show !== true) { + leave(vnode, rm); + } else { + rm(); + } + } +} : {}; + +var platformModules = [ + attrs, + klass, + events, + domProps, + style, + transition +]; + +/* */ + +// the directive module should be applied last, after all +// built-in modules have been applied. +var modules = platformModules.concat(baseModules); + +var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules }); + +/** + * Not type checking this file because flow doesn't like attaching + * properties to Elements. + */ + +/* istanbul ignore if */ +if (isIE9) { + // http://www.matts411.com/post/internet-explorer-9-oninput/ + document.addEventListener('selectionchange', function () { + var el = document.activeElement; + if (el && el.vmodel) { + trigger(el, 'input'); + } + }); +} + +var directive = { + inserted: function inserted (el, binding, vnode, oldVnode) { + if (vnode.tag === 'select') { + // #6903 + if (oldVnode.elm && !oldVnode.elm._vOptions) { + mergeVNodeHook(vnode, 'postpatch', function () { + directive.componentUpdated(el, binding, vnode); + }); + } else { + setSelected(el, binding, vnode.context); + } + el._vOptions = [].map.call(el.options, getValue); + } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) { + el._vModifiers = binding.modifiers; + if (!binding.modifiers.lazy) { + el.addEventListener('compositionstart', onCompositionStart); + el.addEventListener('compositionend', onCompositionEnd); + // Safari < 10.2 & UIWebView doesn't fire compositionend when + // switching focus before confirming composition choice + // this also fixes the issue where some browsers e.g. iOS Chrome + // fires "change" instead of "input" on autocomplete. + el.addEventListener('change', onCompositionEnd); + /* istanbul ignore if */ + if (isIE9) { + el.vmodel = true; + } + } + } + }, + + componentUpdated: function componentUpdated (el, binding, vnode) { + if (vnode.tag === 'select') { + setSelected(el, binding, vnode.context); + // in case the options rendered by v-for have changed, + // it's possible that the value is out-of-sync with the rendered options. + // detect such cases and filter out values that no longer has a matching + // option in the DOM. + var prevOptions = el._vOptions; + var curOptions = el._vOptions = [].map.call(el.options, getValue); + if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) { + // trigger change event if + // no matching option found for at least one value + var needReset = el.multiple + ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); }) + : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions); + if (needReset) { + trigger(el, 'change'); + } + } + } + } +}; + +function setSelected (el, binding, vm) { + actuallySetSelected(el, binding, vm); + /* istanbul ignore if */ + if (isIE || isEdge) { + setTimeout(function () { + actuallySetSelected(el, binding, vm); + }, 0); + } +} + +function actuallySetSelected (el, binding, vm) { + var value = binding.value; + var isMultiple = el.multiple; + if (isMultiple && !Array.isArray(value)) { + true && warn( + "<select multiple v-model=\"" + (binding.expression) + "\"> " + + "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)), + vm + ); + return + } + var selected, option; + for (var i = 0, l = el.options.length; i < l; i++) { + option = el.options[i]; + if (isMultiple) { + selected = looseIndexOf(value, getValue(option)) > -1; + if (option.selected !== selected) { + option.selected = selected; + } + } else { + if (looseEqual(getValue(option), value)) { + if (el.selectedIndex !== i) { + el.selectedIndex = i; + } + return + } + } + } + if (!isMultiple) { + el.selectedIndex = -1; + } +} + +function hasNoMatchingOption (value, options) { + return options.every(function (o) { return !looseEqual(o, value); }) +} + +function getValue (option) { + return '_value' in option + ? option._value + : option.value +} + +function onCompositionStart (e) { + e.target.composing = true; +} + +function onCompositionEnd (e) { + // prevent triggering an input event for no reason + if (!e.target.composing) { return } + e.target.composing = false; + trigger(e.target, 'input'); +} + +function trigger (el, type) { + var e = document.createEvent('HTMLEvents'); + e.initEvent(type, true, true); + el.dispatchEvent(e); +} + +/* */ + +// recursively search for possible transition defined inside the component root +function locateNode (vnode) { + return vnode.componentInstance && (!vnode.data || !vnode.data.transition) + ? locateNode(vnode.componentInstance._vnode) + : vnode +} + +var show = { + bind: function bind (el, ref, vnode) { + var value = ref.value; + + vnode = locateNode(vnode); + var transition$$1 = vnode.data && vnode.data.transition; + var originalDisplay = el.__vOriginalDisplay = + el.style.display === 'none' ? '' : el.style.display; + if (value && transition$$1) { + vnode.data.show = true; + enter(vnode, function () { + el.style.display = originalDisplay; + }); + } else { + el.style.display = value ? originalDisplay : 'none'; + } + }, + + update: function update (el, ref, vnode) { + var value = ref.value; + var oldValue = ref.oldValue; + + /* istanbul ignore if */ + if (!value === !oldValue) { return } + vnode = locateNode(vnode); + var transition$$1 = vnode.data && vnode.data.transition; + if (transition$$1) { + vnode.data.show = true; + if (value) { + enter(vnode, function () { + el.style.display = el.__vOriginalDisplay; + }); + } else { + leave(vnode, function () { + el.style.display = 'none'; + }); + } + } else { + el.style.display = value ? el.__vOriginalDisplay : 'none'; + } + }, + + unbind: function unbind ( + el, + binding, + vnode, + oldVnode, + isDestroy + ) { + if (!isDestroy) { + el.style.display = el.__vOriginalDisplay; + } + } +}; + +var platformDirectives = { + model: directive, + show: show +}; + +/* */ + +var transitionProps = { + name: String, + appear: Boolean, + css: Boolean, + mode: String, + type: String, + enterClass: String, + leaveClass: String, + enterToClass: String, + leaveToClass: String, + enterActiveClass: String, + leaveActiveClass: String, + appearClass: String, + appearActiveClass: String, + appearToClass: String, + duration: [Number, String, Object] +}; + +// in case the child is also an abstract component, e.g. <keep-alive> +// we want to recursively retrieve the real component to be rendered +function getRealChild (vnode) { + var compOptions = vnode && vnode.componentOptions; + if (compOptions && compOptions.Ctor.options.abstract) { + return getRealChild(getFirstComponentChild(compOptions.children)) + } else { + return vnode + } +} + +function extractTransitionData (comp) { + var data = {}; + var options = comp.$options; + // props + for (var key in options.propsData) { + data[key] = comp[key]; + } + // events. + // extract listeners and pass them directly to the transition methods + var listeners = options._parentListeners; + for (var key$1 in listeners) { + data[camelize(key$1)] = listeners[key$1]; + } + return data +} + +function placeholder (h, rawChild) { + if (/\d-keep-alive$/.test(rawChild.tag)) { + return h('keep-alive', { + props: rawChild.componentOptions.propsData + }) + } +} + +function hasParentTransition (vnode) { + while ((vnode = vnode.parent)) { + if (vnode.data.transition) { + return true + } + } +} + +function isSameChild (child, oldChild) { + return oldChild.key === child.key && oldChild.tag === child.tag +} + +var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); }; + +var isVShowDirective = function (d) { return d.name === 'show'; }; + +var Transition = { + name: 'transition', + props: transitionProps, + abstract: true, + + render: function render (h) { + var this$1 = this; + + var children = this.$slots.default; + if (!children) { + return + } + + // filter out text nodes (possible whitespaces) + children = children.filter(isNotTextNode); + /* istanbul ignore if */ + if (!children.length) { + return + } + + // warn multiple elements + if ( true && children.length > 1) { + warn( + '<transition> can only be used on a single element. Use ' + + '<transition-group> for lists.', + this.$parent + ); + } + + var mode = this.mode; + + // warn invalid mode + if ( true && + mode && mode !== 'in-out' && mode !== 'out-in' + ) { + warn( + 'invalid <transition> mode: ' + mode, + this.$parent + ); + } + + var rawChild = children[0]; + + // if this is a component root node and the component's + // parent container node also has transition, skip. + if (hasParentTransition(this.$vnode)) { + return rawChild + } + + // apply transition data to child + // use getRealChild() to ignore abstract components e.g. keep-alive + var child = getRealChild(rawChild); + /* istanbul ignore if */ + if (!child) { + return rawChild + } + + if (this._leaving) { + return placeholder(h, rawChild) + } + + // ensure a key that is unique to the vnode type and to this transition + // component instance. This key will be used to remove pending leaving nodes + // during entering. + var id = "__transition-" + (this._uid) + "-"; + child.key = child.key == null + ? child.isComment + ? id + 'comment' + : id + child.tag + : isPrimitive(child.key) + ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key) + : child.key; + + var data = (child.data || (child.data = {})).transition = extractTransitionData(this); + var oldRawChild = this._vnode; + var oldChild = getRealChild(oldRawChild); + + // mark v-show + // so that the transition module can hand over the control to the directive + if (child.data.directives && child.data.directives.some(isVShowDirective)) { + child.data.show = true; + } + + if ( + oldChild && + oldChild.data && + !isSameChild(child, oldChild) && + !isAsyncPlaceholder(oldChild) && + // #6687 component root is a comment node + !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment) + ) { + // replace old child transition data with fresh one + // important for dynamic transitions! + var oldData = oldChild.data.transition = extend({}, data); + // handle transition mode + if (mode === 'out-in') { + // return placeholder node and queue update when leave finishes + this._leaving = true; + mergeVNodeHook(oldData, 'afterLeave', function () { + this$1._leaving = false; + this$1.$forceUpdate(); + }); + return placeholder(h, rawChild) + } else if (mode === 'in-out') { + if (isAsyncPlaceholder(child)) { + return oldRawChild + } + var delayedLeave; + var performLeave = function () { delayedLeave(); }; + mergeVNodeHook(data, 'afterEnter', performLeave); + mergeVNodeHook(data, 'enterCancelled', performLeave); + mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; }); + } + } + + return rawChild + } +}; + +/* */ + +var props = extend({ + tag: String, + moveClass: String +}, transitionProps); + +delete props.mode; + +var TransitionGroup = { + props: props, + + beforeMount: function beforeMount () { + var this$1 = this; + + var update = this._update; + this._update = function (vnode, hydrating) { + var restoreActiveInstance = setActiveInstance(this$1); + // force removing pass + this$1.__patch__( + this$1._vnode, + this$1.kept, + false, // hydrating + true // removeOnly (!important, avoids unnecessary moves) + ); + this$1._vnode = this$1.kept; + restoreActiveInstance(); + update.call(this$1, vnode, hydrating); + }; + }, + + render: function render (h) { + var tag = this.tag || this.$vnode.data.tag || 'span'; + var map = Object.create(null); + var prevChildren = this.prevChildren = this.children; + var rawChildren = this.$slots.default || []; + var children = this.children = []; + var transitionData = extractTransitionData(this); + + for (var i = 0; i < rawChildren.length; i++) { + var c = rawChildren[i]; + if (c.tag) { + if (c.key != null && String(c.key).indexOf('__vlist') !== 0) { + children.push(c); + map[c.key] = c + ;(c.data || (c.data = {})).transition = transitionData; + } else if (true) { + var opts = c.componentOptions; + var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag; + warn(("<transition-group> children must be keyed: <" + name + ">")); + } + } + } + + if (prevChildren) { + var kept = []; + var removed = []; + for (var i$1 = 0; i$1 < prevChildren.length; i$1++) { + var c$1 = prevChildren[i$1]; + c$1.data.transition = transitionData; + c$1.data.pos = c$1.elm.getBoundingClientRect(); + if (map[c$1.key]) { + kept.push(c$1); + } else { + removed.push(c$1); + } + } + this.kept = h(tag, null, kept); + this.removed = removed; + } + + return h(tag, null, children) + }, + + updated: function updated () { + var children = this.prevChildren; + var moveClass = this.moveClass || ((this.name || 'v') + '-move'); + if (!children.length || !this.hasMove(children[0].elm, moveClass)) { + return + } + + // we divide the work into three loops to avoid mixing DOM reads and writes + // in each iteration - which helps prevent layout thrashing. + children.forEach(callPendingCbs); + children.forEach(recordPosition); + children.forEach(applyTranslation); + + // force reflow to put everything in position + // assign to this to avoid being removed in tree-shaking + // $flow-disable-line + this._reflow = document.body.offsetHeight; + + children.forEach(function (c) { + if (c.data.moved) { + var el = c.elm; + var s = el.style; + addTransitionClass(el, moveClass); + s.transform = s.WebkitTransform = s.transitionDuration = ''; + el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { + if (e && e.target !== el) { + return + } + if (!e || /transform$/.test(e.propertyName)) { + el.removeEventListener(transitionEndEvent, cb); + el._moveCb = null; + removeTransitionClass(el, moveClass); + } + }); + } + }); + }, + + methods: { + hasMove: function hasMove (el, moveClass) { + /* istanbul ignore if */ + if (!hasTransition) { + return false + } + /* istanbul ignore if */ + if (this._hasMove) { + return this._hasMove + } + // Detect whether an element with the move class applied has + // CSS transitions. Since the element may be inside an entering + // transition at this very moment, we make a clone of it and remove + // all other transition classes applied to ensure only the move class + // is applied. + var clone = el.cloneNode(); + if (el._transitionClasses) { + el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); }); + } + addClass(clone, moveClass); + clone.style.display = 'none'; + this.$el.appendChild(clone); + var info = getTransitionInfo(clone); + this.$el.removeChild(clone); + return (this._hasMove = info.hasTransform) + } + } +}; + +function callPendingCbs (c) { + /* istanbul ignore if */ + if (c.elm._moveCb) { + c.elm._moveCb(); + } + /* istanbul ignore if */ + if (c.elm._enterCb) { + c.elm._enterCb(); + } +} + +function recordPosition (c) { + c.data.newPos = c.elm.getBoundingClientRect(); +} + +function applyTranslation (c) { + var oldPos = c.data.pos; + var newPos = c.data.newPos; + var dx = oldPos.left - newPos.left; + var dy = oldPos.top - newPos.top; + if (dx || dy) { + c.data.moved = true; + var s = c.elm.style; + s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)"; + s.transitionDuration = '0s'; + } +} + +var platformComponents = { + Transition: Transition, + TransitionGroup: TransitionGroup +}; + +/* */ + +// install platform specific utils +Vue.config.mustUseProp = mustUseProp; +Vue.config.isReservedTag = isReservedTag; +Vue.config.isReservedAttr = isReservedAttr; +Vue.config.getTagNamespace = getTagNamespace; +Vue.config.isUnknownElement = isUnknownElement; + +// install platform runtime directives & components +extend(Vue.options.directives, platformDirectives); +extend(Vue.options.components, platformComponents); + +// install platform patch function +Vue.prototype.__patch__ = inBrowser ? patch : noop; + +// public mount method +Vue.prototype.$mount = function ( + el, + hydrating +) { + el = el && inBrowser ? query(el) : undefined; + return mountComponent(this, el, hydrating) +}; + +// devtools global hook +/* istanbul ignore next */ +if (inBrowser) { + setTimeout(function () { + if (config.devtools) { + if (devtools) { + devtools.emit('init', Vue); + } else if ( + true && + isChrome + ) { + console[console.info ? 'info' : 'log']( + 'Download the Vue Devtools extension for a better development experience:\n' + + 'https://github.com/vuejs/vue-devtools' + ); + } + } + if ( true && + config.productionTip !== false && + typeof console !== 'undefined' + ) { + console[console.info ? 'info' : 'log']( + "You are running Vue in development mode.\n" + + "Make sure to turn on production mode when deploying for production.\n" + + "See more tips at https://vuejs.org/guide/deployment.html" + ); + } + }, 0); +} + +/* */ + +var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g; +var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g; + +var buildRegex = cached(function (delimiters) { + var open = delimiters[0].replace(regexEscapeRE, '\\$&'); + var close = delimiters[1].replace(regexEscapeRE, '\\$&'); + return new RegExp(open + '((?:.|\\n)+?)' + close, 'g') +}); + + + +function parseText ( + text, + delimiters +) { + var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE; + if (!tagRE.test(text)) { + return + } + var tokens = []; + var rawTokens = []; + var lastIndex = tagRE.lastIndex = 0; + var match, index, tokenValue; + while ((match = tagRE.exec(text))) { + index = match.index; + // push text token + if (index > lastIndex) { + rawTokens.push(tokenValue = text.slice(lastIndex, index)); + tokens.push(JSON.stringify(tokenValue)); + } + // tag token + var exp = parseFilters(match[1].trim()); + tokens.push(("_s(" + exp + ")")); + rawTokens.push({ '@binding': exp }); + lastIndex = index + match[0].length; + } + if (lastIndex < text.length) { + rawTokens.push(tokenValue = text.slice(lastIndex)); + tokens.push(JSON.stringify(tokenValue)); + } + return { + expression: tokens.join('+'), + tokens: rawTokens + } +} + +/* */ + +function transformNode (el, options) { + var warn = options.warn || baseWarn; + var staticClass = getAndRemoveAttr(el, 'class'); + if ( true && staticClass) { + var res = parseText(staticClass, options.delimiters); + if (res) { + warn( + "class=\"" + staticClass + "\": " + + 'Interpolation inside attributes has been removed. ' + + 'Use v-bind or the colon shorthand instead. For example, ' + + 'instead of <div class="{{ val }}">, use <div :class="val">.' + ); + } + } + if (staticClass) { + el.staticClass = JSON.stringify(staticClass); + } + var classBinding = getBindingAttr(el, 'class', false /* getStatic */); + if (classBinding) { + el.classBinding = classBinding; + } +} + +function genData (el) { + var data = ''; + if (el.staticClass) { + data += "staticClass:" + (el.staticClass) + ","; + } + if (el.classBinding) { + data += "class:" + (el.classBinding) + ","; + } + return data +} + +var klass$1 = { + staticKeys: ['staticClass'], + transformNode: transformNode, + genData: genData +}; + +/* */ + +function transformNode$1 (el, options) { + var warn = options.warn || baseWarn; + var staticStyle = getAndRemoveAttr(el, 'style'); + if (staticStyle) { + /* istanbul ignore if */ + if (true) { + var res = parseText(staticStyle, options.delimiters); + if (res) { + warn( + "style=\"" + staticStyle + "\": " + + 'Interpolation inside attributes has been removed. ' + + 'Use v-bind or the colon shorthand instead. For example, ' + + 'instead of <div style="{{ val }}">, use <div :style="val">.' + ); + } + } + el.staticStyle = JSON.stringify(parseStyleText(staticStyle)); + } + + var styleBinding = getBindingAttr(el, 'style', false /* getStatic */); + if (styleBinding) { + el.styleBinding = styleBinding; + } +} + +function genData$1 (el) { + var data = ''; + if (el.staticStyle) { + data += "staticStyle:" + (el.staticStyle) + ","; + } + if (el.styleBinding) { + data += "style:(" + (el.styleBinding) + "),"; + } + return data +} + +var style$1 = { + staticKeys: ['staticStyle'], + transformNode: transformNode$1, + genData: genData$1 +}; + +/* */ + +var decoder; + +var he = { + decode: function decode (html) { + decoder = decoder || document.createElement('div'); + decoder.innerHTML = html; + return decoder.textContent + } +}; + +/* */ + +var isUnaryTag = makeMap( + 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + + 'link,meta,param,source,track,wbr' +); + +// Elements that you can, intentionally, leave open +// (and which close themselves) +var canBeLeftOpenTag = makeMap( + 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source' +); + +// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3 +// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content +var isNonPhrasingTag = makeMap( + 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' + + 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' + + 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' + + 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' + + 'title,tr,track' +); + +/** + * Not type-checking this file because it's mostly vendor code. + */ + +// Regular Expressions for parsing tags and attributes +var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; +// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName +// but for Vue templates we can enforce a simple charset +var ncname = '[a-zA-Z_][\\w\\-\\.]*'; +var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")"; +var startTagOpen = new RegExp(("^<" + qnameCapture)); +var startTagClose = /^\s*(\/?)>/; +var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); +var doctype = /^<!DOCTYPE [^>]+>/i; +// #7298: escape - to avoid being pased as HTML comment when inlined in page +var comment = /^<!\--/; +var conditionalComment = /^<!\[/; + +// Special Elements (can contain anything) +var isPlainTextElement = makeMap('script,style,textarea', true); +var reCache = {}; + +var decodingMap = { + '<': '<', + '>': '>', + '"': '"', + '&': '&', + ' ': '\n', + ' ': '\t' +}; +var encodedAttr = /&(?:lt|gt|quot|amp);/g; +var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10|#9);/g; + +// #5992 +var isIgnoreNewlineTag = makeMap('pre,textarea', true); +var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; }; + +function decodeAttr (value, shouldDecodeNewlines) { + var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr; + return value.replace(re, function (match) { return decodingMap[match]; }) +} + +function parseHTML (html, options) { + var stack = []; + var expectHTML = options.expectHTML; + var isUnaryTag$$1 = options.isUnaryTag || no; + var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no; + var index = 0; + var last, lastTag; + while (html) { + last = html; + // Make sure we're not in a plaintext content element like script/style + if (!lastTag || !isPlainTextElement(lastTag)) { + var textEnd = html.indexOf('<'); + if (textEnd === 0) { + // Comment: + if (comment.test(html)) { + var commentEnd = html.indexOf('-->'); + + if (commentEnd >= 0) { + if (options.shouldKeepComment) { + options.comment(html.substring(4, commentEnd)); + } + advance(commentEnd + 3); + continue + } + } + + // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment + if (conditionalComment.test(html)) { + var conditionalEnd = html.indexOf(']>'); + + if (conditionalEnd >= 0) { + advance(conditionalEnd + 2); + continue + } + } + + // Doctype: + var doctypeMatch = html.match(doctype); + if (doctypeMatch) { + advance(doctypeMatch[0].length); + continue + } + + // End tag: + var endTagMatch = html.match(endTag); + if (endTagMatch) { + var curIndex = index; + advance(endTagMatch[0].length); + parseEndTag(endTagMatch[1], curIndex, index); + continue + } + + // Start tag: + var startTagMatch = parseStartTag(); + if (startTagMatch) { + handleStartTag(startTagMatch); + if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) { + advance(1); + } + continue + } + } + + var text = (void 0), rest = (void 0), next = (void 0); + if (textEnd >= 0) { + rest = html.slice(textEnd); + while ( + !endTag.test(rest) && + !startTagOpen.test(rest) && + !comment.test(rest) && + !conditionalComment.test(rest) + ) { + // < in plain text, be forgiving and treat it as text + next = rest.indexOf('<', 1); + if (next < 0) { break } + textEnd += next; + rest = html.slice(textEnd); + } + text = html.substring(0, textEnd); + advance(textEnd); + } + + if (textEnd < 0) { + text = html; + html = ''; + } + + if (options.chars && text) { + options.chars(text); + } + } else { + var endTagLength = 0; + var stackedTag = lastTag.toLowerCase(); + var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i')); + var rest$1 = html.replace(reStackedTag, function (all, text, endTag) { + endTagLength = endTag.length; + if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') { + text = text + .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298 + .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); + } + if (shouldIgnoreFirstNewline(stackedTag, text)) { + text = text.slice(1); + } + if (options.chars) { + options.chars(text); + } + return '' + }); + index += html.length - rest$1.length; + html = rest$1; + parseEndTag(stackedTag, index - endTagLength, index); + } + + if (html === last) { + options.chars && options.chars(html); + if ( true && !stack.length && options.warn) { + options.warn(("Mal-formatted tag at end of template: \"" + html + "\"")); + } + break + } + } + + // Clean up any remaining tags + parseEndTag(); + + function advance (n) { + index += n; + html = html.substring(n); + } + + function parseStartTag () { + var start = html.match(startTagOpen); + if (start) { + var match = { + tagName: start[1], + attrs: [], + start: index + }; + advance(start[0].length); + var end, attr; + while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) { + advance(attr[0].length); + match.attrs.push(attr); + } + if (end) { + match.unarySlash = end[1]; + advance(end[0].length); + match.end = index; + return match + } + } + } + + function handleStartTag (match) { + var tagName = match.tagName; + var unarySlash = match.unarySlash; + + if (expectHTML) { + if (lastTag === 'p' && isNonPhrasingTag(tagName)) { + parseEndTag(lastTag); + } + if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) { + parseEndTag(tagName); + } + } + + var unary = isUnaryTag$$1(tagName) || !!unarySlash; + + var l = match.attrs.length; + var attrs = new Array(l); + for (var i = 0; i < l; i++) { + var args = match.attrs[i]; + var value = args[3] || args[4] || args[5] || ''; + var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href' + ? options.shouldDecodeNewlinesForHref + : options.shouldDecodeNewlines; + attrs[i] = { + name: args[1], + value: decodeAttr(value, shouldDecodeNewlines) + }; + } + + if (!unary) { + stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs }); + lastTag = tagName; + } + + if (options.start) { + options.start(tagName, attrs, unary, match.start, match.end); + } + } + + function parseEndTag (tagName, start, end) { + var pos, lowerCasedTagName; + if (start == null) { start = index; } + if (end == null) { end = index; } + + // Find the closest opened tag of the same type + if (tagName) { + lowerCasedTagName = tagName.toLowerCase(); + for (pos = stack.length - 1; pos >= 0; pos--) { + if (stack[pos].lowerCasedTag === lowerCasedTagName) { + break + } + } + } else { + // If no tag name is provided, clean shop + pos = 0; + } + + if (pos >= 0) { + // Close all the open elements, up the stack + for (var i = stack.length - 1; i >= pos; i--) { + if ( true && + (i > pos || !tagName) && + options.warn + ) { + options.warn( + ("tag <" + (stack[i].tag) + "> has no matching end tag.") + ); + } + if (options.end) { + options.end(stack[i].tag, start, end); + } + } + + // Remove the open elements from the stack + stack.length = pos; + lastTag = pos && stack[pos - 1].tag; + } else if (lowerCasedTagName === 'br') { + if (options.start) { + options.start(tagName, [], true, start, end); + } + } else if (lowerCasedTagName === 'p') { + if (options.start) { + options.start(tagName, [], false, start, end); + } + if (options.end) { + options.end(tagName, start, end); + } + } + } +} + +/* */ + +var onRE = /^@|^v-on:/; +var dirRE = /^v-|^@|^:/; +var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; +var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; +var stripParensRE = /^\(|\)$/g; + +var argRE = /:(.*)$/; +var bindRE = /^:|^v-bind:/; +var modifierRE = /\.[^.]+/g; + +var decodeHTMLCached = cached(he.decode); + +// configurable state +var warn$2; +var delimiters; +var transforms; +var preTransforms; +var postTransforms; +var platformIsPreTag; +var platformMustUseProp; +var platformGetTagNamespace; + + + +function createASTElement ( + tag, + attrs, + parent +) { + return { + type: 1, + tag: tag, + attrsList: attrs, + attrsMap: makeAttrsMap(attrs), + parent: parent, + children: [] + } +} + +/** + * Convert HTML string to AST. + */ +function parse ( + template, + options +) { + warn$2 = options.warn || baseWarn; + + platformIsPreTag = options.isPreTag || no; + platformMustUseProp = options.mustUseProp || no; + platformGetTagNamespace = options.getTagNamespace || no; + + transforms = pluckModuleFunction(options.modules, 'transformNode'); + preTransforms = pluckModuleFunction(options.modules, 'preTransformNode'); + postTransforms = pluckModuleFunction(options.modules, 'postTransformNode'); + + delimiters = options.delimiters; + + var stack = []; + var preserveWhitespace = options.preserveWhitespace !== false; + var root; + var currentParent; + var inVPre = false; + var inPre = false; + var warned = false; + + function warnOnce (msg) { + if (!warned) { + warned = true; + warn$2(msg); + } + } + + function closeElement (element) { + // check pre state + if (element.pre) { + inVPre = false; + } + if (platformIsPreTag(element.tag)) { + inPre = false; + } + // apply post-transforms + for (var i = 0; i < postTransforms.length; i++) { + postTransforms[i](element, options); + } + } + + parseHTML(template, { + warn: warn$2, + expectHTML: options.expectHTML, + isUnaryTag: options.isUnaryTag, + canBeLeftOpenTag: options.canBeLeftOpenTag, + shouldDecodeNewlines: options.shouldDecodeNewlines, + shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref, + shouldKeepComment: options.comments, + start: function start (tag, attrs, unary) { + // check namespace. + // inherit parent ns if there is one + var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag); + + // handle IE svg bug + /* istanbul ignore if */ + if (isIE && ns === 'svg') { + attrs = guardIESVGBug(attrs); + } + + var element = createASTElement(tag, attrs, currentParent); + if (ns) { + element.ns = ns; + } + + if (isForbiddenTag(element) && !isServerRendering()) { + element.forbidden = true; + true && warn$2( + 'Templates should only be responsible for mapping the state to the ' + + 'UI. Avoid placing tags with side-effects in your templates, such as ' + + "<" + tag + ">" + ', as they will not be parsed.' + ); + } + + // apply pre-transforms + for (var i = 0; i < preTransforms.length; i++) { + element = preTransforms[i](element, options) || element; + } + + if (!inVPre) { + processPre(element); + if (element.pre) { + inVPre = true; + } + } + if (platformIsPreTag(element.tag)) { + inPre = true; + } + if (inVPre) { + processRawAttrs(element); + } else if (!element.processed) { + // structural directives + processFor(element); + processIf(element); + processOnce(element); + // element-scope stuff + processElement(element, options); + } + + function checkRootConstraints (el) { + if (true) { + if (el.tag === 'slot' || el.tag === 'template') { + warnOnce( + "Cannot use <" + (el.tag) + "> as component root element because it may " + + 'contain multiple nodes.' + ); + } + if (el.attrsMap.hasOwnProperty('v-for')) { + warnOnce( + 'Cannot use v-for on stateful component root element because ' + + 'it renders multiple elements.' + ); + } + } + } + + // tree management + if (!root) { + root = element; + checkRootConstraints(root); + } else if (!stack.length) { + // allow root elements with v-if, v-else-if and v-else + if (root.if && (element.elseif || element.else)) { + checkRootConstraints(element); + addIfCondition(root, { + exp: element.elseif, + block: element + }); + } else if (true) { + warnOnce( + "Component template should contain exactly one root element. " + + "If you are using v-if on multiple elements, " + + "use v-else-if to chain them instead." + ); + } + } + if (currentParent && !element.forbidden) { + if (element.elseif || element.else) { + processIfConditions(element, currentParent); + } else if (element.slotScope) { // scoped slot + currentParent.plain = false; + var name = element.slotTarget || '"default"' + ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element; + } else { + currentParent.children.push(element); + element.parent = currentParent; + } + } + if (!unary) { + currentParent = element; + stack.push(element); + } else { + closeElement(element); + } + }, + + end: function end () { + // remove trailing whitespace + var element = stack[stack.length - 1]; + var lastNode = element.children[element.children.length - 1]; + if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) { + element.children.pop(); + } + // pop stack + stack.length -= 1; + currentParent = stack[stack.length - 1]; + closeElement(element); + }, + + chars: function chars (text) { + if (!currentParent) { + if (true) { + if (text === template) { + warnOnce( + 'Component template requires a root element, rather than just text.' + ); + } else if ((text = text.trim())) { + warnOnce( + ("text \"" + text + "\" outside root element will be ignored.") + ); + } + } + return + } + // IE textarea placeholder bug + /* istanbul ignore if */ + if (isIE && + currentParent.tag === 'textarea' && + currentParent.attrsMap.placeholder === text + ) { + return + } + var children = currentParent.children; + text = inPre || text.trim() + ? isTextTag(currentParent) ? text : decodeHTMLCached(text) + // only preserve whitespace if its not right after a starting tag + : preserveWhitespace && children.length ? ' ' : ''; + if (text) { + var res; + if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) { + children.push({ + type: 2, + expression: res.expression, + tokens: res.tokens, + text: text + }); + } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') { + children.push({ + type: 3, + text: text + }); + } + } + }, + comment: function comment (text) { + currentParent.children.push({ + type: 3, + text: text, + isComment: true + }); + } + }); + return root +} + +function processPre (el) { + if (getAndRemoveAttr(el, 'v-pre') != null) { + el.pre = true; + } +} + +function processRawAttrs (el) { + var l = el.attrsList.length; + if (l) { + var attrs = el.attrs = new Array(l); + for (var i = 0; i < l; i++) { + attrs[i] = { + name: el.attrsList[i].name, + value: JSON.stringify(el.attrsList[i].value) + }; + } + } else if (!el.pre) { + // non root node in pre blocks with no attributes + el.plain = true; + } +} + +function processElement (element, options) { + processKey(element); + + // determine whether this is a plain element after + // removing structural attributes + element.plain = !element.key && !element.attrsList.length; + + processRef(element); + processSlot(element); + processComponent(element); + for (var i = 0; i < transforms.length; i++) { + element = transforms[i](element, options) || element; + } + processAttrs(element); +} + +function processKey (el) { + var exp = getBindingAttr(el, 'key'); + if (exp) { + if (true) { + if (el.tag === 'template') { + warn$2("<template> cannot be keyed. Place the key on real elements instead."); + } + if (el.for) { + var iterator = el.iterator2 || el.iterator1; + var parent = el.parent; + if (iterator && iterator === exp && parent && parent.tag === 'transition-group') { + warn$2( + "Do not use v-for index as key on <transition-group> children, " + + "this is the same as not using keys." + ); + } + } + } + el.key = exp; + } +} + +function processRef (el) { + var ref = getBindingAttr(el, 'ref'); + if (ref) { + el.ref = ref; + el.refInFor = checkInFor(el); + } +} + +function processFor (el) { + var exp; + if ((exp = getAndRemoveAttr(el, 'v-for'))) { + var res = parseFor(exp); + if (res) { + extend(el, res); + } else if (true) { + warn$2( + ("Invalid v-for expression: " + exp) + ); + } + } +} + + + +function parseFor (exp) { + var inMatch = exp.match(forAliasRE); + if (!inMatch) { return } + var res = {}; + res.for = inMatch[2].trim(); + var alias = inMatch[1].trim().replace(stripParensRE, ''); + var iteratorMatch = alias.match(forIteratorRE); + if (iteratorMatch) { + res.alias = alias.replace(forIteratorRE, '').trim(); + res.iterator1 = iteratorMatch[1].trim(); + if (iteratorMatch[2]) { + res.iterator2 = iteratorMatch[2].trim(); + } + } else { + res.alias = alias; + } + return res +} + +function processIf (el) { + var exp = getAndRemoveAttr(el, 'v-if'); + if (exp) { + el.if = exp; + addIfCondition(el, { + exp: exp, + block: el + }); + } else { + if (getAndRemoveAttr(el, 'v-else') != null) { + el.else = true; + } + var elseif = getAndRemoveAttr(el, 'v-else-if'); + if (elseif) { + el.elseif = elseif; + } + } +} + +function processIfConditions (el, parent) { + var prev = findPrevElement(parent.children); + if (prev && prev.if) { + addIfCondition(prev, { + exp: el.elseif, + block: el + }); + } else if (true) { + warn$2( + "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " + + "used on element <" + (el.tag) + "> without corresponding v-if." + ); + } +} + +function findPrevElement (children) { + var i = children.length; + while (i--) { + if (children[i].type === 1) { + return children[i] + } else { + if ( true && children[i].text !== ' ') { + warn$2( + "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " + + "will be ignored." + ); + } + children.pop(); + } + } +} + +function addIfCondition (el, condition) { + if (!el.ifConditions) { + el.ifConditions = []; + } + el.ifConditions.push(condition); +} + +function processOnce (el) { + var once$$1 = getAndRemoveAttr(el, 'v-once'); + if (once$$1 != null) { + el.once = true; + } +} + +function processSlot (el) { + if (el.tag === 'slot') { + el.slotName = getBindingAttr(el, 'name'); + if ( true && el.key) { + warn$2( + "`key` does not work on <slot> because slots are abstract outlets " + + "and can possibly expand into multiple elements. " + + "Use the key on a wrapping element instead." + ); + } + } else { + var slotScope; + if (el.tag === 'template') { + slotScope = getAndRemoveAttr(el, 'scope'); + /* istanbul ignore if */ + if ( true && slotScope) { + warn$2( + "the \"scope\" attribute for scoped slots have been deprecated and " + + "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + + "can also be used on plain elements in addition to <template> to " + + "denote scoped slots.", + true + ); + } + el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); + } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { + /* istanbul ignore if */ + if ( true && el.attrsMap['v-for']) { + warn$2( + "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " + + "(v-for takes higher priority). Use a wrapper <template> for the " + + "scoped slot to make it clearer.", + true + ); + } + el.slotScope = slotScope; + } + var slotTarget = getBindingAttr(el, 'slot'); + if (slotTarget) { + el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget; + // preserve slot as an attribute for native shadow DOM compat + // only for non-scoped slots. + if (el.tag !== 'template' && !el.slotScope) { + addAttr(el, 'slot', slotTarget); + } + } + } +} + +function processComponent (el) { + var binding; + if ((binding = getBindingAttr(el, 'is'))) { + el.component = binding; + } + if (getAndRemoveAttr(el, 'inline-template') != null) { + el.inlineTemplate = true; + } +} + +function processAttrs (el) { + var list = el.attrsList; + var i, l, name, rawName, value, modifiers, isProp; + for (i = 0, l = list.length; i < l; i++) { + name = rawName = list[i].name; + value = list[i].value; + if (dirRE.test(name)) { + // mark element as dynamic + el.hasBindings = true; + // modifiers + modifiers = parseModifiers(name); + if (modifiers) { + name = name.replace(modifierRE, ''); + } + if (bindRE.test(name)) { // v-bind + name = name.replace(bindRE, ''); + value = parseFilters(value); + isProp = false; + if ( + true && + value.trim().length === 0 + ) { + warn$2( + ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"") + ); + } + if (modifiers) { + if (modifiers.prop) { + isProp = true; + name = camelize(name); + if (name === 'innerHtml') { name = 'innerHTML'; } + } + if (modifiers.camel) { + name = camelize(name); + } + if (modifiers.sync) { + addHandler( + el, + ("update:" + (camelize(name))), + genAssignmentCode(value, "$event") + ); + } + } + if (isProp || ( + !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name) + )) { + addProp(el, name, value); + } else { + addAttr(el, name, value); + } + } else if (onRE.test(name)) { // v-on + name = name.replace(onRE, ''); + addHandler(el, name, value, modifiers, false, warn$2); + } else { // normal directives + name = name.replace(dirRE, ''); + // parse arg + var argMatch = name.match(argRE); + var arg = argMatch && argMatch[1]; + if (arg) { + name = name.slice(0, -(arg.length + 1)); + } + addDirective(el, name, rawName, value, arg, modifiers); + if ( true && name === 'model') { + checkForAliasModel(el, value); + } + } + } else { + // literal attribute + if (true) { + var res = parseText(value, delimiters); + if (res) { + warn$2( + name + "=\"" + value + "\": " + + 'Interpolation inside attributes has been removed. ' + + 'Use v-bind or the colon shorthand instead. For example, ' + + 'instead of <div id="{{ val }}">, use <div :id="val">.' + ); + } + } + addAttr(el, name, JSON.stringify(value)); + // #6887 firefox doesn't update muted state if set via attribute + // even immediately after element creation + if (!el.component && + name === 'muted' && + platformMustUseProp(el.tag, el.attrsMap.type, name)) { + addProp(el, name, 'true'); + } + } + } +} + +function checkInFor (el) { + var parent = el; + while (parent) { + if (parent.for !== undefined) { + return true + } + parent = parent.parent; + } + return false +} + +function parseModifiers (name) { + var match = name.match(modifierRE); + if (match) { + var ret = {}; + match.forEach(function (m) { ret[m.slice(1)] = true; }); + return ret + } +} + +function makeAttrsMap (attrs) { + var map = {}; + for (var i = 0, l = attrs.length; i < l; i++) { + if ( + true && + map[attrs[i].name] && !isIE && !isEdge + ) { + warn$2('duplicate attribute: ' + attrs[i].name); + } + map[attrs[i].name] = attrs[i].value; + } + return map +} + +// for script (e.g. type="x/template") or style, do not decode content +function isTextTag (el) { + return el.tag === 'script' || el.tag === 'style' +} + +function isForbiddenTag (el) { + return ( + el.tag === 'style' || + (el.tag === 'script' && ( + !el.attrsMap.type || + el.attrsMap.type === 'text/javascript' + )) + ) +} + +var ieNSBug = /^xmlns:NS\d+/; +var ieNSPrefix = /^NS\d+:/; + +/* istanbul ignore next */ +function guardIESVGBug (attrs) { + var res = []; + for (var i = 0; i < attrs.length; i++) { + var attr = attrs[i]; + if (!ieNSBug.test(attr.name)) { + attr.name = attr.name.replace(ieNSPrefix, ''); + res.push(attr); + } + } + return res +} + +function checkForAliasModel (el, value) { + var _el = el; + while (_el) { + if (_el.for && _el.alias === value) { + warn$2( + "<" + (el.tag) + " v-model=\"" + value + "\">: " + + "You are binding v-model directly to a v-for iteration alias. " + + "This will not be able to modify the v-for source array because " + + "writing to the alias is like modifying a function local variable. " + + "Consider using an array of objects and use v-model on an object property instead." + ); + } + _el = _el.parent; + } +} + +/* */ + +function preTransformNode (el, options) { + if (el.tag === 'input') { + var map = el.attrsMap; + if (!map['v-model']) { + return + } + + var typeBinding; + if (map[':type'] || map['v-bind:type']) { + typeBinding = getBindingAttr(el, 'type'); + } + if (!map.type && !typeBinding && map['v-bind']) { + typeBinding = "(" + (map['v-bind']) + ").type"; + } + + if (typeBinding) { + var ifCondition = getAndRemoveAttr(el, 'v-if', true); + var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : ""; + var hasElse = getAndRemoveAttr(el, 'v-else', true) != null; + var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true); + // 1. checkbox + var branch0 = cloneASTElement(el); + // process for on the main node + processFor(branch0); + addRawAttr(branch0, 'type', 'checkbox'); + processElement(branch0, options); + branch0.processed = true; // prevent it from double-processed + branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra; + addIfCondition(branch0, { + exp: branch0.if, + block: branch0 + }); + // 2. add radio else-if condition + var branch1 = cloneASTElement(el); + getAndRemoveAttr(branch1, 'v-for', true); + addRawAttr(branch1, 'type', 'radio'); + processElement(branch1, options); + addIfCondition(branch0, { + exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra, + block: branch1 + }); + // 3. other + var branch2 = cloneASTElement(el); + getAndRemoveAttr(branch2, 'v-for', true); + addRawAttr(branch2, ':type', typeBinding); + processElement(branch2, options); + addIfCondition(branch0, { + exp: ifCondition, + block: branch2 + }); + + if (hasElse) { + branch0.else = true; + } else if (elseIfCondition) { + branch0.elseif = elseIfCondition; + } + + return branch0 + } + } +} + +function cloneASTElement (el) { + return createASTElement(el.tag, el.attrsList.slice(), el.parent) +} + +var model$1 = { + preTransformNode: preTransformNode +}; + +var modules$1 = [ + klass$1, + style$1, + model$1 +]; + +/* */ + +function text (el, dir) { + if (dir.value) { + addProp(el, 'textContent', ("_s(" + (dir.value) + ")")); + } +} + +/* */ + +function html (el, dir) { + if (dir.value) { + addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")")); + } +} + +var directives$1 = { + model: model, + text: text, + html: html +}; + +/* */ + +var baseOptions = { + expectHTML: true, + modules: modules$1, + directives: directives$1, + isPreTag: isPreTag, + isUnaryTag: isUnaryTag, + mustUseProp: mustUseProp, + canBeLeftOpenTag: canBeLeftOpenTag, + isReservedTag: isReservedTag, + getTagNamespace: getTagNamespace, + staticKeys: genStaticKeys(modules$1) +}; + +/* */ + +var isStaticKey; +var isPlatformReservedTag; + +var genStaticKeysCached = cached(genStaticKeys$1); + +/** + * Goal of the optimizer: walk the generated template AST tree + * and detect sub-trees that are purely static, i.e. parts of + * the DOM that never needs to change. + * + * Once we detect these sub-trees, we can: + * + * 1. Hoist them into constants, so that we no longer need to + * create fresh nodes for them on each re-render; + * 2. Completely skip them in the patching process. + */ +function optimize (root, options) { + if (!root) { return } + isStaticKey = genStaticKeysCached(options.staticKeys || ''); + isPlatformReservedTag = options.isReservedTag || no; + // first pass: mark all non-static nodes. + markStatic$1(root); + // second pass: mark static roots. + markStaticRoots(root, false); +} + +function genStaticKeys$1 (keys) { + return makeMap( + 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' + + (keys ? ',' + keys : '') + ) +} + +function markStatic$1 (node) { + node.static = isStatic(node); + if (node.type === 1) { + // do not make component slot content static. this avoids + // 1. components not able to mutate slot nodes + // 2. static slot content fails for hot-reloading + if ( + !isPlatformReservedTag(node.tag) && + node.tag !== 'slot' && + node.attrsMap['inline-template'] == null + ) { + return + } + for (var i = 0, l = node.children.length; i < l; i++) { + var child = node.children[i]; + markStatic$1(child); + if (!child.static) { + node.static = false; + } + } + if (node.ifConditions) { + for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { + var block = node.ifConditions[i$1].block; + markStatic$1(block); + if (!block.static) { + node.static = false; + } + } + } + } +} + +function markStaticRoots (node, isInFor) { + if (node.type === 1) { + if (node.static || node.once) { + node.staticInFor = isInFor; + } + // For a node to qualify as a static root, it should have children that + // are not just static text. Otherwise the cost of hoisting out will + // outweigh the benefits and it's better off to just always render it fresh. + if (node.static && node.children.length && !( + node.children.length === 1 && + node.children[0].type === 3 + )) { + node.staticRoot = true; + return + } else { + node.staticRoot = false; + } + if (node.children) { + for (var i = 0, l = node.children.length; i < l; i++) { + markStaticRoots(node.children[i], isInFor || !!node.for); + } + } + if (node.ifConditions) { + for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { + markStaticRoots(node.ifConditions[i$1].block, isInFor); + } + } + } +} + +function isStatic (node) { + if (node.type === 2) { // expression + return false + } + if (node.type === 3) { // text + return true + } + return !!(node.pre || ( + !node.hasBindings && // no dynamic bindings + !node.if && !node.for && // not v-if or v-for or v-else + !isBuiltInTag(node.tag) && // not a built-in + isPlatformReservedTag(node.tag) && // not a component + !isDirectChildOfTemplateFor(node) && + Object.keys(node).every(isStaticKey) + )) +} + +function isDirectChildOfTemplateFor (node) { + while (node.parent) { + node = node.parent; + if (node.tag !== 'template') { + return false + } + if (node.for) { + return true + } + } + return false +} + +/* */ + +var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/; +var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; + +// KeyboardEvent.keyCode aliases +var keyCodes = { + esc: 27, + tab: 9, + enter: 13, + space: 32, + up: 38, + left: 37, + right: 39, + down: 40, + 'delete': [8, 46] +}; + +// KeyboardEvent.key aliases +var keyNames = { + // #7880: IE11 and Edge use `Esc` for Escape key name. + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + // #9112: IE11 uses `Spacebar` for Space key name. + space: [' ', 'Spacebar'], + // #7806: IE11 uses key names without `Arrow` prefix for arrow keys. + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + // #9112: IE11 uses `Del` for Delete key name. + 'delete': ['Backspace', 'Delete', 'Del'] +}; + +// #4868: modifiers that prevent the execution of the listener +// need to explicitly return null so that we can determine whether to remove +// the listener for .once +var genGuard = function (condition) { return ("if(" + condition + ")return null;"); }; + +var modifierCode = { + stop: '$event.stopPropagation();', + prevent: '$event.preventDefault();', + self: genGuard("$event.target !== $event.currentTarget"), + ctrl: genGuard("!$event.ctrlKey"), + shift: genGuard("!$event.shiftKey"), + alt: genGuard("!$event.altKey"), + meta: genGuard("!$event.metaKey"), + left: genGuard("'button' in $event && $event.button !== 0"), + middle: genGuard("'button' in $event && $event.button !== 1"), + right: genGuard("'button' in $event && $event.button !== 2") +}; + +function genHandlers ( + events, + isNative +) { + var res = isNative ? 'nativeOn:{' : 'on:{'; + for (var name in events) { + res += "\"" + name + "\":" + (genHandler(name, events[name])) + ","; + } + return res.slice(0, -1) + '}' +} + +function genHandler ( + name, + handler +) { + if (!handler) { + return 'function(){}' + } + + if (Array.isArray(handler)) { + return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]") + } + + var isMethodPath = simplePathRE.test(handler.value); + var isFunctionExpression = fnExpRE.test(handler.value); + + if (!handler.modifiers) { + if (isMethodPath || isFunctionExpression) { + return handler.value + } + return ("function($event){" + (handler.value) + "}") // inline statement + } else { + var code = ''; + var genModifierCode = ''; + var keys = []; + for (var key in handler.modifiers) { + if (modifierCode[key]) { + genModifierCode += modifierCode[key]; + // left/right + if (keyCodes[key]) { + keys.push(key); + } + } else if (key === 'exact') { + var modifiers = (handler.modifiers); + genModifierCode += genGuard( + ['ctrl', 'shift', 'alt', 'meta'] + .filter(function (keyModifier) { return !modifiers[keyModifier]; }) + .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); }) + .join('||') + ); + } else { + keys.push(key); + } + } + if (keys.length) { + code += genKeyFilter(keys); + } + // Make sure modifiers like prevent and stop get executed after key filtering + if (genModifierCode) { + code += genModifierCode; + } + var handlerCode = isMethodPath + ? ("return " + (handler.value) + "($event)") + : isFunctionExpression + ? ("return (" + (handler.value) + ")($event)") + : handler.value; + return ("function($event){" + code + handlerCode + "}") + } +} + +function genKeyFilter (keys) { + return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;") +} + +function genFilterCode (key) { + var keyVal = parseInt(key, 10); + if (keyVal) { + return ("$event.keyCode!==" + keyVal) + } + var keyCode = keyCodes[key]; + var keyName = keyNames[key]; + return ( + "_k($event.keyCode," + + (JSON.stringify(key)) + "," + + (JSON.stringify(keyCode)) + "," + + "$event.key," + + "" + (JSON.stringify(keyName)) + + ")" + ) +} + +/* */ + +function on (el, dir) { + if ( true && dir.modifiers) { + warn("v-on without argument does not support modifiers."); + } + el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); }; +} + +/* */ + +function bind$1 (el, dir) { + el.wrapData = function (code) { + return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")") + }; +} + +/* */ + +var baseDirectives = { + on: on, + bind: bind$1, + cloak: noop +}; + +/* */ + + + + + +var CodegenState = function CodegenState (options) { + this.options = options; + this.warn = options.warn || baseWarn; + this.transforms = pluckModuleFunction(options.modules, 'transformCode'); + this.dataGenFns = pluckModuleFunction(options.modules, 'genData'); + this.directives = extend(extend({}, baseDirectives), options.directives); + var isReservedTag = options.isReservedTag || no; + this.maybeComponent = function (el) { return !(isReservedTag(el.tag) && !el.component); }; + this.onceId = 0; + this.staticRenderFns = []; + this.pre = false; +}; + + + +function generate ( + ast, + options +) { + var state = new CodegenState(options); + var code = ast ? genElement(ast, state) : '_c("div")'; + return { + render: ("with(this){return " + code + "}"), + staticRenderFns: state.staticRenderFns + } +} + +function genElement (el, state) { + if (el.parent) { + el.pre = el.pre || el.parent.pre; + } + + if (el.staticRoot && !el.staticProcessed) { + return genStatic(el, state) + } else if (el.once && !el.onceProcessed) { + return genOnce(el, state) + } else if (el.for && !el.forProcessed) { + return genFor(el, state) + } else if (el.if && !el.ifProcessed) { + return genIf(el, state) + } else if (el.tag === 'template' && !el.slotTarget && !state.pre) { + return genChildren(el, state) || 'void 0' + } else if (el.tag === 'slot') { + return genSlot(el, state) + } else { + // component or element + var code; + if (el.component) { + code = genComponent(el.component, el, state); + } else { + var data; + if (!el.plain || (el.pre && state.maybeComponent(el))) { + data = genData$2(el, state); + } + + var children = el.inlineTemplate ? null : genChildren(el, state, true); + code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")"; + } + // module transforms + for (var i = 0; i < state.transforms.length; i++) { + code = state.transforms[i](el, code); + } + return code + } +} + +// hoist static sub-trees out +function genStatic (el, state) { + el.staticProcessed = true; + // Some elements (templates) need to behave differently inside of a v-pre + // node. All pre nodes are static roots, so we can use this as a location to + // wrap a state change and reset it upon exiting the pre node. + var originalPreState = state.pre; + if (el.pre) { + state.pre = el.pre; + } + state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}")); + state.pre = originalPreState; + return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")") +} + +// v-once +function genOnce (el, state) { + el.onceProcessed = true; + if (el.if && !el.ifProcessed) { + return genIf(el, state) + } else if (el.staticInFor) { + var key = ''; + var parent = el.parent; + while (parent) { + if (parent.for) { + key = parent.key; + break + } + parent = parent.parent; + } + if (!key) { + true && state.warn( + "v-once can only be used inside v-for that is keyed. " + ); + return genElement(el, state) + } + return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")") + } else { + return genStatic(el, state) + } +} + +function genIf ( + el, + state, + altGen, + altEmpty +) { + el.ifProcessed = true; // avoid recursion + return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty) +} + +function genIfConditions ( + conditions, + state, + altGen, + altEmpty +) { + if (!conditions.length) { + return altEmpty || '_e()' + } + + var condition = conditions.shift(); + if (condition.exp) { + return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty))) + } else { + return ("" + (genTernaryExp(condition.block))) + } + + // v-if with v-once should generate code like (a)?_m(0):_m(1) + function genTernaryExp (el) { + return altGen + ? altGen(el, state) + : el.once + ? genOnce(el, state) + : genElement(el, state) + } +} + +function genFor ( + el, + state, + altGen, + altHelper +) { + var exp = el.for; + var alias = el.alias; + var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; + var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; + + if ( true && + state.maybeComponent(el) && + el.tag !== 'slot' && + el.tag !== 'template' && + !el.key + ) { + state.warn( + "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + + "v-for should have explicit keys. " + + "See https://vuejs.org/guide/list.html#key for more info.", + true /* tip */ + ); + } + + el.forProcessed = true; // avoid recursion + return (altHelper || '_l') + "((" + exp + ")," + + "function(" + alias + iterator1 + iterator2 + "){" + + "return " + ((altGen || genElement)(el, state)) + + '})' +} + +function genData$2 (el, state) { + var data = '{'; + + // directives first. + // directives may mutate the el's other properties before they are generated. + var dirs = genDirectives(el, state); + if (dirs) { data += dirs + ','; } + + // key + if (el.key) { + data += "key:" + (el.key) + ","; + } + // ref + if (el.ref) { + data += "ref:" + (el.ref) + ","; + } + if (el.refInFor) { + data += "refInFor:true,"; + } + // pre + if (el.pre) { + data += "pre:true,"; + } + // record original tag name for components using "is" attribute + if (el.component) { + data += "tag:\"" + (el.tag) + "\","; + } + // module data generation functions + for (var i = 0; i < state.dataGenFns.length; i++) { + data += state.dataGenFns[i](el); + } + // attributes + if (el.attrs) { + data += "attrs:{" + (genProps(el.attrs)) + "},"; + } + // DOM props + if (el.props) { + data += "domProps:{" + (genProps(el.props)) + "},"; + } + // event handlers + if (el.events) { + data += (genHandlers(el.events, false)) + ","; + } + if (el.nativeEvents) { + data += (genHandlers(el.nativeEvents, true)) + ","; + } + // slot target + // only for non-scoped slots + if (el.slotTarget && !el.slotScope) { + data += "slot:" + (el.slotTarget) + ","; + } + // scoped slots + if (el.scopedSlots) { + data += (genScopedSlots(el.scopedSlots, state)) + ","; + } + // component v-model + if (el.model) { + data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},"; + } + // inline-template + if (el.inlineTemplate) { + var inlineTemplate = genInlineTemplate(el, state); + if (inlineTemplate) { + data += inlineTemplate + ","; + } + } + data = data.replace(/,$/, '') + '}'; + // v-bind data wrap + if (el.wrapData) { + data = el.wrapData(data); + } + // v-on data wrap + if (el.wrapListeners) { + data = el.wrapListeners(data); + } + return data +} + +function genDirectives (el, state) { + var dirs = el.directives; + if (!dirs) { return } + var res = 'directives:['; + var hasRuntime = false; + var i, l, dir, needRuntime; + for (i = 0, l = dirs.length; i < l; i++) { + dir = dirs[i]; + needRuntime = true; + var gen = state.directives[dir.name]; + if (gen) { + // compile-time directive that manipulates AST. + // returns true if it also needs a runtime counterpart. + needRuntime = !!gen(el, dir, state.warn); + } + if (needRuntime) { + hasRuntime = true; + res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},"; + } + } + if (hasRuntime) { + return res.slice(0, -1) + ']' + } +} + +function genInlineTemplate (el, state) { + var ast = el.children[0]; + if ( true && ( + el.children.length !== 1 || ast.type !== 1 + )) { + state.warn('Inline-template components must have exactly one child element.'); + } + if (ast.type === 1) { + var inlineRenderFns = generate(ast, state.options); + return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}") + } +} + +function genScopedSlots ( + slots, + state +) { + return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) { + return genScopedSlot(key, slots[key], state) + }).join(',')) + "])") +} + +function genScopedSlot ( + key, + el, + state +) { + if (el.for && !el.forProcessed) { + return genForScopedSlot(key, el, state) + } + var fn = "function(" + (String(el.slotScope)) + "){" + + "return " + (el.tag === 'template' + ? el.if + ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined") + : genChildren(el, state) || 'undefined' + : genElement(el, state)) + "}"; + return ("{key:" + key + ",fn:" + fn + "}") +} + +function genForScopedSlot ( + key, + el, + state +) { + var exp = el.for; + var alias = el.alias; + var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; + var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; + el.forProcessed = true; // avoid recursion + return "_l((" + exp + ")," + + "function(" + alias + iterator1 + iterator2 + "){" + + "return " + (genScopedSlot(key, el, state)) + + '})' +} + +function genChildren ( + el, + state, + checkSkip, + altGenElement, + altGenNode +) { + var children = el.children; + if (children.length) { + var el$1 = children[0]; + // optimize single v-for + if (children.length === 1 && + el$1.for && + el$1.tag !== 'template' && + el$1.tag !== 'slot' + ) { + var normalizationType = checkSkip + ? state.maybeComponent(el$1) ? ",1" : ",0" + : ""; + return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType) + } + var normalizationType$1 = checkSkip + ? getNormalizationType(children, state.maybeComponent) + : 0; + var gen = altGenNode || genNode; + return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : '')) + } +} + +// determine the normalization needed for the children array. +// 0: no normalization needed +// 1: simple normalization needed (possible 1-level deep nested array) +// 2: full normalization needed +function getNormalizationType ( + children, + maybeComponent +) { + var res = 0; + for (var i = 0; i < children.length; i++) { + var el = children[i]; + if (el.type !== 1) { + continue + } + if (needsNormalization(el) || + (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { + res = 2; + break + } + if (maybeComponent(el) || + (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) { + res = 1; + } + } + return res +} + +function needsNormalization (el) { + return el.for !== undefined || el.tag === 'template' || el.tag === 'slot' +} + +function genNode (node, state) { + if (node.type === 1) { + return genElement(node, state) + } else if (node.type === 3 && node.isComment) { + return genComment(node) + } else { + return genText(node) + } +} + +function genText (text) { + return ("_v(" + (text.type === 2 + ? text.expression // no need for () because already wrapped in _s() + : transformSpecialNewlines(JSON.stringify(text.text))) + ")") +} + +function genComment (comment) { + return ("_e(" + (JSON.stringify(comment.text)) + ")") +} + +function genSlot (el, state) { + var slotName = el.slotName || '"default"'; + var children = genChildren(el, state); + var res = "_t(" + slotName + (children ? ("," + children) : ''); + var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}"); + var bind$$1 = el.attrsMap['v-bind']; + if ((attrs || bind$$1) && !children) { + res += ",null"; + } + if (attrs) { + res += "," + attrs; + } + if (bind$$1) { + res += (attrs ? '' : ',null') + "," + bind$$1; + } + return res + ')' +} + +// componentName is el.component, take it as argument to shun flow's pessimistic refinement +function genComponent ( + componentName, + el, + state +) { + var children = el.inlineTemplate ? null : genChildren(el, state, true); + return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")") +} + +function genProps (props) { + var res = ''; + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + /* istanbul ignore if */ + { + res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ","; + } + } + return res.slice(0, -1) +} + +// #3895, #4268 +function transformSpecialNewlines (text) { + return text + .replace(/\u2028/g, '\\u2028') + .replace(/\u2029/g, '\\u2029') +} + +/* */ + +// these keywords should not appear inside expressions, but operators like +// typeof, instanceof and in are allowed +var prohibitedKeywordRE = new RegExp('\\b' + ( + 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + + 'super,throw,while,yield,delete,export,import,return,switch,default,' + + 'extends,finally,continue,debugger,function,arguments' +).split(',').join('\\b|\\b') + '\\b'); + +// these unary operators should not be used as property/method names +var unaryOperatorsRE = new RegExp('\\b' + ( + 'delete,typeof,void' +).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); + +// strip strings in expressions +var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; + +// detect problematic expressions in a template +function detectErrors (ast) { + var errors = []; + if (ast) { + checkNode(ast, errors); + } + return errors +} + +function checkNode (node, errors) { + if (node.type === 1) { + for (var name in node.attrsMap) { + if (dirRE.test(name)) { + var value = node.attrsMap[name]; + if (value) { + if (name === 'v-for') { + checkFor(node, ("v-for=\"" + value + "\""), errors); + } else if (onRE.test(name)) { + checkEvent(value, (name + "=\"" + value + "\""), errors); + } else { + checkExpression(value, (name + "=\"" + value + "\""), errors); + } + } + } + } + if (node.children) { + for (var i = 0; i < node.children.length; i++) { + checkNode(node.children[i], errors); + } + } + } else if (node.type === 2) { + checkExpression(node.expression, node.text, errors); + } +} + +function checkEvent (exp, text, errors) { + var stipped = exp.replace(stripStringRE, ''); + var keywordMatch = stipped.match(unaryOperatorsRE); + if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { + errors.push( + "avoid using JavaScript unary operator as property name: " + + "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()) + ); + } + checkExpression(exp, text, errors); +} + +function checkFor (node, text, errors) { + checkExpression(node.for || '', text, errors); + checkIdentifier(node.alias, 'v-for alias', text, errors); + checkIdentifier(node.iterator1, 'v-for iterator', text, errors); + checkIdentifier(node.iterator2, 'v-for iterator', text, errors); +} + +function checkIdentifier ( + ident, + type, + text, + errors +) { + if (typeof ident === 'string') { + try { + new Function(("var " + ident + "=_")); + } catch (e) { + errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); + } + } +} + +function checkExpression (exp, text, errors) { + try { + new Function(("return " + exp)); + } catch (e) { + var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE); + if (keywordMatch) { + errors.push( + "avoid using JavaScript keyword as property name: " + + "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()) + ); + } else { + errors.push( + "invalid expression: " + (e.message) + " in\n\n" + + " " + exp + "\n\n" + + " Raw expression: " + (text.trim()) + "\n" + ); + } + } +} + +/* */ + + + +function createFunction (code, errors) { + try { + return new Function(code) + } catch (err) { + errors.push({ err: err, code: code }); + return noop + } +} + +function createCompileToFunctionFn (compile) { + var cache = Object.create(null); + + return function compileToFunctions ( + template, + options, + vm + ) { + options = extend({}, options); + var warn$$1 = options.warn || warn; + delete options.warn; + + /* istanbul ignore if */ + if (true) { + // detect possible CSP restriction + try { + new Function('return 1'); + } catch (e) { + if (e.toString().match(/unsafe-eval|CSP/)) { + warn$$1( + 'It seems you are using the standalone build of Vue.js in an ' + + 'environment with Content Security Policy that prohibits unsafe-eval. ' + + 'The template compiler cannot work in this environment. Consider ' + + 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + + 'templates into render functions.' + ); + } + } + } + + // check cache + var key = options.delimiters + ? String(options.delimiters) + template + : template; + if (cache[key]) { + return cache[key] + } + + // compile + var compiled = compile(template, options); + + // check compilation errors/tips + if (true) { + if (compiled.errors && compiled.errors.length) { + warn$$1( + "Error compiling template:\n\n" + template + "\n\n" + + compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n', + vm + ); + } + if (compiled.tips && compiled.tips.length) { + compiled.tips.forEach(function (msg) { return tip(msg, vm); }); + } + } + + // turn code into functions + var res = {}; + var fnGenErrors = []; + res.render = createFunction(compiled.render, fnGenErrors); + res.staticRenderFns = compiled.staticRenderFns.map(function (code) { + return createFunction(code, fnGenErrors) + }); + + // check function generation errors. + // this should only happen if there is a bug in the compiler itself. + // mostly for codegen development use + /* istanbul ignore if */ + if (true) { + if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) { + warn$$1( + "Failed to generate render function:\n\n" + + fnGenErrors.map(function (ref) { + var err = ref.err; + var code = ref.code; + + return ((err.toString()) + " in\n\n" + code + "\n"); + }).join('\n'), + vm + ); + } + } + + return (cache[key] = res) + } +} + +/* */ + +function createCompilerCreator (baseCompile) { + return function createCompiler (baseOptions) { + function compile ( + template, + options + ) { + var finalOptions = Object.create(baseOptions); + var errors = []; + var tips = []; + finalOptions.warn = function (msg, tip) { + (tip ? tips : errors).push(msg); + }; + + if (options) { + // merge custom modules + if (options.modules) { + finalOptions.modules = + (baseOptions.modules || []).concat(options.modules); + } + // merge custom directives + if (options.directives) { + finalOptions.directives = extend( + Object.create(baseOptions.directives || null), + options.directives + ); + } + // copy other options + for (var key in options) { + if (key !== 'modules' && key !== 'directives') { + finalOptions[key] = options[key]; + } + } + } + + var compiled = baseCompile(template, finalOptions); + if (true) { + errors.push.apply(errors, detectErrors(compiled.ast)); + } + compiled.errors = errors; + compiled.tips = tips; + return compiled + } + + return { + compile: compile, + compileToFunctions: createCompileToFunctionFn(compile) + } + } +} + +/* */ + +// `createCompilerCreator` allows creating compilers that use alternative +// parser/optimizer/codegen, e.g the SSR optimizing compiler. +// Here we just export a default compiler using the default parts. +var createCompiler = createCompilerCreator(function baseCompile ( + template, + options +) { + var ast = parse(template.trim(), options); + if (options.optimize !== false) { + optimize(ast, options); + } + var code = generate(ast, options); + return { + ast: ast, + render: code.render, + staticRenderFns: code.staticRenderFns + } +}); + +/* */ + +var ref$1 = createCompiler(baseOptions); +var compile = ref$1.compile; +var compileToFunctions = ref$1.compileToFunctions; + +/* */ + +// check whether current browser encodes a char inside attribute values +var div; +function getShouldDecode (href) { + div = div || document.createElement('div'); + div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>"; + return div.innerHTML.indexOf(' ') > 0 +} + +// #3663: IE encodes newlines inside attribute values while other browsers don't +var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false; +// #6828: chrome encodes content in a[href] +var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false; + +/* */ + +var idToTemplate = cached(function (id) { + var el = query(id); + return el && el.innerHTML +}); + +var mount = Vue.prototype.$mount; +Vue.prototype.$mount = function ( + el, + hydrating +) { + el = el && query(el); + + /* istanbul ignore if */ + if (el === document.body || el === document.documentElement) { + true && warn( + "Do not mount Vue to <html> or <body> - mount to normal elements instead." + ); + return this + } + + var options = this.$options; + // resolve template/el and convert to render function + if (!options.render) { + var template = options.template; + if (template) { + if (typeof template === 'string') { + if (template.charAt(0) === '#') { + template = idToTemplate(template); + /* istanbul ignore if */ + if ( true && !template) { + warn( + ("Template element not found or is empty: " + (options.template)), + this + ); + } + } + } else if (template.nodeType) { + template = template.innerHTML; + } else { + if (true) { + warn('invalid template option:' + template, this); + } + return this + } + } else if (el) { + template = getOuterHTML(el); + } + if (template) { + /* istanbul ignore if */ + if ( true && config.performance && mark) { + mark('compile'); + } + + var ref = compileToFunctions(template, { + shouldDecodeNewlines: shouldDecodeNewlines, + shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref, + delimiters: options.delimiters, + comments: options.comments + }, this); + var render = ref.render; + var staticRenderFns = ref.staticRenderFns; + options.render = render; + options.staticRenderFns = staticRenderFns; + + /* istanbul ignore if */ + if ( true && config.performance && mark) { + mark('compile end'); + measure(("vue " + (this._name) + " compile"), 'compile', 'compile end'); + } + } + } + return mount.call(this, el, hydrating) +}; + +/** + * Get outerHTML of elements, taking care + * of SVG elements in IE as well. + */ +function getOuterHTML (el) { + if (el.outerHTML) { + return el.outerHTML + } else { + var container = document.createElement('div'); + container.appendChild(el.cloneNode(true)); + return container.innerHTML + } +} + +Vue.compile = compileToFunctions; + +module.exports = Vue; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate)) + +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ "./node_modules/webpack/buildin/module.js": +/*!***********************************!*\ + !*** (webpack)/buildin/module.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if (!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if (!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), + +/***/ "./resources/js/app.js": +/*!*****************************!*\ + !*** ./resources/js/app.js ***! + \*****************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ "./resources/js/base.js"); +/* harmony import */ var _bus_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bus.js */ "./resources/js/bus.js"); +/* harmony import */ var _routes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./routes */ "./resources/js/routes.js"); +/* harmony import */ var vue_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue-router */ "./node_modules/vue-router/dist/vue-router.esm.js"); +/* harmony import */ var vue_textarea_autosize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue-textarea-autosize */ "./node_modules/vue-textarea-autosize/index.js"); +/* harmony import */ var vue_croppie__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue-croppie */ "./node_modules/vue-croppie/dist/vue-croppie.es.js"); +/* harmony import */ var croppie_croppie_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! croppie/croppie.css */ "./node_modules/croppie/croppie.css"); +/* harmony import */ var croppie_croppie_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(croppie_croppie_css__WEBPACK_IMPORTED_MODULE_7__); + + + + + + + + +vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vue_router__WEBPACK_IMPORTED_MODULE_4__["default"]); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vue_textarea_autosize__WEBPACK_IMPORTED_MODULE_5__["default"]); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vue_croppie__WEBPACK_IMPORTED_MODULE_6__["default"]); +var router = new vue_router__WEBPACK_IMPORTED_MODULE_4__["default"]({ + routes: _routes__WEBPACK_IMPORTED_MODULE_3__["default"], + mode: 'history', + base: '/' + Wink.path +}); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('page-header', __webpack_require__(/*! ./components/PageHeader */ "./resources/js/components/PageHeader.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('preloader', __webpack_require__(/*! ./partials/Preloader */ "./resources/js/partials/Preloader.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('alert', __webpack_require__(/*! ./components/Alert */ "./resources/js/components/Alert.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('dropdown', __webpack_require__(/*! ./components/DropDown */ "./resources/js/components/DropDown.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('modal', __webpack_require__(/*! ./components/Modal */ "./resources/js/components/Modal.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('fullscreen-modal', __webpack_require__(/*! ./components/FullscreenModal */ "./resources/js/components/FullscreenModal.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('notification', __webpack_require__(/*! ./components/Notification */ "./resources/js/components/Notification.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('mini-editor', __webpack_require__(/*! ./components/MiniEditor */ "./resources/js/components/MiniEditor.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('editor', __webpack_require__(/*! ./components/Editor */ "./resources/js/components/Editor.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('form-errors', __webpack_require__(/*! ./components/FormErrors */ "./resources/js/components/FormErrors.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('image-picker', __webpack_require__(/*! ./components/ImagePicker */ "./resources/js/components/ImagePicker.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('cropper-modal', __webpack_require__(/*! ./components/CropperModal */ "./resources/js/components/CropperModal.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('date-time-picker', __webpack_require__(/*! ./components/DateTimePicker */ "./resources/js/components/DateTimePicker.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('multiselect', __webpack_require__(/*! ./components/MultiSelect */ "./resources/js/components/MultiSelect.vue").default); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.directive('loading', __webpack_require__(/*! ./components/loadingButton */ "./resources/js/components/loadingButton.js")); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.directive('click-outside', __webpack_require__(/*! ./components/clickOutside */ "./resources/js/components/clickOutside.js")); +vue__WEBPACK_IMPORTED_MODULE_0___default.a.mixin(_base__WEBPACK_IMPORTED_MODULE_1__["default"]); +new vue__WEBPACK_IMPORTED_MODULE_0___default.a({ + el: '#wink', + router: router, + data: function data() { + return { + alert: { + type: null, + autoClose: 0, + message: '', + confirmationProceed: null, + confirmationCancel: null + }, + notification: { + type: null, + autoClose: 0, + message: '' + } + }; + }, + mounted: function mounted() { + var _this = this; + + _bus_js__WEBPACK_IMPORTED_MODULE_2__["Bus"].$on('httpError', function (message) { + return _this.alertError(message); + }); + }, + methods: {} +}); + +/***/ }), + +/***/ "./resources/js/base.js": +/*!******************************!*\ + !*** ./resources/js/base.js ***! + \******************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); +/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); +/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _bus_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bus.js */ "./resources/js/bus.js"); + + + + +/* harmony default export */ __webpack_exports__["default"] = ({ + computed: { + Wink: function (_Wink) { + function Wink() { + return _Wink.apply(this, arguments); + } + + Wink.toString = function () { + return _Wink.toString(); + }; + + return Wink; + }(function () { + return Wink; + }) + }, + methods: { + /** + * Determine if the given date is in the future. + */ + dateInTheFuture: function dateInTheFuture(date) { + return moment__WEBPACK_IMPORTED_MODULE_2___default()().diff(moment__WEBPACK_IMPORTED_MODULE_2___default()(date + ' Z'), 'minutes') < 0; + }, + + /** + * Show the time ago format for the given time. + */ + timeAgo: function timeAgo(time) { + return moment__WEBPACK_IMPORTED_MODULE_2___default()(time + ' Z').utc().local().fromNow(); + }, + + /** + * Show the time in local time. + */ + localTime: function localTime(time) { + return moment__WEBPACK_IMPORTED_MODULE_2___default()(time + ' Z').utc().local().format('MMMM Do YYYY, h:mm:ss A'); + }, + + /** + * Truncate the given string. + */ + truncate: function truncate(string) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 70; + return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.truncate(string, { + 'length': length, + 'separator': /,? +/ + }); + }, + + /** + * Creates a debounced function that delays invoking a callback. + */ + debouncer: lodash__WEBPACK_IMPORTED_MODULE_0___default.a.debounce(function (callback) { + return callback(); + }, 500), + + /** + * Convert string to slug. + * + * src: https://gist.github.com/mathewbyrne/1280286 + */ + slugify: function slugify(text) { + return text.toString().toLowerCase().replace(/\s+/g, '-').replace(/[^\w\-]+/g, '').replace(/\-\-+/g, '-'); + }, + + /** + * Create an instance of axios. + */ + http: function http() { + var instance = axios__WEBPACK_IMPORTED_MODULE_1___default.a.create(); + instance.defaults.baseURL = '/' + Wink.path; + instance.interceptors.response.use(function (response) { + return response; + }, function (error) { + switch (error.response.status) { + case 500: + _bus_js__WEBPACK_IMPORTED_MODULE_3__["Bus"].$emit('httpError', error.response.data.message); + break; + + case 401: + window.location.href = '/' + Wink.path + '/logout'; + break; + } + + return Promise.reject(error); + }); + return instance; + }, + + /** + * Show an error message. + */ + alertError: function alertError(message) { + this.$root.alert.type = 'error'; + this.$root.alert.autoClose = false; + this.$root.alert.message = message; + }, + + /** + * Show confirmation message. + */ + alertConfirm: function alertConfirm(message, success, failure) { + this.$root.alert.type = 'confirmation'; + this.$root.alert.autoClose = false; + this.$root.alert.message = message; + this.$root.alert.confirmationProceed = success; + this.$root.alert.confirmationCancel = failure; + }, + + /** + * Show a success message. + */ + notifySuccess: function notifySuccess(message, autoClose) { + this.$root.notification.type = 'success'; + this.$root.notification.autoClose = autoClose; + this.$root.notification.message = message; + } + } +}); + +/***/ }), + +/***/ "./resources/js/bus.js": +/*!*****************************!*\ + !*** ./resources/js/bus.js ***! + \*****************************/ +/*! exports provided: Bus */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bus", function() { return Bus; }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js"); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); + +var Bus = new vue__WEBPACK_IMPORTED_MODULE_0___default.a(); + +/***/ }), + +/***/ "./resources/js/components/Alert.vue": +/*!*******************************************!*\ + !*** ./resources/js/components/Alert.vue ***! + \*******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Alert_vue_vue_type_template_id_7b2bf401___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Alert.vue?vue&type=template&id=7b2bf401& */ "./resources/js/components/Alert.vue?vue&type=template&id=7b2bf401&"); +/* harmony import */ var _Alert_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Alert.vue?vue&type=script&lang=js& */ "./resources/js/components/Alert.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _Alert_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _Alert_vue_vue_type_template_id_7b2bf401___WEBPACK_IMPORTED_MODULE_0__["render"], + _Alert_vue_vue_type_template_id_7b2bf401___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/Alert.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/Alert.vue?vue&type=script&lang=js&": +/*!********************************************************************!*\ + !*** ./resources/js/components/Alert.vue?vue&type=script&lang=js& ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Alert_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Alert.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Alert.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Alert_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/Alert.vue?vue&type=template&id=7b2bf401&": +/*!**************************************************************************!*\ + !*** ./resources/js/components/Alert.vue?vue&type=template&id=7b2bf401& ***! + \**************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Alert_vue_vue_type_template_id_7b2bf401___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Alert.vue?vue&type=template&id=7b2bf401& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Alert.vue?vue&type=template&id=7b2bf401&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Alert_vue_vue_type_template_id_7b2bf401___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Alert_vue_vue_type_template_id_7b2bf401___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/CropperModal.vue": +/*!**************************************************!*\ + !*** ./resources/js/components/CropperModal.vue ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _CropperModal_vue_vue_type_template_id_6055dbea___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CropperModal.vue?vue&type=template&id=6055dbea& */ "./resources/js/components/CropperModal.vue?vue&type=template&id=6055dbea&"); +/* harmony import */ var _CropperModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CropperModal.vue?vue&type=script&lang=js& */ "./resources/js/components/CropperModal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _CropperModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _CropperModal_vue_vue_type_template_id_6055dbea___WEBPACK_IMPORTED_MODULE_0__["render"], + _CropperModal_vue_vue_type_template_id_6055dbea___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/CropperModal.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/CropperModal.vue?vue&type=script&lang=js&": +/*!***************************************************************************!*\ + !*** ./resources/js/components/CropperModal.vue?vue&type=script&lang=js& ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CropperModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./CropperModal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CropperModal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CropperModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/CropperModal.vue?vue&type=template&id=6055dbea&": +/*!*********************************************************************************!*\ + !*** ./resources/js/components/CropperModal.vue?vue&type=template&id=6055dbea& ***! + \*********************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CropperModal_vue_vue_type_template_id_6055dbea___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./CropperModal.vue?vue&type=template&id=6055dbea& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CropperModal.vue?vue&type=template&id=6055dbea&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CropperModal_vue_vue_type_template_id_6055dbea___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CropperModal_vue_vue_type_template_id_6055dbea___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/DateTimePicker.vue": +/*!****************************************************!*\ + !*** ./resources/js/components/DateTimePicker.vue ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _DateTimePicker_vue_vue_type_template_id_412102b4_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true& */ "./resources/js/components/DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true&"); +/* harmony import */ var _DateTimePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DateTimePicker.vue?vue&type=script&lang=js& */ "./resources/js/components/DateTimePicker.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _DateTimePicker_vue_vue_type_style_index_0_id_412102b4_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css& */ "./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _DateTimePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _DateTimePicker_vue_vue_type_template_id_412102b4_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], + _DateTimePicker_vue_vue_type_template_id_412102b4_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + "412102b4", + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/DateTimePicker.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/DateTimePicker.vue?vue&type=script&lang=js&": +/*!*****************************************************************************!*\ + !*** ./resources/js/components/DateTimePicker.vue?vue&type=script&lang=js& ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./DateTimePicker.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css&": +/*!*************************************************************************************************************!*\ + !*** ./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css& ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_style_index_0_id_412102b4_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader!../../../node_modules/css-loader??ref--7-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--7-2!../../../node_modules/vue-loader/lib??vue-loader-options!./DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=style&index=0&id=412102b4&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_style_index_0_id_412102b4_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_style_index_0_id_412102b4_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_style_index_0_id_412102b4_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_style_index_0_id_412102b4_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_style_index_0_id_412102b4_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/components/DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true&": +/*!***********************************************************************************************!*\ + !*** ./resources/js/components/DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true& ***! + \***********************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_template_id_412102b4_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DateTimePicker.vue?vue&type=template&id=412102b4&scoped=true&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_template_id_412102b4_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DateTimePicker_vue_vue_type_template_id_412102b4_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/DropDown.vue": +/*!**********************************************!*\ + !*** ./resources/js/components/DropDown.vue ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _DropDown_vue_vue_type_template_id_e7c365c8___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DropDown.vue?vue&type=template&id=e7c365c8& */ "./resources/js/components/DropDown.vue?vue&type=template&id=e7c365c8&"); +/* harmony import */ var _DropDown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DropDown.vue?vue&type=script&lang=js& */ "./resources/js/components/DropDown.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _DropDown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _DropDown_vue_vue_type_template_id_e7c365c8___WEBPACK_IMPORTED_MODULE_0__["render"], + _DropDown_vue_vue_type_template_id_e7c365c8___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/DropDown.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/DropDown.vue?vue&type=script&lang=js&": +/*!***********************************************************************!*\ + !*** ./resources/js/components/DropDown.vue?vue&type=script&lang=js& ***! + \***********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DropDown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./DropDown.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DropDown.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DropDown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/DropDown.vue?vue&type=template&id=e7c365c8&": +/*!*****************************************************************************!*\ + !*** ./resources/js/components/DropDown.vue?vue&type=template&id=e7c365c8& ***! + \*****************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DropDown_vue_vue_type_template_id_e7c365c8___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./DropDown.vue?vue&type=template&id=e7c365c8& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/DropDown.vue?vue&type=template&id=e7c365c8&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DropDown_vue_vue_type_template_id_e7c365c8___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DropDown_vue_vue_type_template_id_e7c365c8___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/Editor.vue": +/*!********************************************!*\ + !*** ./resources/js/components/Editor.vue ***! + \********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Editor_vue_vue_type_template_id_1dbb5118___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Editor.vue?vue&type=template&id=1dbb5118& */ "./resources/js/components/Editor.vue?vue&type=template&id=1dbb5118&"); +/* harmony import */ var _Editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Editor.vue?vue&type=script&lang=js& */ "./resources/js/components/Editor.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _Editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _Editor_vue_vue_type_template_id_1dbb5118___WEBPACK_IMPORTED_MODULE_0__["render"], + _Editor_vue_vue_type_template_id_1dbb5118___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/Editor.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/Editor.vue?vue&type=script&lang=js&": +/*!*********************************************************************!*\ + !*** ./resources/js/components/Editor.vue?vue&type=script&lang=js& ***! + \*********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Editor.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Editor.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/Editor.vue?vue&type=template&id=1dbb5118&": +/*!***************************************************************************!*\ + !*** ./resources/js/components/Editor.vue?vue&type=template&id=1dbb5118& ***! + \***************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Editor_vue_vue_type_template_id_1dbb5118___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Editor.vue?vue&type=template&id=1dbb5118& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Editor.vue?vue&type=template&id=1dbb5118&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Editor_vue_vue_type_template_id_1dbb5118___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Editor_vue_vue_type_template_id_1dbb5118___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/FormErrors.vue": +/*!************************************************!*\ + !*** ./resources/js/components/FormErrors.vue ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _FormErrors_vue_vue_type_template_id_bea19b0c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FormErrors.vue?vue&type=template&id=bea19b0c& */ "./resources/js/components/FormErrors.vue?vue&type=template&id=bea19b0c&"); +/* harmony import */ var _FormErrors_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FormErrors.vue?vue&type=script&lang=js& */ "./resources/js/components/FormErrors.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _FormErrors_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _FormErrors_vue_vue_type_template_id_bea19b0c___WEBPACK_IMPORTED_MODULE_0__["render"], + _FormErrors_vue_vue_type_template_id_bea19b0c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/FormErrors.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/FormErrors.vue?vue&type=script&lang=js&": +/*!*************************************************************************!*\ + !*** ./resources/js/components/FormErrors.vue?vue&type=script&lang=js& ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FormErrors_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./FormErrors.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FormErrors.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FormErrors_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/FormErrors.vue?vue&type=template&id=bea19b0c&": +/*!*******************************************************************************!*\ + !*** ./resources/js/components/FormErrors.vue?vue&type=template&id=bea19b0c& ***! + \*******************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FormErrors_vue_vue_type_template_id_bea19b0c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./FormErrors.vue?vue&type=template&id=bea19b0c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FormErrors.vue?vue&type=template&id=bea19b0c&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FormErrors_vue_vue_type_template_id_bea19b0c___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FormErrors_vue_vue_type_template_id_bea19b0c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/FullscreenModal.vue": +/*!*****************************************************!*\ + !*** ./resources/js/components/FullscreenModal.vue ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _FullscreenModal_vue_vue_type_template_id_4d8b8f17___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FullscreenModal.vue?vue&type=template&id=4d8b8f17& */ "./resources/js/components/FullscreenModal.vue?vue&type=template&id=4d8b8f17&"); +/* harmony import */ var _FullscreenModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FullscreenModal.vue?vue&type=script&lang=js& */ "./resources/js/components/FullscreenModal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _FullscreenModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _FullscreenModal_vue_vue_type_template_id_4d8b8f17___WEBPACK_IMPORTED_MODULE_0__["render"], + _FullscreenModal_vue_vue_type_template_id_4d8b8f17___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/FullscreenModal.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/FullscreenModal.vue?vue&type=script&lang=js&": +/*!******************************************************************************!*\ + !*** ./resources/js/components/FullscreenModal.vue?vue&type=script&lang=js& ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FullscreenModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./FullscreenModal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FullscreenModal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FullscreenModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/FullscreenModal.vue?vue&type=template&id=4d8b8f17&": +/*!************************************************************************************!*\ + !*** ./resources/js/components/FullscreenModal.vue?vue&type=template&id=4d8b8f17& ***! + \************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FullscreenModal_vue_vue_type_template_id_4d8b8f17___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./FullscreenModal.vue?vue&type=template&id=4d8b8f17& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/FullscreenModal.vue?vue&type=template&id=4d8b8f17&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FullscreenModal_vue_vue_type_template_id_4d8b8f17___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FullscreenModal_vue_vue_type_template_id_4d8b8f17___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/ImagePicker.vue": +/*!*************************************************!*\ + !*** ./resources/js/components/ImagePicker.vue ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _ImagePicker_vue_vue_type_template_id_497ddc2e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ImagePicker.vue?vue&type=template&id=497ddc2e& */ "./resources/js/components/ImagePicker.vue?vue&type=template&id=497ddc2e&"); +/* harmony import */ var _ImagePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ImagePicker.vue?vue&type=script&lang=js& */ "./resources/js/components/ImagePicker.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _ImagePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _ImagePicker_vue_vue_type_template_id_497ddc2e___WEBPACK_IMPORTED_MODULE_0__["render"], + _ImagePicker_vue_vue_type_template_id_497ddc2e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/ImagePicker.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/ImagePicker.vue?vue&type=script&lang=js&": +/*!**************************************************************************!*\ + !*** ./resources/js/components/ImagePicker.vue?vue&type=script&lang=js& ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImagePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./ImagePicker.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ImagePicker.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImagePicker_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/ImagePicker.vue?vue&type=template&id=497ddc2e&": +/*!********************************************************************************!*\ + !*** ./resources/js/components/ImagePicker.vue?vue&type=template&id=497ddc2e& ***! + \********************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ImagePicker_vue_vue_type_template_id_497ddc2e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./ImagePicker.vue?vue&type=template&id=497ddc2e& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ImagePicker.vue?vue&type=template&id=497ddc2e&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ImagePicker_vue_vue_type_template_id_497ddc2e___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ImagePicker_vue_vue_type_template_id_497ddc2e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/MarkdownEditor.vue": +/*!****************************************************!*\ + !*** ./resources/js/components/MarkdownEditor.vue ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _MarkdownEditor_vue_vue_type_template_id_8fc46f32___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MarkdownEditor.vue?vue&type=template&id=8fc46f32& */ "./resources/js/components/MarkdownEditor.vue?vue&type=template&id=8fc46f32&"); +/* harmony import */ var _MarkdownEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MarkdownEditor.vue?vue&type=script&lang=js& */ "./resources/js/components/MarkdownEditor.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _MarkdownEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _MarkdownEditor_vue_vue_type_template_id_8fc46f32___WEBPACK_IMPORTED_MODULE_0__["render"], + _MarkdownEditor_vue_vue_type_template_id_8fc46f32___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/MarkdownEditor.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/MarkdownEditor.vue?vue&type=script&lang=js&": +/*!*****************************************************************************!*\ + !*** ./resources/js/components/MarkdownEditor.vue?vue&type=script&lang=js& ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MarkdownEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./MarkdownEditor.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MarkdownEditor.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MarkdownEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/MarkdownEditor.vue?vue&type=template&id=8fc46f32&": +/*!***********************************************************************************!*\ + !*** ./resources/js/components/MarkdownEditor.vue?vue&type=template&id=8fc46f32& ***! + \***********************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MarkdownEditor_vue_vue_type_template_id_8fc46f32___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./MarkdownEditor.vue?vue&type=template&id=8fc46f32& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MarkdownEditor.vue?vue&type=template&id=8fc46f32&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MarkdownEditor_vue_vue_type_template_id_8fc46f32___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MarkdownEditor_vue_vue_type_template_id_8fc46f32___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/MiniEditor.vue": +/*!************************************************!*\ + !*** ./resources/js/components/MiniEditor.vue ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _MiniEditor_vue_vue_type_template_id_04fe0f4f_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true& */ "./resources/js/components/MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true&"); +/* harmony import */ var _MiniEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MiniEditor.vue?vue&type=script&lang=js& */ "./resources/js/components/MiniEditor.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _MiniEditor_vue_vue_type_style_index_0_id_04fe0f4f_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css& */ "./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _MiniEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _MiniEditor_vue_vue_type_template_id_04fe0f4f_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], + _MiniEditor_vue_vue_type_template_id_04fe0f4f_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + "04fe0f4f", + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/MiniEditor.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/MiniEditor.vue?vue&type=script&lang=js&": +/*!*************************************************************************!*\ + !*** ./resources/js/components/MiniEditor.vue?vue&type=script&lang=js& ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./MiniEditor.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css&": +/*!*********************************************************************************************************!*\ + !*** ./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css& ***! + \*********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_style_index_0_id_04fe0f4f_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader!../../../node_modules/css-loader??ref--7-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--7-2!../../../node_modules/vue-loader/lib??vue-loader-options!./MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=style&index=0&id=04fe0f4f&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_style_index_0_id_04fe0f4f_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_style_index_0_id_04fe0f4f_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_style_index_0_id_04fe0f4f_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_style_index_0_id_04fe0f4f_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_style_index_0_id_04fe0f4f_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/components/MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true&": +/*!*******************************************************************************************!*\ + !*** ./resources/js/components/MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true& ***! + \*******************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_template_id_04fe0f4f_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MiniEditor.vue?vue&type=template&id=04fe0f4f&scoped=true&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_template_id_04fe0f4f_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MiniEditor_vue_vue_type_template_id_04fe0f4f_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/Modal.vue": +/*!*******************************************!*\ + !*** ./resources/js/components/Modal.vue ***! + \*******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Modal.vue?vue&type=template&id=53ab54d2& */ "./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&"); +/* harmony import */ var _Modal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Modal.vue?vue&type=script&lang=js& */ "./resources/js/components/Modal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _Modal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["render"], + _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/Modal.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/Modal.vue?vue&type=script&lang=js&": +/*!********************************************************************!*\ + !*** ./resources/js/components/Modal.vue?vue&type=script&lang=js& ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Modal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Modal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&": +/*!**************************************************************************!*\ + !*** ./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2& ***! + \**************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Modal.vue?vue&type=template&id=53ab54d2& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/MultiSelect.vue": +/*!*************************************************!*\ + !*** ./resources/js/components/MultiSelect.vue ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _MultiSelect_vue_vue_type_template_id_add4e00c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MultiSelect.vue?vue&type=template&id=add4e00c& */ "./resources/js/components/MultiSelect.vue?vue&type=template&id=add4e00c&"); +/* harmony import */ var _MultiSelect_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MultiSelect.vue?vue&type=script&lang=js& */ "./resources/js/components/MultiSelect.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _MultiSelect_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _MultiSelect_vue_vue_type_template_id_add4e00c___WEBPACK_IMPORTED_MODULE_0__["render"], + _MultiSelect_vue_vue_type_template_id_add4e00c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/MultiSelect.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/MultiSelect.vue?vue&type=script&lang=js&": +/*!**************************************************************************!*\ + !*** ./resources/js/components/MultiSelect.vue?vue&type=script&lang=js& ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiSelect_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./MultiSelect.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MultiSelect.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiSelect_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/MultiSelect.vue?vue&type=template&id=add4e00c&": +/*!********************************************************************************!*\ + !*** ./resources/js/components/MultiSelect.vue?vue&type=template&id=add4e00c& ***! + \********************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiSelect_vue_vue_type_template_id_add4e00c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./MultiSelect.vue?vue&type=template&id=add4e00c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/MultiSelect.vue?vue&type=template&id=add4e00c&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiSelect_vue_vue_type_template_id_add4e00c___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_MultiSelect_vue_vue_type_template_id_add4e00c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/Notification.vue": +/*!**************************************************!*\ + !*** ./resources/js/components/Notification.vue ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Notification_vue_vue_type_template_id_6a4ce154___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Notification.vue?vue&type=template&id=6a4ce154& */ "./resources/js/components/Notification.vue?vue&type=template&id=6a4ce154&"); +/* harmony import */ var _Notification_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Notification.vue?vue&type=script&lang=js& */ "./resources/js/components/Notification.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _Notification_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Notification.vue?vue&type=style&index=0&lang=css& */ "./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _Notification_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _Notification_vue_vue_type_template_id_6a4ce154___WEBPACK_IMPORTED_MODULE_0__["render"], + _Notification_vue_vue_type_template_id_6a4ce154___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/Notification.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/Notification.vue?vue&type=script&lang=js&": +/*!***************************************************************************!*\ + !*** ./resources/js/components/Notification.vue?vue&type=script&lang=js& ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Notification.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css&": +/*!***********************************************************************************!*\ + !*** ./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css& ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader!../../../node_modules/css-loader??ref--7-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--7-2!../../../node_modules/vue-loader/lib??vue-loader-options!./Notification.vue?vue&type=style&index=0&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/components/Notification.vue?vue&type=template&id=6a4ce154&": +/*!*********************************************************************************!*\ + !*** ./resources/js/components/Notification.vue?vue&type=template&id=6a4ce154& ***! + \*********************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_template_id_6a4ce154___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Notification.vue?vue&type=template&id=6a4ce154& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notification.vue?vue&type=template&id=6a4ce154&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_template_id_6a4ce154___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Notification_vue_vue_type_template_id_6a4ce154___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/PageHeader.vue": +/*!************************************************!*\ + !*** ./resources/js/components/PageHeader.vue ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _PageHeader_vue_vue_type_template_id_7fb418a7___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PageHeader.vue?vue&type=template&id=7fb418a7& */ "./resources/js/components/PageHeader.vue?vue&type=template&id=7fb418a7&"); +/* harmony import */ var _PageHeader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PageHeader.vue?vue&type=script&lang=js& */ "./resources/js/components/PageHeader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _PageHeader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _PageHeader_vue_vue_type_template_id_7fb418a7___WEBPACK_IMPORTED_MODULE_0__["render"], + _PageHeader_vue_vue_type_template_id_7fb418a7___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/PageHeader.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/PageHeader.vue?vue&type=script&lang=js&": +/*!*************************************************************************!*\ + !*** ./resources/js/components/PageHeader.vue?vue&type=script&lang=js& ***! + \*************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PageHeader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./PageHeader.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/PageHeader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PageHeader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/PageHeader.vue?vue&type=template&id=7fb418a7&": +/*!*******************************************************************************!*\ + !*** ./resources/js/components/PageHeader.vue?vue&type=template&id=7fb418a7& ***! + \*******************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_PageHeader_vue_vue_type_template_id_7fb418a7___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./PageHeader.vue?vue&type=template&id=7fb418a7& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/PageHeader.vue?vue&type=template&id=7fb418a7&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_PageHeader_vue_vue_type_template_id_7fb418a7___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_PageHeader_vue_vue_type_template_id_7fb418a7___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/SEOModal.vue": +/*!**********************************************!*\ + !*** ./resources/js/components/SEOModal.vue ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _SEOModal_vue_vue_type_template_id_0c1171bb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SEOModal.vue?vue&type=template&id=0c1171bb& */ "./resources/js/components/SEOModal.vue?vue&type=template&id=0c1171bb&"); +/* harmony import */ var _SEOModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SEOModal.vue?vue&type=script&lang=js& */ "./resources/js/components/SEOModal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _SEOModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _SEOModal_vue_vue_type_template_id_0c1171bb___WEBPACK_IMPORTED_MODULE_0__["render"], + _SEOModal_vue_vue_type_template_id_0c1171bb___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/SEOModal.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/SEOModal.vue?vue&type=script&lang=js&": +/*!***********************************************************************!*\ + !*** ./resources/js/components/SEOModal.vue?vue&type=script&lang=js& ***! + \***********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SEOModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./SEOModal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/SEOModal.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_SEOModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/SEOModal.vue?vue&type=template&id=0c1171bb&": +/*!*****************************************************************************!*\ + !*** ./resources/js/components/SEOModal.vue?vue&type=template&id=0c1171bb& ***! + \*****************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SEOModal_vue_vue_type_template_id_0c1171bb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./SEOModal.vue?vue&type=template&id=0c1171bb& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/SEOModal.vue?vue&type=template&id=0c1171bb&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SEOModal_vue_vue_type_template_id_0c1171bb___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SEOModal_vue_vue_type_template_id_0c1171bb___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/clickOutside.js": +/*!*************************************************!*\ + !*** ./resources/js/components/clickOutside.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * src: https://jsfiddle.net/Linusborg/Lx49LaL8/ + */ +module.exports = { + bind: function bind(el, binding, vnode) { + if (typeof binding.value !== 'function') { + var compName = vnode.context.name; + var warn = "[Vue-click-outside:] provided expression '".concat(binding.expression, "' is not a function, but has to be"); + + if (compName) { + warn += "Found in component '".concat(compName, "'"); + } + } + + var bubble = binding.modifiers.bubble; + + var handler = function handler(e) { + if (bubble || !el.contains(e.target) && el !== e.target) { + binding.value(e); + } + }; + + el.__vueClickOutside__ = handler; + document.addEventListener('click', handler); + }, + unbind: function unbind(el, binding) { + document.removeEventListener('click', el.__vueClickOutside__); + el.__vueClickOutside__ = null; + } +}; + +/***/ }), + +/***/ "./resources/js/components/editorComponents/HTMLBlot.js": +/*!**************************************************************!*\ + !*** ./resources/js/components/editorComponents/HTMLBlot.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill */ "./node_modules/quill/dist/quill.js"); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill__WEBPACK_IMPORTED_MODULE_0__); +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } + +function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + + +var BlockEmbed = quill__WEBPACK_IMPORTED_MODULE_0___default.a.import('blots/block/embed'); + +var HTMLBlot = +/*#__PURE__*/ +function (_BlockEmbed) { + _inherits(HTMLBlot, _BlockEmbed); + + function HTMLBlot() { + _classCallCheck(this, HTMLBlot); + + return _possibleConstructorReturn(this, _getPrototypeOf(HTMLBlot).apply(this, arguments)); + } + + _createClass(HTMLBlot, null, [{ + key: "create", + value: function create(value) { + var node = _get(_getPrototypeOf(HTMLBlot), "create", this).call(this); + + node.innerHTML = value.content; + node.setAttribute('contenteditable', false); + return node; + } + }, { + key: "value", + value: function value(node) { + return { + content: node.innerHTML + }; + } + }]); + + return HTMLBlot; +}(BlockEmbed); + +HTMLBlot.blotName = 'html'; +HTMLBlot.tagName = 'div'; +HTMLBlot.className = 'inline_html'; +/* harmony default export */ __webpack_exports__["default"] = (HTMLBlot); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/HTMLEmbedder.vue": +/*!*******************************************************************!*\ + !*** ./resources/js/components/editorComponents/HTMLEmbedder.vue ***! + \*******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _HTMLEmbedder_vue_vue_type_template_id_9e471858___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HTMLEmbedder.vue?vue&type=template&id=9e471858& */ "./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=template&id=9e471858&"); +/* harmony import */ var _HTMLEmbedder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HTMLEmbedder.vue?vue&type=script&lang=js& */ "./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _HTMLEmbedder_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HTMLEmbedder.vue?vue&type=style&index=0&lang=css& */ "./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _HTMLEmbedder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _HTMLEmbedder_vue_vue_type_template_id_9e471858___WEBPACK_IMPORTED_MODULE_0__["render"], + _HTMLEmbedder_vue_vue_type_template_id_9e471858___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/editorComponents/HTMLEmbedder.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=script&lang=js&": +/*!********************************************************************************************!*\ + !*** ./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=script&lang=js& ***! + \********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./HTMLEmbedder.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css&": +/*!****************************************************************************************************!*\ + !*** ./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css& ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader!../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./HTMLEmbedder.vue?vue&type=style&index=0&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=template&id=9e471858&": +/*!**************************************************************************************************!*\ + !*** ./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=template&id=9e471858& ***! + \**************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_template_id_9e471858___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./HTMLEmbedder.vue?vue&type=template&id=9e471858& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/HTMLEmbedder.vue?vue&type=template&id=9e471858&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_template_id_9e471858___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_HTMLEmbedder_vue_vue_type_template_id_9e471858___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/editorComponents/ImageUploader.vue": +/*!********************************************************************!*\ + !*** ./resources/js/components/editorComponents/ImageUploader.vue ***! + \********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _ImageUploader_vue_vue_type_template_id_6435daa8___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ImageUploader.vue?vue&type=template&id=6435daa8& */ "./resources/js/components/editorComponents/ImageUploader.vue?vue&type=template&id=6435daa8&"); +/* harmony import */ var _ImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ImageUploader.vue?vue&type=script&lang=js& */ "./resources/js/components/editorComponents/ImageUploader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _ImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ImageUploader.vue?vue&type=style&index=0&lang=css& */ "./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _ImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _ImageUploader_vue_vue_type_template_id_6435daa8___WEBPACK_IMPORTED_MODULE_0__["render"], + _ImageUploader_vue_vue_type_template_id_6435daa8___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/components/editorComponents/ImageUploader.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/ImageUploader.vue?vue&type=script&lang=js&": +/*!*********************************************************************************************!*\ + !*** ./resources/js/components/editorComponents/ImageUploader.vue?vue&type=script&lang=js& ***! + \*********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./ImageUploader.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css&": +/*!*****************************************************************************************************!*\ + !*** ./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css& ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader!../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./ImageUploader.vue?vue&type=style&index=0&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/ImageUploader.vue?vue&type=template&id=6435daa8&": +/*!***************************************************************************************************!*\ + !*** ./resources/js/components/editorComponents/ImageUploader.vue?vue&type=template&id=6435daa8& ***! + \***************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_template_id_6435daa8___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./ImageUploader.vue?vue&type=template&id=6435daa8& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/editorComponents/ImageUploader.vue?vue&type=template&id=6435daa8&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_template_id_6435daa8___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUploader_vue_vue_type_template_id_6435daa8___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/components/editorComponents/WinkClipboard.js": +/*!*******************************************************************!*\ + !*** ./resources/js/components/editorComponents/WinkClipboard.js ***! + \*******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill */ "./node_modules/quill/dist/quill.js"); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js"); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_1__); +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + + + +var Clipboard = quill__WEBPACK_IMPORTED_MODULE_0___default.a.import('modules/clipboard'); +var Delta = quill__WEBPACK_IMPORTED_MODULE_0___default.a.import('delta'); // Inspired by https://github.com/Artem-Schander/quill-paste-smart/blob/master/src/quill-paste-smart.js + +var WinkClipboard = +/*#__PURE__*/ +function (_Clipboard) { + _inherits(WinkClipboard, _Clipboard); + + function WinkClipboard() { + _classCallCheck(this, WinkClipboard); + + return _possibleConstructorReturn(this, _getPrototypeOf(WinkClipboard).apply(this, arguments)); + } + + _createClass(WinkClipboard, [{ + key: "onPaste", + value: function onPaste(e) { + var delta; + var text; + var html; + var range; + e.preventDefault(); + range = this.quill.getSelection(); + text = e.clipboardData.getData('text/plain'); + html = e.clipboardData.getData('text/html'); + delta = new Delta().retain(range.index).delete(range.length); + + if (html) { + delta = delta.concat(this.convert(dompurify__WEBPACK_IMPORTED_MODULE_1___default.a.sanitize(html, this.getAllowed()))); + } else { + delta = delta.insert(text); + } + + this.quill.updateContents(delta); + this.quill.setSelection(range.index + text.length, 0); + this.quill.scrollIntoView(); + } + }, { + key: "getAllowed", + value: function getAllowed() { + var tidy = {}; + tidy.ALLOWED_TAGS = ['p', 'br', 'span', 'b', 'strong', 'i', 'u', 's', 'h2', 'h3', 'pre', 'ol', 'ul', 'li', 'a', 'img', 'blockquote']; + tidy.ALLOWED_ATTR = ['class', 'spellcheck', 'href', 'rel', 'src', 'title', 'alt']; + return tidy; + } + }]); + + return WinkClipboard; +}(Clipboard); + +/* harmony default export */ __webpack_exports__["default"] = (WinkClipboard); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/WinkDividerBlot.js": +/*!*********************************************************************!*\ + !*** ./resources/js/components/editorComponents/WinkDividerBlot.js ***! + \*********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill */ "./node_modules/quill/dist/quill.js"); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill__WEBPACK_IMPORTED_MODULE_0__); +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + + +var BlockEmbed = quill__WEBPACK_IMPORTED_MODULE_0___default.a.import('blots/block/embed'); + +var WinkDividerBlot = +/*#__PURE__*/ +function (_BlockEmbed) { + _inherits(WinkDividerBlot, _BlockEmbed); + + function WinkDividerBlot() { + _classCallCheck(this, WinkDividerBlot); + + return _possibleConstructorReturn(this, _getPrototypeOf(WinkDividerBlot).apply(this, arguments)); + } + + return WinkDividerBlot; +}(BlockEmbed); + +WinkDividerBlot.blotName = 'divider'; +WinkDividerBlot.tagName = 'hr'; +/* harmony default export */ __webpack_exports__["default"] = (WinkDividerBlot); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/WinkImageBlot.js": +/*!*******************************************************************!*\ + !*** ./resources/js/components/editorComponents/WinkImageBlot.js ***! + \*******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill */ "./node_modules/quill/dist/quill.js"); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill__WEBPACK_IMPORTED_MODULE_0__); +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } + +function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + + +var BlockEmbed = quill__WEBPACK_IMPORTED_MODULE_0___default.a.import('blots/block/embed'); + +var WinkImageBlot = +/*#__PURE__*/ +function (_BlockEmbed) { + _inherits(WinkImageBlot, _BlockEmbed); + + function WinkImageBlot() { + _classCallCheck(this, WinkImageBlot); + + return _possibleConstructorReturn(this, _getPrototypeOf(WinkImageBlot).apply(this, arguments)); + } + + _createClass(WinkImageBlot, null, [{ + key: "create", + value: function create(value) { + var node = _get(_getPrototypeOf(WinkImageBlot), "create", this).call(this); + + var img = document.createElement('img'); + node.setAttribute('contenteditable', false); + node.dataset.layout = value.layout; + img.setAttribute('alt', value.caption); + img.setAttribute('src', value.url); + node.appendChild(img); + + if (value.caption) { + var caption = document.createElement('p'); + caption.innerHTML = value.caption; + node.appendChild(caption); + } + + return node; + } + }, { + key: "value", + value: function value(node) { + var img = node.querySelector('img'); + return { + layout: node.dataset.layout, + caption: img.getAttribute('alt'), + url: img.getAttribute('src') + }; + } + }]); + + return WinkImageBlot; +}(BlockEmbed); + +WinkImageBlot.tagName = 'div'; +WinkImageBlot.blotName = 'captioned-image'; +WinkImageBlot.className = 'embedded_image'; +/* harmony default export */ __webpack_exports__["default"] = (WinkImageBlot); + +/***/ }), + +/***/ "./resources/js/components/editorComponents/WinkLink.js": +/*!**************************************************************!*\ + !*** ./resources/js/components/editorComponents/WinkLink.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! quill */ "./node_modules/quill/dist/quill.js"); +/* harmony import */ var quill__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(quill__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js"); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_1__); +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } + +function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + + + +var Link = quill__WEBPACK_IMPORTED_MODULE_0___default.a.import('formats/link'); // Inspired by https://codepen.io/anon/pen/GNMXZa?__cf_chl_jschl_tk__=42b291790171908cf2f128f6aff4d78e6a2723fb-1589576797-0-AbEVaGl8yJDXzW3aSFJ8WD9id6PakeZ2fSXBBOoAaJ_mTZUsuAVzCZdUlkEYJ-Q5evt2n6zNpiQlz7VvmILh6-cclhloFqawsRPA2H4F1aqT3G2fQ9GOvPdI8Q1ShHkP8-pKz8F5tPUsQy0sd4Y4fgSDS_OkrsGALxMQKF3Tum378uOf9sE3fkxJvy9QvgSx2i1zs9ZDNTIXhtvaur0R6-e44ZOF0NtCVJfrHgNjqUZZpbdzXN7H6O9HhCoJj-sn9YL7cPicUb2qAoDxsqMGF8NqlYsQtBKNj374tv7SM9cmVZCyfun1n1SoxGBF6-0LNRTSKQCX4F-m72WUGvQ920lxQqZZz29OtHwnD_ys4f6Z + +var WinkLink = +/*#__PURE__*/ +function (_Link) { + _inherits(WinkLink, _Link); + + function WinkLink() { + _classCallCheck(this, WinkLink); + + return _possibleConstructorReturn(this, _getPrototypeOf(WinkLink).apply(this, arguments)); + } + + _createClass(WinkLink, [{ + key: "format", + value: function format(name, value) { + _get(_getPrototypeOf(WinkLink.prototype), "format", this).call(this, name, value); + + this["domNode"].removeAttribute("target"); + } + }], [{ + key: "create", + value: function create(value) { + var node = _get(_getPrototypeOf(WinkLink), "create", this).call(this, value); + + value = this.sanitize(value); + node.setAttribute('href', value); + node.removeAttribute('target'); + return node; + } + }]); + + return WinkLink; +}(Link); + +/* harmony default export */ __webpack_exports__["default"] = (WinkLink); + +/***/ }), + +/***/ "./resources/js/components/loadingButton.js": +/*!**************************************************!*\ + !*** ./resources/js/components/loadingButton.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * The v-loading directive is used with <button> tag to show spinner + * while the component is busy loading. The parent component + * must have a "loading" boolean data property. + */ +module.exports = { + /** + * Component is ready. + */ + bind: function bind(el, binding, vnode) { + var element = el; + vnode.context.$watch(binding.expression || 'saving', function (val) { + if (val) { + element.setAttribute('disabled', true); + return; + } + + element.removeAttribute('disabled'); + }); + } +}; + +/***/ }), + +/***/ "./resources/js/partials/FilterDropdown.vue": +/*!**************************************************!*\ + !*** ./resources/js/partials/FilterDropdown.vue ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _FilterDropdown_vue_vue_type_template_id_33389b58___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FilterDropdown.vue?vue&type=template&id=33389b58& */ "./resources/js/partials/FilterDropdown.vue?vue&type=template&id=33389b58&"); +/* harmony import */ var _FilterDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FilterDropdown.vue?vue&type=script&lang=js& */ "./resources/js/partials/FilterDropdown.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _FilterDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _FilterDropdown_vue_vue_type_template_id_33389b58___WEBPACK_IMPORTED_MODULE_0__["render"], + _FilterDropdown_vue_vue_type_template_id_33389b58___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/partials/FilterDropdown.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/partials/FilterDropdown.vue?vue&type=script&lang=js&": +/*!***************************************************************************!*\ + !*** ./resources/js/partials/FilterDropdown.vue?vue&type=script&lang=js& ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FilterDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./FilterDropdown.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/FilterDropdown.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FilterDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/partials/FilterDropdown.vue?vue&type=template&id=33389b58&": +/*!*********************************************************************************!*\ + !*** ./resources/js/partials/FilterDropdown.vue?vue&type=template&id=33389b58& ***! + \*********************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FilterDropdown_vue_vue_type_template_id_33389b58___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./FilterDropdown.vue?vue&type=template&id=33389b58& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/FilterDropdown.vue?vue&type=template&id=33389b58&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FilterDropdown_vue_vue_type_template_id_33389b58___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FilterDropdown_vue_vue_type_template_id_33389b58___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/partials/Preloader.vue": +/*!*********************************************!*\ + !*** ./resources/js/partials/Preloader.vue ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _Preloader_vue_vue_type_template_id_37734fd2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Preloader.vue?vue&type=template&id=37734fd2& */ "./resources/js/partials/Preloader.vue?vue&type=template&id=37734fd2&"); +/* harmony import */ var _Preloader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Preloader.vue?vue&type=script&lang=js& */ "./resources/js/partials/Preloader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _Preloader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _Preloader_vue_vue_type_template_id_37734fd2___WEBPACK_IMPORTED_MODULE_0__["render"], + _Preloader_vue_vue_type_template_id_37734fd2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/partials/Preloader.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/partials/Preloader.vue?vue&type=script&lang=js&": +/*!**********************************************************************!*\ + !*** ./resources/js/partials/Preloader.vue?vue&type=script&lang=js& ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Preloader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Preloader.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/Preloader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Preloader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/partials/Preloader.vue?vue&type=template&id=37734fd2&": +/*!****************************************************************************!*\ + !*** ./resources/js/partials/Preloader.vue?vue&type=template&id=37734fd2& ***! + \****************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Preloader_vue_vue_type_template_id_37734fd2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Preloader.vue?vue&type=template&id=37734fd2& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/partials/Preloader.vue?vue&type=template&id=37734fd2&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Preloader_vue_vue_type_template_id_37734fd2___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Preloader_vue_vue_type_template_id_37734fd2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/routes.js": +/*!********************************!*\ + !*** ./resources/js/routes.js ***! + \********************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony default export */ __webpack_exports__["default"] = ([{ + path: '/', + redirect: '/posts' +}, // Posts... +{ + path: '/posts', + name: 'posts', + component: __webpack_require__(/*! ./screens/posts/index */ "./resources/js/screens/posts/index.vue").default +}, { + path: '/posts/new', + name: 'post-new', + component: __webpack_require__(/*! ./screens/posts/edit */ "./resources/js/screens/posts/edit.vue").default +}, { + path: '/posts/:id', + name: 'post-edit', + component: __webpack_require__(/*! ./screens/posts/edit */ "./resources/js/screens/posts/edit.vue").default +}, // Categories... +{ + path: '/tags', + name: 'tags', + component: __webpack_require__(/*! ./screens/tags/index */ "./resources/js/screens/tags/index.vue").default +}, { + path: '/tags/new', + name: 'tag-new', + component: __webpack_require__(/*! ./screens/tags/edit */ "./resources/js/screens/tags/edit.vue").default +}, { + path: '/tags/:id', + name: 'tag-edit', + component: __webpack_require__(/*! ./screens/tags/edit */ "./resources/js/screens/tags/edit.vue").default +}, // Authors... +{ + path: '/team', + name: 'team', + component: __webpack_require__(/*! ./screens/team/index */ "./resources/js/screens/team/index.vue").default +}, { + path: '/team/new', + name: 'team-new', + component: __webpack_require__(/*! ./screens/team/edit */ "./resources/js/screens/team/edit.vue").default +}, { + path: '/team/:id', + name: 'team-edit', + component: __webpack_require__(/*! ./screens/team/edit */ "./resources/js/screens/team/edit.vue").default +}, // Pages... +{ + path: '/pages', + name: 'pages', + component: __webpack_require__(/*! ./screens/pages/index */ "./resources/js/screens/pages/index.vue").default +}, { + path: '/pages/new', + name: 'page-new', + component: __webpack_require__(/*! ./screens/pages/edit */ "./resources/js/screens/pages/edit.vue").default +}, { + path: '/pages/:id', + name: 'page-edit', + component: __webpack_require__(/*! ./screens/pages/edit */ "./resources/js/screens/pages/edit.vue").default +}, // Catch All... +{ + path: '*', + name: 'catch-all', + component: __webpack_require__(/*! ./screens/404 */ "./resources/js/screens/404.vue").default +}]); + +/***/ }), + +/***/ "./resources/js/screens/404.vue": +/*!**************************************!*\ + !*** ./resources/js/screens/404.vue ***! + \**************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _404_vue_vue_type_template_id_148d4cbc___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./404.vue?vue&type=template&id=148d4cbc& */ "./resources/js/screens/404.vue?vue&type=template&id=148d4cbc&"); +/* harmony import */ var _404_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./404.vue?vue&type=script&lang=js& */ "./resources/js/screens/404.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _404_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _404_vue_vue_type_template_id_148d4cbc___WEBPACK_IMPORTED_MODULE_0__["render"], + _404_vue_vue_type_template_id_148d4cbc___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/404.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/404.vue?vue&type=script&lang=js&": +/*!***************************************************************!*\ + !*** ./resources/js/screens/404.vue?vue&type=script&lang=js& ***! + \***************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_404_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./404.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/404.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_404_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/404.vue?vue&type=template&id=148d4cbc&": +/*!*********************************************************************!*\ + !*** ./resources/js/screens/404.vue?vue&type=template&id=148d4cbc& ***! + \*********************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_404_vue_vue_type_template_id_148d4cbc___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./404.vue?vue&type=template&id=148d4cbc& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/404.vue?vue&type=template&id=148d4cbc&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_404_vue_vue_type_template_id_148d4cbc___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_404_vue_vue_type_template_id_148d4cbc___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/loadsEntries.js": +/*!**********************************************!*\ + !*** ./resources/js/screens/loadsEntries.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +module.exports = { + computed: { + isFiltered: function isFiltered() { + return !!this.searchQuery.length || this.filters && this.filters.status || this.filters && this.filters.author_id || this.filters && this.filters.tag_id; + } + }, + watch: { + searchQuery: function searchQuery() { + this.searchEntries(); + } + }, + methods: { + loadEntries: function loadEntries() { + var _this = this; + + this.http().get(this.baseURL + '?wink=wink' + (this.searchQuery ? '&search=' + this.searchQuery : '') + (this.filters && this.filters.status ? '&status=' + this.filters.status : '') + (this.filters && this.filters.author_id ? '&author_id=' + this.filters.author_id : '') + (this.filters && this.filters.tag_id ? '&tag_id=' + this.filters.tag_id : '')).then(function (response) { + _this.entries = response.data.data; + _this.hasMoreEntries = !!response.data.links.next; + _this.nextPageUrl = response.data.links.next; + _this.ready = true; + }); + }, + + /** + * Load the older entries. + */ + loadOlderEntries: function loadOlderEntries() { + var _this2 = this; + + this.loadingMoreEntries = true; + this.http().get(this.nextPageUrl).then(function (response) { + var _this2$entries; + + (_this2$entries = _this2.entries).push.apply(_this2$entries, _toConsumableArray(response.data.data)); + + _this2.hasMoreEntries = !!response.data.links.next; + _this2.nextPageUrl = response.data.links.next; + _this2.loadingMoreEntries = false; + }); + }, + + /** + * Filter the entries by the search query. + */ + searchEntries: function searchEntries() { + var _this3 = this; + + if (!this.searchQuery) { + this.ready = false; + } + + this.debouncer(function () { + _this3.ready = false; + + _this3.loadEntries(); + }); + }, + + /** + * Focus the search input when the filter dropdown opens. + */ + focusSearchInput: function focusSearchInput() { + var _this4 = this; + + this.$nextTick(function () { + _this4.$refs.searchInput.focus(); + }); + }, + + /** + * Watch filters changes and fetch the entries. + */ + watchFiltersChanges: function watchFiltersChanges() { + var _this5 = this; + + this.$watch('filters', function () { + _this5.ready = false; + + _this5.debouncer(function () { + _this5.ready = false; + + _this5.loadEntries(); + }); + }, { + deep: true + }); + } + } +}; + +/***/ }), + +/***/ "./resources/js/screens/pages/edit.vue": +/*!*********************************************!*\ + !*** ./resources/js/screens/pages/edit.vue ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _edit_vue_vue_type_template_id_1451210a_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit.vue?vue&type=template&id=1451210a&scoped=true& */ "./resources/js/screens/pages/edit.vue?vue&type=template&id=1451210a&scoped=true&"); +/* harmony import */ var _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit.vue?vue&type=script&lang=js& */ "./resources/js/screens/pages/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _edit_vue_vue_type_style_index_0_id_1451210a_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css& */ "./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _edit_vue_vue_type_template_id_1451210a_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], + _edit_vue_vue_type_template_id_1451210a_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + "1451210a", + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/pages/edit.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/pages/edit.vue?vue&type=script&lang=js&": +/*!**********************************************************************!*\ + !*** ./resources/js/screens/pages/edit.vue?vue&type=script&lang=js& ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css&": +/*!******************************************************************************************************!*\ + !*** ./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css& ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_1451210a_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader!../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=style&index=0&id=1451210a&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_1451210a_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_1451210a_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_1451210a_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_1451210a_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_1451210a_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/screens/pages/edit.vue?vue&type=template&id=1451210a&scoped=true&": +/*!****************************************************************************************!*\ + !*** ./resources/js/screens/pages/edit.vue?vue&type=template&id=1451210a&scoped=true& ***! + \****************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_1451210a_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=template&id=1451210a&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/edit.vue?vue&type=template&id=1451210a&scoped=true&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_1451210a_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_1451210a_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/pages/index.vue": +/*!**********************************************!*\ + !*** ./resources/js/screens/pages/index.vue ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _index_vue_vue_type_template_id_06ce39b1___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=06ce39b1& */ "./resources/js/screens/pages/index.vue?vue&type=template&id=06ce39b1&"); +/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ "./resources/js/screens/pages/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _index_vue_vue_type_template_id_06ce39b1___WEBPACK_IMPORTED_MODULE_0__["render"], + _index_vue_vue_type_template_id_06ce39b1___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/pages/index.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/pages/index.vue?vue&type=script&lang=js&": +/*!***********************************************************************!*\ + !*** ./resources/js/screens/pages/index.vue?vue&type=script&lang=js& ***! + \***********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/pages/index.vue?vue&type=template&id=06ce39b1&": +/*!*****************************************************************************!*\ + !*** ./resources/js/screens/pages/index.vue?vue&type=template&id=06ce39b1& ***! + \*****************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_06ce39b1___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=template&id=06ce39b1& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/pages/index.vue?vue&type=template&id=06ce39b1&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_06ce39b1___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_06ce39b1___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/posts/FeaturedImageUploader.vue": +/*!**************************************************************!*\ + !*** ./resources/js/screens/posts/FeaturedImageUploader.vue ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _FeaturedImageUploader_vue_vue_type_template_id_1a2a44e9___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9& */ "./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9&"); +/* harmony import */ var _FeaturedImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FeaturedImageUploader.vue?vue&type=script&lang=js& */ "./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _FeaturedImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FeaturedImageUploader.vue?vue&type=style&index=0&lang=css& */ "./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _FeaturedImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _FeaturedImageUploader_vue_vue_type_template_id_1a2a44e9___WEBPACK_IMPORTED_MODULE_0__["render"], + _FeaturedImageUploader_vue_vue_type_template_id_1a2a44e9___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/posts/FeaturedImageUploader.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=script&lang=js&": +/*!***************************************************************************************!*\ + !*** ./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=script&lang=js& ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./FeaturedImageUploader.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css&": +/*!***********************************************************************************************!*\ + !*** ./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css& ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader!../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./FeaturedImageUploader.vue?vue&type=style&index=0&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=style&index=0&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9&": +/*!*********************************************************************************************!*\ + !*** ./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9& ***! + \*********************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_template_id_1a2a44e9___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/FeaturedImageUploader.vue?vue&type=template&id=1a2a44e9&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_template_id_1a2a44e9___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FeaturedImageUploader_vue_vue_type_template_id_1a2a44e9___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/posts/edit.vue": +/*!*********************************************!*\ + !*** ./resources/js/screens/posts/edit.vue ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _edit_vue_vue_type_template_id_16bc044c_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit.vue?vue&type=template&id=16bc044c&scoped=true& */ "./resources/js/screens/posts/edit.vue?vue&type=template&id=16bc044c&scoped=true&"); +/* harmony import */ var _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit.vue?vue&type=script&lang=js& */ "./resources/js/screens/posts/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _edit_vue_vue_type_style_index_0_id_16bc044c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css& */ "./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( + _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _edit_vue_vue_type_template_id_16bc044c_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], + _edit_vue_vue_type_template_id_16bc044c_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + "16bc044c", + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/posts/edit.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/posts/edit.vue?vue&type=script&lang=js&": +/*!**********************************************************************!*\ + !*** ./resources/js/screens/posts/edit.vue?vue&type=script&lang=js& ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css&": +/*!******************************************************************************************************!*\ + !*** ./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css& ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_16bc044c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader!../../../../node_modules/css-loader??ref--7-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=style&index=0&id=16bc044c&scoped=true&lang=css&"); +/* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_16bc044c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_16bc044c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_16bc044c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_16bc044c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); + /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_7_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_style_index_0_id_16bc044c_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a); + +/***/ }), + +/***/ "./resources/js/screens/posts/edit.vue?vue&type=template&id=16bc044c&scoped=true&": +/*!****************************************************************************************!*\ + !*** ./resources/js/screens/posts/edit.vue?vue&type=template&id=16bc044c&scoped=true& ***! + \****************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_16bc044c_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=template&id=16bc044c&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/edit.vue?vue&type=template&id=16bc044c&scoped=true&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_16bc044c_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_16bc044c_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/posts/index.vue": +/*!**********************************************!*\ + !*** ./resources/js/screens/posts/index.vue ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _index_vue_vue_type_template_id_027c3f00___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=027c3f00& */ "./resources/js/screens/posts/index.vue?vue&type=template&id=027c3f00&"); +/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ "./resources/js/screens/posts/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _index_vue_vue_type_template_id_027c3f00___WEBPACK_IMPORTED_MODULE_0__["render"], + _index_vue_vue_type_template_id_027c3f00___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/posts/index.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/posts/index.vue?vue&type=script&lang=js&": +/*!***********************************************************************!*\ + !*** ./resources/js/screens/posts/index.vue?vue&type=script&lang=js& ***! + \***********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/posts/index.vue?vue&type=template&id=027c3f00&": +/*!*****************************************************************************!*\ + !*** ./resources/js/screens/posts/index.vue?vue&type=template&id=027c3f00& ***! + \*****************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_027c3f00___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=template&id=027c3f00& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/posts/index.vue?vue&type=template&id=027c3f00&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_027c3f00___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_027c3f00___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/tags/edit.vue": +/*!********************************************!*\ + !*** ./resources/js/screens/tags/edit.vue ***! + \********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _edit_vue_vue_type_template_id_0e13d92a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit.vue?vue&type=template&id=0e13d92a& */ "./resources/js/screens/tags/edit.vue?vue&type=template&id=0e13d92a&"); +/* harmony import */ var _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit.vue?vue&type=script&lang=js& */ "./resources/js/screens/tags/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _edit_vue_vue_type_template_id_0e13d92a___WEBPACK_IMPORTED_MODULE_0__["render"], + _edit_vue_vue_type_template_id_0e13d92a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/tags/edit.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/tags/edit.vue?vue&type=script&lang=js&": +/*!*********************************************************************!*\ + !*** ./resources/js/screens/tags/edit.vue?vue&type=script&lang=js& ***! + \*********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/tags/edit.vue?vue&type=template&id=0e13d92a&": +/*!***************************************************************************!*\ + !*** ./resources/js/screens/tags/edit.vue?vue&type=template&id=0e13d92a& ***! + \***************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_0e13d92a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=template&id=0e13d92a& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/edit.vue?vue&type=template&id=0e13d92a&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_0e13d92a___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_0e13d92a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/tags/index.vue": +/*!*********************************************!*\ + !*** ./resources/js/screens/tags/index.vue ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _index_vue_vue_type_template_id_13c1f43c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=13c1f43c& */ "./resources/js/screens/tags/index.vue?vue&type=template&id=13c1f43c&"); +/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ "./resources/js/screens/tags/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _index_vue_vue_type_template_id_13c1f43c___WEBPACK_IMPORTED_MODULE_0__["render"], + _index_vue_vue_type_template_id_13c1f43c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/tags/index.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/tags/index.vue?vue&type=script&lang=js&": +/*!**********************************************************************!*\ + !*** ./resources/js/screens/tags/index.vue?vue&type=script&lang=js& ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/tags/index.vue?vue&type=template&id=13c1f43c&": +/*!****************************************************************************!*\ + !*** ./resources/js/screens/tags/index.vue?vue&type=template&id=13c1f43c& ***! + \****************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_13c1f43c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=template&id=13c1f43c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/tags/index.vue?vue&type=template&id=13c1f43c&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_13c1f43c___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_13c1f43c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/team/edit.vue": +/*!********************************************!*\ + !*** ./resources/js/screens/team/edit.vue ***! + \********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _edit_vue_vue_type_template_id_1474d134___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit.vue?vue&type=template&id=1474d134& */ "./resources/js/screens/team/edit.vue?vue&type=template&id=1474d134&"); +/* harmony import */ var _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit.vue?vue&type=script&lang=js& */ "./resources/js/screens/team/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _edit_vue_vue_type_template_id_1474d134___WEBPACK_IMPORTED_MODULE_0__["render"], + _edit_vue_vue_type_template_id_1474d134___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/team/edit.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/team/edit.vue?vue&type=script&lang=js&": +/*!*********************************************************************!*\ + !*** ./resources/js/screens/team/edit.vue?vue&type=script&lang=js& ***! + \*********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/edit.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/team/edit.vue?vue&type=template&id=1474d134&": +/*!***************************************************************************!*\ + !*** ./resources/js/screens/team/edit.vue?vue&type=template&id=1474d134& ***! + \***************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_1474d134___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./edit.vue?vue&type=template&id=1474d134& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/edit.vue?vue&type=template&id=1474d134&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_1474d134___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_edit_vue_vue_type_template_id_1474d134___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/js/screens/team/index.vue": +/*!*********************************************!*\ + !*** ./resources/js/screens/team/index.vue ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _index_vue_vue_type_template_id_04a50f26___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=04a50f26& */ "./resources/js/screens/team/index.vue?vue&type=template&id=04a50f26&"); +/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ "./resources/js/screens/team/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); + + + + + +/* normalize component */ + +var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( + _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], + _index_vue_vue_type_template_id_04a50f26___WEBPACK_IMPORTED_MODULE_0__["render"], + _index_vue_vue_type_template_id_04a50f26___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], + false, + null, + null, + null + +) + +/* hot reload */ +if (false) { var api; } +component.options.__file = "resources/js/screens/team/index.vue" +/* harmony default export */ __webpack_exports__["default"] = (component.exports); + +/***/ }), + +/***/ "./resources/js/screens/team/index.vue?vue&type=script&lang=js&": +/*!**********************************************************************!*\ + !*** ./resources/js/screens/team/index.vue?vue&type=script&lang=js& ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/index.vue?vue&type=script&lang=js&"); +/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); + +/***/ }), + +/***/ "./resources/js/screens/team/index.vue?vue&type=template&id=04a50f26&": +/*!****************************************************************************!*\ + !*** ./resources/js/screens/team/index.vue?vue&type=template&id=04a50f26& ***! + \****************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_04a50f26___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./index.vue?vue&type=template&id=04a50f26& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/screens/team/index.vue?vue&type=template&id=04a50f26&"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_04a50f26___WEBPACK_IMPORTED_MODULE_0__["render"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_template_id_04a50f26___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); + + + +/***/ }), + +/***/ "./resources/sass/dark.scss": +/*!**********************************!*\ + !*** ./resources/sass/dark.scss ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), + +/***/ "./resources/sass/light.scss": +/*!***********************************!*\ + !*** ./resources/sass/light.scss ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), + +/***/ 0: +/*!******************************************************************************************!*\ + !*** multi ./resources/js/app.js ./resources/sass/light.scss ./resources/sass/dark.scss ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! /Users/edionme/workspace/code/personal/personal-site-laravel-wink/packages/wink/resources/js/app.js */"./resources/js/app.js"); +__webpack_require__(/*! /Users/edionme/workspace/code/personal/personal-site-laravel-wink/packages/wink/resources/sass/light.scss */"./resources/sass/light.scss"); +module.exports = __webpack_require__(/*! /Users/edionme/workspace/code/personal/personal-site-laravel-wink/packages/wink/resources/sass/dark.scss */"./resources/sass/dark.scss"); + + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/resources/js/screens/posts/edit.vue b/resources/js/screens/posts/edit.vue index 0f979f9e..cdba7ee7 100644 --- a/resources/js/screens/posts/edit.vue +++ b/resources/js/screens/posts/edit.vue @@ -340,6 +340,9 @@ this.http().post('/api/posts/' + this.id, this.form).then(response => { this.status = ''; + // Refresh to updated tags + this.form.tags = response.data.entry.tags; + if (this.id == 'new') { this.$router.push({name: 'post-edit', params: {id: this.form.id}}) } diff --git a/src/Http/Controllers/PostsController.php b/src/Http/Controllers/PostsController.php index 3817e070..cca00f7b 100644 --- a/src/Http/Controllers/PostsController.php +++ b/src/Http/Controllers/PostsController.php @@ -100,7 +100,7 @@ public function store($id) ); return response()->json([ - 'entry' => $entry, + 'entry' => $entry->load('tags'), ]); }