23 lines
26 KiB
JavaScript
23 lines
26 KiB
JavaScript
|
|
import{x as E,r,j as e,y as x,ag as h,ah as p,ak as f,z as j,F as ve,v as b,p as D,L as W,X as ze,I as T,D as Be,A as ye,a as Ue,u as He,o as $e,n as Ge,ai as Y,B as ge,T as Ye,q as l,aS as K,M as Ke,al as Q,C as Qe,S as Xe,aj as We,w as P}from"./index-CZD3_4lD.js";import{A as Ze}from"./index-DXB3_sFe.js";import{U as Je}from"./upload-B_ploHV0.js";import{B as es}from"./badge-D3Mn__J4.js";import{R as X,a as S}from"./radio-group-BcmHTP2Q.js";import{S as ss,a as as,b as rs,c as ts,d as is}from"./select-Dcsz1esX.js";import{A as fe}from"./arrow-left-DyClWdEf.js";import{I as ns}from"./info-DLVcQf5T.js";import{R as cs}from"./repeat-CjEas7lo.js";import{C as ls}from"./calendar-3jVgdv6R.js";import{G as os}from"./gift-C8Ri1JSk.js";import{M as ds}from"./megaphone-B7uGchyN.js";import"./index-C6sfL5Wv.js";import"./circle-CNf9xg3I.js";import"./chevron-down-DA--jGG2.js";import"./check-CCL32zXH.js";/**
|
||
|
|
* @license lucide-react v0.462.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const ms=E("BadgePercent",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 15h.01",key:"lqbp3k"}]]);/**
|
||
|
|
* @license lucide-react v0.462.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const us=E("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);/**
|
||
|
|
* @license lucide-react v0.462.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const Ne=E("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
|
||
|
|
* @license lucide-react v0.462.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const xs=E("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),hs=({goodExamples:s,onGoodExamplesChange:N})=>{const v=r.useRef(null),g=t=>{if(!t)return;const u=Array.from(t).map(o=>({id:crypto.randomUUID(),file:o,previewUrl:URL.createObjectURL(o),type:"good",caption:""}));N([...s,...u])},i=t=>{const u=s.filter(o=>o.id!==t);N(u)},n=(t,u)=>{const o=s.map(M=>M.id===t?{...M,caption:u}:M);N(o)};return e.jsxs(x,{className:"glass-card",children:[e.jsxs(h,{children:[e.jsxs(p,{className:"flex items-center gap-2",children:[e.jsx(Ne,{className:"w-5 h-5"}),"Example Images"]}),e.jsx(f,{children:"Upload images showing the photographer what good photos look like"})]}),e.jsx(j,{className:"space-y-6",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"w-4 h-4 text-success"}),e.jsx("span",{className:"text-sm font-medium",children:"Good examples"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",s.length,")"]})]}),e.jsxs(b,{type:"button",variant:"outline",size:"sm",onClick:()=>{var t;return(t=v.current)==null?void 0:t.click()},className:"gap-1",children:[e.jsx(Ne,{className:"w-3 h-3"}),"Add"]}),e.jsx("input",{ref:v,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:t=>g(t.target.files)})]}),e.jsx(Ze,{children:s.length>0&&e.jsx(D.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"grid grid-cols-2 gap-3",children:s.map(t=>e.jsxs(D.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"relative rounded-lg overflow-hidden border-2 border-success/30",children:[e.jsxs("div",{className:"aspect-[4/3] relative",children:[e.jsx("img",{src:t.previewUrl,alt:t.caption||"Example image",className:"w-full h-full object-cover"}),t.uploading&&e.jsx("div",{className:"absolute inset-0 bg-background/80 flex items-center justify-center",children:e.jsx(W,{className:"w-6 h-6 animate-spin text-primary"})}),e.jsx(b,{type:"button",variant:"destructive",size:"icon",className:"absolute top-1 right-1 w-6 h-6",onClick:()=>i(t.id),children:e.jsx(ze,{className:"w-3 h-3"})})]}),e.jsx("div",{className:"p-2 bg-background",children:e.jsx(T,{placeholder:"Caption...",value:t.caption,onChange:u=>n(t.id,u.target.value),className:"h-8 text-xs"})})]},t.id))})}),s.length===0&&e.jsxs("div",{onClick:()=>{var t;return(t=v.current)==null?void 0:t.click()},className:"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors hover:border-primary/50 border-success/20",children:[e.jsx(Je,{className:"w-8 h-8 mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to upload good examples"})]})]})})]})},ps=async(s,N,v)=>{const g=[...N.map((i,n)=>({...i,orderIndex:n})),...v.map((i,n)=>({...i,orderIndex:n}))];for(const i of g)if(i.file)try{const n=await Be(i.file,`mission-examples/${s}/${i.type}`);if(!(n!=null&&n.url)){console.error("Upload failed for",i.file.name);continue}await ye("/mission-example-images",{mission_id:s,image_url:n.url,image_type:i.type,caption:i.caption||null,order_index:i.orderIndex})}catch(n){console.error("Failed to upload image:",n)}return!0},qs=()=>{var xe,he,pe,je;const{t:s}=Ue(),N=[{value:"once",label:s("createMission.frequencyOnce"),description:s("createMission.frequencyOnceDesc")},{value:"daily",label:s("createMission.frequencyDaily"),description:s("createMission.frequencyDailyDesc")},{value:"weekly",label:s("createMission.frequencyWeekly"),description:s("createMission.frequencyWeeklyDesc")},{value:"biweekly",label:s("createMission.frequencyBiweekly"),description:s("createMission.frequencyBiweeklyDesc")},{value:"monthly",label:s("createMission.frequencyMonthly"),description:s("createMission.frequencyMonthly
|
||
|
|
//# sourceMappingURL=CreateMission-DTYpAitx.js.map
|