import{f as D,o as l,c as _,J as ce,a as i,b as p,w as g,v as E,l as U,K as I,G as L,t as k,k as w,F as le,y as de,d as V,r as ue,H as pe,a2 as _e,m as z,j as Q,s as Z,N as c,O as d,aN as f,P as x,aU as q,aV as me,aW as fe,L as he,S as N}from"./entry.73954258.js";import{_ as we}from"./dw-dropdown-icon.33caaea3.js";import{_ as G}from"./dw-btn.vue.83a377e8.js";import{u as ge,a as ve,_ as ye}from"./use-popper.ed309c92.js";import{R as Ce,h as be,M as ke}from"./menu.cda0c2dd.js";import{_ as xe}from"./dw-input.24a5b0f4.js";import{_ as K}from"./_plugin-vue_export-helper.c27b6911.js";import{u as j}from"./product-filters-store.d68e7567.js";import{r as $e}from"./XIcon.1220cd7f.js";import{c as J,w as X}from"./woodTypes.a45b542c.js";import{A as u}from"./advert.a20d7b8d.js";import{d as Se}from"./user.79b0f166.js";const De=i("path",{d:"M12.5 23.75L3.75 15M3.75 15L12.5 6.25M3.75 15L26.25 15",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},null,-1),Be=[De],Oe=D({__name:"dw-arrow-back-icon",props:{flipX:{type:Boolean},disabled:{type:Boolean}},setup(s){return(t,o)=>(l(),_("svg",{style:ce({transform:t.flipX?"scale(-1,1)":void 0}),fill:"none",height:"30",viewBox:"0 0 30 30",width:"30",xmlns:"http://www.w3.org/2000/svg"},Be,4))}}),Te={fill:"none","stroke-width":"1",viewBox:"0 0 14 12",xmlns:"http://www.w3.org/2000/svg"},Ie=i("path",{d:"M1.39961 0.400391C0.957782 0.400391 0.599609 0.758563 0.599609 1.20039C0.599609 1.64222 0.957782 2.00039 1.39961 2.00039H10.1996C10.6414 2.00039 10.9996 1.64222 10.9996 1.20039C10.9996 0.758563 10.6414 0.400391 10.1996 0.400391H1.39961Z",fill:"currentColor"},null,-1),Ee=i("path",{d:"M1.39961 3.60039C0.957782 3.60039 0.599609 3.95856 0.599609 4.40039C0.599609 4.84222 0.957782 5.20039 1.39961 5.20039H6.99961C7.44144 5.20039 7.79961 4.84222 7.79961 4.40039C7.79961 3.95856 7.44144 3.60039 6.99961 3.60039H1.39961Z",fill:"currentColor"},null,-1),Fe=i("path",{d:"M1.39961 6.80039C0.957782 6.80039 0.599609 7.15856 0.599609 7.60039C0.599609 8.04222 0.957782 8.40039 1.39961 8.40039H4.59961C5.04144 8.40039 5.39961 8.04222 5.39961 7.60039C5.39961 7.15856 5.04144 6.80039 4.59961 6.80039H1.39961Z",fill:"currentColor"},null,-1),ze=["transform"],Me=D({__name:"sort-order-icon",props:{flipArrow:{type:Boolean}},setup(s){return(t,o)=>(l(),_("svg",Te,[Ie,Ee,Fe,i("path",{transform:t.flipArrow?"rotate(180)":void 0,d:"M10.9996 4.40039C10.9996 3.95856 10.6414 3.60039 10.1996 3.60039C9.75778 3.60039 9.39961 3.95856 9.39961 4.40039L9.39961 8.86902L8.36529 7.83471C8.05288 7.52229 7.54634 7.52229 7.23392 7.83471C6.9215 8.14712 6.9215 8.65366 7.23392 8.96608L9.63392 11.3661C9.78395 11.5161 9.98744 11.6004 10.1996 11.6004C10.4118 11.6004 10.6153 11.5161 10.7653 11.3661L13.1653 8.96608C13.4777 8.65366 13.4777 8.14713 13.1653 7.83471C12.8529 7.52229 12.3463 7.52229 12.0339 7.83471L10.9996 8.86902L10.9996 4.40039Z",fill:"currentColor","transform-origin":"10 8"},null,8,ze)]))}}),Pe={class:"flex-1"},Le={class:"h-full mr-1"},Re=D({__name:"dw-dropdown-button",props:{dark:{type:Boolean,default:!1},slim:{type:Boolean}},setup(s){return(t,o)=>{const e=we,n=G;return l(),_("div",null,[p(n,{class:I([{"text-black":!t.dark,"text-white":t.dark},"w-full text-base px-0"]),btnStyle:"transparent",size:"sm"},{default:g(()=>[i("div",Pe,[E(t.$slots,"content")]),i("div",Le,[t.$slots.icon?E(t.$slots,"icon",{key:0}):(l(),U(e,{key:1,class:"text-shimmer h-full"}))])]),_:3},8,["class"])])}}}),We=D({__name:"dw-dropdown-scaffold",props:{sameWidthAsTrigger:{type:Boolean,default:!0},placement:{default:"bottom-end"},strategy:{default:"absolute"}},setup(s){const t=s,o={name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:a})=>{a.styles.popper.width=`${a.rects.reference.width}px`},effect:({state:a})=>{a.elements.popper.style.width=`${a.elements.reference.offsetWidth}px`}},e={placement:t.placement,strategy:t.strategy,modifiers:[{name:"offset",options:{offset:[0,0]}},{name:"flip",enabled:!1}]};t.sameWidthAsTrigger&&e.modifiers.push(o);const[n,r]=ge(e);return(a,$)=>{const S=Ce,y=be,h=ve,O=ke;return l(),U(O,{as:"div"},{default:g(()=>[p(S,{ref_key:"trigger",ref:n,as:"div",class:"w-full"},{default:g(()=>[E(a.$slots,"trigger")]),_:3},512),i("div",{ref_key:"container",ref:r,class:"z-10"},[p(h,null,{default:g(()=>[p(y,{as:"div",class:"rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"},{default:g(()=>[E(a.$slots,"items")]),_:3})]),_:3})],512)]),_:3})}}}),Ae={class:"flex"},Ne={class:"flex pl-2 dropdown h-full"},je={class:"flex items-center justify-center"},Ue=D({__name:"products-filtering-order-dropdown",props:{placement:{},sortBy:{},sortDesc:{type:Boolean},slim:{type:Boolean}},emits:["update:sort-by","update:sort-desc"],setup(s){const t=s,o=[{key:"createdAt",value:"PUBLISHED_AT"},{key:"pricePerUnit",value:"PRICE_PER_UNIT"},{key:"priceTotal",value:"PRICE_TOTAL"},{key:"distance",value:"DISTANCE"}],e=L(()=>{var n;return(n=o.find(r=>r.value===t.sortBy))==null?void 0:n.key});return(n,r)=>{const a=Me,$=Re,S=ye,y=We;return l(),_("div",{class:I(n.slim?"h-8":"h-[38px]")},[i("div",Ae,[i("div",{class:I(["flex items-center justify-center w-[34px] bg-white border border-gray-300 rounded-l-md hover:bg-white-hovered hover:cursor-pointer px-1",n.slim?"h-8":"h-[38px]"]),onClick:r[0]||(r[0]=h=>n.$emit("update:sort-desc",!n.sortDesc))},[p(a,{flipArrow:n.sortDesc,class:"text-dark-grey ml-0.5 mt-0.5 w-5 h-5"},null,8,["flipArrow"])],2),p(y,{placement:n.placement,"same-width-as-trigger":!1},{trigger:g(()=>[p($,{class:I(["bg-white rounded-r-md border-r border-b border-t border-gray-300 pr-1",n.slim?"h-8":"h-[38px]"]),dark:""},{content:g(()=>[i("div",Ne,[i("div",je,[i("span",{class:I(["leading-5 font-medium text-dark mr-3",n.slim?"text-xs":"text-sm"])},k(n.$t("products.sorting."+w(e))),3)])])]),_:1},8,["class"])]),items:g(()=>[(l(),_(le,null,de(o,h=>p(S,{key:h.key,onClick:O=>n.$emit("update:sort-by",h.value),slim:n.slim},{default:g(()=>[V(k(n.$t("products.sorting."+h.key)),1)]),_:2},1032,["onClick","slim"])),64))]),_:1},8,["placement"])])],2)}}}),He={key:0},Ve=D({__name:"h1-seo-header",props:{showMobile:{type:Boolean}},setup(s){const t=ue(!1);pe(()=>{window.addEventListener("resize",o,{passive:!0}),o()}),_e(()=>{window.removeEventListener("resize",o)});function o(){t.value=window.innerWidth<=768}return(e,n)=>e.showMobile==w(t)?(l(),_("h1",He,[E(e.$slots,"default")])):z("",!0)}}),Qe={},Ze={width:"800px",height:"800px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",fill:"none"},qe=i("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M17 5L8 15l-5-4"},null,-1),Ge=[qe];function Ke(s,t){return l(),_("svg",Ze,Ge)}const Je=K(Qe,[["render",Ke]]),Xe={},Ye={width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},et=i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:`M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM15 9C15 
10.6569 13.6569 12 12 12C10.3431 12 9 10.6569 9 9C9 7.34315 10.3431 6 12 6C13.6569 6 15 7.34315 15 9ZM12 20.5C13.784 20.5 15.4397 19.9504 16.8069 19.0112C17.4108 18.5964 
17.6688 17.8062 17.3178 17.1632C16.59 15.8303 15.0902 15 11.9999 15C8.90969 15 7.40997 15.8302 6.68214 17.1632C6.33105 17.8062 6.5891 18.5963 7.19296 19.0111C8.56018 19.9503 
10.2159 20.5 12 20.5Z`,fill:"currentColor"},null,-1),tt=[et];function ot(s,t){return l(),_("svg",Ye,tt)}const st=K(Xe,[["render",ot]]),nt={class:"mx-1 h-40 bg-white mb-3 rounded p-4 shadow"},rt={class:"flex items-center"},it={class:"text-sm font-semibold text-dark"},at={class:"absolute md:top-5 top-[12rem] md:right-3 right-4 h-9 w-9 flex justify-center items-center hover:bg-dark text-dark hover:text-white rounded cursor-pointer"},ct=D({__name:"public-user-profile",props:{userData:{}},setup(s){const t=j(),o=Q(),{queryParams:e}=Z(j());function n(){t.userId=void 0,o.push({name:"products",query:e.value})}return(r,a)=>{var S,y,h,O,P;const $=st;return l(),_("div",nt,[i("div",rt,[p($,{class:"h-32 w-32 bg-shimmer text-white rounded-full mr-8"}),i("div",it,[i("div",null,k((S=r.userData)==null?void 0:S.companyName),1),i("div",null,k((y=r.userData)==null?void 0:y.firstname)+" "+k((h=r.userData)==null?void 0:h.lastname),1),i("div",null,k((O=r.userData)==null?void 0:O.postalCode)+" "+k((P=r.userData)==null?void 0:P.city),1)]),i("div",at,[p(w($e),{class:"w-8 h-8",onClick:n})])])])}}}),lt=20;function dt(){return{parseQueryToFilters:pt}}function Gt(){return{parseQueryToText:ut}}function ut(s,t,o){let e="";const n=Y(s,t),r=q(n);return r.searchTerm!=null&&r.searchTerm!=null&&r.searchTerm!=""&&(e+='"'+r.searchTerm+'"'),e!=""&&r.category!=""&&(e+=" in "),r.category!=null&&r.category!=null&&r.category!=""?e+=o.t("category."+r.category.toLowerCase()):r.searchTerm!=null&&r.searchTerm!=null&&r.searchTerm!=""&&(e+="allen Kategorien"),t.includes("holzbrett")&&(e=e.replace("Schnittholz","Holzbrett")),t.includes("kantholz")&&(e=e.replace("Schnittholz","Kantholz")),t.includes("faserholz")&&(e=e.replace("Rundholz","Faserholz")),t.includes("kaminholz")&&(e=e.replace("Brennholz","Kaminholz")),t.includes("ofenholz")&&(e=e.replace("Brennholz","Ofenholz")),t.includes("lieferung")&&(e+=" Lieferung"),t.includes("zustellung")&&(e+=" Zustellung"),J.forEach(a=>{t.includes(a[1])&&(e+=" "+a[0])}),X.forEach(a=>{(t.includes(a[1])||t.includes(a[2]))&&(e+=" "+a[0])}),e==""?"Holz":e}function pt(s,t){var a;const o=Y(s,t),e=q(o),n=me(o),r=fe(o);return e.size=lt,e.sorting=Object.values(n).filter(Boolean).length>0?n:void 0,e.sorting=$t(e.sorting,t),e.categoryData=(((a=e.category)==null?void 0:a.length)||0)>0?r:void 0,e.categoryData=xt(e.categoryData,t),e.priceOnRequest=e.priceOnRequest!==!1,e}function Y(s,t){let o=b;switch(s=kt(s,t),s==null?void 0:s.category){case u.WOOD_LOG:o=b.concat(bt);break;case u.SAWN_WOOD:o=b.concat(yt);break;case u.FURNACE_WOOD:o=b.concat(gt);break;case u.WOOD_CHIPS:o=b.concat(Ct);break;case u.PELLET:o=b.concat(vt);break;case u.FOREST_WOOD:o=b.concat(wt);break;case u.DIVERSE:o=b.concat(ht);break;case u.COMPANY_SERVICE:o=b.concat(ft);break}return o.cast(s,{stripUnknown:!0})}const b=c({searchTerm:d().optional(),category:d().optional(),page:f().positive().optional(),pricingType:d().optional(),priceMinInCents:f().positive().optional(),priceMaxInCents:f().positive().optional(),priceOnRequest:x().optional(),sortBy:d().optional(),sortDesc:x().optional(),postalCode:d().optional(),userId:d().optional()}),M=c({woodTypeId:d().optional()}),R=c({lengthMin:f().positive().optional(),lengthMax:f().positive().optional()}),W=c({diameterMin:f().positive().optional(),diameterMax:f().positive().optional()}),T=c({quantityMin:f().positive().optional(),quantityMax:f().positive().optional()}),B=c({pefcCertified:x().optional()}),F=c({countryCodeOfOrigin:d().optional()}),_t=c({isFromTrunkSale:x().optional()}),mt=c({isForProcessing:x().optional()}),H=c({deliveryIsPossible:x().optional()}),ee=c({blowInIsPossible:x().optional()}),ft=c({categoryId:d().optional()}).concat(B),ht=c().concat(M).concat(R).concat(W).concat(T).concat(B).concat(F),wt=c().concat(M).concat(W).concat(T).concat(_t).concat(mt).concat(B),gt=c({dryingStateId:d().optional()}).concat(M).concat(R).concat(W).concat(T).concat(B).concat(F).concat(H),vt=c({pelletQualityType:d().optional(),dinPlusCertified:x().optional(),enPlusCertified:x().optional()}).concat(T).concat(B).concat(F).concat(H).concat(ee),yt=c({widthMin:f().positive().optional(),widthMax:f().positive().optional(),thicknessMin:f().positive().optional(),thicknessMax:f().positive().optional()}).concat(M).concat(R).concat(T).concat(B).concat(F),Ct=c({woodChipsWoodTypeId:d().optional(),woodChipsDryingStateId:d().optional(),ashId:d().optional(),fineFractionId:d().optional(),particleSizeId:d().optional(),moistureContentId:d().optional(),rawMaterialGroupId:d().optional()}).concat(T).concat(B).concat(F).concat(H).concat(ee),bt=c().concat(M).concat(R).concat(W).concat(T).concat(F).concat(B);function kt(s,t){let o=s;var e=t.split("?").at(0);return e==null?s:((e.includes("brennholz")||e.includes("ofenholz")||e.includes("kammergetrocknet")||e.includes("scheit")||e.includes("kamin"))&&(o.category=u.FURNACE_WOOD),(e.includes("stamm")||e.includes("faserholz")||e.includes("rundholz"))&&(o.category=u.WOOD_LOG),(e.includes("brett")||e.includes("schnitt")||e.includes("pfosten")||e.includes("kantholz"))&&(o.category=u.SAWN_WOOD),e.includes("hack")&&(o.category=u.WOOD_CHIPS),e.includes("pellets")&&(o.category=u.PELLET),e.includes("stehendes-holz")&&(o.category=u.FOREST_WOOD),e.includes("holzprodukt")&&(o.category=u.DIVERSE),e.includes("dienstleistung")&&(o.category=u.COMPANY_SERVICE),(e.includes("zustellung")||e.includes("lieferung"))&&(o.deliveryIsPossible=!0),o)}function xt(s,t){let o=s;return o==null?s:(X.forEach(e=>{t.includes(e[1])&&(o.woodTypeId=e[2])}),o)}function $t(s,t){let o=s??{};return J.forEach(e=>{t.includes(e[1])&&(o.postalCode=e[2],o.sortBy="DISTANCE")}),o}const St={key:0,class:"flex justify-between items-center w-full"},Dt={class:"flex flex-col justify-center max-w-[calc(100%-140px)] max-h-8"},Bt={showMobile:!0,class:"text-xs leading-4 font-medium tracking-wider uppercase overflow-hidden"},Ot={key:1,class:"flex justify-between w-full"},Tt={class:"flex flex-col content-center my-2 space-y-2 w-full px-1"},It={key:0,class:"flex justify-between"},Et={class:"flex justify-end"},Ft={class:"flex justify-between h-8"},zt={class:"flex flex-col justify-center max-w-[calc(100%-140px)] max-h-8"},Mt={key:0,class:"flex justify-end space-x-1 h-8"},Pt={key:1,class:"h-8"},Kt=D({__name:"mobile-header-bar",props:{title:{},showBackButton:{type:Boolean},defaultBackRouteName:{},showDistanceFiler:{type:Boolean}},setup(s){const{sortBy:t,sortDesc:o,postalCode:e}=Z(j()),n=L({get(){return t==null?void 0:t.value},set(v){t&&(t.value=v)}}),r=s,a=Q(),$=he(),{parseQueryToFilters:S}=dt(),y=L(()=>S($.query,$.fullPath)),h=Se(y.value.userId),{data:O}=h,P=L(()=>r.showBackButton==!0?"h-[50px]":"");function A(){t&&t.value!=="DISTANCE"&&e&&(e.value=void 0),a.push({name:"products",query:{...$.query,postalCode:e==null?void 0:e.value,sortBy:t==null?void 0:t.value,sortDesc:o!=null&&o.value?"true":void 0}})}return(v,m)=>{const te=Oe,oe=Ue,se=Ve,ne=xe,re=Je,ie=G,ae=ct;return l(),_("div",{class:I(["text-gray-500 bg-gray-50 w-full border-b border-gray-200 flex",w(P)])},[v.showBackButton?(l(),_("div",St,[i("div",{onClick:m[0]||(m[0]=C=>w(a).back())},[p(te,{class:"w-[25px] h-[25px] text-gray-900"})]),i("div",Dt,[i("div",Bt,k(v.title),1)])])):z("",!0),v.showBackButton?z("",!0):(l(),_("div",Ot,[i("div",Tt,[v.showDistanceFiler?(l(),_("div",It,[E(v.$slots,"left"),i("div",Et,[p(oe,{"sort-by":w(n),"onUpdate:sortBy":[m[1]||(m[1]=C=>N(n)?n.value=C:null),m[3]||(m[3]=C=>A())],"sort-desc":w(o),"onUpdate:sortDesc":[m[2]||(m[2]=C=>N(o)?o.value=C:null),m[4]||(m[4]=C=>A())],slim:!0},null,8,["sort-by","sort-desc"])])])):z("",!0),i("div",Ft,[i("div",zt,[p(se,{showMobile:!0,class:"text-xs leading-4 font-medium tracking-wider uppercase overflow-hidden"},{default:g(()=>[V(k(v.title),1)]),_:1})]),w(t)==="DISTANCE"&&!v.showBackButton&&v.showDistanceFiler?(l(),_("div",Mt,[p(ne,{modelValue:w(e),"onUpdate:modelValue":m[5]||(m[5]=C=>N(e)?e.value=C:null),class:"w-20 h-8",placeholder:"PLZ",slim:!0},null,8,["modelValue"]),p(ie,{onClick:m[6]||(m[6]=C=>A()),icon:!0,size:"sm"},{default:g(()=>[p(re,{class:"w-6 h-6"})]),_:1})])):(l(),_("div",Pt))]),w(y).userId!=null?(l(),U(ae,{key:1,userData:w(O)},null,8,["userData"])):z("",!0)])]))],2)}}});export{lt as P,Kt as _,Oe as a,Re as b,We as c,Je as d,Ue as e,ct as f,Ve as g,Gt as h,dt as u};
