1"use strict";(self.webpackChunkportail_landing=self.webpackChunkportail_landing||[]).push([[78],{60078:function(B,m,g){g.d(m,{H:function(){return R}});var d=g(51179),b=g(11874),l=g(82900),v=g(79828),y=g(83385),$=g(51893),S=(s,t,e)=>new Promise((i,r)=>{var a=n=>{try{c(e.next(n))}catch(h){r(h)}},o=n=>{try{c(e.throw(n))}catch(h){r(h)}},c=n=>n.done?i(n.value):Promise.resolve(n.value).then(a,o);c((e=e.apply(s,t)).next())});const M=(0,b.nY)("information",{state:()=>({infoRating:{stars:4,rating:0},infoHeader:{},infoData:[],navMenu:[],authors:void 0,datePublished:y.l.pages.statutAutoEntrepreneur.datePublished,dateModified:y.l.pages.statutAutoEntrepreneur.dateModified,metaDescription:y.l.pages.statutAutoEntrepreneur.metaDescription,seoHeadline:y.l.pages.statutAutoEntrepreneur.seoHeadline,seoDescription:y.l.pages.statutAutoEntrepreneur.seoDescription}),actions:{fetchAuthors(){return S(this,null,function*(){const s=l.KB_AUTHOR_LIST;let t=s;const e=[y.l.authorIds.elodieGuyomard,y.l.authorIds.jeanneEscure],i=new URLSearchParams;return i.append("id",e.join(",")),t=`${s}?${i.toString()}`,yield d.A.get(t).then(({data:r})=>(this.authors={author:r==null?void 0:r.find(a=>a.id===e[0]),expert_author:r==null?void 0:r.find(a=>a.id===e[1])},this.authors)).catch(r=>{console.error(r),this.authors=void 0})})},fetchInformationBlock(){return S(this,null,function*(){return this.$reset(),d.A.get(l.BLOCK).then(({data:s})=>{s.forEach(t=>{const e=()=>{let i=0;const r={id:`chapter-${t.id}`,title:t.title,sub:[]};t.description=t.description.replace(/<h3(.*?)>(.*?)<\/h3>/g,(a,o,c)=>{i++;const n={id:`chapter-${t.id}-${i}`,title:c.replace(/<(.*?)>/g,"")};return r.sub.push(n),`<h3 id="chapter-${t.id}-${i}">${c}</h3>`}),this.navMenu.push(r)};switch(t.permalink){case"infoData":this.infoData.push(t),e();break;case"infoHeader":this.infoHeader=t;break}t.id===1&&((0,$.e)().rating.stars=t.current_rating,this.infoRating={stars:t.current_rating,rating:t.ratings})})}).catch(s=>{console.error(s)})})}}});var p=g(73388),D=g(47207),O=Object.defineProperty,k=Object.defineProperties,w=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,A=(s,t,e)=>t in s?O(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,C=(s,t)=>{for(var e in t||(t={}))T.call(t,e)&&A(s,e,t[e]);if(P)for(var e of P(t))K.call(t,e)&&A(s,e,t[e]);return s},E=(s,t)=>k(s,w(t)),u=(s,t,e)=>new Promise((i,r)=>{var a=n=>{try{c(e.next(n))}catch(h){r(h)}},o=n=>{try{c(e.throw(n))}catch(h){r(h)}},c=n=>n.done?i(n.value):Promise.resolve(n.value).then(a,o);c((e=e.apply(s,t)).next())});const R=(0,b.nY)("kb",{state:()=>({searchedString:"",isCardsMoving:!1,objCategoryToMove:null,isMoving:void 0,movingCardIndex:void 0,is404:!1,isSinglePageSubcategory:!1,subcategoryDetails:{},searchData:[],isSearching:!1,data:{},activeChapterId:null,navigationItems:[]}),getters:{categories:s=>s.data,isContentEditor:()=>(0,D.j)().isContentEditor,isSearch:s=>s.searchedString,chapters:s=>s.data.chapters},actions:{search_kb(s){return u(this,null,function*(){this.isSearching=!0,this.searchedString=s;const t=`${l.KB_SEARCH}${s}`;(0,d.A)(t).then(e=>{const i=e.data;this.isSearching=!1,this.searchData=this.isContentEditor?i:i.filter(r=>r.status===1).map(r=>r)}).catch(e=>{console.log(e.response?e.response.data:e)})})},changePostHeroImage(s){return u(this,null,function*(){s.append("subcategory",this.data.subcategory),(0,p.h)().setModal("Loading");const t=`${l.KB_POST}${this.data.slug}/`;d.A.put(t,s).then(e=>{(0,p.h)().clearModal(),this.data.hero_img=e.data.hero_img}).catch(e=>{(0,p.h)().clearModal(),console.error(e.response?e.response.data:e)})})},updateContent(s){return u(this,arguments,function*({title:t,slug:e=void 0}){const{content:i,api:r,propertyName:a,section:o,index:c}=(0,p.h)().passingData;i[a]=t;const n=`${l[r]}${i.slug||i.id}/`;return e&&(i.slug=e),d.A.put(n,i).then(h=>{var _;const f=(_=this.data[o])==null?void 0:_[c];switch(o){case"informer":M().infoData[c][a]=h.data[a];break;case"chapters":f[a]=h.data[a];break;case"subcategories":f[a]=h.data[a],f.meta_title=i.meta_title,f.meta_description=i.meta_description;break;default:this.data[a]=h.data[a]}(0,p.h)().closeModal()}).catch(h=>console.log(h.response?h.response.data:h))})},createSubCategory(s){return u(this,arguments,function*({data:t}){this.createData({data:t,api_name:"KB_SUB_CATEGORY",updateUI:"create_subcateg"})})},createData(s){return u(this,arguments,function*({data:t,api_name:e,updateUI:i,clbk:r=void 0,index:a=void 0}){d.A.post(l[e],t).then(o=>{r==null||r(o.data.slug),window.sessionStorage.removeItem("kb_article"),this.updateUI({data:o.data,updateUI:i,index:a}),(0,p.h)().closeModal()}).catch(o=>{console.log("e",o.response),(0,p.h)().setNotificationModal(o.response.data)})})},updateData(s){return u(this,arguments,function*({data:t,api_name:e,slug:i,updateUI:r,newSlug:a=void 0,clbk:o=void 0,context:c=void 0}){const n=`${l[e]}${i?`${i}/`:""}`;a&&(t instanceof window.FormData?t.append("slug",a):t.slug=a),d.A.put(n,t).then(
1h=>{o==null||o(),(0,p.h)().closeModal(),this.updateUI({data:h.data,updateUI:r,context:c})}).catch(h=>{console.log("e",h.response),(0,p.h)().setNotificationModal(h.response.data)})})},deleteData(s){return u(this,arguments,function*({api_name:t,slug:e,updateUI:i,index:r=void 0}){const a=`${l[t]}${e}/`;d.A.delete(a).then(o=>{(0,p.h)().closeModal(),this.updateUI({index:r,slug:e,updateUI:i})}).catch(o=>{console.log("e",o.response),(0,p.h)().setNotificationModal(o.response.data)})})},fetchArticle(s){return u(this,arguments,function*({category:t,post:e,subcategory:i}){return this.set404(!1),(0,d.A)(`${l.KB_POST}${e}/`).then(r=>{const a=r.data;if(a.category.slug===t&&a.subcategory_slug===i)return I(a),this.setData(a),a;console.error(`${a.category.slug} !== ${t} || ${a.subcategory_slug} !== ${i}!`),this.set404(!0)}).catch(r=>{var a;((a=r.response)==null?void 0:a.status)===404&&this.set404(!0)})})},fetchCategories(){return u(this,null,function*(){return d.A.get(l.KB_CATEGORIES).then(s=>this.sortCategoriesByPriority({data:s.data})).catch(s=>console.error(s))})},fetchCategory(s){return u(this,null,function*(){return d.A.get(`${l.KB_CATEGORIES}${s}/`).then(t=>{this.sortByPriority({data:t.data})}).catch(t=>{console.error(t)})})},fetchSubcategoryPost(s){return u(this,arguments,function*({category:t,secondParam:e}){yield Promise.allSettled([d.A.get(`${l.KB_CATEGORIES}${t}/`).then(i=>{this.setIsSinglePageSubcategory(i.data.single_page_subcategory);let r=this.isSinglePageSubcategory?l.KB_SUBCATEGORY:l.KB_POST;return r+=e,this.isSinglePageSubcategory||(r=r.replace(/\/?(\?|#|$)/,"/$1")),(0,d.A)(r)}).then(i=>{const r=i.data;r.results&&(r.results=r.results.sort((a,o)=>a.priority-o.priority)),!this.isSinglePageSubcategory&&r.chapters&&I(r),this.setData(r)}).catch(i=>{this.set404(!0),console.error(i)})])})},addCategory(s){return u(this,arguments,function*({data:t}){return d.A.post(l.KB_CATEGORIES,t).then(e=>{this.categories.push(e.data),this.sortCategoriesByPriority({data:this.categories}),(0,p.h)().closeModal()}).catch(e=>{console.log(e.response?e.response.data:e)})})},updateCategory(s){return u(this,arguments,function*({data:t,slug:e,newSlug:i,id:r}){const a=`${l.KB_CATEGORIES}${e}/`;return i&&t.append("slug",i),i&&t.append("slug",i),d.A.put(a,t).then(o=>{this.categories.forEach((c,n)=>{c.id===r&&(this.categories[n]=E(C({},o.data),{subcategories:c.subcategories}))}),this.sortCategoriesByPriority({data:this.categories}),(0,p.h)().closeModal()}).catch(o=>{console.log(o.response?o.response.data:o)})})},deleteCategory(s){return u(this,arguments,function*({slug:t}){return this.deleteData({api_name:"KB_CATEGORIES",updateUI:"delete_category",slug:t})})},updateCategoryPriority(s){return u(this,arguments,function*({start:t,end:e}){let i;if(t===-1)i=this.categories[0].priority-1;else if(e===this.categories.length)i=this.categories[this.categories.length-1].priority+1;else{const o=this.categories[t].priority,c=this.categories[e].priority;i=(o+c)/2}const r=`${l.KB_CATEGORIES}${this.objCategoryToMove.slug}/`;this.objCategoryToMove.priority=i;const a=C({},this.objCategoryToMove);return delete a.display_image,d.A.put(r,a).then(o=>u(this,null,function*(){var c;yield this.fetchCategories(),this.sortCategoriesByPriority({data:this.categories}),this.isCardsMoving=!1,(c=this.isMoving)==null||c.call(this)})).catch(o=>{console.log(o.response?o.response.data:o)})})},updateDeepSubcategory(s){return u(this,arguments,function*({id:t,index:e,formData:i}){try{const r=`${l.KB_SUB_CATEGORY}${t}/`,{data:a}=yield d.A.put(r,i);this.data.subcategories=this.data.subcategories.map((o,c)=>e===c?a:o),(0,p.h)().clearModal()}catch(r){console.error(r.response?r.response.data:r),window.alert("Server error")}})},updateChapterTitle(s){return u(this,arguments,function*({content:t,index:e}){const i=`${l.KB_CHAPTERS}${t.slug||t.id}/`;d.A.put(i,t).then(r=>{const a=this.data.chapters[e];a.title=t.title,a.side_title=t.side_title,(0,p.h)().closeModal()}).catch(r=>{console.log(r.response?r.response.data:r)})})},updateRating(s){return u(this,arguments,function*({slug:t,data:e}){const i=`${l.KB}/${t}`;
1d.A.post(i,e).catch(r=>{console.error(r.response?r.response.data:r)})})},reorder(s){return u(this,arguments,function*({api_name:t,array:e,end:i,section:r,selected:a,subcategID:o=void 0}){let c,n;switch(i){case 0:a.priority=e[0].priority-1;break;case e.length:a.priority=e[e.length-1].priority+1;break;default:a.priority=(e[i-1].priority+e[i].priority)/2}switch(r){case"articles":n=`${l[t]}${a.slug}/`,c={priority:a.priority,slug:a.slug,subcategory:o};break;case"categories":n=`${l[t]}${a.slug}/`,c=new window.FormData,c.append("priority",a.priority),c.append("title",a.title);break;default:n=`${l[t]}${a.id}/`,c={category:a.category,id:a.id,priority:a.priority,title:a.title}}d.A.put(n,c).then(h=>{this.sortByPriority({data:this.data,section:r})}).catch(h=>{console.log(h.response?h.response.data:h)})})},set404(s){return u(this,null,function*(){this.is404=s})},setData(s){return u(this,null,function*(){this.data=s})},setCategories(s){return u(this,null,function*(){this.data=s})},setIsSinglePageSubcategory(s){return u(this,null,function*(){this.isSinglePageSubcategory=s})},setSubcategoryDetails(s){return u(this,null,function*(){this.subcategoryDetails=s})},openEditorModal(s){return u(this,null,function*(){this.isContentEditor&&((0,p.h)().setPassingData(s),(0,p.h)().setModal("BaseLiveEditorModal"))})},setSearchedString(s){return u(this,null,function*(){this.searchedString=s})},setStarRating(){return u(this,null,function*(){var s,t;(0,$.e)().rating.slug=(s=this.data)==null?void 0:s.slug,(0,$.e)().rating.stars=(t=this.data)==null?void 0:t.current_rating})},sortCategoriesByPriority(s){return u(this,arguments,function*({data:t}){this.sortByPriority({data:t,section:"categories"})})},sortByPriority(s){return u(this,arguments,function*({data:t,section:e=void 0}){if(e==="categories")this.setCategories(t.sort((i,r)=>i.priority-r.priority));else{const i=t.subcategories;i?i.forEach((r,a)=>{i[a].results=r.results.sort((o,c)=>o.priority-c.priority)}):t.results=t.results.sort((r,a)=>r.priority-a.priority),i&&(t.subcategories=i.sort((r,a)=>r.priority-a.priority)),this.setData(t)}})},updateUI({updateUI:s,data:t=void 0,index:e=void 0,slug:i=void 0,context:r=void 0}){const a=(0,p.h)().passingData,o=a.subcategoryIndex,c=a.postIndex,n=this.data,h=()=>{["hero_img","hero_img_thumbnail","hero_img_meta_description","title","meta_title","short_description","status","slug","show_side_nav","show_subscription"].forEach(f=>{n.subcategories?n.subcategories[o].results[c][f]=t[f]:n.results[c][f]=t[f]})};switch(s){case"create_chapter":n.chapters.splice(e+1,0,t);break;case"delete_chapter":n.chapters.splice(e,1);break;case"create_post":n.subcategories?n.subcategories[o].results.push(t):n.results.push(t);break;case"del_post":n.subcategories?n.subcategories[o].results.splice(c,1):n.results.splice(c,1);break;case"create_subcateg":n.subcategories.push(t);break;case"create_kb_categ":this.categories.push(t);break;case"delete_category":this.categories.forEach((_,f)=>{i===_.slug&&this.categories.splice(f,1)});break;case"delete_subcateg":n.subcategories.splice(o,1);break;case"update_post_img":h();break;case"update_post_details":h();break;case"update_move_article_to_subcateg":n.subcategories[r.subcategStartIndex].results.splice(r.articleIndex,1),n.subcategories[r.subcategEndIndex].results.push(t);break;default:break}},initializeNavigation(s){this.navigationItems=s.map(t=>({id:(0,v.i)(t.html_id),title:t.title,isActive:!1}))},setActiveChapter(s){this.activeChapterId=s,this.navigationItems=this.navigationItems.map(t=>E(C({},t),{isActive:t.id===s}))},updateNavigationOnScroll(){const s=this.navigationItems.map(i=>({id:i.id,element:document.getElementById((0,v.i)(i.html_id))})),t=i=>{i.forEach(r=>{r.isIntersecting&&this.setActiveChapter(r.target.id)})},e=new IntersectionObserver(t,{rootMargin:"-10% 0px -80% 0px"});return s.forEach(i=>{i.element&&e.observe(i.element)}),e}}});function I(s){const t=/<div class="table-wrapper"><table(.*?)>(.*?)<\/table>(.*?)<\/div>/g;s.chapters.forEach(e=>{e.content=e.content.replace(t,(i,r,a,o)=>`<div class='table-wrapper'><table${r}>${a}</table></div>${o}`)})}},79828:function(B,m,g){g.d(m,{$:function(){return b},i:function(){return d}});function d(l){return l.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function b(l,v){return l.single_page_subcategory?"/academie/"+l.slug+"/"+v.slug:"/academie/"+l.slug+"#"+d(v.slug)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.