????

Your IP : 3.15.5.184


Current Path : /home/multihiv/www/store/wp-content/plugins/woocommerce/assets/client/blocks/
Upload File :
Current File : /home/multihiv/www/store/wp-content/plugins/woocommerce/assets/client/blocks/classic-shortcode.js

(()=>{var e,t,o,c={6390:(e,t,o)=>{"use strict";o.r(t);var c={};o.r(c),o.d(c,{blockifyConfig:()=>O,getDescription:()=>B,getTitle:()=>R,isConversionPossible:()=>v});var r={};o.r(r),o.d(r,{blockifyConfig:()=>I,getDescription:()=>j,getTitle:()=>M,isConversionPossible:()=>P});var i=o(1609);const l=window.wp.blocks,n=window.wp.blockEditor,a=window.wp.components;var s=o(7723),h=o(7104),m=o(3707);const d=window.wp.data;var w=o(6087);const p=window.wp.notices;var u=o(5573),g=o(851);const k=(0,i.createElement)((({className:e,...t})=>(0,i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 23 6",className:(0,g.A)("woo-icon",e),...t,width:46,height:12},(0,i.createElement)("g",{id:"surface1"},(0,i.createElement)("path",{style:{stroke:"none",fillRule:"evenodd",fill:"rgb(52.941179%,24.313726%,100%)",fillOpacity:1},d:"M 9.695312 0.0234375 C 9.15625 0.0234375 8.808594 0.199219 8.492188 0.789062 L 7.066406 3.480469 L 7.066406 1.089844 C 7.066406 0.375 6.726562 0.0234375 6.101562 0.0234375 C 5.472656 0.0234375 5.210938 0.238281 4.898438 0.839844 L 3.546875 3.480469 L 3.546875 1.113281 C 3.546875 0.351562 3.230469 0.0234375 2.46875 0.0234375 L 0.914062 0.0234375 C 0.324219 0.0234375 0 0.300781 0 0.800781 C 0 1.300781 0.3125 1.601562 0.890625 1.601562 L 1.527344 1.601562 L 1.527344 4.621094 C 1.527344 5.472656 2.105469 5.976562 2.929688 5.976562 C 3.757812 5.976562 4.132812 5.648438 4.546875 4.886719 L 5.449219 3.195312 L 5.449219 4.621094 C 5.449219 5.460938 6 5.976562 6.839844 5.976562 C 7.679688 5.976562 7.992188 5.6875 8.46875 4.886719 L 10.546875 1.378906 C 11 0.613281 10.6875 0.0234375 9.683594 0.0234375 C 9.683594 0.0234375 9.683594 0.0234375 9.695312 0.0234375 Z M 9.695312 0.0234375"}),(0,i.createElement)("path",{style:{stroke:"none",fillRule:"evenodd",fill:"rgb(52.941179%,24.313726%,100%)",fillOpacity:1},d:"M 13.605469 0.0234375 C 11.902344 0.0234375 10.609375 1.289062 10.609375 3.007812 C 10.609375 4.722656 11.914062 5.976562 13.605469 5.976562 C 15.296875 5.976562 16.585938 4.710938 16.597656 3.007812 C 16.597656 1.289062 15.296875 0.0234375 13.605469 0.0234375 Z M 13.605469 4.144531 C 12.964844 4.144531 12.527344 3.671875 12.527344 3.007812 C 12.527344 2.34375 12.964844 1.855469 13.605469 1.855469 C 14.242188 1.855469 14.683594 2.34375 14.683594 3.007812 C 14.683594 3.671875 14.257812 4.144531 13.605469 4.144531 Z M 13.605469 4.144531"}),(0,i.createElement)("path",{style:{stroke:"none",fillRule:"evenodd",fill:"rgb(52.941179%,24.313726%,100%)",fillOpacity:1},d:"M 20.007812 0.0234375 C 18.316406 0.0234375 17.011719 1.289062 17.011719 3.007812 C 17.011719 4.722656 18.316406 5.976562 20.007812 5.976562 C 21.695312 5.976562 23 4.710938 23 3.007812 C 23 1.300781 21.695312 0.0234375 20.007812 0.0234375 Z M 20.007812 4.144531 C 19.355469 4.144531 18.941406 3.671875 18.941406 3.007812 C 18.941406 2.34375 19.367188 1.855469 20.007812 1.855469 C 20.644531 1.855469 21.082031 2.34375 21.082031 3.007812 C 21.082031 3.671875 20.65625 4.144531 20.007812 4.144531 Z M 20.007812 4.144531"})))),null),x=({blocks:e,findCondition:t})=>{for(const o of e){if(t(o))return o;if(o.innerBlocks){const e=x({blocks:o.innerBlocks,findCondition:t});if(e)return e}}};o(4918),o(120);const f=()=>(0,i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 892 516"},(0,i.createElement)(u.G,{fill:"currentColor",transform:"translate(-1)"},(0,i.createElement)(u.Rect,{width:"100",height:"20",x:"1",rx:"2"}),(0,i.createElement)(u.Rect,{width:"100",height:"20",x:"421",rx:"2"}),(0,i.createElement)(u.Rect,{width:"100",height:"20",x:"793",rx:"2"}),(0,i.createElement)(u.Rect,{width:"150",height:"24",x:"125",y:"48",rx:"2"}),(0,i.createElement)(u.Rect,{width:"50",height:"24",x:"125",y:"86",rx:"2"}),(0,i.createElement)(u.Rect,{width:"50",height:"24",x:"457",y:"48",rx:"2"}),(0,i.createElement)(u.Rect,{width:"100",height:"100",x:"15",y:"48",rx:"2"}),(0,i.createElement)(u.Rect,{width:"150",height:"150",x:"1",y:"318",rx:"2"}),(0,i.createElement)(u.Rect,{width:"150",height:"150",x:"373",y:"318",rx:"2"}),(0,i.createElement)(u.Rect,{width:"150",height:"150",x:"187",y:"318",rx:"2"}),(0,i.createElement)(u.Rect,{width:"150",height:"24",x:"125",y:"178",rx:"2"}),(0,i.createElement)(u.Rect,{width:"50",height:"24",x:"125",y:"216",rx:"2"}),(0,i.createElement)(u.Rect,{width:"50",height:"24",x:"457",y:"178",rx:"2"}),(0,i.createElement)(u.Rect,{width:"100",height:"100",x:"15",y:"178",rx:"2"}),(0,i.createElement)(u.Rect,{width:"304",height:"359",x:"588",y:"34",rx:"2"}),(0,i.createElement)(u.Rect,{width:"520",height:"1",x:"1",y:"34",rx:".5"}),(0,i.createElement)(u.Rect,{width:"520",height:"1",y:"162",rx:".5"}),(0,i.createElement)(u.Rect,{width:"520",height:"1",x:"1",y:"292",rx:".5"}),(0,i.createElement)(u.Rect,{width:"304",height:"64",x:"589",y:"407",rx:"2"}),(0,i.createElement)(u.Rect,{width:"100",height:"38",x:"26",y:"478",rx:"2"}),(0,i.createElement)(u.Rect,{width:"100",height:"38",x:"212",y:"478",rx:"2"}),(0,i.createElement)(u.Rect,{width:"100",height:"38",x:"398",y:"478",rx:"2"}))),b=()=>(0,i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 892 726"},(0,i.createElement)(u.G,{fill:"currentColor",transform:"translate(-1)"},(0,i.createElement)(u.Rect,{width:"203",height:"38",x:"1",rx:"2"}),(0,i.createElement)(u.Rect,{width:"434",height:"38",x:"1",y:"62",rx:"2"}),(0,i.createElement)(u.Rect,{width:"434",height:"38",y:"124",rx:"2"}),(0,i.createElement)(u.Rect,{width:"434",height:"38",x:"1",y:"186",rx:"2"}),(0,i.createElement)(u.Rect,{width:"434",height:"38",x:"2",y:"248",rx:"2"}),(0,i.createElement)(u.Rect,{width:"434",height:"38",x:"3",y:"310",rx:"2"}),(0,i.createElement)(u.Rect,{width:"434",height:"38",x:"3",y:"372",rx:"2"}),(0,i.createElement)(u.Rect,{width:"892",height:"204",x:"2",y:"434",rx:"2"}),(0,i.createElement)(u.Rect,{width:"203",height:"38",x:"231",rx:"2"}),(0,i.createElement)(u.Rect,{width:"203",height:"38",x:"514",rx:"2"}),(0,i.createElement)(u.Rect,{width:"427",height:"100",x:"466",y:"62",rx:"2"}),(0,i.createElement)(u.Rect,{width:"304",height:"64",x:"588",y:"662",rx:"2"}),(0,i.createElement)(u.Rect,{width:"38",height:"38",x:"466",rx:"2"}),(0,i.createElement)(u.Rect,{width:"203",height:"38",x:"48",y:"662",rx:"2"}),(0,i.createElement)(u.Rect,{width:"38",height:"38",y:"662",rx:"2"}))),y="cart",E="checkout",C={cart:{type:y,title:(0,s.__)("Cart Shortcode","woocommerce"),description:(0,s.__)("Renders the classic cart shortcode.","woocommerce"),placeholder:"cart"},checkout:{type:E,title:(0,s.__)("Checkout Cart","woocommerce"),description:(0,s.__)("Renders the classic checkout shortcode.","woocommerce"),placeholder:"checkout"}},v=()=>!0,_=e=>[(0,l.createBlock)("woocommerce/checkout",{...e,className:"wc-block-checkout"})].filter(Boolean),R=()=>(0,s.__)("Classic Checkout","woocommerce"),B=()=>(0,s.__)("This block will render the classic checkout shortcode. You can optionally transform it into blocks for more control over the checkout experience.","woocommerce"),O={getButtonLabel:()=>(0,s.__)("Transform into blocks","woocommerce"),onClickCallback:({clientId:e,attributes:t,getBlocks:o,replaceBlock:c,selectBlock:r})=>{c(e,_(t));const i=o().find((e=>"core/group"===e.name&&e.innerBlocks.some((e=>"woocommerce/store-notices"===e.name))));i&&r(i.clientId)},getBlockifiedTemplate:_},P=()=>!0,L=e=>[(0,l.createBlock)("woocommerce/cart",{...e,className:"wc-block-cart"})].filter(Boolean),M=()=>(0,s.__)("Classic Cart","woocommerce"),j=()=>(0,s.__)("This block will render the classic cart shortcode. You can optionally transform it into blocks for more control over the cart experience.","woocommerce"),I={getButtonLabel:()=>(0,s.__)("Transform into blocks","woocommerce"),onClickCallback:({clientId:e,attributes:t,getBlocks:o,replaceBlock:c,selectBlock:r})=>{c(e,L(t));const i=o().find((e=>"core/group"===e.name&&e.innerBlocks.some((e=>"woocommerce/store-notices"===e.name))));i&&r(i.clientId)},getBlockifiedTemplate:L},S=JSON.parse('{"name":"woocommerce/classic-shortcode","version":"1.0.0","title":"Classic Shortcode","description":"Renders classic WooCommerce shortcodes.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":true,"html":false,"multiple":false,"reusable":false,"inserter":true},"attributes":{"shortcode":{"type":"string","default":"cart","enum":["cart","checkout"]},"align":{"type":"string","default":"wide"}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),T={[y]:r,[E]:c,fallback:{isConversionPossible:()=>!1,getBlockifiedTemplate:()=>[],getDescription:()=>"",onClickCallback:()=>{}}},N=({blockifyConfig:e,clientId:t,attributes:o})=>{const{getButtonLabel:c,onClickCallback:r,getBlockifiedTemplate:h}=e,[m,u]=(0,w.useState)(!1),{replaceBlock:g,selectBlock:k}=(0,d.useDispatch)(n.store),{createInfoNotice:f}=(0,d.useDispatch)(p.store),{getBlocks:b}=(0,d.useSelect)((e=>({getBlocks:e(n.store).getBlocks})),[]);return(0,i.createElement)(a.TabbableContainer,{className:"wp-block-woocommerce-classic-shortcode__placeholder-migration-button-container"},(0,i.createElement)(a.Button,{variant:"primary",onClick:()=>{r({clientId:t,getBlocks:b,attributes:o,replaceBlock:g,selectBlock:k}),f((0,s.__)("Classic shortcode transformed to blocks.","woocommerce"),{actions:[{label:(0,s.__)("Undo","woocommerce"),onClick:()=>{const e=["woocommerce/cart","woocommerce/checkout"],t=x({blocks:b(),findCondition:t=>e.includes(t.name)});t&&g(t.clientId,(0,l.createBlock)("woocommerce/classic-shortcode",{shortcode:o.shortcode}))}}],type:"snackbar"})},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),text:c?c():"",tabIndex:0},m&&(0,i.createElement)(a.Popover,{resize:!1,placement:"right-end"},(0,i.createElement)("div",{style:{minWidth:"250px",width:"250px",maxWidth:"250px",minHeight:"300px",height:"300px",maxHeight:"300px",cursor:"pointer"}},(0,i.createElement)(n.BlockPreview,{blocks:h({...o,isPreview:!0}),viewportWidth:1200,additionalStyles:[{css:"body { padding: 20px !important; height: fit-content !important; overflow:hidden}"}]})))),(0,i.createElement)(a.Button,{variant:"secondary",href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/",target:"_blank",tabIndex:0},(0,s.__)("Learn more","woocommerce")))},A=({clientId:e,attributes:t})=>{var o,c;const r=(0,n.useBlockProps)(),l=function(e,t){const o=Object.keys(t);let c=null;for(let r=0;o.length>r;r++){const i=t[e.substr(0,o[r].length)];if(i){c=i;break}}return c}(t.shortcode,C),m=t.shortcode,d=null!==(o=null==l?void 0:l.placeholder)&&void 0!==o?o:"cart",p=null!==(c=null==l?void 0:l.type)&&void 0!==c?c:"fallback",{isConversionPossible:u,getDescription:g,getTitle:x,blockifyConfig:y}=T[p],E=u(),v=x?x():(0,s.__)("Classic Shortcode Placeholder","woocommerce"),_=g(m,E),R=(0,w.createInterpolateElement)((0,s.__)("You can learn more about the benefits of switching to blocks, compatibility with extensions, and how to switch back to shortcodes <a>in our documentation</a>.","woocommerce"),{a:(0,i.createElement)(a.ExternalLink,{href:"https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/"})});return(0,i.createElement)("div",{...r},(0,i.createElement)(a.Placeholder,{className:"wp-block-woocommerce-classic-shortcode__placeholder"},(0,i.createElement)("div",{className:"wp-block-woocommerce-classic-shortcode__placeholder-wireframe"},"cart"===d?(0,i.createElement)(f,null):(0,i.createElement)(b,null)),(0,i.createElement)("div",{className:"wp-block-woocommerce-classic-shortcode__placeholder-copy"},(0,i.createElement)("div",{className:"wp-block-woocommerce-classic-shortcode__placeholder-copy__icon-container"},(0,i.createElement)("span",{className:"woo-icon-wrapper"},(0,i.createElement)(h.A,{icon:k})," ",(0,s.__)("WooCommerce","woocommerce")),(0,i.createElement)("span",null,v)),(0,i.createElement)("p",null,_),(0,i.createElement)("p",null,R),E&&y&&(0,i.createElement)(N,{clientId:e,blockifyConfig:y,attributes:t}))))},W={icon:(0,i.createElement)(h.A,{icon:m.A,className:"wc-block-editor-components-block-icon"}),edit:({attributes:e,clientId:t,setAttributes:o})=>(0,i.createElement)(A,{attributes:e,setAttributes:o,clientId:t}),save:()=>null,variations:[{name:"checkout",title:(0,s.__)("Classic Checkout","woocommerce"),attributes:{shortcode:"checkout"},isActive:(e,t)=>e.shortcode===t.shortcode,scope:["inserter"]},{name:"cart",title:(0,s.__)("Classic Cart","woocommerce"),attributes:{shortcode:"cart"},isActive:(e,t)=>e.shortcode===t.shortcode,scope:["inserter"],isDefault:!0}],apiVersion:3};(0,l.registerBlockType)(S,W)},4918:()=>{},120:()=>{},1609:e=>{"use strict";e.exports=window.React},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return c[e].call(o.exports,o,o.exports,i),o.exports}i.m=c,e=[],i.O=(t,o,c,r)=>{if(!o){var l=1/0;for(h=0;h<e.length;h++){for(var[o,c,r]=e[h],n=!0,a=0;a<o.length;a++)(!1&r||l>=r)&&Object.keys(i.O).every((e=>i.O[e](o[a])))?o.splice(a--,1):(n=!1,r<l&&(l=r));if(n){e.splice(h--,1);var s=c();void 0!==s&&(t=s)}}return t}r=r||0;for(var h=e.length;h>0&&e[h-1][2]>r;h--)e[h]=e[h-1];e[h]=[o,c,r]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var r=Object.create(null);i.r(r);var l={};t=t||[null,o({}),o([]),o(o)];for(var n=2&c&&e;"object"==typeof n&&!~t.indexOf(n);n=o(n))Object.getOwnPropertyNames(n).forEach((t=>l[t]=()=>e[t]));return l.default=()=>e,i.d(r,l),r},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=3035,(()=>{var e={3035:0};i.O.j=t=>0===e[t];var t=(t,o)=>{var c,r,[l,n,a]=o,s=0;if(l.some((t=>0!==e[t]))){for(c in n)i.o(n,c)&&(i.m[c]=n[c]);if(a)var h=a(i)}for(t&&t(o);s<l.length;s++)r=l[s],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return i.O(h)},o=self.webpackChunkwebpackWcBlocksMainJsonp=self.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var l=i.O(void 0,[94],(()=>i(6390)));l=i.O(l),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["classic-shortcode"]=l})();