Socket
Socket
Sign inDemoInstall

richlagetest

Package Overview
Dependencies
0
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-62f0dcaa5d7b632a563724e31f54c2059aad4fb8 to 0.0.0-63f8aca91c5b2536658cdc37bb50277af0e339e3

dist/lib/contentAnalytics.cjs.js

4

dist/module.cjs.js

@@ -1,2 +0,4 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends=require("@babel/runtime/helpers/extends"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),wixRichContentPluginCommons=require("wix-rich-content-plugin-commons"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),wixRichContentCommon=require("wix-rich-content-common"),verticalEmbedSchema=require("wix-rich-content-common/dist/statics/schemas/vertical-embed.schema.json"),classnames=require("classnames"),lodash=require("lodash"),wixRichContentEditorCommon=require("wix-rich-content-editor-common"),wixRichContentUiComponents=require("wix-rich-content-ui-components");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _dataTypeMapper,_extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),verticalEmbedSchema__default=_interopDefaultLegacy(verticalEmbedSchema),classnames__default=_interopDefaultLegacy(classnames),VERTICAL_EMBED_TYPE="wix-draft-plugin-vertical-embed",styles$3={card:"eSWSJ",link:"_3FwrF",container:"aMyTV",image:"_3hjHR",cardLayout:"_33kqy",content:"_26Lqs",title:"_1Npvf",subtitle:"_2a6W8",button:"MUh8b",buttonText:"_2tWJB",slimLayout:"nep6I",rtl:"_atWu",ltr:"_15JaP"},verticalEmbedProviders={event:"event",booking:"booking",product:"product"},contentTypeMap={event:"Events",booking:"Bookings",product:"Stores"},modalContentStyles={width:440,height:522,padding:20,boxSizing:"border-box",border:"solid 1px rgba(51, 51, 51, 0.1)",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"},convertDuration=function(durationInMinutes,t){if(!lodash.isNumber(durationInMinutes))return"";if(durationInMinutes<60)return t("VerticalEmbed_Units_Minute",{minutes:durationInMinutes});var hours=durationInMinutes/60,rhours=Math.floor(hours),minutes=60*(hours-rhours),rminutes=Math.round(minutes);return 0===rminutes?t("VerticalEmbed_Units_Hour",{hours:rhours}):t("VerticalEmbed_Units_Hour",{hours:rhours})+" "+t("VerticalEmbed_Units_Minute",{minutes:rminutes})},dataTypeMapper=((_dataTypeMapper={})[verticalEmbedProviders.booking]=function(data,t){var name=data.name,imageSrc=data.imageSrc,pageUrl=data.pageUrl,durations=data.durations;return{url:pageUrl,imageSrc:imageSrc,content:{title:name,info:{leftSubtitle:durations&&convertDuration(durations,t)},buttonText:t("VerticalEmbed_Bookings_Button")}}},_dataTypeMapper[verticalEmbedProviders.event]=function(data,t){var name=data.name,imageSrc=data.imageSrc,scheduling=data.scheduling;return{url:data.pageUrl,imageSrc:imageSrc,content:{title:name,info:{leftSubtitle:scheduling,rightSubtitle:data.location},buttonText:t("VerticalEmbed_Events_Button")}}},_dataTypeMapper[verticalEmbedProviders.product]=function(data,t){var name=data.name,imageSrc=data.imageSrc;return{url:data.pageUrl,imageSrc:imageSrc,content:{title:name,buttonText:t("VerticalEmbed_Products_Button")}}},_dataTypeMapper),CardContent=function(props){var title=props.title,info=props.info,buttonText=props.buttonText;return React__default.default.createElement("div",{className:styles$3.content},React__default.default.createElement("div",null,React__default.default.createElement("div",{className:styles$3.title},function(title){return title.length<=80?title:title.substring(0,80)+"..."}(title)),info&&function(info){return info.leftSubtitle&&React__default.default.createElement("div",{className:styles$3.subtitle},info.leftSubtitle,info.rightSubtitle&&React__default.default.createElement("span",null,React__default.default.createElement("span",{className:styles$3.right},"|"),info.rightSubtitle))}(info)),React__default.default.createElement("div",{className:styles$3.button},React__default.default.createElement("div",{className:styles$3.buttonText},buttonText)))},Card=function(props){var url=props.url,imageSrc=props.imageSrc,content=props.content,direction=props.direction;return React__default.default.createElement("a",{className:styles$3.link,href:url,target:"_blank"},React__default.default.createElement("div",{style:{direction:direction},className:classnames__default.default(styles$3[direction],styles$3.container,styles$3.cardLayout)},imageSrc&&React__default.default.createElement("div",{style:{backgroundImage:"url("+imageSrc+")"},className:styles$3.image}),React__default.default.createElement(CardContent,content)))},VerticalEmbedComponent=function(_PureComponent){function VerticalEmbedComponent(props){var _this;return(_this=_PureComponent.call(this,props)||this).onClick=function(){var _this$props$helpers$o,_this$props$helpers;return null===(_this$props$helpers$o=(_this$props$helpers=_this.props.helpers).onViewerAction)||void 0===_this$props$helpers$o?void 0:_this$props$helpers$o.call(_this$props$helpers,VERTICAL_EMBED_TYPE,"Click",_this.props.componentData.type)},wixRichContentCommon.validate(props.componentData,verticalEmbedSchema__default.default),_this}return _inheritsLoose__default.default(VerticalEmbedComponent,_PureComponent),VerticalEmbedComponent.prototype.render=function(){var _classnames,_this$props=this.props,componentData=_this$props.componentData,className=_this$props.className,_this$props$settings$=_this$props.settings.slimLayout,slimLayout=void 0!==_this$props$settings$&&_this$props$settings$,t=_this$props.t,locale=_this$props.locale,selectedProduct=componentData.selectedProduct,type=componentData.type,props=dataTypeMapper[type](selectedProduct,t),direction=wixRichContentCommon.getLangDir(locale);return React__default.default.createElement("div",{className:classnames__default.default(className,styles$3.card,(_classnames={},_classnames[styles$3.slimLayout]=slimLayout,_classnames)),"data-hook":"vertical-embed",onClick:this.onClick},React__default.default.createElement(Card,_extends__default.default({},props,{t:t,direction:direction})))},VerticalEmbedComponent}(React.PureComponent),Event=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 25 24"},props),React__default.default.createElement("g",{fill:"currentColor",fillRule:"evenodd"},React__default.default.createElement("path",{d:"M2.526 21.553h18.948V3.789H2.526v17.764zm1.185-14.21h16.578v-2.37H3.711v2.37zm0 13.025h16.578V8.526H3.711v11.842z",transform:"translate(.333)"}),React__default.default.createElement("path",{d:"M8.16 0L8.842 0.682 3.599 6.316 0 3.461 0.583 2.684 3.508 4.985z",transform:"translate(.333) translate(7.579 11.368)"}),React__default.default.createElement("path",{stroke:"currentColor",d:"M16.921 3.026H17.921V5.8149999999999995H16.921zM6.816 3.026H7.816V5.8149999999999995H6.816z",transform:"translate(.333)"})))},Product=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"19",height:"19",viewBox:"0 0 25 24"},props),React__default.default.createElement("defs",null,React__default.default.createElement("filter",{id:"prefix__a",width:"179.2%",height:"215.2%",x:"-39.6%",y:"-57.6%",filterUnits:"objectBoundingBox"},React__default.default.createElement("feOffset",{in:"SourceAlpha",result:"shadowOffsetOuter1"}),React__default.default.createElement("feMorphology",{in:"SourceAlpha",radius:"1",result:"shadowInner"}),React__default.default.createElement("feOffset",{in:"shadowInner",result:"shadowInner"}),React__default.default.createElement("feComposite",{in:"shadowOffsetOuter1",in2:"shadowInner",operator:"out",result:"shadowOffsetOuter1"}),React__default.default.createElement("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"2.5"}),React__default.default.createElement("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"})),React__default.default.createElement("path",{id:"prefix__b",d:"M0 4.737L18.947 4.737 17.763 17.763 1.184 17.763z"})),React__default.default.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(3.193 2.526)"},React__default.default.createElement("use",{fill:"currentColor",filter:"url(#prefix__a)",xlinkHref:"#prefix__b"}),React__default.default.createElement("path",{stroke:"currentColor",strokeLinecap:"square",d:"M18.4 5.237H.548L1.64 17.263h15.666L18.4 5.237z"}),React__default.default.createElement("path",{fillRule:"nonzero",stroke:"currentColor",d:"M5.921 4.737v-.948C5.921 1.697 7.511 0 9.474 0c1.962 0 3.552 1.697 3.552 3.79v.947"})))},Booking=function(props){return React__default.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 24 24"},props),React__default.default.createElement("g",{fill:"currentColor",fillRule:"evenodd"},React__default.default.createElement("path",{d:"M21.474 3.79v17.763H2.526V3.789h18.948zm-1.185 4.736H3.711v11.842h16.578V8.526zm-2.368 7.106V18h-2.368v-2.368h2.368zm-4.737 0V18h-2.368v-2.368h2.368zm-4.737 0V18H6.08v-2.368h2.368zm0-4.737v2.368H6.08v-2.368h2.368zm4.737 0v2.368h-2.368v-2.368h2.368zm4.737 0v2.368h-2.368v-2.368h2.368zm2.368-5.921H3.711v2.37h16.578v-2.37z"}),React__default.default.createElement("path",{stroke:"currentColor",d:"M16.921 3.026H17.921V5.8149999999999995H16.921zM6.816 3.026H7.816V5.8149999999999995H6.816z"})))},ReplaceIcon=function(props){return React__default.default.createElement("svg",Object.assign({xmlnsXlink:"http://www.w3.org/1999/xlink",width:19,height:19,viewBox:"0 0 19 19"},props),React__default.default.createElement("defs",null,React__default.default.createElement("path",{id:"replace-path",d:"M3 7.8V3.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2v2.592A6.607 6.607 0 0 1 9.412 3C13.05 3 16 5.91 16 9.5c0 .168-.006.335-.02.5h-1.016a5.51 5.51 0 0 0 .022-.5c0-3.038-2.495-5.5-5.574-5.5a5.583 5.583 0 0 0-4.967 3H7.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H3.2a.2.2 0 0 1-.2-.2zm13 3.4v4.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2v-2.592A6.607 6.607 0 0 1 9.588 16C5.95 16 3 13.09 3 9.5c0-.168.006-.335.02-.5h1.016a5.496 5.496 0 0 0-.022.5c0 3.038 2.495 5.5 5.574 5.5a5.583 5.583 0 0 0 4.967-3H11.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h4.6c.11 0 .2.09.2.2z"})),React__default.default.createElement("g",{fillRule:"evenodd"},React__default.default.createElement("mask",{id:"replace-mask"},React__default.default.createElement("use",{xlinkHref:"#replace-path"})),React__default.default.createElement("use",{fillRule:"nonzero",xlinkHref:"#replace-path"})))},getModalCustomStyles=function(isMobile){var content={maxWidth:580,minHeight:585};return isMobile&&(content=_extends__default.default({},content,{minHeight:"100%",minWidth:"100%",margin:0,alignContent:"center",top:0,transform:"none",backgroundColor:"white"})),{content:content}},styles$2_container="_2Q-rY",styles$2_mobile="rO2EZ",generalStyles_emptyState="_2FaLJ",generalStyles_title="_3QLpw",generalStyles_description="_25CzD",styles$1_container="_2S0Vi",styles$1_selected="pS_Dt",styles$1_image="dcuVD",styles$1_title="bIcfu",styles$1_description="_3nVAQ",Item=function(_PureComponent){function Item(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_PureComponent.call.apply(_PureComponent,[this].concat(args))||this).itemRef=React__default.default.createRef(),_this.handleClick=function(){return _this.props.onClick(_this.props.item)},_this}_inheritsLoose__default.default(Item,_PureComponent);var _proto=Item.prototype;return _proto.componentDidMount=function(){var _this$itemRef;this.props.selected&&(null===(_this$itemRef=this.itemRef)||void 0===_this$itemRef||_this$itemRef.current.scrollIntoView())},_proto.render=function(){var _this$props=this.props,selected=_this$props.selected,item=_this$props.item;_this$props.t;var name=item.name,imageSrc=item.imageSrc,getDescription=item.getDescription;return React__default.default.createElement("div",{ref:this.itemRef,className:classnames__default.default(styles$1_container,selected&&styles$1_selected),onClick:this.handleClick},React__default.default.createElement("div",{style:{backgroundImage:"url("+imageSrc+")"},className:styles$1_image,"data-hook":"verticalsImage"}),React__default.default.createElement("div",{className:styles$1_title},name),getDescription&&React__default.default.createElement("div",{className:styles$1_description},getDescription(item)))},Item}(React.PureComponent),ItemsList=function(_PureComponent){function ItemsList(props){var _this;return(_this=_PureComponent.call(this,props)||this).state={selectedItem:{}},_this}return _inheritsLoose__default.default(ItemsList,_PureComponent),ItemsList.prototype.render=function(){var _cx,_this$props=this.props,items=_this$props.items,onClick=_this$props.onClick,selectedItem=_this$props.selectedItem,contentType=_this$props.contentType,t=_this$props.t,isMobile=_this$props.isMobile,emptyState=React__default.default.createElement("div",{className:generalStyles_emptyState},React__default.default.createElement("div",{className:generalStyles_title},t("Embed_Vertical_"+contentType+"_EmptyState_NoItems_Title")),React__default.default.createElement("div",{className:generalStyles_description},t("Embed_Vertical_"+contentType+"_EmptyState_NoItems_Description")));return React__default.default.createElement("div",{className:classnames__default.default(styles$2_container,(_cx={},_cx[styles$2_mobile]=isMobile,_cx)),"data-hook":"verticalsItemsList"},items.length>0?items.map((function(item,index){return React__default.default.createElement(Item,{item:item,key:index,onClick:onClick,selected:(null==selectedItem?void 0:selectedItem.id)===item.id,t:t})})):emptyState)},ItemsList}(React.PureComponent),styles_itemsWrapper="_1OMRl",styles_fileLoaderIcon="_3hZQC",_excluded=["getDescription"],VerticalEmbedInputModal=function(_Component){function VerticalEmbedInputModal(){for(var _this$props$component,_this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={errorMsg:"",items:[],selectedProduct:(null===(_this$props$component=_this.props.componentData)||void 0===_this$props$component?void 0:_this$props$component.selectedProduct)||null,status:"LOADING"},_this.onInputChange=function(inputString){void 0===inputString&&(inputString=""),_this.verticalApi.search(inputString).then((function(items){_this.setState({items:items,status:0===items.length?"NOT_FOUND":"READY"})})),_this.setState({inputString:inputString})},_this.onConfirm=function(){var _this$props=_this.props,onConfirm=_this$props.onConfirm,componentData=_this$props.componentData,helpers=_this$props.helpers,onReplace=_this$props.onReplace,selectedProduct=_this.state.selectedProduct;selectedProduct&&((onConfirm||onReplace)(_extends__default.default({},componentData,{selectedProduct:selectedProduct})),helpers.closeModal())},_this.onItemClick=function(_ref){_ref.getDescription;var item=_objectWithoutPropertiesLoose__default.default(_ref,_excluded),_this$state=_this.state,selectedProduct=_this$state.selectedProduct;_this$state.items,item.id===(null==selectedProduct?void 0:selectedProduct.id)?_this.onConfirm():_this.setState({selectedProduct:item})},_this.getItems=function(){var getDescription,_this$props2=_this.props,type=_this$props2.componentData.type,t=_this$props2.t,items=_this.state.items;return type===verticalEmbedProviders.booking?getDescription=function(product){return convertDuration(product.durations,t)}:type===verticalEmbedProviders.event&&(getDescription=function(product){return product.scheduling+" | "+product.location}),getDescription?items.map((function(product){return _extends__default.default({},product,{getDescription:getDescription})})):items},_this}_inheritsLoose__default.default(VerticalEmbedInputModal,_Component);var _proto=VerticalEmbedInputModal.prototype;return _proto.componentDidMount=function(){var _this2=this,_this$props3=this.props,verticalsApi=_this$props3.verticalsApi,type=_this$props3.componentData.type,locale=_this$props3.locale;this.verticalApi=verticalsApi(type,locale);try{this.verticalApi.search("").then((function(items){_this2.setState({items:items,status:0===items.length?"NO_ITEMS":"READY"})}))}catch(e){console.error("failed to load products ",e),this.setState({items:[],status:"NO_ITEMS"})}},_proto.render=function(){var _experiments$newVerti,_this$state2=this.state,inputString=_this$state2.inputString,selectedProduct=_this$state2.selectedProduct,status=_this$state2.status,_this$props4=this.props,t=_this$props4.t,type=_this$props4.componentData.type,helpers=_this$props4.helpers,isMobile=_this$props4.isMobile,experiments=_this$props4.experiments,contentType=contentTypeMap[type],selected=null!==selectedProduct,emptyState=React__default.default.createElement("div",{className:generalStyles_emptyState},React__default.default.createElement("div",{className:generalStyles_title},t("Embed_Vertical_"+contentType+"_EmptyState_NoResults_Title")),React__default.default.createElement("div",{className:generalStyles_description},t("Embed_Vertical_"+contentType+"_EmptyState_NoResults_Description"))),textInput=!!("NO_ITEMS"!==status)&&{searchIcon:!0},UrlInputModalComponent=(null==experiments||null===(_experiments$newVerti=experiments.newVerticalEmbedModal)||void 0===_experiments$newVerti?void 0:_experiments$newVerti.enabled)?wixRichContentUiComponents.SearchInputModal:wixRichContentUiComponents.UrlInputModal;return React__default.default.createElement(UrlInputModalComponent,{onConfirm:this.onConfirm,helpers:helpers,t:t,title:t("Embed_Vertical_"+contentType+"_Title"),dataHook:"verticalEmbedModal",placeholder:t("Embed_Vertical_"+contentType+"_Placeholder"),saveLabel:t("Embed_Add_Button_Label"),onCloseRequested:helpers.closeModal,onInputChange:this.onInputChange,input:inputString,isMobile:isMobile,buttonAlignment:wixRichContentUiComponents.FOOTER_BUTTON_ALIGNMENT.END,controlsPosition:isMobile?wixRichContentUiComponents.MODAL_CONTROLS_POSITION.TOP:wixRichContentUiComponents.MODAL_CONTROLS_POSITION.BOTTOM,selected:selected,textInput:textInput,buttonSize:wixRichContentUiComponents.BUTTON_SIZE.small,showTitle:!isMobile},React__default.default.createElement("div",{className:styles_itemsWrapper},"LOADING"===status?React__default.default.createElement("div",{className:generalStyles_emptyState},React__default.default.createElement(wixRichContentPluginCommons.LoaderIcon,{className:styles_fileLoaderIcon})):"NOT_FOUND"===status?emptyState:React__default.default.createElement(ItemsList,{isMobile:isMobile,selectedItem:selectedProduct,items:this.getItems(),onClick:this.onItemClick,contentType:contentType,t:t})))},VerticalEmbedInputModal}(React.Component),createInlineButtons=function(_ref){var t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,locale=_ref.locale,_ref$experiments=_ref.experiments,newVerticalEmbedModal=(void 0===_ref$experiments?{}:_ref$experiments).newVerticalEmbedModal,useNewModal=null==newVerticalEmbedModal?void 0:newVerticalEmbedModal.enabled,newModalCustomStyles=isMobile?wixRichContentUiComponents.MOBILE_FULL_SCREEN_CUSTOM_STYLE:_extends__default.default({},wixRichContentUiComponents.DesktopFlyOutModalStyles,{content:modalContentStyles}),customStyles=useNewModal?newModalCustomStyles:getModalCustomStyles(isMobile),defaultModalStyles=wixRichContentEditorCommon.getModalStyles({customStyles:customStyles,fullScreen:!!useNewModal,isMobile:isMobile}),modalStyles=useNewModal?isMobile?defaultModalStyles:void 0:defaultModalStyles;return[{keyName:"replace",type:wixRichContentPluginCommons.BUTTONS.EXTERNAL_MODAL,icon:ReplaceIcon,modalElement:wixRichContentEditorCommon.decorateComponentWithProps(VerticalEmbedInputModal,_extends__default.default({},settings,{locale:locale})),modalStyles:modalStyles,mobile:!0,tooltipTextKey:"Replace product",t:t,modalStylesFn:useNewModal?function(_ref2){var buttonRef=_ref2.buttonRef,modalStyles=wixRichContentEditorCommon.getModalStyles({customStyles:newModalCustomStyles,fullScreen:!0,isMobile:isMobile}),_buttonRef$getBoundin=buttonRef.getBoundingClientRect(),top=_buttonRef$getBoundin.top,modalLeft=_buttonRef$getBoundin.left-15,modalTop=top>522?top-540:top+40;return _extends__default.default({},modalStyles,{content:_extends__default.default({},modalStyles.content,{top:modalTop,left:modalLeft,margin:0,position:"absolute"})})}:void 0},{keyName:"delete",type:wixRichContentPluginCommons.BUTTONS.DELETE,mobile:!0}]},createInsertButtons=function(_ref){var _experiments$newVerti,t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile,locale=_ref.locale,_ref$experiments=_ref.experiments,experiments=void 0===_ref$experiments?{}:_ref$experiments,iconsMap={product:Product,event:Event,booking:Booking},useNewModal=null==experiments||null===(_experiments$newVerti=experiments.newVerticalEmbedModal)||void 0===_experiments$newVerti?void 0:_experiments$newVerti.enabled,newModalCustomStyles=isMobile?wixRichContentUiComponents.MOBILE_FULL_SCREEN_CUSTOM_STYLE:_extends__default.default({},wixRichContentUiComponents.DesktopFlyOutModalStyles,{content:modalContentStyles}),customStyles=useNewModal?newModalCustomStyles:getModalCustomStyles(isMobile),modalStylesFn=useNewModal?function(_ref2){var buttonRef=_ref2.buttonRef,toolbarName=_ref2.toolbarName;return wixRichContentEditorCommon.getBottomToolbarModalStyles(buttonRef,{customStyles:customStyles},toolbarName)}:void 0,defaultModalStyles=wixRichContentEditorCommon.getModalStyles({customStyles:customStyles,fullScreen:!!useNewModal,isMobile:isMobile}),modalStyles=useNewModal?isMobile?defaultModalStyles:void 0:defaultModalStyles,_settings$exposeEmbed=settings.exposeEmbedButtons,exposeEmbedButtons=void 0===_settings$exposeEmbed?[]:_settings$exposeEmbed,getIsVisiblePromise=settings.getIsVisiblePromise,buttonsBaseProps=function(type){var contentType=contentTypeMap[type];return{type:wixRichContentEditorCommon.BUTTON_TYPES.MODAL,name:contentType+"_InsertButton",tooltip:t(contentType+"Plugin_InsertButton_Tooltip"),getIcon:function(){return iconsMap[type]},Icon:iconsMap[type],componentData:{type:type},section:"BlockToolbar_Section_Embed_Wix",modalElement:wixRichContentEditorCommon.decorateComponentWithProps(VerticalEmbedInputModal,_extends__default.default({},settings,{locale:locale})),isVisiblePromise:null==getIsVisiblePromise?void 0:getIsVisiblePromise(type,locale),modalStylesFn:modalStylesFn}},toolbars=useNewModal?[wixRichContentEditorCommon.TOOLBARS.MOBILE,wixRichContentEditorCommon.TOOLBARS.FOOTER,wixRichContentEditorCommon.TOOLBARS.SIDE]:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN,wixRichContentEditorCommon.TOOLBARS.MOBILE,wixRichContentEditorCommon.TOOLBARS.FOOTER,wixRichContentEditorCommon.TOOLBARS.SIDE],verticalEmbedButtons=exposeEmbedButtons.map((function(verticalType){return _extends__default.default({},buttonsBaseProps(verticalType),{toolbars:toolbars,modalStyles:modalStyles})}));if(useNewModal){var externalToolbarButtons=exposeEmbedButtons.map((function(verticalType){return _extends__default.default({},buttonsBaseProps(verticalType),{toolbars:[wixRichContentEditorCommon.TOOLBARS.INSERT_PLUGIN],modalStyles:wixRichContentEditorCommon.getModalStyles({customStyles:_extends__default.default({},customStyles,wixRichContentUiComponents.DesktopOverlayModalStyles),fullScreen:!1,isMobile:isMobile})})}));verticalEmbedButtons=[].concat(verticalEmbedButtons,externalToolbarButtons)}return verticalEmbedButtons},createToolbar=function(_ref){var settings=_ref.settings,t=_ref.t,isMobile=_ref.isMobile,locale=_ref.locale,experiments=_ref.experiments;return{InlineButtons:createInlineButtons({t:t,isMobile:isMobile,settings:settings,locale:locale,experiments:experiments}),InsertButtons:createInsertButtons({t:t,settings:settings,isMobile:isMobile,locale:locale,experiments:experiments}),name:"vertical-embed"}};function _toPropertyKey(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}var _ModalsMap,createVerticalEmbedPlugin=function(config){var type=VERTICAL_EMBED_TYPE,helpers=config.helpers,theme=config.theme,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,isMobile=config.isMobile,locale=config.locale,localeContent=config.localeContent,experiments=config.experiments,rest=_objectWithoutPropertiesLoose__default.default(config,["helpers","theme","t",type,"isMobile","locale","localeContent","experiments"].map(_toPropertyKey));return wixRichContentPluginCommons.createBasePlugin(_extends__default.default({component:VerticalEmbedComponent,settings:settings,theme:theme,type:type,toolbar:createToolbar({settings:settings,helpers:helpers,t:t,isMobile:isMobile,locale:localeContent||locale,experiments:experiments}),helpers:helpers,t:t,defaultPluginData:{},isMobile:isMobile,locale:localeContent||locale},rest))};createVerticalEmbedPlugin.functionName=VERTICAL_EMBED_TYPE;var Modals={POST_SELECTION_INPUT:"post-selection-input"},ModalsMap=((_ModalsMap={})[Modals.POST_SELECTION_INPUT]=VerticalEmbedInputModal,_ModalsMap);exports.Modals=Modals,exports.ModalsMap=ModalsMap,exports.VERTICAL_EMBED_TYPE=VERTICAL_EMBED_TYPE,exports.createVerticalEmbedPlugin=createVerticalEmbedPlugin,exports.pluginVerticalEmbed=function(config){return{config:_extends__default.default({},config),type:VERTICAL_EMBED_TYPE,createPlugin:createVerticalEmbedPlugin,ModalsMap:ModalsMap}},exports.verticalEmbedProviders=verticalEmbedProviders;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ricosContent=require("ricos-content"),_inheritsLoose=require("@babel/runtime/helpers/inheritsLoose"),React=require("react"),reactIntersectionObserver=require("react-intersection-observer"),classNames=require("classnames"),_extends=require("@babel/runtime/helpers/extends"),lodash=require("lodash"),_objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),_asyncToGenerator=require("@babel/runtime/helpers/asyncToGenerator"),_regeneratorRuntime=require("@babel/runtime/regenerator"),reactI18next=require("react-i18next"),i18next=require("i18next");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(k){if("default"!==k){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}})),n.default=e,Object.freeze(n)}var _inheritsLoose__default=_interopDefaultLegacy(_inheritsLoose),React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),_extends__default=_interopDefaultLegacy(_extends),_objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_asyncToGenerator__default=_interopDefaultLegacy(_asyncToGenerator),_regeneratorRuntime__default=_interopDefaultLegacy(_regeneratorRuntime),__assign$r=function(){return(__assign$r=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};var _DRAFT_TO_RICOS_DOC_T,ButtonType,ModifierKey,ToolbarType,DisplayMode,DecorationMode,baseLink={target:"SELF"},Link_fromJSON=function(object){var message=__assign$r({},baseLink);return void 0!==object.url&&null!==object.url?message.url=String(object.url):message.url=void 0,void 0!==object.anchor&&null!==object.anchor?message.anchor=String(object.anchor):message.anchor=void 0,void 0!==object.target&&null!==object.target?message.target=function(object){switch(object){case 0:case"SELF":return"SELF";case 1:case"BLANK":return"BLANK";case 2:case"PARENT":return"PARENT";case 3:case"TOP":return"TOP";case-1:case"UNRECOGNIZED":default:return"UNRECOGNIZED"}}(object.target):message.target="SELF",void 0!==object.rel&&null!==object.rel?message.rel=Link_Rel.fromJSON(object.rel):message.rel=void 0,void 0!==object.customData&&null!==object.customData?message.customData=String(object.customData):message.customData=void 0,message},Link_toJSON=function(message){var obj={};return void 0!==message.url&&(obj.url=message.url),void 0!==message.anchor&&(obj.anchor=message.anchor),void 0!==message.target&&(obj.target=function(object){switch(object){case"SELF":return"SELF";case"BLANK":return"BLANK";case"PARENT":return"PARENT";case"TOP":return"TOP";default:return"UNKNOWN"}}(message.target)),void 0!==message.rel&&(obj.rel=message.rel?Link_Rel.toJSON(message.rel):void 0),void 0!==message.customData&&(obj.customData=message.customData),obj},baseLink_Rel={},Link_Rel={fromJSON:function(object){var message=__assign$r({},baseLink_Rel);return void 0!==object.nofollow&&null!==object.nofollow?message.nofollow=Boolean(object.nofollow):message.nofollow=void 0,void 0!==object.sponsored&&null!==object.sponsored?message.sponsored=Boolean(object.sponsored):message.sponsored=void 0,void 0!==object.ugc&&null!==object.ugc?message.ugc=Boolean(object.ugc):message.ugc=void 0,message},toJSON:function(message){var obj={};return void 0!==message.nofollow&&(obj.nofollow=message.nofollow),void 0!==message.sponsored&&(obj.sponsored=message.sponsored),void 0!==message.ugc&&(obj.ugc=message.ugc),obj}},__assign$n=function(){return(__assign$n=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},baseLinkData={},LinkData={fromJSON:function(object){var message=__assign$n({},baseLinkData);return void 0!==object.link&&null!==object.link?message.link=Link_fromJSON(object.link):message.link=void 0,message},toJSON:function(message){var obj={};return void 0!==message.link&&(obj.link=message.link?Link_toJSON(message.link):void 0),obj}},DRAFT_TO_RICOS_DOC_TYPE=((_DRAFT_TO_RICOS_DOC_T={})[ricosContent.HEADER_BLOCK.ONE]="headerOne",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.TWO]="headerTwo",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.THREE]="headerThree",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.FOUR]="headerFour",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.FIVE]="headerFive",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.SIX]="headerSix",_DRAFT_TO_RICOS_DOC_T[ricosContent.HEADER_BLOCK.PARAGRAPH]="paragraph",_DRAFT_TO_RICOS_DOC_T);exports.ButtonType=void 0,(ButtonType=exports.ButtonType||(exports.ButtonType={})).CUSTOM="custom",ButtonType.FILES="file",ButtonType.TOGGLE="toggle",ButtonType.PANEL="panel",ButtonType.INLINE_PANEL="inline-panel",ButtonType.EXTERNAL_MODAL="external-modal",ButtonType.DROPDOWN="dropdown",ButtonType.SEPARATOR="separator",ButtonType.SIZE_ORIGINAL="size-original",ButtonType.SIZE_CONTENT_CENTER="size-content-center",ButtonType.SIZE_SMALL_CENTER="size-small-center",ButtonType.SIZE_SMALL_LEFT="size-small-left",ButtonType.SIZE_SMALL_RIGHT="size-small-right",ButtonType.ALIGN_LEFT="align-left",ButtonType.ALIGN_RIGHT="align-right",ButtonType.ALIGN_CENTER="align-center",ButtonType.SIZE_CONTENT="size-content",ButtonType.SIZE_FULL_WIDTH="size-full-width",ButtonType.SIZE_SMALL="size-small",ButtonType.SIZE_MEDIUM="size-medium",ButtonType.SIZE_LARGE="size-large",ButtonType.TEXT_ALIGN_LEFT="alignment-left",ButtonType.TEXT_ALIGN_CENTER="alignment-center",ButtonType.TEXT_ALIGN_RIGHT="alignment-right",ButtonType.WIDTH="width",ButtonType.HEIGHT="height",ButtonType.LINK="link",ButtonType.SPOILER="spoiler",ButtonType.DELETE="delete",ButtonType.LINK_PREVIEW="link-preview",ButtonType.VIDEO_SETTINGS="video-settings",exports.ModifierKey=void 0,(ModifierKey=exports.ModifierKey||(exports.ModifierKey={})).COMMAND="command",ModifierKey.CTRL="ctrl",ModifierKey.OPTION="option",ModifierKey.SHIFT="shift",ModifierKey.ALT="alt",exports.ToolbarType=void 0,(ToolbarType=exports.ToolbarType||(exports.ToolbarType={})).SIDE="SIDE",ToolbarType.MOBILE="MOBILE",ToolbarType.FOOTER="FOOTER",ToolbarType.STATIC="STATIC",ToolbarType.INLINE="INLINE",ToolbarType.PLUGIN="PLUGIN",ToolbarType.FORMATTING="FORMATTING",ToolbarType.INSERT_PLUGIN="INSERT_PLUGIN",ToolbarType.TEXT="ALL-TEXT-TOOLBARS",ToolbarType.SHORTCUT="SHORTCUT",ToolbarType.LINK="LINK",exports.DisplayMode=void 0,(DisplayMode=exports.DisplayMode||(exports.DisplayMode={})).NORMAL="NORMAL",DisplayMode.FLOATING="FLOATING",exports.DecorationMode=void 0,(DecorationMode=exports.DecorationMode||(exports.DecorationMode={})).PREPEND="PREPEND",DecorationMode.WRAP="WRAP",DecorationMode.APPEND="APPEND";var noOutlineStyle_noOutline="_1-vl0",AccessibilityListener=function(_Component){function AccessibilityListener(){var _this;return(_this=_Component.apply(this,arguments)||this).handleTabKeyUp=function(e){9===e.which&&document.body.classList.contains(noOutlineStyle_noOutline)&&document.body.classList.remove(noOutlineStyle_noOutline)},_this.handleClick=function(){document.body.classList.contains(noOutlineStyle_noOutline)||document.body.classList.add(noOutlineStyle_noOutline)},_this.render=function(){return null},_this}_inheritsLoose__default.default(AccessibilityListener,_Component);var _proto=AccessibilityListener.prototype;return _proto.componentDidMount=function(){document.body.classList.add(noOutlineStyle_noOutline),this.props.isMobile||(document.addEventListener("keyup",this.handleTabKeyUp),document.addEventListener("click",this.handleClick))},_proto.componentWillUnmount=function(){this.props.isMobile||(document.removeEventListener("keyup",this.handleTabKeyUp),document.removeEventListener("click",this.handleClick))},AccessibilityListener}(React.Component),cssClassMerger=function(defaultStyleClassName,themeClassName){return defaultStyleClassName+" "+themeClassName},mergeStyles=function(_ref){var styles=_ref.styles,theme=_ref.theme;if(!theme)return console.warn("mergeStyles invoked without theme!"),styles;var themeStyles=lodash.pickBy(theme),themeStylesToMerge=lodash.pickBy(themeStyles,(function(_,key){return lodash.has(styles,key)}));return lodash.mergeWith(_extends__default.default({},styles),themeStylesToMerge,cssClassMerger)},isSSR=function(){return"undefined"==typeof window},styles={placeholder:"_2bUeE"},ViewportRenderer=function(_Component){function ViewportRenderer(){return _Component.apply(this,arguments)||this}return _inheritsLoose__default.default(ViewportRenderer,_Component),ViewportRenderer.prototype.render=function(){var _this=this,_this$props=this.props,children=_this$props.children,placeholderStyle=_this$props.placeholderStyle,placeholderClass=_this$props.placeholderClass,containerStyle=_this$props.containerStyle,containerClass=_this$props.containerClass,theme=this.props.theme;return this.styles=this.styles||mergeStyles({styles:styles,theme:theme}),isSSR()||void 0===window.IntersectionObserver?children:React__default.default.createElement(reactIntersectionObserver.InView,{triggerOnce:!0},(function(_ref){var inView=_ref.inView,ref=_ref.ref;return inView?React__default.default.createElement("div",{ref:ref,style:containerStyle,className:containerClass},children):React__default.default.createElement("div",{ref:ref,className:classNames__default.default(_this.styles.placeholder,placeholderClass),style:placeholderStyle})}))},ViewportRenderer}(React.Component);function i18n(_ref){var _resources,locale=_ref.locale,localeResource=_ref.localeResource;return i18next.createInstance().init({lng:locale,keySeparator:"$",interpolation:{escapeValue:!1},react:{wait:!0},resources:(_resources={},_resources[locale]={translation:localeResource},_resources)})}function getDisplayName(Component){return Component.displayName||Component.name||"Component"}function createHocName(hocComponentName,WrappedComponent){return hocComponentName+"("+getDisplayName(WrappedComponent)+")"}ViewportRenderer.defaultProps={placeholderStyle:{},containerStyle:{},alwaysRenderChildren:!1,placeholderClass:"",containerClass:""};var memoizedNow,_excluded=["forwardedRef"],safeJsonParse=function(jsonString){try{return JSON.parse(jsonString)}catch(e){return}};function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}function compute(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C}function isOptionsObject(options){return options===Object(options)&&0!==Object.keys(options).length}function scrollIntoView$1(target,options){var targetIsDetached=!target.ownerDocument.documentElement.contains(target);if(isOptionsObject(options)&&"function"==typeof options.behavior)return options.behavior(targetIsDetached?[]:compute(target,options));if(!targetIsDetached){var computeOptions=function(options){return!1===options?{block:"end",inline:"nearest"}:isOptionsObject(options)?options:{block:"start",inline:"nearest"}}(options);return function(actions,behavior){void 0===behavior&&(behavior="auto");var canSmoothScroll="scrollBehavior"in document.body.style;actions.forEach((function(_ref){var el=_ref.el,top=_ref.top,left=_ref.left;el.scroll&&canSmoothScroll?el.scroll({top:top,left:left,behavior:behavior}):(el.scrollTop=top,el.scrollLeft=left)}))}(compute(target,computeOptions),computeOptions.behavior)}}var now=function(){return memoizedNow||(memoizedNow="performance"in window?performance.now.bind(performance):Date.now),memoizedNow()};function step(context){var time=now(),elapsed=Math.min((time-context.startTime)/context.duration,1),value=context.ease(elapsed),currentX=context.startX+(context.x-context.startX)*value,currentY=context.startY+(context.y-context.startY)*value;context.method(currentX,currentY),currentX!==context.x||currentY!==context.y?requestAnimationFrame((function(){return step(context)})):context.cb()}function smoothScroll(el,x,y,duration,ease,cb){var scrollable,startX,startY;void 0===duration&&(duration=600),void 0===ease&&(ease=function(t){return 1+--t*t*t*t*t}),scrollable=el,startX=el.scrollLeft,startY=el.scrollTop,step({scrollable:scrollable,method:function(x,y){el.scrollLeft=Math.ceil(x),el.scrollTop=Math.ceil(y)},startTime:now(),startX:startX,startY:startY,x:x,y:y,duration:duration,ease:ease,cb:cb})}var scrollIntoView=function(target,options){var overrides=options||{};return function(options){return options&&!options.behavior||"smooth"===options.behavior}(overrides)?scrollIntoView$1(target,{block:overrides.block,inline:overrides.inline,scrollMode:overrides.scrollMode,boundary:overrides.boundary,behavior:function(actions){return Promise.all(actions.reduce((function(results,_ref){var el=_ref.el,left=_ref.left,top=_ref.top,startLeft=el.scrollLeft,startTop=el.scrollTop;return startLeft===left&&startTop===top?results:[].concat(results,[new Promise((function(resolve){return smoothScroll(el,left,top,overrides.duration,overrides.ease,(function(){return resolve({el:el,left:[startLeft,left],top:[startTop,top]})}))}))])}),[]))}}):Promise.resolve(scrollIntoView$1(target,options))},anchorScrollUsingSmoothScrollIntoViewIfNeeded=function(element,fixedElementsOffset){var _element$style=element.style,paddingTop=_element$style.paddingTop,marginTop=_element$style.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",scrollIntoView(element,{block:"start",inline:"start"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},anchorScrollUsingScrollIntoView=function(element,fixedElementsOffset){var _element$style2=element.style,paddingTop=_element$style2.paddingTop,marginTop=_element$style2.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",element.scrollIntoView({behavior:"smooth"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},getLinkRangesInBlock=function(block,contentState){var ranges=[];return block.entityRanges.forEach((function(entityRange){var _contentState$entityM,entityType=null===(_contentState$entityM=contentState.entityMap[entityRange.key])||void 0===_contentState$entityM?void 0:_contentState$entityM.type;if("LINK"===entityType||"wix-draft-plugin-external-link"===entityType){var start=entityRange.offset,end=start+entityRange.length;ranges.push([start,end])}})),ranges},contentStateSchema={definitions:{inlineStyleDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/inline-style.json",type:"object",title:"inline style",required:["offset","length","style"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},style:{$id:"#/properties/style",type:"string",title:"style",default:"",examples:["color4"],pattern:"^(.*)$"}}},entityRangeDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"inline style",required:["offset","length","key"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},key:{$id:"#/properties/style",type:"integer",title:"key",default:"",examples:[0]}}},entityDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"entity",required:["type","data"],properties:{type:{$id:"#/properties/type",enum:["IMAGE","VIDEO-EMBED","LINK","mention","wix-draft-plugin-image","wix-draft-plugin-link-button","wix-draft-plugin-action-button","wix-draft-plugin-video","wix-draft-plugin-gallery","wix-draft-plugin-link","wix-draft-plugin-html","wix-draft-plugin-sound-cloud","wix-draft-plugin-hashtag","wix-draft-plugin-divider","wix-draft-plugin-emoji","wix-draft-plugin-giphy","wix-draft-plugin-map","wix-draft-plugin-file-upload","wix-draft-plugin-vertical-embed","wix-draft-plugin-poll","wix-draft-plugin-link-preview","ANCHOR","wix-rich-content-plugin-table","wix-rich-content-plugin-collapsible-list"],title:"entity type",examples:["wix-draft-plugin-image"]},mutability:{$id:"#/properties/mutability",type:"string",enum:["MUTABLE","IMMUTABLE","SEGMENTED"],title:"entity mutability",examples:["IMMUTABLE"]},data:{$id:"#/properties/data",type:"object",title:"entity data"}},anyOf:[{}]},textBlockStyle:{$id:"https://wix-rich-content/text-block-style.json",title:"text block style",type:"object"}},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/content-state-schema.json",type:"object",title:"content state",required:["blocks","entityMap","VERSION"],properties:{blocks:{$id:"#/properties/blocks",type:"array",title:"blocks",items:{$id:"#/properties/blocks/items",type:"object",title:"block",required:["key","text","type","inlineStyleRanges","entityRanges","data"],properties:{key:{$id:"#/properties/blocks/items/properties/key",type:"string",title:"block key",default:"",examples:["45qkg"],pattern:"^(.*)$"},text:{$id:"#/properties/blocks/items/properties/text",type:"string",title:"text",default:"",examples:["test"]},type:{$id:"#/properties/blocks/items/properties/type",type:"string",title:"block type",default:"",examples:["unstyled"],enum:["unstyled","header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","figure"]},depth:{$id:"#/properties/blocks/items/properties/depth",type:"integer",title:"depth",maximum:10,default:0,examples:[0]},inlineStyleRanges:{$id:"#/properties/blocks/items/properties/inlineStyleRanges",type:"array",title:"inline style ranges",items:{$ref:"#/definitions/inlineStyleDef"}},entityRanges:{$id:"#/properties/blocks/items/properties/entityRanges",type:"array",title:"entity ranges",default:null,items:{$ref:"#/definitions/entityRangeDef"}},data:{$id:"#/properties/blocks/items/properties/data",type:"object",title:"data",default:null}}}},entityMap:{$id:"#/properties/entityMap",type:"object",title:"entity map",patternProperties:{"[0-9]+":{$ref:"#/definitions/entityDef"}}},documentStyle:{$id:"#/properties/documentStyle",type:"object",title:"document style",default:null,properties:{headerOne:{$ref:"#/definitions/textBlockStyle"},headerTwo:{$ref:"#/definitions/textBlockStyle"},headerThree:{$ref:"#/definitions/textBlockStyle"},headerFour:{$ref:"#/definitions/textBlockStyle"},headerFive:{$ref:"#/definitions/textBlockStyle"},headerSix:{$ref:"#/definitions/textBlockStyle"},paragraph:{$ref:"#/definitions/textBlockStyle"}}}}},LTR="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",isRtlRegex=new RegExp("^[^"+LTR+"]*[֑-߿יִ-﷽ﹰ-ﻼ]"),isLtrRegex=new RegExp("^[^֑-߿יִ-﷽ﹰ-ﻼ]*["+LTR+"]"),emojiRegex=/\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]/g,GlobalContext=React__default.default.createContext({isMobile:!1,experiments:{}}),isHexColor=function(str){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(str)},rtlLangs=["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"],isRtl=function(locale){return!!locale&&rtlLangs.includes(locale.split("-|_")[0].toLowerCase())},getBlocksFromContentState=function(contentState){var entityMap,rceInRcePlugins,innerRCEBlocks=(entityMap=contentState.entityMap,rceInRcePlugins=["wix-rich-content-plugin-table","wix-rich-content-plugin-collapsible-list"],Object.values(entityMap).some((function(entity){return rceInRcePlugins.includes(entity.type)}))?getInnerRCEBlocks(contentState.entityMap):[]);return[].concat(contentState.blocks,innerRCEBlocks)};function getInnerRCEBlocks(object){var result=[];if(object instanceof Array)Array.prototype.forEach.call(object,(function(arrayElement){var innerBlocks=getInnerRCEBlocks(arrayElement);innerBlocks&&(result=[].concat(result,innerBlocks))}));else for(var _i=0,_Object$entries=Object.entries(object);_i<_Object$entries.length;_i++){var _Object$entries$_i=_Object$entries[_i],key=_Object$entries$_i[0],value=_Object$entries$_i[1];if("blocks"===key)return value;if(value instanceof Object||value instanceof Array){var innerBlocks=getInnerRCEBlocks(value);innerBlocks&&(result=[].concat(result,innerBlocks))}}return result}var _INLINE_STYLE_TYPES,_RICOS_TO_DRAFT_TYPE,_dynamicStyleParsers,_defaultStyleFnMapper,_defaultStyleSelectio;function isInEditor(contentBlock){return contentBlock.toJS}function isInLink(i,block,contentState){var entityKey=function(i,block){var _block$entityRanges$f;return isInEditor(block)?block.getEntityAt(i):null===(_block$entityRanges$f=block.entityRanges.find((function(_ref){var offset=_ref.offset,length=_ref.length;return i>offset&&i<offset+length})))||void 0===_block$entityRanges$f?void 0:_block$entityRanges$f.key}(i,block);return function(type){return"LINK"===type||"ricos-plugin-custom-link"===type}(function(block,contentState,entityKey){var _contentState$entityM;return isInEditor(block)?null!==entityKey&&contentState.getEntity(entityKey).getType():null===(_contentState$entityM=contentState.entityMap[entityKey])||void 0===_contentState$entityM?void 0:_contentState$entityM.type}(block,contentState,entityKey))}var INLINE_STYLE_TYPES=((_INLINE_STYLE_TYPES={})[ricosContent.RICOS_TEXT_COLOR_TYPE]="FG",_INLINE_STYLE_TYPES[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]="BG",_INLINE_STYLE_TYPES[ricosContent.RICOS_FONT_SIZE_TYPE]="font-size",_INLINE_STYLE_TYPES),RICOS_TO_DRAFT_TYPE=((_RICOS_TO_DRAFT_TYPE={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=ricosContent.TEXT_COLOR_TYPE,_RICOS_TO_DRAFT_TYPE[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=ricosContent.TEXT_HIGHLIGHT_TYPE,_RICOS_TO_DRAFT_TYPE),parseStyleByType=function(style,type){var property=INLINE_STYLE_TYPES[type],cssRule=safeJsonParse(style);return null==cssRule?void 0:cssRule[property]},dynamicStyleParsers=((_dynamicStyleParsers={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,ricosContent.RICOS_TEXT_COLOR_TYPE);if(styleSelectionPredicate){var parsedStyle=color||style;return styleSelectionPredicate(parsedStyle)&&parsedStyle}return color||isHexColor(style)&&style},_dynamicStyleParsers[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE);return styleSelectionPredicate?styleSelectionPredicate(color)&&color:color},_dynamicStyleParsers[ricosContent.RICOS_FONT_SIZE_TYPE]=function(style){return parseStyleByType(style,ricosContent.RICOS_FONT_SIZE_TYPE)},_dynamicStyleParsers),defaultStyleFnMapper=((_defaultStyleFnMapper={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[ricosContent.RICOS_TEXT_COLOR_TYPE](style,isHexColor);return parsedStyle?{color:parsedStyle}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE](style,isHexColor);return parsedStyle?{backgroundColor:parsedStyle}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_FONT_SIZE_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[ricosContent.RICOS_FONT_SIZE_TYPE](style);return parsedStyle?{fontSize:parsedStyle}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_BOLD_TYPE]=function(style){return"NOT_BOLD"===style?{fontWeight:"normal"}:void 0},_defaultStyleFnMapper[ricosContent.RICOS_ITALIC_TYPE]=function(style){return"NOT_ITALIC"===style?{fontStyle:"normal"}:void 0},_defaultStyleFnMapper),defaultStyleSelectionPredicates=((_defaultStyleSelectio={})[ricosContent.RICOS_TEXT_COLOR_TYPE]=isHexColor,_defaultStyleSelectio[ricosContent.RICOS_TEXT_HIGHLIGHT_TYPE]=isHexColor,_defaultStyleSelectio);Object.defineProperty(exports,"Trans",{enumerable:!0,get:function(){return reactI18next.Trans}}),Object.defineProperty(exports,"translate",{enumerable:!0,get:function(){return reactI18next.translate}}),exports.ADD_PLUGIN_LINK_BI="addPluginLink",exports.ANCHOR_CATEGORY="section",exports.ANCHOR_VIEWER_DATA_HOOK="anchorViewer",exports.AccessibilityListener=AccessibilityListener,exports.CUSTOM_LINK="custom-link",exports.DRAFT_TO_RICOS_DOC_TYPE=DRAFT_TO_RICOS_DOC_TYPE,exports.DROPDOWN_OPTIONS_TO_DOC_STYLE_TYPE={P:"paragraph",H1:"headerOne",H2:"headerTwo",H3:"headerThree",H4:"headerFour",H5:"headerFive",H6:"headerSix"},exports.GlobalContext=GlobalContext,exports.INLINE_STYLE_TYPES=INLINE_STYLE_TYPES,exports.LINK_VIEWER_DATA_HOOK="linkViewer",exports.LinkData=LinkData,exports.Link_Rel=Link_Rel,exports.RicosTranslate=function(_ref3){var children=_ref3.children,locale=_ref3.locale,localeResource=_ref3.localeResource,i18nInstance=React.useRef(i18n({locale:locale,localeResource:localeResource})),_React$useState=React__default.default.useState(0),forceCounter=_React$useState[0],forceUpdate=_React$useState[1];return React.useEffect((function(){i18nInstance.current.addResourceBundle(locale,"translation",localeResource),i18nInstance.current.changeLanguage(locale,(function(err){err||forceUpdate(forceCounter+1)}))}),[locale,localeResource]),React__default.default.createElement(reactI18next.I18nextProvider,{i18n:i18nInstance.current},React__default.default.createElement(reactI18next.I18n,{i18n:i18nInstance.current,wait:!0,initialLanguage:locale},(function(t){return children(t)})))},exports.ViewportRenderer=ViewportRenderer,exports.WEB_ADDRESS_CATEGORY="web_address",exports.addAnchorTagToUrl=function(anchorString){var url=new URL(window.location.href);url.hash=anchorString,history.pushState({},"",url.href)},exports.alignmentClassName=function(componentData,theme,styles){var alignment=(componentData.config||{}).alignment;if(!alignment)return"";var key="align"+lodash.upperFirst(alignment);return classNames__default.default(styles[key],theme[key])},exports.anchorScroll=function(element,experiments){var _document$querySelect,_document$querySelect2,_document$querySelect3,_document$querySelect4,_experiments$anchorSc,fixedElementsOffset=((null===(_document$querySelect=document.querySelector('[id="SITE_HEADER"]'))||void 0===_document$querySelect?void 0:_document$querySelect.clientHeight)||0)+((null===(_document$querySelect2=document.querySelector('[id="WIX_ADS"]'))||void 0===_document$querySelect2?void 0:_document$querySelect2.clientHeight)||0)+((null===(_document$querySelect3=document.querySelector('[data-hook="mobileToolbar"]'))||void 0===_document$querySelect3?void 0:_document$querySelect3.clientHeight)||(null===(_document$querySelect4=document.querySelector('[data-hook="ricos-editor-toolbars"]'))||void 0===_document$querySelect4?void 0:_document$querySelect4.clientHeight)||0);null!=experiments&&null!==(_experiments$anchorSc=experiments.anchorScrollWithSmoothScrollIntoViewIfNeeded)&&void 0!==_experiments$anchorSc&&_experiments$anchorSc.enabled?anchorScrollUsingSmoothScrollIntoViewIfNeeded(element,fixedElementsOffset):anchorScrollUsingScrollIntoView(element,fixedElementsOffset)},exports.convertRelObjectToString=function(relObject){if(relObject){var relString="";return relObject.nofollow&&(relString+="nofollow "),relObject.sponsored&&(relString+="sponsored "),relObject.ugc&&(relString+="ugc"),relString.trim()}},exports.convertRelStringToObject=function(rel){var relObject={};return rel?(rel.includes("nofollow")&&(relObject.nofollow=!0),rel.includes("sponsored")&&(relObject.sponsored=!0),rel.includes("ugc")&&(relObject.ugc=!0),relObject):relObject},exports.convertTargetBooleanToString=function(targetBlank){return targetBlank?"_blank":"_top"},exports.convertTargetStringToBoolean=function(target){return"_blank"===target},exports.createHocName=createHocName,exports.createJustificationFixDecorator=function(){var isTextJustified=function(contentBlock){return"justify"===function(contentBlock){var _contentBlock$data;return isInEditor(contentBlock)?contentBlock.getData().get("textAlignment"):null==contentBlock||null===(_contentBlock$data=contentBlock.data)||void 0===_contentBlock$data?void 0:_contentBlock$data.textAlignment}(contentBlock)};return{strategy:function(contentBlock,callback,contentState){if(!isSSR()&&(isSSR()||!window.chrome)&&isTextJustified(contentBlock))for(var match,regex=/\s[^\s]/g,str=contentBlock.getText();null!==(match=regex.exec(str));)isInLink(match.index,contentBlock,contentState)||callback(match.index,match.index+1)},component:function(props){return React__default.default.createElement("span",{style:{whiteSpace:"normal"}},props.children)}}},exports.defaultStyleFnMapper=defaultStyleFnMapper,exports.depthClassName=function(depth){return"public-DraftStyleDefault-block-depth"+depth},exports.draftDecorationsToCss={BOLD:{"font-weight":"bold"},ITALIC:{"font-style":"italic"},NOT_BOLD:{"font-weight":"normal"},NOT_ITALIC:{"font-style":"normal"}},exports.dynamicStyleParsers=dynamicStyleParsers,exports.generateKey=function(){return Math.random().toString(36).substr(2,9)},exports.getBlocksFromContentState=getBlocksFromContentState,exports.getContentStateSchema=function(pluginDataSchemas){void 0===pluginDataSchemas&&(pluginDataSchemas={});var schema=contentStateSchema;return schema.definitions.entityDef.anyOf=Object.keys(pluginDataSchemas).map((function(pluginType){return{properties:{type:{const:pluginType},data:pluginDataSchemas[pluginType]}}})),schema},exports.getDirectionFromAlignmentAndTextDirection=function(textAlignment,textDirection){return"right"===textAlignment?"rtl":"left"===textAlignment?"ltr":textDirection&&"rtl"===textDirection?textDirection:"ltr"},exports.getDisplayName=getDisplayName,exports.getDynamicInlineStyleMapper=function(type){return function(config,raw){var settings=config[RICOS_TO_DRAFT_TYPE[type]||""]||{},styleParser=dynamicStyleParsers[type],styleSelectionPredicate=settings.styleSelectionPredicate?function(style){return!!styleParser(style,settings.styleSelectionPredicate)}:function(style){return!!styleParser(style,defaultStyleSelectionPredicates[type])},customStyleFn=settings.customStyleFn?function(style){return settings.customStyleFn(styleParser(style,settings.styleSelectionPredicate))}:defaultStyleFnMapper[type],mapper=getBlocksFromContentState(raw).reduce((function(map,block){return block.inlineStyleRanges&&block.inlineStyleRanges.filter((function(range){return styleSelectionPredicate(range.style)})).forEach((function(range){map[range.style]=function(children,_ref){var key=_ref.key;return React__default.default.createElement("span",{key:key,style:customStyleFn(range.style)},children)}})),map}),{});return function(){return mapper}}},exports.getLangDir=function(locale){return isRtl(locale)?"rtl":"ltr"},exports.getLinkRangesInBlock=getLinkRangesInBlock,exports.getRelValue=function(rel){return("noopener noreferrer "+(rel||"")).trim()},exports.getTextDirection=function(text){var result="neutral";if(!text)return result;var plainText=text.replace(emojiRegex,"");return isRtlRegex.test(plainText)?result="rtl":isLtrRegex.test(plainText)&&(result="ltr"),result},exports.hasLinksInBlock=function(block,contentState){return getLinkRangesInBlock(block,contentState).length>0},exports.isHexColor=isHexColor,exports.isNewTab=function(target){return"_blank"===target},exports.isRtl=isRtl,exports.isSSR=isSSR,exports.mergeStyles=mergeStyles,exports.parseStyleByType=parseStyleByType,exports.safeJsonParse=safeJsonParse,exports.simplePubsub=function(initialState){var state=initialState||{},listeners={},subscribe=function(key,callback){if("function"!=typeof callback)throw"Callback for key "+key+" is not a function";return listeners[key]=listeners[key]||[],listeners[key].push(callback),function(){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))}},update=function(key,newData,blockKey){var data=get(key),newItem=lodash.merge({},data,newData);blockKey?_setSingle(key,newItem,blockKey):set(key,newItem)},_setSingle=function(key,item,blockKey){var _extends2;state=_extends__default.default({},state,((_extends2={})[key]=item,_extends2)),listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key],blockKey)}))},_setBatch=function(updates){state=_extends__default.default({},state,updates),Object.keys(updates).forEach((function(key){listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key])}))}))},set=function(){1===arguments.length?_setBatch(arguments.length<=0?void 0:arguments[0]):_setSingle.apply(void 0,arguments)},setBlockHandler=function(key,blockKey,item){_setSingle(blockHandlerKey(key,blockKey),item)},get=function(key){return state[key]},getBlockHandler=function(key,blockKey){return void 0===blockKey&&(blockKey=state.focusedBlock),state[blockHandlerKey(key,blockKey)]},blockHandlerKey=function(key,blockKey){return blockKey+"_"+key};return{subscribe:subscribe,unsubscribe:function(key,callback){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))},update:update,set:set,setBlockHandler:setBlockHandler,get:get,getBlockHandler:getBlockHandler,store:{get:get,getBlockHandler:getBlockHandler,update:update,set:set,setBlockHandler:setBlockHandler},getBlockData:function(_ref3){var key=_ref3.key,_ref3$blockKey=_ref3.blockKey,blockKey=void 0===_ref3$blockKey?state.focusedBlock:_ref3$blockKey;return state[blockHandlerKey(key,blockKey)]},setBlockData:function(_ref2){var key=_ref2.key,_ref2$blockKey=_ref2.blockKey,blockKey=void 0===_ref2$blockKey?state.focusedBlock:_ref2$blockKey,item=_ref2.item;_setSingle(blockHandlerKey(key,blockKey),item)},subscribeOnBlock:function(_ref){var key=_ref.key,_ref$blockKey=_ref.blockKey,blockKey=void 0===_ref$blockKey?state.focusedBlock:_ref$blockKey,callback=_ref.callback;return subscribe(blockHandlerKey(key,blockKey),callback)}}},exports.sizeClassName=function(componentData,theme,styles){var size=(componentData.config||{}).size;if(!size)return"";var key="size"+lodash.upperFirst(lodash.camelCase(size));return classNames__default.default(styles[key],theme[key])},exports.textWrapClassName=function(componentData,theme,styles){var textWrap=(componentData.config||{}).textWrap;if(!textWrap)return"";var key="textWrap"+lodash.upperFirst(lodash.camelCase(textWrap));return classNames__default.default(styles[key],theme[key])},exports.uuid=function(){var d=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)}))},exports.validate=function(data,schema){return!0},exports.withI18n=function(Component,defaultLocaleResource,_temp){var _ref$forceRemount=(void 0===_temp?{}:_temp).forceRemount,forceRemount=void 0===_ref$forceRemount||_ref$forceRemount,Translated=reactI18next.translate(void 0,{withRef:!0})(Component),I18nWrapper=function(_PureComponent){function I18nWrapper(props){var _this;_this=_PureComponent.call(this,props)||this;var locale=props.locale,localeResource=props.localeResource;return _this.i18n=i18n({locale:locale,localeResource:localeResource}),_this.state={key:I18nWrapper.displayName+"-"+locale},_this}_inheritsLoose__default.default(I18nWrapper,_PureComponent);var _proto=I18nWrapper.prototype;return _proto.componentDidMount=function(){var _componentDidMount=_asyncToGenerator__default.default(_regeneratorRuntime__default.default.mark((function _callee(){var _yield$this$getResour,locale,localeResource;return _regeneratorRuntime__default.default.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:if("en"===this.props.locale){_context.next=7;break}return _context.next=3,this.getResourceByLocale(this.props.locale);case 3:_yield$this$getResour=_context.sent,locale=_yield$this$getResour.locale,localeResource=_yield$this$getResour.localeResource,this.changeLocale({locale:locale,localeResource:localeResource});case 7:case"end":return _context.stop()}}),_callee,this)})));return function(){return _componentDidMount.apply(this,arguments)}}(),_proto.componentWillReceiveProps=function(nextProps){this.props.locale!==nextProps.locale&&this.changeLocale(nextProps)},_proto.getResourceByLocale=function(){var _getResourceByLocale=_asyncToGenerator__default.default(_regeneratorRuntime__default.default.mark((function _callee2(locale){var localeResource;return _regeneratorRuntime__default.default.wrap((function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,_context2.next=3,function(t){return Promise.resolve().then((function(){return _interopNamespace(require(t))}))}(
/* webpackChunkName: "messages_[request]" */
"wix-rich-content-common/dist/statics/locale/messages_"+locale+".json").then((function(res){return res.default}));case 3:return localeResource=_context2.sent,_context2.abrupt("return",{locale:locale,localeResource:localeResource});case 7:throw _context2.prev=7,_context2.t0=_context2.catch(0),new Error("error while loading locale "+locale+":\n"+_context2.t0);case 10:case"end":return _context2.stop()}}),_callee2,null,[[0,7]])})));return function(_x){return _getResourceByLocale.apply(this,arguments)}}(),_proto.changeLocale=function(_ref2){var _this2=this,locale=_ref2.locale,localeResource=_ref2.localeResource;this.i18n.addResourceBundle(locale,"translation",localeResource),this.i18n.changeLanguage(locale,(function(err){err||(forceRemount?_this2.setState({key:I18nWrapper.displayName+"-"+_this2.i18n.language}):_this2.forceUpdate())}))},_proto.render=function(){var _this$props=this.props,forwardedRef=_this$props.forwardedRef,rest=_objectWithoutPropertiesLoose__default.default(_this$props,_excluded);return React__default.default.createElement(reactI18next.I18nextProvider,{i18n:this.i18n},React__default.default.createElement(Translated,Object.assign({key:this.state.key},rest,{ref:forwardedRef})))},I18nWrapper}(React.PureComponent);return I18nWrapper.defaultProps={locale:"en",localeResource:defaultLocaleResource},I18nWrapper.displayName=createHocName("I18nWrapper",Component),React__default.default.forwardRef((function(props,ref){return React__default.default.createElement(I18nWrapper,Object.assign({},props,{forwardedRef:ref}))}))},Object.keys(ricosContent).forEach((function(k){"default"===k||exports.hasOwnProperty(k)||Object.defineProperty(exports,k,{enumerable:!0,get:function(){return ricosContent[k]}})}));
//# sourceMappingURL=module.cjs.js.map

@@ -1,2 +0,4 @@

import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import{LoaderIcon,BUTTONS,createBasePlugin}from"wix-rich-content-plugin-commons";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{PureComponent,Component}from"react";import{validate,getLangDir}from"wix-rich-content-common";import verticalEmbedSchema from"wix-rich-content-common/dist/statics/schemas/vertical-embed.schema.json";import classnames from"classnames";import{isNumber}from"lodash";import{decorateComponentWithProps,getModalStyles,TOOLBARS,BUTTON_TYPES,getBottomToolbarModalStyles}from"wix-rich-content-editor-common";import{FOOTER_BUTTON_ALIGNMENT,MODAL_CONTROLS_POSITION,BUTTON_SIZE,SearchInputModal,UrlInputModal,MOBILE_FULL_SCREEN_CUSTOM_STYLE,DesktopFlyOutModalStyles,DesktopOverlayModalStyles}from"wix-rich-content-ui-components";var _dataTypeMapper,VERTICAL_EMBED_TYPE="wix-draft-plugin-vertical-embed",styles$3={card:"eSWSJ",link:"_3FwrF",container:"aMyTV",image:"_3hjHR",cardLayout:"_33kqy",content:"_26Lqs",title:"_1Npvf",subtitle:"_2a6W8",button:"MUh8b",buttonText:"_2tWJB",slimLayout:"nep6I",rtl:"_atWu",ltr:"_15JaP"},verticalEmbedProviders={event:"event",booking:"booking",product:"product"},contentTypeMap={event:"Events",booking:"Bookings",product:"Stores"},modalContentStyles={width:440,height:522,padding:20,boxSizing:"border-box",border:"solid 1px rgba(51, 51, 51, 0.1)",boxShadow:"0 0 10px 0 rgba(0, 0, 0, 0.06)"},convertDuration=function(durationInMinutes,t){if(!isNumber(durationInMinutes))return"";if(durationInMinutes<60)return t("VerticalEmbed_Units_Minute",{minutes:durationInMinutes});var hours=durationInMinutes/60,rhours=Math.floor(hours),minutes=60*(hours-rhours),rminutes=Math.round(minutes);return 0===rminutes?t("VerticalEmbed_Units_Hour",{hours:rhours}):t("VerticalEmbed_Units_Hour",{hours:rhours})+" "+t("VerticalEmbed_Units_Minute",{minutes:rminutes})},dataTypeMapper=((_dataTypeMapper={})[verticalEmbedProviders.booking]=function(data,t){var name=data.name,imageSrc=data.imageSrc,pageUrl=data.pageUrl,durations=data.durations;return{url:pageUrl,imageSrc:imageSrc,content:{title:name,info:{leftSubtitle:durations&&convertDuration(durations,t)},buttonText:t("VerticalEmbed_Bookings_Button")}}},_dataTypeMapper[verticalEmbedProviders.event]=function(data,t){var name=data.name,imageSrc=data.imageSrc,scheduling=data.scheduling;return{url:data.pageUrl,imageSrc:imageSrc,content:{title:name,info:{leftSubtitle:scheduling,rightSubtitle:data.location},buttonText:t("VerticalEmbed_Events_Button")}}},_dataTypeMapper[verticalEmbedProviders.product]=function(data,t){var name=data.name,imageSrc=data.imageSrc;return{url:data.pageUrl,imageSrc:imageSrc,content:{title:name,buttonText:t("VerticalEmbed_Products_Button")}}},_dataTypeMapper),CardContent=function(props){var title=props.title,info=props.info,buttonText=props.buttonText;return React.createElement("div",{className:styles$3.content},React.createElement("div",null,React.createElement("div",{className:styles$3.title},function(title){return title.length<=80?title:title.substring(0,80)+"..."}(title)),info&&function(info){return info.leftSubtitle&&React.createElement("div",{className:styles$3.subtitle},info.leftSubtitle,info.rightSubtitle&&React.createElement("span",null,React.createElement("span",{className:styles$3.right},"|"),info.rightSubtitle))}(info)),React.createElement("div",{className:styles$3.button},React.createElement("div",{className:styles$3.buttonText},buttonText)))},Card=function(props){var url=props.url,imageSrc=props.imageSrc,content=props.content,direction=props.direction;return React.createElement("a",{className:styles$3.link,href:url,target:"_blank"},React.createElement("div",{style:{direction:direction},className:classnames(styles$3[direction],styles$3.container,styles$3.cardLayout)},imageSrc&&React.createElement("div",{style:{backgroundImage:"url("+imageSrc+")"},className:styles$3.image}),React.createElement(CardContent,content)))},VerticalEmbedComponent=function(_PureComponent){function VerticalEmbedComponent(props){var _this;return(_this=_PureComponent.call(this,props)||this).onClick=function(){var _this$props$helpers$o,_this$props$helpers;return null===(_this$props$helpers$o=(_this$props$helpers=_this.props.helpers).onViewerAction)||void 0===_this$props$helpers$o?void 0:_this$props$helpers$o.call(_this$props$helpers,VERTICAL_EMBED_TYPE,"Click",_this.props.componentData.type)},validate(props.componentData,verticalEmbedSchema),_this}return _inheritsLoose(VerticalEmbedComponent,_PureComponent),VerticalEmbedComponent.prototype.render=function(){var _classnames,_this$props=this.props,componentData=_this$props.componentData,className=_this$props.className,_this$props$settings$=_this$props.settings.slimLayout,slimLayout=void 0!==_this$props$settings$&&_this$props$settings$,t=_this$props.t,locale=_this$props.locale,selectedProduct=componentData.selectedProduct,type=componentData.type,props=dataTypeMapper[type](selectedProduct,t),direction=getLangDir(locale);return React.createElement("div",{className:classnames(className,styles$3.card,(_classnames={},_classnames[styles$3.slimLayout]=slimLayout,_classnames)),"data-hook":"vertical-embed",onClick:this.onClick},React.createElement(Card,_extends({},props,{t:t,direction:direction})))},VerticalEmbedComponent}(PureComponent),Event=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 25 24"},props),React.createElement("g",{fill:"currentColor",fillRule:"evenodd"},React.createElement("path",{d:"M2.526 21.553h18.948V3.789H2.526v17.764zm1.185-14.21h16.578v-2.37H3.711v2.37zm0 13.025h16.578V8.526H3.711v11.842z",transform:"translate(.333)"}),React.createElement("path",{d:"M8.16 0L8.842 0.682 3.599 6.316 0 3.461 0.583 2.684 3.508 4.985z",transform:"translate(.333) translate(7.579 11.368)"}),React.createElement("path",{stroke:"currentColor",d:"M16.921 3.026H17.921V5.8149999999999995H16.921zM6.816 3.026H7.816V5.8149999999999995H6.816z",transform:"translate(.333)"})))},Product=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"19",height:"19",viewBox:"0 0 25 24"},props),React.createElement("defs",null,React.createElement("filter",{id:"prefix__a",width:"179.2%",height:"215.2%",x:"-39.6%",y:"-57.6%",filterUnits:"objectBoundingBox"},React.createElement("feOffset",{in:"SourceAlpha",result:"shadowOffsetOuter1"}),React.createElement("feMorphology",{in:"SourceAlpha",radius:"1",result:"shadowInner"}),React.createElement("feOffset",{in:"shadowInner",result:"shadowInner"}),React.createElement("feComposite",{in:"shadowOffsetOuter1",in2:"shadowInner",operator:"out",result:"shadowOffsetOuter1"}),React.createElement("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"2.5"}),React.createElement("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"})),React.createElement("path",{id:"prefix__b",d:"M0 4.737L18.947 4.737 17.763 17.763 1.184 17.763z"})),React.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(3.193 2.526)"},React.createElement("use",{fill:"currentColor",filter:"url(#prefix__a)",xlinkHref:"#prefix__b"}),React.createElement("path",{stroke:"currentColor",strokeLinecap:"square",d:"M18.4 5.237H.548L1.64 17.263h15.666L18.4 5.237z"}),React.createElement("path",{fillRule:"nonzero",stroke:"currentColor",d:"M5.921 4.737v-.948C5.921 1.697 7.511 0 9.474 0c1.962 0 3.552 1.697 3.552 3.79v.947"})))},Booking=function(props){return React.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 24 24"},props),React.createElement("g",{fill:"currentColor",fillRule:"evenodd"},React.createElement("path",{d:"M21.474 3.79v17.763H2.526V3.789h18.948zm-1.185 4.736H3.711v11.842h16.578V8.526zm-2.368 7.106V18h-2.368v-2.368h2.368zm-4.737 0V18h-2.368v-2.368h2.368zm-4.737 0V18H6.08v-2.368h2.368zm0-4.737v2.368H6.08v-2.368h2.368zm4.737 0v2.368h-2.368v-2.368h2.368zm4.737 0v2.368h-2.368v-2.368h2.368zm2.368-5.921H3.711v2.37h16.578v-2.37z"}),React.createElement("path",{stroke:"currentColor",d:"M16.921 3.026H17.921V5.8149999999999995H16.921zM6.816 3.026H7.816V5.8149999999999995H6.816z"})))},ReplaceIcon=function(props){return React.createElement("svg",Object.assign({xmlnsXlink:"http://www.w3.org/1999/xlink",width:19,height:19,viewBox:"0 0 19 19"},props),React.createElement("defs",null,React.createElement("path",{id:"replace-path",d:"M3 7.8V3.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2v2.592A6.607 6.607 0 0 1 9.412 3C13.05 3 16 5.91 16 9.5c0 .168-.006.335-.02.5h-1.016a5.51 5.51 0 0 0 .022-.5c0-3.038-2.495-5.5-5.574-5.5a5.583 5.583 0 0 0-4.967 3H7.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H3.2a.2.2 0 0 1-.2-.2zm13 3.4v4.6a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2v-2.592A6.607 6.607 0 0 1 9.588 16C5.95 16 3 13.09 3 9.5c0-.168.006-.335.02-.5h1.016a5.496 5.496 0 0 0-.022.5c0 3.038 2.495 5.5 5.574 5.5a5.583 5.583 0 0 0 4.967-3H11.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2h4.6c.11 0 .2.09.2.2z"})),React.createElement("g",{fillRule:"evenodd"},React.createElement("mask",{id:"replace-mask"},React.createElement("use",{xlinkHref:"#replace-path"})),React.createElement("use",{fillRule:"nonzero",xlinkHref:"#replace-path"})))},getModalCustomStyles=function(isMobile){var content={maxWidth:580,minHeight:585};return isMobile&&(content=_extends({},content,{minHeight:"100%",minWidth:"100%",margin:0,alignContent:"center",top:0,transform:"none",backgroundColor:"white"})),{content:content}},styles$2_container="_2Q-rY",styles$2_mobile="rO2EZ",generalStyles_emptyState="_2FaLJ",generalStyles_title="_3QLpw",generalStyles_description="_25CzD",styles$1_container="_2S0Vi",styles$1_selected="pS_Dt",styles$1_image="dcuVD",styles$1_title="bIcfu",styles$1_description="_3nVAQ",Item=function(_PureComponent){function Item(){for(var _this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_PureComponent.call.apply(_PureComponent,[this].concat(args))||this).itemRef=React.createRef(),_this.handleClick=function(){return _this.props.onClick(_this.props.item)},_this}_inheritsLoose(Item,_PureComponent);var _proto=Item.prototype;return _proto.componentDidMount=function(){var _this$itemRef;this.props.selected&&(null===(_this$itemRef=this.itemRef)||void 0===_this$itemRef||_this$itemRef.current.scrollIntoView())},_proto.render=function(){var _this$props=this.props,selected=_this$props.selected,item=_this$props.item;_this$props.t;var name=item.name,imageSrc=item.imageSrc,getDescription=item.getDescription;return React.createElement("div",{ref:this.itemRef,className:classnames(styles$1_container,selected&&styles$1_selected),onClick:this.handleClick},React.createElement("div",{style:{backgroundImage:"url("+imageSrc+")"},className:styles$1_image,"data-hook":"verticalsImage"}),React.createElement("div",{className:styles$1_title},name),getDescription&&React.createElement("div",{className:styles$1_description},getDescription(item)))},Item}(PureComponent),ItemsList=function(_PureComponent){function ItemsList(props){var _this;return(_this=_PureComponent.call(this,props)||this).state={selectedItem:{}},_this}return _inheritsLoose(ItemsList,_PureComponent),ItemsList.prototype.render=function(){var _cx,_this$props=this.props,items=_this$props.items,onClick=_this$props.onClick,selectedItem=_this$props.selectedItem,contentType=_this$props.contentType,t=_this$props.t,isMobile=_this$props.isMobile,emptyState=React.createElement("div",{className:generalStyles_emptyState},React.createElement("div",{className:generalStyles_title},t("Embed_Vertical_"+contentType+"_EmptyState_NoItems_Title")),React.createElement("div",{className:generalStyles_description},t("Embed_Vertical_"+contentType+"_EmptyState_NoItems_Description")));return React.createElement("div",{className:classnames(styles$2_container,(_cx={},_cx[styles$2_mobile]=isMobile,_cx)),"data-hook":"verticalsItemsList"},items.length>0?items.map((function(item,index){return React.createElement(Item,{item:item,key:index,onClick:onClick,selected:(null==selectedItem?void 0:selectedItem.id)===item.id,t:t})})):emptyState)},ItemsList}(PureComponent),styles_itemsWrapper="_1OMRl",styles_fileLoaderIcon="_3hZQC",_excluded=["getDescription"],VerticalEmbedInputModal=function(_Component){function VerticalEmbedInputModal(){for(var _this$props$component,_this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return(_this=_Component.call.apply(_Component,[this].concat(args))||this).state={errorMsg:"",items:[],selectedProduct:(null===(_this$props$component=_this.props.componentData)||void 0===_this$props$component?void 0:_this$props$component.selectedProduct)||null,status:"LOADING"},_this.onInputChange=function(inputString){void 0===inputString&&(inputString=""),_this.verticalApi.search(inputString).then((function(items){_this.setState({items:items,status:0===items.length?"NOT_FOUND":"READY"})})),_this.setState({inputString:inputString})},_this.onConfirm=function(){var _this$props=_this.props,onConfirm=_this$props.onConfirm,componentData=_this$props.componentData,helpers=_this$props.helpers,onReplace=_this$props.onReplace,selectedProduct=_this.state.selectedProduct;selectedProduct&&((onConfirm||onReplace)(_extends({},componentData,{selectedProduct:selectedProduct})),helpers.closeModal())},_this.onItemClick=function(_ref){_ref.getDescription;var item=_objectWithoutPropertiesLoose(_ref,_excluded),_this$state=_this.state,selectedProduct=_this$state.selectedProduct;_this$state.items,item.id===(null==selectedProduct?void 0:selectedProduct.id)?_this.onConfirm():_this.setState({selectedProduct:item})},_this.getItems=function(){var getDescription,_this$props2=_this.props,type=_this$props2.componentData.type,t=_this$props2.t,items=_this.state.items;return type===verticalEmbedProviders.booking?getDescription=function(product){return convertDuration(product.durations,t)}:type===verticalEmbedProviders.event&&(getDescription=function(product){return product.scheduling+" | "+product.location}),getDescription?items.map((function(product){return _extends({},product,{getDescription:getDescription})})):items},_this}_inheritsLoose(VerticalEmbedInputModal,_Component);var _proto=VerticalEmbedInputModal.prototype;return _proto.componentDidMount=function(){var _this2=this,_this$props3=this.props,verticalsApi=_this$props3.verticalsApi,type=_this$props3.componentData.type,locale=_this$props3.locale;this.verticalApi=verticalsApi(type,locale);try{this.verticalApi.search("").then((function(items){_this2.setState({items:items,status:0===items.length?"NO_ITEMS":"READY"})}))}catch(e){console.error("failed to load products ",e),this.setState({items:[],status:"NO_ITEMS"})}},_proto.render=function(){var _experiments$newVerti,_this$state2=this.state,inputString=_this$state2.inputString,selectedProduct=_this$state2.selectedProduct,status=_this$state2.status,_this$props4=this.props,t=_this$props4.t,type=_this$props4.componentData.type,helpers=_this$props4.helpers,isMobile=_this$props4.isMobile,experiments=_this$props4.experiments,contentType=contentTypeMap[type],selected=null!==selectedProduct,emptyState=React.createElement("div",{className:generalStyles_emptyState},React.createElement("div",{className:generalStyles_title},t("Embed_Vertical_"+contentType+"_EmptyState_NoResults_Title")),React.createElement("div",{className:generalStyles_description},t("Embed_Vertical_"+contentType+"_EmptyState_NoResults_Description"))),textInput=!!("NO_ITEMS"!==status)&&{searchIcon:!0},UrlInputModalComponent=(null==experiments||null===(_experiments$newVerti=experiments.newVerticalEmbedModal)||void 0===_experiments$newVerti?void 0:_experiments$newVerti.enabled)?SearchInputModal:UrlInputModal;return React.createElement(UrlInputModalComponent,{onConfirm:this.onConfirm,helpers:helpers,t:t,title:t("Embed_Vertical_"+contentType+"_Title"),dataHook:"verticalEmbedModal",placeholder:t("Embed_Vertical_"+contentType+"_Placeholder"),saveLabel:t("Embed_Add_Button_Label"),onCloseRequested:helpers.closeModal,onInputChange:this.onInputChange,input:inputString,isMobile:isMobile,buttonAlignment:FOOTER_BUTTON_ALIGNMENT.END,controlsPosition:isMobile?MODAL_CONTROLS_POSITION.TOP:MODAL_CONTROLS_POSITION.BOTTOM,selected:selected,textInput:textInput,buttonSize:BUTTON_SIZE.small,showTitle:!isMobile},React.createElement("div",{className:styles_itemsWrapper},"LOADING"===status?React.createElement("div",{className:generalStyles_emptyState},React.createElement(LoaderIcon,{className:styles_fileLoaderIcon})):"NOT_FOUND"===status?emptyState:React.createElement(ItemsList,{isMobile:isMobile,selectedItem:selectedProduct,items:this.getItems(),onClick:this.onItemClick,contentType:contentType,t:t})))},VerticalEmbedInputModal}(Component),createInlineButtons=function(_ref){var t=_ref.t,isMobile=_ref.isMobile,settings=_ref.settings,locale=_ref.locale,_ref$experiments=_ref.experiments,newVerticalEmbedModal=(void 0===_ref$experiments?{}:_ref$experiments).newVerticalEmbedModal,useNewModal=null==newVerticalEmbedModal?void 0:newVerticalEmbedModal.enabled,newModalCustomStyles=isMobile?MOBILE_FULL_SCREEN_CUSTOM_STYLE:_extends({},DesktopFlyOutModalStyles,{content:modalContentStyles}),customStyles=useNewModal?newModalCustomStyles:getModalCustomStyles(isMobile),defaultModalStyles=getModalStyles({customStyles:customStyles,fullScreen:!!useNewModal,isMobile:isMobile}),modalStyles=useNewModal?isMobile?defaultModalStyles:void 0:defaultModalStyles;return[{keyName:"replace",type:BUTTONS.EXTERNAL_MODAL,icon:ReplaceIcon,modalElement:decorateComponentWithProps(VerticalEmbedInputModal,_extends({},settings,{locale:locale})),modalStyles:modalStyles,mobile:!0,tooltipTextKey:"Replace product",t:t,modalStylesFn:useNewModal?function(_ref2){var buttonRef=_ref2.buttonRef,modalStyles=getModalStyles({customStyles:newModalCustomStyles,fullScreen:!0,isMobile:isMobile}),_buttonRef$getBoundin=buttonRef.getBoundingClientRect(),top=_buttonRef$getBoundin.top,modalLeft=_buttonRef$getBoundin.left-15,modalTop=top>522?top-540:top+40;return _extends({},modalStyles,{content:_extends({},modalStyles.content,{top:modalTop,left:modalLeft,margin:0,position:"absolute"})})}:void 0},{keyName:"delete",type:BUTTONS.DELETE,mobile:!0}]},createInsertButtons=function(_ref){var _experiments$newVerti,t=_ref.t,settings=_ref.settings,isMobile=_ref.isMobile,locale=_ref.locale,_ref$experiments=_ref.experiments,experiments=void 0===_ref$experiments?{}:_ref$experiments,iconsMap={product:Product,event:Event,booking:Booking},useNewModal=null==experiments||null===(_experiments$newVerti=experiments.newVerticalEmbedModal)||void 0===_experiments$newVerti?void 0:_experiments$newVerti.enabled,newModalCustomStyles=isMobile?MOBILE_FULL_SCREEN_CUSTOM_STYLE:_extends({},DesktopFlyOutModalStyles,{content:modalContentStyles}),customStyles=useNewModal?newModalCustomStyles:getModalCustomStyles(isMobile),modalStylesFn=useNewModal?function(_ref2){var buttonRef=_ref2.buttonRef,toolbarName=_ref2.toolbarName;return getBottomToolbarModalStyles(buttonRef,{customStyles:customStyles},toolbarName)}:void 0,defaultModalStyles=getModalStyles({customStyles:customStyles,fullScreen:!!useNewModal,isMobile:isMobile}),modalStyles=useNewModal?isMobile?defaultModalStyles:void 0:defaultModalStyles,_settings$exposeEmbed=settings.exposeEmbedButtons,exposeEmbedButtons=void 0===_settings$exposeEmbed?[]:_settings$exposeEmbed,getIsVisiblePromise=settings.getIsVisiblePromise,buttonsBaseProps=function(type){var contentType=contentTypeMap[type];return{type:BUTTON_TYPES.MODAL,name:contentType+"_InsertButton",tooltip:t(contentType+"Plugin_InsertButton_Tooltip"),getIcon:function(){return iconsMap[type]},Icon:iconsMap[type],componentData:{type:type},section:"BlockToolbar_Section_Embed_Wix",modalElement:decorateComponentWithProps(VerticalEmbedInputModal,_extends({},settings,{locale:locale})),isVisiblePromise:null==getIsVisiblePromise?void 0:getIsVisiblePromise(type,locale),modalStylesFn:modalStylesFn}},toolbars=useNewModal?[TOOLBARS.MOBILE,TOOLBARS.FOOTER,TOOLBARS.SIDE]:[TOOLBARS.INSERT_PLUGIN,TOOLBARS.MOBILE,TOOLBARS.FOOTER,TOOLBARS.SIDE],verticalEmbedButtons=exposeEmbedButtons.map((function(verticalType){return _extends({},buttonsBaseProps(verticalType),{toolbars:toolbars,modalStyles:modalStyles})}));if(useNewModal){var externalToolbarButtons=exposeEmbedButtons.map((function(verticalType){return _extends({},buttonsBaseProps(verticalType),{toolbars:[TOOLBARS.INSERT_PLUGIN],modalStyles:getModalStyles({customStyles:_extends({},customStyles,DesktopOverlayModalStyles),fullScreen:!1,isMobile:isMobile})})}));verticalEmbedButtons=[].concat(verticalEmbedButtons,externalToolbarButtons)}return verticalEmbedButtons},createToolbar=function(_ref){var settings=_ref.settings,t=_ref.t,isMobile=_ref.isMobile,locale=_ref.locale,experiments=_ref.experiments;return{InlineButtons:createInlineButtons({t:t,isMobile:isMobile,settings:settings,locale:locale,experiments:experiments}),InsertButtons:createInsertButtons({t:t,settings:settings,isMobile:isMobile,locale:locale,experiments:experiments}),name:"vertical-embed"}};function _toPropertyKey(arg){var key=function(input,hint){if("object"!=typeof input||null===input)return input;var prim=input[Symbol.toPrimitive];if(void 0!==prim){var res=prim.call(input,hint||"default");if("object"!=typeof res)return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}(arg,"string");return"symbol"==typeof key?key:String(key)}var _ModalsMap,createVerticalEmbedPlugin=function(config){var type=VERTICAL_EMBED_TYPE,helpers=config.helpers,theme=config.theme,t=config.t,_config$type=config[type],settings=void 0===_config$type?{}:_config$type,isMobile=config.isMobile,locale=config.locale,localeContent=config.localeContent,experiments=config.experiments,rest=_objectWithoutPropertiesLoose(config,["helpers","theme","t",type,"isMobile","locale","localeContent","experiments"].map(_toPropertyKey));return createBasePlugin(_extends({component:VerticalEmbedComponent,settings:settings,theme:theme,type:type,toolbar:createToolbar({settings:settings,helpers:helpers,t:t,isMobile:isMobile,locale:localeContent||locale,experiments:experiments}),helpers:helpers,t:t,defaultPluginData:{},isMobile:isMobile,locale:localeContent||locale},rest))};createVerticalEmbedPlugin.functionName=VERTICAL_EMBED_TYPE;var Modals={POST_SELECTION_INPUT:"post-selection-input"},ModalsMap=((_ModalsMap={})[Modals.POST_SELECTION_INPUT]=VerticalEmbedInputModal,_ModalsMap),pluginVerticalEmbed=function(config){return{config:_extends({},config),type:VERTICAL_EMBED_TYPE,createPlugin:createVerticalEmbedPlugin,ModalsMap:ModalsMap}};export{Modals,ModalsMap,VERTICAL_EMBED_TYPE,createVerticalEmbedPlugin,pluginVerticalEmbed,verticalEmbedProviders};
import{HEADER_BLOCK,RICOS_TEXT_COLOR_TYPE,RICOS_TEXT_HIGHLIGHT_TYPE,RICOS_FONT_SIZE_TYPE,TEXT_COLOR_TYPE,TEXT_HIGHLIGHT_TYPE,RICOS_BOLD_TYPE,RICOS_ITALIC_TYPE}from"ricos-content";export*from"ricos-content";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import React,{Component,PureComponent,useRef,useEffect}from"react";import{InView}from"react-intersection-observer";import classNames from"classnames";import _extends from"@babel/runtime/helpers/extends";import{pickBy,has,mergeWith,upperFirst,camelCase,merge}from"lodash";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _regeneratorRuntime from"@babel/runtime/regenerator";import{translate,I18nextProvider,I18n}from"react-i18next";export{Trans,translate}from"react-i18next";import{createInstance}from"i18next";var __assign$r=function(){return(__assign$r=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};var _DRAFT_TO_RICOS_DOC_T,ButtonType,ModifierKey,ToolbarType,DisplayMode,DecorationMode,baseLink={target:"SELF"},Link_fromJSON=function(object){var message=__assign$r({},baseLink);return void 0!==object.url&&null!==object.url?message.url=String(object.url):message.url=void 0,void 0!==object.anchor&&null!==object.anchor?message.anchor=String(object.anchor):message.anchor=void 0,void 0!==object.target&&null!==object.target?message.target=function(object){switch(object){case 0:case"SELF":return"SELF";case 1:case"BLANK":return"BLANK";case 2:case"PARENT":return"PARENT";case 3:case"TOP":return"TOP";case-1:case"UNRECOGNIZED":default:return"UNRECOGNIZED"}}(object.target):message.target="SELF",void 0!==object.rel&&null!==object.rel?message.rel=Link_Rel.fromJSON(object.rel):message.rel=void 0,void 0!==object.customData&&null!==object.customData?message.customData=String(object.customData):message.customData=void 0,message},Link_toJSON=function(message){var obj={};return void 0!==message.url&&(obj.url=message.url),void 0!==message.anchor&&(obj.anchor=message.anchor),void 0!==message.target&&(obj.target=function(object){switch(object){case"SELF":return"SELF";case"BLANK":return"BLANK";case"PARENT":return"PARENT";case"TOP":return"TOP";default:return"UNKNOWN"}}(message.target)),void 0!==message.rel&&(obj.rel=message.rel?Link_Rel.toJSON(message.rel):void 0),void 0!==message.customData&&(obj.customData=message.customData),obj},baseLink_Rel={},Link_Rel={fromJSON:function(object){var message=__assign$r({},baseLink_Rel);return void 0!==object.nofollow&&null!==object.nofollow?message.nofollow=Boolean(object.nofollow):message.nofollow=void 0,void 0!==object.sponsored&&null!==object.sponsored?message.sponsored=Boolean(object.sponsored):message.sponsored=void 0,void 0!==object.ugc&&null!==object.ugc?message.ugc=Boolean(object.ugc):message.ugc=void 0,message},toJSON:function(message){var obj={};return void 0!==message.nofollow&&(obj.nofollow=message.nofollow),void 0!==message.sponsored&&(obj.sponsored=message.sponsored),void 0!==message.ugc&&(obj.ugc=message.ugc),obj}},__assign$n=function(){return(__assign$n=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},baseLinkData={},LinkData={fromJSON:function(object){var message=__assign$n({},baseLinkData);return void 0!==object.link&&null!==object.link?message.link=Link_fromJSON(object.link):message.link=void 0,message},toJSON:function(message){var obj={};return void 0!==message.link&&(obj.link=message.link?Link_toJSON(message.link):void 0),obj}},DROPDOWN_OPTIONS_TO_DOC_STYLE_TYPE={P:"paragraph",H1:"headerOne",H2:"headerTwo",H3:"headerThree",H4:"headerFour",H5:"headerFive",H6:"headerSix"},DRAFT_TO_RICOS_DOC_TYPE=((_DRAFT_TO_RICOS_DOC_T={})[HEADER_BLOCK.ONE]="headerOne",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.TWO]="headerTwo",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.THREE]="headerThree",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.FOUR]="headerFour",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.FIVE]="headerFive",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.SIX]="headerSix",_DRAFT_TO_RICOS_DOC_T[HEADER_BLOCK.PARAGRAPH]="paragraph",_DRAFT_TO_RICOS_DOC_T);!function(ButtonType){ButtonType.CUSTOM="custom",ButtonType.FILES="file",ButtonType.TOGGLE="toggle",ButtonType.PANEL="panel",ButtonType.INLINE_PANEL="inline-panel",ButtonType.EXTERNAL_MODAL="external-modal",ButtonType.DROPDOWN="dropdown",ButtonType.SEPARATOR="separator",ButtonType.SIZE_ORIGINAL="size-original",ButtonType.SIZE_CONTENT_CENTER="size-content-center",ButtonType.SIZE_SMALL_CENTER="size-small-center",ButtonType.SIZE_SMALL_LEFT="size-small-left",ButtonType.SIZE_SMALL_RIGHT="size-small-right",ButtonType.ALIGN_LEFT="align-left",ButtonType.ALIGN_RIGHT="align-right",ButtonType.ALIGN_CENTER="align-center",ButtonType.SIZE_CONTENT="size-content",ButtonType.SIZE_FULL_WIDTH="size-full-width",ButtonType.SIZE_SMALL="size-small",ButtonType.SIZE_MEDIUM="size-medium",ButtonType.SIZE_LARGE="size-large",ButtonType.TEXT_ALIGN_LEFT="alignment-left",ButtonType.TEXT_ALIGN_CENTER="alignment-center",ButtonType.TEXT_ALIGN_RIGHT="alignment-right",ButtonType.WIDTH="width",ButtonType.HEIGHT="height",ButtonType.LINK="link",ButtonType.SPOILER="spoiler",ButtonType.DELETE="delete",ButtonType.LINK_PREVIEW="link-preview",ButtonType.VIDEO_SETTINGS="video-settings"}(ButtonType||(ButtonType={})),function(ModifierKey){ModifierKey.COMMAND="command",ModifierKey.CTRL="ctrl",ModifierKey.OPTION="option",ModifierKey.SHIFT="shift",ModifierKey.ALT="alt"}(ModifierKey||(ModifierKey={})),function(ToolbarType){ToolbarType.SIDE="SIDE",ToolbarType.MOBILE="MOBILE",ToolbarType.FOOTER="FOOTER",ToolbarType.STATIC="STATIC",ToolbarType.INLINE="INLINE",ToolbarType.PLUGIN="PLUGIN",ToolbarType.FORMATTING="FORMATTING",ToolbarType.INSERT_PLUGIN="INSERT_PLUGIN",ToolbarType.TEXT="ALL-TEXT-TOOLBARS",ToolbarType.SHORTCUT="SHORTCUT",ToolbarType.LINK="LINK"}(ToolbarType||(ToolbarType={})),function(DisplayMode){DisplayMode.NORMAL="NORMAL",DisplayMode.FLOATING="FLOATING"}(DisplayMode||(DisplayMode={})),function(DecorationMode){DecorationMode.PREPEND="PREPEND",DecorationMode.WRAP="WRAP",DecorationMode.APPEND="APPEND"}(DecorationMode||(DecorationMode={}));var CUSTOM_LINK="custom-link",noOutlineStyle_noOutline="_1-vl0",AccessibilityListener=function(_Component){function AccessibilityListener(){var _this;return(_this=_Component.apply(this,arguments)||this).handleTabKeyUp=function(e){9===e.which&&document.body.classList.contains(noOutlineStyle_noOutline)&&document.body.classList.remove(noOutlineStyle_noOutline)},_this.handleClick=function(){document.body.classList.contains(noOutlineStyle_noOutline)||document.body.classList.add(noOutlineStyle_noOutline)},_this.render=function(){return null},_this}_inheritsLoose(AccessibilityListener,_Component);var _proto=AccessibilityListener.prototype;return _proto.componentDidMount=function(){document.body.classList.add(noOutlineStyle_noOutline),this.props.isMobile||(document.addEventListener("keyup",this.handleTabKeyUp),document.addEventListener("click",this.handleClick))},_proto.componentWillUnmount=function(){this.props.isMobile||(document.removeEventListener("keyup",this.handleTabKeyUp),document.removeEventListener("click",this.handleClick))},AccessibilityListener}(Component),cssClassMerger=function(defaultStyleClassName,themeClassName){return defaultStyleClassName+" "+themeClassName},mergeStyles=function(_ref){var styles=_ref.styles,theme=_ref.theme;if(!theme)return console.warn("mergeStyles invoked without theme!"),styles;var themeStyles=pickBy(theme),themeStylesToMerge=pickBy(themeStyles,(function(_,key){return has(styles,key)}));return mergeWith(_extends({},styles),themeStylesToMerge,cssClassMerger)},isSSR=function(){return"undefined"==typeof window},styles={placeholder:"_2bUeE"},ViewportRenderer=function(_Component){function ViewportRenderer(){return _Component.apply(this,arguments)||this}return _inheritsLoose(ViewportRenderer,_Component),ViewportRenderer.prototype.render=function(){var _this=this,_this$props=this.props,children=_this$props.children,placeholderStyle=_this$props.placeholderStyle,placeholderClass=_this$props.placeholderClass,containerStyle=_this$props.containerStyle,containerClass=_this$props.containerClass,theme=this.props.theme;return this.styles=this.styles||mergeStyles({styles:styles,theme:theme}),isSSR()||void 0===window.IntersectionObserver?children:React.createElement(InView,{triggerOnce:!0},(function(_ref){var inView=_ref.inView,ref=_ref.ref;return inView?React.createElement("div",{ref:ref,style:containerStyle,className:containerClass},children):React.createElement("div",{ref:ref,className:classNames(_this.styles.placeholder,placeholderClass),style:placeholderStyle})}))},ViewportRenderer}(Component);function i18n(_ref){var _resources,locale=_ref.locale,localeResource=_ref.localeResource;return createInstance().init({lng:locale,keySeparator:"$",interpolation:{escapeValue:!1},react:{wait:!0},resources:(_resources={},_resources[locale]={translation:localeResource},_resources)})}function getDisplayName(Component){return Component.displayName||Component.name||"Component"}function createHocName(hocComponentName,WrappedComponent){return hocComponentName+"("+getDisplayName(WrappedComponent)+")"}ViewportRenderer.defaultProps={placeholderStyle:{},containerStyle:{},alwaysRenderChildren:!1,placeholderClass:"",containerClass:""};var memoizedNow,_excluded=["forwardedRef"],withI18n=function(Component,defaultLocaleResource,_temp){var _ref$forceRemount=(void 0===_temp?{}:_temp).forceRemount,forceRemount=void 0===_ref$forceRemount||_ref$forceRemount,Translated=translate(void 0,{withRef:!0})(Component),I18nWrapper=function(_PureComponent){function I18nWrapper(props){var _this;_this=_PureComponent.call(this,props)||this;var locale=props.locale,localeResource=props.localeResource;return _this.i18n=i18n({locale:locale,localeResource:localeResource}),_this.state={key:I18nWrapper.displayName+"-"+locale},_this}_inheritsLoose(I18nWrapper,_PureComponent);var _proto=I18nWrapper.prototype;return _proto.componentDidMount=function(){var _componentDidMount=_asyncToGenerator(_regeneratorRuntime.mark((function _callee(){var _yield$this$getResour,locale,localeResource;return _regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:if("en"===this.props.locale){_context.next=7;break}return _context.next=3,this.getResourceByLocale(this.props.locale);case 3:_yield$this$getResour=_context.sent,locale=_yield$this$getResour.locale,localeResource=_yield$this$getResour.localeResource,this.changeLocale({locale:locale,localeResource:localeResource});case 7:case"end":return _context.stop()}}),_callee,this)})));return function(){return _componentDidMount.apply(this,arguments)}}(),_proto.componentWillReceiveProps=function(nextProps){this.props.locale!==nextProps.locale&&this.changeLocale(nextProps)},_proto.getResourceByLocale=function(){var _getResourceByLocale=_asyncToGenerator(_regeneratorRuntime.mark((function _callee2(locale){var localeResource;return _regeneratorRuntime.wrap((function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,_context2.next=3,import(
/* webpackChunkName: "messages_[request]" */
"wix-rich-content-common/dist/statics/locale/messages_"+locale+".json").then((function(res){return res.default}));case 3:return localeResource=_context2.sent,_context2.abrupt("return",{locale:locale,localeResource:localeResource});case 7:throw _context2.prev=7,_context2.t0=_context2.catch(0),new Error("error while loading locale "+locale+":\n"+_context2.t0);case 10:case"end":return _context2.stop()}}),_callee2,null,[[0,7]])})));return function(_x){return _getResourceByLocale.apply(this,arguments)}}(),_proto.changeLocale=function(_ref2){var _this2=this,locale=_ref2.locale,localeResource=_ref2.localeResource;this.i18n.addResourceBundle(locale,"translation",localeResource),this.i18n.changeLanguage(locale,(function(err){err||(forceRemount?_this2.setState({key:I18nWrapper.displayName+"-"+_this2.i18n.language}):_this2.forceUpdate())}))},_proto.render=function(){var _this$props=this.props,forwardedRef=_this$props.forwardedRef,rest=_objectWithoutPropertiesLoose(_this$props,_excluded);return React.createElement(I18nextProvider,{i18n:this.i18n},React.createElement(Translated,Object.assign({key:this.state.key},rest,{ref:forwardedRef})))},I18nWrapper}(PureComponent);return I18nWrapper.defaultProps={locale:"en",localeResource:defaultLocaleResource},I18nWrapper.displayName=createHocName("I18nWrapper",Component),React.forwardRef((function(props,ref){return React.createElement(I18nWrapper,Object.assign({},props,{forwardedRef:ref}))}))},RicosTranslate=function(_ref3){var children=_ref3.children,locale=_ref3.locale,localeResource=_ref3.localeResource,i18nInstance=useRef(i18n({locale:locale,localeResource:localeResource})),_React$useState=React.useState(0),forceCounter=_React$useState[0],forceUpdate=_React$useState[1];return useEffect((function(){i18nInstance.current.addResourceBundle(locale,"translation",localeResource),i18nInstance.current.changeLanguage(locale,(function(err){err||forceUpdate(forceCounter+1)}))}),[locale,localeResource]),React.createElement(I18nextProvider,{i18n:i18nInstance.current},React.createElement(I18n,{i18n:i18nInstance.current,wait:!0,initialLanguage:locale},(function(t){return children(t)})))},alignmentClassName=function(componentData,theme,styles){var alignment=(componentData.config||{}).alignment;if(!alignment)return"";var key="align"+upperFirst(alignment);return classNames(styles[key],theme[key])},sizeClassName=function(componentData,theme,styles){var size=(componentData.config||{}).size;if(!size)return"";var key="size"+upperFirst(camelCase(size));return classNames(styles[key],theme[key])},textWrapClassName=function(componentData,theme,styles){var textWrap=(componentData.config||{}).textWrap;if(!textWrap)return"";var key="textWrap"+upperFirst(camelCase(textWrap));return classNames(styles[key],theme[key])},depthClassName=function(depth){return"public-DraftStyleDefault-block-depth"+depth},convertRelObjectToString=function(relObject){if(relObject){var relString="";return relObject.nofollow&&(relString+="nofollow "),relObject.sponsored&&(relString+="sponsored "),relObject.ugc&&(relString+="ugc"),relString.trim()}},convertRelStringToObject=function(rel){var relObject={};return rel?(rel.includes("nofollow")&&(relObject.nofollow=!0),rel.includes("sponsored")&&(relObject.sponsored=!0),rel.includes("ugc")&&(relObject.ugc=!0),relObject):relObject},convertTargetStringToBoolean=function(target){return"_blank"===target},convertTargetBooleanToString=function(targetBlank){return targetBlank?"_blank":"_top"},getRelValue=function(rel){return("noopener noreferrer "+(rel||"")).trim()},safeJsonParse=function(jsonString){try{return JSON.parse(jsonString)}catch(e){return}};function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}function compute(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C}function isOptionsObject(options){return options===Object(options)&&0!==Object.keys(options).length}function scrollIntoView$1(target,options){var targetIsDetached=!target.ownerDocument.documentElement.contains(target);if(isOptionsObject(options)&&"function"==typeof options.behavior)return options.behavior(targetIsDetached?[]:compute(target,options));if(!targetIsDetached){var computeOptions=function(options){return!1===options?{block:"end",inline:"nearest"}:isOptionsObject(options)?options:{block:"start",inline:"nearest"}}(options);return function(actions,behavior){void 0===behavior&&(behavior="auto");var canSmoothScroll="scrollBehavior"in document.body.style;actions.forEach((function(_ref){var el=_ref.el,top=_ref.top,left=_ref.left;el.scroll&&canSmoothScroll?el.scroll({top:top,left:left,behavior:behavior}):(el.scrollTop=top,el.scrollLeft=left)}))}(compute(target,computeOptions),computeOptions.behavior)}}var now=function(){return memoizedNow||(memoizedNow="performance"in window?performance.now.bind(performance):Date.now),memoizedNow()};function step(context){var time=now(),elapsed=Math.min((time-context.startTime)/context.duration,1),value=context.ease(elapsed),currentX=context.startX+(context.x-context.startX)*value,currentY=context.startY+(context.y-context.startY)*value;context.method(currentX,currentY),currentX!==context.x||currentY!==context.y?requestAnimationFrame((function(){return step(context)})):context.cb()}function smoothScroll(el,x,y,duration,ease,cb){var scrollable,startX,startY;void 0===duration&&(duration=600),void 0===ease&&(ease=function(t){return 1+--t*t*t*t*t}),scrollable=el,startX=el.scrollLeft,startY=el.scrollTop,step({scrollable:scrollable,method:function(x,y){el.scrollLeft=Math.ceil(x),el.scrollTop=Math.ceil(y)},startTime:now(),startX:startX,startY:startY,x:x,y:y,duration:duration,ease:ease,cb:cb})}var scrollIntoView=function(target,options){var overrides=options||{};return function(options){return options&&!options.behavior||"smooth"===options.behavior}(overrides)?scrollIntoView$1(target,{block:overrides.block,inline:overrides.inline,scrollMode:overrides.scrollMode,boundary:overrides.boundary,behavior:function(actions){return Promise.all(actions.reduce((function(results,_ref){var el=_ref.el,left=_ref.left,top=_ref.top,startLeft=el.scrollLeft,startTop=el.scrollTop;return startLeft===left&&startTop===top?results:[].concat(results,[new Promise((function(resolve){return smoothScroll(el,left,top,overrides.duration,overrides.ease,(function(){return resolve({el:el,left:[startLeft,left],top:[startTop,top]})}))}))])}),[]))}}):Promise.resolve(scrollIntoView$1(target,options))},anchorScroll=function(element,experiments){var _document$querySelect,_document$querySelect2,_document$querySelect3,_document$querySelect4,_experiments$anchorSc,fixedElementsOffset=((null===(_document$querySelect=document.querySelector('[id="SITE_HEADER"]'))||void 0===_document$querySelect?void 0:_document$querySelect.clientHeight)||0)+((null===(_document$querySelect2=document.querySelector('[id="WIX_ADS"]'))||void 0===_document$querySelect2?void 0:_document$querySelect2.clientHeight)||0)+((null===(_document$querySelect3=document.querySelector('[data-hook="mobileToolbar"]'))||void 0===_document$querySelect3?void 0:_document$querySelect3.clientHeight)||(null===(_document$querySelect4=document.querySelector('[data-hook="ricos-editor-toolbars"]'))||void 0===_document$querySelect4?void 0:_document$querySelect4.clientHeight)||0);null!=experiments&&null!==(_experiments$anchorSc=experiments.anchorScrollWithSmoothScrollIntoViewIfNeeded)&&void 0!==_experiments$anchorSc&&_experiments$anchorSc.enabled?anchorScrollUsingSmoothScrollIntoViewIfNeeded(element,fixedElementsOffset):anchorScrollUsingScrollIntoView(element,fixedElementsOffset)},anchorScrollUsingSmoothScrollIntoViewIfNeeded=function(element,fixedElementsOffset){var _element$style=element.style,paddingTop=_element$style.paddingTop,marginTop=_element$style.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",scrollIntoView(element,{block:"start",inline:"start"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},anchorScrollUsingScrollIntoView=function(element,fixedElementsOffset){var _element$style2=element.style,paddingTop=_element$style2.paddingTop,marginTop=_element$style2.marginTop;element.style.marginTop="-"+fixedElementsOffset+"px",element.style.paddingTop=fixedElementsOffset+"px",element.scrollIntoView({behavior:"smooth"}),element.style.marginTop=marginTop,element.style.paddingTop=paddingTop},addAnchorTagToUrl=function(anchorString){var url=new URL(window.location.href);url.hash=anchorString,history.pushState({},"",url.href)},isNewTab=function(target){return"_blank"===target},hasLinksInBlock=function(block,contentState){return getLinkRangesInBlock(block,contentState).length>0},getLinkRangesInBlock=function(block,contentState){var ranges=[];return block.entityRanges.forEach((function(entityRange){var _contentState$entityM,entityType=null===(_contentState$entityM=contentState.entityMap[entityRange.key])||void 0===_contentState$entityM?void 0:_contentState$entityM.type;if("LINK"===entityType||"wix-draft-plugin-external-link"===entityType){var start=entityRange.offset,end=start+entityRange.length;ranges.push([start,end])}})),ranges},contentStateSchema={definitions:{inlineStyleDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/inline-style.json",type:"object",title:"inline style",required:["offset","length","style"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},style:{$id:"#/properties/style",type:"string",title:"style",default:"",examples:["color4"],pattern:"^(.*)$"}}},entityRangeDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"inline style",required:["offset","length","key"],properties:{offset:{$id:"#/properties/offset",type:"integer",title:"offset",default:0,min:0,examples:[0]},length:{$id:"#/properties/length",type:"integer",title:"length",default:0,min:0,examples:[4]},key:{$id:"#/properties/style",type:"integer",title:"key",default:"",examples:[0]}}},entityDef:{definitions:{},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/entity-range.json",type:"object",title:"entity",required:["type","data"],properties:{type:{$id:"#/properties/type",enum:["IMAGE","VIDEO-EMBED","LINK","mention","wix-draft-plugin-image","wix-draft-plugin-link-button","wix-draft-plugin-action-button","wix-draft-plugin-video","wix-draft-plugin-gallery","wix-draft-plugin-link","wix-draft-plugin-html","wix-draft-plugin-sound-cloud","wix-draft-plugin-hashtag","wix-draft-plugin-divider","wix-draft-plugin-emoji","wix-draft-plugin-giphy","wix-draft-plugin-map","wix-draft-plugin-file-upload","wix-draft-plugin-vertical-embed","wix-draft-plugin-poll","wix-draft-plugin-link-preview","ANCHOR","wix-rich-content-plugin-table","wix-rich-content-plugin-collapsible-list"],title:"entity type",examples:["wix-draft-plugin-image"]},mutability:{$id:"#/properties/mutability",type:"string",enum:["MUTABLE","IMMUTABLE","SEGMENTED"],title:"entity mutability",examples:["IMMUTABLE"]},data:{$id:"#/properties/data",type:"object",title:"entity data"}},anyOf:[{}]},textBlockStyle:{$id:"https://wix-rich-content/text-block-style.json",title:"text block style",type:"object"}},$schema:"http://json-schema.org/draft-07/schema#",$id:"https://wix-rich-content/content-state-schema.json",type:"object",title:"content state",required:["blocks","entityMap","VERSION"],properties:{blocks:{$id:"#/properties/blocks",type:"array",title:"blocks",items:{$id:"#/properties/blocks/items",type:"object",title:"block",required:["key","text","type","inlineStyleRanges","entityRanges","data"],properties:{key:{$id:"#/properties/blocks/items/properties/key",type:"string",title:"block key",default:"",examples:["45qkg"],pattern:"^(.*)$"},text:{$id:"#/properties/blocks/items/properties/text",type:"string",title:"text",default:"",examples:["test"]},type:{$id:"#/properties/blocks/items/properties/type",type:"string",title:"block type",default:"",examples:["unstyled"],enum:["unstyled","header-one","header-two","header-three","header-four","header-five","header-six","unordered-list-item","ordered-list-item","blockquote","atomic","code-block","figure"]},depth:{$id:"#/properties/blocks/items/properties/depth",type:"integer",title:"depth",maximum:10,default:0,examples:[0]},inlineStyleRanges:{$id:"#/properties/blocks/items/properties/inlineStyleRanges",type:"array",title:"inline style ranges",items:{$ref:"#/definitions/inlineStyleDef"}},entityRanges:{$id:"#/properties/blocks/items/properties/entityRanges",type:"array",title:"entity ranges",default:null,items:{$ref:"#/definitions/entityRangeDef"}},data:{$id:"#/properties/blocks/items/properties/data",type:"object",title:"data",default:null}}}},entityMap:{$id:"#/properties/entityMap",type:"object",title:"entity map",patternProperties:{"[0-9]+":{$ref:"#/definitions/entityDef"}}},documentStyle:{$id:"#/properties/documentStyle",type:"object",title:"document style",default:null,properties:{headerOne:{$ref:"#/definitions/textBlockStyle"},headerTwo:{$ref:"#/definitions/textBlockStyle"},headerThree:{$ref:"#/definitions/textBlockStyle"},headerFour:{$ref:"#/definitions/textBlockStyle"},headerFive:{$ref:"#/definitions/textBlockStyle"},headerSix:{$ref:"#/definitions/textBlockStyle"},paragraph:{$ref:"#/definitions/textBlockStyle"}}}}},validate=function(data,schema){return!0},getContentStateSchema=function(pluginDataSchemas){void 0===pluginDataSchemas&&(pluginDataSchemas={});var schema=contentStateSchema;return schema.definitions.entityDef.anyOf=Object.keys(pluginDataSchemas).map((function(pluginType){return{properties:{type:{const:pluginType},data:pluginDataSchemas[pluginType]}}})),schema},LTR="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",isRtlRegex=new RegExp("^[^"+LTR+"]*[֑-߿יִ-﷽ﹰ-ﻼ]"),isLtrRegex=new RegExp("^[^֑-߿יִ-﷽ﹰ-ﻼ]*["+LTR+"]"),emojiRegex=/\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]/g,getTextDirection=function(text){var result="neutral";if(!text)return result;var plainText=text.replace(emojiRegex,"");return isRtlRegex.test(plainText)?result="rtl":isLtrRegex.test(plainText)&&(result="ltr"),result},getDirectionFromAlignmentAndTextDirection=function(textAlignment,textDirection){return"right"===textAlignment?"rtl":"left"===textAlignment?"ltr":textDirection&&"rtl"===textDirection?textDirection:"ltr"},GlobalContext=React.createContext({isMobile:!1,experiments:{}}),isHexColor=function(str){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(str)},rtlLangs=["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"],isRtl=function(locale){return!!locale&&rtlLangs.includes(locale.split("-|_")[0].toLowerCase())},getLangDir=function(locale){return isRtl(locale)?"rtl":"ltr"},simplePubsub=function(initialState){var state=initialState||{},listeners={},subscribe=function(key,callback){if("function"!=typeof callback)throw"Callback for key "+key+" is not a function";return listeners[key]=listeners[key]||[],listeners[key].push(callback),function(){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))}},update=function(key,newData,blockKey){var data=get(key),newItem=merge({},data,newData);blockKey?_setSingle(key,newItem,blockKey):set(key,newItem)},_setSingle=function(key,item,blockKey){var _extends2;state=_extends({},state,((_extends2={})[key]=item,_extends2)),listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key],blockKey)}))},_setBatch=function(updates){state=_extends({},state,updates),Object.keys(updates).forEach((function(key){listeners[key]&&listeners[key].forEach((function(listener){return listener(state[key])}))}))},set=function(){1===arguments.length?_setBatch(arguments.length<=0?void 0:arguments[0]):_setSingle.apply(void 0,arguments)},setBlockHandler=function(key,blockKey,item){_setSingle(blockHandlerKey(key,blockKey),item)},get=function(key){return state[key]},getBlockHandler=function(key,blockKey){return void 0===blockKey&&(blockKey=state.focusedBlock),state[blockHandlerKey(key,blockKey)]},blockHandlerKey=function(key,blockKey){return blockKey+"_"+key};return{subscribe:subscribe,unsubscribe:function(key,callback){listeners[key]=listeners[key].filter((function(listener){return listener!==callback}))},update:update,set:set,setBlockHandler:setBlockHandler,get:get,getBlockHandler:getBlockHandler,store:{get:get,getBlockHandler:getBlockHandler,update:update,set:set,setBlockHandler:setBlockHandler},getBlockData:function(_ref3){var key=_ref3.key,_ref3$blockKey=_ref3.blockKey,blockKey=void 0===_ref3$blockKey?state.focusedBlock:_ref3$blockKey;return state[blockHandlerKey(key,blockKey)]},setBlockData:function(_ref2){var key=_ref2.key,_ref2$blockKey=_ref2.blockKey,blockKey=void 0===_ref2$blockKey?state.focusedBlock:_ref2$blockKey,item=_ref2.item;_setSingle(blockHandlerKey(key,blockKey),item)},subscribeOnBlock:function(_ref){var key=_ref.key,_ref$blockKey=_ref.blockKey,blockKey=void 0===_ref$blockKey?state.focusedBlock:_ref$blockKey,callback=_ref.callback;return subscribe(blockHandlerKey(key,blockKey),callback)}}},generateKey=function(){return Math.random().toString(36).substr(2,9)},getBlocksFromContentState=function(contentState){var entityMap,rceInRcePlugins,innerRCEBlocks=(entityMap=contentState.entityMap,rceInRcePlugins=["wix-rich-content-plugin-table","wix-rich-content-plugin-collapsible-list"],Object.values(entityMap).some((function(entity){return rceInRcePlugins.includes(entity.type)}))?getInnerRCEBlocks(contentState.entityMap):[]);return[].concat(contentState.blocks,innerRCEBlocks)};function getInnerRCEBlocks(object){var result=[];if(object instanceof Array)Array.prototype.forEach.call(object,(function(arrayElement){var innerBlocks=getInnerRCEBlocks(arrayElement);innerBlocks&&(result=[].concat(result,innerBlocks))}));else for(var _i=0,_Object$entries=Object.entries(object);_i<_Object$entries.length;_i++){var _Object$entries$_i=_Object$entries[_i],key=_Object$entries$_i[0],value=_Object$entries$_i[1];if("blocks"===key)return value;if(value instanceof Object||value instanceof Array){var innerBlocks=getInnerRCEBlocks(value);innerBlocks&&(result=[].concat(result,innerBlocks))}}return result}var _INLINE_STYLE_TYPES,_RICOS_TO_DRAFT_TYPE,_dynamicStyleParsers,_defaultStyleFnMapper,_defaultStyleSelectio,ADD_PLUGIN_LINK_BI="addPluginLink",WEB_ADDRESS_CATEGORY="web_address",ANCHOR_CATEGORY="section",LINK_VIEWER_DATA_HOOK="linkViewer",ANCHOR_VIEWER_DATA_HOOK="anchorViewer";function isInEditor(contentBlock){return contentBlock.toJS}function isInLink(i,block,contentState){var entityKey=function(i,block){var _block$entityRanges$f;return isInEditor(block)?block.getEntityAt(i):null===(_block$entityRanges$f=block.entityRanges.find((function(_ref){var offset=_ref.offset,length=_ref.length;return i>offset&&i<offset+length})))||void 0===_block$entityRanges$f?void 0:_block$entityRanges$f.key}(i,block);return function(type){return"LINK"===type||"ricos-plugin-custom-link"===type}(function(block,contentState,entityKey){var _contentState$entityM;return isInEditor(block)?null!==entityKey&&contentState.getEntity(entityKey).getType():null===(_contentState$entityM=contentState.entityMap[entityKey])||void 0===_contentState$entityM?void 0:_contentState$entityM.type}(block,contentState,entityKey))}function createJustificationFixDecorator(){var isTextJustified=function(contentBlock){return"justify"===function(contentBlock){var _contentBlock$data;return isInEditor(contentBlock)?contentBlock.getData().get("textAlignment"):null==contentBlock||null===(_contentBlock$data=contentBlock.data)||void 0===_contentBlock$data?void 0:_contentBlock$data.textAlignment}(contentBlock)};return{strategy:function(contentBlock,callback,contentState){if(!isSSR()&&(isSSR()||!window.chrome)&&isTextJustified(contentBlock))for(var match,regex=/\s[^\s]/g,str=contentBlock.getText();null!==(match=regex.exec(str));)isInLink(match.index,contentBlock,contentState)||callback(match.index,match.index+1)},component:function(props){return React.createElement("span",{style:{whiteSpace:"normal"}},props.children)}}}var INLINE_STYLE_TYPES=((_INLINE_STYLE_TYPES={})[RICOS_TEXT_COLOR_TYPE]="FG",_INLINE_STYLE_TYPES[RICOS_TEXT_HIGHLIGHT_TYPE]="BG",_INLINE_STYLE_TYPES[RICOS_FONT_SIZE_TYPE]="font-size",_INLINE_STYLE_TYPES),RICOS_TO_DRAFT_TYPE=((_RICOS_TO_DRAFT_TYPE={})[RICOS_TEXT_COLOR_TYPE]=TEXT_COLOR_TYPE,_RICOS_TO_DRAFT_TYPE[RICOS_TEXT_HIGHLIGHT_TYPE]=TEXT_HIGHLIGHT_TYPE,_RICOS_TO_DRAFT_TYPE),parseStyleByType=function(style,type){var property=INLINE_STYLE_TYPES[type],cssRule=safeJsonParse(style);return null==cssRule?void 0:cssRule[property]},dynamicStyleParsers=((_dynamicStyleParsers={})[RICOS_TEXT_COLOR_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,RICOS_TEXT_COLOR_TYPE);if(styleSelectionPredicate){var parsedStyle=color||style;return styleSelectionPredicate(parsedStyle)&&parsedStyle}return color||isHexColor(style)&&style},_dynamicStyleParsers[RICOS_TEXT_HIGHLIGHT_TYPE]=function(style,styleSelectionPredicate){var color=parseStyleByType(style,RICOS_TEXT_HIGHLIGHT_TYPE);return styleSelectionPredicate?styleSelectionPredicate(color)&&color:color},_dynamicStyleParsers[RICOS_FONT_SIZE_TYPE]=function(style){return parseStyleByType(style,RICOS_FONT_SIZE_TYPE)},_dynamicStyleParsers),draftDecorationsToCss={BOLD:{"font-weight":"bold"},ITALIC:{"font-style":"italic"},NOT_BOLD:{"font-weight":"normal"},NOT_ITALIC:{"font-style":"normal"}},defaultStyleFnMapper=((_defaultStyleFnMapper={})[RICOS_TEXT_COLOR_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[RICOS_TEXT_COLOR_TYPE](style,isHexColor);return parsedStyle?{color:parsedStyle}:void 0},_defaultStyleFnMapper[RICOS_TEXT_HIGHLIGHT_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[RICOS_TEXT_HIGHLIGHT_TYPE](style,isHexColor);return parsedStyle?{backgroundColor:parsedStyle}:void 0},_defaultStyleFnMapper[RICOS_FONT_SIZE_TYPE]=function(style){var parsedStyle=dynamicStyleParsers[RICOS_FONT_SIZE_TYPE](style);return parsedStyle?{fontSize:parsedStyle}:void 0},_defaultStyleFnMapper[RICOS_BOLD_TYPE]=function(style){return"NOT_BOLD"===style?{fontWeight:"normal"}:void 0},_defaultStyleFnMapper[RICOS_ITALIC_TYPE]=function(style){return"NOT_ITALIC"===style?{fontStyle:"normal"}:void 0},_defaultStyleFnMapper),defaultStyleSelectionPredicates=((_defaultStyleSelectio={})[RICOS_TEXT_COLOR_TYPE]=isHexColor,_defaultStyleSelectio[RICOS_TEXT_HIGHLIGHT_TYPE]=isHexColor,_defaultStyleSelectio),getDynamicInlineStyleMapper=function(type){return function(config,raw){var settings=config[RICOS_TO_DRAFT_TYPE[type]||""]||{},styleParser=dynamicStyleParsers[type],styleSelectionPredicate=settings.styleSelectionPredicate?function(style){return!!styleParser(style,settings.styleSelectionPredicate)}:function(style){return!!styleParser(style,defaultStyleSelectionPredicates[type])},customStyleFn=settings.customStyleFn?function(style){return settings.customStyleFn(styleParser(style,settings.styleSelectionPredicate))}:defaultStyleFnMapper[type],mapper=getBlocksFromContentState(raw).reduce((function(map,block){return block.inlineStyleRanges&&block.inlineStyleRanges.filter((function(range){return styleSelectionPredicate(range.style)})).forEach((function(range){map[range.style]=function(children,_ref){var key=_ref.key;return React.createElement("span",{key:key,style:customStyleFn(range.style)},children)}})),map}),{});return function(){return mapper}}},uuid=function(){var d=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)}))};export{ADD_PLUGIN_LINK_BI,ANCHOR_CATEGORY,ANCHOR_VIEWER_DATA_HOOK,AccessibilityListener,ButtonType,CUSTOM_LINK,DRAFT_TO_RICOS_DOC_TYPE,DROPDOWN_OPTIONS_TO_DOC_STYLE_TYPE,DecorationMode,DisplayMode,GlobalContext,INLINE_STYLE_TYPES,LINK_VIEWER_DATA_HOOK,LinkData,Link_Rel,ModifierKey,RicosTranslate,ToolbarType,ViewportRenderer,WEB_ADDRESS_CATEGORY,addAnchorTagToUrl,alignmentClassName,anchorScroll,convertRelObjectToString,convertRelStringToObject,convertTargetBooleanToString,convertTargetStringToBoolean,createHocName,createJustificationFixDecorator,defaultStyleFnMapper,depthClassName,draftDecorationsToCss,dynamicStyleParsers,generateKey,getBlocksFromContentState,getContentStateSchema,getDirectionFromAlignmentAndTextDirection,getDisplayName,getDynamicInlineStyleMapper,getLangDir,getLinkRangesInBlock,getRelValue,getTextDirection,hasLinksInBlock,isHexColor,isNewTab,isRtl,isSSR,mergeStyles,parseStyleByType,safeJsonParse,simplePubsub,sizeClassName,textWrapClassName,uuid,validate,withI18n};
//# sourceMappingURL=module.js.map

@@ -1,6 +0,27 @@

export { createVerticalEmbedPlugin } from './createVerticalEmbedPlugin';
export { verticalEmbedProviders } from './constants';
export { VERTICAL_EMBED_TYPE } from './types';
export { Modals, ModalsMap } from './modals';
export { pluginVerticalEmbed } from './editor';
export * from './types';
export { default as AccessibilityListener } from './Components/AccessibilityListener';
export { default as ViewportRenderer } from './Components/ViewportRenderer';
export { default as withI18n, translate, Trans, RicosTranslate } from './Utils/withI18n';
export { default as createHocName } from './Utils/createHocName';
export { sizeClassName, alignmentClassName, textWrapClassName, depthClassName, } from './Utils/classNameStrategies';
export { mergeStyles } from './Utils/mergeStyles';
export { convertRelObjectToString, convertRelStringToObject, convertTargetStringToBoolean, convertTargetBooleanToString, getRelValue, } from './Utils/linkConverters';
export { safeJsonParse } from './Utils/jsonUtils';
export { anchorScroll, addAnchorTagToUrl, isNewTab } from './Utils/anchor';
export * from 'ricos-content';
export { default as getDisplayName } from './Utils/getDisplayName';
export { hasLinksInBlock, getLinkRangesInBlock } from './Utils/draftUtils';
export { validate, getContentStateSchema } from './Utils/data-schema-validator';
export { isSSR } from './Utils/ssrUtils';
export { getTextDirection, getDirectionFromAlignmentAndTextDirection } from './Utils/textDirection';
export { GlobalContext } from './Utils/contexts';
export { isHexColor } from './Utils/colorUtils';
export { isRtl, getLangDir } from './Utils/rtlUtils';
export { simplePubsub, Pubsub, Store } from './Utils/simplePubsub';
export { generateKey } from './Utils/generateKey';
export { getBlocksFromContentState } from './Utils/innerRCEBlocksUtils';
export * from './consts';
export { default as createJustificationFixDecorator } from './draftDecorators/createJustificationFixDecorator';
export { parseStyleByType, CustomInlineStyleType, INLINE_STYLE_TYPES, defaultStyleFnMapper, dynamicStyleParsers, getDynamicInlineStyleMapper, draftDecorationsToCss, } from './Utils/viewerUtils';
export { default as uuid } from './Utils/uuid';
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

{"name":"richlagetest","version":"0.0.0-62f0dcaa5d7b632a563724e31f54c2059aad4fb8"}
{"name":"richlagetest","version":"0.0.0-63f8aca91c5b2536658cdc37bb50277af0e339e3"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc