text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-88209be0","chunk-21b5085a"],{4015:function(t,e,a){"use strict";var r=a("de7f"),n=a.n(r);n.a},b747:function(t,e,a){(function(e,a,r){t.exports=r(),t.exports["default"]=r()})(0,0,function(){var t=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","ǈ":"LJ","ǉ":"lj","ǋ":"NJ","ǌ":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","џ":"dz","Ґ":"G","ґ":"g","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","‘":"\'","’":"\'","“":"\\"","”":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₹":"indian rupee","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial"}');function e(e,a){if("string"!==typeof e)throw new Error("slugify: string argument expected");a="string"===typeof a?{replacement:a}:a||{};var r=e.split("").reduce(function(e,r){return e+(t[r]||r).replace(a.remove||/[^\w\s$*_+~.()'"!\-:@]/g,"")},"").trim().replace(/[-\s]+/g,a.replacement||"-");return a.lower?r.toLowerCase():r}return e.extend=function(e){for(var a in e)t[a]=e[a]},e})},c745:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("main",{attrs:{id:"main-container"}},[a("div",{staticClass:"row no-gutters flex-md-10-auto"},[a("div",{staticClass:"col-md-4 col-lg-5 col-xl-3 order-md-1 bg-white"},[a("div",{staticClass:"content p-0"},[t._m(0),a("div",{staticClass:"d-none d-md-block push",attrs:{id:"side-content"}},[a("div",{attrs:{id:"settings-accordion",role:"tablist","aria-multiselectable":"true"}},[a("div",{staticClass:"block mb-0"},[t._m(1),a("div",{staticClass:"collapse show",attrs:{id:"settings-accordion_s1",role:"tabpanel","aria-labelledby":"settings-accordion_h1","data-parent":"#settings-accordion"}},[a("div",{staticClass:"block-content"},[a("div",{staticClass:"form-group row"},[a("div",{staticClass:"col-12"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.currentForm.status,expression:"currentForm.status"}],staticClass:"custom-select",attrs:{id:"example-wp-visibility",name:"example-wp-visibility"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){var e="_value"in t?t._value:t.value;return e});t.$set(t.currentForm,"status",e.target.multiple?a:a[0])}}},t._l(t.listStatus,function(e,r){return a("option",{key:r,domProps:{value:e.id}},[t._v(" "+t._s(e.name))])}),0)])])])])]),a("div",{staticClass:"block mb-0"},[t._m(2),a("div",{staticClass:"collapse",attrs:{id:"settings-accordion_s4",role:"tabpanel","aria-labelledby":"settings-accordion_h4","data-parent":"#settings-accordion"}},[a("div",{staticClass:"block-content block-content-full",on:{click:function(e){return t.openFileManager("image")}}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.currentForm.image,expression:"currentForm.image"}],attrs:{type:"hidden"},domProps:{value:t.currentForm.image},on:{input:function(e){e.target.composing||t.$set(t.currentForm,"image",e.target.value)}}}),t.currentForm.image&&""!=t.currentForm.image?a("div",[a("img",{staticClass:"img-fluid",attrs:{src:t.currentForm.image,alt:""}})]):a("div",{staticClass:"btn-add-image"},[t._v(" + ")])])])])])])])]),a("div",{staticClass:"col-md-8 col-lg-7 col-xl-9 order-md-0 bg-body-dark"},[a("div",{staticClass:"content content-full"},[a("div",{staticClass:"block block-fx-pop"},[a("div",{staticClass:"block-content block-content-full d-flex justify-content-between border-bottom"},[a("div",[a("nav",{attrs:{"aria-label":"breadcrumb"}},[a("ol",{staticClass:"breadcrumb"},[t._m(3),a("li",{staticClass:"breadcrumb-item"},[a("router-link",{attrs:{to:"/catalogs"}},[t._v("Catalog")])],1),t.isEdit?a("li",{staticClass:"breadcrumb-item active",attrs:{"aria-current":"page"}},[t._v("Sửa Catalog / "+t._s(t.currentForm.name))]):a("li",{staticClass:"breadcrumb-item active",attrs:{"aria-current":"page"}},[t._v("Tạo Catalog")])])])]),a("div",[a("a",{staticClass:"btn btn-sm btn-info",attrs:{href:"javascript:void(0)"},on:{click:function(e){return e.preventDefault(),t.submitForm(e)}}},[t._v("Lưu lại")])])]),a("div",{staticClass:"block-content block-content-full"},[a("div",{staticClass:"form-group"},[a("input",{directives:[{name:"validate",rawName:"v-validate",value:"required|min:1|max:254",expression:"'required|min:1|max:254'"},{name:"model",rawName:"v-model",value:t.currentForm.name,expression:"currentForm.name"}],staticClass:"form-control py-4",attrs:{type:"text",id:"post-name",name:"name",placeholder:"Tiêu đề ..."},domProps:{value:t.currentForm.name},on:{input:function(e){e.target.composing||t.$set(t.currentForm,"name",e.target.value)}}}),a("span",{staticClass:"text-danger"},[t._v(t._s(t.errors.first("name")))])]),a("div",{staticClass:"form-group"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.slug,expression:"slug"}],staticClass:"form-control py-4",attrs:{type:"text",id:"post-slug",name:"post-slug",placeholder:"Url ..."},domProps:{value:t.slug},on:{input:function(e){e.target.composing||(t.slug=e.target.value)}}})]),a("div",{staticClass:"form-group"},[a("label",{attrs:{for:"example-wp-overview"}},[t._v("Link: ")]),a("div",{staticClass:"block-content block-content-full",on:{click:function(e){return t.openFile("link")}}},[t.currentForm.link&&""!=t.currentForm.link?a("div",[a("iframe",{staticStyle:{width:"100%",height:"500px"},attrs:{frameborder:"0",src:t.currentForm.link}})]):a("div",{staticClass:"btn-add-image"},[t._v(" + ")])])]),a("div",{staticClass:"form-group"},[a("tinymce-tinymce",{key:"vue-tinymce-"+t.currentForm.id,model:{value:t.currentForm.body,callback:function(e){t.$set(t.currentForm,"body",e)},expression:"currentForm.body"}})],1)])])])])]),a("add-category",{attrs:{editedIndex:t.newDirectoryIndex,editedItem:t.newDirectoryItem,slug:t.newDirectorySlug},on:{saveSuccess:function(e){return t.saveNewDirectorySuccess()}}}),a("file-manager-popup")],1)},n=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"d-md-none p-3"},[a("button",{staticClass:"btn btn-block btn-hero-primary",attrs:{type:"button","data-toggle":"class-toggle","data-target":"#side-content","data-class":"d-none"}},[t._v("\n                        Cài đặt\n                    ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"block-header block-header-default p-0",attrs:{role:"tab",id:"settings-accordion_h1"}},[a("a",{staticClass:"font-w600 d-block w-100 p-3",attrs:{"data-toggle":"collapse","data-parent":"#settings-accordion",href:"#settings-accordion_s1","aria-expanded":"true","aria-controls":"settings-accordion_s1"}},[t._v("Trạng thái")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"block-header block-header-default border-top p-0",attrs:{role:"tab",id:"settings-accordion_h4"}},[a("a",{staticClass:"font-w600 d-block w-100 p-3",attrs:{"data-toggle":"collapse","data-parent":"#settings-accordion",href:"#settings-accordion_s4","aria-expanded":"true","aria-controls":"settings-accordion_s4"}},[t._v("Hình đại diện")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",{staticStyle:{"margin-top":"-4px","margin-right":"5px"}},[a("button",{staticClass:"btn btn-sm btn-light",attrs:{type:"button"}},[a("i",{staticClass:"fa fa-plus"})])])}],i=(a("8e6e"),a("ac6a"),a("456d"),a("a481"),a("bd86")),s=(a("7f7f"),a("2b0e")),o=a("7bb1"),c=a("b775"),l="ajax/";function u(t){return Object(c["a"])({url:l+"catalogs/"+t,method:"get"})}function d(t){return Object(c["a"])({url:l+"catalogs",method:"post",data:t})}function m(t,e){return Object(c["a"])({url:l+"catalogs/"+t,method:"patch",data:e})}var g=a("2ef0"),p=a.n(g),f=a("2f62");function v(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,r)}return a}function h(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?v(a,!0).forEach(function(e){Object(i["a"])(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):v(a).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}var b=a("b747");s["a"].use(o["b"],{useConstraintAttrs:!1});var y={id:null,name:"",link:"",body:"",image:"",slug:"",order:0,status:1},k={vn:{custom:{name:{required:"Vui lòng nhập username",min:"Username ít nhất 1 kí tự",max:"Tên quá quá dài"}}}};o["a"].localize(k);var C=new o["a"]({first_name:"min",second_name:"required"});C.localize("vn");var w={name:"Detail",props:{isEdit:{type:Boolean,default:!1}},data:function(){return{currentForm:Object.assign({},y),valid:!0,loading:!1,nameRules:[function(t){return t.length>0||"Tiêu đề không được để trống"}],slugRules:[function(t){return t.length>0||"Url không được để trống"},function(t){return/^[a-z0-9](-?[a-z0-9])*$/.test(t)||"Url không chứa khoảng trắng"}],listStatus:[{id:1,name:"Xuất bản"},{id:0,name:"Bản nháp"}],slug:"",isAutoSlug:!0}},computed:{},watch:{"currentForm.name":function(){this.isAutoSlug&&(this.slug=b(p.a.lowerCase(this.currentForm.name)))}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.catalog;this.isAutoSlug=!1,this.getData(t)}else this.currentForm=Object.assign({},y)},methods:h({},Object(f["d"])("app",["setSnackbar","setMessage"]),{getData:function(t){var e=this;u(t).then(function(t){e.currentForm=t,e.slug=t.slug}).catch(function(t){console.log(t)})},submitFormRequest:function(t){var e=this;return new Promise(function(a,r){if(e.isEdit){var n=e.$route.params&&e.$route.params.catalog;m(n,t).then(function(t){a(t)}).catch(function(t){console.log(t),r(t)})}else d(t).then(function(t){a(t)}).catch(function(t){console.log(t),r(t)})})},submitForm:function(){var t=this;this.$validator.validateAll().then(function(e){e&&(t.loading=!0,t.currentForm.slug=t.slug,t.submitFormRequest(t.currentForm).then(function(e){t.loading=!1,Dashmix.helpers("notify",{type:"success",icon:"fa fa-success mr-1",message:"Lưu dữ liệu thành công."}),t.isEdit||t.$router.replace("/catalogs/edit/"+e.id)},function(){t.loading=!1,Dashmix.helpers("notify",{type:"danger",icon:"fa fa-times mr-1",message:"Không lưu được. Vui lòng lưu lại bài viết bằng công cụ khác. Reload và thử lại."})}))})},openFileManager:function(t){var e=this;window.setFileToElement=function(a,r){e.currentForm[t]=r,e.$store.dispatch("file/closeFileManager"),jQuery("#modal-site-file").modal("hide")},"video"==t&&this.$store.dispatch("file/setType","Files"),this.$store.dispatch("file/openFileManager"),jQuery("#modal-site-file").modal("show")},openFile:function(t){var e=this;window.setFileToElement=function(a,r){e.currentForm[t]=r,e.$store.dispatch("file/closeFileManager"),jQuery("#modal-site-file").modal("hide")},"link"==t&&this.$store.dispatch("file/setType","Images"),this.$store.dispatch("file/openFileManager"),jQuery("#modal-site-file").modal("show")}})},O=w,F=(a("4015"),a("2877")),_=Object(F["a"])(O,r,n,!1,null,"3c33973c",null);e["default"]=_.exports},d516:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("detail",{attrs:{"is-edit":!0}})},n=[],i=a("c745"),s={name:"Edit Catalogs",components:{Detail:i["default"]}},o=s,c=a("2877"),l=Object(c["a"])(o,r,n,!1,null,null,null);e["default"]=l.exports},de7f:function(t,e,a){}}]);
  //# sourceMappingURL=chunk-88209be0.40ff4086.js.map