{"version":3,"file":"TextWithIllustrations.aDniTOCp.mjs","names":["useMemo","__esmMin","init_npm_react_18_3_1","pe","init_jsx_runtime","c","init_framer_DKtAEkcX","addPropertyControls","TextWithIllustrations","props","content","words","text","slots","afterWord1","illustration1","afterWord2","illustration2","afterWord3","illustration3","afterWord4","illustration4","afterWord5","illustration5","slot","a","b","elements","wordIndex","wordsBeforeSlot","font","slotIndex","remainingWords","textColor","init_TextWithIllustrations","ControlType"],"sources":["https:/framerusercontent.com/modules/xZftLaASEYHL6BbKK00B/XaUhC5zpgqn2svNsXHnW/TextWithIllustrations.js"],"sourcesContent":["// Component for displaying text with interspersed illustrations from connected layers\n// Text is wrapped in p tag with illustrations in aria-hidden spans for SEO\n// Illustrations are connected via ComponentInstance slots and positioned after specified word counts\n// Illustration height follows text line height\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TextWithIllustrations(props){const{text=\"Welcome to our amazing kindergarten where children learn and play\",illustration1,afterWord1=3,illustration2,afterWord2=6,illustration3,afterWord3=9,illustration4,afterWord4=12,illustration5,afterWord5=15,textColor,font}=props;const content=useMemo(()=>{const words=text.split(/\\s+/);const slots=[{afterWord:afterWord1,content:illustration1},{afterWord:afterWord2,content:illustration2},{afterWord:afterWord3,content:illustration3},{afterWord:afterWord4,content:illustration4},{afterWord:afterWord5,content:illustration5}].filter(slot=>slot.content).sort((a,b)=>a.afterWord-b.afterWord);const elements=[];let wordIndex=0;slots.forEach((slot,slotIndex)=>{const wordsBeforeSlot=words.slice(wordIndex,slot.afterWord);if(wordsBeforeSlot.length>0){elements.push(wordsBeforeSlot.join(\" \"));if(slot.afterWord<words.length){elements.push(\" \");}}if(slot.afterWord<=words.length){elements.push(/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{display:\"inline-block\",verticalAlign:\"top\",height:font.lineHeight||\"inherit\",lineHeight:font.lineHeight||\"inherit\",width:\"auto\",overflow:\"visible\"},children:slot.content},`illustration-${slotIndex}`));if(slot.afterWord<words.length){elements.push(\" \");}}wordIndex=slot.afterWord;});const remainingWords=words.slice(wordIndex);if(remainingWords.length>0){elements.push(remainingWords.join(\" \"));}return elements;},[text,illustration1,afterWord1,illustration2,afterWord2,illustration3,afterWord3,illustration4,afterWord4,illustration5,afterWord5,font.lineHeight]);return /*#__PURE__*/_jsx(\"div\",{role:\"paragraph\",style:{margin:0,padding:0,color:textColor,...font,width:\"100%\"},children:content});}addPropertyControls(TextWithIllustrations,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Welcome to our amazing kindergarten where children learn and play\",displayTextArea:true},illustration1:{type:ControlType.ComponentInstance,title:\"Illustration 1\"},afterWord1:{type:ControlType.Number,title:\"After Word\",defaultValue:3,min:0,step:1,displayStepper:true},illustration2:{type:ControlType.ComponentInstance,title:\"Illustration 2\"},afterWord2:{type:ControlType.Number,title:\"After Word\",defaultValue:6,min:0,step:1,displayStepper:true},illustration3:{type:ControlType.ComponentInstance,title:\"Illustration 3\"},afterWord3:{type:ControlType.Number,title:\"After Word\",defaultValue:9,min:0,step:1,displayStepper:true},illustration4:{type:ControlType.ComponentInstance,title:\"Illustration 4\"},afterWord4:{type:ControlType.Number,title:\"After Word\",defaultValue:12,min:0,step:1,displayStepper:true},illustration5:{type:ControlType.ComponentInstance,title:\"Illustration 5\"},afterWord5:{type:ControlType.Number,title:\"After Word\",defaultValue:15,min:0,step:1,displayStepper:true},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1.2em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextWithIllustrations\",\"slots\":[\"illustration1\",\"illustration2\",\"illustration3\",\"illustration4\",\"illustration5\"],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextWithIllustrations.map"],"mappings":"A,qKAOG,SAAwBQ,EAAsB,EAAM,CAAC,GAAK,CAAC,OAAK,oEAAoE,gBAAc,aAAW,EAAE,gBAAc,aAAW,EAAE,gBAAc,aAAW,EAAE,gBAAc,aAAW,GAAG,gBAAc,aAAW,GAAG,YAAU,QAAMC,EAAYC,EAAQV,MAAY,CAAC,IAAMW,EAAMC,EAAK,MAAM,KAAK,EAAQC,EAAM,CAAC,CAAC,UAAUC,EAAW,QAAQC,CAAa,EAAE,CAAC,UAAUC,EAAW,QAAQC,CAAa,EAAE,CAAC,UAAUC,EAAW,QAAQC,CAAa,EAAE,CAAC,UAAUC,EAAW,QAAQC,CAAa,EAAE,CAAC,UAAUC,EAAW,QAAQC,CAAa,CAAC,CAAC,CAAC,OAAO,GAAMC,EAAK,OAAO,CAAC,CAAC,MAAM,EAAE,IAAIC,EAAE,UAAUC,EAAE,SAAS,EAAQC,EAAS,CAAC,EAAMC,EAAU,EAAEf,EAAM,SAAS,EAAK,IAAY,CAAC,IAAMgB,EAAgBlB,EAAM,MAAMiB,EAAUJ,EAAK,SAAS,EAAKK,EAAgB,OAAO,IAAGF,EAAS,KAAKE,EAAgB,KAAK,GAAG,CAAC,EAAKL,EAAK,UAAUb,EAAM,QAAQgB,EAAS,KAAK,GAAG,GAAOH,EAAK,WAAWb,EAAM,SAAQgB,EAAS,KAAkB,gBAAK,OAAO,CAAC,cAAc,OAAO,MAAM,CAAC,QAAQ,eAAe,cAAc,MAAM,OAAOG,EAAK,YAAY,UAAU,WAAWA,EAAK,YAAY,UAAU,MAAM,OAAO,SAAS,SAAS,EAAE,SAASN,EAAK,OAAO,EAAE,gBAAgBO,GAAW,CAAC,EAA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