[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.188.15.159: ~ $
/*! For license information please see premium.js.LICENSE.txt */
(()=>{var __webpack_modules__={643:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{n_:()=>initialize,Hz:()=>storeName});var actions_namespaceObject={};__webpack_require__.r(actions_namespaceObject),__webpack_require__.d(actions_namespaceObject,{addStep:()=>addStep,addStepFilter:()=>addStepFilter,deleteStep:()=>deleteStep,deleteStepFilter:()=>deleteStepFilter,markStepForDeletion:()=>markStepForDeletion,updateFilterGroupOperator:()=>updateFilterGroupOperator,updateStepFilter:()=>updateStepFilter});var selectors_namespaceObject={};__webpack_require__.r(selectors_namespaceObject),__webpack_require__.d(selectors_namespaceObject,{getDeletingStepIds:()=>getDeletingStepIds,getNewStepIds:()=>getNewStepIds,getStepsNumberInAutomation:()=>getStepsNumberInAutomation});var external_MailPoetLib_Automation_=__webpack_require__(296),external_MailPoetLib_WordPressData_=__webpack_require__(54),external_MailPoetLib_Hooks_=__webpack_require__(401),external_MailPoet_=__webpack_require__(632),external_MailPoet_default=__webpack_require__.n(external_MailPoet_);function addStep(stepType){return external_MailPoet_default().trackEvent("Automations > Step added",{type:"triggers"===stepType.group?"trigger":"action","Step key":stepType.key}),{type:"ADD_STEP",stepType}}function markStepForDeletion(stepId){return{type:"MARK_STEP_FOR_DELETION",stepId}}function deleteStep(stepId){const stepType=(0,external_MailPoetLib_WordPressData_.select)(external_MailPoetLib_Automation_.EditorStore.storeName).getStepById(stepId);return external_MailPoet_default().trackEvent("Automations > Step deleted",{type:stepType.type,"Step key":stepType.key}),{type:"DELETE_STEP",stepId}}function updateFilterGroupOperator(stepId,groupId,operator){return{type:"UPDATE_FILTER_GROUP_OPERATOR",stepId,groupId,operator}}function addStepFilter(stepId,filter){return{type:"ADD_STEP_FILTER",stepId,filter}}function updateStepFilter(stepId,filter){return{type:"UPDATE_STEP_FILTER",stepId,filter}}function deleteStepFilter(stepId,filter){return{type:"DELETE_STEP_FILTER",stepId,filter}}const ActionsNotCountingAgainstStepLimit=["core:delay"];function getNewStepIds(state){return state.newStepIds}function getDeletingStepIds(state){return state.deletingStepIds}function getStepsNumberInAutomation(state){return Object.values(state.automationData.steps).filter((step=>"action"===step.type&&!ActionsNotCountingAgainstStepLimit.includes(step.key))).length}const editSteps=(steps,{add=[],update=[],delete:del=[]}={})=>{const updatedSteps={...steps};return add.forEach((step=>{updatedSteps[step.id]=step})),del.forEach((step=>{delete updatedSteps[step.id]})),update.forEach((step=>{updatedSteps[step.id]={...updatedSteps[step.id],...step}})),updatedSteps},getSubtreeSteps=(steps,step)=>[step,...step.next_steps.map((nextStep=>steps[nextStep.id])).filter(Boolean).flatMap((stepData=>getSubtreeSteps(steps,stepData)))],automation_deleteStep=(automation,step)=>{const previousStep=((steps,step)=>Object.values(steps).find((({next_steps})=>next_steps.find((({id})=>id===step.id)))))(automation.steps,step),deleteSteps=[...step.next_steps.slice(0,0),...step.next_steps.slice(1)].map((nextStep=>automation.steps[nextStep.id])).filter(Boolean).flatMap((stepData=>getSubtreeSteps(automation.steps,stepData))),steps=editSteps(automation.steps,{delete:[step,...deleteSteps],update:previousStep?[{id:previousStep.id,next_steps:previousStep.next_steps.map((nextStep=>nextStep.id===step.id?step.next_steps[0]:nextStep)).filter(Boolean)}]:[]});return{...automation,steps}},getStepArgDefaults=(state,key)=>{const step=state.registry.steps[key];return Object.entries(step.args_schema?.properties??{}).reduce(((defaults,[k,v])=>"default"in v?{...defaults,[k]:v.default}:defaults),{})},createReducer=mainReducer=>(state,action)=>{const steps=state.automationData.steps,wrapper=state.inserterPopover?.anchor;switch(action.type){case"ADD_STEP":{const previousStepId=wrapper?.getAttribute("data-previous-step-id"),index=Number(wrapper?.getAttribute("data-index")??0),previousStep=steps[previousStepId];if(!previousStep)return state;const key=action.stepType.key,createCallback=state.stepTypes[key].createStep??(data=>data),nextStep=previousStep.next_steps[index],step=createCallback({id:(0,external_MailPoetLib_Automation_.id)(),key,type:"actions"===action.stepType.group?"action":"trigger",args:getStepArgDefaults(state,key),next_steps:nextStep?[nextStep]:[],filters:null},state),automationData=((automation,step,previousStepId,index)=>{const previousNextSteps=automation.steps[previousStepId].next_steps,steps=editSteps(automation.steps,{add:[step],update:[{id:previousStepId,next_steps:[...previousNextSteps.slice(0,index),{id:step.id},...previousNextSteps.slice(index+1)]}]});return{...automation,steps}})(state.automationData,step,previousStepId,index);return{...state,automationData,selectedStep:step,newStepIds:new Set([...state.newStepIds,step.id]),savedState:"unsaved",errors:0===(state.errors?.steps??[]).length?void 0:state.errors}}case"MARK_STEP_FOR_DELETION":{const stepId=action.stepId;return{...state,newStepIds:new Set([...Array.from(state.newStepIds).filter((id=>id!==stepId))]),deletingStepIds:new Set([...state.deletingStepIds,stepId])}}case"DELETE_STEP":{const step=steps[action.stepId],automationData=automation_deleteStep(state.automationData,step),stepErrors=Object.values(state.errors?.steps??{}).filter((({step_id})=>step_id!==action.stepId));return{...state,automationData,selectedStep:state.selectedStep===step?void 0:state.selectedStep,deletingStepIds:new Set([...Array.from(state.deletingStepIds).filter((id=>id!==step.id))]),savedState:"unsaved",errors:stepErrors.length>0?{...state.errors,steps:Object.fromEntries(stepErrors.map((error=>[error.step_id,error])))}:void 0}}case"UPDATE_FILTER_GROUP_OPERATOR":{const step=steps[action.stepId],filters=step.filters;if(!filters)return state;const data={...step,filters:{...filters,groups:filters.groups.map((group=>group.id===action.groupId?{...group,operator:action.operator}:group))}};return{...state,automationData:{...state.automationData,steps:{...state.automationData.steps,[step.id]:data}},selectedStep:state.selectedStep.id===step.id?data:state.selectedStep,savedState:"unsaved"}}case"ADD_STEP_FILTER":{const step=steps[action.stepId],filters=step.filters??{operator:"and",groups:[{id:(0,external_MailPoetLib_Automation_.id)(),operator:"and",filters:[]}]},group=filters.groups[0],data={...step,filters:{...filters,groups:[{...group,filters:[...group.filters,action.filter]}]}};return{...state,automationData:{...state.automationData,steps:{...state.automationData.steps,[step.id]:data}},selectedStep:state.selectedStep.id===step.id?data:state.selectedStep,savedState:"unsaved"}}case"UPDATE_STEP_FILTER":{const step=steps[action.stepId],group=step.filters?.groups?.[0],filters=group?.filters?.map((filter=>filter.id===action.filter.id?action.filter:filter)),data={...step,filters:{...step.filters,groups:[{...group,filters}]}},stepErrors=state.errors?.steps?.[step.id],errors=!!stepErrors?.filters?.[action.filter.id]?{...state.errors,steps:{...state.errors.steps,[step.id]:{...stepErrors,filters:{...Object.fromEntries(Object.entries(stepErrors.filters).filter((([k])=>k!==action.filter.id)))}}}}:state.errors;return{...state,automationData:{...state.automationData,steps:{...state.automationData.steps,[step.id]:data}},selectedStep:state.selectedStep.id===step.id?data:state.selectedStep,errors,savedState:"unsaved"}}case"DELETE_STEP_FILTER":{const step=state.automationData.steps[action.stepId],group=step.filters?.groups?.[0],filters=group?.filters?.filter((filter=>filter!==action.filter)),data={...step,filters:filters.length>0?{...step.filters,groups:[{...group,filters}]}:null};return{...state,automationData:{...state.automationData,steps:{...state.automationData.steps,[step.id]:data}},selectedStep:state.selectedStep.id===step.id?data:state.selectedStep,savedState:"unsaved"}}default:return mainReducer(state,action)}};var premium=__webpack_require__(188);const{storeName,actions:freePluginActions,selectors:freePluginSelectors}=external_MailPoetLib_Automation_.EditorStore,initialize=()=>{external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.editor.create_store","mailpoet",(config=>(config=>({...config,actions:{...config.actions,...actions_namespaceObject},reducer:createReducer(config.reducer),selectors:{...config.selectors,...selectors_namespaceObject},initialState:{...config.initialState,newStepIds:new Set,deletingStepIds:new Set}}))(config))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.add_step_callback","mailpoet",(originalCallback=>stepType=>{const stepsNumber=(0,external_MailPoetLib_WordPressData_.select)(storeName).getStepsNumberInAutomation();!ActionsNotCountingAgainstStepLimit.includes(stepType.key)&&premium.R.automationSteps.value&&stepsNumber>=premium.R.automationSteps.value?originalCallback():((0,external_MailPoetLib_WordPressData_.dispatch)(storeName).addStep(stepType),(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).setInserterPopover(void 0))}))}},188:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{I:()=>premiumFeaturesEnabled,R:()=>capabilities});var _mailpoet__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(632),_mailpoet__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_mailpoet__WEBPACK_IMPORTED_MODULE_0__),_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(394);const{hasValidPremiumKey,subscribersLimitReached}=_mailpoet__WEBPACK_IMPORTED_MODULE_0___default(),premiumFeaturesEnabled=hasValidPremiumKey&&!subscribersLimitReached,{capabilities}=_mailpoet__WEBPACK_IMPORTED_MODULE_0___default();(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.setLocaleData)(window.wp.i18n.getLocaleData("mailpoet-premium"),"mailpoet-premium")},328:(module,__unused_webpack_exports,__webpack_require__)=>{var _=__webpack_require__(409).runInContext();module.exports=__webpack_require__(192)(_,_)},192:(module,__unused_webpack_exports,__webpack_require__)=>{var mapping=__webpack_require__(426),fallbackHolder=__webpack_require__(906),push=Array.prototype.push;function baseAry(func,n){return 2==n?function(a,b){return func(a,b)}:function(a){return func(a)}}function cloneArray(array){for(var length=array?array.length:0,result=Array(length);length--;)result[length]=array[length];return result}function wrapImmutable(func,cloner){return function(){var length=arguments.length;if(length){for(var args=Array(length);length--;)args[length]=arguments[length];var result=args[0]=cloner.apply(void 0,args);return func.apply(void 0,args),result}}}module.exports=function baseConvert(util,name,func,options){var isLib="function"==typeof name,isObj=name===Object(name);if(isObj&&(options=func,func=name,name=void 0),null==func)throw new TypeError;options||(options={});var config={cap:!("cap"in options)||options.cap,curry:!("curry"in options)||options.curry,fixed:!("fixed"in options)||options.fixed,immutable:!("immutable"in options)||options.immutable,rearg:!("rearg"in options)||options.rearg},defaultHolder=isLib?func:fallbackHolder,forceCurry="curry"in options&&options.curry,forceFixed="fixed"in options&&options.fixed,forceRearg="rearg"in options&&options.rearg,pristine=isLib?func.runInContext():void 0,helpers=isLib?func:{ary:util.ary,assign:util.assign,clone:util.clone,curry:util.curry,forEach:util.forEach,isArray:util.isArray,isError:util.isError,isFunction:util.isFunction,isWeakMap:util.isWeakMap,iteratee:util.iteratee,keys:util.keys,rearg:util.rearg,toInteger:util.toInteger,toPath:util.toPath},ary=helpers.ary,assign=helpers.assign,clone=helpers.clone,curry=helpers.curry,each=helpers.forEach,isArray=helpers.isArray,isError=helpers.isError,isFunction=helpers.isFunction,isWeakMap=helpers.isWeakMap,keys=helpers.keys,rearg=helpers.rearg,toInteger=helpers.toInteger,toPath=helpers.toPath,aryMethodKeys=keys(mapping.aryMethod),wrappers={castArray:function(castArray){return function(){var value=arguments[0];return isArray(value)?castArray(cloneArray(value)):castArray.apply(void 0,arguments)}},iteratee:function(iteratee){return function(){var arity=arguments[1],result=iteratee(arguments[0],arity),length=result.length;return config.cap&&"number"==typeof arity?(arity=arity>2?arity-2:1,length&&length<=arity?result:baseAry(result,arity)):result}},mixin:function(mixin){return function(source){var func=this;if(!isFunction(func))return mixin(func,Object(source));var pairs=[];return each(keys(source),(function(key){isFunction(source[key])&&pairs.push([key,func.prototype[key]])})),mixin(func,Object(source)),each(pairs,(function(pair){var value=pair[1];isFunction(value)?func.prototype[pair[0]]=value:delete func.prototype[pair[0]]})),func}},nthArg:function(nthArg){return function(n){var arity=n<0?1:toInteger(n)+1;return curry(nthArg(n),arity)}},rearg:function(rearg){return function(func,indexes){var arity=indexes?indexes.length:0;return curry(rearg(func,indexes),arity)}},runInContext:function(runInContext){return function(context){return baseConvert(util,runInContext(context),options)}}};function castCap(name,func){if(config.cap){var indexes=mapping.iterateeRearg[name];if(indexes)return function(func,indexes){return overArg(func,(function(func){var n=indexes.length;return function(func,n){return 2==n?function(a,b){return func.apply(void 0,arguments)}:function(a){return func.apply(void 0,arguments)}}(rearg(baseAry(func,n),indexes),n)}))}(func,indexes);var n=!isLib&&mapping.iterateeAry[name];if(n)return function(func,n){return overArg(func,(function(func){return"function"==typeof func?baseAry(func,n):func}))}(func,n)}return func}function castFixed(name,func,n){if(config.fixed&&(forceFixed||!mapping.skipFixed[name])){var data=mapping.methodSpread[name],start=data&&data.start;return void 0===start?ary(func,n):function(func,start){return function(){for(var length=arguments.length,lastIndex=length-1,args=Array(length);length--;)args[length]=arguments[length];var array=args[start],otherArgs=args.slice(0,start);return array&&push.apply(otherArgs,array),start!=lastIndex&&push.apply(otherArgs,args.slice(start+1)),func.apply(this,otherArgs)}}(func,start)}return func}function castRearg(name,func,n){return config.rearg&&n>1&&(forceRearg||!mapping.skipRearg[name])?rearg(func,mapping.methodRearg[name]||mapping.aryRearg[n]):func}function cloneByPath(object,path){for(var index=-1,length=(path=toPath(path)).length,lastIndex=length-1,result=clone(Object(object)),nested=result;null!=nested&&++index<length;){var key=path[index],value=nested[key];null==value||isFunction(value)||isError(value)||isWeakMap(value)||(nested[key]=clone(index==lastIndex?value:Object(value))),nested=nested[key]}return result}function createConverter(name,func){var realName=mapping.aliasToReal[name]||name,methodName=mapping.remap[realName]||realName,oldOptions=options;return function(options){var newUtil=isLib?pristine:helpers,newFunc=isLib?pristine[methodName]:func,newOptions=assign(assign({},oldOptions),options);return baseConvert(newUtil,realName,newFunc,newOptions)}}function overArg(func,transform){return function(){var length=arguments.length;if(!length)return func();for(var args=Array(length);length--;)args[length]=arguments[length];var index=config.rearg?0:length-1;return args[index]=transform(args[index]),func.apply(void 0,args)}}function wrap(name,func,placeholder){var result,realName=mapping.aliasToReal[name]||name,wrapped=func,wrapper=wrappers[realName];return wrapper?wrapped=wrapper(func):config.immutable&&(mapping.mutate.array[realName]?wrapped=wrapImmutable(func,cloneArray):mapping.mutate.object[realName]?wrapped=wrapImmutable(func,function(func){return function(object){return func({},object)}}(func)):mapping.mutate.set[realName]&&(wrapped=wrapImmutable(func,cloneByPath))),each(aryMethodKeys,(function(aryKey){return each(mapping.aryMethod[aryKey],(function(otherName){if(realName==otherName){var data=mapping.methodSpread[realName],afterRearg=data&&data.afterRearg;return result=afterRearg?castFixed(realName,castRearg(realName,wrapped,aryKey),aryKey):castRearg(realName,castFixed(realName,wrapped,aryKey),aryKey),result=function(name,func,n){return forceCurry||config.curry&&n>1?curry(func,n):func}(0,result=castCap(realName,result),aryKey),!1}})),!result})),result||(result=wrapped),result==func&&(result=forceCurry?curry(result,1):function(){return func.apply(this,arguments)}),result.convert=createConverter(realName,func),result.placeholder=func.placeholder=placeholder,result}if(!isObj)return wrap(name,func,defaultHolder);var _=func,pairs=[];return each(aryMethodKeys,(function(aryKey){each(mapping.aryMethod[aryKey],(function(key){var func=_[mapping.remap[key]||key];func&&pairs.push([key,wrap(key,func,_)])}))})),each(keys(_),(function(key){var func=_[key];if("function"==typeof func){for(var length=pairs.length;length--;)if(pairs[length][0]==key)return;func.convert=createConverter(key,func),pairs.push([key,func])}})),each(pairs,(function(pair){_[pair[0]]=pair[1]})),_.convert=function(options){return _.runInContext.convert(options)(void 0)},_.placeholder=_,each(keys(_),(function(key){each(mapping.realToAlias[key]||[],(function(alias){_[alias]=_[key]}))})),_}},426:(__unused_webpack_module,exports)=>{exports.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},exports.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},exports.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},exports.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},exports.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},exports.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},exports.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},exports.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},exports.realToAlias=function(){var hasOwnProperty=Object.prototype.hasOwnProperty,object=exports.aliasToReal,result={};for(var key in object){var value=object[key];hasOwnProperty.call(result,value)?result[value].push(key):result[value]=[key]}return result}(),exports.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},exports.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},exports.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},906:module=>{module.exports={}},409:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;module=__webpack_require__.nmd(module),function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function r(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function e(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function o(n,t){return!(null==n||!n.length)&&y(n,t,0)>-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function c(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function a(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function l(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function s(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function h(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}function _(n){return n.match($t)||[]}function v(n,t,r){var e;return r(n,(function(n,r,u){if(t(n,r,u))return e=r,!1})),e}function g(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function y(n,t,r){return t==t?function(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):g(n,b,r)}function d(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function b(n){return n!=n}function w(n,t){var r=null==n?0:n.length;return r?k(n,t)/r:Cn}function m(n){return function(t){return null==t?X:t[n]}}function x(n){return function(t){return null==n?X:n[t]}}function j(n,t,r,e,u){return u(n,(function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)})),r}function k(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==X&&(r=r===X?i:r+i)}return r}function O(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function R(n){return n?n.slice(0,H(n)+1).replace(Lt,""):n}function z(n){return function(t){return n(t)}}function E(n,t){return c(t,(function(t){return n[t]}))}function S(n,t){return n.has(t)}function W(n,t){for(var r=-1,e=n.length;++r<e&&y(t,n[r],0)>-1;);return r}function L(n,t){for(var r=n.length;r--&&y(t,n[r],0)>-1;);return r}function U(n){return"\\"+Yr[n]}function T(n){return Nr.test(n)}function $(n){return Pr.test(n)}function M(n){var t=-1,r=Array(n.size);return n.forEach((function(n,e){r[++t]=[e,n]})),r}function F(n,t){return function(r){return n(t(r))}}function N(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==cn||(n[r]=cn,i[u++]=r)}return i}function P(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=n})),r}function V(n){return T(n)?function(n){for(var t=Mr.lastIndex=0;Mr.test(n);)++t;return t}(n):_e(n)}function G(n){return T(n)?function(n){return n.match(Mr)||[]}(n):function(n){return n.split("")}(n)}function H(n){for(var t=n.length;t--&&Ct.test(n.charAt(t)););return t}function Q(n){return n.match(Fr)||[]}var X,en="Expected a function",on="__lodash_hash_undefined__",cn="__lodash_placeholder__",mn=128,Sn=1/0,Wn=9007199254740991,Cn=NaN,Un=4294967295,$n=[["ary",mn],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],Dn="[object Arguments]",Mn="[object Array]",Nn="[object Boolean]",Pn="[object Date]",Zn="[object Error]",Kn="[object Function]",Vn="[object GeneratorFunction]",Gn="[object Map]",Hn="[object Number]",Yn="[object Object]",Qn="[object Promise]",nt="[object RegExp]",tt="[object Set]",rt="[object String]",et="[object Symbol]",it="[object WeakMap]",ft="[object ArrayBuffer]",ct="[object DataView]",at="[object Float32Array]",lt="[object Float64Array]",st="[object Int8Array]",ht="[object Int16Array]",pt="[object Int32Array]",_t="[object Uint8Array]",vt="[object Uint8ClampedArray]",gt="[object Uint16Array]",yt="[object Uint32Array]",dt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,wt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,jt=RegExp(mt.source),At=RegExp(xt.source),kt=/<%-([\s\S]+?)%>/g,Ot=/<%([\s\S]+?)%>/g,It=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zt=/^\w*$/,Et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,St=/[\\^$.*+?()[\]{}|]/g,Wt=RegExp(St.source),Lt=/^\s+/,Ct=/\s/,Ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Tt=/,? & /,$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dt=/[()=,{}\[\]\/\s]/,Mt=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Pt=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,Zt=/^\[object .+?Constructor\]$/,Kt=/^0o[0-7]+$/i,Vt=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ht=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,Yt="\\ud800-\\udfff",tr="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",rr="\\u2700-\\u27bf",er="a-z\\xdf-\\xf6\\xf8-\\xff",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",ar="\\ufe0e\\ufe0f",lr="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sr="['’]",hr="["+Yt+"]",pr="["+lr+"]",_r="["+tr+"]",vr="\\d+",gr="["+rr+"]",yr="["+er+"]",dr="[^"+Yt+lr+vr+rr+er+cr+"]",br="\\ud83c[\\udffb-\\udfff]",mr="[^"+Yt+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",jr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ar="["+cr+"]",Or="(?:"+yr+"|"+dr+")",Ir="(?:"+Ar+"|"+dr+")",Rr="(?:['’](?:d|ll|m|re|s|t|ve))?",zr="(?:['’](?:D|LL|M|RE|S|T|VE))?",Er="(?:"+_r+"|"+br+")"+"?",Sr="["+ar+"]?",Ur=Sr+Er+("(?:\\u200d(?:"+[mr,xr,jr].join("|")+")"+Sr+Er+")*"),Br="(?:"+[gr,xr,jr].join("|")+")"+Ur,Tr="(?:"+[mr+_r+"?",_r,xr,jr,hr].join("|")+")",$r=RegExp(sr,"g"),Dr=RegExp(_r,"g"),Mr=RegExp(br+"(?="+br+")|"+Tr+Ur,"g"),Fr=RegExp([Ar+"?"+yr+"+"+Rr+"(?="+[pr,Ar,"$"].join("|")+")",Ir+"+"+zr+"(?="+[pr,Ar+Or,"$"].join("|")+")",Ar+"?"+Or+"+"+Rr,Ar+"+"+zr,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vr,Br].join("|"),"g"),Nr=RegExp("[\\u200d"+Yt+tr+ar+"]"),Pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zr=-1,Kr={};Kr[at]=Kr[lt]=Kr[st]=Kr[ht]=Kr[pt]=Kr[_t]=Kr[vt]=Kr[gt]=Kr[yt]=!0,Kr[Dn]=Kr[Mn]=Kr[ft]=Kr[Nn]=Kr[ct]=Kr[Pn]=Kr[Zn]=Kr[Kn]=Kr[Gn]=Kr[Hn]=Kr[Yn]=Kr[nt]=Kr[tt]=Kr[rt]=Kr[it]=!1;var Vr={};Vr[Dn]=Vr[Mn]=Vr[ft]=Vr[ct]=Vr[Nn]=Vr[Pn]=Vr[at]=Vr[lt]=Vr[st]=Vr[ht]=Vr[pt]=Vr[Gn]=Vr[Hn]=Vr[Yn]=Vr[nt]=Vr[tt]=Vr[rt]=Vr[et]=Vr[_t]=Vr[vt]=Vr[gt]=Vr[yt]=!0,Vr[Zn]=Vr[Kn]=Vr[it]=!1;var Yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qr=parseFloat,Xr=parseInt,ne="object"==typeof __webpack_require__.g&&__webpack_require__.g&&__webpack_require__.g.Object===Object&&__webpack_require__.g,te="object"==typeof self&&self&&self.Object===Object&&self,re=ne||te||Function("return this")(),ee=exports&&!exports.nodeType&&exports,ue=ee&&module&&!module.nodeType&&module,ie=ue&&ue.exports===ee,oe=ie&&ne.process,fe=function(){try{var n=ue&&ue.require&&ue.require("util").types;return n||oe&&oe.binding&&oe.binding("util")}catch(n){}}(),ce=fe&&fe.isArrayBuffer,ae=fe&&fe.isDate,le=fe&&fe.isMap,se=fe&&fe.isRegExp,he=fe&&fe.isSet,pe=fe&&fe.isTypedArray,_e=m("length"),ve=x({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),ge=x({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),ye=x({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),be=function p(x){function Z(n){if(cc(n)&&!bh(n)&&!(n instanceof Ct)){if(n instanceof Y)return n;if(bl.call(n,"__wrapped__"))return eo(n)}return new Y(n)}function J(){}function Y(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=X}function Ct(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Un,this.__views__=[]}function Xt(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function ir(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function sr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function yr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new sr;++t<r;)this.add(n[t])}function wr(n){this.size=(this.__data__=new ir(n)).size}function Or(n,t){var r=bh(n),e=!r&&dh(n),u=!r&&!e&&mh(n),i=!r&&!e&&!u&&Oh(n),o=r||e||u||i,f=o?O(n.length,hl):[],c=f.length;for(var a in n)!t&&!bl.call(n,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ci(a,c))||f.push(a);return f}function Ir(n){var t=n.length;return t?n[tu(0,t-1)]:X}function Rr(n,t){return Xi(Tu(n),Mr(t,0,n.length))}function zr(n){return Xi(Tu(n))}function Er(n,t,r){(r===X||Gf(n[t],r))&&(r!==X||t in n)||Br(n,t,r)}function Sr(n,t,r){var e=n[t];bl.call(n,t)&&Gf(e,r)&&(r!==X||t in n)||Br(n,t,r)}function Wr(n,t){for(var r=n.length;r--;)if(Gf(n[r][0],t))return r;return-1}function Lr(n,t,r,e){return ys(n,(function(n,u,i){t(e,n,r(n),i)})),e}function Cr(n,t){return n&&$u(t,Pc(t),n)}function Br(n,t,r){"__proto__"==t&&Tl?Tl(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function Tr(n,t){for(var r=-1,e=t.length,u=il(e),i=null==n;++r<e;)u[r]=i?X:Mc(n,t[r]);return u}function Mr(n,t,r){return n==n&&(r!==X&&(n=n<=r?n:r),t!==X&&(n=n>=t?n:t)),n}function Fr(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==X)return f;if(!fc(n))return n;var s=bh(n);if(s){if(f=function(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&bl.call(n,"index")&&(r.index=n.index,r.input=n.input),r}(n),!c)return Tu(n,f)}else{var h=zs(n),p=h==Kn||h==Vn;if(mh(n))return Iu(n,c);if(h==Yn||h==Dn||p&&!i){if(f=a||p?{}:Ei(n),!c)return a?function(n,t){return $u(n,Rs(n),t)}(n,function(n,t){return n&&$u(t,qc(t),n)}(f,n)):function(n,t){return $u(n,Is(n),t)}(n,Cr(f,n))}else{if(!Vr[h])return i?n:{};f=function(n,t,r){var e=n.constructor;switch(t){case ft:return Ru(n);case Nn:case Pn:return new e(+n);case ct:return function(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.byteLength)}(n,r);case at:case lt:case st:case ht:case pt:case _t:case vt:case gt:case yt:return Wu(n,r);case Gn:return new e;case Hn:case rt:return new e(n);case nt:return function(n){var t=new n.constructor(n.source,Nt.exec(n));return t.lastIndex=n.lastIndex,t}(n);case tt:return new e;case et:return function(n){return _s?ll(_s.call(n)):{}}(n)}}(n,h,c)}}o||(o=new wr);var _=o.get(n);if(_)return _;o.set(n,f),kh(n)?n.forEach((function(r){f.add(Fr(r,t,e,r,n,o))})):jh(n)&&n.forEach((function(r,u){f.set(u,Fr(r,t,e,u,n,o))}));var g=s?X:(l?a?di:yi:a?qc:Pc)(n);return r(g||n,(function(r,u){g&&(r=n[u=r]),Sr(f,u,Fr(r,t,e,u,n,o))})),f}function Pr(n,t,r){var e=r.length;if(null==n)return!e;for(n=ll(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===X&&!(u in n)||!i(o))return!1}return!0}function Gr(n,t,r){if("function"!=typeof n)throw new pl(en);return Ws((function(){n.apply(X,r)}),t)}function Hr(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,z(r))),e?(i=f,a=!1):t.length>=200&&(i=S,a=!1,t=new yr(t));n:for(;++u<l;){var p=n[u],_=null==r?p:r(p);if(p=e||0!==p?p:0,a&&_==_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function Jr(n,t){var r=!0;return ys(n,(function(n,e,u){return r=!!t(n,e,u)})),r}function Yr(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===X?o==o&&!bc(o):r(o,f)))var f=o,c=i}return c}function te(n,t){var r=[];return ys(n,(function(n,e,u){t(n,e,u)&&r.push(n)})),r}function ee(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Li),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?ee(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ue(n,t){return n&&bs(n,t,Pc)}function oe(n,t){return n&&ws(n,t,Pc)}function fe(n,t){return i(t,(function(t){return uc(n[t])}))}function _e(n,t){for(var r=0,e=(t=ku(t,n)).length;null!=n&&r<e;)n=n[no(t[r++])];return r&&r==e?n:X}function de(n,t,r){var e=t(n);return bh(n)?e:a(e,r(n))}function we(n){return null==n?n===X?"[object Undefined]":"[object Null]":Bl&&Bl in ll(n)?function(n){var t=bl.call(n,Bl),r=n[Bl];try{n[Bl]=X;var e=!0}catch(n){}var u=xl.call(n);return e&&(t?n[Bl]=r:delete n[Bl]),u}(n):function(n){return xl.call(n)}(n)}function me(n,t){return n>t}function xe(n,t){return null!=n&&bl.call(n,t)}function je(n,t){return null!=n&&t in ll(n)}function ke(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=il(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,z(t))),s=Hl(p.length,s),l[a]=!r&&(t||u>=120&&p.length>=120)?new yr(a&&p):X}p=n[0];var _=-1,v=l[0];n:for(;++_<u&&h.length<s;){var g=p[_],y=t?t(g):g;if(g=r||0!==g?g:0,!(v?S(v,y):e(h,y,r))){for(a=i;--a;){var d=l[a];if(!(d?S(d,y):e(n[a],y,r)))continue n}v&&v.push(y),h.push(g)}}return h}function Ie(t,r,e){var u=null==(t=Gi(t,r=ku(r,t)))?t:t[no(jo(r))];return null==u?X:n(u,t,e)}function Re(n){return cc(n)&&we(n)==Dn}function Se(n,t,r,e,u){return n===t||(null==n||null==t||!cc(n)&&!cc(t)?n!=n&&t!=t:function(n,t,r,e,u,i){var o=bh(n),f=bh(t),c=o?Mn:zs(n),a=f?Mn:zs(t);c=c==Dn?Yn:c,a=a==Dn?Yn:a;var l=c==Yn,s=a==Yn,h=c==a;if(h&&mh(n)){if(!mh(t))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new wr),o||Oh(n)?pi(n,t,r,e,u,i):function(n,t,r,e,u,i,o){switch(r){case ct:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case ft:return!(n.byteLength!=t.byteLength||!i(new Rl(n),new Rl(t)));case Nn:case Pn:case Hn:return Gf(+n,+t);case Zn:return n.name==t.name&&n.message==t.message;case nt:case rt:return n==t+"";case Gn:var f=M;case tt:var c=1&e;if(f||(f=P),n.size!=t.size&&!c)return!1;var a=o.get(n);if(a)return a==t;e|=2,o.set(n,t);var l=pi(f(n),f(t),e,u,i,o);return o.delete(n),l;case et:if(_s)return _s.call(n)==_s.call(t)}return!1}(n,t,c,r,e,u,i);if(!(1&r)){var p=l&&bl.call(n,"__wrapped__"),_=s&&bl.call(t,"__wrapped__");if(p||_){var v=p?n.value():n,g=_?t.value():t;return i||(i=new wr),u(v,g,r,e,i)}}return!!h&&(i||(i=new wr),function(n,t,r,e,u,i){var o=1&r,f=yi(n),c=f.length;if(c!=yi(t).length&&!o)return!1;for(var a=c;a--;){var l=f[a];if(!(o?l in t:bl.call(t,l)))return!1}var s=i.get(n),h=i.get(t);if(s&&h)return s==t&&h==n;var p=!0;i.set(n,t),i.set(t,n);for(var _=o;++a<c;){var v=n[l=f[a]],g=t[l];if(e)var y=o?e(g,v,l,t,n,i):e(v,g,l,n,t,i);if(!(y===X?v===g||u(v,g,r,e,i):y)){p=!1;break}_||(_="constructor"==l)}if(p&&!_){var d=n.constructor,b=t.constructor;d!=b&&"constructor"in n&&"constructor"in t&&!("function"==typeof d&&d instanceof d&&"function"==typeof b&&b instanceof b)&&(p=!1)}return i.delete(n),i.delete(t),p}(n,t,r,e,u,i))}(n,t,r,e,Se,u))}function Ce(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=ll(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++u<i;){var c=(f=r[u])[0],a=n[c],l=f[1];if(o&&f[2]){if(a===X&&!(c in n))return!1}else{var s=new wr;if(e)var h=e(a,l,c,n,t,s);if(!(h===X?Se(l,a,3,e,s):h))return!1}}return!0}function Ue(n){return!(!fc(n)||function(n){return!!ml&&ml in n}(n))&&(uc(n)?kl:Zt).test(to(n))}function De(n){return"function"==typeof n?n:null==n?La:"object"==typeof n?bh(n)?Ze(n[0],n[1]):qe(n):Fa(n)}function Me(n){if(!Mi(n))return Vl(n);var t=[];for(var r in ll(n))bl.call(n,r)&&"constructor"!=r&&t.push(r);return t}function Fe(n){if(!fc(n))return function(n){var t=[];if(null!=n)for(var r in ll(n))t.push(r);return t}(n);var t=Mi(n),r=[];for(var e in n)("constructor"!=e||!t&&bl.call(n,e))&&r.push(e);return r}function Ne(n,t){return n<t}function Pe(n,t){var r=-1,e=Hf(n)?il(n.length):[];return ys(n,(function(n,u,i){e[++r]=t(n,u,i)})),e}function qe(n){var t=ji(n);return 1==t.length&&t[0][2]?Ni(t[0][0],t[0][1]):function(r){return r===n||Ce(r,n,t)}}function Ze(n,t){return Bi(n)&&Fi(t)?Ni(no(n),t):function(r){var e=Mc(r,n);return e===X&&e===t?Nc(r,n):Se(t,e,3)}}function Ke(n,t,r,e,u){n!==t&&bs(t,(function(i,o){if(u||(u=new wr),fc(i))!function(n,t,r,e,u,i,o){var f=Ji(n,r),c=Ji(t,r),a=o.get(c);if(a)return Er(n,r,a),X;var l=i?i(f,c,r+"",n,t,o):X,s=l===X;if(s){var h=bh(c),p=!h&&mh(c),_=!h&&!p&&Oh(c);l=c,h||p||_?bh(f)?l=f:Jf(f)?l=Tu(f):p?(s=!1,l=Iu(c,!0)):_?(s=!1,l=Wu(c,!0)):l=[]:gc(c)||dh(c)?(l=f,dh(f)?l=Rc(f):fc(f)&&!uc(f)||(l=Ei(c))):s=!1}s&&(o.set(c,l),u(l,c,e,i,o),o.delete(c)),Er(n,r,l)}(n,t,o,r,Ke,e,u);else{var f=e?e(Ji(n,o),i,o+"",n,t,u):X;f===X&&(f=i),Er(n,o,f)}}),qc)}function Ge(n,t){var r=n.length;if(r)return Ci(t+=t<0?r:0,r)?n[t]:X}function He(n,t,r){t=t.length?c(t,(function(n){return bh(n)?function(t){return _e(t,1===n.length?n[0]:n)}:n})):[La];var e=-1;return t=c(t,z(mi())),function(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}(Pe(n,(function(n,r,u){return{criteria:c(t,(function(t){return t(n)})),index:++e,value:n}})),(function(n,t){return function(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;++e<o;){var c=Lu(u[e],i[e]);if(c)return e>=f?c:c*("desc"==r[e]?-1:1)}return n.index-t.index}(n,t,r)}))}function Ye(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=_e(n,o);r(f,o)&&fu(i,ku(o,n),f)}return i}function Xe(n,t,r,e){var u=e?d:y,i=-1,o=t.length,f=n;for(n===t&&(t=Tu(t)),r&&(f=c(n,z(r)));++i<o;)for(var a=0,l=t[i],s=r?r(l):l;(a=u(f,s,a,e))>-1;)f!==n&&Ll.call(f,a,1),Ll.call(n,a,1);return n}function nu(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Ci(u)?Ll.call(n,u,1):yu(n,u)}}return n}function tu(n,t){return n+Nl(Ql()*(t-n+1))}function eu(n,t){var r="";if(!n||t<1||t>Wn)return r;do{t%2&&(r+=n),(t=Nl(t/2))&&(n+=n)}while(t);return r}function uu(n,t){return Ls(Vi(n,t,La),n+"")}function iu(n){return Ir(ra(n))}function ou(n,t){var r=ra(n);return Xi(r,Mr(t,0,r.length))}function fu(n,t,r,e){if(!fc(n))return n;for(var u=-1,i=(t=ku(t,n)).length,o=i-1,f=n;null!=f&&++u<i;){var c=no(t[u]),a=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(u!=o){var l=f[c];(a=e?e(l,c,f):X)===X&&(a=fc(l)?l:Ci(t[u+1])?[]:{})}Sr(f,c,a),f=f[c]}return n}function cu(n){return Xi(ra(n))}function au(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=il(u);++e<u;)i[e]=n[e+t];return i}function lu(n,t){var r;return ys(n,(function(n,e,u){return!(r=t(n,e,u))})),!!r}function su(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t==t&&u<=2147483647){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!bc(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return hu(n,t,La,r)}function hu(n,t,r,e){var u=0,i=null==n?0:n.length;if(0===i)return 0;for(var o=(t=r(t))!=t,f=null===t,c=bc(t),a=t===X;u<i;){var l=Nl((u+i)/2),s=r(n[l]),h=s!==X,p=null===s,_=s==s,v=bc(s);if(o)var g=e||_;else g=a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):!p&&!v&&(e?s<=t:s<t);g?u=l+1:i=l}return Hl(i,4294967294)}function pu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!Gf(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function _u(n){return"number"==typeof n?n:bc(n)?Cn:+n}function vu(n){if("string"==typeof n)return n;if(bh(n))return c(n,vu)+"";if(bc(n))return vs?vs.call(n):"";var t=n+"";return"0"==t&&1/n==-Sn?"-0":t}function gu(n,t,r){var e=-1,u=o,i=n.length,c=!0,a=[],l=a;if(r)c=!1,u=f;else if(i>=200){var s=t?null:ks(n);if(s)return P(s);c=!1,u=S,l=new yr}else l=t?[]:a;n:for(;++e<i;){var h=n[e],p=t?t(h):h;if(h=r||0!==h?h:0,c&&p==p){for(var _=l.length;_--;)if(l[_]===p)continue n;t&&l.push(p),a.push(h)}else u(l,p,r)||(l!==a&&l.push(p),a.push(h))}return a}function yu(n,t){return null==(n=Gi(n,t=ku(t,n)))||delete n[no(jo(t))]}function du(n,t,r,e){return fu(n,t,r(_e(n,t)),e)}function bu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?au(n,e?0:i,e?i+1:u):au(n,e?i+1:0,e?u:i)}function wu(n,t){var r=n;return r instanceof Ct&&(r=r.value()),l(t,(function(n,t){return t.func.apply(t.thisArg,a([n],t.args))}),r)}function mu(n,t,r){var e=n.length;if(e<2)return e?gu(n[0]):[];for(var u=-1,i=il(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=Hr(i[u]||o,n[f],t,r));return gu(ee(i,1),t,r)}function xu(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;)r(o,n[e],e<i?t[e]:X);return o}function ju(n){return Jf(n)?n:[]}function Au(n){return"function"==typeof n?n:La}function ku(n,t){return bh(n)?n:Bi(n,t)?[n]:Cs(Ec(n))}function Ou(n,t,r){var e=n.length;return r=r===X?e:r,!t&&r>=e?n:au(n,t,r)}function Iu(n,t){if(t)return n.slice();var r=n.length,e=zl?zl(r):new n.constructor(r);return n.copy(e),e}function Ru(n){var t=new n.constructor(n.byteLength);return new Rl(t).set(new Rl(n)),t}function Wu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.length)}function Lu(n,t){if(n!==t){var r=n!==X,e=null===n,u=n==n,i=bc(n),o=t!==X,f=null===t,c=t==t,a=bc(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function Uu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Gl(i-o,0),l=il(c+a),s=!e;++f<c;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];return l}function Bu(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=Gl(i-f,0),s=il(l+a),h=!e;++u<l;)s[u]=n[u];for(var p=u;++c<a;)s[p+c]=t[c];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Tu(n,t){var r=-1,e=n.length;for(t||(t=il(e));++r<e;)t[r]=n[r];return t}function $u(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):X;c===X&&(c=n[f]),u?Br(r,f,c):Sr(r,f,c)}return r}function Fu(n,r){return function(e,u){var i=bh(e)?t:Lr,o=r?r():{};return i(e,n,mi(u,2),o)}}function Nu(n){return uu((function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:X,o=u>2?r[2]:X;for(i=n.length>3&&"function"==typeof i?(u--,i):X,o&&Ui(r[0],r[1],o)&&(i=u<3?X:i,u=1),t=ll(t);++e<u;){var f=r[e];f&&n(t,f,e,i)}return t}))}function Pu(n,t){return function(r,e){if(null==r)return r;if(!Hf(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=ll(r);(t?i--:++i<u)&&!1!==e(o[i],i,o););return r}}function qu(n){return function(t,r,e){for(var u=-1,i=ll(t),o=e(t),f=o.length;f--;){var c=o[n?f:++u];if(!1===r(i[c],c,i))break}return t}}function Ku(n){return function(t){var r=T(t=Ec(t))?G(t):X,e=r?r[0]:t.charAt(0),u=r?Ou(r,1).join(""):t.slice(1);return e[n]()+u}}function Vu(n){return function(t){return l(Ra(ca(t).replace($r,"")),n,"")}}function Gu(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=gs(n.prototype),e=n.apply(r,t);return fc(e)?e:r}}function Hu(t,r,e){var i=Gu(t);return function u(){for(var o=arguments.length,f=il(o),c=o,a=wi(u);c--;)f[c]=arguments[c];var l=o<3&&f[0]!==a&&f[o-1]!==a?[]:N(f,a);return(o-=l.length)<e?oi(t,r,Qu,u.placeholder,X,f,l,X,X,e-o):n(this&&this!==re&&this instanceof u?i:t,this,f)}}function Ju(n){return function(t,r,e){var u=ll(t);if(!Hf(t)){var i=mi(r,3);t=Pc(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:X}}function Yu(n){return gi((function(t){var r=t.length,e=r,u=Y.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new pl(en);if(u&&!o&&"wrapper"==bi(i))var o=new Y([],!0)}for(e=o?e:r;++e<r;){var f=bi(i=t[e]),c="wrapper"==f?Os(i):X;o=c&&$i(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?o[bi(c[0])].apply(o,c[3]):1==i.length&&$i(i)?o[f]():o.thru(i)}return function(){var n=arguments,e=n[0];if(o&&1==n.length&&bh(e))return o.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}}))}function Qu(n,t,r,e,u,i,o,f,c,a){var s=t&mn,h=1&t,p=2&t,_=24&t,v=512&t,g=p?X:Gu(n);return function l(){for(var y=arguments.length,d=il(y),b=y;b--;)d[b]=arguments[b];if(_)var w=wi(l),m=function(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}(d,w);if(e&&(d=Uu(d,e,u,_)),i&&(d=Bu(d,i,o,_)),y-=m,_&&y<a)return oi(n,t,Qu,l.placeholder,r,d,N(d,w),f,c,a-y);var x=h?r:this,j=p?x[n]:n;return y=d.length,f?d=function(n,t){for(var r=n.length,e=Hl(t.length,r),u=Tu(n);e--;){var i=t[e];n[e]=Ci(i,r)?u[i]:X}return n}(d,f):v&&y>1&&d.reverse(),s&&c<y&&(d.length=c),this&&this!==re&&this instanceof l&&(j=g||Gu(j)),j.apply(x,d)}}function Xu(n,t){return function(r,e){return function(n,t,r,e){return ue(n,(function(n,u,i){t(e,r(n),u,i)})),e}(r,n,t(e),{})}}function ni(n,t){return function(r,e){var u;if(r===X&&e===X)return t;if(r!==X&&(u=r),e!==X){if(u===X)return e;"string"==typeof r||"string"==typeof e?(r=vu(r),e=vu(e)):(r=_u(r),e=_u(e)),u=n(r,e)}return u}}function ti(t){return gi((function(r){return r=c(r,z(mi())),uu((function(e){var u=this;return t(r,(function(t){return n(t,u,e)}))}))}))}function ri(n,t){var r=(t=t===X?" ":vu(t)).length;if(r<2)return r?eu(t,n):t;var e=eu(t,Fl(n/V(t)));return T(t)?Ou(G(e),0,n).join(""):e.slice(0,n)}function ei(t,r,e,u){var o=1&r,f=Gu(t);return function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=il(l+c),h=this&&this!==re&&this instanceof i?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++r];return n(h,o?e:this,s)}}function ui(n){return function(t,r,e){return e&&"number"!=typeof e&&Ui(t,r,e)&&(r=e=X),t=Ac(t),r===X?(r=t,t=0):r=Ac(r),function(n,t,r,e){for(var u=-1,i=Gl(Fl((t-n)/(r||1)),0),o=il(i);i--;)o[e?i:++u]=n,n+=r;return o}(t,r,e=e===X?t<r?1:-1:Ac(e),n)}}function ii(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Ic(t),r=Ic(r)),n(t,r)}}function oi(n,t,r,e,u,i,o,f,c,a){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var v=[n,t,u,l?i:X,l?o:X,l?X:i,l?X:o,f,c,a],g=r.apply(X,v);return $i(n)&&Ss(g,v),g.placeholder=e,Yi(g,n,t)}function fi(n){var t=al[n];return function(n,r){if(n=Ic(n),(r=null==r?0:Hl(kc(r),292))&&Zl(n)){var e=(Ec(n)+"e").split("e");return+((e=(Ec(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return t(n)}}function ci(n){return function(t){var r=zs(t);return r==Gn?M(t):r==tt?function(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=[n,n]})),r}(t):function(n,t){return c(t,(function(t){return[t,n[t]]}))}(t,n(t))}}function ai(n,t,r,e,u,i,o,f){var c=2&t;if(!c&&"function"!=typeof n)throw new pl(en);var a=e?e.length:0;if(a||(t&=-97,e=u=X),o=o===X?o:Gl(kc(o),0),f=f===X?f:kc(f),a-=u?u.length:0,64&t){var l=e,s=u;e=u=X}var h=c?X:Os(n),p=[n,t,r,e,u,l,s,i,o,f];if(h&&function(n,t){var r=n[1],e=t[1],u=r|e,i=u<131,o=e==mn&&8==r||e==mn&&256==r&&n[7].length<=t[8]||384==e&&t[7].length<=t[8]&&8==r;if(!i&&!o)return n;1&e&&(n[2]=t[2],u|=1&r?0:4);var f=t[3];if(f){var c=n[3];n[3]=c?Uu(c,f,t[4]):f,n[4]=c?N(n[3],cn):t[4]}f=t[5],f&&(c=n[5],n[5]=c?Bu(c,f,t[6]):f,n[6]=c?N(n[5],cn):t[6]),f=t[7],f&&(n[7]=f),e&mn&&(n[8]=null==n[8]?t[8]:Hl(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u}(p,h),n=p[0],t=p[1],r=p[2],e=p[3],u=p[4],!(f=p[9]=p[9]===X?c?0:n.length:Gl(p[9]-a,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?Hu(n,t,f):32!=t&&33!=t||u.length?Qu.apply(X,p):ei(n,t,r,e);else var _=function(n,t,r){var u=1&t,i=Gu(n);return function e(){return(this&&this!==re&&this instanceof e?i:n).apply(u?r:this,arguments)}}(n,t,r);return Yi((h?ms:Ss)(_,p),n,t)}function li(n,t,r,e){return n===X||Gf(n,gl[r])&&!bl.call(e,r)?t:n}function si(n,t,r,e,u,i){return fc(n)&&fc(t)&&(i.set(t,n),Ke(n,t,X,si,i),i.delete(t)),n}function hi(n){return gc(n)?X:n}function pi(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=2&r?new yr:X;for(i.set(n,t),i.set(t,n);++s<f;){var v=n[s],g=t[s];if(e)var y=o?e(g,v,s,t,n,i):e(v,g,s,n,t,i);if(y!==X){if(y)continue;p=!1;break}if(_){if(!h(t,(function(n,t){if(!S(_,t)&&(v===n||u(v,n,r,e,i)))return _.push(t)}))){p=!1;break}}else if(v!==g&&!u(v,g,r,e,i)){p=!1;break}}return i.delete(n),i.delete(t),p}function gi(n){return Ls(Vi(n,X,_o),n+"")}function yi(n){return de(n,Pc,Is)}function di(n){return de(n,qc,Rs)}function bi(n){for(var t=n.name+"",r=fs[t],e=bl.call(fs,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function wi(n){return(bl.call(Z,"placeholder")?Z:n).placeholder}function mi(){var n=Z.iteratee||Ca;return n=n===Ca?De:n,arguments.length?n(arguments[0],arguments[1]):n}function xi(n,t){var r=n.__data__;return function(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}(t)?r["string"==typeof t?"string":"hash"]:r.map}function ji(n){for(var t=Pc(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,Fi(u)]}return t}function Ai(n,t){var r=function(n,t){return null==n?X:n[t]}(n,t);return Ue(r)?r:X}function Ri(n,t,r){for(var e=-1,u=(t=ku(t,n)).length,i=!1;++e<u;){var o=no(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:!!(u=null==n?0:n.length)&&oc(u)&&Ci(o,u)&&(bh(n)||dh(n))}function Ei(n){return"function"!=typeof n.constructor||Mi(n)?{}:gs(El(n))}function Li(n){return bh(n)||dh(n)||!!(Cl&&n&&n[Cl])}function Ci(n,t){var r=typeof n;return!!(t=null==t?Wn:t)&&("number"==r||"symbol"!=r&&Vt.test(n))&&n>-1&&n%1==0&&n<t}function Ui(n,t,r){if(!fc(r))return!1;var e=typeof t;return!!("number"==e?Hf(r)&&Ci(t,r.length):"string"==e&&t in r)&&Gf(r[t],n)}function Bi(n,t){if(bh(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!bc(n))||zt.test(n)||!Rt.test(n)||null!=t&&n in ll(t)}function $i(n){var t=bi(n),r=Z[t];if("function"!=typeof r||!(t in Ct.prototype))return!1;if(n===r)return!0;var e=Os(r);return!!e&&n===e[0]}function Mi(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||gl)}function Fi(n){return n==n&&!fc(n)}function Ni(n,t){return function(r){return null!=r&&r[n]===t&&(t!==X||n in ll(r))}}function Vi(t,r,e){return r=Gl(r===X?t.length-1:r,0),function(){for(var u=arguments,i=-1,o=Gl(u.length-r,0),f=il(o);++i<o;)f[i]=u[r+i];i=-1;for(var c=il(r+1);++i<r;)c[i]=u[i];return c[r]=e(f),n(t,this,c)}}function Gi(n,t){return t.length<2?n:_e(n,au(t,0,-1))}function Ji(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}function Yi(n,t,r){var e=t+"";return Ls(n,function(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Ut,"{\n/* [wrapped with "+t+"] */\n")}(e,ro(function(n){var t=n.match(Bt);return t?t[1].split(Tt):[]}(e),r)))}function Qi(n){var t=0,r=0;return function(){var e=Jl(),u=16-(e-r);if(r=e,u>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(X,arguments)}}function Xi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===X?e:t;++r<t;){var i=tu(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}function no(n){if("string"==typeof n||bc(n))return n;var t=n+"";return"0"==t&&1/n==-Sn?"-0":t}function to(n){if(null!=n){try{return dl.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function ro(n,t){return r($n,(function(r){var e="_."+r[0];t&r[1]&&!o(n,e)&&n.push(e)})),n.sort()}function eo(n){if(n instanceof Ct)return n.clone();var t=new Y(n.__wrapped__,n.__chain__);return t.__actions__=Tu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function ho(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:kc(r);return u<0&&(u=Gl(e+u,0)),g(n,mi(t,3),u)}function po(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==X&&(u=kc(r),u=r<0?Gl(e+u,0):Hl(u,e-1)),g(n,mi(t,3),u,!0)}function _o(n){return null!=n&&n.length?ee(n,1):[]}function bo(n){return n&&n.length?n[0]:X}function jo(n){var t=null==n?0:n.length;return t?n[t-1]:X}function Oo(n,t){return n&&n.length&&t&&t.length?Xe(n,t):n}function Eo(n){return null==n?n:Xl.call(n)}function Go(n){if(!n||!n.length)return[];var t=0;return n=i(n,(function(n){if(Jf(n))return t=Gl(n.length,t),!0})),O(t,(function(t){return c(n,m(t))}))}function Ho(t,r){if(!t||!t.length)return[];var e=Go(t);return null==r?e:c(e,(function(t){return n(r,X,t)}))}function Qo(n){var t=Z(n);return t.__chain__=!0,t}function nf(n,t){return t(n)}function _f(n,t){return(bh(n)?r:ys)(n,mi(t,3))}function vf(n,t){return(bh(n)?e:ds)(n,mi(t,3))}function yf(n,t){return(bh(n)?c:Pe)(n,mi(t,3))}function Rf(n,t,r){return t=r?X:t,t=n&&null==t?n.length:t,ai(n,mn,X,X,X,X,t)}function zf(n,t){var r;if("function"!=typeof t)throw new pl(en);return n=kc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=X),r}}function Wf(n,t,r){function e(t){var r=h,e=p;return h=p=X,d=t,v=n.apply(e,r)}function o(n){var r=n-y;return y===X||r>=t||r<0||w&&n-d>=_}function f(){var n=fh();return o(n)?c(n):(g=Ws(f,function(n){var u=t-(n-y);return w?Hl(u,_-(n-d)):u}(n)),X)}function c(n){return g=X,m&&h?e(n):(h=p=X,v)}function s(){var n=fh(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===X)return function(n){return d=n,g=Ws(f,t),b?e(n):v}(y);if(w)return As(g),g=Ws(f,t),e(y)}return g===X&&(g=Ws(f,t)),v}var h,p,_,v,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new pl(en);return t=Ic(t)||0,fc(r)&&(b=!!r.leading,_=(w="maxWait"in r)?Gl(Ic(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m),s.cancel=function(){g!==X&&As(g),d=0,h=y=p=g=X},s.flush=function(){return g===X?v:c(fh())},s}function Cf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new pl(en);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Cf.Cache||sr),r}function Uf(n){if("function"!=typeof n)throw new pl(en);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Gf(n,t){return n===t||n!=n&&t!=t}function Hf(n){return null!=n&&oc(n.length)&&!uc(n)}function Jf(n){return cc(n)&&Hf(n)}function rc(n){if(!cc(n))return!1;var t=we(n);return t==Zn||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!gc(n)}function uc(n){if(!fc(n))return!1;var t=we(n);return t==Kn||t==Vn||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ic(n){return"number"==typeof n&&n==kc(n)}function oc(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Wn}function fc(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function cc(n){return null!=n&&"object"==typeof n}function vc(n){return"number"==typeof n||cc(n)&&we(n)==Hn}function gc(n){if(!cc(n)||we(n)!=Yn)return!1;var t=El(n);if(null===t)return!0;var r=bl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&dl.call(r)==jl}function dc(n){return"string"==typeof n||!bh(n)&&cc(n)&&we(n)==rt}function bc(n){return"symbol"==typeof n||cc(n)&&we(n)==et}function jc(n){if(!n)return[];if(Hf(n))return dc(n)?G(n):Tu(n);if(Ul&&n[Ul])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Ul]());var t=zs(n);return(t==Gn?M:t==tt?P:ra)(n)}function Ac(n){return n?(n=Ic(n))===Sn||n===-Sn?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function kc(n){var t=Ac(n),r=t%1;return t==t?r?t-r:t:0}function Oc(n){return n?Mr(kc(n),0,Un):0}function Ic(n){if("number"==typeof n)return n;if(bc(n))return Cn;if(fc(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=fc(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=R(n);var r=qt.test(n);return r||Kt.test(n)?Xr(n.slice(2),r?2:8):Pt.test(n)?Cn:+n}function Rc(n){return $u(n,qc(n))}function Ec(n){return null==n?"":vu(n)}function Mc(n,t,r){var e=null==n?X:_e(n,t);return e===X?r:e}function Nc(n,t){return null!=n&&Ri(n,t,je)}function Pc(n){return Hf(n)?Or(n):Me(n)}function qc(n){return Hf(n)?Or(n,!0):Fe(n)}function Gc(n,t){if(null==n)return{};var r=c(di(n),(function(n){return[n]}));return t=mi(t),Ye(n,r,(function(n,r){return t(n,r[0])}))}function ra(n){return null==n?[]:E(n,Pc(n))}function fa(n){return Qh(Ec(n).toLowerCase())}function ca(n){return(n=Ec(n))&&n.replace(Gt,ve).replace(Dr,"")}function Ra(n,t,r){return n=Ec(n),(t=r?X:t)===X?$(n)?Q(n):_(n):n.match(t)||[]}function Sa(n){return function(){return n}}function La(n){return n}function Ca(n){return De("function"==typeof n?n:Fr(n,1))}function Ta(n,t,e){var u=Pc(t),i=fe(t,u);null!=e||fc(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=fe(t,Pc(t)));var o=!(fc(e)&&"chain"in e&&!e.chain),f=uc(n);return r(i,(function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Tu(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})})),n}function Da(){}function Fa(n){return Bi(n)?m(no(n)):function(n){return function(t){return _e(t,n)}}(n)}function Pa(){return[]}function qa(){return!1}var il=(x=null==x?re:be.defaults(re.Object(),x,be.pick(re,qr))).Array,ol=x.Date,fl=x.Error,cl=x.Function,al=x.Math,ll=x.Object,sl=x.RegExp,hl=x.String,pl=x.TypeError,_l=il.prototype,vl=cl.prototype,gl=ll.prototype,yl=x["__core-js_shared__"],dl=vl.toString,bl=gl.hasOwnProperty,wl=0,ml=function(){var n=/[^.]+$/.exec(yl&&yl.keys&&yl.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),xl=gl.toString,jl=dl.call(ll),Al=re._,kl=sl("^"+dl.call(bl).replace(St,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ol=ie?x.Buffer:X,Il=x.Symbol,Rl=x.Uint8Array,zl=Ol?Ol.allocUnsafe:X,El=F(ll.getPrototypeOf,ll),Sl=ll.create,Wl=gl.propertyIsEnumerable,Ll=_l.splice,Cl=Il?Il.isConcatSpreadable:X,Ul=Il?Il.iterator:X,Bl=Il?Il.toStringTag:X,Tl=function(){try{var n=Ai(ll,"defineProperty");return n({},"",{}),n}catch(n){}}(),$l=x.clearTimeout!==re.clearTimeout&&x.clearTimeout,Dl=ol&&ol.now!==re.Date.now&&ol.now,Ml=x.setTimeout!==re.setTimeout&&x.setTimeout,Fl=al.ceil,Nl=al.floor,Pl=ll.getOwnPropertySymbols,ql=Ol?Ol.isBuffer:X,Zl=x.isFinite,Kl=_l.join,Vl=F(ll.keys,ll),Gl=al.max,Hl=al.min,Jl=ol.now,Yl=x.parseInt,Ql=al.random,Xl=_l.reverse,ns=Ai(x,"DataView"),ts=Ai(x,"Map"),rs=Ai(x,"Promise"),es=Ai(x,"Set"),us=Ai(x,"WeakMap"),is=Ai(ll,"create"),os=us&&new us,fs={},cs=to(ns),as=to(ts),ls=to(rs),ss=to(es),hs=to(us),ps=Il?Il.prototype:X,_s=ps?ps.valueOf:X,vs=ps?ps.toString:X,gs=function(){function n(){}return function(t){if(!fc(t))return{};if(Sl)return Sl(t);n.prototype=t;var r=new n;return n.prototype=X,r}}();Z.templateSettings={escape:kt,evaluate:Ot,interpolate:It,variable:"",imports:{_:Z}},Z.prototype=J.prototype,Z.prototype.constructor=Z,Y.prototype=gs(J.prototype),Y.prototype.constructor=Y,Ct.prototype=gs(J.prototype),Ct.prototype.constructor=Ct,Xt.prototype.clear=function(){this.__data__=is?is(null):{},this.size=0},Xt.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Xt.prototype.get=function(n){var t=this.__data__;if(is){var r=t[n];return r===on?X:r}return bl.call(t,n)?t[n]:X},Xt.prototype.has=function(n){var t=this.__data__;return is?t[n]!==X:bl.call(t,n)},Xt.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=is&&t===X?on:t,this},ir.prototype.clear=function(){this.__data__=[],this.size=0},ir.prototype.delete=function(n){var t=this.__data__,r=Wr(t,n);return!(r<0||(r==t.length-1?t.pop():Ll.call(t,r,1),--this.size,0))},ir.prototype.get=function(n){var t=this.__data__,r=Wr(t,n);return r<0?X:t[r][1]},ir.prototype.has=function(n){return Wr(this.__data__,n)>-1},ir.prototype.set=function(n,t){var r=this.__data__,e=Wr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},sr.prototype.clear=function(){this.size=0,this.__data__={hash:new Xt,map:new(ts||ir),string:new Xt}},sr.prototype.delete=function(n){var t=xi(this,n).delete(n);return this.size-=t?1:0,t},sr.prototype.get=function(n){return xi(this,n).get(n)},sr.prototype.has=function(n){return xi(this,n).has(n)},sr.prototype.set=function(n,t){var r=xi(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},yr.prototype.add=yr.prototype.push=function(n){return this.__data__.set(n,on),this},yr.prototype.has=function(n){return this.__data__.has(n)},wr.prototype.clear=function(){this.__data__=new ir,this.size=0},wr.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},wr.prototype.get=function(n){return this.__data__.get(n)},wr.prototype.has=function(n){return this.__data__.has(n)},wr.prototype.set=function(n,t){var r=this.__data__;if(r instanceof ir){var e=r.__data__;if(!ts||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new sr(e)}return r.set(n,t),this.size=r.size,this};var ys=Pu(ue),ds=Pu(oe,!0),bs=qu(),ws=qu(!0),ms=os?function(n,t){return os.set(n,t),n}:La,xs=Tl?function(n,t){return Tl(n,"toString",{configurable:!0,enumerable:!1,value:Sa(t),writable:!0})}:La,js=uu,As=$l||function(n){return re.clearTimeout(n)},ks=es&&1/P(new es([,-0]))[1]==Sn?function(n){return new es(n)}:Da,Os=os?function(n){return os.get(n)}:Da,Is=Pl?function(n){return null==n?[]:(n=ll(n),i(Pl(n),(function(t){return Wl.call(n,t)})))}:Pa,Rs=Pl?function(n){for(var t=[];n;)a(t,Is(n)),n=El(n);return t}:Pa,zs=we;(ns&&zs(new ns(new ArrayBuffer(1)))!=ct||ts&&zs(new ts)!=Gn||rs&&zs(rs.resolve())!=Qn||es&&zs(new es)!=tt||us&&zs(new us)!=it)&&(zs=function(n){var t=we(n),r=t==Yn?n.constructor:X,e=r?to(r):"";if(e)switch(e){case cs:return ct;case as:return Gn;case ls:return Qn;case ss:return tt;case hs:return it}return t});var Es=yl?uc:qa,Ss=Qi(ms),Ws=Ml||function(n,t){return re.setTimeout(n,t)},Ls=Qi(xs),Cs=function(n){var t=Cf(n,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}((function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(Et,(function(n,r,e,u){t.push(e?u.replace(Mt,"$1"):r||n)})),t})),Us=uu((function(n,t){return Jf(n)?Hr(n,ee(t,1,Jf,!0)):[]})),Bs=uu((function(n,t){var r=jo(t);return Jf(r)&&(r=X),Jf(n)?Hr(n,ee(t,1,Jf,!0),mi(r,2)):[]})),Ts=uu((function(n,t){var r=jo(t);return Jf(r)&&(r=X),Jf(n)?Hr(n,ee(t,1,Jf,!0),X,r):[]})),$s=uu((function(n){var t=c(n,ju);return t.length&&t[0]===n[0]?ke(t):[]})),Ds=uu((function(n){var t=jo(n),r=c(n,ju);return t===jo(r)?t=X:r.pop(),r.length&&r[0]===n[0]?ke(r,mi(t,2)):[]})),Ms=uu((function(n){var t=jo(n),r=c(n,ju);return(t="function"==typeof t?t:X)&&r.pop(),r.length&&r[0]===n[0]?ke(r,X,t):[]})),Fs=uu(Oo),Ns=gi((function(n,t){var r=null==n?0:n.length,e=Tr(n,t);return nu(n,c(t,(function(n){return Ci(n,r)?+n:n})).sort(Lu)),e})),Ps=uu((function(n){return gu(ee(n,1,Jf,!0))})),qs=uu((function(n){var t=jo(n);return Jf(t)&&(t=X),gu(ee(n,1,Jf,!0),mi(t,2))})),Zs=uu((function(n){var t=jo(n);return t="function"==typeof t?t:X,gu(ee(n,1,Jf,!0),X,t)})),Ks=uu((function(n,t){return Jf(n)?Hr(n,t):[]})),Vs=uu((function(n){return mu(i(n,Jf))})),Gs=uu((function(n){var t=jo(n);return Jf(t)&&(t=X),mu(i(n,Jf),mi(t,2))})),Hs=uu((function(n){var t=jo(n);return t="function"==typeof t?t:X,mu(i(n,Jf),X,t)})),Js=uu(Go),Ys=uu((function(n){var t=n.length,r=t>1?n[t-1]:X;return r="function"==typeof r?(n.pop(),r):X,Ho(n,r)})),Qs=gi((function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Tr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Ct&&Ci(r)?((e=e.slice(r,+r+(t?1:0))).__actions__.push({func:nf,args:[u],thisArg:X}),new Y(e,this.__chain__).thru((function(n){return t&&!n.length&&n.push(X),n}))):this.thru(u)})),Xs=Fu((function(n,t,r){bl.call(n,r)?++n[r]:Br(n,r,1)})),nh=Ju(ho),th=Ju(po),rh=Fu((function(n,t,r){bl.call(n,r)?n[r].push(t):Br(n,r,[t])})),eh=uu((function(t,r,e){var u=-1,i="function"==typeof r,o=Hf(t)?il(t.length):[];return ys(t,(function(t){o[++u]=i?n(r,t,e):Ie(t,r,e)})),o})),uh=Fu((function(n,t,r){Br(n,r,t)})),ih=Fu((function(n,t,r){n[r?0:1].push(t)}),(function(){return[[],[]]})),oh=uu((function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ui(n,t[0],t[1])?t=[]:r>2&&Ui(t[0],t[1],t[2])&&(t=[t[0]]),He(n,ee(t,1),[])})),fh=Dl||function(){return re.Date.now()},ch=uu((function(n,t,r){var e=1;if(r.length){var u=N(r,wi(ch));e|=32}return ai(n,e,t,r,u)})),ah=uu((function(n,t,r){var e=3;if(r.length){var u=N(r,wi(ah));e|=32}return ai(t,e,n,r,u)})),lh=uu((function(n,t){return Gr(n,1,t)})),sh=uu((function(n,t,r){return Gr(n,Ic(t)||0,r)}));Cf.Cache=sr;var hh=js((function(t,r){var e=(r=1==r.length&&bh(r[0])?c(r[0],z(mi())):c(ee(r,1),z(mi()))).length;return uu((function(u){for(var i=-1,o=Hl(u.length,e);++i<o;)u[i]=r[i].call(this,u[i]);return n(t,this,u)}))})),ph=uu((function(n,t){return ai(n,32,X,t,N(t,wi(ph)))})),_h=uu((function(n,t){return ai(n,64,X,t,N(t,wi(_h)))})),vh=gi((function(n,t){return ai(n,256,X,X,X,t)})),gh=ii(me),yh=ii((function(n,t){return n>=t})),dh=Re(function(){return arguments}())?Re:function(n){return cc(n)&&bl.call(n,"callee")&&!Wl.call(n,"callee")},bh=il.isArray,wh=ce?z(ce):function(n){return cc(n)&&we(n)==ft},mh=ql||qa,xh=ae?z(ae):function(n){return cc(n)&&we(n)==Pn},jh=le?z(le):function(n){return cc(n)&&zs(n)==Gn},Ah=se?z(se):function(n){return cc(n)&&we(n)==nt},kh=he?z(he):function(n){return cc(n)&&zs(n)==tt},Oh=pe?z(pe):function(n){return cc(n)&&oc(n.length)&&!!Kr[we(n)]},Ih=ii(Ne),Rh=ii((function(n,t){return n<=t})),zh=Nu((function(n,t){if(Mi(t)||Hf(t))return $u(t,Pc(t),n),X;for(var r in t)bl.call(t,r)&&Sr(n,r,t[r])})),Eh=Nu((function(n,t){$u(t,qc(t),n)})),Sh=Nu((function(n,t,r,e){$u(t,qc(t),n,e)})),Wh=Nu((function(n,t,r,e){$u(t,Pc(t),n,e)})),Lh=gi(Tr),Ch=uu((function(n,t){n=ll(n);var r=-1,e=t.length,u=e>2?t[2]:X;for(u&&Ui(t[0],t[1],u)&&(e=1);++r<e;)for(var i=t[r],o=qc(i),f=-1,c=o.length;++f<c;){var a=o[f],l=n[a];(l===X||Gf(l,gl[a])&&!bl.call(n,a))&&(n[a]=i[a])}return n})),Uh=uu((function(t){return t.push(X,si),n(Mh,X,t)})),Bh=Xu((function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=xl.call(t)),n[t]=r}),Sa(La)),Th=Xu((function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=xl.call(t)),bl.call(n,t)?n[t].push(r):n[t]=[r]}),mi),$h=uu(Ie),Dh=Nu((function(n,t,r){Ke(n,t,r)})),Mh=Nu((function(n,t,r,e){Ke(n,t,r,e)})),Fh=gi((function(n,t){var r={};if(null==n)return r;var e=!1;t=c(t,(function(t){return t=ku(t,n),e||(e=t.length>1),t})),$u(n,di(n),r),e&&(r=Fr(r,7,hi));for(var u=t.length;u--;)yu(r,t[u]);return r})),Nh=gi((function(n,t){return null==n?{}:function(n,t){return Ye(n,t,(function(t,r){return Nc(n,r)}))}(n,t)})),Ph=ci(Pc),qh=ci(qc),Zh=Vu((function(n,t,r){return t=t.toLowerCase(),n+(r?fa(t):t)})),Kh=Vu((function(n,t,r){return n+(r?"-":"")+t.toLowerCase()})),Vh=Vu((function(n,t,r){return n+(r?" ":"")+t.toLowerCase()})),Gh=Ku("toLowerCase"),Hh=Vu((function(n,t,r){return n+(r?"_":"")+t.toLowerCase()})),Jh=Vu((function(n,t,r){return n+(r?" ":"")+Qh(t)})),Yh=Vu((function(n,t,r){return n+(r?" ":"")+t.toUpperCase()})),Qh=Ku("toUpperCase"),Xh=uu((function(t,r){try{return n(t,X,r)}catch(n){return rc(n)?n:new fl(n)}})),np=gi((function(n,t){return r(t,(function(t){t=no(t),Br(n,t,ch(n[t],n))})),n})),tp=Yu(),rp=Yu(!0),ep=uu((function(n,t){return function(r){return Ie(r,n,t)}})),up=uu((function(n,t){return function(r){return Ie(n,r,t)}})),ip=ti(c),op=ti(u),fp=ti(h),cp=ui(),ap=ui(!0),lp=ni((function(n,t){return n+t}),0),sp=fi("ceil"),hp=ni((function(n,t){return n/t}),1),pp=fi("floor"),_p=ni((function(n,t){return n*t}),1),vp=fi("round"),gp=ni((function(n,t){return n-t}),0);return Z.after=function(n,t){if("function"!=typeof t)throw new pl(en);return n=kc(n),function(){if(--n<1)return t.apply(this,arguments)}},Z.ary=Rf,Z.assign=zh,Z.assignIn=Eh,Z.assignInWith=Sh,Z.assignWith=Wh,Z.at=Lh,Z.before=zf,Z.bind=ch,Z.bindAll=np,Z.bindKey=ah,Z.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return bh(n)?n:[n]},Z.chain=Qo,Z.chunk=function(n,t,r){t=(r?Ui(n,t,r):t===X)?1:Gl(kc(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=il(Fl(e/t));u<e;)o[i++]=au(n,u,u+=t);return o},Z.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},Z.concat=function(){var n=arguments.length;if(!n)return[];for(var t=il(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return a(bh(r)?Tu(r):[r],ee(t,1))},Z.cond=function(t){var r=null==t?0:t.length,e=mi();return t=r?c(t,(function(n){if("function"!=typeof n[1])throw new pl(en);return[e(n[0]),n[1]]})):[],uu((function(e){for(var u=-1;++u<r;){var i=t[u];if(n(i[0],this,e))return n(i[1],this,e)}}))},Z.conforms=function(n){return function(n){var t=Pc(n);return function(r){return Pr(r,n,t)}}(Fr(n,1))},Z.constant=Sa,Z.countBy=Xs,Z.create=function(n,t){var r=gs(n);return null==t?r:Cr(r,t)},Z.curry=function Ef(n,t,r){var e=ai(n,8,X,X,X,X,X,t=r?X:t);return e.placeholder=Ef.placeholder,e},Z.curryRight=function Sf(n,t,r){var e=ai(n,16,X,X,X,X,X,t=r?X:t);return e.placeholder=Sf.placeholder,e},Z.debounce=Wf,Z.defaults=Ch,Z.defaultsDeep=Uh,Z.defer=lh,Z.delay=sh,Z.difference=Us,Z.differenceBy=Bs,Z.differenceWith=Ts,Z.drop=function(n,t,r){var e=null==n?0:n.length;return e?au(n,(t=r||t===X?1:kc(t))<0?0:t,e):[]},Z.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?au(n,0,(t=e-(t=r||t===X?1:kc(t)))<0?0:t):[]},Z.dropRightWhile=function(n,t){return n&&n.length?bu(n,mi(t,3),!0,!0):[]},Z.dropWhile=function(n,t){return n&&n.length?bu(n,mi(t,3),!0):[]},Z.fill=function(n,t,r,e){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&Ui(n,t,r)&&(r=0,e=u),function(n,t,r,e){var u=n.length;for((r=kc(r))<0&&(r=-r>u?0:u+r),(e=e===X||e>u?u:kc(e))<0&&(e+=u),e=r>e?0:Oc(e);r<e;)n[r++]=t;return n}(n,t,r,e)):[]},Z.filter=function(n,t){return(bh(n)?i:te)(n,mi(t,3))},Z.flatMap=function(n,t){return ee(yf(n,t),1)},Z.flatMapDeep=function(n,t){return ee(yf(n,t),Sn)},Z.flatMapDepth=function(n,t,r){return r=r===X?1:kc(r),ee(yf(n,t),r)},Z.flatten=_o,Z.flattenDeep=function(n){return null!=n&&n.length?ee(n,Sn):[]},Z.flattenDepth=function(n,t){return null!=n&&n.length?ee(n,t=t===X?1:kc(t)):[]},Z.flip=function(n){return ai(n,512)},Z.flow=tp,Z.flowRight=rp,Z.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},Z.functions=function(n){return null==n?[]:fe(n,Pc(n))},Z.functionsIn=function(n){return null==n?[]:fe(n,qc(n))},Z.groupBy=rh,Z.initial=function(n){return null!=n&&n.length?au(n,0,-1):[]},Z.intersection=$s,Z.intersectionBy=Ds,Z.intersectionWith=Ms,Z.invert=Bh,Z.invertBy=Th,Z.invokeMap=eh,Z.iteratee=Ca,Z.keyBy=uh,Z.keys=Pc,Z.keysIn=qc,Z.map=yf,Z.mapKeys=function(n,t){var r={};return t=mi(t,3),ue(n,(function(n,e,u){Br(r,t(n,e,u),n)})),r},Z.mapValues=function(n,t){var r={};return t=mi(t,3),ue(n,(function(n,e,u){Br(r,e,t(n,e,u))})),r},Z.matches=function(n){return qe(Fr(n,1))},Z.matchesProperty=function(n,t){return Ze(n,Fr(t,1))},Z.memoize=Cf,Z.merge=Dh,Z.mergeWith=Mh,Z.method=ep,Z.methodOf=up,Z.mixin=Ta,Z.negate=Uf,Z.nthArg=function(n){return n=kc(n),uu((function(t){return Ge(t,n)}))},Z.omit=Fh,Z.omitBy=function(n,t){return Gc(n,Uf(mi(t)))},Z.once=function(n){return zf(2,n)},Z.orderBy=function(n,t,r,e){return null==n?[]:(bh(t)||(t=null==t?[]:[t]),bh(r=e?X:r)||(r=null==r?[]:[r]),He(n,t,r))},Z.over=ip,Z.overArgs=hh,Z.overEvery=op,Z.overSome=fp,Z.partial=ph,Z.partialRight=_h,Z.partition=ih,Z.pick=Nh,Z.pickBy=Gc,Z.property=Fa,Z.propertyOf=function(n){return function(t){return null==n?X:_e(n,t)}},Z.pull=Fs,Z.pullAll=Oo,Z.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?Xe(n,t,mi(r,2)):n},Z.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Xe(n,t,X,r):n},Z.pullAt=Ns,Z.range=cp,Z.rangeRight=ap,Z.rearg=vh,Z.reject=function(n,t){return(bh(n)?i:te)(n,Uf(mi(t,3)))},Z.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=mi(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return nu(n,u),r},Z.rest=function(n,t){if("function"!=typeof n)throw new pl(en);return uu(n,t=t===X?t:kc(t))},Z.reverse=Eo,Z.sampleSize=function(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t),(bh(n)?Rr:ou)(n,t)},Z.set=function(n,t,r){return null==n?n:fu(n,t,r)},Z.setWith=function(n,t,r,e){return e="function"==typeof e?e:X,null==n?n:fu(n,t,r,e)},Z.shuffle=function(n){return(bh(n)?zr:cu)(n)},Z.slice=function(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&Ui(n,t,r)?(t=0,r=e):(t=null==t?0:kc(t),r=r===X?e:kc(r)),au(n,t,r)):[]},Z.sortBy=oh,Z.sortedUniq=function(n){return n&&n.length?pu(n):[]},Z.sortedUniqBy=function(n,t){return n&&n.length?pu(n,mi(t,2)):[]},Z.split=function(n,t,r){return r&&"number"!=typeof r&&Ui(n,t,r)&&(t=r=X),(r=r===X?Un:r>>>0)?(n=Ec(n))&&("string"==typeof t||null!=t&&!Ah(t))&&(!(t=vu(t))&&T(n))?Ou(G(n),0,r):n.split(t,r):[]},Z.spread=function(t,r){if("function"!=typeof t)throw new pl(en);return r=null==r?0:Gl(kc(r),0),uu((function(e){var u=e[r],i=Ou(e,0,r);return u&&a(i,u),n(t,this,i)}))},Z.tail=function(n){var t=null==n?0:n.length;return t?au(n,1,t):[]},Z.take=function(n,t,r){return n&&n.length?au(n,0,(t=r||t===X?1:kc(t))<0?0:t):[]},Z.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?au(n,(t=e-(t=r||t===X?1:kc(t)))<0?0:t,e):[]},Z.takeRightWhile=function(n,t){return n&&n.length?bu(n,mi(t,3),!1,!0):[]},Z.takeWhile=function(n,t){return n&&n.length?bu(n,mi(t,3)):[]},Z.tap=function(n,t){return t(n),n},Z.throttle=function(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new pl(en);return fc(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Wf(n,t,{leading:e,maxWait:t,trailing:u})},Z.thru=nf,Z.toArray=jc,Z.toPairs=Ph,Z.toPairsIn=qh,Z.toPath=function(n){return bh(n)?c(n,no):bc(n)?[n]:Tu(Cs(Ec(n)))},Z.toPlainObject=Rc,Z.transform=function(n,t,e){var u=bh(n),i=u||mh(n)||Oh(n);if(t=mi(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:fc(n)&&uc(o)?gs(El(n)):{}}return(i?r:ue)(n,(function(n,r,u){return t(e,n,r,u)})),e},Z.unary=function(n){return Rf(n,1)},Z.union=Ps,Z.unionBy=qs,Z.unionWith=Zs,Z.uniq=function(n){return n&&n.length?gu(n):[]},Z.uniqBy=function(n,t){return n&&n.length?gu(n,mi(t,2)):[]},Z.uniqWith=function(n,t){return t="function"==typeof t?t:X,n&&n.length?gu(n,X,t):[]},Z.unset=function(n,t){return null==n||yu(n,t)},Z.unzip=Go,Z.unzipWith=Ho,Z.update=function(n,t,r){return null==n?n:du(n,t,Au(r))},Z.updateWith=function(n,t,r,e){return e="function"==typeof e?e:X,null==n?n:du(n,t,Au(r),e)},Z.values=ra,Z.valuesIn=function(n){return null==n?[]:E(n,qc(n))},Z.without=Ks,Z.words=Ra,Z.wrap=function(n,t){return ph(Au(t),n)},Z.xor=Vs,Z.xorBy=Gs,Z.xorWith=Hs,Z.zip=Js,Z.zipObject=function(n,t){return xu(n||[],t||[],Sr)},Z.zipObjectDeep=function(n,t){return xu(n||[],t||[],fu)},Z.zipWith=Ys,Z.entries=Ph,Z.entriesIn=qh,Z.extend=Eh,Z.extendWith=Sh,Ta(Z,Z),Z.add=lp,Z.attempt=Xh,Z.camelCase=Zh,Z.capitalize=fa,Z.ceil=sp,Z.clamp=function(n,t,r){return r===X&&(r=t,t=X),r!==X&&(r=(r=Ic(r))==r?r:0),t!==X&&(t=(t=Ic(t))==t?t:0),Mr(Ic(n),t,r)},Z.clone=function(n){return Fr(n,4)},Z.cloneDeep=function(n){return Fr(n,5)},Z.cloneDeepWith=function(n,t){return Fr(n,5,t="function"==typeof t?t:X)},Z.cloneWith=function(n,t){return Fr(n,4,t="function"==typeof t?t:X)},Z.conformsTo=function(n,t){return null==t||Pr(n,t,Pc(t))},Z.deburr=ca,Z.defaultTo=function(n,t){return null==n||n!=n?t:n},Z.divide=hp,Z.endsWith=function(n,t,r){n=Ec(n),t=vu(t);var e=n.length,u=r=r===X?e:Mr(kc(r),0,e);return(r-=t.length)>=0&&n.slice(r,u)==t},Z.eq=Gf,Z.escape=function(n){return(n=Ec(n))&&At.test(n)?n.replace(xt,ge):n},Z.escapeRegExp=function(n){return(n=Ec(n))&&Wt.test(n)?n.replace(St,"\\$&"):n},Z.every=function(n,t,r){var e=bh(n)?u:Jr;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))},Z.find=nh,Z.findIndex=ho,Z.findKey=function(n,t){return v(n,mi(t,3),ue)},Z.findLast=th,Z.findLastIndex=po,Z.findLastKey=function(n,t){return v(n,mi(t,3),oe)},Z.floor=pp,Z.forEach=_f,Z.forEachRight=vf,Z.forIn=function(n,t){return null==n?n:bs(n,mi(t,3),qc)},Z.forInRight=function(n,t){return null==n?n:ws(n,mi(t,3),qc)},Z.forOwn=function(n,t){return n&&ue(n,mi(t,3))},Z.forOwnRight=function(n,t){return n&&oe(n,mi(t,3))},Z.get=Mc,Z.gt=gh,Z.gte=yh,Z.has=function(n,t){return null!=n&&Ri(n,t,xe)},Z.hasIn=Nc,Z.head=bo,Z.identity=La,Z.includes=function(n,t,r,e){n=Hf(n)?n:ra(n),r=r&&!e?kc(r):0;var u=n.length;return r<0&&(r=Gl(u+r,0)),dc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1},Z.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:kc(r);return u<0&&(u=Gl(e+u,0)),y(n,t,u)},Z.inRange=function(n,t,r){return t=Ac(t),r===X?(r=t,t=0):r=Ac(r),function(n,t,r){return n>=Hl(t,r)&&n<Gl(t,r)}(n=Ic(n),t,r)},Z.invoke=$h,Z.isArguments=dh,Z.isArray=bh,Z.isArrayBuffer=wh,Z.isArrayLike=Hf,Z.isArrayLikeObject=Jf,Z.isBoolean=function(n){return!0===n||!1===n||cc(n)&&we(n)==Nn},Z.isBuffer=mh,Z.isDate=xh,Z.isElement=function(n){return cc(n)&&1===n.nodeType&&!gc(n)},Z.isEmpty=function(n){if(null==n)return!0;if(Hf(n)&&(bh(n)||"string"==typeof n||"function"==typeof n.splice||mh(n)||Oh(n)||dh(n)))return!n.length;var t=zs(n);if(t==Gn||t==tt)return!n.size;if(Mi(n))return!Me(n).length;for(var r in n)if(bl.call(n,r))return!1;return!0},Z.isEqual=function(n,t){return Se(n,t)},Z.isEqualWith=function(n,t,r){var e=(r="function"==typeof r?r:X)?r(n,t):X;return e===X?Se(n,t,X,r):!!e},Z.isError=rc,Z.isFinite=function(n){return"number"==typeof n&&Zl(n)},Z.isFunction=uc,Z.isInteger=ic,Z.isLength=oc,Z.isMap=jh,Z.isMatch=function(n,t){return n===t||Ce(n,t,ji(t))},Z.isMatchWith=function(n,t,r){return r="function"==typeof r?r:X,Ce(n,t,ji(t),r)},Z.isNaN=function(n){return vc(n)&&n!=+n},Z.isNative=function(n){if(Es(n))throw new fl("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ue(n)},Z.isNil=function(n){return null==n},Z.isNull=function(n){return null===n},Z.isNumber=vc,Z.isObject=fc,Z.isObjectLike=cc,Z.isPlainObject=gc,Z.isRegExp=Ah,Z.isSafeInteger=function(n){return ic(n)&&n>=-Wn&&n<=Wn},Z.isSet=kh,Z.isString=dc,Z.isSymbol=bc,Z.isTypedArray=Oh,Z.isUndefined=function(n){return n===X},Z.isWeakMap=function(n){return cc(n)&&zs(n)==it},Z.isWeakSet=function(n){return cc(n)&&"[object WeakSet]"==we(n)},Z.join=function(n,t){return null==n?"":Kl.call(n,t)},Z.kebabCase=Kh,Z.last=jo,Z.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return r!==X&&(u=(u=kc(r))<0?Gl(e+u,0):Hl(u,e-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,u):g(n,b,u,!0)},Z.lowerCase=Vh,Z.lowerFirst=Gh,Z.lt=Ih,Z.lte=Rh,Z.max=function(n){return n&&n.length?Yr(n,La,me):X},Z.maxBy=function(n,t){return n&&n.length?Yr(n,mi(t,2),me):X},Z.mean=function(n){return w(n,La)},Z.meanBy=function(n,t){return w(n,mi(t,2))},Z.min=function(n){return n&&n.length?Yr(n,La,Ne):X},Z.minBy=function(n,t){return n&&n.length?Yr(n,mi(t,2),Ne):X},Z.stubArray=Pa,Z.stubFalse=qa,Z.stubObject=function(){return{}},Z.stubString=function(){return""},Z.stubTrue=function(){return!0},Z.multiply=_p,Z.nth=function(n,t){return n&&n.length?Ge(n,kc(t)):X},Z.noConflict=function(){return re._===this&&(re._=Al),this},Z.noop=Da,Z.now=fh,Z.pad=function(n,t,r){n=Ec(n);var e=(t=kc(t))?V(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ri(Nl(u),r)+n+ri(Fl(u),r)},Z.padEnd=function(n,t,r){n=Ec(n);var e=(t=kc(t))?V(n):0;return t&&e<t?n+ri(t-e,r):n},Z.padStart=function(n,t,r){n=Ec(n);var e=(t=kc(t))?V(n):0;return t&&e<t?ri(t-e,r)+n:n},Z.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),Yl(Ec(n).replace(Lt,""),t||0)},Z.random=function(n,t,r){if(r&&"boolean"!=typeof r&&Ui(n,t,r)&&(t=r=X),r===X&&("boolean"==typeof t?(r=t,t=X):"boolean"==typeof n&&(r=n,n=X)),n===X&&t===X?(n=0,t=1):(n=Ac(n),t===X?(t=n,n=0):t=Ac(t)),n>t){var e=n;n=t,t=e}if(r||n%1||t%1){var u=Ql();return Hl(n+u*(t-n+Qr("1e-"+((u+"").length-1))),t)}return tu(n,t)},Z.reduce=function(n,t,r){var e=bh(n)?l:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ys)},Z.reduceRight=function(n,t,r){var e=bh(n)?s:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ds)},Z.repeat=function(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t),eu(Ec(n),t)},Z.replace=function(){var n=arguments,t=Ec(n[0]);return n.length<3?t:t.replace(n[1],n[2])},Z.result=function(n,t,r){var e=-1,u=(t=ku(t,n)).length;for(u||(u=1,n=X);++e<u;){var i=null==n?X:n[no(t[e])];i===X&&(e=u,i=r),n=uc(i)?i.call(n):i}return n},Z.round=vp,Z.runInContext=p,Z.sample=function(n){return(bh(n)?Ir:iu)(n)},Z.size=function(n){if(null==n)return 0;if(Hf(n))return dc(n)?V(n):n.length;var t=zs(n);return t==Gn||t==tt?n.size:Me(n).length},Z.snakeCase=Hh,Z.some=function(n,t,r){var e=bh(n)?h:lu;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))},Z.sortedIndex=function(n,t){return su(n,t)},Z.sortedIndexBy=function(n,t,r){return hu(n,t,mi(r,2))},Z.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=su(n,t);if(e<r&&Gf(n[e],t))return e}return-1},Z.sortedLastIndex=function(n,t){return su(n,t,!0)},Z.sortedLastIndexBy=function(n,t,r){return hu(n,t,mi(r,2),!0)},Z.sortedLastIndexOf=function(n,t){if(null!=n&&n.length){var r=su(n,t,!0)-1;if(Gf(n[r],t))return r}return-1},Z.startCase=Jh,Z.startsWith=function(n,t,r){return n=Ec(n),r=null==r?0:Mr(kc(r),0,n.length),t=vu(t),n.slice(r,r+t.length)==t},Z.subtract=gp,Z.sum=function(n){return n&&n.length?k(n,La):0},Z.sumBy=function(n,t){return n&&n.length?k(n,mi(t,2)):0},Z.template=function(n,t,r){var e=Z.templateSettings;r&&Ui(n,t,r)&&(t=X),n=Ec(n),t=Sh({},t,e,li);var u,i,o=Sh({},t.imports,e.imports,li),f=Pc(o),c=E(o,f),a=0,l=t.interpolate||Ht,s="__p += '",h=sl((t.escape||Ht).source+"|"+l.source+"|"+(l===It?Ft:Ht).source+"|"+(t.evaluate||Ht).source+"|$","g"),p="//# sourceURL="+(bl.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zr+"]")+"\n";n.replace(h,(function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(Jt,U),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t})),s+="';\n";var _=bl.call(t,"variable")&&t.variable;if(_){if(Dt.test(_))throw new fl("Invalid `variable` option passed into `_.template`")}else s="with (obj) {\n"+s+"\n}\n";s=(i?s.replace(dt,""):s).replace(bt,"$1").replace(wt,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";var v=Xh((function(){return cl(f,p+"return "+s).apply(X,c)}));if(v.source=s,rc(v))throw v;return v},Z.times=function(n,t){if((n=kc(n))<1||n>Wn)return[];var r=Un,e=Hl(n,Un);t=mi(t),n-=Un;for(var u=O(e,t);++r<n;)t(r);return u},Z.toFinite=Ac,Z.toInteger=kc,Z.toLength=Oc,Z.toLower=function(n){return Ec(n).toLowerCase()},Z.toNumber=Ic,Z.toSafeInteger=function(n){return n?Mr(kc(n),-Wn,Wn):0===n?n:0},Z.toString=Ec,Z.toUpper=function(n){return Ec(n).toUpperCase()},Z.trim=function(n,t,r){if((n=Ec(n))&&(r||t===X))return R(n);if(!n||!(t=vu(t)))return n;var e=G(n),u=G(t);return Ou(e,W(e,u),L(e,u)+1).join("")},Z.trimEnd=function(n,t,r){if((n=Ec(n))&&(r||t===X))return n.slice(0,H(n)+1);if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,0,L(e,G(t))+1).join("")},Z.trimStart=function(n,t,r){if((n=Ec(n))&&(r||t===X))return n.replace(Lt,"");if(!n||!(t=vu(t)))return n;var e=G(n);return Ou(e,W(e,G(t))).join("")},Z.truncate=function(n,t){var r=30,e="...";if(fc(t)){var u="separator"in t?t.separator:u;r="length"in t?kc(t.length):r,e="omission"in t?vu(t.omission):e}var i=(n=Ec(n)).length;if(T(n)){var o=G(n);i=o.length}if(r>=i)return n;var f=r-V(e);if(f<1)return e;var c=o?Ou(o,0,f).join(""):n.slice(0,f);if(u===X)return c+e;if(o&&(f+=c.length-f),Ah(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=sl(u.source,Ec(Nt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index;c=c.slice(0,s===X?f:s)}}else if(n.indexOf(vu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e},Z.unescape=function(n){return(n=Ec(n))&&jt.test(n)?n.replace(mt,ye):n},Z.uniqueId=function(n){var t=++wl;return Ec(n)+t},Z.upperCase=Yh,Z.upperFirst=Qh,Z.each=_f,Z.eachRight=vf,Z.first=bo,Ta(Z,function(){var n={};return ue(Z,(function(t,r){bl.call(Z.prototype,r)||(n[r]=t)})),n}(),{chain:!1}),Z.VERSION="4.17.21",r(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Z[n].placeholder=Z})),r(["drop","take"],(function(n,t){Ct.prototype[n]=function(r){r=r===X?1:Gl(kc(r),0);var e=this.__filtered__&&!t?new Ct(this):this.clone();return e.__filtered__?e.__takeCount__=Hl(r,e.__takeCount__):e.__views__.push({size:Hl(r,Un),type:n+(e.__dir__<0?"Right":"")}),e},Ct.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}})),r(["filter","map","takeWhile"],(function(n,t){var r=t+1,e=1==r||3==r;Ct.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:mi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}})),r(["head","last"],(function(n,t){var r="take"+(t?"Right":"");Ct.prototype[n]=function(){return this[r](1).value()[0]}})),r(["initial","tail"],(function(n,t){var r="drop"+(t?"":"Right");Ct.prototype[n]=function(){return this.__filtered__?new Ct(this):this[r](1)}})),Ct.prototype.compact=function(){return this.filter(La)},Ct.prototype.find=function(n){return this.filter(n).head()},Ct.prototype.findLast=function(n){return this.reverse().find(n)},Ct.prototype.invokeMap=uu((function(n,t){return"function"==typeof n?new Ct(this):this.map((function(r){return Ie(r,n,t)}))})),Ct.prototype.reject=function(n){return this.filter(Uf(mi(n)))},Ct.prototype.slice=function(n,t){n=kc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ct(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==X&&(r=(t=kc(t))<0?r.dropRight(-t):r.take(t-n)),r)},Ct.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ct.prototype.toArray=function(){return this.take(Un)},ue(Ct.prototype,(function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Z[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(Z.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ct,c=o[0],l=f||bh(t),s=function(n){var t=u.apply(Z,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Ct(this);var g=n.apply(t,o);return g.__actions__.push({func:nf,args:[s],thisArg:X}),new Y(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})})),r(["pop","push","shift","sort","splice","unshift"],(function(n){var t=_l[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Z.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(bh(u)?u:[],n)}return this[r]((function(r){return t.apply(bh(r)?r:[],n)}))}})),ue(Ct.prototype,(function(n,t){var r=Z[t];if(r){var e=r.name+"";bl.call(fs,e)||(fs[e]=[]),fs[e].push({name:t,func:r})}})),fs[Qu(X,2).name]=[{name:"wrapper",func:X}],Ct.prototype.clone=function(){var n=new Ct(this.__wrapped__);return n.__actions__=Tu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Tu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Tu(this.__views__),n},Ct.prototype.reverse=function(){if(this.__filtered__){var n=new Ct(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Ct.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=bh(n),e=t<0,u=r?n.length:0,i=function(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=Hl(t,n+o);break;case"takeRight":n=Gl(n,t-o)}}return{start:n,end:t}}(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Hl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return wu(n,this.__actions__);var _=[];n:for(;c--&&h<p;){for(var v=-1,g=n[a+=t];++v<s;){var y=l[v],d=y.iteratee,b=y.type,w=d(g);if(2==b)g=w;else if(!w){if(1==b)continue n;break n}}_[h++]=g}return _},Z.prototype.at=Qs,Z.prototype.chain=function(){return Qo(this)},Z.prototype.commit=function(){return new Y(this.value(),this.__chain__)},Z.prototype.next=function(){this.__values__===X&&(this.__values__=jc(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?X:this.__values__[this.__index__++]}},Z.prototype.plant=function(n){for(var t,r=this;r instanceof J;){var e=eo(r);e.__index__=0,e.__values__=X,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t},Z.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Ct){var t=n;return this.__actions__.length&&(t=new Ct(this)),(t=t.reverse()).__actions__.push({func:nf,args:[Eo],thisArg:X}),new Y(t,this.__chain__)}return this.thru(Eo)},Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=function(){return wu(this.__wrapped__,this.__actions__)},Z.prototype.first=Z.prototype.head,Ul&&(Z.prototype[Ul]=function(){return this}),Z}();re._=be,void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return be}.call(exports,__webpack_require__,exports,module))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}.call(this)},632:module=>{"use strict";module.exports=MailPoet},296:module=>{"use strict";module.exports=MailPoetLib.Automation},990:module=>{"use strict";module.exports=MailPoetLib.Common},401:module=>{"use strict";module.exports=MailPoetLib.Hooks},525:module=>{"use strict";module.exports=MailPoetLib.Listing},862:module=>{"use strict";module.exports=MailPoetLib.React},813:module=>{"use strict";module.exports=MailPoetLib.ReactJsxRuntime},225:module=>{"use strict";module.exports=MailPoetLib.ReactStringReplace},54:module=>{"use strict";module.exports=MailPoetLib.WordPressData},394:module=>{"use strict";module.exports=MailPoetLib.WordPressI18n},64:module=>{"use strict";module.exports=MailPoetLib.WordPressIcons},414:module=>{"use strict";module.exports=MailPoetLib.WordpressComponentsButton},655:module=>{"use strict";module.exports=MailPoetLib.WordpressComponentsSelectControl},282:module=>{"use strict";module.exports=MailPoetLib.WordpressComponentsTextControl}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.nmd=module=>(module.paths=[],module.children||(module.children=[]),module),(()=>{"use strict";var actions_namespaceObject={};__webpack_require__.r(actions_namespaceObject),__webpack_require__.d(actions_namespaceObject,{addTag:()=>addTag,createTag:()=>createTag});var selectors_namespaceObject={};__webpack_require__.r(selectors_namespaceObject),__webpack_require__.d(selectors_namespaceObject,{getTagById:()=>getTagById,getTagByName:()=>getTagByName,getTags:()=>getTags,getTagsByIds:()=>getTagsByIds});var store=__webpack_require__(643),external_MailPoetLib_React_=__webpack_require__(862),external_MailPoetLib_WordPressData_=__webpack_require__(54),external_MailPoetLib_Hooks_=__webpack_require__(401),external_MailPoetLib_WordPressI18n_=__webpack_require__(394),external_MailPoetLib_WordPressIcons_=__webpack_require__(64),external_MailPoetLib_WordpressComponentsButton_=__webpack_require__(414),external_MailPoetLib_WordpressComponentsButton_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsButton_);const FilterContext=(0,external_MailPoetLib_React_.createContext)(null);var external_MailPoetLib_Automation_=__webpack_require__(296),external_MailPoetLib_WordpressComponentsSelectControl_=__webpack_require__(655),external_MailPoetLib_WordpressComponentsSelectControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsSelectControl_),external_MailPoetLib_ReactJsxRuntime_=__webpack_require__(813);function Condition({field}){const{condition,setArgs,setCondition}=(0,external_MailPoetLib_React_.useContext)(FilterContext),filter=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>select(store.Hz).getRegistry().filters[field.type]),[field.type]),conditions=filter?.conditions??[],defaultValue=conditions[0]?.key;return(0,external_MailPoetLib_React_.useEffect)((()=>{void 0===condition&&void 0!==defaultValue&&setCondition(defaultValue)}),[condition,defaultValue,setCondition]),conditions.length<=1?null:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{value:condition,onChange:value=>{setArgs(void 0),setCondition(value)},children:conditions.map((({key,label})=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:key,children:label},key)))})})}const getParentSteps=(step,stepMap)=>{const parentSteps=[];return Object.values(stepMap).forEach((s=>{s.next_steps.find((({id})=>id===step.id))&&parentSteps.push(s)})),[...parentSteps,...parentSteps.flatMap((s=>getParentSteps(s,stepMap)))]};function Field({step,value,onSelect}){const{steps,subjects,fields,stepMap}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({steps:(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getRegistry().steps,subjects:s(store.Hz).getRegistry().subjects,fields:s(store.Hz).getRegistry().fields,stepMap:s(store.Hz).getAutomationData().steps}))),subjectKeys=(0,external_MailPoetLib_React_.useMemo)((()=>{const triggers=[step,...getParentSteps(step,stepMap)].filter((({type})=>"trigger"===type));return triggers.length>0?triggers.map((({key})=>steps[key]?.subject_keys??[])).reduce(((all,keys)=>all.filter((key=>keys.includes(key))))):[]}),[step,steps,stepMap]);return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{value:value??"",onChange:onSelect,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"",disabled:!0,children:(0,external_MailPoetLib_WordPressI18n_.__)("Select criteria","mailpoet-premium")}),subjectKeys.map((key=>{const subject=subjects[key];return subject&&0!==subject.field_keys.length?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("optgroup",{label:subject.name,children:subject.field_keys.map((fieldKey=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:fieldKey,children:fields[fieldKey].name},fieldKey)))},subject.key):null}))]})}function Value({field,args,onChange}){const{filterType}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({filterType:select(store.Hz).getFilterType(field.type)})),[field]),Edit=filterType?.edit;return Edit?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Edit,{field,args,onChange}):(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"mailpoet-automation-filter-settings-not-supported",children:(0,external_MailPoetLib_WordPressI18n_.__)("Filtering by this field is not supported.","mailpoet-premium")})}function Settings({step,filter,onChange,onClose}){const{condition,args,setArgs,setCondition}=(0,external_MailPoetLib_React_.useContext)(FilterContext),[selectedField,setSelectedField]=(0,external_MailPoetLib_React_.useState)(filter?.field_key),{field,filterType}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>{const fieldData=select(store.Hz).getRegistry().fields[selectedField];return{field:fieldData,filterType:fieldData?select(store.Hz).getFilterType(fieldData.type):void 0}}),[selectedField]),isValid=args&&condition&&field&&filterType?.validateArgs(args,condition,field);return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-automation-filter-settings",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-automation-filter-settings-content",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Field,{step,value:selectedField,onSelect:value=>{setArgs(void 0),setCondition(void 0),setSelectedField(value)}}),selectedField&&(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Condition,{field}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Value,{field,args:args??{},onChange:setArgs})]})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-automation-filter-settings-footer",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{variant:"secondary",disabled:!isValid,onClick:()=>isValid&&onChange({id:filter?.id??(0,external_MailPoetLib_Automation_.id)(),field_type:field.type,field_key:field.key,condition,args}),children:(0,external_MailPoetLib_WordPressI18n_.__)("Save","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{variant:"tertiary",onClick:onClose,children:(0,external_MailPoetLib_WordPressI18n_.__)("Cancel","mailpoet-premium")})]})]})}function FilterSettings({step,filter,onChange,onClose}){const[context,setContext]=(0,external_MailPoetLib_React_.useState)({condition:filter?.condition,args:filter?.args,setCondition:condition=>{setContext((prev=>({...prev,condition})))},setArgs:args=>{setContext((prev=>({...prev,args})))}});return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(FilterContext.Provider,{value:context,children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Settings,{step,filter,onChange,onClose})})}function FilterSelector({step,strings,onChange}){const[showSelector,setShowSelector]=(0,external_MailPoetLib_React_.useState)(!1),{addStepFilter}=(0,external_MailPoetLib_WordPressData_.useDispatch)(store.Hz);return showSelector?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(FilterSettings,{step,onChange:data=>{addStepFilter(step.id,data),setShowSelector(!1),onChange?.(data)},onClose:()=>setShowSelector(!1)}):(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{className:"mailpoet-automation-filters-panel-add-filter",variant:"secondary",icon:external_MailPoetLib_WordPressIcons_.plus,onClick:()=>setShowSelector(!0),children:strings.addFilter})}const external_MailPoetLib_WordpressComponentsRadioControl_namespaceObject=MailPoetLib.WordpressComponentsRadioControl;var external_MailPoetLib_WordpressComponentsRadioControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsRadioControl_namespaceObject);const values=new Map([[!0,"yes"],[!1,"no"]]),options=[{label:(0,external_MailPoetLib_WordPressI18n_.__)("Yes","mailpoet-premium"),value:values.get(!0)},{label:(0,external_MailPoetLib_WordPressI18n_.__)("No","mailpoet-premium"),value:values.get(!1)}];function BooleanValue({args,onChange}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsRadioControl_default(),{options,selected:values.get(args.value)??"",onChange:value=>onChange({value:"yes"===value})})}const external_MailPoetLib_WordpressComponentsDatePicker_namespaceObject=MailPoetLib.WordpressComponentsDatePicker;var external_MailPoetLib_WordpressComponentsDatePicker_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsDatePicker_namespaceObject);const external_MailPoetLib_WordPressDate_namespaceObject=MailPoetLib.WordPressDate,external_MailPoetLib_WordpressComponentsDropdown_namespaceObject=MailPoetLib.WordpressComponentsDropdown;var external_MailPoetLib_WordpressComponentsDropdown_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsDropdown_namespaceObject);function DateControl({value,onChange}){const settings=(0,external_MailPoetLib_React_.useMemo)((()=>(0,external_MailPoetLib_WordPressDate_namespaceObject.getSettings)()),[]),label=value?(0,external_MailPoetLib_WordPressDate_namespaceObject.dateI18n)(settings.formats.date,value,settings.timezone.string):(0,external_MailPoetLib_WordPressI18n_.__)("Set date","mailpoet-premium");return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-automation-filter-value-datetime",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsDropdown_default(),{renderToggle:({isOpen,onToggle})=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{className:"mailpoet-automation-filter-value-datetime-toggle-button",variant:"tertiary","aria-expanded":isOpen,"aria-label":value?(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_.__)("Change date: %s"),label):label,onClick:onToggle,icon:external_MailPoetLib_WordPressIcons_.calendar,iconSize:16,children:label}),renderContent:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsDatePicker_default(),{startOfWeek:settings.l10n.startOfWeek,currentDate:value,onChange:newValue=>{onChange(newValue.split("T")[0])}})})})}const external_MailPoetLib_WordpressComponentsDateTimePicker_namespaceObject=MailPoetLib.WordpressComponentsDateTimePicker;var external_MailPoetLib_WordpressComponentsDateTimePicker_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsDateTimePicker_namespaceObject);const is12HourTime=()=>/a(?!\\)/i.test((0,external_MailPoetLib_WordPressDate_namespaceObject.getSettings)().formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));function DateTimeControl({value,onChange}){const{settings,is12Hour}=(0,external_MailPoetLib_React_.useMemo)((()=>({settings:(0,external_MailPoetLib_WordPressDate_namespaceObject.getSettings)(),is12Hour:is12HourTime()})),[]),label=value?(0,external_MailPoetLib_WordPressDate_namespaceObject.dateI18n)(settings.formats.datetime,value,settings.timezone.string):(0,external_MailPoetLib_WordPressI18n_.__)("Set date/time","mailpoet-premium");return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-automation-filter-value-datetime",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsDropdown_default(),{renderToggle:({isOpen,onToggle})=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{className:"mailpoet-automation-filter-value-datetime-toggle-button",variant:"tertiary","aria-expanded":isOpen,"aria-label":value?(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_.__)("Change date: %s"),label):label,onClick:onToggle,icon:external_MailPoetLib_WordPressIcons_.calendar,iconSize:16,children:label}),renderContent:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsDateTimePicker_default(),{startOfWeek:settings.l10n.startOfWeek,is12Hour,currentDate:value,onChange})})})}const external_MailPoetLib_ClassNames_namespaceObject=MailPoetLib.ClassNames;var external_MailPoetLib_ClassNames_default=__webpack_require__.n(external_MailPoetLib_ClassNames_namespaceObject);const external_MailPoetLib_WordpressComponentsNumberControl_namespaceObject=MailPoetLib.WordpressComponentsNumberControl;var external_MailPoetLib_WordpressComponentsNumberControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsNumberControl_namespaceObject);function NumberControl({className,onChange,step,value,...props}){const ref=(0,external_MailPoetLib_React_.useRef)(null),handleChange=(0,external_MailPoetLib_React_.useCallback)((newValue=>{const number=Number(newValue),isValid=!Number.isNaN(number)&&`${newValue}`.trim().length>0;onChange(isValid&&("any"===step||number%step==0)?number:void 0)}),[onChange,step]);return(0,external_MailPoetLib_React_.useEffect)((()=>{const element=ref.current,eventListener=event=>event.preventDefault();return element?.addEventListener("wheel",eventListener),()=>element?.removeEventListener("wheel",eventListener)}),[]),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsNumberControl_default(),{ref,className:external_MailPoetLib_ClassNames_default()("mailpoet-automation-number-control",className),type:"number",step,value:value??ref.current?.value??"",onChange:handleChange,__next36pxDefaultSize:!0,...props})}function RelativeControl({value,onChange}){const{condition}=(0,external_MailPoetLib_React_.useContext)(FilterContext),[currentValue,setCurrentValue]=(0,external_MailPoetLib_React_.useState)(value),handleChange=(0,external_MailPoetLib_React_.useCallback)((newValue=>{setCurrentValue(newValue);const isValid="number"==typeof newValue.number&&"string"==typeof newValue.unit&&newValue.number>0;onChange(isValid?newValue:void 0)}),[onChange]);return(0,external_MailPoetLib_React_.useEffect)((()=>{handleChange({number:void 0,unit:"days"})}),[condition,handleChange]),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-automation-filter-value-datetime-relative",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(NumberControl,{step:1,min:1,value:currentValue?.number,onChange:newValue=>handleChange({number:newValue,unit:currentValue?.unit})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{onChange:newValue=>handleChange({number:currentValue?.number,unit:newValue}),children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"days",children:(0,external_MailPoetLib_WordPressI18n_.__)("days","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"weeks",children:(0,external_MailPoetLib_WordPressI18n_.__)("weeks","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"months",children:(0,external_MailPoetLib_WordPressI18n_.__)("months","mailpoet-premium")})]})]})}const external_MailPoetLib_WordpressComponentsCheckboxControl_namespaceObject=MailPoetLib.WordpressComponentsCheckboxControl;var external_MailPoetLib_WordpressComponentsCheckboxControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsCheckboxControl_namespaceObject);function WeekDaysControl({value,onChange}){const settings=(0,external_MailPoetLib_React_.useMemo)((()=>(0,external_MailPoetLib_WordPressDate_namespaceObject.getSettings)()),[]),handleChange=(0,external_MailPoetLib_React_.useCallback)(((day,checked)=>{const days=checked?[...value??[],day]:(value??[]).filter((d=>d!==day)),newValue=[...new Set(days)].sort();onChange(newValue.length>0?newValue:void 0)}),[onChange,value]);return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-automation-filter-value-datetime-weekdays",children:Array.from({length:7},((_,i)=>(settings.l10n.startOfWeek+i)%7)).map((day=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsCheckboxControl_default(),{label:settings.l10n.weekdays[day],checked:value?.includes(day)??!1,onChange:checked=>handleChange(day,checked)},day)))})}const getDateTimeValue=value=>{if("string"!=typeof value&&!(value instanceof String))return;const string=value.toString();return!Number.isNaN(new Date(string).getTime())?value.toString():void 0},getRelativeValue=value=>{const record=value,number=record?.number,unit=record?.unit;return"number"==typeof number&&["days","weeks","months"].includes(unit)?value:void 0},getWeekDaysValue=value=>Array.isArray(value)&&!value.some((n=>"number"!=typeof n||n<0||n>6))?value:void 0;function DateTimeValue({args,onChange}){const{condition}=(0,external_MailPoetLib_React_.useContext)(FilterContext),handleChange=(0,external_MailPoetLib_React_.useCallback)((newValue=>{onChange(void 0===newValue?void 0:{value:newValue})}),[onChange]),isEmpty="is-set"===condition||"is-not-set"===condition;if((0,external_MailPoetLib_React_.useEffect)((()=>{isEmpty&&onChange({})}),[condition,isEmpty,onChange]),isEmpty)return null;const value=args?.value;return"on"===condition||"not-on"===condition?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(DateControl,{value:getDateTimeValue(value),onChange:handleChange}):"in-the-last"===condition||"not-in-the-last"===condition?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(RelativeControl,{value:getRelativeValue(value),onChange:handleChange}):"on-the-days-of-the-week"===condition?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(WeekDaysControl,{value:getWeekDaysValue(value),onChange:handleChange}):(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(DateTimeControl,{value:getDateTimeValue(value),onChange:handleChange})}const external_MailPoetLib_WordpressComponentsFormTokenField_namespaceObject=MailPoetLib.WordpressComponentsFormTokenField;var external_MailPoetLib_WordpressComponentsFormTokenField_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsFormTokenField_namespaceObject);function InTheLastParam({value,onChange}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-automation-filter-params-in-the-last",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{value:void 0===value?"all-time":"in-the-last",onChange:newValue=>{onChange("all-time"===newValue?void 0:{number:void 0,unit:"days"})},children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"all-time",children:(0,external_MailPoetLib_WordPressI18n_.__)("over all time","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"in-the-last",children:(0,external_MailPoetLib_WordPressI18n_.__)("in the last","mailpoet-premium")})]}),value&&(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(NumberControl,{className:"mailpoet-automation-filter-params-in-the-last-value",step:1,min:1,value:value.number,onChange:newValue=>{onChange({number:newValue,unit:"days"})}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("span",{children:(0,external_MailPoetLib_WordPressI18n_.__)("days","mailpoet-premium")})]})]})}function EnumArrayValue({field,args,onChange}){const options=(0,external_MailPoetLib_React_.useMemo)((()=>field.args.options??[]),[field.args.options]),getId=(0,external_MailPoetLib_React_.useCallback)((name=>options.find((option=>option.name===name))?.id),[options]),getName=(0,external_MailPoetLib_React_.useCallback)((id=>options.find((option=>option.id===id))?.name),[options]),onValueChange=(0,external_MailPoetLib_React_.useCallback)((value=>onChange({...args,value})),[args,onChange]),onInTheLastParamChange=(0,external_MailPoetLib_React_.useCallback)((value=>{if(void 0===value){const newValue={...args};delete newValue.params,onChange(newValue)}else onChange({...args,params:{...args.params,in_the_last:value}})}),[args,onChange]);return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-automation-filter-value-enum-array",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsFormTokenField_default(),{__experimentalExpandOnFocus:!0,__experimentalAutoSelectFirstMatch:!0,value:(args.value??[]).map(getName),suggestions:options.map((({name})=>name)),onChange:values=>{const newValues=values.map(getId).filter((id=>!!id));onValueChange(newValues.length>0?newValues:void 0)},placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Select one or more values…","mailpoet-premium")}),(field.args?.params??[]).includes("in_the_last")&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(InTheLastParam,{value:args.params?.in_the_last,onChange:onInTheLastParamChange})]})}function Between({value,onChange,step}){const{condition}=(0,external_MailPoetLib_React_.useContext)(FilterContext),[[from,to],setState]=(0,external_MailPoetLib_React_.useState)(value??[void 0,void 0]),[key,setKey]=(0,external_MailPoetLib_React_.useState)(condition);(0,external_MailPoetLib_React_.useEffect)((()=>{setState([void 0,void 0]),setKey(condition)}),[condition]);const handleChange=(0,external_MailPoetLib_React_.useCallback)((newValue=>{setState(newValue);const isValid="number"==typeof newValue[0]&&"number"==typeof newValue[1]&&newValue[0]<newValue[1];onChange(isValid?newValue:void 0)}),[onChange]);return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_React_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(NumberControl,{placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("From","mailpoet-premium"),step,value:from,onChange:newValue=>handleChange([newValue,to])}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(NumberControl,{placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("To","mailpoet-premium"),step,value:to,onChange:newValue=>handleChange([from,newValue])})]},key)}function value_Value({value,onChange,step="any"}){const{condition}=(0,external_MailPoetLib_React_.useContext)(FilterContext),isEmpty="is-set"===condition||"is-not-set"===condition,isTuple="between"===condition||"not-between"===condition;if((0,external_MailPoetLib_React_.useEffect)((()=>{isEmpty&&onChange(void 0)}),[condition,isEmpty,onChange]),isEmpty)return null;if(isTuple){const tupleValue=Array.isArray(value)&&2===value.length?value:[void 0,void 0];return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Between,{step,value:tupleValue,onChange})}return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(NumberControl,{step,value:"number"==typeof value?value:void 0,onChange:newValue=>onChange(newValue)},condition)}function NumberValue({field,args,onChange,step}){const onValueChange=(0,external_MailPoetLib_React_.useCallback)((value=>onChange({...args,value})),[args,onChange]),onInTheLastParamChange=(0,external_MailPoetLib_React_.useCallback)((value=>{if(void 0===value){const newValue={...args};delete newValue.params,onChange(newValue)}else onChange({...args,params:{...args.params,in_the_last:value}})}),[args,onChange]);return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(value_Value,{step,value:args.value,onChange:onValueChange}),(field.args?.params??[]).includes("in_the_last")&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(InTheLastParam,{value:args.params?.in_the_last,onChange:onInTheLastParamChange})]})}var external_MailPoetLib_WordpressComponentsTextControl_=__webpack_require__(282),external_MailPoetLib_WordpressComponentsTextControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsTextControl_);function StringValue({args,onChange}){const{condition}=(0,external_MailPoetLib_React_.useContext)(FilterContext),isEmpty="is-blank"===condition||"is-not-blank"===condition;return(0,external_MailPoetLib_React_.useEffect)((()=>{isEmpty&&onChange({})}),[condition,isEmpty,onChange]),isEmpty?null:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{value:args.value??"",onChange:value=>onChange(value.length>0?{value}:void 0)})}function FilterWrapper({step,filter,editable,children}){const[editing,setEditing]=(0,external_MailPoetLib_React_.useState)(!1),{updateStepFilter,deleteStepFilter}=(0,external_MailPoetLib_WordPressData_.useDispatch)(store.Hz);return editing?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(FilterSettings,{step,filter,onChange:data=>{updateStepFilter(step.id,data),setEditing(!1)},onClose:()=>setEditing(!1)}):(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{className:"mailpoet-automation-filters-list-item-content",disabled:!editable,onClick:()=>setEditing(!0),children}),editable&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{className:"mailpoet-automation-filters-list-item-remove",isSmall:!0,onClick:()=>deleteStepFilter(step.id,filter),children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordPressIcons_.Icon,{icon:external_MailPoetLib_WordPressIcons_.closeSmall})})]})}const{storeName}=external_MailPoetLib_Automation_.EditorStore;function SeparatorWrapper({step,children}){const ref=(0,external_MailPoetLib_React_.useRef)(),{newStepIds,deletingStepIds}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({newStepIds:select(storeName).getNewStepIds(),deletingStepIds:select(storeName).getDeletingStepIds()})),[]),isNew=newStepIds.has(step.id),isDeleting=deletingStepIds.has(step.id),isTrigger="trigger"===step.type;return(0,external_MailPoetLib_React_.useEffect)((()=>{isDeleting&&!isTrigger&&(ref.current.style.height=`${ref.current.clientHeight}px`,setTimeout((()=>{ref.current.style.height="0"})))}),[isDeleting,isTrigger]),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{ref,className:external_MailPoetLib_ClassNames_default()({"mailpoet-automation-editor-separator-transition-wrapper":!0,animate:isNew,deleted:isDeleting,"is-trigger":isTrigger}),children})}const{storeName:step_wrapper_storeName}=external_MailPoetLib_Automation_.EditorStore;function StepWrapper({step,children}){const ref=(0,external_MailPoetLib_React_.useRef)(),{newStepIds,deletingStepIds}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({newStepIds:select(step_wrapper_storeName).getNewStepIds(),deletingStepIds:select(step_wrapper_storeName).getDeletingStepIds()})),[step]),{deleteStep}=(0,external_MailPoetLib_WordPressData_.useDispatch)(step_wrapper_storeName);return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{ref,"data-step-id":step.id,className:external_MailPoetLib_ClassNames_default()({"mailpoet-automation-editor-step-transition-wrapper":!0,animate:newStepIds.has(step.id),deleting:deletingStepIds.has(step.id),"is-trigger":"trigger"===step.type}),onTransitionEnd:event=>{event.target===ref.current&&(deleteStep(step.id),newStepIds.delete(step.id))},children})}const external_MailPoetLib_WordpressComponentsConfirmDialog_namespaceObject=MailPoetLib.WordpressComponentsConfirmDialog;const ConfirmDialog=__webpack_require__.n(external_MailPoetLib_WordpressComponentsConfirmDialog_namespaceObject)();function DeleteMenuItem({isOpen,stepData,step,onClose}){let question=(0,external_MailPoetLib_WordPressI18n_.__)("Are you sure you want to delete this step? This action cannot be undone.","mailpoet-premium");return step&&(question=(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_.__)('Are you sure you want to delete the following step: "%s"? This action cannot be undone.',"mailpoet-premium"),stepData?.args?.name??step?.title)),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ConfirmDialog,{isOpen,title:(0,external_MailPoetLib_WordPressI18n_.__)("Delete this step?","mailpoet-premium"),confirmButtonText:(0,external_MailPoetLib_WordPressI18n_.__)("Delete step","mailpoet-premium"),onConfirm:()=>function(stepData){if("trigger"!==stepData.type){const wrapper=document.querySelector(`.mailpoet-automation-editor-step-transition-wrapper[data-step-id="${stepData.id}"]`);wrapper.style.height=`${wrapper.clientHeight}px`,setTimeout((()=>{wrapper.style.height="0"}))}(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).markStepForDeletion(stepData.id)}(stepData),onCancel:()=>{onClose()},__experimentalHideHeader:!1,children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:question})})}const external_MailPoetLib_Slugify_namespaceObject=MailPoetLib.Slugify;var external_MailPoetLib_Slugify_default=__webpack_require__.n(external_MailPoetLib_Slugify_namespaceObject);const generateGaCampaignName=(id,subject)=>`${external_MailPoetLib_Slugify_default()(subject,{strict:!0,lower:!0})||"email"}-${id}`;let prevSubject;function GoogleAnalyticsPanel(){const{error,selectedStep}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep(),error:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)?.fields?.ga_campaign})),[]),{updateStepArgs}=(0,external_MailPoetLib_WordPressData_.useDispatch)(store.Hz);(()=>{const{subject}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({subject:select(store.Hz).getSelectedStep().args?.subject})),[]),{updateStepArgs}=(0,external_MailPoetLib_WordPressData_.useDispatch)(store.Hz);(0,external_MailPoetLib_React_.useEffect)((()=>{const automationId=(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getAutomationData().id,selectedStep=(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getSelectedStep(),gaCampaign=selectedStep.args?.ga_campaign,currentSubject=prevSubject??subject;prevSubject=subject;const prevDefaultGaCampaign=generateGaCampaignName(automationId,currentSubject);if(!gaCampaign||gaCampaign===prevDefaultGaCampaign){const value=generateGaCampaignName(automationId,subject);value!==gaCampaign&&updateStepArgs(selectedStep.id,"ga_campaign",value)}}),[subject,updateStepArgs])})();const gaCampaign=selectedStep.args?.ga_campaign;return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{className:error?"mailpoet-automation-field__error":"",label:"Campaign",placeholder:"campaign-name",required:!0,value:gaCampaign??"",onChange:value=>updateStepArgs(selectedStep.id,"ga_campaign",value),help:error??""})}const constants_storeName="tags",external_MailPoetLib_WordPressDataControls_namespaceObject=MailPoetLib.WordPressDataControls;function addTag(tag){return{type:"ADD_TAG",value:tag}}function*createTag(name,callback){const url=`${window.mailpoet_json_api.root}`,token=window.mailpoet_token,body=new FormData;body.append("token",token),body.append("action","mailpoet"),body.append("api_version","v1"),body.append("endpoint","tags"),body.append("method","create"),body.append("data[name]",name);const data=yield(0,external_MailPoetLib_WordPressDataControls_namespaceObject.apiFetch)({url,method:"POST",body}),tag=data?.data;yield{type:"ADD_TAG",value:tag},callback(tag)}function reducer(state,action){switch(action.type){case"ADD_TAG":return{...state,tags:[...state.tags,action.value]};case"SET_TAGS":return{...state,tags:action.value};default:return state}}function getTags(state){return state.tags}function getTagById(state,tagId){return state.tags?state.tags.find((({id})=>tagId===id)):void 0}function getTagsByIds(state,tagIds){return tagIds.map((id=>getTagById(state,id))).filter((tag=>void 0!==tag))}function getTagByName(state,tagName){return state.tags?state.tags.find((({name})=>tagName===name)):void 0}const external_MailPoetLib_WordpressComponentsPanelBody_namespaceObject=MailPoetLib.WordpressComponentsPanelBody;var external_MailPoetLib_WordpressComponentsPanelBody_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsPanelBody_namespaceObject);const external_MailPoetLib_AutomationEditorComponents_namespaceObject=MailPoetLib.AutomationEditorComponents,external_MailPoetLib_WordpressComponentsSpinner_namespaceObject=MailPoetLib.WordpressComponentsSpinner;var external_MailPoetLib_WordpressComponentsSpinner_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsSpinner_namespaceObject);const generateSearchItems=values=>[...new Set(values.map((({name})=>name)))].map((name=>(0,external_MailPoetLib_WordPressData_.select)(constants_storeName).getTagByName(name)??{id:name,name}));function AddTagPanel({onChange,selected,error,label,placeholder}){const{tags}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({tags:s(constants_storeName).getTags()})),[]),[search,setSearch]=(0,external_MailPoetLib_React_.useState)([...tags]),[isBusy,setIsBusy]=(0,external_MailPoetLib_React_.useState)(!1);return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Settings","mailpoet-premium")}),isBusy&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{style:{position:"absolute",right:"5px"},children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsSpinner_default(),{})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:error?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label,placeholder,value:selected,disabled:isBusy,suggestions:isBusy?[]:search,onChange:values=>{!async function(values,setIsBusy,updateCallback){setIsBusy(!0);const tags=values.filter((({id})=>"string"!=typeof id)),createCallback=tag=>{tags.push(tag)},tagsToCreate=values.filter((({id})=>"string"==typeof id));await Promise.all((tagsToCreate??[]).map((item=>(0,external_MailPoetLib_WordPressData_.dispatch)(constants_storeName).createTag(item.name,createCallback)))),updateCallback(tags),setIsBusy(!1)}(values,setIsBusy,onChange)},onInputChange:value=>{setSearch(generateSearchItems([...tags??[],...selected,{id:value,name:value}]))}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:error})]})]})}function SkipTriggersCheckbox({helpText}){const{selectedStep}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep()})),[]),{updateStepArgs}=(0,external_MailPoetLib_WordPressData_.useDispatch)(store.Hz),isChecked=!0===selectedStep.args?.skip_triggers;return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsCheckboxControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Do not trigger automations","mailpoet-premium"),help:helpText,checked:isChecked,onChange:value=>updateStepArgs(selectedStep.id,"skip_triggers",value)})}function Edit(){const{selectedStep,selected,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),selected:s(constants_storeName).getTagsByIds(s(store.Hz).getSelectedStep().args?.tag_ids??[]),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),fields=errors?.fields??{},addTagFieldError=fields?.tag_ids??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(AddTagPanel,{onChange:tags=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"tag_ids",tags.map((item=>item.id)))},selected,error:addTagFieldError,label:(0,external_MailPoetLib_WordPressI18n_.__)("Tags to add","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Please select a tag","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SkipTriggersCheckbox,{helpText:(0,external_MailPoetLib_WordPressI18n_.__)("Adding a tag to a subscriber won't trigger other automations","mailpoet-premium")})})]})}const add_tag_step={key:"mailpoet:add-tag",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Add tag","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Add a tag or multiple tags to a subscriber.","mailpoet-premium"),subtitle:data=>{const tagIds=data.args.tag_ids;if(!tagIds||!tagIds.length)return(0,external_MailPoetLib_WordPressI18n_.__)("Not set up yet","mailpoet-premium");const tags=(0,external_MailPoetLib_WordPressData_.select)(constants_storeName).getTagsByIds(tagIds);return(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_._n)('Add the "%s" tag','Add "%s" tags',tags.length,"mailpoet-premium"),tags.map((t=>t.name)).join('", "'))},keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("tags","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("label","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("labels","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("add tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("add tags","mailpoet-premium")],foreground:"#00A32A",background:"#EDFAEF",icon:()=>external_MailPoetLib_WordPressIcons_.tag,edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Edit,{}),createStep:stepData=>stepData};function edit_Edit(){const{selectedStep,tags,selected,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep(),tags:select(constants_storeName).getTags(),selected:select(constants_storeName).getTagsByIds(select(store.Hz).getSelectedStep().args?.tag_ids??[]),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),fields=errors?.fields??{},removeTagFieldError=fields?.tag_ids??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Settings","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:removeTagFieldError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Tags to remove","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Please select a tag","mailpoet-premium"),value:selected,suggestions:tags,onChange:values=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"tag_ids",values.map((item=>item.id)))}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:removeTagFieldError})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SkipTriggersCheckbox,{helpText:(0,external_MailPoetLib_WordPressI18n_.__)("Removing a tag from a subscriber won't trigger other automations","mailpoet-premium")})]})}const remove_tag_step={key:"mailpoet:remove-tag",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Remove tag","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Remove a tag or multiple tags from a subscriber.","mailpoet-premium"),subtitle:data=>{const tagIds=data.args.tag_ids;if(!tagIds||!tagIds.length)return(0,external_MailPoetLib_WordPressI18n_.__)("Not set up yet","mailpoet-premium");const tags=(0,external_MailPoetLib_WordPressData_.select)(constants_storeName).getTagsByIds(tagIds);return(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_._n)('Remove the "%s" tag','Remove "%s" tags',tagIds.length,"mailpoet-premium"),tags.map((({name})=>name)).join('", "'))},keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("tags","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("label","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("labels","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("remove tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("remove tags","mailpoet-premium")],foreground:"#00A32A",background:"#EDFAEF",icon:()=>external_MailPoetLib_WordPressIcons_.tag,edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(edit_Edit,{}),createStep:stepData=>stepData},getContext=()=>(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getContext("mailpoet-premium"),getFreePluginContext=()=>(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getContext("mailpoet");function ListPanel(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep(),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),segmentIds=selectedStep.args?.segment_ids??[],all=getFreePluginContext().segments.filter((({type})=>"default"===type)),selected=all.filter((({id})=>segmentIds.includes(id))),segmentIdsError=errors?.fields?.segment_ids;return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Trigger settings","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:segmentIdsError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Lists to subscribe to:","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Please select a list","mailpoet-premium"),value:selected,suggestions:all,onChange:values=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"segment_ids",values.map((item=>item.id)))}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:segmentIdsError})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SkipTriggersCheckbox,{helpText:(0,external_MailPoetLib_WordPressI18n_.__)("Adding a subscriber to a list won't trigger other automations","mailpoet-premium")})]})}const add_to_list_step={key:"mailpoet:add-to-list",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Add to list","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Add a subscriber to a list.","mailpoet-premium"),subtitle:data=>{const allSegments=getFreePluginContext().segments,segmentIds=data.args.segment_ids,segments=allSegments.filter((({id})=>segmentIds.includes(id)));return segments&&segments.length?(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_._n)('Add to the "%s" list','Add to "%s" lists',segments.length,"mailpoet-premium"),segments.map((({name})=>name)).join('", "')):(0,external_MailPoetLib_WordPressI18n_.__)("Not set up yet","mailpoet-premium")},keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("list","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("add list","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("add to list","mailpoet-premium")],foreground:"#00A32A",background:"#EDFAEF",icon:()=>external_MailPoetLib_WordPressIcons_.list,edit:function(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ListPanel,{})}};function list_panel_ListPanel(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep(),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),segmentIds=selectedStep.args?.segment_ids??[],all=getFreePluginContext().segments.filter((({type})=>"default"===type)),selected=all.filter((({id})=>segmentIds.includes(id))),segmentIdsError=errors?.fields?.segment_ids;return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Trigger settings","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:segmentIdsError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Lists to unsubscribe from:","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Please select a list","mailpoet-premium"),value:selected,suggestions:all,onChange:values=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"segment_ids",values.map((item=>item.id)))}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:segmentIdsError})]})]})}const remove_from_list_step={key:"mailpoet:remove-from-list",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Remove from list","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Remove a subscriber from a list.","mailpoet-premium"),subtitle:data=>{const allSegments=getFreePluginContext().segments,segmentIds=data.args.segment_ids,segments=allSegments.filter((({id})=>segmentIds.includes(id)));return segments&&segments.length?(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_._n)('Remove from the "%s" list','Remove from "%s" lists',segments.length,"mailpoet-premium"),segments.map((({name})=>name)).join('", "')):(0,external_MailPoetLib_WordPressI18n_.__)("Not set up yet","mailpoet-premium")},keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("list","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("remove list","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("remove from list","mailpoet-premium")],foreground:"#00A32A",background:"#EDFAEF",icon:()=>external_MailPoetLib_WordPressIcons_.list,edit:function(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(list_panel_ListPanel,{})}},external_MailPoetLib_WordpressComponentsExternalLink_namespaceObject=MailPoetLib.WordpressComponentsExternalLink;var external_MailPoetLib_WordpressComponentsExternalLink_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsExternalLink_namespaceObject);const getType=field=>{switch(field.params.validate){case"alphanum":default:return"text";case"number":return"number";case"phone":return"tel"}},getPattern=field=>{switch(field.params.validate){case"alphanum":return"^[a-zA-Z0-9]+$";case"phone":return"^[-+#0-9() ]+$";default:return}};function ValueText({field,value,onChange,error}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{type:getType(field),pattern:getPattern(field),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Set custom field value…","mailpoet-premium"),value,onChange,help:error},field.id)}const external_MailPoetLib_WordpressComponentsTextareaControl_namespaceObject=MailPoetLib.WordpressComponentsTextareaControl;var external_MailPoetLib_WordpressComponentsTextareaControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsTextareaControl_namespaceObject);function ValueTextarea({field,value,onChange,error}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextareaControl_default(),{placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Set custom field value…","mailpoet-premium"),value,onChange,help:error},field.id)}function ValueCheckbox({field,value,onChange,error}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsCheckboxControl_default(),{label:field.params.values[0]?.value??"",checked:value,onChange,help:error})}function ValueRadio({field,value,onChange,error}){const options=field.params.values.map((({value:newValue})=>({label:newValue,value:newValue})));return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsRadioControl_default(),{options,selected:value,onChange,help:error})}function ValueSelect({field,value,onChange,error}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{value,onChange,help:error,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"",disabled:!0,children:(0,external_MailPoetLib_WordPressI18n_.__)("Select a value…","mailpoet-premium")}),field.params.values.map((({value:newValue})=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{label:newValue,value:newValue},newValue)))]})}const{locale}=external_MailPoetLib_Automation_.config;function YearSelect({value,onChange,error}){const currentYear=(new Date).getFullYear();return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Year","mailpoet-premium"),value:`${value??""}`,onChange:selected=>onChange(selected?parseInt(selected,10):void 0),help:error,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{label:(0,external_MailPoetLib_WordPressI18n_.__)("Select year…","mailpoet-premium"),disabled:!0}),Array.from({length:101},((_,i)=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:currentYear-i,label:""+(currentYear-i)},i)))]})}function MonthSelect({value,onChange,error}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Month","mailpoet-premium"),value:`${value??""}`,onChange:selected=>onChange(selected?parseInt(selected,10):void 0),help:error,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{label:(0,external_MailPoetLib_WordPressI18n_.__)("Select month…","mailpoet-premium"),disabled:!0}),Array.from({length:12},((_,i)=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:i+1,label:new Date(`2000-${(i+1).toString().padStart(2,"0")}-05T00:00:00+00:00`).toLocaleDateString(locale.toString(),{month:"long"})},i)))]})}function DaySelect({value,onChange,year,month,error}){const daysInMonth=new Date(year??2e3,month??0,0).getDate();return(0,external_MailPoetLib_React_.useEffect)((()=>{value>daysInMonth&&onChange(void 0)}),[daysInMonth,onChange,value]),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Day","mailpoet-premium"),value:`${value??""}`,onChange:selected=>onChange(selected?parseInt(selected,10):void 0),help:error,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{label:(0,external_MailPoetLib_WordPressI18n_.__)("Select day…","mailpoet-premium"),disabled:!0}),Array.from({length:daysInMonth},((_,i)=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:i+1,label:`${i+1}`},i)))]})}function ValueDate({field,value,onChange,error}){const dateType=field.params.date_type,onYearChange=(0,external_MailPoetLib_React_.useCallback)((year=>onChange({...value,date_type:dateType,year})),[dateType,onChange,value]),onMonthChange=(0,external_MailPoetLib_React_.useCallback)((month=>onChange({...value,date_type:dateType,month})),[dateType,onChange,value]),onDayChange=(0,external_MailPoetLib_React_.useCallback)((day=>onChange({...value,date_type:dateType,day})),[dateType,onChange,value]),yearError=void 0===value.year?error:void 0,monthError=void 0===value.month?error:void 0,dayError=void 0===value.day?error:void 0;switch(dateType){case"year_month_day":return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(YearSelect,{value:value.year,onChange:onYearChange,error:yearError}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(MonthSelect,{value:value.month,onChange:onMonthChange,error:monthError}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(DaySelect,{value:value.day,onChange:onDayChange,year:value.year,month:value.month,error:dayError})]});case"year_month":return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(YearSelect,{value:value.year,onChange:onYearChange,error:yearError}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(MonthSelect,{value:value.month,onChange:onMonthChange,error:monthError})]});case"year":return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(YearSelect,{value:value.year,onChange:onYearChange,error:yearError});case"month":return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(MonthSelect,{value:value.month,onChange:onMonthChange,error:monthError});case"day":return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(DaySelect,{value:value.day,onChange:onDayChange,error:dayError});default:return null}}function field_value_Field({field,data,onChange,error}){switch(field.type){case"text":{const value="text"===data?.type?data?.value??"":"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ValueText,{field,value,onChange,error})}case"textarea":{const value="textarea"===data?.type?data?.value??"":"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ValueTextarea,{field,value,onChange,error})}case"checkbox":{const value="checkbox"===data?.type&&!!data?.value;return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ValueCheckbox,{field,value,onChange,error})}case"radio":{const value="radio"===data?.type?data?.value??"":"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ValueRadio,{field,value,onChange,error})}case"select":{const value="select"===data?.type?data?.value??"":"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ValueSelect,{field,value,onChange,error})}case"date":{const value="date"===data?.type?data?.value??{}:{};return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ValueDate,{field,value,onChange,error})}default:return null}}function FieldValue({id}){const{step,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({step:select(store.Hz).getSelectedStep(),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),data=step.args?.custom_fields?.[0],error=errors?.fields?.custom_fields??void 0,field=getContext().custom_fields.find((({id:fieldId})=>fieldId===id)),setValue=(0,external_MailPoetLib_React_.useCallback)((newValue=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(step.id,"custom_fields",[{id,type:field.type,value:newValue}])}),[id,field.type,step.id]);return(0,external_MailPoetLib_React_.useEffect)((()=>{"checkbox"===field.type&&void 0===data?.value&&setValue(!1)}),[data,field,setValue]),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:error?"mailpoet-automation-field__error":"",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(field_value_Field,{field,data,onChange:setValue,error:error?(0,external_MailPoetLib_WordPressI18n_.__)("This field is required.","mailpoet-premium"):""})})}function edit_list_panel_ListPanel(){const{step,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({step:select(store.Hz).getSelectedStep(),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),setSelectedId=(0,external_MailPoetLib_React_.useCallback)((id=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(step.id,"custom_fields",[{id}])}),[step.id]);if(!step)return null;const selectedId=step.args?.custom_fields?.[0]?.id,customFields=getContext().custom_fields,error=errors?.fields?.custom_fields??void 0;return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Custom field","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:error?"mailpoet-automation-field__error":"",style:{display:"grid"},children:(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{onChange:id=>setSelectedId(parseInt(id,10)),defaultValue:selectedId??"",help:error&&!selectedId?(0,external_MailPoetLib_WordPressI18n_.__)("This field is required.","mailpoet-premium"):"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:"",disabled:!0,children:(0,external_MailPoetLib_WordPressI18n_.__)("Select a custom field…","mailpoet-premium")}),customFields.map((field=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:field.id,children:field.name},field.id)))]})}),selectedId&&(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Set the value to","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(FieldValue,{id:selectedId})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{style:{marginTop:"24px"},children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsExternalLink_default(),{href:"https://kb.mailpoet.com/article/297-create-a-form-with-our-new-editor#custom-field",children:(0,external_MailPoetLib_WordPressI18n_.__)("How to create a custom field?","mailpoet-premium")})})]})}function update_subscriber_edit_Edit(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(edit_list_panel_ListPanel,{})}const{locale:update_subscriber_locale}=external_MailPoetLib_Automation_.config,update_subscriber_step={key:"mailpoet:update-subscriber",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Update subscriber","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Update the subscriber’s custom field to a specific value.","mailpoet-premium"),subtitle:data=>{const field=data.args?.custom_fields?.[0];if(!field||void 0===field.value||""===field.value)return(0,external_MailPoetLib_WordPressI18n_.__)("Not set up yet","mailpoet-premium");const name=getContext().custom_fields?.find((({id})=>id===field.id)).name??(0,external_MailPoetLib_WordPressI18n_.__)("Unknown field","mailpoet-premium");return(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_.__)('Update "%s" to "%s"',"mailpoet-premium"),name,"object"==typeof field.value?(({year,month,day})=>new Date(year??2e3,month?month-1:1,day??1).toLocaleDateString(update_subscriber_locale.toString(),{year:year?"numeric":void 0,month:month?"long":void 0,day:day?"numeric":void 0}))(field.value):field.value)},keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("update","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("update subscriber","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("update custom field","mailpoet-premium")],foreground:"#00A32A",background:"#EDFAEF",icon:()=>external_MailPoetLib_WordPressIcons_.postAuthor,edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(update_subscriber_edit_Edit,{})};function Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"-2 -2 25 20",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{d:"M 12,3.99997 C 12,1.78997 10.21,-3.05e-5 8,-3.05e-5 5.79,-3.05e-5 4,1.78997 4,3.99997 4,6.21 5.79,8 8,8 10.21,8 12,6.21 12,3.99997 Z m -2.0000002,0 C 9.9999998,5.09997 9.1,6 8,6 6.9,6 6,5.09997 6,3.99997 c 0,-1.1 0.9,-2 2,-2 1.1,0 1.9999998,0.9 1.9999998,2 z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{d:"m 0,14 v 2 h 16 v -2 c 0,-2.66 -5.33,-4 -8,-4 -2.67,0 -8,1.34 -8,4 z m 2,0 c 0.2,-0.71 3.3,-2 6,-2 2.69,0 5.77,1.28 6,2 z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{d:"m 21,6 h -6 v 2 h 6 z"})]})}const unsubscribe_step={key:"mailpoet:unsubscribe",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Unsubscribe","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Unsubscribe the subscriber from all marketing emails.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Unsubscribe","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("unsubscribe","mailpoet-premium")],foreground:"#00A32A",background:"#EDFAEF",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Icon,{}),edit:()=>null};var external_MailPoetLib_Common_=__webpack_require__(990);const external_MailPoetLib_AutomationIntegrationsMailPoet_namespaceObject=MailPoetLib.AutomationIntegrationsMailPoet;function ReceipientsSection(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),emails=(selectedStep.args.emails??[]).map((email=>({name:email,id:email}))),fields=errors?.fields??{},[suggestions,setSuggestions]=(0,external_MailPoetLib_React_.useState)(emails),emailFieldError=fields?.emails??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:emailFieldError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Recipients","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Send to (up to 5 email addresses)","mailpoet-premium"),value:emails,disabled:!1,suggestions,onChange:values=>{const uniqueValues=[...new Set(values.map((({id})=>id)))];(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"emails",uniqueValues)},onInputChange:value=>{const emailField=document.createElement("input");if(emailField.setAttribute("type","email"),emailField.value=value,emailField.validity.valid){const newSuggestions=[...new Set([...emails.map((mail=>mail.name)),value])];setSuggestions(newSuggestions.map((suggestion=>({name:suggestion,id:suggestion}))))}}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:emailFieldError})]})}function EmailPanel(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),errorFields=errors?.fields??{},errorEmailText=errorFields?.email_text??"",emailText=selectedStep.args.email_text??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Email body","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:errorEmailText?"mailpoet-automation-field__error":"",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextareaControl_default(),{className:errorEmailText?"mailpoet-automation-field__error":"",help:errorEmailText,value:emailText,onChange:value=>(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"email_text",value)})})]})}function SingleLineTextareaControl(props){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextareaControl_default(),{...props,onChange:value=>props.onChange(value.replaceAll(/(\r?\n)+/g," ")),onKeyDown:event=>{"Enter"===event.key&&event.preventDefault(),props.onKeyDown&&props.onKeyDown(event)}})}function notification_email_edit_Edit(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),errorFields=errors?.fields??{},senderNameErrorMessage=errorFields?.sender_name??"",senderAddressErrorMessage=errorFields?.sender_address??"",subjectErrorMessage=errorFields?.subject??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.StepName,{currentName:selectedStep.args.name??"",defaultName:(0,external_MailPoetLib_WordPressI18n_.__)("Send notification email","mailpoet-premium"),update:value=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"name",value)}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{className:senderNameErrorMessage?"mailpoet-automation-field__error":"",help:senderNameErrorMessage,label:(0,external_MailPoetLib_WordPressI18n_.__)('"From" name',"mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("John Doe","mailpoet-premium"),value:selectedStep.args.sender_name??"",onChange:value=>(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"sender_name",value)}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{className:senderAddressErrorMessage?"mailpoet-automation-field__error":"",help:(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[senderAddressErrorMessage,window.mailpoet_mss_active&&(0,external_MailPoetLib_Common_.isEmail)(selectedStep.args.sender_address??"")&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationIntegrationsMailPoet_namespaceObject.SenderDomainNotice,{email:selectedStep.args.sender_address??""})]}),type:"email",label:(0,external_MailPoetLib_WordPressI18n_.__)('"From" email address',"mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("you@domain.com","mailpoet-premium"),value:selectedStep.args.sender_address??"",onChange:value=>(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"sender_address",value)}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SingleLineTextareaControl,{className:subjectErrorMessage?"mailpoet-automation-field__error":"",label:(0,external_MailPoetLib_WordPressI18n_.__)("Subject","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Type in subject…","mailpoet-premium"),value:selectedStep.args.subject??"",onChange:value=>(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"subject",value),help:subjectErrorMessage}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ReceipientsSection,{})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(EmailPanel,{})]})}function icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"-2 -2 28 29",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.21226 7.94521C1.21226 6.58751 2.31289 5.48687 3.67059 5.48687H17.6706C19.0283 5.48687 20.1289 6.58751 20.1289 7.94521V11.2455C19.8263 11.2032 19.5171 11.1813 19.2029 11.1813C18.8372 11.1813 18.4785 11.2109 18.1289 11.2679V8.70276L10.6706 15.0956L3.21226 8.70276V17.2785C3.21226 17.5317 3.41746 17.7369 3.67059 17.7369H12.5745C12.5742 17.7613 12.5741 17.7857 12.5741 17.8101C12.5741 18.4802 12.6735 19.1271 12.8584 19.7369H3.67059C2.31289 19.7369 1.21226 18.6362 1.21226 17.2785V7.94521ZM4.86691 7.48687L10.6706 12.4615L16.4743 7.48687H4.86691Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.1337 18.7225L22.2517 18.0384C22.2682 17.9065 22.2847 17.7746 22.2847 17.6345C22.2847 17.4944 22.2765 17.3625 22.2517 17.2306L23.1255 16.5464C23.1997 16.4805 23.2244 16.3734 23.1749 16.2827L22.3507 14.8567C22.3012 14.766 22.194 14.733 22.0951 14.766L21.073 15.1782C20.8587 15.0133 20.6279 14.8732 20.3724 14.7743L20.2158 13.6862C20.2075 13.5873 20.1169 13.5131 20.018 13.5131H18.3694C18.2705 13.5131 18.1798 13.5873 18.1633 13.6862L18.0067 14.7743C17.7594 14.8814 17.5204 15.0133 17.3061 15.1782L16.284 14.766C16.1933 14.733 16.0862 14.766 16.0285 14.8567L15.2042 16.2827C15.1547 16.3734 15.1712 16.4805 15.2536 16.5464L16.1274 17.2306C16.1109 17.3625 16.1027 17.4944 16.1027 17.6345C16.1027 17.7746 16.1109 17.9065 16.1274 18.0384L15.2536 18.7225C15.1795 18.7885 15.1547 18.8956 15.2042 18.9863L16.0285 20.4123C16.0779 20.503 16.1851 20.5359 16.284 20.503L17.3061 20.0908C17.5204 20.2557 17.7512 20.3958 18.0067 20.4947L18.1633 21.5828C18.1798 21.6817 18.2623 21.7559 18.3694 21.7559H20.018C20.1169 21.7559 20.2075 21.6817 20.224 21.5828L20.3806 20.4947C20.6279 20.3876 20.867 20.2557 21.073 20.0908L22.1034 20.503C22.194 20.5359 22.3012 20.503 22.3589 20.4123L23.1832 18.9863C23.2326 18.8956 23.2079 18.7885 23.1337 18.7225ZM19.1937 18.8709C18.5095 18.8709 17.9573 18.3186 17.9573 17.6345C17.9573 16.9503 18.5095 16.3981 19.1937 16.3981C19.8778 16.3981 20.4301 16.9503 20.4301 17.6345C20.4301 18.3186 19.8778 18.8709 19.1937 18.8709Z"})]})}const notification_email_step={key:"mailpoet:notification-email",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Send notification email","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Receive a notification when a contact reaches a specific point in automation.","mailpoet-premium"),subtitle:data=>data.args.name??(0,external_MailPoetLib_WordPressI18n_.__)("Send notification email","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("notification","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("email","mailpoet-premium")],foreground:"#996800",background:"#FCF9E8",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(icon_Icon,{}),edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(notification_email_edit_Edit,{}),createStep:stepData=>stepData},external_MailPoetLib_WordPressNotices_namespaceObject=MailPoetLib.WordPressNotices;function CopyToClipboard({button,label,children}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextareaControl_default(),{label,onChange:()=>{},readOnly:!0,rows:4,value:children}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{variant:"tertiary",onClick:()=>async function(text){try{await navigator.clipboard.writeText(text),(0,external_MailPoetLib_WordPressData_.dispatch)(external_MailPoetLib_WordPressNotices_namespaceObject.store).createSuccessNotice((0,external_MailPoetLib_WordPressI18n_.__)("Added to clipboard.","mailpoet-premium"))}catch(e){(0,external_MailPoetLib_WordPressData_.dispatch)(external_MailPoetLib_WordPressNotices_namespaceObject.store).createErrorNotice((0,external_MailPoetLib_WordPressI18n_.__)("Could not add the text to clipboard.","mailpoet-premium"))}}(children),children:button})]})}function CodeableLink(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:"https://www.codeable.io/partners/mailpoet/?ref=xxVTOd",target:"_blank",rel:"noreferrer nofollow",children:(0,external_MailPoetLib_WordPressI18n_.__)("You can find a developer on codeable.io.","mailpoet-premium")})}const custom_trigger_step={key:"mailpoet:custom-trigger",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Custom trigger","mailpoet-premium"),description:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("p",{children:[(0,external_MailPoetLib_WordPressI18n_.__)("This is an advanced feature for developers. Triggers an automation when a certain action is fired. The action's first argument must be the email address of a subscriber.","mailpoet-premium")," ",(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(CodeableLink,{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("br",{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:"https://kb.mailpoet.com/article/409-custom-trigger",target:"_blank",rel:"noreferrer nofollow",children:(0,external_MailPoetLib_WordPressI18n_.__)("Learn more","mailpoet-premium")})]}),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("custom","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("hook","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("code","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>external_MailPoetLib_WordPressIcons_.plugins,edit:function(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep(),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),fields=errors?.fields??{},hookError=fields?.hook??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Settings","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:hookError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{id:"mailpoet-automation-custom-trigger-hook",label:(0,external_MailPoetLib_WordPressI18n_.__)("Hook","mailpoet-premium"),type:"text",value:selectedStep.args?.hook,onChange:hook=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"hook",hook)}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:hookError})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("hr",{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(CopyToClipboard,{button:(0,external_MailPoetLib_WordPressI18n_.__)("Copy code snippet","mailpoet-premium"),label:(0,external_MailPoetLib_WordPressI18n_.__)("Example code:","mailpoet-premium"),children:`do_action(\n\t'${selectedStep.args?.hook}',\n\t$subscriber_email\n);`})]})}};const custom_action_step={key:"mailpoet:custom-action",group:"actions",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Custom action","mailpoet-premium"),description:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("p",{children:[(0,external_MailPoetLib_WordPressI18n_.__)("This is an advanced feature for developers. It fires a customizable hook.","mailpoet-premium")," ",(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(CodeableLink,{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("br",{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:"https://kb.mailpoet.com/article/410-custom-action",target:"_blank",rel:"noreferrer nofollow",children:(0,external_MailPoetLib_WordPressI18n_.__)("Learn more","mailpoet-premium")})]}),subtitle:data=>{const hook=data.args.hook;return hook&&hook.length?(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_.__)('Fires the "%s" hook',"mailpoet-premium"),hook):(0,external_MailPoetLib_WordPressI18n_.__)("Not set up yet","mailpoet-premium")},keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("custom","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("hook","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("code","mailpoet-premium")],foreground:"#00A32A",background:"#EDFAEF",icon:()=>external_MailPoetLib_WordPressIcons_.code,edit:function(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep(),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),fields=errors?.fields??{},hookError=fields?.hook??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Settings","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:hookError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{id:"mailpoet-automation-custom-trigger-hook",label:(0,external_MailPoetLib_WordPressI18n_.__)("Hook","mailpoet-premium"),type:"text",value:selectedStep.args?.hook,onChange:hook=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"hook",hook)}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:hookError})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("hr",{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(CopyToClipboard,{button:(0,external_MailPoetLib_WordPressI18n_.__)("Copy code snippet","mailpoet-premium"),label:(0,external_MailPoetLib_WordPressI18n_.__)("Example code:","mailpoet-premium"),children:`add_action(\n\t'${selectedStep.args?.hook}',\n\tfunction( $subscriber_email ) {\n\t\t//add your code.\n\t}\n);`})]})}};function tag_added_edit_Edit(){const{selectedStep,selected,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),selected:s(constants_storeName).getTagsByIds(s(store.Hz).getSelectedStep().args?.tag_ids??[]),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),fields=errors?.fields??{},addTagFieldError=fields?.tag_ids??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(AddTagPanel,{onChange:tags=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"tag_ids",tags.map((item=>item.id)))},selected,error:addTagFieldError,label:(0,external_MailPoetLib_WordPressI18n_.__)("Tags","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Please select a tag","mailpoet-premium")})}function tag_added_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2256 4.00778L15.9469 6.72904C15.3573 6.81906 14.7994 7.00565 14.29 7.27216L12.3256 5.30778H5.52563V12.0078L12.0256 18.5078C12.1256 18.6078 12.2256 18.7078 12.3256 18.7078C12.5256 18.8078 12.7256 18.8078 12.9256 18.7078C12.9756 18.6578 13.0256 18.6328 13.0756 18.6078C13.1256 18.5828 13.1756 18.5578 13.2256 18.5078L14.7801 16.9533C15.29 17.1571 15.8388 17.2845 16.4122 17.3213L14.2256 19.5078C14.1361 19.5675 14.0555 19.6272 13.9784 19.6842C13.7974 19.8182 13.6361 19.9376 13.4256 20.0078C13.1256 20.1078 12.8256 20.2078 12.5256 20.2078C12.2256 20.2078 11.8256 20.1078 11.6256 20.0078C11.4256 19.9078 11.1256 19.7078 10.9256 19.5078L4.22564 12.8078C4.12564 12.7078 4.02563 12.5078 4.02563 12.3078V4.50778C4.02563 4.10778 4.42563 3.70778 4.82563 3.80778H12.7256C12.9256 3.80778 13.1256 3.90778 13.2256 4.00778Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.82563 7.50778C8.22563 7.50778 7.82563 7.90778 7.82563 8.50778C7.82563 9.10778 8.22563 9.50778 8.82563 9.50778C9.42564 9.50778 9.82563 9.10778 9.82563 8.50778C9.82563 7.90778 9.42564 7.50778 8.82563 7.50778Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0084 15.25V12.75H13.5084V11.25H16.0084V8.75H17.5084V11.25H20.0084V12.75H17.5084V15.25H16.0084Z"})]})}const tag_added_step={key:"mailpoet:subscriber-tag-added",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Tag added to subscriber","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a tag is added to a subscriber.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Trigger","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("tags","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("label","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("labels","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("add tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("add tags","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(tag_added_icon_Icon,{}),edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(tag_added_edit_Edit,{})};function tag_removed_edit_Edit(){const{selectedStep,selected,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),selected:s(constants_storeName).getTagsByIds(s(store.Hz).getSelectedStep().args?.tag_ids??[]),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),fields=errors?.fields??{},addTagFieldError=fields?.tag_ids??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(AddTagPanel,{onChange:tags=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"tag_ids",tags.map((item=>item.id)))},selected,error:addTagFieldError,label:(0,external_MailPoetLib_WordPressI18n_.__)("Tags","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Please select a tag","mailpoet-premium")})}function tag_removed_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2256 4.00778L15.9469 6.72904C15.3573 6.81906 14.7994 7.00565 14.29 7.27216L12.3256 5.30778H5.52563V12.0078L12.0256 18.5078C12.1256 18.6078 12.2256 18.7078 12.3256 18.7078C12.5256 18.8078 12.7256 18.8078 12.9256 18.7078C12.9756 18.6578 13.0256 18.6328 13.0756 18.6078C13.1256 18.5828 13.1756 18.5578 13.2256 18.5078L14.7801 16.9533C15.29 17.1571 15.8388 17.2845 16.4122 17.3213L14.2256 19.5078C14.1361 19.5675 14.0555 19.6272 13.9784 19.6842C13.7974 19.8182 13.6361 19.9376 13.4256 20.0078C13.1256 20.1078 12.8256 20.2078 12.5256 20.2078C12.2256 20.2078 11.8256 20.1078 11.6256 20.0078C11.4256 19.9078 11.1256 19.7078 10.9256 19.5078L4.22564 12.8078C4.12564 12.7078 4.02563 12.5078 4.02563 12.3078V4.50778C4.02563 4.10778 4.42563 3.70778 4.82563 3.80778H12.7256C12.9256 3.80778 13.1256 3.90778 13.2256 4.00778Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.82563 7.50778C8.22563 7.50778 7.82563 7.90778 7.82563 8.50778C7.82563 9.10778 8.22563 9.50778 8.82563 9.50778C9.42564 9.50778 9.82563 9.10778 9.82563 8.50778C9.82563 7.90778 9.42564 7.50778 8.82563 7.50778Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5084 12.75V11.25H20.0084V12.75H13.5084Z"})]})}const tag_removed_step={key:"mailpoet:subscriber-tag-removed",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Tag removed from subscriber","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a tag is removed from a subscriber.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Trigger","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("tags","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("label","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("labels","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("remove tag","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("remove tags","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(tag_removed_icon_Icon,{}),edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(tag_removed_edit_Edit,{})};function clicks_email_link_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.75689 17.1943H8.20134C5.33253 17.1943 3.0069 14.8687 3.0069 11.9999C3.0069 9.13108 5.33253 6.80545 8.20134 6.80545H9.75689V8.30545L8.20134 8.30545C6.16096 8.30545 4.5069 9.95951 4.5069 11.9999C4.5069 14.0403 6.16096 15.6943 8.20134 15.6943H9.75689V17.1943Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.7569 6.80567H15.3124C18.1812 6.80567 20.5068 9.1313 20.5068 12.0001C20.5068 12.6517 20.3868 13.2753 20.1678 13.85L18.7867 13.2592C18.9291 12.8662 19.0068 12.4422 19.0068 12.0001C19.0068 9.95973 17.3528 8.30567 15.3124 8.30567H13.7569V6.80567Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.0956 11.9124L19.806 14.7829L17.167 15.3448L17.3797 15.6105L17.377 15.6111L19.9939 18.8806L18.354 20.1869L15.5334 16.6461L14.3934 19.0974L13.0956 11.9124Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.2569 11.3215V11.3055H14.2193L14.2569 11.3215Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2407 12.8055L11.9697 11.3055H9.25689V12.8055H12.2407Z"})]})}var external_MailPoet_=__webpack_require__(632),external_MailPoet_default=__webpack_require__.n(external_MailPoet_);async function loadLinks(newsletterId,links,setLinks){if(Object.keys(links).includes(newsletterId.toString()))return;const result=await external_MailPoet_default().Ajax.post({api_version:external_MailPoet_default().apiVersion,endpoint:"newsletter_links",action:"get",data:{newsletterId}});setLinks({...links,[newsletterId]:result.data})}function clicks_email_link_edit_Edit(){const[links,setLinks]=(0,external_MailPoetLib_React_.useState)({}),{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep(),errors:select(store.Hz).getStepError(select(store.Hz).getSelectedStep().id)})),[]),options=[{disabled:!0,label:(0,external_MailPoetLib_WordPressI18n_.__)("Select a newsletter","mailpoet-premium"),value:"0"}].concat(getContext().newsletter_list.map((newsletter=>{let sentAt="";return newsletter.sent_at&&(sentAt=(0,external_MailPoetLib_WordPressI18n_.sprintf)(" (%s)",external_MailPoet_default().Date.format(newsletter.sent_at.date))),{disabled:!1,value:`${newsletter.id}`,label:(0,external_MailPoetLib_WordPressI18n_.sprintf)("%s%s",newsletter.subject,sentAt)}}))),selectedNewsletter=(selectedStep.args?.newsletter_id||0).toString();"0"!==selectedNewsletter&&loadLinks(parseInt(selectedNewsletter,10),links,setLinks);const selectedLinks=selectedStep.args?.link_ids||[],selectedOperator=selectedStep.args?.operator||"any",isLoading="0"!==selectedNewsletter&&void 0===links[selectedNewsletter],newsletterIdError=errors?.fields?.newsletter_id,operatorError=errors?.fields?.operator,linkIdsError=errors?.fields?.link_ids;return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Trigger settings","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:newsletterIdError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Newsletter:","mailpoet-premium"),value:selectedNewsletter,options,onChange:value=>{const newsletterId=parseInt(value,10);(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"newsletter_id",newsletterId),loadLinks(newsletterId,links,setLinks)}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:newsletterIdError})]}),isLoading&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:(0,external_MailPoetLib_WordPressI18n_.__)("Loading...","mailpoet-premium")}),!isLoading&&"0"!==selectedNewsletter&&0===links[selectedNewsletter].length&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:(0,external_MailPoetLib_WordPressI18n_.__)("This newsletter has no links","mailpoet-premium")}),!isLoading&&"0"!==selectedNewsletter&&links[selectedNewsletter].length>0&&(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:operatorError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Condition:","mailpoet-premium"),value:selectedOperator,options:[{disabled:!1,value:"any",label:(0,external_MailPoetLib_WordPressI18n_.__)("any of","mailpoet-premium")},{disabled:!1,value:"all",label:(0,external_MailPoetLib_WordPressI18n_.__)("all of","mailpoet-premium")},{disabled:!1,value:"none",label:(0,external_MailPoetLib_WordPressI18n_.__)("none of","mailpoet-premium")}],onChange:value=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"operator",value),loadLinks(parseInt(value,10),links,setLinks)}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:operatorError})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:linkIdsError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Link:","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Please select a link","mailpoet-premium"),value:selectedLinks.map((linkId=>({id:linkId,name:links[selectedNewsletter].find((link=>link.id===linkId))?.url||""}))),suggestions:links[selectedNewsletter].map((link=>({id:link.id,name:link.url}))),onChange:value=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"link_ids",value.map((v=>v.id)))}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:linkIdsError})]})]})]})}const clicks_email_link_step={key:"mailpoet:clicks-email-link",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Subscriber clicks a link in email","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Triggers an automation when a subscriber clicks a link in an email.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("email","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("link","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("clicks","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(clicks_email_link_icon_Icon,{}),edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(clicks_email_link_edit_Edit,{})},context_getContext=()=>(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getContext("wordpress");function getCommentPostTypes(){return context_getContext().post_types.filter((type=>!(!type.public||!type.show_in_rest)&&type.supports?.comments))}function getPossibleTaxonomies(forPostTypes){const postTypes=forPostTypes??getCommentPostTypes().map((type=>type.name));return context_getContext().taxonomies.filter((tax=>{if(!1===tax.show_in_rest)return!1;for(let i=0;i<postTypes.length;i+=1)if(tax.object_type.includes(postTypes[i]))return!0;return!1}))}function PostTypePanel(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),postTypesError=errors?.fields?.post_types,options=getCommentPostTypes().map((type=>({id:type.name,name:type.label}))),selectPostTypeNames=selectedStep.args?.post_types??[],selected=options.filter((option=>selectPostTypeNames.includes(option.id)));return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:postTypesError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Post Types:","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Any","mailpoet-premium"),value:selected,suggestions:options,onChange:values=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"post_types",values.map((item=>item.id)));const taxonomies=getPossibleTaxonomies(),terms={};taxonomies.forEach((taxonomy=>{terms[taxonomy.name]=selectedStep.args?.terms?.[taxonomy.name]??[]})),(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"terms",terms)}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:postTypesError})]})}const external_MailPoetLib_WordPressAPIFetch_namespaceObject=MailPoetLib.WordPressAPIFetch;var external_MailPoetLib_WordPressAPIFetch_default=__webpack_require__.n(external_MailPoetLib_WordPressAPIFetch_namespaceObject);const external_MailPoetLib_WordPressUrl_namespaceObject=MailPoetLib.WordPressUrl;async function updateValues(callback,search,include=[],type="post",subtype=[]){if(null===search&&0===include.length)return void callback([]);const posts=await async function(search,include=[],type="post",subtype=[]){const url=(0,external_MailPoetLib_WordPressUrl_namespaceObject.addQueryArgs)(`${external_MailPoetLib_Automation_.config.api.root}/wp/v2/search`,{search,include,type,subtype});return await external_MailPoetLib_WordPressAPIFetch_default()({url})}(search,include,type,subtype);callback(posts.map((({id,title})=>({id,name:title}))))}function SearchPanel({title,type,selectedIds,error,updateCallback,subtype}){const[search,setSearch]=(0,external_MailPoetLib_React_.useState)(""),[suggestions,setSuggestions]=(0,external_MailPoetLib_React_.useState)([]),[selected,setSelected]=(0,external_MailPoetLib_React_.useState)();return(0,external_MailPoetLib_React_.useEffect)((()=>{void 0===selected&&selectedIds&&0!==selectedIds.length&&updateValues(setSelected,null,selectedIds,type,subtype)}),[selected,selectedIds,type,subtype]),(0,external_MailPoetLib_React_.useEffect)((()=>{0!==search.length&&updateValues(setSuggestions,search,[],type,subtype)}),[search,type,subtype]),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:error?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{value:selected??[],suggestions,onChange:values=>{updateCallback(values),setSelected(values)},onInputChange:setSearch,label:title,placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Any","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:error})]})}function PostsPanel({label}){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),postTypes=function(){const step=(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getSelectedStep(),selectedPostTypeNames=step.args?.post_types??[];return 0===selectedPostTypeNames.length?[]:context_getContext().post_types.filter((type=>selectedPostTypeNames.includes(type.name)))}().map((item=>item.name));return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SearchPanel,{title:label??(0,external_MailPoetLib_WordPressI18n_.__)("Posts:","mailpoet-premium"),type:"post",selectedIds:selectedStep.args?.post_ids,error:errors?.fields?.post_ids??"",subtype:postTypes,updateCallback:values=>(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"post_ids",values.map((item=>item.id)))})}function PostTaxonomyPanel({taxonomy}){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),terms=selectedStep.args?.terms??{},termsOfTaxonomy=terms?.[taxonomy.name]??[];return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SearchPanel,{title:`${taxonomy.label}:`,type:"term",selectedIds:termsOfTaxonomy,updateCallback:values=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"terms",{...terms,[taxonomy.name]:values.map((value=>value.id))})},subtype:[taxonomy.name],error:errors?.fields?.terms??""})}function CommentStatus({label,title}){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)})),[]),commentStatusesError=errors?.fields?.comment_statuses??"",options=context_getContext().comment_statuses,selectedStatuses=selectedStep.args?.comment_statuses??[],selected=options.filter((option=>selectedStatuses.includes(option.id)));return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:title??(0,external_MailPoetLib_WordPressI18n_.__)("Comment Status","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:commentStatusesError?"mailpoet-automation-field__error":"",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.FormTokenField,{label:label??(0,external_MailPoetLib_WordPressI18n_.__)("Select Comment Status:","mailpoet-premium"),placeholder:(0,external_MailPoetLib_WordPressI18n_.__)("Any","mailpoet-premium"),value:selected,suggestions:options,onChange:values=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"comment_statuses",values.map((item=>item.id)))}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{className:"components-base-control__help",children:commentStatusesError})]})]})}function made_a_comment_edit_Edit(){const taxonomies=getPossibleTaxonomies();return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(CommentStatus,{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Posts","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:(0,external_MailPoetLib_WordPressI18n_.__)("The automation will be triggered for these:","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(PostTypePanel,{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(PostsPanel,{}),taxonomies.map((taxonomy=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(PostTaxonomyPanel,{taxonomy},taxonomy.name)))]})]})}function made_a_comment_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.0554 5.69248C20.0554 6.8395 19.1255 7.76933 17.9785 7.76933C16.8315 7.76933 15.9017 6.8395 15.9017 5.69248C15.9017 4.54547 16.8315 3.61564 17.9785 3.61564C19.1255 3.61564 20.0554 4.54547 20.0554 5.69248Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.8819 4.06748H4.94464C4.39236 4.06748 3.94464 4.5152 3.94464 5.06748V19.5922C3.94464 19.8848 4.10587 20.1535 4.36399 20.2912C4.67175 20.4553 5.05065 20.3988 5.29716 20.152L7.25464 18.1925H18.9446C19.4969 18.1925 19.9446 17.7448 19.9446 17.1925V8.58416C19.5059 8.88307 18.9955 9.08472 18.4446 9.15811V16.6925H6.63286L5.44464 17.882V5.56748H14.4843C14.5033 5.02733 14.6448 4.51835 14.8819 4.06748Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.8098 8.228C11.8696 8.04374 12.1303 8.04374 12.1902 8.228L12.8224 10.1736C12.8491 10.256 12.9259 10.3118 13.0126 10.3118H15.0583C15.2521 10.3118 15.3326 10.5598 15.1759 10.6736L13.5208 11.8761C13.4507 11.927 13.4214 12.0173 13.4482 12.0997L14.0804 14.0453C14.1402 14.2296 13.9293 14.3828 13.7726 14.2689L12.1175 13.0665C12.0474 13.0156 11.9525 13.0156 11.8824 13.0665L10.2274 14.2689C10.0706 14.3828 9.85973 14.2296 9.9196 14.0453L10.5518 12.0997C10.5786 12.0173 10.5492 11.927 10.4791 11.8761L8.82407 10.6736C8.66733 10.5598 8.74788 10.3118 8.94163 10.3118H10.9874C11.074 10.3118 11.1508 10.256 11.1776 10.1736L11.8098 8.228ZM11.287 11.2739C11.5814 11.198 11.8368 11.0125 12 10.7559C12.1631 11.0125 12.4185 11.198 12.7129 11.2739C12.5194 11.5083 12.4218 11.8086 12.4406 12.112C12.1578 12.0004 11.8421 12.0004 11.5594 12.112C11.5782 11.8086 11.4806 11.5083 11.287 11.2739Z"})]})}const made_a_comment_step={key:"wordpress:made-a-comment",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("User makes a comment","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a user makes a comment.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Trigger","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("comment","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(made_a_comment_icon_Icon,{}),edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(made_a_comment_edit_Edit,{})};function made_a_review_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.9785 7.76934C19.1255 7.76934 20.0554 6.8395 20.0554 5.69249C20.0554 4.54548 19.1255 3.61565 17.9785 3.61565C16.8315 3.61565 15.9017 4.54548 15.9017 5.69249C15.9017 6.8395 16.8315 7.76934 17.9785 7.76934Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.94464 4.06749H14.8819C14.6448 4.51836 14.5033 5.02734 14.4843 5.56749H5.44464V17.882L6.63286 16.6925H18.4446V9.15811C18.9955 9.08473 19.5059 8.88307 19.9446 8.58416V17.1925C19.9446 17.7448 19.4969 18.1925 18.9446 18.1925H7.25464L5.29716 20.152C5.05065 20.3988 4.67175 20.4553 4.36399 20.2912C4.10587 20.1535 3.94464 19.8848 3.94464 19.5922V5.06749C3.94464 4.51521 4.39236 4.06749 4.94464 4.06749Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9446 10.0675H7.94464V8.56746H15.9446V10.0675Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.94464 14.0675H12.9446V12.5675H7.94464V14.0675Z"})]})}const external_MailPoetLib_AutomationIntegrationsWooCommerceContext_namespaceObject=MailPoetLib.AutomationIntegrationsWooCommerceContext,external_MailPoetLib_WordpressComponentsToggleControl_namespaceObject=MailPoetLib.WordpressComponentsToggleControl;var external_MailPoetLib_WordpressComponentsToggleControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsToggleControl_namespaceObject);function FromToRange({isActive,from,to,onChange}){if(!isActive)return null;function update(value,type){let sanitizedValue=value;value<0&&(sanitizedValue=0),value>5&&(sanitizedValue=5),onChange(sanitizedValue,type)}return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{className:"mailpoet-product-rating-range-from",label:(0,external_MailPoetLib_WordPressI18n_.__)("From","mailpoet-premium"),type:"number",min:"0",max:"5",step:"1",value:from,onChange:value=>{update(parseInt(value,10),"from")}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{className:"mailpoet-product-rating-range-to",label:(0,external_MailPoetLib_WordPressI18n_.__)("to","mailpoet-premium"),type:"number",min:"0",max:"5",step:"1",value:to,onChange:value=>{update(parseInt(value,10),"to")}})]})}function RatingsPanel(){const{selectedStep,errors}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({selectedStep:s(store.Hz).getSelectedStep(),errors:s(store.Hz).getStepError(s(store.Hz).getSelectedStep().id)}))),ratingSetting=selectedStep.args?.rating??{from:0,to:5,is_active:!1},onChange=(value,type)=>{const newRatingSetting={is_active:ratingSetting.is_active,from:"from"===type&&"boolean"!=typeof value?value:ratingSetting.from,to:"to"===type&&"boolean"!=typeof value?value:ratingSetting.to};"is_active"===type&&"boolean"==typeof value&&(newRatingSetting.is_active=value),"from"===type&&newRatingSetting.from>newRatingSetting.to&&(newRatingSetting.to=newRatingSetting.from),"to"===type&&newRatingSetting.to<newRatingSetting.from&&(newRatingSetting.from=newRatingSetting.to),(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,"rating",newRatingSetting)},error=errors?.fields?.rating??"";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Ratings","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-product-rating-range "+(error?"mailpoet-automation-field__error":""),children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsToggleControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Enable","mailpoet-premium"),checked:ratingSetting.is_active,onChange:value=>{onChange(value,"is_active")}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(FromToRange,{isActive:ratingSetting.is_active,from:ratingSetting.from,to:ratingSetting.to,onChange})]})]})}function made_a_review_edit_Edit(){const taxonomies=getPossibleTaxonomies(["product"]),ratingEnabled=(0,external_MailPoetLib_AutomationIntegrationsWooCommerceContext_namespaceObject.getContext)().review_ratings_enabled;return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(CommentStatus,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Review Status","mailpoet-premium"),label:(0,external_MailPoetLib_WordPressI18n_.__)("Select Review Status:","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:(0,external_MailPoetLib_WordPressI18n_.__)("Products","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:(0,external_MailPoetLib_WordPressI18n_.__)("The automation will be triggered for these:","mailpoet-premium")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(PostsPanel,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Products:","mailpoet-premium")}),taxonomies.map((taxonomy=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(PostTaxonomyPanel,{taxonomy},taxonomy.name)))]}),ratingEnabled&&(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(RatingsPanel,{})]})}const made_a_review_step={key:"woocommerce:made-a-review",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Customer makes a review","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a customer makes a review.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Trigger","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("review","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("buy","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("comment","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("ecommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("product","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("order","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(made_a_review_icon_Icon,{}),edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(made_a_review_edit_Edit,{})},woocommerce_initialize=()=>{external_MailPoet_default().isWoocommerceActive&&external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.register_step_type","mailpoet",(step=>"woocommerce:made-a-review"===step.key?made_a_review_step:step))};function subscription_status_changed_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.0932 17.9065C8.0932 19.0455 7.1699 19.9688 6.03096 19.9688C4.89202 19.9688 3.96872 19.0455 3.96872 17.9065C3.96872 16.7676 4.89202 15.8443 6.03096 15.8443C7.1699 15.8443 8.0932 16.7676 8.0932 17.9065Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.0875 17.9065C20.0875 19.0454 19.1642 19.9687 18.0253 19.9687C16.8863 19.9687 15.9631 19.0454 15.9631 17.9065C15.9631 16.7675 16.8863 15.8442 18.0253 15.8442C19.1642 15.8442 20.0875 16.7675 20.0875 17.9065Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.38597 11.5784C6.38597 8.69346 8.7247 6.35474 11.6097 6.35474C14.1254 6.35474 16.2257 8.1331 16.7222 10.5013H15.3354L17.8333 13.4988L20.3312 10.5013H18.7536C18.2335 7.02264 15.2331 4.35474 11.6097 4.35474C7.62013 4.35474 4.38597 7.58889 4.38597 11.5784V12.1208H6.38597V11.5784Z"})]})}const woocommerce_subscriptions_context_getContext=()=>(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getContext("woocommerce-subscriptions");function getSubscriptionStatusOptions(){const context=woocommerce_subscriptions_context_getContext(),options={any:{label:(0,external_MailPoetLib_WordPressI18n_.__)("Any","mailpoet-premium"),value:"any"}};return Object.values(context?.subscription_statuses||{}).forEach((status=>{options[status.value]=status})),options}function SubscriptionStatusPanel({label,toLabel,fromLabel,onChange}){const{selectedStep}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep()})),[]),fromSelected=selectedStep.args?.from??"any",toSelected=selectedStep.args?.to??"any",update=(value,property)=>{onChange(value,property)},options=Object.values(getSubscriptionStatusOptions());return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_WordpressComponentsPanelBody_default(),{opened:!0,children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_AutomationEditorComponents_namespaceObject.PlainBodyTitle,{title:label}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{value:fromSelected,label:fromLabel,options,onChange:value=>update(value,"from")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{value:toSelected,label:toLabel,options:Object.values(getSubscriptionStatusOptions()),onChange:value=>update(value,"to")})]})}function subscription_status_changed_edit_Edit(){const{selectedStep}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({selectedStep:select(store.Hz).getSelectedStep()})),[]);return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SubscriptionStatusPanel,{label:(0,external_MailPoetLib_WordPressI18n_.__)("Trigger settings","mailpoet-premium"),toLabel:(0,external_MailPoetLib_WordPressI18n_.__)("Status changes to:","mailpoet-premium"),fromLabel:(0,external_MailPoetLib_WordPressI18n_.__)("Status changes from:","mailpoet-premium"),onChange:(status,property)=>{(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateStepArgs(selectedStep.id,property,status)}})}const subscription_status_changed_step={key:"woocommerce-subscriptions:subscription-status-changed",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Woo Subscription status changed","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when subscription changed to a specific status.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("subscriptions","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("status","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("changed","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_status_changed_icon_Icon,{}),edit:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_status_changed_edit_Edit,{})};function subscription_created_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.5197 16.8032C15.3729 17.8384 13.8534 18.4688 12.1867 18.4688C8.61411 18.4688 5.71796 15.5726 5.71796 12C5.71796 8.42741 8.61411 5.53125 12.1867 5.53125C15.7593 5.53125 18.6555 8.42741 18.6555 12C18.6555 12.1834 18.6478 12.365 18.6329 12.5445H16.8363L19.3363 15.5445L21.8363 12.5445H20.1371C20.1493 12.3646 20.1555 12.183 20.1555 12C20.1555 7.59898 16.5877 4.03125 12.1867 4.03125C7.78569 4.03125 4.21796 7.59898 4.21796 12C4.21796 16.401 7.78569 19.9688 12.1867 19.9688C14.2782 19.9688 16.1816 19.163 17.6032 17.8449L16.5197 16.8032Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.4609 12L13.2391 10.9901L12.2292 8.76837L11.2193 10.9901L8.99759 12L11.2193 13.0099L12.2292 15.2316L13.2391 13.0099L15.4609 12Z"})]})}const subscription_created_step={key:"woocommerce-subscriptions:subscription-created",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Woo Subscription started","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a subscription is created.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("subscriptions","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("new","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("created","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("started","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_created_icon_Icon,{}),edit:()=>null};function subscription_trial_ended_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9182 5.53662C8.35167 5.53662 5.4604 8.42789 5.4604 11.9944L5.45851 11.9944C5.45851 12.2815 5.47716 12.5638 5.51323 12.8403L4.02583 13.0343C3.98139 12.6937 3.95851 12.3465 3.95851 11.9944C3.95851 11.6424 3.98139 11.2952 4.02583 10.9546L4.0277 10.9548C4.53704 7.05107 7.8756 4.03662 11.9182 4.03662C16.3132 4.03662 19.8761 7.59946 19.8761 11.9944L19.876 11.9914L19.1261 11.9944H19.8761C19.8763 12.1236 19.8611 12.3282 19.835 12.5361H21.4636L19.0359 15.4261L16.666 12.5361H18.3191C18.3232 12.5127 18.3271 12.4884 18.3309 12.4631C18.3631 12.2512 18.3763 12.0542 18.3761 11.9974L18.3761 11.9944C18.3761 8.42789 15.4848 5.53662 11.9182 5.53662Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5635 15.0451C4.83232 15.6933 5.18405 16.2981 5.60526 16.8462L6.79464 15.9322C6.45239 15.4869 6.167 14.996 5.94908 14.4705L4.5635 15.0451Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.07569 18.3167C7.62381 18.7379 8.22858 19.0896 8.87685 19.3584L9.45143 17.9728C8.92593 17.7549 8.43505 17.4695 7.98968 17.1273L7.07569 18.3167Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.9781 19.3584C15.6264 19.0896 16.2311 18.7379 16.7792 18.3167L15.8653 17.1273C15.4199 17.4695 14.929 17.7549 14.4035 17.9728L14.9781 19.3584Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8876 19.8961C11.2283 19.9405 11.5754 19.9634 11.9275 19.9634C12.2796 19.9634 12.6267 19.9405 12.9673 19.8961L12.7733 18.4087C12.4968 18.4448 12.2145 18.4634 11.9275 18.4634C11.6404 18.4634 11.3581 18.4448 11.0816 18.4087L10.8876 19.8961Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9189 12.4406H11.1341V7.97858H12.9189V12.4406Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9189 16.0103H11.1341V14.2254H12.9189V16.0103Z"})]})}const subscription_trial_ended_step={key:"woocommerce-subscriptions:trial-ended",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Woo Subscription trial ended","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a subscription trial ends.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("subscription","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("trial","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("ended","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_trial_ended_icon_Icon,{}),edit:()=>null};function subscription_trial_started_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9182 5.53662C8.35167 5.53662 5.4604 8.42789 5.4604 11.9944L5.45851 11.9944C5.45851 12.2815 5.47716 12.5638 5.51323 12.8403L4.02583 13.0343C3.98139 12.6937 3.95851 12.3465 3.95851 11.9944C3.95851 11.6424 3.98139 11.2952 4.02583 10.9546L4.0277 10.9548C4.53704 7.05107 7.8756 4.03662 11.9182 4.03662C16.3132 4.03662 19.8761 7.59946 19.8761 11.9944H19.1261L19.876 11.9914L19.8761 11.9944C19.8763 12.1236 19.8611 12.3282 19.835 12.5361H21.4636L19.0359 15.4261L16.666 12.5361H18.3191C18.3232 12.5127 18.3271 12.4884 18.3309 12.4631C18.3631 12.2512 18.3763 12.0542 18.3761 11.9974L18.3761 11.9944C18.3761 8.42789 15.4848 5.53662 11.9182 5.53662Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5635 15.0451C4.83232 15.6933 5.18405 16.2981 5.60526 16.8462L6.79464 15.9322C6.45239 15.4869 6.167 14.996 5.94908 14.4705L4.5635 15.0451Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.07569 18.3167C7.62381 18.7379 8.22858 19.0896 8.87685 19.3584L9.45143 17.9728C8.92593 17.7549 8.43505 17.4695 7.98968 17.1273L7.07569 18.3167Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.9781 19.3584C15.6264 19.0896 16.2311 18.7379 16.7792 18.3167L15.8653 17.1273C15.4199 17.4695 14.929 17.7549 14.4035 17.9728L14.9781 19.3584Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8876 19.8961C11.2283 19.9405 11.5754 19.9634 11.9275 19.9634C12.2796 19.9634 12.6267 19.9405 12.9673 19.8961L12.7733 18.4087C12.4968 18.4448 12.2145 18.4634 11.9275 18.4634C11.6404 18.4634 11.3581 18.4448 11.0816 18.4087L10.8876 19.8961Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.0302 11.9945L12.8085 10.9846L11.7986 8.76282L10.7887 10.9846L8.56697 11.9945L10.7887 13.0043L11.7986 15.2261L12.8085 13.0043L15.0302 11.9945Z"})]})}const subscription_trial_started_step={key:"woocommerce-subscriptions:trial-started",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Woo Subscription trial started","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a subscription trial started.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("subscription","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("trial","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("started","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_trial_started_icon_Icon,{}),edit:()=>null};function subscription_renewed_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.3068 16.8031C15.1599 17.8384 13.6404 18.4688 11.9737 18.4688C8.40113 18.4688 5.50497 15.5726 5.50497 12C5.50497 8.42741 8.40113 5.53125 11.9737 5.53125C15.5463 5.53125 18.4425 8.42741 18.4425 12C18.4425 12.1834 18.4348 12.365 18.4199 12.5445H16.6234L19.1234 15.5445L21.6234 12.5445H19.9242C19.9363 12.3646 19.9425 12.183 19.9425 12C19.9425 7.59898 16.3747 4.03125 11.9737 4.03125C7.57271 4.03125 4.00497 7.59898 4.00497 12C4.00497 16.401 7.57271 19.9688 11.9737 19.9688C14.0652 19.9688 15.9686 19.163 17.3902 17.8449L16.3068 16.8031Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1311 12.4535L14.3016 9.28302L15.4386 10.42L11.1322 14.717L8.5939 12.1607L9.72105 11.0335L11.1311 12.4535Z"})]})}const subscription_renewed_step={key:"woocommerce-subscriptions:subscription-renewed",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Woo Subscription renewed","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a subscription renewed.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("subscription","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("renewed","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_renewed_icon_Icon,{}),edit:()=>null};function subscription_payment_failed_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18 5.35132H6C5.16751 5.35132 4.50751 6.01881 4.50751 6.85132L4.5 15.8513C4.5 16.6838 5.16751 17.3513 6 17.3513H11.7075V15.8513H6V11.3513H19.5V6.85132C19.5 6.01881 18.8325 5.35132 18 5.35132ZM18 8.35132H6V6.85132H18V8.35132Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5355 15.8203L13.7678 17.5881L14.8284 18.6487L16.5962 16.8809L18.364 18.6487L19.4246 17.5881L17.6569 15.8203L19.4246 14.0525L18.364 12.9919L16.5962 14.7596L14.8284 12.9919L13.7678 14.0525L15.5355 15.8203Z"})]})}const subscription_payment_failed_step={key:"woocommerce-subscriptions:subscription-payment-failed",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Woo Subscription payment failed","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a payment failed.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("subscription","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("payment","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("failed","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_payment_failed_icon_Icon,{}),edit:()=>null};function subscription_expired_icon_Icon(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.3388 16.8031C15.1919 17.8384 13.6724 18.4688 12.0057 18.4688C8.43315 18.4688 5.53699 15.5726 5.53699 12C5.53699 8.42741 8.43315 5.53125 12.0057 5.53125C15.5783 5.53125 18.4745 8.42741 18.4745 12C18.4745 12.1834 18.4669 12.365 18.4519 12.5445H16.6554L19.1554 15.5445L21.6554 12.5445H19.9562C19.9683 12.3646 19.9745 12.183 19.9745 12C19.9745 7.59898 16.4068 4.03125 12.0057 4.03125C7.60472 4.03125 4.03699 7.59898 4.03699 12C4.03699 16.401 7.60472 19.9688 12.0057 19.9688C14.0973 19.9688 16.0006 19.163 17.4222 17.8449L16.3388 16.8031Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9407 12.4462H11.1558V7.98413H12.9407V12.4462Z"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9407 16.0158H11.1558V14.231H12.9407V16.0158Z"})]})}const subscription_expired_step={key:"woocommerce-subscriptions:subscription-expired",group:"triggers",title:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Woo Subscription expired","mailpoet-premium"),description:()=>(0,external_MailPoetLib_WordPressI18n_.__)("Start the automation when a subscription expires.","mailpoet-premium"),subtitle:()=>(0,external_MailPoetLib_WordPressI18n_._x)("Trigger","noun","mailpoet-premium"),keywords:[(0,external_MailPoetLib_WordPressI18n_.__)("woocommerce","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("subscription","mailpoet-premium"),(0,external_MailPoetLib_WordPressI18n_.__)("expired","mailpoet-premium")],foreground:"#2271b1",background:"#f0f6fc",icon:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(subscription_expired_icon_Icon,{}),edit:()=>null};async function createNewautomationAndRedirect(errorHandler){const endpoint=`${window.mailpoet_automation_api.root}/mailpoet/v1/automations`,nonce=window.mailpoet_automation_api.nonce;try{const res=await fetch(endpoint,{method:"POST",body:JSON.stringify({name:(0,external_MailPoetLib_WordPressI18n_.__)("New automation","mailpoet-premium"),steps:{root:{id:"root",type:"root",key:"core:root",args:{},next_steps:[]}}}),headers:{"Content-Type":"application/json","X-WP-Nonce":nonce}}),resJson=await res.json();if(resJson?.data?.id){external_MailPoet_default().trackEvent("Automations > New empty automation");const url=(0,external_MailPoetLib_WordPressUrl_namespaceObject.addQueryArgs)(window.mailpoet_urls.automationEditor,{id:resJson.data.id});return void(window.location.href=url)}errorHandler(resJson?.message??(0,external_MailPoetLib_WordPressI18n_.__)("An unknown error occurred.","mailpoet-premium"))}catch(error){errorHandler(error instanceof Error?error.message:(0,external_MailPoetLib_WordPressI18n_.__)("An unknown error occurred.","mailpoet-premium"))}}__webpack_require__(188).I&&((()=>{const storeConfig={actions:actions_namespaceObject,controls:external_MailPoetLib_WordPressDataControls_namespaceObject.controls,selectors:selectors_namespaceObject,reducer,initialState:{tags:window.mailpoet_tags}},store=(0,external_MailPoetLib_WordPressData_.createReduxStore)(constants_storeName,storeConfig);(0,external_MailPoetLib_WordPressData_.register)(store)})(),(0,store.n_)(),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.step.more-controls","mailpoet",((controls,stepData)=>{const[showDeleteConfirmDialog,setShowDeleteConfirmDialog]=(0,external_MailPoetLib_React_.useState)(!1),{step}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({step:select(store.Hz).getStepType(stepData.key)})),[stepData]);return{...controls,delete:{key:"delete",control:{title:(0,external_MailPoetLib_WordPressI18n_.__)("Delete step","mailpoet-premium"),icon:external_MailPoetLib_WordPressIcons_.trash,onClick:()=>setShowDeleteConfirmDialog(!0)},slot:()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(DeleteMenuItem,{onClose:()=>setShowDeleteConfirmDialog(!1),isOpen:showDeleteConfirmDialog,stepData,step})}}})),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.render_step","mailpoet",(renderStep=>function(stepData,index){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(StepWrapper,{step:stepData,children:renderStep(stepData,index)})})),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.render_step_separator","mailpoet",(renderStep=>function(stepData,index){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SeparatorWrapper,{step:stepData,children:renderStep(stepData,index)})})),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.filters.panel.content","mailpoet",((_,strings,onChange)=>function(stepData){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(FilterSelector,{step:stepData,strings,onChange})})),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.filters.group_operator_change_callback","mailpoet",(()=>(stepId,groupId,operator)=>(0,external_MailPoetLib_WordPressData_.dispatch)(store.Hz).updateFilterGroupOperator(stepId,groupId,operator))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.filters.filter_wrapper","mailpoet",(()=>FilterWrapper)),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.register_filter_type","mailpoet",(filterType=>{switch(filterType.fieldType){case"boolean":return{...filterType,edit:BooleanValue};case"number":return{...filterType,edit:NumberValue};case"integer":return{...filterType,edit:function(props){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(NumberValue,{step:1,...props})}};case"string":return{...filterType,edit:StringValue};case"datetime":return{...filterType,edit:DateTimeValue};case"enum":case"enum_array":return{...filterType,edit:EnumArrayValue};default:return filterType}})),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.register_step_type","mailpoet",(step=>"mailpoet:notification-email"===step.key?notification_email_step:"mailpoet:custom-action"===step.key?custom_action_step:"mailpoet:custom-trigger"===step.key?custom_trigger_step:"mailpoet:unsubscribe"===step.key?unsubscribe_step:"mailpoet:add-tag"===step.key?add_tag_step:"mailpoet:remove-tag"===step.key?remove_tag_step:"mailpoet:add-to-list"===step.key?add_to_list_step:"mailpoet:remove-from-list"===step.key?remove_from_list_step:"mailpoet:update-subscriber"===step.key?update_subscriber_step:"mailpoet:subscriber-tag-added"===step.key?tag_added_step:"mailpoet:subscriber-tag-removed"===step.key?tag_removed_step:"mailpoet:clicks-email-link"===step.key?clicks_email_link_step:step)),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.trigger.order_status_changed.order_status_options","mailpoet",(options=>([...options.values()].forEach((item=>{options.set(item.value,{...item,isDisabled:!1})})),options))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.send_email.google_analytics_panel","mailpoet",(()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(GoogleAnalyticsPanel,{}))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.send_email.create_step","mailpoet",((step,automationId)=>({...step,args:{...step.args,ga_campaign:step.args.subject?generateGaCampaignName(automationId,step.args.subject):void 0}}))),woocommerce_initialize(),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.register_step_type","mailpoet",(step=>"wordpress:made-a-comment"===step.key?made_a_comment_step:step)),woocommerce_initialize(),external_MailPoet_default().isWoocommerceSubscriptionsActive&&external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.register_step_type","mailpoet",(step=>"woocommerce-subscriptions:subscription-status-changed"===step.key?subscription_status_changed_step:"woocommerce-subscriptions:subscription-created"===step.key?subscription_created_step:"woocommerce-subscriptions:trial-ended"===step.key?subscription_trial_ended_step:"woocommerce-subscriptions:trial-started"===step.key?subscription_trial_started_step:"woocommerce-subscriptions:subscription-renewed"===step.key?subscription_renewed_step:"woocommerce-subscriptions:subscription-payment-failed"===step.key?subscription_payment_failed_step:"woocommerce-subscriptions:subscription-expired"===step.key?subscription_expired_step:step)),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.templates.from_scratch_button","mailpoet",(()=>createNewautomationAndRedirect)),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet.automation.hero.actions","mailpoet",(actions=>({...actions,createNewautomation:{key:"createNewautomation",control:{title:(0,external_MailPoetLib_WordPressI18n_.__)("New automation","mailpoet-premium"),onClick:createNewautomationAndRedirect,icon:null}}}))))})(),(()=>{"use strict";var external_MailPoetLib_Hooks_=__webpack_require__(401);const external_MailPoetLib_WooCommerceComponents_namespaceObject=MailPoetLib.WooCommerceComponents,external_MailPoetLib_WooCommerceDate_namespaceObject=MailPoetLib.WooCommerceDate;var external_MailPoetLib_WordPressData_=__webpack_require__(54);const external_MailPoetLib_AutomationAnalyticsStore_namespaceObject=MailPoetLib.AutomationAnalyticsStore;var external_MailPoetLib_ReactJsxRuntime_=__webpack_require__(813);function DateFilter(){const{setQuery}=(0,external_MailPoetLib_WordPressData_.useDispatch)(external_MailPoetLib_AutomationAnalyticsStore_namespaceObject.storeName),{query}=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>({query:select(external_MailPoetLib_AutomationAnalyticsStore_namespaceObject.storeName).getCurrentQuery()}))),{period,compare,before,after}=(0,external_MailPoetLib_WooCommerceDate_namespaceObject.getDateParamsFromQuery)(query,"period=month&compare=previous_year"),{primary:primaryDate,secondary:secondaryDate}=(0,external_MailPoetLib_WooCommerceDate_namespaceObject.getCurrentDates)(query,"period=month&compare=previous_year"),dateQuery={period,compare,before,after,primaryDate,secondaryDate};return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-analytics-filter-element woocommerce-layout",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WooCommerceComponents_namespaceObject.DateRangeFilterPicker,{query,onRangeSelect:q=>{setQuery(q)},dateQuery,isoDateFormat:external_MailPoetLib_WooCommerceDate_namespaceObject.isoDateFormat})})}var external_MailPoetLib_WordpressComponentsButton_=__webpack_require__(414),external_MailPoetLib_WordpressComponentsButton_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsButton_),external_MailPoetLib_WordPressI18n_=__webpack_require__(394);const external_MailPoetLib_WordpressComponentsTreeSelect_namespaceObject=MailPoetLib.WordpressComponentsTreeSelect;var external_MailPoetLib_WordpressComponentsTreeSelect_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsTreeSelect_namespaceObject);function MultiSelect({selected,label,allOption,options,onChange}){let selectedId="";return selected&&selected.length>0&&(selectedId=selected.join(",")),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-analytics-multiselect",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTreeSelect_default(),{label,noOptionLabel:allOption,onChange:value=>{onChange(value.split(","))},selectedId,tree:options})})}const storeName="mailpoet_automation_analytics";function ClearAllFilters({section,onClick}){return section.customQuery.filter||section.customQuery.search?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{className:"mailpoet-analytics-clear-filters",variant:"tertiary",onClick:()=>{!async function(section,onClick){await(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateSection({...section,customQuery:{...section.customQuery,filter:void 0,search:""}}),void 0!==onClick&&onClick()}(section,onClick)},children:(0,external_MailPoetLib_WordPressI18n_.__)("Clear all filters","mailpoet-premium")}):null}function OrderFilter(){const{section}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({section:s(storeName).getSection("orders")})));return void 0===section.data?(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-analytics-filter",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"is-loading"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"is-loading"})]}):(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("form",{className:"mailpoet-analytics-filter",onSubmit:e=>{e.preventDefault(),(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateSection({...section,customQuery:{...section.customQuery,filter:{emails:section.currentView.filters.emails}}})},children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-analytics-filter-controls",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(MultiSelect,{selected:section.currentView.filters.emails,label:(0,external_MailPoetLib_WordPressI18n_.__)("Select Email","mailpoet-premium"),allOption:(0,external_MailPoetLib_WordPressI18n_.__)("All emails","mailpoet-premium"),options:section.data?.emails,onChange:emails=>{(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateCurrentView(section.id,{filters:{emails}})}})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ClearAllFilters,{section,onClick:()=>{(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateCurrentView(section.id,{filters:{emails:[]}})}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{variant:"primary",type:"submit",children:(0,external_MailPoetLib_WordPressI18n_.__)("Filter","mailpoet-premium")})]})]})}var external_MailPoetLib_WordpressComponentsSelectControl_=__webpack_require__(655),external_MailPoetLib_WordpressComponentsSelectControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsSelectControl_),external_MailPoetLib_WordpressComponentsTextControl_=__webpack_require__(282),external_MailPoetLib_WordpressComponentsTextControl_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsTextControl_),store=__webpack_require__(643);const statusMap={running:(0,external_MailPoetLib_WordPressI18n_.__)("In Progress","mailpoet-premium"),cancelled:(0,external_MailPoetLib_WordPressI18n_.__)("Cancelled","mailpoet-premium"),complete:(0,external_MailPoetLib_WordPressI18n_.__)("Completed","mailpoet-premium"),failed:(0,external_MailPoetLib_WordPressI18n_.__)("Failed","mailpoet-premium")},sortByLabelCallback=(a,b)=>a.label.localeCompare(b.label),sortByNameCallback=(a,b)=>a.name.localeCompare(b.name);function getStatusOptions(){const statusOptions=Object.keys(statusMap).map((status=>({value:status,label:statusMap[status]}))).sort(sortByLabelCallback);return[{value:"",label:(0,external_MailPoetLib_WordPressI18n_.__)("All","mailpoet-premium")}].concat(statusOptions)}function getStepOptions(automation){const steps=Object.values(automation.steps).map((step=>{if("action"!==step.type)return null;const name=(0,external_MailPoetLib_WordPressData_.select)(store.Hz).getRegistryStep(step.key)?.name;return{id:step.id,key:step.key,name,children:[]}})).filter((value=>null!==value)).sort(sortByNameCallback),stepTypes={};for(let i=0;i<steps.length;i+=1){const s=steps[i],key=s.key;void 0===stepTypes[key]&&(stepTypes[key]={id:"",name:s.name,children:[]}),stepTypes[key].id=stepTypes[key].id.length>0?`${stepTypes[key].id},${s.id}`:s.id,stepTypes[key].children.push(s)}return Object.values(stepTypes).map((stepType=>{const children=stepType.children.map(((step,i)=>({...step,name:(0,external_MailPoetLib_WordPressI18n_.sprintf)((0,external_MailPoetLib_WordPressI18n_.__)('%d. "%s" step',"mailpoet-premium"),i+1,step.name)})));return{...stepType,children:1===stepType.children.length?[]:children}}))}function SubscriberFilter(){const{automation,section}=(0,external_MailPoetLib_WordPressData_.useSelect)((s=>({automation:s(store.Hz).getAutomationData(),section:s(storeName).getSection("subscribers")})));return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("form",{className:"mailpoet-analytics-filter",onSubmit:e=>{e.preventDefault(),(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateSection({...section,customQuery:{...section.customQuery,filter:section.currentView.filters,search:section.currentView.search}})},children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-analytics-filter-controls",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsTextControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Search subscriber","mailpoet-premium"),value:section.currentView.search,onChange:search=>{(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateCurrentView(section.id,{...section.currentView,search})}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(MultiSelect,{selected:section.currentView.filters.step,label:(0,external_MailPoetLib_WordPressI18n_.__)("Select step","mailpoet-premium"),allOption:(0,external_MailPoetLib_WordPressI18n_.__)("All steps","mailpoet-premium"),options:getStepOptions(automation),onChange:step=>{(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateCurrentView(section.id,{...section.currentView,filters:{...section.currentView.filters,step}})}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsSelectControl_default(),{label:(0,external_MailPoetLib_WordPressI18n_.__)("Status","mailpoet-premium"),options:getStatusOptions(),value:section.currentView.filters.status.length>0?section.currentView.filters.status[0]:"",onChange:status=>{(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateCurrentView(section.id,{...section.currentView,filters:{...section.currentView.filters,status:[status]}})}})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ClearAllFilters,{section,onClick:()=>{(0,external_MailPoetLib_WordPressData_.dispatch)(storeName).updateCurrentView(section.id,{search:"",filters:{step:[],status:[]}})}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{variant:"primary",type:"submit",children:(0,external_MailPoetLib_WordPressI18n_.__)("Filter","mailpoet-premium")})]})]})}var premium=__webpack_require__(188);premium.I&&!premium.R.detailedAnalytics.isRestricted&&(external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_analytics_filter","mailpoet",(()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(DateFilter,{}))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_analytics_orders_before_table","mailpoet",(()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(OrderFilter,{}))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_analytics_subscribers_before_table","mailpoet",(()=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SubscriberFilter,{}))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_analytics_section_sample_data","mailpoet",((data,sectionId)=>["orders","subscribers","runLogs"].includes(sectionId)?void 0:data)))})(),(()=>{"use strict";var modules_namespaceObject={};__webpack_require__.r(modules_namespaceObject),__webpack_require__.d(modules_namespaceObject,{VERSION:()=>VERSION,after:()=>after,all:()=>every,allKeys:()=>allKeys,any:()=>some,assign:()=>extendOwn,before:()=>before,bind:()=>bind,bindAll:()=>bindAll,chain:()=>chain,chunk:()=>chunk,clone:()=>clone,collect:()=>map,compact:()=>compact,compose:()=>compose,constant:()=>constant,contains:()=>contains,countBy:()=>countBy,create:()=>create,debounce:()=>debounce,default:()=>underscore_array_methods,defaults:()=>defaults,defer:()=>defer,delay:()=>delay,detect:()=>find,difference:()=>difference,drop:()=>rest,each:()=>each,escape:()=>modules_escape,every:()=>every,extend:()=>extend,extendOwn:()=>extendOwn,filter:()=>filter,find:()=>find,findIndex:()=>findIndex,findKey:()=>findKey,findLastIndex:()=>findLastIndex,findWhere:()=>findWhere,first:()=>first,flatten:()=>flatten_flatten,foldl:()=>reduce,foldr:()=>reduceRight,forEach:()=>each,functions:()=>functions,get:()=>get,groupBy:()=>groupBy,has:()=>has_has,head:()=>first,identity:()=>identity,include:()=>contains,includes:()=>contains,indexBy:()=>indexBy,indexOf:()=>indexOf,initial:()=>initial,inject:()=>reduce,intersection:()=>intersection,invert:()=>invert,invoke:()=>invoke,isArguments:()=>modules_isArguments,isArray:()=>isArray,isArrayBuffer:()=>isArrayBuffer,isBoolean:()=>isBoolean,isDataView:()=>modules_isDataView,isDate:()=>isDate,isElement:()=>isElement,isEmpty:()=>isEmpty,isEqual:()=>isEqual,isError:()=>isError,isFinite:()=>isFinite_isFinite,isFunction:()=>modules_isFunction,isMap:()=>isMap,isMatch:()=>isMatch,isNaN:()=>isNaN_isNaN,isNull:()=>isNull,isNumber:()=>isNumber,isObject:()=>isObject,isRegExp:()=>isRegExp,isSet:()=>isSet,isString:()=>isString,isSymbol:()=>isSymbol,isTypedArray:()=>modules_isTypedArray,isUndefined:()=>isUndefined,isWeakMap:()=>isWeakMap,isWeakSet:()=>isWeakSet,iteratee:()=>iteratee,keys:()=>keys,last:()=>last,lastIndexOf:()=>lastIndexOf,map:()=>map,mapObject:()=>mapObject,matcher:()=>matcher,matches:()=>matcher,max:()=>max,memoize:()=>memoize,methods:()=>functions,min:()=>min,mixin:()=>mixin,negate:()=>negate,noop:()=>noop,now:()=>now,object:()=>object,omit:()=>omit,once:()=>once,pairs:()=>pairs,partial:()=>modules_partial,partition:()=>partition,pick:()=>pick,pluck:()=>pluck,property:()=>property,propertyOf:()=>propertyOf,random:()=>random,range:()=>range,reduce:()=>reduce,reduceRight:()=>reduceRight,reject:()=>reject,rest:()=>rest,restArguments:()=>restArguments,result:()=>result,sample:()=>sample,select:()=>filter,shuffle:()=>shuffle,size:()=>size,some:()=>some,sortBy:()=>sortBy,sortedIndex:()=>sortedIndex,tail:()=>rest,take:()=>first,tap:()=>tap,template:()=>template,templateSettings:()=>templateSettings,throttle:()=>throttle,times:()=>times,toArray:()=>toArray,toPath:()=>toPath,transpose:()=>unzip,unescape:()=>modules_unescape,union:()=>union,uniq:()=>uniq,unique:()=>uniq,uniqueId:()=>uniqueId,unzip:()=>unzip,values:()=>values,where:()=>where,without:()=>without,wrap:()=>wrap,zip:()=>zip});var external_MailPoetLib_Hooks_=__webpack_require__(401),external_MailPoet_=__webpack_require__(632),external_MailPoet_default=__webpack_require__.n(external_MailPoet_),external_MailPoetLib_ReactStringReplace_=__webpack_require__(225),external_MailPoetLib_ReactStringReplace_default=__webpack_require__.n(external_MailPoetLib_ReactStringReplace_);const external_MailPoetLib_HelpTooltip_namespaceObject=MailPoetLib.HelpTooltip;var external_MailPoetLib_ReactJsxRuntime_=__webpack_require__(813);function RevenuesStats({revenue}){return revenue&&0!==revenue.count?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet_stat_big mailpoet_stat_spaced",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-statistics-value",children:[external_MailPoetLib_ReactStringReplace_default()(external_MailPoet_default().I18n.t("revenuesStats"),/(%1s|%2s)/,(match=>"%1s"===match?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("span",{className:"mailpoet-statistics-value-number",children:revenue.formatted},"a"):"%2s"===match?revenue.count:"")),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_HelpTooltip_namespaceObject.Tooltip,{tooltip:external_MailPoet_default().I18n.t("revenueStatsTooltip"),place:"top",tooltipId:"helpTooltipStatsRevenue"})]})}):null}function renderLink(url){const parts=url.split("?"),domain=parts[0];let params=parts[1]||"";return params&&(params=params.split("&").filter((p=>!p.startsWith("utm_medium")&&!p.startsWith("utm_source")&&!p.startsWith("utm_campaign"))).join("&")),params&&(params=`?${params}`),external_MailPoet_default().getShortcodeLinks()[url]?external_MailPoet_default().getShortcodeLinks()[url]:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:url,target:"_blank",rel:"noopener noreferrer",className:"mailpoet-stats-link",children:domain+params})}function ClickedLinksTable(props){const{links}=props;let content;return content=0===links.length?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("tr",{children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{colSpan:2,children:external_MailPoet_default().I18n.t("noClickedLinksFound")})}):links.map((row=>(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("tr",{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{children:renderLink(row.url)}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{children:row.cnt})]},`link-${row.url}`))),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-listing mailpoet-listing-no-space",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("table",{className:"mailpoet-listing-table",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("thead",{children:(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("tr",{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("th",{children:external_MailPoet_default().I18n.t("linkColumn")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("th",{children:external_MailPoet_default().I18n.t("uniqueClicksColumn")})]})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("tbody",{children:content})]})})}var external_MailPoetLib_React_=__webpack_require__(862),external_MailPoetLib_Common_=__webpack_require__(990);function PurchasedProduct({product}){const Element=product.product_id?"a":"div";return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(Element,{className:"mailpoet-stats-product","data-acceptance-id":`purchased-product-${product.name}`,href:product.product_id&&`post.php?post=${product.product_id}&action=edit`,target:"_blank",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-stats-product-image",style:{backgroundImage:product.image_url?`url('${product.image_url}')`:null}}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-stats-product-info",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("h5",{className:"mailpoet-h5",children:product.name}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:external_MailPoet_default().I18n.t("nProductsSold").replace("%1s",product.count.toString())}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:external_MailPoet_default().I18n.t("totalNetRevenue").replace("%1s",product.formatted_total)})]})]})}function PurchasedProducts({newsletter}){const[initalized,setInitialized]=(0,external_MailPoetLib_React_.useState)(!1),[products,setProducts]=(0,external_MailPoetLib_React_.useState)(null);return(0,external_MailPoetLib_React_.useEffect)((()=>{external_MailPoet_default().Ajax.post({api_version:external_MailPoet_default().apiVersion,endpoint:"stats",action:"getProducts",data:{newsletter_id:newsletter.id}}).done((response=>{setInitialized(!0);const responseData=Array.isArray(response.data)?response.data:[];setProducts(responseData)})).fail((()=>{setInitialized(!0)}))}),[newsletter.id]),null===products||0===products.length?initalized?(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:external_MailPoet_default().I18n.t("noProducts1")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:external_MailPoetLib_ReactStringReplace_default()(external_MailPoet_default().I18n.t("noProducts2"),/\[link\](.*?)\[\/link\]/,(match=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:"https://www.mailpoet.com/blog/woocommerce-follow-up-emails/",rel:"noopener noreferrer",target:"_blank",className:"mailpoet-link",children:match},match)))}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:external_MailPoetLib_ReactStringReplace_default()(external_MailPoet_default().I18n.t("noProducts3"),/\[link\](.*?)\[\/link\]/,(match=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:"https://kb.mailpoet.com/article/275-how-to-add-a-products-widget-to-the-newsletter","data-beacon-article":"5d3983ff2c7d3a2ec4bf66ea",rel:"noopener noreferrer",target:"_blank",className:"mailpoet-link",children:match},match)))})]}):(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Loader,{}):(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-stats-products","data-acceptance-id":"purchased_product_list",children:Object.values(products).map((product=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(PurchasedProduct,{product},product.product_id)))})}var VERSION="1.13.6",root="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},ArrayProto=Array.prototype,ObjProto=Object.prototype,SymbolProto="undefined"!=typeof Symbol?Symbol.prototype:null,push=ArrayProto.push,slice=ArrayProto.slice,_setup_toString=ObjProto.toString,_setup_hasOwnProperty=ObjProto.hasOwnProperty,supportsArrayBuffer="undefined"!=typeof ArrayBuffer,supportsDataView="undefined"!=typeof DataView,nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeCreate=Object.create,nativeIsView=supportsArrayBuffer&&ArrayBuffer.isView,_isNaN=isNaN,_isFinite=isFinite,hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MAX_ARRAY_INDEX=Math.pow(2,53)-1;function restArguments(func,startIndex){return startIndex=null==startIndex?func.length-1:+startIndex,function(){for(var length=Math.max(arguments.length-startIndex,0),rest=Array(length),index=0;index<length;index++)rest[index]=arguments[index+startIndex];switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);case 2:return func.call(this,arguments[0],arguments[1],rest)}var args=Array(startIndex+1);for(index=0;index<startIndex;index++)args[index]=arguments[index];return args[startIndex]=rest,func.apply(this,args)}}function isObject(obj){var type=typeof obj;return"function"===type||"object"===type&&!!obj}function isNull(obj){return null===obj}function isUndefined(obj){return void 0===obj}function isBoolean(obj){return!0===obj||!1===obj||"[object Boolean]"===_setup_toString.call(obj)}function isElement(obj){return!(!obj||1!==obj.nodeType)}function tagTester(name){var tag="[object "+name+"]";return function(obj){return _setup_toString.call(obj)===tag}}const isString=tagTester("String"),isNumber=tagTester("Number"),isDate=tagTester("Date"),isRegExp=tagTester("RegExp"),isError=tagTester("Error"),isSymbol=tagTester("Symbol"),isArrayBuffer=tagTester("ArrayBuffer");var isFunction=tagTester("Function"),nodelist=root.document&&root.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof nodelist&&(isFunction=function(obj){return"function"==typeof obj||!1});const modules_isFunction=isFunction,_hasObjectTag=tagTester("Object");var hasStringTagBug=supportsDataView&&_hasObjectTag(new DataView(new ArrayBuffer(8))),isIE11="undefined"!=typeof Map&&_hasObjectTag(new Map),isDataView=tagTester("DataView");const modules_isDataView=hasStringTagBug?function(obj){return null!=obj&&modules_isFunction(obj.getInt8)&&isArrayBuffer(obj.buffer)}:isDataView,isArray=nativeIsArray||tagTester("Array");function has(obj,key){return null!=obj&&_setup_hasOwnProperty.call(obj,key)}var isArguments=tagTester("Arguments");!function(){isArguments(arguments)||(isArguments=function(obj){return has(obj,"callee")})}();const modules_isArguments=isArguments;function isFinite_isFinite(obj){return!isSymbol(obj)&&_isFinite(obj)&&!isNaN(parseFloat(obj))}function isNaN_isNaN(obj){return isNumber(obj)&&_isNaN(obj)}function constant(value){return function(){return value}}function createSizePropertyCheck(getSizeProperty){return function(collection){var sizeProperty=getSizeProperty(collection);return"number"==typeof sizeProperty&&sizeProperty>=0&&sizeProperty<=MAX_ARRAY_INDEX}}function shallowProperty(key){return function(obj){return null==obj?void 0:obj[key]}}const _getByteLength=shallowProperty("byteLength"),_isBufferLike=createSizePropertyCheck(_getByteLength);var typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const modules_isTypedArray=supportsArrayBuffer?function(obj){return nativeIsView?nativeIsView(obj)&&!modules_isDataView(obj):_isBufferLike(obj)&&typedArrayPattern.test(_setup_toString.call(obj))}:constant(!1),_getLength=shallowProperty("length");function collectNonEnumProps(obj,keys){keys=function(keys){for(var hash={},l=keys.length,i=0;i<l;++i)hash[keys[i]]=!0;return{contains:function(key){return!0===hash[key]},push:function(key){return hash[key]=!0,keys.push(key)}}}(keys);var nonEnumIdx=nonEnumerableProps.length,constructor=obj.constructor,proto=modules_isFunction(constructor)&&constructor.prototype||ObjProto,prop="constructor";for(has(obj,prop)&&!keys.contains(prop)&&keys.push(prop);nonEnumIdx--;)(prop=nonEnumerableProps[nonEnumIdx])in obj&&obj[prop]!==proto[prop]&&!keys.contains(prop)&&keys.push(prop)}function keys(obj){if(!isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)has(obj,key)&&keys.push(key);return hasEnumBug&&collectNonEnumProps(obj,keys),keys}function isEmpty(obj){if(null==obj)return!0;var length=_getLength(obj);return"number"==typeof length&&(isArray(obj)||isString(obj)||modules_isArguments(obj))?0===length:0===_getLength(keys(obj))}function isMatch(object,attrs){var _keys=keys(attrs),length=_keys.length;if(null==object)return!length;for(var obj=Object(object),i=0;i<length;i++){var key=_keys[i];if(attrs[key]!==obj[key]||!(key in obj))return!1}return!0}function _(obj){return obj instanceof _?obj:this instanceof _?void(this._wrapped=obj):new _(obj)}function toBufferView(bufferSource){return new Uint8Array(bufferSource.buffer||bufferSource,bufferSource.byteOffset||0,_getByteLength(bufferSource))}_.VERSION=VERSION,_.prototype.value=function(){return this._wrapped},_.prototype.valueOf=_.prototype.toJSON=_.prototype.value,_.prototype.toString=function(){return String(this._wrapped)};var tagDataView="[object DataView]";function eq(a,b,aStack,bStack){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return!1;if(a!=a)return b!=b;var type=typeof a;return("function"===type||"object"===type||"object"==typeof b)&&deepEq(a,b,aStack,bStack)}function deepEq(a,b,aStack,bStack){a instanceof _&&(a=a._wrapped),b instanceof _&&(b=b._wrapped);var className=_setup_toString.call(a);if(className!==_setup_toString.call(b))return!1;if(hasStringTagBug&&"[object Object]"==className&&modules_isDataView(a)){if(!modules_isDataView(b))return!1;className=tagDataView}switch(className){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!=+a?+b!=+b:0==+a?1/+a==1/b:+a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object Symbol]":return SymbolProto.valueOf.call(a)===SymbolProto.valueOf.call(b);case"[object ArrayBuffer]":case tagDataView:return deepEq(toBufferView(a),toBufferView(b),aStack,bStack)}var areArrays="[object Array]"===className;if(!areArrays&&modules_isTypedArray(a)){if(_getByteLength(a)!==_getByteLength(b))return!1;if(a.buffer===b.buffer&&a.byteOffset===b.byteOffset)return!0;areArrays=!0}if(!areArrays){if("object"!=typeof a||"object"!=typeof b)return!1;var aCtor=a.constructor,bCtor=b.constructor;if(aCtor!==bCtor&&!(modules_isFunction(aCtor)&&aCtor instanceof aCtor&&modules_isFunction(bCtor)&&bCtor instanceof bCtor)&&"constructor"in a&&"constructor"in b)return!1}bStack=bStack||[];for(var length=(aStack=aStack||[]).length;length--;)if(aStack[length]===a)return bStack[length]===b;if(aStack.push(a),bStack.push(b),areArrays){if((length=a.length)!==b.length)return!1;for(;length--;)if(!eq(a[length],b[length],aStack,bStack))return!1}else{var key,_keys=keys(a);if(length=_keys.length,keys(b).length!==length)return!1;for(;length--;)if(!has(b,key=_keys[length])||!eq(a[key],b[key],aStack,bStack))return!1}return aStack.pop(),bStack.pop(),!0}function isEqual(a,b){return eq(a,b)}function allKeys(obj){if(!isObject(obj))return[];var keys=[];for(var key in obj)keys.push(key);return hasEnumBug&&collectNonEnumProps(obj,keys),keys}function ie11fingerprint(methods){var length=_getLength(methods);return function(obj){if(null==obj)return!1;var keys=allKeys(obj);if(_getLength(keys))return!1;for(var i=0;i<length;i++)if(!modules_isFunction(obj[methods[i]]))return!1;return methods!==weakMapMethods||!modules_isFunction(obj[forEachName])}}var forEachName="forEach",commonInit=["clear","delete"],mapTail=["get","has","set"],mapMethods=commonInit.concat(forEachName,mapTail),weakMapMethods=commonInit.concat(mapTail),setMethods=["add"].concat(commonInit,forEachName,"has");const isMap=isIE11?ie11fingerprint(mapMethods):tagTester("Map"),isWeakMap=isIE11?ie11fingerprint(weakMapMethods):tagTester("WeakMap"),isSet=isIE11?ie11fingerprint(setMethods):tagTester("Set"),isWeakSet=tagTester("WeakSet");function values(obj){for(var _keys=keys(obj),length=_keys.length,values=Array(length),i=0;i<length;i++)values[i]=obj[_keys[i]];return values}function pairs(obj){for(var _keys=keys(obj),length=_keys.length,pairs=Array(length),i=0;i<length;i++)pairs[i]=[_keys[i],obj[_keys[i]]];return pairs}function invert(obj){for(var result={},_keys=keys(obj),i=0,length=_keys.length;i<length;i++)result[obj[_keys[i]]]=_keys[i];return result}function functions(obj){var names=[];for(var key in obj)modules_isFunction(obj[key])&&names.push(key);return names.sort()}function createAssigner(keysFunc,defaults){return function(obj){var length=arguments.length;if(defaults&&(obj=Object(obj)),length<2||null==obj)return obj;for(var index=1;index<length;index++)for(var source=arguments[index],keys=keysFunc(source),l=keys.length,i=0;i<l;i++){var key=keys[i];defaults&&void 0!==obj[key]||(obj[key]=source[key])}return obj}}const extend=createAssigner(allKeys),extendOwn=createAssigner(keys),defaults=createAssigner(allKeys,!0);function baseCreate(prototype){if(!isObject(prototype))return{};if(nativeCreate)return nativeCreate(prototype);var Ctor=function(){};Ctor.prototype=prototype;var result=new Ctor;return Ctor.prototype=null,result}function create(prototype,props){var result=baseCreate(prototype);return props&&extendOwn(result,props),result}function clone(obj){return isObject(obj)?isArray(obj)?obj.slice():extend({},obj):obj}function tap(obj,interceptor){return interceptor(obj),obj}function toPath(path){return isArray(path)?path:[path]}function _toPath_toPath(path){return _.toPath(path)}function deepGet(obj,path){for(var length=path.length,i=0;i<length;i++){if(null==obj)return;obj=obj[path[i]]}return length?obj:void 0}function get(object,path,defaultValue){var value=deepGet(object,_toPath_toPath(path));return isUndefined(value)?defaultValue:value}function has_has(obj,path){for(var length=(path=_toPath_toPath(path)).length,i=0;i<length;i++){var key=path[i];if(!has(obj,key))return!1;obj=obj[key]}return!!length}function identity(value){return value}function matcher(attrs){return attrs=extendOwn({},attrs),function(obj){return isMatch(obj,attrs)}}function property(path){return path=_toPath_toPath(path),function(obj){return deepGet(obj,path)}}function optimizeCb(func,context,argCount){if(void 0===context)return func;switch(null==argCount?3:argCount){case 1:return function(value){return func.call(context,value)};case 3:return function(value,index,collection){return func.call(context,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection)}}return function(){return func.apply(context,arguments)}}function baseIteratee(value,context,argCount){return null==value?identity:modules_isFunction(value)?optimizeCb(value,context,argCount):isObject(value)&&!isArray(value)?matcher(value):property(value)}function iteratee(value,context){return baseIteratee(value,context,1/0)}function cb(value,context,argCount){return _.iteratee!==iteratee?_.iteratee(value,context):baseIteratee(value,context,argCount)}function mapObject(obj,iteratee,context){iteratee=cb(iteratee,context);for(var _keys=keys(obj),length=_keys.length,results={},index=0;index<length;index++){var currentKey=_keys[index];results[currentKey]=iteratee(obj[currentKey],currentKey,obj)}return results}function noop(){}function propertyOf(obj){return null==obj?noop:function(path){return get(obj,path)}}function times(n,iteratee,context){var accum=Array(Math.max(0,n));iteratee=optimizeCb(iteratee,context,1);for(var i=0;i<n;i++)accum[i]=iteratee(i);return accum}function random(min,max){return null==max&&(max=min,min=0),min+Math.floor(Math.random()*(max-min+1))}_.toPath=toPath,_.iteratee=iteratee;const now=Date.now||function(){return(new Date).getTime()};function createEscaper(map){var escaper=function(match){return map[match]},source="(?:"+keys(map).join("|")+")",testRegexp=RegExp(source),replaceRegexp=RegExp(source,"g");return function(string){return string=null==string?"":""+string,testRegexp.test(string)?string.replace(replaceRegexp,escaper):string}}const _escapeMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},modules_escape=createEscaper(_escapeMap),modules_unescape=createEscaper(invert(_escapeMap)),templateSettings=_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(match){return"\\"+escapes[match]}var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(text,settings,oldSettings){!settings&&oldSettings&&(settings=oldSettings),settings=defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g"),index=0,source="__p+='";text.replace(matcher,(function(match,escape,interpolate,evaluate,offset){return source+=text.slice(index,offset).replace(escapeRegExp,escapeChar),index=offset+match.length,escape?source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'":interpolate?source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'":evaluate&&(source+="';\n"+evaluate+"\n__p+='"),match})),source+="';\n";var render,argument=settings.variable;if(argument){if(!bareIdentifier.test(argument))throw new Error("variable is not a bare identifier: "+argument)}else source="with(obj||{}){\n"+source+"}\n",argument="obj";source="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{render=new Function(argument,"_",source)}catch(e){throw e.source=source,e}var template=function(data){return render.call(this,data,_)};return template.source="function("+argument+"){\n"+source+"}",template}function result(obj,path,fallback){var length=(path=_toPath_toPath(path)).length;if(!length)return modules_isFunction(fallback)?fallback.call(obj):fallback;for(var i=0;i<length;i++){var prop=null==obj?void 0:obj[path[i]];void 0===prop&&(prop=fallback,i=length),obj=modules_isFunction(prop)?prop.call(obj):prop}return obj}var idCounter=0;function uniqueId(prefix){var id=++idCounter+"";return prefix?prefix+id:id}function chain(obj){var instance=_(obj);return instance._chain=!0,instance}function executeBound(sourceFunc,boundFunc,context,callingContext,args){if(!(callingContext instanceof boundFunc))return sourceFunc.apply(context,args);var self=baseCreate(sourceFunc.prototype),result=sourceFunc.apply(self,args);return isObject(result)?result:self}var partial=restArguments((function(func,boundArgs){var placeholder=partial.placeholder,bound=function(){for(var position=0,length=boundArgs.length,args=Array(length),i=0;i<length;i++)args[i]=boundArgs[i]===placeholder?arguments[position++]:boundArgs[i];for(;position<arguments.length;)args.push(arguments[position++]);return executeBound(func,bound,this,this,args)};return bound}));partial.placeholder=_;const modules_partial=partial,bind=restArguments((function(func,context,args){if(!modules_isFunction(func))throw new TypeError("Bind must be called on a function");var bound=restArguments((function(callArgs){return executeBound(func,bound,context,this,args.concat(callArgs))}));return bound})),_isArrayLike=createSizePropertyCheck(_getLength);function flatten(input,depth,strict,output){if(output=output||[],depth||0===depth){if(depth<=0)return output.concat(input)}else depth=1/0;for(var idx=output.length,i=0,length=_getLength(input);i<length;i++){var value=input[i];if(_isArrayLike(value)&&(isArray(value)||modules_isArguments(value)))if(depth>1)flatten(value,depth-1,strict,output),idx=output.length;else for(var j=0,len=value.length;j<len;)output[idx++]=value[j++];else strict||(output[idx++]=value)}return output}const bindAll=restArguments((function(obj,keys){var index=(keys=flatten(keys,!1,!1)).length;if(index<1)throw new Error("bindAll must be passed function names");for(;index--;){var key=keys[index];obj[key]=bind(obj[key],obj)}return obj}));function memoize(func,hasher){var memoize=function(key){var cache=memoize.cache,address=""+(hasher?hasher.apply(this,arguments):key);return has(cache,address)||(cache[address]=func.apply(this,arguments)),cache[address]};return memoize.cache={},memoize}const delay=restArguments((function(func,wait,args){return setTimeout((function(){return func.apply(null,args)}),wait)})),defer=modules_partial(delay,_,1);function throttle(func,wait,options){var timeout,context,args,result,previous=0;options||(options={});var later=function(){previous=!1===options.leading?0:now(),timeout=null,result=func.apply(context,args),timeout||(context=args=null)},throttled=function(){var _now=now();previous||!1!==options.leading||(previous=_now);var remaining=wait-(_now-previous);return context=this,args=arguments,remaining<=0||remaining>wait?(timeout&&(clearTimeout(timeout),timeout=null),previous=_now,result=func.apply(context,args),timeout||(context=args=null)):timeout||!1===options.trailing||(timeout=setTimeout(later,remaining)),result};return throttled.cancel=function(){clearTimeout(timeout),previous=0,timeout=context=args=null},throttled}function debounce(func,wait,immediate){var timeout,previous,args,result,context,later=function(){var passed=now()-previous;wait>passed?timeout=setTimeout(later,wait-passed):(timeout=null,immediate||(result=func.apply(context,args)),timeout||(args=context=null))},debounced=restArguments((function(_args){return context=this,args=_args,previous=now(),timeout||(timeout=setTimeout(later,wait),immediate&&(result=func.apply(context,args))),result}));return debounced.cancel=function(){clearTimeout(timeout),timeout=args=context=null},debounced}function wrap(func,wrapper){return modules_partial(wrapper,func)}function negate(predicate){return function(){return!predicate.apply(this,arguments)}}function compose(){var args=arguments,start=args.length-1;return function(){for(var i=start,result=args[start].apply(this,arguments);i--;)result=args[i].call(this,result);return result}}function after(times,func){return function(){if(--times<1)return func.apply(this,arguments)}}function before(times,func){var memo;return function(){return--times>0&&(memo=func.apply(this,arguments)),times<=1&&(func=null),memo}}const once=modules_partial(before,2);function findKey(obj,predicate,context){predicate=cb(predicate,context);for(var key,_keys=keys(obj),i=0,length=_keys.length;i<length;i++)if(predicate(obj[key=_keys[i]],key,obj))return key}function createPredicateIndexFinder(dir){return function(array,predicate,context){predicate=cb(predicate,context);for(var length=_getLength(array),index=dir>0?0:length-1;index>=0&&index<length;index+=dir)if(predicate(array[index],index,array))return index;return-1}}const findIndex=createPredicateIndexFinder(1),findLastIndex=createPredicateIndexFinder(-1);function sortedIndex(array,obj,iteratee,context){for(var value=(iteratee=cb(iteratee,context,1))(obj),low=0,high=_getLength(array);low<high;){var mid=Math.floor((low+high)/2);iteratee(array[mid])<value?low=mid+1:high=mid}return low}function createIndexFinder(dir,predicateFind,sortedIndex){return function(array,item,idx){var i=0,length=_getLength(array);if("number"==typeof idx)dir>0?i=idx>=0?idx:Math.max(idx+length,i):length=idx>=0?Math.min(idx+1,length):idx+length+1;else if(sortedIndex&&idx&&length)return array[idx=sortedIndex(array,item)]===item?idx:-1;if(item!=item)return(idx=predicateFind(slice.call(array,i,length),isNaN_isNaN))>=0?idx+i:-1;for(idx=dir>0?i:length-1;idx>=0&&idx<length;idx+=dir)if(array[idx]===item)return idx;return-1}}const indexOf=createIndexFinder(1,findIndex,sortedIndex),lastIndexOf=createIndexFinder(-1,findLastIndex);function find(obj,predicate,context){var key=(_isArrayLike(obj)?findIndex:findKey)(obj,predicate,context);if(void 0!==key&&-1!==key)return obj[key]}function findWhere(obj,attrs){return find(obj,matcher(attrs))}function each(obj,iteratee,context){var i,length;if(iteratee=optimizeCb(iteratee,context),_isArrayLike(obj))for(i=0,length=obj.length;i<length;i++)iteratee(obj[i],i,obj);else{var _keys=keys(obj);for(i=0,length=_keys.length;i<length;i++)iteratee(obj[_keys[i]],_keys[i],obj)}return obj}function map(obj,iteratee,context){iteratee=cb(iteratee,context);for(var _keys=!_isArrayLike(obj)&&keys(obj),length=(_keys||obj).length,results=Array(length),index=0;index<length;index++){var currentKey=_keys?_keys[index]:index;results[index]=iteratee(obj[currentKey],currentKey,obj)}return results}function createReduce(dir){return function(obj,iteratee,memo,context){var initial=arguments.length>=3;return function(obj,iteratee,memo,initial){var _keys=!_isArrayLike(obj)&&keys(obj),length=(_keys||obj).length,index=dir>0?0:length-1;for(initial||(memo=obj[_keys?_keys[index]:index],index+=dir);index>=0&&index<length;index+=dir){var currentKey=_keys?_keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo}(obj,optimizeCb(iteratee,context,4),memo,initial)}}const reduce=createReduce(1),reduceRight=createReduce(-1);function filter(obj,predicate,context){var results=[];return predicate=cb(predicate,context),each(obj,(function(value,index,list){predicate(value,index,list)&&results.push(value)})),results}function reject(obj,predicate,context){return filter(obj,negate(cb(predicate)),context)}function every(obj,predicate,context){predicate=cb(predicate,context);for(var _keys=!_isArrayLike(obj)&&keys(obj),length=(_keys||obj).length,index=0;index<length;index++){var currentKey=_keys?_keys[index]:index;if(!predicate(obj[currentKey],currentKey,obj))return!1}return!0}function some(obj,predicate,context){predicate=cb(predicate,context);for(var _keys=!_isArrayLike(obj)&&keys(obj),length=(_keys||obj).length,index=0;index<length;index++){var currentKey=_keys?_keys[index]:index;if(predicate(obj[currentKey],currentKey,obj))return!0}return!1}function contains(obj,item,fromIndex,guard){return _isArrayLike(obj)||(obj=values(obj)),("number"!=typeof fromIndex||guard)&&(fromIndex=0),indexOf(obj,item,fromIndex)>=0}const invoke=restArguments((function(obj,path,args){var contextPath,func;return modules_isFunction(path)?func=path:(path=_toPath_toPath(path),contextPath=path.slice(0,-1),path=path[path.length-1]),map(obj,(function(context){var method=func;if(!method){if(contextPath&&contextPath.length&&(context=deepGet(context,contextPath)),null==context)return;method=context[path]}return null==method?method:method.apply(context,args)}))}));function pluck(obj,key){return map(obj,property(key))}function where(obj,attrs){return filter(obj,matcher(attrs))}function max(obj,iteratee,context){var value,computed,result=-1/0,lastComputed=-1/0;if(null==iteratee||"number"==typeof iteratee&&"object"!=typeof obj[0]&&null!=obj)for(var i=0,length=(obj=_isArrayLike(obj)?obj:values(obj)).length;i<length;i++)null!=(value=obj[i])&&value>result&&(result=value);else iteratee=cb(iteratee,context),each(obj,(function(v,index,list){((computed=iteratee(v,index,list))>lastComputed||computed===-1/0&&result===-1/0)&&(result=v,lastComputed=computed)}));return result}function min(obj,iteratee,context){var value,computed,result=1/0,lastComputed=1/0;if(null==iteratee||"number"==typeof iteratee&&"object"!=typeof obj[0]&&null!=obj)for(var i=0,length=(obj=_isArrayLike(obj)?obj:values(obj)).length;i<length;i++)null!=(value=obj[i])&&value<result&&(result=value);else iteratee=cb(iteratee,context),each(obj,(function(v,index,list){((computed=iteratee(v,index,list))<lastComputed||computed===1/0&&result===1/0)&&(result=v,lastComputed=computed)}));return result}var reStrSymbol=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function toArray(obj){return obj?isArray(obj)?slice.call(obj):isString(obj)?obj.match(reStrSymbol):_isArrayLike(obj)?map(obj,identity):values(obj):[]}function sample(obj,n,guard){if(null==n||guard)return _isArrayLike(obj)||(obj=values(obj)),obj[random(obj.length-1)];var sample=toArray(obj),length=_getLength(sample);n=Math.max(Math.min(n,length),0);for(var last=length-1,index=0;index<n;index++){var rand=random(index,last),temp=sample[index];sample[index]=sample[rand],sample[rand]=temp}return sample.slice(0,n)}function shuffle(obj){return sample(obj,1/0)}function sortBy(obj,iteratee,context){var index=0;return iteratee=cb(iteratee,context),pluck(map(obj,(function(value,key,list){return{value,index:index++,criteria:iteratee(value,key,list)}})).sort((function(left,right){var a=left.criteria,b=right.criteria;if(a!==b){if(a>b||void 0===a)return 1;if(a<b||void 0===b)return-1}return left.index-right.index})),"value")}function group(behavior,partition){return function(obj,iteratee,context){var result=partition?[[],[]]:{};return iteratee=cb(iteratee,context),each(obj,(function(value,index){var key=iteratee(value,index,obj);behavior(result,value,key)})),result}}const groupBy=group((function(result,value,key){has(result,key)?result[key].push(value):result[key]=[value]})),indexBy=group((function(result,value,key){result[key]=value})),countBy=group((function(result,value,key){has(result,key)?result[key]++:result[key]=1})),partition=group((function(result,value,pass){result[pass?0:1].push(value)}),!0);function size(obj){return null==obj?0:_isArrayLike(obj)?obj.length:keys(obj).length}function keyInObj(value,key,obj){return key in obj}const pick=restArguments((function(obj,keys){var result={},iteratee=keys[0];if(null==obj)return result;modules_isFunction(iteratee)?(keys.length>1&&(iteratee=optimizeCb(iteratee,keys[1])),keys=allKeys(obj)):(iteratee=keyInObj,keys=flatten(keys,!1,!1),obj=Object(obj));for(var i=0,length=keys.length;i<length;i++){var key=keys[i],value=obj[key];iteratee(value,key,obj)&&(result[key]=value)}return result})),omit=restArguments((function(obj,keys){var context,iteratee=keys[0];return modules_isFunction(iteratee)?(iteratee=negate(iteratee),keys.length>1&&(context=keys[1])):(keys=map(flatten(keys,!1,!1),String),iteratee=function(value,key){return!contains(keys,key)}),pick(obj,iteratee,context)}));function initial(array,n,guard){return slice.call(array,0,Math.max(0,array.length-(null==n||guard?1:n)))}function first(array,n,guard){return null==array||array.length<1?null==n||guard?void 0:[]:null==n||guard?array[0]:initial(array,array.length-n)}function rest(array,n,guard){return slice.call(array,null==n||guard?1:n)}function last(array,n,guard){return null==array||array.length<1?null==n||guard?void 0:[]:null==n||guard?array[array.length-1]:rest(array,Math.max(0,array.length-n))}function compact(array){return filter(array,Boolean)}function flatten_flatten(array,depth){return flatten(array,depth,!1)}const difference=restArguments((function(array,rest){return rest=flatten(rest,!0,!0),filter(array,(function(value){return!contains(rest,value)}))})),without=restArguments((function(array,otherArrays){return difference(array,otherArrays)}));function uniq(array,isSorted,iteratee,context){isBoolean(isSorted)||(context=iteratee,iteratee=isSorted,isSorted=!1),null!=iteratee&&(iteratee=cb(iteratee,context));for(var result=[],seen=[],i=0,length=_getLength(array);i<length;i++){var value=array[i],computed=iteratee?iteratee(value,i,array):value;isSorted&&!iteratee?(i&&seen===computed||result.push(value),seen=computed):iteratee?contains(seen,computed)||(seen.push(computed),result.push(value)):contains(result,value)||result.push(value)}return result}const union=restArguments((function(arrays){return uniq(flatten(arrays,!0,!0))}));function intersection(array){for(var result=[],argsLength=arguments.length,i=0,length=_getLength(array);i<length;i++){var item=array[i];if(!contains(result,item)){var j;for(j=1;j<argsLength&&contains(arguments[j],item);j++);j===argsLength&&result.push(item)}}return result}function unzip(array){for(var length=array&&max(array,_getLength).length||0,result=Array(length),index=0;index<length;index++)result[index]=pluck(array,index);return result}const zip=restArguments(unzip);function object(list,values){for(var result={},i=0,length=_getLength(list);i<length;i++)values?result[list[i]]=values[i]:result[list[i][0]]=list[i][1];return result}function range(start,stop,step){null==stop&&(stop=start||0,start=0),step||(step=stop<start?-1:1);for(var length=Math.max(Math.ceil((stop-start)/step),0),range=Array(length),idx=0;idx<length;idx++,start+=step)range[idx]=start;return range}function chunk(array,count){if(null==count||count<1)return[];for(var result=[],i=0,length=array.length;i<length;)result.push(slice.call(array,i,i+=count));return result}function chainResult(instance,obj){return instance._chain?_(obj).chain():obj}function mixin(obj){return each(functions(obj),(function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];return push.apply(args,arguments),chainResult(this,func.apply(_,args))}})),_}each(["pop","push","reverse","shift","sort","splice","unshift"],(function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;return null!=obj&&(method.apply(obj,arguments),"shift"!==name&&"splice"!==name||0!==obj.length||delete obj[0]),chainResult(this,obj)}})),each(["concat","join","slice"],(function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;return null!=obj&&(obj=method.apply(obj,arguments)),chainResult(this,obj)}}));const underscore_array_methods=_;var index_default_=mixin(modules_namespaceObject);index_default_._=index_default_;const index_default=index_default_;var external_MailPoetLib_Listing_=__webpack_require__(525);const columns=[{name:"email",label:external_MailPoet_default().I18n.t("subscriberColumn"),sortable:!0},{name:"status",label:external_MailPoet_default().I18n.t("statusColumn"),sortable:!0},{name:"created_at",label:external_MailPoet_default().I18n.t("dateAndTimeColumn"),sortable:!0}],messages={onLoadingItems:()=>external_MailPoet_default().I18n.t("loadingEngagementItems"),onNoItemsFound:()=>external_MailPoet_default().I18n.t("noEngagementItemsFound")},trackFilteredByClickedLinks=index_default.once((()=>external_MailPoet_default().trackEvent("User has filtered subscribers by clicked links")));function getListingItemKey(item){return`item-${item.id}-${item.status}`}function renderStatItem(statistic){let status,email;switch(statistic.status){case"opened":status=(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{children:external_MailPoet_default().I18n.t("opened")});break;case"machine-opened":status=(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{children:external_MailPoet_default().I18n.t("machine-opened")});break;case"clicked":status=(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{isInverted:!0,children:external_MailPoet_default().I18n.t("clicked")});break;case"unsubscribed":status=(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{variant:"unknown",isInverted:!0,children:external_MailPoet_default().I18n.t("unsubscribed")});break;case"unopened":status=(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{children:external_MailPoet_default().I18n.t("unopened")})}return email=statistic.email?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{className:"mailpoet-listing-title",href:statistic.subscriber_url,children:statistic.email}):external_MailPoet_default().I18n.t("deletedSubscriber"),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("td",{className:"manage-column column-primary has-row-actions",children:[email,(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-listing-subtitle",children:[statistic.first_name," ",statistic.last_name]})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{className:"column","data-colname":external_MailPoet_default().I18n.t("statusColumn"),children:status}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{className:"column-date","data-colname":external_MailPoet_default().I18n.t("dateAndTimeColumn"),children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("abbr",{children:external_MailPoet_default().Date.format(statistic.created_at)})})]})}class SubscriberEngagementListing extends external_MailPoetLib_React_.Component{constructor(props){super(props),this.renderCreateSegmentButton=this.renderCreateSegmentButton.bind(this),this.handleCreateSegment=this.handleCreateSegment.bind(this),this.canCreateSegment=this.canCreateSegment.bind(this)}handleCreateSegment(group,newsletter,linkId){const{handleCreateSegment}=this.props;handleCreateSegment(group,newsletter,linkId)}canCreateSegment(listingState){const{newsletter}=this.props;return"standard"===newsletter.type&&-1!==["opened","clicked","unopened"].indexOf(listingState.group)}renderCreateSegmentButton=listingState=>{const{newsletter,savingSegment}=this.props;if(this.canCreateSegment(listingState))return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("input",{onClick:()=>this.handleCreateSegment(listingState.group,newsletter,listingState.filter.link),type:"submit",value:savingSegment?external_MailPoet_default().I18n.t("savingSegment"):external_MailPoet_default().I18n.t("createSegment"),className:"mailpoet-button mailpoet-button-small button-primary",disabled:savingSegment})};render(){const{params,location}=this.props;return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Listing_.Listing,{limit:external_MailPoet_default().listingPerPage,location,params,endpoint:"stats",base_url:"stats/:id",onRenderItem:renderStatItem,getListingItemKey,onBeforeSelectFilter:trackFilteredByClickedLinks,columns,messages,sort_by:"created_at",sort_order:"desc",renderExtraActions:this.renderCreateSegmentButton})}}const buildSegmentFilterData=(group,newsletter,linkId)=>{const filterData={segmentType:"email",action:"unopened"===group?"opened":group,operator:"unopened"===group?"none":"any"};return linkId&&(filterData.link_ids=[parseInt(linkId,10)]),"clicked"===group?filterData.newsletter_id=parseInt(newsletter.id,10):filterData.newsletters=[parseInt(newsletter.id,10)],filterData};class SubscriberEngagement extends external_MailPoetLib_React_.Component{constructor(props){super(props),this.state={savingSegment:!1,segmentCreated:!1,segmentErrors:[]}}handleCreateSegment=(group,newsletter,linkId)=>{const name=`${newsletter.subject} – ${group}`;this.setState({savingSegment:!0,segmentCreated:!1,segmentErrors:[]}),external_MailPoet_default().Ajax.post({api_version:external_MailPoet_default().apiVersion,endpoint:"dynamic_segments",action:"save",data:{name,filters_connect:"and",filters:[buildSegmentFilterData(group,newsletter,linkId)]}}).always((()=>{this.setState({savingSegment:!1})})).done((()=>{this.setState({segmentCreated:!0,segmentName:name})})).fail((response=>{this.setState({segmentErrors:response.errors.map((error=>409===parseInt(error.error,10)?external_MailPoet_default().I18n.t("segmentExists"):error.message))})}))};renderCreateSegmentSuccess(){const{segmentCreated,segmentName}=this.state;let segmentCreatedSuccessMessage;if(segmentCreated){let message=external_MailPoetLib_ReactStringReplace_default()(external_MailPoet_default().I18n.t("successMessage"),/\[link\](.*?)\[\/link\]/g,((match,i)=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:"?page=mailpoet-newsletters#/new",children:match},i)));message=external_MailPoetLib_ReactStringReplace_default()(message,"%s",(()=>segmentName)),segmentCreatedSuccessMessage=(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet_notice notice inline notice-success",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:message})})}return segmentCreatedSuccessMessage}renderCreateSegmentError(){const{segmentErrors}=this.state;let error;return segmentErrors.length>0&&(error=(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{children:segmentErrors.map((errorMessage=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet_notice notice inline error",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:errorMessage})},`error-${errorMessage}`)))})),error}render(){const{savingSegment}=this.state,{params,location,newsletter}=this.props;return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{children:[this.renderCreateSegmentSuccess(),this.renderCreateSegmentError(),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SubscriberEngagementListing,{location,params,newsletter,handleCreateSegment:this.handleCreateSegment,savingSegment})]})}}const bounces_listing_columns=[{name:"email",label:external_MailPoet_default().I18n.t("subscriberColumn"),sortable:!0},{name:"status",label:external_MailPoet_default().I18n.t("statusColumn"),sortable:!0},{name:"created_at",label:external_MailPoet_default().I18n.t("dateAndTimeColumn"),sortable:!0}],bounces_listing_messages={onLoadingItems:()=>external_MailPoet_default().I18n.t("loadingEngagementItems"),onNoItemsFound:()=>external_MailPoet_default().I18n.t("noBouncesItemsFound")};function bounces_listing_getListingItemKey(item){return`item-${item.id}-${item.status}`}function renderItem(bounced){let email;return email=bounced.email?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{className:"mailpoet-listing-title",href:bounced.subscriber_url,children:bounced.email}):external_MailPoet_default().I18n.t("deletedSubscriber"),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("td",{className:"manage-column column-primary has-row-actions",children:[email,(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-listing-subtitle",children:[bounced.first_name," ",bounced.last_name]})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{className:"column","data-colname":external_MailPoet_default().I18n.t("statusColumn"),children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{variant:"unknown",isInverted:!0,children:external_MailPoet_default().I18n.t("bounced")})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{className:"column-date","data-colname":external_MailPoet_default().I18n.t("dateAndTimeColumn"),children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("abbr",{children:external_MailPoet_default().Date.format(bounced.created_at)})})]})}function BouncesListing({params,location}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Listing_.Listing,{groups:!1,limit:external_MailPoet_default().listingPerPage,location,params,endpoint:"bounces",base_url:"stats/:id",onRenderItem:renderItem,getListingItemKey:bounces_listing_getListingItemKey,columns:bounces_listing_columns,messages:bounces_listing_messages,sort_by:"created_at",sort_order:"desc"})}function Bounces({params,location}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(BouncesListing,{location,params})}const trackStatsClicked=()=>{external_MailPoet_default().trackEvent("User has clicked to view detailed stats")};external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_newsletters_listing_stats_tracking","mailpoet",(()=>trackStatsClicked));external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_newsletters_revenues_stats","mailpoet",((_,revenue)=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(RevenuesStats,{revenue})));external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_newsletters_clicked_links_table","mailpoet",((ignoredFreeContent,links)=>external_MailPoet_default().capabilities.detailedAnalytics.isRestricted||void 0===links?ignoredFreeContent:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ClickedLinksTable,{links})));external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_newsletters_purchased_products","mailpoet",((ignoredFreeContent,newsletter)=>external_MailPoet_default().capabilities.detailedAnalytics.isRestricted?ignoredFreeContent:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(PurchasedProducts,{newsletter})));external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_newsletters_subscriber_engagement","mailpoet",((ignoredFreeContent,location,params,newsletter)=>external_MailPoet_default().capabilities.detailedAnalytics.isRestricted?ignoredFreeContent:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SubscriberEngagement,{location,params,newsletter})));external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_newsletters_bounces","mailpoet",((ignoredFreeContent,location,params)=>external_MailPoet_default().capabilities.detailedAnalytics.isRestricted?ignoredFreeContent:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Bounces,{location,params})))})(),(()=>{"use strict";var external_MailPoetLib_Hooks_=__webpack_require__(401),external_MailPoetLib_WordPressData_=__webpack_require__(54),external_MailPoet_=__webpack_require__(632),external_MailPoet_default=__webpack_require__.n(external_MailPoet_);const external_MailPoetLib_DynamicSegments_namespaceObject=MailPoetLib.DynamicSegments;var external_MailPoetLib_ReactStringReplace_=__webpack_require__(225),external_MailPoetLib_ReactStringReplace_default=__webpack_require__.n(external_MailPoetLib_ReactStringReplace_),external_MailPoetLib_ReactJsxRuntime_=__webpack_require__(813);function ConditionType(){const segment=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>select(external_MailPoetLib_DynamicSegments_namespaceObject.storeName).getSegment()),[]),{updateSegment}=(0,external_MailPoetLib_WordPressData_.useDispatch)(external_MailPoetLib_DynamicSegments_namespaceObject.storeName);return segment.filters.length<=1?null:(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-segments-condition-type-selector",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("label",{className:"mailpoet-form-radio","data-automation-id":"dynamic-segment-condition-type-and",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("input",{type:"radio",value:external_MailPoetLib_DynamicSegments_namespaceObject.SegmentConnectTypes.AND,checked:segment.filters_connect===external_MailPoetLib_DynamicSegments_namespaceObject.SegmentConnectTypes.AND,onChange:e=>updateSegment({filters_connect:e.target.value})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("span",{className:"mailpoet-form-radio-control"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("span",{children:external_MailPoetLib_ReactStringReplace_default()(external_MailPoet_default().I18n.t("allConditions"),/<strong>(.*?)<\/strong>/g,((match,i)=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("strong",{children:match},i)))})]}),(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("label",{className:"mailpoet-form-radio","data-automation-id":"dynamic-segment-condition-type-or",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("input",{type:"radio",value:external_MailPoetLib_DynamicSegments_namespaceObject.SegmentConnectTypes.OR,checked:segment.filters_connect===external_MailPoetLib_DynamicSegments_namespaceObject.SegmentConnectTypes.OR,onChange:e=>updateSegment({filters_connect:e.target.value})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("span",{className:"mailpoet-form-radio-control"}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("span",{children:external_MailPoetLib_ReactStringReplace_default()(external_MailPoet_default().I18n.t("anyConditions"),/<strong>(.*?)<\/strong>/g,((match,i)=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("strong",{children:match},i)))})]})]})}function FilterSeparator({index}){const segment=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>select(external_MailPoetLib_DynamicSegments_namespaceObject.storeName).getSegment()),[]);return segment.filters.length<=1||index===segment.filters.length-1?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-gap"}):(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("p",{children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("strong",{className:"mailpoet-segments-condition-type",children:segment.filters_connect===external_MailPoetLib_DynamicSegments_namespaceObject.SegmentConnectTypes.AND?external_MailPoet_default().I18n.t("filterConnectAnd").toUpperCase():external_MailPoet_default().I18n.t("filterConnectOr").toUpperCase()})})}var external_MailPoetLib_WordPressI18n_=__webpack_require__(394),external_MailPoetLib_WordPressIcons_=__webpack_require__(64),external_MailPoetLib_WordpressComponentsButton_=__webpack_require__(414),external_MailPoetLib_WordpressComponentsButton_default=__webpack_require__.n(external_MailPoetLib_WordpressComponentsButton_);function RemoveFilter({filterRows=[],index}){const segment=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>select(external_MailPoetLib_DynamicSegments_namespaceObject.storeName).getSegment()),[]),{updateSegment}=(0,external_MailPoetLib_WordPressData_.useDispatch)(external_MailPoetLib_DynamicSegments_namespaceObject.storeName);return segment.filters.length<=1||filterRows.length<=1?null:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_WordpressComponentsButton_default(),{className:"mailpoet-form-segment-delete","data-automation-id":"delete-filter-row",icon:external_MailPoetLib_WordPressIcons_.trash,label:(0,external_MailPoetLib_WordPressI18n_.__)("Remove condition","mailpoet-premium"),onClick:e=>{e.preventDefault();const filters=segment.filters;filters.splice(index,1),updateSegment({filters})}})}var external_MailPoetLib_React_=__webpack_require__(862),fp=__webpack_require__(328);const external_MailPoetLib_CommonFormSelect_namespaceObject=MailPoetLib.CommonFormSelect,external_MailPoetLib_CommonFormReactSelect_namespaceObject=MailPoetLib.CommonFormReactSelect;function SubscriberTag({filterIndex}){const segment=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>select(external_MailPoetLib_DynamicSegments_namespaceObject.storeName).getSegmentFilter(filterIndex)),[filterIndex]),tagsList=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>select(external_MailPoetLib_DynamicSegments_namespaceObject.storeName).getTags()),[]),{updateSegmentFilter,updateSegmentFilterFromEvent}=(0,external_MailPoetLib_WordPressData_.useDispatch)(external_MailPoetLib_DynamicSegments_namespaceObject.storeName);(0,external_MailPoetLib_React_.useEffect)((()=>{segment.operator!==external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.ANY&&segment.operator!==external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.ALL&&segment.operator!==external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.NONE&&updateSegmentFilter({operator:external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.ANY},filterIndex)}),[updateSegmentFilter,segment,filterIndex]);const options=tagsList.map((currentValue=>({value:currentValue.id,label:currentValue.name})));return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_CommonFormSelect_namespaceObject.Select,{isMinWidth:!0,automationId:"select-operator",value:segment.operator,onChange:e=>{updateSegmentFilterFromEvent("operator",filterIndex,e)},children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.ANY,children:external_MailPoet_default().I18n.t("anyOf")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.ALL,children:external_MailPoet_default().I18n.t("allOf")}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("option",{value:external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.NONE,children:external_MailPoet_default().I18n.t("noneOf")})]},"select"),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_CommonFormReactSelect_namespaceObject.ReactSelect,{dimension:"small",isMulti:!0,automationId:"select-subscriber-tag",placeholder:external_MailPoet_default().I18n.t("searchTags"),options,value:(0,fp.filter)((option=>{if(!segment.tags)return;const tagId=option.value;return-1!==segment.tags.indexOf(tagId)}),options),onChange:selectOptions=>{updateSegmentFilter({tags:selectOptions.map((({value})=>parseInt(value,10)))},filterIndex)}})]})}var premium=__webpack_require__(188);external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_dynamic_segments_form_filters_before","mailpoet",(ignoredFreeContent=>!external_MailPoet_default().hasValidPremiumKey||external_MailPoet_default().subscribersLimitReached?ignoredFreeContent:ConditionType));external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_dynamic_filters_filter_before","mailpoet",(ignoredFreeContent=>!external_MailPoet_default().hasValidPremiumKey||external_MailPoet_default().subscribersLimitReached?ignoredFreeContent:RemoveFilter));external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_dynamic_filters_filter_after","mailpoet",(ignoredFreeContent=>!external_MailPoet_default().hasValidPremiumKey||external_MailPoet_default().subscribersLimitReached?ignoredFreeContent:FilterSeparator));const addConditionAction=(segment,updateSegment)=>{const filters=segment.filters;filters.push({segmentType:external_MailPoetLib_DynamicSegments_namespaceObject.SegmentTypes.WordPressRole,action:external_MailPoetLib_DynamicSegments_namespaceObject.SubscriberActionTypes.WORDPRESS_ROLE}),updateSegment({filters})};external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_dynamic_segments_form_add_condition_action","mailpoet",(ignoredFreeContent=>{const segmentFiltersCount=(0,external_MailPoetLib_WordPressData_.useSelect)((select=>select(external_MailPoetLib_DynamicSegments_namespaceObject.storeName).getSegment().filters.length),[]);return!external_MailPoet_default().hasValidPremiumKey||external_MailPoet_default().subscribersLimitReached||premium.R.segmentFilters.value&&segmentFiltersCount>=premium.R.segmentFilters.value?ignoredFreeContent:addConditionAction})),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_dynamic_segments_filter_subscriber_tag_validate","mailpoet",((ignoredFreeContent,formItems)=>!external_MailPoet_default().hasValidPremiumKey||external_MailPoet_default().subscribersLimitReached?ignoredFreeContent:function(formItems){return(formItems.operator===external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.ANY||formItems.operator===external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.ALL||formItems.operator===external_MailPoetLib_DynamicSegments_namespaceObject.AnyValueTypes.NONE)&&Array.isArray(formItems.tags)&&formItems.tags.length>0}(formItems))),external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_dynamic_segments_filter_subscriber_tag","mailpoet",((ignoredFreeContent,filterIndex)=>!external_MailPoet_default().hasValidPremiumKey||external_MailPoet_default().subscribersLimitReached?ignoredFreeContent:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(SubscriberTag,{filterIndex})))})(),(()=>{"use strict";var external_MailPoetLib_Hooks_=__webpack_require__(401),external_MailPoet_=__webpack_require__(632),external_MailPoet_default=__webpack_require__.n(external_MailPoet_),external_MailPoetLib_Listing_=__webpack_require__(525),external_MailPoetLib_Common_=__webpack_require__(990),external_MailPoetLib_ReactJsxRuntime_=__webpack_require__(813);const truncateInMiddle=(fullString,strLen)=>{if(fullString.length<=strLen)return fullString;const charsToShow=strLen-3,frontChars=Math.ceil(charsToShow*(2/3)),backChars=Math.floor(charsToShow*(1/3));return`${fullString.substr(0,frontChars)}...${fullString.substr(fullString.length-backChars)}`};function Clicked({action}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-subscriber-stats-action-row",children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{isInverted:!0,children:external_MailPoet_default().I18n.t("statsClicked")})," ",external_MailPoet_default().getShortcodeLinks()[action.url]?external_MailPoet_default().getShortcodeLinks()[action.url]:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:action.url,target:"_blank",rel:"noreferrer noopener",children:truncateInMiddle(action.url,40)})]}),action.purchases.map((purchase=>(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("div",{className:"mailpoet-subscriber-stats-action-row",children:["↳ ",(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("a",{href:purchase.order_url,children:`${external_MailPoet_default().I18n.t("orderNumberPrefix")} #${purchase.order_id}`})]},`click-purhase-${purchase.id}`)))]})}function Opened({action}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-subscriber-stats-action-row",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Common_.Tag,{children:"machine-open"===action.type?external_MailPoet_default().I18n.t("statsMachineOpened"):external_MailPoet_default().I18n.t("statsOpened")})})}function ActionList({actions}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:actions.map((action=>"click"===action.type?(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Clicked,{action},`action_${action.type}_${action.id}`):(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(Opened,{action},`action_${action.type}_${action.id}`)))})}function ActionCounts({action}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-subscriber-stats-action-row",children:action.count}),action.purchases&&action.purchases.map((purchase=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-subscriber-stats-action-row",children:purchase.revenue},`action_purchase_count_${purchase.id}`)))]})}function ActionDates({action}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-subscriber-stats-action-row",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("abbr",{children:external_MailPoet_default().Date.format(action.created_at)})}),action.purchases&&action.purchases.map((purchase=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("div",{className:"mailpoet-subscriber-stats-action-row",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("abbr",{children:external_MailPoet_default().Date.format(purchase.created_at)})},`action_purchase_date_${purchase.id}`)))]})}const renderItem=item=>(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{className:"column-primary",children:(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)("a",{className:"mailpoet-listing-title",href:item.preview_url,target:"_blank",rel:"noopener noreferrer",children:[item.campaign_name?item.campaign_name:item.subject,item.campaign_name&&(0,external_MailPoetLib_ReactJsxRuntime_.jsxs)(external_MailPoetLib_ReactJsxRuntime_.Fragment,{children:[(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("br",{}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("span",{className:"mailpoet-listing-subtitle",children:item.subject})]})]})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{children:(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ActionList,{actions:item.actions})}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{children:item.actions.map((action=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ActionCounts,{action},`action_count_${action.type}_${action.id}`)))}),(0,external_MailPoetLib_ReactJsxRuntime_.jsx)("td",{children:item.actions.map((action=>(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(ActionDates,{action},`action_date_${action.type}_${action.id}`)))})]});function getListingItemKey(item){return`item-${item.id}`}const messages={onLoadingItems:()=>external_MailPoet_default().I18n.t("loadingSubscriberStats"),onNoItemsFound:()=>external_MailPoet_default().I18n.t("noStatsForSubscriber")},columns=[{name:"newsletter",label:external_MailPoet_default().I18n.t("email"),sortable:!1},{name:"action",label:external_MailPoet_default().I18n.t("columnAction"),sortable:!1,width:"35%"},{name:"count",label:external_MailPoet_default().I18n.t("columnCount"),sortable:!1,width:"10%"},{name:"actionOn",label:external_MailPoet_default().I18n.t("columnActionOn"),sortable:!1}];function OpenedNewslettersListing({params,location}){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(external_MailPoetLib_Listing_.Listing,{limit:external_MailPoet_default().listingPerPage,params,location,endpoint:"subscriber_detailed_stats",base_url:"stats/:id",onRenderItem:renderItem,getListingItemKey,columns,messages,groups:!1})}external_MailPoetLib_Hooks_.Hooks.addFilter("mailpoet_subscribers_opened_emails_stats","mailpoet",((freeContent,params,location)=>external_MailPoet_default().capabilities.detailedAnalytics.isRestricted?freeContent:function(){return(0,external_MailPoetLib_ReactJsxRuntime_.jsx)(OpenedNewslettersListing,{params,location})}))})()})();

Filemanager

Name Type Size Permission Actions
index.php File 6 B 0644
manifest.json File 32 B 0644
premium.js File 302.27 KB 0644
premium.js.LICENSE.txt File 336 B 0644