1import{R as e}from"./hobbii-user-59Q2brLQ.min.js";import{g as r}from"./hobbii-helpers-Cv_925bZ.min.js";import{l as a,r as t,u as o,i as s}from"./hobbii-country-switcher-BNm3Hsht.min.js";const n=r=>{switch(r){case"love":return e.Love;case"in_love":return e.InLove;case"cool":return e.Cool;case"haha":return e.Haha;case"smile":return e.Smile;case"wow":return e.Wow}return null},i=e=>{let r=0;const a=[];for(const[t,o]of Object.entries(e))"__typename"!==t&&"number"==typeof o&&o>0&&(r+=o,a.push(t));return{count:r,types:a}},m=(e,r)=>{const a=[];for(const[t,o]of Object.entries(e))"__typename"!==t&&"number"==typeof o&&o>0&&a.push({type:t,reactions:r.filter((e=>e.type===t))});return a},l=a=>{const t=(r=>{switch(r){case"love":case e.Love:return"love";case"in_love":case e.InLove:return"in_love";case"cool":case e.Cool:return"cool";case"haha":case e.Haha:return"haha";case"smile":case e.Smile:return"smile";case"wow":case e.Wow:return"wow"}return null})(a.label);return t&&a.author?{type:t,user:{name:a.author.display_name,avatar:a.author.avatar_url,profileUrl:r(a.author)}}:null},u=()=>{const e=s("profile"),r=s("initLogin");if(!e)throw new Error('Community: "profile" not provided.');if(!r)throw new Error('Community: "initLogin" not provided.');return{profile:e,initLogin:r}},c=(e=null,r={})=>{const{t:s}=a(),n=t(e?(e=>{var r;return{__type:"update",body:null!=(r=e.body)?r:"",images:e.images?[...e.images]:[]}})(o(e)):{__type:"new",body:"",images:[]}),i=t({}),m=()=>(delete i.body,r.maxMessageLength&&n.body.length>r.maxMessageLength&&(i.body=s("community.shared.errors.text_length_limit_exceeded",{above:n.body.length-r.maxMessageLength})),!i.body),l=()=>(delete i.images,r.minImages&&n.images.length<r.minImages?i.images=s("community.shared.errors.min_images_not_reached",r.minImages):r.maxImages&&n.images.length>r.maxImages&&(i.images=s("community.shared.errors.text_length_limit_exceeded",{above:n.images.length-r.maxImages})),!i.images);return{contentModel:n,errors:i,reset:()=>{n.body="",n.images=[]},validateAll:()=>{const e=m(),r=l();return e&&r},validateBody:m,validateImages:l}};export{c as a,l as b,n as f,m as g,i as r,u}; 2//# sourceMappingURL=hobbii-composables-CAq0cfOr.min.js.map
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.