1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6641],{67631:function(e){e.exports=function(e,s){for(var a=-1,t=null==e?0:e.length,n=Array(t);++a<t;)n[a]=s(e[a],a,e);return n}},65517:function(e){e.exports=function(e){return e.split("")}},12639:function(e){e.exports=function(e,s,a){var t=-1,n=e.length;s<0&&(s=-s>n?0:n+s),(a=a>n?n:a)<0&&(a+=n),n=s>a?0:a-s>>>0,s>>>=0;for(var l=Array(n);++t<n;)l[t]=e[t+s];return l}},17185:function(e,s,a){var t=a(66293),n=a(67631),l=a(2428),c=a(42848),i=1/0,r=t?t.prototype:void 0,o=r?r.toString:void 0;e.exports=function e(s){if("string"==typeof s)return s;if(l(s))return n(s,e)+"";if(c(s))return o?o.call(s):"";var a=s+"";return"0"==a&&1/s==-i?"-0":a}},87493:function(e,s,a){var t=a(12639);e.exports=function(e,s,a){var n=e.length;return a=void 0===a?n:a,!s&&a>=n?e:t(e,s,a)}},48790:function(e,s,a){var t=a(87493),n=a(98030),l=a(59901),c=a(44091);e.exports=function(e){return function(s){var a=n(s=c(s))?l(s):void 0,i=a?t(a,1).join(""):s.slice(1);return(a?a[0]:s.charAt(0))[e]()+i}}},98030:function(e){var s=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return s.test(e)}},59901:function(e,s,a){var t=a(65517),n=a(98030),l=a(38892);e.exports=function(e){return n(e)?l(e):t(e)}},38892:function(e){var s="\ud800-\udfff",a="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",t="\ud83c[\udffb-\udfff]",n="[^"+s+"]",l="(?:\ud83c[\udde6-\uddff]){2}",c="[\ud800-\udbff][\udc00-\udfff]",i="(?:"+a+"|"+t+")?",r="[\\ufe0e\\ufe0f]?",o="(?:\\u200d(?:"+[n,l,c].join("|")+")"+r+i+")*",u=RegExp(t+"(?="+t+")|(?:"+[n+a+"?",a,l,c,"["+s+"]"].join("|")+")"+(r+i+o),"g");e.exports=function(e){return e.match(u)||[]}},30892:function(e,s,a){var t=a(44091),n=a(57647);e.exports=function(e){return n(t(e).toLowerCase())}},44091:function(e,s,a){var t=a(17185);e.exports=function(e){return null==e?"":t(e)}},57647:function(e,s,a){var t=a(48790)("toUpperCase");e.exports=t},62441:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cms",function(){return a(53641)}])},15058:function(e,s,a){"use strict";var t=a(20503),n=a(73732),l=a(1610),c=a(93054),i=a(26372),r=a.n(i),o=a(99658),u=a.n(o);let _="__none__",m=(0,n.memo)(e=>{let{label:s,icon:a,className:n,value:l,...i}=e;return(0,t.jsx)(c.ck,{className:r()(u().item,n),value:l,...i,children:(0,t.jsxs)(c.eT,{children:[s," ",a]})})});m.displayName="SelectItem",s.Z=(0,n.memo)(e=>{let{value:s,onValueChange:a,items:i,className:o,placeholder:d,position:p="item-aligned"}=e,h=(0,n.useMemo)(()=>d?[{label:d,value:_},...i]:i,[d,i]),f=(0,n.useCallback)(()=>h.map(e=>{let{className:a}=e;return(0,t.jsx)(m,{...e,className:r()(a,{[u().selected]:e.value===s})},e.value)}),[h,s]),x=(0,n.useCallback)(e=>{e===_?a(""):a(e)},[a]);return(0,t.jsx)("div",{className:u().select,children:(0,t.jsxs)(c.fC,{value:s,onValueChange:x,children:[(0,t.jsxs)(c.xz,{className:r()(u().trigger,o),children:[(0,t.jsx)(c.B4,{className:u().value,placeholder:d}),(0,t.jsx)(c.JO,{className:u().icon,children:(0,t.jsx)(l.v4q,{})})]}),(0,t.jsx)(c.h_,{children:(0,t.jsx)(c.VY,{className:u().selectContent,position:p,children:(0,t.jsx)(c.l_,{className:u().viewport,children:f()})})})]})})})},53641:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return V}});var t=a(20503),n=a(73732),l=a(6446),c=a(12410),i=a(57014),r=a(90374),o=a(1610),u=a(26372),_=a.n(u),m=a(30892),d=a.n(m),p=a(73136),h=a.n(p),f=a(13154),x=a(32611),g=a(71002),j=a(17156),v=a(3910),N=a(24097),C=a(65182),b=a(15058),w=a(79170),y=a(8409),k=a(45747),P=a(60726),S=a(67746),I=a(35656),T=a(67679),B=a.n(T);let D=[{label:"Any Template",value:"all"},{label:"Tools Page V1",value:g.PI.GenericStudioTool},{label:"Page Template V2",value:g.PI.GenericPage},{label:"Template Collection",value:g.PI.TemplatesPage},{label:"PSD Templates",value:g.PI.PSDTemplatesPage}],L=[{label:"Any Status",value:"all"},{label:"Published",value:g.ti.Published},{label:"Draft",value:g.ti.Draft}];
1function V(){let[e,s]=(0,n.useState)(""),[a,l]=(0,n.useState)(1),[c,i]=(0,n.useState)(""),[u,m]=(0,n.useState)({status:"all",template:"all"}),{pageData:d,isLoading:p,mutate:h}=(0,y.Qt)(a,g.z6,e,u),f=null==d?void 0:d.pages,N=null==d?void 0:d.lastPage,w=(0,n.useMemo)(()=>f?f.filter(e=>("all"===u.status||e.status===u.status)&&("all"===u.template||e.template===u.template)):[],[u.status,u.template,f]),k=(0,n.useCallback)(e=>{m(s=>({...s,status:e}))},[]),S=(0,n.useCallback)(e=>{m(s=>({...s,template:e}))},[]),I=(0,n.useCallback)(e=>{e.preventDefault(),l(1),s(c)},[c]),T=(0,n.useCallback)(()=>{""===c&&s("")},[c]),V=()=>(0,t.jsxs)("div",{className:B().filters,children:[(0,t.jsx)(b.Z,{value:u.template,onValueChange:S,items:D,className:B().filterSelect,position:"popper"}),(0,t.jsx)(b.Z,{value:u.status,onValueChange:k,items:L,className:B().filterSelect,position:"popper"})]});return(0,t.jsxs)(j.Z,{children:[(0,t.jsx)(v.Z,{}),(0,t.jsxs)("div",{className:B().cmsHome,children:[p&&(0,t.jsx)(P.Z,{}),(0,t.jsx)("div",{className:_()(B().sticky),children:(0,t.jsxs)(r.fC,{onSubmit:I,className:B().searchBarContainer,children:[(0,t.jsx)(o._Ve,{className:B().searchBarIcon}),(0,t.jsx)("div",{className:B().filterContainer,children:V()}),(0,t.jsx)(r.gN,{name:"search",children:(0,t.jsx)(C.Z,{value:c,setValue:i,type:"text",className:B().searchBar,placeholder:"Search for a slug...",onKeyUp:T})})]})}),w&&w.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:B().pageList,children:w.map(e=>(0,t.jsx)("div",{children:(0,t.jsx)(Z,{page:e,mutate:h})},e._id))}),(0,t.jsxs)("div",{className:B().paginationContainer,children:[a>1&&(0,t.jsxs)("div",{className:B().paginationButton,onClick:()=>l(a-1),children:[(0,t.jsx)(x.YFh,{className:B().arrowIcon}),"Previous"]}),"Page ",a,N&&a<N&&(0,t.jsxs)("div",{className:B().paginationButton,onClick:()=>l(a+1),children:["Next",(0,t.jsx)(x.Tfp,{className:B().arrowIcon})]})]})]}):null,f&&f.length?null:(()=>{if(p)return null;let s={query:e,pageTemplate:u.template,pageStatus:u.status,currentPage:a};return(0,t.jsxs)("div",{className:B().empty,children:[(0,t.jsxs)("p",{children:["No pages found that match the following query:",(0,t.jsx)("pre",{children:JSON.stringify(s,null,2)})]}),1!==a?(0,t.jsx)("div",{className:B().resetPage,onClick:()=>{l(1)},children:"Reset currentPage to 1"}):null]})})(),f&&f.length&&e?null:(0,t.jsx)("div",{className:B().empty,children:(0,t.jsxs)("p",{children:["No slugs found for ",(0,t.jsxs)("strong",{children:[" ",e]})]})})]})]})}let Z=e=>{let{page:s,mutate:a}=e,u=(0,f.useRouter)(),{pageSlugs:m,isLoading:p}=(0,y.zx)(),{showSuccess:x,showError:j}=(0,k.Z)(),{_id:v,slug:b,status:P,updatedAt:T,revised:D,...L}=s,{meta:V}=P===g.ti.Draft&&D?D:L,[Z,R]=(0,n.useState)(""),[z,A]=(0,n.useState)(!1),O=(0,n.useMemo)(()=>!!m&&!p&&(0,N.L$)({value:Z,pageSlugs:m}),[Z,p,m]),Q=(0,n.useCallback)(async()=>{if(!O){j("Invalid slug.");return}let{_id:e,...a}=s,t={...a,slug:Z,meta:{...a.meta,url:Z,canonicalLink:"https://www.kapwing.com"+Z,origin:(0,S.i)(Z)}};try{A(!0);let e=await (0,w.D4)(t);u.push("/cms/page?id=".concat(e))}catch(e){console.error(e.message),j(e)}},[Z,O,s,u,j]);return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(l.fC,{children:(0,t.jsx)(c.fC,{children:(0,t.jsxs)(i.fC,{children:[(0,t.jsxs)(I.Z,{className:B().pageListItem,href:"/cms/page/?id=".concat(v),children:[(0,t.jsx)("div",{className:B().thumbnailContainer,children:(0,t.jsx)("img",{src:V.ogImage,alt:V.url,className:B().thumbnail})}),(0,t.jsxs)("div",{className:B().infoContainer,children:[(0,t.jsx)("h4",{className:B().title,children:V.title}),(0,t.jsx)("p",{className:B().slug,children:b})," ",(0,t.jsxs)("div",{className:B().statusContainer,children:[(0,t.jsx)("div",{className:B().status,children:(0,t.jsx)("div",{className:"".concat(B().statusPill," ").concat(P===g.ti.Draft?B().draft:B().published),children:d()(P)})}),(0,t.jsxs)("p",{className:B().updated,children:["Edited ",h()(T).fromNow()]})]})]}),(0,t.jsx)(i.xz,{asChild:!0,children:(0,t.jsx)("div",{className:_()(B().options,B().toggleItem),children:(0,t.jsx)(o.AjK,{})})})]},v),(0,t.jsx)(l.h_,{children:(0,t.jsx)(l.aV,{className:B().overlay,children:(0,t.jsxs)(l.VY,{className:B().alert,children:[(0,t.jsx)(l.Dx,{className:B().title,children:"Are you sure?"}),(0,t.jsxs)(l.dk,{className:B().description,children:["Are you sure you want to delete this page: ",b,"? This action cannot be undone."]}),(0,t.jsxs)("div",{className:B().buttonContainers,children:[(0,t.jsx)(l.$j,{className:"".concat(B().button," ").concat(B().cancel),children:"Back"}),(0,t.jsx)(l.aU,{className:"".concat(B().button," ").concat(B().confirm),onClick:async()=>{await (0,w.CT)(v),x("Page deleted successfully!"),a()},children:"Yes"})]})]})})}),(0,t.jsx)(c.h_,{children:(0,t.jsx)(c.aV,{className:B().overlay,children:(0,t.jsx)(c.VY,{className:B().dialog,children:(0,t.jsxs)(r.fC,{onSubmit:async e=>{e.preventDefault(),await Q()},children:[(0,t.jsx)(c.Dx,{className:B().title,children:"Duplicate page"}),(0,t.jsxs)(c.dk,{className:B().description,children:["Choose a new slug for your page. You slug must be unique.",(0,t.jsx)(r.gN,{name:"slug",children:(0,t.jsx)(C.Z,{value:Z,setValue:R,type:"text",placeholder:"Input a new slug...",messages:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.WU,{}),(0,t.jsx)(N.wS,{}),(0,t.jsx)(N.PI,{}),(0,t.jsx)(N.XQ,{pageSlugs:null!=m?m:[]})]})})})]}),(0,t.jsxs)("div",{className:B().buttonContainers,children:[(0,t.jsx)(c.x8,{className:"".concat(B().button," ").concat(B().cancel),children:"Cancel"}),(0,t.jsx)(r.k4,{className:"".concat(B().button," ").concat(B().primary," ").concat(z||p?B().disabled:""),children:"Duplicate Page"})]})]})})})}),(0,t.jsx)(i.Uv,{children:(0,t.jsxs)(i.VY,{className:B().dropdown,align:"end",children:[(0,t.jsxs)(i.ck,{onClick:async()=>{P===g.ti.Draft?(await (0,w.st)(v),x("Page published successfully!")):(await (0,w.kx
1)(v),x("Page unpublished successfully!")),a()},className:B().item,children:[P===g.ti.Draft?(0,t.jsx)(o.otr,{className:B().icon}):(0,t.jsx)(o.$mW,{className:B().icon}),P===g.ti.Draft?"Publish":"Unpublish"]}),(0,t.jsx)(c.xz,{asChild:!0,children:(0,t.jsxs)(i.ck,{className:B().item,children:[(0,t.jsx)(o.aAW,{className:B().icon}),"Duplicate"]})}),(0,t.jsx)(l.xz,{asChild:!0,children:(0,t.jsxs)(i.ck,{className:B().item,children:[(0,t.jsx)(o.XHJ,{className:B().icon}),"Delete"]})})]})})]})})})})}},67679:function(e){e.exports={"animate-gradient":"cms_animate-gradient__jkw0a",gradient:"cms_gradient__cUtnC",fadeIn:"cms_fadeIn__rVoZM","animate-pink-gradient":"cms_animate-pink-gradient__zi_mp",pinkGradient:"cms_pinkGradient__3u2z4","prevent-highlight":"cms_prevent-highlight__I_FYT","no-select":"cms_no-select__yfwir",noselect:"cms_noselect__XnI7o",button:"cms_button__yTk47",icon:"cms_icon__XPcXE",toggleItem:"cms_toggleItem__FeoPe",primary:"cms_primary__MeZhr",secondary:"cms_secondary__TiEUe",warning:"cms_warning__DmBM9",tertiary:"cms_tertiary__Gjml5",disabled:"cms_disabled__JC6sy",overlay:"cms_overlay__LbicC",content:"cms_content__RRGNO",alert:"cms_alert__SQzV0",dialog:"cms_dialog__Sk7nz",description:"cms_description__tSxLs",buttonContainers:"cms_buttonContainers__9hfUx",confirm:"cms_confirm__QVc5t",cancel:"cms_cancel__yCg6r",dropShadow:"cms_dropShadow__0PLdl",dropdown:"cms_dropdown__Rikht",item:"cms_item__QMr1x",dropdownIndicator:"cms_dropdownIndicator__Q4A_w",slotRight:"cms_slotRight__Zmoeb",dropdownLabel:"cms_dropdownLabel__ns3Pm",dropdownSeparator:"cms_dropdownSeparator__0roA0",active:"cms_active__Bal7x",select:"cms_select___pGuD",trigger:"cms_trigger__rMu0s",selectContent:"cms_selectContent__MQt25",viewport:"cms_viewport__3lBCR",selected:"cms_selected__OwWZu",label:"cms_label__4c5Ot",sticky:"cms_sticky__NdkzP",empty:"cms_empty__ArBP5",resetPage:"cms_resetPage__O_x8Z",searchBarContainer:"cms_searchBarContainer__TQPuC",searchBar:"cms_searchBar__FFgFk",filterSelect:"cms_filterSelect__JiRak",searchBarIcon:"cms_searchBarIcon__LEJq0",filterContainer:"cms_filterContainer__Lspyq",pageListItem:"cms_pageListItem__ZTrKk",thumbnailContainer:"cms_thumbnailContainer__TYlFj",thumbnail:"cms_thumbnail__jQ_wl",infoContainer:"cms_infoContainer__8hPpr",statusContainer:"cms_statusContainer__Rdeh_",title:"cms_title__QewOf",slug:"cms_slug__Zveje",updated:"cms_updated__u3wos",status:"cms_status__LTJPO",options:"cms_options__uKB_u",pageList:"cms_pageList___6HiR",statusPill:"cms_statusPill__T6IwS",draft:"cms_draft__xo3D5",published:"cms_published__Mj2Be",cmsHome:"cms_cmsHome__QkDXO",pageInfo:"cms_pageInfo__WH9S5",filters:"cms_filters__BbQws",paginationContainer:"cms_paginationContainer__bXX9r",paginationButton:"cms_paginationButton__sKFzI",arrowIcon:"cms_arrowIcon__SkOWT"}}},function(e){e.O(0,[5842,828,9112,9914,9228,7069,2611,2233,9324,4952,4078,6585,9774,2888,179],function(){return e(e.s=62441)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.