Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/utils/generateStyleSheet",["module","exports","require","../config/constants/fragmentClassPlaceholder","../config/index","./getFrontendTokenValue","./getLayoutDataItemTopperUniqueClassName","./getLayoutDataItemUniqueClassName"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function generateStyleSheet(e,{itemsWithTopper:t}={}){let a=".lfr-layout-structure-item-container { padding: 0; }";return a+=".lfr-layout-structure-item-row { overflow: hidden; }",Object.entries(e).forEach((([e,{customCSS:r,styles:c}])=>{let d="",s="";Object.entries(c).forEach((([a,n])=>{if(!o.config.commonStylesFields[a])return;const{cssTemplate:r}=o.config.commonStylesFields[a];t.has(e)&&u.includes(a)?s+="".concat(replaceValue(r,getValue(e,a,n)),"\n"):d+="".concat(replaceValue(r,getValue(e,a,n)),"\n")})),d&&(a+=".".concat((0,l.default)(e)," {\n").concat(d,"}\n")),s&&(a+=".".concat((0,i.default)(e)," {\n").concat(s,"}\n")),r&&(a+=r.replaceAll(n.FRAGMENT_CLASS_PLACEHOLDER,(0,l.default)(e)))})),a};var n=a("../config/constants/fragmentClassPlaceholder"),o=a("../config/index"),r=a("./getFrontendTokenValue"),i=_interopRequireDefault(a("./getLayoutDataItemTopperUniqueClassName")),l=_interopRequireDefault(a("./getLayoutDataItemUniqueClassName"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e={0:"0",1:"0.25",2:"0.5",3:"1",4:"1.5",5:"3",6:"4.5",7:"6",8:"7.5",9:"9",10:"10"},c=["marginBottom","marginLeft","marginRight","marginTop","paddingBottom","paddingLeft","paddingRight","paddingTop"],u=["display","marginBottom","marginLeft","marginRight","marginTop","maxWidth","minWidth","width","shadow"];function getValue(t,a,n){return c.includes(a)?isNaN(n)?n:"var(--spacer-".concat(n,", ").concat(e[n],"rem)"):"backgroundImage"===a?"var(--lfr-background-image-".concat(t,")"):"opacity"===a?n/100:(0,r.getFrontendTokenValue)(n)}function replaceValue(e,t){return e.replaceAll("{value}",t)}}}));
//# sourceMappingURL=generateStyleSheet.js.map