1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2252],{31817:(e,t,n)=>{n.d(t,{$8:()=>p,GI:()=>y,Ix:()=>l,JE:()=>b,Pz:()=>c,Sz:()=>f,WO:()=>g,es:()=>d,gf:()=>v,j6:()=>w,py:()=>h,vX:()=>m});var r,o,i=n(76367),a=n(91167),c=((r={}).CROP="crop",r.SCALE="scale",r.MAX="max",r),s={landscape:"aspect-w-16 aspect-h-9",portrait:"",square:"aspect-w-1 aspect-h-1",strap:""};function l(e){return s[function(e){var t="landscape";if(e){var n=e.cropHeight,r=e.cropWidth;void 0!==n&&void 0!==r&&(Math.min(r,n)/Math.max(r,n)>.8?t="square":n/r<.3?t="strap":n>r&&(t="portrait"))}return t}(e)]}var u={c100x66:{f:"crop",h:66,w:100},c105x70:{f:"crop",h:70,w:105},c200x132:{f:"crop",h:132,w:200},c284x270:{f:"crop",h:270,w:284},c370x246:{f:"crop",h:246,w:370},c370x270:{f:"crop",h:270,w:370},c576x298:{f:"crop",h:298,w:576},c627x561:{f:"crop",h:561,w:627},c700x400:{f:"crop",h:400,w:770},c800x561:{f:"crop",h:561,w:800},c1200x678:{f:"crop",h:678,w:1200},cartoon:{f:"crop",h:365,w:500},cartoonLarge:{f:"crop",h:730,w:1e3},deep:{f:"crop",h:630,w:470},exploreTravel:{f:"crop",h:651,w:980},feature:{f:"crop",h:300,w:850},iphone:{f:"crop",h:320,w:320},iphone2x:{f:"scale",h:640,w:640},large:{f:"crop",h:678,w:1200},medium:{f:"crop",h:298,w:576},postcard:{f:"crop",h:180,w:270},small:{f:"crop",h:246,w:370},square:{f:"crop",h:320,w:470},thumbnail:{f:"crop",h:90,w:130},thumbnailLarge:{f:"crop",h:145,w:215},thumbnailSmall:{f:"crop",h:60,w:90},tiny:{f:"crop",h:132,w:200},wide:{f:"crop",h:210,w:370}};function d(e){var t,n,r=e.sourceHeight,o=e.sourceWidth,i={cropHeight:r,cropWidth:o,cropX:0,cropY:0,focalX:Math.round(o/2),focalY:Math.round(r/2),scale:1};return o>=r&&(o/r>16/9?(i.cropHeight=r,i.cropWidth=16*r/9):o/r<16/9&&(i.cropWidth=o,i.cropHeight=9*o/16),i.cropX=(o-(null!=(t=i.cropWidth)?t:0))/2,i.cropY=(r-(null!=(n=i.cropHeight)?n:0))/2),i.cropX<0&&(i.cropX=0),i.cropY<0&&(i.cropY=0),i}function f(e){var t=e.aspect,n=e.focalX,r=e.focalY,o=e.height,i=void 0===o?1:o,a=e.scale,c=void 0===a?1:a,s=e.width,l=void 0===s?1:s,u=l/c,d=i/c;t>l/i?d=u/t:u=d*t;var f=r-r/i*d;return{height:Math.round(d),topX:Math.round(n-n/l*u),topY:Math.round(f),width:Math.round(u)}}var h=((o={}).JPG="jpg",o.WEBP="webp",o);function p(e){var t=e.fit,n=e.height,r=e.ignoreCrop,o=void 0!==r&&r,c=e.image,s=e.outputFormat,l=void 0===s?"jpg":s,d=e.size,h=e.useFocalPoint,p=void 0===h||h,x=e.width,m="cropConfig"in c?c.cropConfig:void 0,g={f:"crop",h:n,w:x};if(d&&!(g=(0,i._)({},u[d])))throw Error("Unsupported transform size ".concat(d));if(t&&(g.f=t),g.path=c.uri.replace(/^\/+|\/+$/g,""),void 0===g.h&&(g.h=0),void 0===g.w&&(g.w=0),void 0===g.f&&(g.f="crop"),o||!((v="cropConfig"in c?c.cropConfig:void 0)&&v.cropWidth))g.transform="resize",g.request=0!==g.h?"w".concat(g.w,"_h").concat(g.h,"_f").concat(o?"max":g.f,".").concat(l):"w".concat(g.w,"_h").concat(g.h,".").concat(l,"?resize_filter=lanczos2&quality=100");else{var v,b,w,y,j=function(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r="cropConfig"in e?e.cropConfig:void 0;if(!r)return[];if(n&&void 0!==r.focalX&&void 0!==r.focalY){var o=f({aspect:t,focalX:r.focalX-r.cropX,focalY:r.focalY-r.cropY,height:r.cropHeight,width:r.cropWidth}),i=Math.round(o.topX+r.cropX),a=Math.round(o.topY+r.cropY);return[[i,a],[Math.round(i+o.width),Math.round(a+o.height)]]}return[[Math.round(r.cropX),Math.round(r.cropY)],[Math.round(r.cropX+(r.cropWidth||0)),Math.round(r.cropY+(r.cropHeight||0))]]}(c,0===g.h?1:g.w/g.h,p);g.transform="crop",b=(0,a._)(j,2),w=(0,a._)(b[0],2),g.x1=w[0],g.y1=w[1],y=(0,a._)(b[1],2),g.x2=y[0],g.y2=y[1],p&&(null==m?void 0:m.focalX)!==void 0&&(g.f="max"),g.request="r".concat(g.x1,"_").concat(g.y1,"_").concat(g.x2,"_").concat(g.y2,"_")+"w".concat(g.w,"_h").concat(g.h,"_f").concat(g.f,".").concat(l)}return g}function x(e){var t=p(e),n="transform/v1/".concat(t.transform,"/frm/").concat(t.path,"/");return"".concat(n).concat(t.request)}function m(e){var t=p(e);return[t.x1+t.x2,t.y1+t.y2]}function g(e){var t=e.fit,n=e.height,r=e.ignoreCrop,o=e.image,i=e.outputFormat,a=e.size,c=e.transformUrl,s=e.useFocalPoint,l=e.width;if(a&&(l||n))throw Error("Cannot use fixedSize and dimensions together");return"".concat(c).concat(x({fit:t,height:n,ignoreCrop:r,image:o,outputFormat:i,size:a,useFocalPoint:s,width:l}))}function v(e){var t=e.fit,n=e.height,r=e.image,o=e.outputFormat,i=e.transformUrl,a=e.width;
1return"".concat(i).concat(x({fit:void 0===t?"crop":t,height:n,ignoreCrop:!1,image:r,outputFormat:o,useFocalPoint:!1,width:a}))}function b(e){var t=e.height,n=e.image,r=e.outputFormat,o=e.transformUrl,i=e.width;return"".concat(o).concat(x({height:t,ignoreCrop:!0,image:n,outputFormat:void 0===r?"jpg":r,useFocalPoint:!1,width:i}))}function w(e){return"uri"in e&&!!e.uri}function y(e){return new Promise(function(t){var n=new Image;n.onload=function(){return t(!0)},n.onerror=function(){return t(!1)},n.src=e})}},62252:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Q});var r,o,i=n(60143),a=n(67501),c=n(92584),s=n(29722),l=n(45159),u=n(54166),d=n(91167),f=n(22951),h=n(17393),p=n(39847);function x(e){var t=e.type,n=(0,d._)((0,f.i)(function(){return{item:{type:t},options:{dropEffect:"copy"},type:p.QF.ZONE_ITEM}}),2)[1],r=h.A[t]||{},o=r.icon,a=r.name;return n((0,i.jsxs)("div",{className:"flex w-full cursor-move flex-col items-center border bg-white p-2 text-center",children:[(0,i.jsx)(u.y,{className:"mb-2",icon:o,size:"2x"}),a]}))}var m=n(65389);function g(){return(0,i.jsx)("div",{className:"-mx-2 flex flex-wrap text-sm",children:Object.values(m.Av).map(function(e){return(0,i.jsx)("div",{className:"my-2 w-1/3 px-2",children:(0,i.jsx)(x,{type:e})},e)})})}var v=n(62715),b=n(10184),w=n(49876),y=n(54504),j=n(85406),N=n(49303),S=n(40229);function _(e){return(0,j._)(function(e){var t,n;return(0,N.YH)(this,function(r){switch(r.label){case 0:return t=e.token,n=window.getStore(),[4,fetch("".concat(n.getState().racetracks.monzaUrl,"o/tokeninfo/"),{headers:{Authorization:"Bearer ".concat(t)},method:"GET"})];case 1:return[4,r.sent().json()];case 2:return[2,S._7.apply(void 0,[r.sent()])]}})}).apply(this,arguments)}function k(e){var t=e.children,n=e.title,r=(0,d._)((0,l.useState)(!1),2),o=r[0],a=r[1];return(0,i.jsxs)("div",{className:"border-b-1 border-gray-200 bg-gray-100",children:[(0,i.jsx)("button",{className:"w-full border-b-1 border-gray-200 px-4 text-left leading-9 focus:outline-none",onClick:function(){return a(!o)},type:"button",children:(0,i.jsxs)("div",{className:"flex flex-row items-center",children:[(0,i.jsx)(u.y,{className:"mr-2 text-gray-500 transition-all ".concat(o?"rotate-90":"rotate-0"),icon:c.XkK,size:"xs"}),n]})}),(0,i.jsx)("div",{className:"relative h-full ".concat(o?"py-2":"max-h-0 overflow-hidden py-0"," px-4 transition-all"),children:l.cloneElement(t,{expanded:o})})]})}function C(e){var t=e.children,n=e.disabled,r=e.onClick;return(0,i.jsx)("button",{className:(0,s.A)("w-full bg-blue-500 py-1 text-center text-white hover:bg-blue-400 focus:outline-none",{"pointer-events-none border border-gray-300 bg-transparent text-gray-300":void 0!==n&&n}),onClick:r,type:"button",children:t})}n(87358);var z=n(31817);function E(e){return(0,j._)(function(e){var t,n,r,o,i,a;return(0,N.YH)(this,function(c){switch(c.label){case 0:return t=e.limit,n=e.offset,r=e.query,o=e.token,i=new URLSearchParams({limit:t.toString(),media_type:"image",offset:n.toString(),q:r}),a=window.getStore(),[4,fetch("".concat(a.getState().racetracks.valenciaUrl,"api/v1/object/?").concat(i.toString()),{headers:{Authorization:"Bearer ".concat(o)},method:"GET"})];case 1:return[4,c.sent().json()];case 2:return[2,S._7.apply(void 0,[c.sent()])]}})}).apply(this,arguments)}function A(e){var t=e.children,n=e.className,r=e.onClick,o=e.testId;return(0,i.jsx)("button",{className:(0,s.A)("flex size-8 items-center justify-center border-1 border-gray-300","bg-white text-lg text-gray-500","hover:z-10 hover:border-blue-400 hover:text-blue-400","focus:outline-none",n),"data-testid":o,onClick:r,type:"button",children:t})}function U(e){var t=e.image,n=e.url,r=(0,d._)((0,f.i)(function(){return{collect:function(e){return{isDragging:e.isDragging()}},item:{cropConfig:(0,z.es)({sourceHeight:t.meta.height,sourceWidth:t.meta.width}),description:t.description,height:t.meta.height,id:t.id,printLead:!1,title:t.title,uri:t.uri,webLead:!1,width:t.meta.width},type:p.QF.IMAGE}},[t]),2)[1];return(0,i.jsx)("div",{className:"cursor-pointer p-2","data-testid":"library-image",children:r((0,i.jsx)("img",{alt:t.title,"data-testid":"".concat(t.id),height:"100",src:n,width:"100"}))},t.resourceUri)}function L(e){var t=e.expanded,n=e.forceReset,r=(0,y.nM)(),o=(0,v.GV)(function(e){return e.settings.transformUrl}),a=(0,d._)((0,l.useState)(!1),2),s=a[0],f=a[1],h=(0,d._)((0,l.useState)(!1),2),p=h[0],x=h[1],m=(0,d._)((0,l.useState)(!0),2),g=m[0],b=m[1],w=(0,d._)((0,l.useState)([]),2),j=w[0],N=w[1],S=(0,d._)((0,l.useState)(""),2),_=S[0],k=S[1],L=(0,d._)((0,l.useState)(0),2),M=L[0],T=L[1],I=(0,d._)((0,l.useState)(""),2),P=I[0],Y=I[1];function X(e){b(!0),T(e),E({limit:18,offset:18*e,query:P,token:r}).then(function(e){b(!1),N(e.objects)}).catch(function(){})}return(0,l.useEffect)(function(){p&&!n&&x(!1),n&&!p&&(x(!0),b(!0),k(""),T(0),Y(""),E({limit:18,offset:0,query:"",token:r}).then(function(e){b(!1),N(e.objects)}).catch(function(){}))},[r,n,p,x,b,k,T,Y]),(0,l.useEffect)(function(){t&&!s&&(b(!0),f(!0),E({limit:18,offset:0,query:"",token:r}).then(function(e){b(!1),N(e.objects)}).catch(function(){}))},[r,t,s,f,N]),(0,i.jsxs)("div",{className:"px-4 py-8",children:[g&&(0,i.jsx)("div",{className:"absolute left-0 top-0 z-10 size-full bg-white/50"}),(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("input",{className:"w-full border-1 border-gray-200 px-2 py-1 focus:border-blue-400 focus:outline-none focus:ring-1",onChange:function(e){k(e.target.value)},placeholder:"Search...",value:_}),(0,i.jsx)(u.y,{className:"pointer-events-none absolute right-2 top-2.5 text-gray-300",icon:c.MjD})]}),(0,i.jsx)(C,{onClick:function(){b(!0),T(0),Y(_),E({limit:18,offset:0,query:_,token:r}).then(function(e){b(!1),N(e.objects)}).catch(function(){})},children:"Search"}),(0,i.jsxs)("div",{className:"mt-1 flex justify-between text-xs",children:[(0,i.jsx)("button",{className:"text-blue-500 hover:text-blue-400 focus:outline-none",onClick:function(){k("")},type:"button",children:"Reset Filters"}),(0,i.jsxs)("span",{children:[j.length," results"]})]}),(0,i.jsxs)("div",{className:"mt-4 flex justify-end",children:[M>0&&(0,i.jsx)(A,{className:"-mr-px rounded-l-md",onClick:function(){X(M-1)},testId:"library-page-prev",children:(0,i.jsx)(u.y,{icon:c.Wzs,size:"xs"})}),(0,i.jsx)(A,{className:"rounded-r-md",onClick:function(){X(M+1)},testId:"library-page-next",children:(0,i.jsx)(u.y,{icon:c.XkK,size:"xs"})})]}),(0,i.jsx)("div",{className:"grid grid-cols-3",children:j.map(function(e){if((0,z.j6)(e)){var t=(0,z.WO)({fit:z.Pz.MAX,height:100,image:e,transformUrl:o,width:100});return(0,i.jsx)(U,{image:e,url:t},e.id)}return null})})]})}var M=n(98952),T=n(10256);function I(e){var t=e.className,n=Math.max(0,Math.min(1,e.progress));return(0,i.jsxs)("div",{className:"flex h-4 w-full flex-row items-center ".concat(null!=t?t:""),children:[(0,i.jsx)("div",{className:"grow",children:(0,i.jsx)("div",{className:"h-2 rounded-md ".concat(1===n?"bg-green-700":"bg-blue-500"),style:{width:"".concat((n+.03)/1.03*100,"%")}})}),1===n?(0,i.jsx)(u.y,{className:"ml-2 text-green-700",icon:c.SGM}):(0,i.jsxs)("div",{className:"ml-2 text-sm",children:[Math.ceil(100*n),"%"]})]})}function P(e){var t=e.image,n=e.onRemove,r=(0,d._)((0,l.useState)(!1),2),o=r[0],c=r[1],s=(0,l.useCallback)(function(){return c(!1)},[c]);return(0,i.jsxs)("div",{className:"group relative flex size-24 items-center justify-center rounded-md border border-gray-300 p-2","data-testid":"preview-image",children:[o&&(0,i.jsx)(T.A,{onRequestClose:s,width:520,children:(0,i.jsx)("img",{alt:"Preview",className:"size-full",src:t})}),(0,i.jsxs)("div",{className:"pointer-events-none absolute left-0 top-0 flex size-full flex-row items-center justify-center bg-gray-900/50 text-white opacity-0 transition-all group-hover:pointer-events-auto group-hover:opacity-100",children:[(0,i.jsx)("button",{"aria-label":"Preview",className:"mr-3 focus:outline-none","data-testid":"preview-image-preview",onClick:function(){return c(!0)},type:"button",children:(0,i.jsx)(u.y,{icon:a.pS3,size:"lg"})}),(0,i.jsx)("button",{"aria-label":"Delete",className:"focus:outline-none","data-testid":"preview-image-remove",onClick:n,type:"button",children:(0,i.jsx)(u.y,{icon:a.BeE,size:"lg"})})]}),(0,i.jsx)("img",{alt:"Uploaded",className:"size-full","data-testid":t,src:t})]})}function Y(e){var t=e.addFiles,n=(0,l.useRef)(null);return(0,i.jsxs)("button",{className:"flex size-24 select-none flex-col items-center justify-center border-1 border-dashed border-gray-300 bg-white hover:border-blue-400 hover:text-blue-400 focus:outline-none",onClick:function(){var e;return null==(e=n.current)?void 0:e.click()},type:"button",children:[(0,i.jsx)("input",{className:"hidden","data-testid":"add-image-input",multiple:!0,onInput:function(e){var n=e.currentTarget.files;n&&t(Array.prototype.slice.call(n))},ref:n,type:"file"}),(0,i.jsx)("div",{children:"+"}),(0,i.jsx)("div",{children:"Add"})]})}function X(e){var t=e.onUpload,n=(0,y.nM)(),r=(0,v.GV)(function(e){return e.tokenInfo.user}),o=(0,d._)((0,l.useState)(!1),2),a=o[0],s=o[1],f=(0,d._)((0,l.useState)(0),2),h=f[0],p=f[1],x=(0,d._)((0,l.useState)([]),2),m=x[0],g=x[1],b=(0,d._)((0,l.useState)([]),2),w=b[0],_=b[1],k=(0,l.useCallback)(function(e){g((0,M._)(m).concat((0,M._)(e))),_((0,M._)(w).concat((0,M._)(e.map(function(e){return URL.createObjectURL(e)}))))},[m,g,w,_]),z=(0,l.useCallback)(function(){return(0,j._)(function(){var e,o,i;return(0,N.YH)(this,function(a){switch(a.label){case 0:if(!(m.length>0&&r))return[3,4];s(!0),p(0),e=0,a.label=1;case 1:if(!(e<m.length))return[3,4];for(i=0,o=[];e+i<m.length&&i<4;i++)o.push(function(e){return(0,j._)(function(e){var t,n,r,o,i,a,c,s,l,u,d,f;return(0,N.YH)(this,function(h){switch(h.label){case 0:return t=e.token,n=e.upload,r=e.username,(u=new FormData).append("blob",n.file),u.append("title",null!=(o=null==(c=n.meta)?void 0:c.title)?o:n.file.name),u.append("description",null!=(i=null==(s=n.meta)?void 0:s.description)?i:""),u.append("organization",null!=(a=null==(l=n.meta)?void 0:l.organization)?a:""),[4,function(e){return(0,j._)(function(e){var t,n,r;return(0,N.YH)(this,function(o){switch(o.label){case 0:return t=e.bucketName,n=e.token,r=window.getStore(),[4,fetch("".concat(r.getState().racetracks.valenciaUrl,"api/v1/bucket/").concat(t,"/"),{headers:{Authorization:"Bearer ".concat(n)},method:"GET"})];case 1:return[4,o.sent().json()];case 2:return[2,S._7.apply(void 0,[o.sent()])]}})}).apply(this,arguments)}({bucketName:r,token:t})];case 1:return d=h.sent(),f=window.getStore(),[4,fetch("".concat(f.getState().racetracks.valenciaUrl,"upload/v1/").concat(d.name,"/"),{body:u,headers:{Authorization:"Bearer ".concat(t)},method:"POST"})];case 2:return[4,h.sent().json()];case 3:return[2,S._7.apply(void 0,[h.sent()])]}})}).apply(this,arguments)}({token:n,upload:{file:m[e+i]},username:r.username}));return[4,Promise.all(o)];case 2:a.sent(),p((e+4)/m.length),e+4>=m.length&&setTimeout(function(){s(!1),g([]),_([]),t()},1e3),a.label=3;case 3:return e+=4,[3,1];case 4:return[2]}})})()},[m,n,r,s,p,g,_,t]);return(0,i.jsxs)("div",{className:"pb-8 pt-4",children:[(0,i.jsxs)("div",{className:"mb-2.5 grid grid-cols-3 gap-2.5 px-1 ".concat(a?"pointer-events-none opacity-50":""),children:[w.map(function(e,t){return(0,i.jsx)(P,{image:e,onRemove:function(){g(m.filter(function(e,n){return n!==t})),_(w.filter(function(e,n){return n!==t}))}},t)}),(0,i.jsx)(Y,{addFiles:k})]}),(0,i.jsxs)(C,{disabled:a||0===m.length,onClick:function(){z().catch(function(){})},children:[(0,i.jsx)(u.y,{className:"mr-2",icon:c.JmV}),"Start Upload"]}),a&&(0,i.jsx)(I,{className:"mt-2",progress:h})]})}var R=((r=R||{}
1).LIBRARY="Library",r.UPLOADS="Uploads",r);function O(e){var t=e.children,n=e.onClick,r=e.selected;return(0,i.jsx)("button",{className:"flex grow items-center justify-center ".concat(r?"border-b-2 border-blue-500 text-blue-500":"border-b-1 border-gray-600 pb-px"," select-none text-center focus:outline-none"),onClick:n,type:"button",children:t})}function F(e){var t=e.children,n=e.selected;return(0,i.jsx)("div",{className:n?"":"h-0 overflow-hidden",children:t})}function G(e){var t=e.expanded,n=(0,d._)((0,l.useState)(!1),2),r=n[0],o=n[1],a=(0,d._)((0,l.useState)("Library"),2),c=a[0],s=a[1];(0,l.useEffect)(function(){t&&!r&&o(!0)},[t,r,o]);var u=(0,d._)((0,l.useState)(!1),2),f=u[0],h=u[1];(0,l.useEffect)(function(){f&&h(!1)},[f,h]);var p=(0,l.useCallback)(function(){s("Library"),h(!0)},[s,h]);return(0,i.jsxs)("div",{className:"pt-4 text-sm",children:[(0,i.jsxs)("div",{className:"flex flex-row",children:[(0,i.jsx)(O,{onClick:function(){return s("Library")},selected:"Library"===c,children:"Library"}),(0,i.jsx)(O,{onClick:function(){return s("Uploads")},selected:"Uploads"===c,children:"Uploads"})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(F,{selected:"Library"===c,children:(0,i.jsx)(L,{expanded:t,forceReset:f})}),(0,i.jsx)(F,{selected:"Uploads"===c,children:(0,i.jsx)(X,{onUpload:p})})]})]})}function q(e){var t,n=e.alignLeft,r=e.className,o=e.options,a=e.selected,f=e.setSelected,h=(0,d._)((0,l.useState)(!1),2),p=h[0],x=h[1],m=(0,d._)((0,l.useState)(""),2),g=m[0],v=m[1],b=(0,d._)((0,l.useState)(null),2),w=b[0],y=b[1],j=o.find(function(e){return e.idx===a});return(0,l.useEffect)(function(){p||v("")},[p,v]),(0,i.jsxs)("div",{className:"relative select-none ".concat(null!=r?r:""),onBlur:function(e){if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement){var t=e.relatedTarget;if(t===e.currentTarget)return;for(;t.parentElement;){if(t.parentElement===e.currentTarget)return;t=t.parentElement}}x(!1)},tabIndex:-1,children:[!p&&(0,i.jsx)("button",{className:"w-full cursor-pointer truncate border border-gray-200 bg-white py-1 pl-2 pr-6 text-left hover:border-blue-400",onClick:function(){return x(!0)},type:"button",children:null!=(t=null==j?void 0:j.text)?t:"Unable to find selected item"}),p&&(0,i.jsx)("input",{className:"w-full overflow-hidden text-ellipsis border border-gray-200 bg-white py-1 pl-2 pr-6 focus:border-blue-400 focus:outline-none","data-testid":"filter-input",onChange:function(e){return v(e.currentTarget.value)},placeholder:null==j?void 0:j.text,ref:function(e){null==e||e.focus()},value:g}),(0,i.jsx)("button",{"aria-label":"Open",className:"absolute right-0 top-0 h-full px-2 focus:outline-none","data-testid":"dropdown-chevron",onClick:function(){return x(!p)},type:"button",children:(0,i.jsx)(u.y,{className:(0,s.A)("size-full cursor-pointer text-gray-300 transition-all",{"rotate-180":p}),icon:c.Jt$,size:"sm"})}),p&&(0,i.jsx)("div",{className:(0,s.A)("absolute top-full z-50 flex max-h-40 flex-col overflow-y-auto rounded-md bg-transparent shadow-lg",void 0===n||n?"left-0":"right-0"),ref:function(e){e&&w&&(e.scrollTop=w)},children:o.filter(function(e){return 0===g.length||e.text.includes(g)}).map(function(e){return(0,i.jsx)("button",{className:(0,s.A)("cursor-pointer whitespace-nowrap px-2 py-1 hover:bg-blue-100 focus:outline-none","first:rounded-t-md last:rounded-b-md",a===e.idx?"bg-gray-200":"bg-white"),onClick:function(t){var n,r;f(e.idx),x(!1),y(null!=(n=null==(r=t.currentTarget.parentElement)?void 0:r.scrollTop)?n:null)},type:"button",children:e.text},e.idx)})})]})}var B=((o=B||{}).WEB="web",o.PRINT="print",o);function D(e){return(0,j._)(function(e){var t,n,r,o,i,a,c,s,l;return(0,N.YH)(this,function(u){switch(u.label){case 0:return t=e.organization,n=e.page,r=e.query,o=e.token,i=e.updatedOn,a=e.userId,c={organization:t,page:n.toString(),page_size:"10",publishable_to:"web",status:"published"},r&&(c.q=r),a&&(c.user=a),i&&(c.updated_on=i),s=new URLSearchParams(c),l=window.getStore(),[4,fetch("".concat(l.getState().racetracks.silverstoneUrl,"api/v2/story/?").concat(s.toString()),{headers:{Authorization:"Bearer ".concat(o)},method:"GET"})];case 1:return[4,u.sent().json()];case 2:return[2,S._7.apply(void 0,[u.sent()])]}})}).apply(this,arguments)}var H=n(40152);function W(e){var t=e.REVOrg,n=e.className,r=e.story,o=(0,v.GV)(function(e){return e.settings.transformUrl}),a=r.leadImage&&(0,z.j6)(r.leadImage)?(0,z.WO)({height:60,image:r.leadImage,transformUrl:o,width:80}):void 0,l=(0,d._)((0,f.i)(function(){return{item:{storyId:r.id},type:p.QF.STORY}}),3),h=l[1],x=l[2],m=r.canonicalUrl,g=r.organization,b=r.tags,w=!(t.length>0&&t[0].idx===g&&b.includes("rev-only"))||!!m,y=(0,i.jsx)("button",{"aria-label":w?"Drag to pin":"Click for info",className:"mr-2 rounded-md border border-transparent bg-gray-200 p-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-200 focus:ring-offset-2 ".concat(w?"cursor-move":"cursor-pointer"),onClick:function(){return w?null:(0,H.A)("This story cannot be added as it is missing the Canonical URL. Please add the Canonical URL and try again.",{position:"top-center"})},title:w?"Drag to pin":"Click for info",type:"button",children:(0,i.jsx)(u.y,{fixedWidth:!0,icon:w?c.ckx:c.ktq})}),j=(0,i.jsxs)("div",{className:(0,s.A)("relative flex min-h-24 w-full flex-row rounded-md bg-white p-3","text-sm",n),children:[w?h(y):y,(0,i.jsx)("div",{className:"absolute right-3 top-1 text-xs font-semibold",children:new Date(r.publishFrom).toLocaleDateString("en-AU")}),r.leadImage&&(0,i.jsx)("div",{className:"mr-3 mt-3 w-20 shrink-0",children:(0,i.jsx)("img",{alt:r.leadImage.t
1itle,height:60,src:a,width:80})}),(0,i.jsxs)("div",{className:"mt-3",children:[(0,i.jsx)("div",{children:r.byline||r.createdByDetail&&"".concat(r.createdByDetail.firstName," ")+"".concat(r.createdByDetail.lastName)}),(0,i.jsx)("div",{className:"text-gray-700",children:r.title})]})]});return w?x(j):j}var V=[{idx:"",text:"Any Time"},{idx:"-1d",text:"Past Day"},{idx:"-1w",text:"Past Week"},{idx:"-1m",text:"Past Month"},{idx:"-1y",text:"Past Year"}],J={idx:"",text:"All Users"};function K(e){var t=e.expanded,n=(0,v.GV)(function(e){return e.conf.organizationId}),r=(0,v.GV)(function(e){return e.conf.name}),o=(0,y.nM)(),a=(0,d._)((0,l.useState)(!1),2),s=a[0],f=a[1],h=(0,d._)((0,l.useState)(!0),2),p=h[0],x=h[1],m=(0,d._)((0,l.useState)([J]),2),g=m[0],b=m[1],w=(0,d._)((0,l.useState)([{idx:n,text:r}]),2),k=w[0],z=w[1],E=(0,d._)((0,l.useState)(""),2),A=E[0],U=E[1],L=(0,d._)((0,l.useState)(J.idx),2),T=L[0],I=L[1],P=(0,d._)((0,l.useState)(V[0].idx),2),Y=P[0],X=P[1],R=(0,d._)((0,l.useState)(n),2),O=R[0],F=R[1],G=(0,d._)((0,l.useState)(""),2),B=G[0],H=G[1],K=(0,d._)((0,l.useState)(J.idx),2),Z=K[0],Q=K[1],$=(0,d._)((0,l.useState)(V[0].idx),2),ee=$[0],et=$[1],en=(0,d._)((0,l.useState)(n),2),er=en[0],eo=en[1],ei=(0,d._)((0,l.useState)(0),2),ea=ei[0],ec=ei[1],es=(0,d._)((0,l.useState)([]),2),el=es[0],eu=es[1];(0,l.useEffect)(function(){(function(e){return(0,j._)(function(e){var t,n,r,o,i;return(0,N.YH)(this,function(a){switch(a.label){case 0:return t=e.orgId,r=void 0===(n=e.pageSize)?1e3:n,o=e.token,i=window.getStore(),[4,fetch("".concat(i.getState().racetracks.monzaUrl,"api/v2/organization/").concat(t,"/users/?page_size=").concat(r),{headers:{Authorization:"Bearer ".concat(o)},method:"GET"})];case 1:return[4,a.sent().json()];case 2:return[2,S._7.apply(void 0,[a.sent()])]}})}).apply(this,arguments)})({orgId:n,token:o}).then(function(e){var t,n;b([J].concat((0,M._)(null!=(t=null==(n=e.results)?void 0:n.map(function(e){return{idx:e.id,text:"".concat(e.firstName," ").concat(e.lastName)}}))?t:[])))}).catch(function(){})},[n,o,b]),(0,l.useEffect)(function(){_({token:o}).then(function(e){z(e.organizations.map(function(e){return{idx:e.organization.id.toString(),text:e.organization.name}}))}).catch(function(){})},[]),(0,l.useEffect)(function(){t&&!s&&(f(!0),x(!0),ec(1),D({organization:er.toString(),page:1,token:o}).then(function(e){eu(e.results),x(!1)}).catch(function(){}))},[t,s,f]);var ed=(0,l.useCallback)(function(){x(!0),ec(1),eo(O),H(A),et(Y),Q(T),D({organization:O.toString(),page:1,query:A||void 0,token:o,updatedOn:Y.toString()||void 0,userId:T.toString()||void 0}).then(function(e){eu(e.results),x(!1)}).catch(function(){})},[x,ec,eo,H,et,Q,O,Y,T,o,A,eu]),ef=(0,l.useCallback)(function(){x(!0),ec(ea+1),D({organization:er.toString(),page:ea+1,query:B||void 0,token:o,updatedOn:ee.toString()||void 0,userId:Z.toString()||void 0}).then(function(e){eu((0,M._)(el).concat((0,M._)(e.results))),x(!1)}).catch(function(){})},[x,ec,ea,er,ee,Z,B,eu,el,o]),eh=k.filter(function(e){return"real estate view"===e.text.toLowerCase()});return(0,i.jsxs)("div",{className:"pb-10 text-sm",children:[p&&(0,i.jsx)("div",{className:"absolute left-0 top-0 z-10 size-full bg-white/50"}),(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("input",{className:"w-full border border-gray-200 px-2 py-1 focus:border-blue-400 focus:outline-none focus:ring-1",onChange:function(e){U(e.target.value)},placeholder:"Search Stories...",value:A}),(0,i.jsx)(u.y,{className:"pointer-events-none absolute right-2 top-2.5 text-gray-300",icon:c.MjD})]}),(0,i.jsxs)("div",{className:"flex flex-row",children:[(0,i.jsx)(q,{className:"w-3/12",options:g,selected:T,setSelected:I}),(0,i.jsx)(q,{className:"w-4/12",options:V,selected:Y,setSelected:X}),(0,i.jsx)(q,{alignLeft:!1,className:"w-5/12",options:k,selected:O,setSelected:F})]}),(0,i.jsx)(C,{onClick:ed,children:"Search"}),(0,i.jsxs)("div",{children:[0===el.length&&(0,i.jsx)("div",{className:"mt-4 text-gray-600",children:"No Stories Found"}),el.map(function(e){return(0,i.jsx)(W,{REVOrg:eh,className:"my-3",story:e},e.id)}),el.length>0&&(0,i.jsx)(C,{onClick:ef,children:"More"})]})]})}function Z(e){var t=e.children,n=e.targetLayout,r=(0,v.GV)(function(e){return e.editmode}).layout,o=(0,v.jL)();return(0,i.jsx)("button",{className:(0,s.A)("group mr-1 size-8 rounded-full border border-gray-400","flex cursor-pointer items-center justify-center hover:border-blue-400",{"border-blue-400":r===n}),onClick:function(){o(b.A.actions.setLayout(n)),[b.U.MOBILE,b.U.TABLET].includes(n)&&o(b.A.actions.setCollapsed(!0)),window.parent&&window.parent.postMessage(n,"*")},type:"button",children:l.cloneElement(t,{className:"".concat(r===n?"text-blue-400":""," group-hover:text-blue-400")})})}function Q(){var e=(0,y.nM)(),t=(0,v.GV)(function(e){return e.settings.host}),n=(0,v.GV)(function(e){return e.editmode.layout}),r=(0,v.jL)(),o=(0,v.GV)(function(e){return e.editmode.sidebar.collapsed}),d=(0,v.GV)(function(e){return e.editmode.isZoneView});return(0,l.useEffect)(function(){_({token:e}).then(function(e){r(w.A.actions.set(e))}).catch(function(){})},[e,r]),(0,i.jsx)("div",{style:{width:350*!o},children:(0,i.jsxs)("div",{className:"fixed right-0 top-0 z-20 h-full border-l-1 border-gray-400 bg-white shadow-2xl transition-all",children:[(0,i.jsx)("button",{"aria-label":o?"Expand":"Collapse",className:"absolute -left-9 top-0 flex h-10 w-9 items-center justify-center border border-t-0 border-gray-400 bg-gray-200 shadow-2xl focus:outline-none",onClick:function(){return r(b.A.actions.toggleCollapsed())},type:"button",children:(0,i.jsx)(u.y,{color:"rgba(0, 0, 0, .5)",icon:o?a.CHJ:a.xbI,size:"lg"})}),(0,i.jsx)("div",{className:"h-full overflow-hidden transition-all",style:{width:350*!o},children:(0,i.jsxs)("div",{className:"relative flex h-full flex-col overflow-hidden",style:{right:o?
1-350:void 0},children:[(0,i.jsxs)("div",{className:"flex flex-row items-center justify-between p-4",children:[(0,i.jsxs)("button",{className:"rounded-md bg-blue-500 px-4 leading-8 text-white hover:bg-blue-400 focus:outline-none",onClick:function(){return window.open("//".concat(t),"_blank")},type:"button",children:[(0,i.jsx)(u.y,{color:"white",icon:c.pS3})," Live Site"]}),(0,i.jsxs)("div",{className:"flex flex-row items-center justify-center",children:[(0,i.jsx)("span",{className:"mr-2 select-none",children:"Layout: "}),(0,i.jsx)(Z,{targetLayout:b.U.MOBILE,children:(0,i.jsx)(u.y,{icon:c.XRN})}),(0,i.jsx)(Z,{targetLayout:b.U.TABLET,children:(0,i.jsx)(u.y,{icon:c.DIx})}),(0,i.jsx)(Z,{targetLayout:b.U.DESKTOP,children:(0,i.jsx)(u.y,{icon:c.ArK})})]})]}),n===b.U.DESKTOP&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"border-b border-gray-200 pl-2",children:(0,i.jsx)("nav",{"aria-label":"Tabs",className:"-mb-px flex space-x-8",children:[!1,!0].map(function(e){var t=d===e;return(0,i.jsx)("button",{"aria-current":t,className:(0,s.A)("relative whitespace-nowrap border-b-2 px-3 py-4 text-sm font-medium outline-none",{"border-black font-semibold":t,"border-transparent":!t}),onClick:function(){return!t&&r(b.A.actions.toggleZoneView())},type:"button",children:(0,i.jsx)("span",{className:"uppercase",children:e?"Zone":"Story"})},e.toString())})})}),(0,i.jsxs)("div",{className:"mt-1 grow overflow-y-auto",children:[(0,i.jsx)("div",{className:(0,s.A)({hidden:!d}),children:(0,i.jsx)(k,{title:"Zone Elements",children:(0,i.jsx)(g,{})})}),(0,i.jsx)("div",{className:(0,s.A)({hidden:d}),children:(0,i.jsx)(k,{title:"Search Stories",children:(0,i.jsx)(K,{})})}),(0,i.jsx)("div",{className:(0,s.A)({hidden:d}),children:(0,i.jsx)(k,{title:"Story Media",children:(0,i.jsx)(G,{})})})]})]})]})})]})})}}}]);
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.