PageSourceSearch

https://www.sowee.fr/_next/static/chunks/pages/so-admin/contrib-pages-bbc1050884677b04.js

js sowee.fr collected 2026-09-24 11:58:18 UTC 104,951 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[281,2913,9640],{167973:e=>{e.exports={"cart-line--tag":"LineTag_cart-line--tag__nSo6d","theme-pink":"LineTag_theme-pink__sXcT1","theme-blue":"LineTag_theme-blue__l0jEQ","theme-orange":"LineTag_theme-orange__MxKix","theme-red":"LineTag_theme-red__ZgyeF"}},199640:(e,t,i)=>{"use strict";i.d(t,{A:()=>E});var a=i(637876),s=i(720972),r=i.n(s),n=i(668160),l=i(14232),o=i(204415),c=i(167973),d=i.n(c),p=i(15039),u=i.n(p);let h=e=>(0,a.jsx)(a.Fragment,{children:e.data.tagWording&&(0,a.jsx)("div",{className:u()(d()["cart-line--tag"],d()[`${e.data.tagClass}`]),children:e.data.tagWording})}),m=e=>{let{prices:t,priceKey:i,type:s,text:n,round:l,hidePromo:o,textOrangered:c}=e;if(!t)return null;let d=!o&&t[i+"_Bf_Promo"]>t[i],p=e=>d&&(0,a.jsxs)("span",{className:u()(r()["price-display--before-promo"],r()[e]),children:[(0,a.jsx)("br",{className:r()["price-display-price--before-promo--br"]}),t[i+"_Bf_Promo"]?.toFixed(2).replace(".",",").replace("-0,00","0,00")," € ",n]});return(0,a.jsxs)("span",{className:u()(r()["price-display"],r()["text-right"],"text-right",r()["price-display-"+s]),"data-tnr":e.dataTnr??"price-display-price-"+i,children:[p("before-real-price"),(0,a.jsxs)("span",{className:u()(r()["price-display-price"],t[i+"_Bf_Promo"]>t[i]?r()["is-promo"]:"",c?r()["text-orangered"]:""),children:[t[i]?.toFixed(l||2).replace(".",",").replace("-0,00","0,00")," ","€",(0,a.jsx)("span",{className:u()(r()["price-display-price--suffix"]),children:n})]}),p("after-real-price")]})};var g=i(523727),x=i.n(g);let y=e=>{let{title:t,messages:i}=e.data,s=e=>i?i.filter(t=>t.target===e):[];return(0,a.jsxs)("div",{className:u()(x()["cart--line--title-bloc"],e.isPopIn?x().isPopIn:""),children:[(0,a.jsxs)("div",{className:x()["cart--line--title-text-content"],children:[s("TITLE_PREFIX").map((t,i)=>(0,a.jsx)("span",{className:x()["prefix-text"],"data-tnr":[e.data.type,"title-prefix",i].join("-"),children:t.msg},i)),(0,a.jsx)("span",{className:x()["cart--line--title-text"],"data-tnr":[e.data.type,"cart--line--title-text"].join("-"),dangerouslySetInnerHTML:{__html:t}}),s("TITLE_SUFFIX").map((t,i)=>(0,a.jsxs)("span",{className:x()["suffix-text"],"data-tnr":[e.data.type,"suffix-text",i].join("-"),children:[" ",t.msg]},i))]}),(e.isPopIn&&"voucher"==e.data.type||!e.isPopIn&&!e.hideSubtitle)&&(0,a.jsx)(a.Fragment,{children:s("SUBTITLE").map((e,t)=>(0,a.jsx)("p",{className:x()["subtitle-text"],children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:e.msg.toString().replace("kVA"," kVA").replace("HP/HC","Heures pleines / Heures creuses")}})},t))})]})},_=e=>{let{data:t,isPopIn:i,isRecap:s}=e,c=t.owners[0]?.quantity>0&&(t.prices.initial?.TTC_Total_Price||t.prices.monthly?.TTC_Total_Price||t.prices.annual?.TTC_Total_Price),{cartState:d,cartService:p}=(0,o.B_)(),[g,x]=(0,l.useState)(!1),_=e=>t.messages?t.messages.filter(t=>t.target===e):[];async function b(t){if(!g){e.onClick&&e.onClick(),x(!0);try{await p.deleteMultiples(t)}catch(e){console.log("error deleted")}x(!1)}}return(0,a.jsx)("div",{className:u()(r()["cart--line"],r()["cart--line--assistance"],t.hasTopSeparator?r()["has-top-separator"]:"",g?r().isLoading:""),children:(0,a.jsxs)(n.A,{container:!0,children:[(0,a.jsx)(n.A,{size:12,className:"no-padding",children:(0,a.jsxs)(n.A,{container:!0,className:r()["sw-cart--line--container"],children:[t.tagWording&&(0,a.jsx)(n.A,{size:12,children:(0,a.jsx)(h,{data:t})}),(0,a.jsx)(n.A,{size:{xs:6,md:8},className:"no-padding",children:(0,a.jsx)(y,{data:t,isPopIn:i})}),(0,a.jsx)(n.A,{size:{xs:6,md:4},className:u()(r()["text-right"],"text-right"),children:(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsxs)(a.Fragment,{children:[t.prices.initial&&(0,a.jsx)(m,{prices:t.prices.initial,priceKey:"TTC_Total_Price_Bf_Promo"}),t.prices.monthly&&(0,a.jsx)(m,{prices:t.prices.monthly,priceKey:"TTC_Total_Price_Bf_Promo",text:"/par mois"}),t.prices.annual&&(0,a.jsx)(m,{prices:t.prices.annual,priceKey:"TTC_Total_Price_Bf_Promo",text:"/an"}),_("PROMO").map((e,t)=>(0,a.jsx)("span",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-
1promo"]),children:e.msg},t))]}),!t.noPrice&&t.freeWording&&(0,a.jsx)("span",{"data-tnr":t.type+"-freeWording",className:r()["sw-cart--line--freeWording"],children:t.freeWording}),t.noPrice&&!t.freeWording&&(0,a.jsx)("span",{className:r()["price-display-price"],children:"0 €"}),_("PROMO").map((e,t)=>(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-promo"]),children:e.msg},t))]})})]})}),(0,a.jsx)(n.A,{size:12,className:"no-padding",children:t.hasDelete&&!s&&!i&&(0,a.jsx)("a",{"data-tnr":"delete-line-assistance "+t.type,onClick:()=>b(t.owners),className:u()(r()["delete-line"],"primary-link"),children:"Supprimer"})})]})})};var b=i(711946),j=i(754587),f=i.n(j);let T=e=>{let t=e=>i.messages?i.messages.filter(t=>t.target===e):[],{data:i,isRecap:s,isPopIn:c}=e,{cartState:d,cartService:p}=(0,o.B_)(),[g,x]=(0,l.useState)(!1),[_,j]=(0,l.useState)(!1),T=t("DETAILS")?.length>0,C=c||s,A=d?.contextualizedCart,L=A?.products||[],v=(0,l.useMemo)(()=>L.find(e=>e.product.jou_add||e.product.thermostatAdd),[L]),N=(i.owners?.[0]?.quantity>0||"effacement"==i.type)&&null!=i.prices?.initial?.TTC_Total_Price&&0!=i.prices?.initial?.TTC_Total_Price||null!=i.prices?.monthly?.TTC_Total_Price&&0!=i?.prices.monthly?.TTC_Total_Price||null!=i.prices?.annual?.TTC_Total_Price&&0!=i.prices?.annual?.TTC_Total_Price,w=i.qtMin?parseInt(i.qtMin):0,P=Array.from({length:(i.qtMax?parseInt(i.qtMax):10)-w+1},(e,t)=>t+w);async function S(t){if(!g){e.onClick&&e.onClick(),x(!0);try{await p.deleteMultiples(t)}catch(e){console.log("error deleted",e)}x(!1)}}async function k(e,t){x(!0);try{await p.setQuantity(i.owners?.[0],t)}catch(e){console.log("error quantity")}x(!1)}let E=()=>(0,a.jsx)(a.Fragment,{children:!c&&(0,a.jsx)("button",{type:"button",className:u()(r()["sw-cart--line--btn-arrow"],_?r().open:""),onClick:()=>j(!_),children:"D\xe9tails"})});return(0,a.jsx)("div",{"data-tnr":`cart--line-${i.type}`,className:u()(r()["cart--line"],r()["cart--line--default"],i.hasTopSeparator||c?r()["has-top-separator"]:"",g?r().isLoading:"",c?r().contentPopin:""),children:(0,a.jsxs)(b.A,{children:[(0,a.jsxs)(n.A,{container:!0,maxWidth:"lg",spacing:1,className:r()["sw-cart--line--container"],children:[i.tagWording&&(0,a.jsx)(n.A,{size:12,className:"grid12",children:(0,a.jsx)(h,{data:i})}),(0,a.jsx)(n.A,{size:{xs:"liv"===i.type&&i.img&&C?4:7,md:(i.hasQuantity||"liv"===i.type&&i.img)&&C?5:7},className:u()(r()["sw-cart--line--quantity-wrapper"],"no-padding",i.hasQuantity?r()["no-quantity"]:""),children:(0,a.jsx)(y,{data:i,getDetailsOpenButton:T?E:null,isPopIn:c,hideSubtitle:!0})}),i.hasQuantity&&C&&(0,a.jsx)(n.A,{size:{xs:3,md:2},className:"no-padding text-right hide-on-mobile"}),"liv"===i.type&&i.img&&(0,a.jsx)(n.A,{size:{xs:3,md:2},className:"no-padding text-right",children:i.img&&(0,a.jsx)(f(),{width:47,height:40,src:i.img,alt:""})}),N&&(0,a.jsx)(n.A,{size:5,className:u()(r()["text-right"],"no-padding","text-right"),children:(0,a.jsxs)(a.Fragment,{children:[i.prices.initial&&(0,a.jsx)(m,{prices:i.prices.initial,priceKey:"TTC_Total_Price",textOrangered:!0}),i.prices.monthly&&(0,a.jsx)(m,{prices:i.prices.monthly,priceKey:"TTC_Total_Price",textOrangered:!0,text:"/ par mois"}),i.prices.annual&&(0,a.jsx)(m,{prices:i.prices.annual,priceKey:"TTC_Total_Price",textOrangered:!0,text:"/an"})]})}),i.owners?.[0]?.quantity>0&&!i.prices.initial?.TTC_Total_Price&&!i.prices.monthly?.TTC_Total_Price&&!i.prices.annual?.TTC_Total_Price&&(0,a.jsxs)(n.A,{size:5,className:u()(r()["text-right"],"no-padding","text-right"),children:[!i.noPrice&&i.freeWording&&(0,a.jsx)("span",{"data-tnr":i.type+"-freeWording",className:r()["sw-cart--line--freeWording"],children:i.freeWording}),t("PROMO").map((e,t)=>(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-promo"]),children:e.msg},t))]}),!c&&(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:t("SUBTITLE").map((e,t)=>(0,a.jsx)("p",{className:r().subtitleText,children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:e.msg}})},t))}),T&&(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:E()}),(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:i.hasQuantity&&!s&&!C&&(0,a.jsxs)(a.Fragment,{children:[v&&"jou"===i.type&&(0,a.jsx)("p",{children:(0,a.jsx)("strong",{children:"Nombre de radiateurs"})}),(0,a.jsx)("div",{className:u()(r()["sw-cart--line--quantity-select"],"simple-select-custom"),children:(0,a.jsx)("select",{"data-tnr":"quantity-kit-product",defaultValue:i.owners?.[0]?.quantity||1,onChange:e=>k(i.owners,e.target.value),children:P.map((e,t)=>(0,a.jsx)("option",{value:e,children:e},t))})})]})})]}),T&&!c&&(0,a.jsx)(n.A,{container:!0,className:"no-padding",children:(0,a.jsx)("div",{className:u()(r()["sw-cart--line--details"],_?r().open:"",r()[t("DETAILS")[0].class]),dangerouslySetInnerHTML:{__html:t("DETAILS")[0].msg}})}),i.hasQuantity&&C&&(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:(0,a.jsxs)("p",{className:r()["text-grey"],children:["Qt\xe9 : ",i.owners?.[0]?.quantity]})}),i.hasQuantity&&!c&&v&&!s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:(0,a.jsx)("button",{type:"button",className:u()(r()["sw-cart--line--btn-arrow"],_?r().open:""),onClick:()=>j(!_),children:"D\xe9tails"})}),(0,a.jsx)(n.A,{container:!0,className:"no-padding",children:(0,a.jsx)("div",{className:u()(r()["sw-cart--line--details"],_?r().open:""),children:(0,a.jsx)(n.A,{container:!0,className:u()(r()["sw-cart--line--details-item"],"no-padding"),spacing:0,children:(0,a.jsxs)(n.A,{size:12,className:u()("no-padding","grid12"),children:["kit_th"===i.t
1ype&&(0,a.jsx)("p",{children:"T\xeate thermostatique connect\xe9e"}),"kit_jou"===i.type&&(0,a.jsx)("p",{children:"Kit pour radiateur additionnel"}),(0,a.jsxs)("p",{className:r()["text-grey"],children:["Qt\xe9 : ",i.owners?.[0]?.quantity]}),(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:i.prices.monthly||i.prices.initial||i.prices.annual,priceKey:"TTC_Total_Price",type:"detail-product",text:" TTC"})}),(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:i.prices.monthly||i.prices.initial||i.prices.annual,priceKey:"HT_Total_Price",type:"detail-product-regular",text:" HT"})})]})})})})]}),(0,a.jsx)(n.A,{container:!0,children:(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:i.hasDelete&&!s&&!c&&(0,a.jsx)("a",{"data-tnr":"delete-line-cartLine "+i.type,onClick:()=>S(i.owners),className:u()(r()["delete-line"],"primary-link"),children:"Supprimer"})})})]})})};var C=i(393277);let A=e=>{let{data:t,contextualizedCart:i,isRecap:s}=e,{context:n}=i||{},l="Prix du kWh";return(0,a.jsxs)(a.Fragment,{children:["elec"===t.type&&n?.cart_attr_elec_structure==="HP/HC"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsxs)("p",{className:u()(r()["sw-cart--line--detail--hp-hc"],r().marginTop),children:[(0,a.jsx)("span",{className:u()(s?r()["details-title-bold"]:""),children:l})," ","Heures pleines"]})}),(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--price"],r()["is-ttc-price"]),children:(0,a.jsx)(m,{prices:t.prices.conso_hp,priceKey:"TTC_Unit_Web",type:"detail",text:"/kWh TTC",round:4})})}),(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:t.prices.conso_hp,priceKey:"HT_Unit_Web",type:"detail",text:"/kWh HT",round:4})})}),(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsx)("p",{className:r()["sw-cart--line--detail--hp-hc"],children:"Heures creuses"})}),(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--price"],r()["is-ttc-price"]),children:(0,a.jsx)(m,{prices:t.prices.conso_hc,priceKey:"TTC_Unit_Web",type:"detail",text:"/kWh TTC",round:4})})}),(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:t.prices.conso_hc,priceKey:"HT_Unit_Web",type:"detail",text:"/kWh HT",round:4})})})]}):(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--name"],s?r()["details-title-bold"]:"",r().marginTop),children:l})}),(0,a.jsxs)("div",{className:"no-padding",children:[(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--price"],r()["is-ttc-price"]),children:(0,a.jsx)(m,{prices:t.prices.conso,priceKey:"TTC_Unit_Web",type:"detail",text:"/kWh TTC",round:4})}),(0,a.jsx)("p",{className:r()["sw-cart--line--detail--price"],children:(0,a.jsx)(m,{prices:t.prices.conso,priceKey:"HT_Unit_Web",type:"detail",text:"/kWh HT",round:4})})]})]}),(0,a.jsx)("div",{className:"no-padding",children:(t.messages?t.messages.filter(e=>"CONSO"===e.target):[]).map((e,t)=>(0,a.jsx)("span",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-abo-promo"]),children:e.msg},t))})]})},L=e=>{let{contextualizedCart:t,energy:i,isRecap:s}=e,{context:n}=t||{};return n?(0,a.jsxs)("div",{className:u()("no-padding",r()["sw-cart--line--details-item"],r().marginTop),children:[(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--name"],s?r()["details-title-bold"]:""),children:"Estimation de conso"}),"gaz"===i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:[n.cart_attr_gaz_car," kWh/an"]}),n.cart_attr_gaz_car_parcours&&n.cart_attr_gaz_car_parcours!==n.cart_attr_gaz_car&&(0,a.jsxs)("p",{className:u()(r()["sw-cart--line--detail--price"],r()["car-display--before-promo-free"]),children:[n.cart_attr_gaz_car_parcours," kWh/an"]}),!s&&(0,a.jsxs)("div",{className:r().marginTop,children:[" ",n.cart_attr_gaz_zone&&(0,a.jsx)("div",{className:u()(r()["sw-cart--line--estimation-price"],"no-padding"),children:(0,a.jsxs)("span",{children:["Zone"," ",(0,a.jsxs)("span",{className:r()["sw-cart--text-bold"],children:[n.cart_attr_gaz_zone.charAt(0),n.cart_attr_gaz_zone.slice(-1)]})]})}),(0,a.jsx)("div",{className:u()(r()["sw-cart--line--estimation-price"],"no-padding"),children:(0,a.jsxs)("span",{children:["Option"," ",(0,a.jsx)("span",{className:r()["sw-cart--text-bold"],children:"Index\xe9"===n.cart_attr_gaz_tarif_type?n.cart_attr_gaz_conso_index:n.cart_attr_gaz_conso_fixe})]})})]})]}):(0,a.jsxs)("div",{children:[n.has_ve&&(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--name"],r().orangered),children:"Cette estimation inclut la recharge de votre v\xe9hicule \xe9lectrique"}),"HP/HC"===n.cart_attr_elec_structure?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsx)("span",{className:r()["sw-cart--line--detail--hp-hc"],children:"Heures pleines"})}),(0,a.jsxs)("div",{className:u()("no-padding",r()["sw-cart--line--estimation-price"]),children:[n.cart_attr_elec_car_parcours_hp&&n.cart_attr_elec_car_parcours_hp!=n.cart_attr_elec_car_hp&&(0,a.jsxs)("span",{className:r()["price-display--before-promo"],children:[n.cart_attr_elec_car_parcours_hp," kWh/an"]}),(0,a.jsxs)("span",{children:[n.cart_attr_elec_car_hp," kWh/an "]})]}),(0,a.jsx)("div",{className:u()("no-padding",r()["sw-cart--line--estimation-price"]),children:(0,a.jsx)("span",{className:r()["sw-cart--line--detail--hp-hc"],children:"Heures creuses"})}),(0,a.jsxs)("div",{className:u()(r()["sw-cart--line--estimation-price"],"no-padding"),children:[n.cart_attr_elec_car_parcours_hc&&n.cart_attr_elec_car_parcours_hc!=n.cart_attr_elec_car_hc&&(0,a.jsxs)("span",{className:r()["price-display--before-promo"],children:[n.cart_attr_elec_car_parcours_hc," kWh/an"]}),(0,a.jsxs)("span",{children:[n.cart_attr_elec_car_hc," kWh/an "]})]})]}):(0,a.jsxs)("div",{className:"no-padding",children:[(0,a.jsxs)("p",{children:[t.context.cart_attr_elec_car," kWh/an"]}),n.cart_attr_elec_car_parcours&&n.cart_attr_elec_car_parcours!=n.cart_attr_elec_car&&(0,a.jsxs)("p",{className:r()["car-display--before-promo-free"],children:[n.cart_attr_elec_car_parcours," kWh/an"]})]}),!s&&"elec"===i&&(0,a.jsxs)("div",{className:r().marginTop,children:[(0,a.jsx)("div",{className:u()(r()["sw-cart--line--estimation-price"],"no-padding"),children:(0,a.jsxs)("span",{children:["Option"," ",(0,a.jsx)("span",{className:r()["sw-cart--text-bold"],children:n.cart_attr_elec_structure})]})}),(0,a.jsx)("div",{className:u()(r()["sw-cart--line--estimation-price"],"no-padding"),children:(0,a.jsxs)("span",{children:["Puissance souscrite"," ",(0,a.jsx)("span",{className:r()["sw-cart--text-bold"],children:n.cart_attr_elec_puissance})]})})]})]})]}):null},v=e=>{let t,i,s,{data:c,isRecap:d,isPopIn:p}=e,{cartState:g,cartService:x}=(0,o.B_)(),_=g?.contextualizedCart,b=_?.context?.cart_attr_energie_billing_mode==="Mensuel reel",[j,f]=(0,l.useState)(b),[T,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(c?.owners[0]?.attributes[c.type+"_tarif_type"]),[P,S]=(0,l.useState)(!1),[k,E]=(0,l.useState)({elec:{fix:null,eco:null,fix2Ans:!1,fix1An:!1},gaz:{fix:null,indexe:null,fix2Ans:!1}});(0,l.useEffect)(()=>{j||_?.context?.cart_attr_energie_billing_mode!=="Mensuel reel"||f(!0)},[g]),(0,l.useEffect)(()=>{let e={fix:null,eco:null,fix2Ans:null,fix1An:null},t={fix:null,indexe:null,fix2Ans:null};if("elec"===c.type){let t=g?.othersOffers?.filter(e=>"elec"===e.type);c?.owners[0]?.attributes?.elec_tarif_type&&c.owners[0].attributes.elec_tarif_type.startsWith("Fixe")?(e.eco=t?t[0]?.prices?.monthly:null,e.fix=c?.prices?.monthly,e.fix2Ans=c?.owners[0]?.attributes.elec_tarif_type==="Fixe 2 ans",e.fix1An=c?.owners[0]?.attributes.elec_tarif_type==="Fixe 1 an"):(e.fix=t?t[0]?.prices.monthly:null,e.eco=c?.prices.monthly)}else if("gaz"===c.type){let e=g?.othersOffers?.filter(e=>"gaz"===e.type);c?.owners[0]?.attributes.gaz_tarif_type==="Fixe 3 ans"||c?.owners[0]?.attributes.gaz_tarif_type==="Fixe 2 ans"?(t.indexe=e?e[0]?.prices?.monthly:null,t.fix=c?.prices?.monthly,t.fix2Ans=c?.owners[0]?.attributes.gaz_tarif_type==="Fixe 2 ans"):(t.fix=e?e[0]?.prices?.monthly:null,t.indexe=c?.prices?.monthly)}E({elec:e,gaz:t})},[]);let I=e=>c.messages?c.messages.filter(t=>t.target===e):[];async function D(t){if(!P){e.onClick&&e.onClick(),S(!0);try{await x.deleteMultiples(t)}catch(e){console.log("error deleted")}S(!1)}}async function O(e,t){if(!P){S(!0);try{await x.setCartAttribute(e+"_tarif_type",t)}catch(e){console.log("error deleted")}S(!1)}}let B=()=>{let e=!1;return"elec"===c.type?e=k.elec.fix?.HT_Total_Price_Bf_Promo>0&&k.elec.eco?.HT_Total_Price_Bf_Promo>0:"gaz"===c.type&&(e=k.gaz.fix?.HT_Total_Price_Bf_Promo>0&&k.gaz.indexe?.HT_Total_Price_Bf_Promo>0),e};return(0,a.jsxs)("div",{className:u()(r()["cart--line"],r()["cart--line--gaz"],c.hasTopSeparator?r()["has-top-separator"]:"",P?r().isLoading:""),children:[(t=k?.elec?.fix1An,i=k?.elec?.fix2Ans,s=k?.gaz?.fix2Ans,(0,a.jsx)(a.Fragment,{children:!d&&!d&&!p&&B()&&(0,a.jsx)(C._j,{containerparentclass:r().modalPriceBloc,open:T,onClose:()=>v(!1),title:"Modifier mon niveau de prix",children:(0,a.jsxs)("div",{className:r().contentModal,children:["elec"===c.type&&(0,a.jsxs)("div",{className:r().cartLineTarifType,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:r().cartLineTarifTypeItem,onClick:()=>w(t?"Fixe 1 an":i?"Fixe 2 ans":"Fixe 3 ans"),children:[t&&(0,a.jsx)(C.A1,{checked:"Fixe 1 an"===N,value:"Fixe 1 an",label:"\xc9lec’ prix fixe 1 an",name:"elec_tarif_type"}),i&&(0,a.jsx)(C.A1,{checked:"Fixe 2 ans"===N,value:"Fixe 2 ans",label:"\xc9lec’ prix fixe 2 ans",name:"elec_tarif_type"})," ",!t&&!i&&(0,a.jsx)(C.A1,{checked:"Fixe 3 ans"===N,value:"Fixe 3 ans",label:"\xc9lec’ prix fixe 3 ans",name:"elec_tarif_type"}),k?.elec&&_?.context?.cart_attr_energie_billing_mode!=="Mensuel reel"&&(0,a.jsx)(m,{prices:k.elec.fix,priceKey:"TTC_Total_Price",text:"/par mois"})]}),(0,a.jsxs)("p",{children:["Un prix HT garanti sans augmentation pendant"," ",t?"1 an":i?"2 ans*":"3 ans*"]}),(0,a.jsx)("a",{className:u()("btn","primary-link"),href:"/api/document/grille-de-prix-elec",rel:"noopener noreferrer",target:"_blank",children:"Consulter la grille de prix"})]}),(0,a.jsxs)("div",{className:r().borderTop,children:[(0,a.jsxs)("div",{className:r().cartLineTarifTypeItem,onClick:()=>w("Variable"),children:[(0,a.jsx)(C.A1,{checked:"Variable"===N,value:"Variable",label:"\xc9lec’ Optim",name:"elec_tarif_type"}),k?.elec&&_?.context?.cart_attr_energie_billing_mode!=="Mensuel reel"&&(0,a.jsx)(m,{prices:k.elec.eco,priceKey:"TTC_Total_Price",text:"/par mois"})]}),(0,a.jsx)("p",{children:"Offre \xe0 prix variable, qui n'\xe9volue qu'une fois par an*"}),(0,a.jsx)("a",{className:u()("btn","primary-link"),href:"/api/document/grille-de-prix-elec-optim",rel:"noopener noreferrer",target:"_blank",children:"Consulter la grille de prix"})]})]}),"gaz"===c.type&&(0,a.jsxs)("div",{className:r().cartLineTarifType,children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:r().cartLineTarifTypeItem,onClick:()=>w(s?"Fixe 2 ans":"Fixe 3 ans"),children:[s?(0,a.jsx)(C.A1,{checked:"Fixe 2 ans"===N,value:"Fixe 2 ans",label:"Gaz prix fixe 2 ans",name:"gaz_tarif_type"}):(0,a.jsx)(C.A1,{checked:"Fixe 3 ans"===N,value:"Fixe 3 ans",label:"Gaz prix fixe 3 ans",name:"gaz_tarif_type"}),k?.gaz&&_?.context?.cart_attr_energie_billing_mode!=="Mensuel reel"&&(0,a.jsx)(m,{prices:k.gaz.fix,priceKey:"TTC_Total_Price",text:"/par mois"})]}),(0,a.jsxs)("p",{children:["Un prix HT garanti sans augmentation pendant ",s?"2":"3"," ","ans*"]}),(0,a.jsx)("a",{className:u()("btn","primary-link"),href:"/api/document/grille-de-prix-gaz",rel:"noopener noreferrer",target:"_blank",children:"Consulter la grille de prix"})]}),(0,a.jsxs)("div",{className:r().borderTop,children:[(0,a.jsxs)("div",{className:r().cartLineTarifTypeItem,onClick:()=>w("Index\xe9"),children:[(0,a.jsx)(C.A1,{checked:"Index\xe9"===N,value:"Index\xe9",label:"Gaz \xe9co",name:"gaz_tarif_type"}),k?.gaz&&_?.context?.cart_attr_energie_billing_mode!=="Mensuel reel"&&(0,a.jsx)(m,{prices:k.gaz.indexe,priceKey:"TTC_Total_Price",text:"/par mois"})]}),(0,a.jsx)("p",{children:"Le prix du kWh HT gaz est \xe9gal \xe0 celui du tarif fix\xe9 par l'\xc9tat*"}),(0,a.jsx)("a",{className:u()("btn","primary-link"),href:"/api/document/grille-de-prix-gaz-eco",rel:"noopener noreferrer",target:"_blank",children:"Consulter la grille de prix"})]})]}),(0,a.jsx)("div",{className:r().validateBtn,children:(0,a.jsx)("button",{className:"btn",onClick:()=>{P||(c.owners[0]?.attributes[c.type+"_tarif_type"]!==N&&O(c.type,N),v(!1))},children:"Valider"})})]})})})),(0,a.jsxs)("div",{children:[(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:(0,a.jsxs)(n.A,{container:!0,className:r()["sw-cart--line--container"],children:[c.tagWording&&(0,a.jsx)(n.A,{size:12,className:"grid12",children:(0,a.jsx)(h,{data:c})}),(0,a.jsx)(n.A,{size:{xs:b?12:6,md:p?6:b?12:7},className:u()("no-padding",r()["sw-cart--line--quantity-wrapper"],c.hasQuantity?r()["no-quantity"]:"",b?"grid12":""),children:(0,a.jsx)(y,{data:c,isPopIn:p,hideSubtitle:!0})}),(0,a.jsxs)(n.A,{size:{xs:6,md:p?6:5},className:u()(r()["text-left-mobile"],r()["no-padding-mobile"],r()["text-right"],"text-right",r().totalPriceBloc),children:[!b&&(0,a.jsx)("div",{className:u()(r()["sw-cart--price--total"]),children:(0,a.jsx)(m,{prices:c.prices.monthly,priceKey:"TTC_Total_Price",text:"/par mois"})}),I("PROMO").map((e,t)=>(0,a.jsx)("span",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-
1promo"]),children:e.msg},t))]}),!p&&(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:I("SUBTITLE").map((e,t)=>(0,a.jsx)("p",{className:r().subtitleText,children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:e.msg.toString().replace("kVA"," kVA").replace("HP/HC","Heures pleines / Heures creuses")}})},t))}),!p&&(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:(0,a.jsx)("button",{type:"button",className:u()(r()["sw-cart--line--btn-arrow"],j?r().open:""),onClick:()=>f(!j),children:"D\xe9tails"})})]})}),!p&&(0,a.jsx)(n.A,{container:!0,className:"no-padding",children:(0,a.jsxs)("div",{className:u()(r()["sw-cart--line--details"],j?r().open:""),children:[(0,a.jsxs)(n.A,{container:!0,className:u()(r()["sw-cart--line--details-item"],"no-padding"),spacing:0,children:[(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:(0,a.jsxs)("p",{children:["Abonnement ","elec"===c.type?"\xe9lec’":"gaz"]})}),(0,a.jsxs)(n.A,{size:12,className:u()("no-padding","grid12"),children:[(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--price"],r()["is-ttc-price"]),children:(0,a.jsx)(m,{prices:c.prices.abo,priceKey:"TTC_Total_Price",type:"detail",text:"/mois TTC"})}),(0,a.jsx)("p",{className:u()(r()["sw-cart--line--detail--price"],r()["is-ht-price"]),children:(0,a.jsx)(m,{prices:c.prices.abo,priceKey:"HT_Total_Price",type:"detail",text:"/mois HT",round:2})})]})]}),!p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:u()(r()["sw-cart--line--details-item"],"no-padding"),children:[(0,a.jsx)(A,{data:c,contextualizedCart:_}),(0,a.jsx)(L,{contextualizedCart:_,energy:c.type})]}),(0,a.jsx)("div",{children:I("GLOBAL_PROMO").map((e,t)=>(0,a.jsx)("span",{className:u()(r()["sw-cart--line--detail--promo-wrapper"],r()["sw-cart--line--detail--global-promo"]),dangerouslySetInnerHTML:{__html:e.msg}},t))})]}),(0,a.jsx)("div",{children:I("ABO").map((e,t)=>(0,a.jsx)("span",{className:u()(r().promoWrapper,r()["is-abo-promo"]),dangerouslySetInnerHTML:{__html:e.msg}},t))})]})}),(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:c.hasDelete&&!d&&!p&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("a",{onClick:()=>D(c.owners),className:u()(r().changePriceLevel,r()["delete-line"],"primary-link"),"data-tnr":"delete-line-energy "+c.type,children:"Supprimer"}),B()&&(0,a.jsx)("a",{onClick:()=>v(!0),className:"primary-link",children:"Modifier mon niveau de prix"})]})})]})]})};var N=i(316868);let w=e=>{let t,i,s,c,d,{data:p,isPopIn:g,isRecap:x,isMonitoring:_}=e,b=(0,l.useId)(),j=(0,l.useId)(),f=(0,l.useId)(),T=(0,l.useId)(),A=(0,l.useRef)(null),L=(0,l.useRef)(null),v=!g&&!x,w=p?.owners[0].product.sku.endsWith("SE_JOU"),P=p?.owners[0].product.sku.endsWith("SE_TH"),S=p?.owners[0].product.sku.endsWith("PACK_SE_TH"),k=w&&Math.round(p.prices.initial?.TTC_Total_Price)||w&&Math.round(p.prices.monthly?.TTC_Total_Price)||P&&Math.round(p.prices.initial?.TTC_Total_Price)||P&&Math.round(p.prices.monthly?.TTC_Total_Price)||p.prices.annual?.TTC_Total_Price,{cartState:E,cartService:I}=(0,o.B_)(),[D,O]=(0,l.useState)(!1),[B,F]=(0,l.useState)(p?.owners[0]?.attributes?.station_billing_mode||null),M=!g&&!(x&&P),[W,z]=(0,l.useState)(!1),R=E?.contextualizedCart,U=R?.caracs||{},H=(0,l.useMemo)(()=>U?.available_loc&&U?.available_os,[U?.available_loc,U?.available_os]),q=R?.products||[],V=(0,l.useMemo)(()=>q.find(e=>e.product.jou_add),[q]),K=(0,l.useMemo)(()=>Array.from({length:29},(e,t)=>({label:t+2,value:t})),[]);if((0,l.useEffect)(()=>{if(E?.hasCart&&R){let e=R.context.cart_attr_station_billing_mode;e&&B!==e&&F(e)}},[E,R]),!R&&!_&&!p)return null;async function G(t){if(!D){e.onClick&&e.onClick(),O(!0);try{await I.deleteMultiples(t)}catch(e){console.log("error deleted")}O(!1)}}async function $(e,t){if(V){O(!0);try{await I.setQuantity({product:{sku:V.product.sku}},t)}catch(e){console.log("error JOU quantity")}O(!1)}}async function X(e){O(!0),F(e);try{await I.setCartAttribute("station_billing_mode",e)}catch(e){console.log("error setCartAttribute")}O(!1)}let Q=e=>p.messages?p.messages.filter(t=>t.target===e):[],J=()=>g?null:(0,a.jsx)("button",{type:"button","data-tnr":"equipement-details-btn",className:u()(r()["sw-cart--line--btn-arrow"],W?r().open:""),onClick:()=>z(!W),id:j,"aria-expanded":W,"aria-controls":b,children:"D\xe9tails"}),Y=()=>Q("PROMO").map((e,t)=>(0,a.jsx)("div",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-
1promo"]),dangerouslySetInnerHTML:{__html:e.msg}},t));return(0,a.jsxs)("div",{className:u()(r()["cart--line"],r()["cart--line--gaz"],p.hasTopSeparator?r()["has-top-separator"]:"",D?r().isLoading:""),children:[(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"no-padding",children:(0,a.jsxs)(n.A,{container:!0,className:r()["sw-cart--line--container"],children:[p.tagWording&&(0,a.jsx)(n.A,{size:12,className:"grid12",children:(0,a.jsx)(h,{data:p})}),(0,a.jsxs)(n.A,{size:{xs:7},className:"no-padding",children:[(0,a.jsx)(y,{data:p,isPopIn:g,getDetailsOpenButton:k&&J,hideSubtitle:!0}),(0,a.jsx)("div",{className:r().equipementSubtitle,children:Q("SUBTITLE").map((e,t)=>(0,a.jsx)("p",{className:r().subtitleText,children:(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:e.msg}})},t))}),H&&v&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{role:"radiogroup","aria-label":"Mode de facturation",id:T,children:(s=(i=(t=[N.eS.STATION_ACHAT,N.eS.STATION_LOCATION]).findIndex(e=>e===B))>=0?i:0,c=async e=>{let i=t[e];i&&i!==B&&await X(i)},d=async(e,i)=>{var a;if(D)return;let s=e.key;if(" "===s||"Enter"===s){e.preventDefault(),await c(i);return}let r="ArrowLeft"===s||"ArrowUp"===s,n="ArrowRight"===s||"ArrowDown"===s,l="Home"===s,o="End"===s;if(!r&&!n&&!l&&!o)return;e.preventDefault();let d=i;l?d=0:o?d=t.length-1:r?d=(i-1+t.length)%t.length:n&&(d=(i+1)%t.length),0===(a=d)&&A.current?.focus(),1===a&&L.current?.focus(),await c(d)},(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:A,className:u()(r()["cart--line-radio-item"],r().a11yRadioItem),role:"radio",tabIndex:0===s?0:-1,"aria-checked":"Achat"===B,"aria-disabled":D,onClick:()=>!D&&X("Achat"),onKeyDown:e=>void d(e,0),children:(0,a.jsx)(C.A1,{checked:"Achat"===B,value:"Achat",label:"Achat",name:"station_billing_mode"})}),(0,a.jsx)("div",{ref:L,className:u()(r()["cart--line-radio-item"],r().a11yRadioItem),role:"radio",tabIndex:1===s?0:-1,"aria-checked":"Location"===B,"aria-disabled":D,onClick:()=>!D&&X("Location"),onKeyDown:e=>void d(e,1),children:(0,a.jsx)(C.A1,{checked:"Location"===B,value:"Location",label:"Location",name:"station_billing_mode"})})]}))})})]}),!k&&(0,a.jsxs)(n.A,{size:5,className:u()(r()["text-right"],r().textBold,"text-right"),children:[!p.noPrice&&p.freeWording&&(0,a.jsx)("span",{"data-tnr":p.type+"-freeWording",children:p.freeWording}),!p.noPrice&&!p.freeWording&&(0,a.jsx)("span",{"data-tnr":p.type+"-noPrice",className:r()["price-display-price"],children:"0 €"}),Y()]}),k&&(0,a.jsxs)(n.A,{"data-tnr":"equipment-price-display-total",size:5,className:u()(r()["price-display-total"],r()["text-right"],"text-right"),children:[(0,a.jsxs)(a.Fragment,{children:[w&&p.prices.initial&&(0,a.jsx)(m,{prices:p.prices.initial,type:"total",textOrangered:!0,priceKey:"TTC_Total_Price"}),w&&p.prices.monthly&&(0,a.jsx)(m,{prices:p.prices.monthly,priceKey:"TTC_Total_Price",textOrangered:!0,text:"/par mois"}),P&&p.prices.initial_equip&&(0,a.jsx)(m,{prices:p.prices.initial_equip,textOrangered:!0,type:"total",priceKey:"TTC_Total_Price"}),P&&p.prices.monthly&&(0,a.jsx)(m,{prices:p.prices.monthly,textOrangered:!0,priceKey:"TTC_Total_Price",text:"/par mois"}),p.prices.annual&&(0,a.jsx)(m,{prices:p.prices.annual,textOrangered:!0,priceKey:"TTC_Total_Price",text:"/an"})]}),Y()]})]})})}),V&&(0,a.jsxs)(n.A,{container:!0,maxWidth:"lg",children:[(0,a.jsxs)(n.A,{size:12,className:u()("no-padding","grid12"),children:[(0,a.jsxs)("div",{className:u()(r()["sw-cart--line--quantity-select--title"],g?r().quantityTitle:""),id:f,children:["Nombre de radiateurs",!v&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("span",{className:x?r().quantitySquare:"",children:[" ",": ",2+V?.quantity]})})]}),g&&p.prices.prime_cee&&(0,a.jsxs)("div",{className:r().primeCEEPopIn,children:[(0,a.jsx)(n.A,{size:8,className:"no-padding",children:(0,a.jsx)("span",{className:r().title,children:"Prime Coup de pouce"})}),(0,a.jsx)(n.A,{size:4,className:"no-padding text-right ",children:(0,a.jsx)("strong",{children:(0,a.jsx)(m,{prices:p.prices.prime_cee,priceKey:"TTC_Total_Price",text:"",round:2,hidePromo:!0})})})]})]}),!g&&(0,a.jsxs)(n.A,{size:12,className:u()("no-padding","grid12"),children:[v&&(0,a.jsx)("div",{className:u()(r()["sw-cart--line--quantity-select"],"simple-select-custom"),children:(0,a.jsx)("select",{"data-tnr":"quantity-jou-product","aria-labelledby":f,defaultValue:V?.quantity,onChange:e=>$(p.owners,e.target.value),children:K.map((e,t)=>(0,a.jsx)("option",{value:e.value,children:e.label},t))})}),p.prices.prime_cee&&(0,a.jsx)("div",{className:u()(r().orangeredBlocCee,"orangeredBlocCee"),children:(0,a.jsxs)("p",{children:["Pour b\xe9n\xe9ficier de la ",(0,a.jsx)("strong",{children:"prime Coup de pouce"}),", vous devez \xe9quiper l'ensemble de vos radiateurs et ils doivent \xeatre \xe9quip\xe9s d’un fil pilote."]})})]})]}),M&&(0,a.jsxs)(a.Fragment,{children:[k&&(0,a.jsx)(n.A,{container:!0,children:(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:J()})}),(0,a.jsx)("div",{className:u()(r()["sw-cart--line--details"],W&&k?r().open:""),id:b,role:"region","aria-labelledby":j,"aria-hidden":!W,children:(0,a.jsx)(n.A,{container:!0,className:r()["sw-cart--line--details-item"],spacing:0,children:(0,a.jsxs)(n.A,{size:12,className:u()("no-padding","grid12"),children:[p.prices.monthly&&(0,a.jsxs)("div",{className:r().priceDetailsBloc,
1children:[w&&(0,a.jsx)("p",{children:"Pack Station Sowee by EDF + 2 radiateurs"}),P&&(0,a.jsx)("p",{children:"Station Sowee by EDF"}),(0,a.jsx)("strong",{children:(0,a.jsx)(m,{prices:p.prices.monthly_se,priceKey:"TTC_Total_Price",text:"TTC",round:2,hidePromo:!0})}),(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:p.prices.monthly,priceKey:"HT_Total_Price",text:"HT",round:2,hidePromo:!0})})]}),p.prices.annual&&(0,a.jsx)(m,{prices:p.prices.annual,priceKey:"TTC_Total_Price",text:" par an",round:2}),p.prices.initial&&(0,a.jsxs)("div",{className:r().priceDetailsBloc,children:[w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:"Pack Station Sowee by EDF + 2 radiateurs"}),(0,a.jsx)("strong",{children:(0,a.jsx)(m,{prices:p.prices.initial_se_equip,priceKey:"TTC_Total_Price",text:"TTC",round:2})}),(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:p.prices.initial_se_equip,priceKey:"HT_Total_Price",text:"HT",round:2})})]}),P&&(0,a.jsxs)(a.Fragment,{children:[S&&(0,a.jsx)("p",{children:"Station Sowee by EDF"}),(0,a.jsx)("strong",{children:(0,a.jsx)(m,{dataTnr:"equipment-price-pack-initial-ttc",prices:p.prices.initial_se_equip,priceKey:"TTC_Total_Price_Bf_Promo",text:"TTC",round:2,hidePromo:!0})}),(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:p.prices.initial_se_equip,priceKey:"HT_Total_Price_Bf_Promo",text:"HT",round:2,hidePromo:!0})})]})]}),w&&p.prices.variable_kit&&p.prices.variable_kit.quantity>0&&(0,a.jsxs)("div",{className:r().priceDetailsBloc,children:[(0,a.jsx)("p",{children:"Kit pour radiateur additionnel"}),(0,a.jsxs)("p",{children:["Qt\xe9 : ",p.prices.variable_kit.quantity," "]}),(0,a.jsx)("strong",{children:(0,a.jsx)(m,{prices:p.prices.variable_kit,priceKey:"TTC_Total_Price",text:"TTC",round:2})}),(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:p.prices.variable_kit,priceKey:"HT_Total_Price",text:"HT",round:2})})]}),p.prices.initial_inst&&(0,a.jsxs)("div",{className:r().priceDetailsBloc,children:[(0,a.jsx)("p",{children:"Installation par un pro"}),(0,a.jsx)("strong",{children:(0,a.jsx)(m,{prices:p.prices.initial_inst,priceKey:"TTC_Total_Price",text:"TTC",round:2})}),(0,a.jsx)("p",{children:(0,a.jsx)(m,{prices:p.prices.initial_inst,priceKey:"HT_Total_Price",text:"HT",round:2})})]}),p.prices.prime_cee&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{children:"Prime Coup de pouce"}),(0,a.jsx)("strong",{children:(0,a.jsx)(m,{prices:p.prices.prime_cee,priceKey:"TTC_Total_Price",text:"",round:2,hidePromo:!0})})]})]})})})]}),(0,a.jsx)(n.A,{container:!0,children:(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:p.hasDelete&&!x&&!g&&(0,a.jsx)("button",{type:"button","data-tnr":"delete-line-equipement "+p.type,onClick:()=>G(p.owners),className:u()(r()["delete-line"],"primary-link"),disabled:D,children:"Supprimer"})})})]})},P=e=>{let{data:t,isPopIn:i,isRecap:s}=e,{cartState:c,cartService:d}=(0,o.B_)(),[p,g]=(0,l.useState)(!1),[x,_]=(0,l.useState)(!1),b=t?.prices?.initial?.TTC_Total_Price||t?.prices?.over_10_months?.TTC_Total_Price,[j,f]=(0,l.useState)(t?.owners[0]?.attributes?.inst_billing_mode||null),T=t.owners.some(e=>e.product.is_package);async function A(e){g(!0),f(e);try{await d.setCartAttribute("inst_billing_mode",e)}catch(e){console.log("error deleted")}g(!1)}async function L(t){if(!p){e.onClick&&e.onClick(),g(!0);try{await d.deleteMultiples(t)}catch(e){console.log("error deleted")}g(!1)}}async function v(){if(!p){e.onClick&&e.onClick(),g(!0);try{await d.setCartAttribute("station_offer_mode","default")}catch(e){console.log("error setStationOfferModeToDefault")}g(!1)}}return(0,l.useEffect)(()=>{if(c.hasCart){let{caracs:e}=c.contextualizedCart;_(e.available_inst_os&&e.available_inst_lisse&&!i&&!s&&!e.available_package)}},[c]),(0,a.jsx)("div",{className:u()(r()["cart--line"],r()["cart--line--installation"],t.hasTopSeparator?r()["has-top-separator"]:"",p?r().isLoading:""),children:(0,a.jsxs)(n.A,{container:!0,children:[(0,a.jsx)(n.A,{size:12,className:u()("no-padding","grid12"),children:(0,a.jsxs)(n.A,{container:!0,className:r()["sw-cart--line--container"],children:[t.tagWording&&(0,a.jsx)(n.A,{size:12,className:"grid12",children:(0,a.jsx)(h,{data:t})}),(0,a.jsxs)(n.A,{size:7,className:"no-padding",children:[(0,a.jsx)(y,{data:t,isPopIn:i}),x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:r()["cart--line-radio-item"],onClick:()=>A("One Shot"),children:(0,a.jsx)(C.A1,{checked:"One Shot"===j,value:"One Shot",label:"En une fois",name:"inst_billing_mode"})}),(0,a.jsx)("div",{className:r()["cart--line-radio-item"],onClick:()=>A("Lisse"),children:(0,a.jsx)(C.A1,{checked:"Lisse"===j,value:"Lisse",label:"En 10 fois sans frais",name:"inst_billing_mode"})})]})]}),(0,a.jsx)(n.A,{size:5,className:u()(r()["text-right"],"text-right"),children:(0,a.jsxs)(a.Fragment,{children:[b?(0,a.jsxs)("span",{className:r()["price-display-total"],children:[t.prices.initial&&(0,a.jsx)(m,{textOrangered:!0,prices:t.prices.initial,priceKey:"TTC_Total_Price"}),t.prices.over_10_months&&(0,a.jsx)(m,{textOrangered:!0,prices:t.prices.over_10_months,priceKey:"TTC_Total_Price",text:"/par mois"})]}):(0,a.jsxs)(a.Fragment,{children:[!t.noPrice&&t.freeWording&&(0,a.jsx)("span",{"data-tnr":t.type+"-freeWording",className:r()["sw-cart--line--freeWording"],children:t.freeWording}),!t.noPrice&&!t.freeWording&&(0,a.jsx)("span",{className:r()["price-display"],children:(0,a.jsx)("span",{className:r()["price-display-price"],children:"0 €"})})]}),(t.messages?t.messages.filter(e=>"PROMO"===e.target):[]).map((e,t)=>(0,a.jsx)("span",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-
1promo"]),children:e.msg},t))]})})]})}),(0,a.jsx)(n.A,{container:!0,children:(0,a.jsxs)(n.A,{size:12,className:u()("no-padding","grid12"),children:[t.hasDelete&&!s&&!i&&(0,a.jsx)("a",{"data-tnr":"delete-line-installation "+t.type,onClick:()=>L(t.owners),className:u()(r()["delete-line"],"primary-link"),children:"Supprimer"}),T&&!i&&!s&&(0,a.jsx)("a",{"data-tnr":"delete-line-installation "+t.type,onClick:()=>v(),className:u()(r()["delete-line"],"primary-link"),children:"Supprimer"})]})})]})})},S=e=>{let{data:t,isPopIn:i,isRecap:s}=e,{cartState:c,cartService:d}=(0,o.B_)(),{contextualizedCart:p}=c,[g,x]=(0,l.useState)(p?.context?.cart_attr_maintenance_recurrence),[_,b]=(0,l.useState)(!1),j=t.prices?.initial?.TTC_Total_Price||t.prices?.monthly?.TTC_Total_Price||t.prices?.annual?.TTC_Total_Price,f=p.caracs.elec||p.caracs.gaz||-1!=p.context.patrimony.indexOf("ELEC")||-1!=p.context.patrimony.indexOf("GAZ");async function T(t){if(!_){e.onClick&&e.onClick(),b(!0);try{await d.deleteMultiples(t)}catch(e){console.log("error deleted")}b(!1)}}async function A(e){x(e),b(!0);try{await d.setCartAttribute("maintenance_billing_mode",e)}catch(e){console.log("error deleted")}b(!1)}return(0,a.jsx)("div",{className:u()(r()["cart--line"],r()["cart--line--maintenance"],t.hasTopSeparator?r()["has-top-separator"]:"",_?r().isLoading:""),children:(0,a.jsxs)(n.A,{container:!0,children:[(0,a.jsx)(n.A,{size:12,className:"no-padding",children:(0,a.jsxs)(n.A,{container:!0,className:r()["sw-cart--line--container"],children:[t.tagWording&&(0,a.jsx)(n.A,{size:12,children:(0,a.jsx)(h,{data:t})}),(0,a.jsx)(n.A,{size:{xs:12,md:5},className:u()(r()["sw-cart--line--quantity-wrapper"],"no-padding"),children:(0,a.jsx)(y,{data:t,isPopIn:i})}),(0,a.jsx)(n.A,{size:{xs:12,md:3},className:r()["sw-cart--line--quantity-wrapper"],children:(0,a.jsx)("div",{children:f&&(0,a.jsxs)("div",{className:r()["cart--line-gaz-tarif-type"],children:[(0,a.jsx)("div",{className:r()["cart--line-gaz-tarif-type-item"],onClick:()=>A("Annuel"),children:(0,a.jsx)(C.A1,{checked:"Annuel"===g,value:"Annuel",label:"En une fois",name:"maint_mode_de_facturation"})}),(0,a.jsx)("div",{className:r()["cart--line-gaz-tarif-type-item"],onClick:()=>A("Mensuel lisse"),children:(0,a.jsx)(C.A1,{checked:"Mensuel lisse"===g,value:"Mensuel lisse",label:"En 12 fois sans frais",name:"maint_mode_de_facturation"})})]})})}),(0,a.jsxs)(n.A,{size:{xs:12,md:4},className:u()(r()["text-left-mobile"],r()["text-right"],"text-right",r()["sw-cart--price--clicable"]),children:[j?(0,a.jsxs)("div",{className:r()["sw-cart--price--total"],children:[t.prices.initial&&(0,a.jsx)(m,{prices:t.prices.initial,priceKey:"TTC_Total_Price"}),t.prices.monthly&&(0,a.jsx)(m,{prices:t.prices.monthly,priceKey:"TTC_Total_Price"}),t.prices.initial&&(0,a.jsx)(m,{prices:t.prices.initial,priceKey:"TTC_Total_Price",text:"/par mois"}),t.prices.annual&&(0,a.jsx)(m,{prices:t.prices.annual,priceKey:"TTC_Total_Price",text:"/mois/an"}),(0,a.jsx)("p",{className:r()["sub-text"],children:"Sous r\xe9serve d’application du taux de TVA de 10%"})]}):(0,a.jsxs)("div",{children:[!t.noPrice&&t.freeWording&&(0,a.jsx)("span",{"data-tnr":t.type+"-freeWording",className:r()["sw-cart--line--freeWording"],children:t.freeWording}),!t.noPrice&&!t.freeWording&&(0,a.jsx)("span",{className:r()["price-display-price"],children:"0 €"})]}),(t.messages?t.messages.filter(e=>"PROMO"===e.target):[]).map((e,t)=>(0,a.jsx)("span",{className:u()(r()["sw-cart--line--detail--promo"],r()["is-promo"]),children:e.msg},t))]})]})}),t.hasDelete&&!s&&!i&&(0,a.jsx)("a",{"data-tnr":"delete-line-maintenance "+t.type,onClick:()=>T(t.owners),className:u()(r()["delete-line"],"primary-link"),children:"Supprimer"})]})})},k=e=>{let{data:t}=e;return(0,a.jsx)("div",{className:u()(r()["cart--line"],r()["cart--line--message-upsell"],t.hasTopSeparator?r()["has-top-separator"]:""),children:(0,a.jsx)(n.A,{container:!0,children:(0,a.jsxs)(n.A,{size:12,className:"no-padding",children:[(0,a.jsx)(h,{data:t}),(0,a.jsx)(y,{data:t})]})})})},E=e=>(0,a.jsx)("div",{className:u()(r()["cart--lines--list"],e.isPopIn?r().isPopIn:""),children:(0,a.jsx)(n.A,{size:12,className:u()(e.isRecap?r().cartLinesRecap:"",r()["cart--lines--list"],r()["cart--lines--list-items"]),children:e.lines.map((t,i)=>(0,a.jsx)("div",{className:u()(0===i?r()["cart--lines--first-line"]:i+1===e.lines.length?r().lastLine:""),children:(t=>{switch(t.type){case"gaz":case"elec":return(0,a.jsx)(v,{data:t,isPopIn:e.isPopIn,isRecap:e.isRecap});case"equipement":return(0,a.jsx)(w,{data:t,isPopIn:e.isPopIn,isRecap:e.isRecap,isMonitoring:e.isMonitoring});case"assistance":return(0,a.jsx)(_,{data:t,isPopIn:e.isPopIn,isRecap:e.isRecap});case"maint":return(0,a.jsx)(S,{data:t,isPopIn:e.isPopIn,isRecap:e.isRecap});case"message_upsell":return(0,a.jsx)(k,{data:t,isPopIn:e.isPopIn});case"inst_th":case"inst_jou":return(0,a.jsx)(P,{data:t,isPopIn:e.isPopIn,isRecap:e.isRecap});default:return(0,a.jsx)(T,{data:t,isPopIn:e.isPopIn,isRecap:e.isRecap})}})(t)},`${t.type}-${i}`))})})},204415:(e,t,i)=>{"use strict";i.d(t,{$g:()=>d,B_:()=>c});var a=i(637876),s=i(514e3),r=i(14232),n=i(745482),l=i(422939);let o=(0,r.createContext)({cartState:null,setCartState:()=>{},cartService:null}),c=()=>(0,r.useContext)(o),d=({children:e})=>{let t=(0,s.usePathname)(),[i,c]=(0,r.useState)(null),[d,p]=(0,r.useState)({ready:!1,isLoading:!1,hasCart:!1}),u=async e=>{try{let t=await l.A.getNode(),i=e.includes("souscription/"),a="/panier"==e,s=new n.A(p);i&&void 0!=t.sowee.subscriptionCartId?(s.setSubscriptionCartId(t.sowee.subscriptionCartId),s.setCartType("souscription")):(s.setSimulationCartId(t.sowee.simulationCartId),s.setCartType("simulation")),c(s),s.getCartData(!a)}catch(e){console.log("error cartData",e),p({...d,ready:!0})}};return(0,r.useEffect)(()=>{t&&u(t)},[t]),(0,a.jsx)(o.Provider,{value:{cartState:d,setCartState:p,cartService:i},children:e})}},285718:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/so-admin/contrib-pages",function(){return i(809995)}])},316868:(e,t,i)=>{"use strict";i.d(t,{OA:()=>s,a6:()=>n,eS:()=>a,qr:()=>l,zG:()=>r});let a={STATION_ACHAT:"Achat",STATION_LOCATION:"Location",STATION_OFFER_MODE_PACKAGE:"package",TARIF_TYPE_FIXE:"Fixe 3 ans",TARIF_TYPE_FIXE_2ANS:"Fixe 2 ans",TARIF_TYPE_FIXE_1AN:"Fixe 1 an",TARIF_TYPE_ELEC_VARIABLE:"Variable",TARIF_TYPE_GAZ_INDEXE:"Index\xe9",BILLING_MODE_LISSE:"Lisse"},s={SUBSCRIBED:"subscribed"},r={key:"services_essentiel",label:"Services \xc9nergie"},n={key:"services_pilotage",label:"Station Sowee by EDF"},l={RADIATEURS_INDEPENDANTS:"IndependentRadiators",CLIM_REVERSIBLE:"ReversibleAirConditioning",PAC:"HeatPump"}},370281:(e,t,i)=>{"use strict";i.d(t,{A:()=>F});var a=i(637876),s=i(926727),r=i(164420),n=i(583647),l=i(702712),o=i(601721),c=i(824661),d=i(780169),p=i(894592),u=i(144244),h=i(651095),m=i(594014),g=i(91704),x=i(222250),y=i(509092),_=i(81393),b=i(949843),j=i(761001),f=i(177223),T=i(475782),C=i(625923),A=i(173996),L=i(729370),v=i.n(L),N=i(14232),w=i(531337),P=i(382071),S=i(851171),
1k=i(15039),E=i.n(k),I=i(175598),D=i(162753),O=i(548506),B=i.n(O);let F=e=>{let t=e=>{let t={};return Object.keys(e).map(i=>{t[i]="","BOOLEAN"==e[i].type&&(t[i]=!0)}),t},[i,L]=(0,N.useState)({}),[k,O]=(0,N.useState)(!1),[F,M]=(0,N.useState)({}),[W,z]=(0,N.useState)(!1),[R,U]=(0,N.useState)({by:e.orderBy||null,direction:e.orderDirection||null}),[H,q]=(0,N.useState)(e.limit||null),V=e=>(e.model.modelObj=JSON.parse(e?.model?.model),e.data.map(t=>{let i=e.model.storeTable?t:JSON.parse(t.data);return i.id=t.id,i})),[K,G]=(0,N.useState)([]),[$,X]=(0,N.useState)(),[Q,J]=(0,N.useState)(null),Y=new URLSearchParams;H&&Y.append("limit",H),R.by&&(Y.append("orderBy",R.by),Y.append("orderDirection",R.direction));let Z=""!=Y.toString()?"&"+Y.toString():"",{data:ee,error:et}=(0,w.u)("/api/node/v1/private/object-models/getObjectModel?configType="+e.configType+Z,P.A.get.bind(P.A));if((0,N.useEffect)(()=>{ee&&(G(V(ee)),J(ee.model.modelObj))},[ee]),et)return(0,a.jsxs)("div",{children:["Error: ",JSON.stringify(et)," "]});if(!ee)return(0,a.jsx)(S.A,{});if(!e.configType)return(0,a.jsx)("div",{children:"Error: Missing configType"});let ei=async()=>{let t=new URLSearchParams;H&&t.append("limit",H),R.by&&(t.append("orderBy",R.by),t.append("orderDirection",R.direction));let i=""!=t.toString()?"&"+t.toString():"";G(V(await P.A.get("/api/node/v1/private/object-models/getObjectModel?configType="+e.configType+i)))},ea=async e=>{z(!1);let t=await P.A.post("/api/node/v1/private/config-var/delete",{keys:[e]});t.error?(console.error(t.error),z(!0),alert('Une erreur est survenue lors de la RAZ de la "Config Var" : '+e)):alert('RAZ Config Var "'+e+'" => OK !')},es=e=>{let{target:t}=e;L({...i,[t.name]:"checkbox"===t.type?t.checked:t.value})},er=async a=>{let s=a||{...i};e.afterEditAction&&await e.afterEditAction(s,Q);let{error:r,message:n,cause:l}=await P.A.post("/api/node/v1/private/object-models/saveObjectModel?configType="+e.configType,s);if(z(!0),r){let e="ERROR : "+JSON.stringify(r);n&&(e+="\nMessage : "+n),l&&(e+="\n\nCause : "+JSON.stringify(l)),alert(e);return}await v()("/api/node/v1/private/memcached/clearCache?cache-keys="+e.configType),L(t(Q)),k&&O(!1),ei()},en=async t=>{await P.A.post("/api/node/v1/private/object-models/deleteObjectModel?configType="+e.configType,{id:t.id}),await v()("/api/node/v1/private/memcached/clearCache?cache-keys="+e.configType),ei()},el=async e=>{L(e),O(!0)},eo=async()=>{L(t(Q)),Object.values(Q).filter(e=>e.editDisplay).length>0?O(!0):er()},ec=async t=>{e.customAction(t)},ed=async(e,t,i)=>{X(i);try{let i=await e.handleAction?.(t,e,K);i?.saveItem&&await er(i.newItem)}catch(e){console.error("handleAdvancedAction ERROR : ",e)}X(null)},ep=e=>{e.target.name||console.error("need un name sur le input filter !"),M({...F,[e.target.name]:e.target.value})};return(0,a.jsxs)(N.Fragment,{children:[(0,a.jsxs)(p.A,{fullWidth:!0,maxWidth:"md",open:k,"aria-labelledby":"form-dialog-title",children:[(0,a.jsxs)(m.A,{children:['Nouvel objet "',e.configType,'" ']}),(0,a.jsx)(h.A,{style:{minHeight:Q&&Object.values(Q).filter(e=>["CUSTOM LIST","ADVANCED LIST"].includes(e.type)).length>0?"65vh":"none"},children:(0,a.jsx)("form",{noValidate:!0,autoComplete:"off",children:Q&&Object.values(Q).sort((e,t)=>e.weight-t.weight).map((e,t)=>{if(e.editDisplay){let s={label:e.title,name:e.colName,disabled:!e.editable,required:e.required,helperText:null,value:null,style:null};if(e.description&&(s.helperText=e.description),"BOOLEAN"!=e.type&&(s.value=i[e.colName],s.style={marginBottom:12}),"DATETIME"==e.type&&(s.value=new Date(i[e.colName]).toISOString()),"INT"==e.type)return(0,a.jsx)(A.A,{...s,type:"number",onChange:e=>es(e),inputProps:{min:"0"},InputLabelProps:{shrink:!0}},t);if("MULTILINE"==e.type)return(0,a.jsx)(A.A,{...s,fullWidth:!0,multiline:!0,onChange:e=>es(e)},t);if("TEXT"==e.type||"EXPRESSION"==e.type||"DATETIME"==e.type)return(0,a.jsx)(A.A,{...s,fullWidth:!0,multiline:!0,onChange:e=>es(e)},t);else if("BOOLEAN"==e.type)return(0,a.jsx)(g.A,{control:(0,a.jsx)(d.A,{...s,checked:i[e.colName],onChange:e=>es(e),color:"default"}),label:s.label},t);else if("CUSTOM LIST"==e.type)return(0,a.jsx)(I.A,{value:s.value,disablePortal:!0,options:e.customByType.split(","),sx:{width:300},onChange:(e,t)=>
1{L({...i,[s.name]:t})},renderInput:e=>(0,a.jsx)(A.A,{...e,...s,fullWidth:!0,style:{border:"1px solid #BBB",marginBottom:12}})},t);else if("ADVANCED LIST"==e.type)return(0,a.jsx)(I.A,{multiple:!0,value:Array.isArray(s.value)?s.value:s.value?s.value.split(","):[],disablePortal:!0,options:e.customByType.split(","),onChange:(e,t)=>{L({...i,[s.name]:t.join(",")})},renderInput:e=>(0,a.jsx)(A.A,{...e,...s,fullWidth:!0,style:{border:"1px solid #BBB",marginBottom:12}})},t);else return(0,a.jsx)(A.A,{...s,fullWidth:!0,onChange:e=>es(e)},t)}})})}),(0,a.jsxs)(u.A,{children:[(0,a.jsx)(c.A,{onClick:()=>O(!1),color:"primary",children:"Annuler"}),(0,a.jsx)(c.A,{onClick:async()=>{await er()},color:"primary",children:"Valider"})]})]}),e.hasConfigVarKey&&Q&&(0,a.jsx)("div",{children:(0,a.jsxs)(c.A,{disabled:!W,title:"Cliquer ici est \xe9quivalent \xe0 aller dans 'So-Admin > Config Var' et supprimer le contenu de la clef '"+e.hasConfigVarKey+"' ",onClick:()=>ea(e.hasConfigVarKey),color:"warning",children:['Clear de la "Config Var" associ\xe9e : ',(0,a.jsx)("u",{children:e.hasConfigVarKey})]})}),e.withFilter&&Q&&(0,a.jsxs)("div",{children:["FILTRE (En Front)",(0,a.jsx)("br",{}),(0,a.jsx)("input",{placeholder:"any",name:"any",onChange:ep}),(0,a.jsx)("br",{}),(0,a.jsx)("hr",{}),Object.values(Q)?.map(e=>e.colName)?.map((e,t)=>
1(0,a.jsx)("input",{placeholder:e,name:e,onChange:ep,style:{marginRight:5}},t)),(0,a.jsx)("br",{}),(0,a.jsx)("hr",{}),(0,a.jsx)("br",{}),"ORDRE (En Back)",(0,a.jsx)("br",{}),(0,a.jsxs)("select",{name:"orderBy",onChange:e=>{U({...R,by:e.target.value})},children:[(0,a.jsx)("option",{value:"",children:"--"}),Object.values(Q)?.map(e=>e.colName)?.map((e,t)=>(0,a.jsx)("option",{selected:R.by==e,value:e,children:e},t))]}),"-",(0,a.jsxs)("select",{name:"order",onChange:e=>{U({...R,direction:e.target.value})},children:[(0,a.jsx)("option",{value:"",children:"--"}),(0,a.jsx)("option",{selected:"ASC"==R.direction,value:"ASC",children:"ASC"}),(0,a.jsx)("option",{selected:"DESC"==R.direction,value:"DESC",children:"DESC"})]}),(0,a.jsx)("br",{}),(0,a.jsx)("br",{}),"LIMITE (En back)",(0,a.jsx)("br",{}),(0,a.jsx)("input",{placeholder:"limit",name:"limit",value:H,onChange:e=>{q(e.target.value)}}),(0,a.jsx)("br",{}),(0,a.jsx)("hr",{})]}),(0,a.jsx)(f.A,{component:y.A,children:(0,a.jsxs)(_.A,{className:B().simpleTable,"aria-label":"customized table",children:[(0,a.jsx)(T.A,{children:(0,a.jsxs)(C.A,{classes:{head:B().tableHeadStyle},children:[(0,a.jsx)(j.A,{children:(0,a.jsx)(x.A,{onClick:()=>eo(),"aria-label":"add-new-attribute",children:(0,a.jsx)(s.A,{fontSize:"large",style:{color:"blue"}})})}),Q&&Object.values(Q).map((e,t)=>{if(e.listDisplay)return(0,a.jsx)(j.A,{align:"left",children:e.listTitle&&""!=e.listTitle?e.listTitle:e.title},t)}),(0,a.jsx)(j.A,{colSpan:e.advancedActions?2:1,children:"Actions"})]})}),(0,a.jsx)(b.A,{children:K.filter(e=>{if(F.any&&e){let t=!1;for(let i of Object.values(e))if(i?.toString()?.toLowerCase()?.includes(F.any?.toLowerCase())){t=!0;break}if(!t)return!1}for(let t in F)if("any"!==t&&F[t]&&e[t]&&!e[t]?.toString()?.toLowerCase()?.includes(F[t]?.toLowerCase()))return!1;return!0}).map((t,i)=>(0,a.jsxs)(C.A,{style:$==i?{opacity:"0.4",cursor:"not-allowed"}:{},children:[(0,a.jsx)(j.A,{padding:"none",style:{textAlign:"center"},children:$==i&&(0,a.jsx)(D.A,{size:20})}),Q&&Object.values(Q).filter(e=>e.listDisplay).map((i,s)=>(0,a.jsxs)(j.A,{padding:"none",align:"left",style:e.customColStyle?.[i.colName]?.style?.(t[i.colName],t,K)||{},children:["BOOLEAN"==i.type&&(t[i.colName]?(0,a.jsx)(r.A,{style:{color:"green"}}):(0,a.jsx)("i",{className:E()("icon-close","icon"),style:{color:"red"}})),"DATETIME"==i.type&&"string"==typeof t[i.colName]&&new Date(t[i.colName]).toLocaleString("fr-FR"),["MULTILINE","CUSTOM LIST","ADVANCED LIST"].includes(i.type)&&"string"==typeof t[i.colName]&&(0,a.jsx)("ul",{children:t[i.colName].split(",").map(e=>(0,a.jsx)("li",{children:e}))}),!["DATETIME","BOOLEAN","MULTILINE","CUSTOM LIST","ADVANCED LIST"].includes(i.type)&&("string"==typeof t[i.colName]&&t[i.colName].length>42?t[i.colName].substr(0,39)+"...":t[i.colName])]},s)),e.advancedActions&&(0,a.jsx)(j.A,{padding:"none",align:"right",children:e.advancedActions.filter(e=>!e.display||e.display(t,e,K)).map((e,s)=>(0,a.jsx)("span",{style:{display:"inline-block",marginRight:"12px"},children:(0,a.jsx)(c.A,{onClick:()=>ed(e,t,i),variant:"contained",color:e.button.color?.(t,e,K)||"primary",style:e.button.style?.(t,e,K)||{},disabled:e.button.disabled?.(t,e,K)||!1,disableElevation:!0,startIcon:e.button.icon?.(t,e,K)||null,children:e.button.text?.(t,e,K)})},s))}),(0,a.jsxs)(j.A,{padding:"none",align:"right",children:[!1!=e.canEditItems&&(0,a.jsx)(x.A,{onClick:()=>el(t),"aria-label":"edit",children:(0,a.jsx)(l.A,{style:{color:"blue"}})}),!1!=e.canDeleteItems&&(0,a.jsx)(x.A,{onClick:()=>en(t),"aria-label":"delete",children:(0,a.jsx)(n.A,{style:{color:"red"}})}),e.customAction&&(0,a.jsx)(x.A,{onClick:()=>ec(t),"aria-label":"custom-action",children:(0,a.jsx)(o.A,{style:{color:"green"}})})]})]},t.id))})]})})]})}},422939:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});var a=i(990734),s=i(382071);class r{static{this.promiseEndPoint={node:{sessionGet:null,cart:null}}}static{this.isFirstCall={node:!0}}static{this.activatedSessionCookieName={node:"sowee.webapp.sid.active"}}static async timeout(e){return new Promise(t=>setTimeout(t,e))}static async waitForCookie(e){return new Promise(function(t){let i=setInterval(()=>{a.A.getCookieValue(e)&&(clearInterval(i),t())},100)})}static async myPromiseAny(e){let t=[];return new Promise((i,a)=>{e.forEach((s,r)=>{s&&s.then(e=>{i(e)}).catch(i=>{t[r]=i,r===e.length-1&&a(AggregateError(t,"All promises were rejected"))})})})}static async waitIfCannotRunParallelRequests(e="node"){if(!a.A.getCookieValue(this.activatedSessionCookieName[e])&&!this.isFirstCall[e]){let t=Object.values(this.promiseEndPoint[e]);await (Promise.any?Promise.any(t):r.myPromiseAny(t)),await this.waitForCookie(this.activatedSessionCookieName[e])}this.isFirstCall[e]&&(this.isFirstCall[e]=!1)}static async getNode(){return await this.waitIfCannotRunParallelRequests(),this.promiseEndPoint.node.sessionGet||(this.promiseEndPoint.node.sessionGet=s.A.query("/api/node/v1/session/get")),this.promiseEndPoint.node.sessionGet}static clearNodePromise(){this.promiseEndPoint.node.sessionGet=null}}let n=r},523727:e=>
1{e.exports={"cart--line--title-text":"TitleLine_cart--line--title-text__TkDkS","subtitle-text":"TitleLine_subtitle-text__fnXbt","suffix-text":"TitleLine_suffix-text__xJryU","cart--line--mobile-opener-button":"TitleLine_cart--line--mobile-opener-button__QzYDK",isPopIn:"TitleLine_isPopIn__EyN7o"}},720972:e=>{e.exports={"cart-line--tag":"CartLinesList_cart-line--tag__Yg_XZ","theme-pink":"CartLinesList_theme-pink__L2PXS","theme-blue":"CartLinesList_theme-blue__w3s7R","theme-orange":"CartLinesList_theme-orange__ROc8Q","theme-red":"CartLinesList_theme-red__iE28q","details-title-bold":"CartLinesList_details-title-bold__xZLLr","cart--lines--list":"CartLinesList_cart--lines--list__sjmHl","cart--lines--first-line":"CartLinesList_cart--lines--first-line__4lq_W","has-top-separator":"CartLinesList_has-top-separator__KVuws",lastLine:"CartLinesList_lastLine__NznC2","cart--line":"CartLinesList_cart--line__oMLXT",isPopIn:"CartLinesList_isPopIn__W5gTo","price-display":"CartLinesList_price-display__UKsbQ","price-display--before-promo":"CartLinesList_price-display--before-promo__La2L1","price-display-detail":"CartLinesList_price-display-detail__Uzmic","cart--line--default":"CartLinesList_cart--line--default__lcOFD","price-display-detail-product":"CartLinesList_price-display-detail-product__qq0vZ","price-display-price":"CartLinesList_price-display-price__YVatw","price-display-price--suffix":"CartLinesList_price-display-price--suffix__DMYwl","price-display-detail-product-regular":"CartLinesList_price-display-detail-product-regular__YOOy3","after-real-price":"CartLinesList_after-real-price__G5Ye1",changePriceLevel:"CartLinesList_changePriceLevel__pgdUD","delete-line":"CartLinesList_delete-line__koZzF","sw-cart--line--container":"CartLinesList_sw-cart--line--container__m4GSY","sw-cart--line--detail--promo":"CartLinesList_sw-cart--line--detail--promo__gMtnu",textBold:"CartLinesList_textBold__r4Llb","cart--line-elec-tarif-type-item":"CartLinesList_cart--line-elec-tarif-type-item__Px3hL",orangeredBlocCee:"CartLinesList_orangeredBlocCee__GHYH7","cart--line-radio-item":"CartLinesList_cart--line-radio-item__s_h0W",a11yRadioItem:"CartLinesList_a11yRadioItem__s5rv_","cart--line-gaz-tarif-type-item":"CartLinesList_cart--line-gaz-tarif-type-item__Fh7tf",totalPriceBloc:"CartLinesList_totalPriceBloc__plmDQ","sw-cart--price--total":"CartLinesList_sw-cart--price--total__wp_CV","price-display-total":"CartLinesList_price-display-total__aFuBZ","cart--line--assistance":"CartLinesList_cart--line--assistance__s59_Q","price-display-price--suffix--br":"CartLinesList_price-display-price--suffix--br__R4yU5","price-display-price--before-promo--br":"CartLinesList_price-display-price--before-promo--br__kpgIU",cartLineTarifTypeItem:"CartLinesList_cartLineTarifTypeItem__62Hmo","is-promo":"CartLinesList_is-promo__b4nxS","text-orangered":"CartLinesList_text-orangered__DQpcc",cartLinesRecap:"CartLinesList_cartLinesRecap__tSjbk",commandDetail:"CartLinesList_commandDetail__Jcb81",recapBloc:"CartLinesList_recapBloc__SxPAy",titleBloc:"CartLinesList_titleBloc__JdV1W",priceBloc:"CartLinesList_priceBloc__WLfG7",btnOpen:"CartLinesList_btnOpen__uPfHa",isOpen:"CartLinesList_isOpen__wYzFZ",contratDetail:"CartLinesList_contratDetail__dZvw6",title:"CartLinesList_title__eNhWi","sw-cart--line--details-item":"CartLinesList_sw-cart--line--details-item__3TQIY",typeService:"CartLinesList_typeService__u33nL",cartLineTitle:"CartLinesList_cartLineTitle__EO7Ne",cartLineSubTitle:"CartLinesList_cartLineSubTitle__Z5I_m","sub-text":"CartLinesList_sub-text__thJ8a","sw-cart--line--btn-arrow":"CartLinesList_sw-cart--line--btn-arrow__PRu47",open:"CartLinesList_open__rOMqi",promoWrapper:"CartLinesList_promoWrapper__Mz9f_","sw-cart--line--detail--global-promo":"CartLinesList_sw-cart--line--detail--global-promo___4c42","sw-cart--line--details":"CartLinesList_sw-cart--line--details__Lqwkf","car-estimation-container":"CartLinesList_car-estimation-container__sS0AA",isRecap:"CartLinesList_isRecap__Yy3_S","car-display--before-promo-free":"CartLinesList_car-display--before-promo-free__EelzI","sw-cart--text-bold":"CartLinesList_sw-cart--text-bold__m4Xq9","sw-cart--line--freeWording":"CartLinesList_sw-cart--line--freeWording__jaeCE","sw-cart--line--estimation-price":"CartLinesList_sw-cart--line--estimation-price__jcCsD",marginTop:"CartLinesList_marginTop__UaUJB","sw-cart--line--detail--estimation":"CartLinesList_sw-cart--line--detail--estimation__gPyfM","is-ttc-price":"CartLinesList_is-ttc-price__h77BF","sw-cart--line--estimation-item":"CartLinesList_sw-cart--line--estimation-item__kWwEA",quantitySquare:"CartLinesList_quantitySquare__mpj71","sw-cart--line--quantity-select--title":"CartLinesList_sw-cart--line--quantity-select--title__rFB_A",quantityTitle:"CartLinesList_quantityTitle__m_5S0",primeCEEPopIn:"CartLinesList_primeCEEPopIn__9v1U_",cartLineQuantity:"CartLinesList_cartLineQuantity__tSSIR","sw-cart--line--quantity-select":"CartLinesList_sw-cart--line--quantity-select__FmsOk",isLoading:"CartLinesList_isLoading__YY6zN","sw-cart--line--detail--hp-hc":"CartLinesList_sw-cart--line--detail--hp-hc__CBRO7","cart--block--order-bloc":"CartLinesList_cart--block--order-bloc__NPwnq","cart
1--block--total-price-line":"CartLinesList_cart--block--total-price-line__35wqf",recapPage:"CartLinesList_recapPage__tt72z","cart--block--total-price":"CartLinesList_cart--block--total-price__mb_1k","cart--block--title-no-lines":"CartLinesList_cart--block--title-no-lines__6xatl","cart--block--title-mention":"CartLinesList_cart--block--title-mention__naOUn","text-grey":"CartLinesList_text-grey__U9d1m","cart--block--total-price-title":"CartLinesList_cart--block--total-price-title__TWU8f","cart--block--total-price-subtitle":"CartLinesList_cart--block--total-price-subtitle___2T1i","cart--block--total-price-detail":"CartLinesList_cart--block--total-price-detail__hoRmP","cart--block--total-price-value":"CartLinesList_cart--block--total-price-value__63yBv","cart--block--order-btn":"CartLinesList_cart--block--order-btn__58yTc","cart--block--total-price-line-bloc":"CartLinesList_cart--block--total-price-line-bloc__HQqUT",contentPopin:"CartLinesList_contentPopin__pGG2u","text-right":"CartLinesList_text-right__xpUST",modalPriceBloc:"CartLinesList_modalPriceBloc__m3I_H",validateBtn:"CartLinesList_validateBtn__g8xvC",contentModal:"CartLinesList_contentModal__WKWZl",cartLineTarifType:"CartLinesList_cartLineTarifType__0p62k",priceDetails:"CartLinesList_priceDetails__gmcWf",borderTop:"CartLinesList_borderTop__pwXye","primary-link":"CartLinesList_primary-link__NWjV1",subtitleText:"CartLinesList_subtitleText__M1EwF",equipementSubtitle:"CartLinesList_equipementSubtitle__M7P2N",priceDetailsBloc:"CartLinesList_priceDetailsBloc__UbXH6","no-padding-mobile":"CartLinesList_no-padding-mobile__4XH1T","before-real-price":"CartLinesList_before-real-price__lw2I0","cart--block--content-lines":"CartLinesList_cart--block--content-lines__IMXr3",priceToTop:"CartLinesList_priceToTop__fmF2J"}},745482:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});let a="/api/v1/cart/get",s="/api/v1/cart/raw";class r{constructor(e){return this.setCartState=e,new Proxy(this,{get(e,t){let i=e[t];if("function"==typeof i)return function(...t){let a=i.apply(e,t);return a&&a.then&&a.then(e=>{e?.data?this.setCartState({...e.data,ready:!0,isLoading:!1,hasCart:!0}):e?.pushableEligibility||this.setCartState({hasCart:!1,ready:!0,isLoading:!1})}),a}}})}}var n=i(382071);class l extends r{static{this.cartEngineApiProxy="/api/node/v1/cart-engine/proxy"}static proxifiedFrontUrlStatic(e=""){return this.cartEngineApiProxy+e.replace("/api/v1","")}proxifiedFrontUrl(e=""){return this.cartEngineApiProxy+e.replace("/api/v1","")}getCurrentCartId(){return this.isSubscriptionPage?this.subscriptionCartId:this.isSimulationPage?this.simulationCartId:null}getSubscriptionCartId(){return this.subscriptionCartId}getSimulationCartId(){return this.simulationCartId}setSimulationCartId(e){this.simulationCartId=e}setSubscriptionCartId(e){this.subscriptionCartId=e}setCartType(e){this.isSubscriptionPage="souscription"==e,this.isSimulationPage="simulation"==e}isSubscriptionType(){return this.isSubscriptionPage}isSimulationType(){return this.isSimulationPage}async getCartData(e=!1){let t=this.getCurrentCartId();if(t)return n.A.post(this.proxifiedFrontUrl(a+"/"+t),{onlyCartData:e})}static async getCart(e,t=!1){if(e)return n.A.post(this.proxifiedFrontUrlStatic(a+"/"+e),{onlyCartData:t})}static async getRawCart(e){if(e)return n.A.get(this.proxifiedFrontUrlStatic(s+`/${e}`))}async deleteMultiples(e){let t=this.getCurrentCartId();return n.A.post(this.proxifiedFrontUrl(a+"/"+t),{actions:e.map(e=>[e.product.sku,"delProductSku"])})}async addSku(e,t=1){let i=this.getCurrentCartId();return n.A.post(this.proxifiedFrontUrl(a+"/"+i),{actions:[[e,t,"addSku"]]})}async addCodePromo(e){let t=this.getCurrentCartId();return n.A.post(this.proxifiedFrontUrl(a+"/"+t),{actions:[[e,"addCodePromo"]]})}async promoDirecte(){}async setQuantity(e,t){let i=this.getCurrentCartId();return n.A.post(this.proxifiedFrontUrl(a+"/"+i),{actions:[[e?.product?.sku,t,"setSkuQuantity"]]})}async setCartAttribute(e,t){let i=this.getCurrentCartId();return n.A.post(this.proxifiedFrontUrl(a+"/"+i),{actions:[[e,t,"setCartAttribute"]]})}async addPushable(e){let t=this.getCurrentCartId();return n.A.post(this.proxifiedFrontUrl(a+"/"+t),{actions:[[e.id,"addPushable"]]})}async getPushableEligibility(e){let t=this.getCurrentCartId(),i=await n.A.post(this.proxifiedFrontUrl(a+"/"+t),{actions:[[e.id,"getPushableEligibility"]]});return{pushableEligibility:i.data?.actionsResponse[0],updatedProduct:i.data?.pushable?.find(t=>
1t.id==e.id)}}constructor(...e){super(...e),this.cartEngineApiProxy="/api/node/v1/cart-engine/proxy",this.simulationCartId=null,this.subscriptionCartId=null,this.isSubscriptionPage=!1,this.isSimulationPage=!1}}},809995:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>tS});var a=i(751237),s=i(637876),r=i(993318),n=i(738213),l=i(725732),o=i(591033),c=i(632025),d=i(711946),p=i(175598),u=i(173996),h=i(824661),m=i(296203),g=i(243196),x=i(739852),y=i(629351),_=i(682702),b=i(669750),j=i(380967),f=i(655623),T=i(162753),C=i(587210),A=i(883990),L=i(14232),v=i(90946),N=i(382071),w=i(393277),P=i(981145),S=i(832231),k=i(525328),E=i(952129),I=i(454848),D=i(947103),O=i(55081),B=i(509092),F=i(894592),M=i(594014),W=i(651095),z=i(118570),R=i(144244),U=i(177223),H=i(81393),q=i(475782),V=i(625923),K=i(761001),G=i(949843),$=i(595927),X=i(185261),Q=i(349106),J=i(192181),Y=i(368129),Z=i(229024),ee=i(507638),et=i(702766);let ei={dataType:{properties:{},optionalProperties:{id:{type:"string",nullable:!0},title:{type:"string",nullable:!0},openFirst:{type:"boolean",nullable:!0},borderTop:{type:"boolean",nullable:!0},justifyContent:{type:"string",nullable:!0},accordions:{elements:{properties:{title:{type:"string"}},optionalProperties:{detail:{type:"string"}}}}},definitions:{}},defaultValues:{booleanTrue:[],booleanFalse:["openFirst","borderTop"],customValueByKey:{}}};class ea extends et.A{constructor(...e){super(...e),this.getSchema=()=>ei}}let es={dataType:{properties:{},optionalProperties:{id:{type:"string",nullable:!0},title:{type:"string",nullable:!0},withApps:{type:"boolean",nullable:!0},avisVerifiesBadge:{type:"string",nullable:!0},listAvisLink:{ref:"Button",nullable:!0},appsList:{elements:{properties:{title:{type:"string"},note:{type:"string"},totalAvis:{type:"string"}}}}},definitions:{}},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class er extends et.A{constructor(...e){super(...e),this.getSchema=()=>es}}let en={dataType:{properties:{},optionalProperties:{id:{type:"string",nullable:!0},avis:{elements:{properties:{id:{type:"string"},note:{type:"uint8"},comment:{type:"string"},firstName:{type:"string"},lastName:{type:"string"},date:{type:"string"}}}},globalAnswer:{type:"string",nullable:!0}},definitions:{}},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class el extends et.A{constructor(...e){super(...e),this.getSchema=()=>en}}var eo=i(259007);let ec={dataType:{properties:{},optionalProperties:{id:{type:"string",nullable:!0},title:{type:"string",nullable:!0},bottomLinkText:{type:"string",nullable:!0},bottomLinkUrl:{type:"string",nullable:!0},openFirst:{type:"boolean",nullable:!0},detail:{type:"string",nullable:!0},articles:{elements:{properties:{title:{type:"string",nullable:!0}},optionalProperties:{image:{type:"string",nullable:!0},link:{type:"string",nullable:!0}}}},accordions:{elements:{properties:{title:{type:"string",nullable:!0},detail:{type:"string",nullable:!0}},optionalProperties:{links:{elements:{ref:"Button"}}}}}},definitions:{},additionalProperties:!0},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class ed extends et.A{constructor(...e){super(...e),this.getSchema=()=>ec}}var ep=i(401294),eu=i(465968),eh=i(197808),em=i(936404),eg=i(411080),ex=i(349391);let ey={dataType:{properties:{},optionalProperties:{id:{type:"string",nullable:!0},isInfoBloc:{type:"boolean",nullable:!0},isFixBloc:{type:"boolean",nullable:!0},hnTitle:{ref:"HnTitle",nullable:!0},content:{type:"string",nullable:!0},imageUrl:{type:"string",nullable:!0},links:{elements:{ref:"Button"}}},definitions:{}},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class e_ extends et.A{constructor(...e){super(...e),this.getSchema=()=>ey}}var eb=i(204424),ej=i(414630),ef=i(11289),eT=i(286005),eC=i(941329),eA=i(182160),eL=i(683045),ev=i(444763),eN=i(437158),ew=i(111163);let eP={dataType:{properties:{id:{type:"string"},title:{type:"string"},textContent:{type:"string"},hasHeaterSelect:{type:"boolean"}},optionalProperties:{hnTitle:{ref:"HnTitle",nullable:!0},contentImage:{nullable:!0,properties:{src:{type:"string"},alt:{type:"string"},width:{type:"string"},height:{type:"string"}}},isLargeText:{type:"boolean",nullable:!0},button:{ref:"Button",nullable:!0},logoUrl:{type:"string",nullable:!0},centerText:{type:"boolean",nullable:!0},centerLogo:{type:"boolean",nullable:!0},centerButton:{type:"boolean",nullable:!0},marginToplogo:{type:"string",nullable:!0}},definitions:{}},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};
1class eS extends et.A{constructor(...e){super(...e),this.getSchema=()=>eP}}let ek={dataType:{properties:{},definitions:{},additionalProperties:!0},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class eE extends et.A{constructor(...e){super(...e),this.getSchema=()=>ek,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...ek.dataType,definitions:{...e,...ek.dataType.definitions}}}}}var eI=i(385637),eD=i(980244);let eO={dataType:{properties:{config:{type:"string"}},optionalProperties:{id:{type:"string"}},definitions:{},additionalProperties:!1},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class eB extends et.A{constructor(...e){super(...e),this.getSchema=()=>eO,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...eO.dataType,definitions:{...e,...eO.dataType.definitions}}}}}var eF=i(210920),eM=i(663247),eW=i(711193),ez=i(189380),eR=i(536954),eU=i(295218),eH=i(440591),eq=i(645642),eV=i(576462),eK=i(860543),eG=i(10264);let e$={dataType:{properties:{title:{type:"string"},faqItems:{elements:{properties:{title:{type:"string"},picto:{type:"string"},link:{type:"string"}},optionalProperties:{soweeTag:{type:"string"}}}}},optionalProperties:{abstract:{type:"string",nullable:!0},button:{ref:"Button"}},definitions:{},additionalProperties:!1},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class eX extends et.A{constructor(...e){super(...e),this.getSchema=()=>e$,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...e$.dataType,definitions:{...e,...e$.dataType.definitions}}}}}let eQ={dataType:{properties:{title:{type:"string"},questions:{elements:{properties:{title:{type:"string"},response:{type:"string"}},optionalProperties:{link:{type:"string"}}}}},optionalProperties:{hnTitle:{ref:"HnTitle",nullable:!0},subText:{type:"string",nullable:!0},bottomLinkText:{type:"string",nullable:!0},bottomLinkUrl:{type:"string",nullable:!0},accordions:{elements:{properties:{title:{type:"string"},links:{elements:{ref:"Button"}}},optionalProperties:{detail:{type:"string"}}}}},definitions:{},additionalProperties:!1},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class eJ extends et.A{constructor(...e){super(...e),this.getSchema=()=>eQ,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...eQ.dataType,definitions:{...e,...eQ.dataType.definitions}}}}}let eY={dataType:{properties:{button:{ref:"Button"},blocs:{elements:{properties:{image:{type:"string"},text:{type:"string"},theme:{type:"string"}},optionalProperties:{desc:{type:"string",nullable:!0},number:{type:"string",nullable:!0},themeNumber:{type:"string",nullable:!0},link:{type:"string",nullable:!0},type:{type:"string",nullable:!0},isRightText:{type:"boolean",nullable:!0}}}}},optionalProperties:{id:{type:"string",nullable:!0},showNumber:{type:"boolean",nullable:!0},blocStyle:{type:"string",nullable:!0},hnTitle:{ref:"HnTitle"}},definitions:{},additionalProperties:!1},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class eZ extends et.A{constructor(...e){super(...e),this.getSchema=()=>eY,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...eY.dataType,definitions:{...e,...eY.dataType.definitions}}}}}let e0={dataType:{properties:{title:{type:"string"},menuFooterLinks:{elements:{ref:"Link"}}},optionalProperties:{id:{type:"string",nullable:!0}},definitions:{},additionalProperties:!1},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class e1 extends et.A{constructor(...e){super(...e),this.getSchema=()=>e0,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...e0.dataType,definitions:{...e,...e0.dataType.definitions}}}}}let e2={dataType:{properties:{menuBlocs:{elements:{properties:{title:{type:"string"},menuLinks:{elements:{ref:"Link"}}},optionalProperties:{}}}},optionalProperties:{id:{type:"string",nullable:!0}},definitions:{},additionalProperties:!1},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};
1class e3 extends et.A{constructor(...e){super(...e),this.getSchema=()=>e2,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...e2.dataType,definitions:{...e,...e2.dataType.definitions}}}}}let e4={dataType:{properties:{elements:{elements:{properties:{title:{type:"string"},content:{type:"string"}}}}},optionalProperties:{id:{type:"string",nullable:!0},globalTitle:{type:"string",nullable:!0},title:{type:"string",nullable:!0},imageUrl:{type:"string",nullable:!0}},definitions:{},additionalProperties:!0},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class e5 extends et.A{constructor(...e){super(...e),this.getSchema=()=>e4}}let e7={dataType:{properties:{title:{type:"string"},layerUrl:{type:"string"},layerMobileUrl:{type:"string"},areas:{elements:{ref:"Area"}}},definitions:{Area:{properties:{img:{ref:"Image"},description:{type:"string"},link:{ref:"Link"},personnalisedLayerUrl:{type:"string"},personnalisedMobileLayerUrl:{type:"string"},position:{ref:"Position"},positionMobile:{ref:"Position"}}},Position:{properties:{right:{type:"string"},left:{type:"string"},top:{type:"string"},bottom:{type:"string"}}}},additionalProperties:!1},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class e9 extends et.A{constructor(...e){super(...e),this.getSchema=()=>e7,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...e7.dataType,definitions:{...e,...e7.dataType.definitions}}}}}let e6={dataType:{optionalProperties:{HTML:{type:"string"},name:{type:"string"},property:{type:"string"},content:{type:"string"},rel:{type:"string"},href:{type:"string"},as:{type:"string"},charset:{type:"string"},itemprop:{type:"string"},defer:{type:"string"},src:{type:"string"},type:{type:"string"}},definitions:{}},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class e8 extends et.A{constructor(...e){super(...e),this.getSchema=()=>e6}}var te=i(520044),tt=i(151262),ti=i(153738),ta=i(185394);let ts={dataType:{properties:{title:{type:"string"},apiEndpoint:{type:"string"},successMessage:{type:"string"},errorMessage:{type:"string"},button:{ref:"Button",nullable:!0}},optionalProperties:{},definitions:{}},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class tr extends et.A{constructor(...e){super(...e),this.getSchema=()=>ts}}var tn=i(609781),tl=i(950540),to=i(498350),tc=i(407204),td=i(462957),tp=i(858806);let tu={dataType:{properties:{desktopOnly:{type:"boolean",nullable:!0},maxWidth:{enum:["xs","sm","md","lg","xl"],nullable:!0},sideBlocs:{elements:{properties:{name:{type:"string",nullable:!0}}}}},optionalProperties:{alignItems:{type:"string",nullable:!0}},definitions:{},additionalProperties:!0},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class th extends et.A{constructor(...e){super(...e),this.getSchema=()=>tu,this.getDataTypeWithGlobalDef=()=>{let e=this.getGlobalDefinitionsSchema();return{...tu.dataType,definitions:{...e,...tu.dataType.definitions}}}}}let tm={dataType:{properties:{id:{type:"string"},displayMode:{enum:["headers","rows","both"]}},optionalProperties:{hnTitle:{ref:"HnTitle",nullable:!0},headers:{elements:{properties:{label:{type:"string"}}}},rows:{elements:{properties:{rowTitleLabel:{type:"string",nullable:!0},cells:{elements:{type:"string",nullable:!0}}}}}},definitions:{},additionalProperties:!0},defaultValues:{booleanTrue:[],booleanFalse:[],customValueByKey:{}}};class tg extends et.A{constructor(...e){super(...e),this.getSchema=()=>tm}}let tx={blogSummary:ed,imageDescription:e5,metaTagAttributes:e8,enteteStation:eS,sideBySideBlocs:th,accordionBloc:ea,avisVerifies:er,avisVerifiesChat:el,blocChooseSowee:e_,blocNewsletter:tr,blocsSameHeight:tp.A,table:tg,parcoursRemerciement:tn.A,planSite:to.A,phoneCallback:tl.A,mappedLayer:e9,modalProductBloc:ti.A,modalBloc:tt.A,moveBloc:ta.A,pressReview:tc.A,productDetail:td.A,miniSocials:te.A,blocWidgets:eo.A,boutique:ep.A,breadcrumbs:eu.A,carouselBloc:eh.A,carouselOffers:em.A,carouselServices:eg.A,cartBloc:ex.A,comparateurElec:eb.A,conditionalDisplay:e
1j.A,consentmentsManager:ef.A,contact:eT.A,crcGatewayList:eC.A,debugger:eA.A,downloadBloc:eL.A,dynamicLegalNotices:ev.A,engagement:eN.A,entete:ew.A,entreeSimulateur:eE,faq:eI.A,faqDemenagement:eD.A,subscriptionBloc:eB,subscriptionMonitoring:eF.A,surheader:eM.A,switcher:eW.A,textReveal:ez.A,tutoFactu:eR.A,tutoImage:eU.A,twoThirdsEnhanced:eH.A,userCtaChoice:eq.A,userSiteChoice:eV.A,videoChapterer:eK.A,widgetsStation:eG.A,faqGallery:eX,faqSummary:eJ,flexibleBlocs:eZ,footer:e1,footerMenu:e3};class ty{static{this.getSchemaByType=e=>tx[e]??tx[Y.A.capitalize(e)]}}function t_({type:e,data:t,onUpdate:i}){let[a,r]=(0,L.useState)(t),[n,l]=(0,L.useState)(e),[o,c]=(0,L.useState)(null),[d,p]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{if(e){let t=!1;if(n!=e&&(console.log(" TYPE update A newType = ",e),t=!0,l(e)),!o||t){let t={},i=ty.getSchemaByType(e);if(i){let e=new i;c(e),t=e.getNewSkeleton()}else c(null),console.warn("!!BlocContribEditor : blocSchema NOT found for type=",e);v.A.isEmpty(a)&&r(t)}}},[e]),(0,s.jsxs)(s.Fragment,{children:[n&&(0,s.jsxs)(s.Fragment,{children:["Le type ",(0,s.jsx)("u",{children:n})," est ",(0,s.jsx)("b",{children:o?"typ\xe9":"NON typ\xe9"}),(0,s.jsx)("br",{}),(0,s.jsxs)("span",{onClick:()=>{p(!d)},style:{cursor:"pointer",color:d?"red":"green",fontWeight:"bold"},children:[o&&!d&&(0,s.jsx)("u",{children:"CONTRIBUER SANS TYPAGE"}),o&&d&&(0,s.jsx)("u",{children:"CONTRIBUER AVEC TYPAGE"})]})]}),(0,s.jsx)(ee.iN,{maxWidth:910,minWidth:910,rootName:"",data:a,onUpdate:({newData:e})=>{if(o&&!d){let t=o.getContribValidator();if(!t(e))return console.log("Errors BLOC SCHEMA",t.errors),"JSON Schema error : "+t.errors[0].message+" ( Path : "+t.errors[0].instancePath+")";i&&i({newData:e})}else i&&i({newData:e})},newKeyOptions:o&&!d?o.getNewKeyOptions:void 0,defaultValue:o&&!d?o.getDefaultValue:null,restrictTypeSelection:!!o&&!d&&o.restrictTypeSelection})]})}let tb=Object.keys(Z.q).map(e=>Y.A.unCapitalize(e));tb.push("sideBySideBlocs"),tb.sort((e,t)=>e.localeCompare(t));let tj=["CONTENT","FOOTER","HEADER","HIDDEN","POPIN","HEADER-EDF","CONTENT-EDF","FOOTER-EDF","HEADER-SOWEE","CONTENT-SOWEE","FOOTER-SOWEE"],tf=["title","meta","link"],tT=e=>{let t,i,a,r,{objectType:n,items:l,onChange:o,currentPage:c}=e,m=e.existingObjectList??[],g="meta"===n,x=(0,Q.A)(),[y,b]=(0,L.useState)(!1),[j,f]=(0,L.useState)(null),[T,C]=(0,L.useState)(null),A=(0,L.useMemo)(()=>{let e={};return m.forEach(t=>{t?.id!=null&&(e[String(t.id)]=t)}),e},[m]),v=e=>{let{target:t}=e;f(e=>({...e,[t.name]:"checkbox"===t.type?t.checked:t.value}))};return(0,s.jsxs)(B.A,{variant:"outlined",sx:{p:2,borderRadius:2},children:[(0,s.jsxs)(F.A,{fullWidth:!0,maxWidth:"md",open:y,onClose:()=>b(!1),children:[(0,s.jsxs)(M.A,{children:[j?.index==="new"?"Cr\xe9er un ":"Modifier le "," ",g?"META Tag":"BLOC"]}),y&&(0,s.jsxs)(W.A,{children:[g&&(0,s.jsxs)(z.A,{children:[(0,s.jsx)(_.A,{variant:"subtitle2",sx:{mb:1,color:"text.secondary"},children:"Preview"}),(0,s.jsx)(d.A,{component:"pre",sx:{m:0,p:1.5,bgcolor:"background.default",borderRadius:1.5,border:1,borderColor:"divider",overflow:"auto",fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(t=j?.type||"meta",a=Object.keys(i=j?.attributes??{}).filter(e=>"HTML"!==e).map(e=>` ${e}="${i[e]}"`).join(""),(r=i.HTML)?`<${t}${a}>${r}</${t}>`:`<${t}${a}>`)}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("em",{children:'(L\'attribut "HTML" correspond au contenu HTML du tag)'}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]})]}),(0,s.jsxs)("form",{id:g?"editMetaForm":"editBlocForm",onSubmit:e=>{e.preventDefault(),(()=>{if(!j)return;if(g){let e={name:j.name,type:j.type,attributes:j.attributes??{}},t=[...l];"new"===j.index?t.push({idMeta:99999,idPage:c?.id,meta:e,hasChange:!0,state:{isNew:!0},orderWeight:t.length}):(t[j.index].meta=e,t[j.index].hasChange=!0,t[j.index].state={...t[j.index].state??{},isEdited:!0}),o(t),b(!1),f(null);return}let e={name:j.name,type:j.type,data:JSON.stringify(j.data??{})},t=[...l];if("new"===j.index){let i=-Date.now();t.push({id:`tmp-link-${Date.now()}`,idPage:c?.id,idBloc:i,orderWeight:t.length,position:j.position||"CONTENT",hasChange:!0,state:{isNew:!0},bloc:{id:i,...e,idCreate:0,idUpdate:0}})}else{let i=j.index;t[i].bloc={...t[i].bloc??{},...e},t[i].position=j.position||t[i].position||"CONTENT",t[i].hasChange=!0,t[i].state={...t[i].state??{},isEdited:!0}}o(t),b(!1),f(null)})()},children:[(0,s.jsx)(u.A,{autoFocus:!0,margin:"dense",id:"name",name:"name",label:"Nom technique",type:"text",fullWidth:!0,variant:"standard",value:j?.name??"",onChange:v}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Type:",(0,s.jsx)("br",{}),(0,s.jsx)(X.A,{required:!0,id:"type",name:"type",fullWidth:!0,value:j?.type??"",label:"Type",disabled:j?.index!="new"&&!g,onChange:v,children:(g?tf:tb).map(e=>(0,s.jsx)($.A,{value:e,children:e},e))}),g?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Attributs:",(0,s.jsx)("br",{}),(0,s.jsx)(t_,{type:"MetaTagAttributes",data:{...j.attributes},onUpdate:({newData:e})=>{f(t=>({...t,attributes:e??{}}))}})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)("p",{children:"Position"}),(0,s.jsx)(X.A,{id:"position",name:"position",fullWidth:!0,value:j?.position??"",label:"Position",onChange:v,children:tj.map(e=>(0,s.jsx)($.A,{value:e,children:e},e))}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Donn\xe9es (JSON): ",j.type,(0,s.jsx)("br",{}),(0,s.jsx)(t_,{type:j.type,data:{...j.data},onUpdate:({newData:e})=>{f(t=>({...t,data:e??{}}))}})]})]})]}),(0,s.jsxs)(R.A,{children:[(0,s.jsx)(h.A,{onClick:()=>b(!1),children:"Annuler"}),(0,s.jsx)(h.A,{type:"submit",form:g?"editMetaForm":"editBlocForm",children:"Valider"})]})]}),(0,s.jsxs)(d.A,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:2,mb:2,mt:2},children:[(0,s.jsx)(h.A,{variant:"contained",color:"primary",disableElevation:!0,startIcon:(0,s.jsx)(E.A,{}),onClick:()=>{f(g?{index:"new",name:"",type:"",attributes:{}}:{index:"new",name:"",type:"",position:"CONTENT",data:{}}),b(!0)},children:"Nouveau"}),(0,s.jsxs)(_.A,{variant:"body2",sx:{color:"text.secondary"},children:["Ajouter un ",g?"M\xe9ta Tag":"Bloc"," existant :"]}),(0,s.jsx)(p.A,{sx:{minWidth:360,maxWidth:"100%"},size:"small",options:m.map(e=>({...e,label:g?`${e.name||"NONAME"}`:`${e.type||""} - ${e.name||"NONAME"} - ${e.id}`})).sort((e,t)=>
1{let i=g?0:e.type.localeCompare(t.type);return 0==i?`${e.name||"NONAME"}`.localeCompare(`${t.name||"NONAME"}`):i}),getOptionLabel:e=>e?.label??"",isOptionEqualToValue:(e,t)=>e?.id===t?.id,renderInput:e=>(0,s.jsx)(u.A,{...e,label:g?"META TAG existants":"BLOCs existants"}),value:T,onChange:(e,t)=>C(t)}),T&&(0,s.jsx)(h.A,{onClick:()=>{if(!T)return;if(g){let e={idMeta:T.id,idPage:c?.id,hasChange:!0,state:{isLinked:!0},orderWeight:l.length+1,meta:{...T,id:T.id,attributes:{}}};o([...l,e]),C(null);return}let e={id:`new-link-${Date.now()}`,idPage:c?.id,idBloc:T.id,orderWeight:l.length,position:"CONTENT",hasChange:!0,state:{isLinked:!0},bloc:{...T,data:T.data}};o([...l,e]),C(null)},variant:"contained",color:"primary",disableElevation:!0,startIcon:(0,s.jsx)(S.A,{}),children:"Associer"})]}),(0,s.jsx)(P.JY,{onDragEnd:e=>{if(!e.destination)return;let t=((e,t,i)=>{let a=[...e],[s]=a.splice(t,1);return a.splice(i,0,s),a})(l,e.source.index,e.destination.index);t.forEach((e,t)=>{e&&(e.orderWeight=t,g||(e.hasChange=!0))}),o(t)},children:(0,s.jsx)(U.A,{component:B.A,variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:(0,s.jsxs)(H.A,{size:"small",children:[(0,s.jsx)(q.A,{children:(0,s.jsxs)(V.A,{sx:{bgcolor:"background.default"},children:[(0,s.jsx)(K.A,{sx:{fontWeight:700},children:g?"Type de tag":"Type de bloc"}),(0,s.jsx)(K.A,{sx:{fontWeight:700},children:g?"Contenu et attributs du M\xe9ta tag":"Donn\xe9es du bloc"}),(0,s.jsx)(K.A,{sx:{fontWeight:700,width:180},children:"Actions"})]})}),(0,s.jsx)(P.gL,{droppableId:g?"listMeta":"listBloc",isDropDisabled:g,children:e=>(0,s.jsxs)(G.A,{...e.droppableProps,ref:e.innerRef,sx:{p:1,bgcolor:"background.paper",minHeight:100},children:[l.map((e,t)=>{let i=g?e?.meta?.type??"":e?.bloc?.type??"",a=g?e?.meta?.name??"":e?.bloc?.name??"",r=g?`${e?.idMeta??"meta"}-${e?.idPage??"na"}-${t}`:`${e?.id??"link"}-${e?.idBloc??e?.bloc?.id??t}-${e?.idPage??"na"}`,n=g?e?.meta?.attributes??{}:null,c=g?"":(e=>{if(null==e)return"";if("string"==typeof e)try{let t=JSON.parse(e);return JSON.stringify(t,null,2)}catch{return e}try{return JSON.stringify(e,null,2)}catch{return String(e)}})(e?.bloc?.data);return(0,s.jsx)(P.sx,{draggableId:r,index:t,isDragDisabled:g,children:(r,p)=>{let u,h;return(0,s.jsxs)(V.A,{ref:r.innerRef,...r.draggableProps,...r.dragHandleProps,style:{...(u=p.isDragging,h=r.draggableProps.style,{userSelect:"none",padding:12,margin:"0 0 12px 0",borderRadius:12,border:`1px solid ${e?.hasChange?(0,J.X4)(x.palette.warning.main,.35):x.palette.divider}`,backgroundColor:u?(0,J.X4)(x.palette.success.light,.35):e?.state?.isDeleted?(0,J.X4)(x.palette.error.light,.25):e?.hasChange?(0,J.X4)(x.palette.warning.light,.25):x.palette.background.paper,boxShadow:u?x.shadows[2]:"none",...h}),border:e?.state?.isNew?`2px solid ${x.palette.info.main}`:void 0},children:[(0,s.jsx)(K.A,{style:{backgroundColor:(e=>{if(e){if(e.startsWith("HEADER"))return"#007bff52";if(e.startsWith("CONTENT"))return"#56ff0036";if(e.startsWith("FOOTER"))return"#a900ff1f";if(e.startsWith("HIDDEN"))return"#FFF"}})(e.position)},children:(0,s.jsxs)("div",{style:{fontFamily:"RubikRegular"},children:["[",e?.orderWeight??t,"]"," ",(0,s.jsxs)("strong",{children:["<",i,">"]})," ",(0,s.jsx)("br",{})," ",a,e.position&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("br",{}),`[${e.position}]`]})]})}),(0,s.jsx)(K.A,{children:g?(0,s.jsxs)("div",{children:[n?.HTML&&(0,s.jsx)("span",{children:n.HTML}),(!n?.HTML||n?.HTML&&Object.keys(n).length>1)&&(0,s.jsx)("ul",{children:Object.keys(n).filter(e=>"HTML"!==e).map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{children:e})," :"," ",n[e]]},e))})]}):(0,s.jsx)(d.A,{component:"pre",style:{fontSize:"0.75rem",backgroundColor:"#ededed"},sx:{m:0,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:240,overflow:"auto",fontFamily:"monospace",bgcolor:"background.default",borderRadius:1.5,border:1,borderColor:"divider",p:1},children:c})}),(0,s.jsx)(K.A,{children:(0,s.jsxs)("div",{children:[!e?.state?.isDeleted&&(0,s.jsx)("span",{title:g?"Modifier ce m\xe9ta tag":"Modifier ce bloc",style:{cursor:"pointer",marginRight:"10px"},onClick:()=>(e=>{let t=l[e];if(t){if(g){void 0===t.originalMeta&&(t.originalMeta={...t.meta??{}}),f({index:e,name:t?.meta?.name??"",type:t?.meta?.type??"",attributes:t?.meta?.attributes??{}}),b(!0);return}void 0===t.originalBloc&&(t.originalBloc={...t.bloc??{}},t.originalPosition=t.position),f({index:e,name:t?.bloc?.name??"",type:t?.bloc?.type??"",position:t?.position??"CONTENT",data:(e=>{if(null==e)return{};if("object"==typeof e)return e;if("string"!=typeof e)return{};try{return JSON.parse(e)}catch{return{}}})(t?.bloc?.data)}),b(!0)}})(t),children:(0,s.jsx)(I.A,{style:{fill:e?.state?.isEdited?"":"black"}})}),e?.state?.isNew!==!0&&!e?.state?.isDeleted&&(0,s.jsx)("span",{title:g?"DIssocier ce m\xe9ta tag de la page":"Dissocier ce bloc de la page",style:{cursor:"pointer"},onClick:()=>{let e=[...l];e[t].hasChange=!0,e[t].state={...e[t].state??{},isUnlinked:!0},o(e)},children:(0,s.jsx)(O.A,{style:{fill:e?.state?.isUnlinked?"":"black"}})}),e?.state?.isNew!==!0&&(e=>{if(e?.state?.isDeleted)return!1;if(g){let t=e?.idMeta??e?.meta?.id;return null!=t&&A[String(t)]?.associatedPages==1}let t=e?.idBloc??e?.bloc?.id;return null!=t&&A[String(t)]?.associatedPages==1})(e)&&(0,s.jsx)("span",{title:g?"Supprimer cette m\xe9ta":"Supprimer ce bloc",style:{cursor:"pointer",marginLeft:"20px"},onClick:()=>{let e=[...l];e[t].hasChange=!0,e[t].state={isDeleted:!0}
1,o(e)},children:(0,s.jsx)(D.A,{style:{fill:e?.state?.isDeleted?"":"black"}})}),e?.hasChange&&(0,s.jsx)("span",{title:"Annuler les modifications",style:{cursor:"pointer",marginLeft:"20px"},onClick:()=>{let e=[...l];g?e[t].originalMeta&&(e[t].meta=e[t].originalMeta):(e[t].originalBloc&&(e[t].bloc=e[t].originalBloc),void 0!==e[t].originalPosition&&(e[t].position=e[t].originalPosition)),e[t].hasChange=!1,delete e[t].state,o(e)},children:(0,s.jsx)(k.A,{style:{fill:"red"}})})]})})]})}},r)}),e.placeholder]})})]})})})]})};var tC=i(370281),tA=i(548506),tL=i.n(tA);function tv(e){let{children:t,value:i,index:a,...r}=e;return(0,s.jsx)("div",{role:"tabpanel",hidden:i!==a,id:`full-width-tabpanel-${a}`,"aria-labelledby":`full-width-tab-${a}`,...r,children:i===a&&(0,s.jsx)(d.A,{p:3,children:t})})}function tN(e){return{id:`full-width-tab-${e}`,"aria-controls":`full-width-tabpanel-${e}`,href:"#"+e,value:e}}let tw=e=>e?new Date(e).toLocaleString():"--",tP=({setSnackbar:e})=>{let[t,i]=(0,L.useState)({list:!0,pageData:!1}),[a,l]=(0,L.useState)(!1),[m,g]=(0,L.useState)(!1),[x,y]=(0,L.useState)(!0),[_,b]=(0,L.useState)([]),[j,f]=(0,L.useState)([]),[T,C]=(0,L.useState)([]),[A,v]=(0,L.useState)(null),[P,S]=(0,L.useState)(null),[k,E]=(0,L.useState)(null),[I,D]=(0,L.use
1State)([]),[O,B]=(0,L.useState)([]),F=e=>Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[],M=async e=>{i({list:!1,pageData:!0});let t=await N.A.query("/api/node/v1/private/contrib/get-page-data?id="+e);try{t.listMeta?.forEach(e=>{"string"==typeof e?.meta?.attributes&&(e.meta.attributes=JSON.parse(e.meta.attributes))})}catch{}E(t.editObjList),S(t),D(t.listMeta??[]),B(t.listBloc??[]),i({list:!1,pageData:!1})};(0,L.useEffect)(()=>{let e=async()=>{f(F(await N.A.query("/api/node/v1/private/contrib/existing-meta-list")))},t=async()=>{C(F(await N.A.query("/api/node/v1/private/contrib/existing-bloc-list?withData=true")))};(async()=>{let e=await N.A.query("/api/node/v1/private/object-models/getObjectModel?configType=static-page");e?.data?.length>0&&b(e.data),i({list:!1,pageData:!1})})(),e(),t()},[]),(0,L.useEffect)(()=>{null!=A?M(A.id):(S(null),E(null),D([]),B([]),i({list:!1,pageData:!1}))},[A]);let W=async()=>{if(!A)return;let t=O.filter(e=>e?.hasChange&&e.state?.isNew).map(e=>({actionName:"create",objectType:"bloc",objectData:{name:e.bloc.name,type:e.bloc.type,data:e.bloc.data},linkData:{idPage:e.idPage,orderWeight:e.orderWeight,position:e.position}})),a=O.filter(e=>e?.state?.isDeleted&&!e?.state?.isNew).map(e=>({actionName:"delete",objectType:"bloc",id:e.idBloc,objectData:{idUpdate:e.bloc.idUpdate}})),s=O.filter(e=>e?.state?.isUnlinked&&!e?.state?.isNew&&!e?.state?.isDeleted&&!!e?.id).map(e=>({actionName:"unlink",objectType:"bloc",id:e.idBloc,linkData:{id:e.id,idPage:e.idPage,idUpdate:e.idUpdateXBloc,idBloc:e.idBloc}})),r=O.filter(e=>e?.hasChange&&e.state?.isEdited&&!e.state?.isNew&&!e.state?.isDeleted&&!e.state?.isUnlinked).map(e=>({actionName:"update",objectType:"bloc",id:e.idBloc,objectData:{name:e.bloc.name,type:e.bloc.type,data:e.bloc.data,idUpdate:e.idUpdate},linkData:{idPage:e.idPage,idUpdate:e.idUpdateXBloc,orderWeight:e.orderWeight,position:e.position,idBloc:e.idBloc,id:e.id}})),n=O.filter(e=>e?.hasChange&&e.state?.isLinked).map(e=>({actionName:"link",objectType:"bloc",id:e.idBloc,linkData:{idPage:e.idPage,orderWeight:e.orderWeight,position:e.position}})),l=O.filter(e=>e?.hasChange&&!e.state?.isLinked&&!e.state?.isUnlinked&&!e.state?.isDeleted&&!e.state?.isNew&&!e.state?.isEdited).map(e=>({id:e.id,orderWeight:e.orderWeight,idUpdate:e.idUpdateXBloc})),o=l?.length>0?[{actionName:"move",objectType:"bloc",id:A.id,linkData:l}]:[],c=I.filter(e=>e?.hasChange&&e.state?.isNew).map(e=>({actionName:"create",objectType:"meta",objectData:{name:e.meta.name,attributes:e.meta.attributes,type:e.meta.type},linkData:{idPage:e.idPage,orderWeight:e.orderWeight}})),d=I.filter(e=>e?.hasChange&&e.state?.isLinked).map(e=>({actionName:"link",objectType:"meta",id:e.idMeta,linkData:{idPage:e.idPage,orderWeight:e.orderWeight}})),p=I.filter(e=>e?.state?.isUnlinked).map(e=>({actionName:"unlink",objectType:"meta",id:e.id,linkData:{id:e.id,idPage:e.idPage,idUpdate:e.idUpdate,idMeta:e.idMeta}})),u=I.filter(e=>e?.state?.isDeleted).map(e=>({actionName:"delete",objectType:"meta",id:e.idMeta,objectData:{name:e.meta.name,attributes:e.meta.attributes,idUpdate:e.meta.idUpdate}})),h=I.filter(e=>e?.hasChange&&e.state?.isEdited).map(e=>({actionName:"update",objectType:"meta",id:e.idMeta,objectData:{name:e.meta.name,attributes:e.meta.attributes,idUpdate:e.idUpdate},linkData:{idPage:e.idPage,idUpdate:e.idUpdate,idMeta:e.idMeta,orderWeight:e.orderWeight,id:e.id}}));try{i({list:!1,pageData:!0});let l=await N.A.post("/api/node/v1/private/contrib/action",{actions:[...o,...r,...n,...h,...t,...c,...u,...a,...p,...s,...d]}),m=!1;if(l?.resActions?.length>0)if(l.resActions.forEach(e=>{e.success||(m=!0)}),m){let t=l.resActions.find(e=>!e.success),i=t?.error?.cause,a="unknown-error";"string"==typeof i?a=i:i?.error?a=String(i.error):i&&(a=JSON.stringify(i)),e({severity:"error",children:"Une erreur est survenue lors de la sauvegarde. ("+a+")"})}else e({children:"Sauvegarde r\xe9ussie.",severity:"success"});m?i({list:!1,pageData:!1}):await M(A.id),await z()}catch(t){console.log("[CONTENT-CONTRIB] - error=",t),i({list:!1,pageData:!1}),e({severity:"error",children:"Une erreur est survenue lors de la sauvegarde."})}},z=async()=>
1{l(!0);let t=await N.A.post("/api/node/v1/private/contrib/clear-cache",{paths:[A.path]});if(t.success){let i=t.invalidation?.Status=="InProgress";if(e({severity:"success",children:"Cache nettoy\xe9"+(i?" ... Invalidation CloudFront en cours ...":"")}),i&&t.invalidation?.Id){let i;do i=await N.A.post("/api/node/v1/private/contrib/follow-invalidation",{invalidationId:t.invalidation.Id,maxWaitTime:25});while(i.invalidation?.Status!="Completed");e({severity:"success",children:"Invalidation CloudFront termin\xe9e"})}}else e({severity:"error",children:"Une erreur est survenue lors de la nettoyage du cache pour la page "+A.path});l(!1)};return t.list?(0,s.jsx)(w.aH,{}):(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{children:"Choisir la page \xe0 modifier :"}),(0,s.jsxs)(d.A,{className:tL()["bloc-align-left"],children:[(0,s.jsx)("div",{style:{marginRight:"24px"},children:(0,s.jsx)(p.A,{style:{border:"1px solid grey",borderRadius:"6px"},options:_.map(e=>({...e,label:e.name+(e.path?" - ("+e.path+")":""),labelHtml:"<strong>"+e.name+"</strong> "+(e.path?" - ("+e.path+")":"")})),value:A,isOptionEqualToValue:(e,t)=>e?.id===t?.id,sx:{width:600},disabled:t.pageData,renderInput:e=>(0,s.jsx)(u.A,{...e,disabled:t.pageData,label:"Page : ID, nom, URL"}),onChange:(e,t)=>
1{v(t)},renderOption:(e,t)=>{let{key:i,...a}=e;return(0,s.jsx)(d.A,{component:"li",...a,dangerouslySetInnerHTML:{__html:t.labelHtml}},i)}})}),P&&(0,s.jsxs)("div",{children:[(0,s.jsx)(h.A,{onClick:W,variant:"contained",color:"success",disabled:I.filter(e=>e?.hasChange).length+O.filter(e=>e?.hasChange).length===0,loading:t.pageData,loadingPosition:"start",disableElevation:!0,startIcon:(0,s.jsx)(n.A,{}),children:"ENREGISTRER"}),"\xa0\xa0\xa0",(0,s.jsx)(h.A,{onClick:z,loading:a,loadingPosition:"start",variant:"contained",color:"success",disableElevation:!0,startIcon:(0,s.jsx)(r.A,{}),children:"CLEAR Cache"})]})]}),(0,s.jsx)("hr",{}),t.pageData?(0,s.jsx)(w.aH,{}):(0,s.jsx)("div",{children:P&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(d.A,{sx:{width:"100%"},style:{marginTop:"32px"},children:[(0,s.jsxs)("h4",{children:["Page : ",P.name]}),(0,s.jsxs)("p",{children:["URL :"," ",(0,s.jsx)("a",{href:P.path,target:"_blank",rel:"noopener noreferrer",children:P.path})]}),(0,s.jsxs)("p",{children:["Page publi\xe9e : ",P.isPublished?"Oui":"Non"]}),(0,s.jsxs)("p",{children:["Page dans le sitemap XML : ",P.isInSitemap?"Oui":"Non"]}),(0,s.jsxs)("p",{children:["Date de Cr\xe9ation : ",tw(k?.[P.idCreate]?.date)]}),(0,s.jsxs)("p",{children:["Date de Modification : ",tw(k?.[P.idUpdate]?.date)]})]}),(0,s.jsx)("hr",{}),(0,s.jsxs)(d.A,{sx:{width:"100%"},style:{marginTop:"32px"},children:[(0,s.jsxs)("h4",{onClick:()=>{g(!m)},style:{cursor:"pointer"},children:[(0,s.jsxs)("span",{children:[m?(0,s.jsx)(o.A,{style:{fontSize:"42px",marginBottom:"-12px"}}):(0,s.jsx)(c.A,{style:{fontSize:"42px",marginBottom:"-12px"}})," "]}),"META Tags :"]}),(0,s.jsx)("div",{style:{display:"block",height:m?"auto":"0",overflow:"hidden"},children:(0,s.jsx)(tT,{objectType:"meta",items:I,onChange:D,currentPage:A,existingObjectList:j})})]}),(0,s.jsx)("hr",{}),(0,s.jsxs)(d.A,{sx:{width:"100%"},style:{marginTop:"32px"},children:[(0,s.jsxs)("h4",{onClick:()=>{y(!x)},style:{cursor:"pointer"},children:[(0,s.jsxs)("span",{children:[x?(0,s.jsx)(o.A,{style:{fontSize:"42px",marginBottom:"-12px"}}):(0,s.jsx)(c.A,{style:{fontSize:"42px",marginBottom:"-12px"}})," "]}),"BLOCs :"," "]}),(0,s.jsx)("div",{style:{display:"block",height:x?"auto":"0",overflow:"hidden"},children:(0,s.jsx)(tT,{objectType:"bloc",items:O,onChange:B,currentPage:A,existingObjectList:T})})]})]})})]})},tS=(0,a.A)(()=>{let[e,t]=(0,L.useState)(null),i=()=>
1t(null),[a,o]=(0,L.useState)(!1),c=(0,L.useRef)(null),[d,p]=(0,L.useState)([]),u={pagesList:0,pagesBlocs:1,tools:2},w=(e,t=!0,i=!1)=>{let a="string"==typeof e&&e.includes("/"),s=e;if(a){let t=e.split("/");s=t.shift()??"",i&&t.toString()!=d.toString()&&p(t)}else i&&""!=d.toString()&&p([]);let r="number"==typeof s?s:Number.parseInt(String(s),10);if(!Number.isNaN(r))return r;if(t){let e=u[String(s)];return"number"==typeof e?e:0}return String(s)},[P,S]=(0,L.useState)(()=>""!==window.location.hash?w(window.location.hash.replace("#",""),!1,!0):0);(0,L.useEffect)(()=>{let e=()=>{S(""!==window.location.hash?w(window.location.hash.replace("#",""),!1,!0):0)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[d]);let k=async e=>{try{if(!e.target.files||e.target.files.length<1)throw Error("No files provided.");let t=e.target.files[0];if(!t)throw Error("No file provided.");let i=new FormData;if(i.append("file",t),confirm("ATTENTION, cet import va \xe9craser tout le contenu des pages / blocs.")){if(o(!0),!(await N.A.fetch("/api/node/v1/private/contrib/import",i,"POST")).success)throw Error("Import failed..");window.alert("Import r\xe9ussi..")}}catch(t){let e=await v.A.formatError(t);window.alert(e.message||"Erreur inconnue")}finally{o(!1),c.current&&(c.current.value="")}},E=async()=>{let e=await N.A.get("/api/node/v1/private/contrib/export");e.error?window.alert("Une erreur est survenue.."):I("export_contrib[prod]["+new Date().toLocaleDateString("fr-FR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"].sql",e)},I=(e,t)=>{let i=new Blob([t],{type:"application/sql"}),a=document.createElement("a");a.download=e,a.href=window.URL.createObjectURL(i),a.dataset.downloadurl=["application/sql",a.download,a.href].join(":");let s=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});a.dispatchEvent(s),a.remove()},[D,O]=(0,L.useState)(!1),B=async()=>{O(!0);let e=await N.A.post("/api/node/v1/private/contrib/clear-cache",{allPaths:!0});if(e.success){let i=e.invalidation?.Status=="InProgress";if(t({severity:"success",children:"Cache nettoy\xe9"+(i?" ... Invalidation CloudFront en cours ...":"")}),i&&e.invalidation?.Id){let i;do console.log("Contrib Clear Cache resFollowInvalidation=",i=await N.A.post("/api/node/v1/private/contrib/follow-invalidation",{invalidationId:e.invalidation.Id,maxWaitTime:25}));while(i.invalidation?.Status!="Completed");t({severity:"success",children:"Invalidation CloudFront termin\xe9e"})}}else t({severity:"error",children:"Une erreur est survenue lors de la nettoyage du cache"});O(!1)};return(0,s.jsxs)("div",{className:tL().root,children:[(0,s.jsx)(m.A,{position:"static",color:"default",children:(0,s.jsxs)(g.A,{value:P,onChange:(e,t)=>
1{S(t)},indicatorColor:"primary",textColor:"primary",variant:"fullWidth","aria-label":"full width tabs",children:[(0,s.jsx)(x.A,{label:"Pages - liste",...tN("pagesList")}),(0,s.jsx)(x.A,{label:"Pages - blocs et contenu",...tN("pagesBlocs")}),(0,s.jsx)(x.A,{label:"Outils",...tN("tools")})]})}),(0,s.jsxs)("div",{className:tL().tabContainer,children:[(0,s.jsx)(tv,{value:P,index:"pagesList",children:(0,s.jsx)(tC.A,{configType:"static-page"})}),(0,s.jsx)(tv,{value:P,index:"pagesBlocs",children:(0,s.jsx)(tP,{setSnackbar:t})}),(0,s.jsxs)(tv,{value:P,index:"tools",children:["Outils",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsxs)(y.A,{direction:"row",spacing:3,children:[(0,s.jsxs)(y.A,{direction:"column",spacing:3,width:"50%",children:[(0,s.jsx)(_.A,{variant:"h4",children:"Clear Cache Full"}),(0,s.jsx)(b.A,{className:"secondary-divider"}),(0,s.jsx)(j.A,{variant:"outlined",children:(0,s.jsxs)(f.A,{children:["Nettoyage complet du cache des pages contribu\xe9es",(0,s.jsx)(h.A,{style:{marginRight:"32px"},onClick:B,variant:"contained",color:"primary",disableElevation:!0,loading:D,loadingPosition:"start",startIcon:(0,s.jsx)(r.A,{}),children:"Full CLear"})]})})]}),(0,s.jsx)(y.A,{direction:"row",spacing:3,width:"50%",children:(0,s.jsxs)(y.A,{direction:"column",spacing:3,width:500,children:[(0,s.jsx)(_.A,{variant:"h4",children:"Nouvelle configuration"}),(0,s.jsx)(b.A,{className:"secondary-divider"}),(0,s.jsx)(j.A,{variant:"outlined",children:(0,s.jsxs)(f.A,{children:["Exporter (donn\xe9es)",(0,s.jsx)(h.A,{style:{marginRight:"32px"},onClick:E,variant:"contained",color:"primary",disableElevation:!0,startIcon:(0,s.jsx)(n.A,{}),children:"Exporter"})]})}),(0,s.jsx)(j.A,{variant:"outlined",children:(0,s.jsxs)(f.A,{children:["Importer (donn\xe9es)",(0,s.jsxs)(h.A,{style:{marginRight:"32px"},onClick:()=>c.current?.click(),variant:"contained",color:"primary",disableElevation:!0,startIcon:(0,s.jsx)(l.A,{}),disabled:a,children:["Importer ",a&&(0,s.jsx)(s.Fragment,{children:"en cours.."})]}),a&&(0,s.jsx)(T.A,{size:20}),(0,s.jsx)("input",{ref:c,type:"file",accept:".sql,application/sql",hidden:!0,onChange:k})]})})]})})]})]})]}),!!e&&(0,s.jsx)(A.A,{open:!0,anchorOrigin:{vertical:"top",horizontal:"center"},onClose:i,autoHideDuration:6e3,children:(0,s.jsx)(C.A,{...e,onClose:i})})]})})},851171:(e,t,i)=>{"use strict";i.d(t,{A:()=>d});var a=i(637876),s=i(431174),r=i(162753),n=i(15039),l=i.n(n),o=i(548506),c=i.n(o);let d=({overrideClassname:e=""})=>(0,a.jsx)(s.A,{className:l()(c().backdrop,e),open:!0,children:(0,a.jsx)(r.A,{color:"inherit"})})}},e=>{e.O(0,[4955,8513,9759,8987,2217,2735,169,4828,8893,2376,4663,424,7985,8230,4e3,5524,4079,6649,5851,6134,9420,7638,9629,1237,8381,3501,636,6593,8792],()=>e(e.s=285718)),_N_E=e.O()}]);

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.