"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("react");exports.default=o=>{let{width:l,position:s}=o??{},p=e.makeStyleResponsive("w",l),a=e.usePageStore(e=>"interaction"===e.sidebarMode),b=e.useCurrentDevice(),d=(e,t)=>({[`--left${t}`]:"top"==e?"0":"50%",[`--t${t}`]:"top"==e?"unset":"translateX(-50%)"}),i=t.useMemo(()=>({...d(s?.desktop,""),...d(s?.tablet??s?.desktop,"-tablet"),...d(s?.mobile??s?.tablet??s?.desktop,"-mobile")}),[s?.desktop,s?.mobile,s?.tablet]),k=t.useMemo(()=>{if(a&&s?.[b]==="top")return"40px"},[b,a,s]),r=t.useMemo(()=>({"--d":(o?.display?.desktop,"block"),"--d-tablet":(o?.display?.tablet??o?.display?.desktop,"block"),"--d-mobile":(o?.display?.mobile??o?.display?.tablet??o?.display?.desktop,"block")}),[o?.display?.desktop,o?.display?.mobile,o?.display?.tablet]),m=t.useMemo(()=>({"--top":k??"auto","--top-tablet":k??"auto","--top-mobile":k??"auto",[`--${s?.desktop}`]:k??"0px",[`--${s?.tablet??s?.desktop}-tablet`]:k??"0px",[`--${s?.mobile??s?.tablet??s?.desktop}-mobile`]:k??"0px"}),[k,s?.desktop,s?.mobile,s?.tablet]),u=e=>"top"==e?"sticky":"fixed",y=t.useMemo(()=>({"--pos":u(s?.desktop),"--pos-tablet":u(s?.tablet??s?.desktop),"--pos-mobile":u(s?.mobile??s?.tablet??s?.desktop)}),[s?.desktop,s?.mobile,s?.tablet]);return{w:p,displayStyle:m,positionStyle:y,getCSSAlign:i,makeDisplaySettingStyles:r}};
