PageSourceSearch

https://51wan.ai/_next/static/chunks/2362.4d8c66cffd378464.js

js 51wan.ai collected 2026-10-05 13:35:18 UTC 14,331 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2362],{52362:(e,t,l)=>{l.r(t),l.d(t,{default:()=>C});var a=l(37876),r=l(14232),n=l(97445);let i=r.forwardRef(function(e,t){let{title:l,titleId:a,...n}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},n),l?r.createElement("title",{id:a},l):null,r.createElement("path",{fillRule:"evenodd",d:"M1.5 6a2.25 2.25 0 0 1 2.25-2.25h16.5A2.25 2.25 0 0 1 22.5 6v12a2.25 2.25 0 0 1-2.25 2.25H3.75A2.25 2.25 0 0 1 1.5 18V6ZM3 16.06V18c0 .414.336.75.75.75h16.5A.75.75 0 0 0 21 18v-1.94l-2.69-2.689a1.5 1.5 0 0 0-2.12 0l-.88.879.97.97a.75.75 0 1 1-1.06 1.06l-5.16-5.159a1.5 1.5 0 0 0-2.12 0L3 16.061Zm10.125-7.81a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Z",clipRule:"evenodd"}))});var s=l(29757);let o=r.forwardRef(function(e,t){let{title:l,titleId:a,...n}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},n),l?r.createElement("title",{id:a},l):null,r.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}),c=r.forwardRef(function(e,t){let{title:l,titleId:a,...n}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},n),l?r.createElement("title",{id:a},l):null,r.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6 6 0 0 0-5.98 6.496A5.25 5.25 0 0 0 6.75 20.25H18a4.5 4.5 0 0 0 2.206-8.423 3.75 3.75 0 0 0-4.133-4.303A6.001 6.001 0 0 0 10.5 3.75Zm2.03 5.47a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72v4.94a.75.75 0 0 0 1.5 0v-4.94l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3Z",clipRule:"evenodd"}))});var d=l(90662);let u=r.forwardRef(function(e,t){let{title:l,titleId:a,...n}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},n),l?r.createElement("title",{id:a},l):null,r.createElement("path",{fillRule:"evenodd",d:"M7.5 6v.75H5.513c-.96 0-1.764.724-1.865 1.679l-1.263 12A1.875 1.875 0 0 0 4.25 22.5h15.5a1.875 1.875 0 0 0 1.865-2.071l-1.263-12a1.875 1.875 0 0 0-1.865-1.679H16.5V6a4.5 4.5 0 1 0-9 0ZM12 3a3 3 0 0 0-3 3v.75h6V6a3 3 0 0 0-3-3Zm-3 8.25a3 3 0 1 0 6 0v-.75a.75.75 0 0 1 1.5 0v.75a4.5 4.5 0 1 1-9 0v-.75a.75.75 0 0 1 1.5 0v.75Z",clipRule:"evenodd"}))});var m=l(8598),x=l(3631),p=l(77497),b=l(22951),g=l(8327),v=l(43013);let f="!z-[10050]";function h(e){if(!(null==e?void 0:e.trim()))return"";if(/^(https?:|data:)/i.test(e))return e;let t=(0,g.W4)().replace(/\/$/,""),l=e.startsWith("/")?e:`/${e}`;return`${t}${l}`}let y=["from-rose-400 to-pink-600","from-amber-400 to-orange-600","from-emerald-400 to-teal-600","from-sky-400 to-blue-600","from-violet-400 to-purple-600","from-fuchsia-400 to-rose-600"];function j(e){let t=0;for(let l=0;l<e.length;l+=1)t=31*t+e.charCodeAt(l)>>>0;return y[t%y.length]}function w(e){let{item:t,selected:l,onSelect:r,displayLabel:n}=e,o=l?"ring-2 ring-v2-accent-primary":"ring-1 ring-v2-border-primary hover:ring-v2-border-secondary";return(0,a.jsxs)("button",{type:"button",onClick:r,"aria-pressed":l,className:`group relative aspect-[3/4] w-full overflow-hidden rounded-xl bg-v2-bg-secondary text-left transition ${o}`,children:[t.image?(0,a.jsx)("img",{src:h(t.image),alt:n,className:"absolute inset-0 h-full w-full object-cover transition-transform duration-150 group-hover:scale-105",loading:"lazy"}):(0,a.jsx)("div",{className:`absolute inset-0 flex items-center justify-center bg-gradient-to-br ${j(t.id)}`,children:(0,a.jsx)(i,{className:"h-7 w-7 text-white/70","aria-hidden":!0})}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/85 via-black/35 to-transparent px-1.5 pb-1.5 pt-4",children:(0,a.jsx)("span",{className:"line-clamp-2 text-[11px] font-medium leading-tight text-white drop-shadow-sm",children:n})}),l?(0,a.jsx)("span",{className:"absolute right-1.5 top-1.5 inline-flex h-5 w-5 items-center justify-center rounded-full bg-v2-accent-primary shadow-sm",children:(0,a.jsx)(s.A,{className:"h-3 w-3 text-v2-text-inverse","aria-hidden":!0})}):null]})}function N(e){let{upload:t}=e,l=(0,r.useRef)(null),[n,i]=(0,r.useState)(!1),s=t.value.trim(),d=s.startsWith("data:image")||/^https?:\/\//i.test(s),u=s.length>0,m=()=>i(!0),x=(0,a.jsx)("input",{ref:l,type:"file",accept:t.accept,className:"sr-only",onChange:e=>{var l;let a=null==(l=e.target.files)?void 0:l[0];e.target.value="",a&&(t.onSelectFile(a),i(!1))}}),p=(0,a.jsx)(v.h,{open:n,onOpenChange:i,onRequestNativeUpload:()=>{var e;return null==(e=l.current)?void 0:e.click()},onSelect:t.onSelectExisting});return u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:m,className:"group relative aspect-square w-full overflow-hidden rounded-2xl bg-v2-bg-secondary text-left ring-1 ring-v2-border-primary transition hover:ring-v2-border-secondary",children:[x,d?(0,a.jsx)("img",{src:s,alt:t.label,className:"absolute inset-0 h-full w-full object-cover"}):(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-v2-bg-tertiary",children:(0,a.jsx)("span",{className:"text-xs text-v2-text-secondary",children:t.label})}),(0,a.jsx)("span",{role:"button",tabIndex:0,"aria-label":t.removeAria,onClick:e=>{e.stopPropagation(),t.onRemove()},onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),e.preventDefault(),t.onRemove())},className:"absolute right-1.5 top-1.5 inline-flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white transition hover:bg-black/75",children:(0,a.jsx)(o,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}),p]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:m,className:"flex aspect-square w-full flex-col items-center justify-center gap-2 rounded-2xl bg-v2-bg-secondary text-center ring-1 ring-v2-border-primary transition hover:bg-v2-bg-hover hover:ring-v2-border-secondary",children:[x,(0,a.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-v2-bg-tertiary text-v2-text-tertiary",children:(0,a.jsx)(c,{className:"h-6 w-6","aria-hidden":!0})}),(0,a.jsx)("span",{className:"text-sm font-semibold text-v2-text-primary",children:t.label}),(0,a.jsx)("span",{className:"text-xs text-v2-text-tertiary",children:t.hint})]}),p]})}function k(e){let{icon:t,title:l,optionalLabel:r,selectedItem:n,selectedLabel:i,onOpen:s,onClear:c,clearAria:d}=e;return n?(0,a.jsxs)("button",{type:"button",onClick:s,className:"group relative aspect-square w-full overflow-hidden rounded-2xl bg-v2-bg-secondary text-left ring-1 ring-v2-border-primary transition hover:ring-v2-border-secondary",children:[n.image?(0,a.jsx)("img",{src:h(n.image),alt:i,className:"absolute inset-0 h-full w-full object-cover",loading:"lazy"}):(0,a.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${j(n.id)}`}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/85 via-black/30 to-transparent px-2.5 pb-2 pt-6",children:(0,a.jsx)("span",{className:"line-clamp-1 text-xs font-semibold text-white drop-shadow-sm",children:i})}),(0,a.jsx)("span",{role:"button",tabIndex:0,"aria-label":d,onClick:e=>{e.stopPropagation(),c()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),e.preventDefault(),c())},className:"absolute right-1.5 top-1.5 inline-flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white transition hover:bg-black/75",children:(0,a.jsx)(o,{className:"h-3.5 w-3.5","aria-hidden":!0})})]}):(0,a.jsxs)("button",{type:"button",onClick:s,className:"flex aspect-square w-full flex-col items-center justify-center gap-2 rounded-2xl bg-v2-bg-secondary text-center ring-1 ring-v2-border-primary transition hover:bg-v2-bg-hover hover:ring-v2-border-secondary",children:[(0,a.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-v2-bg-tertiary text-v2-text-tertiary",children:t}),(0,a.jsx)("span",{className:"text-sm font-semibold text-v2-text-primary",children:l}),(0,a.jsx)("span",{className:"text-xs text-v2-text-tertiary",children:r})]})}function C(e){var t,l;let{onSelectionChange:s,upload:o,mediaMode:c="image",presetStyle:g="Anime",initialSelectionIds:v}=e,{t:h,i18n:y}=(0,n.Bd)("toolsDetail"),{isMobile:j}=(0,p.X)(),[w,C]=(0,r.useState)(null),[E,S]=(0,r.useState)(!1),L="Female",[R,F]=(0,r.useState)("all"),[$,O]=(0,r.useState)(null),[I,Z]=(0,r.useState)(null),[B,H]=(0,r.useState)(null),[M,P]=(0,r.useState)(null),T=y.language,q="video"===c?"videoAction":"pose",V=(0,r.useRef)(!1),D=e=>{F("all"),P(e)};if((0,r.useEffect)(()=>{let e=!1;return(0,b.tW)().then(t=>{e||C(t)}).catch(t=>{console.error("[CharacterEditPresetPicker] load catalog failed:",t),e||S(!0)}),()=>{e=!0}},[]),(0,r.useEffect)(()=>{if(!w||!v||V.current)return;V.current=!0;let e=(e,t)=>t?(0,b.lr)(w,e,g,L).find(e=>e.id===t)??null:null,t=e(q,v.pose),l=e("outfit",v.outfit),a=e("background",v.background);t&&O(t),l&&H(l),a&&Z(a)},[w,v,g,L,q]),(0,r.useEffect)(()=>{null==s||s({pose:$,outfit:B,background:I})},[$,I,B,s]),E)return(0,a.jsx)("div",{className:"mb-6 rounded-xl border border-v2-border-primary bg-v2-bg-secondary px-4 py-3 text-sm text-v2-text-secondary",children:h("presetPickerLoadFailed")});if(!w)return(0,a.jsx)("div",{className:"mb-6 grid grid-cols-2 gap-3",children:Array.from({length:4}).map((e,t)=>(0,a.jsx)("div",{className:"aspect-square animate-pulse rounded-2xl bg-v2-bg-secondary"},t))});let W={pose:h("presetSectionPose"),videoAction:h("presetSectionVideoAction"),background:h("presetSectionBackgroun
1d"),outfit:h("presetSectionOutfit")},_={pose:$,videoAction:$,background:I,outfit:B},z={pose:O,videoAction:O,background:Z,outfit:H},K=M?(0,b.lr)(w,M,g,L):[],U=(0,b.U3)(K,R),G=M?[{id:"all",label:h("presetTagAll")},{id:"Community",label:h("presetTagCommunity")},...(0,b.aW)(w,M).map(e=>({id:e,label:(0,b.i$)(e,T)}))]:[];return(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsx)(N,{upload:o}),(0,a.jsx)(k,{icon:(0,a.jsx)(d.A,{className:"h-6 w-6","aria-hidden":!0}),title:W[q],optionalLabel:h("presetOptionalHint"),selectedItem:$,selectedLabel:$?(0,b.s$)($,T):"",onOpen:()=>D(q),onClear:()=>O(null),clearAria:h("presetClearSelection")}),(0,a.jsx)(k,{icon:(0,a.jsx)(u,{className:"h-6 w-6","aria-hidden":!0}),title:W.outfit,optionalLabel:h("presetOptionalHint"),selectedItem:B,selectedLabel:B?(0,b.s$)(B,T):"",onOpen:()=>D("outfit"),onClear:()=>H(null),clearAria:h("presetClearSelection")}),(0,a.jsx)(k,{icon:(0,a.jsx)(i,{className:"h-6 w-6","aria-hidden":!0}),title:W.background,optionalLabel:h("presetOptionalHint"),selectedItem:I,selectedLabel:I?(0,b.s$)(I,T):"",onOpen:()=>D("background"),onClear:()=>Z(null),clearAria:h("presetClearSelection")})]}),M?j?(0,a.jsx)(x.default,{open:!0,onClose:()=>P(null),title:W[M],showCloseButton:!0,closeAriaLabel:h("common:close",{defaultValue:"关闭"}),overlayClassName:f,sheetClassName:f,height:"min(88dvh, 720px)",maxHeight:"min(88dvh, 720px)",contentClassName:"flex flex-col overflow-hidden px-4 pb-[max(1rem,env(safe-area-inset-bottom))]",children:(0,a.jsx)(A,{categoryTabs:G,tagFilter:R,onTagFilterChange:F,tagFilterAriaLabel:h("presetTagFilterLabel"),filteredItems:U,emptyLabel:h("presetEmptyFilter"),presetStyle:g,lang:T,selectedId:null==(t=_[M])?void 0:t.id,onSelectItem:e=>{let t=_[M];z[M]((null==t?void 0:t.id)===e.id?null:e),P(null)},className:"flex min-h-0 flex-1 flex-col"})}):(0,a.jsx)(m.lG,{open:!0,onOpenChange:e=>!e&&P(null),children:(0,a.jsxs)(m.Cf,{className:"flex h-[min(88dvh,720px)] w-[96vw] max-w-[calc(100%-2rem)] flex-col overflow-hidden rounded-2xl border-v2-border-primary bg-v2-bg-card p-5 text-v2-text-primary sm:max-w-3xl",children:[(0,a.jsx)(m.c7,{className:"shrink-0",children:(0,a.jsx)(m.L3,{className:"text-v2-text-primary",children:W[M]})}),(0,a.jsx)(A,{categoryTabs:G,tagFilter:R,onTagFilterChange:F,tagFilterAriaLabel:h("presetTagFilterLabel"),filteredItems:U,emptyLabel:h("presetEmptyFilter"),presetStyle:g,lang:T,selectedId:null==(l=_[M])?void 0:l.id,onSelectItem:e=>{let t=_[M];z[M]((null==t?void 0:t.id)===e.id?null:e),P(null)},className:"mt-3 flex min-h-0 flex-1 flex-col"})]})}):null]})}function A(e){let{categoryTabs:t,tagFilter:l,onTagFilterChange:r,tagFilterAriaLabel:n,filteredItems:i,emptyLabel:s,presetStyle:o,lang:c,selectedId:d,onSelectItem:u,className:m}=e;return(0,a.jsxs)("div",{className:m??"flex min-h-0 flex-1 flex-col",children:[(0,a.jsx)("div",{className:"-mx-1 flex shrink-0 gap-1.5 overflow-x-auto px-1 pb-1",role:"tablist","aria-label":n,children:t.map(e=>{let t=l===e.id;return(0,a.jsx)("button",{type:"button",role:"tab","aria-selected":t,onClick:()=>r(e.id),className:`shrink-0 rounded-full px-3 py-1 text-xs font-medium transition ${t?"bg-v2-bg-tertiary text-v2-text-primary":"bg-v2-bg-secondary text-v2-text-secondary hover:text-v2-text-primary"}`,children:e.label},e.id)})}),(0,a.jsx)("div",{className:"mt-3 min-h-0 flex-1 overflow-y-auto",children:0===i.length?(0,a.jsx)("p",{className:"py-8 text-center text-sm text-v2-text-tertiary",children:s}):(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2.5 sm:grid-cols-4 md:grid-cols-5",children:i.map(e=>(0,a.jsx)(w,{item:e,displayLabel:(0,b.s$)(e,c),selected:d===e.id,onSelect:()=>u(e)},`${o}-${e.id}`))})})]})}},90662:(e,t,l)=>{l.d(t,{A:()=>r});var a=l(14232);let r=a.forwardRef(function(e,t){let{title:l,titleId:r,...n}=e;return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},n),l?a.createElement("title",{id:r},l):null,a.createElement("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z",clipRule:"evenodd"}))})}}]);

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.