|
1
|
|
-import{j as e,b as r}from"./chunks/BlockEditorTranslator.js?ver=1.3.21";const{useBlockProps:u}=wp.blockEditor,p={edit:t=>{const s=u({className:"fc-checkout-name-fields-block"});return e.jsxs("div",{...t,...s,children:[e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Name")}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Email")}),e.jsxs("label",{htmlFor:"allow_create_account",children:[e.jsx("input",{type:"checkbox",name:"allow_create_account",readOnly:!0,disabled:!0}),e.jsx("span",{children:r("Create an Account?")})]})]})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},h={edit:()=>null,save:()=>null,category:"fluent-cart"},{useBlockProps:i,InnerBlocks:n}=wp.blockEditor,m=[["fluent-cart/checkout-billing-address-field"],["fluent-cart/checkout-ship-to-different-field",{style:{typography:{fontSize:"14px"}}}],["fluent-cart/checkout-shipping-address-field"]],f={edit:t=>{const s=i({className:"fc-checkout-address-fields-block"});return e.jsx("div",{...t,...s,children:e.jsx(n,{template:m,templateLock:!1,allowedBlocks:["core/heading","core/paragraph","fluent-cart/checkout-billing-address-field","fluent-cart/checkout-shipping-address-field","fluent-cart/checkout-ship-to-different-field"]})})},save:t=>{const s=i.save({className:"fct_checkout_address_fields"});return e.jsx("div",{...s,children:e.jsx(n.Content,{})})},supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:x}=wp.blockEditor,g={edit:t=>{const s=x({className:"fc-checkout-shipping-methods-block"});return e.jsxs("div",{...t,...s,children:[e.jsx("div",{className:"fc-checkout-section-title",children:r("Shipping Methods")}),e.jsxs("div",{className:"fc-checkout-shipping-methods-list",children:[e.jsxs("div",{className:"fc-checkout-shipping-methods-list-item",children:[e.jsx("input",{type:"radio",name:"shipping_method",checked:!0,disabled:!0,value:"flat_rate"}),e.jsx("label",{children:r("Flat Rate")}),e.jsx("span",{className:"fc-checkout-shipping-methods-list-item-price",children:"$10.00"})]}),e.jsxs("div",{className:"fc-checkout-shipping-methods-list-item",children:[e.jsx("input",{type:"radio",name:"shipping_method",disabled:!0,value:"free_shipping"}),e.jsx("label",{children:r("Free Shipping")}),e.jsx("span",{className:"fc-checkout-shipping-methods-list-item-price",children:r("Free")})]})]})]})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:k}=wp.blockEditor,{Notice:_}=wp.components,j={edit:t=>{const s=k({className:"fc-checkout-payment-methods-block"});return e.jsxs("div",{...t,...s,children:[e.jsx("div",{className:"fc-checkout-section-title",children:r("Payment")}),e.jsx("div",{className:"fc-checkout-payment-methods-list",children:e.jsx(_,{status:"warning",isDismissible:!1,children:e.jsx("div",{children:r("Please preview your form on the front-end to view payment methods.")})})})]})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:b,RichText:y}=wp.blockEditor,v={attributes:{terms_title:{type:"string",default:r("I agree to the terms and conditions.")}},edit:t=>{const{attributes:s,setAttributes:c}=t,l=b({className:"fc-checkout-agree-terms-block"});return e.jsx("div",{...t,...l,children:e.jsxs("label",{htmlFor:"terms_and_conditions",children:[e.jsx("input",{type:"checkbox",name:"terms_and_conditions",readOnly:!0,disabled:!0}),e.jsx(y,{tagName:"span",value:s.terms_title,onChange:o=>c({terms_title:o}),placeholder:r("I agree to the terms and conditions."),allowedFormats:["core/bold","core/italic"]})]})})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:N}=wp.blockEditor,B={edit:t=>{const s=N({className:"fc-checkout-submit-button-block fct_place_order_btn_wrap fc-checkout-place-order-btn large",type:"submit","data-loading":""});return e.jsx("button",{...t,...s,children:r("Place Order")})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:P,RichText:w}=wp.blockEditor,C={attributes:{title:{type:"string",default:r("Leave a Note")}},edit:t=>{const{attributes:s,setAttributes:c}=t,l=P({className:"fc-checkout-order-notes-block"});return e.jsx("div",{...t,...l,children:e.jsx("div",{className:"fct-toggle-field fct_order_note",id:"fct_wrapper_order_notes","data-fct-item-toggle":"",children:e.jsxs("label",{htmlFor:"order_notes","data-fct-item-toggle-control":"",className:"fct-toggle-control fct_order_note_toggle",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M15.6 12.0001L10.2 17.4001V6.6001L15.6 12.0001Z",fill:"currentColor"})}),e.jsx(w,{tagName:"span",value:s.title,onChange:o=>c({title:o}),placeholder:r("Leave a Note"),allowedFormats:["core/bold","core/italic"]})]})})})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},T=window.fluent_cart_checkout_data,{useBlockProps:d,InnerBlocks:S}=wp.blockEditor,{__:a}=wp.i18n,$={deprecated:[{save:()=>{const t=d.save({className:"fct_checkout_summary"});return e.jsx("div",{...t,children:e.jsx(S.Content,{})})}}],edit:()=>{const t=d({className:"fc-checkout-summary-block"});return e.jsx("div",{...t,children:e.jsxs("div",{className:"fct_checkout_summary",style:{position:"relative"},children:[e.jsx("span",{style:{position:"absolute",top:"8px",right:"8px",background:"#e0e0e0",color:"#555",fontSize:"11px",padding:"2px 8px",borderRadius:"3px",lineHeight:"1.4"},children:a("Preview","fluent-cart")}),e.jsx("div",{className:"fct_summary active",children:e.jsx("div",{className:"fct_summary_box",children:e.jsxs("div",{className:"fct_checkout_form_section",children:[e.jsxs("div",{className:"fct_form_section_header",children:[e.jsxs("div",{className:"fct_toggle_content",children:[e.jsx("h4",{children:a("Order summary","fluent-cart")}),e.jsx("div",{className:"fct_toggle_icon",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",children:e.jsx("path",{d:"M1 1L4.29289 4.29289C4.62623 4.62623 4.79289 4.79289 5 4.79289C5.20711 4.79289 5.37377 4.62623 5.70711 4.29289L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsx("div",{className:"fct_summary_toggle_total",children:e.jsx("span",{className:"value",children:"$0.00"})})]}),e.jsxs("div",{className:"fct_form_section_body",children:[e.jsx("div",{className:"fct_items_wrapper",children:e.jsx("div",{className:"fct_line_items",children:e.jsxs("div",{className:"fct_line_item fct_has_image",children:[e.jsxs("div",{className:"fct_line_item_info",children:[e.jsx("div",{className:"fct_item_image",children:e.jsx("img",{src:T.placeholder_image,alt:a("Product Image","fluent-cart")})}),e.jsx("div",{className:"fct_item_content",children:e.jsxs("div",{className:"fct_item_title",children:[a("Product Title","fluent-cart"),e.jsx("div",{className:"fct_item_variant_title",children:"– "+a("Variation Title","fluent-cart")})]})})]}),e.jsx("div",{className:"fct_line_item_price",children:e.jsx("span",{className:"fct_line_item_total",children:"$0.00"})})]})})}),e.jsx("div",{className:"fct_summary_items",children:e.jsxs("ul",{className:"fct_summary_items_list",children:[e.jsxs("li",{children:[e.jsx("span",{className:"fct_summary_label",children:a("Subtotal","fluent-cart")}),e.jsx("span",{className:"fct_summary_value",children:"$0.00"})]}),e.jsxs("li",{children:[e.jsx("span",{className:"fct_summary_label",children:a("Shipping","fluent-cart")}),e.jsx("span",{className:"fct_summary_value",children:"$0.00"})]}),e.jsx("li",{children:e.jsx("div",{className:"fct_coupon",children:e.jsx("div",{className:"fct_coupon_toggle",children:e.jsx("a",{href:"#",children:a("Have a Coupon?","fluent-cart")})})})}),e.jsxs("li",{children:[e.jsx("span",{className:"fct_summary_label",children:a("Tax Estimate (Included)","fluent-cart")}),e.jsx("span",{className:"fct_summary_value",children:"$0.00"})]}),e.jsxs("li",{className:"fct_summary_items_total",children:[e.jsx("span",{className:"fct_summary_label",children:a("Total","fluent-cart")}),e.jsx("span",{className:"fct_summary_value",children:"$0.00"})]})]})})]})]})})})]})})},save:()=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:E,RichText:F}=wp.blockEditor,A={attributes:{section_title:{type:"string",default:r("Recommended")}},edit:t=>{const{attributes:s,setAttributes:c}=t,l=E({className:"fc-checkout-order-bump-block"});return e.jsxs("div",{...t,...l,children:[e.jsx("div",{className:"fc-checkout-section-title",children:e.jsx(F,{tagName:"span",value:s.section_title,onChange:o=>c({section_title:o}),placeholder:r("Recommended"),allowedFormats:["core/bold","core/italic"]})}),e.jsx("div",{className:"fct_form_section_body",children:e.jsx("div",{className:"fct_order_promotions",children:e.jsxs("div",{className:"fct_order_promotion",children:[e.jsx("div",{className:"fct_order_promotion_checkbox",children:e.jsx("input",{type:"checkbox",disabled:!0,className:"fct_order_promotion_input",id:"fct_order_promotion_1"})}),e.jsx("div",{className:"fct_bump_details",children:e.jsxs("label",{htmlFor:"fct_order_promotion_1",className:"fct_order_promotion_label",children:[e.jsx("div",{className:"fct_order_promotion_title",children:"Product Title"}),e.jsx("div",{className:"fct_order_promotion_product_title",children:"Variation Title"}),e.jsx("div",{className:"fct_order_promotion_price",children:e.jsx("span",{className:"fct_order_promotion_price",children:"$0.00"})})]})})]})})})]})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},O={edit:()=>null,save:()=>null,category:"fluent-cart"},{useBlockProps:R,InnerBlocks:H}=wp.blockEditor,I={deprecated:[{save:()=>{const t=R.save({className:"fct_checkout_summary"});return e.jsx("div",{...t,children:e.jsx(H.Content,{})})}}],edit:()=>null,save:()=>null,category:"fluent-cart"},z={edit:()=>null,save:()=>null,category:"fluent-cart"},L={edit:()=>null,save:()=>null,category:"fluent-cart"},M={edit:()=>null,save:()=>null,category:"fluent-cart"},D={edit:()=>null,save:()=>null,category:"fluent-cart"},V={edit:()=>null,save:()=>null,category:"fluent-cart"},Z={edit:()=>null,save:()=>null,category:"fluent-cart"},U={edit:()=>null,save:()=>null,category:"fluent-cart"},W={edit:()=>null,save:()=>null,category:"fluent-cart"},{useBlockProps:q,RichText:G}=wp.blockEditor,J={attributes:{addressTitle:{type:"string",default:r("Billing Address")}},edit:t=>{const{attributes:s,setAttributes:c}=t,l=q();return e.jsxs("div",{...t,...l,children:[e.jsx("div",{className:"fc-checkout-section-title",children:e.jsx(G,{tagName:"span",value:s.addressTitle,onChange:o=>c({addressTitle:o}),placeholder:r("Address"),allowedFormats:["core/bold","core/italic"]})}),e.jsxs("div",{className:"fc-checkout-address-fields-block-row",children:[e.jsx("select",{disabled:!0,children:e.jsx("option",{value:"",children:r("Select a Country")})}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("House number and street name *")}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Apartment, suite, unit, etc. (optional)")}),e.jsx("select",{disabled:!0,children:e.jsx("option",{value:"",children:r("State")})}),e.jsxs("div",{className:"two-column",children:[e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Town / City")}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Postcode / ZIP")})]}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Phone Number")})]})]})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:K,RichText:Q}=wp.blockEditor,X={attributes:{addressTitle:{type:"string",default:r("Shipping Address")}},edit:t=>{const{attributes:s,setAttributes:c}=t,l=K();return e.jsxs("div",{...t,...l,children:[e.jsx("div",{className:"fc-checkout-section-title",children:e.jsx(Q,{tagName:"span",value:s.addressTitle,onChange:o=>c({addressTitle:o}),placeholder:r("Address"),allowedFormats:["core/bold","core/italic"]})}),e.jsxs("div",{className:"fc-checkout-address-fields-block-row",children:[e.jsx("select",{disabled:!0,children:e.jsx("option",{value:"",children:r("Select a Country")})}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("House number and street name *")}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Apartment, suite, unit, etc. (optional)")}),e.jsx("select",{disabled:!0,children:e.jsx("option",{value:"",children:r("State")})}),e.jsxs("div",{className:"two-column",children:[e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Town / City")}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Postcode / ZIP")})]}),e.jsx("input",{type:"text",readOnly:!0,disabled:!0,placeholder:r("Phone Number")})]})]})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:Y,RichText:ee}=wp.blockEditor,te={attributes:{ship_to_different_title:{type:"string",default:r("Ship to a different address?")}},edit:t=>{const{attributes:s,setAttributes:c}=t,l=Y({className:"fc-checkout-create-account-block"});return e.jsx("div",{...t,...l,children:e.jsxs("label",{htmlFor:"allow_create_account",children:[e.jsx("input",{type:"checkbox",name:"allow_create_account",readOnly:!0,disabled:!0,placeholder:r("Ship to a different address?")}),e.jsx(ee,{tagName:"span",value:s.ship_to_different_title,onChange:o=>c({ship_to_different_title:o}),placeholder:r("Title"),allowedFormats:["core/bold","core/italic"]})]})})},save:t=>null,supports:{html:!1,align:["left","center","right"],typography:{fontSize:!0,lineHeight:!0},spacing:{margin:!0},color:{text:!0}},category:"fluent-cart"},{useBlockProps:se}=wp.blockEditor,re={edit:t=>{const s=se({className:"fc-checkout-eu-vat-block"});return e.jsxs("div",{...t,...s,children:[e.jsx("div",{className:"fc-checkout-section-title",children:r("EU VAT")}),e.jsx("div",{className:"fct_tax_field",style:{marginTop:"8px"},children:e.jsxs("div",{className:"fct_tax_input_wrapper",style:{display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("input",{type:"text",placeholder:r("Enter Tax ID"),disabled:!0,style:{flex:1,padding:"8px 12px",border:"1px solid #ddd",borderRadius:"4px",backgroundColor:"#f9f9f9"}}),e.jsx("button",{disabled:!0,style:{padding:"8px 16px",border:"1px solid #ddd",borderRadius:"4px",backgroundColor:"#f0f0f0",cursor:"default"},children:r("Apply")})]})})]})},save:()=>null},ce={CheckoutNameFieldsBlock:p,CheckoutCreateAccountFieldBlock:h,CheckoutAddressFieldsBlock:f,CheckoutShippingMethodsBlock:g,CheckoutPaymentMethodsBlock:j,CheckoutAgreeTermsFieldBlock:v,CheckoutSubmitButtonBlock:B,CheckoutOrderNotesFieldBlock:C,CheckoutSummaryBlock:$,CheckoutOrderBumpBlock:A,CheckoutOrderSummaryBlock:O,CheckoutSummaryFooterBlock:I,CheckoutSubtotalBlock:z,CheckoutShippingBlock:L,CheckoutFeesBlock:M,CheckoutCouponBlock:D,CheckoutManualDiscountBlock:V,CheckoutTaxBlock:Z,CheckoutShippingTaxBlock:U,CheckoutTotalBlock:W,CheckoutBillingAddressFieldBlock:J,CheckoutShippingAddressFieldBlock:X,CheckoutShipToDifferentFieldBlock:te,CheckoutEuVatBlock:re},{registerBlockType:le}=wp.blocks,oe=window.fluent_cart_checkout_inner_blocks,{InnerBlocks:ie,useBlockProps:ne}=wp.blockEditor;oe.blocks.forEach(t=>{const s=ce[t.component],c=[];t.parent&&c.push(...t.parent),s!=null&&s.parent&&c.push(...s.parent),le(t.slug,{apiVersion:3,category:"fluent-cart",title:t.title,name:t.slug,icon:t.icon||null,parent:c.length>0?c:null,edit:(s==null?void 0:s.edit)||(()=>r("No edit found")),save:(s==null?void 0:s.save)||(()=>null),deprecated:(s==null?void 0:s.deprecated)||[],supports:(t==null?void 0:t.supports)||{},usesContext:(s==null?void 0:s.usesContext)||[],attributes:(s==null?void 0:s.attributes)||{}})}); |
|
1
|
+import{j as t}from"./chunks/jsx-runtime.js?ver=1.7.0";import{b as h}from"./chunks/BlockEditorTranslator.js?ver=1.7.0";import{u as A,S as T}from"./chunks/SingleProductContext.js?ver=1.7.0";import{H as M}from"./chunks/Icons.js?ver=1.7.0";import{u as q}from"./chunks/ProductContext.js?ver=1.7.0";import{P as z}from"./chunks/ProductContainerContext.js?ver=1.7.0";const{useBlockProps:H}=wp.blockEditor,_=window.fluent_cart_product_image_data,D=_.placeholder_image,F={title:_.title,description:_.description,icon:{src:M},category:"fluent-cart",edit:()=>{var o,i;const s=H(),e=A(),r=e==null?void 0:e.currentImage,a=e==null?void 0:e.product,n=(r==null?void 0:r.url)||((i=(o=a==null?void 0:a.detail)==null?void 0:o.featured_media)==null?void 0:i.url)||D,l=(r==null?void 0:r.title)||(a==null?void 0:a.post_title)||h("Product Image");return t.jsx("div",{...s,children:t.jsx("img",{src:n,alt:l,className:"w-full aspect-square object-cover rounded-md"})})},save(){return null},supports:{html:!1,align:["left","center","right","wide","full"],__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},spacing:{margin:!0,padding:!0},shadow:!0,__experimentalFilter:{duotone:!0}},usesContext:["fluent-cart/query_type","fluent-cart/carousel_settings","fluent-cart/current_image","fluent-cart/image_index"]},{InnerBlocks:L,useBlockProps:b,useInnerBlocksProps:O,__experimentalUseBlockPreview:R}=wp.blockEditor,U=R||null,{useContext:V,useEffect:W,useState:K,useMemo:G,memo:J}=wp.element,{useSelect:Q}=wp.data;var P,N;const X=((P=window.fluent_cart_product_image_data)==null?void 0:P.placeholder_image)||((N=window.fluent_cart_block_editor_asset)==null?void 0:N.placeholder_image)||"",Y=()=>{const s=O({className:"fct-media-carousel-slide"},{__unstableDisableLayoutClassNames:!0});return t.jsx("div",{...s})},Z=({blocks:s,blockContextId:e,isHidden:r,setActiveBlockContextId:a})=>{const n=U({blocks:s,props:{className:"fct-media-carousel-slide"}}),l=()=>{a(e)},o={display:r?"none":void 0};return t.jsx("div",{...n,tabIndex:0,role:"button",onClick:l,onKeyPress:l,style:o})},ee=J(Z),te=({displayTemplate:s,blocks:e,imageIndex:r,setActiveBlockContextId:a})=>t.jsxs(t.Fragment,{children:[s?t.jsx(Y,{}):null,t.jsx(ee,{blocks:e,blockContextId:r,setActiveBlockContextId:a,isHidden:s})]}),se=s=>{var n,l;if(!s)return[];const e=[];return(Array.isArray((l=(n=s==null?void 0:s.detail)==null?void 0:n.gallery_image)==null?void 0:l.meta_value)?s.detail.gallery_image.meta_value:[]).forEach(o=>{o!=null&&o.url&&e.push(o)}),((s==null?void 0:s.variants)||[]).forEach(o=>{var p;(Array.isArray((p=o==null?void 0:o.media)==null?void 0:p.meta_value)?o.media.meta_value:[]).forEach(c=>{c!=null&&c.url&&e.push(c)})}),e.length||e.push({id:"placeholder",url:X,title:"Product Image"}),e},re={attributes:{wp_client_id:{type:"string",default:""},last_changed:{type:"string",default:""}},edit:s=>{var j;const{attributes:e,setAttributes:r,clientId:a,context:n}=s,l=V(z)||{},{simulateLoading:o,simulateNoResults:i}=l,c=b({className:"fct-shop-app-preview-wrap "+(o||i?"hide":"")});W(()=>{r({last_changed:new Date().toISOString()}),!e.wp_client_id&&r({wp_client_id:a})},[a,e.wp_client_id,r]);const m=q(),g=((j=m==null?void 0:m.products)==null?void 0:j[0])||null,f=n["fluent-cart/carousel_settings"]||{},v=Math.max(1,Number((f==null?void 0:f.slidesToShow)||3)),B=G(()=>se(g),[g]),x=Q(u=>u("core/block-editor").getBlock(a),[a]),E=(x==null?void 0:x.innerBlocks)||[],[C,S]=K(0),k=B.slice(0,v);return t.jsx("div",{...c,children:t.jsx("div",{className:"fct-product-loop-editor",style:{display:"grid",gridTemplateColumns:`repeat(${Math.min(v,k.length||1)}, 1fr)`,gap:"12px"},children:k.map((u,d)=>{const $=d===(C??0);return t.jsx(T,{value:{product:g,currentImage:u,imageIndex:d},children:t.jsx("div",{className:"fluent-cart-product-loop fct-product-block-editor-product-card",children:t.jsx(te,{displayTemplate:$,blocks:E,imageIndex:d,setActiveBlockContextId:S})})},u.id||d)})})})},save:s=>{const e=b.save();return t.jsx("div",{...e,className:"fluent-cart-product-loop fct-product-block-editor-product-card",children:t.jsx(L.Content,{})})},supports:{align:["wide","full"],html:!1},usesContext:["fluent-cart/query_type","fluent-cart/carousel_settings","fluent-cart/product_id","fluent-cart/variation_ids","fluent-cart/has_controls","fluent-cart/has_pagination"]},{useBlockProps:ae}=wp.blockEditor,{useContext:xe}=wp.element,oe={edit:({context:s})=>{const r=(s["fluent-cart/carousel_settings"]||{}).arrows!=="no",a=ae({className:"fct-carousel-controls-editor"});return r?t.jsxs("div",{...a,children:[t.jsx("button",{className:"editor-carousel-nav prev","aria-hidden":"true",children:"‹"}),t.jsx("button",{className:"editor-carousel-nav next","aria-hidden":"true",children:"›"})]}):t.jsx("div",{...a,style:{opacity:.5}})},save:()=>null,supports:{html:!1},usesContext:["fluent-cart/carousel_settings"]},{useBlockProps:ne}=wp.blockEditor,le={edit:({context:s})=>{const e=s["fluent-cart/carousel_settings"]||{},r=e.pagination!=="no",a=e.paginationType||"bullets",n=ne({className:"fct-carousel-pagination-editor"});if(!r)return t.jsx("div",{...n,style:{opacity:.5}});const l=()=>{switch(a){case"fraction":return t.jsxs("div",{className:"editor-carousel-pagination editor-carousel-pagination--fraction",children:[t.jsx("span",{className:"fraction-current",style:{fontSize:"18px",fontWeight:"700",color:"#111827"},children:"1"}),t.jsx("span",{style:{margin:"0 8px",fontSize:"14px",color:"#6b7280"},children:"—"}),t.jsx("span",{className:"fraction-total",style:{fontSize:"14px",fontWeight:"400",color:"#9ca3af"},children:"5"})]});case"progress":return t.jsx("div",{className:"editor-carousel-pagination editor-carousel-pagination--progress",children:t.jsx("div",{className:"progress-bar",style:{width:"40%"}})});case"segmented":return t.jsxs("div",{className:"editor-carousel-pagination editor-carousel-pagination--segmented",children:[t.jsx("div",{className:"progress-segment is-completed"}),t.jsx("div",{className:"progress-segment is-active"}),t.jsx("div",{className:"progress-segment"}),t.jsx("div",{className:"progress-segment"}),t.jsx("div",{className:"progress-segment"}),t.jsx("span",{className:"segment-counter",children:"1 / 5"})]});case"bullets":default:return t.jsxs("div",{className:"editor-carousel-pagination",children:[t.jsx("span",{className:"editor-carousel-dot is-active"}),t.jsx("span",{className:"editor-carousel-dot"}),t.jsx("span",{className:"editor-carousel-dot"})]})}};return t.jsx("div",{...n,children:l()})},save:()=>null,supports:{html:!1},usesContext:["fluent-cart/carousel_settings"]},{registerBlockType:I}=wp.blocks,ce=window.fluent_cart_media_carousel_inner_blocks,{InnerBlocks:w,useBlockProps:y}=wp.blockEditor,ie={ProductImageBlockEditor:F,MediaCarouselLoopBlock:re,CarouselControlsBlock:oe,CarouselPaginationBlock:le};ce.blocks.forEach(s=>{const e=ie[s.component],r=[];s.parent&&r.push(...s.parent),e!=null&&e.parent&&r.push(...e.parent),I(s.slug,{apiVersion:3,category:"product-elements",title:s.title,name:s.slug,icon:s.icon||null,parent:r.length>0?r:null,edit:(e==null?void 0:e.edit)||(()=>h("No edit found")),save:(e==null?void 0:e.save)||(()=>null),supports:(e==null?void 0:e.supports)||{},usesContext:(e==null?void 0:e.usesContext)||[],attributes:(e==null?void 0:e.attributes)||{}})});I("fluent-cart/product-paginator",{apiVersion:3,title:h("Paginator"),icon:"screenoptions",parent:["fluent-cart/media_carousel","core/column"],category:"layout",attributes:{},edit:s=>{const e=y({className:"fluent-cart-product-paginator"});return t.jsx("div",{...e,children:t.jsx("div",{children:t.jsx(w,{allowedBlocks:["core/paragraph"]})})})},save:s=>{const e=y.save();return t.jsx("div",{...e,className:"fluent-cart-product-paginator",children:t.jsx(w.Content,{})})},usesContext:["fluent-cart/query_type","fluent-cart/carousel_settings","fluent-cart/product_id","fluent-cart/variation_ids","fluent-cart/has_controls","fluent-cart/has_pagination"]}); |