"use strict";(self.webpackChunk_digicms_admin=self.webpackChunk_digicms_admin||[]).push([[5162],{41513:function(te,M,t){t.d(M,{Z:function(){return Fe}});var e=t(32735),n=t(58521),L=t(27649),P=t(84968),x=t(5141),E=t(31842),p=t(17247),ne=t(60216),d=t.n(ne),h=t(29439),k=t(66456),ce=t(74512);function ve(a){return(0,ce.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:(0,ce.jsx)("path",{d:"M4 20.252V3.748a1 1 0 011.507-.862l14.028 8.252a1 1 0 010 1.724L5.507 21.113A1 1 0 014 20.252z",fill:"#212134"})})}var be=t(28356),Re=t(17e3),ae=t(72850),ue=t(41415),W=t(27677),Q=t(10369),me=t(15335),D=t(5803),Z=t(83281),N=t(5636),Ce=t(76437),F=t(49372),ye=t(83292),Ie=t(44426),G=t(8284),ge=t(23940),i=t.n(ge);const C=({disabledEvents:a,name:r,events:o,inputValue:s,handleChange:c,handleChangeAll:O})=>{const u=o.filter(b=>!a.includes(b)),f=s.length===u.length,m=s.length>0,K=({target:{name:b}})=>{O({target:{name:b,value:!f}})};return e.createElement("tr",null,e.createElement("td",null,e.createElement(G.X,{indeterminate:m&&!f,"aria-label":"Select all entries",name:r,onChange:K,value:f},i()(r))),o.map(b=>e.createElement("td",{key:b},e.createElement(Ie.C,{disabled:a.includes(b),"aria-label":b,name:b,value:s.includes(b),onValueChange:S=>c({target:{name:b,value:S}})}))))};C.defaultProps={disabledEvents:[],events:[],inputValue:[],handleChange(){},handleChangeAll(){}},C.propTypes={disabledEvents:d().array,events:d().array,inputValue:d().array,handleChange:d().func,handleChangeAll:d().func,name:d().string.isRequired};var A=C,R=a=>a.reduce((r,o)=>{const s=o.split(".")[0];return r[s]||(r[s]=[]),r[s].push(o),r},{});const pe=ye.default.table`
  td {
    height: ${52/16}rem;
    width: 10%;
    vertical-align: middle;
    text-align: center;
  }

  tbody tr:nth-child(odd) {
    background: ${({theme:a})=>a.colors.neutral100};
  }

  tbody tr td:first-child {
    padding-left: ${({theme:a})=>a.spaces[7]};
  }
`,re={headers:{default:[{id:"Settings.webhooks.events.create",defaultMessage:"Create"},{id:"Settings.webhooks.events.update",defaultMessage:"Update"},{id:"app.utils.delete",defaultMessage:"Delete"}],draftAndPublish:[{id:"Settings.webhooks.events.create",defaultMessage:"Create"},{id:"Settings.webhooks.events.update",defaultMessage:"Update"},{id:"app.utils.delete",defaultMessage:"Delete"},{id:"app.utils.publish",defaultMessage:"Publish"},{id:"app.utils.unpublish",defaultMessage:"Unpublish"}]},events:{default:{entry:["entry.create","entry.update","entry.delete"],media:["media.create","media.update","media.delete"]},draftAndPublish:{entry:["entry.create","entry.update","entry.delete","entry.publish","entry.unpublish"],media:["media.create","media.update","media.delete"]}}},fe=({isDraftAndPublish:a})=>{const r=a?re.headers.draftAndPublish:re.headers.default,o=a?re.events.draftAndPublish:re.events.default,{formatMessage:s}=(0,N.useIntl)(),{values:c,handleChange:O}=(0,Z.useFormikContext)(),u="events",f=c.events,m=[],K=R(f),b=({target:{name:v,value:ee}})=>{let l=new Set(f);ee?l.add(v):l.delete(v),O({target:{name:u,value:Array.from(l)}})},S=({target:{name:v,value:ee}})=>{let l=new Set(f);ee?o[v].forEach(g=>{m.includes(g)||l.add(g)}):o[v].forEach(g=>l.delete(g)),O({target:{name:u,value:Array.from(l)}})};return e.createElement(W.K,{spacing:1},e.createElement(Ce.Q,null,s({id:"Settings.webhooks.form.events",defaultMessage:"Events"})),e.createElement(pe,null,e.createElement("thead",null,e.createElement("tr",null,e.createElement("td",null),r.map(v=>v==="app.utils.publish"||v==="app.utils.unpublish"?e.createElement("td",{key:v.id,title:s({id:"Settings.webhooks.event.publish-tooltip",defaultMessage:"This event only exists for content with draft & publish enabled"})},e.createElement(F.Z,{variant:"sigma",textColor:"neutral600"},s(v))):e.createElement("td",{key:v.id},e.createElement(F.Z,{variant:"sigma",textColor:"neutral600"},s(v)))))),e.createElement("tbody",null,Object.keys(o).map(v=>e.createElement(A,{disabledEvents:m,key:v,name:v,events:o[v],inputValue:K[v],handleChange:b,handleChangeAll:S})))))};fe.propTypes={isDraftAndPublish:d().bool.isRequired};var J=fe,Te=t(19406),z=t(87933),Le=t(7563),Ae=t(21590),Me=t(90333),Pe=["A-IM","Accept","Accept-Charset","Accept-Encoding","Accept-Language","Accept-Datetime","Access-Control-Request-Method","Access-Control-Request-Headers","Authorization","Cache-Control","Connection","Content-Length","Content-Type","Cookie","Date","Expect","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Max-Forwards","Origin","Pragma","Proxy-Authorization","Range","Referer","TE","User-Agent","Upgrade","Via","Warning"];const oe=({name:a,onChange:r,value:o,...s})=>{const[c,O]=(0,e.useState)(o?[...Pe,o]:Pe),u=m=>{r({target:{name:a,value:m}})},f=m=>{O(K=>[...K,m]),r({target:{name:a,value:m}})};return e.createElement(Ae.X,{...s,onChange:u,onCreateOption:f,placeholder:"",value:o},c.map(m=>e.createElement(Me.O,{value:m,key:m},m)))};oe.defaultProps={value:void 0},oe.propTypes={name:d().string.isRequired,onChange:d().func.isRequired,value:d().string};var De=oe,xe=()=>{const{formatMessage:a}=(0,N.useIntl)(),{values:r,errors:o}=(0,Z.useFormikContext)();return e.createElement(W.K,{spacing:1},e.createElement(Ce.Q,null,a({id:"Settings.webhooks.form.headers",defaultMessage:"Headers"})),e.createElement(ae.x,{padding:8,background:"neutral100",hasRadius:!0},e.createElement(Z.FieldArray,{validateOnChange:!1,name:"headers",render:({push:s,remove:c})=>e.createElement(me.r,{gap:4},r.headers?.map((O,u)=>e.createElement(e.Fragment,{key:u},e.createElement(D.P,{col:6},e.createElement(Z.Field,{as:De,name:`headers.${u}.key`,"aria-label":`row ${u+1} key`,label:a({id:"Settings.webhooks.key",defaultMessage:"Key"}),error:o.headers?.[u]?.key&&a({id:o.headers[u]?.key,defaultMessage:o.headers[u]?.key})})),e.createElement(D.P,{col:6},e.createElement(z.k,{alignItems:"flex-end"},e.createElement(ae.x,{style:{flex:1}},e.createElement(Z.Field,{as:Q.o,"aria-label":`row ${u+1} value`,label:a({id:"Settings.webhooks.value",defaultMessage:"Value"}),name:`headers.${u}.value`,error:o.headers?.[u]?.value&&a({id:o.headers[u]?.value,defaultMessage:o.headers[u]?.value})})),e.createElement(z.k,{paddingLeft:2,style:{alignSelf:"center"},paddingTop:o.headers?.[u]?.value?0:5},e.createElement(n.RemoveRoundedButton,{onClick:()=>r.headers.length!==1&&c(u),label:a({id:"Settings.webhooks.headers.remove",defaultMessage:"Remove header row {number}"},{number:u+1})})))))),e.createElement(D.P,{col:12},e.createElement(Le.A,{type:"button",onClick:()=>{s({key:"",value:""})},startIcon:e.createElement(Te.default,null)},a({id:"Settings.webhooks.create.header",defaultMessage:"Create new header"}))))})))},w=t(35331),$e=t(27169);const le=ye.default.svg(({theme:a,color:r})=>`
  width: ${12/16}rem;
  height: ${12/16}rem;

  path {
    fill: ${a.colors[r]};
  }
`),y=({isPending:a,statusCode:r})=>{const{formatMessage:o}=(0,N.useIntl)();return a?e.createElement(W.K,{horizontal:!0,spacing:2,style:{alignItems:"center"}},e.createElement(le,{as:$e.Z}),e.createElement(F.Z,null,o({id:"Settings.webhooks.trigger.pending",defaultMessage:"pending"}))):r>=200&&r<300?e.createElement(W.K,{horizontal:!0,spacing:2,style:{alignItems:"center"}},e.createElement(le,{as:k.Z,color:"success700"}),e.createElement(F.Z,null,o({id:"Settings.webhooks.trigger.success",defaultMessage:"success"}))):r>=300?e.createElement(W.K,{horizontal:!0,spacing:2,style:{alignItems:"center"}},e.createElement(le,{as:w.default,color:"danger700"}),e.createElement(F.Z,null,o({id:"Settings.error",defaultMessage:"error"})," ",r)):null};y.propTypes={isPending:d().bool.isRequired,statusCode:d().number},y.defaultProps={statusCode:void 0};const se=({statusCode:a,message:r})=>{const{formatMessage:o}=(0,N.useIntl)();return a>=200&&a<300?e.createElement(z.k,{justifyContent:"flex-end"},e.createElement(F.Z,{textColor:"neutral600",ellipsis:!0},o({id:"Settings.webhooks.trigger.success.label",defaultMessage:"Trigger succeeded"}))):a>=300?e.createElement(z.k,{justifyContent:"flex-end"},e.createElement(z.k,{maxWidth:(0,n.pxToRem)(250),justifyContent:"flex-end",title:r},e.createElement(F.Z,{ellipsis:!0,textColor:"neutral600"},r))):null};se.propTypes={statusCode:d().number,message:d().string},se.defaultProps={statusCode:void 0,message:void 0};const Oe=({onCancel:a})=>{const{formatMessage:r}=(0,N.useIntl)();return e.createElement(z.k,{justifyContent:"flex-end"},e.createElement("button",{onClick:a,type:"button"},e.createElement(W.K,{horizontal:!0,spacing:2,style:{alignItems:"center"}},e.createElement(F.Z,{textColor:"neutral400"},r({id:"Settings.webhooks.trigger.cancel",defaultMessage:"cancel"})),e.createElement(le,{as:w.default,color:"neutral400"}))))};Oe.propTypes={onCancel:d().func.isRequired};const he=({isPending:a,onCancel:r,response:o})=>{const{statusCode:s,message:c}=o,{formatMessage:O}=(0,N.useIntl)();return e.createElement(ae.x,{background:"neutral0",padding:5,shadow:"filterShadow",hasRadius:!0},e.createElement(me.r,{gap:4,style:{alignItems:"center"}},e.createElement(D.P,{col:3},e.createElement(F.Z,null,O({id:"Settings.webhooks.trigger.test",defaultMessage:"Test-trigger"}))),e.createElement(D.P,{col:3},e.createElement(y,{isPending:a,statusCode:s})),e.createElement(D.P,{col:6},a?e.createElement(Oe,{onCancel:r}):e.createElement(se,{statusCode:s,message:c}))))};he.defaultProps={isPending:!1,onCancel(){},response:{}},he.propTypes={isPending:d().bool,onCancel:d().func,response:d().object};var $=he,B=t(5173);const H=/(^$)|(^[A-Za-z][_0-9A-Za-z ]*$)/,Be=/(^$)|((https?:\/\/.*)(d*)\/?(.*))/;var ie=B.Ry().shape({name:B.Z_(n.translatedErrors.string).required(n.translatedErrors.required).matches(H,n.translatedErrors.regex),url:B.Z_(n.translatedErrors.string).required(n.translatedErrors.required).matches(Be,n.translatedErrors.regex),headers:B.Vo(a=>{let r=B.IX();if(a.length===1){const{key:o,value:s}=a[0];if(!o&&!s)return r}return r.of(B.Ry().shape({key:B.Z_().required(n.translatedErrors.required),value:B.Z_().required(n.translatedErrors.required)}))}),events:B.IX()});const V=({handleSubmit:a,data:r,triggerWebhook:o,isCreating:s,isTriggering:c,triggerResponse:O,isDraftAndPublishEvents:u})=>{const{formatMessage:f}=(0,N.useIntl)(),[m,K]=(0,e.useState)(!1);return e.createElement(Z.Formik,{onSubmit:a,initialValues:{name:r?.name||"",url:r?.url||"",headers:Object.keys(r?.headers||[]).length?Object.entries(r.headers).map(([b,S])=>({key:b,value:S})):[{key:"",value:""}],events:r?.events||[]},validationSchema:ie,validateOnChange:!1,validateOnBlur:!1},({handleSubmit:b,errors:S})=>e.createElement(n.Form,{noValidate:!0},e.createElement(be.T,{primaryAction:e.createElement(W.K,{horizontal:!0,spacing:2},e.createElement(ue.z,{onClick:()=>{o(),K(!0)},variant:"tertiary",startIcon:e.createElement(ve,null),disabled:s||c,size:"L"},f({id:"Settings.webhooks.trigger",defaultMessage:"Trigger"})),e.createElement(ue.z,{startIcon:e.createElement(k.Z,null),onClick:b,type:"submit",size:"L"},f({id:"global.save",defaultMessage:"Save"}))),title:s?f({id:"Settings.webhooks.create",defaultMessage:"Create a webhook"}):r?.name,navigationAction:e.createElement(n.Link,{startIcon:e.createElement(h.Z,null),to:"/settings/webhooks"},f({id:"global.back",defaultMessage:"Back"}))}),e.createElement(Re.D,null,e.createElement(W.K,{spacing:4},m&&e.createElement("div",{className:"trigger-wrapper"},e.createElement($,{isPending:c,response:O,onCancel:()=>K(!1)})),e.createElement(ae.x,{background:"neutral0",padding:8,shadow:"filterShadow",hasRadius:!0},e.createElement(W.K,{spacing:6},e.createElement(me.r,{gap:6},e.createElement(D.P,{col:6},e.createElement(Z.Field,{as:Q.o,name:"name",error:S.name&&f({id:S.name}),label:f({id:"global.name",defaultMessage:"Name"}),required:!0})),e.createElement(D.P,{col:12},e.createElement(Z.Field,{as:Q.o,name:"url",error:S.url&&f({id:S.url}),label:f({id:"Settings.roles.form.input.url",defaultMessage:"Url"}),required:!0}))),e.createElement(xe,null),e.createElement(J,{isDraftAndPublish:u})))))))};V.propTypes={data:d().object,handleSubmit:d().func.isRequired,triggerWebhook:d().func.isRequired,isCreating:d().bool.isRequired,isDraftAndPublishEvents:d().bool.isRequired,isTriggering:d().bool.isRequired,triggerResponse:d().object},V.defaultProps={data:void 0,triggerResponse:void 0};var de=V,_=t(92891);const Se=a=>{const r={...a};return(0,_.set)(r,"headers",Ke(a.headers)),r},Ke=a=>a.reduce((r,o)=>{const{key:s,value:c}=o;return s!==""?{...r,[s]:c}:r},{});var Ee=Se,T=t(98399),Fe=()=>{const{params:{id:a}}=(0,x.useRouteMatch)("/settings/webhooks/:id"),{replace:r}=(0,x.useHistory)(),{lockApp:o,unlockApp:s}=(0,n.useOverlayBlocker)(),c=(0,n.useNotification)(),O=(0,P.useQueryClient)(),{isLoading:u,collectionTypes:f}=(0,E.bP)(),m=a==="create",K=(0,e.useCallback)(async j=>{const[X,{data:Ve}]=await(0,n.to)((0,n.request)(`/admin/webhooks/${j}`,{method:"GET"}));return X?(c({type:"warning",message:{id:"notification.error"}}),null):Ve},[c]),{isLoading:b,data:S}=(0,P.useQuery)(["get-webhook",a],()=>K(a),{enabled:!m}),{isLoading:v,data:ee,isIdle:l,mutate:g}=(0,P.useMutation)(()=>p.be.post(`/admin/webhooks/${a}/trigger`)),U=()=>g(null,{onError(){c({type:"warning",message:{id:"notification.error"}})}}),Y=(0,P.useMutation)(j=>(0,n.request)("/admin/webhooks",{method:"POST",body:j})),Ue=(0,P.useMutation)(({id:j,body:X})=>(0,n.request)(`/admin/webhooks/${j}`,{method:"PUT",body:X})),Ze=async j=>{m?(o(),Y.mutate(Ee(j),{onSuccess(X){c({type:"success",message:{id:"Settings.webhooks.created"}}),r(`/settings/webhooks/${X.data.id}`),s()},onError(X){c({type:"warning",message:{id:"notification.error"}}),T.log(X),s()}})):(o(),Ue.mutate({id:a,body:Ee(j)},{onSuccess(){O.invalidateQueries(["get-webhook",a]),c({type:"success",message:{id:"notification.form.success.fields"}}),s()},onError(X){c({type:"warning",message:{id:"notification.error"}}),T.log(X),s()}}))},ze=(0,e.useMemo)(()=>f.some(j=>j.options.draftAndPublish===!0),[f]);return b||u?e.createElement(n.LoadingIndicatorPage,null):e.createElement(L.o,null,e.createElement(n.SettingsPageTitle,{name:"Webhooks"}),e.createElement(de,{handleSubmit:Ze,data:S,triggerWebhook:U,isCreating:m,isTriggering:v,isTriggerIdle:l,triggerResponse:ee?.data.data,isDraftAndPublishEvents:ze}))}},33238:function(te,M,t){t.r(M);var e=t(32735),n=t(58521),L=t.n(n),P=t(83983),x=t(41513);const E=()=>e.createElement(n.CheckPagePermissions,{permissions:P.Z.settings.webhooks.create},e.createElement(x.Z,null));M.default=E},59021:function(te,M,t){t.r(M);var e=t(32735),n=t(58521),L=t.n(n),P=t(83983),x=t(41513);const E=()=>e.createElement(n.CheckPagePermissions,{permissions:P.Z.settings.webhooks.update},e.createElement(x.Z,null));M.default=E},21590:function(te,M,t){t.d(M,{h:function(){return G},X:function(){return ge}});var e=t(32735),n=t(60216),L=t(57269),P=t(59002),x=t(96892),E=t(94486);const p={Close:"Close",CloseSelect:"CloseSelect",First:"First",Last:"Last",Next:"Next",Open:"Open",PageDown:"PageDown",PageUp:"PageUp",Previous:"Previous",Select:"Select",Space:"Space",Type:"Type"},ne={Close:"Close",First:"First",Last:"Last",Next:"Next",Open:"Open",Previous:"Previous",Select:"Select",UpLevel:"UpLevel"};function d(i=[],C=null,A=[]){const q=String(C??"").toLowerCase();return q?i.filter(R=>R.props.children.toString().toLowerCase().includes(q)&&A.indexOf(R)<0):i}function h(i,C){if(!C&&i===E.y.DOWN)return p.Open;if(i===E.y.DOWN)return p.Next;if(i===E.y.UP)return p.Previous;if(i===E.y.HOME)return p.First;if(i===E.y.END)return p.Last;if(i===E.y.ESCAPE)return p.Close;if(i===E.y.ENTER)return p.CloseSelect;if(i===E.y.BACKSPACE||i===E.y.CLEAR||i.length===1)return p.Type}function k(i,C,A){switch(A){case p.First:return 0;case p.Last:return C;case p.Previous:return Math.max(0,i-1);case p.Next:return Math.min(C,i+1);default:return i}}function ce(i){x(i,{scrollMode:"if-needed",block:"nearest",inline:"nearest"}).forEach(({el:C,top:A,left:q})=>{C.scrollTop=A,C.scrollLeft=q})}var ve=t(87933),be=t(93958),Re=t(46406),ae=t(72850),ue=t(49372),W=t(97405),Q=t(91225),me=t(90333);const D=({options:i,activeOptionRef:C})=>((0,e.useEffect)(()=>{C.current&&ce(C.current)},[C]),i);D.defaultProps={activeOptionRef:void 0},D.propTypes={options:n.array.isRequired};var Z=t(87107),N=t(76437),Ce=t(67014),F=t(47851),ye=t(27677),Ie=t(3685);const G=({children:i,clearLabel:C,creatable:A,createMessage:q,disabled:R,error:pe,hasMoreItems:re,hint:fe,label:J,labelAction:Te,loading:z,loadingMessage:Le,noOptionsMessage:Ae,onChange:Me,onClear:ke,onCreateOption:Pe,onInputChange:oe,onLoadMore:De,placeholder:we,required:xe,value:w,...$e})=>{const le=()=>i.find(l=>l.props?.value.toLowerCase()===w.toLowerCase()).props?.children,[y,se]=(0,e.useState)(0),[Oe,he]=(0,e.useState)(null),[$,B]=(0,e.useState)(i),[H,Be]=(0,e.useState)(!1),[I,ie]=(0,e.useState)(""),V=(0,e.useRef)(),de=(0,e.useRef)(!1),_=(0,e.useRef)(),Se=(0,e.useRef)(),Ke=(0,e.useRef)(),Ee=(0,e.useRef)(!0),T=(0,P.M)("combobox"),We=`${T}-label`;if(!J&&!$e["aria-label"])throw new Error('The Combobox component needs a "label" or an "aria-label" props');(0,e.useEffect)(()=>{B(d(i,I))},[I,i]),(0,e.useEffect)(()=>{H&&V.current&&ce(V.current)},[y,H]),(0,e.useLayoutEffect)(()=>{Ee.current&&(Ee.current=!1)},[w]);const Fe=H?`${T}-${y}`:"",a=()=>{Me(null),ie("")},r=l=>{oe&&oe(l);const g=_.current.value;B(d(i,g)),se(0),he(null),I!==g&&ie(g),H||m(!0,!1)},o=l=>{const{key:g}=l,U=A&&I?$.length:$.length-1,Y=h(g,H);switch(w&&!I&&g===E.y.BACKSPACE&&a(),Y){case p.Next:{if(y===U){c(0);break}c(k(y,U,Y));break}case p.Previous:{if(y===0){c(U);break}c(k(y,U,Y));break}case p.Last:case p.First:{if(y===U){c(0);break}c(k(y,U,Y));break}case p.CloseSelect:l.preventDefault(),f(y);break;case p.Close:l.preventDefault(),m(!1);break;case p.Open:m(!0);break}},s=l=>{if(l.preventDefault(),w&&!de.current&&ie(""),de.current){de.current=!1;return}m(!1,!1)},c=l=>{se(l)},O=l=>{c(l),f(l)},u=()=>{de.current=!0},f=l=>{const g=$[l];if(ie(""),g){Me(g.props.value),m(!1);return}A&&(Pe(I),m(!1))},m=(l,g=!0)=>{Be(l),g&&_.current.focus()},K=e.Children.toArray($).map((l,g)=>{const U=y===g;return(0,e.cloneElement)(l,{id:`${T}-${g}`,"aria-selected":Oe===g,"aria-posinset":g+1,"aria-setsize":e.Children.toArray($).length,ref(Y){U&&(V.current=Y)},onClick:()=>O(g),onMouseDown:u,isSelected:U})}),b=()=>{_.current.focus(),ke&&ke(),a()},S=()=>{_.current.focus(),m(!0)},v=()=>{const l=$.findIndex(g=>g.props?.children===I);return I&&l===-1},ee=l=>{l.preventDefault(),m(l,!0)};return e.createElement(Z.g,{hint:fe,error:pe,id:T,required:xe},e.createElement(Ie.T,{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text"},w),e.createElement(ye.K,{spacing:J||fe||pe?1:0},J&&e.createElement(N.Q,{action:Te},J),e.createElement(Q.d8,{ref:Se,$disabled:R,hasError:pe},e.createElement(Q.fv,{wrap:"wrap"},!I&&w&&e.createElement(Q.K7,{id:`${T}-selected-value`},e.createElement(ue.Z,null,le())),e.createElement(Q.II,{"aria-activedescendant":Fe,"aria-autocomplete":"list","aria-controls":`${T}-listbox`,"aria-disabled":R,"aria-expanded":H,"aria-haspopup":"listbox","aria-labelledby":J?We:void 0,autoComplete:"off",autoCorrect:"off",id:T,onBlur:R?void 0:s,onClick:R?void 0:ee,onInput:R?void 0:r,onKeyDown:R?void 0:o,placeholder:w?"":we,readOnly:R,ref:_,required:xe,role:"combobox",spellCheck:"off",type:"text",value:I})),e.createElement(ve.k,null,(w||I)&&e.createElement(be.zb,{id:`${T}-clear`,"aria-label":C,disabled:R,paddingLeft:3,as:"button",onClick:b,type:"button"},e.createElement(L.Cross,null)),e.createElement(be.AV,{disabled:R,paddingLeft:3,"aria-hidden":!0,as:"button",onClick:S,tabIndex:-1,type:"button"},e.createElement(L.CarretDown,null)))),e.createElement(Ce.J,null),e.createElement(F.c,null)),H&&e.createElement(Re.J,{id:`${T}-popover`,source:Se,spacing:4,fullWidth:!0,intersectionId:`${T}-listbox-popover-intersection`,onReachEnd:re&&!z?De:void 0},e.createElement("div",{role:"listbox",ref:Ke,id:`${T}-listbox`,"aria-labelledby":J?We:void 0},(Boolean($.length)||A)&&e.createElement(e.Fragment,null,e.createElement(D,{activeOptionRef:V,options:K}),v()&&A&&e.createElement(me.O,{isSelected:y===$.length,ref:l=>{y===$.length&&(V.current=l)},onMouseDown:u,onClick:()=>f(),taindex:0},q(I))),!$.length&&!A&&!z&&e.createElement(ae.x,{paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2,ref:V},e.createElement(ue.Z,{textColor:"neutral800"},Ae(I))),z&&e.createElement(ve.k,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2},e.createElement(W.a,{small:!0},Le)))))},ge=i=>e.createElement(G,{...i,creatable:!0});G.defaultProps={"aria-label":void 0,clearLabel:"clear",creatable:!1,createMessage:i=>`Create "${i}"`,disabled:!1,error:void 0,hasMoreItems:!1,hint:void 0,label:void 0,loading:!1,loadingMessage:"Loading content...",noOptionsMessage:()=>"No results found",onClear:void 0,onCreateOption:void 0,onInputChange:void 0,onLoadMore:void 0,placeholder:"Select or enter a value",value:void 0},ge.defaultProps=G.defaultProps,G.propTypes={"aria-label":n.string,children:n.oneOfType([n.arrayOf(n.node),n.node]),clearLabel:n.string,creatable:n.bool,createMessage:n.func,disabled:n.bool,error:n.string,hasMoreItems:n.bool,hint:n.oneOfType([n.string,n.node,n.arrayOf(n.node)]),label:n.string,labelAction:n.element,loading:n.bool,loadingMessage:n.string,noOptionsMessage:n.func,onChange:n.func.isRequired,onClear:n.func,onCreateOption:n.func,onInputChange:n.func,onLoadMore:n.func,placeholder:n.string,value:n.string},ge.propTypes={...G.propTypes,onCreateOption:n.func.isRequired}},90333:function(te,M,t){t.d(M,{O:function(){return x}});var e=t(32735),n=t(60216),L=t(49372),P=t(91225);const x=(0,e.forwardRef)(({isSelected:E,children:p,...ne},d)=>e.createElement(P.Zq,{hasRadius:!0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2,role:"option",background:"neutral0",isSelected:E,ref:d,...ne},e.createElement(L.Z,{textColor:E?"primary600":"neutral800",fontWeight:E?"bold":null},p)));x.defaultProps={isSelected:!1},x.propTypes={children:n.oneOfType([n.string,n.number]).isRequired,isSelected:n.bool},x.displayName="ComboboxOption"},91225:function(te,M,t){t.d(M,{II:function(){return ne},K7:function(){return E},Zq:function(){return d},d8:function(){return x},fv:function(){return p}});var e=t(83292),n=t(72850),L=t(87933),P=t(30350);const x=(0,e.default)(L.k)`
  position: relative;
  border: 1px solid ${({theme:h,hasError:k})=>k?h.colors.danger600:h.colors.neutral200};
  padding-right: ${({theme:h})=>h.spaces[3]};
  padding-left: ${({theme:h})=>h.spaces[3]};
  border-radius: ${({theme:h})=>h.borderRadius};
  background: ${({theme:h})=>h.colors.neutral0};

  ${({theme:h,$disabled:k})=>k?`
    color: ${h.colors.neutral600};
    background: ${h.colors.neutral150};
  `:void 0}

  ${(0,P.k3)()}
`,E=e.default.div`
  padding: 1px 2px;
  grid-area: 1 / 1 / 2 / 3;
`,p=(0,e.default)(L.k)`
  display: grid;
  flex: 1 1 0%;
  position: relative;
`,ne=e.default.input`
  display: inline-grid;
  grid-area: 1 / 1 / 2 / 3;
  grid-template-columns: 0px min-content;
  background: transparent;
  min-height: ${40/16}rem;
  border: none;
  flex: 1;
  font-size: ${14/16}rem;
  color: ${({theme:h})=>h.colors.neutral800};
  outline: none;
  &:focus-visible {
    outline: none;
    box-shadow: none;
    outline-offset: 0;
  }
  &[aria-disabled='true'] {
    background: inherit;
    color: inherit;
    cursor: not-allowed;
  }
`,d=(0,e.default)(n.x)`
  width: 100%;
  border: none;
  text-align: left;
  outline-offset: -3px;
  ${({isSelected:h,theme:k})=>h&&`background: ${k.colors.primary100};`}

  &:hover {
    background: ${({theme:h})=>h.colors.primary100};
  }
`},27169:function(te,M,t){t.d(M,{Z:function(){return n}});var e=t(74512);function n(L){return(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...L,children:(0,e.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.057 18c.552 0 1 .451 1 .997v4.006a1 1 0 01-.941.995l-.059.002c-.552 0-1-.451-1-.997v-4.006a1 1 0 01.941-.995l.06-.002zm-3.06-.736l.055.03c.478.276.64.89.367 1.364l-2.002 3.468a1 1 0 01-1.31.394l-.055-.03a1.002 1.002 0 01-.368-1.363l2.003-3.469a1 1 0 011.31-.394zm7.42.394l2.002 3.468a1 1 0 01-.314 1.331l-.053.033a1.002 1.002 0 01-1.365-.363l-2.003-3.469a1 1 0 01.314-1.33l.054-.034a1.002 1.002 0 011.364.364zm-9.548-2.66l.033.054c.276.478.11 1.091-.364 1.364L3.07 18.42a1 1 0 01-1.331-.314l-.033-.053a1.001 1.001 0 01.364-1.365l3.468-2.003a1 1 0 011.33.314zm11.79-.313l3.468 2.002a1 1 0 01.393 1.31l-.03.055c-.276.478-.89.64-1.363.367l-3.469-2.003a1 1 0 01-.394-1.309l.03-.055c.276-.479.89-.64 1.364-.367zm4.344-3.628a1 1 0 01.995.941l.002.06c0 .551-.451 1-.997 1h-4.006a1 1 0 01-.995-.942L18 12.057c0-.552.451-1 .997-1h4.006zm-18 0a1 1 0 01.995.941l.002.06c0 .551-.451 1-.998 1H.998a1 1 0 01-.996-.942L0 12.057c0-.552.451-1 .998-1h4.004zm17.454-5.059l.033.054c.277.478.11 1.091-.363 1.365l-3.469 2.002a1 1 0 01-1.33-.314l-.034-.053a1.002 1.002 0 01.364-1.365l3.468-2.003a1 1 0 011.331.314zM3.07 5.684l3.468 2.003a1 1 0 01.394 1.31l-.03.055c-.276.478-.89.64-1.364.367L2.07 7.417a1 1 0 01-.394-1.31l.03-.055c.276-.479.89-.64 1.364-.368zm14.926-4.008l.056.03c.478.276.64.89.367 1.364l-2.003 3.468a1 1 0 01-1.309.394l-.055-.03a1.002 1.002 0 01-.367-1.364l2.002-3.468a1 1 0 011.31-.394zm-10.58.394L9.42 5.538a1 1 0 01-.314 1.33l-.053.034a1.002 1.002 0 01-1.365-.364L5.684 3.07a1 1 0 01.314-1.331l.054-.033a1.002 1.002 0 011.365.364zM12.058 0c.552 0 1 .451 1 .998v4.004a1 1 0 01-.941.996L12.057 6c-.552 0-1-.451-1-.998V.998a1 1 0 01.941-.996l.06-.002z",fill:"#212134"})})}}}]);
