(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5132],{57225:function(n,r,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/catalog-category-manager/add",function(){return i(98981)}])},82241:function(n,r,i){"use strict";i.d(r,{Z:function(){return m}});var a=i(87462),u=i(67294),s=i(38047),c=i(65342),l=i(1413),p=i(74902),d=i(45987),v=i(34582),g=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],compareOption=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,a=String(n).toLowerCase(),u=String(i.getOptionValue(r)).toLowerCase(),s=String(i.getOptionLabel(r)).toLowerCase();return u===a||s===a},h={formatCreateLabel:function(n){return'Create "'.concat(n,'"')},isValidNewOption:function(n,r,i,a){return!(!n||r.some(function(r){return compareOption(n,r,a)})||i.some(function(r){return compareOption(n,r,a)}))},getNewOptionData:function(n,r){return{label:r,value:n,__isNew__:!0}}};i(73935),i(73469);var m=(0,u.forwardRef)(function(n,r){var i,m,O,w,C,_,N,y,b,V,L,E,Z,P,k,D,S,U,M,j,X,x,A,H,T,W,K,R,q=(O=void 0!==(m=(i=(0,c.u)(n)).allowCreateWhileLoading)&&m,C=void 0===(w=i.createOptionPosition)?"last":w,N=void 0===(_=i.formatCreateLabel)?h.formatCreateLabel:_,b=void 0===(y=i.isValidNewOption)?h.isValidNewOption:y,L=void 0===(V=i.getNewOptionData)?h.getNewOptionData:V,E=i.onCreateOption,P=void 0===(Z=i.options)?[]:Z,k=i.onChange,U=void 0===(S=(D=(0,d.Z)(i,g)).getOptionValue)?s.g:S,j=void 0===(M=D.getOptionLabel)?s.b:M,X=D.inputValue,x=D.isLoading,A=D.isMulti,H=D.value,T=D.name,W=(0,u.useMemo)(function(){return b(X,(0,v.H)(H),P,{getOptionValue:U,getOptionLabel:j})?L(X,N(X)):void 0},[N,L,j,U,X,b,P,H]),K=(0,u.useMemo)(function(){return(O||!x)&&W?"first"===C?[W].concat((0,p.Z)(P)):[].concat((0,p.Z)(P),[W]):P},[O,C,x,W,P]),R=(0,u.useCallback)(function(n,r){if("select-option"!==r.action)return k(n,r);var i=Array.isArray(n)?n:[n];if(i[i.length-1]===W){if(E)E(X);else{var a=L(X,X);k((0,v.D)(A,[].concat((0,p.Z)((0,v.H)(H)),[a]),a),{action:"create-option",name:T,option:a})}return}k(n,r)},[L,X,A,T,W,E,k,H]),(0,l.Z)((0,l.Z)({},D),{},{options:K,onChange:R}));return u.createElement(s.S,(0,a.Z)({ref:r},q))})},47533:function(n,r,i){"use strict";i.d(r,{X:function(){return o}});var a=i(87536),e=function(n,r,i){if(n&&"reportValidity"in n){var u=(0,a.U2)(i,r);n.setCustomValidity(u&&u.message||""),n.reportValidity()}},resolvers_t=function(n,r){var t=function(i){var a=r.fields[i];a&&a.ref&&"reportValidity"in a.ref?e(a.ref,i,n):a.refs&&a.refs.forEach(function(r){return e(r,i,n)})};for(var i in r.fields)t(i)},f=function(n,r){r.shouldUseNativeValidation&&resolvers_t(n,r);var i={};for(var u in n){var s=(0,a.U2)(r.fields,u);(0,a.t8)(i,u,Object.assign(n[u]||{},{ref:s&&s.ref}))}return i},o=function(n,r,i){return void 0===r&&(r={}),void 0===i&&(i={}),function(u,s,c){try{return Promise.resolve(function(a,l){try{var p=(r.context,Promise.resolve(n["sync"===i.mode?"validateSync":"validate"](u,Object.assign({abortEarly:!1},r,{context:s}))).then(function(n){return c.shouldUseNativeValidation&&resolvers_t({},c),{values:i.raw?u:n,errors:{}}}))}catch(n){return l(n)}return p&&p.then?p.then(void 0,l):p}(0,function(n){var r;if(!n.inner)throw n;return{values:{},errors:f((r=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,(n.inner||[]).reduce(function(n,i){if(n[i.path]||(n[i.path]={message:i.message,type:i.type}),r){var u=n[i.path].types,s=u&&u[i.type];n[i.path]=(0,a.KN)(i.path,r,n,i.type,s?[].concat(s,i.message):i.message)}return n},{})),c)}}))}catch(n){return Promise.reject(n)}}}}},function(n){n.O(0,[7536,6310,3157,8981,9774,2888,179],function(){return n(n.s=57225)}),_N_E=n.O()}]);