1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cd2b53f2-f7af-4a33-9fdb-6bbf50db784b",e._sentryDebugIdIdentifier="sentry-dbid-cd2b53f2-f7af-4a33-9fdb-6bbf50db784b")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[315],{10315:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var n=a(95155),l=a(79775),i=a(95644),o=a.n(i),s=a(12115),r=a(55372),c=a(77374),d=a(91642),u=a(97417),p=a(41245),g=a(26790);let h=e=>{var t,a,i,h,f,m,x,v;let{data:b,id:w}=e.widget,{w:y,h:j}=e,k=(0,s.useRef)(null),S=(0,s.useRef)(!0),[N,T]=(0,s.useState)(""),[C,L]=(0,s.useState)(""),[I,_]=(0,s.useState)(!0),[R,A]=(0,s.useState)((null==(t=b.overrides)?void 0:t.title)||""),[O,P]=(0,s.useState)(""),U=(0,u.o)(),E=(null==U?void 0:U.getTextBlockStyle)||(()=>({})),M=(null==U?void 0:U.setSelectedTextBlockId)||(()=>{}),B=s.useCallback((t,a)=>{a=o()(a,{allowedTags:["b","i","a","p"],allowedAttributes:{a:["href"]}}),"title"===t&&A(a),e.updateWidgetDataInPage({overrides:Object.assign(b.overrides||{},{[t]:a})},e.widget.id),clearTimeout(k.current),k.current=setTimeout(()=>{e.setSavePage({save:!0})},300)},[]),W=new AbortController;async function z(){let t=W.signal;_(!0);let a=await (0,g.I)(b.href,t);if("completed"===a.status&&(L(a.data.icon),Object.assign(a.data||{},b.overrides),T((0,d.I)(a.data.image)),A(a.data.title),_(!1),P(a.data.description),b.new)){let t={...b};delete t.new,e.updateWidgetRootProp("data",t,e.widget.id),e.setSavePage({save:!0})}if("inprogress"===a.status&&setTimeout(z,1e3),"failed"===a.status){var n;Object.assign(a.data||{},b.overrides),A(a.data.title),T((0,d.I)(null==(n=a.data)?void 0:n.image)),_(!1)}}let D=t=>{e.updateWidgetDataInPage({overrides:Object.assign(b.overrides||{},{image:t})},e.widget.id),T(t)};(0,s.useEffect)(()=>(S.current&&z(),()=>{S.current=!1,W.abort("Removed")}),[]);let F="flex-row",H=40,q="flex-col",G="",J="font-bold",K={};1===y&&4===j&&(K={maxHeight:"100%",maxWidth:"154px"},F="flex-col"),2===y&&4===j&&(K={maxHeight:"190px",maxWidth:"100%"},F="flex-col"),2===y&&2===j&&(K={maxHeight:"100%",maxWidth:"154px"}),2===y&&1===j&&(H=32,q="flex-row",G="justify-center items-center",J="font-normal");let Q=b.colorscheme.textColor||"".concat((null==(a=e.layoutColorSchemeBg)?void 0:a.includes("black"))?"text-white":"");return(0,n.jsxs)("div",{"data-item":"link","data-link-url":b.href,"data-widget-type":"link"===b.type?b.type+b.name:b.type,"data-override-image":(null==(i=b.overrides)?void 0:i.image)||"","data-override-title":(null==(h=b.overrides)?void 0:h.title)||"","data-override-icon":(null==(f=b.overrides)?void 0:f.icon)||"","data-override-description":b.description||"","data-override-posts":JSON.stringify((null==(m=b.overrides)?void 0:m.posts)||[]),style:e.customStyle,className:"typelink-item ".concat(e.customClassname," ").concat(e.isStatic?"typelink-item__static":""," ").concat(e.isStatic?"typelink-item__clickable":""," gap-2 ").concat(b.colorscheme.border," ").concat(b.colorscheme.bg," ").concat(Q," rounded-2xl flex ").concat(F),children:[(0,n.jsx)("div",{className:"border border-transparent hidden"}),(0,n.jsxs)("div",{className:"flex ".concat(q," gap-2 ").concat(G),children:[(0,n.jsx)("div",{className:"".concat(I?"animated-background":""," relative flex-none rounded-lg overflow-hidden"),style:{width:H,height:H},children:I?"":(0,c.c6)()}),(0,n.jsxs)("div",{className:"flex flex-col ".concat("gap-1"," ").concat("justify-left"),children:[(0,n.jsx)(l.A,{isStatic:e.isStatic,onChange:B.bind(null,"title"),textColor:Q,html:(null==(x=b.overrides)?void 0:x.hasOwnProperty("title"))?R:R||"Figma",className:"typelink-item__title ".concat(1!==j?"overflow-hidden webkit-box-2":""," ").concat(1===y&&4===j?"overflow-hidden webkit-box-2":""," ").concat(1===j?"overflow-hidden webkit-box-1":""," ").concat("text-[14px]"," word-break outline-none leading-[17px] ").concat(J),tagName:"p",textBlockId:(0,p.BT)(b.type,"title",w),textBlockStyle:E((0,p.BT)(b.type,"title",w)),onTextBlockClick:M}),2===y&&4===j&&O&&(0,n.jsx)("p",{dangerouslySetInnerHTML:{__html:O},className:"".concat("text-[12px]"," typelink-item__text outline-none ").concat((null==Q?void 0:Q.includes("text-black"))||!Q?"text-gray":"text-white"," mt-[8px] ").concat(4!==j?"webkit-box-1 overflow-hidden":"webkit-box-2 overflow-hidden max-h-[35px]")})]}),(0,n.jsx)("button",{className:"".concat(1===y&&4===j?"my-[13px]":"mt-auto"," bg-blue text-white fill-white cursor-unset bg-blue inset-border min-w-[86px] text-center active:scale-95 transition self-start ").concat(2===y&&1===j?"absolute right-[24px] top-[23px]":""," ").concat(2===y&&4===j?"absolute top-[23px] right-[24px]":""," flex-none rounded-[6px] text-[12px] px-[10px] py-[5px] font-bold flex-grow-0 h-[28px]"),children:"Open"})]}),(1!==e.w||2!==e.h)&&(2!==y||1!==j)&&(0,n.jsx)("div",{style:K,className:"relative rounded-lg flex-none ".concat(1===y&&4===j?"mx-auto":""," ").concat(2===y&&2===j?"ml-auto":"mt-auto"),children:N&&(0,n.jsx)(r.A,{isStatic:e.isStatic,id:w,className:"object-cover object-top rounded-[8px] ".concat(1===y&&4===j?"max-h-[135px]":""," ").concat(2===y&&2===j?"max-h-[114px]":""),wrapperClassNames:"rounded-[8px] flex h-full ".concat(2===y&&2===j||1===y&&4===j?"flex-col":""," justify-center"),src:N,alt:"Figma image",width:"",height:"",originalWidth:720,panelAlign:"center",handleChangePhotoUrl:D,onUploadSuccess:t=>{D(t),e.setSavePage({save:!0})}})}),e.isStatic&&(0,n.jsx)("a",{title:(null==(v=b.overrides)?void 0:v.hasOwnProperty("title"))?R:R||"Figma",className:"absolute top-0 left-0 right-0 bottom-0",href:b.tracking&&b.trackingUrl?b.trackingUrl:b.href,target:"_blank"})]})}},26790:(e,t,a)=>{a.d(t,{I:()=>o});let n=new Map,l=new Map,i=e=>e&&"object"==typeof e?{...e,data:e.data&&"object"==typeof e.data?{...e.data}:e.data}:e;async function o(e,t){let a=n.get(e);if(a)return i(a);let o=l.get(e);return o||(o=(async()=>{let t=await fetch("/api/urldata/".concat(encodeURIComponent(e)));if(!t.ok)return{status:"failed",data:{}};let a=await t.json().catch(()=>({status:"failed",data:{}}));return((null==a?void 0:a.status)==="completed"||(null==a?void 0:a.status)==="failed")&&n.set(e,a),a})(),l.set(e,o),o.finally(()=>l.delete(e)).catch(()=>{})),i(await o)}},55372:(e,t,a)=>{a.d(t,{A:()=>u});var n=a(95155),l=a(12115),i=a(46964),o=a(77374),s=a(12870),r=a(91642),c=a(70012),d=a(32802);let u=e=>{var t;let[a,u]=(0,l.useState)(e.panelMounted),[p,g]=(0,l.useState)(e.panelMounted),[h,f]=(0,l.useState)(!1),[m,x]=(0,l.useState)(!1),[v,b]=(0,l.useState)(!1),[w,y]=(0,l.useState)(""),[j,k]=(0,l.useState)(e.mediaType||"image"),S=(0,l.useRef)(null),N=(0,l.useRef)(!1),T=(0,l.useRef)(null),C=(0,l.useRef)(null),L=(0,l.useRef)(null),I=(0,c.t)({onPickFromStock:t=>{y(""),e.onUploadSuccess(t,"image")}});function _(){e.isStatic||(g(!0),setTimeout(()=>{u(!0)},10))}function R(t){!e.isStatic&&((h||N.current)&&!0!==t||(u(!1),setTimeout(()=>{e.panelMounted||g(!1)},150)))}async function A(t,a){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];var l,o=new FormData;let r=t.type.split("/")[0],c=t.name,d="";"image"===r?(l=e.originalWidth,new Promise(e=>{let a=new Image;a.onload=()=>{let n=document.createElement("canvas"),i=l*(a.height/a.width);n.width=l,n.height=i,n.getContext("2d").drawImage(a,0,0,l,i),n.toBlob(t=>{e(URL.createObjectURL(t))},t.type)},a.src=URL.createObjectURL(t)})).then(t=>{y(t),e.handleChangePhotoUrl(t,r,c)}):(d=URL.createObjectURL(t),e.handleChangePhotoUrl(d,r,c),y(d)),k(r),f(!0),o.append(a,t),C.current=s.A.CancelToken.source();try{if(r.includes("video")){let t=await i.A.post("/assets",o,{cancelToken:C.current.token});e.onUploadSuccess(t.data.gurl,r),f(!1)}else{let t=await i.A.post("/assets",o,{cancelToken:C.current.token});e.onUploadSuccess(t.data.gurl,r,c,n)}}catch(e){f(!1),s.A.isCancel(e)&&console.log("Request canceled",e.message)}y(""),r.includes("video")&&x(!0),r.includes("video")&&setTimeout(()=>{N.current=!1,R(!0),r.includes("video")&&setTimeout(()=>{x(!1)},700)},600)}async function O(e){var t,a;if((null==e||null==(a=e.target)||null==(t=a.files)?void 0:t.length)>0){let t=Array.from(e.target.files);for(let a of t)await A(a,e.target.name,t.indexOf(a)===t.length-1)}else f(!1),R(!0),N.current=!1;S.current&&(S.current.value="")}(0,l.useEffect)(()=>{let e=function(){N.current=!1};return p&&window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[p]),(0,l.useEffect)(()=>
1{if("video"===j){var e,t;null==(e=T.current)||e.load(),null==(t=T.current)||t.play()}},[w,e.mediaType,e.src]),(0,l.useEffect)(()=>()=>{var e;null==(e=C.current)||e.cancel("Operation canceled by the user.")},[]);let P="top"===e.panelAlign?{top:-40,paddingBottom:20,paddingRight:20,left:"50%",marginLeft:-15}:"center"===e.panelAlign?{top:"30%",left:"50%",marginTop:-20,marginLeft:-15}:{bottom:-40,paddingTop:40};async function U(e){let t=e.dataTransfer.files;if((null==t?void 0:t.length)>0){_();let e=Array.from(t);for(let t of e)await A(t,"asset",e.indexOf(t)===e.length-1)}S.current&&(S.current.value=""),document.body.classList.remove("is-dragging")}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}return(0,l.useEffect)(()=>{var e;return null==(e=L.current)||e.addEventListener("drop",U,!1),()=>{var e;null==(e=L.current)||e.removeEventListener("drop",U,!1)}}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{ref:L,className:"w-full h-full",onMouseEnter:_,onMouseLeave:R.bind(null,!1),children:[(0,n.jsxs)("div",{className:"overflow-hidden relative transition-all "+e.wrapperClassNames,children:[!v&&e.showSrcLoader&&!e.isStatic&&(0,n.jsx)("div",{className:"z-10 bg-black bg-opacity-40 absolute top-0 left-0 right-0 bottom-0 flex items-center justify-center",children:(0,n.jsx)("div",{className:"loading text-white w-[20px]"})}),"image"===j&&(w||e.src)&&(0,n.jsx)("img",{loading:"lazy",fetchPriority:"high",src:w||e.src.includes("blob:")&&e.src||"".concat((0,r.I)(e.src)).concat((()=>{var t,a,n;return(null==(t=e.src)?void 0:t.includes(".gif"))?"":(null==(a=e.src)?void 0:a.includes("unsplash"))?"&w=".concat(E(1.5*e.originalWidth)):(null==(n=e.src)?void 0:n.includes("pexels"))?"?auto=compress&w=".concat(E(1.5*e.originalWidth)):"?w=".concat(e.originalWidth,"&q=80")})()),alt:e.alt,className:e.className+" z-1 ".concat(e.errorOverlay===w?"!object-none":""),style:{height:e.height,width:e.width},onLoad:t=>{t.target.src.includes("blob:")||(e.onLoad&&e.onLoad(),h&&(f(!1),x(!0),setTimeout(()=>{N.current=!1,R(!0),setTimeout(()=>{x(!1)},700)},600)),b(!0),I.handleImageLoaded())},onError:function(t){y((0,r.I)(e.errorOverlay||"https://r2.type.link/sites/ogimages/overlay.jpg"))},width:"100px",height:"100px"}),"video"===j&&(0,n.jsx)("video",{onLoadedData:()=>e.onLoad&&e.onLoad(),ref:T,autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:e.className+" z-1",style:{height:e.height,width:e.width},children:(0,n.jsx)("source",{src:w||e.src,type:"video/mp4"})})]}),p&&(0,n.jsx)("div",{className:"flex absolute z-[21] uploader-panel grid-drag__disabled",style:P,children:(0,n.jsxs)("div",{className:"".concat(a?"scale-100 opacity-100":"scale-95 opacity-0"," c-shadow transition flex flex-row justify-center items-center bg-blue rounded-md"),children:[(0,n.jsx)("div",{className:"absolute bg-blue w-[12px] h-[12px] rounded-sm bottom-[-3px] left-[10px] rotate-45 z-[0]",style:"top"===e.panelAlign||"center"===e.panelAlign?{bottom:-3}:{top:-3}}),(0,n.jsxs)("label",{onClick:()=>N.current=!0,htmlFor:"upload-asset"+e.id,className:"cursor-pointer text-white active:scale-95 z-[1] p-[6px]",children:[m?(0,n.jsx)("svg",{className:"checkmark",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{d:"M5 10 L8 13 L15 6"})}):h?(0,n.jsx)("span",{children:o.wG}):(0,o.T3)(20),(0,n.jsx)("input",{multiple:e.multiple,accept:e.accept||"image/png, image/gif, image/jpeg, image/avif, image/webp",ref:S,onChange:O,id:"upload-asset"+e.id,name:"asset",type:"file",className:"hidden"})]}),(0,n.jsx)("div",{className:"p-[6px] active:scale-95 text-white cursor-pointer",onClick:I.handleOpenStockModal,children:(0,o.Ur)(18)}),(null==(t=e.rounding)?void 0:t.length)>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"p-[6px] active:scale-95 cursor-pointer",onClick:()=>e.handleChangePhotoRounding("rounded-".concat(e.rounding[0])),children:(0,n.jsx)("div",{className:"w-[18px] h-[18px] rounded-full border border-white z-[1]"})}),(0,n.jsx)("div",{className:"p-[6px] active:scale-95 cursor-pointer",onClick:()=>e.handleChangePhotoRounding("rounded-".concat(e.rounding[1])),children:(0,n.jsx)("div",{className:"w-[18px] h-[18px] rounded-sm border border-white z-[1]"})})]})]})})]}),(0,n.jsx)(d.A,{...I})]})}}}]);
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.