"use strict";var t=require("../constants.js");const e=t=>{switch(!0){case"bottom-left"===t:return"rotate(-90deg)";case t.includes("bottom"):return"rotate(180deg)";case t.includes("right"):return"rotate(90deg)";default:return""}},o=(e,o)=>[t.SHAPE_ID.RIBBON_2,t.SHAPE_ID.RIBBON_3].includes(e)&&o.includes("right")||t.SHAPE_ID.RIBBON_3===e&&"bottom"===o,r=t=>!0===t.includes("bottom")?"rotate(135deg)":"rotate(-45deg)";exports.composeShapeStyleByPosition=(r,s,i)=>{if(!s||!r)return r?.shapeStyle||{};let l=r.shapeStyle||{};return["desktop","mobile","tablet"].forEach(a=>{let d=s[a]?.placement||"";if(!/\bright\b|\bbottom\b/.test(d))return;let n=`--t${"desktop"===a?"":`-${a}`}`,b="";[t.SHAPE_ID.RIBBON,t.SHAPE_ID.TRIANGLE].includes(r.id)&&!i&&(b=e(d)),o(r.id,d)&&!i&&(b="rotate(180deg)"),l={...l,...b?{[n]:b}:{}}}),l},exports.composeTextStyleByPosition=(e,s,i)=>{if(!s||!e)return e?.textStyle||{};let l=e.textStyle||{};return["desktop","mobile","tablet"].forEach(a=>{let d=s[a]?.placement||"";if(!/\bright\b|\bbottom\b/.test(d)||i)return;let n="",b=`--t${"desktop"===a?"":`-${a}`}`;e.id!==t.SHAPE_ID.RIBBON||i?e.id!==t.SHAPE_ID.TRIANGLE||i?e.id===t.SHAPE_ID.VERTICAL_RECTANGLE?n=["bottom","bottom-left"].includes(d)?"rotate(-180deg)":"rotate(0)":o(e.id,d)&&!i&&(n="rotate(180deg)"):n=`translate(-20%, -75%) ${r(d)}`:n=`translate(-10%, -30%) ${r(d)}`,l={...l,...n?{[b]:n}:{}}}),l};
