PageSourceSearch

https://www.swipewell.app/_next/static/chunks/3770-5a324cf2b62cbe6d.js

js swipewell.app collected 2026-10-01 15:10:07 UTC 27,204 bytes, 1 lines download raw bytes

1try{!function(){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]="5aafcde1-02f3-4201-bf1b-22b58dc53da0",e._sentryDebugIdIdentifier="sentry-dbid-5aafcde1-02f3-4201-bf1b-22b58dc53da0")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3770],{17039:function(e,t,l){var r=l(85893);l(67294);var a=l(88767),n=l(61997),i=l(45827),s=l(81207),o=l(56896),d=l(4891);t.Z=e=>{var t,l;let{collection:u,handleSubmitEffect:m}=e,{session:h,teamId:p,recordEvent:v,identifyUser:g,userQuery:x}=(0,i.kP)(),{addToast:b}=(0,o.pm)(),{inputs:f,handleInput:y,setInputs:w,resetForm:j}=(0,n.Z)({name:u?u.name:"",description:null!==(t=null==u?void 0:u.description)&&void 0!==t?t:"",swipes:null!==(l=null==u?void 0:u.swipes)&&void 0!==l?l:[]}),N=(0,a.useQueryClient)(),{status:C,mutate:k}=(0,a.useMutation)(async e=>{if(e.preventDefault(),u){var t;if(!p)throw Error("Unable to edit collection.");let e=f.swipes.filter(e=>{var t;return(null===(t=u.swipes)||void 0===t?void 0:t.findIndex(t=>t.swipe_id===e.swipe_id))===-1}).map(e=>e.swipe_id),l=null===(t=u.swipes)||void 0===t?void 0:t.filter(e=>-1===f.swipes.findIndex(t=>e.swipe_id===t.swipe_id)).map(e=>e.swipe_id),r=await fetch("/api/teams/".concat(p,"/collections/").concat(u.collection_id),{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({collection:f,swipesAdded:e,swipesRemoved:l})});return await r.json()}{if(!p)throw Error("Unable to create collection.");let e=await fetch("/api/teams/".concat(p,"/collections"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({...f})});return await e.json()}},{onSuccess:e=>{if(e.error){b({title:"Error",body:"There was an error saving your collection.",type:"error"});return}if(N.invalidateQueries(s.U.collections(null!=p?p:"")),u)N.invalidateQueries(s.U.collection(null!=p?p:"",u.collection_id)),N.invalidateQueries(s.U.swipesByCollection(null!=p?p:"",u.collection_id)),v("collection_edited");else{var t,l,r,a,n,i,o;j(),v("collection_created");let e=null!==(n=null==x?void 0:null===(l=x.data)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.metadata)&&void 0!==n?n:{};g(null!==(i=null==h?void 0:null===(r=h.user)||void 0===r?void 0:r.id)&&void 0!==i?i:"",null!==(o=null==h?void 0:null===(a=h.user)||void 0===a?void 0:a.email)&&void 0!==o?o:"",{collection_count:(null==e?void 0:e.collection_count)?e.collection_count+1:1,last_collection_created_at:new Date().toISOString()})}b({title:"Success",type:"success"}),m&&m()},onError:()=>{b({title:"Error",body:"There was an error saving your collection.",type:"error"})}});return(0,r.jsxs)("div",{className:"px-4 sm:mx-auto sm:w-screen sm:max-w-sm lg:px-0",children:[(0,r.jsxs)("h2",{className:"mb-2 text-xl font-medium",children:[u?"Edit":"New"," Collection"]}),(0,r.jsx)("form",{onSubmit:k,className:"mt-4",children:(0,r.jsxs)("fieldset",{disabled:"loading"===C,className:"space-y-4 duration-200 disabled:animate-pulse",children:[(0,r.jsxs)("label",{className:"label",children:["Name",(0,r.jsx)("input",{type:"text",className:"input",name:"name",placeholder:"Collection name",value:f.name,onChange:y})]}),(0,r.jsxs)("label",{className:"label",children:["Description",(0,r.jsx)(d.ZP,{value:f.description,onChange:e=>{w({...f,description:e})},placeholder:"Description"})]}),(0,r.jsxs)("div",{className:"flex gap-x-3",children:[(0,r.jsx)("button",{type:"submit",className:"btn",children:"loading"===C?"Saving...":"Save"}),(0,r.jsx)("button",{onClick:()=>{m&&m()},type:"button",className:"btn-secondary",children:"Cancel"})]})]})})]})}},26028:function(e,t,l){l.d(t,{Z:function(){return Share_ShareCollectionForm}});var r=l(85893),a=l(335),n=l(65242),i=l(67294);let s=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"}))});var o=l(88767),d=l(45827),u=l(81207),m=l(56896),h=l(64343),Share_CopyCollectionLink=e=>{let{collectionId:t}=e,[l,a]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e;return l&&(e=setTimeout(()=>{a(!1)},2e3)),()=>{e&&clearTimeout(e)}},[l]),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsxs)("div",{className:"border-r-none overflow-hidden rounded-l-md border border-gray-300 bg-gray-200/60 px-2 py-1 text-sm text-gray-800 line-clamp-1",children:["https://www.swipewell.app","/collections/",t]}),(0,r.jsx)("button",{onClick:()=>{navigator.clipboard.writeText("".concat("https://www.swipewell.app","/collections/").concat(t)),a(!0)},className:"btn-outline flex h-auto min-w-[105px] flex-shrink-0 items-center justify-center rounded-l-none border-l-0 py-1 text-sm",children:l?(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{children:"Copied"}),(0,r.jsx)(h.Z,{className:"ml-1 h-4 w-4 text-green-600","aria-hidden":"true"})]}):"Copy link"})]})};let generateSnippet=(e,t)=>'\n<iframe height="500" style="width: 100%;" title="'.concat(null!=t?t:"SwipeWell Collection",'" src="').concat(e,'" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">\n  See this ').concat(t?"collection":"",' <a href="').concat(e,'">').concat(null!=t?t:"collection",'</a>\n  on <a href="https://www.swipewell.app">SwipeWell</a>.\n</iframe>\n');var Share_EmbedCollection=e=>{let{collectionId:t,name:l}=e,[a,n]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e;return a&&(e=setTimeout(()=>{n(!1)},2e3)),()=>{e&&clearTimeout(e)}},[a]);let s="".concat("https://www.swipewell.app","/collections/").concat(t),o=generateSnippet(s,l);return(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"border-r-none overflow-hidden rounded-l-md border border-gray-300 bg-gray-200/60 px-2 py-1 text-sm text-gray-800 line-clamp-1",children:o}),(0,r.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(o),n(!0)},className:"btn-outline flex h-auto min-w-[105px] flex-shrink-0 items-center justify-center rounded-l-none border-l-0 py-1 text-sm",children:a?(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{children:"Copied"}),(0,r.jsx)(h.Z,{className:"ml-1 h-4 w-4 text-green-600","aria-hidden":"true"})]}):"Copy code"})]})};let p=i.forwardRef(function(e,t){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"}))});var v=l(13902),g=l(17378),Share_LogoUpload=e=>{let{value:t,onChange:l,disabled:a}=e,{teamId:n}=(0,d.kP)(),[s,o]=(0,i.useState)(!1),[u,m]=(0,i.useState)(null),[h,x]=(0,i.useState)(!1),b=(0,i.useRef)(null),validateFile=e=>e.type.startsWith("image/")?e.size>5242880?"File size must be less than 5MB":null:"Please select an image file",uploadFile=async e=>{if(!n){m("Unable to upload: not logged in");return}let t=validateFile(e);
1if(t){m(t);return}o(!0),m(null);try{let t=await (0,g.createImage)(e,"logo_".concat(e.name),n);(null==t?void 0:t.publicURL)?l(t.publicURL):m("Failed to upload image")}catch(e){console.error("Upload error:",e),m("Failed to upload image")}finally{o(!1)}},f=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),x(!0)},[]),y=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),x(!1)},[]),w=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),j=(0,i.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),x(!1),a||s)return;let t=Array.from(e.dataTransfer.files);t.length>0&&uploadFile(t[0])},[a,s,n]),N=(0,i.useCallback)(e=>{let t=e.target.files;t&&t.length>0&&uploadFile(t[0]),b.current&&(b.current.value="")},[]);return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"share-logo",className:"label mb-1",children:"Logo"}),(0,r.jsx)("input",{type:"url",id:"share-logo",className:"input mb-3",placeholder:"https://example.com/logo.png",value:t,onChange:e=>l(e.target.value),disabled:a||s}),(0,r.jsxs)("div",{className:"\n          relative border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors\n          ".concat(h?"border-blue-400 bg-blue-50":"border-gray-300 hover:border-gray-400","\n          ").concat(a||s?"opacity-50 cursor-not-allowed":"","\n        "),onDragEnter:f,onDragLeave:y,onDragOver:w,onDrop:j,onClick:()=>{if(!a&&!s){var e;null===(e=b.current)||void 0===e||e.click()}},children:[(0,r.jsx)("input",{ref:b,type:"file",accept:"image/*",onChange:N,className:"hidden",disabled:a||s}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(p,{className:"mx-auto h-12 w-12 text-gray-400"}),s?(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Uploading..."}),(0,r.jsx)("div",{className:"mt-2 w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full animate-pulse w-1/2"})})]}):(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Drop an image here, or click to select"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"PNG, JPG, GIF up to 5MB"})]})]})]}),u&&(0,r.jsxs)("div",{className:"mt-2 flex items-center text-sm text-red-600",children:[(0,r.jsx)(v.Z,{className:"h-4 w-4 mr-1"}),u]}),t&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:"Preview:"}),(0,r.jsx)("img",{src:t,alt:"Logo preview",className:"h-12 w-auto rounded border",onError:e=>{e.currentTarget.style.display="none"}})]})]})},x=l(59272),b=l(3948),f=l(5506);let useCreateCollectionShareRecipient=(e,t)=>{let l=(0,o.useQueryClient)();return(0,o.useMutation)(async l=>{let r=await fetch("/api/teams/".concat(e,"/collections/").concat(t,"/share-recipients"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(l)});return await r.json()},{onSuccess:()=>{l.invalidateQueries(u.U.collections(e))}})},useDeleteCollectionShareRecipient=(e,t)=>{let l=(0,o.useQueryClient)(),{addToast:r}=(0,m.pm)();return(0,o.useMutation)(async l=>{let r=await fetch("/api/teams/".concat(e,"/collections/").concat(t,"/share-recipients/").concat(l),{method:"DELETE"});return await r.json()},{onSuccess:t=>{if(t.error){r({title:"Unable to delete share recipient",type:"error"});return}l.invalidateQueries(u.U.collections(e)),r({title:"Deleted",type:"success"})},onError:()=>{r({title:"Unable to delete share recipient",type:"error"})}})},getColorForEmail=e=>{let t=["bg-primary-500","bg-red-500","bg-green-500","bg-purple-500","bg-yellow-500","bg-cyan-500","bg-indigo-500","bg-orange-500","bg-teal-500"],l=(0,b.R)(e.toLowerCase()),r=Math.abs(l%t.length);return t[r]},ShareRecipientRow=e=>{let{teamId:t,collectionId:l,collection_share_recipient_id:a,recipient_email:n,role:i}=e,s=useDeleteCollectionShareRecipient(t,l);return(0,r.jsxs)("div",{className:(0,x.Z)("group/row relative -mx-2 -my-1 flex items-center rounded-full px-2 py-1 hover:bg-gray-100","loading"===s.status?"animate-pulse opacity-80":""),children:[(0,r.jsx)("div",{className:(0,x.Z)("mr-2 flex h-9 w-9 items-center justify-center rounded-full",getColorForEmail(n)),children:(0,r.jsx)("div",{className:"mr-[-2px] text-sm font-medium uppercase tracking-widest text-white",children:n.slice(0,2)})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-medium text-gray-900",children:n}),(0,r.jsx)("div",{className:"text-xs capitalize text-gray-600",children:i})]}),(0,r.jsxs)("button",{onClick:()=>{s.mutate(a)},disabled:"loading"===s.status,className:"group/btn absolute right-3 rounded-full p-1 opacity-0 hover:bg-gray-200 focus-visible:opacity-100 group-hover/row:opacity-100",children:[(0,r.jsx)(f.Z,{className:"h-5 w-5 text-gray-500 group-hover/btn:text-gray-900","aria-hidden":"true"}),(0,r.jsx)("span",{className:"sr-only",children:"Remove access"})]})]})};var y=l(67792),Share_ShareCollectionForm=e=>{var t,l,h,p;let{collection:v}=e,{teamId:g,session:x}=(0,d.kP)(),{addToast:b}=(0,m.pm)(),[f,w]=(0,i.useState)(""),j=useCreateCollectionShareRecipient(null!=g?g:"",null!==(l=null==v?void 0:v.collection_id)&&void 0!==l?l:""),[N,C]=(0,i.useState)((null==v?void 0:v.name)||""),[k,S]=(0,i.useState)((null==v?void 0:v.description)||""),[_,E]=(0,i.useState)((null==v?void 0:v.share_logo_url)||""),[T,L]=(0,i.useState)((null==v?void 0:v.share_creator)||""),[P,R]=(0,i.useState)((null==v?void 0:v.share_creator_description)||""),[D,U]=(0,i.useState)((null==v?void 0:v.share_creator_link)||""),handleCreateShareRecipient=async e=>{e.preventDefault();try{var t;if(!f)throw Error("Please enter a valid email address.");
1if(f===(null==x?void 0:null===(t=x.user)||void 0===t?void 0:t.email))throw Error("You cannot share with your own email address.");if((null==v?void 0:v.shareRecipients)&&-1!==v.shareRecipients.findIndex(e=>e.recipient_email===f))throw Error("Already shared with this email.");await j.mutate({recipient_email:f,role:"viewer"}),"success"===j.status&&w("")}catch(e){b({title:e.message,type:"error"})}},[F,M]=(0,i.useState)((null==v?void 0:v.visibility)==="public"),I=(0,o.useQueryClient)(),O=(0,o.useMutation)(async e=>{let{isPublic:t}=e;if(!g||!v)throw Error("Unable to edit collection.");let{shareRecipients:l,...r}=v,a={...r,name:N,description:k,visibility:t?"public":"private",share_logo_url:_,share_creator:T,share_creator_description:P,share_creator_link:D},n=await fetch("/api/teams/".concat(g,"/collections/").concat(v.collection_id),{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({collection:a})});return n.json()},{onSuccess:(e,t)=>{if(e.error){b({title:"Error",body:"There was an error saving your changes.",type:"error"});return}M(t.isPublic),I.invalidateQueries(u.U.collections(null!=g?g:""))},onError:()=>{b({title:"Error",body:"There was an error saving your changes.",type:"error"})}}),z=(0,o.useMutation)(async()=>{if(!g||!v)throw Error("Unable to update collection.");let{shareRecipients:e,...t}=v,l={...t,name:N,description:k,share_logo_url:_,share_creator:T,share_creator_description:P,share_creator_link:D},r=await fetch("/api/teams/".concat(g,"/collections/").concat(v.collection_id),{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({collection:l})});return r.json()},{onSuccess:e=>{if(e.error){b({title:"Error",body:e.error,type:"error"});return}b({title:"Saved",body:"Collection updated successfully.",type:"success"}),I.invalidateQueries(u.U.collections(null!=g?g:""))},onError:e=>{b({title:"Error",body:(null==e?void 0:e.message)||"There was an error saving your changes.",type:"error"})}}),[A,Z]=(0,i.useState)(!1),B=(0,y.Af)(g,null==x?void 0:null===(t=x.user)||void 0===t?void 0:t.id),Q=!B.isBlockedByPaywall,getIsPublicViewer=()=>{var e,t;if(Q||g&&(null==v?void 0:v.team_id)&&g===v.team_id)return!1;if((null==v?void 0:v.visibility)==="public"&&g!==(null==v?void 0:v.team_id))return!0;if(v&&(null==x?void 0:null===(e=x.user)||void 0===e?void 0:e.email)){let e=null===(t=v.shareRecipients)||void 0===t?void 0:t.find(e=>{var t;return e.recipient_email===(null===(t=x.user)||void 0===t?void 0:t.email)});if((null==e?void 0:e.role)==="viewer")return!0}return!1};return(0,i.useEffect)(()=>{let e=getIsPublicViewer();e!==A&&Z(e)},[v,x]),(0,r.jsxs)("div",{className:"mx-auto px-4 sm:w-screen sm:max-w-5xl lg:px-0",children:[(0,r.jsxs)("h2",{className:"mb-4 text-xl font-medium text-gray-900 line-clamp-1",children:["Share ",(null==v?void 0:v.name)?'"'.concat(v.name,'"'):"Collection"]}),(0,r.jsx)("div",{className:"pb-4",children:A?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4",children:[(0,r.jsx)("h3",{className:"text-base font-medium text-gray-900 mb-3",children:"Collection Details"}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"collection-name",className:"label mb-1",children:"Title"}),(0,r.jsx)("input",{type:"text",id:"collection-name",className:"input",placeholder:"Collection title",value:N,onChange:e=>C(e.target.value),maxLength:100})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"collection-description",className:"label mb-1",children:"Description"}),(0,r.jsx)("textarea",{id:"collection-description",className:"input",placeholder:"Describe this collection",value:k||"",onChange:e=>S(e.target.value),maxLength:500,rows:3})]})]})]}),(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4",children:[(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"text-base font-medium text-gray-900 mb-3",children:"Share via email"}),(0,r.jsx)("form",{onSubmit:handleCreateShareRecipient,className:"mt-2",children:(0,r.jsxs)("fieldset",{disabled:"loading"===j.status,className:"flex items-center space-x-2 disabled:opacity-50",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("label",{htmlFor:"email",className:"sr-only",children:"Email"}),(0,r.jsx)("input",{type:"email",className:"input",id:"email",name:"email",placeholder:"Add an email",value:f,onChange:e=>w(e.currentTarget.value),required:!0})]}),(0,r.jsx)("button",{type:"submit",className:"btn",children:"Invite"})]})})]}),(null==v?void 0:v.shareRecipients)&&v.shareRecipients.length>0?(0,r.jsx)("div",{className:"-mx-2 mt-3 space-y-3 px-2",children:v.shareRecipients.map((e,t)=>{var l;return(0,r.jsx)(ShareRecipientRow,{...e,teamId:null!=g?g:"",collectionId:null!==(l=null==v?void 0:v.collection_id)&&void 0!==l?l:""},e.recipient_email+t.toString())})}):null]}),(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4",children:[(0,r.jsx)("h3",{className:"text-base font-medium text-gray-900 mb-3",children:"General visibility"}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsxs)(a.r,{checked:F,onChange:e=>{O.mutate({isPublic:e})},disabled:O.isLoading,className:"flex w-full items-center gap-3 rounded disabled:animate-pulse disabled:opacity-80",children:[(0,r.jsx)("div",{children:F?(0,r.jsx)(n.Z,{className:"h-10 w-10 rounded-full bg-green-100 p-2 text-green-700","aria-hidden":"true"}):(0,r.jsx)(s,{className:"h-10 w-10 rounded-full bg-gray-100 p-2 text-gray-700","aria-hidden":"true"})}),(0,r.jsxs)("div",{className:"flex-grow text-left",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-gray-900",children:F?"Public":"Private"}),(0,r.jsx)("div",{className:"text-sm text-gray-600",children:F?"Anyone with the link can view":"Only you can view"})]}),(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"".concat(F?"bg-primary-500":"bg-gray-300"," relative inline-flex h-6 w-11 items-center rounded-full"),children:[(0,r.jsx)("span",{className:"sr-only",children:"Enable public viewing"}),(0,r.jsx)("span",{className:"".concat(F?"translate-x-6":"translate-x-1"," inline-block h-4 w-4 transform rounded-full bg-white transition")})]})})]})}),(F||(null==v?void 0:v.shareRecipients)&&v.shareRecipients.length>0)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)("h4",{className:"label mb-1",children:"Link"}),(0,r.jsx)(Share_CopyCollectionLink,{collectionId:null!==(h=null==v?void 0:v.collection_id)&&void 0!==h?h:""})]}),!A&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("h4",{className:"label mb-1",children:"Embed"}),(0,r.jsx)(Share_EmbedCollection,{collectionId:null!==(p=null==v?void 0:v.collection_id)&&void 0!==p?p:"",name:null==v?void 0:v.name})]})]})]})]}),(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4 h-fit",children:[(0,r.jsx)("h3",{className:"text-base font-medium text-gray-900 mb-2",children:"Custom Branding"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Add your branding to public shared collections"}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(Share_LogoUpload,{value:_,onCh
1ange:E,disabled:z.isLoading}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"share-creator",className:"label mb-1",children:"Creator"}),(0,r.jsx)("input",{type:"text",id:"share-creator",className:"input",placeholder:"Your name or company",value:T,onChange:e=>L(e.target.value),maxLength:100})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"share-creator-link",className:"label mb-1",children:"Creator Link"}),(0,r.jsx)("input",{type:"url",id:"share-creator-link",className:"input",placeholder:"https://yourwebsite.com",value:D,onChange:e=>U(e.target.value),maxLength:200})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"share-creator-description",className:"label mb-1",children:"Creator Description"}),(0,r.jsx)("textarea",{id:"share-creator-description",className:"input",placeholder:"Brief description about yourself or your company",value:P,onChange:e=>R(e.target.value),maxLength:500,rows:3}),(0,r.jsxs)("div",{className:"mt-1 text-sm text-gray-500",children:[P.length,"/500 characters"]})]})]})]})]}),(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsx)("button",{type:"button",onClick:()=>z.mutate(),disabled:z.isLoading,className:"btn btn-primary w-full",children:z.isLoading?"Saving...":"Save Changes"})})]})})]})}},335:function(e,t,l){l.d(t,{r:function(){return f}});var r=l(67294),a=l(12351),n=l(19946),i=l(61363),s=l(64103),o=l(16723),d=l(23784),u=l(73781);let m=(0,r.createContext)(null),h=(0,a.yV)(function(e,t){let{passive:l=!1,...i}=e,s=function c(){let e=(0,r.useContext)(m);if(null===e){let e=Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,c),e}return e}(),u=`headlessui-label-${(0,n.M)()}`,h=(0,d.T)(t);(0,o.e)(()=>s.register(u),[u,s.register]);let p={ref:h,...s.props,id:u};return l&&("onClick"in p&&delete p.onClick,"onClick"in i&&delete i.onClick),(0,a.sY)({ourProps:p,theirProps:i,slot:s.slot||{},defaultTag:"label",name:s.name||"Label"})});var p=l(39516),v=l(14157),g=l(46045);let x=(0,r.createContext)(null);x.displayName="GroupContext";let b=r.Fragment,f=Object.assign((0,a.yV)(function(e,t){let{checked:l,defaultChecked:o=!1,onChange:m,name:h,value:p,...b}=e,f=`headlessui-switch-${(0,n.M)()}`,y=(0,r.useContext)(x),w=(0,r.useRef)(null),j=(0,d.T)(w,t,null===y?null:y.setSwitch),[N,C]=function(e,t,l){let[a,n]=(0,r.useState)(l),i=void 0!==e,s=(0,r.useRef)(i),o=(0,r.useRef)(!1),d=(0,r.useRef)(!1);
1return!i||s.current||o.current?i||!s.current||d.current||(d.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(o.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[i?e:a,(0,u.z)(e=>(i||n(e),null==t?void 0:t(e)))]}(l,m,o),k=(0,u.z)(()=>null==C?void 0:C(!N)),S=(0,u.z)(e=>{if((0,s.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),k()}),_=(0,u.z)(e=>{e.key===i.R.Space?(e.preventDefault(),k()):e.key===i.R.Enter&&function(e){var t;let l=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(l){for(let e of l.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type){e.click();return}}}(e.currentTarget)}),E=(0,u.z)(e=>e.preventDefault()),T=(0,r.useMemo)(()=>({checked:N}),[N]),L={id:f,ref:j,role:"switch",type:(0,v.f)(e,w),tabIndex:0,"aria-checked":N,"aria-labelledby":null==y?void 0:y.labelledby,"aria-describedby":null==y?void 0:y.describedby,onClick:S,onKeyUp:_,onKeyPress:E};return r.createElement(r.Fragment,null,null!=h&&N&&r.createElement(g._,{features:g.A.Hidden,...(0,a.oA)({as:"input",type:"checkbox",hidden:!0,readOnly:!0,checked:N,name:h,value:p})}),(0,a.sY)({ourProps:L,theirProps:b,slot:T,defaultTag:"button",name:"Switch"}))}),{Group:function(e){let[t,l]=(0,r.useState)(null),[n,i]=function(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)(()=>function(e){let l=(0,u.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let l=t.slice(),r=l.indexOf(e);return -1!==r&&l.splice(r,1),l}))),a=(0,r.useMemo)(()=>({register:l,slot:e.slot,name:e.name,props:e.props}),[l,e.slot,e.name,e.props]);return r.createElement(m.Provider,{value:a},e.children)},[t])]}(),[s,o]=(0,p.f)(),d=(0,r.useMemo)(()=>({switch:t,setSwitch:l,labelledby:n,describedby:s}),[t,l,n,s]);return r.createElement(o,{name:"Switch.Description"},r.createElement(i,{name:"Switch.Label",props:{onClick(){t&&(t.click(),t.focus({preventScroll:!0}))}}},r.createElement(x.Provider,{value:d},(0,a.sY)({ourProps:{},theirProps:e,defaultTag:b,name:"Switch.Group"}))))},Label:h,Description:p.d})},13902:function(e,t,l){var r=l(67294);let a=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},65242:function(e,t,l){var r=l(67294);let a=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},37051:function(e,t,l){var r=l(67294);let a=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});t.Z=a},20839:function(e,t,l){var r=l(67294);let a=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.3
116m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"}))});t.Z=a}}]);

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.