woocommerce/10.267e66c0.iframe.bundle.js

1 line
63 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunk_woocommerce_storybook=self.webpackChunk_woocommerce_storybook||[]).push([[10],{"../../node_modules/.pnpm/@automattic+interpolate-components@1.2.1_@types+react@17.0.71_react@17.0.2/node_modules/@automattic/interpolate-components/dist/esm/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>interpolate});var react=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js");function identifyToken(item){return item.startsWith("{{/")?{type:"componentClose",value:item.replace(/\W/g,"")}:item.endsWith("/}}")?{type:"componentSelfClosing",value:item.replace(/\W/g,"")}:item.startsWith("{{")?{type:"componentOpen",value:item.replace(/\W/g,"")}:{type:"string",value:item}}function buildChildren(tokens,components){let openComponent,openIndex,children=[];for(let i=0;i<tokens.length;i++){const token=tokens[i];if("string"!==token.type){if(void 0===components[token.value])throw new Error(`Invalid interpolation, missing component node: \`${token.value}\``);if("object"!=typeof components[token.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${token.value}\``);if("componentClose"===token.type)throw new Error(`Missing opening component token: \`${token.value}\``);if("componentOpen"===token.type){openComponent=components[token.value],openIndex=i;break}children.push(components[token.value])}else children.push(token.value)}if(openComponent){const closeIndex=function getCloseIndex(openIndex,tokens){const openToken=tokens[openIndex];let nestLevel=0;for(let i=openIndex+1;i<tokens.length;i++){const token=tokens[i];if(token.value===openToken.value){if("componentOpen"===token.type){nestLevel++;continue}if("componentClose"===token.type){if(0===nestLevel)return i;nestLevel--}}}throw new Error("Missing closing component token `"+openToken.value+"`")}(openIndex,tokens),grandChildren=buildChildren(tokens.slice(openIndex+1,closeIndex),components),clonedOpenComponent=(0,react.cloneElement)(openComponent,{},grandChildren);if(children.push(clonedOpenComponent),closeIndex<tokens.length-1){const siblings=buildChildren(tokens.slice(closeIndex+1),components);children=children.concat(siblings)}}return children=children.filter(Boolean),0===children.length?null:1===children.length?children[0]:(0,react.createElement)(react.Fragment,null,...children)}function interpolate(options){const{mixedString,components,throwErrors}=options;if(!components)return mixedString;if("object"!=typeof components){if(throwErrors)throw new Error(`Interpolation Error: unable to process \`${mixedString}\` because components is not an object`);return mixedString}const tokens=function tokenize(mixedString){return mixedString.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(identifyToken)}(mixedString);try{return buildChildren(tokens,components)}catch(error){if(throwErrors)throw new Error(`Interpolation Error: unable to process \`${mixedString}\` because of error \`${error.message}\``);return mixedString}}},"../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/card/card-footer/component.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>card_footer_component});var esm_extends=__webpack_require__("../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/extends.js"),react=__webpack_require__("../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"),context_connect=__webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llglu/node_modules/@wordpress/components/build-module/ui/context/context-connect.js"),component=__webpack_require__("../../node_modules/.pnpm/@wordpress+components@19.8.5_@types+react@17.0.71_react-dom@17.0.2_react@17.0.2__react-with-d_oli5xz3n7pc4ztqokra47llgl